Add hwsync extended mnemonic.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
8086551f
CC
12015-06-03 Cary Coutant <cary@google.com>
2
3 * script-sections.cc (Script_sections::Script_sections): Initialize
4 segments_created_.
5 (Script_sections::create_note_and_tls_segments): Set flag when
6 segments are created.
7 (Script_sections::expected_segment_count): Count PT_INTERP.
8 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
9 segments are created.
10 * script-sections.h (Script_sections::segments_created_): New data
11 member.
12
374082df
CC
132015-06-03 Cary Coutant <ccoutant@gmail.com>
14
15 PR gold/15370
16 * script-sections.cc
17 (Output_section_element_input::set_section_addresses): When there
18 are several patterns with no sort spec, put all sections in the same
19 bin.
20 * testsuite/Makefile.am (script_test_12): New testcase.
21 (script_test_12i): New testcase.
22 * testsuite/Makefile.in: Regenerate.
23 * testsuite/script_test_12.t: New test linker script.
24 * testsuite/script_test_12i.t: New test linker script.
25 * testsuite/script_test_12a.c: New test source file.
26 * testsuite/script_test_12b.c: New test source file.
27
775ed62e
CC
282015-06-02 Cary Coutant <ccoutant@gmail.com>
29
30 * nacl.h (Sniff_file): Switch parameters to get_view to get an
31 aligned view.
32
9c7fe3c5
CC
332015-06-03 Cary Coutant <ccoutant@gmail.com>
34
35 PR gold/17819
36 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
37 separate task to schedule the build id computation.
38 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
39 add Output_file and offset.
40 (Hash_task::run): Get and release the input views.
41 (Hash_task::is_runnable): Always return NULL (always runnable).
42 (Layout::queue_build_id_tasks): Remove.
43 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
44 parameters; use them instead of class members.
45 (Build_id_task_runner::run): New function.
46 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
47 to write_build_id.
48 * layout.h (Layout::queue_build_id_tasks): Remove.
49 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
50 parameters.
51 (Layout::array_of_hashes_): Remove.
52 (Layout::size_of_array_of_hashes_): Remove.
53 (Layout::input_view_): Remove.
54 (Build_id_task_runner): New class.
55 (Close_task_runner::Close_task_runner): Add array_of_hashes and
56 size_of_hashes parameters.
57 (Close_task_runner::array_of_hashes_): New data member.
58 (Close_task_runner::size_of_hashes_): New data member.
59 * testsuite/Makefile.am
60 (flagstest_compress_debug_sections_and_build_id_tree): New test.
61 * testsuite/Makefile.in: Regenerate.
62
400f8944
RÁE
632015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
64
65 * merge.cc (get_input_merge_map): Update for data structure change.
66 (get_or_make_input_merge_map): Update for data structure change.
67 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
68 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
69
bbec1a5d
AM
702015-05-16 Alan Modra <amodra@gmail.com>
71
72 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
73 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
74 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
75 (lis_0): Rename from lis_0_0.
76
efc6fa12
CC
772015-04-29 Cary Coutant <cary@google.com>
78 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
79
80 * gc.h (Garbage_collection::is_section_garbage): Change Object*
81 to Relobj*.
82 (Garbage_collection::add_reference): Likewise.
83 (Garbage_collection::gc_process_relocs): Likewise. Don't push
84 object/shndx pair onto *secvec for dynamic objects. Don't follow
85 relocations pointing to dynamic objects for GC.
86 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
87 (Icf::unfold_section): Likewise.
88 (Icf::is_section_folded): Likewise.
89 (Icf::get_folded_section): Likewise.
90 * icf.h: (Icf::get_folded_section): Likewise.
91 (Icf::unfold_section): Likewise.
92 (Icf::is_section_folded): Likewise.
93 (Icf::section_has_function_pointers): Likewise.
94 (Icf::set_section_has_function_pointers): Likewise.
95 * object.h (Section_id): Likewise.
96 (Const_section_id): Likewise.
97 * output.cc (Output_section::update_section_layout): Likewise.
98 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
99 Likewise.
100 * plugin.cc (update_section_order): Likewise.
101 (unique_segment_for_sections): Likewise.
102 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
103 (Target_powerpc::do_gc_add_reference): Likewise.
104 (Target_powerpc::gc_process_relocs): Likewise.
105 (Target_powerpc::do_gc_add_reference): Likewise.
106 * symtab.cc (Symbol_table::is_section_folded): Likewise.
107 (Symbol_table::gc_mark_symbol): Likewise.
108 * symtab.h: (Symbol_table::is_section_folded): Likewise.
109 * target.h: (Sized_target::gc_add_reference): Likewise.
110 (Sized_target::do_gc_add_reference): Likewise.
111
f9d3ecaa
NC
1122015-04-29 Nick Clifton <nickc@redhat.com>
113
114 * po/fi.po: Updated Finnish translation.
115
faa2211d
AM
1162015-04-28 Alan Modra <amodra@gmail.com>
117
118 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
119 than unsigned int for find_global_entry result temp. Compare
120 against invalid_address.
121 (Target_powerpc::do_plt_address_for_global): Likewise.
122 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
123 on plt call stub existence for debug info. Do assert for plt
124 and global entry stub existence if an alloc section.
125
6ec65f28
AM
1262015-04-28 Alan Modra <amodra@gmail.com>
127
128 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
129 on missing global entry stub due to bogus debug info.
130
7a2a1c79
HS
1312015-04-27 Han Shen <shenhan@google.com>
132
133 * options.h (--fix-cortex-a53-843419): Rename option.
134 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
135 option.
136 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
137
cfbf0e3c
RÁE
1382015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
139
140 PR gold/18327
141 * output.cc (Output_section::is_input_address_mapped): Assume a missing
142 entry is mapped.
143 * testsuite/Makefile.am: Add the eh_test test.
144 * testsuite/Makefile.in: Regenerate.
145 * testsuite/eh_test_a.cc: New test.
146 * testsuite/eh_test_b.cc: New test.
147
6ec65f28
AM
1482015-04-23 Sriraman Tallam <tmsriram@google.com>
149
a100d66f
ST
150 * options.h (--weak-unresolved-symbols): New option.
151 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
152 binding to weak with new option.
153 * symtab.h (is_weak_undefined): Check for new option.
154 (is_strong_undefined): Check for new option.
155 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
156 * testsuite/Makefile.in: Regenerate.
157 * testsuite/weak_unresolved_symbols_test.cc: New file.
158
4b889c30
IC
1592015-04-20 Ian Coolidge <icoolidge@google.com>
160
161 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
162 GNU_UNIQUE.
163
4277535c
RÁE
1642015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
165
166 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
167 push_back.
168 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
169 * object.cc (Sized_relobj_file::do_layout): Use push_back.
170 * powerpc.cc (process_gc_mark): Use push_back.
171 (Target_powerpc::do_gc_mark_symbol): Use push_back.
172 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
173
7a2a1c79 1742015-04-16 Han Shen <shenhan@google.com>
5019d64a 175
6ec65f28
AM
176 * aarch64.cc (AArch64_insn_utilities): New utility class.
177 (AArch64_relobj::Mapping_symbol_position): New struct.
178 (AArch64_relobj::Mapping_symbol_info): New typedef.
179 (AArch64_relobj::do_count_local_symbols): New function overriding
180 parent's implementation.
181 (AArch64_relobj::mapping_symbol_info_): New member
182 (AArch64_relobj::scan_erratum_843419): New method.
183 (Target_aarch64::scan_erratum_843419_span): New method.
184 (Target_aarch64::is_erratum_843419_sequence): New method.
185 * options.h (fix_cortex_a53): New option.
5019d64a 186
a6a17750
CC
1872015-04-09 Cary Coutant <ccoutant@google.com>
188
189 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
190 in a PIE link.
191 * testsuite/Makefile.am (tls_pie_test.sh): New test.
192 * testsuite/Makefile.in: Regenerate.
193 * testsuite/tls_pie_test.sh: New.
194
437ddf0c
CC
1952015-04-09 Cary Coutant <ccoutant@google.com>
196
197 * debug.h (DEBUG_LOCATION): New.
198 (DEBUG_ALL): Include DEBUG_LOCATION.
199 (debug_string_to_enum): Add DEBUG_LOCATION.
200 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
201 output to print correct context.
202 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
203 up to 4 more locations at the beginning of the function.
204 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
205 result before sorting list of line numbers.
206 * testsuite/debug_msg.sh: Allow range of line numbers for
207 canonical results on optimized code.
208
24491327
HS
2092015-04-07 HC Yen <hc.yen@mediatek.com>
210
211 Add AArch32 support for gold linker.
212 gold/
213 * arm.cc: Add V8 arch combine table.
214
7fa5525f
RÁE
2152015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
216
217 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
218
5368dcf2
RÁE
2192015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
220
221 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
222 to find by using the return value of insert.
223
9dbb4b02
RÁE
2242015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
225
226 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
227 constructor call.
228
1fa29f10
IT
2292015-04-06 Ilya Tocar <ilya.tocar@intel.com>
230
231 PR gold/17641
232 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
233 (Target_x86_64::Scan::local): Don't create GOT entry, when we
234 can convert mov to lea.
235 (Target_x86_64::Scan::global): Ditto.
236 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
237 %reg to lea foo(%rip), %reg if possible.
238 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
239 * testsuite/x86_64_mov_to_lea1.s: New.
240 * testsuite/x86_64_mov_to_lea2.s: Ditto.
241 * testsuite/x86_64_mov_to_lea3.s: Ditto.
242 * testsuite/x86_64_mov_to_lea4.s: Ditto.
243 * testsuite/x86_64_mov_to_lea.sh: Ditto.
244
39f3de7c
L
2452015-04-02 H.J. Lu <hongjiu.lu@intel.com>
246
247 * configure: Regenerated.
248
c4fc4724
IT
2492015-04-01 Ilya Tocar <ilya.tocar@intel.com>
250
251 PR gold/17640
252 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
253 (Target_i386::Scan::local): Don't create GOT entry, when we
254 can convert GOT to GOTOFF.
255 (Target_i386::Scan::global): Ditto.
256 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
257 lea foo@GOTOFF(%reg), %reg if possible.
258 * testsuite/Makefile.am (i386_mov_to_lea): New test.
259 * testsuite/i386_mov_to_lea1.s: New.
260 * testsuite/i386_mov_to_lea2.s: Ditto.
261 * testsuite/i386_mov_to_lea3.s: Ditto.
262 * testsuite/i386_mov_to_lea4.s: Ditto.
263 * testsuite/i386_mov_to_lea5.s: Ditto.
264 * testsuite/i386_mov_to_lea.sh: Ditto.
265
918357b9
L
2662015-04-01 H.J. Lu <hongjiu.lu@intel.com>
267
268 * Makefile.am (ZLIB): New.
269 (ZLIBINC): Likewise.
270 (AM_CFLAGS): Add $(ZLIBINC).
271 (AM_CXXFLAGS): Likewise.
272 (ldadd_varldadd_var): Add $(ZLIB).
273 (incremental_dump_LDADD): Likewise.
274 (dwp_LDADD): Likewise.
275 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
276 <zlib.h>.
277 (zlib_compress): Don't check HAVE_ZLIB_H.
278 (zlib_decompress): Likewise.
279 * options.h (compress_debug_sections): Likewise.
280 * configure.ac (AM_CONDITIONAL): Removed.
281 * testsuite/Makefile.am (ZLIB): New.
282 (LDADD): Add $(ZLIB).
283 Don't check HAVE_ZLIB.
284 * Makefile.in: Regenerated.
285 * config.in: Likewise.
286 * configure: Likewise.
287 * testsuite/Makefile.in: Likewise.
288
6b0ad2eb
JY
2892015-03-30 Jing Yu <jingyu@google.com>
290
291 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
292 TLSLD_ADD_DTPREL_LO12_NC.
293 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
294 _TLS_MODULE_BASE_ point to the start of tls segment.
295 (Target_aarch64::optimize_tls_reloc): Add cases for
296 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
297 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
298 (Target_aarch64::Scan::local): Likewise.
299 (Target_aarch64::Scan::global): Likewise.
300 (Target_aarch64::Relocate::relocate): Likewise.
301 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
302 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
303 relocations.
304
0916f9e7
RÁE
3052015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
306
307 * merge.cc (Object_merge_map::add_mapping): call
308 Object_merge_map::Input_merge_map::add_mapping.
309 (Object_merge_map::Input_merge_map::add_mapping): New.
310 (Output_merge_data::do_add_input_section): Call
311 get_or_make_input_merge_map before a loop.
312 (Output_merge_string<Char_type>::finalize_merged_data): Call
313 get_or_make_input_merge_map before a loop.
314 * merge.h (Object_merge_map): Make Input_merge_map public.
315 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
316 (Relobj::get_or_create_merge_map): New.
317 * object.h (Relobj::get_or_create_merge_map): New.
318
282c9750
AM
3192015-03-24 Alan Modra <amodra@gmail.com>
320
321 PR 18147
322 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
323 relocation errors for branches to strong undefined symbols.
324
67f95b96
RÁE
3252015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
326
327 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
328 (Object_merge_map::is_merge_section_for): Remove.
329 (Object_merge_map::find_merge_section): New.
330 * merge.h (Object_merge_map::is_merge_section_for): Remove.
331 (Object_merge_map::find_merge_section): New.
332 (Object_merge_map::get_input_merge_map): Add a const version.
333 * object.cc (Relobj::is_merge_section_for): Remove.
334 (Relobj::find_merge_section): New.
335 * object.h (Relobj::is_merge_section_for): Remove.
336 (Relobj::find_merge_section): New.
337 * output.cc
338 (Output_section::Input_section::is_merge_section_for): Remove.
339 (Output_section::add_merge_input_section): Don't call
340 add_merge_input_section.
341 (Output_section::find_merge_section): Return const. Use
342 object->find_merge_section.
343 (Output_section::build_lookup_maps): Don't build a map for
344 merge sections.
345 (Output_section::is_input_address_mapped): Return false if
346 section is not found.
347 (Output_section::find_starting_output_address): Use
348 find_merge_section instead of is_merge_section_for.
349 (Output_section::add_script_input_section): Don't build a map for
350 merge sections.
351 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
352 (Output_section_lookup_maps::find_merge_section): Remove.
353 (Output_section_lookup_maps::add_merge_input_section) Remove.
354 (Output_section::find_merge_section): Return const.
355
152f7024
CC
3562015-03-22 Cary Coutant <cary@google.com>
357
358 PR gold/18106
359 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
360 non-SIB form of lea, with nop after the call.
361
bccffdfd
CC
3622015-03-21 Cary Coutant <cary@google.com>
363
364 PR gold/14217
365 * output.cc (Output_segment::is_first_section_relro): Don't ignore
366 .tdata section.
367 (Output_segment::set_section_addresses): Don't align size of relro
368 segment for .tbss.
369
1c582fe7
CC
3702015-03-21 Cary Coutant <cary@google.com>
371
372 PR gold/18010
373 * stringpool.cc (Stringpool_template): Don't optimize if section
374 alignment is greater than sizeof(char).
375
410da591
CC
3762015-03-21 Cary Coutant <cary@google.com>
377
378 PR gold/18048
379 * script-c.h (script_include_directive): Add first_token parameter.
380 * script.cc (script_include_directive): Add first_token parameter, and
381 pass it to read_script_file.
382 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
383 (PARSING_MEMORY_DEF): New tokens.
384 (top): Add new productions for INCLUDE files.
385 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
386 Pass PARSING_LINKER_SCRIPT to script_include_directive.
387 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
388 (section_cmd): Pass PARSING_SECTION_CMDS.
389 (file_or_sections_cmd): Remove.
390 (memory_def): Pass PARSING_MEMORY_DEF.
391 * testsuite/Makefile.am (memory_test_2): New test.
392 * testsuite/Makefile.in: Regenerate.
393 * testsuite/memory_test_inc.t: New script file.
394 * testsuite/memory_test_inc_1.t.src: New script file.
395 * testsuite/memory_test_inc_2.t.src: New script file.
396 * testsuite/memory_test_inc_3.t.src: New script file.
397
0d5bbdb0
CC
3982015-03-21 Cary Coutant <cary@google.com>
399
400 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
401 (Sized_relobj_dwo::setup): Build compressed section map.
402 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
403 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
404 section map.
405 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
406 compressed_sections_ field.
407 (build_compressed_section_map): Take Object instead of
408 Sized_relobj_file parameter; add decompress_if_needed parameter.
409 (Sized_relobj_file::do_find_special_sections): Store compressed
410 section map in parent Object.
411 (Sized_relobj_file::do_decompressed_section_contents): Move
412 implementation to Object::decompressed_section_contents.
413 (Sized_relobj_file::do_discard_decompressed_sections): Move
414 implementation to Object::discard_decompressed_sections.
415 * object.h (build_compressed_section_map): Declare.
416 (Object::Object): Add compressed_sections_ field.
417 (Object::section_is_compressed): Move implementation here.
418 (Object::decompressed_section_contents): De-virtualize.
419 (Object::discard_decompressed_sections): De-virtualize.
420 (Object::do_section_is_compressed): Delete.
421 (Object::do_decompressed_section_contents): Delete.
422 (Object::set_compressed_sections): New method.
423 (Object::compressed_sections): New method.
424 (Object::compressed_sections_): New data member.
425 (Compressed_section_info, Compressed_section_map): Move to top of file.
426 (Sized_relobj_file::do_section_is_compressed): Delete.
427 (Sized_relobj_file::do_decompressed_section_contents): Delete.
428 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
429 (Sized_relobj_file::compressed_sections_): Move to Object class.
430
bd9e0d46
CC
4312015-03-21 Cary Coutant <ccoutant@google.com>
432
433 PR gold/18152
434 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
435 deferred objects.
436
943c8b43
CC
4372015-03-11 Cary Coutant <ccoutant@google.com>
438
439 * options.cc (General_options::finalize): Don't allow -z relro
440 with incremental linking.
441 * testsuite/Makefile.am (incremental_test): Add -z norelro.
442 (incremental_test_2): Likewise.
443 (incremental_test_3): Likewise.
444 (incremental_test_4): Likewise.
445 (incremental_test_5): Likewise.
446 (incremental_test_6): Likewise.
447 (incremental_copy_test): Likewise.
448 (incremental_common_test_1): Likewise.
449 (incremental_comdat_test_1): Likewise.
450 * testsuite/Makefile.in: Regenerate.
451
e1663197
CC
4522015-03-09 Cary Coutant <ccoutant@google.com>
453
454 PR gold/14675
455 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
456 return enum indicating whether .eh_frame section is empty, optimizable,
457 unrecognized, or an end marker. Adjust explicit instantiations.
458 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
459 (Eh_frame::add_ehframe_input_section): Change return type.
460 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
461 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
462 to the .eh_frame output section until we see the end marker.
463 (Layout::finalize_eh_frame_section): New.
464 * layout.h: (Layout::finalize_eh_frame_section): New.
465
beb8418f
L
4662015-03-05 H.J. Lu <hongjiu.lu@intel.com>
467
468 * output.cc (Relobj::initialize_input_to_output_map<size>):
469 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
470
48c73428
CC
4712015-03-04 Cary Coutant <ccoutant@google.com>
472
473 * parameters.cc (Parameters::set_target_once): Call
474 Target::select_as_default_target just once from here...
475 (set_parameters_target): ...instead of from here.
476
4772015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
478
479 * ehframe.cc (Cie::set_output_offset): Pass in and use a
480 Output_section_data instead of a Merge_map.
481 (Eh_frame::Eh_frame): Don't initialize merge_map_.
482 (Eh_frame::read_cie): Use add_merge_mapping instead of
483 Merge_map::add_mapping.
484 (Eh_frame::read_fde): Ditto.
485 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
486 (Eh_frame::do_output_offset): Use merge_output_offset istead of
487 merge_map_->get_output_offset.
488 (Eh_frame::do_is_merge_section_for): Delete.
489 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
490 instead of a Merge_map.
491 (Cie::set_output_offset): Pass in a Output_section_data instead of a
492 Merge_map.
493 (Eh_frame::do_is_merge_section_for): Delete.
494 (Eh_frame::merge_map_): Delete.
495 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
496 and use a Output_section_data instead of a Merge_map.
497 (Object_merge_map::add_mapping): Ditto.
498 (Object_merge_map::get_output_offset): Remove the merge_map argument.
499 (Object_merge_map::is_merge_section_for): Pass in and use a
500 Output_section_data instead of a Merge_map.
501 (Merge_map): Delete.
502 (Output_merge_base::do_output_offset): Use merge_output_offset instead
503 of merge_map_.get_output_offset.
504 (Output_merge_base::do_is_merge_section_for): Delete.
505 (Output_merge_data::do_add_input_section): Use
506 object->add_merge_mapping instead of add_mapping.
507 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
508 * merge.h (Merge_map): Delete forward declaration.
509 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
510 instead of a Merge_map.
511 (Object_merge_map::get_output_offset): Remove the merge_map argument.
512 (Object_merge_map::is_merge_section_for): Pass in and use a
513 Output_section_data instead of a Merge_map.
514 (Input_merge_map::Object_merge_map::merge_map): Replace with
515 output_data.
516 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
517 Output_section_data instead of a Merge_map.
518 (Merge_map): Delete.
519 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
520 (Output_merge_base::do_is_merge_section_for): Delete.
521 (Output_merge_base::add_mapping): Delete.
522 (Output_merge_base::merge_map_): Delete.
523 * object.cc (Relobj::initialize_input_to_output_map): New.
524 (Relobj::initialize_input_to_output_map): New.
525 (Relobj::merge_output_offset): New.
526 (Relobj::is_merge_section_for): New.
527 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
528 bits.
529 * object.h (Relobj::merge_map): Delete.
530 (initialize_input_to_output_map): New.
531 (set_merge_map): Delete.
532 (add_merge_mapping): New.
533 (merge_output_offset): New.
534 (is_merge_section_for): New.
535 * output.cc (Output_section::Input_section::is_merge_section_for):
536 Use object->is_merge_section_for.
537 * output.h (Output_section_data::is_merge_section_for): Delete.
538 (Output_section_data::do_is_merge_section_for): Delete.
539 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
540 Use object->initialize_input_to_output_map.
541 (Merged_symbol_value<size>::value_from_output_section): Use
542 object->merge_output_offset.
543
48c73428 5442015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
545 Cary Coutant <ccoutant@google.com>
546
547 * output.cc (Output_section::add_merge_input_section): Do not
548 attempt to merge sections with an entsize of 0.
549
48c73428 5502015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
551
552 * attributes.h (class Output_attributes_section_data ): Add
553 do_print_to_mapfile function.
554
ec86f434
AM
5552015-02-24 Alan Modra <amodra@gmail.com>
556
557 PR 18010
558 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
559 complain if value is not a multiple of four.
560 (Target_powerpc::Relocate::relocate): Correct handling of
561 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
562
be66981e
L
5632015-02-21 H.J. Lu <hongjiu.lu@intel.com>
564
565 * configure.ac (default_size): Set to 32 for x32.
566 * configure: Regenerated.
567
e3ee8ed4
AM
5682015-02-18 Alan Modra <amodra@gmail.com>
569
570 PR 17954
571 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
572 visibility.
573
3a935c6c
RÁE
5742015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
575
576 * gc.h (Garbage_collection::add_reference): Don't use find.
577
e0a1e121
RÁE
5782015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
579
580 * object.cc (write_local_symbols): avoid std::vector copy.
581
45a4fb1a
RÁE
5822015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
583
584 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
585
2d9afefe
MW
5862015-02-09 Mark Wielaard <mjw@redhat.com>
587
588 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
589 DW_LANG_Fortran03 and DW_LANG_Fortran08.
590
e9c1bdad
CC
5912015-02-16 Cary Coutant <ccoutant@google.com>
592
593 PR gold/13577
594 PR gold/16992
595 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
596 DF_SYMBOLIC if --dynamic-list option is used.
597 * options.cc (General_options::finalize): --dynamic-list is not
598 mutually exclusive with -Bsymbolic.
599 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
600 listed in --dynamic-list.
601 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
602 -Bsymbolic-functions.
603 * testsuite/Makefile.in: Regenerate.
604
0ed4b0bf
CC
6052015-02-16 Cary Coutant <ccoutant@google.com>
606
607 PR gold/17971
608 * incremental.cc: Remove redundant include of "output.h".
609
1a920511
JY
6102015-02-12 Jing Yu <jingyu@google.com>
611
612 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
613 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
614 New relocation.
615 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
616 TLSLE_MOVW_* relocations.
617 (Target_aarch64::Scan::global): Likewise.
618 (Target_aarch64::Relocate::relocate): Likewise.
619 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
620 for new TLSLE_MOVW_* relocations.
621
07f107f3
WN
6222015-02-11 Will Newton <will.newton@linaro.org>
623
624 PR gold/13321
625 * arm.cc (Target_arm::make_plt_section): Create an ARM
626 state mapping symbol at the start of the PLT.
627
e051a5b5
L
6282015-02-09 H.J. Lu <hongjiu.lu@intel.com>
629
630 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
631 Replace two_file_shared_2.so with two_file_shared_1.so.
632 * testsuite/Makefile.in: Regenerated.
633
dddcc5b9
AM
6342015-02-09 Alan Modra <amodra@gmail.com>
635
636 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
637 plugin_test_thin.a and defsym_test.
638 * testsuite/Makefile.in: Regenerate.
639
b39b8b9d
RÁE
6402015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
641
642 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
643 body.
644
b66d1c52
CC
6452015-02-04 Peter Collingbourne <pcc@google.com>
646
647 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
648 forwarding symbols when computing symbol resolution info for plugins.
649 * plugin.h (Plugin_manager::symtab): New method.
650 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
651
23081de0
CC
6522015-02-03 Cary Coutant <ccoutant@google.com>
653 Peter Collingbourne <pcc@google.com>
654
655 PR gold/15660
656 * archive.cc (Thin_archive_object_unlocker): New class.
657 (Archive::include_member): Unlock external members of thin archives.
658 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
659 (plugin_test_2): Likewise.
660 (plugin_test_3): Likewise.
661 (plugin_test_4): Likewise.
662 (plugin_test_5): Likewise.
663 (plugin_test_6): Likewise.
664 (plugin_test_7): Likewise.
665 (plugin_test_8): Likewise.
666 (plugin_test_9): Likewise.
667 (plugin_test_10): Likewise.
668 (plugin_test_11): New test case.
669 * testsuite/Makefile.in: Regenerate.
670 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
671 file to decide whether to claim file.
672 (all_symbols_read_hook): Likewise.
673 * testsuite/plugin_test_1.sh: Adjust expected output.
674 * testsuite/plugin_test_2.sh: Likewise.
675 * testsuite/plugin_test_3.sh: Likewise.
676 * testsuite/plugin_test_6.sh: Likewise.
677 * testsuite/plugin_test_tls.sh: Likewise.
678 * testsuite/plugin_test_11.sh: New testcase.
679
6802015-02-03 Cary Coutant <ccoutant@google.com>
681
682 * descriptors.cc (Descriptors::open): Set artificially-low limit for
683 file descriptors when debugging enabled. Add debug output.
684 (Descriptors::release): Add debug output.
685 (Descriptors::close_some_descriptor): Likewise.
686 (Descriptors::close_all): Likewise.
687 * fileread.cc (File_read::lock): Likewise.
688 (File_read::unlock): Likewise.
689
24dd5808
CC
6902015-02-02 Cary Coutant <ccoutant@google.com>
691
692 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
693 executable output file.
694
fa89cc82
HS
6952015-01-22 Han Shen <shenhan@google.com>
696
697 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
698 (Target_arm::do_plt_address_for_global): New method.
699 (Target_arm::do_plt_address_for_local): New method.
700 (Target_arm::rel_irelative_section): New method.
701 (Target_arm::make_data_plt): Add more parameters for plt ctor.
702 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
703 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
704 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
705 (Target_arm::Scan::check_non_pic): Add ifunc support.
706 (Target_arm::Scan::local): Add ifunc support.
707 (Target_arm::Scan::global): Add ifunc support.
708 (Target_arm::make_plt_section): New method.
709 (Target_arm::make_plt_entry): Change to call to make_plt_section.
710 (Target_arm::make_local_ifunc_plt_entry): New method.
711 (Target_arm::got_irelative_): New member.
712 (Target_arm::rel_irelative_): New member.
713 (Target_arm::got_section): Add creation for got_irelative_.
714 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
715 (Target_arm::Relocate::relocate): Properly set local ifunc address.
716 (Target_arm::do_dynsym_value): Properly set global ifunc address.
717 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
718 (Output_data_plt_arm::IRelative_data): New type.
719 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
720 (Output_data_plt_arm::add_entry): Add more parameters.
721 (Output_data_plt_arm::add_relocation): New method.
722 (Output_data_plt_arm::add_local_ifunc_entry): New method.
723 (Output_data_plt_arm::rel_irelative): New method.
724 (Output_data_plt_arm::entry_count): Modified.
725 (Output_data_plt_arm::address_for_global): New method.
726 (Output_data_plt_arm::address_for_local): New method.
23081de0 727gold/
fa89cc82
HS
728 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
729 (Output_data_plt_arm::insert_irelative_data): New method.
730 (Output_data_plt_arm::irelative_rel_): New member.
731 (Output_data_plt_arm::got_): New member.
732 (Output_data_plt_arm::got_irelative_): New member.
733 (Output_data_plt_arm::irelative_count_): New member.
734 (Output_data_plt_arm::IRelative_data_vec): New typedef.
735 (Output_data_plt_arm::irelative_data_vec_): New member.
736 (Output_data_plt_arm::do_write): Write out irelative entries.
737 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
738 more parameters to ctor.
739 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
740 more parameters to ctor.
741 * output.h (Output_data_reloc::add_local_relative): New method.
742 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
743
0f81d3f0
AM
7442015-01-29 Alan Modra <amodra@gmail.com>
745
746 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
747 and GOT_TLSGD to LE optimization.
748
65d92137
CC
7492015-01-28 Cary Coutant <ccoutant@google.com>
750
751 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
752 for undef TLS symbols.
753 (Target_x86_64::Relocate::relocate_tls): Likewise.
754 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
755
5485698a
CC
7562015-01-25 Cary Coutant <ccoutant@google.com>
757
758 * output.cc (Output_segment::set_section_addresses): Fix calculation
759 of size of relro segment.
760
b01a4b04
AM
7612015-01-22 Alan Modra <amodra@gmail.com>
762
763 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
764 condition for need of ifunc plt entry.
765 (Target_powerpc::Scan::global <got relocs>): Likewise.
766
3d0064a9
CC
7672015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
768
769 * mips.cc (reloc_high): Add r_sym.
770 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
771 reloc_high constructor.
772 (Mips_relocate_functions::relgot16_local): Likewise.
773 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
774 r_type to decide whether LO16 matches HI16.
775 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
776 rello16 and relgot16_local.
777
a5cd8f05
CC
7782015-01-09 Cary Coutant <ccoutant@google.com>
779
780 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
781 unless alignment is larger than page size.
782
4fc1b9d4
L
7832015-01-06 H.J. Lu <hongjiu.lu@intel.com>
784 Cary Coutant <ccoutant@google.com>
785
786 PR gold/17729
787 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
788 (DEFAULT_TARGET_X32): Set for x32.
789 * x86_64.cc (cmp_insn_32): New.
790 (lea_r10_insn_32): Likewise.
791 (lea_r11_insn_32): Likewise.
792 (cmp_insn_64): Likewise.
793 (lea_r10_insn_64): Likewise.
794 (lea_r11_insn_64): Likewise.
795 (Target_x86_64<size>::do_calls_non_split): Handle x32.
796 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
797 (check_DATA): Add split_x32 files.
798 (split_x32_[1234n].o): New targets.
799 (split_x32_[124]): New targets.
800 (split_x32_[1234r].stdout): New targets.
801 * testsuite/split_x32.sh: New file.
802 * testsuite/split_x32_1.s: Likewise.
803 * testsuite/split_x32_2.s: Likewise.
804 * testsuite/split_x32_3.s: Likewise.
805 * testsuite/split_x32_4.s: Likewise.
806 * testsuite/split_x32_n.s: Likewise.
807 * configure: Regenerated.
808 * testsuite/Makefile.in: Likewise.
809
e749cab8
L
8102015-01-06 H.J. Lu <hongjiu.lu@intel.com>
811
812 PR gold/17809
813 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
814 x32.
815
af759df0
AM
8162015-01-02 Alan Modra <amodra@gmail.com>
817
818 * version.cc (print_version): Just print current year.
819 * dwp.cc (print_version): Likewise.
820
b90efa5b
AM
8212015-01-01 Alan Modra <amodra@gmail.com>
822
823 Update year range in copyright notice of all files.
824
f12d1e8a
AM
8252014-12-25 Alan Modra <amodra@gmail.com>
826
827 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
828 new enums.
829 (Target_arm::merge_object_attributes, ): Likewise.
830
5c294fee
TG
8312014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
832
833 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
834 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
835 AEABI_VFP_args_vfp to check that.
836 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
837 value and replace hardcoded values by enum values.
838
e30880c2
CC
8392014-12-22 Cary Coutant <ccoutant@google.com>
840
841 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
842
bd040da1
L
8432014-12-20 H.J. Lu <hongjiu.lu@intel.com>
844
845 PR gold/14608
846 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
847 to "return i * i * 3;".
848
e02a4046
CC
8492014-12-16 Cary Coutant <ccoutant@google.com>
850
851 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
852 (Mapfile::print_output_data): Use current_data_size() to avoid
853 assert for sections requiring postprocessing; if address is not valid,
854 print 0.
855 (Mapfile::print_output_section): Use current_data_size(); print note
856 that addresses and sizes are before compression.
857
add6016b
L
8582014-12-14 H.J. Lu <hongjiu.lu@intel.com>
859
860 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
861 Cast current_group_size to unsigned long when reporting error.
862
0bf32ea9
JY
8632014-12-10 Jing Yu <jingyu@google.com>
864
865 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
866 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
867 Update error message.
868 (Target_aarch64::do_relax): Use absolute value of option
869 stub_group_size. Replace local variable with class member
870 stub_group_size_.
871
cbcb23fa
AM
8722014-12-04 Alan Modra <amodra@gmail.com>
873
874 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
875 addend of PLTREL24 reloc when not generating a plt stub. Make
876 max_branch_offset an "Address".
fbad6518 877 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
878 (Target_powerpc::Relocate::relocate): Likewise.
879
1611bc4a
AM
8802014-12-04 Alan Modra <amodra@gmail.com>
881
882 PR 17670
883 * symtab.cc (Symbol::set_undefined): Remove assertion.
884 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
885 on symbols defined in discarded sections, instead return false.
886 Rearrange params, update all callers.
887 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
888 branches to syms in discarded sections.
889 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
890 undefined and flag as discarded.
891 (Target_powerpc::Relocate::relocate): Localize variable.
892
4759c34e
L
8932014-12-03 H.J. Lu <hongjiu.lu@intel.com>
894
895 PR gold/17675
896 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
897 * testsuite/Makefile.in: Regenerated.
898
1f98a074
AM
8992014-12-03 Alan Modra <amodra@gmail.com>
900
901 PR 17566
902 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
903 when adding dynamic relocations against section symbols.
904
fb257835
DI
9052014-12-01 Dimitry Ivanov <dimitry@google.com>
906
907 * layout.cc (Layout::finish_dynamic_section): When '-z global'
908 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
909 * options.h (General_options): New -z option (global).
910
d8e60314
CC
9112014-12-01 Cary Coutant <ccoutant@google.com>
912
913 PR gold/17578
914 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
915 is given.
916 (Layout::create_executable_stack_info): Warn when -z noexecstack is
917 given but some inputs require executable stack.
918
982bbd97
CC
9192014-11-26 Cary Coutant <ccoutant@google.com>
920
921 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
922 .debug_str_offsets; strip .debug_gnu_pubnames and
923 .debug_gnu_pubtypes.
924 (lines_only_debug_sections): Strip all four new sections.
925
bb779192
HS
9262014-11-26 Jing Yu <jingyu@google.com>
927
928 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
929 register to be x0 when to relax TLSDESC_LD64_LO12.
930
a3e60ddb
AM
9312014-11-26 Alan Modra <amodra@gmail.com>
932
933 * powerpc.cc (struct Stub_table_owner): New.
934 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
935 unsigned int vector. Update all references.
936 (powerpc_relobj::set_stub_table): Take an unsigned int param
937 rather than a Stub_table. Update callers.
938 (Powerpc_relobj::clear_stub_table): New function.
939 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
940 stub_group_size_ vars.
941 (Target_powerpc::new_stub_table): Delete.
942 (max_branch_delta): New function, extracted from..
943 (Target_powerpc::Relocate::relocate): ..here..
944 (Target_powerpc::Branch_info::make_stub): ..and here. Return
945 status on whether stub created successfully.
946 (Stub_control::Stub_control): Add "no_size_errors" param. Move
947 default sizing to..
948 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
949 reduce on relax failure.
950 (Target_powerpc::group_sections): Add "no_size_errors" param.
951 Use stub_group_size_. Set up group info in a temp vector,
952 before building Stub_table vector. Account for input sections
953 possibly already converted to relaxed sections.
954 (Stub_table::init): Delete. Merge into..
955 (Stub_table::Stub_table): ..here.
956 (Stub_table::can_reach_stub): New function.
957 (Stub_table::add_plt_call_entry): Add "from" parameter and
958 return true iff stub could be reached.
959 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
960 param too.
961 (Stub_table::clear_stubs): Add "all" param.
962
a20605cf
AM
9632014-11-26 Alan Modra <amodra@gmail.com>
964
965 * powerpc.cc (Stub_control::set_output_and_owner): New function.
966 (Target_powerpc::group_sections): Use it.
967
43b64deb
CC
9682014-11-25 Cary Coutant <ccoutant@google.com>
969
970 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
971 (Binary_to_elf::write_symbol): Add st_size parameter.
972 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
973
c924eb67
CC
9742014-11-25 Cary Coutant <ccoutant@google.com>
975
976 PR gold/17639
977 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
978 (Sized_relobj_file::do_layout): Handle deferred sections properly
979 during GC pass 1. Don't add reloc sections to deferred list twice.
980 * object.h (Sized_relobj_file::is_deferred_layout): New function.
981 (Sized_relobj_file::is_deferred_layout_): New data member.
982
9d585188
L
9832014-11-21 H.J. Lu <hongjiu.lu@intel.com>
984
985 PR gold/17619
986 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
987 Check PC-relative offset overflow in PLT entry.
988
3ffaac20
AM
9892014-11-21 Alan Modra <amodra@gmail.com>
990
991 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
992 for undefined weaks.
993
0cfb0717
AM
9942014-11-20 Alan Modra <amodra@gmail.com>
995
996 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
997 from --stub-group-size parameter divided by 1024.
998 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
999 template parameter. Update all uses.
1000 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1001 has_stub_value. Set for long branches. Don't report overflow for
1002 branch to undefined weak symbols. Print info message on
1003 overflowing branch to stub.
1004
f9dffbf0
AM
10052014-11-20 Alan Modra <amodra@gmail.com>
1006
1007 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1008
e88ba8d5
L
10092014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1010
1011 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1012 entry for R_X86_64_GOTPLT64.
1013 (Target_x86_64<size>::Relocate::relocate): Update comments for
1014 R_X86_64_GOTPLT64.
1015
d37ffe25
ED
10162014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1017
1018 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1019 * plugin.h: add lock definition
1020
9726c3c1
HS
10212014-10-29 Han Shen <shenhan@google.com>
1022 Jing Yu <jingyu@google.com>
1023
1024 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1025 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1026 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1027 Symbol::TLS_REF.
1028 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1029 method.
1030 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1031 (Target_aarch64::tls_ld_to_le): New method.
1032 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1033 for 64bit targets.
1034 (Output_data_plt_aarch64::irelative_rel_): New data member.
1035 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1036 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1037 (Output_data_plt_aarch64::add_relocation): New method.
1038 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1039 offset. Add got_irelative size to got size.
1040 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1041 type string with the new typename.
1042 (AArch64_relocate_functions::update_adr): Replace parameter x with
1043 immed.
1044 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1045 (AArch64_relocate_functions::reloc_common): New method.
1046 (AArch64_relocate_funcsions::rela_general): Extract common part out
1047 into reloc_common method.
1048 (AArch64_relocate_functions::rela_general): Likewise.
1049 (AArch64_relocate_functions::pcrela_general): Likewise.
1050 (AArch64_relocate_functions::adr): New method.
1051 (AArch64_relocate_functions::adrp): Calculate immed before calling
1052 update_adr.
1053 (AArch64_relocate_functions::adrp): Likewise.
1054 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1055 comparing x to 0. Calculate immed from ~x when x < 0.
1056 (Target_aarch64::optimize_tls_reloc): Add new cases for
1057 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1058 TLSLD_MOVW_DTPREL_G0_NC.
1059 (Target_aarch64::possible_function_pointer_reloc): Implement this
1060 method.
1061 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1062 comment.
1063 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1064 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1065 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1066 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1067 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1068 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1069 (Target_aarch64::make_plt_entry): Call add_entry with two more
1070 parameters.
1071 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1072 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1073 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1074 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1075 (Target_aarch64::Relocate::relocate_tls): Add cases for
1076 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1077 TLSLD_MOVW_DTPREL_G0_NC.
1078 * testsuite/icf_safe_so_test.cc: Correct test comment.
1079 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1080
80272b8c
AM
10812014-10-22 Alan Modra <amodra@gmail.com>
1082
1083 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1084 thread_starter.
1085
998a69f4
AS
10862014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1087
1088 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1089
aed56ec5
CC
10902014-10-17 Cary Coutant <ccoutant@google.com>
1091
1092 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1093 Add "typename" keyword.
1094
bb779192 10952014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1096 Jing Yu <jingyu@google.com>
1097
1098 Patch for gold aarch64 backend to support relaxation.
1099 * aarch64-reloc.def: Change format.
1100 * aarch64.cc (class Reloc_stub): New class.
1101 (class Stub_table): New class.
1102 (class AArch64_relobj): New class.
1103 (class AArch64_input_section): New class.
1104 (class AArch64_output_section): New class.
1105 (Target_aarch64::new_stub_table): New method.
1106 (Target_aarch64::new_aarch64_input_section): New method.
1107 (Target_aarch64::find_aarch64_input_section): New method.
1108 (Target_aarch64::scan_section_for_stubs): New method.
1109 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1110 (Target_aarch64::relocate_stub): New method.
1111 (Target_aarch64::current_target): New method.
1112 (Target_aarch64::do_make_elf_object): New method.
1113 (Target_aarch64::do_may_relax): New method.
1114 (Target_aarch64::do_relax): New method.
1115 (Target_aarch64::group_sections): New method.
1116 (Target_aarch64::scan_reloc_for_stub): New method.
1117 (Target_aarch64::do_make_output_section): New method.
1118 (Target_aarch64::stub_tables_): New data member.
1119 (Target_aarch64::aarch64_input_section_map_): New data member.
1120 (AArch64_relocate_functions::maybe_apply_stub): New method.
1121
db4c9594
CC
11222014-09-30 Cary Coutant <ccoutant@google.com>
1123
1124 PR gold/17432
1125 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1126
cd6da036
KC
11272014-09-30 Kito Cheng <kito@0xlab.org>
1128
1129 PR gold/13597
1130 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1131 hash table before sysv-style hash table.
1132
5f772412
ST
11332014-09-29 Sriraman Tallam <tmsriram@google.com>
1134
1135 * options.h (--pic-executable): Add negative to alias to -no-pie.
1136
5efeedf6
CC
11372014-09-26 Cary Coutant <ccoutant@google.com>
1138
1139 PR gold/16773
1140 * object.cc (Sized_relobj_file): Compute value of section symbols
1141 for TLS sections the same as TLS symbols.
1142
1707f183
CC
11432014-09-25 Cary Coutant <ccoutant@google.com>
1144
1145 PR gold/17432
1146 * resolve.cc (Symbol_table::resolve): Override common placeholder
1147 symbols, but adjust sizes.
1148 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1149 symbols to common lists.
1150
00cac886
AM
11512014-09-24 Alan Modra <amodra@gmail.com>
1152
1153 * po/POTFILES.in: Regenerate.
1154
635aa30e
CC
11552014-09-23 Taiju Tsuiki <tzik@google.com>
1156 Cary Coutant <ccoutant@google.com>
1157
71b9b91b 1158 PR gold/14860
635aa30e
CC
1159 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1160 on input_sections_blocker.
1161 * layout.cc (Write_sections_task::locks): Unblock
1162 input_sections_blocker_.
1163 * layout.h (Write_sections_task::Write_sections_task): Add
1164 input_sections_blocker.
1165 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1166 to DEPENDENCIES.
1167 * testsuite/Makefile.in: Regenerate.
1168
c0c71592
RÁE
11692014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1170
1171 * testsuite/Makefile.am (plugin_test_10): New test.
1172 * testsuite/Makefile.in: Regenerate
1173 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1174 * testsuite/plugin_test_10.sh: New file.
1175
6168c2a1
RÁE
11762014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1177
1178 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1179 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1180 during the replacement phase.
1181
3a531937
JY
11822014-09-17 Han Shen <shenhan@google.com>
1183 Jing Yu <jingyu@google.com>
1184
1185 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1186 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1187 * aarch64.cc (Target_aarch64): Add data members
1188 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1189 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1190 constructor.
1191 (Target_aarch64::do_reloc_symbol_index): New method.
1192 (Target_aarch64::do_reloc_addend): New method.
1193 (Target_aarch64::add_tlsdesc_info): New method.
1194 (Target_aarch64::do_dynsym_value): New method.
1195 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1196 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1197 (Target_aarch64::make_data_plt): Add new parameters: got,
1198 got_irelative. Pass them to do_make_data_plt.
1199 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1200 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1201 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1202 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1203 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1204 (Target_aarch64::got_tlsdesc_section): New method.
1205 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1206 (Target_aarch64::define_tls_base_symbol): New method.
1207 (Target_aarch64::reserve_tlsdesc_entries): New method.
1208 (Target_aarch64::got_mod_index_entry): New method.
1209 (Target_aarch64::rela_tlsdesc_section): New method.
1210 (Target_aarch64::rela_irelative_section): New method.
1211 (Target_aarch64::Tlsdesc_info): New struct.
1212 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1213 relocations and tlsdesc relocations.
1214 (Target_aarch64::optimize_tls_reloc): Implement method.
1215 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1216 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1217 in constructor.
1218 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1219 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1220 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1221 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1222 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1223 (Output_data_plt_aarch64::rela_irelative): New method.
1224 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1225 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1226 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1227 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1228 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1229 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1230 (Output_data_plt_aarch64_standard): New member variables:
1231 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1232 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1233 New parameter: got, got_irelative.
1234 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1235 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1236 (Output_data_plt_aarch64::do_write): Replace got_address with
1237 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1238 (AArch64_relocate_functions::update_movnz): New method.
1239 (AArch64_relocate_functions): Correct format.
1240 (AArch64_relocate_functions::movnz): New method.
1241 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1242 before the switch. Add new cases to switch.
00cac886 1243 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1244 tlsgd tlsdesc cases.
1245 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1246 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1247 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1248 Call reloc_name_in_error_message to print unsupported reloc.
1249 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1250 make_data_plt.
1251 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1252 relocs. Fill in some more dynamic tags.
1253 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1254 Skip call tls_get_addr when tlsgd is relaxed.
1255 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1256 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1257 tlsdesc->ie relaxation.
1258
62661c93
SS
12592014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1260
1261 * mips.cc (Target_mips_nacl): New class.
1262 (Target_selector_mips_nacl): New class.
1263 (target_selector_mips32): Rename from target_selector_mips32be and use
1264 Target_selector_mips_nacl instead of Target_selector_mips.
1265 (target_selector_mips32el): Rename from target_selector_mips32 and use
1266 Target_selector_mips_nacl instead of Target_selector_mips.
1267 (target_selector_mips64): Rename from target_selector_mips64be and use
1268 Target_selector_mips_nacl instead of Target_selector_mips.
1269 (target_selector_mips64el): Rename from target_selector_mips64 and use
1270 Target_selector_mips_nacl instead of Target_selector_mips.
1271 (Target_mips::mips_info): Add const attribute.
1272
54674d38
CC
12732014-09-02 Cary Coutant <ccoutant@google.com>
1274
1275 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1276 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1277 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1278 (Sized_incr_dynobj::do_section_name): Likewise.
1279 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1280 (Sized_incr_dynobj::do_section_name): Likewise.
1281 * object.h (Object::section_name): Likewise.
1282 (Object::do_section_name): Likewise.
1283 (Sized_relobj_file::do_section_name): Likewise.
1284 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1285 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1286
9860cbcf
CC
12872014-09-02 Cary Coutant <ccoutant@google.com>
1288
1289 PR gold/17005
1290 * ehframe.cc (Fde::write): Add output_offset parameter.
1291 (Cie::write): Likewise.
1292 (Eh_frame::set_final_data_size): Account for offset within output
1293 section.
1294 (Eh_frame::do_sized_write): Likewise.
1295 * ehframe.h (Fde::write): Add output_offset parameter.
1296 (Cie::write): Likewise.
1297 * output.cc (Output_section::Input_section_sort_entry): Remove
1298 section_has_name_; add output_section_name parameter. Use
1299 output section name for non-input sections.
1300 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1301 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1302 (Output_section::Input_section_sort_compare): Remove logic for
1303 sections without names.
1304 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1305 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1306 Likewise.
1307 (Output_section::Input_section_sort_section_name_compare): Likewise.
1308
8e33481e
HS
13092014-08-29 Han Shen <shenhan@google.com>
1310 Jing Yu <jingyu@google.com>
1311
1312 * aarch64-reloc-property.cc
1313 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1314 reference reloc property in the table.
1315 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1316 3 other entries.
1317 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1318 2 new overloaded methods.
1319 (Output_data_got_aarch64::do_write): Add code to write out
1320 static relocs.
1321 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1322 static relocs.
1323 (Output_data_got_aarch64::static_relocs): New vector to
1324 hold static relocs.
1325 (Target_aarch64::TCB_SIZE): New const static memeber.
1326 (Target_aarch64::tcb_size): New method.
1327 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1328 (Target_aarch64::Relocate::relocate_tls): New method.
1329 (Target_aarch64::Scan::local): Add code handling new reloc types.
1330 (Target_aarch64::Scan::global): Add code handling new reloc types.
1331
81233653
ST
13322014-08-13 Sriraman Tallam <tmsriram@google.com>
1333
1334 * options.h (-no-pie): Add option.
1335
9363c7c3
JY
13362014-08-08 Jing Yu <jingyu@google.com>
1337 Han Shen <shenhan@google.com>
1338
1339 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1340 (DEFFILES): add aarch64-reloc.def.
1341 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1342 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1343 * Makefile.in: Regenerate.
1344 * aarch64-reloc-property.cc: New file.
1345 * aarch64-reloc-property.h: New file.
1346 * aarch64-reloc.def: New file.
1347 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1348 with tab to make the format consistent.
1349 (Output_data_got_aarch64::symbol_table_): New method.
1350 (Target_aarch64::do_plt_address_for_global): New method.
1351 (Target_aarch64::do_plt_address_for_local): New method.
1352 (Target_aarch64::do_select_as_default_target): New method.
1353 (Target_aarch64::do_make_data_plt): New method.
1354 (Target_aarch64::make_data_plt): New method.
1355 (Output_data_plt_aarch64::has_irelative_section): New method.
1356 (Output_data_plt_aarch64::address_for_global): New method.
1357 (Output_data_plt_aarch64::address_for_local): New method.
1358 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1359 (Output_data_plt_aarch64::add_entry): Implement contents.
1360 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1361 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1362 the got_pov entry to plt0.
1363 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1364 Implement contents.
1365 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1366 (AArch64_howto): New struct.
1367 (aarch64_howto[]): New static const array.
1368 (AArch64_relocate_functions): New class.
1369 (Target_aarch64::Scan::get_reference_flags): Remove method.
1370 (Target_aarch64::Scan::local): Implement to support a few relocations.
1371 (Target_aarch64::Scan::global): Implement to support a few relocations.
1372 (Target_aarch64::make_plt_section): Implement contents.
1373 (Target_aarch64::make_plt_entry): Implement contents.
1374 (Target_aarch64::do_finalize_sections): Implement contents.
1375 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1376 (Target_aarch64::relocate_section): Implement contents.
1377
ad9fe6c1
AM
13782014-08-06 Alan Modra <amodra@gmail.com>
1379
1380 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1381
7cd4e5b7
AM
13822014-08-06 Alan Modra <amodra@gmail.com>
1383
1384 PR 13227
1385 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1386
5ad9b0a7
ST
13872014-07-21 Sriraman Tallam <tmsriram@google.com>
1388
1389 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1390 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1391
e051745c
CC
13922014-07-08 Cary Coutant <ccoutant@google.com>
1393
1394 * expression.cc (struct Expression::Expression_eval_info): Add
1395 new fields type_pointer, vis_pointer, and nonvis_pointer.
1396 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1397 nonvis_pointer parameters. Adjust all calls.
1398 (Symbol_expression::value): Update type, visibility, and nonvis bits
1399 in caller.
1400 * script.cc (Symbol_assignment::sized_finalize): Update type,
1401 visibility, and remaining st_other bits for new symbol.
1402 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1403 vis_pointer, and nonvis_pointer parameters.
1404 * symtab.h (Symbol::set_type): New method.
1405
1406 * testsuite/Makefile.am (defsym_test): New test.
1407 * testsuite/Makefile.in: Regenerate.
1408 * testsuite/defsym_test.c: New file.
1409 * testsuite/defsym_test.sh: New file.
1410
f35c4853
CC
14112014-07-08 Cary Coutant <ccoutant@google.com>
1412
1413 PR gold/15639
1414 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1415 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1416 (Sized_dynobj::base_read_symbols): ...new method.
1417 * object.h (Sized_relobj_file::base_read_symbols): New method.
1418 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1419 (Sized_relobj_file::base_read_symbols): ...new method.
1420 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1421 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1422 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1423
2900af2d
AM
14242014-07-04 Alan Modra <amodra@gmail.com>
1425
1426 * po/POTFILES.in: Regenerate.
1427
053a4d68
JY
14282014-07-02 Jing Yu <jingyu@google.com>
1429
1430 * aarch64.cc: New file
1431 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1432 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1433 * Makefile.in: Regenerate.
1434 * configure.tgt: Add entries for aarch64*.
1435 * configure.ac: Likewise.
1436 * configure: Likewise.
1437
7b549045
AM
14382014-06-27 Alan Modra <amodra@gmail.com>
1439
1440 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1441
cb818dbf
CC
14422014-06-24 Cary Coutant <ccoutant@google.com>
1443
1444 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1445 sections.
1446 (Dwo_file::sized_read_unit_index): Likewise.
1447
9810d34d
SS
14482014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1449
1450 * mips.cc: New file.
1451 * Makefile.am (TARGETSOURCES): Add mips.cc
1452 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1453 * configure.tgt: Add entries for mips*.
1454 * configure.ac: Likewise.
1455 * Makefile.in: Regenerate.
1456 * configure: Likewise.
1457
9baa787b
CC
14582014-06-09 Cary Coutant <ccoutant@google.com>
1459
1460 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1461 unit_length is within section bounds.
1462
8f89af0a
CC
14632014-06-09 Cary Coutant <ccoutant@google.com>
1464
1465 PR gold/16980
1466 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1467 map.
1468
a47622ac
AM
14692014-06-07 Alan Modra <amodra@gmail.com>
1470
1471 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1472
4320c691
CC
14732014-06-06 Cary Coutant <ccoutant@google.com>
1474
1475 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1476 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1477 (Dwarf_pubnames_table::read_header): Likewise.
1478 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1479 .debug_gnu_pubtypes.
1480
270c9937
JB
14812014-06-05 Joel Brobecker <brobecker@adacore.com>
1482
1483 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1484 * Makefile.in, configure: Regenerate.
1485
397998fc
AM
14862014-06-03 Alan Modra <amodra@gmail.com>
1487
1488 * powerpc.cc (addis_12_2): Define.
1489 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1490
61f5c66f
AM
14912014-06-03 Alan Modra <amodra@gmail.com>
1492
1493 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1494 st_other output.
1495
f6971787
AM
14962014-06-02 Alan Modra <amodra@gmail.com>
1497
1498 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1499 Only ignore relocs on ELFv1.
1500 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1501
f6fb8322
CC
15022014-05-30 Cary Coutant <ccoutant@google.com>
1503
1504 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1505 * testsuite/Makefile.in: Regenerate.
1506 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1507
c23dd342
L
15082014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1509
1510 PR gold/16945
1511 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1512 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1513
5fe7ffdc
AM
15142014-05-15 Alan Modra <amodra@gmail.com>
1515
1516 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1517 Compare FDE contents with DW_CFA_nop rather than 0.
1518
a82bef93
ST
15192014-05-13 Sriraman Tallam <tmsriram@google.com>
1520
1521 * symtab.h (may_need_copy_reloc): Remove check for position independent
1522 code.
1523 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1524 position independence before pc absolute may_need_copy_reloc call.
1525 Add check for executable output befor pc relative may_need_copy_reloc
1526 call.
1527 * i386.cc: Ditto.
1528 * arm.cc: Ditto.
1529 * sparc.cc: Ditto.
1530 * tilegx.cc: Ditto.
1531 * powerpc.cc: Add check for no position independence before
1532 may_need_copy_reloc calls.
1533 * testsuite/pie_copyrelocs_test.cc: New file.
1534 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1535 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1536 * Makefile.in: Regenerate.
a82bef93 1537
53c66605
ML
15382014-05-08 Martin Liška <mliska@suse.cz>
1539
1540 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1541
57b2284c
CC
15422014-05-06 Cary Coutant <ccoutant@google.com>
1543
1544 PR gold/16900
1545 * i386.cc (Output_data_got_plt_i386): New class.
1546 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1547 parameter. Change all callers.
1548 (Output_data_plt_i386::layout_): Remove.
1549 (Output_data_plt_i386::got_plt_): Change type.
1550 (Target_i386::got_plt_): Change type. Change all references.
1551 (Target_i386::got_section): Create instance of new class.
1552 (Output_data_got_plt_i386::do_write): New function.
1553 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1554 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1555 parameter. Change all callers.
1556 (Output_data_plt_x86_64::layout_): Remove.
1557 (Output_data_plt_x86_64::got_plt_): Change type.
1558 (Target_x86_64::got_plt_): Change type. Change all references.
1559 (Target_x86_64::got_section): Create instance of new class.
1560 (Output_data_got_plt_x86_64::do_write): New function.
1561 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1562 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1563 class.
1564
6b97515d 15652014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1566
6b97515d
CC
1567 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1568 if we have pubnames/pubtypes.
1569
d1bddd3c
CC
15702014-05-02 Cary Coutant <ccoutant@google.com>
1571
5fe7ffdc
AM
1572 * defstd.cc (in_segment): Define __ehdr_start here...
1573 * layout.cc (Layout::finalize): ...Instead of here. Set the
1574 output segment when known.
1575 * resolve.cc (Symbol::override_base_with_special): Remember
1576 the original binding.
1577 * symtab.cc (Symbol::set_output_segment): New function.
1578 (Symbol::set_undefined): New function.
1579 * symtab.h (Symbol::is_weak_undefined): Check original undef
1580 binding.
1581 (Symbol::is_strong_undefined): New function.
1582 (Symbol::set_output_segment): New function.
1583 (Symbol::set_undefined): New function.
1584 * target-reloc.h (is_strong_undefined): Remove.
1585 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1586 Check for hidden undefs.
1587 (relocate_section): Call Symbol::is_strong_undefined.
1588
1589 * testsuite/Makefile.am (ehdr_start_test_1)
1590 (ehdr_start_test_2, ehdr_start_test_3)
1591 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1592 * testsuite/Makefile.in: Regenerate.
1593 * testsuite/ehdr_start_def.cc: New source file.
1594 * testsuite/ehdr_start_test.cc: New source file.
1595 * testsuite/ehdr_start_test.t: New linker script.
1596 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1597
7849f6d8
CC
15982014-04-23 Cary Coutant <ccoutant@google.com>
1599
bf2cc635 1600 PR gold/16870
7849f6d8
CC
1601 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1602
99fd8cff
CC
16032014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1604
1605 * layout.cc (Layout::include_section): Allow a target to decide
1606 whether to include a section.
1607 * target.h (Target::should_include_section): New function.
1608 (Target::do_should_include_section): New function.
1609
91f43acd
CC
16102014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1611
1612 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1613 inline into ...
1614 (Copy_relocs::emit): ... here.
1615 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1616 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1617 (Copy_reloc_entry::entries_): Change from private to protected.
1618
c4eb27e1
ST
16192014-04-02 Sriraman Tallam <tmsriram@google.com>
1620
1621 * icf.cc (get_section_contents): Replace copies of reloc
1622 vectors with const references.
1623
ae447ddd
CC
16242014-04-02 Cary Coutant <ccoutant@google.com>
1625
1626 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1627 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1628 * configure: Regenerate.
1629 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1630 -fno-use-linker-plugin.
1631 (LINK1, CXXLINK1): Add it to the link command.
1632 * testsuite/Makefile.in: Regenerate.
1633
fa47fa92
AM
16342014-03-12 Alan Modra <amodra@gmail.com>
1635
1636 * Makefile.in: Regenerate.
1637
9b12c500
CC
16382014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1639
1640 * symtab.h (Symbol::set_nonvis): New function.
1641
beacaa96
CC
16422014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1643
1644 * symtab.cc (Sized_symbol<32>::init_output_data):
1645 Instantiate the template.
1646 (Sized_symbol<64>::init_output_data): Likewise.
1647
800d9823
CC
16482014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1649
1650 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1651 adjust dynamic symbol value.
1652 * target.h (Target::adjust_dyn_symbol): New function.
1653 (Target::do_adjust_dyn_symbol): New function.
1654
918fc1f8 16552014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1656
918fc1f8
CC
1657 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1658 Get the value of DYNAMIC_CUSTOM dynamic entry.
1659 * output.h (Output_data_dynamic::add_custom): New function.
1660 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1661 dynamic entry.
1662 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1663 * target.h (Target::dynamic_tag_custom_value): New function.
1664 (Target::do_dynamic_tag_custom_value): New function.
1665
98ff9231
CC
16662014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1667
1668 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1669 dynsym indexes.
1670 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1671 (Target::do_has_custom_set_dynsym_indexes): New function.
1672 (Target::set_dynsym_indexes): New function.
1673 (Target::do_set_dynsym_indexes): New function.
1674
b80eed39
AM
16752014-03-07 Alan Modra <amodra@gmail.com>
1676
1677 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1678 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1679 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1680 (Powerpc_relocate_functions::has_overflow_bitfield,
1681 overflowed): Use the above.
1682 (Target_powerpc::Relocate::relocate): Correct overflow checking
1683 for a number of relocations. Modify overflow test for 16-bit
1684 fields in instructions to signed/unsigned according to whether
1685 the field takes a signed or unsigned value.
1686
4b95cf5c
AM
16872014-03-05 Alan Modra <amodra@gmail.com>
1688
1689 Update copyright years.
1690
45965137
AM
16912014-03-05 Alan Modra <amodra@gmail.com>
1692
1693 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1694 R_PPC64_ADDR64_LOCAL.
1695 (Target_powerpc::Relocate::relocate): Likewise.
1696
2c80b753
AM
16972014-03-03 Alan Modra <amodra@gmail.com>
1698
1699 * dwp.cc (print_version): Update copyright year to current.
1700
c1c69e83
AM
17012014-02-10 Alan Modra <amodra@gmail.com>
1702
1703 * po/gold.pot: Regenerate.
1704
dd0c4e70
CC
17052014-02-06 Cary Coutant <ccoutant@google.com>
1706
1707 Fix problem where -u is ignored when a weak undef is seen.
1708
1709 * archive.cc (Library_base::should_include_member): Reorder
1710 code to check for -u option if a weak undef has already been seen.
1711 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1712 * testsuite/Makefile.in: Regenerate.
1713 * testsuite/weak_undef_file3.cc: New file.
1714 * testsuite/weak_undef_file4.cc: New file.
1715 * testsuite/weak_undef_test_2.cc: New file.
1716
1a221d3d
CC
17172014-02-05 Cary Coutant <ccoutant@google.com>
1718
1719 Fix issues with gold undefined symbol diagnostics.
1720
1721 PR binutils/15435
1722 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1723 check to here.
1724 * target-reloc.h (is_strong_undefined): New function.
1725 (relocate_section): Move undef vtable symbol check from here.
1726 Check for is_strong_undefined.
1727
e889f0a4 17282014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1729
e889f0a4
CC
1730 Fix problems with the --dynamic-list option.
1731
1732 PR gold/13577
1733 * options.cc (General_options::parse_dynamic_list):
1734 Set have_dynamic_list_.
1735 (General_options::General_options): Initialize have_dynamic_list_.
1736 (General_options::finalize): Turn off -Bsymbolic and
1737 -Bsymbolic-functions if --dynamic-list provided.
1738 * options.h (General_options::have_dynamic_list): New function.
1739 (General_options::have_dynamic_list_): New data member.
1740 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1741 correctly.
5fe7ffdc 1742
e889f0a4
CC
1743 PR gold/16530
1744 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1745 in --dynamic-list, mark it.
5fe7ffdc 1746
e889f0a4
CC
1747 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1748 (dynamic_list_2): New test case.
1749 * testsuite/Makefile.in: Regenerate.
1750 * testsuite/dynamic_list_2.cc: New file.
1751 * testsuite/dynamic_list_2.t: New file.
1752 * testsuite/dynamic_list_lib1.cc: New file.
1753 * testsuite/dynamic_list_lib2.cc: New file.
1754 * testsuite/gc_dynamic_list_test.c: New file.
1755 * testsuite/gc_dynamic_list_test.sh: New file.
1756 * testsuite/gc_dynamic_list_test.t: New file.
1757
ec673e64
CC
17582014-01-28 Cary Coutant <ccoutant@google.com>
1759
1760 Add .gdb_index version 7 support.
1761
1762 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1763 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1764 debug sections.
1765 (Dwarf_ranges_table::read_ranges_table): Likewise.
1766 (Dwarf_pubnames_table::read_section): Check for GNU-style
1767 sections, and for compressed debug sections.
1768 (Dwarf_pubnames_table::read_header): Compute end address of table.
1769 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1770 for end of list by offset, not by offset == 0.
1771 (Dwarf_info_reader::do_read_string_table): Check for compressed
1772 debug sections.
1773 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1774 Initialize new data members.
1775 (Dwarf_pubnames_table::next_name): return flag_byte.
1776 (Dwarf_pubnames_table::end_of_table_): New data member.
1777 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1778 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1779 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1780 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1781 read skeleton type unit DIEs.
1782 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1783 (Gdb_index::do_write): Write flag_byte.
1784 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1785 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1786 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1787 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1788
221fd5d5
L
17892014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1790
1791 * version.cc (print_version): Update copyright year to 2014.
1792
6c09fb0b
ILT
17932013-12-19 Dimitry Andric <dimitry@andric.com>
1794
1795 * stringpool.cc (Stringpool_template::reserve): Add
1796 HAVE_UNORDERED_MAP case.
1797 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1798
8356f2d0
CC
17992013-12-18 Cary Coutant <ccoutant@google.com>
1800
1801 * configure.ac: Check for <unordered_set> and <unordered_map>.
1802 * config.in: Regenerate.
1803 * configure: Regenerate.
1804 * system.h: Use <unordered_set> and <unordered_map> if available.
1805
f2c7d7ee
RM
18062013-12-10 Roland McGrath <mcgrathr@google.com>
1807
1808 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1809 with $(INSTALL_PROGRAM_ENV).
1810 * Makefile.in: Regenerate.
1811
6632e8cc
CC
18122013-11-22 Cary Coutant <ccoutant@google.com>
1813
1814 * configure.ac: Add check for which library is needed for
1815 dlopen.
1816 * configure: Regenerate.
1817
0c075858
CC
18182013-11-22 Cary Coutant <ccoutant@google.com>
1819
1820 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1821 assembler.
1822 * testsuite/Makefile.in: Regenerate.
1823
f49fe902
L
18242013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1825
1826 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1827 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1828 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1829 (Target_x86_64<size>::Scan::local): Likewise.
1830 (Target_x86_64<size>::Scan::global): Likewise.
1831 (Target_x86_64<size>::Relocate::relocate): Likewise.
1832 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1833 Likewise.
1834 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1835 R_X86_64_PC32_BND.
1836
1837 * testsuite/Makefile.am (check_PROGRAMS): Add
1838 exception_x86_64_bnd_test.
1839 (exception_x86_64_bnd_test_SOURCES): New macro.
1840 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1841 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1842 (exception_x86_64_bnd_test_LDADD): Likewise.
1843 (exception_x86_64_bnd_1.o): New rule.
1844 (exception_x86_64_bnd_2.o): Likewise.
1845 * testsuite/Makefile.in: Regenerated.
1846
9055360d
AM
18472013-11-15 Alan Modra <amodra@gmail.com>
1848
1849 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1850 accessor.
1851 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1852 Only call ppc64_local_entry_offset for 64-bit. Restrict
1853 symval_for_branch lookup to ELFv1.
1854 (Stub_table::add_plt_call_entry): Use unsigned int off.
1855 (Output_data_glink::Address, invalid_address): New.
1856 (Output_data_glink::add_eh_frame): Move out of line. Add
1857 support for ELFv2.
1858 (Output_data_glink::add_global_entry, find_global_entry,
1859 global_entry_address): New functions.
1860 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1861 ge_size): New variables.
1862 (Output_data_glink::set_final_data_size): Add global entry
1863 stub sizing.
1864 (Output_data_glink::do_write): Write global entry stubs.
1865 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1866 parameter. Return true for ELFv2. Adjust callers.
1867 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1868 ELFv1. Similarly for ifunc and dynamic relocation processing
1869 specific to ELFv1. Recognize that symbols are defined on
1870 their plt entries for ELFv2.
1871 (Target_powerpc::symval_for_branch): Assert if called for
1872 ELFv2 or ppc32.
1873 (Target_powerpc::Relocate::relocate): Use global entry plt
1874 stub for symbol value if such exists on ELFv2.
1875 (Target_powerpc::Relocate::relocate): Don't call
1876 symval_for_branch when ELFv2. Do adjust for local entry
1877 offset when ELFv2.
1878 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1879 plt stub for ELFv2.
1880 (Target_powerpc::do_plt_address_for_global): Similarly.
1881
cafdd569
CC
18822013-11-14 Cary Coutant <ccoutant@google.com>
1883
1884 Revert patch -- this did not fix the problem, and there is
1885 no race there.
1886
1887 2013-11-14 Cary Coutant <ccoutant@google.com>
1888
1889 PR gold/14860
1890 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1891 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1892 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1893 updating fde_offsets_.
1894 (Eh_frame_hdr::lock_): New data member.
1895
94e49e16
CC
18962013-11-14 Cary Coutant <ccoutant@google.com>
1897
1898 * dwp.cc (Dwo_file_entry): New type.
1899 (File_list): Use Dwo_file_entry.
1900 (Dwo_file::verify): New function.
1901 (Dwo_file::verify_dwo_list): New function.
1902 (Dwo_file::sized_verify_dwo_list): New function.
1903 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1904 list.
1905 (Dwp_options): New enum type.
1906 (dwp_options): Add --verify-only.
1907 (usage): Likewise.
1908 (main): Likewise.
1909 * dwp.h (gold_info): Add declaration.
1910
7cdd7d57
CC
19112013-11-14 Cary Coutant <ccoutant@google.com>
1912
1913 PR gold/14860
1914 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1915 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1916 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1917 updating fde_offsets_.
1918 (Eh_frame_hdr::lock_): New data member.
1919
1d946cb3
CC
19202013-11-06 Cary Coutant <ccoutant@google.com>
1921
1922 PR gold/15758
1923 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1924 before reloc sections.
1925
4f65b40e
AM
19262013-11-04 Alan Modra <amodra@gmail.com>
1927
1928 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1929 (Symbol::needs_dynamic_reloc): Test new flag.
1930 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1931 (Target_powerpc::Scan::get_reference_flags): Add target param.
1932 Return FUNC_DESC_ABI for 64-bit ELFv1.
1933 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1934 call.
1935 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1936 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1937
908794a9
CC
19382013-10-31 Cary Coutant <ccoutant@google.com>
1939
1940 Restore support for dwp v2 DWARF package file format.
1941
1942 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1943 tu_length parameter. Adjust all callers.
1944 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1945 * dwp.cc: Include dwarf.h.
1946 (Section_bounds): New struct type.
1947 (Unit_set): New struct type.
1948 (Dwo_file::Dwo_file): Initialize new data member.
1949 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1950 Combine and rename to...
1951 (Dwo_file::read_unit_index): ...this.
1952 (Dwo_file::sized_read_compunit_index)
1953 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1954 (Dwo_file::sized_read_unit_index): ...this.
1955 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1956 parameters; add section_id parameter.
1957 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1958 (Dwo_file::add_unit_set): ...this.
1959 (Dwo_file::shndx_map_): Remove.
1960 (Dwo_file::sect_offsets_): New data member.
1961 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1962 (Dwp_output_file::add_section): Rename to...
1963 (Dwp_output_file::add_contribution): ...this.
1964 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1965 (Dwp_output_file::add_tu_set): Likewise.
1966 (Dwp_output_file::Contribution): New type.
1967 (Dwp_output_file::Section::contributions): New data member.
1968 (Dwp_output_file::Cu_or_tu_set): Remove.
1969 (Dwp_output_file::Section::Section): New ctor.
1970 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1971 (Dwp_output_file::Dwp_index::Section_table): New type.
1972 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1973 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1974 parameter.
1975 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1976 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1977 (Dwp_output_file::Dwp_index::section_table): New member function.
1978 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1979 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1980 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1981 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1982 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1983 (Dwp_output_file::Dwp_index::section_table_): New data member.
1984 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1985 (Dwp_output_file::add_output_section): New member function.
1986 (Dwp_output_file::write_new_section): New member function.
1987 (Dwp_output_file::write_contributions): New member function.
1988 (Dwp_output_file::section_id_map_): New data member.
1989 (class Dwo_id_info_reader): Remove.
1990 (class Unit_reader): New class.
1991 (get_dwarf_section_name): New function.
1992 (Dwo_file::read_executable): Adjust initializations of class data.
1993 (Dwo_file::read): Add support for v2 package file format.
1994 (Dwo_file::read_unit_index): Likewise.
1995 (Dwo_file::sized_read_unit_index): Likewise.
1996 (Dwo_file::copy_section): Likewise.
1997 (Dwo_file::add_unit_set): Likewise.
1998 (Dwp_output_file::add_output_section): Likewise.
1999 (Dwp_output_file::add_contribution): Likewise.
2000 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2001 for empty slot.
2002 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2003 file format.
2004 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2005 slot.
2006 (Dwp_output_file::initialize): Remove unused function.
2007 (Dwp_output_file::finalize): Add support for v2 package file format.
2008 (Dwp_output_file::write_index): Likewise.
2009 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2010 function prototype.
2011
2500c017
CC
20122013-10-31 Cary Coutant <ccoutant@google.com>
2013
2014 * configure.ac: Fix check for -fmerge-constants.
2015 * configure.ac: Regenerate.
2016
dd0845d7
RM
20172013-10-30 Roland McGrath <mcgrathr@google.com>
2018
2019 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2020 Correct 9-byte nop sequence to match what the assembler generates.
2021
b4f7960d
AM
20222013-10-30 Alan Modra <amodra@gmail.com>
2023
2024 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2025 ppc64_local_entry_offset, ppc64_local_entry_offset,
2026 do_read_symbols): New functions.
2027 (Powerpc_relobj::e_flags_, st_other_): New vars.
2028 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2029 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2030 (Powerpc_relobj::e_flags_): New var.
2031 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2032 and adjust for ELFv2.
2033 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2034 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2035 (Powerpc_dynobj::do_find_special_sections): Likewise.
2036 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2037 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2038 to ELFv2 local entry.
2039 (Target_powerpc::do_relax): No thread safe barriers needed for
2040 ELFv2.
2041 (Output_data_plt_powerpc::initial_plt_entry_size_,
2042 plt_entry_size): Delete. Replace all uses with
2043 first_plt_entry_offset() and plt_entry_size().
2044 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2045 reserved_size parm. Update callers.
2046 (Output_data_plt_powerpc::entry_count): Update.
2047 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2048 and use Target_powerpc::first_plt_entry_offset().
2049 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2050 rename to plt_entry_size.
2051 (Output_data_plt_powerpc::add_ifunc_entry,
2052 add_local_ifunc_entry): Adjust reloc for ELFv2.
2053 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2054 (glink_eh_frame_fde_64v2): New.
2055 (Stub_table::plt_call_size): Support ELFv2 sizing.
2056 (Output_data_glink::add_eh_frame): Use the new FDE.
2057 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2058 (Stub_table::do_write): Write ELFv2 stubs and glink.
2059 (Target_powerpc::Relocate::relocate): Replaces nop after call
2060 with ld 2,24(1) and adjust local offset destination for ELFv2.
2061
f9c6b907
AM
20622013-10-30 Alan Modra <amodra@gmail.com>
2063
2064 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2065 (Target_powerpc::Scan::global, local): Likewise.
2066 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2067 on all ppc64 @h and @ha relocs.
2068
e84fe78f
AM
20692013-10-14 Alan Modra <amodra@gmail.com>
2070
2071 * output.h (Output_data_got::add_constant): Tidy.
2072 (Output_data_got::add_constant_pair): New function.
2073 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2074 methods used so as to first call reserve_ent().
2075
679e4abf
RM
20762013-10-11 Roland McGrath <mcgrathr@google.com>
2077
44dcb735
RM
2078 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2079 add_got_entry and add_got_entry_pair.
2080
13323c49
RM
2081 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2082 (HAVE_PUBNAMES): Likewise.
2083 * configure: Regenerate.
2084
1496b446
RM
2085 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2086 * testsuite/Makefile.in: Regenerate.
2087
cc84c10b
RM
2088 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2089 Remove const from declaration.
2090 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2091 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2092 * output.h (Output_file_header): Remove const from member target_
2093 and corresponding constructor argument.
2094 * output.cc (Output_file_header::Output_file_header): Update prototype.
2095 (Output_file_header::do_sized_write): Use this->target_ in place
2096 of parameters()->target().
2097
52f66a2c
RM
2098 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2099
2b64b551
RM
2100 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2101 * configure: Regenerate.
2102 * Makefile.in: Regenerate.
2103 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2104 * testsuite/merge_string_literals_2.c: Likewise.
2105 * testsuite/Makefile.am
2106 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2107 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2108 literal -fmerge-constants.
2109 * testsuite/Makefile.in: Regenerate.
2110
43819297
RM
2111 * i386.cc (Target_i386): Remove unused member dynbss_.
2112 * arm.cc (Target_arm): Likewise.
2113 * powerpc.cc (Target_powerpc): Likewise.
2114 * sparc.cc (Target_sparc): Likewise.
2115 * tilegx.cc (Target_tilegx): Likewise.
2116 * x86_64.cc (Target_x86_64): Likewise.
2117 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2118 type_signature_, type_offset_.
2119 * plugin.h (Plugin_hook): Remove unused member layout_.
2120 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2121 mapfile_.
2122 (Read_member): Remove unused members input_objects_, symtab_,
2123 mapfile_, layout_.
2124 (Check_library): Remove unused member symtab_.
2125 * archive.h (Lib_group): Remove unused member lib_.
2126 * archive.cc (Lib_group::Lib_group): Update initializer.
2127 * incremental.h (Incremental_binary): Remove unused member target_.
2128 (Incremental_script_entry): Removed unused member script_.
2129 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2130 * icf.h (Icf): Remove unused member num_tracked_relocs.
2131
39d9ead7
RM
2132 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2133 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2134 its only use.
2135 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2136
679e4abf
RM
2137 * archive.h: Use struct rather than class for forward declaration
2138 of Read_symbols_data.
2139
54de2ea6
CC
21402013-10-07 Cary Coutant <ccoutant@google.com>
2141
2142 PR gold/16010
2143 * testsuite/Makefile.am (icf_test): Fix dependencies.
2144 (icf_safe_test): Likewise.
2145 (icf_safe_so_test): Likewise.
2146 (large_symbol_alignment): Add empty _LDADD rule.
2147 * testsuite/Makefile.in: Regenerate.
2148
b14016f0
L
21492013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2150
2151 PR gold/15927
2152 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2153 relocation for R_X86_64_32 on x32.
2154
eb426534
RM
21552013-08-27 Roland McGrath <mcgrathr@google.com>
2156
2157 * output.cc (Output_segment::set_section_addresses): Take new
2158 Target* argument. If target->isolate_execinstr() and the segment
2159 is executable and starts at a target->abi_pagesize() boundary,
2160 pad its end out to a target->abi_pagesize() boundary with code fill.
2161 * output.h (Output_segment::set_section_addresses): Update decl.
2162 * layout.h (Layout::check_output_data_for_reset_values): Take new
2163 argument RELAX_OUTPUTS.
2164 (Layout): New member relax_output_list_.
2165 (Layout::add_relax_output): New method.
2166 * layout.cc (Layout::Layout): Update constructor.
2167 (Layout::reset_relax_output): New method.
2168 (Layout::clean_up_after_relaxation): Call it.
2169 (Layout::prepare_for_relaxation): Update caller.
2170 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2171 Call reset_relax_output before re-processing segments for
2172 isolate_execinstr case.
2173 (Layout::write_data): Handle relax_output_list_.
2174 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2175 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2176
9aff4b7a
NC
21772013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2178
2179 PR binutils/15834
2180 * object.h: Fix typos.
2181
93f8221c
RM
21822013-08-16 Roland McGrath <mcgrathr@google.com>
2183
2184 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2185 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2186
e44c3715
CC
21872013-08-07 Cary Coutant <ccoutant@google.com>
2188
2189 Revert support for v2 DWP files:
2190
2191 2013-03-01 Cary Coutant <ccoutant@google.com>
2192
2193 Add dwp support for v2 DWARF package file format.
2194 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2195 tu_length parameter. Adjust all callers.
2196 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2197 * dwp.cc: Include dwarf.h.
2198 (Section_bounds): New struct type.
2199 (Unit_set): New struct type.
2200 (Dwo_file::Dwo_file): Initialize new data member.
2201 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2202 Combine and rename to...
2203 (Dwo_file::read_unit_index): ...this.
2204 (Dwo_file::sized_read_compunit_index)
2205 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2206 (Dwo_file::sized_read_unit_index): ...this.
2207 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2208 parameters; add section_id parameter.
2209 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2210 (Dwo_file::add_unit_set): ...this.
2211 (Dwo_file::shndx_map_): Remove.
2212 (Dwo_file::sect_offsets_): New data member.
2213 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2214 (Dwp_output_file::add_section): Rename to...
2215 (Dwp_output_file::add_contribution): ...this.
2216 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2217 (Dwp_output_file::add_tu_set): Likewise.
2218 (Dwp_output_file::Contribution): New type.
2219 (Dwp_output_file::Section::contributions): New data member.
2220 (Dwp_output_file::Cu_or_tu_set): Remove.
2221 (Dwp_output_file::Section::Section): New ctor.
2222 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2223 (Dwp_output_file::Dwp_index::Section_table): New type.
2224 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2225 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2226 parameter.
2227 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2228 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2229 (Dwp_output_file::Dwp_index::section_table): New member function.
2230 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2231 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2232 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2233 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2234 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2235 (Dwp_output_file::Dwp_index::section_table_): New data member.
2236 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2237 (Dwp_output_file::add_output_section): New member function.
2238 (Dwp_output_file::write_new_section): New member function.
2239 (Dwp_output_file::write_contributions): New member function.
2240 (Dwp_output_file::section_id_map_): New data member.
2241 (class Dwo_id_info_reader): Remove.
2242 (class Unit_reader): New class.
2243 (get_dwarf_section_name): New function.
2244 (Dwo_file::read_executable): Adjust initializations of class data.
2245 (Dwo_file::read): Add support for v2 package file format.
2246 (Dwo_file::read_unit_index): Likewise.
2247 (Dwo_file::sized_read_unit_index): Likewise.
2248 (Dwo_file::copy_section): Likewise.
2249 (Dwo_file::add_unit_set): Likewise.
2250 (Dwp_output_file::add_output_section): Likewise.
2251 (Dwp_output_file::add_contribution): Likewise.
2252 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2253 for empty slot.
2254 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2255 file format.
2256 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2257 slot.
2258 (Dwp_output_file::initialize): Remove unused function.
2259 (Dwp_output_file::finalize): Add support for v2 package file format.
2260 (Dwp_output_file::write_index): Likewise.
2261 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2262 function prototype.
2263
c6905c28
CC
22642013-07-31 Cary Coutant <ccoutant@google.com>
2265
2266 * object.cc (Sized_relobj::do_output_section_address): New function.
2267 (Sized_relobj): Instantiate explicitly.
2268 * object.h (Object::output_section_address): New function.
2269 (Object::do_output_section_address): New function.
2270 (Sized_relobj::do_output_section_address): New function.
2271 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2272
22732013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2274 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2275
2276 * parameters.cc (Parameters::entry): Return target-specific entry
2277 symbol name.
2278 * target.h (Target::entry_symbol_name): New function.
2279 (Target_info::entry_symbol_name): New data member.
2280
2281 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2282 * i386.cc (Target_i386::i386_info): Likewise.
2283 (Target_i386_nacl::i386_nacl_info): Likewise.
2284 * sparc.cc (Target_sparc::sparc_info): Likewise.
2285 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2286 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2287 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2288 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2289
234d4ab8
SA
22902013-07-22 Sterling Augustine <saugustine@google.com>
2291
2292 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2293 Convert parameter shndx to local variable. Add parameters symtab
2294 and symtab_size. Scan over section names. Find relocation
2295 section corresponding to current section. Create and initialize
2296 reloc_mapper_ and reloc_type_.
2297 (Dwarf_pubnames_table::read_header): Add assertion. Change
2298 unit_length to off_t. Initialize member unit_length_. Fill in field
2299 cu_offset_.
2300 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2301 Initialize new fields unit_length_ and cu_offset_.
2302 (Dwarf_pubnames_table::read_section): Update prototype.
2303 (Dwarf_pubnames_table::cu_offset): New member function.
2304 (Dwarf_pubnames_table::subsection_size): Likewise.
2305 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2306 New fields.
2307 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2308 member functions public.
2309 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2310 Update comment. Rework logic. Move repeated parts to...
2311 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2312 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2313 pubtypes_table_, and stmt_list_offset.
2314 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2315 Gdb_index::find_pubtype_offset,
2316 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2317 (Gdb_index::pubnames_read): Update prototype and rework logic.
2318 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2319 Forward declare.
2320 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2321 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2322 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2323 Gdb_index::map_pubtable_to_dies):
2324 Declare functions.
2325 (Gdb_index::pubnames_read): Update declaration.
2326 (Gdb_index::Pubname_offset_map): New type.
2327 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2328 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2329 Gdb_index::stmt_list_offset): Declare.
2330 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2331 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2332 Gdb_index::pubtypes_offset_): Remove.
2333
a3ed37d8
RM
23342013-07-19 Roland McGrath <mcgrathr@google.com>
2335
2336 * options.h (General_options): Add -Trodata-segment option.
2337 * parameters.cc (Parameters::check_rodata_segment): New function.
2338 (Parameters::set_target_once): Call it.
2339 * parameters.h (Parameters): Declare it (private member function).
2340 * layout.cc (load_seg_unusable_for_headers): New function, broken
2341 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2342 then validate rodata segment rather than text segment.
2343 (relaxation_loop_body): Call that.
2344 (is_text_segment): New function. Don't admit a non-executable
2345 segment if TARGET->isolate_execinstr().
2346 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2347
eb5b4ded
CC
23482013-07-15 Shawn Landden <shawnlandden@gmail.com>
2349
2350 PR gold/15070
2351 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2352 * nacl.h (Sniff_file::View::View): Request aligned view.
2353
4d5effb9
CC
23542013-07-11 Cary Coutant <ccoutant@google.com>
2355
2356 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2357 correct BRLT entry size.
2358
ba8ca3e7
AM
23592013-07-03 Alan Modra <amodra@gmail.com>
2360
2361 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2362 comment.
2363
267257d2
CC
23642013-07-01 Cary Coutant <ccoutant@google.com>
2365
2366 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2367 reloc_type_.
2368 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2369 (Dwarf_ranges_table::lookup_reloc): New function.
2370 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2371 reloc_type_.
2372 (Dwarf_ranges_table::lookup_reloc): New function.
2373 (Dwarf_ranges_table::reloc_type_): New data member.
2374
06f30c9d
CC
23752013-06-27 Jing Yu <jingyu@google.com>
2376
2377 PR gold/15662
2378 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2379 function.
2380 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2381 (Target_powerpc::do_relax): Call the above.
2382
a2d7bf59
AM
23832013-06-27 Cary Coutant <ccoutant@google.com>
2384
2385 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2386 on garbage collected .opd section.
2387
23882013-06-27 Alan Modra <amodra@gmail.com>
2389
2390 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2391 is non-zero.
2392 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2393 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2394
32364e50
CC
23952013-06-14 Cary Coutant <ccoutant@google.com>
2396
2397 * resolve.cc (Symbol::override_base): Don't override st_type
2398 from plugin placeholder symbols.
2399 (Symbol_table::resolve): Likewise.
2400 (Symbol_table::should_override): Don't complain about TLS mismatch
2401 if the TO symbol is a plugin placeholder.
2402 * testsuite/Makefile.am (plugin_test_tls): New test.
2403 * testsuite/Makefile.in: Regenerate.
2404 * testsuite/plugin_test_tls.sh: New test script.
2405 * testsuite/two_file_test_2_tls.cc: New test source.
2406 * testsuite/two_file_test_tls.cc: New test source.
2407
7fb47cc9
CC
24082013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2409
2410 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2411 the maximum segment alignment is larger than the page size.
2412 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2413 correctly aligns the symbols with large alignemnt.
2414 * testsuite/Makefile.in: Regenerate.
2415 * testsuite/large_symbol_alignment.cc: New file.
2416
6934001a
CC
24172013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2418 Sriraman Tallam <tmsriram@google.com>
2419
2420 * options.h (sort_section): New option.
2421 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2422 Rename from Input_section_sort_section_name_special_ordering_compare.
2423 (Input_section_sort_section_name_compare): New struct.
2424 * output.cc (Output_section::Input_section_sort_section_name_compare::
2425 operator()): New function.
2426 (Output_section::sort_attached_input_sections): Use new sort function
2427 for .text if --sort-section=name is specified.
2428 * layout.cc (Layout::make_output_section):
2429 Add sorting by name when --sort-section=name is specified.
2430 * testsuite/Makefile.am (text_section_grouping): Test option
2431 --sort-section=name.
2432 * testsuite/Makefile.in: Regenerate.
2433 * testsuite/section_sorting_name.cc: New file.
2434 * testsuite/section_sorting_name.sh: New file.
2435
93acabad
CC
24362013-05-21 Cary Coutant <ccoutant@google.com>
2437
2438 * symtab.h (Symbol::is_cxx_vtable): New function.
2439 * target-reloc.h (relocate_section): Check for vtable symbol.
2440 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2441 * testsuite/Makefile.in: Regenerate.
2442 * testsuite/missing_key_func.cc: New test source.
2443 * testsuite/missing_key_func.sh: New test script.
2444
60e8b3fc
CC
24452013-05-21 Cary Coutant <ccoutant@google.com>
2446
2b64b551
RM
2447 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2448 type of enclosing symbol.
2449 (Relocate_info::location): Check symbol type when describing symbol.
2450 * object.h (Symbol_location_info): Remove unused line_number;
2451 add enclosing_symbol_type.
2452 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2453
9df9de2c
CC
24542013-05-13 Cary Coutant <ccoutant@google.com>
2455
2b64b551
RM
2456 * configure.ac: Export DEFAULT_TARGET.
2457 * configure: Regenerate.
2458 * Makefile.in: Regenerate.
2459 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2460 * testsuite/Makefile.in: Regenerate.
2461 * testsuite/debug_msg.sh: Delete duplicate tests.
2462 Don't check undef_int error message match for powerpc where the
2463 source file and line number aren't available.
9df9de2c 2464
bbc5ae17
RM
24652013-05-10 Roland McGrath <mcgrathr@google.com>
2466
2467 * options.h (General_options): Add --rosegment-gap option.
2468 * options.cc (finalize): --rosegment-gap implies --rosegment.
2469 * layout.cc (set_segment_offsets): Let user option override
2470 target->rosegment_gap().
2471
0c6e6c39
RM
24722013-05-10 Roland McGrath <mcgrathr@google.com>
2473
2474 * options.h (General_options): Remove leading space from help
2475 messages for -nostdlib and --rosegment.
2476
cde7cb01
MR
24772013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2478
2479 PR ld/15365
2480 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2481
f31ae5b8
AM
24822013-05-03 Alan Modra <amodra@gmail.com>
2483
2484 * merge.cc (Output_merge_string::do_add_input_section): Correct
2485 scan for number of strings. Rename vars to avoid shadowing.
2486 Include missing terminator in input_size_.
2487
d3a7cd45
L
24882013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2489
2490 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2491 Restore empty string handling.
2492
6ad3daba
CC
24932013-05-01 Cary Coutant <ccoutant@google.com>
2494
2495 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2496 uninitialized warning.
2497
e31908b6
CC
24982013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2499
2500 * output.cc (Output_section::add_merge_input_section): Allow
2501 to merge sections if the alignment is more than character size.
2502 * merge.h (Output_merge_string::Output_merge_string): Remove
2503 assert.
2504 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2505 only not-null strings. Check the alignment of strings.
2506 * stringpool.h
2507 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2508 alignment as the argument.
2509 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2510 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2511 Align non-zero length strings according to the addralign_.
2512 (Stringpool_template<Stringpool_char>::set_string_offsets):
2513 Updating offsets according to the given alignment.
2514 * testsuite/Makefile.am (text_section_grouping): Test if string
2515 literals are getting merged.
2516 * testsuite/Makefile.in: Regenerate.
2517 * testsuite/merge_string_literals_1.c: New file.
2518 * testsuite/merge_string_literals_2.c: Ditto.
2519 * testsuite/merge_string_literals.sh: Ditto.
2520
0e804863
ILT
25212013-04-26 Ian Lance Taylor <iant@google.com>
2522
2523 * target-reloc.h (relocate_section): If the reloc offset is out of
2524 range, pass VIEW as NULL to relocate.relocate.
2525 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2526 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2527 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2528 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2529 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2530 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2531
e7c5ea40
CC
25322013-04-26 Geoff Pike <gpike@chromium.org>
2533
2534 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2535 * layout.cc (Hash_task): New class.
2536 (Layout::queue_build_id_tasks): New function.
2537 (Layout::write_build_id): Handle single-thread portion of build ID
2538 computation. (In some cases, all of it is single-threaded.) Replace
2539 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2540 functionality in fewer lines of code.
2541 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2542 * options.h (General_options): make "--build-id" default to tree
2543 rather than sha1. Add two new options related to --build-id=tree:
2544 --build-id-chunk-size-for-treehash and
2545 --build-id-min-file-size-for-treehash.
2546 * Makefile.am: add testing of --build-id=tree and related new options
2547 (these tests will be invoked by "make check").
2548 * Makefile.in: Regenerate.
2549
49926cd0
AM
25502013-04-25 Alan Modra <amodra@gmail.com>
2551
2552 * configure.tgt: Add powerpcle and powerpc64le.
2553
a4034750
AM
25542013-04-22 Alan Modra <amodra@gmail.com>
2555
2556 PR gold/15355
2557 * layout.cc (Layout::segment_precedes): Allow more than one
2558 segment with the same type and flags.
2559
e79c84aa
CC
25602013-04-15 Cary Coutant <ccoutant@google.com>
2561
2562 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2563 allocate space in file for BSS sections.
2564
2199fbe7
CC
25652013-04-15 Cary Coutant <ccoutant@google.com>
2566
2567 * script-sections.cc (Orphan_output_section): Reset address
2568 to zero after each orphaned section for relocatable links.
2569
502e8a84
CC
25702013-04-15 Cary Coutant <ccoutant@google.com>
2571
a4034750
AM
2572 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2573 section starting address for relocatable link.
2574 * testsuite/Makefile.am (script_test_11): New test.
2575 * testsuite/Makefile.in: Regenerate.
2576 * testsuite/script_test_11.c: New source file.
2577 * testsuite/script_test_11.t: New linker script.
502e8a84 2578
0cfdc767
AM
25792013-04-13 Alan Modra <amodra@gmail.com>
2580
2581 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2582 owner when sections are not adjacent and exceed group size.
2583 (Target_powerpc::group_sections): Handle corner case.
2584 (Target_powerpc::Branch_info::make_stub): Handle case where
2585 stub table doesn't exist due to branches in non-exec sections.
2586 (Target_powerpc::Relocate::relocate): Likewise.
2587
6830ee24
AM
25882013-04-11 Alan Modra <amodra@gmail.com>
2589
2590 PR gold/15354
2591 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2592 .branch_lt to match bfd ld. Adjust comments throughout file.
2593
54a3d865
ILT
25942013-04-04 Ian Lance Taylor <iant@google.com>
2595
2596 GCC PR c++/56840
2597 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2598 sections before checking whether they are included in the link.
2599
9993ba11
ST
26002013-03-29 Sriraman Tallam <tmsriram@google.com>
2601
2602 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2603 object before calling the plugin claim_file handler. Pass the elf
2604 object of the archive to the plugin. Delete the elf object if the
2605 plugin claims the file.
2606
ebacd51e
AM
26072013-03-21 Alan Modra <amodra@gmail.com>
2608
2609 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2610 segment when omagic.
2611
117be58f
AM
26122013-03-21 Alan Modra <amodra@gmail.com>
2613
2614 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2615 comparison warning.
2616 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2617 uninitialized" warning.
2618
32e2b61d
AM
26192013-03-20 Alan Modra <amodra@gmail.com>
2620
2621 * symtab.h (Symbol::clear_version): New function.
2622 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2623 is_needed by weak references. Clear version for symbols defined
2624 in as-needed objects that are not needed.
2625
b3ccdeb5
AM
26262013-03-15 Alan Modra <amodra@gmail.com>
2627
2628 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2629 static and public. Add report_err param. Return false for data refs.
2630 (Target_powerpc::rela_dyn_section): New overloaded function.
2631 (Target_powerpc::plt_, iplt_): Elucidate.
2632 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2633 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2634 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2635 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2636 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2637 push_branch and make_plt_entry for ifunc syms when
2638 reloc_needs_plt_for_ifunc.
2639 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2640 for ifunc unless reloc_needs_plt_for_ifunc.
2641
ad3d8a2f
AM
26422013-03-15 Alan Modra <amodra@gmail.com>
2643
2644 * gc.h (gc_process_relocs): Don't look through function descriptors.
2645 * icf.cc (get_section_contents): Do so here instead.
2646
4d9aa155
AM
26472013-03-13 Alan Modra <amodra@gmail.com>
2648
2649 * powerpc.cc (is_branch_reloc): Forward declare.
2650 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2651 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2652 false for 64-bit, true for 32-bit non-branch relocs.
2653 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2654 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2655 nm output.
2656 (icf_safe_test): Generate linker map file as well as nm output.
2657 (icf_safe_so_test): Likewise.
2658 * testsuite/Makefile.in: Regenerate.
2659 * testsuite/icf_test.sh: Parse linker map file to determine
2660 section folding.
2661 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2662 * testsuite/icf_safe_so_test.sh: Likewise.
2663 (X86_32_or_ARM_specific_safe_fold): Merge into..
2664 (arch_specific_safe_fold): ..this.
2665 (X86_64_specific_safe_fold): Delete unused function.
2666
57420c20
AM
26672013-03-12 Alan Modra <amodra@gmail.com>
2668
2669 * gc.h (gc_process_relocs): Look through function descriptors
2670 to determine shndx, symvalue and addend used by ICF. Tidy
2671 variable duplication.
2672
dc3714f3
AM
26732013-03-11 Alan Modra <amodra@gmail.com>
2674
2675 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2676 * layout.cc (Layout_task_runner::run): ..to here.
2677 * symtab.h (struct Symbol_location): Extract from..
2678 (class Symbol_table): ..here.
2679 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2680 * target.h (class Target): Add function_location and
2681 do_function_location functions.
2682 (class Sized_target): Add do_function_location.
2683 * object.h (class Sized_relobj_file): Move find_shdr..
2684 (class Object): ..to here.
2685 * object.cc: Likewise. Update to suit. Instantiate.
2686 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2687 * powerpc.cc (class Powerpc_dynobj): New.
2688 (Target_powerpc::do_function_location): New function.
2689 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2690 (Powerpc_dynobj::do_read_symbols): New function.
2691 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2692
956b03bb
ILT
26932013-03-08 Ian Lance Taylor <iant@google.com>
2694
2695 * options.cc (General_options::string_to_object_format): Accept
2696 "default".
2697
4bead2d5
AM
26982013-03-08 Alan Modra <amodra@gmail.com>
2699
2700 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2701 pointer to Post_fde.
2702 (struct Post_fde): Move definition to here..
2703 * ehframe.cc (struct Post_fde): ..from here.
2704 (Cie::write): Don't alloc Post_fde.
2705 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2706
02e60bf7
AM
27072013-03-07 Alan Modra <amodra@gmail.com>
2708
2709 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2710 relocation referencing .LC0.
2711 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2712
8343f03a
AM
27132013-03-07 Alan Modra <amodra@gmail.com>
2714
2715 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2716 always_inline. Add assembly for powerpc to avoid GOT.
2717
3366d57c
AM
27182013-03-07 Alan Modra <amodra@gmail.com>
2719
2720 * testsuite/script_test_10.sh: Don't test .bss section
2721 header number.
2722
6c77229c
AM
27232013-03-06 Alan Modra <amodra@gmail.com>
2724
2725 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2726 (Target_powerpc::symval_for_branch): Add symtab param. Update
2727 all callers. Handle folded sections.
2728 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2729 to Powerpc_relobj.
2730 (Global_symbol_visitor_opd::operator()): Likewise.
2731
a39e4af6
AM
27322013-03-04 Alan Modra <amodra@gmail.com>
2733
2734 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2735 * testsuite/Makefile.in: Regenerate.
2736
d5834edb
CC
27372013-03-01 Cary Coutant <ccoutant@google.com>
2738
2739 Add dwp support for v2 DWARF package file format.
2740 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2741 tu_length parameter. Adjust all callers.
2742 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2743 * dwp.cc: Include dwarf.h.
2744 (Section_bounds): New struct type.
2745 (Unit_set): New struct type.
2746 (Dwo_file::Dwo_file): Initialize new data member.
2747 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2748 Combine and rename to...
2749 (Dwo_file::read_unit_index): ...this.
2750 (Dwo_file::sized_read_compunit_index)
2751 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2752 (Dwo_file::sized_read_unit_index): ...this.
2753 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2754 parameters; add section_id parameter.
2755 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2756 (Dwo_file::add_unit_set): ...this.
2757 (Dwo_file::shndx_map_): Remove.
2758 (Dwo_file::sect_offsets_): New data member.
2759 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2760 (Dwp_output_file::add_section): Rename to...
2761 (Dwp_output_file::add_contribution): ...this.
2762 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2763 (Dwp_output_file::add_tu_set): Likewise.
2764 (Dwp_output_file::Contribution): New type.
2765 (Dwp_output_file::Section::contributions): New data member.
2766 (Dwp_output_file::Cu_or_tu_set): Remove.
2767 (Dwp_output_file::Section::Section): New ctor.
2768 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2769 (Dwp_output_file::Dwp_index::Section_table): New type.
2770 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2771 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2772 parameter.
2773 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2774 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2775 (Dwp_output_file::Dwp_index::section_table): New member function.
2776 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2777 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2778 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2779 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2780 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2781 (Dwp_output_file::Dwp_index::section_table_): New data member.
2782 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2783 (Dwp_output_file::add_output_section): New member function.
2784 (Dwp_output_file::write_new_section): New member function.
2785 (Dwp_output_file::write_contributions): New member function.
2786 (Dwp_output_file::section_id_map_): New data member.
2787 (class Dwo_id_info_reader): Remove.
2788 (class Unit_reader): New class.
2789 (get_dwarf_section_name): New function.
2790 (Dwo_file::read_executable): Adjust initializations of class data.
2791 (Dwo_file::read): Add support for v2 package file format.
2792 (Dwo_file::read_unit_index): Likewise.
2793 (Dwo_file::sized_read_unit_index): Likewise.
2794 (Dwo_file::copy_section): Likewise.
2795 (Dwo_file::add_unit_set): Likewise.
2796 (Dwp_output_file::add_output_section): Likewise.
2797 (Dwp_output_file::add_contribution): Likewise.
2798 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2799 for empty slot.
2800 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2801 file format.
2802 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2803 slot.
2804 (Dwp_output_file::initialize): Remove unused function.
2805 (Dwp_output_file::finalize): Add support for v2 package file format.
2806 (Dwp_output_file::write_index): Likewise.
2807 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2808 function prototype.
2809
a68a081d
CC
28102013-03-01 Cary Coutant <ccoutant@google.com>
2811
2812 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2813 function into class definition in header file.
2814 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2815 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2816 New function.
2817 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2818
9d5781f8
AM
28192013-02-28 Alan Modra <amodra@gmail.com>
2820
2821 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2822 * target.cc (Target::do_plt_fde_location): New function.
2823 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2824 accessor function, and constructor param.
2825 (struct Post_fde, Post_fdes): Declare.
2826 (Cie::write): Add post_fdes param.
2827 * ehframe.cc (Fde::write): Use plt_fde_location.
2828 (struct Post_fde): Define.
2829 (Cie::write): Stash FDEs added post merge mapping.
2830 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2831 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2832 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2833 other FDEs.
2834 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2835 (Target_powerpc::has_glink): New function.
2836 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2837 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2838 glink_eh_frame_fde_32, default_fde): New data.
2839 (Stub_table::eh_frame_added_): New var.
2840 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2841 Make const.
2842 (Stub_table::add_eh_frame): New function.
2843 (Output_data_glink::add_eh_frame): New function.
2844 (Target_powerpc::make_glink_section): Call add_eh_frame.
2845
214383dd
ILT
28462013-02-15 Ian Lance Taylor <iant@google.com>
2847
2848 * options.h (DEFINE_uint64_alias): Define.
2849 (class General_options): Add -Ttext-segment as an alias for
2850 -Ttext.
2851
91c2b899
AM
28522013-02-15 Alan Modra <amodra@gmail.com>
2853
2854 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2855 (Stub_table::do_write): ..here, two places.
2856 (Stub_table::plt_call_size): Use it here too.
2857
20e2a8aa
ILT
28582013-02-11 Ian Lance Taylor <iant@google.com>
2859
2860 * descriptors.cc (Descriptors::close_all): New function.
2861 * descriptors.h (class Descriptors): Declare close_all.
2862 (close_all_descriptors): New inline function.
2863 * plugin.cc: Include "descriptors.h".
2864 (Plugin_manager::cleanup): Call close_all_descriptors.
2865
8952bc69
AM
28662013-02-06 Alan Modra <amodra@gmail.com>
2867
2868 * README: Update coding style link.
2869
29bd8b6b
CC
28702013-01-28 Cary Coutant <ccoutant@google.com>
2871
a4034750
AM
2872 * dwp.cc (File_list): New typedef.
2873 (Dwo_name_info_reader): New class.
2874 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2875 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2876 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2877 (Dwo_file::read_executable): New function.
2878 (Dwo_file::read): Move common setup code to ...
2879 (Dwo_file::make_object): ... here.
2880 (dwp_options): Add --exec/-e.
2881 (usage): Likewise.
2882 (main): Likewise.
29bd8b6b 2883
c6ac678d
ST
28842013-01-24 Sriraman Tallam <tmsriram@google.com>
2885
2886 * layout.cc (Layout::layout): Check for option text_reorder.
2887 (Layout::make_output_section): Ditto.
2888 * options.h (text_reorder): New option.
2889 * output.cc (Input_section_sort_compare): Remove special ordering
2890 of section names.
2891 (Output_section::
2892 Input_section_sort_section_name_special_ordering_compare::
2893 operator()): New function.
2894 (Output_section::sort_attached_input_sections): Use new sort function
2895 for .text.
2896 * output.h (Input_section_sort_section_name_special_ordering_compare):
2897 New struct.
2898 * testsuite/Makefile.am (text_section_grouping): Test option
2899 --no-text-reorder
2900 * testsuite/Makefile.in: Regenerate.
2901 * testsuite/text_section_grouping.sh: Check order of functions without
2902 default text reordering.
2903
50701cc1
MF
29042013-01-18 Mike Frysinger <vapier@gentoo.org>
2905
2906 * options.h (General_options): Change default to true for new_dtags.
2907
b1b00fcc
MF
29082013-01-18 Mike Frysinger <vapier@gentoo.org>
2909
2910 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2911 when enable_new_dtags is false. Only add DT_RUNPATH when
2912 enable_new_dtags is true.
2913
ec5b8187
AM
29142013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2915
2916 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2917 used in declaration and definition consistent.
2918 (Target_powerpc::symval_for_branch): Ditto.
2919
a880d4c4
ST
29202013-01-16 Sriraman Tallam <tmsriram@google.com>
2921
2922 * testsuite/plugin_final_layout.cc: Fix comment.
2923
7c381248
ST
29242013-01-16 Sriraman Tallam <tmsriram@google.com>
2925
2926 * layout.cc (Layout::layout): Do not do default sorting for
2927 text sections when section ordering is specified.
2928 (make_output_section): Ditto.
2929 * testsuite/plugin_final_layout.cc: Name the function sections
2930 to catch reordering issues.
2931
e2458743
AM
29322013-01-15 Alan Modra <amodra@gmail.com>
2933
2934 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2935 plt-thread-safe.
2936
431ed302
AM
29372013-01-15 Alan Modra <amodra@gmail.com>
2938
2939 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2940 * testsuite/Makefile.in: Regenerate.
2941
0ec6429b
AM
29422013-01-14 Alan Modra <amodra@gmail.com>
2943
2944 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2945 * testsuite/Makefile.in: Regenerate.
2946
0bf402d5
ILT
29472013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2948
36af3926 2949 PR bfd/14430
0bf402d5
ILT
2950 Fix mingw gold build with plugins enabled
2951 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2952 * configure.ac: Export DLOPEN_LIBS and add headers check.
2953 * plugin.cc: Handle non-dlfcn case.
2954 * Makefile.in: Regenerate.
2955 * config.in: Regenerate.
2956 * configure: Regenerate.
2957 * testsuite/Makefile.in: Regenerate.
2958
9e9143bc
ST
29592013-01-09 Sriraman Tallam <tmsriram@google.com>
2960
2961 * output.h (sort_attached_input_sections): Change to be public.
2962 * script-sections.cc
2963 (Output_section_definition::set_section_addresses): Sort
2964 attached input sections according to section order before linker
2965 script assigns section addresses.
2966 (Orphan_output_section::set_section_addresses): Sort
2967 attached input sections according to section order before linker
2968 script assigns section addresses.
2969 * Makefile.am (final_layout.sh): Use a simple linker script to
2970 check if section ordering still works.
2971 * Makefile.in: Regenerate.
2972
679af368
ILT
29732013-01-09 Ben Cheng <bccheng@google.com>
2974
2975 * arm.cc (Target_arm::attributes_accept_div): New function.
2976 (Target_arm::attributes_forbid_div): New function.
2977 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2978 attribute using the same new functions as what bfd/elf32_arm.c
2979 does.
2980
3136a00e
CC
29812013-01-07 Cary Coutant <ccoutant@google.com>
2982
2983 PR gold/14993
2984 * output.cc (Output_section::add_input_section): For incremental
2985 updates, don't track input sections that are allocated from patch
2986 space.
2987
f2a6224b
L
29882013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2989 Ian Lance Taylor <iant@google.com>
2990
2991 PR gold/14897
2992 * configure.ac (--enable-ld): Removed.
2993 (install_as_default): Set to yes only for --enable-gold=default
2994 or --disable-ld.
2995 * configure: Regenerated.
2996
4f46f626
L
29972013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2998
2999 * options.h (General_options): Add -fuse-ld= for GCC linker
3000 option compatibility.
3001
26e4ef59
CC
30022013-01-04 Cary Coutant <ccoutant@google.com>
3003
3004 * configure.ac: Fix typo restoring CXXFLAGS.
3005 * configure: Regenerate.
3006
3d587466
CC
30072013-01-04 Cary Coutant <ccoutant@google.com>
3008
4f46f626
L
3009 * testsuite/Makefile.am (CXXLINK_S): New macro.
3010 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3011 * testsuite/Makefile.in: Regenerate.
3d587466 3012
44db6695
L
30132013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3014
3015 * version.cc (print_version): Update copyright year to 2013.
3016
edcac0c1
ILT
30172012-12-20 Ian Lance Taylor <iant@google.com>
3018
3019 * layout.cc (Layout::special_ordering_of_input_section): New
3020 function.
3021 (Layout::layout): If input section requires special ordering, must
3022 sort input sections.
3023 (Layout::make_output_section): May sort .text input sections.
3024 (Layout::is_section_name_prefix_grouped): Remove.
3025 * layout.h (class Layout): Declare
3026 special_ordering_of_input_section. Don't declare
3027 is_section_name_prefix_grouped.
3028 * output.cc (Output_section::add_input_section): Revert last
3029 change.
3030 (Output_section::Input_section_sort::match_file_name): Don't crash
3031 if called on output section data.
3032 (Output_section::Input_section_sort_compare): Sort based on
3033 special ordering.
3034 (Output_section::Input_section_sort_section_order_index_compare):
3035 Revert last patch.
3036 (Output_section::sort_attached_input_sections): Likewise.
3037
28f2a4ac
ST
30382012-12-18 Sriraman Tallam <tmsriram@google.com>
3039
edcac0c1 3040 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3041 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3042 * output.cc (Output_section::add_input_section): Check if section
3043 name contains special prefix. Keep input sections to sort such
3044 sections.
3045 (Output_section::Input_section_sort_section_order_index_compare
3046 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3047 (Output_section::sort_attached_input_sections): Add condition to
3048 Input_section_entry constructor call.
28f2a4ac
ST
3049 * testsuite/Makefile.am (text_section_grouping): New test.
3050 * testsuite/Makefile.in: Regenerate.
3051 * testsuite/text_section_grouping.cc: New file.
3052 * testsuite/text_section_grouping.sh: New file.
3053
5bf135a7
NC
30542012-12-17 Nick Clifton <nickc@redhat.com>
3055
3056 * Makefile.am: Add copyright notice.
3057 * NEWS: Likewise.
3058 * README: Likewise.
3059 * configure.ac: Likewise.
3060 * ftruncate.c: Likewise.
3061 * Makefile.in: Regenerate.
3062
59965708
CC
30632012-12-14 Cary Coutant <ccoutant@google.com>
3064
a4034750
AM
3065 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3066 --no-as-needed flag.
3067 (exception_separate_shared_12_test): Likewise.
3068 (incremental_copy_test): Likewise.
3069 * testsuite/Makefile.in: Regenerate.
59965708 3070
2a77e2ab
CC
30712012-12-14 Cary Coutant <ccoutant@google.com>
3072
3073 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3074 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3075
e3deeb9c
AM
30762012-12-12 Alan Modra <amodra@gmail.com>
3077
3078 * powerpc.cc (class Track_tls): New.
3079 (class Relocate, class Scan): Inherit Track_tls.
3080 (Target_powerpc::Scan::local, global): Track tls optimization
3081 and avoid creating plt entry for __tls_get_addr if all uses
3082 are optimized away.
3083 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3084
d8f5a274
AM
30852012-12-12 Alan Modra <amodra@gmail.com>
3086
3087 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3088 Replace no_toc_optimize with toc_optimize.
3089 * output.h (Output_section::input_sections): Provide non-const variant.
3090 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3091 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3092 accessors.
3093 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3094 (class Sort_toc_sections): New.
3095 (Target_powerpc::do_finalize_sections): Sort toc sections.
3096 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3097
4c8a1de1
RM
30982012-12-10 Roland McGrath <mcgrathr@google.com>
3099
3100 * testsuite/binary_unittest.cc (read_all): New function.
3101 (Sized_binary_test): Use it instead of ::read.
3102 * fileread.cc (do_read): Don't assume pread always reads the whole
3103 amount in a single call.
3104
edc27beb
AM
31052012-12-10 Alan Modra <amodra@gmail.com>
3106
3107 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3108 Set EM_PPC64 or EM_PPC here.
3109 (Target_selector_powerpc::do_recognize): Delete.
3110
906b9150
AM
31112012-12-10 Alan Modra <amodra@gmail.com>
3112
3113 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3114 stub_table_.
3115 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3116
418c15ae
RM
31172012-12-07 Roland McGrath <mcgrathr@google.com>
3118
3119 * testsuite/binary_unittest.cc (Sized_binary_test):
3120 Use open_descriptor rather than ::open.
3121
decdd3bc
AM
31222012-12-07 Alan Modra <amodra@gmail.com>
3123
3124 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3125 typedef and invalid_address constant.
3126 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3127 instantiate constants.
3128
db399005
ILT
31292012-12-06 Roland McGrath <mcgrathr@google.com>
3130
3131 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3132 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3133 * aclocal.m4: Regenerate.
3134 * configure: Regenerate.
3135 * Makefile.in: Regenerate.
3136 * testsuite/Makefile.in: Regenerate.
3137
aba6bc71
AM
31382012-12-07 Alan Modra <amodra@gmail.com>
3139
3140 * options.h (General_options): Add no_toc_optimize.
3141 * powerpc.cc (ok_lo_toc_insn): New function.
3142 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3143
9e69ed50
AM
31442012-12-06 Alan Modra <amodra@gmail.com>
3145
3146 * options.h (General_options): Add plt_align, plt_static_chain,
3147 plt_thread_safe. Update stub_group_size help text.
3148 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3149 for new plt_thread_safe_ var.
3150 (use_plt_offset): Correct comments.
3151 (Target_powerpc::do_relax): Look for thread creation symbols to
3152 determine default plt_thread_safe value. Clear plt call stubs
3153 as well as branch stubs each iteration.
3154 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3155 insn constants.
3156 (l, hi, ha, write_insn): Move earlier.
3157 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3158 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3159 plt stubs too.
3160 (Stub_table::update_size): Adjust.
3161 (Stub_table::prev_size, set_prev_size): Delete.
3162 (Stub_table::stub_align): Let --plt-align affect result.
3163 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3164 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3165 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3166 (Stub_table::do_write): Support more stub variants.
3167
f43ba157
AM
31682012-12-04 Alan Modra <amodra@gmail.com>
3169
3170 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3171 (Target_powerpc::do_define_standard_symbols): New function.
3172
34171bc5
AM
31732012-12-03 Alan Modra <amodra@gmail.com>
3174
3175 * output.h: Formatting, whitespace.
3176
dc9589e9 31772012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3178
3179 * layout.h (Layout::get_executable_sections): Declare.
3180 * layout.cc (Layout::get_executable_sections): New function.
3181 * arm.cc (Target_arm::group_sections): Use it.
3182 (Arm_output_section::group_sections): Delete now redundant test.
3183 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3184 param to handle relative relocs.
3185 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3186 (Output_data_reloc::add_absolute): Adjust.
3187 (Output_data_reloc::add_relative): New function.
3188 (Output_data::reset_data_size): New function.
3189 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3190 (Output_section::set_addralign): New function.
3191 (Output_section::checkpoint_set_addralign): New function.
3192 (Output_section::clear_section_offsets_need_adjustment): New function.
3193 (Output_section::input_sections): Make public.
3194 * powerpc.cc (class Output_data_brlt_powerpc): New.
3195 (class Stub_table, class Stub_control): New.
3196 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3197 stub_table_, set_stub_table, stub_table): New vectors and accessor
3198 functions.
3199 (Target_powerpc::do_may_relax, do_relax, push_branch,
3200 new_stub_table, stub_tables, brlt_section, group_sections,
3201 add_branch_lookup_table, find_branch_lookup_table,
3202 write_branch_lookup_table, make_brlt_section): New functions.
3203 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3204 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3205 branch_info_): New vars.
3206 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3207 make call stubs here.
3208 (Output_data_glink): Remove all call stub handling from this class.
3209 (Target_powerpc::Scan::local, global): Save interesting branch
3210 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3211 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3212 functions on final link.
3213 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3214 Handle long branch destinations too.
3215 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3216 do_plt_address_for_local): Adjust lookup of plt call stubs.
3217
627b30b7
AM
32182012-11-30 Alan Modra <amodra@gmail.com>
3219
3220 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3221 relocs against protected symbols when building 32-bit shared libs.
3222
40b469d7
AM
32232012-11-30 Alan Modra <amodra@gmail.com>
3224
3225 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3226 param. Call got_section() to make .got. Update all callers
3227 and their callers and so on.
3228
bb66a627
AM
32292012-11-30 Alan Modra <amodra@gmail.com>
3230
3231 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3232 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3233 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3234 value if it already exists.
3235
d2cf1c6c
L
32362012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3237
3238 PR gold/14858
3239 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3240
edccdf7c
RM
32412012-11-14 Roland McGrath <mcgrathr@google.com>
3242
3243 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3244 than bfc instruction for data sandboxing.
3245
6febeb74
AM
32462012-11-08 Alan Modra <amodra@gmail.com>
3247
3248 * po/POTFILES.in: Regenerate.
3249
0a6f1bf2
AM
32502012-11-05 Alan Modra <amodra@gmail.com>
3251
3252 * configure.ac: Apply 2012-09-10 change to config.in here.
3253 * configure: Regenerate.
3254
26a4e9cb
AM
32552012-11-05 Alan Modra <amodra@gmail.com>
3256
3257 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3258 (struct Opd_ent): Use "Address" rather than "Offset".
3259 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3260 (Target_powerpc::got_section): Make public.
3261 (Target_powerpc::scan_relocs): Move code setting symbols..
3262 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3263 Create _SDA_BASE_ only when referenced.
3264
cc928013
RM
32652012-11-02 Roland McGrath <mcgrathr@google.com>
3266
3267 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3268 from last change.
3269
50ed5eb1
RM
32702012-11-01 Roland McGrath <mcgrathr@google.com>
3271
62fe925a
RM
3272 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3273 for offset_in_output_section parameter.
3274 (Sized_target::relocate_special_relocatable): Likewise.
3275 * arm.cc (Target_arm::relocate_relocs): Likewise.
3276 (Target_arm::relocate_special_relocatable): Likewise.
3277 * i386.cc (Target_i386::relocate_relocs): Likewise.
3278 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3279 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3280 * target-reloc.h (relocate_relocs): Likewise.
3281 * testsuite/testfile.cc (Target_test): Likewise.
3282 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3283 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3284
3285 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3286 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3287
3288 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3289 parameter, which is unused in the [!F_SETFD] case.
3290
50ed5eb1
RM
3291 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3292 SYMNDX to off_t before comparing it to this->data_size().
3293 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3294 * incremental.cc (Output_section_incremental_inputs::do_write):
3295 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3296
2cadc0bf
RM
3297 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3298
3bfcb652
NC
32992012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3300
3301 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3302 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3303 in EABI_VER5.
3304
c1a8d56e
CC
33052012-10-29 Cary Coutant <ccoutant@google.com>
3306
3307 * dwp.cc (usage): Add file and exit status parameters;
3308 add --help and --version options.
3309 (print_version): New function.
3310 (main): Add --help and --version options.
3311
b2490a7b
L
33122012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3313
3314 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3315 final_layout_sequence.txt.
3316 * testsuite/Makefile.in: Regenerated.
3317
aa543512
L
33182012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3319
3320 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3321 COMPILE generated by automake.
3322 (LINK1): Likewise.
3323 (CXXCOMPILE1): Likewise.
3324 (CXXLINK1): Likewise.
3325 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3326 (LINK): Likewise.
3327 (CXXCOMPILE): Likewise.
3328 (CXXLINK): Likewise.
3329 * testsuite/Makefile.in: Regenerated.
3330
d361fafb
L
33312012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3332
3333 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3334 on bad fwrite return.
3335
598c7410
L
33362012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3337
3338 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3339 on val.
3340
35c813e2
CC
33412012-10-23 Cary Coutant <ccoutant@google.com>
3342
3343 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3344 * testsuite/Makefile.in: Regenerate.
3345 * testsuite/dwp_test.h: New source file.
3346 * testsuite/dwp_test_1.cc: New source file.
3347 * testsuite/dwp_test_1.s: New source file.
3348 * testsuite/dwp_test_1.sh: New source file.
3349 * testsuite/dwp_test_1b.cc: New source file.
3350 * testsuite/dwp_test_1b.s: New source file.
3351 * testsuite/dwp_test_2.cc: New source file.
3352 * testsuite/dwp_test_2.s: New source file.
3353 * testsuite/dwp_test_2.sh: New source file.
3354 * testsuite/dwp_test_main.cc: New source file.
3355 * testsuite/dwp_test_main.s: New source file.
3356
77429909
CC
33572012-10-23 Cary Coutant <ccoutant@google.com>
3358
3359 * dwp.h: New header file.
3360 * dwp.cc: New source file.
3361 * gold.h: Move shared declarations to system.h.
3362 * system.h: New header file.
3363 * Makefile.am: Add dwp.
3364 * Makefile.in: Regenerate.
3365
ed5d6712
CC
33662012-10-23 Cary Coutant <ccoutant@google.com>
3367
3368 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3369 Dwarf_info_reader::read_from_pointer.
3370 (Dwarf_pubnames_table::read_header): Likewise.
3371 (Dwarf_pubnames_table::next_name): Likewise.
3372 (Dwarf_die::read_attributes): Likewise.
3373 (Dwarf_die::skip_attributes): Likewise.
3374 (Dwarf_info_reader::read_from_pointer): New function template.
3375 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3376 (Dwarf_pubnames_table): Likewise.
3377 (Dwarf_info_reader::read_from_pointer): New function template.
3378 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3379 Dwarf_pubnames_table ctor.
3380
8787852d
CC
33812012-10-23 Cary Coutant <ccoutant@google.com>
3382
3383 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3384 abbrev_shndx.
3385 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3386 abbrev_shndx_.
3387 (Dwarf_info_reader::set_abbrev_shndx): New method.
3388 (Dwarf_info_reader::abbrev_shndx_): New data member.
3389
9fc236f3
CC
33902012-10-23 Cary Coutant <ccoutant@google.com>
3391
3392 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3393 from object, not parameters.
3394 (Dwarf_info_reader::parse): Likewise.
3395 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3396 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3397 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3398 methods.
3399
effe8365
CC
34002012-10-23 Cary Coutant <ccoutant@google.com>
3401
3402 * fileread.cc (Input_file::Input_file): New constructor.
3403 * fileread.h (class Input_file): Add new constructor.
3404
1698990d
AM
34052012-10-18 Alan Modra <amodra@gmail.com>
3406
3407 PR gold/14727
3408 * object.cc (Relobj::is_section_name_included): Also match
3409 .sdata personality section.
3410
168a4726
AM
34112012-10-18 Alan Modra <amodra@gmail.com>
3412
3413 * target-reloc.h (class Default_comdat_behavior): New, package up..
3414 (get_comdat_behaviour): ..this.
3415 (relocate_section): Add Relocate_comdat_behavior template arg,
3416 adjust code to suit.
3417 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3418 (Target_arm::scan_reloc_section): Likewise.
3419 * i386.cc (Target_i386::relocate_section): Likewise.
3420 * sparc.cc (Target_sparc::relocate_section): Likewise.
3421 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3422 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3423 * powerpc.cc (class Relocate_comdat_behavior): New.
3424 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3425 gold::relocate_section with new template arg.
3426
acc276d8
AM
34272012-10-18 Alan Modra <amodra@gmail.com>
3428
3429 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3430 dynamic relocs for GOT_TPREL got entries, without symbol if
3431 resolving locally.
3432 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3433 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3434 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3435
e10f9870
AM
34362012-10-17 Alan Modra <amodra@gmail.com>
3437
3438 PR gold/14726
3439 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3440
ae034989
ST
34412012-10-16 Sriraman Tallam <tmsriram@google.com>
3442
3443 * layout.cc (Layout::include_section): Keep sections marked
3444 SHF_EXCLUDE when doing relocatable links.
3445
f3a0ed29
AM
34462012-10-16 Alan Modra <amodra@gmail.com>
3447
3448 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3449 (Target_powerpc::do_finalize_sections): Call it.
3450 (Output_data_save_res): New class and supporting functions.
3451 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3452 normal symbols defined in object files.
3453
c6de8ed4
AM
34542012-10-12 Alan Modra <amodra@gmail.com>
3455
3456 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3457 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3458 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3459 section if scan_opd_relocs not yet called.
3460 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3461
03e25981
AM
34622012-10-12 Alan Modra <amodra@gmail.com>
3463
3464 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3465 add_local_ifunc_entry): Revert last change.
3466 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3467
c9824451
AM
34682012-10-05 Alan Modra <amodra@gmail.com>
3469
3470 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3471 do_plt_address_for_global): New functions.
3472 (Output_data_got_powerpc::do_write): Don't segfault when linking
3473 statically.
3474 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3475 add_local_ifunc_entry): Return true on adding entry..
3476 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3477 glink->add_entry call. Remove unused symtab param. Adjust calls.
3478 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3479 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3480 set up symbols here.
3481 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3482 syms here. Do so even when no .iplt. Don't segfault when linking
3483 statically.
3484 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3485 new variants without reloc param.
3486 (Glink_sym_ent::Glink_sym_ent): Likewise.
3487 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3488 reloc when refs will resolve to plt call stub.
3489 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3490 R_PPC_PLTREL24 to resolve locally.
3491 (Target_powerpc::Scan::global): Correct ifunc handling.
3492 (Target_powerpc::Relocate::relocate): Correct local sym glink
3493 lookup. Don't destroy "value" when we have a plt call stub,
3494 and when checking plt call validity.
3495 (Target_powerpc::do_dynsym_value): Simplify.
3496
19fec8c1
AM
34972012-10-05 Alan Modra <amodra@gmail.com>
3498
3499 * i386.cc (Output_data_plt_i386::address_for_global,
3500 address_for_local): Add plt offset to returned value. Adjust uses.
3501 * sparc.cc (Output_data_plt_sparc::address_for_global,
3502 address_for_local): Likewise.
3503 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3504 address_for_local): Likewise.
3505 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3506 address_for_local): Likewise.
3507 * target.h (Target::plt_address_for_global, plt_address_for_local):
3508 Update comment.
3509 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3510 (Output_data_got::Got_entry::write): Nor here.
3511 * output.h: Comment fix.
3512
e867b647
WL
35132012-10-02 Jiong Wang <jiwang@tilera.com>
3514
3515 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3516 global_offset_table_ value for larget got.
3517 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3518
e5d5f5ed
AM
35192012-09-29 Alan Modra <amodra@gmail.com>
3520
3521 * powerpc.cc (Target_powerpc::iplt_): New output section.
3522 (Target_powerpc::iplt_section, make_iplt_section,
3523 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3524 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3525 Target_powerpc::plt_entry_count): Count iplt entries too.
3526 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3527 reloc section in constructor. New params.
3528 (Target_powerpc::make_plt_section): Create reloc section here instead.
3529 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3530 functions.
3531 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3532 (Output_data_glink::add_entry, find_entry): New functions to
3533 deal with local syms.
3534 (Glink_sym_ent): Add support for local syms.
3535 (Output_data_glink::do_write): Handle ifunc plt entries.
3536 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3537 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3538 (Target_powerpc::Relocate::relocate): Likewise.
3539 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3540
ec4dbad3
AM
35412012-09-25 Alan Modra <amodra@gmail.com>
3542
3543 * object.h (Sized_relobj_file::adjust_local_symbol,
3544 do_adjust_local_symbol): New functions.
3545 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3546 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3547 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3548 and irregular opd entry spacing.
3549 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3550 (Global_symbol_visitor_opd): New functor.
3551 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3552 on deleted opd entries.
3553
5c0b3823
WL
35542012-09-15 Jiong Wang <jiwang@tilera.com>
3555
3556 * tilegx.cc: New file.
3557 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3558 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3559 * configure.tgt: Add entries for tilegx*.
3560 * configure.ac: Likewise.
3561 * Makefile.in: Rebuild.
3562 * configure: Likewise.
3563 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3564 tilegx.
3565
bfdfa4cd
AM
35662012-09-13 Alan Modra <amodra@gmail.com>
3567
3568 * target-reloc.h (scan_relocs): Call scan.local for relocs
3569 against symbols in discarded sections. Pass is_discarded
3570 param.
3571 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3572 Add is_discarded param.
3573 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3574 is_discarded to flag opd entry as discarded. Don't emit dyn
3575 relocs on such entries.
3576 (Target_powerpc::Scan::global): Similarly detect and handle
3577 such opd entries.
3578 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3579 opd_ent_. Update all uses.
3580 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3581 (Target_powerpc::relocate_section): Zero out discarded opd
3582 entry relocs.
3583
d77a0555
ILT
35842012-09-12 Ian Lance Taylor <iant@google.com>
3585
3586 PR gold/14570
3587 * output.cc: Rename Output_data_got template parameter from size
3588 to got_size for all functions. Compile all variants of
3589 Output_data_got.
3590 (Output_data_got::Got_entry::write): Correct use of size for
3591 symbol value. Use local_is_tls rather than casting to
3592 Sized_relobj_file.
3593 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3594 (class Sized_relobj_file): Add do_local_is_tls.
3595 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3596
815a1205
AM
35972012-09-11 Alan Modra <amodra@gmail.com>
3598
3599 PR gold/14566
3600 * layout.cc (Layout::set_segment_offsets): When using
3601 common-page-size alignment, ensure we are on a new max-page-size
3602 page.
3603 * output.cc (Output_segment::set_section_addresses): Use
3604 abi_pagesize, not common_pagesize for relro boundary.
3605 (Output_segment::set_offset): Likewise.
3606
bd73a62d
AM
36072012-09-11 Alan Modra <amodra@gmail.com>
3608
3609 * output.h (Output_data_got::add_global_tls, add_local_tls,
3610 add_local_tls_pair): New functions.
3611 (Output_data_got::add_local_pair_with_rel): Remove second
3612 reloc param. Expand comment.
3613 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3614 use_plt_or_tls_offset_, similarly for constructor param.
3615 (Output_data_got::Got_entry::write): Add got_index param.
3616 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3617 add_local_tls_pair): New functions.
3618 (Output_data_got::Got_entry::write): Handle tls symbols
3619 with use_plt_or_tls_offset_ set specially.
3620 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3621 (Output_data_got::do_write): Replace iterator with index, pass
3622 index to entry write function.
3623 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3624 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3625 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3626 call.
3627 * i386.cc (Target_i386::Scan::local): Likewise.
3628 * sparc.cc (Target_sparc::Scan::local): Likewise.
3629 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3630 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3631 do_tls_offset_for_global): New functions.
3632 (Target_powerpc::Scan::local): Correct TLS relocations and got
3633 entry values.
3634 (Target_powerpc::Scan::global): Don't emit unnecessary
3635 dynamic relocations on TLS GOT entries.
3636
00716ab1
AM
36372012-09-10 Matthias Klose <doko@ubuntu.com>
3638
3639 * config.in: Disable sanity check for kfreebsd.
3640
c891b3f9
SA
36412012-09-10 Sterling Augustine <saugustine@google.com>
3642
3643 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3644 (Gdb_index::pubtypes_read): New parameter.
3645 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3646 to calls.
3647 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3648 pubtypes_object_.
3649
e81fea4d
AM
36502012-09-09 Alan Modra <amodra@gmail.com>
3651
3652 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3653 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3654 * gc.h (gc_process_relocs): Call target gc_add_reference.
3655 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3656 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3657 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3658 unnecessary cast.
3659 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3660 to cater for when we don't need code offset. Update use.
3661 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3662 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3663 set_opd_valid): New functions.
3664 (Target_powerpc::do_gc_add_reference): New function.
3665 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3666 stashed refs.
3667 (Target_powerpc::do_gc_mark_symbol): New function.
3668
d2d60eef
CC
36692012-09-06 Cary Coutant <ccoutant@google.com>
3670
3671 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3672 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3673 (Dwarf_die::skip_attributes): Likewise.
3674 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3675 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3676 (main): Call it.
3677 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3678
32ed4573
L
36792012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3680
3681 * testsuite/script_test_3.t: Add .got.plt output section
3682 statement.
3683 * testsuite/script_test_4.t: Likewise.
3684
f4baf0d4
AM
36852012-09-05 Alan Modra <amodra@gmail.com>
3686
3687 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3688 update all uses and lose "enum" when using type.
3689
864a1b56
AM
36902012-09-05 Alan Modra <amodra@gmail.com>
3691
3692 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3693 * configure: Regenerate.
3694 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3695 (plugin_final_layout.stdout): Likewise.
3696 (memory_test): Set page sizes to 0x1000.
3697 * testsuite/Makefile.in: Regenerate.
3698 * testsuite/discard_locals_test.sh: Add FIXME comment.
3699 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3700 * testsuite/pr14265.t: Add .got output section statement.
3701 * testsuite/script_test_2.t: Likewise.
3702 * testsuite/script_test_3.t: Likewise.
3703 * testsuite/script_test_4.t: Likewise.
3704 * testsuite/script_test_5.t: Likewise.
3705 * testsuite/script_test_6.t: Likewise.
3706 * testsuite/script_test_7.t: Likewise.
3707 * testsuite/script_test_9.t: Likewise.
3708
3ea0a085
AM
37092012-09-05 Alan Modra <amodra@gmail.com>
3710
3711 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3712 (Powerpc_relocate_functions::Status): New typedef.
3713 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3714 (Target_powerpc::Scan::local): Handle REL64.
3715 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3716 for REL32 and REL64.
3717 (Target_powerpc::symval_for_branch): New function, extracted from..
3718 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3719 checks. Report overflow errors.
3720
7404fe1b
AM
37212012-09-05 Alan Modra <amodra@gmail.com>
3722
3723 * object.h (Sized_relobj_file::emit_relocs): Delete.
3724 (Sized_relobj_file::emit_relocs_reltype): Delete.
3725 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3726 relocate_relocs for --emit-relocs.
3727 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3728 * output.h: Update comment.
3729 (Output_segment::first_section): New function.
3730 (Output_segment::first_section_load_address): Use first_section.
3731 * output.cc (Output_segment::first_section): New function extracted..
3732 (Output_segment::first_section_load_address): ..from here. Delete.
3733 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3734 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3735 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3736 adjust call to target.h function.
3737 * i386.cc (Target_i386): Likewise.
3738 * sparc.cc (Target_sparc): Likewise.
3739 * x86_64.cc (Target_x86_64): Likewise.
3740 * powerpc.cc (Target_powerpc): Likewise.
3741 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3742 first tls section has section symbol for optimised local dynamic
3743 output relocs.
3744 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3745 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3746 optimised tls code.
3747 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3748 Rename to relocate_relocs. Update error message.
3749
957564c9
AS
37502012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3751
3752 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3753 --just-symbols.
3754
dd93cd0a
AM
37552012-08-31 Alan Modra <amodra@gmail.com>
3756
3757 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3758 (Powerpc_relobj::toc_base_offset): New stub function.
3759 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3760 got_mod_index_offset to tlsld_got_offset. Update all refs.
3761 (Target_powerpc::Relocate::enum skip_tls): New.
3762 (Target_powerpc::call_tls_get_addr_): New var.
3763 (Target_powerpc::is_branch_reloc): Move to file scope.
3764 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3765 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3766 New functions.
3767 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3768 (powerpc_info): Correct common_pagesize for ppc64.
3769 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3770 (Powerpc_relocate_functions): Add overflow check enums and functions.
3771 Add non-shift version of rela, rela_ua. Delete all rel public
3772 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3773 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3774 addr16_ha3, addr14 functions.
3775 (Output_data_got_powerpc::add_constant_pair): New function.
3776 (Output_data_got_powerpc::got_base_offset): Likewise.
3777 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3778 (instruction constants): Sort, add some more.
3779 (Output_data_glink::do_write): Add and use Address typedef. Use
3780 object->toc_base_offset() stub for 64-bit.
3781 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3782 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3783 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3784 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3785 Always treat .opd relocs as against locally defined symbol.
3786 Correct condition for RELATIVE relocs.
3787 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3788 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3789 for 32-bit syms with a plt entry. Correct ppc64 toc base
3790 calculations. Handle TLS relocs, and more. Add overflow
3791 checking and adjust for Powerpc_relocate_functions changes.
3792 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3793 Reinstate --emit-relocs code with FIXME.
3794
a1373b60
AM
37952012-08-30 Alan Modra <amodra@gmail.com>
3796
3797 * layout.cc (Layout::set_segment_offsets): Set p_align to
3798 abi_pagesize, not common_pagesize.
3799 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3800 to determine whether file header can go in segment.
3801
703d02da
AM
38022012-08-30 Alan Modra <amodra@gmail.com>
3803
3804 * output.h (Output_reloc::Output_reloc <output section>): Add
3805 is_relative param. Adjust calls.
3806 (Output_reloc::add_output_section_relative): New functions.
3807 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3808 is_relative.
3809 (Output_reloc::symbol_value): Handle SECTION_CODE.
3810
16164a6b
ST
38112012-08-24 Sriraman Tallam <tmsriram@google.com>
3812
3813 * gold.cc (queue_middle_tasks): Call layout again when unique
3814 segments for sections is desired.
3815 * layout.cc (Layout::Layout): Initialize new members.
3816 (Layout::get_output_section_flags): New function.
3817 (Layout::choose_output_section): Call get_output_section_flags.
3818 (Layout::layout): Make output section for mapping to a unique segment.
3819 (Layout::insert_section_segment_map): New function.
3820 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3821 output sections marked so.
16164a6b
ST
3822 (Layout::segment_precedes): Check for unique segments when sorting.
3823 * layout.h (Layout::Unique_segment_info): New struct.
3824 (Layout::Section_segment_map): New typedef.
3825 (Layout::insert_section_segment_map): New function.
3826 (Layout::get_output_section_flags): New function.
3827 (Layout::is_unique_segment_for_sections_specified): New function.
3828 (Layout::set_unique_segment_for_sections_specified): New function.
3829 (Layout::unique_segment_for_sections_specified_): New member.
3830 (Layout::section_segment_map_): New member.
3831 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3832 Rename is_gc_pass_one to is_pass_one.
3833 Rename is_gc_pass_two to is_pass_two.
3834 Rename is_gc_or_icf to is_two_pass.
3835 Check for which pass based on whether symbols data is present.
3836 Make it two pass when unique segments for sections is desired.
3837 * output.cc (Output_section::Output_section): Initialize new
3838 members.
3839 * output.h (Output_section::is_unique_segment): New function.
3840 (Output_section::set_is_unique_segment): New function.
3841 (Output_section::is_unique_segment_): New member.
3842 (Output_section::extra_segment_flags): New function.
3843 (Output_section::set_extra_segment_flags): New function.
3844 (Output_section::extra_segment_flags_): New member.
3845 (Output_section::segment_alignment): New function.
3846 (Output_section::set_segment_alignment): New function.
3847 (Output_section::segment_alignment_): New member.
3848 (Output_segment::Output_segment): Initialize is_unique_segment_.
3849 (Output_segment::is_unique_segment): New function.
3850 (Output_segment::set_is_unique_segment): New function.
3851 (Output_segment::is_unique_segment_): New member.
3852 * plugin.cc (allow_unique_segment_for_sections): New function.
3853 (unique_segment_for_sections): New function.
3854 (Plugin::load): Add new functions to transfer vector.
3855 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3856 * Makefile.in: Regenerate.
3857 * testsuite/plugin_final_layout.sh: Check if unique segment
3858 functionality works.
3859 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3860 are available.
3861 (allow_unique_segment_for_sections): New global.
3862 (unique_segment_for_sections): New global.
3863 (claim_file_hook): Call allow_unique_segment_for_sections.
3864 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3865
1e2bee4f
CC
38662012-08-22 Cary Coutant <ccoutant@google.com>
3867
3868 * layout.cc (Layout::include_section): Don't assert on GROUP
3869 sections with --emit-relocs.
3870
1d5dfe78
CC
38712012-08-21 Cary Coutant <ccoutant@google.com>
3872
3873 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3874 if --export-dynamic-symbol names an undef symbol.
3875
c9269dff
AM
38762012-08-18 Alan Modra <amodra@gmail.com>
3877
3878 * powerpc.cc: Formatting and white space.
3879 (Powerpc_relobj): Rename got2_section_ to special_.
3880 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3881 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3882 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3883 (Target_powerpc): Add Address typedef and invalid_address. Use
3884 throughout.
3885 (Target_powerpc::is_branch_reloc): New function.
3886 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3887 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3888 for dst_mask, value and addend.
3889 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3890 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3891 (Output_data_glink::do_write): Correct toc base. Don't try to use
3892 uint16_t for 24-bit offset. Use get_output_section_offset and
3893 check return.
3894 (Target_powerpc::Scan::local): Handle more relocs.
3895 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3896 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3897 Plug in toc restoring insn after plt calls. Translate branches
3898 to function descriptor symbols to corresponding entry point.
3899 (Target_powerpc::relocate_for_relocatable): Check return from
3900 get_output_section_offset.
3901 * symtab.h: Comment typo.
3902
b1759dce
ILT
39032012-08-14 Ian Lance Taylor <iant@google.com>
3904
3905 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3906 unsupported_relocal_local to call unsupported_reloc_global.
3907
b9b2ae8b
NC
39082012-08-14 Nick Clifton <nickc@redhat.com>
3909
3910 PR ld/14265
3911 * script-sections.cc (Sections_element::output_section_name): Add
3912 keep return parameter.
3913 (Output_section_element::match_name): Add keep return parameter.
3914 Return the value of the keep_ member.
3915 * script-sections.h (class Output_section): Update
3916 output_section_name prototype.
3917 * layout.cc (Layout::keep_input_section): New public member
3918 function.
3919 (Layout::choose_output_section): Pass keep parameter to
3920 output_section_name.
3921 * layout.h (class Layout): Add keep_input_section.
3922 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3923 sections.
3924 * testsuite/Makefile.am: Add a test.
3925 * testsuite/Makefile.in: Regenerate.
3926 * testsuite/pr14265.c: Source file for the test.
3927 * testsuite/pr14265.t: Linker script for the test.
3928 * testsuite/pr14265.sh: Shell script for the test.
3929
921b5322
AM
39302012-08-14 Alan Modra <amodra@gmail.com>
3931
3932 * target.h (Target::output_section_name): New function.
3933 (Target::do_output_section_name): New function.
3934 * layout.cc (Layout::choose_output_section): Call the above.
3935 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3936
6ce78956
AM
39372012-08-14 Alan Modra <amodra@gmail.com>
3938
3939 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3940 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3941 for replace_constant call.
3942 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3943 (Output_data_glink::do_print_to_mapfile): New function.
3944 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3945 (Target_powerpc::Relocate::relocate): Likewise.
3946
d1a8cabd
AM
39472012-08-14 Alan Modra <amodra@gmail.com>
3948
3949 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3950 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3951 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3952 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3953 all references to shndx_. Handle special case for R_PPC_PLTREL24
3954 here.
3955 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3956 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3957 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3958 here.
3959 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3960 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3961
d83ce4e3
AM
39622012-08-12 Alan Modra <amodra@gmail.com>
3963
3964 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3965 (glink insn constants): Use uint32_t.
3966 (Output_data_glink::add_entry): Use insert, not [] operator.
3967
cf43a2fe
AM
39682012-08-11 Alan Modra <amodra@gmail.com>
3969
3970 * object.h (Sized_relobj_file::find_shdr): New function.
3971 (Sized_relobj_file::find_special_sections): New function.
3972 * object.cc (Sized_relobj_file::find_shdr): New function.
3973 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3974 (Sized_relobj_file::find_special_sections): New function, split out..
3975 (Sized_relobj_file::do_read_symbols): ..from here.
3976 * output.h (Output_data_got::replace_constant): New function.
3977 (Output_data_got::num_entries): New function.
3978 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3979 (Output_data_got::got_offset): Protected rather than private.
3980 (Output_data_got::replace_got_entry): New function.
3981 * output.cc (Output_data_got::replace_got_entry): New function.
3982 * powerpc.cc (class Powerpc_relobj): New.
3983 (class Powerpc_relocate_functions): Delete all psymval variants or
3984 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3985 Implement _ha functions using corresponding _hi function.
3986 (Powerpc_relobj::find_special_sections): New function.
3987 (Target_powerpc::do_make_elf_object): New function.
3988 (class Output_data_got_powerpc): New.
3989 (class Output_data_glink): New.
3990 (class Powerpc_scan_relocatable_reloc): New.
3991 Many more changes througout file.
3992
3c892704
NC
39932012-08-09 Nick Clifton <nickc@redhat.com>
3994
3995 * po/vi.po: Updated Vietnamese translation.
3996
82435b3b
ILT
39972012-08-07 Ian Lance Taylor <iant@google.com>
3998
3999 * layout.cc (Layout::add_target_dynamic_tags): If
4000 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4001 plt_rel.
4002
a6dc81d2
NC
40032012-07-30 Nick Clifton <nickc@redhat.com>
4004
4005 * po/gold.pot: Updated template.
4006 * po/es.po: Updated Spanish translation.
4007
f1415016
CC
40082012-07-18 Cary Coutant <ccoutant@google.com>
4009
4010 PR gold/14344
4011 * configure.ac: Add check for -gpubnames support.
4012 * configure: Regenerate.
4013 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4014 support; force -gno-pubnames.
4015 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4016 support.
4017 (gdb_index_test_4): New test.
4018 * testsuite/Makefile.in: Regenerate.
4019 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4020 * testsuite/gdb_index_test_2.sh: Likewise.
4021 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4022 * testsuite/gdb_index_test_4.sh: New script.
4023 * testsuite/gdb_index_test_comm.sh: New script with common code;
4024 don't look for space after colon.
4025
b7fd7c37
ST
40262012-07-16 Sriraman Tallam <tmsriram@google.com>
4027
4028 * gold.cc (queue_middle_tasks): Update function order only after
4029 deferred objects due to plugins are processed.
4030
1f3212db
ILT
40312012-07-11 Ian Lance Taylor <iant@google.com>
4032
4033 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4034 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4035 (Target_arm::scan_reloc_for_stub): Likewise.
4036 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4037 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4038 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4039 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4040 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4041
81c82a68
ILT
40422012-07-10 Dodji Seketeli <dodji@redhat.com>
4043 Ian Lance Taylor <iant@google.com>
4044
4045 PR gold/14309
4046 * configure.ac: Test whether std::tr1::hash<off_t> works.
4047 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4048 needed.
4049 * output.h (class Output_fill): Add virtual destructor.
4050 * configure, config.in: Rebuild.
4051
eabc84f4
RM
40522012-06-22 Roland McGrath <mcgrathr@google.com>
4053
4054 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4055
370e30b6
RÁE
40562012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4057
4058 * plugin.cc (Plugin::load): Handle position independent executables.
4059
fb1b895d
CC
40602012-06-06 Cary Coutant <ccoutant@google.com>
4061
4062 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4063 add .debug_macro.
4064 (lines_only_debug_sections): Likewise.
4065 (gdb_fast_lookup_sections): New static array.
4066 (is_gdb_debug_section): Rename formal parameter.
4067 (is_lines_only_debug_section): Likewise.
4068 (is_gdb_fast_lookup_section): New function.
4069 (Layout::include_section): Check for ".zdebug_" prefix; pass
4070 section name suffix to is_gdb_debug_section, et al.; check for
4071 fast-lookup sections when building .gdb_index.
4072 * options.h (--strip-debug-gdb): Update GDB version number.
4073
7c0640fa
CC
40742012-06-06 Cary Coutant <ccoutant@google.com>
4075
4076 * configure.ac: Add check for fallocate.
4077 * configure: Regenerate.
4078 * config.in: Regenerate.
4079
4080 * options.h (class General_options): Add --mmap-output-file and
4081 --posix-fallocate options.
4082 * output.cc: (posix_fallocate): Remove; replace with...
4083 (gold_fallocate): New function.
4084 (Output_file::map_no_anonymous): Call gold_fallocate.
4085 (Output_file::map): Check --mmap-output-file option.
4086
2a49eb69
DK
40872012-06-05 Jing Yu <jingyu@google.com>
4088
4089 * gold.h (textdomain): Add do {} to empty while(0).
4090 (bindtextdomain): Likewise.
4091
fad072ac
CC
40922012-06-04 Cary Coutant <ccoutant@google.com>
4093
4094 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4095 has_dynsym_index.
4096
8cc69fb6
ST
40972012-05-25 Sriraman Tallam <tmsriram@google.com>
4098
4099 * symtab.cc (Symbol_table::define_special_symbol):
4100 Initialize *poldsym to prevent uninitialized variable errors.
4101
1be75daa
CC
41022012-05-23 Cary Coutant <ccoutant@google.com>
4103
4104 * layout.cc (Layout::section_name_mapping): Add rules to handle
4105 exact match on .data.rel.ro.local or .data.rel.ro.
4106 (Layout::output_section_name): Check for exact matches.
4107
9b689de0
CC
41082012-05-23 Cary Coutant <ccoutant@google.com>
4109
4110 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4111 more carefully.
4112
b24fdbf5
CC
41132012-05-22 Cary Coutant <ccoutant@google.com>
4114
4115 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4116 object before exporting symbol.
4117
e550e1a2
L
41182012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4119
4120 * testsuite/tls_test.cc: Include "config.h" first.
4121 * testsuite/tls_test_c.c: Likewise.
4122
df7b86aa
NC
41232012-05-17 Daniel Richard G. <skunk@iskunk.org>
4124 Nick Clifton <nickc@redhat.com>
4125
4126 PR 14072
4127 * configure.in: Add check that sysdep.h has been included before
4128 any system header files.
4129 * configure: Regenerate.
4130 * config.in: Regenerate.
4131
1007b503
CC
41322012-05-14 Cary Coutant <ccoutant@google.com>
4133
4134 * layout.cc (Layout::make_output_section): Mark .tdata section
4135 as RELRO.
4136 * testsuite/relro_test.cc: Add a TLS variable.
4137
fd885f3a
L
41382012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4139
4140 PR gold/14091
4141 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4142 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4143 R_X86_64_64.
4144
80f5885c
CC
41452012-05-08 Cary Coutant <ccoutant@google.com>
4146
4147 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4148 (lines_only_debug_sections): Likewise.
4149
2e702c99
RM
41502012-05-02 Roland McGrath <mcgrathr@google.com>
4151
4152 * nacl.cc: New file.
4153 * nacl.h: New file.
4154 * Makefile.am (CCFILES, HFILES): Add them.
4155 * Makefile.in: Regenerate.
4156 * i386.cc (Output_data_plt_i386_nacl): New class.
4157 (Output_data_plt_i386_nacl_exec): New class.
4158 (Output_data_plt_i386_nacl_dyn): New class.
4159 (Target_i386_nacl): New class.
4160 (Target_selector_i386_nacl): New class.
4161 (target_selector_i386): Use it instead of Target_selector_i386.
4162 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4163 (Target_x86_64_nacl): New class.
4164 (Target_selector_x86_64_nacl): New class.
4165 (target_selector_x86_64, target_selector_x32): Use it instead of
4166 Target_selector_x86_64.
4167 * arm.cc (Output_data_plt_arm_nacl): New class.
4168 (Target_arm_nacl): New class.
4169 (Target_selector_arm_nacl): New class.
4170 (target_selector_arm, target_selector_armbe): Use it instead of
4171 Target_selector_arm.
4172
4173 * target-select.cc (select_target): Take new Input_file* and off_t
4174 arguments, pass them on to recognize method of selector.
4175 * object.cc (make_elf_sized_object): Update caller.
4176 * parameters.cc (parameters_force_valid_target): Likewise.
4177 * incremental.cc (make_sized_incremental_binary): Likewise.
4178 * target-select.h: Update decl.
4179 (Target_selector::recognize): Take new Input_file* argument,
4180 pass it on to do_recognize.
4181 (Target_selector::do_recognize): Take new Input_file* argument.
4182 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4183 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4184 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4185 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4186
4187 * target.h (Target::Target_info): New members isolate_execinstr
4188 and rosegment_gap.
4189 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4190 * arm.cc (Target_arm::arm_info): Update initializer.
4191 * i386.cc (Target_i386::i386_info): Likewise.
4192 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4193 * sparc.cc (Target_sparc::sparc_info): Likewise.
4194 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4195 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4196 * layout.cc (Layout::attach_allocated_section_to_segment):
4197 Take new const Target* argument. If target->isolate_execinstr(), act
4198 like --rosegment.
4199 (Layout::find_first_load_seg): Take new const Target* argument;
4200 if target->isolate_execinstr(), reject PF_X segments.
4201 (Layout::relaxation_loop_body): Update caller.
4202 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4203 reset file offset to zero when we hit LOAD_SEG, and then do a second
4204 loop over the segments before LOAD_SEG to reassign offsets after
4205 addresses have been determined. Handle target->rosegment_gap().
4206 (Layout::attach_section_to_segment): Take new const Target* argument;
4207 pass it to attach_allocated_section_to_segment.
4208 (Layout::make_output_section): Update caller.
4209 (Layout::attach_sections_to_segments): Take new const Target* argument;
4210 pass it to attach_section_to_segment.
4211 * gold.cc (queue_middle_tasks): Update caller.
4212 * layout.h (Layout): Update method decls with new arguments.
4213
4214 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4215 Target_info pointer to use.
4216 (Target_arm::do_make_data_plt): New virtual method.
4217 (Target_arm::make_data_plt): New method that calls it.
4218 (Target_arm::make_plt_entry): Use it.
4219 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4220 for the section alignment.
4221 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4222 method.
4223 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4224 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4225 method.
4226 (Output_data_plt_arm::get_plt_entry_size): Call it.
4227 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4228 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4229 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4230 method.
4231 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4232 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4233 method instead of sizeof(plt_entry).
4234 (Output_data_plt_arm::add_entry): Likewise.
4235 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4236 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4237 than static method.
4238 (Target_arm::plt_entry_size): Likewise.
4239 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4240 Move to ...
4241 (Output_data_plt_arm_standard): ... here, new class.
4242 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4243 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4244 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4245
4246 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4247 Take additional argument for the PLT entry size.
4248 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4249 Use get_plt_entry_size method rather than plt_entry_size variable.
4250 (Output_data_plt_x86_64::reserve_slot): Likewise.
4251 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4252 (Output_data_plt_x86_64::add_entry): Likewise.
4253 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4254 (Output_data_plt_x86_64::address_for_global): Likewise.
4255 (Output_data_plt_x86_64::address_for_local): Likewise.
4256 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4257 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4258 Make method non-static.
4259 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4260 method.
4261 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4262 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4263 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4264 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4265 virtual method.
4266 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4267 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4268 virtual method.
4269 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4270 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4271 virtual method.
4272 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4273 (Output_data_plt_x86_64::plt_entry_size)
4274 (Output_data_plt_x86_64::first_plt_entry)
4275 (Output_data_plt_x86_64::plt_entry)
4276 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4277 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4278 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4279 (Output_data_plt_x86_64_standard): ... here, new class.
4280 (Target_x86_64::Target_x86_64): Take optional argument for the
4281 Target_info pointer to use.
4282 (Target_x86_64::do_make_data_plt): New virtual method.
4283 (Target_x86_64::make_data_plt): New method to call it.
4284 (Target_x86_64::init_got_plt_for_update): Use that.
4285 Call this->plt_->add_eh_frame method here.
4286 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4287 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4288 rather than static method.
4289 (Target_x86_64::plt_entry_size): Likewise.
4290 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4291 rather than plt_entry_size variable. Move guts of PLT filling to...
4292 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4293 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4294 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4295
4296 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4297 additional argument for the section alignment.
4298 Don't do add_eh_frame_for_plt here.
4299 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4300 non-static. Use get_plt_entry_size method rather than plt_entry_size
4301 variable.
4302 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4303 method.
4304 (Output_data_plt_i386::get_plt_entry_size): Call it.
4305 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4306 (Output_data_plt_i386::add_eh_frame): New method to call it.
4307 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4308 method.
4309 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4310 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4311 method.
4312 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4313 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4314 method instead of plt_entry_size.
4315 (Output_data_plt_i386::plt_entry_size)
4316 (Output_data_plt_i386::plt_eh_frame_fde_size)
4317 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4318 (Output_data_plt_i386_standard): ... here, new class.
4319 (Output_data_plt_i386_exec): New class.
4320 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4321 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4322 (Output_data_plt_i386::exec_plt_entry): Move to ...
4323 (Output_data_plt_i386_exec::plt_entry): ... here.
4324 (Output_data_plt_i386_dyn): New class.
4325 (Output_data_plt_i386::first_plt_entry): Move to ...
4326 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4327 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4328 (Output_data_plt_i386_dyn::plt_entry): ... here.
4329 (Target_i386::Target_i386): Take optional argument for the Target_info
4330 pointer to use.
4331 (Target_i386::do_make_data_plt): New virtual method.
4332 (Target_i386::make_data_plt): New method to call it.
4333 (Target_i386::make_plt_section): Use that.
4334 Call this->plt_->add_eh_frame method here.
4335 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4336 rather than plt_entry_size variable.
4337 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4338 (Output_data_plt_i386::address_for_local): Likewise.
4339 (Output_data_plt_i386::do_write): Likewise.
4340 Move guts of PLT filling to...
4341 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4342 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4343 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4344 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4345
b9b9f2ee
CC
43462012-05-01 Cary Coutant <ccoutant@google.com>
4347
4348 * dwarf_reader.cc (Dwarf_die::read_attributes)
4349 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4350 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4351 * reduced_debug_output.cc
4352 (Output_reduced_debug_info_section::get_die_end): Remove
4353 DW_FORM_GNU_ref_index. Add default case.
4354
57923f48
MW
43552012-04-26 Mark Wielaard <mjw@redhat.com>
4356
4357 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4358 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4359 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4360 DW_AT_high_pc as offset from DW_AT_low_pc.
4361
4362 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4363 * testsuite/Makefile.in: Regenerate.
4364 * testsuite/gdb_index_test_3.c: New test source file.
4365 * testsuite/gdb_index_test_3.sh: New test source file.
4366
2c54b4f4
ILT
43672012-04-25 Ian Lance Taylor <iant@google.com>
4368
4369 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4370 pointer.
4371 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4372 as a class, not a struct.
4373 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4374 (Target_arm::apply_cortex_a8_workaround): Likewise.
4375 * gc.h: Declare Reloc_types as a struct, not a class.
4376 * object.h: Declare Symbols_data as a struct.
4377 * reloc.h: Declare Read_relocs_data as a struct.
4378 * target.h: Declare Relocate_info as a struct.
4379
a5a5f7a3
DM
43802012-04-24 David S. Miller <davem@davemloft.net>
4381
4382 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4383 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4384 and R_SPARC_WPLT30.
4385
f038d496
CC
43862012-04-24 Cary Coutant <ccoutant@google.com>
4387
4388 * incremental-dump.cc (find_input_containing_global): Replace
4389 magic number with symbolic constant.
4390 (dump_incremental_inputs): Update version number.
4391 * incremental.cc (Output_section_incremental_inputs): Update version
4392 number; import symbolic constants from Incremental_inputs_reader.
4393 (Incremental_inputs::create_data_sections): Align relocations
4394 section correctly for 64-bit targets.
4395 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4396 constants; add padding.
4397 (Output_section_incremental_inputs::write_header): Add assert for
4398 header_size.
4399 (Output_section_incremental_inputs::write_input_files): Add assert
4400 for input_entry_size.
4401 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4402 add assert for object_info_size, input_section_entry_size,
4403 global_sym_entry_size.
4404 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4405 for data structure sizes; use them.
4406 (Incremental_input_entry_reader): Import symbolic constants from
4407 Incremental_inputs_reader; use them.
4408
a4d85145
DM
44092012-04-23 David S. Miller <davem@davemloft.net>
4410
4411 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4412 and elf_flags_set_.
4413 (Target_sparc::Target_sparc): Initialize new fields.
4414 (Target_sparc::do_make_elf_object): New function.
4415 (Target_sparc::do_adjust_elf_header): New function.
4416
1d509098
CC
44172012-04-23 Cary Coutant <ccoutant@google.com>
4418
4419 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4420 CU range table of gdb index.
4421
7ebeff7f
DM
44222012-04-20 David S. Miller <davem@davemloft.net>
4423
4424 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4425 instead of false.
4426
13cf9988
DM
44272012-04-16 David S. Miller <davem@davemloft.net>
4428
2a1079e8
DM
4429 * sparc.cc (Target_sparc::got_address): New function.
4430 (Sparc_relocate_functions::gdop_hix22): New function.
4431 (Sparc_relocate_functions::gdop_lox10): New function.
4432 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4433 relocs.
4434 (Target_sparc::Scan::local): Likewise if the global symbol is not
4435 preemptible and is not IFUNC.
4436 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4437 transformations for local and non-preemptible non-IFUNC global
4438 symbols.
4439
0bc964fc
DM
4440 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4441 writing out 64-bit part of ranges.
4442
661d7a80
DM
4443 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4444 -fpic and -fpie respectively.
4445 * Makefile.in: Regenerate.
4446
8c2bf391
DM
4447 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4448 (Target_sparc::Target_sparc): Initialize new field.
4449 (Target_sparc::do_plt_section_for_global): New function.
4450 (Target_sparc::do_plt_section_for_local): New function.
4451 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4452 (Target_sparc::make_plt_section): New function, broken out of
4453 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4454 (Target_sparc::make_plt_entry): Call make_plt_section.
4455 (Target_sparc::make_local_ifunc_plt_entry): New function.
4456 (Target_sparc::rela_ifunc_section): New function.
4457 (Target_sparc::plt_section): Remove const.
4458 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4459 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4460 and ifunc_count_ fields.
4461 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4462 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4463 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4464 (Output_data_plt_sparc::rela_ifunc): New function.
4465 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4466 (Output_data_plt_sparc::has_ifunc_section): New function.
4467 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4468 (Output_data_plt_sparc::address_for_global): New function.
4469 (Output_data_plt_sparc::address_for_local): New function.
4470 (Output_data_plt_sparc::plt_index_to_offset): New function.
4471 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4472 and entry_count.
4473 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4474 entry_count.
4475 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4476 R_SPARC_JMP_IREL to switch.
4477 (Target_sparc::Scan::check_non_pic): Likewise.
4478 (Target_sparc::Scan::local): Handle IFUNC symbols.
4479 (Target_sparc::Scan::local): Likewise.
4480 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4481 and plt_address_for_local.
4482 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4483 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4484
13cf9988
DM
4485 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4486 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4487 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4488 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4489 global relocs too.
4490 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4491 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4492 calls.
4493 * sparc.cc (Target_sparc::Scan::global): Likewise.
4494 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4495
31821be0
CC
44962012-04-16 Cary Coutant <ccoutant@google.com>
4497
4498 * archive.cc (Library_base::should_include_member): Check for
4499 --export-dynamic-symbol.
4500 * options.h (class General_options): Add --export-dynamic-symbol.
4501 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4502 --export-dynamic-symbol.
4503 (Symbol_table::gc_mark_undef_symbols): Likewise.
4504 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4505
2615994e
DM
45062012-04-12 David S. Miller <davem@davemloft.net>
4507
4508 * sparc.cc (Reloc::wdisp10): New relocation method.
4509 (Reloc::h34): Likewise.
4510 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4511 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4512 R_SPARC_WDISP10.
4513 (Target_sparc::Scan::local): Likewise.
4514 (Target_sparc::Scan::global): Likewise.
4515 (Target_sparc::Relocate::relocate): Likewise.
4516
6782735d
CC
45172012-04-09 Cary Coutant <ccoutant@google.com>
4518
4519 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4520 low_pc == 0.
4521
8c7a0b00
ILT
45222012-04-06 Ian Lance Taylor <iant@google.com>
4523
4524 * timer.cc: #include <unistd.h>.
4525
58797674
RM
45262012-04-06 Roland McGrath <mcgrathr@google.com>
4527
4528 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4529 * config.in: Regenerate.
4530 * configure: Regenerate.
4531
44350750
NC
45322012-04-05 Nick Clifton <nickc@redhat.com>
4533
4534 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4535 (AM_LC_MESSAGES): Add.
4536 * aclocal.m4: Regenerate.
4537 * config.in: Regenerate.
4538 * configure: Regenerate.
4539
c1027032
CC
45402012-03-21 Cary Coutant <ccoutant@google.com>
4541
4542 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4543 * Makefile.in: Regenerate.
4544 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4545 (Sized_elf_reloc_mapper::symbol_section): New function.
4546 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4547 (make_elf_reloc_mapper): New function.
4548 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4549 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4550 (Dwarf_abbrev_table::do_get_abbrev): New function.
4551 (Dwarf_ranges_table::read_ranges_table): New function.
4552 (Dwarf_ranges_table::read_range_list): New function.
4553 (Dwarf_pubnames_table::read_section): New function.
4554 (Dwarf_pubnames_table::read_header): New function.
4555 (Dwarf_pubnames_table::next_name): New function.
4556 (Dwarf_die::Dwarf_die): New function.
4557 (Dwarf_die::read_attributes): New function.
4558 (Dwarf_die::skip_attributes): New function.
4559 (Dwarf_die::set_name): New function.
4560 (Dwarf_die::set_linkage_name): New function.
4561 (Dwarf_die::attribute): New function.
4562 (Dwarf_die::string_attribute): New function.
4563 (Dwarf_die::int_attribute): New function.
4564 (Dwarf_die::uint_attribute): New function.
4565 (Dwarf_die::ref_attribute): New function.
4566 (Dwarf_die::child_offset): New function.
4567 (Dwarf_die::sibling_offset): New function.
4568 (Dwarf_info_reader::check_buffer): New function.
4569 (Dwarf_info_reader::parse): New function.
4570 (Dwarf_info_reader::do_parse): New function.
4571 (Dwarf_info_reader::do_read_string_table): New function.
4572 (Dwarf_info_reader::lookup_reloc): New function.
4573 (Dwarf_info_reader::get_string): New function.
4574 (Dwarf_info_reader::visit_compilation_unit): New function.
4575 (Dwarf_info_reader::visit_type_unit): New function.
4576 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4577 Sized_elf_reloc_mapper.
4578 (Sized_dwarf_line_info::symbol_section): Remove function.
4579 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4580 (Sized_dwarf_line_info::read_line_mappings): Remove object
4581 parameter, adjust callers.
4582 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4583 * dwarf_reader.h: Include <sys/types.h>.
4584 (class Track_relocs): Remove forward declaration.
4585 (class Elf_reloc_mapper): New class.
4586 (class Sized_elf_reloc_mapper): New class.
4587 (class Dwarf_abbrev_table): New class.
4588 (class Dwarf_range_list): New class.
4589 (class Dwarf_ranges_table): New class.
4590 (class Dwarf_pubnames_table): New class.
4591 (class Dwarf_die): New class.
4592 (class Dwarf_info_reader): New class.
4593 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4594 (Sized_dwarf_line_info::symbol_section): Remove member function.
4595 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4596 base class.
4597 * gdb-index.cc: New source file.
4598 * gdb-index.h: New source file.
4599 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4600 and .debug_types sections, call Layout::add_to_gdb_index.
4601 (Sized_relobj_incr::do_section_name): Implement.
4602 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4603 return type; Implement.
4604 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4605 return type.
4606 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4607 parameter list and return type.
4608 (Sized_incr_dynobj::do_section_contents): Likewise.
4609 * layout.cc: Include gdb-index.h.
4610 (Layout::Layout): Initialize gdb_index_data_.
4611 (Layout::init_fixed_output_section): Check for .gdb_index section.
4612 (Layout::add_to_gdb_index): New function. Instantiate.
4613 * layout.h: Add forward declaration for class Gdb_index.
4614 (Layout::add_to_gdb_index): New member function.
4615 (Layout::gdb_index_data_): New data member.
4616 * main.cc: Include gdb-index.h.
4617 (main): Print statistics for gdb index.
4618 * object.cc (Object::section_contents): Move code into
4619 do_section_contents.
4620 (need_decompressed_section): Check for sections needed when building
4621 gdb index.
4622 (build_compressed_section_map): Likewise.
4623 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4624 gdb index.
4625 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4626 sections; call Layout::add_to_gdb_index.
4627 (Sized_relobj_file::do_decompressed_section_contents): Call
4628 do_section_contents directly.
4629 * object.h (Object::do_section_contents): Adjust parameter list and
4630 return type.
4631 (Object::do_decompressed_section_contents): Call do_section_contents
4632 directly.
4633 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4634 return type.
4635 * options.h (class General_options): Add --gdb-index option.
4636 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4637 list and return type.
4638 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4639 * reloc.h (Track_relocs::checkpoint): New function.
4640 (Track_relocs::reset): New function.
4641
4642 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4643 New test cases.
4644 * testsuite/Makefile.in: Regenerate.
4645 * testsuite/gdb_index_test.cc: New test source file.
4646 * testsuite/gdb_index_test_1.sh: New test source file.
4647 * testsuite/gdb_index_test_2.sh: New test source file.
4648
647f1574
DK
46492012-03-19 Doug Kwan <dougkwan@google.com>
4650
4651 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4652 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4653 __exidx_start and __exidx_end. Make symbol table parameter
4654 anonymous as it is not used.
4655 * gold.cc (queue_middle_tasks): Call target hook to define any
4656 target-specific symbols.
4657 * target.h (Target::define_standard_symbols): New method.
4658 (Target::do_define_standard_symbols): Same.
4659 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4660 * testsuite/Makefile.in: Regenerate.
4661 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4662 and __exidx_end.
4663 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4664 relocations are generated for __exidx_start and __exidx_end.
4665
7c6109da
DK
46662012-03-16 Doug Kwan <dougkwan@google.com>
4667
4668 * testsuite/Makefile.am: Disable test initpri3b.
4669 * testsuite/Makefile.in: Regenerate.
4670
7b8957f8
DK
46712012-03-15 Doug Kwan <dougkwan@google.com>
4672
4673 * arm.cc (Target_arm::got_section): Make .got section read-only
4674 if -z now is given.
4675
14dc9ef7
ILT
46762012-03-15 Ian Lance Taylor <iant@google.com>
4677
4678 PR gold/13850
4679 * layout.cc (Layout::make_output_section): Correctly mark
4680 SHT_INIT_ARRAY, et. al., as relro.
4681
fa40b62a
DK
46822012-03-14 Doug Kwan <dougkwan@google.com>
4683
4684 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4685 dynamic relocations for protected symbols in shared objects.
4686
fd325007
ILT
46872012-03-13 Ian Lance Taylor <iant@google.com>
4688
4689 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4690 keep the larger alignment.
4691
e8dd54e1
CC
46922012-03-12 Cary Coutant <ccoutant@google.com>
4693
4694 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4695 handling of DW_LNE_define_file.
4696
feb5f3b0
CC
46972012-03-12 Cary Coutant <ccoutant@google.com>
4698
4699 * reduced_debug_output.cc
4700 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4701 codes to switch.
4702
a1fb4256
CC
47032012-02-29 Cary Coutant <ccoutant@google.com>
4704
4705 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4706
5dd8762a
CC
47072012-02-29 Cary Coutant <ccoutant@google.com>
4708
4709 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4710 Call Object::decompressed_section_contents.
4711 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4712 New dtor.
4713 (Sized_dwarf_line_info::buffer_start_): New data member.
4714 * merge.cc (Output_merge_data::do_add_input_section): Call
4715 Object::decompressed_section_contents.
4716 (Output_merge_string::do_add_input_section): Likewise.
4717 * object.cc (need_decompressed_section): New function.
4718 (build_compressed_section_map): Decompress sections needed later.
4719 (Sized_relobj_file::do_decompressed_section_contents): New function.
4720 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4721 * object.h (Object::decompressed_section_contents): New function.
4722 (Object::discard_decompressed_sections): New function.
4723 (Object::do_decompressed_section_contents): New function.
4724 (Object::do_discard_decompressed_sections): New function.
4725 (Compressed_section_info): New type.
4726 (Compressed_section_map): Include decompressed section contents.
4727 (Sized_relobj_file::do_decompressed_section_contents): New function.
4728 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4729
7b5de7ee
CC
47302012-02-16 Cary Coutant <ccoutant@google.com>
4731
4732 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4733 * testsuite/Makefile.in: Regenerate.
4734
f9fa4a63
CC
47352012-02-14 Cary Coutant <ccoutant@google.com>
4736
4737 * options.cc (General_options::finalize): Disallow -pie and -static.
4738
2c175ebc
DK
47392012-02-03 Doug Kwan <dougkwan@google.com>
4740
4741 * arm.cc (Arm_relocate_functions::abs8,
4742 Arm_relocate_functions::abs16): Use
4743 Bits::has_signed_unsigned_overflow32.
4744 (Arm_relocate_functions::thm_abs8): Correct range of
4745 overflow check.
4746 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4747 in assertions.
4748
90cff06f
DK
47492012-02-02 Doug Kwan <dougkwan@google.com>
4750
4751 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4752 position independent outputs, not just shared objects.
4753
63887f3d
L
47542012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4755
4756 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4757 * configure: Regenerated.
4758
bef2b434
ILT
47592012-01-27 Ian Lance Taylor <iant@google.com>
4760
4761 * reloc.h (Bits): New class with static functions, copied from
4762 namespace utils in arm.cc.
4763 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4764 instead.
4765
c335b55d
L
47662012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4767
4768 * incremental.cc (write_info_blocks): Correct relocation offset.
4769
41194d9f
L
47702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4771
4772 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4773 (Relocate::tls_gd_to_le): Likewise.
4774
1bae613c
L
47752012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4776
4777 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4778
24482ca0
L
47792012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4780
4781 * configure.ac: Check if -mcmodel=medium works.
4782 * configure: Regenerated.
4783
c2c7840a
CC
47842012-01-24 Cary Coutant <ccoutant@google.com>
4785
4786 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4787 definition and ...
4788 (read_unsigned_LEB_128_x): ... this new function.
4789 (read_signed_LEB_128): Replaced with inline definition and ...
4790 (read_signed_LEB_128_x): ... this new function.
4791 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4792 (read_unsigned_LEB_128): Add inline definition.
4793 (read_signed_LEB_128_x): New function.
4794 (read_signed_LEB_128): Add inline definition.
4795 * testsuite/Makefile.am (leb128_unittest): New unit test.
4796 * testsuite/Makefile.in: Regenerate.
4797 * testsuite/leb128_unittest.cc: New unit test.
4798
833de760 47992012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4800
4801 PR gold/13617
4802 * i386.cc (Target_i386::do_code_fill): When using a jmp
4803 instruction, pad with nop instructions.
4804 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4805
618d6666
L
48062012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4807
4808 * x86_64.cc (gc_process_relocs): Add typename on types used in
4809 template.
4810 (scan_relocs): Likewise.
4811 (relocate_section): Likewise.
4812 (apply_relocation): Likewise.
4813
3660ff06
L
48142012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4815
4816 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4817 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4818 under x32.
4819
fc51264f
L
48202012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4821
4822 * x86_64.cc: Initial support for x32.
4823
dd74ae06
CC
48242012-01-03 Cary Coutant <ccoutant@google.com>
4825
4826 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4827 Use abstract base class for GOT.
4828 * gold/output.h (class Output_data_got_base): New abstract base class.
4829 (class Output_data_got): Derive from new base class, adjust ctors.
4830 (Output_data_got::reserve_slot): Make virtual; rename to
4831 do_reserve_slot; Adjust callers.
4832 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4833 pointer to abstract base class.
4834 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4835
83896202
ILT
48362011-12-18 Ian Lance Taylor <iant@google.com>
4837
4838 * object.h (Relobj::local_symbol_value): New function.
4839 (Relobj::local_plt_offset): New function.
4840 (Relobj::local_has_got_offset): New function.
4841 (Relobj::local_got_offset): New function.
4842 (Relobj::set_local_got_offset): New function.
4843 (Relobj::do_local_symbol_value): New pure virtual function.
4844 (Relobj::do_local_plt_offset): Likewise.
4845 (Relobj::do_local_has_got_offset): Likewise.
4846 (Relobj::do_local_got_offset): Likewise.
4847 (Relobj::do_set_local_got_offset): Likewise.
4848 (Sized_relobj::do_local_has_got_offset): Rename from
4849 local_has_got_offset.
4850 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4851 (Sized_relobj::do_set_local_got_offset): Rename from
4852 set_local_got_offset.
4853 (Sized_relobj_file::do_local_plt_offset): Rename from
4854 local_plt_offset.
4855 (Sized_relobj_file::do_local_symbol_value): New function.
4856 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4857 local_plt_offset.
4858 * output.cc (Output_data_got::Got_entry::write): Change object to
4859 Relobj. Use local_symbol_value.
4860 (Output_data_got::add_global_with_rel): Change rel_dyn to
4861 Output_data_reloc_generic*. Use add_global_generic.
4862 (Output_data_got::add_global_with_rela): Remove. Change all
4863 callers to use add_global_with_rel.
4864 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4865 Output_data_reloc_generic*. Use add_global_generic.
4866 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4867 callers to use add_global_pair_with_rel.
4868 (Output_data_got::add_local): Change object to Relobj*.
4869 (Output_data_got::add_local_plt): Likewise.
4870 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4871 change rel_dyn to Output_data_reloc_generic*. Use
4872 add_local_generic.
4873 (Output_data_got::add_local_with_rela): Remove. Change all
4874 callers to use all_local_with_rel.
4875 (Output_data_got::add_local_pair_with_rel): Change object to
4876 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4877 add_output_section_generic.
4878 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4879 callers to use add_local_pair_with_rel.
4880 (Output_data_got::reserve_local): Change object to Relobj*.
4881 * output.h: (class Output_data_reloc_generic): Add pure virtual
4882 declarations for add_global_generic, add_local_generic,
4883 add_output_section_generic.
4884 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4885 functions for Output_data_reloc_generic. Update declarations for
4886 changes listed in output.cc.
4887 (class Output_data_got): Change template parameter to got_size.
4888 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4889 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4890 function.
4891 (Sized_relobj_incr::do_local_plt_offset): New function.
4892 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4893 add_global_generic.
4894
76677ad0
CC
48952011-12-17 Cary Coutant <ccoutant@google.com>
4896
4897 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4898 * resolve.cc (Symbol_table::resolve): Likewise.
4899 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4900 arrays.
4901 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4902
8b8dd8d5
ILT
49032011-12-16 Ian Lance Taylor <iant@google.com>
4904
4905 * output.h (Output_data_reloc_generic::add): Only call
4906 add_dynamic_reloc if this is a dynamic reloc section.
4907
d55525b9
L
49082011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4909
4910 PR gold/13505
4911 * target-reloc.h (apply_relocation): Replace <64, false> with
4912 <size, big_endian>.
4913
ff81c7c1
NC
49142011-11-25 Nick Clifton <nickc@redhat.com>
4915
4916 * po/it.po: New Italian translation.
4917
628f39be
SA
49182011-11-17 Sterling Augustine <saugustine@google.com>
4919
4920 * script.cc (script_include_directive): Implement.
4921 (read_script_file): New local variables name and search_path. Update
4922 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4923 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4924 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4925
98ef3ea4
SA
49262011-11-11 Sterling Augustine <saugustine@google.com>
4927
4928 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4929 (file_or_sections_cmd): Likewise.
4930
f4a8b6d7
DK
49312011-11-11 Doug Kwan <dougkwan@google.com>
4932
4933 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4934 if --just-symbols is given.
4935
29ab395d
DK
49362011-11-10 Doug Kwan <dougkwan@google.com>
4937
4938 PR gold/13362
4939 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4940 when processing data relocs.
4941 * reloc.h (Relocate_functions::rel_unaligned): New method.
4942 (Relocate_functions::pcrel_unaligned): Ditto.
4943 (Relocate_functions::rel32_unaligned): Ditto.
4944 (Relocate_functions::pcrel32_unaligned): Ditto.
4945
2c339f71
DK
49462011-11-09 Doug Kwan <dougkwan@google.com>
4947
4948 PR gold/13362
4949 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4950 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4951 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4952 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4953 (Relocate_functions::rel_unaligned): New.
4954 (Relocate_functions::rel32_unaligned): New.
4955 * target-reloc.h (relocate_for_relocatable): Add code to handle
4956 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4957 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4958 arm_unaligned_reloc_r): New targets.
4959 * testsuite/Makefile.in: Regenerate.
4960 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4961 linking.
4962
3f3cddf1
ILT
49632011-11-02 Ian Lance Taylor <iant@google.com>
4964
4965 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4966 NATIVE_LINKER.
4967 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4968 * options.cc (General_options::finalize): Use library search path
4969 from configure script if specified. If not native and no sysroot,
4970 only search TOOLLIBDIR.
4971 * options.h (Search_directory::Search_directory): Change name to
4972 const std::string&.
4973 (General_options::add_to_library_path_with_sysroot): Change arg to
4974 const std::string&.
4975 * configure, Makefile.in, config.in: Rebuild.
4976
a8e2273b
ILT
49772011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4978
4979 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4980 we are working around the ARM1176 Erratum.
4981 * options.h (General_options::fix_arm1176): Add option.
4982 * testsuite/Makefile.am: Add testcases, and keep current ones
4983 working.
4984 * testsuite/Makefile.in: Regenerate.
4985 * testsuite/arm_fix_1176.s: New file.
4986 * testsuite/arm_fix_1176.sh: Likewise.
4987
cd6eab1c
ILT
49882011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4989
4990 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4991 may_use_blx_.
4992 (Target_arm::may_use_blx): Remove method.
4993 (Target_arm::set_may_use_blx): Likewise.
4994 (Target_arm::may_use_v4t_interworking): New method.
4995 (Target_arm::may_use_v5t_interworking): Likewise.
4996 (Target_arm::may_use_blx_): Remove member variable.
4997 (Arm_relocate_functions::arm_branch_common): Check for v5T
4998 interworking.
4999 (Arm_relocate_functions::thumb_branch_common): Likewise.
5000 (Reloc_stub::stub_type_for_reloc): Likewise.
5001 (Target_arm::do_finalize_sections): Correct interworking checks.
5002 * testsuite/Makefile.am: Add new tests.
5003 * testsuite/Makefile.in: Regenerate.
5004 * testsuite/arm_farcall_arm_arm.s: New test.
5005 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5006 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5007 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5008 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5009 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5010 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5011 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5012
286adcf4
CC
50132011-10-31 Cary Coutant <ccoutant@google.com>
5014
5015 PR gold/13023
5016 * expression.cc (Expression::eval_with_dot): Add
5017 is_section_dot_assignment parameter.
5018 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5019 absolute and assigning to dot within a section.
5020 * script-sections.cc
5021 (Output_section_element_assignment::set_section_addresses): Pass
5022 dot_section to set_if_absolute.
5023 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5024 as is_section_dot_assignment flag to eval_with_dot.
5025 (Output_section_element_dot_assignment::set_section_addresses):
5026 Likewise.
5027 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5028 parameter. Also set value if relative to dot_section; set the
5029 symbol's output_section.
5030 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5031 parameter. Adjust all callers.
5032 (Expression::eval_maybe_dot): Likewise.
5033 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5034 Adjust all callers.
5035 * testsuite/script_test_2.t: Test assignment of an absolute value
5036 to dot within an output section element.
5037
9634ed06
CC
50382011-10-31 Cary Coutant <ccoutant@google.com>
5039
5040 * options.h (class General_options): Add --[no-]gnu-unique options.
5041 * symtab.cc (Symbol_table::sized_write_globals): Convert
5042 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5043
de4101c7
CC
50442011-10-31 Cary Coutant <ccoutant@google.com>
5045
5046 PR gold/13359
5047 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5048 unnecessary assertion.
5049 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5050
7257cc92
ST
50512011-10-31 Sriraman Tallam <tmsriram@google.com>
5052
5053 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5054 gc_mark_symbol.
5055 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5056 gc_mark_symbol.
5057 Change to just keep the section associated with symbol.
5058 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5059 they are externally visible and --export-dynamic is turned on.
5060 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5061
bfc34b3f
ILT
50622011-10-19 Ian Lance Taylor <iant@google.com>
5063
5064 PR gold/13163
5065 * script-sections.cc
5066 (Output_section_element_dot_assignment::needs_output_section): New
5067 function.
5068
ea0d8c47
ILT
50692011-10-19 Ian Lance Taylor <iant@google.com>
5070
5071 PR gold/13204
5072 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5073 --section-start option was seen.
5074 * options.h (General_options::any_section_start): New function.
5075
abd242a9
DM
50762011-10-18 David S. Miller <davem@davemloft.net>
5077
5078 PR binutils/13301
5079 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5080 member to track relocation locations that have moved during TLS
5081 reloc optimizations.
5082 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5083 (Target_sparc::Relocate::relocate): Adjust view down by 4
5084 bytes if it matches reloc_adjust_addr_.
5085 (Target_sparc::Relocate::relocate_tls): Always move the
5086 __tls_get_addr call delay slot instruction forward 4 bytes when
5087 performing relaxation.
5088
bab9090f
CC
50892011-10-18 Cary Coutant <ccoutant@google.com>
5090
5091 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5092 (Output_file::map_no_anonymous): Check for non-zero
5093 return code from posix_fallocate.
5094
f7c5b166
CC
50952011-10-17 Cary Coutant <ccoutant@google.com>
5096
5097 PR gold/13245
5098 * plugin.cc (is_visible_from_outside): Check for symbols
5099 referenced from dynamic objects.
5100 * resolve.cc (Symbol_table::resolve): Don't count references
5101 from dynamic objects as references from real ELF files.
5102 * testsuite/plugin_test_2.sh: Adjust expected result.
5103
b490c0bb
CC
51042011-10-17 Cary Coutant <ccoutant@google.com>
5105
5106 * gold.cc: Include timer.h.
5107 (queue_middle_tasks): Stamp time.
5108 (queue_final_tasks): Likewise.
5109 * main.cc (main): Store timer in parameters. Print timers
5110 for each pass.
5111 * parameters.cc (Parameters::Parameters): Initialize timer_.
5112 (Parameters::set_timer): New function.
5113 (set_parameters_timer): New function.
5114 * parameters.h (Parameters::set_timer): New function.
5115 (Parameters::timer): New function.
5116 (Parameters::timer_): New data member.
5117 (set_parameters_timer): New function.
5118 * timer.cc (Timer::stamp): New function.
5119 (Timer::get_pass_time): New function.
5120 * timer.h (Timer::stamp): New function.
5121 (Timer::get_pass_time): New function.
5122 (Timer::pass_times_): New data member.
5123
f475cf7b
CC
51242011-10-17 Cary Coutant <ccoutant@google.com>
5125
5126 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5127 task for members of lib groups.
5128
cdd7e244
CC
51292011-10-17 Cary Coutant <ccoutant@google.com>
5130
5131 PR gold/13288
4f95c8b4 5132 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5133 (File_read::make_view): Move bounds check (replace with assert)...
5134 (File_read::find_or_make_view): ... to here.
5135
dfb45471
CC
51362011-10-12 Cary Coutant <ccoutant@google.com>
5137
4f95c8b4 5138 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5139 ::read returns less than requested size.
5140
53bbcc1b
CC
51412011-10-10 Cary Coutant <ccoutant@google.com>
5142
4f95c8b4 5143 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5144 Initialize defined_count_.
5145 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5146 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5147 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5148 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5149 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5150 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5151 member.
5152 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5153 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5154 Return zeroes instead of internal error.
5155
397b129b
CC
51562011-10-10 Cary Coutant <ccoutant@google.com>
5157
5158 PR gold/13249
4f95c8b4 5159 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5160 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5161 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5162 (Output_reloc::type_): Adjust size of bit field.
5163 (Output_reloc::use_plt_offset_): New bit field.
5164 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5165 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5166 flag. Adjust all callers.
4f95c8b4 5167 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5168 creating RELATIVE relocations.
5169
d5698657
NC
51702011-10-10 Nick Clifton <nickc@redhat.com>
5171
5172 * po/es.po: Updated Spanish translation.
5173 * po/fi.po: Updated Finnish translation.
5174
6a59a5c2
DN
51752011-10-03 Diego Novillo <dnovillo@google.com>
5176
5177 * options.cc (parse_uint): Fix dereference of RETVAL.
5178
f0558624
ST
51792011-09-29 Sriraman Tallam <tmsriram@google.com>
5180
5181 * layout.h (section_order_map_): New member.
5182 (get_section_order_map): New member function.
5183 * output.cc (Output_section::add_input_section): Check for patterns
5184 only when --section-ordering-file is specified.
5185 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5186 output_sections have been formed.
5187 * layout.cc (Layout_Layout): Initialize section_order_map_.
5188 * plugin.cc (update_section_order): Store order in order_map. Do not
5189 update the order.
5190 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5191 * testsuite/Makefile.in: Regenerate.
5192 * testsuite/plugin_section_order.c: New file.
5193 * testsuite/plugin_final_layout.cc: New file.
5194 * testsuite/plugin_final_layout.sh: New file.
5195
a7dac153
CC
51962011-09-29 Cary Coutant <ccoutant@google.com>
5197
4f95c8b4 5198 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5199 Check for NULL.
4f95c8b4 5200 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5201 symbols during incremental update.
5202 (Symbol_table::add_from_dynobj): Likewise.
5203
eebd87a5
ILT
52042011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5205 Ian Lance Taylor <iant@google.com>
5206
5207 * symtab.cc (Symbol_table::define_special_symbol): Always
5208 canonicalize version string.
5209
403a3331
CC
52102011-09-26 Cary Coutant <ccoutant@google.com>
5211
4f95c8b4
CC
5212 * gold.cc (queue_initial_tasks): Move option checks ...
5213 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5214 some options; make others fatal.
5215
235061c2
CC
52162011-09-26 Cary Coutant <ccoutant@google.com>
5217
5218 gcc PR lto/47247
5219 * plugin.cc (get_symbols_v2): New function.
5220 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5221 (is_referenced_from_outside): New function.
5222 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5223 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5224 (get_symbols): Pass version parameter.
5225 (get_symbols_v2): New function.
5226 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5227 parameter.
5228 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5229 (onload): Add LDPT_GET_SYMBOLS_V2.
5230 (all_symbols_read_hook): Use get_symbols_v2; check for
5231 LDPR_PREVAILING_DEF_IRONLY_EXP.
5232 * testsuite/plugin_test_3.sh: Update expected results.
5233
dc87f620
ILT
52342011-09-23 Simon Baldwin <simonb@google.com>
5235
5236 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5237 configuration options.
5238 * configure: Regenerate.
5239 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5240 * Makefile.in: Regenerate.
5241 * testsuite/Makefile.in: Regenerate.
5242
a8279f82
ST
52432011-09-19 Sriraman Tallam <tmsriram@google.com>
5244
5245 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5246
0c9350c8
CC
52472011-09-19 Cary Coutant <ccoutant@google.com>
5248
5249 * incremental.cc (can_incremental_update): Fix typo in comment.
5250 * incremental.h (can_incremental_update): Likewise.
5251
aa06ae28
CC
52522011-09-18 Cary Coutant <ccoutant@google.com>
5253
5254 * incremental.cc (can_incremental_update): New function.
5255 * incremental.h (can_incremental_update): New function.
5256 * layout.cc (Layout::init_fixed_output_section): Call it.
5257 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5258 * object.cc (Sized_relobj_file::do_layout): Call
5259 can_incremental_update.
5260
ebb300b2
CC
52612011-09-13 Cary Coutant <ccoutant@google.com>
5262
5263 * configure.ac: Check for glibc support for gnu_indirect_function
5264 support with static linking, setting automake conditional
5265 IFUNC_STATIC.
5266 * Makefile.in: Regenerate.
5267 * configure: Regenerate.
5268
5269 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5270 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5271 for IFUNC_STATIC.
5272 * testsuite/Makefile.in: Regenerate.
5273
1206d0d5
CC
52742011-09-13 Cary Coutant <ccoutant@google.com>
5275
5276 * incremental.cc (Sized_relobj_incr::do_layout): Call
5277 report_comdat_group for kept comdat sections.
5278 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5279 * testsuite/Makefile.in: Regenerate.
5280 * testsuite/incr_comdat_test_1.cc: New source file.
5281 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5282 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5283 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5284
40b29874
ILT
52852011-09-13 Ian Lance Taylor <iant@google.com>
5286
5287 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5288 variable external_symbols_offset.
5289
1b045aac
ILT
52902011-09-12 Ian Lance Taylor <iant@google.com>
5291
5292 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5293 triggered if object has no symbols.
5294
24c6c55a
DM
52952011-09-09 David S. Miller <davem@davemloft.net>
5296
5297 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5298 (Output_fill_debug_line::do_write): Likewise.
5299
66570254
CC
53002011-08-29 Cary Coutant <ccoutant@google.com>
5301
5302 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5303 casts to match formatting specs.
5304 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5305
8ea8cd50
CC
53062011-08-26 Cary Coutant <ccoutant@google.com>
5307
5308 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5309 remaining hole size when allocating.
5310 (Layout::make_output_section): Set fill methods for debug sections.
5311 * layout.h (Free_list::Free_list_node): Move from private to
5312 public.
5313 (Free_list::set_min_hole_size): New function.
5314 (Free_list::begin, Free_list::end): New functions.
5315 (Free_list::min_hole_): New data member.
5316 * output.cc: Include dwarf.h.
5317 (Output_fill_debug_info::do_minimum_hole_size): New function.
5318 (Output_fill_debug_info::do_write): New function.
5319 (Output_fill_debug_line::do_minimum_hole_size): New function.
5320 (Output_fill_debug_line::do_write): New function.
5321 (Output_section::Output_section): Initialize new data member.
5322 (Output_section::set_final_data_size): Ensure patch space is larger
5323 than minimum hole size.
5324 (Output_section::do_write): Fill holes in debug sections.
5325 * output.h (Output_fill): New class.
5326 (Output_fill_debug_info): New class.
5327 (Output_fill_debug_line): New class.
5328 (Output_section::set_free_space_fill): New function.
5329 (Output_section::free_space_fill_): New data member.
5330 * testsuite/Makefile.am (incremental_test_3): Add
5331 --incremental-patch option.
5332 (incremental_test_4): Likewise.
5333 (incremental_test_5): Likewise.
5334 (incremental_test_6): Likewise.
5335 (incremental_copy_test): Likewise.
5336 (incremental_common_test_1): Likewise.
5337 * testsuite/Makefile.in: Regenerate.
5338
7cf80422
NC
53392011-08-26 Nick Clifton <nickc@redhat.com>
5340
5341 * po/es.po: Updated Spanish translation.
5342
c3f7b0e5
CC
53432011-08-01 Cary Coutant <ccoutant@google.com>
5344
5345 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5346 * gold/testsuite/Makefile.in: Regenerate.
5347 * gold/testsuite/justsyms_exec.c: New source file.
5348 * gold/testsuite/justsyms_lib.c: New source file.
5349
9590bf25
CC
53502011-08-01 Cary Coutant <ccoutant@google.com>
5351
5352 * layout.cc (Layout::set_segment_offsets): Don't realign text
5353 segment if -Ttext was specified.
5354 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5355 file type.
5356 * object.h (Sized_relobj_file::e_type): New function.
5357 (Sized_relobj_file::e_type_): New data member.
5358 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5359 base address for ET_EXEC files.
5360 * target.cc (Target::do_make_elf_object_implementation): Allow
5361 ET_EXEC files with --just-symbols option.
5362
dcd8d12e
CC
53632011-07-28 Cary Coutant <ccoutant@google.com>
5364
5365 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5366 Add thread_number parameter.
5367 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5368 * workqueue-threads.cc
5369 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5370 current thread if its thread number is greater than desired thread
5371 count.
5372 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5373 Add thread_number parameter.
5374 (Workqueue::should_cancel_thread): Likewise.
5375 (Workqueue::find_runnable_or_wait): Pass thread_number to
5376 should_cancel_thread.
5377 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5378 parameter.
5379
804eb480
ST
53802011-07-22 Sriraman Tallam <tmsriram@google.com>
5381
5382 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5383 only after checking if it cannot be forced local.
5384 * symtab.h (is_externally_visible): Check if the symbol is not forced
5385 local.
5386
f1ddb600
ILT
53872011-07-15 Ian Lance Taylor <iant@google.com>
5388
5389 * options.h (class General_options): Add --print-output-format.
5390 Move -EL next to -EB, for better --help output.
5391 * target-select.cc: Include <cstdio>, "options.h", and
5392 "parameters.h".
5393 (Target_selector::do_target_bfd_name): New function.
5394 (print_output_format): New function.
5395 * target-select.h (class Target_selector): Update declarations.
5396 (Target_selector::target_bfd_name): New function.
5397 (print_output_format): Declare.
5398 * main.cc: Include "target-select.h".
5399 (main): Handle --print-output-format.
5400 * gold.cc: Include "target-select.h".
5401 (queue_initial_tasks): Handle --print-output-format when there are
5402 no input files.
5403 * parameters.cc (parameters_force_valid_target): Give a better
5404 error message if -EB/-EL does not match target.
5405 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5406 function.
5407
7d172687
ILT
54082011-07-15 Ian Lance Taylor <iant@google.com>
5409
5410 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5411 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5412 (Output_data_plt_i386::do_write): Write address of .dynamic
5413 section to first entry in .got.plt section.
5414 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5415 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5416 Initialize layout_.
5417 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5418 section to first entry in .got.plt section.
5419 * layout.h (Layout::dynamic_section): New function.
5420
e9552f7e
ST
54212011-07-13 Sriraman Tallam <tmsriram@google.com>
5422
5423 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5424 to claim_file call.
5425 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5426 input_section_position_, and input_section_glob_.
5427 (read_layout_from_file): Call function section_ordering_specified.
5428 * layout.h (is_section_ordering_specified): New function.
5429 (section_ordering_specified): New function.
5430 (section_ordering_specified_): New boolean member.
5431 * main.cc(main): Call load_plugins after layout object is defined.
5432 * output.cc (Output_section::add_input_section): Use
5433 function section_ordering_specified to check if section ordering is
5434 needed.
5435 * output.cc (Output_section::add_relaxed_input_section): Use
5436 function section_ordering_specified to check if section ordering is
5437 needed.
5438 (Output_section::update_section_layout): New function.
5439 (Output_section::sort_attached_input_sections): Check if input section
5440 must be reordered.
5441 * output.h (Output_section::update_section_layout): New function.
5442 * plugin.cc (get_section_count): New function.
5443 (get_section_type): New function.
5444 (get_section_name): New function.
5445 (get_section_contents): New function.
5446 (update_section_order): New function.
58797674 5447 (allow_section_ordering): New function.
e9552f7e
ST
5448 (Plugin::load): Add the new interfaces to the transfer vector.
5449 (Plugin_manager::load_plugins): New parameter.
5450 (Plugin_manager::all_symbols_read): New parameter.
5451 (Plugin_manager::claim_file): New parameter. Save the elf object for
5452 unclaimed objects.
5453 (Plugin_manager::get_elf_object): New function.
5454 (Plugin_manager::get_view): Change to directly use the bool to check
5455 if get_view is called from claim_file_hook.
5456 * plugin.h (input_objects): New function
5457 (Plugin__manager::load_plugins): New parameter.
5458 (Plugin_manager::claim_file): New parameter.
5459 (Plugin_manager::get_elf_object): New function.
5460 (Plugin_manager::in_claim_file_handler): New function.
5461 (Plugin_manager::in_claim_file_handler_): New member.
5462 (layout): New function.
5463 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5464 handler with an extra parameter. Make the elf object before calling
5465 claim_file handler.
5466 * testsuite/plugin_test.c (get_section_count): New function pointer.
5467 (get_section_type): New function pointer.
5468 (get_section_name): New function pointer.
5469 (get_section_contents): New function pointer.
5470 (update_section_order): New function pointer.
5471 (allow_section_ordering): New function pointer.
5472 (onload): Check if the new interfaces exist.
5473
9446efde
ILT
54742011-07-13 Ian Lance Taylor <iant@google.com>
5475
5476 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5477 relro section.
5478 * x86_64.cc (Target_x86_64::got_section): Likewise.
5479 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5480 (relro_now_test_SOURCES): New variable.
5481 (relro_now_test_DEPENDENCIES): New variable.
5482 (relro_now_test_LDFLAGS): New variable.
5483 (relro_now_test_LDADD): New variable.
5484 (relro_now_test.so): New target.
5485 * testsuite/Makefile.in: Rebuild.
5486
07aa62f2
ILT
54872011-07-12 Ian Lance Taylor <iant@google.com>
5488
5489 PR gold/12980
5490 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5491 GLOB_DAT relocation rather than a RELATIVE relocation for a
5492 protected symbol when creating a shared library.
5493 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5494 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5495 * testsuite/protected_main_1.cc (main): Test that protected
5496 function has same address.
5497
e2153196
ILT
54982011-07-11 Ian Lance Taylor <iant@google.com>
5499
5500 PR gold/12979
5501 * options.h (class General_options): Add -Bgroup.
5502 * options.cc (General_options::finalize): If -Bgroup is set,
5503 default to --unresolved-symbols=report-all.
5504 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5505 * target-reloc.h (issue_undefined_symbol_error): Handle
5506 --unresolved-symbols=report-all.
5507
6daf5215
ILT
55082011-07-08 Ian Lance Taylor <iant@google.com>
5509
5510 PR gold/11985
5511 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5512 if linker script discards key sections.
5513 (Layout::create_dynamic_symtab): Likewise.
5514 (Layout::assign_local_dynsym_offsets): Likewise.
5515 (Layout::sized_create_version_sections): Likewise.
5516 (Layout::create_interp): Likewise.
5517 (Layout::finish_dynamic_section): Likewise.
5518 (Layout::set_dynamic_symbol_size): Likewise.
5519
beabb2c6
ILT
55202011-07-08 Ian Lance Taylor <iant@google.com>
5521
5522 PR gold/12386
5523 * options.h (class General_options): Add --unresolved-symbols.
5524 * target-reloc.h (issue_undefined_symbol_error): Check
5525 --unresolved-symbols. Add comments.
5526
9c16daf1
ILT
55272011-07-08 Ian Lance Taylor <iant@google.com>
5528
5529 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5530 expression more complex.
5531
191f1a2d
ILT
55322011-07-08 Ian Lance Taylor <iant@google.com>
5533
5534 PR gold/11317
5535 * target-reloc.h (issue_undefined_symbol_error): New inline
5536 function, broken out of relocate_section.
5537 (relocate_section): Call issue_undefined_symbol_error.
5538 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5539 there is no TLS segment if we are about to issue an undefined
5540 symbol error.
5541 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5542
62855347
ILT
55432011-07-08 Ian Lance Taylor <iant@google.com>
5544
5545 PR gold/12279
5546 * resolve.cc (Symbol_table::should_override): Add fromtype
5547 parameter. Change all callers. Give error when linking together
5548 TLS and non-TLS symbol.
5549 (Symbol_table::should_override_with_special): Add fromtype
5550 parameter. Change all callers.
5551 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5552 there is no TLS segment if we have reported some errors.
5553 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5554
67181c72
ILT
55552011-07-08 Ian Lance Taylor <iant@google.com>
5556
5557 PR gold/12372
5558 * target.h (Target::plt_address_for_global): New function.
5559 (Target::plt_address_for_local): New function.
5560 (Target::plt_section_for_global): Remove.
5561 (Target::plt_section_for_local): Remove.
5562 (Target::do_plt_address_for_global): New virtual function.
5563 (Target::do_plt_address_for_local): New virtual function.
5564 (Target::do_plt_section_for_global): Remove.
5565 (Target::do_plt_section_for_local): Remove.
5566 (Target::register_global_plt_entry): Add Symbol_table and Layout
5567 parameters.
5568 * output.cc (Output_data_got::Got_entry::write): Use
5569 plt_address_for_global and plt_address_for_local.
5570 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5571 address of output section.
5572 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5573 got_irelative_, and irelative_count_ fields. Update
5574 declarations.
5575 (Output_data_plt_i386::has_irelative_section): New function.
5576 (Output_data_plt_i386::entry_count): Add irelative_count_.
5577 (Output_data_plt_i386::set_final_data_size): Likewise.
5578 (class Target_i386): Add got_irelative_ and rel_irelative_
5579 fields. Update declarations.
5580 (Target_i386::Target_i386): Initialize new fields.
5581 (Target_i386::do_plt_address_for_global): New function replacing
5582 do_plt_section_for_global.
5583 (Target_i386::do_plt_address_for_local): New function replacing
5584 do_plt_section_for_local.
5585 (Target_i386::got_section): Create got_irelative_.
5586 (Target_i386::rel_irelative_section): New function.
5587 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5588 fields. Don't define __rel_iplt_{start,end}.
5589 (Output_data_plt_i386::add_entry): Add symtab and layout
5590 parameters. Change all callers. Use different PLT and GOT for
5591 IFUNC symbols.
5592 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5593 layout parameters. Change all callers. Use different PLT and
5594 GOT.
5595 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5596 (Output_data_plt_i386::rel_irelative): New function.
5597 (Output_data_plt_i386::address_for_global): New function.
5598 (Output_data_plt_i386::address_for_local): New function.
5599 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5600 IRELATIVE GOT when changing IFUNC GOT entries.
5601 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5602 reloc.
5603 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5604 if we didn't create an IRELATIVE GOT.
5605 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5606 plt_address_for_local.
5607 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5608 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5609 got_irelative_, and irelative_count_ fields. Update
5610 declarations.
5611 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5612 Initialize new fields. Remove symtab parameter. Change all
5613 callers.
5614 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5615 irelative_count_.
5616 (Output_data_plt_x86_64::has_irelative_section): New function.
5617 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5618 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5619 fields. Update declarations.
5620 (Target_x86_64::Target_x86_64): Initialize new fields.
5621 (Target_x86_64::do_plt_address_for_global): New function replacing
5622 do_plt_section_for_global.
5623 (Target_x86_64::do_plt_address_for_local): New function replacing
5624 do_plt_section_for_local.
5625 (Target_x86_64::got_section): Create got_irelative_.
5626 (Target_x86_64::rela_irelative_section): New function.
5627 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5628 all callers. Don't create __rel_iplt_{start,end}.
5629 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5630 parameters. Change all callers. Use different PLT and GOT for
5631 IFUNC symbols.
5632 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5633 layout parameters. Change all callers. Use different PLT and
5634 GOT.
5635 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5636 parameters. Change all callers. Use different PLT and GOT for
5637 IFUNC symbols.
5638 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5639 (Output_data_plt_x86_64::rela_irelative): New function.
5640 (Output_data_plt_x86_64::address_for_global): New function.
5641 (Output_data_plt_x86_64::address_for_local): New function.
5642 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5643 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5644 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5645 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5646 parameters.
5647 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5648 reloc.
5649 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5650 symbols if we didn't create an IRELATIVE GOT.
5651 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5652 plt_address_for_local.
5653 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5654 * testsuite/ifuncvar1.c: New test file.
5655 * testsuite/ifuncvar2.c: New test file.
5656 * testsuite/ifuncvar3.c: New test file.
5657 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5658 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5659 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5660 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5661 * testsuite/Makefile.in: Rebuild.
5662
33c15b45
CC
56632011-07-07 Cary Coutant <ccoutant@google.com>
5664
5665 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5666 (two_file_test_1_ndebug.o): Likewise.
5667 (two_file_test_1b_ndebug.o): Likewise.
5668 (two_file_test_2_ndebug.o): Likewise.
5669 (two_file_test_main_ndebug.o): Likewise.
5670 (incremental_test_2): Link with no-debug versions.
5671
f48b5fb7
CC
56722011-07-06 Cary Coutant <ccoutant@google.com>
5673
5674 * gold/incremental.cc
5675 (Output_section_incremental_inputs::write_info_blocks): Check for
5676 hidden and internal symbols.
5677
221597a5
CC
56782011-07-06 Cary Coutant <ccoutant@google.com>
5679
5680 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5681 Check disposition for startup file.
5682 (Incremental_inputs::report_command_line): Ignore
5683 --incremental-startup-unchanged option.
5684 * options.cc (General_options::parse_incremental_startup_unchanged):
5685 New function.
5686 (General_options::General_options): Initialize new data member.
5687 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5688 (General_options): Add --incremental-startup-unchanged option.
5689 (General_options::incremental_startup_disposition): New function.
5690 (General_options::incremental_startup_disposition_): New data member.
5691
e24719f6
CC
56922011-07-06 Cary Coutant <ccoutant@google.com>
5693
5694 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5695 input file index to Script_info ctor.
5696 (Sized_incremental_binary::do_file_has_changed): Find the
5697 command-line argument for files named in scripts.
5698 * incremental.h (Script_info::Script_info): New ctor
5699 with input file index.
5700 (Script_info::input_file_index): New function.
5701 (Script_info::input_file_index_): New data member.
5702 (Incremental_binary::get_library): Add const.
5703 (Incremental_binary::get_script_info): Add const.
5704 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5705 * testsuite/Makefile.am (incremental_test_5): New test case.
5706 (incremental_test_6): New test case.
5707 * testsuite/Makefile.in: Regenerate.
5708
8f7c81e8
CC
57092011-07-06 Cary Coutant <ccoutant@google.com>
5710
5711 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5712 debug output when command lines differ.
5713
9fbd3822
CC
57142011-07-06 Cary Coutant <ccoutant@google.com>
5715
5716 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5717 --incremental-patch option.
5718 * layout.cc (Free_list::allocate): Extend allocation beyond original
5719 end if enabled.
5720 (Layout::make_output_section): Mark sections that should get
5721 patch space.
5722 * options.cc (parse_percent): New function.
5723 * options.h (parse_percent): New function.
5724 (DEFINE_percent): New macro.
5725 (General_options): Add --incremental-patch option.
5726 * output.cc (Output_section::Output_section): Initialize new data
5727 members.
5728 (Output_section::add_input_section): Print section name when out
5729 of patch space.
5730 (Output_section::add_output_section_data): Likewise.
5731 (Output_section::set_final_data_size): Add patch space when
5732 doing --incremental-full.
5733 (Output_section::do_reset_address_and_file_offset): Remove patch
5734 space.
5735 (Output_segment::set_section_list_addresses): Print debug output
5736 only if --incremental-update.
5737 * output.h (Output_section::set_is_patch_space_allowed): New function.
5738 (Output_section::is_patch_space_allowed_): New data member.
5739 (Output_section::patch_space_): New data member.
5740 * parameters.cc (Parameters::incremental_full): New function.
5741 * parameters.h (Parameters::incremental_full): New function
5742 * testsuite/Makefile.am (incremental_test_2): Add test for
5743 --incremental-patch option.
5744 * testsuite/Makefile.in: Regenerate.
5745 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5746 (t18): Remove function body.
5747
f6cccc2c
DK
57482011-07-05 Doug Kwan <dougkwan@google.com>
5749
5750 PR gold/12771
5751 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5752 Arm_Address type for relocation result.
5753 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5754 overflow check.
5755 (Arm_relocate_functions::abs32): Use unaligned access.
5756 (Arm_relocate_functions::rel32): Ditto.
5757 (Arm_relocate_functions::prel31): Ditto.
5758 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5759 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5760 static data relocations.
5761 * testsuite/Makefile.in: Regnerate.
5762 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5763
28a13fec
ILT
57642011-07-05 Ian Lance Taylor <iant@google.com>
5765
5766 PR gold/12392
5767 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5768 symbols if necessary.
5769 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5770
24d47b34
ILT
57712011-07-05 Ian Lance Taylor <iant@google.com>
5772
5773 PR gold/12952
5774 * resolve.cc (Symbol::override_base_with_special): Simply override
5775 version with special symbol version, ignoring previous version.
5776
41f9cbbe
ILT
57772011-07-05 Ian Lance Taylor <iant@google.com>
5778
5779 * object.cc (Sized_relobj_file::include_section_group): Add
5780 information to comment about signature location.
5781
886288f1
ILT
57822011-07-02 Ian Lance Taylor <iant@google.com>
5783
5784 PR gold/12957
5785 * options.h (class General_options): Add -f and -F.
5786 * options.cc (General_options::finalize): Fatal error if -f/-F
5787 are used without -shared.
5788 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5789
ae3a6d4f
ILT
57902011-07-02 Ian Lance Taylor <iant@google.com>
5791
5792 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5793
21131061
ILT
57942011-07-01 Ian Lance Taylor <iant@google.com>
5795
5796 PR gold/12525
5797 PR gold/12952
5798 * resolve.cc (Symbol::override_base_with_special): Don't override
5799 the version if the overriding symbol has a different name.
5800 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5801 all callers. If we give an error about an undefined version,
5802 define the base version if necessary.
5803 * dynobj.h (class Versions): Update declaration.
5804 * testsuite/weak_alias_test_5.cc: New file.
5805 * testsuite/weak_alias_test.script: New file.
5806 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5807 and versioned_alias have the right value, and call t2.
5808 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5809 weak_alias_test_5.so.
5810 (weak_alias_test_LDADD): Likewise.
5811 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5812 * testsuite/Makefile.in: Rebuild.
5813
611062c0
ILT
58142011-07-01 Ian Lance Taylor <iant@google.com>
5815
5816 PR gold/12525
5817 * options.h (class General_options): Support -z notext.
5818 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5819 -Wl,-z,notext.
5820 (two_file_shared_nonpic.so): Likewise.
5821 (two_file_shared_mixed.so): Likewise.
5822 (two_file_shared_mixed_1.so): Likewise.
5823 (weak_undef_lib_nonpic.so): Likewise.
5824 (alt/weak_undef_lib_nonpic.so): Likewise.
5825 (tls_test_shared_nonpic.so): Likewise.
5826 * testsuite/Makefile.in: Rebuild.
5827
328c7c2f
ILT
58282011-07-01 Ian Lance Taylor <iant@google.com>
5829
5830 PR gold/12525
5831 * configure.ac: Test whether static linking works, setting
5832 the automake conditional HAVE_STATIC.
5833 * testsuite/Makefile.am: Disable tests using -static if
5834 HAVE_STATIC is not true.
5835 * configure, testsuite/Makefile.in: Rebuild.
5836
02d7cd44
ILT
58372011-07-01 Ian Lance Taylor <iant@google.com>
5838
5839 PR gold/12525
5840 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5841 Assert if we see DW_EH_PE_indirect.
5842 * target.h (Target::ehframe_datarel_base): New function.
5843 (Target::do_ehframe_datarel_base): New target function.
5844 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5845 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5846 function.
5847
07a60597
ILT
58482011-07-01 Ian Lance Taylor <iant@google.com>
5849
5850 PR gold/12571
5851 * options.h (class General_options): Add
5852 --ld-generated-unwind-info.
5853 * ehframe.cc (Fde::write): Add address parameter. Change all
5854 callers. If associated with PLT, fill in address and size.
5855 (Cie::set_output_offset): Only add merge mapping if there is an
5856 object.
5857 (Cie::write): Add address parameter. Change all callers.
5858 (Eh_frame::add_ehframe_for_plt): New function.
5859 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5860 input_offset_ fields into union u_, with new plt field.
5861 (Fde::Fde): Adjust for new union field.
5862 (Fde::Fde) [Output_data version]: New constructor.
5863 (Fde::add_mapping): Only add merge mapping if there is an object.
5864 (class Cie): Update declarations.
5865 (class Eh_frame): Declare add_ehframe_for_plt.
5866 * layout.cc (Layout::layout_eh_frame): Break out code into
5867 make_eh_frame_section, and call it.
5868 (Layout::make_eh_frame_section): New function.
5869 (Layout::add_eh_frame_for_plt): New function.
5870 * layout.h (class Layout): Update declarations.
5871 * merge.cc (Merge_map::add_mapping): Add assertion.
5872 * i386.cc: Include "dwarf.h".
5873 (class Output_data_plt_i386): Make first_plt_entry,
5874 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5875 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5876 and plt_eh_frame_fde.
5877 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5878 boundary. Call add_eh_frame_for_plt if appropriate.
5879 * x86_64.cc: Include "dwarf.h".
5880 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5881 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5882 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5883 and plt_eh_frame_fde.
5884 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5885 appropriate.
5886
14788a3f
ILT
58872011-06-29 Ian Lance Taylor <iant@google.com>
5888
5889 PR gold/12629
5890 * object.cc (Sized_relobj_file::layout_section): Change shdr
5891 parameter to be const.
5892 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5893 out of do_layout.
5894 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5895 appropriate. Call layout_eh_frame_section.
5896 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5897 sections.
5898 * object.h (class Sized_relobj_file): Update declarations.
5899
6c21fce1
ILT
59002011-06-29 Ian Lance Taylor <iant@google.com>
5901
37e41b03 5902 PR gold/12652
6c21fce1
ILT
5903 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5904 modifier.
5905 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5906
4d5e4e62
ILT
59072011-06-29 Ian Lance Taylor <iant@google.com>
5908
5909 PR gold/12675
5910 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5911 SHT_X86_64_UNWIND.
5912 * layout.cc (Layout::layout_eh_frame): Likewise.
5913
886f533a
ILT
59142011-06-29 Ian Lance Taylor <iant@google.com>
5915
5916 PR gold/12695
5917 * layout.cc (Layout::symtab_section_shndx): New function.
5918 * layout.h (class Layout): Declare symtab_section_shndx.
5919 * output.cc (Output_section::write_header): Call it.
5920
f3ae1b28
ILT
59212011-06-29 Ian Lance Taylor <iant@google.com>
5922
5923 PR gold/12818
5924 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5925 symbols which are not used in a relocation.
5926
aecf301f
ILT
59272011-06-28 Ian Lance Taylor <iant@google.com>
5928
5929 PR gold/12898
5930 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5931 script create indistinguishable segments.
5932 (Layout::set_segment_offsets): Use stable_sort when sorting
5933 segments. Pass this to Compare_segments constructor.
5934 * layout.h (class Layout): Make segment_precedes non-static.
5935 (class Compare_segments): Change from struct to class. Add
5936 layout_ field. Add constructor.
5937 * script-sections.cc
5938 (Script_sections::attach_sections_using_phdrs_clause): Rename
5939 local orphan to is_orphan. Don't report failure to put empty
5940 section in segment. On attachment failure, report name of
5941 section, and attach to first PT_LOAD segment.
5942
03ef7571
ILT
59432011-06-28 Ian Lance Taylor <iant@google.com>
5944
5945 PR gold/12934
5946 * target-select.cc (Target_selector::Target_selector): Add
5947 emulation parameter. Change all callers.
5948 (select_target_by_bfd_name): Rename from select_target_by_name.
5949 Change all callers.
5950 (select_target_by_emulation): New function.
5951 (supported_emulation_names): New function.
5952 * target-select.h (class Target_selector): Add emulation_ field.
5953 Update declarations.
5954 (Target_selector::recognize_by_bfd_name): Rename from
5955 recognize_by_name. Change all callers.
5956 (Target_selector::supported_bfd_names): Rename from
5957 supported_names. Change all callers.
5958 (Target_selector::recognize_by_emulation): New function.
5959 (Target_selector::supported_emulations): New function.
5960 (Target_selector::emulation): New function.
5961 (Target_selector::do_recognize_by_bfd_name): Rename from
5962 do_recognize_by_name. Change all callers.
5963 (Target_selector::do_supported_bfd_names): Rename from
5964 do_supported_names. Change all callers.
5965 (Target_selector::do_recognize_by_emulation): New function.
5966 (Target_selector::do_supported_emulations): New function.
5967 (select_target_by_bfd_name): Change name in declaration.
5968 (select_target_by_emulation): Declare.
5969 (supported_emulation_names): Declare.
5970 * parameters.cc (parameters_force_valid_target): Try to find
5971 target based on emulation from -m option.
5972 * options.h (class General_options): Change doc string for -m.
5973 * options.cc (help): Print emulations.
5974 (General_options::parse_V): Likewise.
5975 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5976 Add emulation parameter. Change all callers.
5977
200b2bb9
ILT
59782011-06-28 Ian Lance Taylor <iant@google.com>
5979
5980 * target.h (class Target): Add osabi_ field.
5981 (Target::osabi): New function.
5982 (Target::set_osabi): New function.
5983 (Target::Target): Initialize osabi_.
5984 (Target::do_adjust_elf_header): Make pure virtual.
5985 (Sized_target::do_adjust_elf_header): Declare.
5986 * target.cc (Sized_target::do_adjust_elf_header): New function.
5987 (class Sized_target): Instantiate all versions.
5988 * freebsd.h (class Target_freebsd): Remove.
5989 (Target_selector_freebsd::do_recognize): Call set_osabi on
5990 Target.
5991 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5992 (Target_selector_freebsd::set_osabi): Remove.
5993 * i386.cc (class Target_i386): Inherit from Sized_target rather
5994 than Target_freebsd.
5995 * x86_64.cc (class Target_x86_64): Likewise.
5996
b3ce541e
ILT
59972011-06-28 Ian Lance Taylor <iant@google.com>
5998
5999 * target.h (Target::can_check_for_function_pointers): Rewrite.
6000 Make non-virtual.
6001 (Target::can_icf_inline_merge_sections): Likewise.
6002 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6003 (Target::Target_info): Add can_icf_inline_merge_sections field.
6004 (Target::do_can_check_for_function_pointers): New virtual
6005 function.
6006 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6007 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6008 from can_check_for_function_pointers, move in file.
6009 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6010 section_may_have_icf_unsafe_poineters, move in file.
6011 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6012 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6013 Rename from can_check_for_function_pointers, move in file.
6014 (Target_i386::can_icf_inline_merge_sections): Remove.
6015 (Target_i386::i386_info): Initialize
6016 can_icf_inline_merge_sections.
6017 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6018 Initialize can_icf_inline_merge_sections.
6019 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6020 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6021 Rename from can_check_for_function_pointers, move in file.
6022 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6023 (Target_x86_64::x86_64_info): Initialize
6024 can_icf_inline_merge_sections.
6025 * testsuite/testfile.cc (Target_test::test_target_info):
6026 Likewise.
6027 * icf.cc (get_section_contents): Correct formatting.
6028
6d1c4efb
ILT
60292011-06-27 Ian Lance Taylor <iant@google.com>
6030
6031 * symtab.cc (Symbol::versioned_name): New function.
6032 (Symbol_table::add_to_final_symtab): Use versioned_name when
6033 appropriate.
6034 (Symbol_table::sized_write_symbol): Likewise.
6035 * symtab.h (class Symbol): Declare versioned_name.
6036 * stringpool.h (class Stringpool_template): Add variant of add
6037 which takes a std::basic_string.
6038 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6039 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6040 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6041 (ver_test_12.o): New target.
6042 * testsuite/Makefile.in: Rebuild.
6043
57eb9b50
DK
60442011-06-27 Doug Kwan <dougkwan@google.com>
6045
6046 * arm.cc (Arm_relocate_functions::thm_jump8,
6047 Arm_relocate_functions::thm_jump11): Use a wider signed
6048 type to compute offset.
6049 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6050 arm_thm_jump8.
6051 * testsuite/Makefile.in: Regenerate.
6052 * testsuite/arm_branch_in_range.sh: Check test results of
6053 arm_thm_jump11 and arm_thm_jump8.
6054 * testsuite/arm_thm_jump11.s: New test source file.
6055 * testsuite/arm_thm_jump11.t: New linker script.
6056 * testsuite/arm_thm_jump8.s: New test source file.
6057 * testsuite/arm_thm_jump8.t: New linker script.
6058
487b39df
ILT
60592011-06-24 Ian Lance Taylor <iant@google.com>
6060
6061 * layout.cc: Include "object.h".
6062 (ctors_sections_in_init_array): New static variable.
6063 (Layout::is_ctors_in_init_array): New function.
6064 (Layout::layout): Add entry to ctors_sections_in_init_array if
6065 appropriate.
6066 * layout.h (class Layout): Declare is_ctors_in_init_array.
6067 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6068 is_ctors_reverse_view is set.
6069 (Sized_relobj_file::write_sections): Add layout parameter. Change
6070 all callers. Set is_ctors_reverse_view field of View_size.
6071 (Sized_relobj_file::reverse_words): New function.
6072 * object.h (Sized_relobj_file::View_size): Add
6073 is_ctors_reverse_view field.
6074 (class Sized_relobj_file): Update declarations.
6075 * testsuite/initpri3.c: New test.
6076 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6077 initpri3b.
6078 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6079 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6080 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6081 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6082 * testsuite/Makefile.in: Rebuild.
6083
472076e4
CC
60842011-06-24 Cary Coutant <ccoutant@google.com>
6085
6086 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6087 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6088 (debug_msg_cdebug.err): New targets.
6089 * testsuite/Makefile.in: Regenerate.
6090 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6091 Fix checks for link with shared library.
6092
a60af0db
DK
60932011-06-24 Doug Kwan <dougkwan@google.com>
6094
6095 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6096 skip empty text sections.
6097 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6098
5393d741
ILT
60992011-06-22 Ian Lance Taylor <iant@google.com>
6100
6101 PR gold/12910
6102 * options.h (class General_options): Add --ctors-in-init-array.
6103 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6104 friends as SHT_PROGBITS for merging sections.
6105 (Layout::layout): Remove special handling of .init_array and
6106 friends. Don't sort if doing relocatable link. Sort for .ctors
6107 and .dtors if ctors_in_init_array.
6108 (Layout::make_output_section): Force correct section types for
6109 .init_array and friends. Don't sort if doing relocatable link,
6110 Don't sort .ctors and .dtors if ctors_in_init_array.
6111 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6112 (Layout::output_section_name): Add relobj parameter. Change all
6113 callers. Handle .ctors. and .dtors. in code rather than table.
6114 Handle .ctors and .dtors if ctors_in_init_array.
6115 (Layout::match_file_name): New function, moved from output.cc.
6116 * layout.h (class Layout): Update declarations.
6117 * output.cc: Include "layout.h".
6118 (Input_section_sort_entry::get_priority): New function.
6119 (Input_section_sort_entry::match_file_name): Just call
6120 Layout::match_file_name.
6121 (Output_section::Input_section_sort_init_fini_compare::operator()):
6122 Handle .ctors and .dtors. Sort by explicit priority rather than
6123 by name.
6124 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6125 * testsuite/initpri2.c: New test.
6126 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6127 (check_PROGRAMS): Add initpri2.
6128 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6129 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6130 * configure, testsuite/Makefile.in: Rebuild.
6131
e1f74f98
ILT
61322011-06-19 Ian Lance Taylor <iant@google.com>
6133
6134 PR gold/12880
6135 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6136 .interp section to a PT_INTERP segment even if we have seen a
6137 --dynamic-linker option. Don't do it if we have seen a PHDRS
6138 clause in a linker script.
6139 (Layout::finalize): Don't create a .interp section if we've
6140 already create a PT_INTERP segment.
6141 (Layout::create_interp): Always call choose_output_section (revert
6142 patch of 2011-06-17). Don't create PT_INTERP segment.
6143 * script-sections.cc
6144 (Script_sections::create_note_and_tls_segments): Add a .interp
6145 section to a PT_INTERP segment even if we have seen a
6146 --dynamic-linker option.
6147
766f91bb
ILT
61482011-06-18 Ian Lance Taylor <iant@google.com>
6149
6150 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6151 merely because a non-PT_LOAD segment has a dynamic reloc.
6152
0d212c3a
ILT
61532011-06-18 Ian Lance Taylor <iant@google.com>
6154
6155 * layout.cc (Layout::finish_dynamic_section): Don't create
6156 DT_FLAGS entry if not needed.
6157
911a5072
ILT
61582011-06-18 Ian Lance Taylor <iant@google.com>
6159
6160 PR gold/12745
6161 * layout.cc (Layout::layout_eh_frame): Correct handling of
6162 writable .eh_frame section.
6163
534b4e5f
ILT
61642011-06-17 Ian Lance Taylor <iant@google.com>
6165
6166 PR gold/12893
6167 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6168 symbol is redefined with the exact same object and value.
6169
10b4f102
ILT
61702011-06-17 Ian Lance Taylor <iant@google.com>
6171
6172 PR gold/12880
6173 * layout.h (class Layout): Add interp_segment_ field.
6174 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6175 (Layout::attach_allocated_section_to_segment): If making shared
6176 library, put .interp section in PT_INTERP segment.
6177 (Layout::finalize): Also call create_interp if -dynamic-linker
6178 option was used.
6179 (Layout::create_interp): Assert that there is no PT_INTERP
6180 segment. If not using a SECTIONS clause, use make_output_section.
6181 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6182 * script-sections.cc
6183 (Script_sections::create_note_and_tls_segments): If making shared
6184 library, put .interp section in PT_INTERP segment.
6185
a29b0dad
ILT
61862011-06-17 Ian Lance Taylor <iant@google.com>
6187
e588ea8d
ILT
6188 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6189 when making a shared library.
6190
61912011-06-17 Ian Lance Taylor <iant@google.com>
6192
6193 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6194 parameter. Change all callers. Don't issue warning about PC32
6195 against locally defined symbol.
a29b0dad 6196
9d3b0698
ILT
61972011-06-16 Ian Lance Taylor <iant@google.com>
6198
6199 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6200 occurs in same object.
6201
85b0f90c
AM
62022011-06-14 Alan Modra <amodra@gmail.com>
6203
6204 * po/POTFILES.in: Regenerate.
6205
a94907d9
ILT
62062011-06-09 Ian Lance Taylor <iant@google.com>
6207
6208 * script-sections.cc
6209 (Orphan_output_section::set_section_addresses): For a relocatable
6210 link set address to 0.
6211
4fb3a1c3
CC
62122011-06-09 Cary Coutant <ccoutant@google.com>
6213
6214 PR gold/12804
6215 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6216 used with --compress-debug-sections.
6217 * gold/object.cc (Sized_relobj_file::do_layout): Report
6218 uncompressed size of compressed input sections.
6219
61220854
CC
62202011-06-08 Cary Coutant <ccoutant@google.com>
6221
6222 PR gold/12804
6223 * testsuite/two_file_test_2_v1.cc: Change initialization of
6224 v2 to keep it in .data.
6225
e6455dfb
CC
62262011-06-07 Cary Coutant <ccoutant@google.com>
6227
6228 * common.cc (Symbol_table::do_allocate_commons_list): Call
6229 gold_fallback.
6230 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6231 (Errors::fallback): New function.
6232 (gold_fallback): New function.
6233 * errors.h (Errors::fallback): New function.
6234 * gold.cc (gold_exit): Change status parameter to enum; adjust
6235 all callers.
6236 (queue_initial_tasks): Call gold_fallback.
6237 * gold.h: Include cstdlib.
6238 (Exit_status): New enum type.
6239 (gold_exit): Change status parameter to enum.
6240 (gold_fallback): New function.
6241 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6242 (Layout::create_symtab_sections): Likewise.
6243 (Layout::create_shdrs): Likewise.
6244 * main.cc (main): Adjust call to gold_exit.
6245 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6246 (Output_data_got::add_got_entry_pair): Likewise.
6247 (Output_section::add_input_section): Likewise.
6248 (Output_section::add_output_section_data): Likewise.
6249 (Output_segment::set_section_list_addresses): Likewise.
6250 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6251
fb0e076f
CC
62522011-06-07 Cary Coutant <ccoutant@google.com>
6253
6254 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6255 for incremental links.
6256 * output.cc (Output_segment::set_section_list_addresses): Remove
6257 FIXME and test for TLS or BSS.
6258
a5ee4d5d
CC
62592011-06-07 Cary Coutant <ccoutant@google.com>
6260
6261 * testsuite/Makefile.am: Add incremental_copy_test,
6262 incremental_common_test_1.
6263 * testsuite/Makefile.in: Regenerate.
6264 * testsuite/common_test_1_v1.c: New source file.
6265 * testsuite/common_test_1_v2.c: New source file.
6266 * testsuite/copy_test_v1.cc: New source file.
6267
5146f448
CC
62682011-06-07 Cary Coutant <ccoutant@google.com>
6269
6270 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6271 update, allocate common from bss section's free list.
6272 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6273 linker-defined symbols.
6274 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6275 Skip GOT and PLT entries that are no longer referenced.
6276 (Output_section_incremental_inputs::write_info_blocks): Mark
6277 linker-defined symbols.
6278 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6279 * output.cc (Output_section::allocate): New function.
6280 * output.h (Output_section::allocate): New function.
6281 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6282 linker-defined symbols.
6283 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6284 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6285 (Symbol::init_base_output_data): Likewise.
6286 (Symbol::init_base_output_segment): Likewise.
6287 (Symbol::init_base_constant): Likewise.
6288 (Sized_symbol::init_output_data): Likewise.
6289 (Sized_symbol::init_output_segment): Likewise.
6290 (Sized_symbol::init_constant): Likewise.
6291 (Symbol_table::do_define_in_output_data): Likewise.
6292 (Symbol_table::do_define_in_output_segment): Likewise.
6293 (Symbol_table::do_define_as_constant): Likewise.
6294 * symtab.h (Symbol::is_predefined): New function.
6295 (Symbol::init_base_output_data): Add is_predefined parameter.
6296 (Symbol::init_base_output_segment): Likewise.
6297 (Symbol::init_base_constant): Likewise.
6298 (Symbol::is_predefined_): New data member.
6299 (Sized_symbol::init_output_data): Add is_predefined parameter.
6300 (Sized_symbol::init_output_segment): Likewise.
6301 (Sized_symbol::init_constant): Likewise.
6302 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6303
26d3c67d
CC
63042011-06-07 Cary Coutant <ccoutant@google.com>
6305
6306 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6307 instead of emit_copy_reloc.
6308 (Copy_relocs::emit_copy_reloc): Refactor.
6309 (Copy_relocs::make_copy_reloc): New function.
6310 (Copy_relocs::add_copy_reloc): Remove.
6311 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6312 section.
6313 (Copy_relocs::make_copy_reloc): New function.
6314 (Copy_relocs::add_copy_reloc): Remove.
6315 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6316 unchanged input files.
6317 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6318 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6319 Reserve BSS space for COPY relocations.
6320 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6321 (Output_section_incremental_inputs::write_info_blocks): Record
6322 whether a symbol is copied from a shared object.
6323 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6324 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6325 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6326 (Incremental_input_entry_reader::get_output_symbol_index): Add
6327 is_copy parameter.
6328 (Incremental_binary::emit_copy_relocs): New function.
6329 (Incremental_binary::do_emit_copy_relocs): New function.
6330 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6331 new data member.
6332 (Sized_incremental_binary::add_copy_reloc): New function.
6333 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6334 (Sized_incremental_binary::Copy_reloc): New struct.
6335 (Sized_incremental_binary::Copy_relocs): New typedef.
6336 (Sized_incremental_binary::copy_relocs_): New data member.
6337 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6338 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6339 * target.h (Sized_target::emit_copy_reloc): New function.
6340 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6341
7cdb37d9
CC
63422011-06-02 Cary Coutant <ccoutant@google.com>
6343
6344 PR gold/12163
6345 * gold/archive.cc (Archive::Archive): Initialize new data member.
6346 (Archive::include_all_members): Return if archive has already been
6347 included.
6348 * gold/archive.h (Archive::include_all_members_): New data member.
6349
cc643b88
NC
63502011-06-02 Nick Clifton <nickc@redhat.com>
6351
6352 * dynobj.h: Fix spelling mistake in comment.
6353 * output.cc: Likewise.
6354
f62a3ca7 63552011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6356 Asier Llano
f62a3ca7
DK
6357
6358 PR gold/12826
cc643b88 6359 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6360 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6361 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6362 redundant arm_exidx_test.so.
6363 * testsuite/Makefile.in: Regenerate.
6364 (check_SCRIPTS): Add pr12826.sh
6365 (check_DATA): Add pr12826.stdout
6366 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6367 * testsuite/pr12826.sh: New file.
6368 * testsuite/pr12826_1.s: Ditto.
6369 * testsuite/pr12826_1.s: Ditto.
6370
8dbe1edc
ILT
63712011-05-30 Ian Lance Taylor <iant@google.com>
6372
6373 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6374 sections.
6375
c49875be
ILT
63762011-05-29 Ian Lance Taylor <iant@google.com>
6377
6378 PR gold/12804
6379 * testsuite/Makefile.am: Use different file name for two_file_test
6380 temporary file for each incremental test.
6381 * testsuite/Makefile.in: Rebuild.
6382
69d53f7a
ILT
63832011-05-29 Ian Lance Taylor <iant@google.com>
6384
6385 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6386 binary input file is empty.
6387
41d0ab5f
ILT
63882011-05-27 Ian Lance Taylor <iant@google.com>
6389
6390 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6391 (ver_test_9.so): Likewise.
6392 * testsuite/Makefile.in: Rebuild.
6393
89d8a36b
CC
63942011-05-26 Cary Coutant <ccoutant@google.com>
6395
6396 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6397 * incremental.cc (Incremental_inputs::report_input_section): Fix
6398 comment, indentation.
6399 (Incremental_inputs::report_comdat_group): New function.
6400 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6401 of data for incremental input file entry.
6402 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6403 group count, COMDAT group signatures.
6404 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6405 an unchanged input file.
6406 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6407 Initialize new data member.
6408 (Incremental_object_entry::add_comdat_group): New function.
6409 (Incremental_object_entry::get_comdat_group_count): New function.
6410 (Incremental_object_entry::get_comdat_signature_key): New function.
6411 (Incremental_object_entry::groups_): New data member.
6412 (Incremental_inputs::report_comdat_group): New function.
6413 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6414 data for incremental input file entry.
6415 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6416 (Incremental_input_entry_reader::get_input_section): Adjust size of
6417 data for incremental input file entry.
6418 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6419 (Incremental_input_entry_reader::get_comdat_group_signature): New
6420 function.
6421 * object.cc (Sized_relobj::include_section_group): Report kept
6422 COMDAT groups for incremental links.
6423
1706a06f
ILT
64242011-05-24 David Meyer <pdox@google.com>
6425
6426 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6427 with name parameter. Add found_name parameter.
6428 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6429 * dirsearch.h (class Dirsearch): Update declaration.
6430
a10ae760
ILT
64312011-05-24 Ian Lance Taylor <iant@google.com>
6432
6433 * archive.cc (Library_base::should_include_member): Pull in object
6434 from archive if it defines the entry symbol.
6435 * parameters.cc (Parameters::entry): New function.
6436 * parameters.h (class Parameters): Declare entry.
6437 * output.h (class Output_file_header): Remove entry_ field.
6438 * output.cc (Output_file_header::Output_file_header): Remove entry
6439 parameter. Change all callers.
6440 (Output_file_header::entry): Use parameters->entry.
6441 * gold.cc (queue_middle_tasks): Likewise.
6442 * plugin.cc (Plugin_hook::run): Likewise.
6443
aa92d6ed
CC
64442011-05-24 Cary Coutant <ccoutant@google.com>
6445
6446 * gold.cc (queue_initial_tasks): Pass incremental base filename
6447 to Output_file::open_base_file; don't print error message.
6448 * incremental-dump.cc (main): Adjust call to
6449 Output_file::open_for_modification.
6450 * incremental-dump.cc (main): Likewise.
6451 * incremental.cc (Incremental_inputs::report_command_line):
6452 Ignore --incremental-base option when comparing command lines.
6453 Ignore parameter when given as separate argument.
6454 * options.h (class General_options): Add --incremental-base.
6455 * output.cc (Output_file::Output_file):
6456 (Output_file::open_base_file): Add base_name and writable parameters;
6457 read base file into new file; print error message here.
6458 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6459 callers.
6460 * output.h (Output_file::open_for_modification): Rename to...
6461 (Output_file::open_base_file): ...this; add base_name and
6462 writable parameters; adjust all callers.
6463 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6464 callers.
6465 * testsuite/Makefile.am (incremental_test_4): Test
6466 --incremental-base.
6467 * testsuite/Makefile.in: Regenerate.
6468
2eedd706
CC
64692011-05-24 Cary Coutant <ccoutant@google.com>
6470
6471 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6472 incremental_test_4.
6473 * testsuite/Makefile.in: Regenerate.
6474 * testsuite/two_file_test_1_v1.cc: New test source file.
6475 * testsuite/two_file_test_1b_v1.cc: New test source file.
6476 * testsuite/two_file_test_2_v1.cc: New test source file.
6477
0f1c85a6
CC
64782011-05-24 Cary Coutant <ccoutant@google.com>
6479
6480 * dynobj.h (Dynobj::do_dynobj): New function.
6481 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6482 flag and soname for shared objects.
6483 * incremental.cc (Incremental_inputs::report_object): Make
6484 either Incremental_object_entry or Incremental_dynobj_entry; add
6485 soname to string table.
6486 (Incremental_inputs::report_input_section): Add assertion.
6487 (Output_section_incremental_inputs::set_final_data_size): Adjust
6488 type of input file entry for shared libraries; adjust size of
6489 shared library info entry.
6490 (Output_section_incremental_inputs::write_input_files): Write
6491 as_needed flag for shared libraries.
6492 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6493 of input file entry for shared libraries; write soname.
6494 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6495 soname from incremental info.
6496 * incremental.h (enum Incremental_input_flags): Add
6497 INCREMENTAL_INPUT_AS_NEEDED.
6498 (Incremental_input_entry::Incremental_input_entry): Initialize new
6499 data member.
6500 (Incremental_input_entry::set_as_needed): New function.
6501 (Incremental_input_entry::as_needed): New function.
6502 (Incremental_input_entry::do_dynobj_entry): New function.
6503 (Incremental_input_entry::as_needed_): New data member.
6504 (Incremental_object_entry::Incremental_object_entry): Don't check
6505 for shared library.
6506 (Incremental_object_entry::do_type): Likewise.
6507 (class Incremental_dynobj_entry): New class.
6508 (Incremental_input_entry_reader::as_needed): New function.
6509 (Incremental_input_entry_reader::get_soname): New function.
6510 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6511 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6512 size of shared library info entry.
58797674 6513 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6514 incremental link when adding DT_NEEDED entries.
6515 * object.h (Object::Object): Initialize new data member.
6516 (Object::dynobj): New function.
6517 (Object::set_as_needed): New function.
6518 (Object::as_needed): New function.
6519 (Object::do_dynobj): New function.
6520 (Object::as_needed_): New data member.
6521
6fa2a40b
CC
65222011-05-24 Cary Coutant <ccoutant@google.com>
6523
6524 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6525 info; adjust display of GOT entries.
6526 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6527 vector of input objects; remove file_status_.
6528 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6529 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6530 got_plt reader; call target hooks to reserve GOT entries.
6531 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6532 of input file info header and GOT info entry.
6533 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6534 relocation info.
6535 (Got_plt_view_info::got_descriptor): Remove.
6536 (Got_plt_view_info::sym_index): New data member.
6537 (Got_plt_view_info::input_index): New data member.
6538 (Local_got_offset_visitor::visit): Write input file index.
6539 (Global_got_offset_visitor::visit): Write 0 for input file index.
6540 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6541 with sym_index and input_index.
6542 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6543 incremental info GOT entry; replace got_descriptor with input_index.
6544 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6545 map from input file index to object.
6546 (Sized_relobj_incr::do_layout): Replace direct data member reference
6547 with accessor function.
6548 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6549 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6550 Adjust size of input file info header.
6551 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6552 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6553 (Incremental_input_entry_reader::get_input_section): Adjust size of
6554 input file info header.
6555 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6556 of incremental info GOT entry.
6557 (Incremental_got_plt_reader::get_got_desc): Remove.
6558 (Incremental_got_plt_reader::get_got_symndx): New function.
6559 (Incremental_got_plt_reader::get_got_input_index): New function.
6560 (Sized_incremental_binary::Sized_incremental_binary): Remove
6561 file_status_; add input_objects_.
6562 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6563 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6564 (Sized_incremental_binary::file_is_unchanged): Remove.
6565 (Sized_incremental_binary::set_input_object): New function.
6566 (Sized_incremental_binary::input_object): New function.
6567 (Sized_incremental_binary::file_status_): Remove.
6568 (Sized_incremental_binary::input_objects_): New data member.
6569 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6570 references.
6571 (Sized_relobj_incr::invalid_address): Move to base class.
6572 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6573 class.
6574 (Sized_relobj_incr::do_output_section_offset): Likewise.
6575 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6576 (Sized_relobj_incr::section_offsets_): Likewise.
6577 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6578 function.
6579 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6580 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6581 with accessor function.
6582 (Sized_relobj_file::do_layout): Likewise.
6583 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6584 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6585 (Sized_relobj_file::compute_final_local_value): Replace refs to
6586 section_offsets_ with accessor function.
6587 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6588 * object.h (Relobj::Relobj): Initialize new data members.
6589 (Relobj::add_dyn_reloc): New function.
6590 (Relobj::first_dyn_reloc): New function.
6591 (Relobj::dyn_reloc_count): New function.
6592 (Relobj::first_dyn_reloc_): New data member.
6593 (Relobj::dyn_reloc_count_): New data member.
6594 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6595 references.
6596 (Sized_relobj::Address): New typedef.
6597 (Sized_relobj::invalid_address): Move here from child class.
6598 (Sized_relobj::Sized_relobj): Initialize new data members.
6599 (Sized_relobj::sized_relobj): New function.
6600 (Sized_relobj::is_output_section_offset_invalid): Move here from
6601 child class.
6602 (Sized_relobj::get_output_section_offset): Likewise.
6603 (Sized_relobj::local_has_got_offset): Likewise.
6604 (Sized_relobj::local_got_offset): Likewise.
6605 (Sized_relobj::set_local_got_offset): Likewise.
6606 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6607 (Sized_relobj::clear_got_offsets): New function.
6608 (Sized_relobj::section_offsets): Move here from child class.
6609 (Sized_relobj::do_output_section_offset): Likewise.
6610 (Sized_relobj::do_set_section_offset): Likewise.
6611 (Sized_relobj::Local_got_offsets): Likewise.
6612 (Sized_relobj::local_got_offsets_): Likewise.
6613 (Sized_relobj::section_offsets_): Likewise.
6614 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6615 references.
6616 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6617 class.
6618 (Sized_relobj_file::sized_relobj): New function
6619 (Sized_relobj_file::local_has_got_offset): Move to base class.
6620 (Sized_relobj_file::local_got_offset): Likewise.
6621 (Sized_relobj_file::set_local_got_offset): Likewise.
6622 (Sized_relobj_file::get_output_section_offset): Likewise.
6623 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6624 (Sized_relobj_file::do_output_section_offset): Likewise.
6625 (Sized_relobj_file::do_set_section_offset): Likewise.
6626 (Sized_relobj_file::Local_got_offsets): Likewise.
6627 (Sized_relobj_file::local_got_offsets_): Likewise.
6628 (Sized_relobj_file::section_offsets_): Likewise.
6629 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6630 (all constructors).
6631 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6632 (Output_reloc::get_symbol_index): Likewise.
6633 (Output_reloc::local_section_offset): Likewise.
6634 (Output_reloc::get_address): Likewise.
6635 (Output_reloc::symbol_value): Likewise.
6636 (Output_data_got::reserve_slot): Move to class definition.
6637 (Output_data_got::reserve_local): New function.
6638 (Output_data_got::reserve_slot_for_global): Remove.
6639 (Output_data_got::reserve_global): New function.
6640 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6641 (all constructors, two instantiations).
6642 (Output_reloc::get_relobj): New function (two instantiations).
6643 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6644 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6645 (Output_data_reloc::add_global): Adjust type of relobj.
6646 (Output_data_reloc::add_global_relative): Likewise.
6647 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6648 (Output_data_reloc::add_local): Likewise.
6649 (Output_data_reloc::add_local_relative): Likewise.
6650 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6651 (Output_data_reloc::add_local_section): Likewise.
6652 (Output_data_reloc::add_output_section): Likewise.
6653 (Output_data_reloc::add_absolute): Likewise.
6654 (Output_data_reloc::add_target_specific): Likewise.
6655 (Output_data_got::reserve_slot): Move definition here.
6656 (Output_data_got::reserve_local): New function.
6657 (Output_data_got::reserve_global): New function.
6658 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6659 section_offsets_ with accessor function.
6660 (Sized_relobj_file::write_sections): Likewise.
6661 (Sized_relobj_file::do_relocate_sections): Likewise.
6662 * target.h (Sized_target::reserve_local_got_entry): New function.
6663 (Sized_target::reserve_global_got_entry): New function.
6664 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6665 (Target_x86_64::reserve_global_got_entry): New function.
6666 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6667
4829d394
CC
66682011-05-23 Cary Coutant <ccoutant@google.com>
6669
6670 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6671 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6672 bit when checking got_type.
6673 * incremental.cc (Sized_incremental_binary::setup_readers):
6674 Store symbol table and string table locations; initialize bit vector
6675 of file status flags.
6676 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6677 unchanged files.
6678 (Sized_incremental_binary::do_process_got_plt): New function.
6679 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6680 (Output_section_incremental_inputs::set_final_data_size): Record
6681 file index for each input file.
6682 (Output_section_incremental_inputs::write_got_plt): Store file index
6683 instead of input entry offset for each GOT entry.
6684 * incremental.h
6685 (Incremental_input_entry::Incremental_input_entry): Initialize new
6686 data member.
6687 (Incremental_input_entry::set_offset): Store file index.
6688 (Incremental_input_entry::get_file_index): New function.
6689 (Incremental_input_entry::file_index_): New data member.
6690 (Incremental_binary::process_got_plt): New function.
6691 (Incremental_binary::do_process_got_plt): New function.
6692 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6693 data members.
6694 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6695 (Sized_incremental_binary::set_file_is_unchanged): New function.
6696 (Sized_incremental_binary::file_is_unchanged): New function.
6697 (Sized_incremental_binary::do_process_got_plt): New function.
6698 (Sized_incremental_binary::file_status_): New data member.
6699 (Sized_incremental_binary::main_symtab_loc_): New data member.
6700 (Sized_incremental_binary::main_strtab_loc_): New data member.
6701 * output.cc (Output_data_got::Got_entry::write): Add case
6702 RESERVED_CODE.
6703 (Output_data_got::add_global): Call add_got_entry.
6704 (Output_data_got::add_global_plt): Likewise.
6705 (Output_data_got::add_global_with_rel): Likewise.
6706 (Output_data_got::add_global_with_rela): Likewise.
6707 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6708 (Output_data_got::add_global_pair_with_rela): Likewise.
6709 (Output_data_got::add_local): Call add_got_entry.
6710 (Output_data_got::add_local_plt): Likewise.
6711 (Output_data_got::add_local_with_rel): Likewise.
6712 (Output_data_got::add_local_with_rela): Likewise.
6713 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6714 (Output_data_got::add_local_pair_with_rela): Likewise.
6715 (Output_data_got::reserve_slot): New function.
6716 (Output_data_got::reserve_slot_for_global): New function.
6717 (Output_data_got::add_got_entry): New function.
6718 (Output_data_got::add_got_entry_pair): New function.
6719 (Output_section::add_output_section_data): Edit FIXME.
6720 * output.h
6721 (Output_section_data_build::Output_section_data_build): New
6722 constructor with size parameter.
6723 (Output_data_space::Output_data_space): Likewise.
6724 (Output_data_got::Output_data_got): Initialize new data member; new
6725 constructor with size parameter.
6726 (Output_data_got::add_constant): Call add_got_entry.
6727 (Output_data_got::reserve_slot): New function.
6728 (Output_data_got::reserve_slot_for_global): New function.
6729 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6730 (Output_data_got::add_got_entry): New function.
6731 (Output_data_got::add_got_entry_pair): New function.
6732 (Output_data_got::free_list_): New data member.
6733 * target.h (Sized_target::init_got_plt_for_update): New function.
6734 (Sized_target::register_global_plt_entry): New function.
6735 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6736 Initialize new data member; call init; add constructor with PLT count.
6737 (Output_data_plt_x86_64::init): New function.
6738 (Output_data_plt_x86_64::add_relocation): New function.
6739 (Output_data_plt_x86_64::reserve_slot): New function.
6740 (Output_data_plt_x86_64::free_list_): New data member.
6741 (Target_x86_64::init_got_plt_for_update): New function.
6742 (Target_x86_64::register_global_plt_entry): New function.
6743 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6744 incremental updates.
6745 (Output_data_plt_x86_64::add_relocation): New function.
6746 * testsuite/object_unittest.cc (Object_test): Set default options.
6747
ec69d6da
ILT
67482011-05-16 Ian Lance Taylor <iant@google.com>
6749
6750 * options.h (class General_options): Make -i a synonym for -r.
6751
732e31de
ILT
67522011-05-16 Ian Lance Taylor <iant@google.com>
6753
6754 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6755
403676b5
CC
67562011-05-10 Cary Coutant <ccoutant@google.com>
6757
6758 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6759 strip_all (-s).
6760
5b7b7d6e
ILT
67612011-05-06 Ian Lance Taylor <iant@google.com>
6762
6763 * layout.cc (Layout::layout): If the output section flags change,
6764 update the ordering.
6765
f0f9babf
CC
67662011-04-25 Cary Coutant <ccoutant@google.com>
6767
6768 * incremental-dump.cc (dump_incremental_inputs): Print local
6769 symbol info for each input file.
6770 * incremental.cc
6771 (Output_section_incremental_inputs::set_final_data_size): Add local
6772 symbol info to input file entries in incremental info.
6773 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6774 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6775 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6776 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6777 implementation.
6778 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6779 (Sized_incr_relobj::do_relocate): Write the local symbols.
6780 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6781 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6782 Adjust size of input file header.
6783 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6784 (Incremental_inputs_reader::get_local_symbol_count): New function.
6785 (Incremental_inputs_reader::get_input_section): Adjust size of input
6786 file header.
6787 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6788 (Sized_incr_relobj::This): New typedef.
6789 (Sized_incr_relobj::sym_size): New const data member.
6790 (Sized_incr_relobj::Local_symbol): New struct.
6791 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6792 (Sized_incr_relobj::do_local_symbol_offset): New function.
6793 (Sized_incr_relobj::local_symbol_count_): New data member.
6794 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6795 (Sized_incr_relobj::local_symbol_index_): New data member.
6796 (Sized_incr_relobj::local_symbol_offset_): New data member.
6797 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6798 (Sized_incr_relobj::local_symbols_): New data member.
6799 * object.h (Relobj::output_local_symbol_count): New function.
6800 (Relobj::local_symbol_offset): New function.
6801 (Relobj::do_output_local_symbol_count): New function.
6802 (Relobj::do_local_symbol_offset): New function.
6803 (Sized_relobj::do_output_local_symbol_count): New function.
6804 (Sized_relobj::do_local_symbol_offset): New function.
6805
d0a9ace3
ILT
68062011-04-22 Vladimir Simonov <sv@sw.ru>
6807
6808 * descriptors.cc (set_close_on_exec): New function.
6809 (Descriptors::open): Use set_close_on_exec.
6810 * output.cc (S_ISLNK): Define if not defined.
6811
94a3fc8b
CC
68122011-04-22 Cary Coutant <ccoutant@google.com>
6813
6814 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6815 global symbol map.
6816 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6817 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6818 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6819 relocations.
6820 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6821 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6822 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6823 * incremental.h
6824 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6825 function.
6826 (Incremental_binary::apply_incremental_relocs): New function.
6827 (Incremental_binary::do_apply_incremental_relocs): New function.
6828 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6829 data member.
6830 (Sized_incremental_binary::add_global_symbol): New function.
6831 (Sized_incremental_binary::global_symbol): New function.
6832 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6833 (Sized_incremental_binary::symbol_map_): New data member.
6834 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6835 * target.h (Sized_target::apply_relocation): New function.
6836 * target-reloc.h (apply_relocation): New function.
6837 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6838
c87e4302
DK
68392011-04-22 Doug Kwan <dougkwan@google.com>
6840
6841 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6842 flag of a SHT_ARM_EXIDX section.
2e702c99 6843 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6844 * testsuite/Makefile.in: Regenerate.
6845 * testsuite/arm_exidx_test.s: New file.
6846 * testsuite/arm_exidx_test.sh: Same.
6847
e7782cf6
CC
68482011-04-20 Cary Coutant <ccoutant@google.com>
6849
6850 PR gold/12689
6851 * archive.h (Incremental_archive_entry::Archive_member):
6852 Initialize arg_serial_ (second constructor).
6853
308ecdc7
ILT
68542011-04-17 Ian Lance Taylor <iant@google.com>
6855
6856 * object.cc (Relocate_info::location): Simplify location string.
6857 * errors.cc (Errors::error_at_location): Don't print program
6858 name.
6859 (Errors::warning_at_location): Likewise.
6860 (Errors::undefined_symbol): Likewise.
6861 * testsuite/debug_msg.sh: Update accordingly.
6862
bec5b579
CC
68632011-04-14 Cary Coutant <ccoutant@google.com>
6864
6865 * gold/layout.cc (Layout::symtab_section_offset): New function.
6866 * gold/layout.h (Layout::symtab_section_offset): New function.
6867 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6868
88597d34
ILT
68692011-04-12 Ian Lance Taylor <iant@google.com>
6870
6871 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6872 with MREMAP_MAYMOVE.
6873 * output.h (class Output_file): Add map_is_allocated_ field.
6874 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6875 not available, provide stubs. If mremap is not available, #define
6876 it to gold_mremap.
6877 (MREMAP_MAYMOVE): Define if not defined.
6878 (Output_file::Output_file): Initialize map_is_allocated_.
6879 (Output_file::resize): Check map_is_allocated_.
6880 (Output_file::map_anonymous): If mmap fails, use malloc.
6881 (Output_file::unmap): Don't do anything for an anonymous map.
6882 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6883 is not available, provide stubs.
6884 (File_read::View::~View): Use free rather than delete[].
6885 (File_read::make_view): Use malloc rather than new[]. If mmap
6886 fails, use malloc.
6887 (File_read::find_or_make_view): Use malloc rather than new[].
6888 * gold.h: Remove HAVE_REMAP code.
6889 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6890 exists. Rename mremap to gold_mremap. If mmap is not available
6891 don't do anything.
6892 * configure, config.in: Rebuild.
6893
11e361bc
ILT
68942011-04-11 Ian Lance Taylor <iant@google.com>
6895
6896 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6897 initialize local variable v.
6898
cdc29364
CC
68992011-04-11 Cary Coutant <ccoutant@google.com>
6900
6901 * archive.cc (Archive::include_member): Adjust call to
6902 report_object.
6903 (Add_archive_symbols::run): Track argument serial numbers.
6904 (Lib_group::include_member): Likewise.
6905 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6906 * archive.h (Incremental_archive_entry::Archive_member):
6907 Initialize arg_serial_.
6908 (Archive_member::arg_serial_): New data member.
6909 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6910 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6911 incremental link.
6912 (Sized_dynobj::do_for_all_local_got_entries): New function.
6913 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6914 function.
6915 * fileread.cc (get_mtime): New function.
6916 * fileread.h (get_mtime): New function.
6917 * gold.cc (queue_initial_tasks): Check for incremental update.
6918 (process_incremental_input): New function.
6919 (queue_middle_tasks): Don't force valid target for incremental
6920 update.
6921 * incremental-dump.cc (find_input_containing_global): Adjust
6922 size of symbol info entry.
6923 (dump_incremental_inputs): Dump argument serial number and
6924 in_system_directory flag; bias shndx by 1; print symbol names
6925 when dumping per-file symbol lists; use new symbol info readers.
6926 * incremental.cc
6927 (Output_section_incremental_inputs:update_data_size): New function.
6928 (Sized_incremental_binary::setup_readers): Setup input readers
6929 for each input file; build maps for files added from libraries
6930 and scripts.
6931 (Sized_incremental_binary::check_input_args): New function.
6932 (Sized_incremental_binary::do_check_inputs): Build map of argument
6933 serial numbers to input arguments.
6934 (Sized_incremental_binary::do_file_has_changed): Rename
6935 do_file_is_unchanged to this; compare file modification times.
6936 (Sized_incremental_binary::do_init_layout): New function.
6937 (Sized_incremental_binary::do_reserve_layout): New function.
6938 (Sized_incremental_binary::do_get_input_reader): Remove.
6939 (Sized_incremental_binary::get_symtab_view): New function.
6940 (Incremental_checker::can_incrementally_link_output_file): Remove.
6941 (Incremental_inputs::report_command_line): Exclude --debug options.
6942 (Incremental_inputs::report_archive_begin): Add parameter; track
6943 argument serial numbers; don't put input file entry for archive
6944 before archive members.
6945 (Incremental_inputs::report_archive_end): Put input file entry
6946 for archive after archive members.
6947 (Incremental_inputs::report_object): Add parameter; track argument
6948 serial numbers and in_system_directory flag.
6949 (Incremental_inputs::report_script): Add parameter; track argument
6950 serial numbers.
6951 (Output_section_incremental_inputs::set_final_data_size): Adjust
6952 size of symbol info entry; check for forwarding symbols.
6953 (Output_section_incremental_inputs::write_input_files): Write
6954 in_system_directory flag and argument serial number.
6955 (Output_section_incremental_inputs::write_info_blocks): Map section
6956 indices between incremental info and original input file; store
6957 input section index for each symbol.
6958 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6959 change operator() to visit().
6960 (class Global_got_offset_visitor): Likewise.
6961 (class Global_symbol_visitor_got_plt):
6962 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6963 classes.
6964 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6965 (Sized_incr_relobj::do_read_symbols): New function.
6966 (Sized_incr_relobj::do_layout): New function.
6967 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6968 (Sized_incr_relobj::do_add_symbols): New function.
6969 (Sized_incr_relobj::do_should_include_member): New function.
6970 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6971 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6972 (Sized_incr_relobj::do_section_size): New function.
6973 (Sized_incr_relobj::do_section_name): New function.
6974 (Sized_incr_relobj::do_section_contents): New function.
6975 (Sized_incr_relobj::do_section_flags): New function.
6976 (Sized_incr_relobj::do_section_entsize): New function.
6977 (Sized_incr_relobj::do_section_address): New function.
6978 (Sized_incr_relobj::do_section_type): New function.
6979 (Sized_incr_relobj::do_section_link): New function.
6980 (Sized_incr_relobj::do_section_info): New function.
6981 (Sized_incr_relobj::do_section_addralign): New function.
6982 (Sized_incr_relobj::do_initialize_xindex): New function.
6983 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6984 (Sized_incr_relobj::do_read_relocs): New function.
6985 (Sized_incr_relobj::do_gc_process_relocs): New function.
6986 (Sized_incr_relobj::do_scan_relocs): New function.
6987 (Sized_incr_relobj::do_count_local_symbols): New function.
6988 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6989 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6990 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6991 (Sized_incr_relobj::do_relocate): New function.
6992 (Sized_incr_relobj::do_set_section_offset): New function.
6993 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6994 (Sized_incr_dynobj::do_read_symbols): New function.
6995 (Sized_incr_dynobj::do_layout): New function.
6996 (Sized_incr_dynobj::do_add_symbols): New function.
6997 (Sized_incr_dynobj::do_should_include_member): New function.
6998 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6999 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7000 (Sized_incr_dynobj::do_section_size): New function.
7001 (Sized_incr_dynobj::do_section_name): New function.
7002 (Sized_incr_dynobj::do_section_contents): New function.
7003 (Sized_incr_dynobj::do_section_flags): New function.
7004 (Sized_incr_dynobj::do_section_entsize): New function.
7005 (Sized_incr_dynobj::do_section_address): New function.
7006 (Sized_incr_dynobj::do_section_type): New function.
7007 (Sized_incr_dynobj::do_section_link): New function.
7008 (Sized_incr_dynobj::do_section_info): New function.
7009 (Sized_incr_dynobj::do_section_addralign): New function.
7010 (Sized_incr_dynobj::do_initialize_xindex): New function.
7011 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7012 (make_sized_incremental_object): New function.
7013 (Incremental_library::copy_unused_symbols): New function.
7014 (Incremental_library::do_for_all_unused_symbols): New function.
7015 * incremental.h (enum Incremental_input_flags): New type.
7016 (class Incremental_checker): Remove.
7017 (Incremental_input_entry::Incremental_input_entry): Add argument
7018 serial number.
7019 (Incremental_input_entry::arg_serial): New function.
7020 (Incremental_input_entry::set_is_in_system_directory): New function.
7021 (Incremental_input_entry::is_in_system_directory): New function.
7022 (Incremental_input_entry::arg_serial_): New data member.
7023 (Incremental_input_entry::is_in_system_directory_): New data member.
7024 (class Script_info): Move here from script.h.
7025 (Script_info::Script_info): Add filename parameter.
7026 (Script_info::filename): New function.
7027 (Script_info::filename_): New data member.
7028 (Incremental_script_entry::Incremental_script_entry): Add argument
7029 serial number.
7030 (Incremental_object_entry::Incremental_object_entry): Likewise.
7031 (Incremental_object_entry::add_input_section): Build list of input
7032 sections with map to original shndx.
7033 (Incremental_object_entry::get_input_section_index): New function.
7034 (Incremental_object_entry::shndx_): New data member.
7035 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7036 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7037 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7038 serial number.
7039 (Incremental_inputs::report_archive_begin): Likewise.
7040 (Incremental_inputs::report_object): Likewise.
7041 (Incremental_inputs::report_script): Likewise.
7042 (class Incremental_global_symbol_reader): New class.
7043 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7044 and store flags and input file type.
7045 (Incremental_input_entry_reader::arg_serial): New function.
7046 (Incremental_input_entry_reader::type): Extract type from flags.
7047 (Incremental_input_entry_reader::is_in_system_directory): New function.
7048 (Incremental_input_entry_reader::get_input_section_count): Call
7049 accessor function for type.
7050 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7051 function for type; adjust size of global symbol entry.
7052 (Incremental_input_entry_reader::get_global_symbol_count): Call
7053 accessor function for type.
7054 (Incremental_input_entry_reader::get_object_count): Likewise.
7055 (Incremental_input_entry_reader::get_object_offset): Likewise.
7056 (Incremental_input_entry_reader::get_member_count): Likewise.
7057 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7058 (Incremental_input_entry_reader::get_member_offset): Likewise.
7059 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7060 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7061 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7062 (Incremental_input_entry_reader::get_global_symbol_reader): New
7063 function.
7064 (Incremental_input_entry_reader::get_output_symbol_index): New
7065 function.
7066 (Incremental_input_entry_reader::type_): Remove.
7067 (Incremental_input_entry_reader::flags_): New data member.
7068 (Incremental_inputs_reader::input_file_offset): New function.
7069 (Incremental_inputs_reader::input_file_index): New function.
7070 (Incremental_inputs_reader::input_file): Call input_file_offset.
7071 (Incremental_inputs_reader::input_file_at_offset): New function.
7072 (Incremental_relocs_reader::get_r_type): Reformat.
7073 (Incremental_relocs_reader::get_r_shndx): Reformat.
7074 (Incremental_relocs_reader::get_r_offset): Reformat.
7075 (Incremental_relocs_reader::data): New function.
7076 (Incremental_binary::Incremental_binary): Initialize new data members.
7077 (Incremental_binary::check_inputs): Add cmdline parameter.
7078 (Incremental_binary::file_is_unchanged): Remove.
7079 (Input_reader::arg_serial): New function.
7080 (Input_reader::get_unused_symbol_count): New function.
7081 (Input_reader::get_unused_symbol): New function.
7082 (Input_reader::do_arg_serial): New function.
7083 (Input_reader::do_get_unused_symbol_count): New function.
7084 (Input_reader::do_get_unused_symbol): New function.
7085 (Incremental_binary::input_file_count): New function.
7086 (Incremental_binary::get_input_reader): Change signature to use
7087 index instead of filename.
7088 (Incremental_binary::file_has_changed): New function.
7089 (Incremental_binary::get_input_argument): New function.
7090 (Incremental_binary::get_library): New function.
7091 (Incremental_binary::get_script_info): New function.
7092 (Incremental_binary::init_layout): New function.
7093 (Incremental_binary::reserve_layout): New function.
7094 (Incremental_binary::output_file): New function.
7095 (Incremental_binary::do_check_inputs): New function.
7096 (Incremental_binary::do_file_is_unchanged): Remove.
7097 (Incremental_binary::do_file_has_changed): New function.
7098 (Incremental_binary::do_init_layout): New function.
7099 (Incremental_binary::do_reserve_layout): New function.
7100 (Incremental_binary::do_input_file_count): New function.
7101 (Incremental_binary::do_get_input_reader): Change signature.
7102 (Incremental_binary::input_args_map_): New data member.
7103 (Incremental_binary::library_map_): New data member.
7104 (Incremental_binary::script_map_): New data member.
7105 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7106 new data members.
7107 (Sized_incremental_binary::output_section): New function.
7108 (Sized_incremental_binary::inputs_reader): Add const.
7109 (Sized_incremental_binary::symtab_reader): Add const.
7110 (Sized_incremental_binary::relocs_reader): Add const.
7111 (Sized_incremental_binary::got_plt_reader): Add const.
7112 (Sized_incremental_binary::get_symtab_view): New function.
7113 (Sized_incremental_binary::Inputs_reader): New typedef.
7114 (Sized_incremental_binary::Input_entry_reader): New typedef.
7115 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7116 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7117 (Sized_incremental_binary::do_file_has_changed): New function.
7118 (Sized_incremental_binary::do_init_layout): New function.
7119 (Sized_incremental_binary::do_reserve_layout): New function.
7120 (Sized_input_reader::Inputs_reader): Remove.
7121 (Sized_input_reader::Input_entry_reader): Remove.
7122 (Sized_input_reader::do_arg_serial): New function.
7123 (Sized_input_reader::do_get_unused_symbol_count): New function.
7124 (Sized_input_reader::do_get_unused_symbol): New function.
7125 (Sized_incremental_binary::do_input_file_count): New function.
7126 (Sized_incremental_binary::do_get_input_reader): Change signature;
7127 use index instead of filename.
7128 (Sized_incremental_binary::section_map_): New data member.
7129 (Sized_incremental_binary::input_entry_readers_): New data member.
7130 (class Sized_incr_relobj): New class.
7131 (class Sized_incr_dynobj): New class.
7132 (make_sized_incremental_object): New function.
7133 (class Incremental_library): New class.
7134 * layout.cc (Free_list::num_lists): New static data member.
7135 (Free_list::num_nodes): New static data member.
7136 (Free_list::num_removes): New static data member.
7137 (Free_list::num_remove_visits): New static data member.
7138 (Free_list::num_allocates): New static data member.
7139 (Free_list::num_allocate_visits): New static data member.
7140 (Free_list::init): New function.
7141 (Free_list::remove): New function.
7142 (Free_list::allocate): New function.
7143 (Free_list::dump): New function.
7144 (Free_list::print_stats): New function.
7145 (Layout_task_runner::run): Resize output file for incremental updates.
7146 (Layout::Layout): Initialize new data members.
7147 (Layout::set_incremental_base): New function.
7148 (Layout::init_fixed_output_section): New function.
7149 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7150 incremental updates.
7151 (Layout::create_gold_note): Do not create gold note section for
7152 incremental updates.
7153 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7154 for incremental updates.
7155 (Layout::set_section_offsets): For incremental updates, allocate space
7156 from free list.
7157 (Layout::create_symtab_sections): Layout with offsets relative to
7158 start of section; for incremental updates, allocate space from free
7159 list.
7160 (Layout::create_shdrs): For incremental updates, allocate space from
7161 free list.
7162 (Layout::finish_dynamic_section): For incremental updates, do not
7163 check --as-needed (fixed in subsequent patch).
7164 * layout.h (class Free_list): New class.
7165 (Layout::set_incremental_base): New function.
7166 (Layout::incremental_base): New function.
7167 (Layout::init_fixed_output_section): New function.
7168 (Layout::allocate): New function.
7169 (Layout::incremental_base_): New data member.
7170 (Layout::free_list_): New data member.
7171 * main.cc (main): Print Free_list statistics.
7172 * object.cc (Relobj::finalize_incremental_relocs): Add
7173 clear_counts parameter; clear counts only when clear_counts is set.
7174 (Sized_relobj::Sized_relobj): Initialize new base class.
7175 (Sized_relobj::do_layout): Don't report special sections.
7176 (Sized_relobj::do_for_all_local_got_entries): New function.
7177 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7178 symtab_off to all symbol table offsets.
7179 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7180 * object.h (class Got_offset_list): Move to top of file.
7181 (Object::Object): Allow case where input_file == NULL.
7182 (Object::~Object): Likewise.
7183 (Object::input_file): Assert that input_file != NULL.
7184 (Object::lock): Allow case where input_file == NULL.
7185 (Object::unlock): Likewise.
7186 (Object::is_locked): Likewise.
7187 (Object::token): Likewise.
7188 (Object::release): Likewise.
7189 (Object::is_incremental): New function.
7190 (Object::get_mtime): New function.
7191 (Object::for_all_local_got_entries): New function.
7192 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7193 (Object::set_is_in_system_directory): New function.
7194 (Object::is_in_system_directory): New function.
7195 (Object::do_is_incremental): New function.
7196 (Object::do_get_mtime): New function.
7197 (Object::do_for_all_local_got_entries): New function.
7198 (Object::is_in_system_directory_): New data member.
7199 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7200 (class Sized_relobj_base): New class.
7201 (class Sized_relobj): Derive from Sized_relobj_base.
7202 (class Sized_relobj::Symbols): Redeclare from base class.
7203 (class Sized_relobj::local_got_offset_list): Remove.
7204 (class Sized_relobj::Output_sections): Redeclare from base class.
7205 (class Sized_relobj::do_for_all_local_got_entries): New function.
7206 (class Sized_relobj::write_local_symbols): Add offset parameter.
7207 (class Sized_relobj::local_symbol_offset_): Update comment.
7208 (class Sized_relobj::local_dynsym_offset_): Update comment.
7209 * options.cc (Input_arguments::add_file): Remove const.
7210 * options.h (Input_file_argument::Input_file_argument):
7211 Initialize arg_serial_ (all constructors).
7212 (Input_file_argument::set_arg_serial): New function.
7213 (Input_file_argument::arg_serial): New function.
7214 (Input_file_argument::arg_serial_): New data member.
7215 (Input_arguments::Input_arguments): Initialize file_count_.
7216 (Input_arguments::add_file): Remove const.
7217 (Input_arguments::number_of_input_files): New function.
7218 (Input_arguments::file_count_): New data member.
7219 (Command_line::number_of_input_files): Call
7220 Input_arguments::number_of_input_files.
7221 * output.cc (Output_segment_headers::Output_segment_headers):
7222 Set current size.
7223 (Output_section::Input_section::current_data_size): New function.
7224 (Output_section::Output_section): Initialize new data members.
7225 (Output_section::add_input_section): Don't do merge sections for
7226 an incremental link; allocate space from free list for an
7227 incremental update.
7228 (Output_section::add_output_section_data): Allocate space from
7229 free list for an incremental update.
7230 (Output_section::update_data_size): New function.
7231 (Output_section::set_fixed_layout): New function.
7232 (Output_section::reserve): New function.
7233 (Output_segment::set_section_addresses): Remove const.
7234 (Output_segment::set_section_list_addresses): Remove const; allocate
7235 space from free list for an incremental update.
7236 (Output_segment::set_offset): Adjust size of RELRO segment for an
7237 incremental update.
7238 * output.h (Output_data::current_data_size): Move here from
7239 child classes.
7240 (Output_data::pre_finalize_data_size): New function.
7241 (Output_data::update_data_size): New function.
7242 (Output_section_headers::update_data_size): new function.
7243 (Output_section_data_build::current_data_size): Move to Output_data.
7244 (Output_data_strtab::update_data_size): New function.
7245 (Output_section::current_data_size): Move to Output_data.
7246 (Output_section::set_fixed_layout): New function.
7247 (Output_section::has_fixed_layout): New function.
7248 (Output_section::reserve): New function.
7249 (Output_section::update_data_size): New function.
7250 (Output_section::has_fixed_layout_): New data member.
7251 (Output_section::free_list_): New data member.
7252 (Output_segment::set_section_addresses): Remove const.
7253 (Output_segment::set_section_list_addresses): Remove const.
7254 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7255 New function.
7256 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7257 New function.
7258 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7259 parameter when calling Add_symbols constructor; store argument
7260 serial number for members of a lib group.
7261 (Add_symbols::locks): Allow case where token == NULL.
7262 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7263 (Read_member::~Read_member): New function.
7264 (Read_member::is_runnable): New function.
7265 (Read_member::locks): New function.
7266 (Read_member::run): New function.
7267 (Check_script::~Check_script): New function.
7268 (Check_script::is_runnable): New function.
7269 (Check_script::locks): New function.
7270 (Check_script::run): New function.
7271 (Check_library::~Check_library): New function.
7272 (Check_library::is_runnable): New function.
7273 (Check_library::locks): New function.
7274 (Check_library::run): New function.
7275 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7276 (Add_symbols::library_): New data member.
7277 (class Read_member): New class.
7278 (class Check_script): New class.
7279 (class Check_library): New class.
7280 * reloc.cc (Read_relocs::is_runnable): Allow case where
7281 token == NULL.
7282 (Read_relocs::locks): Likewise.
7283 (Scan_relocs::locks): Likewise.
7284 (Relocate_task::locks): Likewise.
7285 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7286 to clear counters.
7287 (Sized_relobj::incremental_relocs_scan): Fix comment.
7288 (Sized_relobj::do_relocate): Pass output file offset to
7289 write_local_symbols.
7290 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7291 from class declaration.
7292 * script.cc (read_input_script): Allocate Script_info; pass
7293 argument serial number to report_script.
7294 * script.h (class Script_info): Move to incremental.h.
7295 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7296 * symtab.h (Symbol_table::add_from_incrobj): New function.
7297 (Symbol_table::set_file_offset): New function.
7298
b961d0d7
CC
72992011-04-05 Cary Coutant <ccoutant@google.com>
7300
7301 * incremental-dump.cc (dump_incremental_inputs): Change signature
7302 to take a Sized_incremental_binary; change caller. Use readers
7303 in Sized_incremental_binary.
7304 * incremental.cc
7305 (Sized_incremental_binary::find_incremental_inputs_sections):
7306 Rename do_find_incremental_inputs_sections to this.
7307 (Sized_incremental_binary::setup_readers): New function.
7308 (Sized_incremental_binary::do_check_inputs): Check
7309 has_incremental_info_ flag; move setup code to setup_readers;
7310 use input readers.
7311 (Sized_incremental_binary::do_file_is_unchanged): New function.
7312 (Sized_incremental_binary::do_get_input_reader): New function.
7313 * incremental.h (class Incremental_binary): Move to end of file.
7314 (Incremental_binary::file_is_unchanged): New function.
7315 (Incremental_binary::do_file_is_unchanged): New function.
7316 (Incremental_binary::Input_reader): New class.
7317 (Incremental_binary::get_input_reader): New function.
7318 (class Sized_incremental_binary): Move to end of file.
7319 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7320 input section reader classes.
7321 (Sized_incremental_binary::has_incremental_info): New function.
7322 (Sized_incremental_binary::inputs_reader): New function.
7323 (Sized_incremental_binary::symtab_reader): New function.
7324 (Sized_incremental_binary::relocs_reader): New function.
7325 (Sized_incremental_binary::got_plt_reader): New function.
7326 (Sized_incremental_binary::do_file_is_unchanged): New function.
7327 (Sized_incremental_binary::Sized_input_reader): New class.
7328 (Sized_incremental_binary::get_input_reader): New function.
7329 (Sized_incremental_binary::find_incremental_inputs_sections):
7330 Rename do_find_incremental_inputs_sections to this.
7331 (Sized_incremental_binary::setup_readers): New function.
7332 (Sized_incremental_binary::has_incremental_info_): New data member.
7333 (Sized_incremental_binary::inputs_reader_): New data member.
7334 (Sized_incremental_binary::symtab_reader_): New data member.
7335 (Sized_incremental_binary::relocs_reader_): New data member.
7336 (Sized_incremental_binary::got_plt_reader_): New data member.
7337 (Sized_incremental_binary::current_input_file_): New data member.
7338
a869183f
PP
73392011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7340
7341 PR gold/12640
7342 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7343 violation.
7344
73452011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7346
7347 * archive.cc (Archive::include_member): Adjust call to report_object.
7348 (Add_archive_symbols::run): Add script_info to call to
7349 report_archive_begin.
7350 (Lib_group::include_member): Adjust call to report_object.
7351 (Add_lib_group_symbols::run): Adjust call to report_object.
7352 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7353 blocks. Add object count for script input files.
7354 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7355 script_info parameter; change all callers.
7356 (Incremental_inputs::report_object): Add script_info parameter;
7357 change all callers.
7358 (Incremental_inputs::report_script): Store backpointer to
7359 incremental info entry.
7360 (Output_section_incremental_inputs::set_final_data_size): Record
7361 additional information for scripts.
7362 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7363 * incremental.h (Incremental_script_entry::add_object): New function.
7364 (Incremental_script_entry::get_object_count): New function.
7365 (Incremental_script_entry::get_object): New function.
7366 (Incremental_script_entry::objects_): New data member; adjust
7367 constructor.
7368 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7369 (Incremental_inputs::report_object): Add script_info parameter.
7370 (Incremental_inputs_reader::get_object_count): New function.
7371 (Incremental_inputs_reader::get_object_offset): New function.
7372 * options.cc (Input_arguments::add_file): Return reference to
7373 new input argument.
7374 * options.h (Input_argument::set_script_info): New function.
7375 (Input_argument::script_info): New function.
7376 (Input_argument::script_info_): New data member; adjust all
7377 constructors.
7378 (Input_file_group::add_file): Return reference to new input argument.
7379 (Input_file_lib::add_file): Likewise.
7380 (Input_arguments::add_file): Likewise.
7381 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7382 * script.cc (Parser_closure::Parser_closure): Add script_info
7383 parameter; adjust all callers.
7384 (Parser_closure::script_info): New function.
7385 (Parser_closure::script_info_): New data member.
7386 (read_input_script): Report scripts earlier to incremental info.
7387 (script_add_file): Set script_info in Input_argument.
7388 (script_add_library): Likewise.
7389 * script.h (Script_options::Script_info): Rewrite class.
7390
a869183f 73912011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7392
7393 * archive.cc (Library_base::should_include_member): Move
7394 method here from class Archive.
7395 (Archive::Archive): Initialize base class.
7396 (Archive::should_include_member): Move to base class.
7397 (Archive::do_for_all_unused_symbols): New function.
7398 (Add_archive_symbols::run): Remove redundant access to
7399 incremental_inputs.
7400 (Lib_group::Lib_group): Initialize base class.
7401 (Lib_group::do_filename): New function.
7402 (Lib_group::include_member): Pass pointer to Lib_group to
7403 report_object.
7404 (Lib_group::do_for_all_unused_symbols): New function.
7405 (Add_lib_group_symbols::run): Report archive information for
7406 incremental links.
7407 * archive.h (class Library_base): New base class.
7408 (class Archive): Derive from Library_base.
7409 (Archive::filename): Move to base class.
7410 (Archive::set_incremental_info): Likewise.
7411 (Archive::incremental_info): Likewise.
7412 (Archive::Should_include): Likewise.
7413 (Archive::should_include_member): Likewise.
7414 (Archive::Armap_entry): Remove.
7415 (Archive::Unused_symbol_iterator): Remove.
7416 (Archive::unused_symbols_begin): Remove.
7417 (Archive::unused_symbols_end): Remove.
7418 (Archive::do_filename): New function.
7419 (Archive::do_get_mtime): New function.
7420 (Archive::do_for_all_unused_symbols): New function.
7421 (Archive::task_): Move to base class.
7422 (Archive::incremental_info_): Likewise.
7423 (class Lib_group): Derive from Library_base.
7424 (Lib_group::do_filename): New function.
7425 (Lib_group::do_get_mtime): New function.
7426 (Lib_group::do_for_all_unused_symbols): New function.
7427 (Lib_group::task_): Move to base class.
7428 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7429 function.
7430 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7431 function.
7432 * incremental.cc (Incremental_inputs::report_archive_begin):
7433 Use Library_base; call library's get_mtime; add incremental inputs
7434 entry before members.
7435 (class Unused_symbol_visitor): New class.
7436 (Incremental_inputs::report_archive_end): Use Library_base; use
7437 visitor class to record unused symbols; don't add incremental inputs
7438 entry after members.
7439 (Incremental_inputs::report_object): Use Library_base.
7440 * incremental.h
7441 (Incremental_archive_entry::Incremental_archive_entry): Remove
7442 unused Archive parameter.
7443 (Incremental_inputs::report_archive_begin): Use Library_base.
7444 (Incremental_inputs::report_archive_end): Likewise.
7445 (Incremental_inputs::report_object): Likewise.
7446 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7447 function.
7448 * object.h (Object::for_all_global_symbols): New function.
7449 (Object::do_for_all_global_symbols): New function.
7450 (Sized_relobj::do_for_all_global_symbols): New function.
7451 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7452 function.
7453 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7454 function.
7455
61ab3e40
ILT
74562011-03-27 Ian Lance Taylor <iant@google.com>
7457
7458 * archive.cc (Archive::interpret_header): Return -1 if something
7459 goes wrong. Change callers accordingly.
7460
30e1f9e6
CC
74612011-03-25 Cary Coutant <ccoutant@google.com>
7462
7463 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7464 * testsuite/Makefile.in: Regenerate.
7465
9370ce59 74662011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7467
7468 * plugin.cc (get_view): New.
7469 (Plugin::load): Pass get_view to the plugin.
7470 (Plugin_manager::get_view): New.
7471
9312bb0a
ILT
74722011-03-21 Ian Lance Taylor <iant@google.com>
7473
7474 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7475 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7476
7e12ba9e
ST
74772011-03-21 Sriraman Tallam <tmsriram@google.com>
7478
7479 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7480 Change == to -eq.
7481 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7482 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7483 Change == to -eq.
7484 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7485 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7486
fd7a005d
ILT
74872011-03-14 Ian Lance Taylor <iant@google.com>
7488
7489 * script-sections.cc (Sort_output_sections::script_compare):
7490 Rename from is_before, change return type.
7491 (Sort_output_sections::operator()): Adjust accordingly.
7492
ed16fd1b
ILT
74932011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7494
7495 PR gold/12572
7496 * testsuite/odr_violation2.cc: Add comment to make all error line
7497 numbers double digits.
7498 * testsuite/debug_msg.sh: Adjust expected errors.
7499
71ff8986
ILT
75002011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7501
7502 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7503 but mark earlier ones as non-canonical
7504 (offset_to_iterator): Update search target and example
7505 (do_addr2line): Return extra lines in a vector*
7506 (format_file_lineno): Extract from do_addr2line
7507 (one_addr2line): Add vector* out-param
7508 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7509 when a lineno entry appeared last for its instruction
7510 (Dwarf_line_info): Add vector* out-param
7511 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7512 * symtab.cc (Odr_violation_compare): Include the lineno in the
7513 comparison again.
7514 (linenos_from_loc): New. Combine the canonical line for an
7515 address with its other lines.
7516 (True_if_intersect): New. Helper functor to make
7517 std::set_intersection a query.
7518 (detect_odr_violations): Compare sets of lines instead of just
7519 one line for each function. This became less deterministic, but
7520 has fewer false positives.
7521 * symtab.h: Declarations.
7522 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7523 mix an optimized and non-optimized object in the same binary
7524 (odr_violation2.so): Same.
7525 * testsuite/Makefile.in: Regenerate from Makefile.am.
7526 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7527 * testsuite/debug_msg.sh: Update line numbers and add
7528 assertions.
7529 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7530 non-optimized context.
7531 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7532 isn't inlined, and use OdrDerived in an optimized context.
7533 * testsuite/odr_header1.h: Defines OdrDerived, where
7534 optimization will change the
7535 first-instruction-in-the-destructor's file and line number.
7536 * testsuite/odr_header2.h: Defines OdrBase.
7537
a19fefdc
ILT
75382011-03-09 Ian Lance Taylor <iant@google.com>
7539
7540 * fileread.cc (File_read::clear_views): Don't delete the whole
7541 file view.
7542
ecb351e9
ILT
75432011-03-08 Ian Lance Taylor <iant@google.com>
7544
7545 PR gold/12525
7546 * fileread.cc: #include <climits>.
7547 (GOLD_IOV_MAX): Define.
7548 (File_read::read_multiple): Limit number of entries by iov_max.
7549 * fileread.h (class File_read): Always set max_readv_entries to
7550 128.
7551
b821d13c
ILT
75522011-03-07 Ian Lance Taylor <iant@google.com>
7553
7554 PR gold/12525
7555 * options.h (class General_options): Add -dy and -dn.
7556
89243142
CC
75572011-03-02 Cary Coutant <ccoutant@google.com>
7558
7559 * testsuite/script_test_9.t: Add TLS segment.
7560
d0773f31
ILT
75612011-03-02 Simon Baldwin <simonb@google.com>
7562
7563 * configure.ac: Add check for gnu_indirect_function support in
7564 the toolchain building binutils.
7565 * configure: Rebuild.
7566
9370ce59 75672011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7568
7569 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7570 plugin only symbols.
7571 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7572 in plugin files as not needed in the symbol table.
7573
4cf7a849
ST
75742011-02-11 Sriraman Tallam <tmsriram@google.com>
7575
7576 * output.cc (Output_section::add_input_section): Delay fill
7577 generation for section ordering.
7578
b578bd7d
ILT
75792011-02-09 Ian Lance Taylor <iant@google.com>
7580
7581 PR gold/12316
7582 * object.h (class Sized_relobj): Remove clear_local_symbols.
7583 * reloc.cc (Sized_relobj::do_relocate): Don't call
7584 clear_local_symbols.
7585
9370ce59 75862011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7587
7588 * plugin.cc (is_visible_from_outside): Return true for symbols
7589 in the -u option.
7590
55382fb7
ILT
75912011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7592
7593 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7594 filename.
7595
4e271fff
ST
75962011-02-02 Sriraman Tallam <tmsriram@google.com>
7597
7598 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7599 to std::string.
4e271fff 7600 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7601 section_name to be std::string.
4e271fff
ST
7602 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7603
d433c3ac
ILT
76042011-01-25 Ian Lance Taylor <iant@google.com>
7605
7606 * script.cc (script_add_extern): Rewrite to use
7607 add_symbol_reference.
7608
880473a6
DK
76092011-01-25 Doug Kwan <dougkwan@google.com>
7610
d433c3ac 7611 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7612
f30f86fa
ILT
76132011-01-24 Ian Lance Taylor <iant@google.com>
7614
7615 * options.h (class General_options): Accept
7616 --no-detect-odr-violations.
7617
8e51a0b9
ILT
76182011-01-24 Ian Lance Taylor <iant@google.com>
7619
7620 * version.cc (version_string): Bump to 1.11.
7621
0f3b89d8
ILT
76222011-01-24 Ian Lance Taylor <iant@google.com>
7623
7624 * plugin.cc (class Plugin_rescan): Define new class.
7625 (Plugin_manager::claim_file): Set any_claimed_.
7626 (Plugin_manager::save_archive): New function.
7627 (Plugin_manager::save_input_group): New function.
7628 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7629 necessary.
7630 (Plugin_manager::new_undefined_symbol): New function.
7631 (Plugin_manager::rescan): New function.
7632 (Plugin_manager::rescannable_defines): New function.
7633 (Plugin_manager::add_input_file): Set any_added_.
7634 * plugin.h (class Plugin_manager): define new fields rescannable_,
7635 undefined_symbols_, any_claimed_, and any_added_. Declare
7636 Plugin_rescan as friend. Declare new functions.
7637 (Plugin_manager::Rescannable): Define type.
7638 (Plugin_manager::Rescannable_list): Define type.
7639 (Plugin_manager::Undefined_symbol_list): Define type.
7640 (Plugin_manager::Plugin_manager): Initialize new fields.
7641 * archive.cc (Archive::defines_symbol): New function.
7642 (Add_archive_symbols::run): Pass archive to plugins if any.
7643 * archive.h (class Archive): Declare defines_symbol.
7644 * readsyms.cc (Input_group::~Input_group): New function.
7645 (Finish_group::run): Pass input_group to plugins if any.
7646 * readsyms.h (class Input_group): Declare destructor.
7647 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7648 any.
7649
3bb951e5
ILT
76502011-01-10 Ian Lance Taylor <iant@google.com>
7651
7652 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7653 section as relro.
7654 (Layout::set_segment_offsets): Reset increase_relro before calling
7655 set_section_addresses a second time.
7656
0aa45fac
CC
76572011-01-04 Cary Coutant <ccoutant@google.com>
7658
7659 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7660 sections before NOBITS sections.
7661
0db46eb4
L
76622011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7663
7664 * version.cc (print_version): Update copyright to 2011.
7665
829c9745
CC
76662010-12-23 Cary Coutant <ccoutant@google.com>
7667
7668 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7669 of OS to this->add. Add OD parameter to second form of the function.
7670
7500420b
ILT
76712010-12-20 Ian Lance Taylor <iant@google.com>
7672
7673 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7674 second of two consecutive entries with same offset.
7675
f8e9a930
RW
76762010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7677
7678 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7679 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7680 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7681 to avoid unneeded links against $(LDADD).
7682 * testsuite/Makefile.in: Regenerate.
7683
2fbb4320
ILT
76842010-12-15 Ian Lance Taylor <iant@google.com>
7685
7686 PR gold/12324
7687 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7688 for R_X86_64_32 and R_X86_64_PC32.
7689 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7690 ver_matching_def_pic.o.
7691 (ver_matching_def_pic.o): New target.
7692
fedb228d
RW
76932010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7694
7695 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7696 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7697 Move definition before File_read::View member definitions.
7698 (File_read::View::~View): Initialize and hold lock before
7699 updating current_mapped_bytes.
7700
9b547ce6
RW
77012010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7702
7703 * dwarf_reader.cc: Remove outdated comment.
7704 * gold-threads.cc: Fix typo in error message.
7705 * archive.cc: Fix typos in comments.
7706 * archive.h: Likewise.
7707 * arm-reloc-property.cc: Likewise.
7708 * arm-reloc-property.h: Likewise.
7709 * arm-reloc.def: Likewise.
7710 * arm.cc: Likewise.
7711 * attributes.h: Likewise.
7712 * cref.cc: Likewise.
7713 * ehframe.cc: Likewise.
7714 * fileread.h: Likewise.
7715 * gold.h: Likewise.
7716 * i386.cc: Likewise.
7717 * icf.cc: Likewise.
7718 * incremental.h: Likewise.
7719 * int_encoding.cc: Likewise.
7720 * layout.h: Likewise.
7721 * main.cc: Likewise.
7722 * merge.h: Likewise.
7723 * object.cc: Likewise.
7724 * object.h: Likewise.
7725 * options.cc: Likewise.
7726 * readsyms.cc: Likewise.
7727 * reduced_debug_output.cc: Likewise.
7728 * reloc.cc: Likewise.
7729 * script-sections.cc: Likewise.
7730 * sparc.cc: Likewise.
7731 * symtab.h: Likewise.
7732 * target-reloc.h: Likewise.
7733 * target.cc: Likewise.
7734 * target.h: Likewise.
7735 * timer.cc: Likewise.
7736 * timer.h: Likewise.
7737 * x86_64.cc: Likewise.
7738
83e17bd5
CC
77392010-12-09 Cary Coutant <ccoutant@google.com>
7740
7741 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7742 stack.
7743 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7744 parameter; change all callers.
7745 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7746 * options.h (warn_execstack): New option.
7747
017257f8
DK
77482010-12-07 Doug Kwan <dougkwan@google.com>
7749
7750 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7751 like function call relocations.
7752
c20cbc06
ILT
77532010-12-07 Ian Lance Taylor <iant@google.com>
7754
7755 * archive.cc (Archive::get_elf_object_for_member): Permit
7756 punconfigured to be NULL.
7757 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7758 (Archive::include_member): Pass NULL to get_elf_object_for_member
7759 if we searched for the archive and this is the first included
7760 object.
7761
4dbfafcc
ILT
77622010-12-01 Ian Lance Taylor <iant@google.com>
7763
7764 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7765 track_relocs_type_ field.
7766 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7767 Set track_relocs_type_.
7768 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7769 contents when using RELA relocs.
7770 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7771 reloc_map_.
7772 * reloc.cc (Track_relocs::next_addend): New function.
7773 * reloc.h (class Track_relocs): Declare next_addend.
7774
e5e19edd
ILT
77752010-12-01 Ian Lance Taylor <iant@google.com>
7776
7777 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7778 virtual destructor.
7779
9a5ce24c
ILT
77802010-12-01 Ian Lance Taylor <iant@google.com>
7781
7782 * README: Update compilers known to work and fail.
7783
c7791212
NC
77842010-11-23 Matthias Klose <doko@ubuntu.com>
7785
7786 * configure.in: For --enable-gold, handle value `default' instead of
7787 `both*'. Always install ld as ld.bfd, install as ld if gold is
7788 not the default.
7789 * configure: Regenerate.
7790
0ad220c9
DK
77912010-11-18 Doug Kwan <dougkwan@google.com>
7792
7793 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7794 and right_alignment to be zero. Store result alignment only if it is
7795 greater than existing alignment.
7796
ab8056e0
CC
77972010-11-16 Cary Coutant <ccoutant@google.com>
7798
7799 PR gold/12220
7800 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7801 Check for ".zdebug_line".
7802
fd064a5b
CC
78032010-11-16 Doug Kwan <dougkwan@google.com>
7804 Cary Coutant <ccoutant@google.com>
7805
7806 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7807 by reference; adjust all callers.
7808 * output.cc (Output_segment::set_section_addresses): Adjust references
7809 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7810 list is empty.
7811 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7812 end at page boundary.
7813
6fc6ea19
CC
78142010-11-16 Cary Coutant <ccoutant@google.com>
7815
7816 PR gold/12220
7817 * layout.cc (Layout::choose_output_section): Transform names of
7818 compressed sections even when using a script with a SECTIONS clause.
7819 (Layout::output_section_name): Remove code to transform
7820 compressed debug section names.
7821 * output.cc (Output_section::add_input_section): Use uncompressed
7822 section size when tracking input sections.
7823
95a2c8d6
RS
78242010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7825
7826 * symtab.h (Symbol::NON_PIC_REF): Remove.
7827 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7828 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7829 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7830 (Symbol::use_plt_offset): Take a flags argument and pass it
7831 directly to needs_dynamic_reloc. Restrict check for undefined
7832 weak symbols to function calls.
7833 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7834 (Target_arm::Scan::global): Use it.
7835 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7836 (Target_arm::Relocate::relocate): Likewise.
7837 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7838 parameter with an r_type parameter. Use get_reference_flags
7839 to get the flags.
7840 (Target_arm::Relocate::relocate): Update accordingly.
7841 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7842 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7843 (Target_i386::Scan::global): Likewise.
7844 (Target_i386::Relocate::relocate): Likewise.
7845 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7846 parameter with an r_type parameter. Use get_reference_flags
7847 to get the flags.
7848 (Target_i386::Relocate::relocate): Update accordingly.
7849 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7850 (Target_powerpc::Scan::global): Use it.
7851 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7852 (Target_powerpc::Relocate::relocate): Likewise.
7853 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7854 (Target_sparc::Scan::global): Use it.
7855 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7856 (Target_sparc::Relocate::relocate): Likewise.
7857 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7858 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7859 (Target_x86_64::Scan::global): Likewise.
7860 (Target_x86_64::Relocate::relocate): Likewise.
7861
f625ae50
DK
78622010-11-08 Doug Kwan <dougkwan@google.com>
7863 Cary Coutant <ccoutant@google.com>
7864
7865 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7866 (Arm_exidx_merge_section::section_contents_): New data member.
7867 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7868 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7869 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7870 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7871 in parameters instead of calling Object::section_contents without
7872 locking.
7873 (Arm_output_section::group_section): New parameter TASK. Pass it
7874 to callees that need locking objects.
7875 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7876 to lock EXIDX input sections. Fix a formatting issue. Call
7877 Arm_exidx_merged_section::build_contents to create merged section
7878 contents.
7879 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7880 to lock object of stub table owner.
7881 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7882 TEXT_SIZE to initialize data member TEXT_SIZE_.
7883 (Arm_exidx_input_section::addralign): Fix typo in comment.
7884 (Arm_exidx_input_section::text_size): New method.
7885 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7886 that require locking objects. Lock objects before scanning for stubs
7887 and updating local symbols.
7888 (Arm_input_section<big_endian>::init): Copy contents of original
7889 input section.
2e702c99 7890 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7891 original input section instead of calling Object::section_contents
7892 without locking.
7893 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7894 size without calling Object::section_size().
7895 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7896 for size. Allocate a buffer for merged EXIDX entries.
7897 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7898 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7899 building code to Arm_exidx_merged_section::build_contetns. Write
7900 out contetns in buffer instead of building it on the fly.
7901 (Arm_relobj::make_exidx_input_section): Also pass text section size
7902 to Arm_exidx_input_section constructor.
7903 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7904 (Arm_dynobj::do_read_symbols): Fix memory leak.
7905 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7906 * target.h: (class Task): Add forward declaration.
7907 (Target::relax): Add new parameter TASK and pass it to
7908 Target::do_relax().
7909 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7910
5f9bcf58
CC
79112010-11-05 Cary Coutant <ccoutant@google.com>
7912
7913 PR gold/10708
7914 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7915 object when reading from the file.
7916 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7917 second layout pass.
7918 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7919 when reading section contents.
7920 (get_section_contents): Likewise.
7921 (icf::find_identical_sections): Likewise.
7922 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7923 object when reading from the file.
7924 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7925 the object when doing deferred section layout.
7926
e597fa08
NC
79272010-11-03 Nick Clifton <nickc@redhat.com>
7928
7929 PR gold/12001
7930 * script.h (class Symbol_assignment: name): New member. Returns
7931 the name of the symbol.
7932 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7933 Returns true if the given symbol name is on the list of
7934 assignments wating to be processed.
7935 * archive.cc (should_incldue_member): If the symbol is undefined,
7936 check to see if it is on the list of symbols pending assignment.
7937
3f9a3278
ILT
79382010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7939
7940 * script-sections.cc (Script_sections::find_memory_region): Check
7941 for a NULL output section pointer.
7942
d06fb4d1
DK
79432010-10-29 Doug Kwan <dougkwan@google.com>
7944
7945 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7946 Output_section::add_relaxed_input_section.
7947 * output.cc (Output_section::add_relaxed_input_section): Add new
7948 arguments LAYOUT and NAME. Set section order index.
7949 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7950 Copy section order index.
7951 * output.h (Output_section::add_relaxed_input_section): Add new
7952 arguments LAYOUT and NAME.
7953
90e24de5
ILT
79542010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7955
7956 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7957 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7958 * testsuite/Makefile.in: Regenerate.
7959
c9484ea5
DK
79602010-10-20 Doug Kwan <dougkwan@google.com>
7961
7962 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7963 without SHF_LINK_ORDER flags.
7964 * layout.cc (Layout::choose_output_section): Do not filter
7965 SHF_LINK_ORDER flag in a relocatable link.
7966
5bc2f5be
CC
79672010-10-17 Cary Coutant <ccoutant@google.com>
7968
7969 * output.h (Output_segment::set_section_addresses): Change function
7970 signature. Update all callers.
7971 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7972 sections.
7973 (Output_segment::set_section_addresses): Align after last TLS
7974 section. Add padding before last relro section instead of after.
7975
0c91cf04
DK
79762010-10-17 Doug Kwan <dougkwan@google.com>
7977
7978 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7979 GOT output section to be writable.
7980
8c21d9d3
CC
79812010-10-14 Cary Coutant <ccoutant@google.com>
7982
7983 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7984 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7985 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7986 mode.
7987 * incremental.cc (report_command_line): Ignore all forms of
7988 --incremental.
7989 * layout.cc (Layout::Layout): Check parameters for incremental link
7990 mode.
7991 * options.cc (General_options::parse_incremental): New function.
7992 (General_options::parse_no_incremental): New function.
7993 (General_options::parse_incremental_full): New function.
7994 (General_options::parse_incremental_update): New function.
7995 (General_options::incremental_mode_): New data member.
7996 (General_options::finalize): Check incremental_mode_.
7997 * options.h (General_options): Update help text for --incremental.
7998 Add --no-incremental, --incremental-full, --incremental-update.
7999 (General_options::Incremental_mode): New enum type.
8000 (General_options::incremental_mode): New function.
8001 (General_options::incremental_mode_): New data member.
8002 * parameters.cc (Parameters::incremental_mode_): New data member.
8003 (Parameters::set_options): Set incremental_mode_.
8004 (Parameters::set_incremental_full): New function.
8005 (Parameters::incremental): New function.
8006 (Parameters::incremental_update): New function.
8007 (set_parameters_incremental_full): New function.
8008 * parameters.h (Parameters::set_incremental_full): New function.
8009 (Parameters::incremental): New function.
8010 (Parameters::incremental_update): New function.
8011 (Parameters::incremental_mode_): New data member.
8012 (set_parameters_incremental_full): New function.
8013 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8014 incremental link mode.
8015 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8016 (Sized_relobj::do_relocate_sections): Likewise.
8017 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8018 option.
8019 * testsuite/Makefile.in: Regenerate.
8020 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8021
bb32aa18 80222010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8023
8024 * script-sections.h (class Script_sections): Make
8025 Sections_elements typedef public.
8026 * script-sections.cc (class Sort_output_sections): Add elements_
8027 field. Add constructor which sets it; change all callers.
8028 (Sort_output_sections::is_before): New function.
8029 (Sort_output_sections::operator()): Call is_before.
8030 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8031 conditional.
8032 * testsuite/script_test_10.sh: New test. Test script section
8033 order.
8034 * testsuite/script_test_10.t: Likewise.
8035 * testsuite/script_test_10.s: Likewise.
8036 * testsuite/Makefile.am: Wrap the cross linker tests and the
8037 common tests into NATIVE_OR_CROSS_LINKER.
8038 (check_SCRIPTS): Add script_test_10.sh.
8039 (check_DATA): Add script_test_10.stdout.
8040 (script_test_10.o, script_test_10): New targets.
8041 (script_test_10.stdout): New target.
8042 * configure, testsuite/Makefile.in: Regenerate.
8043
3cef7179
ILT
80442010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8045
8046 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8047 error for the deprecated relocations.
8048 (Target_arm::Scan::global): Likewise.
8049 (Target_arm::Relocate::relocate): Likewise.
8050
7411e9a8
RS
80512010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8052
8053 * fileread.cc (Input_file::find_file): Initialize *found_name
8054 and *namep when using the fallback search for case 4.
8055
6a9da32a
CC
80562010-10-11 Cary Coutant <ccoutant@google.com>
8057
8058 * options.h (class General_options): Redefine -z lazy as an alias for
8059 the negation of -z now.
8060
ac897c20
ILT
80612010-10-11 Ian Lance Taylor <iant@google.com>
8062
8063 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8064 binding.
8065
ea5cae92
NC
80662010-10-06 Nick Clifton <nickc@redhat.com>
8067
8068 * script-sections.cc(class Memory_region): Remove
8069 current_lma_offset_ field. Rename current_vma_offset_ to
8070 current_offset_. Add last_section_ field.
8071 (Memory_region::get_current_vma_address): Rename to
8072 get_current_address.
8073 (Memory_region::get_current_lma_address): Delete.
8074 (Memory_region::increment_vma_offset): Rename to
8075 increment_offset.
8076 (Memory_region::increment_lma_offset): Delete.
8077 (Memory_region::attributes_compatible): New method. Returns
8078 true if the provided section is compatible with the region.
8079 (Memory_region::get_last_section): New method. Returns the last
8080 section to use the region.
8081 (Memory_region::set_last_section): New method. Stores the last
8082 section to use the region.
8083 (Script_sections::block_in_region): New method. Returns true if
8084 a block of memory is contained within a region.
8085 (Script_sections::find_memory_region): New method. Locates a
8086 memory region to be used to set a VMA or LMA address.
8087 (Output_section_definition::set_section_addresses): Add code to
8088 check for addresses set by memory regions.
8089 (Output_segment::set_section_addresses): Remove memory region
8090 walking code.
8091 (Script_sections::create_segment): Add a warning if a header
8092 segment is created outside of any region.
8093 * script-sections.h (class Script_sections): Add prototypes for
8094 find_memory_region and block_in_region methods.
8095 * testsuite/memory_test.s: Use .long instead of .word.
8096 * testsuite/memory_test.t: Add some more output sections.
8097 * testsuite/memory_test.sh: Update expected output.
8098
a9bfd952
DK
80992010-10-02 Doug Kwan <dougkwan@google.com>
8100
8101 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8102 defintion to symtab.h
8103 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8104 declaration to defintion.
8105
bacff3ab
NC
81062010-10-01 Nick Clifton <nickc@redhat.com>
8107
8108 * expression.cc (eval): Replace dummy argument with NULL.
8109 (eval_maybe_dot): Check for a NULL result section pointer.
8110 (Symbol_expression::value): Likewise.
8111 (Dot_expression::value): Likewise.
8112 (BINARY_EXPRESSION): Likewise.
8113 (Max_expression::value): Likewise.
8114 (Min_expression::value): Likewise.
8115 (Absolute_expression::value): Likewise.
8116 (Addr_expression::value_from_output_section): Likewise.
8117 (Loaddddr_expression::value_from_output_section): Likewise.
8118 (Segment_start_expression::value): Likewise.
8119 * script-sections.cc
8120 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8121 argument with NULL.
8122 (Sections_elememt_dot_assignment::set_section_addresses):
8123 Likewise.
8124 (Output_data_expression::do_write_to_buffer): Likewise.
8125 (Output_section_definition::finalize_symbols): Likewise.
8126 (Output_section_definition::set_section_addresses): Likewise.
8127
f81bc8b5
DK
81282010-09-30 Doug Kwan <dougkwan@google.com>
8129
8130 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8131
c95e9f27
ST
81322010-09-28 Sriraman Tallam <tmsriram@google.com>
8133
8134 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8135 function.
c95e9f27
ST
8136 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8137 virtual function.
8138 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8139 virtual function.
8140 * icf.cc (get_section_contents): Inline merge sections only when
8141 target allows it.
8142
3cac54d2
RW
81432010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8144
8145 * configure: Regenerate.
8146
2904037a
ILT
81472010-09-17 Ian Lance Taylor <iant@google.com>
8148
8149 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8150 * testsuite/Makefile.am (memory_test.o): New target.
8151 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8152 memory_test.t.
8153 * testsuite/Makefile.in: Rebuild.
2904037a 8154
bca7fb63
DK
81552010-09-17 Doug Kwan <dougkwan@google.com>
8156
8157 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8158 defintion if relocation uses GOT entries of the symbol.
8159 * testsuite/icf_safe_test.sh: Fix test.
8160 * testsuite/icf_safe_so_test.sh: Fix test.
8161
4ef28648
CC
81622010-09-16 Cary Coutant <ccoutant@google.com>
8163
8164 * script_sections.cc (class Memory_region): Remove "NULL" from
8165 vector initializations.
8166
793990de
CC
81672010-09-15 Cary Coutant <ccoutant@google.com>
8168
8169 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8170 Resolve forwarding symbols.
8171
81e015e2
DK
81722010-09-15 Doug Kwan <dougkwan@google.com>
8173
8174 * gold/testsuite/script_test_3.t: Add ARM special sections.
8175 * gold/testsuite/script_test_4.t: Same.
8176 * gold/testsuite/script_test_5.t: Same.
8177 * gold/testsuite/script_test_6.t: Same.
8178 * gold/testsuite/script_test_7.t: Same.
8179 * gold/testsuite/script_test_7.t: Same.
8180 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8181
36171d64
CC
81822010-09-14 Cary Coutant <ccoutant@google.com>
8183
8184 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8185 (Target_x86_64::Relocate::relocate_tls): Replace check for
8186 saw_tls_block_reloc_ with test for executable section.
8187
d89051bd
CC
81882010-09-12 Cary Coutant <ccoutant@google.com>
8189
8190 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8191 position-independent executables to shared libraries need dynamic
8192 relocations.
8193 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8194 position-independent executables.
8195 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8196 * testsuite/Makefile.in: Regenerate.
8197
fca41f0f
NC
81982010-09-10 Nick Clifton <nickc@redhat.com>
8199
8200 PR gold/11997
8201 * testsuite/memory_test.t: Discard any sections that are not
8202 needed.
8203
6695e4b3
L
82042010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8205
8206 PR gold/11996
8207 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8208 "This::" to work around a bug in gcc 4.2.
8209
8210 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8211
0f72bf6f
RÁE
82122010-09-09 Rafael Espindola <espindola@google.com>
8213
8214 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8215 sections with different PF_X flags in the same segment.
8216 (Layout::find_first_load_seg): Search all segments to find the first
8217 one.
8218 * options.h (rosegment): New.
8219
82202010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8221
05a79166 8222 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8223
aa98ff75
DK
82242010-09-08 Doug Kwan <dougkwan@google.com>
8225
8226 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8227 (Arm_relobj::do_relocate_sections): Add new parameter for output
8228 file to match the parent.
8229 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8230 of local symbols instead of input values. Update code to track
8231 changes in gold::relocate_section.
8232 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8233 (Sized_relobj::compute_final_local_value_internal): New methods.
8234 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8235 body into private version of Sized_relobj::compute_final_local_value.
8236 Call the inline method.
8237 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8238 merged symbol value if there is one.
8239 (Symbol_value::has_output_value): New method defintiion.
8240 (Sized_relobj::Compute_final_local_value_status): New enum type.
8241 (Sized_relobj::compute_final_local_value): New methods.
8242 (Sized_relobj::compute_final_local_value_internal): New methods.
8243 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8244 and arm_cortex_a8.sh.
8245 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8246 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8247 New tests.
8248 * Makefile.in: Regenerate.
8249 * testsuite/arm_bl_out_of_range.s: Update test.
8250 * testsuite/thumb_bl_out_of_range.s: Ditto.
8251 * testsuite/thumb_blx_out_of_range.s: Ditto.
8252 * testsuite/arm_branch_out_of_range.sh: New file.
8253 * testsuite/arm_cortex_a8.sh: Ditto.
8254 * testsuite/arm_cortex_a8_b.s: Ditto.
8255 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8256 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8257 * testsuite/arm_cortex_a8_bl.s: Ditto.
8258 * testsuite/arm_cortex_a8_blx.s: Ditto.
8259 * testsuite/arm_cortex_a8_local.s: Ditto.
8260 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8261 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8262
05a79166
L
82632010-09-08 Rafael Espindola <espindola@google.com>
8264
8265 * Makefile.am (memory_test.stdout): Run readelf with -W.
8266 * Makefile.in: Regenerate.
8267 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8268 64 bit output.
8269
33dbc701
RÁE
82702010-09-08 Rafael Espindola <espindola@google.com>
8271
8272 * script-sections.cc (Script_sections::add_memory_region): Convert
8273 field precision to int.
8274 * script.cc (script_set_section_region, script_set_section_region):
8275 Convert field precision to int.
8276
731ca54a
RÁE
82772010-09-08 Rafael Espindola <espindola@google.com>
8278
8279 * arm.cc (do_finalize_sections): Create the __exidx_start and
8280 __exdix_end symbols even when the section is missing.
8281
7f8cd844
NC
82822010-09-08 Nick Clifton <nickc@redhat.com>
8283
8284 * README: Remove claim that MEMORY is not supported.
8285 * expression.cc (script_exp_function_origin)
8286 (script_exp_function_length): Move from here to ...
8287 * script.cc: ... here.
8288 (script_set_section_region, script_add_memory)
8289 (script_parse_memory_attr, script_include_directive): New
8290 functions.
8291 * script-sections.cc
8292 (class Memory_region): New class.
8293 (class Output_section_definition): Add set_memory_region,
8294 set_section_vma, set_section_lma and get_section_name methods.
8295 (class Script_Sections): Add add_memory_region,
8296 find_memory_region, find_memory_region_origin,
8297 find_memory_region_length and set_memory_region methods.
8298 Have set_section_addresses method walk the list of set memory
8299 regions.
8300 Extend the print methos to display memory regions.
8301 * script-sections.h: Add prototypes for new methods.
8302 Add enum for MEMORY region attributes.
8303 * yyscript.y: Add support for parsing MEMORY regions.
8304 * script-c.h: Add prototypes for new functions.
8305 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8306 * testsuite/Makefile.in: Regenerate.
8307 * testsuite/memory_test.sh: New script.
8308 * testsuite/memory_test.s: New assembler source file.
8309 * testsuite/memory_test.t: New linker script.
8310
a4649286
DK
83112010-08-27 Doug Kwan <dougkwan@google.com>
8312
8313 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8314 reference override an existing dynamic weak reference.
8315 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8316 * testsuite/Makefile.in: Regenerate.
8317 * testsuite/dyn_weak_ref.sh: New file.
8318 * testsuite/dyn_weak_ref_1.c: Ditto.
8319 * testsuite/dyn_weak_ref_2.c: Ditto.
8320
b56648ad
ILT
83212010-08-27 Ian Lance Taylor <iant@google.com>
8322
8323 * incremental.h (class Incremental_input_entry): Add virtual
8324 destructor.
8325
809313cb
ILT
83262010-08-27 Ian Lance Taylor <iant@google.com>
8327
8328 * testsuite/start_lib_test_3.c: Mark t3 as used.
8329
11e32464
NC
83302010-08-27 Nick Clifton <nickc@redhat.com>
8331
8332 * options.cc (version_script): Fix small typo in previous
8333 whitespace tidyup.
8334
ca09d69a
NC
83352010-08-25 Nick Clifton <nickc@redhat.com>
8336
8337 * archive.cc: Formatting fixes: Remove whitespace between
8338 typename and following asterisk. Remove whitespace between
8339 function name and opening parenthesis.
8340 * archive.h: Likewise.
8341 * arm.cc: Likewise.
8342 * attributes.cc: Likewise.
8343 * attributes.h: Likewise.
8344 * common.cc: Likewise.
8345 * copy-relocs.cc: Likewise.
8346 * dirsearch.h: Likewise.
8347 * dynobj.cc: Likewise.
8348 * ehframe.cc: Likewise.
8349 * ehframe.h: Likewise.
8350 * expression.cc: Likewise.
8351 * fileread.cc: Likewise.
8352 * fileread.h: Likewise.
8353 * gc.h: Likewise.
8354 * gold-threads.cc: Likewise.
8355 * gold.cc: Likewise.
8356 * i386.cc: Likewise.
8357 * icf.h: Likewise.
8358 * incremental-dump.cc: Likewise.
8359 * incremental.cc: Likewise.
8360 * layout.cc: Likewise.
8361 * layout.h: Likewise.
8362 * main.cc: Likewise.
8363 * merge.cc: Likewise.
8364 * merge.h: Likewise.
8365 * object.cc: Likewise.
8366 * object.h: Likewise.
8367 * options.cc: Likewise.
8368 * options.h: Likewise.
8369 * output.cc: Likewise.
8370 * output.h: Likewise.
8371 * plugin.cc: Likewise.
8372 * plugin.h: Likewise.
8373 * powerpc.cc: Likewise.
8374 * reloc.cc: Likewise.
8375 * script-c.h: Likewise.
8376 * script-sections.cc: Likewise.
8377 * script.cc: Likewise.
8378 * stringpool.cc: Likewise.
8379 * symtab.cc: Likewise.
8380 * symtab.h: Likewise.
8381 * target.cc: Likewise.
8382 * timer.cc: Likewise.
8383 * timer.h: Likewise.
8384 * version.cc: Likewise.
8385 * x86_64.cc: Likewise.
8386
b8fa8750
NC
83872010-08-24 Nick Clifton <nickc@redhat.com>
8388
8389 PR 11899
8390 * layout.cc (segment_precedes): Sort segments by their physical
8391 addresses, if they have been set.
8392
9919d93b
CC
83932010-08-23 Cary Coutant <ccoutant@google.com>
8394
8395 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8396 symbols data.
8397 (Lib_group::include_member): Unlock object after deleting its
8398 symbols data.
8399 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8400 the bug fixed here.
8401
97b4be1c
CC
84022010-08-19 Neil Vachharajani <nvachhar@google.com>
8403 Cary Coutant <ccoutant@google.com>
8404
8405 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8406 constructor, and set_blocker.
8407 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8408 readsyms_blocker_.
8409 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8410 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8411 * testsuite/Makefile.am (start_lib_test): New test case.
8412 * testsuite/Makefile.in: Regenerate.
8413 * testsuite/start_lib_test_main.c: New file.
8414 * testsuite/start_lib_test_1.c: New file.
8415 * testsuite/start_lib_test_2.c: New file.
8416 * testsuite/start_lib_test_3.c: New file.
8417
dd0b1884
ILT
84182010-08-19 Ian Lance Taylor <iant@google.com>
8419
8420 * Makefile.in: Rebuild with automake 1.11.1.
8421 * aclocal.m4: Likewise.
8422 * testsuite/Makefile.in: Likewise.
8423
7223e9ca
ILT
84242010-08-19 Ian Lance Taylor <iant@google.com>
8425
8426 PR 10893
8427 * i386.cc (class Output_data_plt_i386): Update declarations.
8428 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8429 local_ifuncs_ fields.
8430 (Target_i386::do_plt_section_for_global): New function.
8431 (Target_i386::do_plt_section_for_local): New function.
8432 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8433 parameter; change all callers. Initialize global_ifuncs_ and
8434 local_ifuncs_. If doing a static link define __rel_iplt_start and
8435 __rel_iplt_end.
8436 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8437 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8438 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8439 symbols.
8440 (Target_i386::make_plt_section): New function, broken out of
8441 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8442 (Target_i386::make_plt_entry): Call make_plt_section.
8443 (Target_i386::make_local_ifunc_plt_entry): New function.
8444 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8445 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8446 R_386_IRELATIVE to switch.
8447 (Target_i386::Scan::global): Likewise.
8448 (Target_i386::Relocate::relocate): Likewise.
8449 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8450 switch.
8451 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8452 (Target_x86_64::do_plt_section_for_global): New function.
8453 (Target_x86_64::do_plt_section_for_local): New function.
8454 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8455 parameter; change all callers. If doing a static link define
8456 __rela_iplt_start and __rela_iplt_end.
8457 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8458 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8459 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8460 to point to .plt.
8461 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8462 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8463 switch.
8464 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8465 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8466 R_X86_64_IRELATIVE to switch.
8467 (Target_x86_64::Scan::global): Likewise.
8468 (Target_x86_64::Relocate::relocate): Likewise.
8469 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8470 switch.
8471 * target.h (class Target): Add plt_section_for_global and
8472 plt_section_for_local functions. Add do_plt_section_for_global
8473 and do_plt_section_for_local virtual functions.
8474 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8475 clarifying comments.
8476 (Symbol::use_plt_offset): Handle IFUNC symbol.
8477 * object.cc (Sized_relobj::Sized_relobj): Initialize
8478 local_plt_offsets_.
8479 (Sized_relobj::local_has_plt_offset): New function.
8480 (Sized_relobj::local_plt_offset): New function.
8481 (Sized_relobj::set_local_plt_offset): New function.
8482 (Sized_relobj::do_count): Handle IFUNC symbol.
8483 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8484 a bit away from input_shndx_ field. Add set_is_func_symbol and
8485 is_ifunc_symbol functions.
8486 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8487 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8488 local_plt_offsets_ field.
8489 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8490 * output.h (class Output_section_data): Add non-const
8491 output_section function.
8492 (class Output_data_got): Update declarations.
8493 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8494 Add use_plt_offset parameter to global and local constructors.
8495 Change all callers. Change local_sym_index_ field to 31 bits.
8496 Change GSYM_CODE and CONSTANT_CODE accordingly.
8497 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8498 doing a static link don't set sh_link field.
8499 (Output_data_got::Got_entry::write): Use PLT offset if
8500 appropriate.
8501 (Output_data_got::add_global_plt): New function.
8502 (Output_data_got::add_local_plt): New function.
8503 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8504 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8505 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8506 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8507 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8508 IFUNC conditional.
8509 * testsuite/ifunc-sel.h: New file.
8510 * testsuite/ifuncmain1.c: New file.
8511 * testsuite/ifuncmain1vis.c: New file.
8512 * testsuite/ifuncmod1.c: New file.
8513 * testsuite/ifuncdep2.c: New file.
8514 * testsuite/ifuncmain2.c: New file.
8515 * testsuite/ifuncmain3.c: New file.
8516 * testsuite/ifuncmod3.c: New file.
8517 * testsuite/ifuncmain4.c: New file.
8518 * testsuite/ifuncmain5.c: New file.
8519 * testsuite/ifuncmod5.c: New file.
8520 * testsuite/ifuncmain6pie.c: New file.
8521 * testsuite/ifuncmod6.c: New file.
8522 * testsuite/ifuncmain7.c: New file.
8523 * configure, testsuite/Makefile.in: Rebuild.
8524
56f75c03
ILT
85252010-08-18 Ian Lance Taylor <iant@google.com>
8526
8527 * incremental.cc
8528 (Output_section_incremental_inputs::write_input_files): Add cast
8529 to avoid signed/unsigned comparison warning.
8530 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8531
55455f89
CC
85322010-08-12 Cary Coutant <ccoutant@google.com>
8533
8534 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8535
e2054bcb
ILT
85362010-08-13 Ian Lance Taylor <iant@google.com>
8537
8538 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8539
74f67560
DK
85402010-08-12 Cary Coutant <ccoutant@google.com>
8541 Doug Kwan <dougkwan@google.com>
8542
8543 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8544 defintion overrides non-weak undef, remember that the original undef
8545 is not weak.
8546 * symtab.cc (Symbol_table::sized_write_global): For undef without
8547 an original weak binding, set binding to global in output.
8548 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8549 * testsuite/Makefile.in: Regenerate.
8550 * testsuite/strong_ref_weak_def.sh: New file.
8551 * testsuite/strong_ref_weak_def_1.c: Ditto.
8552 * testsuite/strong_ref_weak_def_2.c: Ditto.
8553
d1238d12
CC
85542010-08-12 Cary Coutant <ccoutant@google.com>
8555
8556 * testsuite/incremental_test.sh: Rewrite.
8557 * testsuite/incremental_test_1.c: Rewrite.
8558 * testsuite/incremental_test_2.c: Rewrite.
8559
0e70b911
CC
85602010-08-12 Cary Coutant <ccoutant@google.com>
8561
8562 * arm.cc (Target_arm::got_size): Add const.
8563 (Target_arm::got_entry_count): New function.
8564 (Target_arm::plt_entry_count): New function.
8565 (Target_arm::first_plt_entry_offset): New function.
8566 (Target_arm::plt_entry_size): New function.
8567 (Output_data_plt_arm::entry_count): New function.
8568 (Output_data_plt_arm::first_plt_entry_offset): New function.
8569 (Output_data_plt_arm::get_plt_entry_size): New function.
8570 * i386.cc (Target_i386::got_size): Add const.
8571 (Target_i386::got_entry_count): New function.
8572 (Target_i386::plt_entry_count): New function.
8573 (Target_i386::first_plt_entry_offset): New function.
8574 (Target_i386::plt_entry_size): New function.
8575 (Output_data_plt_i386::entry_count): New function.
8576 (Output_data_plt_i386::first_plt_entry_offset): New function.
8577 (Output_data_plt_i386::get_plt_entry_size): New function.
8578 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8579 find_incremental_inputs_sections. Dump incremental_got_plt section.
8580 * incremental.cc: Include target.h.
8581 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8582 parameter. Adjust all callers. Find incremental_got_plt section.
8583 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8584 section.
8585 (Output_section_incremental_inputs::set_final_data_size): Calculate
8586 size of incremental_got_plt section.
8587 (Output_section_incremental_inputs::do_write): Write the
8588 incremental_got_plt section.
8589 (Got_plt_view_info): New struct.
8590 (Local_got_offset_visitor): New class.
8591 (Global_got_offset_visitor): New class.
8592 (Global_symbol_visitor_got_plt): New class.
8593 (Output_section_incremental_inputs::write_got_plt): New function.
8594 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8595 Add parameter. Adjust all callers.
8596 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8597 (Incremental_inputs::got_plt_section): New function.
8598 (Incremental_inputs::got_plt_section_): New data member.
8599 (Incremental_got_plt_reader): New class.
8600 * layout.cc (Layout::create_incremental_info_sections): Add the
8601 incremental_got_plt section.
8602 * object.h (Got_offset_list::get_list): New function.
8603 (Got offset_list::for_all_got_offsets): New function.
8604 (Sized_relobj::local_got_offset_list): New function.
8605 * powerpc.cc (Target_powerpc::got_size): Add const.
8606 (Target_powerpc::got_entry_count): New function.
8607 (Target_powerpc::plt_entry_count): New function.
8608 (Target_powerpc::first_plt_entry_offset): New function.
8609 (Target_powerpc::plt_entry_size): New function.
8610 (Output_data_plt_powerpc::entry_count): New function.
8611 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8612 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8613 * sparc.cc (Target_sparc::got_size): Add const.
8614 (Target_sparc::got_entry_count): New function.
8615 (Target_sparc::plt_entry_count): New function.
8616 (Target_sparc::first_plt_entry_offset): New function.
8617 (Target_sparc::plt_entry_size): New function.
8618 (Output_data_plt_sparc::entry_count): New function.
8619 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8620 (Output_data_plt_sparc::get_plt_entry_size): New function.
8621 * symtab.h (Symbol::got_offset_list): New function.
8622 (Symbol_table::for_all_symbols): New function.
8623 * target.h (Sized_target::got_entry_count): New function.
8624 (Sized_target::plt_entry_count): New function.
8625 (Sized_target::plt_entry_size): New function.
8626 * x86_64.cc (Target_x86_64::got_size): Add const.
8627 (Target_x86_64::got_entry_count): New function.
8628 (Target_x86_64::plt_entry_count): New function.
8629 (Target_x86_64::first_plt_entry_offset): New function.
8630 (Target_x86_64::plt_entry_size): New function.
8631 (Output_data_plt_x86_64::entry_count): New function.
8632 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8633 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8634
09ec0418
CC
86352010-08-12 Cary Coutant <ccoutant@google.com>
8636
8637 * archive.cc: Include incremental.h.
8638 (Archive::Archive): Initialize incremental_info_.
8639 (Archive::include_member): Record archive members in incremental info.
8640 (Add_archive_symbols::run): Record begin and end of an archive in
8641 incremental info.
8642 (Lib_group::include_member): Record objects in incremental info.
8643 * archive.h (Incremental_archive_entry): Forward declaration.
8644 (Archive::set_incremental_info): New member function.
8645 (Archive::incremental_info): New member function.
8646 (Archive::Unused_symbol_iterator): New class.
8647 (Archive::unused_symbols_begin): New member function.
8648 (Archive::unused_symbols_end): New member function.
8649 (Archive::incremental_info_): New data member.
8650 * incremental-dump.cc (find_input_containing_global): New function.
8651 (dump_incremental_inputs): Dump new incremental info sections.
8652 * incremental.cc: Include symtab.h.
8653 (Output_section_incremental_inputs): New class.
8654 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8655 new incremental info sections.
8656 (Sized_incremental_binary::do_check_inputs): Likewise.
8657 (Incremental_inputs::report_archive): Remove.
8658 (Incremental_inputs::report_archive_begin): New function.
8659 (Incremental_inputs::report_archive_end): New function.
8660 (Incremental_inputs::report_object): New function.
8661 (Incremental_inputs::finalize_inputs): Remove.
8662 (Incremental_inputs::report_input_section): New function.
8663 (Incremental_inputs::report_script): Rewrite.
8664 (Incremental_inputs::finalize): Do nothing but finalize string table.
8665 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8666 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8667 (Incremental_inputs::create_data_sections): New function.
8668 (Incremental_inputs::relocs_entsize): New function.
8669 (Output_section_incremental_inputs::set_final_data_size): New function.
8670 (Output_section_incremental_inputs::do_write): New function.
8671 (Output_section_incremental_inputs::write_header): New function.
8672 (Output_section_incremental_inputs::write_input_files): New function.
8673 (Output_section_incremental_inputs::write_info_blocks): New function.
8674 (Output_section_incremental_inputs::write_symtab): New function.
8675 * incremental.h (Incremental_script_entry): Forward declaration.
8676 (Incremental_object_entry): Forward declaration.
8677 (Incremental_archive_entry): Forward declaration.
8678 (Incremental_inputs): Forward declaration.
8679 (Incremental_inputs_header_data): Remove.
8680 (Incremental_inputs_header): Remove.
8681 (Incremental_inputs_header_write): Remove.
8682 (Incremental_inputs_entry_data): Remove.
8683 (Incremental_inputs_entry): Remove.
8684 (Incremental_inputs_entry_write): Remove.
8685 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8686 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8687 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8688 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8689 Likewise.
8690 (Incremental_input_entry): New class.
8691 (Incremental_script_entry): New class.
8692 (Incremental_object_entry): New class.
8693 (Incremental_archive_entry): New class.
8694 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8695 (Incremental_inputs::report_inputs): Remove.
8696 (Incremental_inputs::report_archive): Remove.
8697 (Incremental_inputs::report_archive_begin): New function.
8698 (Incremental_inputs::report_archive_end): New function.
8699 (Incremental_inputs::report_object): Change prototype.
8700 (Incremental_inputs::report_input_section): New function.
8701 (Incremental_inputs::report_script): Change prototype.
8702 (Incremental_inputs::get_reloc_count): New function.
8703 (Incremental_inputs::set_reloc_count): New function.
8704 (Incremental_inputs::create_data_sections): New function.
8705 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8706 (Incremental_inputs::inputs_section): New function.
8707 (Incremental_inputs::symtab_section): New function.
8708 (Incremental_inputs::relocs_section): New function.
8709 (Incremental_inputs::get_stringpool): Add const.
8710 (Incremental_inputs::command_line): Add const.
8711 (Incremental_inputs::inputs): Remove.
8712 (Incremental_inputs::command_line_key): New function.
8713 (Incremental_inputs::input_file_count): New function.
8714 (Incremental_inputs::input_files): New function.
8715 (Incremental_inputs::relocs_entsize): New function.
8716 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8717 (Incremental_inputs::finalize_inputs): Remove.
8718 (Incremental_inputs::Input_info): Remove.
8719 (Incremental_inputs::lock_): Remove.
8720 (Incremental_inputs::inputs_): Change type.
8721 (Incremental_inputs::inputs_map_): Remove.
8722 (Incremental_inputs::current_object_entry_): New data member.
8723 (Incremental_inputs::inputs_section_): New data member.
8724 (Incremental_inputs::symtab_section_): New data member.
8725 (Incremental_inputs::relocs_section_): New data member.
8726 (Incremental_inputs::reloc_count_): New data member.
8727 (Incremental_inputs_reader): New class.
8728 (Incremental_symtab_reader): New class.
8729 (Incremental_relocs_reader): New class.
8730 * layout.cc (Layout::finalize): Move finalization of incremental info
8731 and creation of incremental info sections to follow finalization of
8732 symbol table. Set offsets for postprocessing sections.
8733 (Layout::create_incremental_info_sections): Call
8734 Incremental_inputs::create_data_sections. Add incremental symtab
8735 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8736 sections to layout after input sections.
8737 * layout.h (struct Timespec): Forward declaration.
8738 (Layout::incremental_inputs): Add const.
8739 (Layout::create_incremental_info_sections): Add parameter.
8740 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8741 * object.cc: Include incremental.h.
8742 (Relobj::finalize_incremental_relocs): New function.
8743 (Sized_relobj::do_layout): Record input sections in incremental info.
8744 * object.h (Object::output_section): New function.
8745 (Object::output_section_offset): Moved from Relobj.
8746 (Object::get_incremental_reloc_base): New function.
8747 (Object::get_incremental_reloc_count): New function.
8748 (Object::do_output_section): New function.
8749 (Object::do_output_section_offset): Moved from Relobj.
8750 (Object::do_get_incremental_reloc_base): New function.
8751 (Object::do_get_incremental_reloc_count): New function.
8752 (Object::Object): Initialize new data members.
8753 (Relobj::output_section): Renamed do_output_section and moved to
8754 protected.
8755 (Relobj::output_section_offset): Moved to Object.
8756 (Relobj::do_get_incremental_reloc_base): New function.
8757 (Relobj::do_get_incremental_reloc_count): New function.
8758 (Relobj::allocate_incremental_reloc_counts): New function.
8759 (Relobj::count_incremental_reloc): New function.
8760 (Relobj::finalize_incremental_relocs): New function.
8761 (Relobj::next_incremental_reloc_index): New function.
8762 (Relobj::reloc_counts_): New data member.
8763 (Relobj::reloc_bases_): New data member.
8764 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8765 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8766 (Sized_relobj::incremental_relocs_scan): New function.
8767 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8768 (Sized_relobj::incremental_relocs_write): New function.
8769 (Sized_relobj::incremental_relocs_write_reltype): New function.
8770 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8771 incremental link.
8772 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8773 archives and object files elsewhere.
8774 (Add_symbols::run): Report object files here.
8775 (Finish_group::run): Report end of archive at end of group.
8776 * reloc.cc: Include layout.h, incremental.h.
8777 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8778 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8779 (Sized_relobj::incremental_relocs_scan): New function.
8780 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8781 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8782 (Sized_relobj::incremental_relocs_write): New function.
8783 (Sized_relobj::incremental_relocs_write_reltype): New function.
8784 * script.cc (read_input_script): Rewrite test for incremental link.
8785 Change call to Incremental_inputs::report_script.
8786 * symtab.h (Symbol_table::first_global_index): New function.
8787 (Symbol_table::output_count): New function.
8788
ce0d1972
DK
87892010-08-12 Doug Kwan <dougkwan@google.com>
8790
8791 * arm.cc (Target_arm::merge_object_attributes): Check command line
8792 options --no-wchar-size-warning and --no-enum-size-warning.
8793 * options.h (General_options): Add ld-compatible options
8794 --no-enum-size-warning and --no-wchar-size-warning.
8795
6e5710ce
ILT
87962010-08-04 Ian Lance Taylor <iant@google.com>
8797
8798 * x86_64.cc (Target_x86_64::Scan::local): Use
8799 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8800 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8801 (Target_x86_64::Scan::global): Likewise.
8802 (Target_x86_64::Relocate::relocate): Likewise.
8803 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8804 Likewise.
8805
fef830db
CC
88062010-08-03 Cary Coutant <ccoutant@google.com>
8807
8808 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8809 to reserve space in merged_strings vector. Keep total input size
8810 for stats.
8811 (Output_merge_string::do_print_merge_stats): Print total input size.
8812 * merge.h (Output_merge_string): Add input_size_ field.
8813 * stringpool.cc (Stringpool_template::string_length): Move
8814 implementations out of Stringpool_template class and place in
8815 stringpool.h.
8816 * stringpool.h (string_length): Move out of Stringpool_template.
8817
1e3811b0
ILT
88182010-08-03 Ian Lance Taylor <iant@google.com>
8819
8820 PR 11712
8821 * layout.cc (relaxation_loop_body): If address of load segment is
8822 set, adjust address to include headers if possible.
8823
7af0c620
ILT
88242010-08-03 Ian Lance Taylor <iant@google.com>
8825
8826 * version.cc (version_string): Bump to 1.10.
8827
22f0da72
ILT
88282010-08-03 Ian Lance Taylor <iant@google.com>
8829
8830 PR 11805
8831 * layout.h (enum Output_section_order): Define.
8832 (class Layout): Update declarations.
8833 * layout.cc (Layout::get_output_section): Add order parameter.
8834 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8835 is_first_non_relro parameters. Change all callers.
8836 (Layout::choose_output_section): Likewise.
8837 (Layout::add_output_section_data): Likewise.
8838 (Layout::make_output_section): Likewise. Set order.
8839 (Layout::default_section_order): New function.
8840 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8841 * output.cc (Output_section::Output_section): Initialize order_.
8842 Don't initialize deleted fields.
8843 (Output_segment::Output_segment): Don't initialize deleted
8844 fields.
8845 (Output_segment::add_output_section_to_load): New function
8846 replacing add_output_section. Change all callers to call this or
8847 add_output_section_to_nonload.
8848 (Output_segment::add_output_section_to_nonload): New function.
8849 (Output_segment::remove_output_section): Rewrite.
8850 (Output_segment::add_initial_output_data): Likewise.
8851 (Output_segment::has_any_data_sections): Likewise.
8852 (Output_segment::is_first_section_relro): Likewise.
8853 (Output_segment::maximum_alignment): Likewise.
8854 (Output_segment::has_dynamic_reloc): New function replacing
8855 dynamic_reloc_count. Change all callers.
8856 (Output_segment::has_dynamic_reloc_list): New function replacing
8857 dynamic_reloc_count_list. Change all callers.
8858 (Output_segment::set_section_addresses): Rewrite.
8859 (Output_segment::set_offset): Rewrite.
8860 (Output_segment::find_first_and_last_list): Remove.
8861 (Output_segment::set_tls_offsets): Rewrite.
8862 (Output_segment::first_section_load_address): Likewise.
8863 (Output_segment::output_section_count): Likewise.
8864 (Output_segment::section_with_lowest_load_address): Likewise.
8865 (Output_segment::write_section_headers): Likewise.
8866 (Output_segment::print_sections_to_map): Likewise.
8867 * output.h (class Output_data): Remove dynamic_reloc_count_
8868 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8869 (Output_data::add_dynamic_reloc): Rewrite.
8870 (Output_data::has_dynamic_reloc): New function.
8871 (Output_data::dynamic_reloc_count): Remove.
8872 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8873 is_last_relro_, is_first_non_relro_, is_interp_,
8874 is_dynamic_linker_section_ fields. Add order and set_order
8875 functions. Remove is_relro_local, set_is_relro_local,
8876 is_last_relro, set_is_last_relro, is_first_non_relro,
8877 set_is_first_non_relro functions, is_interp, set_is_interp,
8878 is_dynamic_linker_section, and set_is_dynamic_linker_section
8879 functions.
8880 (class Output_segment): Change Output_data_list from std::list to
8881 std:;vector. Add output_lists_ field. Remove output_data_ and
8882 output_bss_ fields. Update declarations.
8883
3ff2ccb0
ILT
88842010-08-02 Ian Lance Taylor <iant@google.com>
8885
8886 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8887 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8888 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8889
88a4108b
ILT
88902010-08-02 Ian Lance Taylor <iant@google.com>
8891
8892 PR 11855
8893 * script.cc (Script_options::Script_options): Initialize
8894 symbol_definitions_ and symbol_references_.
8895 (Script_options::add_symbol_assignment): Update
8896 symbol_definitions_ and symbol_references_.
8897 (Script_options::add_symbol_reference): New function.
8898 (script_symbol): New function.
8899 * script.h (class Script_options): Add symbol_definitions_ and
8900 symbol_references_ fields.
8901 (Script_options::referenced_const_iterator): New type.
8902 (Script_options::referenced_begin): New function.
8903 (Script_options::referenced_end): New function.
8904 (Script_options::is_referenced): New function.
8905 (Script_options::any_unreferenced): New function.
8906 * script-c.h (script_symbol): Declare.
8907 * yyscript.y (exp): Call script_symbol.
8908 * symtab.cc: Include "script.h".
8909 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8910 Change all callers. Check symbols referenced by scripts.
8911 (Symbol_table::add_undefined_symbols_from_command_line): Add
8912 layout parameter. Change all callers.
8913 (Symbol_table::do_add_undefined_symbols_from_command_line):
8914 Likewise. Break out loop body. Check symbols referenced by
8915 scripts.
8916 (Symbol_table::add_undefined_symbol_from_command_line): New
8917 function broken out of
8918 do_add_undefined_symbols_from_command_line.
8919 * symtab.h (class Symbol_table): Update declarations.
8920 * archive.cc: Include "layout.h".
8921 (Archive::should_include_member): Add layout parameter. Change
8922 all callers. Check for symbol mentioned in expression.
8923 * archive.h (class Archive): Update declaration.
8924 * object.cc (Sized_relobj::do_should_include_member): Add layout
8925 parameter.
8926 * object.h (Object::should_include_member): Add layout parameter.
8927 Change all callers.
8928 (Object::do_should_include_member): Add layout parameter.
8929 (class Sized_relobj): Update declaration.
8930 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8931 parameter.
8932 * dynobj.h (class Sized_dynobj): Update declaration.
8933 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8934 layout parameter.
8935 * plugin.h (class Sized_pluginobj): Update declaration.
8936
5f1ab67a
ILT
89372010-08-02 Ian Lance Taylor <iant@google.com>
8938
8939 PR 11866
8940 * output.cc (Output_segment::set_offset): Search for the first and
8941 last sections rather than assuming that the list is in order.
8942 (Output_segment::find_first_and_last_list): New function.
8943 * output.h (class Output_segment): Update declarations.
8944 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8945 (relro_strip_test_SOURCES): New variable.
8946 (relro_strip_test_DEPENDENCIES): New variable.
8947 (relro_strip_test_LDFLAGS): New variable.
8948 (relro_strip_test_LDADD): New variable.
8949 (relro_strip_test.so): New target.
8950
a8df5856
ILT
89512010-08-02 Ian Lance Taylor <iant@google.com>
8952
8953 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8954 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8955 (Target_i386::got_tlsdesc_section): New function.
8956 (Target_i386::got_section): Create space for GOT entries for
8957 TLSDESC relocations.
8958 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8959 R_386_TLS_GOTDESC.
8960 (Target_i386::Scan::global): Likewise.
8961 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8962 using TLSDESC GOT.
8963 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8964 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8965 (Target_x86_64::got_tlsdesc_section): New function.
8966 (Target_x86_64::got_section): Create space for GOT entries for
8967 TLSDESC relocations.
8968 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8969 R_386_TLS_GOTDESC.
8970 (Target_x86_64::Scan::global): Likewise.
8971 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8972 using TLSDESC GOT.
8973
0c10a0a6
ILT
89742010-08-02 Ian Lance Taylor <iant@google.com>
8975
8976 * testsuite/final_layout.sh: Use dc to convert from hex to
8977 decimal.
8978
41cbeecc
ST
89792010-07-29 Sriraman Tallam <tmsriram@google.com>
8980
8981 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8982 paramter to the call to gold::gc_process_relocs.
8983 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8984 paramter to the call to gold::gc_process_relocs.
8985 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8986 parameter to the call to gold::gc_process_relocs.
8987 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8988 template parameter to the call to gold::gc_process_relocs.
8989 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8990 paramter to the call to gold::gc_process_relocs.
8991 * gc.h (get_embedded_addend_size): New function.
8992 (gc_process_relocs): Save the size of the reloc for use by ICF.
8993 * icf.cc (get_section_contents): Get the addend from the text section
8994 for SHT_REL relocation sections.
8995 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8996 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8997 * int_encoding.h (read_from_pointer): New overloaded function.
8998 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8999 * testsuite/icf_sht_rel_addend_test.sh: New file.
9000 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9001 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9002
6ea55b82
RW
90032010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9004
9005 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9006 * Makefile.in: Regenerate.
9007 * testsuite/Makefile.in: Regenerate.
9008
9691462b
ILT
90092010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9010
9011 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9012 * gold/testsuite/debug_msg.cc: Likewise.
9013 * gold/testsuite/odr_violation1.cc
9014 * gold/testsuite/odr_violation2.cc
9015
76897331
CC
90162010-07-21 Cary Coutant <ccoutant@google.com>
9017
9018 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9019 string, and length fields.
9020 (Output_merge_string::Merged_strings_list): New type.
9021 (Output_merge_string::Merged_strings_lists): New typedef.
9022 (Output_merge_string): Replace merged_strings_ with
9023 merged_strings_lists_.
9024 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9025 Merged_strings_list per input object and section. Don't store pointer
9026 to the string. Don't store length with each merged string entry.
9027 (Output_merge_string::finalize_merged_data): Loop over list of merged
9028 strings lists. Recompute length of each merged string.
9029
78384e8f
CC
90302010-07-15 Cary Coutant <ccoutant@google.com>
9031
9032 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9033 here.
9034
783659f9
ILT
90352010-07-14 Ian Lance Taylor <iant@google.com>
9036
9037 * descriptors.cc (Descriptors::open): Report correct name in error
9038 message.
9039
131687b4
DK
90402010-07-13 Doug Kwan <dougkwan@google.com>
9041
9042 * arm.cc (Arm_input_section::Arm_input_section): For a
9043 SHT_ARM_EXIDX section, always keeps the input sections.
9044 (Arm_input_section::set_exidx_section_link): New method.
9045 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9046 has_errors_ to false.
9047 (Arm_exidx_input_section::has_errors,
9048 Arm_exidx_input_section::set_has_errors): New methods.
9049 (Arm_exidx_input_section::has_errors_): New data member.
9050 (Arm_relobj::get_exidx_shndx_list): New method.
9051 (Arm_output_section::append_text_sections_to_list): Do not skip
9052 section without SHF_EXECINSTR.
9053 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9054 errors.
2e702c99 9055 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9056 section header. Make error messages more verbose. Check for
9057 a non-executable section linked to an EXIDX section.
9058 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9059 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9060 check that there is no deferred EXIDX section if we exit early.
9061 Instead of not making an EXIDX section in case of an error, make one
9062 and set the has_errors flag of it.
9063 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9064 in a relocatable link.
9065 (Target_arm::do_relax): Look for the EXIDX output section instead of
9066 assuming that it is called .ARM.exidx.
2e702c99 9067 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9068 section list. Do not check for SHF_EXECINSTR section flags but
9069 skip any input section with errors.
9070 * output.cc (Output_section::Output_section): Initialize
9071 always_keeps_input_sections_ to false.
9072 (Output_section::add_input_section): Check for
9073 always_keeps_input_sections_.
9074 * output.h (Output_section::always_keeps_input_sections,
9075 Output_section::set_always_keeps_input_sections): New methods.
9076 (Output_section::always_keeps_input_sections): New data member.
9077
69517287
RÁE
90782010-07-13 Rafael Espindola <espindola@google.com>
9079
9080 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9081 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9082
82742395
ILT
90832010-07-13 Philip Herron <herron.philip@googlemail.com>
9084 Ian Lance Taylor <iant@google.com>
9085
9086 * output.h (Output_section_lookup_maps::add_merge_section):
9087 Correct check of whether value was inserted.
9088 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9089 (Output_section_lookup_maps::add_relaxed_input_section):
9090 Likewise.
9091 * arm.cc (Target_arm::got_section): Remove used local os.
9092 * i386.cc (Target_i386::got_section): Likewise.
9093 * x86_64.cc (Target_x86_64::got_section): Likewise.
9094 * sparc.cc (Target_sparc::got_section): Likewise.
9095 (Target_sparc::relocate): Remove unused local have_got_offset.
9096 * powerpc.cc (Target_powerpc::relocate): Likewise.
9097
f2d707b5
ILT
90982010-07-13 Ian Lance Taylor <iant@google.com>
9099
241531d6
ILT
9100 * compressed_output.cc (zlib_decompress): Fix signature in
9101 !HAVE_ZLIB_H case.
9102
f2d707b5
ILT
9103 * archive.cc (Archive::include_member): Unlock an external member
9104 of a thin archive. Don't bother to delete an object we know is
9105 NULL.
9106
a2e47362
CC
91072010-07-12 Cary Coutant <ccoutant@google.com>
9108
9109 * compressed_output.cc (zlib_decompress): New function.
9110 (get_uncompressed_size): New function.
9111 (decompress_input_section): New function.
9112 * compressed_output.h (get_uncompressed_size): New function.
9113 (decompress_input_section): New function.
9114 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9115 Handle compressed debug sections.
9116 * layout.cc (is_compressed_debug_section): New function.
9117 (Layout::output_section_name): Map compressed section names to
9118 canonical names.
9119 * layout.h (is_compressed_debug_section): New function.
9120 (is_debug_info_section): Recognize compressed debug sections.
9121 * merge.cc: Include compressed_output.h.
9122 (Output_merge_data::do_add_input_section): Handle compressed
9123 debug sections.
9124 (Output_merge_string::do_add_input_section): Handle compressed
9125 debug sections.
9126 * object.cc: Include compressed_output.h.
9127 (Sized_relobj::Sized_relobj): Initialize new data members.
9128 (build_compressed_section_map): New function.
9129 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9130 * object.h (Object::section_is_compressed): New method.
9131 (Object::do_section_is_compressed): New method.
9132 (Sized_relobj::Compressed_section_map): New type.
9133 (Sized_relobj::do_section_is_compressed): New method.
9134 (Sized_relobj::compressed_sections_): New data member.
9135 * output.cc (Output_section::add_input_section): Handle compressed
9136 debug sections.
9137 * reloc.cc: Include compressed_output.h.
9138 (Sized_relobj::write_sections): Handle compressed debug sections.
9139
ce279a62
CC
91402010-07-08 Cary Coutant <ccoutant@google.com>
9141
9142 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9143 weak when resolving to a dynamic def.
9144 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9145 for weak undef/dynamic def cases. Adjust callers.
9146 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9147 undef_binding_weak_.
9148 (Symbol_table::sized_write_globals): Adjust symbol binding.
9149 (Symbol_table::sized_write_symbol): Add binding parameter.
9150 * symtab.h (Symbol::set_undef_binding): New method.
9151 (Symbol::is_undef_binding_weak): New method.
9152 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9153 (Symbol_table::should_override): Add new parameter.
9154 (Symbol_table::sized_write_symbol): Add new parameter.
9155
9156 * testsuite/weak_undef_file1.cc: Add new test case.
9157 * testsuite/weak_undef_file2.cc: Fix header comment.
9158 * testsuite/weak_undef_test.cc: Add new test case.
9159
b2286c10
DK
91602010-06-29 Doug Kwan <dougkwan@google.com>
9161
9162 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9163 Initialize USE_SYMBOL_.
9164 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9165 definition.
9166 (Arm_reloc_property::uses_symbol_): New data member declaration.
9167 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9168 uses symbol value and symbol is undefined but not weakly undefined.
9169
4802450a
RÁE
91702010-06-28 Rafael Espindola <espindola@google.com>
9171
9172 * plugin.cc (Plugin::load): Use dlerror.
9173
e5ca47ba
ILT
91742010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9175
9176 * symtab.cc (detect_odr_violations): When reporting an ODR
9177 violation, report an object where the symbol is defined.
9178
8a75a161
DK
91792010-06-25 Doug Kwan <dougkwan@google.com>
9180
9181 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9182 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9183 definition.
9184 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9185 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9186 target hook to detect function points.
9187 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9188 * icf.h (Icf::check_section_for_function_pointers): Change type of
9189 parameter SECTION_NAME to const reference to std::string. Use
9190 target hook to determine if section may have unsafe pointers.
9191 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9192 method definition.
9193
42218b9f
RÁE
91942010-06-21 Rafael Espindola <espindola@google.com>
9195
9196 * fileread.cc (Input_file::find_fie): New
9197 (Input_file::open): Use Input_file::find_fie.
9198 * fileread.h (Input_file::find_fie): New
9199 * plugin.cc (set_extra_library_path): New.
9200 (Plugin::load): Add set_extra_library_path to the transfer vector.
9201 (Plugin_manager::set_extra_library_path): New.
9202 (Plugin_manager::add_input_file): Use the extra search path if set.
9203 (set_extra_library_path(): New.
9204 * plugin.h (Plugin_manager): Add set_extra_library_path and
9205 extra_search_path_.
9206
a0506cca
CC
92072010-06-19 Cary Coutant <ccoutant@google.com>
9208
9209 * layout.cc (gdb_sections): Add .debug_types.
9210 (lines_only_debug_sections): Likewise.
9211
6508b958
RÁE
92122010-06-18 Rafael Espindola <espindola@google.com>
9213
9214 * plugin.cc (add_input_file,add_input_library)
9215 (Plugin_manager::add_input_file): Make filename arguments const.
9216 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9217 const.
9218
3e235302
DK
92192010-06-16 Doug Kwan <dougkwan@google.com>
9220
9221 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9222 .ARM.attributes section if we have not merged any input
9223 attributes sections.
9224
106e8a6c
DK
92252010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9226
9227 * arm.cc: Allow combining objects with no EABI version
9228 information.
9229
91ff43fe
RÁE
92302010-06-15 Rafael Espindola <espindola@google.com>
9231
9232 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9233
68ed838c
ILT
92342010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9235
9236 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9237 (struct iovec): Correct !HAVE_READV definition.
9238
f3a2388f
CC
92392010-06-10 Cary Coutant <ccoutant@google.com>
9240
9241 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9242 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9243 reloc sections.
9244 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9245
9246 PR 11683
9247 * symtab.h (Symbol::is_placeholder): New member function.
9248 * target-reloc.h (relocate_section): Check for placeholder symbols.
9249
9250 * testsuite/Makefile.am (plugin_test_8): New test.
9251 (plugin_test_9): New test.
9252 * testsuite/Makefile.in: Regenerate.
9253
e1df38aa
NC
92542010-06-09 Nick Clifton <nickc@redhat.com>
9255
9256 * yyscript.y (input_list_element): Allow strings prefixed with
9257 the '-' character. Treat these as libraries.
9258 * script.cc (script_add_library): New function. Adds a library
9259 specified by "-l<name>" found in an input script.
9260 * script-c.h: Add prototype for script_add_library.
9261
25bbe950
DK
92622010-06-07 Doug Kwan <dougkwan@google.com>
9263
9264 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9265 Restrict stub-group size to be within long conditional branch
9266 range when working around cortex-A8 erratum.
9267
0f32ea4c
ILT
92682010-06-07 Damien Diederen <dd@crosstwine.com>
9269
9270 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9271 #ifdef typo.
9272
8fe2a369
ST
92732010-06-03 Sriraman Tallam <tmsriram@google.com>
9274
9275 PR gold/11658
9276 * output.cc
9277 (Output_section::Input_section_sort_entry::compare_section_ordering):
9278 Change to return non-zero correctly.
9279 (Output_section::Input_section_sort_section_order_index_compare
9280 ::operator()): Change to fix ambiguity in comparisons.
9281
6e9ba2ca
ST
92822010-06-01 Sriraman Tallam <tmsriram@google.com>
9283
9284 * gold.h (is_wildcard_string): New function.
9285 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9286 (Layout::layout_eh_frame): Ditto.
9287 (Layout::find_section_order_index): New method.
9288 (Layout::read_layout_from_file): New method.
9289 * layout.h (Layout::find_section_order_index): New method.
9290 (Layout::read_layout_from_file): New method.
9291 (Layout::input_section_position_): New private member.
9292 (Layout::input_section_glob_): New private member.
9293 * main.cc (main): Call read_layout_from_file here.
9294 * options.h (--section-ordering-file): New option.
9295 * output.cc (Output_section::input_section_order_specified_): New
9296 member.
9297 (Output_section::Output_section): Initialize new member.
9298 (Output_section::add_input_section): Add new parameter.
9299 Keep input sections when --section-ordering-file is used.
9300 (Output_section::set_final_data_size): Sort input sections when
9301 section ordering file is specified.
9302 (Output_section::Input_section_sort_entry): Add new parameter.
9303 Check sorting type.
9304 (Output_section::Input_section_sort_entry::compare_section_ordering):
9305 New method.
9306 (Output_section::Input_section_sort_compare::operator()): Change to
9307 consider section_order_index.
9308 (Output_section::Input_section_sort_init_fini_compare::operator()):
9309 Change to consider section_order_index.
9310 (Output_section::Input_section_sort_section_order_index_compare
9311 ::operator()): New method.
9312 (Output_section::sort_attached_input_sections): Change to sort
9313 according to section order when specified.
e1df38aa
NC
9314 (Output_section::add_input_section<32, true>): Add new parameter.
9315 (Output_section::add_input_section<64, true>): Add new parameter.
9316 (Output_section::add_input_section<32, false>): Add new parameter.
9317 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9318 * output.h (Output_section::add_input_section): Add new parameter.
9319 (Output_section::input_section_order_specified): New
9320 method.
9321 (Output_section::set_input_section_order_specified): New method.
9322 (Input_section::Input_section): Initialize section_order_index_.
9323 (Input_section::section_order_index): New method.
9324 (Input_section::set_section_order_index): New method.
9325 (Input_section::section_order_index_): New member.
9326 (Input_section::Input_section_sort_section_order_index_compare): New
9327 struct.
9328 (Output_section::input_section_order_specified_): New member.
9329 * script-sections.cc (is_wildcard_string): Delete and move modified
9330 method to gold.h.
9331 (Output_section_element_input::Output_section_element_input): Modify
9332 call to is_wildcard_string.
9333 (Output_section_element_input::Input_section_pattern
9334 ::Input_section_pattern): Ditto.
9335 (Output_section_element_input::Output_section_element_input): Ditto.
9336 * testsuite/Makefile.am (final_layout): New test case.
9337 * testsuite/Makefile.in: Regenerate.
9338 * testsuite/final_layout.cc: New file.
9339 * testsuite/final_layout.sh: New file.
9340
3537c84b
RÁE
93412010-06-01 Rafael Espindola <espindola@google.com>
9342
9343 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9344
105b6afd
RÁE
93452010-06-01 Rafael Espindola <espindola@google.com>
9346
9347 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9348 visibility of symbols.
9349
29e11421
DK
93502010-05-27 Doug Kwan <dougkwan@google.com>
9351
9352 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9353 from start of output section instead of address for a local symbol
9354 in a merged or relaxed section when doing a relocatable link.
9355
5e0f337e
RÁE
93562010-05-26 Rafael Espindola <espindola@google.com>
9357
703d02da 9358 PR 11604
5e0f337e
RÁE
9359 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9360 adding sections the garbage collector removed.
9361 * gold/testsuite/Makefile.am: Add test.
9362 * gold/testsuite/Makefile.in: Regenerate.
9363 * gold/testsuite/plugin_test_7.sh: New.
9364 * gold/testsuite/plugin_test_7_1.c: New.
9365 * gold/testsuite/plugin_test_7_2.c: New.
9366
f4187277
RÁE
93672010-05-26 Rafael Espindola <espindola@google.com>
9368
9369 * script-sections.cc (Output_section_definition::set_section_addresses):
9370 Check for --section-start.
9371
5c388529
DK
93722010-05-26 Doug Kwan <dougkwan@google.com>
9373
9374 * arm.cc (Arm_scan_relocatable_relocs): New class.
9375 (Target_arm::relocate_special_relocatable): New method.
9376 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9377 (Arm_relocate_functions::thumb_branch_common): Same.
9378 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9379 instead of Default_scan_relocatable_relocs.
9380 * target-reloc.h (relocate_for_relocatable): Let target handle
9381 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9382 * target.h (Sized_target::relocate_special_relocatable): New method.
9383
bca1c3ae
ILT
93842010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9385
9386 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9387
0439c796
DK
93882010-05-23 Doug Kwan <dougkwan@google.com>
9389
9390 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9391 instead of a cast.
9392 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9393 with a direct branch, not a conditional branch, to a stub.
9394 * merge.cc (Output_merge_base::record_input_section): New method
9395 defintion.
9396 (Output_merge_data::do_add_input_section): Record input section if
9397 keeps-input-sections flag is set.
9398 (Output_merge_string::do_add_input_section): Ditto.
9399 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9400 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9401 INPUT_SECTIONS_.
9402 (Output_merge_base::keeps_input_sections,
9403 Output_merge_base::set_keeps_input_sections,
9404 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9405 method definitions.
9406 (Output_merge_base::Input_sections): New type declaration.
9407 (Output_merge_base::input_sections_begin,
9408 Output_merge_base::input_sections_end,
9409 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9410 (Output_merge_base::bool keeps_input_sections_,
9411 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9412 Output_merge_base::input_sections_): New data members.
9413 (Output_merge_data::do_set_keeps_input_sections): New method
9414 defintion.
9415 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9416 * output.cc (Output_section::Input_section::relobj): Move method
9417 defintion from class declaration to here and handle merge sections.
9418 (Output_section::Input_section::shndx): Ditto.
9419 (Output_section::Output_section): Remove initializations of removed
9420 data members and initialize new data member LOOKUP_MAPS_.
9421 (Output_section::add_input_section): Set keeps-input-sections flag
9422 for a newly created merge output section as appropriate. Adjust code
9423 to use Output_section_lookup_maps class.
9424 (Output_section::add_relaxed_input_section): Adjst code for lookup
9425 maps code refactoring.
2e702c99 9426 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9427 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9428 class. If adding input section to a newly created merge output
9429 section fails, remove the new merge section.
9430 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9431 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9432 (Output_section::find_merge_section): Ditto.
0439c796 9433 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9434 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9435 Output_section_lookup_maps class.
9436 (Output_section::get_input_sections): Export merge sections. Adjust
9437 code to use Output_section_lookup_maps class.
9438 (Output_section:::add_script_input_section): Adjust code to use
9439 Output_section_lookup_maps class. Update lookup maps for merge
9440 sections also.
9441 (Output_section::discard_states): Use Output_section_lookup_maps.
9442 (Output_section::restore_states): Same.
9443 * output.h (Merge_section_properties): Move class defintion out of
9444 Output_section.
9445 (Output_section_lookup_maps): New class.
9446 (Output_section::Input_section::is_merge_section): New method
9447 defintion.
9448 (Output_section::Input_section::relobj): Move defintion out of class
9449 defintion. Declare method only.
9450 (Output_section::Input_section::shndx): Ditto.
9451 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9452 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9453 (Output_section::Merge_section_by_properties_map,
9454 Output_section::Output_section_data_by_input_section_map,
9455 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9456 Remove types.
2e702c99 9457 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9458 KEEPS_INPUT_SECTIONS.
9459 (Output_section::build_lookup_maps): New method declaration.
9460 (Output_section::merge_section_map_,
9461 Output_section::merge_section_by_properties_map_,
9462 Output_section::relaxed_input_section_map_,
9463 Output_section::is_relaxed_input_section_map_valid_): Remove data
9464 members.
9465 (Output_section::lookup_maps_): New data member.
9466
76295588
L
94672010-05-21 Doug Kwan <dougkwan@google.com>
9468
9469 PR gold/11619
9470 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9471 avoid a compilation error.
9472
d103a984
RÁE
94732010-05-19 Rafael Espindola <espindola@google.com>
9474
9475 * script-sections.cc (Output_section_definition::allocate_to_segment):
9476 Update the phdrs_list even when the output section is NULL.
9477 * testsuite/Makefile.am: Add test.
9478 * testsuite/Makefile.in: Regenerate.
9479 * testsuite/script_test_9.cc: New.
9480 * testsuite/script_test_9.sh: New.
9481 * testsuite/script_test_9.t: New.
9482
6625d24e
DK
94832010-05-19 Doug Kwan <dougkwan@google.com>
9484
9485 * arm.cc (Arm_input_section::original_size): New method.
9486 (Arm_input_section::do_addralign): Add a cast.
9487 (Arm_input_section::do_output_offset): Remove static cast.
9488 (Arm_input_section::original_addralign,
9489 Arm_input_section::original_size_): Change type to uint32_t.
9490 (Arm_input_section::init): Add safe casts for section alignment
9491 and size.
9492 (Arm_input_section::set_final_data_size): Do not set address and
9493 offset of stub table.
9494 (Arm_output_section::fix_exidx_coverage): Change use of of
9495 Output_section::Simple_input_section to that of
9496 Output_section::Input_section.
9497 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9498 except for the first pass.
9499 * output.cc (Output_section::get_input_sections): Change type of
9500 input_sections to std::list<Input_section>.
9501 (Output_section::add_script_input_section): Rename from
9502 Output_section::add_simple_input_section. Change type of SIS
9503 parameter from Simple_input_section to Input_section.
9504 * output.h (Output_section::Simple_input_section): Remove class.
9505 (Output_section::Input_section): Change class visibility to public.
9506 (Output_section::Input_section::addralign): Use stored alignments
9507 for special input sections if set.
9508 (Output_section::Input_section::set_addralign): New method.
9509 (Output_section::get_input_sections): Change parameter type from
9510 list of Simple_input_section to list of Input_section.
9511 (Output_section::add_script_input_section): Rename from
9512 Output_section::add_simple_input_section. Change first parameter's
9513 type from Simple_input_section to Input_section and remove the
9514 second and third parameters.
9515 * script-sections.cc (Input_section::Input_section_list): Change
9516 type to list of Output_section::Input_section/
9517 (Input_section_info::Input_section_info): Change parameter type of
9518 INPUT_SECTION to Output_section::Input_section.
9519 (Input_section_info::input_section): Change return type.
9520 (Input_section_info::input_section_): Change type to
9521 Output_section::Input_section.
9522 (Output_section_element_input::set_section_addresses): Adjust code
9523 to use Output_section::Input_section instead of
9524 Output_section::Simple_input_section. Adjust code for renaming
9525 of Output_section::add_simple_input_section.
9526 (Orphan_output_section::set_section_addresses): Ditto.
9527
e1e82ea4
RW
95282010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9529
9530 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9531 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9532
91e75c8a
RÁE
95332010-05-18 Rafael Espindola <espindola@google.com>
9534
9535 * options.cc (General_options::finalize): Handle -nostdlib.
9536 * options.h (nostdlib): New option.
9537 * script.cc (script_add_search_dir): Handle -nostdlib.
9538
da59ad79
DK
95392010-05-12 Doug Kwan <dougkwan@google.com>
9540
9541 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9542 attributes section only if there no attributes section after merging.
9543 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9544 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9545 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9546 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9547 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9548 and arm_attr_merge_7.stdout.
9549 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9550 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9551 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9552 arm_attr_merge_7b.o): New rules.
9553 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9554 arm_attr_merge_7
9555 * testsuite/Makefile.in: Regenerate.
9556 * testsuite/arm_attr_merge.sh: New file.
9557 * testsuite/arm_attr_merge_[67][ab].s: Same.
9558
3e01a7fd
NC
95592010-05-05 Nick Clifton <nickc@redhat.com>
9560
9561 * po/es.po: Updated Spanish translation.
9562
7ad2014a
L
95632010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9564
9565 * Makefile.am (install-exec-local): Properly install gold as
9566 default cross linker.
9567 * Makefile.in: Regenerated.
9568
4fda8867
NC
95692010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9570 Nick Clifton <nickc@redhat.com>
9571
9572 * configure.ac (install_as_default): Define and set to false
9573 unless --enable-gold or --enable-gold=both/gold has been
9574 specified.
9575 * configure: Regenerate.
9576
9577 * Makefile.am (install-exec-local): Install the executable as
9578 'ld.gold'. If install_as_default is true then also install it as
9579 'ld'.
9580 * Makefile.in: Regenerated.
9581
bd288ea2
ILT
95822010-04-24 Ian Lance Taylor <iant@google.com>
9583
9584 * layout.cc (Layout::layout_reloc): In relocatable link don't
9585 combine reloc sections for grouped sections.
9586
ef38fd8a
ST
95872010-04-23 Sriraman Tallam <tmsriram@google.com>
9588
9589 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9590 sections that are not ordinary to icf.
9591 * icf.cc (get_section_contents): Handle relocation pointing to section
9592 with no object or shndx information.
9593 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9594 * testsuite/Makefile.in: Regenerate.
9595 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9596 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9597
f6973bdc
ILT
95982010-04-22 Ian Lance Taylor <iant@google.com>
9599
9600 * expression.cc (Expression::Expression_eval_info): Add
9601 result_alignment_pointer field.
9602 (Expression::eval_with_dot): Add result_alignment_pointer
9603 parameter. Change all callers.
9604 (Expression::eval_maybe_dot): Likewise.
9605 (class Binary_expression): Add alignment_pointer parameter to
9606 left_value and right_value. Change all callers.
9607 (BINARY_EXPRESSION): Set result alignment.
9608 (class Trinary_expression): Add alignment_pointer parameter to
9609 arg2_value and arg3_value. Change all callers.
9610 (Trinary_cond::value): Set result alignment.
9611 (Max_expression::value, Min_expression::value): Likewise.
9612 (Align_expression::value): Likewise.
9613 * script-sections.cc (class Sections_element): Add dot_alignment
9614 parameter to set_section_addresses virtual function. Update
9615 instantiations.
9616 (class Output_section_element): Likewise.
9617 (Script_sections::create_segments): Add dot_alignment parameter.
9618 Change all callers.
9619 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9620 (Script_sections::set_phdrs_clause_addresses): Likewise.
9621 * script-sections.h: Update declarations.
9622 * script.h: Update declarations.
9623 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9624 min_p_align.
9625 * testsuite/script_test_3.t: Set large alignment.
9626 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9627 segment has expected alignment.
9628
9c9c98a5
NC
96292010-04-22 Nick Clifton <nickc@redhat.com>
9630
9631 * po/gold.pot: Updated by the Translation project.
9632 * po/vi.po: Updated Vietnamese translation.
9633
2253bfba
L
96342010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9635
9636 * testsuite/Makefile.am (check_PROGRAMS): Add
9637 icf_virtual_function_folding_test.
9638 * testsuite/Makefile.in: Regenerated.
9639
85fdf906
AH
96402010-04-15 Andrew Haley <aph@redhat.com>
9641
9642 * options.h (merge_exidx_entries): New option.
9643 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9644 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9645 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9646 (Target_arm::merge_exidx_entries): New function.
9647 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9648 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9649 to Arm_exidx_fixup constructor.
9650 Add new arg, merge_exidx_entries.
9651 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9652 Arm_output_section::fix_exidx_coverage.
9653
ce97fa81
ST
96542010-04-18 Sriraman Tallam <tmsriram@google.com>
9655
9656 * icf.cc (get_section_contents): Check for preemptible functions.
9657 Ignore addend when appropriate.
9658 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9659 section folded.
9660 (add_from_relobj): Check for section folded.
9661 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9662 * symtab.h (should_add_dynsym_entry): Add new parameter.
9663 * target-reloc.h (scan_relocs): Check for section folded.
9664 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9665 Check reloc types for function pointers in shared objects.
9666 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9667 case.
9668 (icf_preemptible_functions_test): New test case.
9669 (icf_string_merge_test): New test case.
9670 * testsuite.Makefile.in: Regenerate.
9671 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9672 bar_glob. Refactor code.
9673 * testsuite/icf_preemptible_functions_test.cc: New file.
9674 * testsuite/icf_preemptible_functions_test.sh: New file.
9675 * testsuite/icf_string_merge_test.cc: New file.
9676 * testsuite/icf_string_merge_test.sh: New file.
9677 * testsuite/icf_virtual_function_folding_test.cc: New file.
9678 * testsuite/icf_virtual_function_folding_test.sh: New file.
9679
04ceb17c
DK
96802010-04-14 Doug Kwan <dougkwan@google.com>
9681
9682 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9683 for local symbol recounting if we remove a section due to ICF.
9684 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9685 there are no regular objects in input.
9686
153e7da4
DK
96872010-04-13 Doug Kwan <dougkwan@google.com>
9688
9689 * arm.cc (Arm_input_section::set_final_data_size): Compute
9690 accurate final data size instead of using current data size.
9691
4dbd9faf
DK
96922010-04-09 Doug Kwan <dougkwan@google.com>
9693
9694 * layout.cc (Layout::choose_output_section): Handle script section
9695 types.
9696 (Layout::make_output_section_for_script): Add section type parameter.
9697 Handle script section types.
9698 * layout.h (Layout::make_output_section_for_script): Add section
9699 type parameter.
9700 * output.cc (Output_section::Output_section): Initialize data member
9701 is_noload_.
9702 (Output_section::do_reset_address_and_file_offset): Do not set address
9703 to 0 if section is a NOLOAD section.
9704 * output.h (Output_section::is_noload): New method.
9705 (Output_section::set_is_noload): Ditto.
9706 (Output_section::is_noload_): New data member.
9707 * script-c.h (Script_section_type): New enum type.
9708 (struct Parser_output_section_header): Add new file section_type.
9709 * script-sections.cc (Sections_element::output_section_name): Add
9710 parameter for returning script section type.
9711 (Output_section_definition::output_section_name): Ditto.
9712 (Output_section_definition::section_type)P; New method.
9713 (Output_section_definiton::script_section_type_name): Ditto.
9714 (Output_section_definition::script_section_type_): New data member.
9715 (Output_section_definition::Output_section_definition): Initialize
9716 data member Output_section_definition::script_section_type_.
9717 (Output_section_definition::create_sections): Pass script section type
9718 to Layout::make_output_section_for_script.
9719 (Output_section_definition::output_section_name): Return script
9720 section type to caller.
9721 (Output_section_definition::set_section_address): Do not advance
9722 dot value and load address if section type is NOLOAD. Set address
9723 of NOLOAD sections regardless of section flags.
9724 (Output_section_definition::print): Print section type if it is
9725 not SCRIPT_SECTION_TYPE_NONE.
9726 (Output_section_definition::section_type): New method.
9727 (Output_section_definition::script_section_type_name): Ditto.
9728 (Script_sections::output_section_name): Add new parameter
9729 PSECTION_TYPE for returning script section type. Pass it to
9730 section elements. Handle discard sections.
9731 (Sort_output_sections::operator()): Handle NOLOAD sections.
9732 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9733 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9734 returning script section type.
9735 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9736 INFO and NOLOAD.
9737 * yyscript.y (union): Add new field SECTION_TYPE.
9738 (COPY, DSECT, INFO, NOLOAD): New tokens.
9739 (opt_address_and_section_type): Change type to output_section_header.
9740 (section_type): New non-terminal
9741 (section_header): Handle section type.
2253bfba 9742 (opt_address_and_section_type): Return section type value.
4dbd9faf 9743
721ea635
L
97442010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9745
9746 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9747 * testsuite/plugin_common_test_2.c (foo): Likewise.
9748
6bf924b0
DK
97492010-04-08 Doug Kwan <dougkwan@google.com>
9750
9751 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9752 Output_merge_data.
9753 * output.cc (Output_section::add_merge_input_section): Simplify
9754 code and return status of Output_merge_base::add_input_section.
e1df38aa 9755 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9756 returns true.
9757
24af6f92
DK
97582010-04-07 Doug Kwan <dougkwan@google.com>
9759
9760 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9761 if section is marked as containing instructions but has no mapping
9762 symbols.
9763 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9764 correct section index.
9765 (Arm_relobj::find_linked_text_section): Ditto.
9766
00698fc5
CC
97672010-04-07 Cary Coutant <ccoutant@google.com>
9768
9769 * archive.cc (include_member): Destroy Read_symbols_data object before
9770 releasing file.
9771 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9772 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9773 (Read_symbols_data::~Read_symbols_data) New destructor.
9774 (Section_relocs::Section_relocs) New constructor.
9775 (Section_relocs::~Section_relocs) New destructor.
9776 (Read_relocs_data::Read_relocs_data) New constructor.
9777 (Read_relocs_data::~Read_relocs_data) New destructor.
9778 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9779 pointers to NULL after deleting.
9780
7296d933
DK
97812010-04-07 Doug Kwan <dougkwan@google.com>
9782
9783 * arm.cc: Replace "endianity" with "endianness" in comments.
9784 (Arm_exidx_cantunwind): Ditto.
9785 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9786 (Arm_relobj::merge_flags_and_attributes): New method.
9787 (Arm_relobj::merge_flags_and_attributes_): New data member.
9788 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9789 (Arm_relobj::scan_sections_for_stubs): Ditto.
9790 (Arm_relobj::do_read_symbols): Check to see if we really want to
9791 merge processor-specific flags and attributes. Exit early if
9792 an object is empty except for section names and the undefined symbol.
9793 (Target_arm::do_finalize_sections): Move check for ELF format to
9794 Arm_relobj::do_read_symbols. Merge processor specific flags and
9795 attributes from a regular object only when we have determined that
9796 it is aapropriate. Do not create an .ARM.attributes section in
9797 output if there is no regular input object.
9798 (Target_arm::merge_processor_specific_flags): Check
9799 --warn-mismatch before printing any error.
9800 (Target_arm::merge_object_attributes): Ditto.
9801 * gold.cc (queue_middle_tasks): Handle the case in which there is
9802 no regular object in input.
9803 * options.cc (General_options::parse_EB): New method.
9804 (General_options::parse_EL): Same.
9805 (General_options::General_options): Initialize endianness_.
9806 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9807 New options.
9808 (General_options::Endianness): New enum.
9809 (General_options::endianness): New method.
9810 (General_options::endianness_): New data member.
9811 * parameters.cc (Parameters::set_options): Check target endianness.
9812 (Parameters::set_target_once): Ditto.
9813 (Parameters::check_target_endianness): New method.
9814 (parameters_force_valid_target): If either -EL or -EB is specified,
9815 use it to define endianness of default target.
9816 * parameters.h (Parameters::check_target_endianness): New method
9817 declaration.
9818 * target.h (class Target): Change "endianity" to "endianness"
9819 in comments.
9820
efc8d4f2
RW
98212010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9822
9823 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9824 * configure: Regenerate.
9825 * Makefile.in: Regenerate.
9826 * testsuite/Makefile.in: Regenerate.
9827
be234d88
CC
98282010-04-06 Cary Coutant <ccoutant@google.com>
9829
9830 gcc PR lto/42757
9831 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9832 prevailing definitions of common symbols.
9833 * testsuite/plugin_test_6.sh: New test case.
9834 * testsuite/plugin_common_test_1.c: New test case.
9835 * testsuite/plugin_common_test_2.c: New test case.
9836 * testsuite/Makefile.am (plugin_test_6): New test case.
9837 * testsuite/Makefile.in: Regenerate.
9838
bd32c6bd
NC
98392010-04-06 Nick Clifton <nickc@redhat.com>
9840
9841 * po/vi.po: New Vietnamese translation.
9842
323c532f
DK
98432010-03-30 Doug Kwan <dougkwan@google.com>
9844
9845 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9846
4fcd97eb
DK
98472010-03-25 Doug Kwan <dougkwan@google.com>
9848
9849 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9850 to avoid a conversion warning on a 32-bit host.
9851
4ebf39db
ILT
98522010-03-24 Ian Lance Taylor <iant@google.com>
9853
9854 * testsuite/script_test_3.t: Add a TLS segment.
9855 * testsuite/Makefile.am (check_PROGRAMS): Add
9856 tls_phdrs_script_test.
9857 (tls_phdrs_script_test_SOURCES): Define.
9858 (tls_phdrs_script_test_DEPENDENCIES): Define.
9859 (tls_phdrs_script_test_LDFLAGS): Define.
9860 (tls_phdrs_script_test_LDADD): Define.
9861 * testsuite/Makefile.in: Rebuild.
9862
4a599bdd
CC
98632010-03-23 Cary Coutant <ccoutant@google.com>
9864
9865 * fileread.cc (find_or_make_view): Fix comment.
9866
6c93b22c
ILT
98672010-03-23 Ian Lance Taylor <iant@google.com>
9868
9869 * script-sections.cc (class Orphan_section_placement): Define
9870 PLACE_TLS and PLACE_TLS_BSS.
9871 (Orphan_section_placement::Orphan_section_placement): Initialize
9872 new places.
9873 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9874 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9875 (tls_script_test_SOURCES): Define.
9876 (tls_script_test_DEPENDENCIES): Define.
9877 (tls_script_test_LDFLAGS): Define.
9878 (tls_script_test_LDADD): Define.
9879 * testsuite/Makefile.in: Rebuild.
9880
a2c7281b
DK
98812010-03-22 Doug Kwan <dougkwan@google.com>
9882
9883 * arm.cc (Arm_relocate_functions::abs8,
9884 Arm_relocate_functions::abs16): Use correct check for overflow
9885 specified in the ARM ELF specs.
9886 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9887 target of a BLX instruction specially.
9888 (Reloc_stub::stub_type_for_reloc): Ditto.
9889 (Relocate::relocate): Use symbolic names instead of numeric relocation
9890 codes to report error.
9891 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9892 workaround.
9893 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9894 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9895 thumb2_blx_out_of_range.stdout
9896 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9897 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9898 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9899 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9900 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9901 thumb2_blx_in_range, thumb2_blx_in_range.o,
9902 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9903 thumb2_blx_out_of_range.o): New rules.
2e702c99 9904 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9905 thumb2_blx_in_range and thumb2_blx_out_of_range.
9906 * testsuite/Makefile.in: Regenerate.
9907 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9908 * testsuite/thumb_blx_in_range.s: New file.
9909 * testsuite/thumb_blx_out_of_range.s: New file.
9910
b0193076
RÁE
99112010-03-22 Rafael Espindola <espindola@google.com>
9912
9913 * archive.cc (Should_include): Move to archive.h.
9914 (should_include_member): Make it a member of Archive.
9915 (Lib_group): New.
9916 (Add_lib_group_symbols): New.
9917 * archive.h: Include options.h.
9918 (Archive_member): Moved from Archive.
9919 (Should_include): Moved from archive.cc.
9920 (Lib_group): New.
9921 (Add_lib_group_symbols): New.
9922 * dynobj.cc (do_should_include_member): New.
9923 * dynobj.h (do_should_include_member): New.
9924 * gold.cc (queue_initial_tasks): Update call to queue.
9925 * main.cc (main): Print lib group stats.
9926 * object.cc (do_should_include_member): New.
9927 * object.h: Include archive.h.
9928 (Object::should_include_member): New.
9929 (Object::do_should_include_member): New.
9930 (Sized_relobj::do_should_include_member): New.
9931 * options.cc (General_options::parse_start_lib): New.
9932 (General_options::parse_end_lib): New.
9933 (Input_arguments::add_file): Handle lib groups.
9934 (Input_arguments::start_group): Check we are not in a lib.
9935 (Input_arguments::start_lib): New.
9936 (Input_arguments::end_lib): New.
9937 * options.h (General_options): Add start_lib and end_lib.
9938 (Input_argument::lib_): New.
9939 (Input_argument::lib): New.
9940 (Input_argument::is_lib): New.
9941 (Input_file_lib): New.
9942 (Input_arguments::in_lib_): New.
9943 (Input_arguments::in_lib): New.
9944 (Input_arguments::start_lib): New.
9945 (Input_arguments::end_lib_): New.
9946 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9947 in unused members as preempted.
9948 (Sized_pluginobj::do_should_include_member): New.
9949 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9950 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9951 return the blocker.
9952 (Read_symbols::do_whole_lib_group): New.
9953 (Read_symbols::do_lib_group): New.
9954 (Read_symbols::do_read_symbols): Handle lib groups.
9955 (Read_symbols::get_name): Handle lib groups.
9956 * readsyms.h (Read_symbols): Add an archive member pointer.
9957 (Read_symbols::do_whole_lib_group): New.
9958 (Read_symbols::do_lib_group): New.
9959 (Read_symbols::member_): New.
9960 * script.cc (read_input_script): Update call to queue_soon.
9961
d099120c
DK
99622010-03-19 Doug Kwan <dougkwan@google.com>
9963
9964 * arm.cc (Stub_table::Stub_table): Initialize new data members
9965 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9966 (Stub_table::add_reloc_stub): Assign stub offset and update
9967 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9968 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9969 New data members.
2e702c99 9970 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9971 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9972 instead of going over all reloc stubs.
2e702c99 9973 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9974 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9975 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9976 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9977 Stringpool_template::offset_.
9978 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9979 Stringpool_template::offset_ to zero.
9980
1aa37384
DK
99812010-03-15 Doug Kwan <dougkwan@google.com>
9982
9983 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9984 offset_.
9985 (Stringpool_template::new_key_offset): New method.
9986 (Stringpool_template::add_string): Assign offsets when adding new
9987 strings.
9988 (Stringpool_template::set_string_offsets): Do not set string offsets
9989 when not optimizing.
9990 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9991 member size_.
2e702c99
RM
9992 (Chunked_vector::clear): Clear size_.
9993 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9994 (Chunked_vector::size): Return size_.
9995 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9996 (Chunked_vector::size_): New data member.
1aa37384
DK
9997 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9998 (Stringpool_template::new_key_offset): New method declaration.
9999 (Stringpool_template::offset_): New data member.
10000
b672b057
RÁE
100012010-03-15 Rafael Espindola <espindola@google.com>
10002
10003 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10004 Add_symbols' constructor.
10005 * readsyms.h (Add_symbols): Remove the input_group member.
10006
b6848d3c
ILT
100072010-03-10 Ian Lance Taylor <iant@google.com>
10008
10009 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10010 target to ask whether a reference to a symbol requires a stack
10011 split.
10012 * target.h (Target::is_call_to_non_split): New function.
10013 (Target::do_is_call_to_non_split): Declare virtual function.
10014 * target.cc: Include "symtab.h".
10015 (Target::do_is_call_to_non_split): New function.
10016 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10017
a2a5469e
CC
100182010-03-10 Cary Coutant <ccoutant@google.com>
10019
10020 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10021 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10022 (File_read::open[2]): Add whole_file_view_ to list of views.
10023 (File_read::make_view): Remove test of whole_file_view_.
10024 (File_read::find_or_make_view): Create whole_file_view_ if
10025 necessary.
10026 (File_read::clear_views): Replace bool parameter with enum;
10027 adjust all callers. Don't delete views with permanent data;
10028 do delete cached views and views from archives if
10029 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10030 if clearing the corresponding view.
10031 * fileread.h (File_read::Clear_views_mode): New enum.
10032 (File_read::View::is_permanent_view): New method.
10033 (File_read::clear_views): Replace bool parameter
10034 with enum; adjust all callers.
10035 * options.h (General_options): Change keep_files_mapped option;
10036 add map_whole_files.
10037 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10038 releasing the file.
10039 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10040 the file.
10041
8861f32b
DM
100422010-03-10 David S. Miller <davem@davemloft.net>
10043
10044 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10045
d62d0f5f
ST
100462010-03-09 Sriraman Tallam <tmsriram@google.com>
10047
10048 * icf.cc (get_section_contents): Add '@' marker after processing the
10049 merge reloc.
10050
9177756d
DK
100512010-03-08 Doug Kwan <dougkwan@google.com>
10052
10053 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10054 due to a conversion warning.
10055 (Arm_relobj::update_output_local_symbol_count): Check for local
10056 symbol with unset output index.
10057
9e9e071b
ILT
100582010-03-05 Ian Lance Taylor <iant@google.com>
10059
10060 * options.h (class General_options): Add --spare-dynamic-tags.
10061 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10062 --spare-dynamic-tags.
10063
a81ee015
ILT
100642010-03-05 Ian Lance Taylor <iant@google.com>
10065
10066 * incremental.cc: Include "libiberty.h".
10067
44ec90b9
RO
100682010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10069
10070 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10071 function, is_info_ member.
10072 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10073 (Versions::Versions): Update caller.
10074 (Versions::define_base_version): Likewise.
10075 (Versions::add_def): Likewise.
10076
0897ed3b
ST
100772010-03-03 Sriraman Tallam <tmsriram@google.com>
10078
10079 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10080 (Scan::possible_function_pointer_reloc): New function.
10081 (Scan::local_reloc_may_be_function_pointer): Change to call
10082 possible_function_pointer_reloc.
10083 (Scan::global_reloc_may_be_function_pointer): Ditto.
10084 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10085 relocations in ".data.rel.ro._ZTV" section.
10086 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10087 * testsuite/icf_safe_so_test.cc: Ditto.
10088 * testsuite/icf_safe_test.cc: Ditto.
10089 * testsuite/icf_safe_test.sh: Ditto.
10090
d3bbad62
ILT
100912010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10092 Ian Lance Taylor <iant@google.com>
10093
10094 * target-reloc.h (relocate_section): Check the symbol table index
10095 for -1U before setting the local symbol index.
10096 (scan_relocatable_relocs): If copying the relocation, record that
10097 the local symbol is required.
10098 * object.h (Symbol_value::is_output_symtab_index_set): New
10099 function.
10100 (Symbol_value::may_be_discarded_from_output_symtab): New
10101 function.
10102 (Symbol_value::has_output_symtab_entry): New function.
10103 (Symbol_value::needs_output_symtab_entry): Remove.
10104 (Symbol_value::output_symtab_index): Make sure the symbol index is
10105 set.
10106 (Symbol_value::set_output_symtab_index): Make sure the symbol
10107 index is not set. Make sure the new index is valid.
10108 (Symbol_value::set_must_have_output_symtab_entry): New function.
10109 (Symbol_value::has_output_dynsym_entry): New function.
10110 (Symbol_value::set_output_dynsym_index): Make sure the new index
10111 is valid.
10112 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10113 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10114 local symbol if permitted.
10115 (Sized_relobj::do_finalize_local_symbols): Call
10116 is_output_symtab_index_set rather than needs_output_symtab_entry.
10117 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10118 rather than needs_output_symtab_entry. Call
10119 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10120 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10121 is_output_symtab_index_set rather than needs_output_symtab_entry.
10122 * testsuite/discard_locals_relocatable_test.c: New file.
10123 * testsuite/discard_locals_test.sh: Test -r.
10124 * testsuite/Makefile.am (check_DATA): Add
10125 discard_locals_relocatable_test1.syms,
10126 discard_local_relocatable_test2.syms.
10127 (MOSTLYCLEANFILES): Likewise. Also add
10128 discard_locals_relocatable_test1.lout and
10129 discard_locals_relocatable_test2.out.
10130 (discard_locals_relocatable_test1.syms): New target.
10131 (discard_locals_relocatable_test.o): New target.
10132 (discard_locals_relocatable_test1.out): New target.
10133 (discard_locals_relocatable_test2.syms): New target.
10134 (discard_locals_relocatable_test2.out): New target.
10135 (various): Add missing ../ld-new dependencies.
10136 * testsuite/Makefile.in: Rebuild.
10137
7e8ccf26
NC
101382010-03-03 Nick Clifton <nickc@redhat.com>
10139
10140 * po/fi.po: New Finnish translation.
10141
2a0ff005
DK
101422010-03-01 Doug Kwan <dougkwan@google.com>
10143
10144 * layout.cc (Layout::Layout): Force section types of .init_array*,
10145 .preinit_array* and .fini_array* sections.
10146 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10147 Fix check of return value of std::string::find.().
10148 (Output_section::Input_section_sort_compare::operator()): Remove
10149 comment about .init_array.
10150 (Output_section::Input_section_sort_init_fini_compare::operator()):
10151 New method.
10152 (Output_section::sort_attached_input_sections): Handle .init_array
10153 and .fini_array specially.
10154 * output.h (Output_section::Inut_section_sort_compare): Update
10155 comment.
10156 (Output_section::Input_section_sort_init_fini_compare): New struct.
10157
c3e4ae29
DK
101582010-02-26 Doug Kwan <dougkwan@google.com>
10159
10160 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10161 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10162 * testsuite/debug_msg.sh: Avoid matching source line number for
10163 use of global variable undef_int.
10164
2fd9ae7a
DK
101652010-02-26 Doug Kwan <dougkwan@google.com>
10166
10167 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10168 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10169 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10170 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10171 * options.cc (General_options::General_options): Initialize member
10172 fix_v4bx_.
10173 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10174 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10175 and rm_no_fix_v4bx.stdout
10176 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10177 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10178 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10179 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10180 and arm_no_fix_v4bx.
10181 * Makefile.in: Regenerate.
10182 * testsuite/arm_fix_v4bx.s: New file.
10183 * testsuite/arm_fix_v4bx.sh: Ditto.
10184
67ec7d0b
DK
101852010-02-24 Doug Kwan <dougkwan@google.com>
10186
10187 * arm.cc (Target_arm::got_section): Make the .got section the first
10188 non RELRO section in the data segment.
10189 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10190 suffixes of section names.
10191
10165461
DK
101922010-02-24 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10195 flags and attributes merging if an input file is a binary file.
10196 * fileread.cc (Input_file::open): Record format of original file.
10197 * fileread.h (Input_file::Format): New enum type.
2e702c99 10198 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10199 (Input_file::format): New method definition.
10200 (Input_file::format_):: New data member.
10201
4a54abbb
DK
102022010-02-24 Doug Kwan <dougkwan@google.com>
10203
10204 * arm.cc (Arm_output_data_got): New class.
10205 (ARM_TCB_SIZE): New constant
10206 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10207 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10208 If user uses a script with a SECTIONS clause, issue only a warning
10209 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10210 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10211 garbage collection.
10212 (Target_arm::got_mode_index_entry): Handle static linking.
10213 (Target_arm::Scan::local): Ditto.
10214 (Target_arm::Scan::global): Ditto.
10215 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10216 all incorrectly implemented relocations.
e1df38aa 10217 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10218 Arm_output_section::fix_exidx_coverage.
10219 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10220 from ".ARM.exidx." and ".ARM.extab.".
10221
ca419a6f
ILT
102222010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10223
10224 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10225 section if it does not already exist.
10226 * attributes.cc (Attributes_section_data::Attributes_section_data):
10227 Don't crash if size is zero.
10228
135b9c78
ILT
102292010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10230 Ian Lance Taylor <iant@google.com>
10231
10232 * gold.cc (queue_middle_tasks): If no input files were opened,
10233 exit.
10234 * workqueue.h (Task_function::Task_function): Assert that there is
10235 a blocker.
10236
bb0bfe4f
DK
102372010-02-22 Doug Kwan <dougkwan@google.com>
10238
10239 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10240 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10241 types to avoid warnings due to different uint64_t implementations
10242 on different hosts.
10243
2a2b6d42
DK
102442010-02-21 Doug Kwan <dougkwan@google.com>
10245
10246 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10247 handling of the maximum backward branch offset.
2e702c99 10248 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10249 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10250 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10251 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10252 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10253 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10254 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10255 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10256 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10257 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10258 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10259 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10260 thumb2_bl_out_of_range.o): New rules.
10261 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10262 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10263 thumb2_bl_out_of_range
10264 * testsuite/Makefile.in: Regenerate.
10265 * testsuite/arm_bl_in_range.s: New file.
10266 * testsuite/arm_bl_out_of_range.s: Ditto.
10267 * testsuite/arm_branch_in_range.sh: Ditto.
10268 * testsuite/arm_branch_range.t: Ditto.
10269 * testsuite/thumb2_branch_range.t: Ditto.
10270 * testsuite/thumb_bl_in_range.s: Ditto.
10271 * testsuite/thumb_bl_out_of_range.s: Ditto.
10272 * testsuite/thumb_branch_range.t: Ditto.
10273
b487ad64
ST
102742010-02-20 Sriraman Tallam <tmsriram@google.com>
10275
10276 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10277 Add reloc offset information.
10278 * icf.cc (get_section_contents): Change iterators to point to the new
10279 vectors. Add reloc offset information to the contents.
10280 * icf.h (Icf::Sections_reachable_info): New typedef.
10281 (Icf::Sections_reachable_list): New typedef.
10282 (Icf::Offset_info): New typedef.
10283 (Icf::Reloc_info): New struct typedef.
10284 (Icf::Reloc_info_list): New typedef.
10285 (Icf::symbol_reloc_list): Delete method.
10286 (Icf::addend_reloc_list): Delete method.
10287 (Icf::section_reloc_list): Delete method.
10288 (Icf::reloc_info_list): New method.
10289 (Icf::reloc_info_list_): New member.
10290
f96accdf
DK
102912010-02-19 Doug Kwan <dougkwan@google.com>
10292
10293 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10294 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10295 * arm.cc (Arm_relocation_functions): New forward declaration.
10296 (Target_arm::Target_arm): Initialize new data members
10297 got_mod_index_offset_ and tls_base_symbol_defined_.
10298 (Target_arm::Relocate::relocate_tls): New method.
10299 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10300 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10301 New methods.
2e702c99 10302 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10303 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10304 (Target_arm::got_mod_index_offset_,
10305 Target_arm::tls_base_symbol_defined_): New data members.
10306 (Target_arm::Scan::local, Target::Scan::global,
10307 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10308 relocations.
10309
c8761b9a
DK
103102010-02-18 Doug Kwan <dougkwan@google.com>
10311
10312 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10313 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10314 text section as a parameter becuase some broken tools may not set
10315 the link in section header.
10316 (Target_arm::has_got_section): New method.
10317 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10318 without any mapping symbol as data only. Remove warning.
10319 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10320 link in its section header, try to discover the link by inspecting the
10321 REL31 relocation at the beginning of the section.
10322 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10323 in error message.
10324 (Target_arm::Scan::global): Treat any reference to the symbol
10325 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10326
21bb3914
ST
103272010-02-12 Sriraman Tallam <tmsriram@google.com>
10328
10329 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10330 (Scan::global_reloc_may_be_function_pointer): New function.
10331 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10332 (Scan::global_reloc_may_be_function_pointer): New function.
10333 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10334 (Scan::global_reloc_may_be_function_pointer): New function.
10335 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10336 (Scan::global_reloc_may_be_function_pointer): New function.
10337 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10338 (Scan::global_reloc_may_be_function_pointer): New function.
10339 (Scan::possible_function_pointer_reloc): New function.
10340 (Target_x86_64::can_check_for_function_pointers): New function.
10341 * gc.h (gc_process_relocs): Scan relocation types to determine if
10342 function pointers were taken for targets that support it.
10343 * icf.cc (Icf::find_identical_sections): Include functions for
10344 folding in safe ICF whose pointer is not taken.
10345 * icf.h (Secn_fptr_taken_set): New typedef.
10346 (fptr_section_id_): New member.
10347 (section_has_function_pointers): New function.
10348 (set_section_has_function_pointers): New function.
10349 (check_section_for_function_pointers): New function.
10350 * options.h: Fix comment for safe ICF option.
10351 * target.h (can_check_for_function_pointers): New function.
10352 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10353 Modify icf_safe_test for X86-64.
10354 * testsuite/Makefile.in: Regenerate.
10355 * testsuite/icf_safe_so_test.cc: New file.
10356 * testsuite/icf_safe_so_test.sh: New file.
10357 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10358 (main): Change to take pointer to function kept_func_3.
10359 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10360 folding is done correctly for X86-64.
10361
0da6fa6c
DM
103622010-02-12 David S. Miller <davem@davemloft.net>
10363
10364 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10365 is_symbolless parameter.
10366 (Output_reloc<SHT_REL>::is_symbolless): New.
10367 (Output_reloc<SHT_REL>::is_symbolless_): New.
10368 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10369 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10370 (Output_reloc<SHT_RELA>::is_symbolless): New.
10371 (Output_data_reloc::add_global): Handle is_symbolless.
10372 (Output_data_reloc::add_global_relative): Likewise.
10373 (Output_data_reloc::add_local): Likewise.
10374 (Output_data_reloc::add_local_relative): Likewise.
10375 (Output_data_reloc::add_symbolless_global_addend): New.
10376 (Output_data_reloc::add_symbolless_local_addend): New.
10377 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10378 is_symbolless.
10379 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10380 instead of ->is_relative_
10381 (Output_reloc::write): Likewise.
10382 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10383 (Output_reloc::write_rel): Simplify.
10384
10385 * sparc.cc (Target_sparc::Scan::local): Use
10386 ->add_symbolless_local_addend as needed.
10387 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10388 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10389 based upon relocation offset.
10390
e4782e83
DK
103912010-02-11 Doug Kwan <dougkwan@google.com>
10392
10393 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10394 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10395 beginning of function.
10396 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10397 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10398 parameter is_32bit in calls to should_apply_static_reloc.
10399 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10400 (check_DATA): Add arm_abs_global.stdout.
10401 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10402 arm_abs_global.stdout): New rules.
10403 (MOSTLLYCLEANFILES): Add arm_abs_global
10404 * Makefile.in: Regenerate.
10405 * testsuite/arm_abs_global.s: New file.
10406 * testsuite/arm_abs_global.sh: Ditto.
10407 * testsuite/arm_abs_lib.s: Ditto.
10408
93ceb764
ILT
104092010-02-11 Ian Lance Taylor <iant@google.com>
10410
10411 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10412 Read_relocs task.
10413 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10414 Allocate_commons_task first.
10415 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10416 task, rather than symtab_lock_.
10417 (Gc_process_relocs::~Gc_process_relocs): New function.
10418 (Gc_process_relocs::is_runnable): Check this_blocker_.
10419 (Gc_process_relocs::locks): Use next_blocker_ rather than
10420 blocker_.
10421 (Scan_relocs::~Scan_relocs): New function.
10422 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10423 symtab_lock_.
10424 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10425 next_blocker_.
10426 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10427 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10428 constructor accordingly.
10429 (class Gc_process_relocs): Likewise.
10430 (class Scan_relocs): Likewise.
10431 * common.h (class Allocate_commons_task): Remove symtab_lock_
10432 field, and corresponding constructor parameter.
10433 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10434 symtab_lock_.
10435 (Allocate_commons_task::locks): Likewise.
10436
114dfbe1
ILT
104372010-02-11 Ian Lance Taylor <iant@google.com>
10438
10439 * gold-threads.h (class Once): Define.
10440 (class Initialize_lock): Rewrite as child of Once.
10441 * gold-threads.cc (class Once_initialize): Define.
10442 (once_pointer_control): New static variable.
10443 (once_pointer, once_arg): New static variables.
10444 (c_run_once): New static function.
10445 (Once::Once, Once::run_once, Once::internal_run): New functions.
10446 (class Initialize_lock_once): Remove.
10447 (initialize_lock_control): Remove.
10448 (initialize_lock_pointer): Remove.
10449 (initialize_lock_once): Remove.
10450 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10451 (Initialize_lock::initialize): Rewrite.
10452 (Initialize_lock::do_run_once): New function.
10453 * archive.cc (Archive::interpret_header): Only clear name if it is
10454 not already empty.
10455 * fileread.cc: Include "gold-threads.h"
10456 (file_counts_lock): New static variable.
10457 (file_counts_initialize_lock): Likewise.
10458 (File_read::release): Only increment counts when using --stats.
10459 Use a lock around the increment.
10460 * parameters.cc (class Set_parameters_target_once): Define.
10461 (set_parameters_target_once): New static variable.
10462 (Parameters::Parameters): Move here from parameters.h.
10463 (Parameters::set_target): Rewrite.
10464 (Parameters::set_target_once): New function.
10465 (Parameters::clear_target): Move here and rewrite.
10466 * parameters.h (class Parameters): Update declarations. Add
10467 set_parameters_target_once_ field.
10468 (Parameters::Parameters): Move to parameters.cc.
10469 (Parameters::clear_target): Likewise.
10470 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10471 task.
10472 (Start_group::~Start_group): New function.
10473 (Start_group::is_runnable): New function.
10474 (Start_group::locks, Start_group::run): New functions.
10475 (Finish_group::run): Change saw_undefined to size_t.
10476 * readsyms.h (class Start_group): Define.
10477 (class Finish_group): Change saw_undefined_ field to size_t.
10478 (Finish_group::Finish_group): Remove saw_undefined and
10479 this_blocker parameters. Change all callers.
10480 (Finish_group::set_saw_undefined): New function.
10481 (Finish_group::set_blocker): New function.
10482 * symtab.h (class Symbol_table): Change saw_undefined to return
10483 size_t. Change saw_undefined_ field to size_t.
10484 * target-select.cc (Set_target_once::do_run_once): New function.
10485 (Target_selector::Target_selector): Initialize set_target_once_
10486 field. Don't initialize lock_ and initialize_lock_ fields.
10487 (Target_selector::instantiate_target): Rewrite.
10488 (Target_selector::set_target): New function.
10489 * target-select.h (class Set_target_once): Define.
10490 (class Target_selector): Update declarations. Make
10491 Set_target_once a friend. Remove lock_ and initialize_lock_
10492 fields. Add set_target_once_ field.
10493
fa17a3f4
ILT
104942010-02-10 Ian Lance Taylor <iant@google.com>
10495
10496 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10497 queueing any tasks.
10498 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10499 (queue_middle_tasks): Add all blockers before queueing any tasks.
10500 (queue_final_tasks): Likewise.
10501 * token.h (Task_token::add_blockers): New function.
10502 * object.h (Input_objects::number_of_relobjs): New function.
10503
c7177d31
ILT
105042010-02-10 Ian Lance Taylor <iant@google.com>
10505
5de0e392
ILT
10506 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10507 shared, not if not position independent.
10508 * x86_64.cc (Relocate::relocate_tls): Likewise.
10509 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10510 (tls_pie_pic_test): New target.
10511 * testsuite/Makefile.in: Rebuild.
10512
c7177d31
ILT
10513 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10514 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10515 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10516 * testsuite/Makefile.in: Rebuild.
10517
684b268a
DM
105182010-02-09 David S. Miller <davem@davemloft.net>
10519
10520 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10521 R_SPARC_RELATIVE using ->add_local_relative().
10522 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10523
612a8d3d
DM
10524 * output.h (Output_data_dynamic::add_section_size): New method
10525 that takes two Output_data objects.
10526 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10527 entry param. Handle it in initializers.
10528 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10529 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10530 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10531 arg.
10532 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10533 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10534 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10535 for dynrel_includes_plt.
10536 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10537 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10538 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10539 before .rela.plt
10540 (Target_sparc::do_finalize_sections): Update to pass true for
10541 dynrel_includes_plt.
10542 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10543 output before .rela.plt
10544 (Target_powerpc::do_finalize_sections): Update to pass true for
10545 dynrel_includes_plt when 32-bit.
10546
cb1be87e
DK
105472010-02-08 Doug Kwan <dougkwan@google.com>
10548
10549 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10550 method.
10551 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10552 Arm_relobj::scan_section_for_cortex_a8_stubs,
10553 Arm_relobj::do_relocation_section): Instead of calling
10554 Output_section::output_address, use faster
10555 Arm_relobj::simple_input_section_output_address.
10556
705b5121
DM
105572010-02-08 David S. Miller <davem@davemloft.net>
10558
10559 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10560 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10561 relocation helper function.
10562
024c4466
DM
10563 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10564 just like R_SPARC_GOT{10,13,22}.
10565 (Target_sparc::Scan::local): Likewise.
10566 (Target_sparc::Relocate:relocate): Likewise.
10567
9109c078
ILT
105682010-02-06 Ian Lance Taylor <iant@google.com>
10569
10570 * configure.ac: Rewrite targetobjs duplicate removal code to use
10571 only shell constructs.
10572 * configure: Rebuild.
10573
cf846138
DK
105742010-02-05 Doug Kwan <dougkwan@google.com>
10575
10576 PR 11247
10577 * arm.cc (Arm_relobj::section_is_scannable): New method.
10578 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10579 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10580
6cfaf60b
DK
105812010-02-04 Doug Kwan <dougkwan@google.com>
10582
10583 PR 11247
10584 * arm-reloc-property.cc (cstdio): Include.
10585 * configure.ac (targetobjs): Remove duplicates.
10586 * configure: Regenerate.
10587 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10588 big and little endian version for a given address size.
10589
5c57f1be
DK
105902010-02-03 Doug Kwan <dougkwan@google.com>
10591
10592 * arm-reloc-property.cc
10593 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10594 definition.
10595 * arm-reloc-property.h
10596 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10597 New method definition.
10598 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10599 declaration.
10600 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10601 overflow to N.
10602 (GOT_PREL): Change implemented to Y.
10603 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10604 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10605 (Arm_relocate_functions::movw_abs_nc): Remove method.
10606 (Arm_relocate_functions::movt_abs): Ditto.
10607 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10608 (Arm_relocate_functions::thm_movt_abs): Ditto.
10609 (Arm_relocate_functions::movw_rel_nc): Ditto.
10610 (Arm_relocate_functions::movw_rel): Ditto.
10611 (Arm_relocate_functions::movt_rel): Ditto.
10612 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10613 (Arm_relocate_functions:thm_movw_rel): Ditto.
10614 (Arm_relocate_functions:thm_movt_rel): Ditto.
10615 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10616 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10617 New method definitions.
10618 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10619 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10620 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10621 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10622 (Target_arm::Relocate::relocate): Check for non-static or
10623 unimplemented relocation code and exit early. Change calls to
10624 Target_arm::reloc_uses_thumb_bit and
10625 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10626 instead. Refactor code to handle similar relocations to increase
10627 code sharing. Remove check for unsupported relocation code in switch
10628 statement.
10629 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10630 relocation property table to find out size. Change error message to
10631 print out the name of a relocation code instead of the numeric value.
10632 (Target_arm::scan_reloc_for_stub): Use relocation property table
10633 instead of calling Target_arm::reloc_uses_thumb_bit().
10634
218c5831
DK
106352010-02-02 Doug Kwan <dougkwan@google.com>
10636
10637 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10638 types of relaxed input section.
10639
0d31c79d
DK
106402010-02-02 Doug Kwan <dougkwan@google.com>
10641
10642 * Makefile.am (HFILES): Add arm-reloc-property.h.
10643 (DEFFILES): New.
2e702c99
RM
10644 (TARGETSOURCES): Add arm-reloc-property.cc
10645 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10646 (libgold_a_SOURCES): $(DEFFILES)
10647 * Makefile.in: Regenerate.
10648 * arm-reloc-property.cc: New file.
10649 * arm-reloc-property.h: New file.
10650 * arm-reloc.def: New file.
10651 * arm.cc: Update comments.
10652 (arm-reloc-property.h): New included header.
10653 (arm_reloc_property_table): New global variable.
10654 (Target_arm::do_select_as_default_target): New method definition.
10655 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10656 arm-reloc-property to targ_extra_obj.
10657 * parameters.cc (set_parameters_target): Call
10658 Target::select_as_default_target().
10659 * target.h (Target::select_as_default_target): New method definition.
10660 (Target::do_select_as_default_target): Same.
10661
546c7457
DK
106622010-02-01 Doug Kwan <dougkwan@google.com>
10663
10664 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10665 first_output_text_section_.
10666 (Arm_exidx_fixup::first_output_text_section): New method definition.
10667 (Arm_exidx_fixup::first_output_text_section_): New data member.
10668 (Arm_exidx_fixup::process_exidx_section): Record the first text
10669 output section seen.
10670 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10671 and entsize in output section header.
10672
11b861d5
DK
106732010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10674
10675 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10676 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10677 (Arm_relocate_functions::thm_alu11): New Method.
10678 (Arm_relocate_functions::thm_pc8): New Method.
10679 (Arm_relocate_functions::thm_pc12): New Method.
10680 (Target_arm::Scan::local): Handle the relocations.
10681 (Target_arm::Scan::global): Likewise.
10682 (Target_arm::Relocate::relocate): Likewise.
10683 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10684
c9a2c125
DK
106852010-01-29 Doug Kwan <dougkwan@google.com>
10686
10687 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10688 of relocation types as ld.
10689
1521477a
DK
106902010-01-29 Doug Kwan <dougkwan@google.com>
10691
10692 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10693 to public.
10694 (Arm_relocate_functions::thumb_branch_common): Ditto.
10695 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10696 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10697 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10698 Arm_relocate_functions::jump24): Remove.
10699 (Target_arm::Relocate::relocate): Adjust code to call
10700 Arm_relocation_functions::arm_branch_common and
10701 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10702 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10703
e7eca48c
DK
107042010-01-29 Doug Kwan <dougkwan@google.com>
10705
10706 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10707 output_local_symbol_count_needs_update_.
10708 (Arm_relobj::output_local_symbol_count_needs_update,
10709 Arm_relobj::set_output_local_symbol_count_needs_update,
10710 Arm_relobj::update_output_local_symbol_count): New methods.
10711 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10712 member.
10713 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10714 of pointed function as in a R_ARM_PREL31 relocation.
10715 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10716 for output local symbol count updating.
10717 (Target_arm::do_relax): Update output local symbol counts in objects
10718 if necessary.
10719 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10720
02961d7e
ILT
107212010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10722
10723 * arm.cc: Added support for the ARM relocations:
10724 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10725 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10726 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10727 movw_prel_nc).
10728 (Arm_relocate_functions::movw_rel): New method.
10729 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10730 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10731 thm_movw_prel_nc).
10732 (Arm_relocate_functions::thm_movw_rel): New method.
10733 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10734 thm_movt_prel).
10735 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10736 relocations.
10737 (Target_arm::Scan::global): Likewise.
10738 (Target_arm::Relocate::relocate): Likewise.
10739 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10740 Likewise.
10741
b10d2873
ILT
107422010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10743
10744 * arm.cc: Added support for ARM group relocations.
10745 (Target_arm::reloc_needs_sym_origin): New method.
10746 (Arm_relocate_functions::calc_grp_kn): New method.
10747 (Arm_relocate_functions::calc_grp_residual): New method.
10748 (Arm_relocate_functions::calc_grp_gn): New method.
10749 (Arm_relocate_functions::arm_grp_alu): New Method.
10750 (Arm_relocate_functions::arm_grp_ldr): New Method.
10751 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10752 (Arm_relocate_functions::arm_grp_ldc): New Method.
10753 (Target_arm::Scan::local): Handle the ARM group relocations.
10754 (Target_arm::Scan::global): Likewise.
10755 (Target_arm::Relocate::relocate): Likewise.
10756 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10757 Likewise.
10758
2b328d4e
DK
107592010-01-26 Doug Kwan <dougkwan@google.com>
10760
10761 * arm.cc (set): Include.
10762 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10763 pointer type.
2e702c99 10764 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10765 (Arm_output_section::append_text_sections_to_list): New method.
10766 (Arm_output_section::fix_exidx_coverage): Ditto.
10767 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10768 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10769 Relobj::set_section_offset() instead of
10770 Sized_relobj::invalidate_section_offset().
2e702c99 10771 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10772 parameter for section headers. Ignore relocation sections for
10773 unallocated sections and EXIDX sections.
10774 (Target_arm::fix_exidx_coverage): New method.
10775 (Target_arm::output_section_address_less_than): New type.
10776 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10777 linked text section instead of the EXIDX section.
10778 (Arm_output_section::create_stub_group): Add an assertion to check
10779 that this is not an EXIDX output section.
10780 (Arm_output_section::append_text_sections_to_list): New method.
10781 (Arm_output_section::fix_exidx_coverage): Ditto.
10782 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10783 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10784 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10785 first pass.
10786 (Target_arm::fix_exidx_coverage): New method.
10787 * object.h (Relobj::set_output_section): New method.
10788 (Sized_relobj::invalidate_section_offset): Remove method.
10789 (Sized_relobj::do_invalidate_section_offset): Remove method.
10790 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10791
c7f3c371
DK
107922010-01-25 Doug Kwan <dougkwan@google.com>
10793
10794 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10795 Fix warning due to signed and unsigned comparison on a 32-bit host.
10796
8923b24c
DK
107972010-01-22 Doug Kwan <dougkwan@google.com>
10798
10799 * arm.cc (Target_arm::do_relax): Record an output section for section
10800 offset adjustment it contains any stub table that has changed.
10801 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10802 offsets in an output section if necessary.
10803 * output.cc (Output_section::Output_section): Initialize
10804 section_offsets_need_adjustments_.
10805 (Output_section::add_input_section_for_script): Renamed to
10806 Output_section::add_simple_input_section.
10807 (Output_section::save_states): Add a comment.
10808 (Output_section::discard_states): New method defintion.
10809 (Output_section::adjust_section_offsets): Same.
10810 * output.h (Output_section::add_input_section_for_script): Renamed to
10811 Output_section::add_simple_input_section.
10812 (Output_section::discard_states): New method declaration.
10813 (Output_section::adjust_section_offsets): Same.
10814 (Output_section::section_offsets_need_adjustment,
10815 Output_section::set_section_offsets_need_adjustment): New method
10816 definitions.
10817 (Output_section::section_offsets_need_adjustment_): New data member.
10818 * script-sections.cc
10819 (Output_section_element_input::set_section_address): Adjust code for
10820 renaming of Output_section::add_input_section_for_script.
10821 (Orphan_output_section::set_section_address): Same.
10822
9b2fd367
DK
108232010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10824
10825 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10826 Fix_v4bx enum values .
10827 * gold/options.h (General_options): New option definitions.
10828 (General_options::fix_v4bx): New method.
10829 (General_options::Fix_v4bx): New enum.
10830 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10831 (General_options::parse_fix_v4bx_interworking): New method.
10832
80d0d023
DK
108332010-01-22 Doug Kwan <dougkwan@google.com>
10834
10835 * arm.cc (Arm_exidx_fixup): New class.
10836
af2cdeae
DK
108372010-01-21 Doug Kwan <dougkwan@google.com>
10838
10839 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10840 classes.
10841 (Arm_exidx_section_offset_map): New type.
10842
993d07c1
DK
108432010-01-21 Doug Kwan <dougkwan@google.com>
10844
10845 * arm.cc (Arm_exidx_input_section): New class.
10846 (Arm_relobj::exidx_input_section_by_link,
10847 Arm_relobj::exidx_input_section_by_shndx,
10848 Arm_relobj::make_exidx_input_section): New methods.
10849 (read_arm_attributes_section): Remove.
10850 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10851 information about them.
10852 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10853 to here.
10854
5ac169d4
DK
108552010-01-20 Doug Kwan <dougkwan@google.com>
10856
10857 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10858 Input_section_specifier to Section_id.
10859 (Target_arm::new_arm_input_section: Adjust code for change of key
10860 type.
10861 (Target_arm::find_arm_input_section): Ditto.
10862 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10863 (Section_id): Remove.
10864 (Garbage_collection::Section_id_hash): Remove.
10865 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10866 (Section_id): Remove.
10867 (Icf::Section_id_hash): Remove.
10868 * object.h (Section_id, Const_section_id, Section_id_hash,
10869 Const_section_id_hash): New type definitions.
10870 * output.cc (Output_section::add_relaxed_input_section): Change to
10871 use Const_section_id instead of Input_section_specifier as key type.
10872 (Output_section::add_merge_input_section): Ditto.
10873 (Output_section::build_relaxation_map): Change to use Section_id
10874 instead of Input_section_specifier as key type.
2e702c99 10875 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10876 Ditto.
10877 (Output_section::convert_input_sections_to_relaxed_sections): Change
10878 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10879 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10880 (Output_section::find_relaxed_input_section): Ditto.
10881 * output.h (Input_section_specifier): Remove class.
10882 (Output_section::Output_section_data_by_input_section_map): Change
10883 key type to Const_section_id.
10884 (Output_section::Output_relaxed_input_section_by_input_section_map):
10885 Ditto.
10886 (Output_section::Relaxation_map): Change key type to Section_id.
10887
a2162063
ILT
108882010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10889
10890 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10891 (class Arm_v4bx_stub): New class.
10892 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10893 (Stub_factory::make_arm_v4bx_stub): New method.
10894 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10895 (Stub_table::empty): Handle v4bx stubs.
10896 (Stub_table::add_arm_v4bx_stub): New method.
10897 (Stub_table::find_arm_v4bx_stub): New method.
10898 (Arm_relocate_functions::v4bx): New method.
10899 (Target_arm::fix_v4bx): New method.
10900 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10901 (Stub_table::relocate_stubs): Likewise.
10902 (Stub_table::do_write): Likewise.
10903 (Stub_table::update_data_size_and_addralign): Likewise.
10904 (Stub_table::finalize_stubs): Likewise.
10905 (Target_arm::Scan::local): Likewise.
10906 (Target_arm::Scan::global): Likewise.
10907 (Target_arm::do_finalize_sections): Likewise.
10908 (Target_arm::Relocate::relocate): Likewise.
10909 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10910 Likewise.
10911 (Target_arm::scan_reloc_for_stub): Likewise.
10912 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10913
5696ab0b
ILT
109142010-01-19 Ian Lance Taylor <iant@google.com>
10915
10916 * output.cc (Output_section_headers::do_sized_write): Write large
10917 segment count to sh_info field.
10918 (Output_file_header::do_sized_write): For large segment count,
10919 write PN_XNUM to e_phnum field.
10920
800d0f56
ILT
109212010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10922
10923 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10924 (Arm_relocate_functions::thm_jump8): New function.
10925 (Arm_relocate_functions::thm_jump11): New function.
10926 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10927 R_ARM_THM_JUMP11.
10928 (Target_arm::Scan::global): Likewise.
10929 (Target_arm::Relocate::relocate): Likewise.
10930 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10931 Likewise.
10932
41263c05
DK
109332010-01-14 Doug Kwan <dougkwan@google.com>
10934
10935 * arm.cc (map, utility): Include headers.
10936 (Target_arm::apply_cortex_a8_workaround): New method.
10937 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10938 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10939 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10940 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10941 the --[no-]fix-cortex-a8 command line options.
10942 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10943 (Target_arm::relocate_stub): Use addend in instruction template.
10944 * options.h (DEFINE_bool): Set the user-set flag.
10945 (General_options): Add --[no-]-fix-cortex options.
10946 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10947 : Update fast look-up map after conversion.
41263c05 10948
459e9b03
ST
109492010-01-14 Sriraman Tallam <tmsriram@google.com>
10950
10951 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10952 in the first pass of do_layout.
10953
b521dfe4
DK
109542010-01-13 Doug Kwan <dougkwan@google.com>
10955
10956 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10957 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10958 apparent compiler problem of not folding static constant integral
10959 data members of elfcpp::Elf_sizes<32>.
10960
44272192
DK
109612010-01-13 Doug Kwan <dougkwan@google.com>
10962
10963 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10964 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10965 Arm_relobj::scan_section_for_cortex_a8_erratum,
10966 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10967 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10968 sections to scan for relocation stubs into a new method
10969 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10970 relocation and Cortex-A8 stub scanning.
10971 (Target_arm::do_relax): Force stubs to be after stubbed sections
10972 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10973 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10974 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10975
44b71ece
ILT
109762010-01-12 Ian Lance Taylor <iant@google.com>
10977
10978 * target-reloc.h (visibility_error): New inline function.
10979 (relocate_section): Call visibility_error.
10980 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10981 (MOSTLYCLEANFILES): Likewise.
10982 (protected_4_pic.o, protected_3.err): New targets.
10983 * testsuite/protected_4.cc: New file.
10984
a120bc7f
DK
109852010-01-12 Doug Kwan <dougkwan@google.com>
10986
10987 * arm.cc (Cortex_a8_reloc): New class.
10988 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10989 and cortex_a8_relocs_info_.
10990 (Target_arm::fix_cortex_a8): New method definition.
10991 (Target_arm::Cortex_a8_relocs_info): New type.
10992 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10993 New data member declarations.
10994 (Target_arm::scan_reloc_for_stub): Record information about
10995 relocations for THUMB branches that might be exempted from the
10996 Cortex-A8 workaround.
10997 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10998 at the beginning of a relaxation pass.
10999
20138696
DK
110002010-01-12 Doug Kwan <dougkwan@google.com>
11001
11002 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11003 (Arm_relobj::Mapping_symbol_position,
11004 Arm_reloj::Mapping_symbol_position_less,
11005 Arm_relobj::Mapping_symbols_info): New types.
11006 (Target_arm::is_mapping_symbol_name): New method definition.
11007 (Arm_relobj::do_count_local_symbols): Save information about mapping
11008 symbols.
11009
089d69dc
DK
110102010-01-11 Doug Kwan <dougkwan@google.com>
11011
11012 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11013 Arm_relocate_functions::thumb32_branch_upper,
11014 Arm_relocate_functions::thumb32_branch_lower,
11015 Arm_relocate_functions::thumb32_cond_branch_offset,
11016 Arm_relocate_functions::thumb32_cond_branch_upper,
11017 Arm_relocate_functions::thumb32_cond_branch_lower,
11018 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11019 branch offset encoding.
11020 (Arm_relocate_functions::thumb_branch_common): Use new branch
11021 offset encoding methods to avoid code duplication.
11022 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11023 (Stub_addend_reader::operator()): Use new branch encoding method
11024 to avoid code duplication.
11025
99e5bff2
DK
110262010-01-11 Doug Kwan <dougkwan@google.com>
11027
11028 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11029 (Target_arm::do_finalize_sections): Define special EXIDX section
11030 symbols only if referenced.
11031 * gc.h (Garbage_collection::add_reference): New method.
11032 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11033 code duplication.
11034
98e090bd
ILT
110352010-01-11 Ian Lance Taylor <iant@google.com>
11036
d0a91bd8
ILT
11037 * script.cc (Version_script_info::build_expression_list_lookup):
11038 Change complaing about duplicate wildcard match from error to
11039 warning.
11040
98e090bd
ILT
11041 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11042 of 2009-12-30.
11043 (Version_script_info::Version_script_info): Initialize globs_,
11044 default_version_, default_is_global_, and exact_. Don't
11045 initialize globals_ or locals_.
11046 (Version_script_info::build_lookup_tables): Build local symbols
11047 first.
11048 (Version_script_info::unquote): New function.
11049 (Version_script_info::add_exact_match): New function.
11050 (Version_script_info::build_expression_list_lookup): Remove lookup
11051 parameter. Add is_global parameter. Change all callers. Handle
11052 wildcard pattern specially. Unquote pattern. Call
11053 add_exact_match.
11054 (Version_script_info::get_name_to_match): New function.
11055 (Version_script_info::get_symbol_version): New function.
11056 (Version_script_info::get_symbol_version_helper): Remove.
11057 (Version_script_info::check_unmatched_names): Call unquote.
11058 * script.h (class Version_script_info): Change get_symbol_version
11059 to be non-inline and add is_global parameter; change all callers.
11060 Rewrite symbol_is_local. Update declarations. Define struct
11061 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11062 Remove globals_ and locals_ members. Add exact_, globs_,
11063 default_version_, is_global_.
11064 (Version_script_info::Glob): Remove pattern, add expression and
11065 is_global. Update constructor. Change all callers.
11066 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11067 default version.
11068 (Versions::symbol_section_contents): If a symbol is undefined, or
11069 defined in a dynamic object, set the version index to
11070 VER_NDX_LOCAL.
11071 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11072 symbol_is_local.
11073 (Symbol_table::add_from_pluginobj): Likewise.
11074 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11075
d56962d3
DK
110762010-01-11 Doug Kwan <dougkwan@google.com>
11077
11078 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11079 (incremental_dump_LDADD): Add linking option for libintl.
11080 * Makefile.in: Regenerate.
11081
94e6ee91
L
110822010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11083
11084 PR gold/11144
11085 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11086 instead of -Ds.
11087 * testsuite/Makefile.in: Regenerated.
11088
e96c574b
DK
110892010-01-10 Doug Kwan <dougkwan@google.com>
11090
11091 * options.h (DEFINE_var): Use parentheses around argument varname__
11092 in macro body to avoid any unintended subsequent substitutions.
11093
7198066b
ILT
110942010-01-10 Ian Lance Taylor <iant@google.com>
11095
ba4d53bf
ILT
11096 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11097 candidates before doing symbol resolution.
11098
7198066b
ILT
11099 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11100 ODR candidates if only one is weak.
11101
a2beed37
ILT
111022010-01-08 Ian Lance Taylor <iant@google.com>
11103
11104 * script.cc (Version_script_info::build_expression_list_lookup):
11105 Don't warn about ambiguous version, just record the ambiguity.
11106 (Version_script_info::get_symbol_version_helper): Give error if
11107 version is ambiguous.
11108
2fb7225c
DK
111092010-01-08 Doug Kwan <dougkwan@google.com>
11110
11111 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11112 prev_data_size_ and prev_addralign_. Remove initializer for
11113 deleted data member has_been_changed_.
11114 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11115 to determine if the table is empty.
11116 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11117 Remove.
11118 (Stub_table::add_reloc_stub): Define method in class definition
11119 instead of just declaring it there.
11120 (Stub_table::add_cortex_a8_stub): New method definition.
11121 (Stub_table::update_data_size_and_addralign): Ditto.
11122 (Stub_table::finalize_stubs): Ditto.
11123 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11124 (Stub_table::do_addralign_): Return address alignment in the
11125 (Stub_table::do_reset_address_and_file_offset): Define method in
11126 class definition instead of declaring it there. Set current data
11127 size to be the data size of the previous pass.
11128 (Stub_table::set_final_data_size): Use current data size as the
11129 final data size.
11130 (Stub_table::relocate_stub): Change parameter type of stub from
11131 Reloc_stub pointer to Stub pointer.
11132 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11133 (Stub_table::Cortex_a8_stub_list): New typedef.
11134 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11135 Stub_table::prev_addralign_): New data member.
11136 (Arm_relobj::Arm_relobj): Initialize data member
11137 section_has_cortex_a8_workaround_.
11138 (Arm_relobj::section_has_cortex_a8_workaround,
11139 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11140 definitions.
11141 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11142 declarations.
11143 (Target_arm::relocate_stub): Change parameter type of stub from
11144 Reloc_stub pointer to Stub pointer.
11145 (Insn_template::size, Insn_template::alignment): Handle
11146 THUMB16_SPECIAL_TYPE.
11147 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11148 Stub_table::update_data_size_and_addralign,
11149 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11150 definitions.
11151 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11152 (Stub_table::do_write): Ditto.
11153 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11154
880cd20d
ILT
111552010-01-08 Ian Lance Taylor <iant@google.com>
11156
11157 PR 11108
11158 * symtab.h (class Symbol): Remove fields is_target_special_ and
11159 has_plt_offset_. Add field is_defined_in_discarded_section_.
11160 (Symbol::is_defined_in_discarded_section): New function.
11161 (Symbol::set_is_defined_in_discarded_section): New function.
11162 (Symbol::has_plt_offset): Rewrite.
11163 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11164 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11165 Don't initialize is_target_special_ or has_plt_offset_.
11166 Initialize is_defined_in_discarded_section_.
11167 (Symbol_table::add_from_relobj): If appropriate, set
11168 is_defined_in_discarded_section.
11169 * resolve.cc (Symbol::override_base_with_special): Don't test
11170 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11171 * target-reloc.h (relocate_section): Do special handling for
11172 symbols defined in discarded sections for global symbols as well
11173 as local symbols.
11174
2703e3eb
ILT
111752010-01-08 Ian Lance Taylor <iant@google.com>
11176
11177 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11178 the SHT_SYMTAB case.
11179
339d40a3
ILT
111802010-01-08 Ian Lance Taylor <iant@google.com>
11181
11182 * object.cc (Sized_relobj::do_layout): Don't get confused if
11183 layout_eh_frame returns NULL.
11184
abecea76
ILT
111852010-01-08 Ian Lance Taylor <iant@google.com>
11186
11187 PR 11084
11188 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11189 dynamic symbol table, use the normal symbol table.
11190 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11191 symbol table.
11192
6b7dd3f3
ILT
111932010-01-08 Ian Lance Taylor <iant@google.com>
11194
11195 PR 11072
11196 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11197 sections.
11198
36c50e63
L
111992010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11200
11201 * version.cc (print_version): Change to "Copyright 2010".
11202
e291e7b9
ILT
112032010-01-08 Ian Lance Taylor <iant@google.com>
11204
11205 PR 10287
11206 PR 11063
11207 * i386.cc (class Target_i386): Change return type of plt_section
11208 to be non-const.
11209 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11210 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11211 tls_desc_rel_ field.
11212 (Output_data_plt_i386::rel_tls_desc): New function.
11213 (Target_i386::rel_tls_desc_section): New function.
11214 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11215 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11216 R_386_TLS_DESC reloc in rel_tls_desc_section.
11217 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11218 Define struct Tlsdesc_info.
11219 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11220 (Target_x86_64::do_reloc_symbol_index): New function.
11221 (Target_x86_64::add_tlsdesc_info): New function.
11222 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11223 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11224 tlsdesc_rel_ field.
11225 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11226 all callers.
11227 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11228 (Target_x86_64::rela_tlsdesc_section): New function.
11229 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11230 handling.
11231 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11232 (Target_x86_64::do_reloc_addend): New function.
11233 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11234 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11235 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11236 (Output_reloc::type): New function.
11237 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11238 (Output_reloc::is_target_specific): New function.
11239 (Output_reloc::target_arg): New function.
11240 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11241 absolute relocs and target specific relocs.
11242 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11243 add_target_specific.
11244 (class Output_data_reloc) [SHT_RELA]: Likewise.
11245 * output.cc (Output_reloc::Output_reloc): Add four new versions
11246 for absolute relocs and target specific relocs.
11247 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11248 (Output_reloc::get_symbol_index): Likewise.
11249 (Output_reloc::local_section_offset): Check that local_sym_index_
11250 is not TARGET_CODE or 0.
11251 (Output_reloc::symbol_value): Likewise.
11252 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11253 reloc.
11254 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11255 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11256 functions.
11257 * layout.cc (add_target_dynamic_tags): Use output section for
11258 DT_PLTRELSZ and DT_JMPREL.
11259
3a44184e
ILT
112602010-01-07 Ian Lance Taylor <iant@google.com>
11261
11262 PR 11061
11263 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11264 function.
11265 (class Output_data_reloc_generic): Define.
11266 (class Output_data_reloc_base): Change base class to
11267 Output_data_reloc_generic. Change add() method to call
11268 bump_relative_reloc_count for a relative reloc. Remove
11269 sort_relocs_ field.
11270 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11271 to sort_relocs().
11272 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11273 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11274 appropriate.
11275 * layout.h (class Layout): Update declaration.
11276
ea715a34
ILT
112772010-01-07 Ian Lance Taylor <iant@google.com>
11278
11279 * output.h (class Output_data): Add const version of
11280 output_section and do_output_section.
11281 (class Output_section_data): Add const version of
11282 do_output_section.
11283 (class Output_section): Likewise.
11284 * layout.cc (Layout::add_target_dynamic_tags): New function.
11285 * layout.h (class Layout): Update declarations.
11286 * arm.cc (Target_arm::do_finalize_sections): Use
11287 add_target_dynamic_tags.
11288 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11289 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11290 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11291 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11292
659948a4
ILT
112932010-01-07 Ian Lance Taylor <iant@google.com>
11294
11295 PR 11042
11296 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11297 object as needed.
11298
9d3b86f6
ILT
112992010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11300 Ian Lance Taylor <iant@google.com>
11301
11302 PR 11019
11303 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11304 Xindex::read_symtab_xindex.
11305
bb0d3eb0
DK
113062010-01-07 Doug Kwan <dougkwan@google.com>
11307
11308 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11309 (Insn_template::thumb16_bcond_insn): New method declaration.
11310 (Insn_template): Fix spelling.
11311 (Stub::thumb16_special): New method declaration.
11312 (Stub::do_write): Define virtual method which was previously pure
11313 virtual.
11314 (Stub::do_thumb16_special): New method declaration.
11315 (Stub::do_fixed_endian_write): New template member.
11316 (Reloc_stub::do_write): Remove.
11317 (Reloc_stub::do_fixed_endian_write): Remove.
11318 (Cortex_a8_stub): New class definition.
11319 (Stub_factory::make_cortex_a8_stub): New method definition.
11320 (Stub_factory::Stub_factory): Add missing static storage class
11321 qualifier for elf32_arm_stub_a8_veneer_blx.
11322
ffeef7df
ILT
113232010-01-07 Ian Lance Taylor <iant@google.com>
11324
dc3f80fe
ILT
11325 PR 10980
11326 * options.h (class General_options): Add --warn-unresolved-symbols
11327 and --error-unresolved-symbols.
11328 * errors.cc (Errors::undefined_symbol): Implement
11329 --warn-unresolved-symbols.
11330
ffeef7df
ILT
11331 * options.h (class General_options): Add -z text and -z textoff.
11332 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11333
f1ec9ded
ST
113342010-01-06 Sriraman Tallam <tmsriram@google.com>
11335
11336 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11337 (Garbage_collection::cident_sections): New function.
11338 (Garbage_collection::add_cident_section): New function.
11339 (Garbage_collection::cident_sections_): New member.
11340 (gc_process_relocs): Add references to sections whose names are C
11341 identifiers.
11342 * gold.h (cident_section_start_prefix): New constant.
11343 (cident_section_stop_prefix): New constant.
11344 (is_cident): New function.
11345 * layout.cc (Layout::define_section_symbols): Replace string constants
11346 with the newly defined constants.
11347 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11348 C identifiers.
11349 * testsuite/Makefile.am: Add gc_orphan_section_test.
11350 * testsuite/Makefile.in: Regenerate.
11351 * testsuite/gc_orphan_section_test.cc: New file.
11352 * testsuite/gc_orphan_section_test.sh: New file.
11353
6eda8c29
ILT
113542010-01-06 Ian Lance Taylor <iant@google.com>
11355
b9674e17
ILT
11356 PR 10980
11357 * options.h (class General_options): Add --warn-shared-textrel.
11358 * layout.cc (Layout::finish_dynamic_section): Implement
11359 --warn-shared-textrel.
11360
6eda8c29
ILT
11361 PR 10980
11362 * options.h (class General_options): Add --warn-multiple-gp.
11363
32dcd44e
ILT
113642010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11365
11366 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11367 $(THREADSLIB) and $(LIBDL).
11368 * Makefile.in: Rebuild.
11369
a192ba05
ILT
113702010-01-06 Ian Lance Taylor <iant@google.com>
11371
11372 PR 10980
11373 * options.cc (General_options::parse_section_start): New function.
11374 (General_options::section_start): New function.
11375 (General_options::General_options): Initialize all members.
11376 * options.h: Include <map>
11377 (class General_options): Add --section-start. Add section_starts_
11378 member.
11379 * layout.cc (Layout::attach_allocated_section_to_segment): If
11380 --section-start was used, set the address of the segment. Remove
11381 local sort_sections.
11382 (Layout::relaxation_loop_body): If the address of the load segment
11383 has been set by --section-start, don't use it.
11384 * output.h (Output_segment::update_flags_for_output_section): New
11385 function.
11386 * output.cc (Output_segment::add_output_section): Call
11387 update_flags_for_output_section.
11388
dde3f402
ILT
113892010-01-05 Ian Lance Taylor <iant@google.com>
11390
62dfdd4d
ILT
11391 PR 10980
11392 * options.h (class General_options): Add --undefined-version.
11393 * script.cc (struct Version_expression): Add was_matched_by_symbol
11394 field.
11395 (Version_script_info::matched_symbol): New function.
11396 (Version_script_info::get_symbol_version_helper): Call
11397 matched_symbol.
11398 (Version_script_info::check_unmatched_names): New function.
11399 * script.h (class Version_script_info): Update declarations.
11400 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11401
9c4ae156
ILT
11402 * options.h (class General_options): Use DEFINE_bool_alias for
11403 allow_multiple_definition.
11404 * resolve.cc (Symbol_table::should_override): Don't test
11405 allow_multiple_definition.
11406
dde3f402
ILT
11407 PR 10980
11408 * options.h (class General_options): Add --cref.
11409 * main.cc (main): Print cref table if --cref. Don't close mapfile
11410 until after printing cref table.
11411 * cref.cc: Include "symtab.h".
11412 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11413 (Cref_table_compare::operator()): New function.
11414 (Cref_inputs::gather_cref): New function.
11415 (filecol): New static const.
11416 (Cref_inputs::print_cref): New function.
11417 (Cref::print_cref): New function.
11418 * cref.h: Include <cstdio>.
11419 (class Cref): Update declarations.
11420 * mapfile.h (Mapfile::file): New function.
11421 * object.h (class Object): Define Symbols. Declare virtual
11422 do_get_global_symbols.
11423 (Object::get_global_symbols): New function.
11424 * object.cc (Input_objects::add_object): Pass object to cref_ if
11425 --cref.
11426 (Input_objects::archive_start): Likewise.
11427 (Input_objects::archive_stop): Likewise.
11428 (Input_objects::print_cref): New function.
11429 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11430 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11431 --cref.
11432 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11433 function.
11434 * plugin.h (class Sized_pluginobj): Update declarations.
11435
8781f709
ILT
114362010-01-05 Ian Lance Taylor <iant@google.com>
11437
11438 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11439 to is_default_version. Rename insdef to insdefault.
11440 (Symbol_table::add_from_relobj): Rename def to is_default_version
11441 and local to is_forced_local.
11442 (Symbol_table::add_from_pluginobj): Likewise.
11443 (Symbol_table::add_from_dynobj): Likewise.
11444 (Symbol_table::define_special_symbol): Rename insdef to
11445 insdefault.
11446
fe35d28d
ILT
114472010-01-04 Ian Lance Taylor <iant@google.com>
11448
30bc8c46
ILT
11449 PR 10980
11450 * options.h (class General_options): Add
11451 --allow-multiple-definition and -z muldefs.
11452 * resolve.cc (Symbol_table::should_override): Don't warn about a
11453 multiple symbol definition if --allow-multiple-definition or -z
11454 muldefs.
11455
7eaea549
ILT
11456 PR 10980
11457 * options.h (class General_options): Add --add-needed and
11458 --copy-dt-needed-entries. Tweak --as-needed help entry.
11459 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11460 error if --copy-dt-needed-entries aka --add-needed is used and
11461 would cause a change in behaviour.
11462
fe35d28d
ILT
11463 PR 10980
11464 * options.h (class General_options): Add -G as a short version of
11465 --shared. Add no-op options -assert, -g, and -i.
11466
55a2bb35
ST
114672010-01-04 Sriraman Tallam <tmsriram@google.com>
11468
11469 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11470 check for .text or .gnu.linkonce.t sections.
11471 * icf.cc (Icf::find_identical_sections): Ditto.
11472 Change the detection for mangled function name within the section
11473 name.
11474 * icf.h (is_section_foldable_candidate): New function.
11475
719328e1
ILT
114762009-12-30 Ian Lance Taylor <iant@google.com>
11477
11478 PR 10980
11479 * options.h (class General_options): Permit two dashes with
11480 --retain-symbols-file.
11481
d7bb5745
ILT
114822009-12-30 Ian Lance Taylor <iant@google.com>
11483
403a15dd
ILT
11484 PR 10979
11485 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11486 don't put the file header and segment headers in the text
11487 segment.
11488
eda294df
ILT
11489 PR 10979
11490 * common.cc (Sort_commons::operator()): Stabilize sort when both
11491 entries are NULL.
11492 (Symbol_table::do_allocate_commons_list): When allocating common
11493 symbols, skip a symbol which is no longer common.
11494 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11495 an object before checking its type.
11496 * testsuite/common_test_2.c: New file.
11497 * testsuite/common_test_3.c: New file.
11498 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11499 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11500 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11501 (common_test_2_pic.o, common_test_2.so): New targets.
11502 (common_test_3_pic.o, common_test_3.so): New targets.
11503 * testsuite/Makefile.in: Rebuild.
11504
d7bb5745
ILT
11505 PR 10979
11506 * script.cc (read_input_script): If we see a new SECTIONS clause,
11507 and we have added an input section, give an error.
11508 * layout.h (class Layout): Add have_added_input_section function.
11509 Add have_added_input_section_ field.
11510 * layout.cc (Layout::Layout): Initialize
11511 have_added_input_section_.
11512 (Layout::layout): Set have_added_input_section_.
11513 (Layout::layout_eh_frame): Likewise.
11514
fc59c572
ILT
115152009-12-30 Ian Lance Taylor <iant@google.com>
11516
11517 PR 10931
11518 * options.h (class General_options): Add --sort-common option.
11519 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11520 * common.cc (Sort_common): Add sort_order parameter to
11521 constructor. Add sort_order_ field.
11522 (Sort_commons::operator): Check sort_order_.
11523 (Symbol_table::allocate_commons): Determine the sort order.
11524 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11525 Change all callers.
11526 (Symbol_table::do_allocate_commons_list): Likewise.
11527
1c74fab0
ILT
115282009-12-30 Ian Lance Taylor <iant@google.com>
11529
11530 PR 10916
11531 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11532 symbols from this object, don't change the visibility of an
11533 undefined symbol.
11534 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11535
6affe781
ILT
115362009-12-30 Ian Lance Taylor <iant@google.com>
11537
11538 PR 10861
11539 * script.h (class Version_script_info): Define Language enum.
11540 Update declarations. Define Glob, Exact, and Lookup types. Add
11541 new fields globals_, locals_, and is_finalized_.
11542 * script.cc: Various formatting fixes.
11543 (class Parser_closure): Change language_stack_ from a vector of
11544 std::string to one of Version_script_info::Language. Adjust all
11545 uses accordingly.
11546 (class Lazy_demangler): Remove.
11547 (struct Version_expression): Change language from std::string to
11548 Version_script_info::Language.
11549 (Version_script_info::Version_script_info): New function.
11550 (Version_script_info::~Version_script_info): Don't call clear.
11551 (Version_script_info::finalize): New function.
11552 (Version_script_info::build_lookup_tables): New function.
11553 (Version_script_info::build_expression_list_lookup): New
11554 function.
11555 (Version_script_info::get_symbol_version_helper): Rewrite to use
11556 lookup tables.
11557 (Version_script_info::print_expression_list): Adjust to use
11558 Version_script_info::Language.
11559 (script_push_lex_into_version_mode): Check that the version script
11560 has not been finalized.
11561 (version_script_push_lang): Change language string to
11562 Version_script_info::Language.
11563 * options.cc (Command_line::version_script): New function.
11564 * options.h (class General_options): Add finalize_dynamic_list
11565 function. Change version_script from declaration to definition.
11566 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11567 * testsuite/version_script.map: Remove duplicate def of foo.
11568 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11569 version_script.map.
11570 * testsuite/Makefile.in: Rebuild.
11571
818bf354
ILT
115722009-12-30 Ian Lance Taylor <iant@google.com>
11573
11574 PR 10843
11575 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11576 if the input symbol index is 0, make the output symbol index 0.
11577
ebcc8304
ILT
115782009-12-30 Ian Lance Taylor <iant@google.com>
11579
11580 PR 10670
11581 * options.h (class General_options): Add -x/--discard-all.
11582 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11583 --discard-all. If the local symbol needs a dynamic entry, check
11584 that before handling --discard-locals.
11585
176fe33f
ILT
115862009-12-30 Ian Lance Taylor <iant@google.com>
11587
bb321bb1
ILT
11588 PR 10450
11589 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11590 flags to PF_R.
11591 (Output_segment::add_output_section): Don't change the flags if
11592 the type is PT_TLS.
11593
176fe33f
ILT
11594 PR 10450
11595 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11596 GNU hash table if they need a dynamic value. Otherwise, don't add
11597 them if they are defined in a dynamic object or are forced local.
11598
e8cd95c7
ILT
115992009-12-29 Ian Lance Taylor <iant@google.com>
11600
1b81fb71
ILT
11601 PR 10450
11602 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11603 .gnu.hash table for a 32-bit target.
11604
8d6d383d
ILT
11605 PR 10450
11606 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11607 regular and a dynamic object only needs a dynamic symbol table
11608 entry if it is externally visible.
11609
e785ec03
ILT
11610 PR 10450
11611 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11612 constructor. Add global_offset_table_ field.
11613 (Target_i386::got_section): Set global_offset_table_.
11614 (Target_i386::do_finalize_sections): Set global_offset_table_
11615 size.
11616 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11617 in constructor. Add global_offset_table_ field.
11618 (Target_x86_64::got_section): Set global_offset_table_.
11619 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11620 size.
11621
1a2dff53
ILT
11622 * layout.cc (Layout::Layout): Initialize increase_relro_.
11623 (Layout::get_output_section): Add is_relro, is_last_relro, and
11624 is_first_non_relro parameters. Change all callers.
11625 (Layout::choose_output_section): Likewise.
11626 (Layout::add_output_section_data): Likewise.
11627 (Layout::make_output_section): Likewise.
11628 (Layout::set_segment_offsets): Clear increase_relro when using a
11629 linker script.
11630 * layout.h (class Layout): Add increase_relro method. Add
11631 increase_relro_ field. Update declarations.
11632 * output.cc (Output_section::Output_section): Initialize
11633 is_last_relro_ and is_first_non_relro_.
11634 (Output_segment::add_output_section): Group relro sections is
11635 do_sort is true. Handle is_last_relro and is_first_non_relro.
11636 (Output_segment::maximum_alignment): Remove relro handling.
11637 (Output_segment::set_section_addresses): Add increase_relro
11638 parameter. Change all callers. Add initial alignment to align
11639 relro sections on separate page. Remove old relro handling.
11640 (Output_segment::set_section_list_addresses): Remove in_relro
11641 parameter. Change all callers.
11642 (Output_segment::set_offset): Add increase parameter. Change all
11643 callers. Remove old relro handling.
11644 * output.h (class Output_section): Add new methods: is_last_relro,
11645 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11646 Add is_last_relro_ and is_first_non_relro_ fields.
11647 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11648 Create separate .got.plt section. Call increase_relro.
11649 * x86_64.cc (Target_x86_64::got_section): Likewise.
11650 * testsuite/relro_script_test.t: Add .got.plt.
11651
f0ba79e2
ILT
11652 PR 10450
11653 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11654 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11655 (Layout::finalize): Call set_dynamic_symbol_size.
11656 (Layout::set_dynamic_symbol_size): New function.
11657 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11658 set_dynamic_symbol_size.
11659
e8cd95c7
ILT
11660 PR 10450
11661 * output.h (class Output_section): Add is_entsize_zero_ field.
11662 * output.cc (Output_section::Output_section): Initialize
11663 is_entsize_zero_.
11664 (Output_section::set_entsize): If two different entsizes are
11665 requested, force it to zero.
11666 (Output_section::add_input_section): Set flags for .debug_str
11667 before updating section flags. Set entsize.
11668 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11669 and SHF_STRING if all input sections have those flags.
11670
3e1b9a8a
RÁE
116712009-12-29 Rafael Espindola <espindola@google.com>
11672
11673 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11674 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11675 reporting.
3e1b9a8a 11676
3dcad376
ST
116772009-12-29 Sriraman Tallam <tmsriram@google.com>
11678
11679 * options.cc (General_options::parse_version): Allow -v to exit
11680 without an error if there is nothing to link.
11681
084e2665
ILT
116822009-12-29 Ian Lance Taylor <iant@google.com>
11683
11684 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11685 using a version of gcc before 4.1.
11686 * configure: Rebuild.
11687
250acde3
CD
116882009-12-28 Chris Demetriou <cgd@google.com>
11689
11690 * attributes.cc (Output_attributes_section_data::do_write): Use
11691 std::vector::front rather than std::vector::data.
11692
99fff23b
ILT
116932009-12-28 Ian Lance Taylor <iant@google.com>
11694
11695 * symtab.h (class Symbol_table): Add enum Defined.
11696 * resolve.cc (Symbol_table::should_override): Add defined
11697 parameter. Change all callers. Test whether object is NULL
11698 before calling a method on it.
11699 (Symbol_table::report_resolve_problem): Add defined parameter.
11700 Change all callers.
11701 (Symbol_table::should_override_with_special): Likewise.
11702 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11703 parameter. Change all callers.
11704 (Symbol_table::do_define_in_output_data): Likewise.
11705 (Symbol_table::define_in_output_segment): Likewise.
11706 (Symbol_table::do_define_in_output_segment): Likewise.
11707 (Symbol_table::define_as_constant): Likewise.
11708 (Symbol_table::do_define_as_constant): Likewise.
11709 * script.h (class Symbol_assignment): Add is_defsym parameter to
11710 constructor; change all callers.
11711 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11712 parameter. Change all callers. Add is_defsym_ field.
11713 (class Parser_closure): Add parsing_defsym parameter to
11714 constructor; change all callers. Add parsing_defsym accessor
11715 function. Add parsing_defsym_ field.
11716
556bd683
ILT
117172009-12-28 Ian Lance Taylor <iant@google.com>
11718
11719 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11720 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11721
1782c879
ILT
117222009-12-23 Ian Lance Taylor <iant@google.com>
11723
11724 * i386.cc (Target_i386::do_calls_non_split): Recognize
11725 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11726 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11727 -fsplit-stack prologue when using %r11.
1782c879 11728
329ca2b1
ST
117292009-12-21 Sriraman Tallam <tmsriram@google.com>
11730
11731 * options.cc (General_options::parse_version): Make -v continue and do
11732 the link like GNU ld does.
11733
d675ff46
RÁE
117342009-12-17 Rafael Avila de Espindola <espindola@google.com>
11735
11736 * Makefile.am (CCFILES): Add timer.cc.
11737 (HFILES): Add timer.h.
11738 * configure.ac: Check for sysconf and times.
11739 * main.cc: include timer.h.
11740 (main): Use Timer instead of get_run_time.
11741 * timer.cc: New.
11742 * timer.h: New.
11743 * workqueue.cc: include timer.h.
11744 (Workqueue::find_and_run_task):
11745 Report user, sys and wall time.
11746 * Makefile.in: Regenerate.
11747 * config.in: Regenerate.
11748 * configure: Regenerate.
11749
d6344fb5
DK
117502009-12-16 Doug Kwan <dougkwan@google.com>
11751
11752 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11753 sections.
11754 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11755 relaxed input sections.
11756 * output.cc (Output_section::find_relaxed_input_section): Change
11757 return type to Output_relaxed_input_section pointer. Adjust code
11758 for new type of relaxed_input_section_map_.
11759 * output.h (Output_section::find_relaxed_input_section): Change
11760 return type to Output_relaxed_input_section pointer.
11761 (Output_section::Output_relaxed_input_section_by_input_section_map):
11762 New type.
11763 (Output_section::relaxed_input_section_map_): Change type to
11764 Output_section::Output_relaxed_input_section_by_input_section_map.
11765 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11766 input section.
11767
0e0d5469
ILT
117682009-12-15 Ian Lance Taylor <iant@google.com>
11769
11770 * layout.cc (Layout::create_shstrtab): Only write out after input
11771 sections if we are compressing debug sections.
11772
0649a889
ILT
117732009-12-15 Ian Lance Taylor <iant@google.com>
11774
11775 * archive.cc (Archive::add_symbols): Only look up a symbol without
11776 a version if there is, in fact, a version.
11777
2ea97941
ILT
117782009-12-14 Ian Lance Taylor <iant@google.com>
11779
11780 Revert -Wshadow changes, all changes from:
11781 2009-12-11 Doug Kwan <dougkwan@google.com>
11782 2009-12-11 Nick Clifton <nickc@redhat.com>
11783 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11784
b0eec2cc
DK
117852009-12-11 Doug Kwan <dougkwan@google.com>
11786
11787 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11788 due to -Wshadow.
11789 * attributes.cc (Object_attribute::size): Ditto.
11790 (Attributes_section_data::size): Ditto.
11791 (Attributes_section_data::Attributes_section_data): Ditto.
11792 (Output_attributes_section_data::do_write): Ditto.
11793 * attributes.h (Object_attribute::set_type): Ditto.
11794 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11795
91d6fa6a
NC
117962009-12-11 Nick Clifton <nickc@redhat.com>
11797
11798 * archive.cc: Fix shadowed variable warnings.
11799 * arm.cc: Likewise.
11800 * compressed_output.cc: Likewise.
11801 * compressed_output.h: Likewise.
11802 * configure: Likewise.
11803 * dwarf_reader.cc: Likewise.
11804 * dynobj.cc: Likewise.
11805 * dynobj.h: Likewise.
11806 * ehframe.cc: Likewise.
11807 * ehframe.h: Likewise.
11808 * errors.cc: Likewise.
11809 * expression.cc: Likewise.
11810 * fileread.cc: Likewise.
11811 * fileread.h: Likewise.
11812 * freebsd.h: Likewise.
11813 * i386.cc: Likewise.
11814 * icf.cc: Likewise.
11815 * incremental.h: Likewise.
11816 * layout.cc: Likewise.
11817 * layout.h: Likewise.
11818 * mapfile.cc: Likewise.
11819 * merge.cc: Likewise.
11820 * merge.h: Likewise.
11821 * object.cc: Likewise.
11822 * object.h: Likewise.
11823 * options.h: Likewise.
11824 * output.cc: Likewise.
11825 * output.h: Likewise.
11826 * parameters.cc: Likewise.
11827 * plugin.cc: Likewise.
11828 * powerpc.cc: Likewise.
11829 * reduced_debug_output.cc: Likewise.
11830 * reduced_debug_output.h: Likewise.
11831 * reloc.cc: Likewise.
11832 * reloc.h: Likewise.
11833 * resolve.cc: Likewise.
11834 * script-sections.cc: Likewise.
11835 * script.cc: Likewise.
11836 * script.h: Likewise.
11837 * sparc.cc: Likewise.
11838 * symtab.cc: Likewise.
11839 * symtab.h: Likewise.
11840 * target-select.cc: Likewise.
11841 * target-select.h: Likewise.
11842 * token.h: Likewise.
11843 * workqueue.cc: Likewise.
11844 * workqueue.h: Likewise.
11845 * x86_64.cc: Likewise.
11846
a0351a69
DK
118472009-12-10 Doug Kwan <dougkwan@google.com>
11848
11849 * arm.cc (attributes.h): New include.
11850 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11851 (Arm_relobj::~Arm_relobj): Delete object pointed by
11852 attributes_section_data_.
11853 (Arm_relobj::attributes_section_data): New method definition.
11854 (Arm_relobj::attributes_section_data_): New data member declaration.
11855 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11856 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11857 attributes_section_data_.
11858 (Arm_dynobj::attributes_section_data): New method definition.
11859 (Arm_dynobj::attributes_section_data_): New data member declaration.
11860 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11861 initialization value of may_use_blx_ to false.
2e702c99 11862 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11863 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11864 object attributes to compute results instead of hard-coding.
11865 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11866 Target_arm::get_secondary_compatible_arch,
11867 Target_arm::set_secondary_compatible_arch
11868 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11869 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11870 New method declarations.
11871 (Target_arm::get_aeabi_object_attribute): New method definition.
11872 (Target_arm::attributes_section_data_): New data member declaration.
11873 (read_arm_attributes_section): New template definition.
11874 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11875 (Arm_dynobj::do_read_symbols): Ditto.
11876 (Target_arm::do_finalize_sections): Merge attributes sections from
11877 input. Check for BLX use after attributes section merging.
11878 Fix __exidx_start and __exidx_end visibility. Create an
11879 .ARM.attributes section if necessary.
11880 (Target_arm::get_secondary_compatible_arch,
11881 Target_arm::set_secondary_compatible_arch,
11882 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11883 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11884 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11885 New method definitions.
11886
b59befec
ILT
118872009-12-09 Ian Lance Taylor <iant@google.com>
11888
11889 * plugin.cc (Plugin::load): Don't cast from void* to a function
11890 pointer.
11891
1276bc89
ILT
118922009-12-09 Ian Lance Taylor <iant@google.com>
11893
11894 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11895 information fields.
11896
2f2de248
L
118972009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11898
11899 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11900 Replace two_file_shared_1.so with two_file_shared_2.so.
11901 * testsuite/Makefile.in: Regenerated.
11902
4f787271
DK
119032009-12-08 Doug Kwan <dougkwan@google.com>
11904
11905 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11906 (HFILES): Add attributes.h and int_encoding.h.
11907 * Makefile.in: Regenerate.
11908 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11909 function definitions to int_encoding.cc
11910 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11911 prototypes to int_encoding.h
11912 * reduced_debug_output.cc (int_encoding.h): New include.
11913 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11914 function definitions to int_encoding.cc
11915 (insert_into_vector, read_from_pointer): Move template definitions to
11916 int_encoding.h
11917 * attributes.cc: New file.
11918 * attributes.h: New file.
11919 * int_encoding.cc: New file.
11920 * int_encoding.h: New file.
11921
20b52f1a
RÁE
119222009-12-07 Rafael Avila de Espindola <espindola@google.com>
11923
11924 PR gold/11055
11925 * incremental-dump.cc (dump_incremental_inputs): New.
11926 (main): Use dump_incremental_inputs.
11927
53d7974c
L
119282009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11929
11930 PR gold/10893
11931 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11932 checking elfcpp::STT_FUNC.
11933 (Target_i386::Relocate::relocate): Likewise.
11934 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11935
11936 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11937 symbols from shared libraries into normal FUNC symbols.
11938
11939 * symtab.h (Symbol): Add is_func and use it.
11940
05a352e6
DK
119412009-12-05 Doug Kwan <dougkwan@google.com>
11942
11943 * arm.cc (Target_arm::arm_info): Initialize new fields
11944 attributes_section and attributes_vendor.
11945 * i386.cc (Target_i386::i386_info): Same.
11946 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11947 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11948 fields attributes_section and attributes_vendor.
53d7974c 11949 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11950 * target.h (Target::attributes_section, Target::attributes_vendor,
11951 Target::is_attributes_section, Target::attribute_arg_type,
11952 Target::attributes_order): New method definitions.
11953 (Target::Target_info::attributes_section,
11954 Target::Target_info::attributes_vendor): New fields.
11955 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11956 virtual method definitions.
11957 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11958 attributes_section and attributes_vendor.
11959 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11960
f4e5969c
DK
119612009-12-05 Doug Kwan <dougkwan@google.com>
11962
11963 * arm.cc: Update comments about interworking and stub generation.
11964 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11965 considered as non-PIC.
11966 (Arm_relocate_functions::base_abs): Fix formatting.
11967 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11968 of function to use GOT entry address instead of offset.
11969 (Target_arm::Scan::global): Issue an error if a symbol would need a
11970 PLT does not get one because it is untyped. Remove code to create
11971 dynamic symbols for relative branches.
11972 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11973 takes unsigned integer instead of boolean.
11974
1abce4a6
L
119752009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11976
11977 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11978 (two_file_test_LDADD): Likewise.
11979 (common_test_1_LDADD): Likewise.
11980 (exception_test_LDADD) Likewise.
11981 (weak_test_LDADD): Likewise.
11982 (many_sections_test_LDADD): Likewise.
11983 (initpri1_LDADD): Likewise.
11984 (script_test_1_LDADD): Likewise.
11985 (script_test_2_LDADD): Likewise.
11986 (justsyms_LDADD): Likewise.
11987 (binary_test_LDADD): Likewise.
11988 (large_LDADD): Likewise.
11989 * testsuite/Makefile.in: Regenerated.
11990
adcf2816 119912009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11992
adcf2816
L
11993 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11994 (Symbol_table::override_with_special): Likewise.
11995 (Symbol_table::add_from_object): Likewise.
11996
28e67f5d
RÁE
119972009-12-04 Rafael Avila de Espindola <espindola@google.com>
11998
11999 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12000 Don't set the data_offset twice.
12001
ae10a101
RÁE
120022009-12-04 Rafael Avila de Espindola <espindola@google.com>
12003
12004 * testsuite/Makefile.in: Regenerate.
12005
f59f41f3
DK
120062009-12-03 Doug Kwan <dougkwan@google.com>
12007
12008 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12009 (Target_arm::do_finalize_sections): Add parameter for symbol table
12010 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12011 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12012 parameter for symbol table pointer.
12013 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12014 an additional parameter for a pointer to symbol table.
12015 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12016 parameter for a symbol table pointer.
12017 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12018 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12019 Ditto.
12020 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12021 parameter for a symbol table pointer.
12022
ca55d848
RÁE
120232009-12-03 Rafael Avila de Espindola <espindola@google.com>
12024
12025 * incremental.cc (Incremental_inputs_header)
12026 (Incremental_inputs_header_write, Incremental_inputs_entry)
12027 (Incremental_inputs_entry_write): Move ...
12028 * incremental.h (Incremental_inputs_header)
12029 (Incremental_inputs_header_write, Incremental_inputs_entry)
12030 (Incremental_inputs_entry_write): here.
12031
3aec4f9c
RÁE
120322009-12-02 Rafael Avila de Espindola <espindola@google.com>
12033
12034 * incremental.cc (make_sized_incremental_binary): Set the target.
12035 Error if it is incompatible.
12036 * output.h (Output_file): Add filename method.
12037
9c0ae74d
RÁE
120382009-12-02 Rafael Avila de Espindola <espindola@google.com>
12039
12040 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12041 from the get_* methods.
12042
a45500ae
RÁE
120432009-12-02 Rafael Avila de Espindola <espindola@google.com>
12044
12045 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12046 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12047 Write 0 for the data_offset of scripts.
12048
325e6408
RÁE
120492009-12-02 Rafael Avila de Espindola <espindola@google.com>
12050
12051 * testsuite/Makefile.am: Add the incremental_test.sh test.
12052 * testsuite/incremental_test.sh: New.
12053 * testsuite/incremental_test_1.c: New.
12054 * testsuite/incremental_test_2.c: New.
12055
954c3e2e
RÁE
120562009-12-01 Rafael Avila de Espindola <espindola@google.com>
12057
703d02da 12058 * incremental-dump.cc (main): Fix typos.
954c3e2e 12059
f8086623
RÁE
120602009-11-27 Rafael Avila de Espindola <espindola@google.com>
12061
12062 PR gold/11025
12063 * incremental-dump.cc (main): Use llu to print 64 bit values.
12064
3b0dd6ac
L
120652009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12066 H.J. Lu <hongjiu.lu@intel.com>
12067
12068 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12069 $(LIBDL).
12070 (incremental_dump_LDADD): Likewise.
12071 * Makefile.in: Regenerated.
12072
a6d1ef57 120732009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12074
a6d1ef57
DK
12075 Revert:
12076
12077 2009-11-25 Doug Kwan <dougkwan@google.com>
12078
12079 * arm.cc (Target_arm::Target_arm): Move method definition
12080 outside of class definition. Add code to handle
12081 --target1-rel, --target1-abs and --target2= options.
12082 (Target_arm::get_reloc_reloc_type): Change method to be
12083 non-static and const.
12084 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12085 New data member declaration.
12086 (Target_arm::Scan::local, Target_arm::Scan::global,
12087 Target_arm::Relocate::relocate,
12088 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12089 Adjust call to Target_arm::get_real_reloc_type.
12090 (Target_arm::get_real_reloc_type): Use command line options
12091 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12092 * options.h (--target1-rel, --target1-abs, --target2): New
12093 ARM-only options.
12094
50aeb7d4
DK
120952009-11-25 Doug Kwan <dougkwan@google.com>
12096
12097 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12098 class definition. Add code to handle --target1-rel, --target1-abs
12099 and --target2= options.
12100 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12101 and const.
12102 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12103 member declaration.
12104 (Target_arm::Scan::local, Target_arm::Scan::global,
12105 Target_arm::Relocate::relocate,
12106 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12107 call to Target_arm::get_real_reloc_type.
12108 (Target_arm::get_real_reloc_type): Use command line options to
12109 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12110 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12111 options.
12112
51938283
DK
121132009-11-25 Doug Kwan <dougkwan@google.com>
12114
12115 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12116 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12117 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12118 formatting.
12119 (Arm_relocate_functions::thm_call): Replace body with a call to
12120 Arm_relocate_functions::thumb_branch_common.
12121 (Arm_relocate_functions::thm_jump24,
12122 Arm_relocate_functions::thm_xpc22): New method definitions.
12123 (Arm_relocate_functions::thumb_branch_common): New method definition.
12124 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12125 operator.
12126 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12127 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12128
e2b8f3c4
RÁE
121292009-11-24 Rafael Avila de Espindola <espindola@google.com>
12130
12131 * Makefile.am: Build incremental-dump
12132 * Makefile.in: Regenerate.
12133 * incremental-dump.cc: New.
12134 * incremental.cc (Incremental_inputs_header_data,
12135 Incremental_inputs_entry_data): Move to incremental.h
12136 * incremental.h: (Incremental_inputs_header_data,
12137 Incremental_inputs_entry_data): Move from incremental.cc
12138
bcba9aec
RÁE
121392009-11-24 Rafael Avila de Espindola <espindola@google.com>
12140
12141 * incremental.cc (Incremental_inputs_header,
12142 Incremental_inputs_header_write, Incremental_inputs_entry,
12143 Incremental_inputs_entry_write): Add a typedef with the data type.
12144
7c3afe08
RÁE
121452009-11-24 Rafael Avila de Espindola <espindola@google.com>
12146
12147 * incremental.cc (Incremental_inputs_header,
12148 Incremental_inputs_header_write, Incremental_inputs_entry,
12149 Incremental_inputs_entry_write): Update comment about which
12150 type has the filed descriptions.
12151
d204b6e9
DK
121522009-11-15 Doug Kwan <dougkwan@google.com>
12153
12154 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12155 (Arm_relocate_functions::arm_branch_common): Change method defintion
12156 in class definition to a method declaration and update list of formal
12157 parameters.
12158 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12159 Arm_relocation_functions::jump24): Adjust call to
12160 Arm_relocate_functions::arm_branch_common. Update list of formal
12161 parameters.
12162 (Arm_relocate_functions::xpc25): New method definition.
12163 (Arm_relocate_functions::arm_branch_common): Move method defintion
12164 out from class definition. Use stubs for mode-switching and extending
12165 branch ranges.
12166 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12167 specially. Change code to enable use of stubs in ARM branches.
12168
43d12afe
DK
121692009-11-10 Doug Kwan <dougkwan@google.com>
12170
12171 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12172 in method declaration.
12173 (Target_arm::relocate_stub): New method declaration.
12174 (Target_arm::default_target): Change to return a pointer instead of
12175 a const reference.
12176 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12177 Target_arm::default_target.
12178 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12179 method definition.
12180 (Target_arm::relocate_section): Adjust view.
12181 (Target_arm::relocate_stub): New method definition.
12182
ac33a407
DK
121832009-11-10 Doug Kwan <dougkwan@google.com>
12184
12185 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12186 a format warning.
12187 * incremental.cc (open_incremental_binary): Initialized local
12188 variables to avoid warnings.
12189 * object.cc (make_elf_object): Ditto.
12190 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12191 a format warning.
e1df38aa 12192
88ee28e9
L
12193009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12194
12195 PR gold/10930
12196 * testsuite/plugin_test.c: Include "config.h".
12197
2daedcd6
DK
121982009-11-09 Doug Kwan <dougkwan@google.com>
12199
12200 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12201 (arm_symbol_value): Remove.
12202 (Arm_relocate_functions::arm_branch_common,
12203 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12204 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12205 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12206 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12207 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12208 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12209 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12210 Arm_relocate_functions::thm_mobw_abs_nc,
12211 Arm_relocate_functions::thm_mov_abs,
12212 Arm_relocate_functions::movw_prel_nc,
12213 Arm_relocate_functions::thm_movt_abs,
12214 Arm_relocate_functions::movt_prel,
12215 Arm_relocate_functions::thm_movw_prel_nc,
12216 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12217 (Target_arm::Relocate::relocate): Only decompose address into two
12218 parts if relocation type uses the thumb-bit and pass the actual
12219 bit instead of a flag indicating that the thumb-bit is used. Adjust
12220 calls to methods in Arm_relocate_functions for this change.
12221
1276bc89 122222009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12223
12224 PR 10925
12225 * reloc.cc: Instantiate
12226 Sized_relobj::initialize_input_to_output_maps and
12227 Sized_relobj:free_input_to_output_maps.
12228
e53ad1b5
ILT
122292009-11-06 Ian Lance Taylor <iant@google.com>
12230
12231 PR 10876
12232 * defstd.cc (in_segment): Set only_if_ref true for "end".
12233
eb44217c
DK
122342009-11-06 Doug Kwan <dougkwan@google.com>
12235
12236 * arm.cc (class Reloc_stub): Correct a comment.
12237 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12238 (Target_arm::scan_section_for_stubs): New method declaration.
12239 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12240 Change methods from private to protected.
12241 (Target_arm::do_may_relax): New method definition.
12242 (Target_arm::do_relax, Target_arm::group_sections,
12243 Target_arm::scan_reloc_for_stub,
12244 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12245 (Target_arm::arm_input_section_map_): New data member declaration.
12246 (Target_arm::scan_reloc_for_stub,
12247 Target_arm::scan_reloc_section_for_stubs,
12248 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12249 Target_arm::do_relax): New method definitions.
12250
5d329b7d
ILT
122512009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12252
12253 * configure.ac: Check for (struct stat)::st_mtim
12254 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12255 * config.in: Regenerate.
12256 * configure: Regenerate.
12257
96a0d71b
ILT
122582009-11-05 Ian Lance Taylor <iant@google.com>
12259
12260 PR 10910
12261 * output.cc (Output_segment::add_output_section): Add missing
12262 return statement.
12263
594c8e5e
ILT
122642009-11-04 Ian Lance Taylor <iant@google.com>
12265
12266 PR 10880
12267 * object.h (class Object): Add is_needed and set_is_needed
12268 methods. Add is_needed_ field. Make bool fields into bitfields.
12269 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12270 defined in a dynamic object and referenced by a regular object,
12271 set is_needed for the dynamic object.
12272 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12273 if the file is marked with as_needed and it is not needed.
12274
22b127cc
ILT
122752009-11-04 Ian Lance Taylor <iant@google.com>
12276
12277 PR 10887
12278 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12279 tags if data is discarded by linker script.
12280 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12281 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12282 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12283 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12284
f5c870d2
ILT
122852009-11-04 Ian Lance Taylor <iant@google.com>
12286
12287 * layout.cc (Layout::get_output_section): Add is_interp and
12288 is_dynamic_linker_section parameters. Change all callers.
12289 (Layout::choose_output_section): Likewise.
12290 (Layout::make_output_section): Likewise.
12291 (Layout::add_output_section_data): Add is_dynamic_linker_section
12292 parameter. Change all callers.
12293 * layout.h (class Layout): Update declarations.
12294 * output.h (class Output_section): Add is_interp, set_is_interp,
12295 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12296 Add is_interp_, is_dynamic_linker_section_ fields. Change
12297 generate_code_fills_at_write_ to a bitfield.
12298 * output.cc (Output_section::Output_sections): Initialize new
12299 fields.
12300 (Output_segment::add_output_section): Add do_sort parameter.
12301 Change all callers.
12302
1ae4d23b
ILT
123032009-11-03 Ian Lance Taylor <iant@google.com>
12304
12305 PR 10860
12306 * options.h (class General_options): Add --warn-common.
12307 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12308 merging two common symbols.
12309 (Symbol_table::should_override): Handle --warn-common when merging
12310 a common symbol with a defined symbol. Use report_resolve_problem
12311 for multiple definitions.
12312 (Symbol_table::report_resolve_problem): New function.
12313 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12314
55da9579
DK
123152009-11-03 Doug Kwan <dougkwan@google.com>
12316
12317 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12318 stub_factory_.
12319 (Target_arm::stub_factory): New method definition.
12320 (Target_arm::new_arm_input_section,
12321 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12322 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12323 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12324 New type definitions.
12325 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12326 member declarations.
12327 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12328 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12329 New method definitions.
12330
37a9ac43
ILT
123312009-11-03 Ian Lance Taylor <iant@google.com>
12332
12333 * options.h (class General_options): Add --warn_constructors.
12334
b3d6a3d4
ILT
123352009-11-03 Ian Lance Taylor <iant@google.com>
12336
12337 PR 10893
12338 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12339 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12340
934b01dd
ILT
123412009-11-03 Ian Lance Taylor <iant@google.com>
12342
12343 PR 10895
12344 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12345 --msgid-bugs-address.
12346 (install-pdf): New target.
12347 (install-data_yes): Look up one directory to find mkinstalldirs.
12348
03c1939b
L
123492009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12350
12351 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12352 tree.
12353
ebd95253
DK
123542009-10-30 Doug Kwan <dougkwan@google.com>
12355
12356 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12357
e9bbb538
DK
123582009-10-30 Doug Kwan <dougkwan@google.com>
12359
12360 * arm.cc (Stub_addend_reader): New struct template definition
12361 and partial specializations.
12362 (Stub_addend_reader::operator()): New method definition for a
12363 partially specialized template.
12364
d5b40221
DK
123652009-10-30 Doug Kwan <dougkwan@google.com>
12366
12367 * arm.cc (Arm_relobj::processor_specific_flags): New method
12368 definition.
12369 (Arm_relobj::do_read_symbols): New method declaration.
12370 (Arm_relobj::processor_specific_flags_): New data member declaration.
12371 (Arm_dynobj): New class definition.
12372 (Target_arm::do_finalize_sections): Add input_objects parameter.
12373 (Target_arm::do_adjust_elf_header): New method declaration.
12374 (Target_arm::are_eabi_versions_compatible,
12375 (Target_arm::merge_processor_specific_flags): New method declaration.
12376 (Target_arm::do_make_elf_object): New overloaded method definitions
12377 and declaration.
12378 (Arm_relobj::do_read_symbols): New method definition.
12379 (Arm_dynobj::do_read_symbols): Ditto.
12380 (Target_arm::do_finalize_sections): Add input_objects parameters.
12381 Merge processor-specific flags from all input objects.
12382 (Target_arm::are_eabi_versions_compatible,
12383 Target_arm::merge_processor_specific_flags,
12384 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12385 New method definitions.
12386 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12387 Input_objects pointer type parameter.
12388 * layout.cc (Layout::finalize): Pass input objects to target's.
12389 finalize_sections function.
12390 * output.cc (Output_file_header::do_sized_write): Set ELF file
12391 header's processor-specific flags.
12392 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12393 Input_objects pointer type parameter.
12394 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12395 * target.h (Input_objects): New forward class declaration.
12396 (Target::processor_specific_flags,
12397 Target::are_processor_specific_flags_sect): New method definitions.
12398 (Target::finalize_sections): Add input_objects parameter.
12399 (Target::Target): Initialize processor_specific_flags_ and
12400 are_processor_specific_flags_set_.
12401 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12402 parameter.
12403 (Target::set_processor_specific_flags): New method definition.
12404 (Target::processor_specific_flags_,
12405 Target::are_processor_specific_flags_set_): New data member
12406 declarations.
12407 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12408 Input_objects pointer type parameter.
12409
ebabffbd
DK
124102009-10-30 Doug Kwan <dougkwan@google.com>
12411
12412 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12413
ad0f2072
ILT
124142009-10-28 Ian Lance Taylor <iant@google.com>
12415
12416 * object.h (class Relobj): Drop options parameter from
12417 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12418 do_scan_relocs, do_relocate. Change all callers.
12419 (class Sized_relobj): Drop options parameters from
12420 do_gc_process_relocs, do_scan_relocs, do_relocate,
12421 do_relocate_sections, relocate_sections, emit_relocs_scan,
12422 emit_relocs_scan_reltype. Change all callers.
12423 (struct Relocate_info): Remove options field and all references to
12424 it.
12425 * reloc.h (class Read_relocs): Remove options constructor
12426 parameter and options_ field. Change all callers.
12427 (class Gc_process_relocs, class Scan_relocs): Likewise.
12428 (class Relocate_task): Likewise.
12429 * target-reloc.h (scan_relocs): Remove options parameter. Change
12430 all callers.
12431 (scan_relocatable_relocs): Likewise.
12432 * target.h (class Sized_target): Remove options parameter from
12433 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12434 all callers.
12435 * gc.h (gc_process_relocs): Remove options parameter. Change all
12436 callers.
12437 * arm.cc: Update functions to remove options parameters.
12438 * i386.cc: Likewise.
12439 * powerpc.cc: Likewise.
12440 * sparc.cc: Likewise.
12441 * x86_64.cc: Likewise.
12442 * testsuite/testfile.cc: Likewise.
12443
8ffa3667
DK
124442009-10-28 Doug Kwan <dougkwan@google.com>
12445
12446 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12447 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12448 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12449 New method definitions.
12450
40f36857
CC
124512009-10-28 Cary Coutant <ccoutant@google.com>
12452
12453 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12454 (Plugin::cleanup_done_): New member.
12455 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12456 (Plugin_manager::cleanup_done_): Remove.
12457 (Plugin_manager::add_input_file): Edit error message.
12458 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12459 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12460
2c849493
ILT
124612009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12462
12463 * fileread.cc: (File_read::View::~View): Use the new
12464 data_ownership_ filed.
12465 (File_read::~File_read): Dispose the new whole_file_view_.
12466 (File_read::open): Mmap the whole file if needed.
12467 (File_read::open): Use whole_file_view_ instead of contents_.
12468 (File_read::find_view): Use whole_file_view_ if applicable.
12469 (File_read::do_read): Use whole_file_view_ instead of contents_.
12470 (File_read::make_view): Use whole_file_view_ instead of contents_,
12471 update File_read::View::View call.
12472 (File_read::find_or_make_view): Update File_read::View::View
12473 call.
12474 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12475 remove contents_
12476 (File_read::View::Data_ownership): New enum.
12477 (File_read::View::View): Replace bool mapped_ with Data_ownership
12478 argument.
12479 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12480 (File_read::View::data_ownership_): New field.
12481 (File_read::contents_): Remove (replaced by whole_file_view_).
12482 (File_read::whole_file_view_): New field.
12483 * options.h (class General_options): Add --keep-files-mapped.
12484
24998053
CC
124852009-10-27 Cary Coutant <ccoutant@google.com>
12486
12487 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12488 * testsuite/Makefile.am (plugin_test_5): New test case.
12489 * testsuite/Makefile.in: Regenerate.
12490
72adc4fa
DK
124912009-10-25 Doug Kwan <dougkwan@google.com>
12492
12493 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12494 from private to protected to allow access by child class.
12495 (Sized_relobj::do_relocate_sections): New method declaration.
12496 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12497 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12498 Sized_relobj::relocate_sections. Instantiate template explicitly
12499 for different target sizes and endianity.
12500
07f508a2
DK
125012009-10-24 Doug Kwan <dougkwan@google.com>
12502
12503 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12504 (Arm_input_section::as_arm_input_section): New method.
12505 (Arm_output_section): New class definition.
12506 (Arm_output_section::create_stub_group,
12507 Arm_output_section::group_sections): New method definitions.
12508
10ad9fe5
DK
125092009-10-22 Doug Kwan <dougkwan@google.com>
12510
12511 * arm.cc (Arm_input_section): New class definition.
12512 (Arm_input_section::init, Arm_input_section:do_write,
12513 Arm_input_section::set_final_data_size,
12514 Arm_input_section::do_reset_address_and_file_offset): New method
12515 definitions.
12516
56ee5e00
DK
125172009-10-21 Doug Kwan <dougkwan@google.com>
12518
12519 * arm.cc (Stub_table, Arm_input_section): New forward class
12520 declarations.
12521 (Stub_table): New class defintion.
12522 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12523 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12524 New method definition.
12525
b569affa
DK
125262009-10-21 Doug Kwan <dougkwan@google.com>
12527
12528 * arm.cc: Update copyright comments.
12529 (Target_arm): New forward class template declaration.
12530 (Arm_address): New type.
12531 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12532 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12533 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12534 constants.
12535 (Insn_template): Same.
12536 (DEF_STUBS): New macro.
12537 (Stub_type): New enum type.
12538 (Stub_template): New class definition.
12539 (Stub): Same.
12540 (Reloc_stub): Same.
12541 (Stub_factory): Same.
12542 (Target_arm::Target_arm): Initialize may_use_blx_ and
12543 should_force_pic_veneer_.
12544 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12545 Target_arm::should_force_pic_veneer,
12546 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12547 Target_arm::using_thumb_only, Target_arm:;default_target): New
12548 method defintions.
12549 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12550 New data member declarations.
12551 (Insn_template::size, Insn_template::alignment): New method defintions.
12552 (Stub_template::Stub_template): New method definition.
12553 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12554 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12555 (Stub_factory::Stub_factory): New method definition.
12556 * gold.h (string_hash): New template.
12557 * output.h (Input_section_specifier::hash_value): Use
12558 gold::string_hash.
12559 (Input_section_specifier::string_hash): Remove.
12560 * stringpool.cc (Stringpool_template::string_hash): Use
12561 gold::string_hash.
12562
6c172549
DK
125632009-10-20 Doug Kwan <dougkwan@google.com>
12564
12565 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12566 symbols of relaxed input sections.
12567 * output.h (Output_section::find_relaxed_input_section): Make
12568 method public.
12569
c5617f2f
DK
125702009-10-16 Doug Kwan <dougkwan@google.com>
12571
12572 * dynobj.cc (Versions::Versions): Initialize version_script_.
12573 Only insert base version symbol definition for a shared object
12574 if version script defines any version versions.
12575 (Versions::define_base_version): New method definition.
12576 (Versions::add_def): Check that base version is not needed.
12577 (Versions::add_need): Define base version lazily.
12578 * dynobj.h (Versions::define_base_version): New method declaration.
12579 (Versions::needs_base_version_): New data member declaration.
12580 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12581 (check_DATA): Add no_version_test.stdout.
12582 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12583 New make rules.
12584 * testsuite/Makefile.in: Regenerate.
12585 * testsuite/no_version_test.c: New file.
12586 * testsuite/no_version_test.sh: Ditto.
12587
3c12dcdb
DK
125882009-10-16 Doug Kwan <dougkwan@google.com>
12589
12590 * expression.cc (class Segment_start_expression): New class definition.
12591 (Segment_start_expression::value): New method definition.
12592 (script_exp_function_segment_start): Return a new
12593 Segment_start_expression.
12594 * gold/script-c.h (script_saw_segment_start_expression): New function
12595 prototype.
12596 * script-sections.cc (Script_sections::Script_sections): Initialize
12597 SAW_SEGMENT_START_EXPRESSION_ to false.
12598 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12599 and -Tbbs options to specify section addresses if given in
12600 command line and no SEGMENT_START expression is seen in a script.
12601 * script-sections.h (Script_sections::saw_segment_start_expression,
12602 Script_sections::set_saw_segment_start_expression): New method
12603 definition.
12604 (Script_sections::saw_segment_start_expression_): New data member
12605 declaration.
12606 * script.cc (script_saw_segment_start_expression): New function.
12607 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12608 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12609 script_test_7.sh and script_test_8.sh.
12610 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12611 script_test_8.stdout.
12612 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12613 (script_test_6, script_test_6.stdout, script_test_7,
12614 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12615 * Makefile.in: Regenerate.
12616 * testsuite/script_test_6.sh: New file.
12617 * testsuite/script_test_6.t: Same.
12618 * testsuite/script_test_7.sh: Same.
12619 * testsuite/script_test_7.t: Same.
12620 * testsuite/script_test_8.sh: Same.
12621
64b1ae37
DK
126222009-10-16 Doug Kwan <dougkwan@google.com>
12623
12624 * output.cc (Output_segment::set_section_list_address): Cast
12625 expressions to unsigned long long type to avoid format warnings.
12626
661be1e2
ILT
126272009-10-15 Ian Lance Taylor <iant@google.com>
12628
12edd763 12629 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12630 dot assignment to script_sections_.
12edd763
ILT
12631 * script-sections.cc (Script_sections::add_dot_assignment):
12632 Initialize if necessary.
12633
68b6574b
ILT
12634 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12635 program headers with no load segment if there is a linker script.
12636
661be1e2
ILT
12637 * layout.cc (Layout::set_segment_offsets): Align the file offset
12638 to the segment aligment for -N or -n with no load segment.
12639 * output.cc (Output_segment::add_output_section): Don't crash if
12640 the first section is a TLS section.
12641 (Output_segment::set_section_list_addresses): Print an error
12642 message if the address moves backward in a linker script.
12643 * script-sections.cc
12644 (Output_section_element_input::set_section_addresses): Don't
12645 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12646 (Orphan_output_section::set_section_addresses): Likewise.
12647
f15f61a7
DK
126482009-10-15 Doug Kwan <dougkwan@google.com>
12649
12650 * layout.cc (Layout::finish_dynamic_section): Generate tags
12651 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12652 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12653 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12654
82bb573a
ILT
126552009-10-14 Ian Lance Taylor <iant@google.com>
12656
12657 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12658 fields.
12659 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12660 data_shdr fields of relinfo.
12661 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12662 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12663 R_386_TLS_LDO_32, adjust based on section flags.
12664 (Target_i386::Relocate::fix_up_ldo): Remove.
12665
374ad285
ILT
126662009-10-13 Ian Lance Taylor <iant@google.com>
12667
12668 Add support for -pie.
12669 * options.h (class General_options): Add -pie and
12670 --pic-executable.
12671 (General_options::output_is_position_independent): Test -pie.
12672 (General_options::output_is_executable): Return true if not shared
12673 and not relocatable.
12674 (General_options::output_is_pie): Remove.
12675 * options.cc (General_options::finalize): Reject incompatible uses
12676 of -pie.
12677 * gold.cc (queue_middle_tasks): A -pie link is not static.
12678 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12679 * symtab.cc (Symbol::final_value_is_known): Return false if
12680 output_is_position_independent.
12681 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12682 output_is_position_independent.
12683 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12684 output_is_position_independent.
12685 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12686 output_is_position_independent.
12687 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12688 two_file_pie_test.
12689 (basic_pie_test.o, basic_pie_test): New targets.
12690 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12691 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12692 (two_file_pie_test): New target.
12693 * testsuite/Makefile.in: Rebuild.
12694 * README: Remove note saying that -pie is not supported.
12695
c6585162
ILT
126962009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12697
12698 * options.h (class General_options): Add -init and -fini.
12699 * layout.cc (Layout::finish_dynamic_section): Emit
12700 given init and fini functions.
12701
032ce4e9
ST
127022009-10-13 Sriraman Tallam <tmsriram@google.com>
12703
12704 * gc.h (gc_process_relocs): Check if icf is enabled using new
12705 function.
12706 * gold.cc (queue_initial_tasks): Likewise.
12707 (queue_middle_tasks): Likewise.
12708 * object.cc (do_layout): Likewise.
12709 * symtab.cc (is_section_folded): Likewise.
12710 * main.cc (main): Likewise.
12711 * reloc.cc (Read_relocs::run): Likewise.
12712 (Sized_relobj::do_scan_relocs): Likewise.
12713 * icf.cc (is_function_ctor_or_dtor): New function.
12714 (Icf::find_identical_sections): Check if function is ctor or dtor when
12715 safe icf is chosen.
12716 * options.h (General_options::icf): Change option to be an enum.
12717 (Icf_status): New enum.
12718 (icf_enabled): New method.
12719 (icf_safe_folding): New method.
12720 (set_icf_status): New method.
12721 (icf_status_): New variable.
12722 * (options.cc) (General_options::finalize): Set icf_status_.
12723 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12724 icf_test and icf_keep_unique_test to use the --icf enum flag.
12725 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12726 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12727
f345227a
ST
127282009-10-12 Sriraman Tallam <tmsriram@google.com>
12729
12730 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12731 includes to gc.h and icf.h.
12732 * arm.cc: Include gc.h.
12733 * gold.cc: Likewise.
12734 * i386.cc: Likewise.
12735 * powerpc.cc: Likewise.
12736 * sparc.cc: Likewise.
12737 * x86_64.cc: Likewise.
12738 * gc.h: Include icf.h.
12739
1c7814ed
ILT
127402009-10-11 Ian Lance Taylor <iant@google.com>
12741
12742 * plugin.cc: Include "gold.h" before other header files.
12743
ae3b5189
CD
127442009-10-10 Chris Demetriou <cgd@google.com>
12745
12746 * options.h (Input_file_argument::Input_file_type): New enum.
12747 (Input_file_argument::is_lib_): Replace with...
12748 (Input_file_argument::type_): New member.
12749 (Input_file_argument::Input_file_argument): Take Input_file_type
12750 'type' rather than boolean 'is_lib' as second argument.
12751 (Input_file_argument::is_lib): Use type_.
12752 (Input_file_argument::is_searched_file): New function.
12753 (Input_file_argument::may_need_search): Handle is_searched_file.
12754 * options.cc (General_options::parse_library): Support -l:filename.
12755 (General_options::parse_just_symbols): Update for Input_file_argument
12756 changes.
12757 (Command_line::process): Likewise.
12758 * archive.cc (Archive::get_file_and_offset): Likewise.
12759 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12760 * script.cc (read_script_file, script_add_file): Likewise.
12761 * fileread.cc (Input_file::Input_file): Likewise.
12762 (Input_file::will_search_for): Handle is_searched_file.
12763 (Input_file::open): Likewise.
12764 * readsyms.cc (Read_symbols::get_name): Likewise.
12765 * testsuite/Makefile.am (searched_file_test): New test.
12766 * testsuite/Makefile.in: Regenerate.
12767 * testsuite/searched_file_test.cc: New file.
12768 * testsuite/searched_file_test_lib.cc: New file.
12769
f3048a1d
ILT
127702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12771 Ian Lance Taylor <iant@google.com>
12772
12773 * descriptor.cc: Include <cstdio> and "binary-io.h".
12774 (Descriptors::open): Open the files in binary mode always.
12775 * script.cc (Lex::get_token): Treat \r as whitespace.
12776
d4780e57
ILT
127772009-10-09 Ian Lance Taylor <iant@google.com>
12778
12779 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12780
d9a893b8
ILT
127812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12782 Ian Lance Taylor <iant@google.com>
12783
12784 * configure.ac: Check for readv function also.
12785 * fileread.cc (readv): Define if not HAVE_READV.
12786 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12787 does not exist.
12788 * config.in: Regenerate.
12789 * configure: Regenerate.
12790
c0a62865
DK
127912009-10-09 Doug Kwan <dougkwan@google.com>
12792
12793 * layout.cc (Layout::make_output_section): Call target hook to make
12794 ordinary output section.
12795 (Layout::finalize): Adjust parameter list of call the
12796 Target::may_relax().
12797 * layout.h (class Layout::section_list): New method.
12798 * merge.h (Output_merge_base::entsize): Change visibility to public.
12799 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12800 New methods.
12801 (Output_merge_string::do_is_string): New method.
12802 * object.cc (Sized_relobj::do_setup): renamed from
12803 Sized_relobj::set_up.
12804 * object.h (Sized_relobj::adjust_shndx,
12805 Sized_relobj::initializ_input_to_output_maps,
12806 Sized_relobj::free_input_to_output_maps): Change visibilities to
12807 protected.
12808 (Sized_relobj::setup): Virtualize.
12809 (Sized_relobj::do_setup): New method declaration.
12810 (Sized_relobj::invalidate_section_offset,
12811 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12812 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12813 * options.cc (parse_int): New function.
12814 * options.h (parse_int): New declaration.
12815 (DEFINE_int): New macro.
12816 (stub_group_size): New option.
12817 * output.cc (Output_section::Output_section): Initialize memebers
12818 merge_section_map_, merge_section_by_properties_map_,
12819 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12820 (Output_section::add_input_section): Handled deferred code-fill
12821 generation and remove an old comment.
12822 (Output_section::add_relaxed_input_section): New method definition.
12823 (Output_section::add_merge_input_section): Use merge section by
12824 properties map to speed to search. Update merge section maps
12825 as appropriate.
12826 (Output_section::build_relaxation_map): New method definition.
12827 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12828 Same.
12829 (Output_section::relax_input_section): Renamed to
12830 Output_section::convert_input_sections_to_relaxed_sections and change
12831 interface to take a vector of pointers to relaxed sections.
12832 (Output_section::find_merge_section,
12833 Output_section::find_relaxed_input_section): New method definitions.
12834 (Output_section::is_input_address_mapped,
12835 Output_section::output_offset, Output_section::output_address):
12836 Use output section data maps to speed up searching.
12837 (Output_section::find_starting_output_address): Add comments.
12838 (Output_section::do_write,
12839 Output_section::write_to_postprocessing_buffer): Do code-fill
12840 generation as appropriate.
12841 (Output_section::get_input_sections): Invalidate relaxed input section
12842 map.
12843 (Output_section::restore_states): Adjust type of checkpoint .
12844 Invalidate relaxed input section map.
12845 * output.h (Output_merge_base): New class declaration.
12846 (Input_section_specifier): New class defintion.
12847 (class Output_relaxed_input_section) Change base class to
12848 Output_section_data_build.
12849 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12850 base class initializer.
12851 (Output_section::add_relaxed_input_section): New method declaration.
12852 (Output_section::Input_section): Change visibility to protected.
2e702c99 12853 (Output_section::Input_section::relobj,
c0a62865
DK
12854 Output_section::Input_section::shndx): Handle relaxed input sections.
12855 Output_section::input_sections) Change visibility to protected. Also
12856 define overload to return a non-const pointer.
12857 (Output_section::Merge_section_properties): New class defintion.
12858 (Output_section::Merge_section_by_properties_map,
12859 Output_section::Output_section_data_by_input_section_map,
12860 Output_section::Relaxation_map): New types.
12861 (Output_section::relax_input_section): Rename method to
12862 Output_section::convert_input_sections_to_relaxed_sections and change
12863 interface to take a vector of relaxed section pointers.
12864 (Output_section::find_merge_section,
12865 Output_section::find_relaxed_input_section,
12866 Output_section::build_relaxation_map,
12867 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12868 New method declarations.
12869 (Output_section::merge_section_map_
12870 Output_section::merge_section_by_properties_map_,
12871 Output_section::relaxed_input_section_map_,
12872 Output_section::is_relaxed_input_section_map_valid_,
12873 Output_section::generate_code_fills_at_write_): New data members.
12874 * script-sections.cc
12875 (Output_section_element_input::set_section_addresses): Call
12876 current_data_size and addralign methods of relaxed input sections.
12877 (Orphan_output_section::set_section_addresses): Call current_data_size
12878 and addralign methods of relaxed input sections.
12879 * symtab.cc (Symbol_table::compute_final_value): Extract template
12880 from the body of Symbol_table::sized_finalize_symbol.
12881 (Symbol_table::sized_finalized_symbol): Call
12882 Symbol_table::compute_final_value.
12883 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12884 (Symbol_table::compute_final_value): New templated method declaration.
12885 * target.cc (Target::do_make_output_section): New method defintion.
12886 * target.h (Target::make_output_section): New method declaration.
12887 (Target::relax): Add more parameters for input objects, symbol table
12888 and layout. Adjust call to do_relax.
12889 (Target::do_make_output_section): New method declaration.
12890 (Target::do_relax): Add parameters for input objects, symbol table
12891 and layout.
12892
d446d6c4
ILT
128932009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12894
12895 * pread.c: Include stdio.h.
12896
bc06c745
ILT
128972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12898
12899 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12900 defined.
12901
75aea3d0
ILT
129022009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12903
12904 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12905 Change read_shndx type to unsigned int.
12906 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12907 int.
12908 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12909 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12910 Change read_shndx type to unsigned int.
12911 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12912 int.
12913 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12914 * layout.cc (Layout::create_symtab_sections): Cast the result of
12915 local_symcount * symsize to off_t in the gold_assert.
12916
be8fcb75
ILT
129172009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12918
12919 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12920 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12921 R_ARM_BASE_ABS.
12922 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12923 (Arm_relocate_functions::thm_abs5): New function.
12924 (Arm_relocate_functions::abs12): New function.
12925 (Arm_relocate_functions::abs16): New function.
12926 (Arm_relocate_functions::base_abs): New function.
12927 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12928 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12929 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12930 R_ARM_BASE_ABS.
12931 (Scan::global): Likewise.
12932 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12933 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12934 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12935 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12936 R_ARM_BASE_ABS.
12937
c2a122b6
ILT
129382009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12939
12940 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12941 (Arm_relocate_functions::movt_prel): New function.
12942 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12943 (Arm_relocate_functions::thm_movt_prel): New function.
12944 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12945 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12946 (Scan::global, Relocate::relocate): Likewise.
12947 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12948
c4aa1e2d
ILT
129492009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12950
12951 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12952 Incremental_checker.
12953 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12954 unsigned int.
12955 (class Incremental_inputs_header): New class.
12956 (Incremental_inputs_header_writer): Edit comment.
12957 (Incremental_inputs_entry): New class.
12958 (Incremental_inputs_entry_writer): Edit comment.
12959 (Sized_incremental_binary::do_find_incremental_inputs_section):
12960 Add *strtab_shndx parameter, fill it.
12961 (Sized_incremental_binary::do_check_inputs): New method.
12962 (Incremental_checker::can_incrementally_link_output_file): Use
12963 Sized_incremental_binary::check_inputs.
12964 (Incremental_inputs::report_command_line): Save command line in
12965 command_line_.
12966 * incremental.h:
12967 (Incremental_binary::find_incremental_inputs_section): New
12968 method.
12969 (Incremental_binary::do_find_incremental_inputs_section): Add
12970 strtab_shndx parameter.
12971 (Incremental_binary::do_check_inputs): New pure virtual method.
12972 (Sized_incremental_binary::do_check_inputs): Declare.
12973 (Incremental_checker::Incremental_checker): Add incremental_inputs
12974 parameter, use it to initialize incremental_inputs_.
12975 (Incremental_checker::incremental_inputs_): New field.
12976 (Incremental_checker::command_line): New method.
12977 (Incremental_checker::inputs): New method.
12978 (Incremental_checker::command_line_): New field.
12979
c549a694
ILT
129802009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12981
12982 * incremental.cc: Include <cstdarg> and "target-select.h".
12983 (vexplain_no_incremental): New function.
12984 (explain_no_incremental): New function.
12985 (Incremental_binary::error): New method.
12986 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12987 method.
12988 (make_sized_incremental_binary): New function.
12989 (open_incremental_binary): New function.
12990 (can_incrementally_link_file): Add checks if output is ELF and has
12991 inputs section.
12992 * incremental.h: Include "elfcpp_file.h" and "output.h".
12993 (Incremental_binary): New class.
12994 (Sized_incremental_binary): New class.
12995 (open_incremental_binary): Declare.
12996 * object.cc (is_elf_object): Use
12997 elfcpp::Elf_recognizer::is_elf_file.
12998 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12999 * output.h (Output_file::filesize): New method.
13000
fd3c5f0b
ILT
130012009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13002
13003 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13004 New function.
13005 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13006 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13007 function.
13008 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13009 function.
13010 (Arm_relocate_functions::movw_abs_nc): New function.
13011 (Arm_relocate_functions::movt_abs): New function.
13012 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13013 (Arm_relocate_functions::thm_movt_abs): New function.
13014 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13015 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13016 (Scan::global): Likewise.
13017 (Relocate::relocate): Likewise.
13018 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13019
7f5309a5
ILT
130202009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13021
13022 * arm.cc (Arm_relocate_functions::got_prel) New function.
13023 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13024 (Relocate::relocate): Likewise.
13025 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13026
364c7fa5
ILT
130272009-10-06 Ian Lance Taylor <iant@google.com>
13028
13029 * options.h (class General_options): Define
13030 split_stack_adjust_size parameter.
13031 * object.h (class Object): Add uses_split_stack_ and
13032 has_no_split_stack_ fields. Add uses_split_stack and
13033 has_no_split_stack accessor functions. Declare
13034 handle_split_stack_section.
13035 (class Reloc_symbol_changes): Define.
13036 (class Sized_relobj): Define Function_offsets. Declare
13037 split_stack_adjust, split_stack_adjust_reltype, and
13038 find_functions.
13039 * object.cc (Object::handle_split_stack_section): New function.
13040 (Sized_relobj::do_layout): Call handle_split_stack_section.
13041 * dynobj.cc (Sized_dynobj::do_layout): Call
13042 handle_split_stack_section.
13043 * reloc.cc (Sized_relobj::relocate_sections): Call
13044 split_stack_adjust for executable sections in split_stack
13045 objects. Pass reloc_map to relocate_section.
13046 (Sized_relobj::split_stack_adjust): New function.
13047 (Sized_relobj::split_stack_adjust_reltype): New function.
13048 (Sized_relobj::find_functions): New function.
13049 * target-reloc.h: Include "object.h".
13050 (relocate_section): Add reloc_symbol_changes parameter. Change
13051 all callers.
13052 * target.h (class Target): Add calls_non_split method. Declare
13053 do_calls_non_split virtual method. Declare match_view and
13054 set_view_to_nop.
13055 * target.cc: Include "elfcpp.h".
13056 (Target::do_calls_non_split): New function.
13057 (Target::match_view): New function.
13058 (Target::set_view_to_nop): New function.
13059 * gold.cc (queue_middle_tasks): Give an error if mixing
13060 split-stack and non-split-stack objects with -r.
13061 * i386.cc (Target_i386::relocate_section): Add
13062 reloc_symbol_changes parameter.
13063 (Target_i386::do_calls_non_split): New function.
13064 * x86_64.cc (Target_x86_64::relocate_section): Add
13065 reloc_symbol_changes parameter.
13066 (Target_x86_64::do_calls_non_split): New function.
13067 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13068 parameter.
13069 * powerpc.cc (Target_powerpc::relocate_section): Add
13070 reloc_symbol_changes parameter.
13071 * sparc.cc (Target_sparc::relocate_section): Add
13072 reloc_symbol_changes parameter.
13073 * configure.ac: Call AM_CONDITIONAL for the default target.
13074 * configure: Rebuild.
13075 * testsuite/Makefile.am (TEST_AS): New variable.
13076 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13077 (check_DATA): Add split_i386 and split_x86_64 files.
13078 (SPLIT_DEFSYMS): Define.
13079 (split_i386_[1234n].o): New targets.
13080 (split_i386_[124]): New targets.
13081 (split_i386_[1234r].stdout): New targets.
13082 (split_x86_64_[1234n].o): New targets.
13083 (split_x86_64_[124]): New targets.
13084 (split_x86_64_[1234r].stdout): New targets.
13085 (MOSTLYCLEANFILES): Add new executables.
13086 * testsuite/split_i386.sh: New file.
13087 * testsuite/split_x86_64.sh: New file.
13088 * testsuite/split_i386_1.s: New file.
13089 * testsuite/split_i386_2.s: New file.
13090 * testsuite/split_i386_3.s: New file.
13091 * testsuite/split_i386_4.s: New file.
13092 * testsuite/split_i386_n.s: New file.
13093 * testsuite/split_x86_64_1.s: New file.
13094 * testsuite/split_x86_64_2.s: New file.
13095 * testsuite/split_x86_64_3.s: New file.
13096 * testsuite/split_x86_64_4.s: New file.
13097 * testsuite/split_x86_64_n.s: New file.
13098 * testsuite/testfile.cc (Target_test): Update relocation_section
13099 function.
13100 * testsuite/Makefile.in: Rebuild.
13101
e8a9fcda
ILT
131022009-10-06 Ian Lance Taylor <iant@google.com>
13103
13104 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13105 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13106 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13107 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13108 the address on ldo_addrs_.
13109 (Target_i386::Relocate::fix_up_ldo): New function.
13110
e99daf92
ILT
131112009-10-06 Rafael Espindola <espindola@google.com>
13112
13113 * plugin.cc (add_input_library): New.
13114 (Plugin::load): Add add_input_library to tv.
13115 (Plugin_manager::add_input_file): Add the is_lib argument.
13116 (add_input_file): Update call to Plugin_manager::add_input_file.
13117 (add_input_library): New.
13118 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13119
966d4097
DK
131202009-09-30 Doug Kwan <dougkwan@google.com>
13121
13122 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13123 symbol and call Symbol::may_need_copy_reloc to determine if
13124 a copy reloc is needed.
13125 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13126 nocopyreloc is given in command line.
13127 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13128 given in command line.
13129 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13130 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13131 of the removed Target_i386::may_need_copy_reloc.
13132 * options.h (copyreloc): New option with default value false.
13133 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13134 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13135 instead of the removed Target_powerpc::may_need_copy_reloc.
13136 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13137 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13138 instead of the removed Target_sparc::may_need_copy_reloc.
13139 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13140 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13141 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13142 instead of the removed Target_x86_64::may_need_copy_reloc.
13143
029ba973
ILT
131442009-09-30 Ian Lance Taylor <iant@google.com>
13145
13146 * object.h (class Object): Remove target_ field, and target,
13147 sized_target, and set_target methods.
13148 (Object::sized_target): Remove.
13149 (class Sized_relobj): Update declarations. Remove sized_target.
13150 * object.cc (Sized_relobj::setup): Remove target parameter.
13151 Change all callers.
13152 (Input_objects::add_object): Don't do anything with the target.
13153 (make_elf_sized_object): Add punconfigured parameter. Change all
13154 callers. Set or test parameter target.
13155 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13156 Change all callers.
13157 * parameters.cc (Parameters::set_target): Change parameter type to
13158 be non-const.
13159 (Parameters::default_target): Remove.
13160 (set_parameters_target): Change parameter type to be non-const.
13161 (parameters_force_valid_target): New function.
13162 (parameters_clear_target): New function.
13163 * parameters.h (class Parameters): Update declarations. Remove
13164 default_target method. Add sized_target and clear_target
13165 methods. Change target_ to be non-const.
13166 (set_parameters_target): Update declaration.
13167 (parameters_force_valid_target): Declare.
13168 (parameters_clear_target): Declare.
13169 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13170 as NULL if we aren't searching.
13171 (Add_symbols::run): Don't check for compatible target.
13172 * fileread.cc (Input_file::open_binary): Call
13173 parameters_force_valid_target.
13174 * gold.cc (queue_middle_tasks): Likewise.
13175 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13176 set_target on object.
13177 * dynobj.h (class Sized_dynobj): Update declarations.
13178 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13179 make_elf_object returns NULL.
13180 (Archive::include_member): Don't check whether object target is
13181 compatible.
13182 * output.cc (Output_section::add_input_section): Get target from
13183 parameters.
13184 (Output_section::relax_input_section): Likewise.
13185 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13186 parameters.
13187 (Sized_relobj::do_scan_relocs): Likewise.
13188 (Sized_relobj::relocate_sections): Likewise.
13189 * resolve.cc (Symbol_table::resolve): Likewise.
13190 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13191 parameter. Change all callers.
13192 (Symbol_table::add_from_object): Get target from parameters.
13193 (Symbol_table::add_from_relobj): Don't check object target.
13194 (Symbol_table::add_from_dynobj): Likewise.
13195 (Symbol_table::define_special_symbol): Get target from
13196 parameters.
13197 * symtab.h (class Symbol_table): Update declaration.
13198 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13199 parameter. Change all callers. Clear parameter target.
13200 (Binary_test): Test target here.
13201 * testsuite/object_unittest.cc (gold_testsuite): Remove
13202 target_test_pointer parameter. Change all callers.
13203 (Object_test): Test target here.
13204
a6a22b83
ILT
132052009-09-26 Ian Lance Taylor <iant@google.com>
13206
13207 * testsuite/initpri1.c: Don't try to use constructor priorities if
13208 compiling with gcc before 4.3.
13209
6a8f49fe
ILT
132102009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13211
13212 * testsuite/retain_symbols_file_test.sh (check_present): Change
13213 output file name to retain_symbols_file_test.stdout.
13214 (check_absent): Likewise.
13215
8c604651
CS
132162009-09-18 Craig Silverstein <csilvers@google.com>
13217
13218 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13219 * options.cc: Include <cerrno> and <fstream>.
13220 (General_options::finalize): Parse -retain-symbols-file tag.
13221 * options.h: New flag.
13222 (General_options): New method should_retain_symbol, new
13223 variable symbols_to_retain.
13224 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13225 should_retain_symbol map.
13226 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13227 * testsuite/Makefile.in: Regenerate.
13228 * testsuite/retain_symbols_file_test.sh: New file.
13229
ca58b19f
NC
132302009-09-18 Nick Clifton <nickc@redhat.com>
13231
13232 * po/es.po: Updated Spanish translation.
13233
20e6d0d6
DK
132342009-09-17 Doug Kwan <dougkwan@google.com>
13235
13236 * debug.h (DEBUG_RELAXATION): New constant.
13237 (DEBUG_ALL): Add DEBUG_RELAXATION.
13238 (debug_string_to_enum): Add relaxation debug option.
13239 * layout.cc
13240 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13241 Layout::Relaxation_debug_check::read_sections,
13242 Layout::Relaxation_debug_check::read_sections): New method definitions.
13243 (Layout::Layout): Initialize data members
13244 record_output_section_data_from_scrips_,
13245 script_output_section_data_list_ and relaxation_debug_check_.
13246 (Layout::save_segments, Layout::restore_segments,
13247 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13248 Layout::relaxation_loop_body): New method definitions.
13249 (Layout::finalize): Support relaxation. Move section layout code to
13250 Layout::relaxation_loop_body.
13251 (Layout::set_asection_address_from_script): Move code for orphan
13252 section placement out.
13253 (Layout::place_orphan_sections_in_script): New method definition.
13254 * layout.h (Output_segment_headers, Output_file_header):
13255 New forward class declarations.
13256 (Layout::~Layout): Define.
13257 (Layout::new_output_section_data_from_script): New method definition.
13258 (Layout::place_orphan_sections_in_script): New method declaration.
13259 (Layout::Segment_states): New type declaration.
13260 (Layout::save_segments, Layout::restore_segments,
13261 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13262 Layout::relaxation_loop_body): New method declarations.
13263 (Layout::Output_section_data_list): New type declaration.
13264 (Layout::Relaxation_debug_check): New class definition.
13265 (Layout::record_output_section_data_from_script_,
13266 Layout::script_output_section_data_list_, Layout::segment_states_,
13267 Layout::relaxation_debug_check_): New data members.
13268 * output.cc: (Output_section_headers::do_size): New method definition.
13269 (Output_section_headers::Output_section_headers): Move size
13270 computation to Output_section_headers::do_size.
13271 (Output_segment_headers::do_size): New method definition.
e1df38aa 13272 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13273 Output_file_header::do_size and call it.
13274 (Output_file_header::do_size): New method definition.
13275 (Output_data_group::Output_data_group): Adjust call to
13276 Output_section_data.
13277 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13278 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13279 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13280 RELAXED_INPUT_SECTION_CODE.
13281 (Output_section::Output_section): Initialize data member checkpoint_.
13282 (Output_section::~Output_section): Delete checkpoint object pointed
13283 by checkpoint_.
13284 (Output_section::add_input_section): Always add an Input_section if
13285 relaxing.
13286 (Output_section::add_merge_input_section): Add assert.
13287 (Output_section::relax_input_section): New method definition.
13288 (Output_section::set_final_data_size): Set load address to zero for
13289 an unallocated section.
13290 (Output_section::do_address_and_file_offset_have_reset_values):
13291 New method definition.
13292 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13293 Handle relaxed input section.
13294 (Output_section::sort_attached_input_sections): Checkpoint input
13295 section list lazily.
13296 (Output_section::get_input_sections): Change type of input_sections to
13297 list of Simple_input_section pointers. Checkpoint input section list
13298 lazily. Also handle relaxed input sections.
13299 (Output_section::add_input_section_for_script): Take a reference to
13300 a Simple_input_section object instead of Relobj pointer and section
13301 index as parameter. Handle relaxed input sections.
13302 (Output_section::save_states, Output_section::restore_states): New
13303 method definitions.
13304 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13305 (Output_data::is_data_size_fixed): New method definition.
13306 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13307 if it is fixed.
13308 (Output_data::address_and_file_offset_have_reset_values): New method
13309 definition.
13310 (Output_data::do_address_and_file_offset_have_reset_values): New method
13311 definition.
13312 (Output_data::set_data_size): Check that data size is not fixed.
13313 (Output_data::fix_data_size): New method definition.
13314 (Output_data::is_data_size_fixed_): New data member.
13315 (Output_section_headers::set_final_data_size): New method definition.
13316 (Output_section_headers::do_size): New method declaration.
13317 (Output_segment_headers::set_final_data_size): New method definition.
13318 (Output_segment_headers::do_size): New method declaration.
13319 (Output_file_header::set_final_data_size)::New method definition.
13320 (Output_file_header::do_size)::New method declaration.
13321 (Output_section_data::Output_section_data): Add new parameter
13322 is_data_size_fixed and use it to fix data size.
13323 (Output_data_const::Output_data_const): Adjust call to base class
13324 constructor and fix data size.
13325 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13326 base class constructor and fix data size.
13327 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13328 base class constructor and fix data size.
13329 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13330 class constructor and fix data size.
13331 (Output_data_group::set_final_data_size): New method definition.
13332 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13333 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13334 class constructor and fix data size.
13335 (Output_relaxed_input_section): New class definition.
13336 (Output_section::Simple_input_section): New class definition.
13337 (Output_section::get_input_sections): Adjust parameter list.
13338 (Output_section::add_input_section_for_script): Same.
13339 (Output_section::save_states, Output_section::restore_states,
13340 Output_section::do_address_and_file_offset_have_reset_values,
13341 (Output_section::Input_section::Input_section): Handle
13342 RELAXED_INPUT_SECTION_CODE. Add new overload for
13343 Output_relaxed_input_section.
13344 (Output_section::Input_section::is_input_section,
13345 Output_section::Input_section::set_output_section): Handle relaxed
13346 input section.
13347 (Output_section::Input_section::is_relaxed_input_section,
13348 Output_section::Input_section::output_section_data,
13349 Output_section::Input_section::relaxed_input_section): New method
13350 definitions.
13351 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13352 value.
13353 (Output_section::Input_section::u1_): Update comments.
13354 (Output_section::Input_section::u2_): Add new union member poris.
13355 (Output_section::Checkpoint_output_section): New classs definition.
13356 (Output_section::relax_input_section): New method declaration.
13357 (Output_section::checkpoint_): New data member.
13358 (Output_segment): Update comments.
13359 (Output_segment::Output_segment): Un-privatize copy constructor.
13360 (Output_segment::operator=): Un-privatize.
13361 * script-sections.cc (Output_section_element::Input_section_list):
13362 Change element type to Output_section::Simple_input_section.
13363 (Output_section_element_dot_assignment::set_section_addresses):
13364 Register output section data for relaxation clean up.
13365 (Output_data_exression::Output_data_expression): Adjust call to base
13366 constructor to fix data size.
13367 (Output_section_element_data::set_section_addresses): Register
13368 Output_data_expression object for relaxation clean up.
13369 (struct Input_section_info): Replace Relobj pointer and section index
13370 pair with Output_section::Simple_input_section and Convert struct to a
13371 class.
13372 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13373 Input_section_info data member to use accessors.
20e6d0d6
DK
13374 (Output_section_element_input::set_section_addresses): Use layout
13375 parameter. Adjust code to use Output_section::Simple_input_section
13376 and Input_secction_info classes. Register filler for relaxation
13377 clean up.
13378 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13379 and section index pair with Output_section::Simple_input_section
13380 class. Adjust code accordingly.
13381 (Phdrs_element::release_segment): New method definition.
13382 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13383 segment list.
13384 (Script_sections::release_segments): New method definition.
13385 * gold/script-sections.h (Script_sections::release_segments): New
13386 method declaration.
13387 * gold/target.h (Target::may_relax, Target::relax,
13388 Target::do_may_relax, Target::do_relax): New method definitions.
13389
5e445df6
ILT
133902009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13391
13392 * arm.cc (has_signed_unsigned_overflow): New function.
13393 (Arm_relocate_functions::abs8): New function.
13394 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13395 (Target_arm::Scan::global): Likewise.
13396 (Target_arm::relocate::relocate): Likewise.
13397 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13398 Likewise.
13399
8c604651 134002009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13401
13402 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13403 * testsuite/Makefile.in: Regenerate.
13404
1e9cc1c2
NC
134052009-09-11 Nick Clifton <nickc@redhat.com>
13406
13407 * po/gold.pot: Updated by the Translation project.
13408
6a89f575
CC
134092009-09-08 Cary Coutant <ccoutant@google.com>
13410
13411 * output.cc (Output_file::open): Add execute permission to empty file.
13412 * testsuite/Makefile.am (permission_test): New test.
13413 * testsuite/Makefile.in: Regenerate.
13414
fdcac5af
ILT
134152009-09-02 Ian Lance Taylor <iant@google.com>
13416
13417 * output.cc (Output_file::resize): Call map_no_anonymous rather
13418 than map.
13419
44453f85
ILT
134202009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13421
13422 * gold.cc: Include "incremental.h".
13423 (queue_initial_tasks): Call Incremental_checker methods.
13424 * incremental.cc: Include "output.h".
13425 (Incremental_checker::can_incrementally_link_output_file): New
13426 method.
13427 * incremental.h (Incremental_checker): New class.
13428
13429 * output.cc (Output_file::open_for_modification): New method.
13430 (Output_file::map_anonymous): Changed return type to bool. Record
13431 map in base_ field.
13432 (Output_file::map_no_anonymous): New method, broken out of map.
13433 (Output_file::map): Use map_no_anonymous and map_anonymous.
13434 * output.h (class Output_file): Update declarations.
13435
293c1386
CC
134362009-08-24 Cary Coutant <ccoutant@google.com>
13437
13438 * options.h (Command_line::Pre_options): New class.
13439 (Command_line::pre_options): New member.
13440 * options.cc (gold::options::ready_to_register): New variable.
13441 (One_option::register_option): Do nothing if not registering options.
13442 Assert if same short option registered twice.
13443 (General_options::General_options): Turn off option registration when
13444 done constructing.
13445 (Command_line::Pre_options::Pre_options): New constructor.
13446
f773f3d2
CC
134472009-08-24 Cary Coutant <ccoutant@google.com>
13448
06a73cfe
CC
13449 * options.h (General_options::no_keep_memory): Remove incorrect
13450 short option.
f773f3d2 13451
a15af8e2
RW
134522009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13453
13454 * Makefile.am (am__skiplex, am__skipyacc): New.
13455 * Makefile.in: Regenerate.
13456
c462b41b
RW
134572009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13458
14ec8efd
RW
13459 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13460 (INCLUDES): ... this.
13461 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13462 (AM_CPPFLAGS): Renamed from ...
13463 (INCLUDE): ... this.
13464 * Makefile.in, testsuite/Makefile.in: Regenerate.
13465
81ecdfbb
RW
13466 * Makefile.in: Regenerate.
13467 * aclocal.m4: Likewise.
13468 * config.in: Likewise.
13469 * configure: Likewise.
13470 * testsuite/Makefile.in: Likewise.
13471
c462b41b
RW
13472 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13473 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13474 * Makefile.in: Regenerate.
13475 * testsuite/Makefile.in: Regenerate.
13476
2da73f13
CC
134772009-08-19 Cary Coutant <ccoutant@google.com>
13478
13479 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13480 symbols in shared libraries overridden by hidden or internal symbols
13481 in the main program.
13482
2db70501
CD
134832009-08-19 Chris Demetriou <cgd@google.com>
13484
13485 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13486 checking source file names in error messages.
13487
f733487b
DK
134882009-08-18 Doug Kwan <dougkwan@google.com>
13489
13490 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13491 an elcpp::Ehdr as parameter. Adjust call to set_target.
13492 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13493 an elfcpp::Ehdr as parameter.
13494 * object.cc (Object::set_target): Remove the version that looks up
13495 a target and sets it.
13496 (Sized_relobj::setup): Take a Target object instead of
13497 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13498 (make_elf_sized_object): Find target and ask target to
13499 make an ELF object.
13500 * object.h: (Object::set_target): Remove the version that looks up
13501 a target and sets it.
13502 (Sized_relobj::setup): Take a Target object instead of
13503 an elfcpp:Ehdr as parameter.
13504 * target.cc: Include dynobj.h.
13505 (Target::do_make_elf_object_implementation): New.
2e702c99 13506 (Target::do_make_elf_object): New.
f733487b
DK
13507 * target.h (Target::make_elf_object): New template declaration.
13508 (Target::do_make_elf_object): New method declarations.
13509 (Target::do_make_elf_object_implementation): New template declaration.
13510
cc70f101
ILT
135112009-08-14 Ian Lance Taylor <iant@google.com>
13512
13513 * gold.h (FUNCTION_NAME): Define.
13514 (gold_unreachable): Use FUNCTION_NAME.
13515
ef5e0cb1
ST
135162009-08-12 Sriraman Tallam <tmsriram@google.com>
13517
13518 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13519 symbol in the --keep-unique list is not found.
13520
48c187ce
ST
135212009-08-12 Sriraman Tallam <tmsriram@google.com>
13522
13523 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13524 been maked as --keep-unique.
13525 (Icf::unfold_section): New function.
13526 * icf.h (Icf::unfold_section): New function.
13527 * options.h (General_options::keep_unique): New option.
13528 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13529 * testsuite/Makefile.in: Regenerate.
13530 * testsuite/icf_keep_unique_test.sh: New file.
13531 * testsuite/icf_keep_unique_test.cc: New file.
13532
645afe0c
CC
135332009-08-12 Cary Coutant <ccoutant@google.com>
13534
13535 PR 10471
13536 * resolve.cc (Symbol_table::resolve): Check for references from
13537 dynamic objects to hidden and internal symbols.
13538 * testsuite/Makefile.am (hidden_test.sh): New test.
13539 * testsuite/Makefile.in: Regenerate.
13540 * testsuite/hidden_test.sh: New script.
13541 * testsuite/hidden_test_1.c: New test source.
13542 * testsuite/hidden_test_main.c: New test source.
13543
11af873f
DK
135442009-08-11 Doug Kwan <dougkwan@google.com>
13545
13546 * arm.cc: Update comments.
13547 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13548 segment to locate the .ARM.exidx section if present.
13549
b9f7d72d
DK
135502009-08-09 Doug Kwan <dougkwan@google.com>
13551
13552 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13553 patch.
13554
ddd3c53c
ST
135552009-08-07 Sriraman Tallam <tmsriram@google.com>
13556 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13557 compiler warnings.
13558
27721062
ST
135592009-08-06 Sriraman Tallam <tmsriram@google.com>
13560
13561 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13562 valid tls_segment only for non-debug-section relocations.
13563 * testsuite/Makefile.am: Add gc_tls_test.
13564 * testsuite/Makefile.in: Regenerate.
13565 * testsuite/gc_tls_test.cc: New file.
13566 * testsuite/gc_tls_test.sh: New file.
13567
ef15dade 135682009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13569
ef15dade
ST
13570 * icf.cc: New file.
13571 * icf.h: New file.
13572 * Makefile.am (CCFILES): Add icf.cc.
13573 (HFILES): Add icf.h
13574 * Makefile.in: Regenerate.
13575 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13576 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13577 section, symbol and addend information for the relocs.
13578 * gold.cc (queue_middle_tasks): Call identical code folding.
13579 * gold.h: Add defines for multimap.
13580 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13581 to the call of finalize_local_symbols.
13582 * main.cc (main): Create object of class Icf.
13583 * object.cc (Sized_relobj::do_layout): Allow this function to be
13584 called twice during icf.
13585 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13586 to sections marked as identical by icf.
13587 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13588 when available.
13589 (Sized_relobj::do_section_entsize): New function.
13590 * object.h (Object::section_entsize): New function.
13591 (Object::do_section_entsize): New pure virtual function.
13592 (Relobj::finalize_local_symbols): Add new parameter.
13593 (Relobj::do_section_entsize): New function.
13594 * options.h (General_options::icf): New option.
13595 (General_options::icf_iterations): New option.
13596 (General_options::print_icf_sections): New option.
13597 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13598 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13599 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13600 icf.
13601 * symtab.cc (Symbol_table::is_section_folded): New function.
13602 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13603 to sections marked as identical by icf.
13604 * symtab.h (Symbol_table::set_icf): New function.
13605 (Symbol_table::icf): New function.
13606 (Symbol_table::is_section_folded): New function.
13607 (Symbol_table::icf_): New data member.
13608 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13609 * testsuite/Makefile.am: Add commands to build icf_test.
13610 * testsuite/Makefile.in: Regenerate.
13611 * testsuite/icf_test.sh: New file.
13612 * testsuite/icf_test.cc: New file.
13613
c3b65ac4
CD
136142009-07-24 Chris Demetriou <cgd@google.com>
13615
13616 * layout.cc (is_compressible_debug_section): Fix incorrect
13617 comment about compressed section names.
13618
1caf2c51
ILT
136192009-07-20 Ian Lance Taylor <ian@airs.com>
13620
13621 PR 10419
13622 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13623
1ef4d87f
ILT
136242009-07-16 Ian Lance Taylor <iant@google.com>
13625
13626 PR 10400
13627 * layout.h: #include <map>.
13628 (class Kept_section): Change from struct to class. Add accessors
13629 and setters. Add section size to Comdat_group mapping. Change
13630 Comdat_group to std::map. Add is_comdat_ field. Add
13631 linkonce_size field in union.
13632 (class Layout): Update declaration of find_or_add_kept_section.
13633 Don't declare find_kept_object.
13634 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13635 parameter. Add object, shndx, is_comdat, and is_group_name
13636 parameters. Change all callers. Adjust for new Kept_section.
13637 (Layout::find_kept_object): Remove.
13638 * object.cc (Sized_relobj::include_section_group): Update use of
13639 Kept_section. Rename secnum to shndx. Only record
13640 Kept_comdat_section if sections are the same size.
13641 (Sized_relobj::include_linkonce_section): Update use of
13642 Kept_section. Only record Kept_comdat_section if sections are the
13643 same size. Set size of linkonce section.
13644 (Sized_relobj::map_to_kept_section): Update call to
13645 get_kept_comdat_section.
13646 * object.h (class Sized_relobj): Rename fields in
13647 Kept_comdat_section to drop trailing underscores; change object
13648 field to Relobj*. Change Kept_comdat_section_table to store
13649 struct rather than pointer.
13650 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13651 Add kept_object and kept_shndx parameters. Change all callers.
13652 (Sized_relobj::get_kept_comdat_section): Change return type to
13653 bool. Add kept_object and kept_shndx parameters. Change all
13654 callers.
13655 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13656 Layout::find_or_add_kept_section.
13657
37c3b7b0
ILT
136582009-07-09 Ian Lance Taylor <iant@google.com>
13659
13660 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13661 Reserve space in the hash table.
13662
98fa85cb
ILT
136632009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13664
13665 * fileread.cc (File_read::get_mtime): New method.
13666 * fileread.h (Timespec): New structure.
13667 (File_read::get_mtime): New method.
13668 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13669 Renamed from timestamp_nsec.
13670 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13671 Elf_Xword.
e1df38aa 13672 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13673 timestamp_nsec.
e1df38aa 13674 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13675 (Incremental_inputs::report_obejct): Save mtime; style fix.
13676 (Incremental_inputs::report_script): Save mtime; style fix.
13677 (Incremental_inputs::finalize_inputs): Style fix.
13678 (Incremental_inputs::finalize): Style fix.
13679 (Incremental_inputs::create_input_section_data): Store inputs
13680 mtime.
13681 * incremental.h (Incremental_inputs::report_script): Add mtime
13682 argument.
13683 (Incremental_inputs::Input_info::Input_info): Intialize only one
13684 union member.
13685 (Incremental_inputs::Input_info::archive): Move to nameless
13686 union.
13687 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13688 (Incremental_inputs::Input_info::script): Move to nameless union.
13689 (Incremental_inputs::mtime): New field.
13690 * script.cc (read_input_script): Pass file mtime to
13691 Incremental_input.
13692 * script.h (Script_info::inputs): Style fix.
13693
c9d70757
ILT
136942009-07-01 Ian Lance Taylor <ian@airs.com>
13695
13696 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13697 instead of 32.
13698
9c547ec3
ILT
136992009-06-24 Ian Lance Taylor <iant@google.com>
13700
13701 PR 10156
13702 * layout.cc (Layout::choose_output_section): If we find an
13703 existing section, update the flags.
13704 (Layout::create_notes): New function, broken out of
13705 Layout::finalize.
13706 (Layout::finalize): Don't create note sections.
13707 (Layout::create_note): Don't crash if linker script discards
13708 section.
13709 (Layout::create_gold_note): Likewise.
13710 (Layout::create_build_id): Likewise. Don't set
13711 after_input_sections on the section.
13712 (Layout::create_executable_stack_info): Remove target parameter.
13713 Change caller.
13714 * layout.h (class Layout): Declare create_notes. Update
13715 declaration of create_executable_stack_info.
13716 * gold.cc (queue_middle_tasks): Call create_notes.
13717 * output.cc (Output_section::update_flags_for_input_section): Move
13718 here from output.h. If SHF_ALLOC flag is newly set, mark address
13719 invalid.
13720 * output.h (Output_data::mark_address_invalid): New function.
13721 (class Output_section): Only declare, not define,
13722 update_flags_for_input_section. Remove set_flags.
13723
55458500
ILT
137242009-06-24 Ian Lance Taylor <iant@google.com>
13725
13726 * script-sections.cc (Output_section_definition::
13727 set_section_addresses): Rename shadowing local load_address to
13728 laddr.
13729
1307d6cd
ILT
137302009-06-24 Ian Lance Taylor <iant@google.com>
13731
13732 PR 10244
13733 * reloc.cc (relocate_sections): Skip empty relocation sections.
13734
ec3f783e
ILT
137352009-06-23 Ian Lance Taylor <iant@google.com>
13736
13737 PR 10156
13738 * layout.cc (Layout::create_note): Use choose_output_section
13739 rather than make_output_section.
13740
459c9f1c
ILT
137412009-06-23 Ian Lance Taylor <iant@google.com>
13742
13743 PR 10237
13744 * options.cc (General_options::parse_V): Set printed_version_.
13745 (General_options::General_options): Initialize printed_version_.
13746 * options.h (class General_options): Add printed_version_ field.
13747 * gold.cc (queue_initial_tasks): If there are no input files,
13748 don't give a fatal error if we printed the version information.
13749 (queue_middle_tasks): If using -r with a shared object, give a
13750 fatal error rather than an ordinary error.
13751
1518dc8f
ILT
137522009-06-23 Ian Lance Taylor <iant@google.com>
13753
13754 PR 10219
13755 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13756 (Layout::make_output_section): Set have_stabstr_section_ if we see
13757 a .stab*str section.
13758 (Layout::finalize): Call link_stabs_sections.
13759 (Layout::link_stabs_sections): New file.
13760 * layout.h (class Layout): Add have_stabstr_section_ field.
13761 Declare link_stabs_sections.
13762
3d857b98
DK
137632009-06-23 Doug Kwan <dougkwan@google.com>
13764
13765 * Makefile.am (libgold_a_LIBADD): New.
13766 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13767 * Makefile.in: Regenerate.
3d857b98
DK
13768 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13769 * configure: Regenerate.
13770 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13771 * fileread.cc: Include sys/state.h
13772 * gold.h: Declare memmem and strndup if found missing.
13773 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13774
0639a6f6
ILT
137752009-06-23 Ian Lance Taylor <iant@google.com>
13776
13777 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13778 * configure: Rebuild.
13779
8d63875c
ILT
137802009-06-23 Ian Lance Taylor <iant@google.com>
13781
13782 PR 10147
13783 * object.cc (Object::section_contents): Don't try to get a view if
13784 the section has length zero.
13785 (Object::handle_gnu_warning_section): If the section is empty, use
13786 the name of the section as the warning.
13787
f7c8a183
ILT
137882009-06-23 Ian Lance Taylor <iant@google.com>
13789
13790 PR 10133
13791 * stringpool.h (class Stringpool_template): Add optimize_ field.
13792 (Stringpool_template::set_optimize): New function.
13793 * stringpool.cc (Stringpool_template::Stringpool_template):
13794 Initialize optimize_ field.
13795 (Stringpool_template::set_string_offsets): Test local optimize
13796 fild rather than parameter.
13797 * layout.cc (Layout::Layout): Call set_optimize on the section
13798 name stringpool.
13799
e6a307ba
ILT
138002009-06-22 Ian Lance Taylor <iant@google.com>
13801
13802 PR 10030
13803 * yyscript.y: Parse TARGET.
13804 * script.cc (script_set_target): New function.
13805 * script-c.h (script_set_target): Declare.
13806 * options.cc (General_options::string_to_object_format): Rename
13807 from string_to_object_format in anonymous namespace. Change
13808 callers.
13809 * options.h (class General_options): Declare
13810 string_to_object_format.
13811
3ee173de
ILT
138122009-06-22 Ian Lance Taylor <iant@google.com>
13813
13814 * script-sections.cc (Script_sections::create_segments): Don't put
13815 program headers in a PT_LOAD segment if -n or -N.
13816
138172009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13818
13819 PR 10141
13820 * options.h (class General_options): Add -z lazy and -z now. Sort
13821 -z options into alphabetical order.
13822 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13823
cd6739a1 138242009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13825
13826 * layout.cc (Layout::make_output_section): Call
13827 Target::new_output_section.
13828 (Layout::attach_allocated_section_to_segment): Put large section
13829 sections in a separate load segment with the large segment flag
13830 set.
13831 (Layout::segment_precedes): Sort large data segments after other
13832 load segments.
13833 (align_file_offset): New static function.
13834 (Layout::set_segment_offsets): Use align_file_offset.
13835 * output.h (class Output_section): Add is_small_section_ and
13836 is_large_section_ fields.
13837 (Output_section::is_small_section): New function.
13838 (Output_section::set_is_small_section): New function.
13839 (Output_section::is_large_section): New function.
13840 (Output_section::set_is_large_section): New function.
13841 (Output_section::is_large_data_section): New function.
13842 (class Output_segment): Add is_large_data_segment_ field.
13843 (Output_segment::is_large_data_segment): New function.
13844 (Output_segment::set_is_large_data_segment): New function.
13845 * output.cc (Output_section::Output_section): Initialize new
13846 fields.
13847 (Output_segment::Output_segment): Likewise.
13848 (Output_segment::add_output_section): Add assertion that large
13849 data sections always go in large data segments. Force small data
13850 sections to the end of the list of data sections. Force small BSS
13851 sections to the start of the list of BSS sections. For large BSS
13852 sections to the end of the list of BSS sections.
13853 * symtab.h (class Symbol): Declare is_common_shndx.
13854 (Symbol::is_defined): Check Symbol::is_common_shndx.
13855 (Symbol::is_common): Likewise.
13856 (class Symbol_table): Define enum Commons_section_type. Update
13857 declarations. Add small_commons_ and large_commons_ fields.
13858 * symtab.cc (Symbol::is_common_shndx): New function.
13859 (Symbol_table::Symbol_table): Initialize new fields.
13860 (Symbol_table::add_from_object): Put small and large common
13861 symbols in the right list.
13862 (Symbol_table::sized_finalized_symbol): Check
13863 Symbol::is_common_shndx.
13864 (Symbol_table::sized_write_globals): Likewise.
13865 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13866 common symbol lists. Don't call do_allocate_commons_list if the
13867 list is empty.
13868 (Symbol_table::do_allocate_commons_list): Remove is_tls
13869 parameter. Add comons_section_type parameter. Change all
13870 callers. Handle small and large common symbols.
13871 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13872 Symbol::is_common_shndx.
13873 * resolve.cc (symbol_to_bits): Likewise.
13874 * target.h (Target::small_common_shndx): New function.
13875 (Target::small_common_section_flags): New function.
13876 (Target::large_common_shndx): New function.
13877 (Target::large_common_section_flags): New function.
13878 (Target::new_output_section): New function.
13879 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13880 small_common_section_flags, and large_common_section_flags
13881 fields.
13882 (Target::do_new_output_section): New virtual function.
13883 * arm.cc (Target_arm::arm_info): Initialize new fields.
13884 * i386.cc (Target_i386::i386_info): Likewise.
13885 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13886 Likewise.
13887 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13888 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13889 (Target_x86_64::do_new_output_section): New function.
13890 * configure.ac: Define conditional MCMODEL_MEDIUM.
13891 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13892 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13893 (large_LDFLAGS): Define.
13894 * testsuite/large.c: New file.
13895 * testsuite/testfile.cc (Target_test::test_target_info):
13896 Initialize new fields.
13897 * configure, testsuite/Makefile.in: Rebuild.
13898
bb04269c
DK
138992009-06-05 Doug Kwan <dougkwan@google.com>
13900
13901 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13902 * Makefile.in: Regenerate.
bb04269c
DK
13903 * i386.cc (class Target_i386): Define new virtual method to
13904 override do_is_local_label_name in parent.
13905 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13906 local symbols if --discard-locals or -X is given.
13907 * options.h (class General_options): Declare new options
13908 '--discard-locals' and '-X' for discarding locals.
13909 * target.h (class Target): Define new methods is_local_label_name.
13910 Declare new virtual method do_is_local_label_name.
13911 * target.cc: New file.
13912 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13913 (check_SCRIPTS): Add discard_locals_test.sh.
13914 (check_DATA): Add discard_local_tests.syms.
13915 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13916 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13917 * testsuite/Makefile.in: Regenerate.
13918 * testsuite/discard_locals_test.c: New file.
13919 * testsuite/discard_locals_test.sh: Same.
13920
805bb01c
DK
139212009-06-05 Doug Kwan <dougkwan@google.com>
13922
13923 * object.cc (Sized_relobj::Sized_relobj): Initialize
13924 discarded_eh_frame_shndx_ to -1U.
13925 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13926 section.
13927 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13928 a discarded .eh_frame section.
13929 (Sized_relobj::do_finalize_local_symbols): Ditto.
13930 * object.h (class Sized_relobj): Declare new member
13931 discarded_eh_frame_shndx_.
13932 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13933 (local_labels_test.o, local_labels_test): New rules.
13934 * testsuite/Makefile.in: Regenerate.
13935
1dcd334d
DK
139362009-06-04 Doug Kwan <dougkwan@google.com>
13937
13938 * layout.cc (Layout::section_name_mapping): Add mapping for
13939 special ARM sections.
13940
96d49306
DK
139412009-06-03 Doug Kwan <dougkwan@google.com>
13942
13943 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13944 (utils::has_overflow): Same.
13945
dff16297
ILT
139462009-06-03 Ian Lance Taylor <iant@google.com>
13947
13948 * layout.cc (Layout::section_name_mapping): New array, replacing
13949 Layout::linkonce_mapping.
13950 (Layout::section_name_mapping_count): New variable, replacing
13951 Layout::linkonce_mapping_count.
13952 (Layout::linkonce_output_name): Remove.
13953 (Layout::output_section_name): Rewrite.
13954 * layout.h (class Layout): Rename Linkonce_mapping to
13955 Section_name_mapping, linkonce_mapping to section_name_mapping,
13956 linkonce_mapping_count to section_name_mapping_count. Don't
13957 declare linkonce_output_name.
13958
c121c671
DK
139592009-06-03 Doug Kwan <dougkwan@google.com>
13960
13961 * gold/arm.cc (namespace utils): New.
13962 (Target_arm::reloc_is_non_pic): Define new method.
13963 (class Arm_relocate_functions): New.
13964 (Target_arm::Relocate::relocate): Handle relocation types used by
13965 Android.
13966
07800fab
ILT
139672009-06-03 Ian Lance Taylor <iant@google.com>
13968
13969 * arm.cc (Target_arm::scan::global): Use || instead of |.
13970
c121c671
DK
139712009-06-02 Doug Kwan <dougkwan@google.com>
13972
13973 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13974 issued_non_pic_error_.
13975 (class Target_arm::Scan): Declare new method check_non_pic.
13976 Define new method symbol_needs_plt_entry.
13977 Declare new data member issued_non_pic_error_.
13978 (class Target_arm::Relocate): Declare new method
13979 should_apply_static_reloc.
13980 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13981 (Target_arm::Scan::check_non_pic): Define new method.
13982 (Target_arm::Scan::local): Handle a small subset of reloc types used
13983 by Android.
13984 (Target_arm::Scan::local): Same.
13985 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13986
b19b0c6d
ILT
139872009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13988
13989 * incremental.cc (Incremental_inputs::report_command_line): Filter
13990 out --incremental-* options.
13991
94cdfcff
DK
139922009-05-29 Doug Kwan <dougkwan@google.com>
13993
13994 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13995 template class.
13996 (class Target_arm): Update comment.
13997 (Target_arm::Target_arm): Initialize new data members GOT_,
13998 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13999 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14000 and Target_arm::rel_dyn_section.
14001 Declare new_enum Target_arm::Got_type.
14002 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14003 and DYNBSS_.
14004 Update commments for member do_dynsym_value.
14005 (Target_arm::got_size, Target_arm::plt_section,
14006 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14007 new methods inside class defintion.
14008 (Target_arm::got_section): Define new method.
14009 (Target_arm::rel_dyn_section): Same.
14010 (Output_data_plt_arm): New template class.
14011 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14012 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14013 (Output_data_plt_arm::add_entry): Same.
14014 (Output_data_plt_arm::first_plt_entry): Define new
14015 static data member for PLT instruction template.
14016 (Output_data_plt_arm::plt_entry): Same.
14017 (Output_data_plt_arm::do_write): Define new method.
14018 (Target_arm::make_plt_entry): Same.
14019 (Target_arm::do_finalize_sections): Same.
14020 (Target_arm::do_dynsym_value): Same.
14021
4a657b0d
DK
140222009-05-28 Doug Kwan <dougkwan@google.com>
14023
14024 * Makefile.am (TARGETSOURCES): Add arm.cc.
14025 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14026 * Makefile.in: Regenerate.
14027 * arm.cc: New file.
14028 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14029
e7ae8c36
DK
140302009-05-26 Doug Kwan <dougkwan@google.com>
14031
14032 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14033 (General_options::check_excluded_libs): Strip off directories in
14034 archive name before matching like GNU ld does.
14035 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14036 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14037 (exclude_libs_test_LDFLAGS): Add linker option
14038 -Wl,--exclude-libs,libexclude_libs_test_3
14039 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14040 an explicit archive without using -l.
14041 (alt/libexclude_libs_test_3.a): New make rule.
14042 * testsuite/Makefile.in: Regenerate.
14043 * testsuite/exclude_libs_test.c : Declare lib3_default().
14044 (main): Call it.
14045 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14046 * exclude_libs_test_3.c: New file.
14047
f12e7348
NC
140482009-05-26 Nick Clifton <nickc@redhat.com>
14049
14050 * po/id.po: New Indonesian translation.
14051 * po/gold.pot: Updated template file.
14052
4daadc0d
ST
140532009-05-22 Sriraman Tallam <tmsriram@google.com>
14054
e1df38aa 14055 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14056 gc_comdat_test files. Add -Wl,--gc-sections to build
14057 gc_comdat_test.
14058 * testsuite/Makefile.in: Regenerate.
14059 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14060
531813ad
ST
140612009-05-21 Sriraman Tallam <tmsriram@google.com>
14062
14063 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14064 kept comdat section was garbage collected.
14065 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14066 * testsuite/Makefile.in: Regenerate.
14067 * testsuite/gc_comdat_test.sh: New file.
14068 * testsuite/gc_comdat_test_1.cc: New file.
14069 * testsuite/gc_comdat_test_2.cc: New file.
14070
65514900
CC
140712009-05-19 Doug Kwan <dougkwan@google.com>
14072
14073 * archive.cc (Archive::Archive): Move constructor from archive.h
14074 to here. Initialize no_export_.
14075 (Archive::get_elf_object_for_member): Set no_export flag of object.
14076 * archive.h (Archive::Archive): Move constructor body to
14077 archive.cc.
14078 (Archive::no_export): New method.
14079 (Archive::no_export_): New field.
14080 * object.h (Object::Object): Initialize no_export_ to false.
14081 (Object::no_export, Object::set_no_export): New methods.
14082 (Object::no_export_): New field.
14083 * options.cc (General_options::parse_exclude_libs): New method.
14084 (General_options::check_excluded_libs) Same.
14085 * options.h (exclude_libs): New option.
14086 (General_options::check_excluded_libs): New method declaration.
14087 (General_options::excluded_libs_): New field.
14088 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14089 default or protected visibility if an object has no-export flag set.
14090 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14091 (check_SCRIPTS): Add exclude_libs_test.sh.
14092 (check_DATA): Add exclude_libs_test.syms.
14093 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14094 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14095 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14096 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14097 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14098 libexclude_libs_test_2.a): New rules.
14099 * testsuite/Makefile.in: Regenerate.
14100 * testsuite/exclude_libs_test.c: New file.
14101 * testsuite/exclude_libs_test.sh: Ditto.
14102 * testsuite/exclude_libs_test_1.c: Ditto.
14103 * testsuite/exclude_libs_test_2.c: Ditto.
14104
1b77ea50
ILT
141052009-05-15 Ian Lance Taylor <iant@google.com>
14106
14107 * configure.ac: Check for declarations for cases where libiberty.h
14108 checks HAVE_DECL_xxx.
14109 * configure, config.in: Rebuild.
14110
072fe7ce
ILT
141112009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14112
14113 * gold.h (Incremental_argument_list): Remove (invalid) forward
14114 declaration.
14115 * incremental.cc (Incremental_inputs::report_achive): New method.
14116 (Incremental_inputs::report_object): New method.
14117 (Incremental_inputs::report_script): New method.
14118 (Incremental_inputs::finalize_inputs): New method.
14119 (Incremental_inputs::finalize): Call finalize_inputs().
14120 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14121 Create inputs entries.
14122 * incremental.h (Incremental_input_type): New enum.
14123 (Incremental_inputs::Incremental_input): Initialize new fields.
14124 (Incremental_inputs::report_inputs): New method.
14125 (Incremental_inputs::report_achive): New method.
14126 (Incremental_inputs::report_object): New method.
14127 (Incremental_inputs::report_script): New method.
14128 (Incremental_inputs::finalize_inputs): New method.
14129 (Incremental_inputs::Input_info): New struct.
14130 (Incremental_inputs::Input_info_map): New typedef.
14131 (Incremental_inputs::lock_): New field.
14132 (Incremental_inputs::Inputs_): New field.
14133 (Incremental_inputs::Inputs_map): New field.
14134 * main.cc (main): Call Incremental_input::report_inputs.
14135 * options.h (Input_argument_list): Typedef moved from
14136 Input_arguments.
14137 (Input_file_group::Files): Remove, use ::Input_argument_list.
14138 (Input_file_group::Input_argument_list): Remove, use
14139 ::Input_argument_list.
14140 * plugin.cc (Plugin_manager::add_input_file): Add error in
14141 incremental build.
14142 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14143 functions.
14144 * script.cc (read_input_script): Call
14145 Incremental_input::report_script.
14146 * script.h (Script_info): New class.
14147
b0481b0b
ILT
141482009-04-27 Ian Lance Taylor <iant@google.com>
14149
14150 * x86_64.cc (do_adjust_output_section): Set entsize to
14151 plt_entry_size.
14152
b22a5a41 141532009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14154
14155 * output.cc (Output_file::close): After short writes, continue
14156 writing from the correct offset in the buffer being written.
14157
40fde488
CD
141582009-04-23 Chris Demetriou <cgd@google.com>
14159
14160 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14161 * configure: Regenerate.
14162 * config.in: Regenerate.
14163 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14164 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14165
3ce2c28e
ILT
141662009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14167
14168 * incremental.cc (Incremental_inputs_header_data): Renamed from
14169 Incremental_input_header_data.
14170 (Incremental_inputs_header_data::data_size): New field.
14171 (Incremental_inputs_header_data::put_input_file_count): Renamed
14172 from input_file_count.
14173 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14174 from command_line_offset.
14175 (Incremental_inputs_header_data::put_reserved): Renamed from
14176 put_reserved.
14177 (Incremental_inputs_entry_data): Renamed from
14178 Incremental_input_entry_data.
14179 (Incremental_inputs_entry_data::data_size): New field.
14180 (Incremental_inputs::report_command_line): New method.
14181 (Incremental_inputs::finalize): New method.
14182 (Incremental_inputs::create_incremental_inputs_data): New method.
14183 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14184 * incremental.h: New file.
14185 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14186 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14187 incremental builds.
703d02da 14188 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14189 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14190 (Layout::create_incremental_info_sections): New method.
14191 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14192 * main.cc (main): Notify Incremental_input of the command line.
14193
e55bde5e
ILT
141942009-04-01 Ian Lance Taylor <iant@google.com>
14195 Mikolaj Zalewski <mikolajz@google.com>
14196
14197 * gold.h (reserve_unordered_map): Define, three versions, one for
14198 each version of Unordered_map.
14199 * layout.cc (Layout::Layout): Remove options parameter. Add
14200 number_of_input_files parameter. Don't initialize options_.
14201 Initialize number_of_input_files_ and resized_signatures_. Move
14202 sections_are_attached_.
14203 (Layout::layout_group): Reserve space for group_signatures_.
14204 (Layout::find_or_add_kept_section): Change name parameter to be a
14205 reference. Resize signatures_ map when it gets large enough.
14206 (Layout::layout_eh_frame): Use parameters->options() instead of
14207 this->options_.
14208 (Layout::make_output_section): Likewise.
14209 (Layout::attach_allocated_section_to_segment): Likewise.
14210 (Layout::finalize, Layout::create_executable_stack): Likewise.
14211 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14212 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14213 * layout.h (class Layout): Update declarations. Remove options_
14214 field. Add number_of_input_files_ and resized_signatures_
14215 fields. Move sections_are_attached_ field.
14216 * main.cc (main): Pass number of input files to Layout
14217 constructor. Don't pass options.
14218
154b857c
ILT
142192009-03-30 Ian Lance Taylor <iant@google.com>
14220
14221 * ffsll.c (ffsll): Correct implementation.
14222
2f35ab9b
ILT
142232009-03-27 Ian Lance Taylor <iant@google.com>
14224
fd03461a
ILT
14225 * ffsll.c: New file.
14226 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14227 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14228 * ftruncate.c (ftruncate): Declare before definition.
14229 * mremap.c (mremap): Likewise.
14230 * pread.c (pread): Likewise.
14231 * configure, Makefile.in, config.in: Rebuild.
14232
2f35ab9b
ILT
14233 * mremap.c: New file.
14234 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14235 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14236 (mremap): Declare if HAVE_MREMAP is not defined.
14237 * configure, Makefile.in, config.in: Rebuild.
14238
33aea2fd
CC
142392009-03-27 Cary Coutant <ccoutant@google.com>
14240
14241 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14242 position independent.
14243 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14244 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14245
6d479619
CC
142462009-03-24 Cary Coutant <ccoutant@google.com>
14247
14248 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14249 an executable.
14250 (needs_dynamic_reloc): Likewise.
14251
afc06bb8
ILT
142522009-03-24 Ian Lance Taylor <iant@google.com>
14253
14254 * yyscript.y (file_cmd): Recognize EXTERN.
14255 (extern_name_list, extern_name_list_body): New nonterminals.
14256 * script.cc (script_add_extern): Define.
14257 * script-c.h (script_add_extern): Declare.
14258
f6060a4d
ILT
142592009-03-24 Rafael Avila de Espindola <espindola@google.com>
14260
14261 * object.cc (is_elf_object): Define.
14262 * object.h (is_elf_object): Declare.
14263 * archive.cc (Archive::get_elf_object_for_member): Call
14264 is_elf_object.
33aea2fd 14265 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14266
26736d8e
ILT
142672009-03-24 Elliott Hughes <enh@google.com>
14268
14269 * output.cc (Output_file::map_anonymous): Define.
14270 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14271 try an anonymous one. Report the size if the mmap fails.
14272 * output.h (class Output_file): Declare map_anonymous.
14273
22fd9730
ILT
142742009-03-24 Ian Lance Taylor <iant@google.com>
14275
14276 * target-select.cc (instantiate_target): Don't acquire the lock if
14277 the instantiated_target_ field has already been set.
14278
cb010894
ILT
142792009-03-23 Ian Lance Taylor <iant@google.com>
14280
7f055c20
ILT
14281 * gold-threads.h (class Initialize_lock): Define.
14282 * gold-threads.cc (class Initialize_lock_once): Define.
14283 (initialize_lock_control): New static variable.
14284 (initialize_lock_pointer): New static variable.
14285 (initialize_lock_once): New static function.
14286 (Initialize_lock::Initialize_lock): Define.
14287 (Initialize_lock::initialize): Define.
14288 * target-select.h: Include "gold-threads.h".
14289 (class Target_selector): Add lock_ and initialize_lock_ fields.
14290 Don't define instantiate_target, just declare it.
14291 * target-select.cc (Target_selector::Target_selector): Initialize
14292 new fields.
14293 (Target_selector::instantiate_target): Define.
14294 * descriptors.h: Include "gold-threads.h".
14295 (class Descriptors): Add initialize_lock_ field.
14296 * descriptors.cc (Descriptors::Descriptors): Initialize new
14297 field.
14298 (Descriptors::open): Use initialize_lock_ field
14299 * errors.h (class Errors): Add initialize_lock_ field.
14300 * errors.cc (Errors::Errors): Initialize new field.
14301 (Errors::initialize_lock): Use initialize_lock_ field.
14302 * powerpc.cc (class Target_selector_powerpc): Remove
14303 instantiated_target_ field. In do_recognize call
14304 instantiate_target rather than do_instantiate_target. In
14305 do_instantiate_target just allocate a new target.
14306 * sparc.cc (class Target_selector_sparc): Likewise.
14307
36959681
ILT
14308 * freebsd.h: New file.
14309 * i386.cc: Include "freebsd.h".
14310 (Target_i386): Derive from Target_freebsd rather than
14311 Sized_target.
14312 (Target_selector_i386): Derive from Target_selector_freebsd rather
14313 than Target_selector.
14314 * x86_64.cc: Include "freebsd.h".
14315 (Target_x86_64): Derive from Target_freebsd rather than
14316 Sized_target.
14317 (Target_selector_x86_64): Derive from Target_selector_freebsd
14318 rather than Target_selector.
14319 * target.h (class Target): Add adjust_elf_header and
14320 do_adjust_elf_header.
14321 * output.cc (Output_file_header:: do_sized_write): Call target
14322 adjust_elf_header routine.
14323 * configure.tgt: Set targ_osabi.
14324 * configure.ac: Define GOLD_DEFAULT_OSABI.
14325 * parameters.cc (Parameters::default_target): Pass
14326 GOLD_DEFAULT_OSABI to select_target.
14327 * target-select.h (class Target_selector): Make instantiate_target
14328 protected rather than private.
14329 * Makefile.am (HFILES): Add freebsd.h.
14330 * configure, Makefile.in, config.in: Rebuild.
14331
cb010894
ILT
14332 * merge.cc (do_add_input_section): Correct pend value. Change
14333 message about last entry not being null terminated from error to
14334 warning.
14335
0e879927
ILT
143362009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14337
14338 * incremental.cc: New file.
14339 * Makefile.am (CCFILES): Add incremental.cc.
14340 * Makefile.in: Rebuild.
14341
41105937
PP
143422009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14343
14344 * layout.cc (Layout::output_section_name): Preserve names
14345 of '.note.' sections.
e1df38aa 14346
60439920
ILT
143472009-03-19 Ian Lance Taylor <iant@google.com>
14348
14349 * descriptors.cc (Descriptors::open): Check that the options are
14350 valid before using them.
14351
0d371ad3
ILT
143522009-03-18 Ian Lance Taylor <iant@google.com>
14353
14354 * script-sections.h: Include <list>.
14355 (class Script_sections): Change Sections_elements from std::vector
14356 to std::list. Typedef public Elements_iterator. Add
14357 orphan_section_placement_, data_segment_align_start_, and
14358 saw_data_segment_align_ fields. Remove data_segment_align_index_
14359 field.
14360 * script-sections.cc (class Orphan_section_placement): New class.
14361 (class Sections_element): Add virtual functions is_relro and
14362 orphan_section_init. Remove virtual function place_orphan_here.
14363 (class Output_section_definition): Add is_relro and
14364 orphan_section_init. Remove place_orphan_here.
14365 (class Orphan_output_section): Likewise.
14366 (Script_sections::Script_sections): Update for field changes.
14367 (Script_sections::data_segment_align): Set saw_data_segment_align_
14368 and data_segment_align_start_, not data_segment_align_index.
14369 (Script_sections::data_segment_relro_end): Check
14370 saw_data_segment_align_. Use data_segment_align_start_ rather
14371 than data_segment_align_index_.
14372 (Script_sections::place_orphan): Rewrite to use
14373 Orphan_section_placement.
14374
9201d894
ILT
143752009-03-17 Ian Lance Taylor <iant@google.com>
14376
9c5b8369
ILT
14377 * archive.cc (Archive::add_symbols): Check for a version attached
14378 to the symbol name in the archive map.
14379 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14380 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14381 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14382 (ver_test_11.a): New target.
14383 * testsuite/Makefile.in: Rebuild.
14384
9201d894
ILT
14385 * configure.ac: Check for chsize and posix_fallocate. Replace
14386 ftruncate.
14387 * ftruncate.c: New file, from gnulib.
14388 * output.cc (posix_fallocate): Define dummy version if not
14389 HAVE_POSIX_FALLOCATE.
14390 (Output_file::map): Call posix_fallocate rather than lseek and
14391 write.
14392 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14393 * configure, Makefile.in, config.in: Rebuild.
14394
ef4ab7a8 143952009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14396
ef4ab7a8
PP
14397 * layout.h (Layout::create_note): Add section_name parameter.
14398 * layout.cc (Layout::create_note): Likewise.
14399 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14400
8c500701
ILT
144012009-03-17 Ian Lance Taylor <iant@google.com>
14402
e85b18e1
ILT
14403 * descriptors.cc: Include "options.h".
14404 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14405 (Descriptors::open): Always use O_CLOEXEC when opening a new
14406 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14407 then set FD_CLOEXEC.
14408
9efe6174
ILT
14409 * sparc.cc (class Target_sparc): Add has_got_section.
14410 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14411 make sure we have a GOT section.
14412
14413 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14414 (Target_sparc::Scan::local): Likewise.
14415 (Target_sparc::Scan::global): Likewise.
14416 (Target_sparc::Relocate::relocate): Likewise.
14417 (Target_sparc::Relocate::relocate_tls): Likewise.
14418
8c500701
ILT
14419 * symtab.cc (Symbol_table::define_default_version): New function,
14420 broken out of add_from_object.
14421 (Symbol_table::add_from_object): Call define_default_version.
14422 (Symbol_table::define_special_symbol): Add resolve_oldsym
14423 parameter. Change all callers. If the version for a symbol comes
14424 from a version script, resolve it with the symbol with the same
14425 name with no version. Also add the symbol without a version if
14426 appropriate.
14427 (do_define_in_output_data): If resolving with oldsym, don't delete
14428 sym.
14429 (do_define_in_output_segment): Likewise.
14430 (do_define_as_constant): Likewise.
14431 * symtab.h (class Symbol_table): Update declarations.
14432
f1ed28fb
ILT
144332009-03-13 Ian Lance Taylor <iant@google.com>
14434
15f8229b
ILT
14435 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14436 (Read_symbols::requeue): New function.
14437 (Read_symbols::do_read_symbols): If make_elf_object fails because
14438 the target type is not configured, and the file was searched for,
14439 issue a warning and retry with the next directory.
14440 (Add_symbols::run): If the file has an incompatible format, and
14441 it was searched for, requeue the Read_symbols task. On error,
14442 release the object.
14443 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14444 dirindex parameter to constructor. Change all callers. Declare
14445 incompatible_warning and requeue.
14446 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14447 input_argument_ and input_group_ fields. Add them to
14448 constructor. Change all callers.
14449 (class Read_script): Add dirindex_ field. Add it to constructor.
14450 Change all callers.
14451 * archive.cc (Archive::setup): Remove input_objects parameter.
14452 Change all callers.
14453 (Archive::get_file_and_offset): Likewise.
14454 (Archive::read_all_symbols): Likewise.
14455 (Archive::read_symbols): Likewise.
14456 (Archive::get_elf_object_for_member): Remove input_objects
14457 parameter. Add punconfigured parameter. Change all callers.
14458 (Archive::add_symbols): Change return type to bool. Check return
14459 value of include_member.
14460 (Archive::include_all_members): Likewise.
14461 (Archive::include_member): Change return type to bool. Return
14462 false if first included object has incompatible target. Set
14463 included_member_ field.
14464 (Add_archive_symbols::run): If add_symbols returns false, requeue
14465 Read_symbols task.
14466 * archive.h (class Archive): Add included_member_ field.
14467 Initialize it in constructor. Add input_file and searched_for
14468 methods. Update declarations.
14469 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14470 input_argument_ fields. Add them to constructor. Change all
14471 callers.
14472 * script.cc: Include "target-select.h".
14473 (class Parser_closure): Add skip_on_incompatible_target_ and
14474 found_incompatible_target_ fields. Add
14475 skip_on_incompatible_target parameter to constructor. Change all
14476 callers. Add methods skip_on_incompatible_target,
14477 clear_skip_on_incompatible_target, found_incompatible_target, and
14478 set_found_incompatible_target.
14479 (read_input_script): Add dirindex parameter. Change all callers.
14480 If parser finds an incompatible target, requeue Read_symbols
14481 task.
14482 (script_set_symbol): Clear skip_on_incompatible_target in
14483 closure.
14484 (script_add_assertion, script_parse_option): Likewise.
14485 (script_start_sections, script_add_phdr): Likewise.
14486 (script_check_output_format): New function.
14487 * script.h (read_input_script): Update declaration.
14488 * script-c.h (script_check_output_format): Declare.
14489 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14490 (ignore_cmd): Remove OUTPUT_FORMAT.
14491 * fileread.cc (Input_file::Input_file): Add explicit this.
14492 (Input_file::will_search_for): New function.
14493 (Input_file::open): Add pindex parameter. Change all callers.
14494 * fileread.h (class Input_file): Add input_file_argument method.
14495 Declare will_search_for. Update declarations.
14496 * object.cc (make_elf_object): Add punconfigured parameter.
14497 Change all callers.
14498 * object.h (class Object): Make input_file public. Add
14499 searched_for method.
14500 (make_elf_object): Update declaration.
14501 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14502 restart search.
14503 * dirsearch.h (class Dirsearch): Update declaration.
14504 * options.h (class General_options): Add --warn-search-mismatch.
14505 * parameters.cc (Parameters::is_compatible_target): New function.
14506 * parameters.h (class Parameters): Declare is_compatible_target.
14507 * workqueue.cc (Workqueue::add_blocker): New function.
14508 * workqueue.h (class Workqueue): Declare add_blocker.
14509
f1ed28fb
ILT
14510 * fileread.cc (Input_file::open): Remove options parameter.
14511 Change all callers.
14512 (Input_file::open_binary): Likewise.
14513 * script.cc (read_input_script): Likewise.
14514 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14515 options parameter from constructor. Change all callers.
14516 (class Read_script): Likewise.
14517 * fileread.h (class Input_file): Update declarations.
14518 * script.h (read_input_script): Update declaration.
14519
34dd024a
NC
145202009-03-10 Nick Clifton <nickc@redhat.com>
14521
14522 * po/es.po: New Spanish translation.
14523
6d71b17c
CC
145242009-03-06 Cary Coutant <ccoutant@google.com>
14525
14526 * options.cc (parse_short_option): Keep dash_z from registering itself.
14527
031cdbed
ILT
145282009-03-03 Ian Lance Taylor <iant@google.com>
14529
14530 PR 9918
14531 * target-reloc.h (relocate_section): Pass output_section to
14532 relocate.
14533 * i386.cc (Target_i386::should_apply_static_reloc): Add
14534 output_section parameter. Change all callers.
14535 (Target_i386::Relocate::relocate): Add output_section parameter.
14536 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14537 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14538 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14539 * testsuite/two_file_shared.sh: New script.
14540 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14541 (check_DATA): Add two_file_shared.dbg.
14542 (two_file_shared.dbg): New target.
14543 * testsuite/Makefile.in: Rebuild.
14544
15d5fa16
ILT
145452009-03-01 Ian Lance Taylor <iant@google.com>
14546
14547 * configure.ac: Check for byteswap.h.
14548 * configure: Rebuild.
14549 * config.in: Rebuild.
14550
8a4c0b0d
ILT
145512009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14552
14553 * layout.cc (Layout::find_or_add_kept_section): New function.
14554 (Layout::add_comdat): Removed.
14555 * layout.h (struct Kept_section): Move out of class Layout.
14556 Remove trailing underscores from field names. Add group_sections
14557 field. Rename group_ field to is_group. Change all uses.
14558 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14559 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14560 comdat_groups_ field.
14561 (Sized_relobj::include_section_group): Use
14562 find_or_add_kept_section and Kept_section::group_sections.
14563 (Sized_relobj::include_linkonce_section): Likewise.
14564 * object.cc (class Sized_relobj): Don't define Comdat_group or
14565 Comdat_group_table. Remove find_comdat_group and
14566 add_comdat_group. Remove comdat_groups_ field.
14567 * plugin.cc (include_comdat_group): Use
14568 Layout::find_or_add_kept_section.
14569
b4ecf66b
ILT
145702009-02-28 Ian Lance Taylor <iant@google.com>
14571
14359ca0
ILT
14572 * README: --gc-sections and map files are now supported. Document
14573 some build requirements.
14574
b4ecf66b
ILT
14575 PR 6992
14576 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14577 relocatable link set the value of the section symbol to zero.
14578 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14579 relocatable link don't include the section address in the local
14580 symbol value.
14581
0602e05a
ILT
145822009-02-27 Ian Lance Taylor <iant@google.com>
14583
fd9d194f
ILT
14584 PR 6811
14585 * options.h (class Search_directory): Add is_system_directory.
14586 (class General_options): Declare is_in_system_directory.
14587 * options.cc (get_relative_sysroot): Make static.
14588 (get_default_sysroot): Make static.
14589 (General_optoins::is_in_system_directory): New function.
14590 * fileread.cc (Input_file::is_in_system_directory): New function.
14591 * fileread.h (class Input_file): Declare is_in_system_directory.
14592 * object.h (class Object): Add is_in_system_directory.
14593 (class Input_objects): Remove system_library_directory_ field.
14594 * object.cc (Input_objects::add_object): Don't set
14595 system_library_directory_.
14596 (input_objects::found_in_system_library_directory): Remove.
14597 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14598 parameter. Change all callers.
14599 (Symbol_table::sized_write_globals): Likewise.
14600 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14601 Call Object::is_in_system_directory.
14602 * symtab.h (class Symbol_table): Update declarations.
14603
61edd21f
ILT
14604 PR 5990
14605 * descriptors.h (Open_descriptor): Add is_on_stack field.
14606 * descriptors.cc (Descriptors::open): If the descriptor is on the
14607 top of the stack, remove it. Initialize is_on_stack field.
14608 (Descriptors::release): Only add pod to stack if it is not on the
14609 stack already.
14610 (Descriptors::close_some_descriptor): Clear stack_next and
14611 is_on_stack fields.
14612
e29e076a
ILT
14613 PR 7091
14614 * output.cc (Output_section::find_starting_output_address): Rename
14615 from starting_output_address; add PADDR parameter; change return
14616 type.
14617 * output.h (class Output_section): Declare
14618 find_starting_output_address instead of starting_output_address.
14619 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14620 section symbol for which we can't find a merge section.
14621
0602e05a
ILT
14622 PR 9836
14623 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14624 hidden or internal, force the symbol to be local.
14625 * resolve.cc (Symbol::override_visibility): Define.
14626 (Symbol::override_base): Use override_visibility.
14627 (Symbol_table::resolve): Likewise.
14628 (Symbol::override_base_with_special): Likewise.
14629 (Symbol_table::override_with_special): If the visibility is hidden
14630 or internal, force the symbol to be local.
14631 * symtab.h (class Symbol): Add set_visibility and
14632 override_visibility.
14633 * testsuite/ver_test_1.sh: New file.
14634 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14635 (check_DATA): Add ver_test_1.syms.
14636 (ver_test_1.syms): New target.
14637 * testsuite/Makefile.in: Rebuild.
14638
401a9a73
CC
146392009-02-25 Cary Coutant <ccoutant@google.com>
14640
14641 * layout.cc (Layout::choose_output_section): Don't rename sections
14642 when using a linker script that has a SECTIONS clause.
14643 * Makefile.in: Regenerate.
14644
14645 * testsuite/Makefile.am (script_test_5.sh): New test case.
14646 * testsuite/Makefile.in: Regenerate.
14647 * testsuite/script_test_5.cc: New file.
14648 * testsuite/script_test_5.sh: New file.
14649 * testsuite/script_test_5.t: New file.
14650
f488e4b0
CC
146512009-02-13 Rafael Avila de Espindola <espindola@google.com>
14652
14653 * archive.cc (Archive::include_member): Update calls to add_symbols.
14654 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14655 the Layout argument.
14656 * dynobj.h (do_add_symbols): Add the Layout argument.
14657 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14658 Layout argument.
14659 * object.h (Object::add_symbols): Add the Layout argument.
14660 (Object::do_add_symbols): Add the Layout argument.
14661 (Sized_relobj::do_add_symbols): Add the Layout argument.
14662 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14663 Unify the two versions.
14664 (Add_plugin_symbols): Remove.
14665 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14666 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14667 (Add_plugin_symbols): Remove.
14668 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14669 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14670 (Add_symbols::run): Make it work with Pulginobj.
14671
89dd1680
ILT
146722009-02-06 Ian Lance Taylor <iant@google.com>
14673
14674 * object.cc (Sized_relobj::do_layout): Make info message start
14675 with lower case letter.
14676
266d0a74
ILT
146772009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14678
602b464e
ILT
14679 * binary.cc: Fix file comment.
14680
266d0a74
ILT
14681 * options.h (enum Incremental_disposition): Define.
14682 (class General_options): Add new options: --incremental,
14683 --incremental_changed, --incremental_unchanged,
14684 --incremental_unknown. Add incremental_disposition_ and
14685 implicit_incremental_ fields.
14686 (General_options::incremental_disposition): New function.
14687 (class Position_dependent_options): Add incremental_disposition
14688 option.
14689 (Position_dependent_options::copy_from_options): Set incremental
14690 dispositions.
14691 * options.cc (General_options::parse_incremental_changed): New
14692 function.
2e702c99
RM
14693 (General_options::parse_incremental_unchanged): New function.
14694 (General_options::parse_incremental_unknown): New function.
14695 (General_options::General_options): Initialize new fields
266d0a74 14696 incremental_disposition_ and implicit_incremental_.
2e702c99 14697 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14698 without --incremental.
14699
f073bbf7
CD
147002009-02-06 Chris Demetriou <cgd@google.com>
14701
14702 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14703 pointer and to report location as the file name associated with
14704 the symbol.
14705 (gold_undefined_symbol_at_location): New function to replace the
14706 old gold_undefined_symbol functionality.
14707 * target-reloc.h (relocate_section): Update to use
14708 gold_undefined_symbol_at_location.
14709 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14710 Call gold_undefined_symbol function rather than gold_error.
14711 * errors.h (Errors::undefined_symbol): Take location as a
14712 string, rather than calculating it from a relocation.
14713 * errors.cc (Errors::fatal): Print "fatal error:" before the
14714 formatted message.
14715 (Errors::error, Errors::error_at_location): Print "error: "
14716 before the formatted message.
14717 (Errors::undefined_symbol): Take location as a string, rather
14718 than calculating it from a relocation.
14719 (gold_undefined_symbol_at_location): New function akin to
14720 old gold_undefined_symbol, calculates location from relocation.
14721 (gold_undefined_symbol): Change to take only a Symbol pointer
14722 and to report location as the file name associated with the symbol.
14723 * testsuite/debug_msg.sh: Update for changed error messages.
14724 * testsuite/undef_symbol.sh: Likewise.
14725
8e94a90c
ILT
147262009-02-04 Duncan Sands <baldrick@free.fr>
14727
14728 PR 9812
14729 * reduced_debug_output.h
14730 (Output_reduced_debug_abbrev_section::failed): Use format for
14731 gold_warning.
14732 (Output_reduced_debug_info_section::faild): Likewise.
14733
88a0e15b
ILT
147342009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14735
14736 * script.cc (Lazy_demangler): New class.
2e702c99 14737 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14738 symbol only once.
14739
5efc7cd2
CC
147402009-01-29 Cary Coutant <ccoutant@google.com>
14741
14742 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14743 to __tls_get_addr.
14744 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14745
e0ebcf42
ILT
147462009-01-28 Ian Lance Taylor <iant@google.com>
14747
5efc7cd2 14748 * version.cc (version_string): Bump to 1.9.
75fe7426 14749
e0ebcf42
ILT
14750 * gold.h: Include <cstring> and <stdint.h>.
14751 * version.cc: Include <cstdio>.
14752 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14753 warning.
14754 * reduced_debug_output.cc (insert_into_vector): Rename from
14755 Insert_into_vector; change all callers. Use Swap_unaligned to
14756 avoid aliasing issue; remove union since it is unnecessary.
14757
8e2813be 147582009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14759
14760 * Makefile.am (CCFILES): Add gc.cc.
14761 (HFILES): Add gc.h.
14762 * Makefile.in: Regenerate.
14763 * gold.cc (Gc_runner): New class.
14764 (queue_initial_tasks): Call garbage collection related tasks
14765 when corresponding options are invoked.
14766 (queue_middle_gc_tasks): New function.
14767 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14768 processed early before laying out sections during garbage collection.
14769 * gold.h (queue_middle_gc_tasks): New function.
14770 (is_prefix_of): Move from "layout.cc".
14771 * i386.cc (Target_i386::gc_process_relocs): New function.
14772 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14773 * main.cc (main): Create object of class "Garbage_collection".
14774 * object.cc (Relobj::copy_symbols_data): New function.
14775 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14776 (Sized_relobj::do_layout): Allow this function to be called twice
14777 during garbage collection and defer layout of section during the
6d03d481
ST
14778 first call.
14779 * object.h (Relobj::get_symbols_data): New function.
14780 (Relobj::is_section_name_included): New function.
14781 (Relobj::copy_symbols_data): New function.
14782 (Relobj::set_symbols_data): New function.
14783 (Relobj::get_relocs_data): New function.
14784 (Relobj::set_relocs_data): New function.
14785 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14786 (Relobj::gc_process_relocs): New function.
14787 (Relobj::do_gc_process_relocs): New pure virtual function.
14788 (Relobj::sd_): New data member.
14789 (Sized_relobj::is_output_section_offset_invalid): New function.
14790 (Sized_relobj::do_gc_process_relocs): New function.
14791 * options.h (General_options::gc_sections): Modify to not be a no-op.
14792 (General_options::print_gc_sections): New option.
14793 * plugin.cc (Plugin_finish::run): Remove function call to
14794 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14795 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14796 * reloc.cc (Read_relocs::run): Add task to process relocs and
14797 determine unreferenced sections when doing garbage collection.
14798 (Gc_process_relocs): New class.
14799 (Sized_relobj::do_gc_process_relocs): New function.
14800 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14801 sections that are garbage collected.
14802 * reloc.h (Gc_process_relocs): New class.
14803 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14804 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14805 symbols whose corresponding sections are garbage collected.
14806 (Symbol_table::Symbol_table): Add new parameter for the garbage
14807 collection object.
14808 (Symbol_table::gc_mark_undef_symbols): New function.
14809 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14810 (Symbol_table::gc_mark_dyn_syms): New function.
14811 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14812 as garbage.
14813 (Symbol_table::add_from_object): Likewise.
14814 (Symbol_table::add_from_relobj): When building shared objects, do not
14815 treat externally visible symbols as garbage.
14816 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14817 table information for static and relocatable links.
14818 * symtab.h (Symbol_table::set_gc): New function.
14819 (Symbol_table::gc): New function.
14820 (Symbol_table::gc_mark_undef_symbols): New function.
14821 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14822 (Symbol_table::gc_mark_dyn_syms): New function.
14823 (Symbol_table::gc_): New data member.
e1df38aa 14824 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14825 function.
14826 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14827 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14828
3b293544
CF
148292009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14830
14831 * options.h (General_options::gc_sections): Define as a no-op for now.
14832 (General_options::no_keep_memory): Ditto.
14833 (General_options::Bshareable): Define.
14834 * options.cc (General_options::finalize): Honor -Bshareable.
14835
83d22aa8
AS
148362009-01-20 Andreas Schwab <schwab@suse.de>
14837
14838 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14839 read the value in the contents, since we don't use it. Use the
14840 template endianness when writing.
14841 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14842
cd536b21
AS
148432009-01-19 Andreas Schwab <schwab@suse.de>
14844
14845 * configure.tgt (powerpc64-*): Fix targ_obj.
14846
99e9a495
ILT
148472009-01-15 Ian Lance Taylor <iant@google.com>
14848
14849 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14850 local symbols when stripping all symbols.
14851
bbbfea06
CC
148522009-01-14 Cary Coutant <ccoutant@google.com>
14853
99e9a495 14854 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14855
0f7c0701
CC
148562009-01-14 Cary Coutant <ccoutant@google.com>
14857
14858 * archive.cc (Archive::get_elf_object_for_member): Remove call
14859 to File_read::claim_for_plugin.
14860 * descriptors.cc (Descriptors::open): Remove reference to
14861 is_claimed.
14862 (Descriptors::claim_for_plugin): Remove.
14863 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14864 (Descriptors::is_claimed): Remove.
14865 (claim_descriptor_for_plugin): Remove.
14866 * fileread.cc (File_read::claim_for_plugin): Remove.
14867 * fileread.h (File_read::claim_for_plugin): Remove.
14868 (File_read::descriptor): Reopen descriptor if necessary.
14869 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14870 (Plugin_manager::all_symbols_read): Add task parameter. Change
14871 all callers.
14872 (Plugin_manager::get_input_file): New function.
14873 (Plugin_manager::release_input_file): New function.
14874 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14875 corresponding data member.
14876 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14877 and pass to base constructor. Change all callers.
14878 (get_input_file, release_input_file): New functions.
14879 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14880 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14881 (Plugin_manager::all_symbols_read): Add task parameter.
14882 (Plugin_manager::get_input_file): New function.
14883 (Plugin_manager::release_input_file): New function.
14884 (Plugin_manager::task_): New data member.
14885 (Pluginobj::Pluginobj): Add filesize parameter.
14886 (Pluginobj::filename): New function.
14887 (Pluginobj::descriptor): New function.
14888 (Pluginobj::filesize): New function.
14889 (Pluginobj::filesize_): New data member.
14890 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14891 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14892 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14893
14894 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14895 with archive libraries.
14896 * testsuite/Makefile.in: Regenerate.
14897 * testsuite/plugin_test.c (struct sym_info): New type.
14898 (get_input_file, release_input_file): New static variables.
14899 (onload): Capture new transfer vector entries.
14900 (claim_file_hook): Stop reading at end of file according to filesize.
14901 Factor out parsing of readelf output into separate function.
14902 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14903 APIs and get the source file name from the symbol table. Convert
14904 source file name to corresponding object file name. Print info
14905 message when adding new input files.
14906 (parse_readelf_line): New function.
14907 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14908 * testsuite/plugin_test_2.sh: Likewise.
14909 * testsuite/plugin_test_3.sh: Likewise.
14910 * testsuite/plugin_test_4.sh: New test case.
14911
62a6d109
ILT
149122009-01-07 Ian Lance Taylor <iant@google.com>
14913
14914 * version.cc (version_string): Bump to 1.8.
14915
483620e8
CC
149162008-12-23 Cary Coutant <ccoutant@google.com>
14917
14918 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14919 * plugin.cc (Plugin_manager::finish): Rename as
14920 layout_deferred_objects. Move cleanup to separate function.
14921 (Plugin_manager::cleanup): New function.
14922 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14923 separately.
14924 * plugin.h (Plugin_manager::finish): Rename as
14925 layout_deferred_objects.
14926 (Plugin_manager::cleanup): New function.
14927 (Plugin_manager::cleanup_done): New field.
14928
d66a9eb3
CC
149292008-12-23 Cary Coutant <ccoutant@google.com>
14930
14931 * plugin.cc (is_visible_from_outside): New function.
14932 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14933 so we don't return "IR only" status for exported symbols or -r links.
14934
14935 * testsuite/Makefile.am (plugin_test_3): New test case.
14936 * testsuite/Makefile.in: Regenerate.
14937 * testsuite/plugin_test_3.sh: New file.
14938
5995b570
CC
149392008-12-22 Cary Coutant <ccoutant@google.com>
14940
14941 * object.cc (Sized_relobj::layout_section): New function.
14942 (Sized_relobj::do_layout): Defer layout of input sections until after
14943 plugin has provided replacement files.
14944 (Sized_relobj::do_layout_deferred_sections): New function.
14945 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14946 (Relobj::layout_deferred_sections): New function.
14947 (Relobj::do_layout_deferred_sections): New function.
14948 (Sized_relobj::do_layout_deferred_sections): New function.
14949 (Sized_relobj::layout_section): New function.
14950 (Sized_relobj::Deferred_layout): New structure.
14951 (Sized_relobj::deferred_layout_): New field.
14952 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14953 Change all callers. Layout deferred sections.
14954 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14955 references.
14956 (Plugin_hook::run): Move code from do_plugin_hook inline.
14957 (Plugin_hook::do_plugin_hook): Remove.
14958 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14959 (Plugin_manager::finish): Renamed, was cleanup.
14960 (Plugin_manager::should_defer_layout): New function.
14961 (Plugin_manager::add_deferred_layout_object): New function.
14962 (Plugin_manager::Deferred_layout_list): New type.
14963 (Plugin_manager::deferred_layout_objects_): New field.
14964 (Plugin_hook::do_plugin_hook): Remove.
14965
ee769c88
ILT
149662008-12-17 Ian Lance Taylor <iant@google.com>
14967
14968 * options.h (class General_options): Add --no case for
14969 --export-dynamic.
14970
abc8dcba
CC
149712008-12-16 Cary Coutant <ccoutant@google.com>
14972
14973 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14974 vector.
14975 (Plugin_manager::claim_file): Create plugin object even if
14976 plugin did not call the add_symbols callback.
14977 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14978 asking for more symbols than were added.
14979 * testsuite/Makefile.am (plugin_test_1): Add test case with
14980 no global symbols.
14981 (empty.syms): New target.
14982 * testsuite/Makefile.in: Regenerate.
14983 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14984 message. Don't call add_symbols if no globals.
14985 (all_symbols_read_hook): Don't provide replacement for empty
14986 claimed file.
14987
b0074644
ILT
149882008-12-12 Ian Lance Taylor <iant@google.com>
14989
68943102
ILT
14990 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14991 r_type == 0 for a local symbol with r_sym == 0.
14992 (scan_relocatable_relocs): Pass r_sym to
14993 local_non_section_strategy.
14994 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14995 r_sym parameter.
14996
b0074644
ILT
14997 * configure.ac: Update test for TLS descriptors: they are
14998 supported as of glibc 2.9.
14999 * configure: Rebuild.
15000
c2508178
ILT
150012008-12-11 Ian Lance Taylor <iant@google.com>
15002
15003 PR 7091
15004 * target-reloc.h (Default_scan_relocatable_relocs): For each
15005 function, map r_type == 0 to RELOC_DISCARD.
15006
2756a258
CC
150072008-12-10 Cary Coutant <ccoutant@google.com>
15008
15009 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15010 object to override a kept COMDAT group from a plugin object.
15011
bb6f53d3
ILT
150122008-12-09 Ian Lance Taylor <iant@google.com>
15013
fbc558e1
ILT
15014 PR 7088
15015 * yyscript.y (file_cmd): Handle INPUT.
15016
bb6f53d3
ILT
15017 * testsuite/initpri1.c: Change all declarations to be full
15018 prototypes by adding void, to avoid compiler warnings.
15019
4674ecfc
CC
150202008-12-05 Rafael Avila de Espindola <espindola@google.com>
15021
15022 * options.cc (General_options::parse_plugin_opt): New.
15023 (General_options::add_plugin): The argument now is just the filename.
15024 (General_options::add_plugin_option): New.
15025 * options.h (plugin_opt): New.
15026 (add_plugin): Change argument name.
15027 (add_plugin_option): New.
15028 * plugin.cc (Plugin::load): Don't parse the plugin option.
15029 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15030 (Plugin::add_option): New.
15031 (Plugin::args_): Change type.
15032 (Plugin::filename_): New.
15033 (Plugin_manager::add_plugin_option): New.
15034 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15035 * testsuite/Makefile.in: Regenerate.
15036
fd06b4aa
CC
150372008-12-05 Cary Coutant <ccoutant@google.com>
15038
15039 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15040 Handle --strip-lto-sections option.
15041 * options.h (strip_lto_sections): New option.
15042
6c52134c
CC
150432008-12-01 Cary Coutant <ccoutant@google.com>
15044
15045 * plugin.cc (ld_plugin_message): Change format parameter to const.
15046 Fix mismatch between new[] and delete.
15047
a45248e0
CC
150482008-11-14 Cary Coutant <ccoutant@google.com>
15049
15050 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15051 instead of -1U.
15052
c82fbeee
CS
150532008-11-05 Craig Silverstein <csilvers@google.com>
15054
15055 * options.cc (General_options::parse_dynamic_list): New function.
15056 * options.h (General_options): New flags dynamic_list,
15057 dynamic_list_data, dynamic_list_cpp_new, and
15058 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15059 (General_options::in_dynamic_list): New function.
15060 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15061 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15062 (Lex::can_continue_name): Likewise.
15063 (yylex): Likewise.
15064 (read_script_file): New parameter script_options.
15065 (read_dynamic_list): New function.
15066 (Script_options::define_dynamic_list): New function.
15067 (dynamic_list_keyword_parsecodes): New variable.
15068 (dynamic_list_keywords): New variable.
15069 * script.h (Script_options::define_dynamic_list): New function
15070 prototype.
15071 (read_dynamic_list): New function prototype.
15072 * symtab.cc (strprefix): New macro.
15073 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15074 dynamic_list_data, dynamic_list_cpp_new, and
15075 dynamic_list_cpp_typeinfo.
15076 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15077 (dynamic_list_expr): New rule.
15078 (dynamic_list_nodes): Likewise.
15079 (dynamic_list_node): Likewise.
15080 * testsuite/Makefile.am (dynamic_list): New test.
15081 * testsuite/Makefile.in: Regenerated.
15082 * testsuite/dynamic_list.t: New file.
15083 * testsuite/dynamic_list.sh: New file.
15084
e0bb29a5
CS
150852008-11-05 Craig Silverstein <csilvers@google.com>
15086
15087 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15088 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15089 (t11_last): Likewise.
15090 * testsuite/ver_test_6.c (main): Likewise.
15091
4e1e25e0
CC
150922008-10-07 Cary Coutant <ccoutant@google.com>
15093
15094 * options.c (General_options::finalize): Add check for -static and
15095 -shared.
15096 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15097 is not empty.
15098
92f03fcb
CC
150992008-10-02 Cary Coutant <ccoutant@google.com>
15100
15101 * plugin.cc (make_sized_plugin_object): Fix conditional
15102 compilation to work when not all targets are enabled.
15103
fbd8a257
CC
151042008-09-29 Cary Coutant <ccoutant@google.com>
15105
15106 * archive.cc (Archive::get_file_and_offset): Use filename instead
15107 of name to get library path.
15108 (Archive::include_member): Unlock external member of a thin archive.
15109
15110 * testsuite/Makefile.am (TEST_AR): New variable.
15111 (thin_archive_test_1): New test.
15112 (thin_archive_test_2): New test.
81636b3f
CC
15113 * testsuite/Makefile.in: Regenerate.
15114 * testsuite/thin_archive_main.cc: New file.
15115 * testsuite/thin_archive_test_1.cc: New file.
15116 * testsuite/thin_archive_test_2.cc: New file.
15117 * testsuite/thin_archive_test_3.cc: New file.
15118 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15119
eff45813
CC
151202008-09-29 Cary Coutant <ccoutant@google.com>
15121
15122 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15123 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15124 instead of -1U.
15125 (Sized_relobj::do_finalize_local_symbols): Likewise.
15126 (Sized_relobj::map_to_kept_section): Likewise.
15127 * object.h (Sized_relobj::invalid_address): New constant.
15128 (Sized_relobj::do_output_section_offset): Check for invalid_address
15129 and return -1ULL.
15130 * output.cc (Output_reloc::local_section_offset): Use constant
15131 invalid_address instead of -1U.
15132 (Output_reloc::get_address): Likewise.
15133 (Output_section::output_address): Change -1U to -1ULL.
15134 * output.h (Output_reloc::invalid_address): New constant.
15135 * reloc.cc (Sized_relobj::write_sections): Use constant
15136 invalid_address instead of -1U.
15137 (Sized_relobj::relocate_sections): Likewise.
15138 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15139 values for merge sections.
15140 * target-reloc.h (relocate_for_relocatable): Use constant
15141 invalid_address instead of -1U.
15142
89fc3421
CC
151432008-09-19 Cary Coutant <ccoutant@google.com>
15144
15145 Add plugin functionality for link-time optimization (LTO).
15146 * configure.ac (plugins): Add --enable-plugins option.
15147 * configure: Regenerate.
15148 * config.in: Regenerate.
15149 * Makefile.am (LIBDL): New variable.
15150 (CCFILES): Add plugin.cc.
15151 (HFILES): Add plugin.h.
15152 (ldadd_var): Add LIBDL.
15153 * Makefile.in: Regenerate.
15154
15155 * archive.cc: Include "plugin.h".
15156 (Archive::setup): Don't preread archive symbols when using a plugin.
15157 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15158 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15159 files.
15160 (Archive::include_member): Add symbols from plugin objects.
15161 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15162 * descriptors.cc (Descriptors::open): Check for file descriptors
15163 abandoned by plugins.
15164 (Descriptors::claim_for_plugin): New function.
15165 * descriptors.h (Descriptors::claim_for_plugin): New function.
15166 (Open_descriptor::is_claimed): New field.
15167 (claim_descriptor_for_plugin): New function.
15168 * fileread.cc (File_read::claim_for_plugin): New function.
15169 * fileread.h (File_read::claim_for_plugin): New function.
15170 (File_read::descriptor): New function.
15171 * gold.cc: Include "plugin.h".
15172 (queue_initial_tasks): Add task to call plugin hooks for generating
15173 new object files.
15174 * main.cc: Include "plugin.h".
15175 (main): Load plugin libraries.
15176 * object.h (Pluginobj): Declare.
15177 (Object::pluginobj): New function.
15178 (Object::do_pluginobj): New function.
15179 (Object::set_target): New function.
15180 * options.cc: Include "plugin.h".
15181 (General_options::parse_plugin): New function.
15182 (General_options::General_options): Initialize plugins_ field.
15183 (General_options::add_plugin): New function.
15184 * options.h (Plugin_manager): Declare.
15185 (General_options): Add --plugin option.
15186 (General_options::has_plugins): New function.
15187 (General_options::plugins): New function.
15188 (General_options::add_plugin): New function.
15189 (General_options::plugins_): New field.
15190 * plugin.cc: New file.
15191 * plugin.h: New file.
15192 * readsyms.cc: Include "plugin.h".
15193 (Read_symbols::do_read_symbols): Check for archive before checking
15194 for ELF file. Call plugin hooks to claim files.
15195 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15196 from a real object file; force override when processing replacement
15197 files.
15198 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15199 (Symbol::init_base_object): Likewise.
15200 (Symbol::init_base_output_data): Likewise.
15201 (Symbol::init_base_output_segment): Likewise.
15202 (Symbol::init_base_constant): Likewise.
15203 (Symbol::init_base_undefined): Likewise.
15204 (Symbol::output_section): Assert that object is not a plugin.
15205 (Symbol_table::add_from_pluginobj): New function.
15206 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15207 undefined.
15208 (Symbol_table::sized_write_globals): Likewise.
15209 (Symbol_table::add_from_pluginobj): Instantiate template.
15210 * symtab.h (Sized_pluginobj): Declare.
15211 (Symbol::in_real_elf): New function.
15212 (Symbol::set_in_real_elf): New function.
15213 (Symbol::in_real_elf_): New field.
15214 (Symbol_table::add_from_pluginobj): New function.
15215
15216 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15217 (LIBDL): New variable.
15218 (LDADD): Add LIBDL.
15219 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15220 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15221 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15222 (MOSTLYCLEANFILES): Likewise.
15223 * testsuite/Makefile.in: Regenerate.
15224 * testsuite/plugin_test.c: New file.
15225 * testsuite/plugin_test_1.sh: New file.
15226 * testsuite/plugin_test_2.sh: New file.
15227
de31bda5
ILT
152282008-09-16 Ian Lance Taylor <iant@google.com>
15229
9c2d0ef9
ILT
15230 * target-reloc.h (relocate_section): Check whether a symbol is
15231 defined by the ABI before reporting an undefined symbol error.
15232 * target.h (Target::is_defined_by_abi): Make parameter const.
15233 (Target::do_is_defined_by_abi): Likewise.
15234 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15235 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15236 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15237 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15238 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15239 * testsuite/Makefile.in: Rebuild.
15240
de31bda5
ILT
15241 * fileread.cc (make_view): Add casts to avoid warning.
15242
9fa33bee
AO
152432008-09-16 Alexandre Oliva <aoliva@redhat.com>
15244
15245 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15246 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15247
183fd0e3
AO
152482008-09-16 Alexandre Oliva <aoliva@redhat.com>
15249
15250 * options.h (General_options::output_is_executable): New.
15251 (General_options::output_is_pie): New.
15252 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15253 for shared libraries.
15254 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15255
7be8330a
CD
152562008-09-11 Chris Demetriou <cgd@google.com>
15257
15258 * options.h (origin): New -z option.
15259 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15260 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15261 in DT_FLAGS_1.
15262
a9caad02
CC
152632008-09-05 Cary Coutant <ccoutant@google.com>
15264
15265 * fileread.cc (File_read::make_view): Add check for attempt to map
15266 beyond end of file.
15267
ae6dce4d
CC
152682008-09-05 Cary Coutant <ccoutant@google.com>
15269
15270 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15271 explicit instantiations.
15272
d7ab2a47
KVH
152732008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15274
15275 PR gold/6858
15276 * options.cc (General_options::finalize): Allow undefined symbols
15277 in shlibs if linking -shared.
15278
15279 PR gold/6859
15280 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15281 symbols as not needing a dynsym entry.
15282
1e52a9c1
CS
152832008-08-20 Craig Silverstein <csilvers@google.com>
15284
15285 * fileread.cc (File_read::open): Do not lock the file unless it
15286 was successfully opened.
15287
d85c80a3
CC
152882008-08-14 Cary Coutant <ccoutant@google.com>
15289
15290 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15291 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15292 * testsuite/tls_test.cc (struct int128): 128-bit struct
15293 for testing TLS relocs with non-zero addend.
15294 (v12): New TLS variable.
15295 (t12): New test.
15296 (t_last): Add check for v12.
15297 * testsuite/tls_test.h (t12): New function.
15298 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15299
2d924fd9
ILT
153002008-08-13 Ian Lance Taylor <iant@google.com>
15301
15302 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15303 set tls_segment_ or relro_segment_.
15304 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15305 when appropriate.
15306 * output.h (Output_section::clear_is_relro): New function.
15307 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15308 sections specially even when output_data_ is empty.
15309 (Output_segment::maximum_alignment): When first section is relro,
15310 only force alignment for PT_LOAD segments.
15311 * script.cc (script_data_segment_align): New function.
15312 (script_data_segment_relro_end): New function.
15313 * script-c.h (script_data_segment_align): Declare.
15314 (script_data_segment_relro_end): Declare.
15315 * script-sections.h (class Script_sections): Declare
15316 data_segment_align and data_segment_relro_end. Add fields
15317 segment_align_index_ and saw_relro_end_.
15318 * script-sections.cc (class Sections_element): Add set_is_relro
15319 virtual function. Add new bool* parameter to place_orphan_here.
15320 Add get_output_section virtual function.
15321 (class Output_section_definition): Add set_is_relro. Add new
15322 bool* parameter to place_orphan_here. Add get_output_section.
15323 Add is_relro_ field.
15324 (Output_section_definition::Output_section_definition): Initialize
15325 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15326 and is_relro_ fields.
15327 (Output_section_definition::place_orphan_here): Add is_relro
15328 parameter.
15329 (Output_section_definition::set_section_addresses): Set relro for
15330 output section.
15331 (Output_section_definition::alternate_constraint): Likewise.
15332 (class Orphan_output_section): Add new bool* parameter to
15333 place_orphan_here. Add get_output_section.
15334 (Orphan_output_section::place_orphan_here): Add is_relro
15335 parameter.
15336 (Script_sections::Script_sections): Initialize
15337 data_segment_align_index_ and saw_relro_end_.
15338 (Script_sections::data_segment_align): New function.
15339 (Script_sections::data_segment_relro_end): New function.
15340 (Script_sections::place_orphan): Set or clear is_relro.
15341 (Script_sections::set_section_addresses): Force alignment of first
15342 TLS section.
15343 * yyscript.y (exp): Call script_data_segment_align and
15344 script_data_segment_relro_end.
15345 * testsuite/relro_script_test.t: New file.
15346 * testsuite/relro_test.cc (using_script): Declare.
15347 (t1, t2): Test using_script.
15348 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15349 (relro_script_test_SOURCES): Define.
15350 (relro_script_test_DEPENDENCIES): Define.
15351 (relro_script_test_LDFLAGS): Define.
15352 (relro_script_test_LDADD): Define.
15353 (relro_script_test.so): New target.
15354 * testsuite/Makefile.in: Rebuild.
15355
f827c9a9
CC
153562008-08-06 Cary Coutant <ccoutant@google.com>
15357
15358 * archive.cc (Archive::total_archives, Archive::total_members)
15359 (Archive::total_members_loaded): New variables.
15360 (Archive::setup): Add parameter. Add option to preread
15361 archive symbols.
15362 (Archive::read_armap): Add counter.
15363 (Archive::get_file_and_offset): New function.
15364 (Archive::get_elf_object_for_member): New function.
15365 (Archive::read_all_symbols): New function.
15366 (Archive::read_symbols): New function.
15367 (Archive::add_symbols): Add counters.
15368 (Archive::include_all_members): Use armap to find members if it's
15369 already built.
15370 (Archive::include_member): Skip reading symbols if already read.
15371 Factored code into Archive::get_file_and_offset and
15372 Archive::get_elf_object_for_member. Changed call to
15373 Mapfile::report_include_archive_member.
15374 (Archive::print_stats): New function.
15375 * archive.h: Declare Object and Read_symbols_data classes.
15376 (Archive::Archive): Add initializers for new members.
15377 (Archive::setup): Add parameter.
15378 (Archive::print_stats): New function.
15379 (Archive::total_archives, Archive::total_members)
15380 (Archive::total_members_loaded): New variables.
15381 (Archive::get_file_and_offset): New function.
15382 (Archive::get_elf_object_for_member): New function.
15383 (Archive::read_all_symbols): New function.
15384 (Archive::read_symbols): New function.
15385 (Archive::Archive_member): New class.
15386 (Archive::members_): New member.
15387 (Archive::num_members_): New member.
15388 * main.cc: Include archive.h.
15389 (main): Call Archive::print_stats.
15390 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15391 archive parameter; member_name is now the fully-decorated name.
15392 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15393 * options.h: (General_options): Add --preread-archive-symbols option.
15394 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15395 Archive::setup.
15396
de4c45bd
ILT
153972008-08-04 Ian Lance Taylor <iant@google.com>
15398
15399 * symtab.h (Symbol::use_plt_offset): New function.
15400 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15401 * powerpc.cc (Relocate::relocate): Likewise.
15402 * sparc.cc (Relocate::relocate): Likewise.
15403 * x86_64.cc (Relocate::relocate): Likewise.
15404 * testsuite/weak_plt.sh: New test.
15405 * testsuite/weak_plt_main.cc: New test.
15406 * testsuite/weak_plt_shared.cc: New test.
15407 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15408 (check_PROGRAMS): Add weak_plt.
15409 (check_DATA): Add weak_plt_shared.so.
15410 (weak_plt_main_pic.o, weak_plt): New targets.
15411 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15412 * testsuite/Makefile.in: Rebuild.
15413
15414 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15415 gcctestdir/ld.
15416 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15417 * testsuite/Makefile.in: Rebuild.
15418
323ee3f4
AM
154192008-08-04 Alan Modra <amodra@bigpond.net.au>
15420
15421 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15422 * Makefile.in: Regenerate.
15423 * po/POTFILES.in: Regenerate.
15424
7c07ecec
ILT
154252008-07-29 Ian Lance Taylor <iant@google.com>
15426
15427 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15428 symbols before other symbols.
15429 * testsuite/script_test_2.cc (test_addr): Declare.
15430 (test_addr_alias): Declare.
15431 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15432 values.
7c07ecec
ILT
15433 * testsuite/script_test_2.t: Define test_addr_alias and
15434 test_addr.
15435
5778530e
ILT
154362008-07-24 Ian Lance Taylor <iant@google.com>
15437
2a00e4fb
ILT
15438 PR 5990
15439 * descriptors.cc: New file.
15440 * descriptors.h: New file.
15441 * gold-threads.h (class Hold_optional_lock): New class.
15442 * fileread.cc: Include "descriptors.h".
15443 (File_read::~File_read): Release descriptor rather than closing
15444 it.
15445 (File_read::open) [file]: Call open_descriptor rather than open.
15446 Set is_descriptor_opened_.
15447 (File_read::open) [memory]: Assert that descriptor is not open.
15448 (File_read::reopen_descriptor): New function.
15449 (File_read::release): Release descriptor.
15450 (File_read::do_read): Make non-const. Reopen descriptor.
15451 (File_read::read): Make non-const.
15452 (File_read::make_view): Reopen descriptor.
15453 (File_read::do_readv): Likewise.
15454 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15455 Update declarations.
15456 * layout.cc: Include "descriptors.h".
15457 (Layout::create_build_id): Use open_descriptor rather than open.
15458 * output.cc: Include "descriptors.h".
15459 (Output_file::open): Use open_descriptor rather than open.
15460 * archive.cc (Archive::const_iterator): Change Archive to be
15461 non-const.
15462 (Archive::begin, Archive::end): Make non-const.
15463 (Archive::count_members): Likewise.
15464 * archive.h (class Archive): Update declarations.
15465 * object.h (Object::read): Make non-const.
15466 * Makefile.am (CCFILES): Add descriptors.cc.
15467 (HFILES): Add descriptors.h.
15468 * Makefile.in: Rebuild.
15469
801647d1
ILT
15470 PR 6716
15471 * gold.h: Always include <clocale>. Add Solaris workarounds
15472 following code in binutils/sysdep.h.
15473
5edd166e
ILT
15474 PR 6048
15475 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15476 this->eh_frame_hdr_ is NULL before using it.
15477
c89ad728
ILT
15478 * dynobj.cc (Versions::Versions): Update comment.
15479
aa86f06b
ILT
15480 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15481 the base version name.
15482
5778530e
ILT
15483 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15484 array size plus one.
15485 (Stringpool_template::set_string_offsets): Subtract one from key
15486 before using it as an array index.
15487 (Stringpool_template::get_offset_with_length): Likewise.
15488 (Stringpool_template::write_to_buffer): Likewise.
15489 * stringpool.h (Stringpool_template::get_offset_from_key):
15490 Likewise.
15491
057ead22
ILT
154922008-07-23 Ian Lance Taylor <iant@google.com>
15493
7f649c59
ILT
15494 PR 6658
15495 * object.h (Merged_symbol_value::value): Do our best to handle a
15496 negative addend.
15497
057ead22
ILT
15498 PR 6647
15499 * script.cc (Version_script_info::get_versions): Don't add empty
15500 version tag to return value.
15501 (Version_script_info::get_symbol_version_helper): Change return
15502 type to bool. Add pversion parameter. Change all callers.
15503 (script_register_vers_node): Don't require a non-NULL tag.
15504 * script.h (class Version_script_info): Update declarations.
15505 (Version_script_info::get_symbol_version): Change return type to
15506 bool. Add version parameter. Change all callers.
15507 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15508 handling. Handle an empty version from a version script.
15509 (Symbol_table::define_special_symbol): Likewise.
15510 * testsuite/ver_test_10.script: New file.
15511 * testsuite/ver_test_10.sh: New file.
15512 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15513 (check_DATA): Add ver_test_10.syms.
15514 (ver_test_10.syms, ver_test_10.so): New target.
15515 * testsuite/Makefile.in: Rebuild.
15516
58e54ac2
CD
155172008-07-23 Simon Baldwin <simonb@google.com>
15518
15519 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15520 to zero for undefined symbols from dynamic libraries.
15521
95d14cd3
ILT
155222008-07-23 Ian Lance Taylor <iant@google.com>
15523
15524 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15525 Change all callers.
15526 * symtab.h (class Symbol_table): Update declaration.
15527 * testsuite/ver_test_9.cc: New file.
15528 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15529 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15530 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15531 (ver_test_9.so, ver_test_9.o): New targets.
15532 * testsuite/Makefile.in: Rebuild.
15533
92de84a6
ILT
155342008-07-22 Ian Lance Taylor <iant@google.com>
15535
34810851
ILT
15536 * options.h (class General_options): Define --check-sections.
15537 * layout.cc (Layout::set_segment_offsets): Handle
15538 --check-sections.
15539
af6156ef
ILT
15540 * options.h (class General_options): Define -n/--nmagic and
15541 -N/--omagic.
15542 * options.cc (General_options::finalize): For -n/--nmagic or
15543 -N/--omagic, set -static.
15544 * layout.cc (Layout::attach_allocated_section_to_segment): If
15545 -N/--omagic, don't put read-only and read-write sections in
15546 different segments.
15547 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15548 finding a read-only segment.
15549 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15550 don't set the minimum segment alignment to the common page size,
15551 and don't set the file offset to the address modulo the page size.
15552 * script-sections.cc (Script_sections::create_segments): If
15553 -n/--omagic, don't put read-only and read-write sections in
15554 different segments.
15555
92de84a6
ILT
15556 * cref.cc: New file.
15557 * cref.h: New file.
15558 * options.h (class General_options): Add --print-symbol-counts.
15559 * main.cc (main): Issue defined symbol report if requested.
15560 * archive.cc (Archive::interpret_header): Make into a const member
15561 function.
15562 (Archive::add_symbols): Call Input_objects::archive_start and
15563 archive_stop.
15564 (Archive::const_iterator): Define new class.
15565 (Archive::begin, Archive::end): New functions.
15566 (Archive::include_all_members): Rewrite to use iterator.
15567 (Archive::count_members): New function.
15568 * archive.h (class Archive): Update declarations.
15569 (Archive::filename): New function.
15570 * object.cc: Include "cref.h".
15571 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15572 (Sized_relobj::do_get_global_symbol_counts): New function.
15573 (Input_objects::add_object): Add object to cross-referencer.
15574 (Input_objects::archive_start): New function.
15575 (Input_objects::archive_stop): New function.
15576 (Input_objects::print_symbol_counts): New function.
15577 * object.h: Declare Cref and Archive.
15578 (Object::get_global_symbol_counts): New function.
15579 (Object::do_get_global_symbol_counts): New pure virtual function.
15580 (class Sized_relobj): Add defined_count_ field. Update
15581 declarations.
15582 (class Input_objects): Add cref_ field. Update constructor.
15583 Update declarations.
15584 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15585 defined_count_.
15586 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15587 symbol counts.
15588 (Sized_dynobj::do_get_global_symbol_counts): New function.
15589 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15590 defined_count_. Update declarations. Define Symbols typedef.
15591 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15592 parameter. Change all callers.
15593 (Symbol_table::add_from_dynobj): Add sympointers and defined
15594 parameters. Change all callers.
15595 * symtab.h (class Symbol_table): Update declarations.
15596 * Makefile.am (CCFILES): Add cref.cc.
15597 (HFILES): Add cref.h.
15598 * Makefile.in: Rebuild.
15599
3f7c5e1d
CD
156002008-07-22 Simon Baldwin <simonb@google.com>
15601
15602 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15603 to zero when writing undefined symbols.
15604
e0b64032
ILT
156052008-07-22 Ian Lance Taylor <iant@google.com>
15606
15607 * output.cc (Output_section::add_input_section): Don't try to
15608 merge empty merge sections.
15609
096b02cf
CS
156102008-07-21 Craig Silverstein <csilvers@google.com>
15611
15612 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15613 Include symbol version in error message.
cd536b21 15614
1d1f116d
CD
156152008-07-20 Chris Demetriou <cgd@google.com>
15616
cd536b21 15617 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15618 (RANDOM_SEED_CFLAGS): New substituted variable.
15619 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15620 * configure: Rebuild.
15621 * Makefile.in: Likewise.
15622 * testsuite/Makefile.in: Likewise.
15623
a18f591e
ILT
156242008-07-18 Ian Lance Taylor <iant@google.com>
15625
15626 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15627 where we see NAME/NULL and NAME/VERSION as separate symbols.
15628 * testsuite/ver_test_main.cc (main): Call t4.
15629 (t4, t4_2a): Define.
15630 * testsuite/ver_test_2.cc (t4_2): Define.
15631 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15632 * testsuite/ver_test_4.cc (t4_2a): Define.
15633 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15634 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15635
c6e3f6ed
ILT
156362008-07-17 Ian Lance Taylor <iant@google.com>
15637
15638 * dynobj.cc (Versions::add_def): If we give an error about a
15639 missing version, go ahead and create the version anyhow.
15640
ef9beddf
ILT
156412008-07-10 Ian Lance Taylor <iant@google.com>
15642
15643 Handle output sections with more than 0x7fffffff bytes.
15644 * object.h (class Relobj): Change map_to_output_ to
15645 output_sections_, and just keep a section pointer. Change all
15646 uses. Move comdat group support to Sized_relobj.
15647 (Relobj::is_section_specially_mapped): Remove.
15648 (Relobj::output_section): Remove poff parameter. Change all
15649 callers.
15650 (Relobj::output_section_offset): New function.
15651 (Relobj::set_section_offset): Rewrite.
15652 (Relobj::map_to_output): Remove.
15653 (Relobj::output_sections): New function.
15654 (Relobj::do_output_section_offset): New pure virtual function.
15655 (Relobj::do_set_section_offset): Likewise.
15656 (class Sized_relobj): Add section_offsets_ field. Add comdat
15657 group support from Relobj. Update declarations.
15658 (Sized_relobj::get_output_section_offset): New function.
15659 (Sized_relobj::do_output_section_offset): New function.
15660 (Sized_relobj::do_set_section_offset): New function.
15661 * object.cc (Relobj::output_section_address): Remove.
15662 (Sized_relobj::Sized_relobj): Initialize new fields.
15663 (Sized_relobj::include_section_group): Cast find_kept_object to
15664 Sized_relobj.
15665 (Sized_relobj::include_linkonce_section): Likewise.
15666 (Sized_relobj::do_layout): Use separate arrays for output section
15667 and output offset.
15668 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15669 output_sections.
15670 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15671 output_sections and section_offsets.
15672 (Sized_relobj::write_local_symbols): Likewise.
15673 (map_to_kept_section): Compute output address directly.
15674 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15675 output_sections and section_offsets.
15676 (Sized_relobj::write_sections): Likewise.
15677 (Sized_relobj::relocate_sections): Likewise.
15678 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15679 * output.h (class Output_reloc): Update declarations. Change
15680 u2_.relobj to Sized_relobj*.
15681 (class Output_data_reloc): Change add functions to use
15682 Sized_relobj*.
15683 * output.cc (Output_reloc::Output_reloc): Change relobj to
15684 Sized_relobj*.
15685 (Output_reloc::local_section_offset): Change return type to
15686 Elf_Addr. Use get_output_section_offset.
15687 (Output_reloc::get_address): Likewise.
15688 (Output_section::is_input_address_mapped): Don't call
15689 is_section_specially_mapped.
15690 (Output_section::output_offset): Likewise.
15691 (Output_section::output_address): Likewise.
15692 (Output_section::starting_output_address): Likewise.
15693 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15694 parameter to Sized_relobj*.
15695 (Copy_relocs::need_copy_reloc): Likewise.
15696 (Copy_relocs::save): Likewise.
15697 * copy-relocs.h (class Copy_relocs): Update declarations.
15698 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15699 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15700 * target-reloc.h (relocate_for_relocatable): Change
15701 offset_in_output_section type to Elf_Addr. Change code that uses
15702 it as well.
15703 * layout.cc (Layout::layout): Always set *off.
15704 * mapfile.cc (Mapfile::print_input_section): Use
15705 output_section_offset.
15706 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15707 Sized_relobj*.
15708 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15709 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15710 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15711
5cb66f97
ILT
157122008-07-03 Ian Lance Taylor <iant@google.com>
15713
15714 * layout.cc (Layout::include_section): Do not discard unrecognized
15715 SHT_STRTAB sections.
15716
afe47622
CS
157172008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15718
15719 * script.cc (Lex::can_continue_name): Make '?' allowable in
15720 version-script names.
15721 * testsuite/version_script.map: Change glob pattern to use '?'
15722
5adf9721
ILT
157232008-06-30 Manish Singh <yosh@gimp.org>
15724
15725 PR 6585
15726 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15727 Correct typo.
15728
e6fde208
ILT
157292008-06-30 Ian Lance Taylor <iant@google.com>
15730
15731 PR 6660
15732 PR 6682
15733 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15734 versions]: Don't try to read the value in the contents, since we
15735 don't use it. Use the template endianness when writing.
15736
3f2e6a2d
CC
157372008-06-25 Cary Coutant <ccoutant@google.com>
15738
15739 * fileread.cc (File_read::make_view): Assert on zero-length view.
15740 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15741 symbol table when there are no symbols to read.
15742
c43d3a48
CS
157432008-06-23 Craig Silverstein <csilvers@google.com>
15744
15745 * version.cc (version_string): Bump to 1.7
15746
5f494ea0
CS
157472008-06-18 Craig Silverstein <csilvers@google.com>
15748
15749 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15750 constant 0xFFFF to type Valtype.
15751 (Powerpc_relocate_functions::rel16_ha): Likewise.
15752
c42e122e
ILT
157532008-06-17 Ian Lance Taylor <iant@google.com>
15754
f34787f8
ILT
15755 * output.h (Output_section::Input_section): Initialize p2align_ to
15756 zero for Output_section_data constructors.
15757 (Output_section::Input_section::addralign): If not an input
15758 section, return the alignment of the Output_section_data.
15759 * testsuite/copy_test.cc: New file.
15760 * testsuite/copy_test_1.cc: New file.
15761 * testsuite/copy_test_2.cc: New file.
15762 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15763 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15764 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15765 (copy_test_1_pic.o, copy_test_1.so): New targets.
15766 (copy_test_2_pic.o, copy_test_2.so): New targets.
15767 * testsuite/Makefile.in: Rebuild.
15768
c42e122e
ILT
15769 * script-sections.cc (Script_sections::place_orphan): Initialize
15770 local variable exact.
15771
ce3ac18a
DE
157722008-06-13 David Edelsohn <edelsohn@gnu.org>
15773
15774 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15775
42cacb20
DE
157762008-06-12 David Edelsohn <edelsohn@gnu.org>
15777 David S. Miller <davem@davemloft.net>
15778
15779 * powerpc.cc: New file.
15780 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15781 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15782 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15783 * Makefile.in: Rebuild.
15784
7b308235
ILT
157852008-06-09 Ian Lance Taylor <iant@google.com>
15786
15787 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15788 <exception>.
15789 (throwing, orig_terminate): New static variables.
15790 (terminate_handler): New static function.
15791 (t2): Set terminate handler.
15792
f0b886e3
ILT
157932008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15794
15795 PR 6584
cd536b21 15796 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15797 alignment.
15798
3e90f135
CC
157992008-05-30 Cary Coutant <ccoutant@google.com>
15800
15801 * archive.cc (Archive::include_all_members) Correct to step
15802 over symbol table and extended name table in thin archives.
15803
e09ad04a
ILT
158042008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15805
15806 PR 6407
15807 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15808 calculation.
15809
62b01cb5
ILT
158102008-05-28 Caleb Howe <cshowe@google.com>
15811
15812 * reduced_debug_output.cc: New file.
15813 * reduced_debug_output.h: New file.
92de84a6 15814 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15815 * options.cc (General_options::finalize): Add strip_debug_non_line
15816 to the strip heirarchy.
15817 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15818 fields.
15819 * layout.cc: Include "reduced_debug_output.h".
15820 (Layout::Layout): Initialize new fields.
15821 (line_only_debug_sections): New static array.
15822 (is_lines_only_debug_sections): New static inline function.
15823 (Layout::include_section): Handle --strip-debug-non-line.
15824 (Layout::make_output_section): If --strip-debug-non-line, build
15825 new output sections for .debug_abbrev and .debug_info.
15826 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15827 gold. Warn about possible overflow.
15828 (read_signed_LEB_128): Likewise.
15829 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15830 (read_signed_LEB_128): Declare.
15831 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15832 (HFILES): Add reduced_debug_output.h.
15833 * Makefile.in: Rebuild.
15834
7d9e3d98
ILT
158352008-05-21 Ian Lance Taylor <iant@google.com>
15836
15837 * mapfile.cc: New file.
15838 * mapfile.h: New file.
15839 * options.h (class General_options): Add -M/--print-map and -Map.
15840 * options.cc (General_options::finalize): Make -M equivalent to
15841 -Map -.
15842 * main.cc: Include <cstdio> and "mapfile.h".
15843 (main): Open mapfile if requested.
15844 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15845 constructor. Change caller.
15846 (queue_initial_tasks): Add mapfile parameter. Change caller.
15847 (queue_middle_tasks): Likewise.
15848 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15849 declarations.
15850 * archive.cc: Include "mapfile.h".
15851 (Archive::add_symbols): Add mapfile parameter. Change all
15852 callers. Pass mapfile, symbol, and reason to include_member.
15853 (Archive::include_all_members): Add mapfile parameter. Change all
15854 callers.
15855 (Archive::include_member): Add mapfile, sym, and why parameters.
15856 Change all callers. Report inclusion to map file.
15857 * archive.h: Include "fileread.h".
15858 (class Archive): Update declarations.
15859 (Archive::file): New const method.
15860 (class Add_archive_symbols): Add mapfile_ field. Update
15861 constructor. Change all callers.
15862 * readsyms.h (class Read_symbols): Likewise.
15863 (class Finish_group): Likewise.
15864 (class Read_script): Likewise.
15865 * common.cc: Include "mapfile.h".
15866 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15867 all callers.
15868 (Symbol_table::do_allocate_commons): Likewise.
15869 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15870 symbol allocation to mapfile.
15871 * common.h (class Allocate_commons_task): Add mapfile_ field.
15872 Update constructor. Change all callers.
15873 * symtab.h (class Symbol_table): Update declarations.
15874 * layout.cc: Include "mapfile.h".
15875 (Layout_task_runner::run): Print information to mapfile.
15876 (Layout::create_gold_note): Change Output_data_fixed_space to
15877 Output_data_zero_fill.
15878 (Layout::create_build_id): Likewise.
15879 (Layout::print_to_mapfile): New function.
15880 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15881 constructor. Change caller.
15882 (class Layout): Declare print_to_mapfile.
15883 * output.cc (Output_section::Input_section::print_to_mapfile): New
15884 function.
15885 (Output_section::add_input_section): If producing a map, always
15886 add to input_sections_ list.
15887 (Output_section::do_print_to_mapfile): New function.
15888 (Output_segment::print_sections_to_mapfile): New function.
15889 (Output_segment::print_section_list_to_mapfile): New function.
15890 * output.h: Include "mapfile.h".
15891 (Output_data::print_to_mapfile): New function.
15892 (Output_data::do_print_to_mapfile): New virtual function.
15893 (Output_segment_headers::do_print_to_mapfile): New function.
15894 (Output_file_header::do_print_to_mapfile): New function.
15895 (Output_data_const::do_print_to_mapfile): New function.
15896 (class Output_data_const_buffer): Add map_name_ field. Update
15897 constructor. Change all callers. Add do_print_to_mapfile
15898 function.
15899 (class Output_data_fixed_space): Likewise.
15900 (class Output_data_space): Likewise.
15901 (class Output_data_zero_fill): New class.
15902 (Output_data_strtab::do_print_to_mapfile): New function.
15903 (Output_data_reloc_base::do_print_to_mapfile): New function.
15904 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15905 (Output_data_group::do_print_to_mapfile): New function.
15906 (Output_data_got::do_print_to_mapfile): New function.
15907 (Output_data_dynamic::do_print_to_mapfile): New function.
15908 (Output_symtab_xindex::do_print_to_mapfile): New function.
15909 (class Output_section): Declare do_print_to_mapflie. Declare
15910 print_to_mapfile in Input_section.
15911 (class Output_segment): Declare new functions.
15912 * object.h (Sized_relobj::symbol_count): New function.
15913 * script-sections.cc
15914 (Output_section_element_dot_assignment::set_section_addresses):
15915 Change Output_data_fixed_space to Output_data_zero_fill.
15916 (Output_data_expression::do_print_to_mapfile): New function.
15917 * script.cc (read_input_script): Add mapfile parameter. Change
15918 all callers.
15919 * script.h (read_input_script): Update declaration.
15920 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15921 (Eh_frame::do_print_to_mapfile): New function.
15922 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15923 (Output_merge_string::do_print_to_mapfile): New function.
15924 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15925 function.
15926 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15927 function.
15928 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15929 function.
15930 * Makefile.am (CCFILES): Add mapfile.cc.
15931 (HFILES): Add mapfile.h.
15932 * Makefile.in: Rebuild.
15933
9f1d377b
ILT
159342008-05-19 Ian Lance Taylor <iant@google.com>
15935
15936 * options.h (class General_options): Add -z relro.
15937 * layout.cc (Layout::Layout): Initialize relro_segment_.
15938 (Layout::add_output_section_data): Return the output section.
15939 (Layout::make_output_section): Rcognize relro sections and mark
15940 them appropriately.
15941 (Layout::attach_allocated_section_to_segment): Put relro sections
15942 in a PT_GNU_RELRO segment.
15943 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15944 section as relro.
15945 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15946 PT_TLS segments.
15947 (Layout::linkonce_mapping): Map d.rel.ro.local to
15948 .data.rel.ro.local.
15949 (Layout::output_section_name): Us .data.rel.ro.local for any
15950 section which begins with that.
15951 * layout.h (class Layout): Update add_output_section_data
15952 declaration. Add relro_segment_ field.
15953 * output.cc (Output_section::Output_section): Initialize is_relro_
15954 and is_relro_local_ fields.
15955 (Output_segment::add_output_section): Group relro sections.
15956 (Output_segment::is_first_section_relro): New function.
15957 (Output_segment::maximum_alignment): If there is a relro section,
15958 align the segment to the common page size.
15959 (Output_segment::set_section_addresses): Track whether we are
15960 looking at relro sections. If the last section is a relro
15961 section, align to the common page size.
15962 (Output_segment::set_section_list_addresses): Add in_relro
15963 parameter. Change all callers. Align to the page size when
15964 moving from relro to non-relro section.
15965 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15966 segment.
15967 * output.h (class Output_section): Add is_relro_ and
15968 is_relro_local_ fields.
15969 (Output_section::is_relro): New function.
15970 (Output_section::set_is_relro): New function.
15971 (Output_section::is_relro_local): New function.
15972 (Output_section::set_is_relro_local): New function.
15973 (class Output_segment): Update declarations.
15974 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15975 * sparc.cc (Target_sparc::got_section): Likewise.
15976 * x86_64.cc (Target_x86_64::got_section): Likewise.
15977 * testsuite/relro_test_main.cc: New file.
15978 * testsuite/relro_test.cc: New file.
15979 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15980 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15981 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15982 (relro_test.so, relro_test_pic.o): New targets.
15983 * testsuite/Makefile.in: Rebuild.
15984
a984ee1d
ILT
159852008-05-16 Ian Lance Taylor <iant@google.com>
15986
01676dcd
ILT
15987 * output.cc (Output_segment::add_output_section): Remove front
15988 parameter.
15989 * output.h (class Output_segment): Remove
15990 add_initial_output_section and overloaded add_output_section.
15991 Update declaration of remaining add_output_section.
15992 * layout.cc (Layout::create_interp): Call add_output_section
15993 rather than add_initial_output_section.
15994 (Layout::finish_dynamic_section): Likewise.
15995
497897f9
ILT
15996 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15997 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15998 know the dynamic type.
15999 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16000 field. Initialize it in constructor.
16001 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16002 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16003 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16004 reloc.
16005
a984ee1d
ILT
16006 * output.cc (Output_reloc::get_address): Change return type to
16007 Elf_Addr.
16008 * output.h (class Output_reloc): Update get_address declaration.
16009 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16010 for section addresses.
16011
55ba0940
ILT
160122008-05-09 Ian Lance Taylor <iant@google.com>
16013
16014 PR 6493
16015 * gold.cc (gold_nomem): Use return value of write.
16016
75517b77
ILT
160172008-05-08 Ian Lance Taylor <iant@google.com>
16018
16019 * symtab.c (Symbol::init_base_output_data): Add version
16020 parameter. Change all callers.
16021 (Symbol::init_base_output_segment): Likewise.
16022 (Symbol::init_base_constant): Likewise.
16023 (Symbol::init_base_undefined): Likewise.
16024 (Sized_symbol::init_output_data): Likewise.
16025 (Sized_symbol::init_output_segment): Likewise.
16026 (Sized_symbol::init_constant): Likewise.
16027 (Sized_symbol::init_undefined): Likewise.
16028 (Symbol_table::do_define_in_output_data): If the new symbol has a
16029 version, mark it as the default.
16030 (Symbol_table::do_define_in_output_segment): Likewise.
16031 (Symbol_table::do_define_as_constant): Likewise.
16032 * symtab.h (class Symbol): Update declarations.
16033 (class Sized_symbol): Likewise.
16034 * resolve.cc (Symbol::override_version): New function.
c42e122e 16035 (Symbol::override_base): Call override_version.
75517b77
ILT
16036 (Symbol::override_base_with_special): Likewise.
16037 * testsuite/ver_script_8.script: New file.
16038 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16039 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16040 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16041 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16042
f1f70eae
ILT
160432008-05-06 Ian Lance Taylor <iant@google.com>
16044
f3e9c5c5
ILT
16045 PR 6049
16046 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16047 functions.
16048 (class General_options): Remove existing --undefined, and add
16049 --no-undefined instead. Add new --undefined as synonym for -u.
16050 * archive.cc (Archive::add_symbols): Check whether symbol was
16051 named with -u.
16052 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16053 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16054 all uses. Add IS_UNDEFINED. Update declarations to split
16055 different versions of init_base. Declare init_base_undefined.
16056 (Symbol::is_defined): Handle IS_UNDEFINED.
16057 (Symbol::is_undefined): Likewise.
16058 (Symbol::is_weak_undefined): Call is_undefined.
16059 (Symbol::is_absolute): Handle IS_CONSTANT.
16060 (class Sized_symbol): Update declarations to split different
16061 versions of init. Declare init_undefined.
16062 (class Symbol_table): Declare new functions.
16063 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16064 Change all callers.
16065 (Symbol::init_base_output_data): Likewise.
16066 (Symbol::init_base_output_segment): Likewise.
16067 (Symbol::init_base_constant): Likewise.
16068 (Symbol::init_base_undefined): New function.
16069 (Sized_symbol::init_object): Rename from init. Change all
16070 callers.
16071 (Sized_symbol::init_output_data): Likewise.
16072 (Sized_symbol::init_output_segment): Likewise.
16073 (Sized_symbol::init_constant): Likewise.
16074 (Sized_symbol::init_undefined): New function.
16075 (Symbol_table::add_undefined_symbols_from_command_line): New
16076 function.
16077 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16078 function.
16079 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16080 (Symbol::output_section): Likewise.
16081 (Symbol::set_output_section): Likewise.
16082 (Symbol_table::sized_finalize_symbol): Likewise.
16083 (Symbol_table::sized_write_globals): Likewise.
16084 * resolve.cc (Symbol_table::should_override): Likewise.
16085 (Symbol::override_base_with_special): Likewise.
16086
8bdcdf2c
ILT
16087 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16088 symbol, change it to have default visibility.
16089 * testsuite/protected_1.cc: New file.
16090 * testsuite/protected_2.cc: New file.
16091 * testsuite/protected_3.cc: New file.
16092 * testsuite/protected_main_1.cc: New file.
16093 * testsuite/protected_main_2.cc: New file.
16094 * testsuite/protected_main_3.cc: New file.
16095 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16096 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16097 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16098 (protected_1.so): New target.
16099 (protected_1_pic.o, protected_2_pic.o): New targets.
16100 (protected_3_pic.o): New target.
16101 (check_PROGRAMS): Add protected_2.
16102 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16103 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16104 * testsuite/Makefile.in: Rebuild.
16105
2b706932
ILT
16106 * options.h (DEFINE_var): Add set_user_set_##varname__.
16107 (DEFINE_bool_alias): New macro.
16108 (class General_options): Define -Bstatic using DEFINE_bool_alias
16109 rather than DEFINE_special. Add --undefined as an alias for -z
16110 defs.
16111 * options.cc (General_options::parse_Bstatic): Remove.
16112
d82a5bcc
ILT
16113 * options.h (class General_options): Add --fatal-warnings.
16114 * main.cc (main): Implement --fatal-warnings.
16115 * errors.h (Errors::warning_count): New function.
16116
f1f70eae
ILT
16117 * options.h (class General_options): Add -Bsymbolic-functions.
16118 * symtab.h (Symbol::is_preemptible): Check for
16119 -Bsymbolic-functions.
16120
8825ac63
ILT
161212008-05-05 Ian Lance Taylor <iant@google.com>
16122
d98bc257
ILT
16123 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16124 as noVARNAME rather than no-VARNAME.
16125 (class General_options): Add option -z combreloc.
16126 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16127 get_address.
16128 (Output_reloc::sort_before) [SHT_REL]: New function.
16129 (Output_reloc::sort_before) [SHT_RELA]: New function.
16130 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16131 Sort_relocs_comparison.
16132 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16133 parameter. Change all callers.
16134 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16135 sort_relocs parameter. Change all callers.
16136 * output.cc (Output_reloc::get_address): New function, broken out
16137 of write_rel.
16138 (Output_reloc::write_rel): Call it.
16139 (Output_reloc::compare): New function.
16140 (Output_data_reloc_base::do_write): Optionally sort relocs.
16141
60b2b4e7
ILT
16142 * configure.ac: If targ_extra_obj is set, link it in.
16143 * configure.tgt: Initialize all variables.
16144 (x86_64*): Set targ_extra_obj and targ_extra_size.
16145 * configure: Rebuild.
16146
8825ac63
ILT
16147 * object.cc (Sized_relobj::include_section_group): Adjust section
16148 indexes read from group data. Build vector to pass to
16149 layout_group.
16150 * layout.cc (Layout::layout_group): Add flags and shndxes
16151 parameters. Remove contents parameter. Change caller. Update
16152 explicit instantiations.
16153 * layout.h (class Layout): Update layout_group declaration.
16154 * output.cc (Output_data_group::Output_data_group): Add flags and
16155 input_shndxes parameters. Remove contents parameter. Change
16156 caller.
16157 (Output_data_group::do_write): Change input_sections_ to
16158 input_shndxes_.
16159 * output.h (class Output_data_group): Update constructor
16160 declaration. Rename input_sections_ to input_shndxes_.
16161 * testsuite/many_sections_test.cc: Add template.
16162
e94cf127
CC
161632008-04-30 Cary Coutant <ccoutant@google.com>
16164
4418b2d5
CC
16165 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16166
e94cf127
CC
16167 * layout.cc (Layout::include_section): Refactored check for debug
16168 info section.
16169 (Layout::add_comdat): Add new parameters. Change type
16170 of signature parameter. Add object and shndx to signatures table.
16171 (Layout::find_kept_object): New function.
16172 * layout.h: Include <cstring>.
16173 (Layout::is_debug_info_section): New function.
16174 (Layout::add_comdat): Add new parameters.
16175 (Layout::find_kept_object): New function.
16176 (Layout::Kept_section): New struct.
16177 (Layout::Signatures): Change type of map range.
16178 * object.cc (Relobj::output_section_address): New function.
16179 (Sized_relobj::include_section_group): Add new parameters. Change
16180 calls to Layout::add_comdat. Change to build table of kept comdat
16181 groups and table mapping discarded sections to kept sections.
16182 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16183 (Sized_relobj::do_layout): Change calls to include_section_group and
16184 include_linkonce_section.
16185 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16186 value to zero when section is discarded.
16187 (Sized_relobj::map_to_kept_section): New function.
16188 * object.h (Relobj::output_section_address): New function.
16189 (Relobj::Comdat_group): New type.
16190 (Relobj::find_comdat_group): New function.
16191 (Relobj::Comdat_group_table): New type.
16192 (Relobj::Kept_comdat_section): New type.
16193 (Relobj::Kept_comdat_section_table): New type.
16194 (Relobj::add_comdat_group): New function.
16195 (Relobj::set_kept_comdat_section): New function.
16196 (Relobj::get_kept_comdat_section): New function.
16197 (Relobj::comdat_groups_): New field.
16198 (Relobj::kept_comdat_sections_): New field.
16199 (Symbol_value::input_value): Update comment.
16200 (Sized_relobj::map_to_kept_section) New function.
16201 (Sized_relobj::include_linkonce_section): Add new parameter.
16202 * target-reloc.h (Comdat_behavior): New type.
16203 (get_comdat_behavior): New function.
16204 (relocate_section): Add code to map a discarded section to the
16205 corresponding kept section when applying a relocation.
16206
e4e5049b
CS
162072008-04-30 Craig Silverstein <csilvers@google.com>
16208
16209 * dwarf_reader.cc (next_generation_count): New static var.
16210 (Addr2line_cache_entry): New struct.
16211 (addr2line_cache): New static var.
16212 (Dwarf_line_info::one_addr2line): Added caching.
16213 (Dwarf_line_info::clear_addr2line_cache): New function.
16214 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16215 cache-size parameter.
16216 (Dwarf_line_info::one_addr2line_cache): New function.
16217 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16218 new cache-size argument to one_addr2line(), and clear cache.
16219
d09e9154
CC
162202008-04-28 Cary Coutant <ccoutant@google.com>
16221
16222 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16223 R_386_PC8 relocations.
16224
7ef73768
ILT
162252008-04-23 Ian Lance Taylor <iant@google.com>
16226
55438702
ILT
16227 * object.cc (Sized_relobj::include_section_group): Check for
16228 invalid section group.
16229
c165fb93
ILT
16230 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16231 header size.
16232
7ef73768
ILT
16233 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16234 than read for file header.
16235 * archive.cc (Archive::include_member): Likewise.
16236
6194aaab
L
162372008-04-23 Paolo Bonzini <bonzini@gnu.org>
16238
16239 * aclocal.m4: Regenerate.
16240 * configure: Regenerate.
16241
d491d34e
ILT
162422008-04-19 Ian Lance Taylor <iant@google.com>
16243
5ea2bac6
ILT
16244 * version.cc (version_string): Bump to 1.6.
16245
7bc3e21a
ILT
16246 * testsuite/Makefile.am (many_sections_r_test): New target.
16247 (many_sections_r_test_SOURCES): Remove.
16248 (many_sections_r_test_DEPENDENCIES): Remove.
16249 (many_sections_r_test_LDFLAGS): Remove.
16250 (many_sections_r_test_LDADD): Remove.
16251
7fcd3aa9
ILT
16252 * object.cc (Sized_relobj::do_add_symbols): Always pass
16253 local_symbol_count_ to add_from_relobj.
16254
4c94d6ae
ILT
16255 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16256 every thousand variables.
16257 * testsuite/Makefile.in: Rebuild.
16258
d491d34e
ILT
16259 * object.cc (Xindex::initialize_symtab_xindex): New function.
16260 (Xindex::read_symtab_xindex): New function.
16261 (Xindex::sym_xindex_to_shndx): New function.
16262 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16263 available.
16264 (Sized_relobj::do_initialize_xindex): New function.
16265 (Sized_relobj::do_read_symbols): Adjust section links.
16266 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16267 parameter. Change all callers.
16268 (Sized_relobj::include_section_group): Adjust section links and
16269 symbol section indexes.
16270 (Sized_relobj::do_layout): Adjust section links.
16271 (Sized_relobj::do_count_local_symbols): Adjust section links and
16272 symbol section indexes.
16273 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16274 ordinary and special symbols.
16275 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16276 dynsym_xindex parameters. Change all callers. Adjust section
16277 links. Use SHN_XINDEX when needed.
16278 (Sized_relobj::get_symbol_location_info): Adjust section links.
16279 Don't get fooled by special symbols.
16280 * object.h (class Xindex): Define.
16281 (class Object): Add xindex_ parameter. Declare virtual functoin
16282 do_initialize_xindex.
16283 (Object::adjust_sym_shndx): New function.
16284 (Object::set_xindex): New protected function.
16285 (class Symbol_value): Add is_ordinary_shndx_ field.
16286 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16287 (Symbol_value::value): Assert ordinary section.
16288 (Symbol_value::initialize_input_to_output_map): Likewise.
16289 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16290 Change all callers.
16291 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16292 all callers.
16293 (class Sized_relobj): Update declarations.
16294 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16295 parameter. Change all callers.
16296 (Sized_relobj::adjust_shndx): New function.
16297 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16298 field.
16299 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16300 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16301 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16302 (Sized_dynobj::read_dynsym_section): Adjust section links.
16303 (Sized_dynobj::read_dynamic): Likewise.
16304 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16305 section links.
16306 (Sized_dynobj::do_initialize_xindex): New function.
16307 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16308 do_initialize_xindex.
16309 (Sized_dynobj::adjust_shndx): New function.
16310 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16311 dynsym_xindex_ fields.
16312 (Layout::finalize): Add a call to set_section_indexes before
16313 creating the symtab sections.
16314 (Layout::set_section_indexes): Don't do anything if the section
16315 already has a section index.
16316 (Layout::create_symtab_sections): Add shnum parameter. Change
16317 caller. Create .symtab_shndx section if needed.
16318 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16319 caller.
16320 (Layout::allocated_output_section_count): New function.
16321 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16322 needed.
16323 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16324 fields. Update declarations.
16325 (Layout::symtab_xindex): New function.
16326 (Layout::dynsym_xindex): New function.
16327 (class Write_symbols_task): Add layout_ field.
16328 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16329 Change caller.
16330 * output.cc (Output_section_headers::Output_section_headers): Add
16331 shstrtab_section parameter. Change all callers.
16332 (Output_section_headers::do_sized_write): Store overflow values
16333 for section count and section string table section index in
16334 section header zero.
16335 (Output_file_header::do_sized_write): Check for overflow of
16336 section count and section string table section index.
16337 (Output_symtab_xindex::do_write): New function.
16338 (Output_symtab_xindex::endian_do_write): New function.
16339 * output.h (class Output_section_headers): Add shstrtab_section_.
16340 Update declarations.
16341 (class Output_symtab_xindex): Define.
16342 (Output_section::has_out_shndx): New function.
16343 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16344 field.
16345 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16346 Change all callers.
16347 (Sized_symbol::init): Likewise.
16348 (Symbol::output_section): Check for ordinary symbol.
16349 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16350 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16351 callers.
16352 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16353 Change all callers. Simplify handling of symbols from sections
16354 not included in the link.
16355 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16356 distinction.
16357 (Weak_alias_sorter::operator()): Assert that symbols are
16358 ordinary.
16359 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16360 distinction.
16361 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16362 parameters. Change all callers.
16363 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16364 symbol distinction. Use SHN_XINDEX when needed.
16365 (Symbol_table::write_section_symbol): Add symtab_xindex
16366 parameter. Change all callers.
16367 (Symbol_table::sized_write_section_symbol): Likewise. Use
16368 SHN_XINDEX when needed.
16369 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16370 declarations.
16371 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16372 (Symbol::is_defined): Check is_ordinary.
16373 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16374 (Symbol::is_absolute, Symbol::is_common): Likewise.
16375 (class Sized_symbol): Update declarations.
16376 (class Symbol_table): Update declarations.
16377 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16378 parameters. Change all callers.
16379 (Sized_symbol::override): Likewise.
16380 (Symbol_table::override): Likewise.
16381 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16382 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16383 is_ordinary, and orig_st_shndx parameters. Change all callers.
16384 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16385 to be in an ordinary section.
16386 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16387 object and is_ordinary parameters. Change all callers.
16388 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16389 Change all callers. Don't add undefined or non-ordinary symbols
16390 to reloc_map_.
16391 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16392 Change all callers.
16393 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16394 declarations.
16395 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16396 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16397 (Sized_relobj::relocate_sections): Likewise.
16398 * target-reloc.h (scan_relocs): Adjust section symbol index.
16399 (scan_relocatable_relocs): Likewise.
16400 * i386.cc (Scan::local): Check for ordinary symbols.
16401 * sparc.cc (Scan::local): Likewise.
16402 * x86_64.cc (Scan::local): Likewise.
16403 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16404 to symbol_section_and_value.
16405 * testsuite/many_sections_test.cc: New file.
16406 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16407 (check_PROGRAMS): Add many_sections_test.
16408 (many_sections_test_SOURCES): Define.
16409 (many_sections_test_DEPENDENCIES): Define.
16410 (many_sections_test_LDFLAGS): Define.
16411 (BUILT_SOURCES): Add many_sections_define.h.
16412 (many_sections_define.h): New target.
16413 (BUILT_SOURCES): Add many_sections_check.h.
16414 (many_sections_check.h): New target.
16415 (check_PROGRAMS): Add many_sections_r_test.
16416 (many_sections_r_test_SOURCES): Define.
16417 (many_sections_r_test_DEPENDENCIES): Define.
16418 (many_sections_r_test_LDFLAGS): Define.
16419 (many_sections_r_test_LDADD): Define.
16420 (many_sections_r_test.o): New target.
16421 * testsuite/Makefile.in: Rebuild.
16422
c5818ff1
CC
164232008-04-17 Cary Coutant <ccoutant@google.com>
16424
16425 * errors.cc (Errors::info): New function.
16426 (gold_info): New function.
16427 * errors.h (Errors::info): New function.
16428 * gold.h (gold_info): New function.
16429 * object.cc (Input_objects::add_object): Print trace output.
16430 * options.cc (options::parse_set): New function.
16431 (General_options::parse_wrap): Deleted.
16432 (General_options::General_options): Deleted initializer.
16433 * options.h (options::String_set): New typedef.
16434 (options::parse_set): New function.
16435 (DEFINE_set): New macro.
16436 (General_options::wrap): Changed to use DEFINE_set. Changed
16437 callers of any_wrap_symbols and is_wrap_symbol.
16438 (General_options::trace, General_options::trace_symbol):
16439 New options.
16440 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16441 (General_options::wrap_symbols_): Deleted.
16442 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16443
b5be4a7c
DM
164442008-04-17 David S. Miller <davem@davemloft.net>
16445
16446 * options.cc (General_options::parse_V): New function.
16447 * options.h: Add entries for -V and -Qy.
16448
155a0dd7
ILT
164492008-04-17 Ian Lance Taylor <iant@google.com>
16450
16451 * common.cc (Symbol_table::allocate_commons): Remove options
16452 parameter. Change caller.
16453 (Symbol_table::do_allocate_commons): Remove options parameter.
16454 Change caller. Just call do_allocate_commons_list twice.
16455 (Symbol_table::do_allocate_commons_list): New function, broken out
16456 of do_allocate_commons.
16457 * common.h (class Allocate_commons_task): Remove options_ field.
16458 Update constructor.
16459 * symtab.cc (Symbol_table::Symbol_table): Initialize
16460 tls_commons_.
16461 (Symbol_table::add_from_object): Put TLS common symbols on
16462 tls_commons_ list.
16463 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16464 which are IN_OUTPUT_DATA.
16465 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16466 allocate_commons and do_allocate_commons declarations. Declare
16467 do_allocate_commons_list.
16468 * gold.cc (queue_middle_tasks): Update creation of
16469 Allocate_commons_task to not pass options.
16470 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16471 (TLS_TEST_C_FLAGS): New variable.
16472 (tls_test_c_pic.o): New target.
16473 (tls_test_shared.so): Link in tls_test_c_pic.o.
16474 (tls_test_c_pic_ie.o): New target.
16475 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16476 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16477 (tls_test_c.o): New target.
16478 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16479 (tls_pic_test_LDADD): Likewise.
16480 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16481 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16482 (tls_test_c_gnu2.o): New target.
16483 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16484 tls_test_c_gnu2.o.
16485 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16486 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16487 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16488 * testsuite/tls_test.cc: Include "config.h".
16489 (t_last): Call t11_last.
16490 * testsuite/tls_test.h (t11, t11_last): Declare.
16491 * testsuite/tls_test_c.c: New file.
16492 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16493 * configure.ac: Check for OpenMP support.
16494 * configure, config.in, Makefile.in: Rebuild.
16495 * testsuite/Makefile.in: Rebuild.
16496
edfbb029
CC
164972008-04-16 Cary Coutant <ccoutant@google.com>
16498
16499 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16500 (Target_i386::tls_base_symbol_defined_): New field.
16501 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16502 (Target_i386::Scan::global): Likewise.
16503 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16504 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16505 (Target_x86_64::tls_base_symbol_defined_): New field.
16506 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16507 (Target_x86_64::Scan::global): Likewise.
16508
f3c69fca
CC
165092008-04-16 Cary Coutant <ccoutant@google.com>
16510
16511 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16512 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16513 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16514 building shared libraries.
16515 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16516 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16517 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16518 * testsuite/Makefile.in: Rebuild.
16519 * testsuite/weak_undef.h: New file.
16520 * testsuite/weak_undef_file1.cc: Add extra test cases.
16521 * testsuite/weak_undef_file2.cc: Likewise.
16522 * testsuite/weak_undef_test.cc: Likewise.
16523
7c414435
DM
165242008-04-16 David S. Miller <davem@davemloft.net>
16525
32b769e1
DM
16526 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16527 Add issued_non_pic_error_ field. Declare check_non_pic.
16528 (Target_sparc::Scan::check_non_pic): New function.
16529 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16530 (Target_sparc::Scan::global): Likewise.
16531
11936fb1
DM
16532 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16533 * configure: Rebuild.
16534
7c414435
DM
16535 * options.h (DEFINE_enable): New macro.
16536 (new_dtags): New enable option.
16537 (initfirst, interpose, loadfltr, nodefaultlib,
16538 nodelete, nodlopen, nodump): New -z options.
16539 * layout.cc (Layout:finish_dynamic_section): If new
16540 dtags enabled, emit DT_RUNPATH. Also, emit a
16541 DT_FLAGS_1 containing any specified -z flags.
16542
85c7bf8b
ILT
165432008-04-16 Ian Lance Taylor <iant@google.com>
16544
12c0daef
ILT
16545 * copy-relocs.cc: New file.
16546 * copy-relocs.h: New file.
16547 * reloc.cc: Remove Copy_relocs code.
16548 * reloc.h: Likewise.
16549 * reloc-types.h (struct Reloc_types) [both versions]: Add
16550 get_reloc_addend_noerror.
16551 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16552 variants of add_global which take an addend which must be zero.
16553 * i386.cc: Include "copy-relocs.h".
16554 (class Target_i386): Change type of copy_relocs_ to variable,
16555 update initializer.
16556 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16557 Change all callers.
16558 (Target_i386::do_finalize_sections): Change handling of
16559 copy_relocs_.
16560 * sparc.cc: Include "copy-relocs.h".
16561 (class Target_sparc): Change type of copy_relocs_ to variable,
16562 update initializer.
16563 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16564 Change all callers.
16565 (Target_sparc::do_finalize_sections): Change handling of
16566 copy_relocs_.
16567 * x86_64.cc: Include "copy-relocs.h".
16568 (class Target_x86_64): Change type of copy_relocs_ to variable,
16569 update initializer.
16570 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16571 class. Change all callers.
16572 (Target_x86_64::do_finalize_sections): Change handling of
16573 copy_relocs_.
16574 * Makefile.am (CCFILES): Add copy-relocs.cc.
16575 (HFILES): Add copy-relocs.h.
16576
4f4995b6
ILT
16577 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16578
85c7bf8b
ILT
16579 * testsuite/script_test_4.sh: Permit leading zeroes.
16580
4f2a9edd
ILT
165812008-04-15 Ian Lance Taylor <iant@google.com>
16582
e6188289
ILT
16583 * script-sections.cc (Script_sections::create_segments): Use
16584 header_size_adjustment even when there is enough room for the
16585 headers.
16586 * testsuite/script_test_4.sh: New file.
16587 * testsuite/script_test_4.t: New file.
16588 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16589 (check_DATA): Add script_test_4.stdout.
16590 (MOSTLYCLEANFILES): Likewise.
16591 (script_test_4): New target.
16592 (script_test_4.stdout): New target.
16593 * testsuite/Makefile.in: Rebuild.
16594
4f2a9edd
ILT
16595 * sparc.cc: Add definitions for Output_data_plt_sparc class
16596 constants.
16597
f5314dd5
DM
165982008-04-14 David S. Miller <davem@davemloft.net>
16599
16600 * sparc.cc: New file.
16601 * Makefile.am (TARGETSOURCES): Add sparc.cc
16602 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16603 * configure.tgt: Document targ_extra_size and
16604 targ_extra_big_endian. Add entries for sparc-* and
16605 sparc64-*.
16606 * configure.ac: Handle targ_extra_size and
16607 targ_extra_big_endian.
16608 * Makefile.in: Rebuild.
16609 * configure: Likewise.
16610 * po/POTFILES.in: Likewise.
16611 * po/gold.pot: Likewise.
16612
154e0e9a
ILT
166132008-04-14 Ian Lance Taylor <iant@google.com>
16614
16615 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16616 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16617 in the name/type/flags to section mapping. Don't call
16618 allocate_output_section.
16619 (Layout::choose_output_section): Change parameter from adjust_name
16620 to is_input_section. Don't permit input sections after sections
16621 are attached to segments. Don't call allocate_output_section.
16622 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16623 not write_enable_output_section.
16624 (Layout::make_output_section): Don't push to
16625 unattached_section_list_ nor call attach_to_segment. Call
16626 attach_section_to_segment if sections are attached.
16627 (Layout::attach_sections_to_segments): New function.
16628 (Layout::attach_section_to_segment): New function.
16629 (Layout::attach_allocated_section_to_segment): Rename from
16630 attach_to_segment. Remove flags parameter.
16631 (Layout::allocate_output_section): Remove function.
16632 (Layout::write_enable_output_section): Remove function.
16633 * layout.h (class Layout): Update for above changes. Add new
16634 field sections_are_attached_.
16635 * output.h (Output_section::update_flags_for_input_section): New
16636 function.
16637 * output.cc (Output_section::add_input_section): Call
16638 update_flags_for_input_section.
16639 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16640
009a67a2
CC
166412008-04-11 Cary Coutant <ccoutant@google.com>
16642
16643 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16644 thought unnecessary.
16645 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16646
759b1a24
ILT
166472008-04-11 Ian Lance Taylor <iant@google.com>
16648
16649 * output.h (class Output_section_data): Remove inline definition
16650 of set_addralign.
16651 * output.cc (Output_section_data::set_addralign): New function.
16652
c2b45e22
CC
166532008-04-11 Cary Coutant <ccoutant@google.com>
16654
16655 Add support for TLS descriptors for i386 and x86_64.
16656 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16657 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16658 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16659 GOT_TYPE_TLS_DESC.
16660 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16661 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16662 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16663 relocations.
16664 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16665 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16666 Fix problem with initial-exec relocations.
16667 (Target_i386::Relocate::relocate_tls): Likewise.
16668 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16669 relaxation.
16670 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16671 support for section-plus-offset dynamic table entries.
16672 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16673 (Output_data_dynamic::Dynamic_entry): Add support for
16674 section-plus-offset dynamic table entries.
16675 (Output_data_dynamic::Classification): Likewise.
16676 (Output_data_dynamic::classification_): Renamed offset_.
16677 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16678 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16679 (Target_x86_64::make_plt_section): New function.
16680 (Target_x86_64::reserve_tlsdesc_entries): New function.
16681 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16682 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16683 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16684 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16685 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16686 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16687 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16688 add extra PLT entry for TLS descriptors.
16689 (Output_data_plt_x86_64::got_): New field.
16690 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16691 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16692 fields.
16693 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16694 descriptors.
16695 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16696 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16697 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16698 R_386_TLS_DESC_CALL relocations.
16699 (Target_x86_64::Scan::global): Likewise.
16700 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16701 for TLS descriptors.
16702 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16703 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16704 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16705 GD-to-IE relaxation.
16706 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16707 and TLS_DESCRIPTORS.
16708 * Makefile.in: Rebuild.
16709 * configure: Rebuild.
16710 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16711 (tls_test_shared2.so): New target.
16712 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16713 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16714 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16715 (tls_shared_gd_to_ie_test_LDADD): New variable.
16716 (tls_shared_gnu2_gd_to_ie_test): New target.
16717 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16718 New targets.
16719 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16720 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16721 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16722 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16723 (tls_shared_gnu2_test): New target.
16724 (tls_test_gnu2_shared.so): New target.
16725 (tls_shared_gnu2_test_SOURCES): New variable.
16726 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16727 (tls_shared_gnu2_test_LDFLAGS): New variable.
16728 (tls_shared_gnu2_test_LDADD): New variable.
16729 * testsuite/Makefile.in: Rebuild.
16730 * testsuite/Makefile.
16731
83bfb6b7
ILT
167322008-04-11 Ian Lance Taylor <iant@google.com>
16733
16734 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16735 justsyms.t.
16736 * testsuite/Makefile.in: Rebuild.
16737
16738 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16739 long.
16740 * testsuite/script_test_2.cc (main): Adjust test.
16741
706e1f5e
ILT
167422008-04-11 David S. Miller <davem@davemloft.net>
16743 Ian Lance Taylor <iant@google.com>
16744
16745 * options.h (General_options): Add entries for '-Y' and
16746 '-relax'.
16747 * options.cc (General_options:finalize): If -Y was used, add those
16748 entries to the library path instead of the default "/lib" and
16749 "/usr/lib".
16750
7c98e6bb
DM
167512008-04-11 David S. Miller <davem@davemloft.net>
16752
16753 * testsuite/justsyms.t: Start at 0x100.
16754 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16755 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16756 long.
16757 * testsuite/script_test_2.cc: Adjust string and section length
16758 checks.
7c98e6bb 16759
99a37bfd
ILT
167602008-04-09 Ian Lance Taylor <iant@google.com>
16761
2cefc357
ILT
16762 PR gold/5996
16763 * script-sections.cc (Sections_element::allocate_to_segment): Add
16764 orphan parameter.
16765 (Output_section_definition::allocate_to_segment): Likewise.
16766 (Orphan_output_section::allocate_to_segment): Likewise.
16767 (Script_sections::attach_sections_using_phdrs_clause): Don't
16768 propagate non-PT_LOAD segments to orphan sections.
16769 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16770 readelf rather than objdump.
16771 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16772 .interp section and PT_INTERP segment are the same size.
16773 * testsuite/Makefile.in: Rebuild.
16774
99a37bfd
ILT
16775 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16776 aliases for symbols defined in the same object.
16777 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16778 (weak_alias_test_SOURCES): New variable.
16779 (weak_alias_test_DEPENDENCIES): New variable.
16780 (weak_alias_test_LDFLAGS): New variable.
16781 (weak_alias_test_LDADD): New variable.
16782 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16783 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16784 (weak_alias_test_3.o): New target.
16785 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16786 * testsuite/weak_alias_test_main.cc: New file.
16787 * testsuite/weak_alias_test_1.cc: New file.
16788 * testsuite/weak_alias_test_2.cc: New file.
16789 * testsuite/weak_alias_test_3.cc: New file.
16790
780e49c5
ILT
167912008-04-08 Ian Lance Taylor <iant@google.com>
16792
cdb0b8f5
ILT
16793 * options.h (class General_options): Add --noinhibit-exec option.
16794 * main.cc (main): Check --noinhibit-exec.
16795
0864d551
ILT
16796 * options.h (class General_options): Define --wrap as a special
16797 option. Add wrap_symbols_ field.
16798 (General_options::any_wrap_symbols): New function.
16799 (General_options::is_wrap_symbol): New function.
16800 * options.cc (General_options::parse_wrap): New function.
16801 (General_options::General_options): Initialize wrap_symbols_.
16802 * symtab.cc (Symbol_table::wrap_symbol): New function.
16803 (Symbol_table::add_from_object): Handle --wrap.
16804 * symtab.h (class Symbol_table): Declare wrap_symbol.
16805 * target.h (Target::wrap_char): New function.
16806 (Target::Target_info): Add wrap_char field.
16807 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16808 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16809 * testsuite/testfile.cc (Target_test::test_target_info):
16810 Likewise.
16811
789aa6de
ILT
16812 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16813 there is one.
16814
2c38906f
ILT
16815 * layout.h (class Layout): Add added_eh_frame_data_ field.
16816 * layout.cc (Layout::Layout): Initialize new field.
16817 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16818 output section until we find a section we merged successfully.
16819 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16820 that the size be non-zero.
16821
780e49c5
ILT
16822 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16823 qualifier.
16824
7fcd0256
ILT
168252008-04-08 Craig Silverstein <csilvers@google.com>
16826
16827 * configure.ac: Export new conditional variable HAVE_ZLIB.
16828 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16829 on HAVE_ZLIB.
16830 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16831 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16832
6835af53
ILT
168332008-04-07 Ian Lance Taylor <iant@google.com>
16834
e24f324c
ILT
16835 * version.cc (version_string): Set to "1.5".
16836
a036edd8
ILT
16837 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16838 Add issued_non_pic_error_ field. Declare check_non_pic.
16839 (Target_x86_64::Scan::check_non_pic): New function.
16840 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16841 (Target_x86_64::Scan::global): Likewise.
16842
624f8810
ILT
16843 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16844 addend parameter. Change caller. Handle merge sections.
16845 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16846 Address to Addend. Don't add in the result of
16847 local_section_offset, pass down the addend and use the returned
16848 value.
16849 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16850 Update declarations of local_section_offset and symbol_value.
16851 * testsuite/two_file_test_1.cc (t18): New function.
16852 * testsuite/two_file_test_2.cc (f18): New function.
16853 * testsuite/two_file_test_main.cc (main): Call t18.
16854 * testsuite/two_file_test.h (t18, f18): Declare.
16855
6835af53
ILT
16856 * configure.ac: Don't test for objdump, c++filt, or readelf.
16857 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16858 conditionals.
16859 (TEST_READELF): New variable.
16860 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16861 (check_PROGRAMS): Add two_file_strip_test.
16862 (two_file_strip_test): New target.
16863 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16864 (two_file_same_shared_strip_test_SOURCES): New variable.
16865 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16866 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16867 (two_file_same_shared_strip_test_LDADD): New variable.
16868 (two_file_shared_strip.so): New target.
16869 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16870 (ver_test_5.syms, ver_test_7.syms): Likewise.
16871 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16872 (strip_test_3.stdout): Use TEST_OBJDUMP.
16873 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16874
86925eef
CC
168752008-04-04 Cary Coutant <ccoutant@google.com>
16876
16877 * symtab.h (Symbol::is_weak_undefined): New function.
16878 (Symbol::is_strong_undefined): New function.
16879 (Symbol::is_absolute): New function.
16880 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16881 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16882 absolute symbols.
16883 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16884 (weak_undef_test): New target.
16885 * testsuite/Makefile.in: Rebuild.
16886 * testsuite/weak_undef_file1.cc: New file.
16887 * testsuite/weak_undef_file2.cc: New file.
16888 * testsuite/weak_undef_test.cc: New file.
16889
126f3ece
ILT
168902008-04-03 Craig Silverstein <csilvers@google.com>
16891
16892 * compressed_output.h (class Output_compressed_section): Use
16893 unsigned buffer.
16894 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16895 add zlib header.
16896 (zlib_compressed_suffix): Removed.
16897 (Output_compressed_section::set_final_data_size): Use unsigned
16898 buffers.
16899 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16900 Fix linker invocation.
16901 (flagstest_o_specialfile_and_compress_debug_sections):
16902 Likewise.
16903 * testsuite/Makefile.in: Regenerated.
16904
deae2a14
DM
169052008-04-02 David S. Miller <davem@davemloft.net>
16906
16907 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16908 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16909
70752818
ILT
169102008-04-02 Craig Silverstein <csilvers@google.com>
16911
16912 * TODO: New file.
16913
39d0cb0e
ILT
169142008-04-02 Ian Lance Taylor <iant@google.com>
16915
16916 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16917 parameters. Update for new key type to views_. Change all
16918 callers.
16919 (File_read::read): Adjust for byteshift in returned view.
16920 (File_read::add_view): New function, broken out of
16921 find_and_make_view.
16922 (File_read::make_view): New function, broken out of
16923 find_and_make_view.
16924 (File_read::find_or_make_view): Add offset and aligned
16925 parameters. Rewrite accordingly. Change all callers.
16926 (File_read::get_view): Add offset and aligned parameters. Adjust
16927 for byteshift in return value.
16928 (File_read::get_lasting_view): Likewise.
16929 * fileread.h (class File_read): Update declarations.
16930 (class File_read::View): Add byteshift_ field. Add byteshift to
16931 constructor. Add byteshift method.
16932 * archive.h (Archive::clear_uncached_views): New function.
16933 (Archive::get_view): Add aligned parameter. Change all callers.
16934 * object.h (Object::get_view): Add aligned parameter. Change all
16935 callers.
16936 (Object::get_lasting_view): Likewise.
16937
16938 * fileread.cc (File_read::release): Don't call clear_views if
16939 there are multiple objects.
16940 * fileread.h (File_read::clear_uncached_views): New function.
16941 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16942 on the archive.
16943
a1207466
CC
169442008-03-31 Cary Coutant <ccoutant@google.com>
16945
16946 Add thin archive support.
16947 * archive.cc (Archive::armagt): New const.
16948 (Archive::setup): Remove task parameter and calls to unlock.
16949 (Archive::unlock_nested_archives): New function.
16950 (Archive::read_header): Add nested_off parameter. Change
16951 all callers.
16952 (Archive::interpret_header): Likewise.
16953 (Archive::include_all_members): Change to handle thin
16954 archives.
16955 (Archive::include_member): Likewise.
16956 * archive.h (Archive::Archive): Add new parameters and
16957 initializers.
16958 (Archive::armagt): New const.
16959 (Archive::setup): Remove task parameter.
16960 (Archive::unlock_nested_archives): New function.
16961 (Archive::read_header): Add nested_off parameter.
16962 (Archive::interpret_header): Likewise.
16963 (Archive::Nested_archive_table): New typedef.
16964 (Archive::is_thin_archive_): New field.
16965 (Archive::nested_archives_): New field.
16966 (Archive::options_): New field.
16967 (Archive::dirpath_): New field.
16968 (Archive::task_): New field.
16969 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16970 for thin archives. Pass additional parameters to
16971 Archive::Archive. Unlock the archive file after calling
16972 Archive::setup.
cd536b21 16973
479f6503
ILT
169742008-03-29 Ian Lance Taylor <iant@google.com>
16975
686c8caf
ILT
16976 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16977 version symbol to be local.
16978 * testsuite/ver_test_4.sh: New file.
16979 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16980 (check_DATA): Add ver_test_4.syms.
16981 (ver_test_4.syms): New target.
16982 * testsuite/Makefile.in: Rebuild.
16983
ab794b6b
ILT
16984 * output.cc
16985 (Output_section::Input_section_sort_entry::has_priority): New
16986 function.
16987 (Output_section::Input_section_sort_entry::match_file_name): New
16988 function.
16989 (Output_section::Input_section_sort_entry::match_section_name):
16990 Remove.
16991 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16992 Remove.
16993 (Output_section::Input_section_sort_entry::match_section_file):
16994 Remove.
16995 (Output_section::Input_section_sort_compare::operator()): Rewrite
16996 using new Input_section_sort_entry functions. Sort crtbegin and
16997 crtend first. Sort sections with no priority before sections with
16998 a priority.
16999 * testsuite/initpri1.c (d3): Check j != 4.
17000 (cd5): New constructor/destructor function.
17001 (main): Check j != 2.
17002
479f6503
ILT
17003 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17004 new symbol when resolving, don't call set_is_default.
17005 * testsuite/ver_test_7.cc: New file.
17006 * testsuite/ver_test_7.sh: New file.
17007 * testsuite/Makefile.am (ver_test_7.so): New target.
17008 (ver_test_7.o): New target.
17009 (check_SCRIPTS): Add ver_test_7.sh.
17010 (check_DATA): Add ver_test_7.syms.
17011 (ver_test_7.syms): New target.
17012
2fd32231
ILT
170132008-03-28 Ian Lance Taylor <iant@google.com>
17014
17015 * layout.cc (Layout::layout): If we see an input section with a
17016 name that needs sorting, set the must_sort flag for the output
17017 section.
17018 (Layout::make_output_section): If the name of the output section
17019 indicates that it might require sorting, set the may_sort flag.
17020 * output.h (Output_section::may_sort_attached_input_sections): New
17021 function.
17022 (Output_section::set_may_sort_attached_input_sections): New
17023 function.
17024 (Output_section::must_sort_attached_input_sections): New
17025 function.
17026 (Output_section::set_must_sort_attached_input_sections): New
17027 function.
17028 (class Output_section): Declare Input_section_sort_entry. Define
17029 Input_section_sort_compare. Declare
17030 sort_attached_input_sections. Add new fields:
17031 may_sort_attached_input_sections_,
17032 must_sort_attached_input_sections_,
17033 attached_input_sections_are_sorted_.
17034 * output.cc (Output_section::Output_section): Initialize new
17035 fields.
17036 (Output_section::add_input_section): Add an entry to
17037 input_sections_ if may_sort or must_sort are true.
17038 (Output_section::set_final_data_size): Call
17039 sort_attached_input_sections if necessary.
17040 (Output_section::Input_section_sort_entry): Define new class.
17041 (Output_section::Input_section_sort_compare::operator()): New
17042 function.
17043 (Output_section::sort_attached_input_sections): New function.
17044 * configure.ac: Check whether the compiler supports constructor
17045 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17046 * testsuite/initpri1.c: New file.
17047 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17048 CONSTRUCTOR_PRIORITY.
17049 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17050 (initpri1_LDFLAGS): New variable.
17051 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17052
18e6b24e
ILT
170532008-03-27 Ian Lance Taylor <iant@google.com>
17054
49bdd526
ILT
17055 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17056 * testsuite/common_test_1.c: New file.
17057 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17058 (common_test_1_SOURCES): New variable.
17059 (common_test_1_DEPENDENCIES): New variable.
17060 (common_test_1_LDFLAGS): New variable.
17061
18e6b24e
ILT
17062 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17063 and commons_ correctly when NAME/VERSION does not override
17064 NAME/NULL.
17065 * testsuite/ver_test_6.c: New file.
17066 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17067 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17068 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17069
04bf7072
ILT
170702008-03-26 Ian Lance Taylor <iant@google.com>
17071
5871526f
ILT
17072 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17073 of an undefined symbol from a version script.
17074 * testsuite/Makefile.am (ver_test_5.so): New target.
17075 (ver_test_5.o): New target.
17076 (check_SCRIPTS): Add ver_test_5.sh.
17077 (check_DATA): Add ver_test_5.syms.
17078 (ver_test_5.syms): New target.
17079 * testsuite/ver_test_5.cc: New file.
17080 * testsuite/ver_test_5.script: New file.
17081 * testsuite/ver_test_5.sh: New file.
17082 * Makefile.in, testsuite/Makefile.in: Rebuild.
17083
04bf7072
ILT
17084 PR gold/5986
17085 Fix problems building gold with gcc 4.3.0.
17086 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17087 (gold_error_at_location, gold_warning_at_location): Use it.
17088 * configure.ac: Check whether we can compile and use a template
17089 function with a printf attribute.
17090 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17091 when jumping over bytes.
17092 * object.cc: Instantiate Object::read_section_data.
17093 * debug.h: Include <cstring>
17094 * dwarf_reader.cc: Include <algorithm>
17095 * main.cc: Include <cstring>.
17096 * options.cc: Include <cstring>.
17097 * output.cc: Include <cstring>.
17098 * script.cc: Include <cstring>.
17099 * script.h: Include <string>.
17100 * symtab.cc: Include <cstring> and <algorithm>.
17101 * target-select.cc: Include <cstring>.
17102 * version.cc: Include <string>.
17103 * testsuite/testmain.cc: Include <cstdlib>.
17104 * configure, config.in: Rebuild.
17105
874c5b28
ILT
171062008-03-25 Ian Lance Taylor <iant@google.com>
17107
819d6c3a
ILT
17108 * options.cc: Include "../bfd/bfdver.h".
17109 (options::help): Print bug reporting address.
17110
f4b2c6f5
ILT
17111 * version.cc (print_version): Adjust output for current value of
17112 BFD_VERSION_STRING.
17113
17114 * NEWS: New file.
17115
e96caa79
ILT
17116 * options.cc (options::help): Print list of supported targets.
17117 * target-select.h: Include <vector>.
17118 (class Target_selector): Make machine_, size_, and is_big_endian_
17119 fields const. Add bfd_name_ and instantiated_target_ fields.
17120 (Target_selector::Target_selector): Add bfd_name parameter.
17121 (Target_selector::recognize): Make non-virtual, call
17122 do_recognize.
17123 (Target_selector::recognize_by_name): Make non-virtual, call
17124 do_recognize_by_name.
17125 (Target_selector::supported_names): New function.
17126 (Target_selector::bfd_name): New function.
17127 (Target_selector::do_instantiate_target): New pure virtual
17128 function.
17129 (Target_selector::do_recognize): New virtual function.
17130 (Target_selector::do_recognize_by_name): New virtual function.
17131 (Target_selector::instantiate_target): New private function.
17132 (supported_target_names): Declare.
17133 * target-select.cc (Target_selector::Target_selector): Update for
17134 new parameter and fields.
17135 (select_target_by_name): Check that the name matches before
17136 calling recognize_by_name.
17137 (supported_target_names): New function.
17138 * i386.cc (class Target_selector_i386): Update Target_selector
17139 constructor call. Remove recognize and recognize_by_name. Add
17140 do_instantiate_target.
17141 * x86_64.cc (class Target_selector_x86_64): Likewise.
17142 * testsuite/testfile.cc (class Target_selector_test): Update for
17143 changes to Target_selector.
17144
874c5b28
ILT
17145 * README: Rewrite, with some notes on unsupported features.
17146
0a65a3a7
CC
171472008-03-24 Cary Coutant <ccoutant@google.com>
17148
17149 * i386.cc (Target_i386::Got_type): New enum declaration.
17150 (Target_i386::Scan::local): Updated callers of Output_data_got
17151 member functions.
17152 (Target_i386::Scan::global): Likewise.
17153 (Target_i386::Relocate::relocate): Likewise.
17154 (Target_i386::Relocate::relocate_tls): Likewise.
17155 * object.h (Got_offset_list): New class.
17156 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17157 (Sized_relobj::local_got_offset): Likewise.
17158 (Sized_relobj::set_local_got_offset): Likewise.
17159 (Sized_relobj::local_has_tls_got_offset): Removed.
17160 (Sized_relobj::local_tls_got_offset): Removed.
17161 (Sized_relobj::set_local_tls_got_offset): Removed.
17162 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17163 * output.cc (Output_data_got::add_global): Added got_type parameter.
17164 (Output_data_got::add_global_with_rel): Likewise.
17165 (Output_data_got::add_global_with_rela): Likewise.
17166 (Output_data_got::add_global_pair_with_rel): New function.
17167 (Output_data_got::add_global_pair_with_rela): New function.
17168 (Output_data_got::add_local): Added got_type parameter.
17169 (Output_data_got::add_local_with_rel): Likewise.
17170 (Output_data_got::add_local_with_rela): Likewise.
17171 (Output_data_got::add_local_pair_with_rel): New function.
17172 (Output_data_got::add_local_pair_with_rela): New function.
17173 (Output_data_got::add_global_tls): Removed.
17174 (Output_data_got::add_global_tls_with_rel): Removed.
17175 (Output_data_got::add_global_tls_with_rela): Removed.
17176 (Output_data_got::add_local_tls): Removed.
17177 (Output_data_got::add_local_tls_with_rel): Removed.
17178 (Output_data_got::add_local_tls_with_rela): Removed.
17179 * output.h (Output_data_got::add_global): Added got_type parameter.
17180 (Output_data_got::add_global_with_rel): Likewise.
17181 (Output_data_got::add_global_with_rela): Likewise.
17182 (Output_data_got::add_global_pair_with_rel): New function.
17183 (Output_data_got::add_global_pair_with_rela): New function.
17184 (Output_data_got::add_local): Added got_type parameter.
17185 (Output_data_got::add_local_with_rel): Likewise.
17186 (Output_data_got::add_local_with_rela): Likewise.
17187 (Output_data_got::add_local_pair_with_rel): New function.
17188 (Output_data_got::add_local_pair_with_rela): New function.
17189 (Output_data_got::add_global_tls): Removed.
17190 (Output_data_got::add_global_tls_with_rel): Removed.
17191 (Output_data_got::add_global_tls_with_rela): Removed.
17192 (Output_data_got::add_local_tls): Removed.
17193 (Output_data_got::add_local_tls_with_rel): Removed.
17194 (Output_data_got::add_local_tls_with_rela): Removed.
17195 * resolve.cc (Symbol::override_base_with_special): Removed
17196 reference to has_got_offset_ field.
17197 * symtab.cc (Symbol::init_fields): Replaced initialization
17198 of got_offset_ with got_offsets_. Removed initialization
17199 of has_got_offset_
53fcba31 17200 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17201 (Symbol::got_offset): Likewise.
17202 (Symbol::set_got_offset): Likewise.
17203 (Symbol::has_tls_got_offset): Removed.
17204 (Symbol::tls_got_offset): Removed.
17205 (Symbol::set_tls_got_offset): Removed.
17206 (Symbol::got_offset_): Removed.
17207 (Symbol::tls_mod_got_offset_): Removed.
17208 (Symbol::tls_pair_got_offset_): Removed.
17209 (Symbol::got_offsets_): New field.
17210 (Symbol::has_got_offset): Removed.
17211 (Symbol::has_tls_mod_got_offset): Removed.
17212 (Symbol::has_tls_pair_got_offset): Removed.
17213 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17214 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17215 member functions.
17216 (Target_x86_64::Scan::global): Likewise.
17217 (Target_x86_64::Relocate::relocate): Likewise.
17218 (Target_x86_64::Relocate::relocate_tls): Likewise.
17219
bd52eafb
BE
172202008-03-25 Ben Elliston <bje@au.ibm.com>
17221
17222 * yyscript.y: Fix spelling error in comment.
17223
8b105e34
ILT
172242008-03-24 Ian Lance Taylor <iant@google.com>
17225
8ed814a9
ILT
17226 * options.h (class General_options): Define build_id option.
17227 * layout.h (class Layout): Declare write_build_id, create_note,
17228 create_build_id. Add build_id_note_ member.
17229 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17230 "libiberty.h", "md5.h", "sha1.h".
17231 (Layout::Layout): Initialize eh_frame_data_,
17232 eh_frame_hdr_section_, and build_id_note_.
17233 (Layout::finalize): Call create_build_id.
17234 (Layout::create_note): New function, broken out of
17235 Layout::create_gold_note.
17236 (Layout::create_gold_note): Call create_note.
17237 (Layout::create_build_id): New function.
17238 (Layout::write_build_id): New function.
17239 (Close_task_runner::run): Call write_build_id.
17240
8b105e34
ILT
17241 * x86_64.cc: Correct license to GPLv3.
17242
086a1841
ILT
172432008-03-23 Ian Lance Taylor <iant@google.com>
17244
17245 * options.cc: Include "demangle.h".
17246 (parse_optional_string): New function.
17247 (parse_long_option): Handle takes_optional_argument.
17248 (parse_short_option): Update dash_z initializer. Handle
17249 takes_optional_argument.
17250 (General_options::General_options): Initialize do_demangle_.
17251 (General_options::finalize): Set do_demangle_. Handle demangling
17252 style.
17253 * options.h (parse_optional_string): Declare.
17254 (struct One_option): Add optional_arg field. Update constructor.
17255 Update call constructor calls. Add takes_optional_argument
17256 function.
17257 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17258 (DEFINE_optional_string): Define.
17259 (General_options::demangle): Change from DEFINE_bool to
17260 DEFINE_optional_string.
17261 (General_options::no_demangle): New function.
17262 (General_options::do_demangle): New function.
17263 (General_options::set_do_demangle): New function.
17264 (General_options::execstack_status_): Move definition to end of
17265 class definition.
17266 (General_options::static_): Likewise.
17267 (General_options::do_demangle_): New field.
17268 * object.cc (big_endian>::get_symbol_location_info): Call
17269 Options::do_demangle, not Options::demangle.
17270 * symtab.cc (demangle): Likewise.
17271
cbb93e63
ILT
172722008-03-22 Ian Lance Taylor <iant@google.com>
17273
17274 * gold.h: Include <cstddef> and <sys/types.h>
17275 * options.h: Include <cstring>.
17276
ec531623
ILT
172772008-03-21 Ian Lance Taylor <iant@google.com>
17278
17279 * Added source code to GNU binutils.
752937aa 17280\f
b90efa5b 17281Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17282
17283Copying and distribution of this file, with or without modification,
17284are permitted in any medium without royalty provided the copyright
17285notice and this notice are preserved.
17286
17287Local Variables:
17288mode: change-log
17289left-margin: 8
17290fill-column: 74
17291version-control: never
17292End:
This page took 1.092029 seconds and 4 git commands to generate.