sim: msp430: delete unused trace macros
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
970cdef2
DI
12015-06-11 Davide Italiano <dccitaliano@gmail.com>
2
3 * gold.h (is_cident): Correct typo.
4
a48d0c12
HS
52015-06-10 Han Shen <shenhan@google.com>
6 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
7
8 Now fixing for 843419 is fully functional.
9
10 The first part of the erratum fix CL is here -
11 https://sourceware.org/ml/binutils/2015-04/msg00229.html
12
13 * aarch64.cc(global enum): New constants representing stub types.
14 (Stub_template): New POD struct.
15 (Stub_template_repertoire): New class.
16 (Stub_base): New class.
17 (Erratum_stub): New class.
18 (Reloc_stub): Refactored to be a subclass of Stub_base.
19 (Reloc_stub::Stub_type): Removed.
20 (Reloc_stub::offset): Moved to Stub_base.
21 (Reloc_stub::set_offset): Moved to Stub_base.
22 (Reloc_stub::destination_address): Moved to Stub_base.
23 (Reloc_stub::set_destination_address): Moved to Stub_base.
24 (Reloc_stub::reset_destination_address): Moved to Stub_base.
25 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
26 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
27 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
28 (Reloc_stub::write): Moved to Stub_base.
29 (Reloc_stub::invalid_offset): Moved to Stub_base.
30 (Reloc_stub::invalid_address): Moved to Stub_base.
31 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
32 (Reloc_stub::stub_insns_): Moved to Stub_base.
33 (Reloc_stub::offset_): Moved to Stub_base.
34 (Reloc_stub::destination_address_): Moved to Stub_base.
35 (Stub_table::The_aarch64_relobj): New typedef.
36 (Stub_table::The_erratum_stub): New typedef.
37 (Stub_table::The_erratum_stub_less): New typedef.
38 (Stub_table::The_erratum_stub_set): New typedef.
39 (Stub_table::The_erratum_stub_set_iter): New typedef.
40 (Stub_table::empty): Added emptiness testing for erratum stubs.
41 (Stub_table::add_erratum_stub): New method to add an erratum stub.
42 (Stub_table::find_erratum_stub): New method.
43 (Stub_table::find_erratum_stubs_for_input_section): New method.
44 (Stub_table::erratum_stub_address): New method.
45 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
46 (Stub_table::do_addralign): Modified to handle erratum stubs.
47 (Stub_table::erratum_stubs_): New member.
48 (Stub_table::erratum_stub_size_): New member.
49 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
50 (Stub_table::do_write): Modified to handle erratum stubs.
51 (AArch64_relobj::The_erratum_stub): New typedef.
52 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
53 (AArch64_relobj::fix_errata): New method.
54 (Target_aarch64::The_reloc_stub_type): Removed.
55 (Target_aarch64::The_erratum_stub): New typede.
56 (AArch64_relocate_functions::construct_b): New method.
57
1e1b2efc
NC
582015-06-08 Nick Clifton <nickc@redhat.com>
59
60 * po/fr.po: New French Translation.
61
b8cf5075
CC
622015-06-07 Cary Coutant <ccoutant@gmail.com>
63
64 PR gold/18288
65 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
66 callers. Don't use STT_COMMON to check for common symbols.
67 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
68 symbol that's not in a common section.
69 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
70 common symbols.
71
bdd2d2b7
CC
722015-06-04 Cary Coutant <ccoutant@gmail.com>
73
74 PR gold/18200
75 * Makefile.am (diststuff): Add target.
76 * Makefile.in: Regenerate.
77
cd3c333f
CC
782015-06-04 Cary Coutant <ccoutant@gmail.com>
79
80 PR gold/17498
81 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
82 temporary locals in merge sections.
83 * options.cc (General_options::parse_discard_all): New method.
84 (General_options::parse_discard_locals): New method.
85 (General_options::parse_discard_none): New method.
86 (General_options::General_options): Initialize discard_locals_.
87 * options.h (--discard-all): Convert to special option.
88 (--discard-locals): Likewise.
89 (--discard-none): New option.
90 (General_options::discard_all): New method.
91 (General_options::discard_locals): New method.
92 (General_options::discard_sec_merge): New method.
93 (General_options::Discard_locals): New enum.
94 (General_options::discard_locals_): New data member.
95
8086551f
CC
962015-06-03 Cary Coutant <cary@google.com>
97
98 * script-sections.cc (Script_sections::Script_sections): Initialize
99 segments_created_.
100 (Script_sections::create_note_and_tls_segments): Set flag when
101 segments are created.
102 (Script_sections::expected_segment_count): Count PT_INTERP.
103 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
104 segments are created.
105 * script-sections.h (Script_sections::segments_created_): New data
106 member.
107
374082df
CC
1082015-06-03 Cary Coutant <ccoutant@gmail.com>
109
110 PR gold/15370
111 * script-sections.cc
112 (Output_section_element_input::set_section_addresses): When there
113 are several patterns with no sort spec, put all sections in the same
114 bin.
115 * testsuite/Makefile.am (script_test_12): New testcase.
116 (script_test_12i): New testcase.
117 * testsuite/Makefile.in: Regenerate.
118 * testsuite/script_test_12.t: New test linker script.
119 * testsuite/script_test_12i.t: New test linker script.
120 * testsuite/script_test_12a.c: New test source file.
121 * testsuite/script_test_12b.c: New test source file.
122
775ed62e
CC
1232015-06-02 Cary Coutant <ccoutant@gmail.com>
124
125 * nacl.h (Sniff_file): Switch parameters to get_view to get an
126 aligned view.
127
9c7fe3c5
CC
1282015-06-03 Cary Coutant <ccoutant@gmail.com>
129
130 PR gold/17819
131 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
132 separate task to schedule the build id computation.
133 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
134 add Output_file and offset.
135 (Hash_task::run): Get and release the input views.
136 (Hash_task::is_runnable): Always return NULL (always runnable).
137 (Layout::queue_build_id_tasks): Remove.
138 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
139 parameters; use them instead of class members.
140 (Build_id_task_runner::run): New function.
141 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
142 to write_build_id.
143 * layout.h (Layout::queue_build_id_tasks): Remove.
144 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
145 parameters.
146 (Layout::array_of_hashes_): Remove.
147 (Layout::size_of_array_of_hashes_): Remove.
148 (Layout::input_view_): Remove.
149 (Build_id_task_runner): New class.
150 (Close_task_runner::Close_task_runner): Add array_of_hashes and
151 size_of_hashes parameters.
152 (Close_task_runner::array_of_hashes_): New data member.
153 (Close_task_runner::size_of_hashes_): New data member.
154 * testsuite/Makefile.am
155 (flagstest_compress_debug_sections_and_build_id_tree): New test.
156 * testsuite/Makefile.in: Regenerate.
157
400f8944
RÁE
1582015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
159
160 * merge.cc (get_input_merge_map): Update for data structure change.
161 (get_or_make_input_merge_map): Update for data structure change.
162 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
163 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
164
bbec1a5d
AM
1652015-05-16 Alan Modra <amodra@gmail.com>
166
167 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
168 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
169 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
170 (lis_0): Rename from lis_0_0.
171
efc6fa12
CC
1722015-04-29 Cary Coutant <cary@google.com>
173 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
174
175 * gc.h (Garbage_collection::is_section_garbage): Change Object*
176 to Relobj*.
177 (Garbage_collection::add_reference): Likewise.
178 (Garbage_collection::gc_process_relocs): Likewise. Don't push
179 object/shndx pair onto *secvec for dynamic objects. Don't follow
180 relocations pointing to dynamic objects for GC.
181 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
182 (Icf::unfold_section): Likewise.
183 (Icf::is_section_folded): Likewise.
184 (Icf::get_folded_section): Likewise.
185 * icf.h: (Icf::get_folded_section): Likewise.
186 (Icf::unfold_section): Likewise.
187 (Icf::is_section_folded): Likewise.
188 (Icf::section_has_function_pointers): Likewise.
189 (Icf::set_section_has_function_pointers): Likewise.
190 * object.h (Section_id): Likewise.
191 (Const_section_id): Likewise.
192 * output.cc (Output_section::update_section_layout): Likewise.
193 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
194 Likewise.
195 * plugin.cc (update_section_order): Likewise.
196 (unique_segment_for_sections): Likewise.
197 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
198 (Target_powerpc::do_gc_add_reference): Likewise.
199 (Target_powerpc::gc_process_relocs): Likewise.
200 (Target_powerpc::do_gc_add_reference): Likewise.
201 * symtab.cc (Symbol_table::is_section_folded): Likewise.
202 (Symbol_table::gc_mark_symbol): Likewise.
203 * symtab.h: (Symbol_table::is_section_folded): Likewise.
204 * target.h: (Sized_target::gc_add_reference): Likewise.
205 (Sized_target::do_gc_add_reference): Likewise.
206
f9d3ecaa
NC
2072015-04-29 Nick Clifton <nickc@redhat.com>
208
209 * po/fi.po: Updated Finnish translation.
210
faa2211d
AM
2112015-04-28 Alan Modra <amodra@gmail.com>
212
213 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
214 than unsigned int for find_global_entry result temp. Compare
215 against invalid_address.
216 (Target_powerpc::do_plt_address_for_global): Likewise.
217 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
218 on plt call stub existence for debug info. Do assert for plt
219 and global entry stub existence if an alloc section.
220
6ec65f28
AM
2212015-04-28 Alan Modra <amodra@gmail.com>
222
223 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
224 on missing global entry stub due to bogus debug info.
225
7a2a1c79
HS
2262015-04-27 Han Shen <shenhan@google.com>
227
228 * options.h (--fix-cortex-a53-843419): Rename option.
229 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
230 option.
231 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
232
cfbf0e3c
RÁE
2332015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
234
235 PR gold/18327
236 * output.cc (Output_section::is_input_address_mapped): Assume a missing
237 entry is mapped.
238 * testsuite/Makefile.am: Add the eh_test test.
239 * testsuite/Makefile.in: Regenerate.
240 * testsuite/eh_test_a.cc: New test.
241 * testsuite/eh_test_b.cc: New test.
242
6ec65f28
AM
2432015-04-23 Sriraman Tallam <tmsriram@google.com>
244
a100d66f
ST
245 * options.h (--weak-unresolved-symbols): New option.
246 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
247 binding to weak with new option.
248 * symtab.h (is_weak_undefined): Check for new option.
249 (is_strong_undefined): Check for new option.
250 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
251 * testsuite/Makefile.in: Regenerate.
252 * testsuite/weak_unresolved_symbols_test.cc: New file.
253
4b889c30
IC
2542015-04-20 Ian Coolidge <icoolidge@google.com>
255
256 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
257 GNU_UNIQUE.
258
4277535c
RÁE
2592015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
260
261 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
262 push_back.
263 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
264 * object.cc (Sized_relobj_file::do_layout): Use push_back.
265 * powerpc.cc (process_gc_mark): Use push_back.
266 (Target_powerpc::do_gc_mark_symbol): Use push_back.
267 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
268
7a2a1c79 2692015-04-16 Han Shen <shenhan@google.com>
5019d64a 270
6ec65f28
AM
271 * aarch64.cc (AArch64_insn_utilities): New utility class.
272 (AArch64_relobj::Mapping_symbol_position): New struct.
273 (AArch64_relobj::Mapping_symbol_info): New typedef.
274 (AArch64_relobj::do_count_local_symbols): New function overriding
275 parent's implementation.
276 (AArch64_relobj::mapping_symbol_info_): New member
277 (AArch64_relobj::scan_erratum_843419): New method.
278 (Target_aarch64::scan_erratum_843419_span): New method.
279 (Target_aarch64::is_erratum_843419_sequence): New method.
280 * options.h (fix_cortex_a53): New option.
5019d64a 281
a6a17750
CC
2822015-04-09 Cary Coutant <ccoutant@google.com>
283
284 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
285 in a PIE link.
286 * testsuite/Makefile.am (tls_pie_test.sh): New test.
287 * testsuite/Makefile.in: Regenerate.
288 * testsuite/tls_pie_test.sh: New.
289
437ddf0c
CC
2902015-04-09 Cary Coutant <ccoutant@google.com>
291
292 * debug.h (DEBUG_LOCATION): New.
293 (DEBUG_ALL): Include DEBUG_LOCATION.
294 (debug_string_to_enum): Add DEBUG_LOCATION.
295 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
296 output to print correct context.
297 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
298 up to 4 more locations at the beginning of the function.
299 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
300 result before sorting list of line numbers.
301 * testsuite/debug_msg.sh: Allow range of line numbers for
302 canonical results on optimized code.
303
24491327
HS
3042015-04-07 HC Yen <hc.yen@mediatek.com>
305
306 Add AArch32 support for gold linker.
307 gold/
308 * arm.cc: Add V8 arch combine table.
309
7fa5525f
RÁE
3102015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
311
312 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
313
5368dcf2
RÁE
3142015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
315
316 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
317 to find by using the return value of insert.
318
9dbb4b02
RÁE
3192015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
320
321 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
322 constructor call.
323
1fa29f10
IT
3242015-04-06 Ilya Tocar <ilya.tocar@intel.com>
325
326 PR gold/17641
327 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
328 (Target_x86_64::Scan::local): Don't create GOT entry, when we
329 can convert mov to lea.
330 (Target_x86_64::Scan::global): Ditto.
331 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
332 %reg to lea foo(%rip), %reg if possible.
333 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
334 * testsuite/x86_64_mov_to_lea1.s: New.
335 * testsuite/x86_64_mov_to_lea2.s: Ditto.
336 * testsuite/x86_64_mov_to_lea3.s: Ditto.
337 * testsuite/x86_64_mov_to_lea4.s: Ditto.
338 * testsuite/x86_64_mov_to_lea.sh: Ditto.
339
39f3de7c
L
3402015-04-02 H.J. Lu <hongjiu.lu@intel.com>
341
342 * configure: Regenerated.
343
c4fc4724
IT
3442015-04-01 Ilya Tocar <ilya.tocar@intel.com>
345
346 PR gold/17640
347 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
348 (Target_i386::Scan::local): Don't create GOT entry, when we
349 can convert GOT to GOTOFF.
350 (Target_i386::Scan::global): Ditto.
351 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
352 lea foo@GOTOFF(%reg), %reg if possible.
353 * testsuite/Makefile.am (i386_mov_to_lea): New test.
354 * testsuite/i386_mov_to_lea1.s: New.
355 * testsuite/i386_mov_to_lea2.s: Ditto.
356 * testsuite/i386_mov_to_lea3.s: Ditto.
357 * testsuite/i386_mov_to_lea4.s: Ditto.
358 * testsuite/i386_mov_to_lea5.s: Ditto.
359 * testsuite/i386_mov_to_lea.sh: Ditto.
360
918357b9
L
3612015-04-01 H.J. Lu <hongjiu.lu@intel.com>
362
363 * Makefile.am (ZLIB): New.
364 (ZLIBINC): Likewise.
365 (AM_CFLAGS): Add $(ZLIBINC).
366 (AM_CXXFLAGS): Likewise.
367 (ldadd_varldadd_var): Add $(ZLIB).
368 (incremental_dump_LDADD): Likewise.
369 (dwp_LDADD): Likewise.
370 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
371 <zlib.h>.
372 (zlib_compress): Don't check HAVE_ZLIB_H.
373 (zlib_decompress): Likewise.
374 * options.h (compress_debug_sections): Likewise.
375 * configure.ac (AM_CONDITIONAL): Removed.
376 * testsuite/Makefile.am (ZLIB): New.
377 (LDADD): Add $(ZLIB).
378 Don't check HAVE_ZLIB.
379 * Makefile.in: Regenerated.
380 * config.in: Likewise.
381 * configure: Likewise.
382 * testsuite/Makefile.in: Likewise.
383
6b0ad2eb
JY
3842015-03-30 Jing Yu <jingyu@google.com>
385
386 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
387 TLSLD_ADD_DTPREL_LO12_NC.
388 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
389 _TLS_MODULE_BASE_ point to the start of tls segment.
390 (Target_aarch64::optimize_tls_reloc): Add cases for
391 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
392 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
393 (Target_aarch64::Scan::local): Likewise.
394 (Target_aarch64::Scan::global): Likewise.
395 (Target_aarch64::Relocate::relocate): Likewise.
396 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
397 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
398 relocations.
399
0916f9e7
RÁE
4002015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
401
402 * merge.cc (Object_merge_map::add_mapping): call
403 Object_merge_map::Input_merge_map::add_mapping.
404 (Object_merge_map::Input_merge_map::add_mapping): New.
405 (Output_merge_data::do_add_input_section): Call
406 get_or_make_input_merge_map before a loop.
407 (Output_merge_string<Char_type>::finalize_merged_data): Call
408 get_or_make_input_merge_map before a loop.
409 * merge.h (Object_merge_map): Make Input_merge_map public.
410 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
411 (Relobj::get_or_create_merge_map): New.
412 * object.h (Relobj::get_or_create_merge_map): New.
413
282c9750
AM
4142015-03-24 Alan Modra <amodra@gmail.com>
415
416 PR 18147
417 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
418 relocation errors for branches to strong undefined symbols.
419
67f95b96
RÁE
4202015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
421
422 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
423 (Object_merge_map::is_merge_section_for): Remove.
424 (Object_merge_map::find_merge_section): New.
425 * merge.h (Object_merge_map::is_merge_section_for): Remove.
426 (Object_merge_map::find_merge_section): New.
427 (Object_merge_map::get_input_merge_map): Add a const version.
428 * object.cc (Relobj::is_merge_section_for): Remove.
429 (Relobj::find_merge_section): New.
430 * object.h (Relobj::is_merge_section_for): Remove.
431 (Relobj::find_merge_section): New.
432 * output.cc
433 (Output_section::Input_section::is_merge_section_for): Remove.
434 (Output_section::add_merge_input_section): Don't call
435 add_merge_input_section.
436 (Output_section::find_merge_section): Return const. Use
437 object->find_merge_section.
438 (Output_section::build_lookup_maps): Don't build a map for
439 merge sections.
440 (Output_section::is_input_address_mapped): Return false if
441 section is not found.
442 (Output_section::find_starting_output_address): Use
443 find_merge_section instead of is_merge_section_for.
444 (Output_section::add_script_input_section): Don't build a map for
445 merge sections.
446 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
447 (Output_section_lookup_maps::find_merge_section): Remove.
448 (Output_section_lookup_maps::add_merge_input_section) Remove.
449 (Output_section::find_merge_section): Return const.
450
152f7024
CC
4512015-03-22 Cary Coutant <cary@google.com>
452
453 PR gold/18106
454 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
455 non-SIB form of lea, with nop after the call.
456
bccffdfd
CC
4572015-03-21 Cary Coutant <cary@google.com>
458
459 PR gold/14217
460 * output.cc (Output_segment::is_first_section_relro): Don't ignore
461 .tdata section.
462 (Output_segment::set_section_addresses): Don't align size of relro
463 segment for .tbss.
464
1c582fe7
CC
4652015-03-21 Cary Coutant <cary@google.com>
466
467 PR gold/18010
468 * stringpool.cc (Stringpool_template): Don't optimize if section
469 alignment is greater than sizeof(char).
470
410da591
CC
4712015-03-21 Cary Coutant <cary@google.com>
472
473 PR gold/18048
474 * script-c.h (script_include_directive): Add first_token parameter.
475 * script.cc (script_include_directive): Add first_token parameter, and
476 pass it to read_script_file.
477 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
478 (PARSING_MEMORY_DEF): New tokens.
479 (top): Add new productions for INCLUDE files.
480 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
481 Pass PARSING_LINKER_SCRIPT to script_include_directive.
482 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
483 (section_cmd): Pass PARSING_SECTION_CMDS.
484 (file_or_sections_cmd): Remove.
485 (memory_def): Pass PARSING_MEMORY_DEF.
486 * testsuite/Makefile.am (memory_test_2): New test.
487 * testsuite/Makefile.in: Regenerate.
488 * testsuite/memory_test_inc.t: New script file.
489 * testsuite/memory_test_inc_1.t.src: New script file.
490 * testsuite/memory_test_inc_2.t.src: New script file.
491 * testsuite/memory_test_inc_3.t.src: New script file.
492
0d5bbdb0
CC
4932015-03-21 Cary Coutant <cary@google.com>
494
495 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
496 (Sized_relobj_dwo::setup): Build compressed section map.
497 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
498 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
499 section map.
500 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
501 compressed_sections_ field.
502 (build_compressed_section_map): Take Object instead of
503 Sized_relobj_file parameter; add decompress_if_needed parameter.
504 (Sized_relobj_file::do_find_special_sections): Store compressed
505 section map in parent Object.
506 (Sized_relobj_file::do_decompressed_section_contents): Move
507 implementation to Object::decompressed_section_contents.
508 (Sized_relobj_file::do_discard_decompressed_sections): Move
509 implementation to Object::discard_decompressed_sections.
510 * object.h (build_compressed_section_map): Declare.
511 (Object::Object): Add compressed_sections_ field.
512 (Object::section_is_compressed): Move implementation here.
513 (Object::decompressed_section_contents): De-virtualize.
514 (Object::discard_decompressed_sections): De-virtualize.
515 (Object::do_section_is_compressed): Delete.
516 (Object::do_decompressed_section_contents): Delete.
517 (Object::set_compressed_sections): New method.
518 (Object::compressed_sections): New method.
519 (Object::compressed_sections_): New data member.
520 (Compressed_section_info, Compressed_section_map): Move to top of file.
521 (Sized_relobj_file::do_section_is_compressed): Delete.
522 (Sized_relobj_file::do_decompressed_section_contents): Delete.
523 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
524 (Sized_relobj_file::compressed_sections_): Move to Object class.
525
bd9e0d46
CC
5262015-03-21 Cary Coutant <ccoutant@google.com>
527
528 PR gold/18152
529 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
530 deferred objects.
531
943c8b43
CC
5322015-03-11 Cary Coutant <ccoutant@google.com>
533
534 * options.cc (General_options::finalize): Don't allow -z relro
535 with incremental linking.
536 * testsuite/Makefile.am (incremental_test): Add -z norelro.
537 (incremental_test_2): Likewise.
538 (incremental_test_3): Likewise.
539 (incremental_test_4): Likewise.
540 (incremental_test_5): Likewise.
541 (incremental_test_6): Likewise.
542 (incremental_copy_test): Likewise.
543 (incremental_common_test_1): Likewise.
544 (incremental_comdat_test_1): Likewise.
545 * testsuite/Makefile.in: Regenerate.
546
e1663197
CC
5472015-03-09 Cary Coutant <ccoutant@google.com>
548
549 PR gold/14675
550 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
551 return enum indicating whether .eh_frame section is empty, optimizable,
552 unrecognized, or an end marker. Adjust explicit instantiations.
553 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
554 (Eh_frame::add_ehframe_input_section): Change return type.
555 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
556 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
557 to the .eh_frame output section until we see the end marker.
558 (Layout::finalize_eh_frame_section): New.
559 * layout.h: (Layout::finalize_eh_frame_section): New.
560
beb8418f
L
5612015-03-05 H.J. Lu <hongjiu.lu@intel.com>
562
563 * output.cc (Relobj::initialize_input_to_output_map<size>):
564 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
565
48c73428
CC
5662015-03-04 Cary Coutant <ccoutant@google.com>
567
568 * parameters.cc (Parameters::set_target_once): Call
569 Target::select_as_default_target just once from here...
570 (set_parameters_target): ...instead of from here.
571
5722015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
573
574 * ehframe.cc (Cie::set_output_offset): Pass in and use a
575 Output_section_data instead of a Merge_map.
576 (Eh_frame::Eh_frame): Don't initialize merge_map_.
577 (Eh_frame::read_cie): Use add_merge_mapping instead of
578 Merge_map::add_mapping.
579 (Eh_frame::read_fde): Ditto.
580 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
581 (Eh_frame::do_output_offset): Use merge_output_offset istead of
582 merge_map_->get_output_offset.
583 (Eh_frame::do_is_merge_section_for): Delete.
584 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
585 instead of a Merge_map.
586 (Cie::set_output_offset): Pass in a Output_section_data instead of a
587 Merge_map.
588 (Eh_frame::do_is_merge_section_for): Delete.
589 (Eh_frame::merge_map_): Delete.
590 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
591 and use a Output_section_data instead of a Merge_map.
592 (Object_merge_map::add_mapping): Ditto.
593 (Object_merge_map::get_output_offset): Remove the merge_map argument.
594 (Object_merge_map::is_merge_section_for): Pass in and use a
595 Output_section_data instead of a Merge_map.
596 (Merge_map): Delete.
597 (Output_merge_base::do_output_offset): Use merge_output_offset instead
598 of merge_map_.get_output_offset.
599 (Output_merge_base::do_is_merge_section_for): Delete.
600 (Output_merge_data::do_add_input_section): Use
601 object->add_merge_mapping instead of add_mapping.
602 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
603 * merge.h (Merge_map): Delete forward declaration.
604 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
605 instead of a Merge_map.
606 (Object_merge_map::get_output_offset): Remove the merge_map argument.
607 (Object_merge_map::is_merge_section_for): Pass in and use a
608 Output_section_data instead of a Merge_map.
609 (Input_merge_map::Object_merge_map::merge_map): Replace with
610 output_data.
611 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
612 Output_section_data instead of a Merge_map.
613 (Merge_map): Delete.
614 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
615 (Output_merge_base::do_is_merge_section_for): Delete.
616 (Output_merge_base::add_mapping): Delete.
617 (Output_merge_base::merge_map_): Delete.
618 * object.cc (Relobj::initialize_input_to_output_map): New.
619 (Relobj::initialize_input_to_output_map): New.
620 (Relobj::merge_output_offset): New.
621 (Relobj::is_merge_section_for): New.
622 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
623 bits.
624 * object.h (Relobj::merge_map): Delete.
625 (initialize_input_to_output_map): New.
626 (set_merge_map): Delete.
627 (add_merge_mapping): New.
628 (merge_output_offset): New.
629 (is_merge_section_for): New.
630 * output.cc (Output_section::Input_section::is_merge_section_for):
631 Use object->is_merge_section_for.
632 * output.h (Output_section_data::is_merge_section_for): Delete.
633 (Output_section_data::do_is_merge_section_for): Delete.
634 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
635 Use object->initialize_input_to_output_map.
636 (Merged_symbol_value<size>::value_from_output_section): Use
637 object->merge_output_offset.
638
48c73428 6392015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
640 Cary Coutant <ccoutant@google.com>
641
642 * output.cc (Output_section::add_merge_input_section): Do not
643 attempt to merge sections with an entsize of 0.
644
48c73428 6452015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
646
647 * attributes.h (class Output_attributes_section_data ): Add
648 do_print_to_mapfile function.
649
ec86f434
AM
6502015-02-24 Alan Modra <amodra@gmail.com>
651
652 PR 18010
653 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
654 complain if value is not a multiple of four.
655 (Target_powerpc::Relocate::relocate): Correct handling of
656 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
657
be66981e
L
6582015-02-21 H.J. Lu <hongjiu.lu@intel.com>
659
660 * configure.ac (default_size): Set to 32 for x32.
661 * configure: Regenerated.
662
e3ee8ed4
AM
6632015-02-18 Alan Modra <amodra@gmail.com>
664
665 PR 17954
666 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
667 visibility.
668
3a935c6c
RÁE
6692015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
670
671 * gc.h (Garbage_collection::add_reference): Don't use find.
672
e0a1e121
RÁE
6732015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
674
675 * object.cc (write_local_symbols): avoid std::vector copy.
676
45a4fb1a
RÁE
6772015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
678
679 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
680
2d9afefe
MW
6812015-02-09 Mark Wielaard <mjw@redhat.com>
682
683 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
684 DW_LANG_Fortran03 and DW_LANG_Fortran08.
685
e9c1bdad
CC
6862015-02-16 Cary Coutant <ccoutant@google.com>
687
688 PR gold/13577
689 PR gold/16992
690 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
691 DF_SYMBOLIC if --dynamic-list option is used.
692 * options.cc (General_options::finalize): --dynamic-list is not
693 mutually exclusive with -Bsymbolic.
694 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
695 listed in --dynamic-list.
696 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
697 -Bsymbolic-functions.
698 * testsuite/Makefile.in: Regenerate.
699
0ed4b0bf
CC
7002015-02-16 Cary Coutant <ccoutant@google.com>
701
702 PR gold/17971
703 * incremental.cc: Remove redundant include of "output.h".
704
1a920511
JY
7052015-02-12 Jing Yu <jingyu@google.com>
706
707 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
708 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
709 New relocation.
710 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
711 TLSLE_MOVW_* relocations.
712 (Target_aarch64::Scan::global): Likewise.
713 (Target_aarch64::Relocate::relocate): Likewise.
714 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
715 for new TLSLE_MOVW_* relocations.
716
07f107f3
WN
7172015-02-11 Will Newton <will.newton@linaro.org>
718
719 PR gold/13321
720 * arm.cc (Target_arm::make_plt_section): Create an ARM
721 state mapping symbol at the start of the PLT.
722
e051a5b5
L
7232015-02-09 H.J. Lu <hongjiu.lu@intel.com>
724
725 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
726 Replace two_file_shared_2.so with two_file_shared_1.so.
727 * testsuite/Makefile.in: Regenerated.
728
dddcc5b9
AM
7292015-02-09 Alan Modra <amodra@gmail.com>
730
731 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
732 plugin_test_thin.a and defsym_test.
733 * testsuite/Makefile.in: Regenerate.
734
b39b8b9d
RÁE
7352015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
736
737 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
738 body.
739
b66d1c52
CC
7402015-02-04 Peter Collingbourne <pcc@google.com>
741
742 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
743 forwarding symbols when computing symbol resolution info for plugins.
744 * plugin.h (Plugin_manager::symtab): New method.
745 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
746
23081de0
CC
7472015-02-03 Cary Coutant <ccoutant@google.com>
748 Peter Collingbourne <pcc@google.com>
749
750 PR gold/15660
751 * archive.cc (Thin_archive_object_unlocker): New class.
752 (Archive::include_member): Unlock external members of thin archives.
753 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
754 (plugin_test_2): Likewise.
755 (plugin_test_3): Likewise.
756 (plugin_test_4): Likewise.
757 (plugin_test_5): Likewise.
758 (plugin_test_6): Likewise.
759 (plugin_test_7): Likewise.
760 (plugin_test_8): Likewise.
761 (plugin_test_9): Likewise.
762 (plugin_test_10): Likewise.
763 (plugin_test_11): New test case.
764 * testsuite/Makefile.in: Regenerate.
765 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
766 file to decide whether to claim file.
767 (all_symbols_read_hook): Likewise.
768 * testsuite/plugin_test_1.sh: Adjust expected output.
769 * testsuite/plugin_test_2.sh: Likewise.
770 * testsuite/plugin_test_3.sh: Likewise.
771 * testsuite/plugin_test_6.sh: Likewise.
772 * testsuite/plugin_test_tls.sh: Likewise.
773 * testsuite/plugin_test_11.sh: New testcase.
774
7752015-02-03 Cary Coutant <ccoutant@google.com>
776
777 * descriptors.cc (Descriptors::open): Set artificially-low limit for
778 file descriptors when debugging enabled. Add debug output.
779 (Descriptors::release): Add debug output.
780 (Descriptors::close_some_descriptor): Likewise.
781 (Descriptors::close_all): Likewise.
782 * fileread.cc (File_read::lock): Likewise.
783 (File_read::unlock): Likewise.
784
24dd5808
CC
7852015-02-02 Cary Coutant <ccoutant@google.com>
786
787 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
788 executable output file.
789
fa89cc82
HS
7902015-01-22 Han Shen <shenhan@google.com>
791
792 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
793 (Target_arm::do_plt_address_for_global): New method.
794 (Target_arm::do_plt_address_for_local): New method.
795 (Target_arm::rel_irelative_section): New method.
796 (Target_arm::make_data_plt): Add more parameters for plt ctor.
797 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
798 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
799 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
800 (Target_arm::Scan::check_non_pic): Add ifunc support.
801 (Target_arm::Scan::local): Add ifunc support.
802 (Target_arm::Scan::global): Add ifunc support.
803 (Target_arm::make_plt_section): New method.
804 (Target_arm::make_plt_entry): Change to call to make_plt_section.
805 (Target_arm::make_local_ifunc_plt_entry): New method.
806 (Target_arm::got_irelative_): New member.
807 (Target_arm::rel_irelative_): New member.
808 (Target_arm::got_section): Add creation for got_irelative_.
809 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
810 (Target_arm::Relocate::relocate): Properly set local ifunc address.
811 (Target_arm::do_dynsym_value): Properly set global ifunc address.
812 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
813 (Output_data_plt_arm::IRelative_data): New type.
814 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
815 (Output_data_plt_arm::add_entry): Add more parameters.
816 (Output_data_plt_arm::add_relocation): New method.
817 (Output_data_plt_arm::add_local_ifunc_entry): New method.
818 (Output_data_plt_arm::rel_irelative): New method.
819 (Output_data_plt_arm::entry_count): Modified.
820 (Output_data_plt_arm::address_for_global): New method.
821 (Output_data_plt_arm::address_for_local): New method.
23081de0 822gold/
fa89cc82
HS
823 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
824 (Output_data_plt_arm::insert_irelative_data): New method.
825 (Output_data_plt_arm::irelative_rel_): New member.
826 (Output_data_plt_arm::got_): New member.
827 (Output_data_plt_arm::got_irelative_): New member.
828 (Output_data_plt_arm::irelative_count_): New member.
829 (Output_data_plt_arm::IRelative_data_vec): New typedef.
830 (Output_data_plt_arm::irelative_data_vec_): New member.
831 (Output_data_plt_arm::do_write): Write out irelative entries.
832 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
833 more parameters to ctor.
834 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
835 more parameters to ctor.
836 * output.h (Output_data_reloc::add_local_relative): New method.
837 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
838
0f81d3f0
AM
8392015-01-29 Alan Modra <amodra@gmail.com>
840
841 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
842 and GOT_TLSGD to LE optimization.
843
65d92137
CC
8442015-01-28 Cary Coutant <ccoutant@google.com>
845
846 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
847 for undef TLS symbols.
848 (Target_x86_64::Relocate::relocate_tls): Likewise.
849 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
850
5485698a
CC
8512015-01-25 Cary Coutant <ccoutant@google.com>
852
853 * output.cc (Output_segment::set_section_addresses): Fix calculation
854 of size of relro segment.
855
b01a4b04
AM
8562015-01-22 Alan Modra <amodra@gmail.com>
857
858 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
859 condition for need of ifunc plt entry.
860 (Target_powerpc::Scan::global <got relocs>): Likewise.
861
3d0064a9
CC
8622015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
863
864 * mips.cc (reloc_high): Add r_sym.
865 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
866 reloc_high constructor.
867 (Mips_relocate_functions::relgot16_local): Likewise.
868 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
869 r_type to decide whether LO16 matches HI16.
870 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
871 rello16 and relgot16_local.
872
a5cd8f05
CC
8732015-01-09 Cary Coutant <ccoutant@google.com>
874
875 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
876 unless alignment is larger than page size.
877
4fc1b9d4
L
8782015-01-06 H.J. Lu <hongjiu.lu@intel.com>
879 Cary Coutant <ccoutant@google.com>
880
881 PR gold/17729
882 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
883 (DEFAULT_TARGET_X32): Set for x32.
884 * x86_64.cc (cmp_insn_32): New.
885 (lea_r10_insn_32): Likewise.
886 (lea_r11_insn_32): Likewise.
887 (cmp_insn_64): Likewise.
888 (lea_r10_insn_64): Likewise.
889 (lea_r11_insn_64): Likewise.
890 (Target_x86_64<size>::do_calls_non_split): Handle x32.
891 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
892 (check_DATA): Add split_x32 files.
893 (split_x32_[1234n].o): New targets.
894 (split_x32_[124]): New targets.
895 (split_x32_[1234r].stdout): New targets.
896 * testsuite/split_x32.sh: New file.
897 * testsuite/split_x32_1.s: Likewise.
898 * testsuite/split_x32_2.s: Likewise.
899 * testsuite/split_x32_3.s: Likewise.
900 * testsuite/split_x32_4.s: Likewise.
901 * testsuite/split_x32_n.s: Likewise.
902 * configure: Regenerated.
903 * testsuite/Makefile.in: Likewise.
904
e749cab8
L
9052015-01-06 H.J. Lu <hongjiu.lu@intel.com>
906
907 PR gold/17809
908 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
909 x32.
910
af759df0
AM
9112015-01-02 Alan Modra <amodra@gmail.com>
912
913 * version.cc (print_version): Just print current year.
914 * dwp.cc (print_version): Likewise.
915
b90efa5b
AM
9162015-01-01 Alan Modra <amodra@gmail.com>
917
918 Update year range in copyright notice of all files.
919
f12d1e8a
AM
9202014-12-25 Alan Modra <amodra@gmail.com>
921
922 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
923 new enums.
924 (Target_arm::merge_object_attributes, ): Likewise.
925
5c294fee
TG
9262014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
927
928 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
929 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
930 AEABI_VFP_args_vfp to check that.
931 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
932 value and replace hardcoded values by enum values.
933
e30880c2
CC
9342014-12-22 Cary Coutant <ccoutant@google.com>
935
936 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
937
bd040da1
L
9382014-12-20 H.J. Lu <hongjiu.lu@intel.com>
939
940 PR gold/14608
941 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
942 to "return i * i * 3;".
943
e02a4046
CC
9442014-12-16 Cary Coutant <ccoutant@google.com>
945
946 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
947 (Mapfile::print_output_data): Use current_data_size() to avoid
948 assert for sections requiring postprocessing; if address is not valid,
949 print 0.
950 (Mapfile::print_output_section): Use current_data_size(); print note
951 that addresses and sizes are before compression.
952
add6016b
L
9532014-12-14 H.J. Lu <hongjiu.lu@intel.com>
954
955 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
956 Cast current_group_size to unsigned long when reporting error.
957
0bf32ea9
JY
9582014-12-10 Jing Yu <jingyu@google.com>
959
960 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
961 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
962 Update error message.
963 (Target_aarch64::do_relax): Use absolute value of option
964 stub_group_size. Replace local variable with class member
965 stub_group_size_.
966
cbcb23fa
AM
9672014-12-04 Alan Modra <amodra@gmail.com>
968
969 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
970 addend of PLTREL24 reloc when not generating a plt stub. Make
971 max_branch_offset an "Address".
fbad6518 972 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
973 (Target_powerpc::Relocate::relocate): Likewise.
974
1611bc4a
AM
9752014-12-04 Alan Modra <amodra@gmail.com>
976
977 PR 17670
978 * symtab.cc (Symbol::set_undefined): Remove assertion.
979 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
980 on symbols defined in discarded sections, instead return false.
981 Rearrange params, update all callers.
982 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
983 branches to syms in discarded sections.
984 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
985 undefined and flag as discarded.
986 (Target_powerpc::Relocate::relocate): Localize variable.
987
4759c34e
L
9882014-12-03 H.J. Lu <hongjiu.lu@intel.com>
989
990 PR gold/17675
991 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
992 * testsuite/Makefile.in: Regenerated.
993
1f98a074
AM
9942014-12-03 Alan Modra <amodra@gmail.com>
995
996 PR 17566
997 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
998 when adding dynamic relocations against section symbols.
999
fb257835
DI
10002014-12-01 Dimitry Ivanov <dimitry@google.com>
1001
1002 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1003 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1004 * options.h (General_options): New -z option (global).
1005
d8e60314
CC
10062014-12-01 Cary Coutant <ccoutant@google.com>
1007
1008 PR gold/17578
1009 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1010 is given.
1011 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1012 given but some inputs require executable stack.
1013
982bbd97
CC
10142014-11-26 Cary Coutant <ccoutant@google.com>
1015
1016 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1017 .debug_str_offsets; strip .debug_gnu_pubnames and
1018 .debug_gnu_pubtypes.
1019 (lines_only_debug_sections): Strip all four new sections.
1020
bb779192
HS
10212014-11-26 Jing Yu <jingyu@google.com>
1022
1023 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1024 register to be x0 when to relax TLSDESC_LD64_LO12.
1025
a3e60ddb
AM
10262014-11-26 Alan Modra <amodra@gmail.com>
1027
1028 * powerpc.cc (struct Stub_table_owner): New.
1029 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1030 unsigned int vector. Update all references.
1031 (powerpc_relobj::set_stub_table): Take an unsigned int param
1032 rather than a Stub_table. Update callers.
1033 (Powerpc_relobj::clear_stub_table): New function.
1034 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1035 stub_group_size_ vars.
1036 (Target_powerpc::new_stub_table): Delete.
1037 (max_branch_delta): New function, extracted from..
1038 (Target_powerpc::Relocate::relocate): ..here..
1039 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1040 status on whether stub created successfully.
1041 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1042 default sizing to..
1043 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1044 reduce on relax failure.
1045 (Target_powerpc::group_sections): Add "no_size_errors" param.
1046 Use stub_group_size_. Set up group info in a temp vector,
1047 before building Stub_table vector. Account for input sections
1048 possibly already converted to relaxed sections.
1049 (Stub_table::init): Delete. Merge into..
1050 (Stub_table::Stub_table): ..here.
1051 (Stub_table::can_reach_stub): New function.
1052 (Stub_table::add_plt_call_entry): Add "from" parameter and
1053 return true iff stub could be reached.
1054 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1055 param too.
1056 (Stub_table::clear_stubs): Add "all" param.
1057
a20605cf
AM
10582014-11-26 Alan Modra <amodra@gmail.com>
1059
1060 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1061 (Target_powerpc::group_sections): Use it.
1062
43b64deb
CC
10632014-11-25 Cary Coutant <ccoutant@google.com>
1064
1065 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1066 (Binary_to_elf::write_symbol): Add st_size parameter.
1067 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1068
c924eb67
CC
10692014-11-25 Cary Coutant <ccoutant@google.com>
1070
1071 PR gold/17639
1072 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1073 (Sized_relobj_file::do_layout): Handle deferred sections properly
1074 during GC pass 1. Don't add reloc sections to deferred list twice.
1075 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1076 (Sized_relobj_file::is_deferred_layout_): New data member.
1077
9d585188
L
10782014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1079
1080 PR gold/17619
1081 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1082 Check PC-relative offset overflow in PLT entry.
1083
3ffaac20
AM
10842014-11-21 Alan Modra <amodra@gmail.com>
1085
1086 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1087 for undefined weaks.
1088
0cfb0717
AM
10892014-11-20 Alan Modra <amodra@gmail.com>
1090
1091 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1092 from --stub-group-size parameter divided by 1024.
1093 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1094 template parameter. Update all uses.
1095 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1096 has_stub_value. Set for long branches. Don't report overflow for
1097 branch to undefined weak symbols. Print info message on
1098 overflowing branch to stub.
1099
f9dffbf0
AM
11002014-11-20 Alan Modra <amodra@gmail.com>
1101
1102 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1103
e88ba8d5
L
11042014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1105
1106 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1107 entry for R_X86_64_GOTPLT64.
1108 (Target_x86_64<size>::Relocate::relocate): Update comments for
1109 R_X86_64_GOTPLT64.
1110
d37ffe25
ED
11112014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1112
1113 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1114 * plugin.h: add lock definition
1115
9726c3c1
HS
11162014-10-29 Han Shen <shenhan@google.com>
1117 Jing Yu <jingyu@google.com>
1118
1119 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1120 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1121 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1122 Symbol::TLS_REF.
1123 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1124 method.
1125 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1126 (Target_aarch64::tls_ld_to_le): New method.
1127 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1128 for 64bit targets.
1129 (Output_data_plt_aarch64::irelative_rel_): New data member.
1130 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1131 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1132 (Output_data_plt_aarch64::add_relocation): New method.
1133 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1134 offset. Add got_irelative size to got size.
1135 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1136 type string with the new typename.
1137 (AArch64_relocate_functions::update_adr): Replace parameter x with
1138 immed.
1139 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1140 (AArch64_relocate_functions::reloc_common): New method.
1141 (AArch64_relocate_funcsions::rela_general): Extract common part out
1142 into reloc_common method.
1143 (AArch64_relocate_functions::rela_general): Likewise.
1144 (AArch64_relocate_functions::pcrela_general): Likewise.
1145 (AArch64_relocate_functions::adr): New method.
1146 (AArch64_relocate_functions::adrp): Calculate immed before calling
1147 update_adr.
1148 (AArch64_relocate_functions::adrp): Likewise.
1149 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1150 comparing x to 0. Calculate immed from ~x when x < 0.
1151 (Target_aarch64::optimize_tls_reloc): Add new cases for
1152 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1153 TLSLD_MOVW_DTPREL_G0_NC.
1154 (Target_aarch64::possible_function_pointer_reloc): Implement this
1155 method.
1156 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1157 comment.
1158 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1159 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1160 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1161 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1162 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1163 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1164 (Target_aarch64::make_plt_entry): Call add_entry with two more
1165 parameters.
1166 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1167 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1168 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1169 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1170 (Target_aarch64::Relocate::relocate_tls): Add cases for
1171 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1172 TLSLD_MOVW_DTPREL_G0_NC.
1173 * testsuite/icf_safe_so_test.cc: Correct test comment.
1174 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1175
80272b8c
AM
11762014-10-22 Alan Modra <amodra@gmail.com>
1177
1178 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1179 thread_starter.
1180
998a69f4
AS
11812014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1182
1183 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1184
aed56ec5
CC
11852014-10-17 Cary Coutant <ccoutant@google.com>
1186
1187 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1188 Add "typename" keyword.
1189
bb779192 11902014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1191 Jing Yu <jingyu@google.com>
1192
1193 Patch for gold aarch64 backend to support relaxation.
1194 * aarch64-reloc.def: Change format.
1195 * aarch64.cc (class Reloc_stub): New class.
1196 (class Stub_table): New class.
1197 (class AArch64_relobj): New class.
1198 (class AArch64_input_section): New class.
1199 (class AArch64_output_section): New class.
1200 (Target_aarch64::new_stub_table): New method.
1201 (Target_aarch64::new_aarch64_input_section): New method.
1202 (Target_aarch64::find_aarch64_input_section): New method.
1203 (Target_aarch64::scan_section_for_stubs): New method.
1204 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1205 (Target_aarch64::relocate_stub): New method.
1206 (Target_aarch64::current_target): New method.
1207 (Target_aarch64::do_make_elf_object): New method.
1208 (Target_aarch64::do_may_relax): New method.
1209 (Target_aarch64::do_relax): New method.
1210 (Target_aarch64::group_sections): New method.
1211 (Target_aarch64::scan_reloc_for_stub): New method.
1212 (Target_aarch64::do_make_output_section): New method.
1213 (Target_aarch64::stub_tables_): New data member.
1214 (Target_aarch64::aarch64_input_section_map_): New data member.
1215 (AArch64_relocate_functions::maybe_apply_stub): New method.
1216
db4c9594
CC
12172014-09-30 Cary Coutant <ccoutant@google.com>
1218
1219 PR gold/17432
1220 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1221
cd6da036
KC
12222014-09-30 Kito Cheng <kito@0xlab.org>
1223
1224 PR gold/13597
1225 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1226 hash table before sysv-style hash table.
1227
5f772412
ST
12282014-09-29 Sriraman Tallam <tmsriram@google.com>
1229
1230 * options.h (--pic-executable): Add negative to alias to -no-pie.
1231
5efeedf6
CC
12322014-09-26 Cary Coutant <ccoutant@google.com>
1233
1234 PR gold/16773
1235 * object.cc (Sized_relobj_file): Compute value of section symbols
1236 for TLS sections the same as TLS symbols.
1237
1707f183
CC
12382014-09-25 Cary Coutant <ccoutant@google.com>
1239
1240 PR gold/17432
1241 * resolve.cc (Symbol_table::resolve): Override common placeholder
1242 symbols, but adjust sizes.
1243 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1244 symbols to common lists.
1245
00cac886
AM
12462014-09-24 Alan Modra <amodra@gmail.com>
1247
1248 * po/POTFILES.in: Regenerate.
1249
635aa30e
CC
12502014-09-23 Taiju Tsuiki <tzik@google.com>
1251 Cary Coutant <ccoutant@google.com>
1252
71b9b91b 1253 PR gold/14860
635aa30e
CC
1254 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1255 on input_sections_blocker.
1256 * layout.cc (Write_sections_task::locks): Unblock
1257 input_sections_blocker_.
1258 * layout.h (Write_sections_task::Write_sections_task): Add
1259 input_sections_blocker.
1260 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1261 to DEPENDENCIES.
1262 * testsuite/Makefile.in: Regenerate.
1263
c0c71592
RÁE
12642014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1265
1266 * testsuite/Makefile.am (plugin_test_10): New test.
1267 * testsuite/Makefile.in: Regenerate
1268 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1269 * testsuite/plugin_test_10.sh: New file.
1270
6168c2a1
RÁE
12712014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1272
1273 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1274 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1275 during the replacement phase.
1276
3a531937
JY
12772014-09-17 Han Shen <shenhan@google.com>
1278 Jing Yu <jingyu@google.com>
1279
1280 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1281 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1282 * aarch64.cc (Target_aarch64): Add data members
1283 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1284 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1285 constructor.
1286 (Target_aarch64::do_reloc_symbol_index): New method.
1287 (Target_aarch64::do_reloc_addend): New method.
1288 (Target_aarch64::add_tlsdesc_info): New method.
1289 (Target_aarch64::do_dynsym_value): New method.
1290 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1291 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1292 (Target_aarch64::make_data_plt): Add new parameters: got,
1293 got_irelative. Pass them to do_make_data_plt.
1294 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1295 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1296 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1297 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1298 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1299 (Target_aarch64::got_tlsdesc_section): New method.
1300 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1301 (Target_aarch64::define_tls_base_symbol): New method.
1302 (Target_aarch64::reserve_tlsdesc_entries): New method.
1303 (Target_aarch64::got_mod_index_entry): New method.
1304 (Target_aarch64::rela_tlsdesc_section): New method.
1305 (Target_aarch64::rela_irelative_section): New method.
1306 (Target_aarch64::Tlsdesc_info): New struct.
1307 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1308 relocations and tlsdesc relocations.
1309 (Target_aarch64::optimize_tls_reloc): Implement method.
1310 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1311 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1312 in constructor.
1313 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1314 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1315 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1316 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1317 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1318 (Output_data_plt_aarch64::rela_irelative): New method.
1319 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1320 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1321 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1322 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1323 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1324 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1325 (Output_data_plt_aarch64_standard): New member variables:
1326 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1327 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1328 New parameter: got, got_irelative.
1329 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1330 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1331 (Output_data_plt_aarch64::do_write): Replace got_address with
1332 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1333 (AArch64_relocate_functions::update_movnz): New method.
1334 (AArch64_relocate_functions): Correct format.
1335 (AArch64_relocate_functions::movnz): New method.
1336 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1337 before the switch. Add new cases to switch.
00cac886 1338 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1339 tlsgd tlsdesc cases.
1340 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1341 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1342 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1343 Call reloc_name_in_error_message to print unsupported reloc.
1344 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1345 make_data_plt.
1346 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1347 relocs. Fill in some more dynamic tags.
1348 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1349 Skip call tls_get_addr when tlsgd is relaxed.
1350 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1351 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1352 tlsdesc->ie relaxation.
1353
62661c93
SS
13542014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1355
1356 * mips.cc (Target_mips_nacl): New class.
1357 (Target_selector_mips_nacl): New class.
1358 (target_selector_mips32): Rename from target_selector_mips32be and use
1359 Target_selector_mips_nacl instead of Target_selector_mips.
1360 (target_selector_mips32el): Rename from target_selector_mips32 and use
1361 Target_selector_mips_nacl instead of Target_selector_mips.
1362 (target_selector_mips64): Rename from target_selector_mips64be and use
1363 Target_selector_mips_nacl instead of Target_selector_mips.
1364 (target_selector_mips64el): Rename from target_selector_mips64 and use
1365 Target_selector_mips_nacl instead of Target_selector_mips.
1366 (Target_mips::mips_info): Add const attribute.
1367
54674d38
CC
13682014-09-02 Cary Coutant <ccoutant@google.com>
1369
1370 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1371 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1372 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1373 (Sized_incr_dynobj::do_section_name): Likewise.
1374 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1375 (Sized_incr_dynobj::do_section_name): Likewise.
1376 * object.h (Object::section_name): Likewise.
1377 (Object::do_section_name): Likewise.
1378 (Sized_relobj_file::do_section_name): Likewise.
1379 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1380 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1381
9860cbcf
CC
13822014-09-02 Cary Coutant <ccoutant@google.com>
1383
1384 PR gold/17005
1385 * ehframe.cc (Fde::write): Add output_offset parameter.
1386 (Cie::write): Likewise.
1387 (Eh_frame::set_final_data_size): Account for offset within output
1388 section.
1389 (Eh_frame::do_sized_write): Likewise.
1390 * ehframe.h (Fde::write): Add output_offset parameter.
1391 (Cie::write): Likewise.
1392 * output.cc (Output_section::Input_section_sort_entry): Remove
1393 section_has_name_; add output_section_name parameter. Use
1394 output section name for non-input sections.
1395 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1396 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1397 (Output_section::Input_section_sort_compare): Remove logic for
1398 sections without names.
1399 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1400 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1401 Likewise.
1402 (Output_section::Input_section_sort_section_name_compare): Likewise.
1403
8e33481e
HS
14042014-08-29 Han Shen <shenhan@google.com>
1405 Jing Yu <jingyu@google.com>
1406
1407 * aarch64-reloc-property.cc
1408 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1409 reference reloc property in the table.
1410 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1411 3 other entries.
1412 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1413 2 new overloaded methods.
1414 (Output_data_got_aarch64::do_write): Add code to write out
1415 static relocs.
1416 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1417 static relocs.
1418 (Output_data_got_aarch64::static_relocs): New vector to
1419 hold static relocs.
1420 (Target_aarch64::TCB_SIZE): New const static memeber.
1421 (Target_aarch64::tcb_size): New method.
1422 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1423 (Target_aarch64::Relocate::relocate_tls): New method.
1424 (Target_aarch64::Scan::local): Add code handling new reloc types.
1425 (Target_aarch64::Scan::global): Add code handling new reloc types.
1426
81233653
ST
14272014-08-13 Sriraman Tallam <tmsriram@google.com>
1428
1429 * options.h (-no-pie): Add option.
1430
9363c7c3
JY
14312014-08-08 Jing Yu <jingyu@google.com>
1432 Han Shen <shenhan@google.com>
1433
1434 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1435 (DEFFILES): add aarch64-reloc.def.
1436 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1437 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1438 * Makefile.in: Regenerate.
1439 * aarch64-reloc-property.cc: New file.
1440 * aarch64-reloc-property.h: New file.
1441 * aarch64-reloc.def: New file.
1442 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1443 with tab to make the format consistent.
1444 (Output_data_got_aarch64::symbol_table_): New method.
1445 (Target_aarch64::do_plt_address_for_global): New method.
1446 (Target_aarch64::do_plt_address_for_local): New method.
1447 (Target_aarch64::do_select_as_default_target): New method.
1448 (Target_aarch64::do_make_data_plt): New method.
1449 (Target_aarch64::make_data_plt): New method.
1450 (Output_data_plt_aarch64::has_irelative_section): New method.
1451 (Output_data_plt_aarch64::address_for_global): New method.
1452 (Output_data_plt_aarch64::address_for_local): New method.
1453 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1454 (Output_data_plt_aarch64::add_entry): Implement contents.
1455 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1456 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1457 the got_pov entry to plt0.
1458 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1459 Implement contents.
1460 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1461 (AArch64_howto): New struct.
1462 (aarch64_howto[]): New static const array.
1463 (AArch64_relocate_functions): New class.
1464 (Target_aarch64::Scan::get_reference_flags): Remove method.
1465 (Target_aarch64::Scan::local): Implement to support a few relocations.
1466 (Target_aarch64::Scan::global): Implement to support a few relocations.
1467 (Target_aarch64::make_plt_section): Implement contents.
1468 (Target_aarch64::make_plt_entry): Implement contents.
1469 (Target_aarch64::do_finalize_sections): Implement contents.
1470 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1471 (Target_aarch64::relocate_section): Implement contents.
1472
ad9fe6c1
AM
14732014-08-06 Alan Modra <amodra@gmail.com>
1474
1475 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1476
7cd4e5b7
AM
14772014-08-06 Alan Modra <amodra@gmail.com>
1478
1479 PR 13227
1480 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1481
5ad9b0a7
ST
14822014-07-21 Sriraman Tallam <tmsriram@google.com>
1483
1484 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1485 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1486
e051745c
CC
14872014-07-08 Cary Coutant <ccoutant@google.com>
1488
1489 * expression.cc (struct Expression::Expression_eval_info): Add
1490 new fields type_pointer, vis_pointer, and nonvis_pointer.
1491 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1492 nonvis_pointer parameters. Adjust all calls.
1493 (Symbol_expression::value): Update type, visibility, and nonvis bits
1494 in caller.
1495 * script.cc (Symbol_assignment::sized_finalize): Update type,
1496 visibility, and remaining st_other bits for new symbol.
1497 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1498 vis_pointer, and nonvis_pointer parameters.
1499 * symtab.h (Symbol::set_type): New method.
1500
1501 * testsuite/Makefile.am (defsym_test): New test.
1502 * testsuite/Makefile.in: Regenerate.
1503 * testsuite/defsym_test.c: New file.
1504 * testsuite/defsym_test.sh: New file.
1505
f35c4853
CC
15062014-07-08 Cary Coutant <ccoutant@google.com>
1507
1508 PR gold/15639
1509 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1510 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1511 (Sized_dynobj::base_read_symbols): ...new method.
1512 * object.h (Sized_relobj_file::base_read_symbols): New method.
1513 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1514 (Sized_relobj_file::base_read_symbols): ...new method.
1515 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1516 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1517 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1518
2900af2d
AM
15192014-07-04 Alan Modra <amodra@gmail.com>
1520
1521 * po/POTFILES.in: Regenerate.
1522
053a4d68
JY
15232014-07-02 Jing Yu <jingyu@google.com>
1524
1525 * aarch64.cc: New file
1526 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1527 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1528 * Makefile.in: Regenerate.
1529 * configure.tgt: Add entries for aarch64*.
1530 * configure.ac: Likewise.
1531 * configure: Likewise.
1532
7b549045
AM
15332014-06-27 Alan Modra <amodra@gmail.com>
1534
1535 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1536
cb818dbf
CC
15372014-06-24 Cary Coutant <ccoutant@google.com>
1538
1539 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1540 sections.
1541 (Dwo_file::sized_read_unit_index): Likewise.
1542
9810d34d
SS
15432014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1544
1545 * mips.cc: New file.
1546 * Makefile.am (TARGETSOURCES): Add mips.cc
1547 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1548 * configure.tgt: Add entries for mips*.
1549 * configure.ac: Likewise.
1550 * Makefile.in: Regenerate.
1551 * configure: Likewise.
1552
9baa787b
CC
15532014-06-09 Cary Coutant <ccoutant@google.com>
1554
1555 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1556 unit_length is within section bounds.
1557
8f89af0a
CC
15582014-06-09 Cary Coutant <ccoutant@google.com>
1559
1560 PR gold/16980
1561 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1562 map.
1563
a47622ac
AM
15642014-06-07 Alan Modra <amodra@gmail.com>
1565
1566 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1567
4320c691
CC
15682014-06-06 Cary Coutant <ccoutant@google.com>
1569
1570 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1571 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1572 (Dwarf_pubnames_table::read_header): Likewise.
1573 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1574 .debug_gnu_pubtypes.
1575
270c9937
JB
15762014-06-05 Joel Brobecker <brobecker@adacore.com>
1577
1578 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1579 * Makefile.in, configure: Regenerate.
1580
397998fc
AM
15812014-06-03 Alan Modra <amodra@gmail.com>
1582
1583 * powerpc.cc (addis_12_2): Define.
1584 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1585
61f5c66f
AM
15862014-06-03 Alan Modra <amodra@gmail.com>
1587
1588 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1589 st_other output.
1590
f6971787
AM
15912014-06-02 Alan Modra <amodra@gmail.com>
1592
1593 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1594 Only ignore relocs on ELFv1.
1595 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1596
f6fb8322
CC
15972014-05-30 Cary Coutant <ccoutant@google.com>
1598
1599 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1600 * testsuite/Makefile.in: Regenerate.
1601 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1602
c23dd342
L
16032014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1604
1605 PR gold/16945
1606 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1607 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1608
5fe7ffdc
AM
16092014-05-15 Alan Modra <amodra@gmail.com>
1610
1611 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1612 Compare FDE contents with DW_CFA_nop rather than 0.
1613
a82bef93
ST
16142014-05-13 Sriraman Tallam <tmsriram@google.com>
1615
1616 * symtab.h (may_need_copy_reloc): Remove check for position independent
1617 code.
1618 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1619 position independence before pc absolute may_need_copy_reloc call.
1620 Add check for executable output befor pc relative may_need_copy_reloc
1621 call.
1622 * i386.cc: Ditto.
1623 * arm.cc: Ditto.
1624 * sparc.cc: Ditto.
1625 * tilegx.cc: Ditto.
1626 * powerpc.cc: Add check for no position independence before
1627 may_need_copy_reloc calls.
1628 * testsuite/pie_copyrelocs_test.cc: New file.
1629 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1630 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1631 * Makefile.in: Regenerate.
a82bef93 1632
53c66605
ML
16332014-05-08 Martin Liška <mliska@suse.cz>
1634
1635 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1636
57b2284c
CC
16372014-05-06 Cary Coutant <ccoutant@google.com>
1638
1639 PR gold/16900
1640 * i386.cc (Output_data_got_plt_i386): New class.
1641 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1642 parameter. Change all callers.
1643 (Output_data_plt_i386::layout_): Remove.
1644 (Output_data_plt_i386::got_plt_): Change type.
1645 (Target_i386::got_plt_): Change type. Change all references.
1646 (Target_i386::got_section): Create instance of new class.
1647 (Output_data_got_plt_i386::do_write): New function.
1648 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1649 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1650 parameter. Change all callers.
1651 (Output_data_plt_x86_64::layout_): Remove.
1652 (Output_data_plt_x86_64::got_plt_): Change type.
1653 (Target_x86_64::got_plt_): Change type. Change all references.
1654 (Target_x86_64::got_section): Create instance of new class.
1655 (Output_data_got_plt_x86_64::do_write): New function.
1656 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1657 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1658 class.
1659
6b97515d 16602014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1661
6b97515d
CC
1662 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1663 if we have pubnames/pubtypes.
1664
d1bddd3c
CC
16652014-05-02 Cary Coutant <ccoutant@google.com>
1666
5fe7ffdc
AM
1667 * defstd.cc (in_segment): Define __ehdr_start here...
1668 * layout.cc (Layout::finalize): ...Instead of here. Set the
1669 output segment when known.
1670 * resolve.cc (Symbol::override_base_with_special): Remember
1671 the original binding.
1672 * symtab.cc (Symbol::set_output_segment): New function.
1673 (Symbol::set_undefined): New function.
1674 * symtab.h (Symbol::is_weak_undefined): Check original undef
1675 binding.
1676 (Symbol::is_strong_undefined): New function.
1677 (Symbol::set_output_segment): New function.
1678 (Symbol::set_undefined): New function.
1679 * target-reloc.h (is_strong_undefined): Remove.
1680 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1681 Check for hidden undefs.
1682 (relocate_section): Call Symbol::is_strong_undefined.
1683
1684 * testsuite/Makefile.am (ehdr_start_test_1)
1685 (ehdr_start_test_2, ehdr_start_test_3)
1686 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1687 * testsuite/Makefile.in: Regenerate.
1688 * testsuite/ehdr_start_def.cc: New source file.
1689 * testsuite/ehdr_start_test.cc: New source file.
1690 * testsuite/ehdr_start_test.t: New linker script.
1691 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1692
7849f6d8
CC
16932014-04-23 Cary Coutant <ccoutant@google.com>
1694
bf2cc635 1695 PR gold/16870
7849f6d8
CC
1696 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1697
99fd8cff
CC
16982014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1699
1700 * layout.cc (Layout::include_section): Allow a target to decide
1701 whether to include a section.
1702 * target.h (Target::should_include_section): New function.
1703 (Target::do_should_include_section): New function.
1704
91f43acd
CC
17052014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1706
1707 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1708 inline into ...
1709 (Copy_relocs::emit): ... here.
1710 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1711 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1712 (Copy_reloc_entry::entries_): Change from private to protected.
1713
c4eb27e1
ST
17142014-04-02 Sriraman Tallam <tmsriram@google.com>
1715
1716 * icf.cc (get_section_contents): Replace copies of reloc
1717 vectors with const references.
1718
ae447ddd
CC
17192014-04-02 Cary Coutant <ccoutant@google.com>
1720
1721 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1722 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1723 * configure: Regenerate.
1724 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1725 -fno-use-linker-plugin.
1726 (LINK1, CXXLINK1): Add it to the link command.
1727 * testsuite/Makefile.in: Regenerate.
1728
fa47fa92
AM
17292014-03-12 Alan Modra <amodra@gmail.com>
1730
1731 * Makefile.in: Regenerate.
1732
9b12c500
CC
17332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1734
1735 * symtab.h (Symbol::set_nonvis): New function.
1736
beacaa96
CC
17372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1738
1739 * symtab.cc (Sized_symbol<32>::init_output_data):
1740 Instantiate the template.
1741 (Sized_symbol<64>::init_output_data): Likewise.
1742
800d9823
CC
17432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1744
1745 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1746 adjust dynamic symbol value.
1747 * target.h (Target::adjust_dyn_symbol): New function.
1748 (Target::do_adjust_dyn_symbol): New function.
1749
918fc1f8 17502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1751
918fc1f8
CC
1752 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1753 Get the value of DYNAMIC_CUSTOM dynamic entry.
1754 * output.h (Output_data_dynamic::add_custom): New function.
1755 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1756 dynamic entry.
1757 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1758 * target.h (Target::dynamic_tag_custom_value): New function.
1759 (Target::do_dynamic_tag_custom_value): New function.
1760
98ff9231
CC
17612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1762
1763 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1764 dynsym indexes.
1765 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1766 (Target::do_has_custom_set_dynsym_indexes): New function.
1767 (Target::set_dynsym_indexes): New function.
1768 (Target::do_set_dynsym_indexes): New function.
1769
b80eed39
AM
17702014-03-07 Alan Modra <amodra@gmail.com>
1771
1772 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1773 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1774 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1775 (Powerpc_relocate_functions::has_overflow_bitfield,
1776 overflowed): Use the above.
1777 (Target_powerpc::Relocate::relocate): Correct overflow checking
1778 for a number of relocations. Modify overflow test for 16-bit
1779 fields in instructions to signed/unsigned according to whether
1780 the field takes a signed or unsigned value.
1781
4b95cf5c
AM
17822014-03-05 Alan Modra <amodra@gmail.com>
1783
1784 Update copyright years.
1785
45965137
AM
17862014-03-05 Alan Modra <amodra@gmail.com>
1787
1788 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1789 R_PPC64_ADDR64_LOCAL.
1790 (Target_powerpc::Relocate::relocate): Likewise.
1791
2c80b753
AM
17922014-03-03 Alan Modra <amodra@gmail.com>
1793
1794 * dwp.cc (print_version): Update copyright year to current.
1795
c1c69e83
AM
17962014-02-10 Alan Modra <amodra@gmail.com>
1797
1798 * po/gold.pot: Regenerate.
1799
dd0c4e70
CC
18002014-02-06 Cary Coutant <ccoutant@google.com>
1801
1802 Fix problem where -u is ignored when a weak undef is seen.
1803
1804 * archive.cc (Library_base::should_include_member): Reorder
1805 code to check for -u option if a weak undef has already been seen.
1806 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1807 * testsuite/Makefile.in: Regenerate.
1808 * testsuite/weak_undef_file3.cc: New file.
1809 * testsuite/weak_undef_file4.cc: New file.
1810 * testsuite/weak_undef_test_2.cc: New file.
1811
1a221d3d
CC
18122014-02-05 Cary Coutant <ccoutant@google.com>
1813
1814 Fix issues with gold undefined symbol diagnostics.
1815
1816 PR binutils/15435
1817 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1818 check to here.
1819 * target-reloc.h (is_strong_undefined): New function.
1820 (relocate_section): Move undef vtable symbol check from here.
1821 Check for is_strong_undefined.
1822
e889f0a4 18232014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1824
e889f0a4
CC
1825 Fix problems with the --dynamic-list option.
1826
1827 PR gold/13577
1828 * options.cc (General_options::parse_dynamic_list):
1829 Set have_dynamic_list_.
1830 (General_options::General_options): Initialize have_dynamic_list_.
1831 (General_options::finalize): Turn off -Bsymbolic and
1832 -Bsymbolic-functions if --dynamic-list provided.
1833 * options.h (General_options::have_dynamic_list): New function.
1834 (General_options::have_dynamic_list_): New data member.
1835 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1836 correctly.
5fe7ffdc 1837
e889f0a4
CC
1838 PR gold/16530
1839 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1840 in --dynamic-list, mark it.
5fe7ffdc 1841
e889f0a4
CC
1842 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1843 (dynamic_list_2): New test case.
1844 * testsuite/Makefile.in: Regenerate.
1845 * testsuite/dynamic_list_2.cc: New file.
1846 * testsuite/dynamic_list_2.t: New file.
1847 * testsuite/dynamic_list_lib1.cc: New file.
1848 * testsuite/dynamic_list_lib2.cc: New file.
1849 * testsuite/gc_dynamic_list_test.c: New file.
1850 * testsuite/gc_dynamic_list_test.sh: New file.
1851 * testsuite/gc_dynamic_list_test.t: New file.
1852
ec673e64
CC
18532014-01-28 Cary Coutant <ccoutant@google.com>
1854
1855 Add .gdb_index version 7 support.
1856
1857 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1858 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1859 debug sections.
1860 (Dwarf_ranges_table::read_ranges_table): Likewise.
1861 (Dwarf_pubnames_table::read_section): Check for GNU-style
1862 sections, and for compressed debug sections.
1863 (Dwarf_pubnames_table::read_header): Compute end address of table.
1864 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1865 for end of list by offset, not by offset == 0.
1866 (Dwarf_info_reader::do_read_string_table): Check for compressed
1867 debug sections.
1868 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1869 Initialize new data members.
1870 (Dwarf_pubnames_table::next_name): return flag_byte.
1871 (Dwarf_pubnames_table::end_of_table_): New data member.
1872 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1873 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1874 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1875 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1876 read skeleton type unit DIEs.
1877 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1878 (Gdb_index::do_write): Write flag_byte.
1879 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1880 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1881 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1882 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1883
221fd5d5
L
18842014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1885
1886 * version.cc (print_version): Update copyright year to 2014.
1887
6c09fb0b
ILT
18882013-12-19 Dimitry Andric <dimitry@andric.com>
1889
1890 * stringpool.cc (Stringpool_template::reserve): Add
1891 HAVE_UNORDERED_MAP case.
1892 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1893
8356f2d0
CC
18942013-12-18 Cary Coutant <ccoutant@google.com>
1895
1896 * configure.ac: Check for <unordered_set> and <unordered_map>.
1897 * config.in: Regenerate.
1898 * configure: Regenerate.
1899 * system.h: Use <unordered_set> and <unordered_map> if available.
1900
f2c7d7ee
RM
19012013-12-10 Roland McGrath <mcgrathr@google.com>
1902
1903 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1904 with $(INSTALL_PROGRAM_ENV).
1905 * Makefile.in: Regenerate.
1906
6632e8cc
CC
19072013-11-22 Cary Coutant <ccoutant@google.com>
1908
1909 * configure.ac: Add check for which library is needed for
1910 dlopen.
1911 * configure: Regenerate.
1912
0c075858
CC
19132013-11-22 Cary Coutant <ccoutant@google.com>
1914
1915 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1916 assembler.
1917 * testsuite/Makefile.in: Regenerate.
1918
f49fe902
L
19192013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1920
1921 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1922 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1923 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1924 (Target_x86_64<size>::Scan::local): Likewise.
1925 (Target_x86_64<size>::Scan::global): Likewise.
1926 (Target_x86_64<size>::Relocate::relocate): Likewise.
1927 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1928 Likewise.
1929 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1930 R_X86_64_PC32_BND.
1931
1932 * testsuite/Makefile.am (check_PROGRAMS): Add
1933 exception_x86_64_bnd_test.
1934 (exception_x86_64_bnd_test_SOURCES): New macro.
1935 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1936 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1937 (exception_x86_64_bnd_test_LDADD): Likewise.
1938 (exception_x86_64_bnd_1.o): New rule.
1939 (exception_x86_64_bnd_2.o): Likewise.
1940 * testsuite/Makefile.in: Regenerated.
1941
9055360d
AM
19422013-11-15 Alan Modra <amodra@gmail.com>
1943
1944 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1945 accessor.
1946 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1947 Only call ppc64_local_entry_offset for 64-bit. Restrict
1948 symval_for_branch lookup to ELFv1.
1949 (Stub_table::add_plt_call_entry): Use unsigned int off.
1950 (Output_data_glink::Address, invalid_address): New.
1951 (Output_data_glink::add_eh_frame): Move out of line. Add
1952 support for ELFv2.
1953 (Output_data_glink::add_global_entry, find_global_entry,
1954 global_entry_address): New functions.
1955 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1956 ge_size): New variables.
1957 (Output_data_glink::set_final_data_size): Add global entry
1958 stub sizing.
1959 (Output_data_glink::do_write): Write global entry stubs.
1960 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1961 parameter. Return true for ELFv2. Adjust callers.
1962 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1963 ELFv1. Similarly for ifunc and dynamic relocation processing
1964 specific to ELFv1. Recognize that symbols are defined on
1965 their plt entries for ELFv2.
1966 (Target_powerpc::symval_for_branch): Assert if called for
1967 ELFv2 or ppc32.
1968 (Target_powerpc::Relocate::relocate): Use global entry plt
1969 stub for symbol value if such exists on ELFv2.
1970 (Target_powerpc::Relocate::relocate): Don't call
1971 symval_for_branch when ELFv2. Do adjust for local entry
1972 offset when ELFv2.
1973 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1974 plt stub for ELFv2.
1975 (Target_powerpc::do_plt_address_for_global): Similarly.
1976
cafdd569
CC
19772013-11-14 Cary Coutant <ccoutant@google.com>
1978
1979 Revert patch -- this did not fix the problem, and there is
1980 no race there.
1981
1982 2013-11-14 Cary Coutant <ccoutant@google.com>
1983
1984 PR gold/14860
1985 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1986 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1987 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1988 updating fde_offsets_.
1989 (Eh_frame_hdr::lock_): New data member.
1990
94e49e16
CC
19912013-11-14 Cary Coutant <ccoutant@google.com>
1992
1993 * dwp.cc (Dwo_file_entry): New type.
1994 (File_list): Use Dwo_file_entry.
1995 (Dwo_file::verify): New function.
1996 (Dwo_file::verify_dwo_list): New function.
1997 (Dwo_file::sized_verify_dwo_list): New function.
1998 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1999 list.
2000 (Dwp_options): New enum type.
2001 (dwp_options): Add --verify-only.
2002 (usage): Likewise.
2003 (main): Likewise.
2004 * dwp.h (gold_info): Add declaration.
2005
7cdd7d57
CC
20062013-11-14 Cary Coutant <ccoutant@google.com>
2007
2008 PR gold/14860
2009 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2010 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2011 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2012 updating fde_offsets_.
2013 (Eh_frame_hdr::lock_): New data member.
2014
1d946cb3
CC
20152013-11-06 Cary Coutant <ccoutant@google.com>
2016
2017 PR gold/15758
2018 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2019 before reloc sections.
2020
4f65b40e
AM
20212013-11-04 Alan Modra <amodra@gmail.com>
2022
2023 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2024 (Symbol::needs_dynamic_reloc): Test new flag.
2025 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2026 (Target_powerpc::Scan::get_reference_flags): Add target param.
2027 Return FUNC_DESC_ABI for 64-bit ELFv1.
2028 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2029 call.
2030 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2031 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2032
908794a9
CC
20332013-10-31 Cary Coutant <ccoutant@google.com>
2034
2035 Restore support for dwp v2 DWARF package file format.
2036
2037 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2038 tu_length parameter. Adjust all callers.
2039 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2040 * dwp.cc: Include dwarf.h.
2041 (Section_bounds): New struct type.
2042 (Unit_set): New struct type.
2043 (Dwo_file::Dwo_file): Initialize new data member.
2044 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2045 Combine and rename to...
2046 (Dwo_file::read_unit_index): ...this.
2047 (Dwo_file::sized_read_compunit_index)
2048 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2049 (Dwo_file::sized_read_unit_index): ...this.
2050 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2051 parameters; add section_id parameter.
2052 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2053 (Dwo_file::add_unit_set): ...this.
2054 (Dwo_file::shndx_map_): Remove.
2055 (Dwo_file::sect_offsets_): New data member.
2056 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2057 (Dwp_output_file::add_section): Rename to...
2058 (Dwp_output_file::add_contribution): ...this.
2059 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2060 (Dwp_output_file::add_tu_set): Likewise.
2061 (Dwp_output_file::Contribution): New type.
2062 (Dwp_output_file::Section::contributions): New data member.
2063 (Dwp_output_file::Cu_or_tu_set): Remove.
2064 (Dwp_output_file::Section::Section): New ctor.
2065 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2066 (Dwp_output_file::Dwp_index::Section_table): New type.
2067 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2068 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2069 parameter.
2070 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2071 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2072 (Dwp_output_file::Dwp_index::section_table): New member function.
2073 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2074 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2075 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2076 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2077 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2078 (Dwp_output_file::Dwp_index::section_table_): New data member.
2079 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2080 (Dwp_output_file::add_output_section): New member function.
2081 (Dwp_output_file::write_new_section): New member function.
2082 (Dwp_output_file::write_contributions): New member function.
2083 (Dwp_output_file::section_id_map_): New data member.
2084 (class Dwo_id_info_reader): Remove.
2085 (class Unit_reader): New class.
2086 (get_dwarf_section_name): New function.
2087 (Dwo_file::read_executable): Adjust initializations of class data.
2088 (Dwo_file::read): Add support for v2 package file format.
2089 (Dwo_file::read_unit_index): Likewise.
2090 (Dwo_file::sized_read_unit_index): Likewise.
2091 (Dwo_file::copy_section): Likewise.
2092 (Dwo_file::add_unit_set): Likewise.
2093 (Dwp_output_file::add_output_section): Likewise.
2094 (Dwp_output_file::add_contribution): Likewise.
2095 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2096 for empty slot.
2097 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2098 file format.
2099 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2100 slot.
2101 (Dwp_output_file::initialize): Remove unused function.
2102 (Dwp_output_file::finalize): Add support for v2 package file format.
2103 (Dwp_output_file::write_index): Likewise.
2104 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2105 function prototype.
2106
2500c017
CC
21072013-10-31 Cary Coutant <ccoutant@google.com>
2108
2109 * configure.ac: Fix check for -fmerge-constants.
2110 * configure.ac: Regenerate.
2111
dd0845d7
RM
21122013-10-30 Roland McGrath <mcgrathr@google.com>
2113
2114 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2115 Correct 9-byte nop sequence to match what the assembler generates.
2116
b4f7960d
AM
21172013-10-30 Alan Modra <amodra@gmail.com>
2118
2119 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2120 ppc64_local_entry_offset, ppc64_local_entry_offset,
2121 do_read_symbols): New functions.
2122 (Powerpc_relobj::e_flags_, st_other_): New vars.
2123 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2124 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2125 (Powerpc_relobj::e_flags_): New var.
2126 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2127 and adjust for ELFv2.
2128 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2129 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2130 (Powerpc_dynobj::do_find_special_sections): Likewise.
2131 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2132 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2133 to ELFv2 local entry.
2134 (Target_powerpc::do_relax): No thread safe barriers needed for
2135 ELFv2.
2136 (Output_data_plt_powerpc::initial_plt_entry_size_,
2137 plt_entry_size): Delete. Replace all uses with
2138 first_plt_entry_offset() and plt_entry_size().
2139 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2140 reserved_size parm. Update callers.
2141 (Output_data_plt_powerpc::entry_count): Update.
2142 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2143 and use Target_powerpc::first_plt_entry_offset().
2144 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2145 rename to plt_entry_size.
2146 (Output_data_plt_powerpc::add_ifunc_entry,
2147 add_local_ifunc_entry): Adjust reloc for ELFv2.
2148 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2149 (glink_eh_frame_fde_64v2): New.
2150 (Stub_table::plt_call_size): Support ELFv2 sizing.
2151 (Output_data_glink::add_eh_frame): Use the new FDE.
2152 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2153 (Stub_table::do_write): Write ELFv2 stubs and glink.
2154 (Target_powerpc::Relocate::relocate): Replaces nop after call
2155 with ld 2,24(1) and adjust local offset destination for ELFv2.
2156
f9c6b907
AM
21572013-10-30 Alan Modra <amodra@gmail.com>
2158
2159 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2160 (Target_powerpc::Scan::global, local): Likewise.
2161 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2162 on all ppc64 @h and @ha relocs.
2163
e84fe78f
AM
21642013-10-14 Alan Modra <amodra@gmail.com>
2165
2166 * output.h (Output_data_got::add_constant): Tidy.
2167 (Output_data_got::add_constant_pair): New function.
2168 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2169 methods used so as to first call reserve_ent().
2170
679e4abf
RM
21712013-10-11 Roland McGrath <mcgrathr@google.com>
2172
44dcb735
RM
2173 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2174 add_got_entry and add_got_entry_pair.
2175
13323c49
RM
2176 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2177 (HAVE_PUBNAMES): Likewise.
2178 * configure: Regenerate.
2179
1496b446
RM
2180 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2181 * testsuite/Makefile.in: Regenerate.
2182
cc84c10b
RM
2183 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2184 Remove const from declaration.
2185 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2186 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2187 * output.h (Output_file_header): Remove const from member target_
2188 and corresponding constructor argument.
2189 * output.cc (Output_file_header::Output_file_header): Update prototype.
2190 (Output_file_header::do_sized_write): Use this->target_ in place
2191 of parameters()->target().
2192
52f66a2c
RM
2193 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2194
2b64b551
RM
2195 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2196 * configure: Regenerate.
2197 * Makefile.in: Regenerate.
2198 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2199 * testsuite/merge_string_literals_2.c: Likewise.
2200 * testsuite/Makefile.am
2201 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2202 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2203 literal -fmerge-constants.
2204 * testsuite/Makefile.in: Regenerate.
2205
43819297
RM
2206 * i386.cc (Target_i386): Remove unused member dynbss_.
2207 * arm.cc (Target_arm): Likewise.
2208 * powerpc.cc (Target_powerpc): Likewise.
2209 * sparc.cc (Target_sparc): Likewise.
2210 * tilegx.cc (Target_tilegx): Likewise.
2211 * x86_64.cc (Target_x86_64): Likewise.
2212 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2213 type_signature_, type_offset_.
2214 * plugin.h (Plugin_hook): Remove unused member layout_.
2215 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2216 mapfile_.
2217 (Read_member): Remove unused members input_objects_, symtab_,
2218 mapfile_, layout_.
2219 (Check_library): Remove unused member symtab_.
2220 * archive.h (Lib_group): Remove unused member lib_.
2221 * archive.cc (Lib_group::Lib_group): Update initializer.
2222 * incremental.h (Incremental_binary): Remove unused member target_.
2223 (Incremental_script_entry): Removed unused member script_.
2224 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2225 * icf.h (Icf): Remove unused member num_tracked_relocs.
2226
39d9ead7
RM
2227 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2228 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2229 its only use.
2230 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2231
679e4abf
RM
2232 * archive.h: Use struct rather than class for forward declaration
2233 of Read_symbols_data.
2234
54de2ea6
CC
22352013-10-07 Cary Coutant <ccoutant@google.com>
2236
2237 PR gold/16010
2238 * testsuite/Makefile.am (icf_test): Fix dependencies.
2239 (icf_safe_test): Likewise.
2240 (icf_safe_so_test): Likewise.
2241 (large_symbol_alignment): Add empty _LDADD rule.
2242 * testsuite/Makefile.in: Regenerate.
2243
b14016f0
L
22442013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2245
2246 PR gold/15927
2247 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2248 relocation for R_X86_64_32 on x32.
2249
eb426534
RM
22502013-08-27 Roland McGrath <mcgrathr@google.com>
2251
2252 * output.cc (Output_segment::set_section_addresses): Take new
2253 Target* argument. If target->isolate_execinstr() and the segment
2254 is executable and starts at a target->abi_pagesize() boundary,
2255 pad its end out to a target->abi_pagesize() boundary with code fill.
2256 * output.h (Output_segment::set_section_addresses): Update decl.
2257 * layout.h (Layout::check_output_data_for_reset_values): Take new
2258 argument RELAX_OUTPUTS.
2259 (Layout): New member relax_output_list_.
2260 (Layout::add_relax_output): New method.
2261 * layout.cc (Layout::Layout): Update constructor.
2262 (Layout::reset_relax_output): New method.
2263 (Layout::clean_up_after_relaxation): Call it.
2264 (Layout::prepare_for_relaxation): Update caller.
2265 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2266 Call reset_relax_output before re-processing segments for
2267 isolate_execinstr case.
2268 (Layout::write_data): Handle relax_output_list_.
2269 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2270 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2271
9aff4b7a
NC
22722013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2273
2274 PR binutils/15834
2275 * object.h: Fix typos.
2276
93f8221c
RM
22772013-08-16 Roland McGrath <mcgrathr@google.com>
2278
2279 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2280 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2281
e44c3715
CC
22822013-08-07 Cary Coutant <ccoutant@google.com>
2283
2284 Revert support for v2 DWP files:
2285
2286 2013-03-01 Cary Coutant <ccoutant@google.com>
2287
2288 Add dwp support for v2 DWARF package file format.
2289 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2290 tu_length parameter. Adjust all callers.
2291 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2292 * dwp.cc: Include dwarf.h.
2293 (Section_bounds): New struct type.
2294 (Unit_set): New struct type.
2295 (Dwo_file::Dwo_file): Initialize new data member.
2296 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2297 Combine and rename to...
2298 (Dwo_file::read_unit_index): ...this.
2299 (Dwo_file::sized_read_compunit_index)
2300 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2301 (Dwo_file::sized_read_unit_index): ...this.
2302 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2303 parameters; add section_id parameter.
2304 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2305 (Dwo_file::add_unit_set): ...this.
2306 (Dwo_file::shndx_map_): Remove.
2307 (Dwo_file::sect_offsets_): New data member.
2308 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2309 (Dwp_output_file::add_section): Rename to...
2310 (Dwp_output_file::add_contribution): ...this.
2311 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2312 (Dwp_output_file::add_tu_set): Likewise.
2313 (Dwp_output_file::Contribution): New type.
2314 (Dwp_output_file::Section::contributions): New data member.
2315 (Dwp_output_file::Cu_or_tu_set): Remove.
2316 (Dwp_output_file::Section::Section): New ctor.
2317 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2318 (Dwp_output_file::Dwp_index::Section_table): New type.
2319 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2320 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2321 parameter.
2322 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2323 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2324 (Dwp_output_file::Dwp_index::section_table): New member function.
2325 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2326 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2327 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2328 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2329 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2330 (Dwp_output_file::Dwp_index::section_table_): New data member.
2331 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2332 (Dwp_output_file::add_output_section): New member function.
2333 (Dwp_output_file::write_new_section): New member function.
2334 (Dwp_output_file::write_contributions): New member function.
2335 (Dwp_output_file::section_id_map_): New data member.
2336 (class Dwo_id_info_reader): Remove.
2337 (class Unit_reader): New class.
2338 (get_dwarf_section_name): New function.
2339 (Dwo_file::read_executable): Adjust initializations of class data.
2340 (Dwo_file::read): Add support for v2 package file format.
2341 (Dwo_file::read_unit_index): Likewise.
2342 (Dwo_file::sized_read_unit_index): Likewise.
2343 (Dwo_file::copy_section): Likewise.
2344 (Dwo_file::add_unit_set): Likewise.
2345 (Dwp_output_file::add_output_section): Likewise.
2346 (Dwp_output_file::add_contribution): Likewise.
2347 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2348 for empty slot.
2349 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2350 file format.
2351 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2352 slot.
2353 (Dwp_output_file::initialize): Remove unused function.
2354 (Dwp_output_file::finalize): Add support for v2 package file format.
2355 (Dwp_output_file::write_index): Likewise.
2356 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2357 function prototype.
2358
c6905c28
CC
23592013-07-31 Cary Coutant <ccoutant@google.com>
2360
2361 * object.cc (Sized_relobj::do_output_section_address): New function.
2362 (Sized_relobj): Instantiate explicitly.
2363 * object.h (Object::output_section_address): New function.
2364 (Object::do_output_section_address): New function.
2365 (Sized_relobj::do_output_section_address): New function.
2366 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2367
23682013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2369 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2370
2371 * parameters.cc (Parameters::entry): Return target-specific entry
2372 symbol name.
2373 * target.h (Target::entry_symbol_name): New function.
2374 (Target_info::entry_symbol_name): New data member.
2375
2376 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2377 * i386.cc (Target_i386::i386_info): Likewise.
2378 (Target_i386_nacl::i386_nacl_info): Likewise.
2379 * sparc.cc (Target_sparc::sparc_info): Likewise.
2380 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2381 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2382 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2383 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2384
234d4ab8
SA
23852013-07-22 Sterling Augustine <saugustine@google.com>
2386
2387 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2388 Convert parameter shndx to local variable. Add parameters symtab
2389 and symtab_size. Scan over section names. Find relocation
2390 section corresponding to current section. Create and initialize
2391 reloc_mapper_ and reloc_type_.
2392 (Dwarf_pubnames_table::read_header): Add assertion. Change
2393 unit_length to off_t. Initialize member unit_length_. Fill in field
2394 cu_offset_.
2395 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2396 Initialize new fields unit_length_ and cu_offset_.
2397 (Dwarf_pubnames_table::read_section): Update prototype.
2398 (Dwarf_pubnames_table::cu_offset): New member function.
2399 (Dwarf_pubnames_table::subsection_size): Likewise.
2400 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2401 New fields.
2402 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2403 member functions public.
2404 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2405 Update comment. Rework logic. Move repeated parts to...
2406 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2407 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2408 pubtypes_table_, and stmt_list_offset.
2409 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2410 Gdb_index::find_pubtype_offset,
2411 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2412 (Gdb_index::pubnames_read): Update prototype and rework logic.
2413 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2414 Forward declare.
2415 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2416 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2417 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2418 Gdb_index::map_pubtable_to_dies):
2419 Declare functions.
2420 (Gdb_index::pubnames_read): Update declaration.
2421 (Gdb_index::Pubname_offset_map): New type.
2422 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2423 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2424 Gdb_index::stmt_list_offset): Declare.
2425 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2426 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2427 Gdb_index::pubtypes_offset_): Remove.
2428
a3ed37d8
RM
24292013-07-19 Roland McGrath <mcgrathr@google.com>
2430
2431 * options.h (General_options): Add -Trodata-segment option.
2432 * parameters.cc (Parameters::check_rodata_segment): New function.
2433 (Parameters::set_target_once): Call it.
2434 * parameters.h (Parameters): Declare it (private member function).
2435 * layout.cc (load_seg_unusable_for_headers): New function, broken
2436 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2437 then validate rodata segment rather than text segment.
2438 (relaxation_loop_body): Call that.
2439 (is_text_segment): New function. Don't admit a non-executable
2440 segment if TARGET->isolate_execinstr().
2441 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2442
eb5b4ded
CC
24432013-07-15 Shawn Landden <shawnlandden@gmail.com>
2444
2445 PR gold/15070
2446 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2447 * nacl.h (Sniff_file::View::View): Request aligned view.
2448
4d5effb9
CC
24492013-07-11 Cary Coutant <ccoutant@google.com>
2450
2451 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2452 correct BRLT entry size.
2453
ba8ca3e7
AM
24542013-07-03 Alan Modra <amodra@gmail.com>
2455
2456 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2457 comment.
2458
267257d2
CC
24592013-07-01 Cary Coutant <ccoutant@google.com>
2460
2461 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2462 reloc_type_.
2463 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2464 (Dwarf_ranges_table::lookup_reloc): New function.
2465 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2466 reloc_type_.
2467 (Dwarf_ranges_table::lookup_reloc): New function.
2468 (Dwarf_ranges_table::reloc_type_): New data member.
2469
06f30c9d
CC
24702013-06-27 Jing Yu <jingyu@google.com>
2471
2472 PR gold/15662
2473 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2474 function.
2475 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2476 (Target_powerpc::do_relax): Call the above.
2477
a2d7bf59
AM
24782013-06-27 Cary Coutant <ccoutant@google.com>
2479
2480 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2481 on garbage collected .opd section.
2482
24832013-06-27 Alan Modra <amodra@gmail.com>
2484
2485 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2486 is non-zero.
2487 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2488 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2489
32364e50
CC
24902013-06-14 Cary Coutant <ccoutant@google.com>
2491
2492 * resolve.cc (Symbol::override_base): Don't override st_type
2493 from plugin placeholder symbols.
2494 (Symbol_table::resolve): Likewise.
2495 (Symbol_table::should_override): Don't complain about TLS mismatch
2496 if the TO symbol is a plugin placeholder.
2497 * testsuite/Makefile.am (plugin_test_tls): New test.
2498 * testsuite/Makefile.in: Regenerate.
2499 * testsuite/plugin_test_tls.sh: New test script.
2500 * testsuite/two_file_test_2_tls.cc: New test source.
2501 * testsuite/two_file_test_tls.cc: New test source.
2502
7fb47cc9
CC
25032013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2504
2505 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2506 the maximum segment alignment is larger than the page size.
2507 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2508 correctly aligns the symbols with large alignemnt.
2509 * testsuite/Makefile.in: Regenerate.
2510 * testsuite/large_symbol_alignment.cc: New file.
2511
6934001a
CC
25122013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2513 Sriraman Tallam <tmsriram@google.com>
2514
2515 * options.h (sort_section): New option.
2516 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2517 Rename from Input_section_sort_section_name_special_ordering_compare.
2518 (Input_section_sort_section_name_compare): New struct.
2519 * output.cc (Output_section::Input_section_sort_section_name_compare::
2520 operator()): New function.
2521 (Output_section::sort_attached_input_sections): Use new sort function
2522 for .text if --sort-section=name is specified.
2523 * layout.cc (Layout::make_output_section):
2524 Add sorting by name when --sort-section=name is specified.
2525 * testsuite/Makefile.am (text_section_grouping): Test option
2526 --sort-section=name.
2527 * testsuite/Makefile.in: Regenerate.
2528 * testsuite/section_sorting_name.cc: New file.
2529 * testsuite/section_sorting_name.sh: New file.
2530
93acabad
CC
25312013-05-21 Cary Coutant <ccoutant@google.com>
2532
2533 * symtab.h (Symbol::is_cxx_vtable): New function.
2534 * target-reloc.h (relocate_section): Check for vtable symbol.
2535 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2536 * testsuite/Makefile.in: Regenerate.
2537 * testsuite/missing_key_func.cc: New test source.
2538 * testsuite/missing_key_func.sh: New test script.
2539
60e8b3fc
CC
25402013-05-21 Cary Coutant <ccoutant@google.com>
2541
2b64b551
RM
2542 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2543 type of enclosing symbol.
2544 (Relocate_info::location): Check symbol type when describing symbol.
2545 * object.h (Symbol_location_info): Remove unused line_number;
2546 add enclosing_symbol_type.
2547 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2548
9df9de2c
CC
25492013-05-13 Cary Coutant <ccoutant@google.com>
2550
2b64b551
RM
2551 * configure.ac: Export DEFAULT_TARGET.
2552 * configure: Regenerate.
2553 * Makefile.in: Regenerate.
2554 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2555 * testsuite/Makefile.in: Regenerate.
2556 * testsuite/debug_msg.sh: Delete duplicate tests.
2557 Don't check undef_int error message match for powerpc where the
2558 source file and line number aren't available.
9df9de2c 2559
bbc5ae17
RM
25602013-05-10 Roland McGrath <mcgrathr@google.com>
2561
2562 * options.h (General_options): Add --rosegment-gap option.
2563 * options.cc (finalize): --rosegment-gap implies --rosegment.
2564 * layout.cc (set_segment_offsets): Let user option override
2565 target->rosegment_gap().
2566
0c6e6c39
RM
25672013-05-10 Roland McGrath <mcgrathr@google.com>
2568
2569 * options.h (General_options): Remove leading space from help
2570 messages for -nostdlib and --rosegment.
2571
cde7cb01
MR
25722013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2573
2574 PR ld/15365
2575 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2576
f31ae5b8
AM
25772013-05-03 Alan Modra <amodra@gmail.com>
2578
2579 * merge.cc (Output_merge_string::do_add_input_section): Correct
2580 scan for number of strings. Rename vars to avoid shadowing.
2581 Include missing terminator in input_size_.
2582
d3a7cd45
L
25832013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2584
2585 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2586 Restore empty string handling.
2587
6ad3daba
CC
25882013-05-01 Cary Coutant <ccoutant@google.com>
2589
2590 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2591 uninitialized warning.
2592
e31908b6
CC
25932013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2594
2595 * output.cc (Output_section::add_merge_input_section): Allow
2596 to merge sections if the alignment is more than character size.
2597 * merge.h (Output_merge_string::Output_merge_string): Remove
2598 assert.
2599 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2600 only not-null strings. Check the alignment of strings.
2601 * stringpool.h
2602 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2603 alignment as the argument.
2604 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2605 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2606 Align non-zero length strings according to the addralign_.
2607 (Stringpool_template<Stringpool_char>::set_string_offsets):
2608 Updating offsets according to the given alignment.
2609 * testsuite/Makefile.am (text_section_grouping): Test if string
2610 literals are getting merged.
2611 * testsuite/Makefile.in: Regenerate.
2612 * testsuite/merge_string_literals_1.c: New file.
2613 * testsuite/merge_string_literals_2.c: Ditto.
2614 * testsuite/merge_string_literals.sh: Ditto.
2615
0e804863
ILT
26162013-04-26 Ian Lance Taylor <iant@google.com>
2617
2618 * target-reloc.h (relocate_section): If the reloc offset is out of
2619 range, pass VIEW as NULL to relocate.relocate.
2620 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2621 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2622 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2623 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2624 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2625 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2626
e7c5ea40
CC
26272013-04-26 Geoff Pike <gpike@chromium.org>
2628
2629 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2630 * layout.cc (Hash_task): New class.
2631 (Layout::queue_build_id_tasks): New function.
2632 (Layout::write_build_id): Handle single-thread portion of build ID
2633 computation. (In some cases, all of it is single-threaded.) Replace
2634 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2635 functionality in fewer lines of code.
2636 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2637 * options.h (General_options): make "--build-id" default to tree
2638 rather than sha1. Add two new options related to --build-id=tree:
2639 --build-id-chunk-size-for-treehash and
2640 --build-id-min-file-size-for-treehash.
2641 * Makefile.am: add testing of --build-id=tree and related new options
2642 (these tests will be invoked by "make check").
2643 * Makefile.in: Regenerate.
2644
49926cd0
AM
26452013-04-25 Alan Modra <amodra@gmail.com>
2646
2647 * configure.tgt: Add powerpcle and powerpc64le.
2648
a4034750
AM
26492013-04-22 Alan Modra <amodra@gmail.com>
2650
2651 PR gold/15355
2652 * layout.cc (Layout::segment_precedes): Allow more than one
2653 segment with the same type and flags.
2654
e79c84aa
CC
26552013-04-15 Cary Coutant <ccoutant@google.com>
2656
2657 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2658 allocate space in file for BSS sections.
2659
2199fbe7
CC
26602013-04-15 Cary Coutant <ccoutant@google.com>
2661
2662 * script-sections.cc (Orphan_output_section): Reset address
2663 to zero after each orphaned section for relocatable links.
2664
502e8a84
CC
26652013-04-15 Cary Coutant <ccoutant@google.com>
2666
a4034750
AM
2667 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2668 section starting address for relocatable link.
2669 * testsuite/Makefile.am (script_test_11): New test.
2670 * testsuite/Makefile.in: Regenerate.
2671 * testsuite/script_test_11.c: New source file.
2672 * testsuite/script_test_11.t: New linker script.
502e8a84 2673
0cfdc767
AM
26742013-04-13 Alan Modra <amodra@gmail.com>
2675
2676 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2677 owner when sections are not adjacent and exceed group size.
2678 (Target_powerpc::group_sections): Handle corner case.
2679 (Target_powerpc::Branch_info::make_stub): Handle case where
2680 stub table doesn't exist due to branches in non-exec sections.
2681 (Target_powerpc::Relocate::relocate): Likewise.
2682
6830ee24
AM
26832013-04-11 Alan Modra <amodra@gmail.com>
2684
2685 PR gold/15354
2686 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2687 .branch_lt to match bfd ld. Adjust comments throughout file.
2688
54a3d865
ILT
26892013-04-04 Ian Lance Taylor <iant@google.com>
2690
2691 GCC PR c++/56840
2692 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2693 sections before checking whether they are included in the link.
2694
9993ba11
ST
26952013-03-29 Sriraman Tallam <tmsriram@google.com>
2696
2697 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2698 object before calling the plugin claim_file handler. Pass the elf
2699 object of the archive to the plugin. Delete the elf object if the
2700 plugin claims the file.
2701
ebacd51e
AM
27022013-03-21 Alan Modra <amodra@gmail.com>
2703
2704 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2705 segment when omagic.
2706
117be58f
AM
27072013-03-21 Alan Modra <amodra@gmail.com>
2708
2709 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2710 comparison warning.
2711 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2712 uninitialized" warning.
2713
32e2b61d
AM
27142013-03-20 Alan Modra <amodra@gmail.com>
2715
2716 * symtab.h (Symbol::clear_version): New function.
2717 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2718 is_needed by weak references. Clear version for symbols defined
2719 in as-needed objects that are not needed.
2720
b3ccdeb5
AM
27212013-03-15 Alan Modra <amodra@gmail.com>
2722
2723 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2724 static and public. Add report_err param. Return false for data refs.
2725 (Target_powerpc::rela_dyn_section): New overloaded function.
2726 (Target_powerpc::plt_, iplt_): Elucidate.
2727 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2728 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2729 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2730 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2731 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2732 push_branch and make_plt_entry for ifunc syms when
2733 reloc_needs_plt_for_ifunc.
2734 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2735 for ifunc unless reloc_needs_plt_for_ifunc.
2736
ad3d8a2f
AM
27372013-03-15 Alan Modra <amodra@gmail.com>
2738
2739 * gc.h (gc_process_relocs): Don't look through function descriptors.
2740 * icf.cc (get_section_contents): Do so here instead.
2741
4d9aa155
AM
27422013-03-13 Alan Modra <amodra@gmail.com>
2743
2744 * powerpc.cc (is_branch_reloc): Forward declare.
2745 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2746 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2747 false for 64-bit, true for 32-bit non-branch relocs.
2748 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2749 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2750 nm output.
2751 (icf_safe_test): Generate linker map file as well as nm output.
2752 (icf_safe_so_test): Likewise.
2753 * testsuite/Makefile.in: Regenerate.
2754 * testsuite/icf_test.sh: Parse linker map file to determine
2755 section folding.
2756 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2757 * testsuite/icf_safe_so_test.sh: Likewise.
2758 (X86_32_or_ARM_specific_safe_fold): Merge into..
2759 (arch_specific_safe_fold): ..this.
2760 (X86_64_specific_safe_fold): Delete unused function.
2761
57420c20
AM
27622013-03-12 Alan Modra <amodra@gmail.com>
2763
2764 * gc.h (gc_process_relocs): Look through function descriptors
2765 to determine shndx, symvalue and addend used by ICF. Tidy
2766 variable duplication.
2767
dc3714f3
AM
27682013-03-11 Alan Modra <amodra@gmail.com>
2769
2770 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2771 * layout.cc (Layout_task_runner::run): ..to here.
2772 * symtab.h (struct Symbol_location): Extract from..
2773 (class Symbol_table): ..here.
2774 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2775 * target.h (class Target): Add function_location and
2776 do_function_location functions.
2777 (class Sized_target): Add do_function_location.
2778 * object.h (class Sized_relobj_file): Move find_shdr..
2779 (class Object): ..to here.
2780 * object.cc: Likewise. Update to suit. Instantiate.
2781 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2782 * powerpc.cc (class Powerpc_dynobj): New.
2783 (Target_powerpc::do_function_location): New function.
2784 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2785 (Powerpc_dynobj::do_read_symbols): New function.
2786 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2787
956b03bb
ILT
27882013-03-08 Ian Lance Taylor <iant@google.com>
2789
2790 * options.cc (General_options::string_to_object_format): Accept
2791 "default".
2792
4bead2d5
AM
27932013-03-08 Alan Modra <amodra@gmail.com>
2794
2795 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2796 pointer to Post_fde.
2797 (struct Post_fde): Move definition to here..
2798 * ehframe.cc (struct Post_fde): ..from here.
2799 (Cie::write): Don't alloc Post_fde.
2800 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2801
02e60bf7
AM
28022013-03-07 Alan Modra <amodra@gmail.com>
2803
2804 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2805 relocation referencing .LC0.
2806 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2807
8343f03a
AM
28082013-03-07 Alan Modra <amodra@gmail.com>
2809
2810 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2811 always_inline. Add assembly for powerpc to avoid GOT.
2812
3366d57c
AM
28132013-03-07 Alan Modra <amodra@gmail.com>
2814
2815 * testsuite/script_test_10.sh: Don't test .bss section
2816 header number.
2817
6c77229c
AM
28182013-03-06 Alan Modra <amodra@gmail.com>
2819
2820 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2821 (Target_powerpc::symval_for_branch): Add symtab param. Update
2822 all callers. Handle folded sections.
2823 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2824 to Powerpc_relobj.
2825 (Global_symbol_visitor_opd::operator()): Likewise.
2826
a39e4af6
AM
28272013-03-04 Alan Modra <amodra@gmail.com>
2828
2829 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2830 * testsuite/Makefile.in: Regenerate.
2831
d5834edb
CC
28322013-03-01 Cary Coutant <ccoutant@google.com>
2833
2834 Add dwp support for v2 DWARF package file format.
2835 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2836 tu_length parameter. Adjust all callers.
2837 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2838 * dwp.cc: Include dwarf.h.
2839 (Section_bounds): New struct type.
2840 (Unit_set): New struct type.
2841 (Dwo_file::Dwo_file): Initialize new data member.
2842 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2843 Combine and rename to...
2844 (Dwo_file::read_unit_index): ...this.
2845 (Dwo_file::sized_read_compunit_index)
2846 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2847 (Dwo_file::sized_read_unit_index): ...this.
2848 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2849 parameters; add section_id parameter.
2850 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2851 (Dwo_file::add_unit_set): ...this.
2852 (Dwo_file::shndx_map_): Remove.
2853 (Dwo_file::sect_offsets_): New data member.
2854 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2855 (Dwp_output_file::add_section): Rename to...
2856 (Dwp_output_file::add_contribution): ...this.
2857 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2858 (Dwp_output_file::add_tu_set): Likewise.
2859 (Dwp_output_file::Contribution): New type.
2860 (Dwp_output_file::Section::contributions): New data member.
2861 (Dwp_output_file::Cu_or_tu_set): Remove.
2862 (Dwp_output_file::Section::Section): New ctor.
2863 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2864 (Dwp_output_file::Dwp_index::Section_table): New type.
2865 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2866 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2867 parameter.
2868 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2869 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2870 (Dwp_output_file::Dwp_index::section_table): New member function.
2871 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2872 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2873 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2874 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2875 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2876 (Dwp_output_file::Dwp_index::section_table_): New data member.
2877 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2878 (Dwp_output_file::add_output_section): New member function.
2879 (Dwp_output_file::write_new_section): New member function.
2880 (Dwp_output_file::write_contributions): New member function.
2881 (Dwp_output_file::section_id_map_): New data member.
2882 (class Dwo_id_info_reader): Remove.
2883 (class Unit_reader): New class.
2884 (get_dwarf_section_name): New function.
2885 (Dwo_file::read_executable): Adjust initializations of class data.
2886 (Dwo_file::read): Add support for v2 package file format.
2887 (Dwo_file::read_unit_index): Likewise.
2888 (Dwo_file::sized_read_unit_index): Likewise.
2889 (Dwo_file::copy_section): Likewise.
2890 (Dwo_file::add_unit_set): Likewise.
2891 (Dwp_output_file::add_output_section): Likewise.
2892 (Dwp_output_file::add_contribution): Likewise.
2893 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2894 for empty slot.
2895 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2896 file format.
2897 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2898 slot.
2899 (Dwp_output_file::initialize): Remove unused function.
2900 (Dwp_output_file::finalize): Add support for v2 package file format.
2901 (Dwp_output_file::write_index): Likewise.
2902 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2903 function prototype.
2904
a68a081d
CC
29052013-03-01 Cary Coutant <ccoutant@google.com>
2906
2907 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2908 function into class definition in header file.
2909 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2910 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2911 New function.
2912 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2913
9d5781f8
AM
29142013-02-28 Alan Modra <amodra@gmail.com>
2915
2916 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2917 * target.cc (Target::do_plt_fde_location): New function.
2918 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2919 accessor function, and constructor param.
2920 (struct Post_fde, Post_fdes): Declare.
2921 (Cie::write): Add post_fdes param.
2922 * ehframe.cc (Fde::write): Use plt_fde_location.
2923 (struct Post_fde): Define.
2924 (Cie::write): Stash FDEs added post merge mapping.
2925 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2926 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2927 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2928 other FDEs.
2929 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2930 (Target_powerpc::has_glink): New function.
2931 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2932 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2933 glink_eh_frame_fde_32, default_fde): New data.
2934 (Stub_table::eh_frame_added_): New var.
2935 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2936 Make const.
2937 (Stub_table::add_eh_frame): New function.
2938 (Output_data_glink::add_eh_frame): New function.
2939 (Target_powerpc::make_glink_section): Call add_eh_frame.
2940
214383dd
ILT
29412013-02-15 Ian Lance Taylor <iant@google.com>
2942
2943 * options.h (DEFINE_uint64_alias): Define.
2944 (class General_options): Add -Ttext-segment as an alias for
2945 -Ttext.
2946
91c2b899
AM
29472013-02-15 Alan Modra <amodra@gmail.com>
2948
2949 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2950 (Stub_table::do_write): ..here, two places.
2951 (Stub_table::plt_call_size): Use it here too.
2952
20e2a8aa
ILT
29532013-02-11 Ian Lance Taylor <iant@google.com>
2954
2955 * descriptors.cc (Descriptors::close_all): New function.
2956 * descriptors.h (class Descriptors): Declare close_all.
2957 (close_all_descriptors): New inline function.
2958 * plugin.cc: Include "descriptors.h".
2959 (Plugin_manager::cleanup): Call close_all_descriptors.
2960
8952bc69
AM
29612013-02-06 Alan Modra <amodra@gmail.com>
2962
2963 * README: Update coding style link.
2964
29bd8b6b
CC
29652013-01-28 Cary Coutant <ccoutant@google.com>
2966
a4034750
AM
2967 * dwp.cc (File_list): New typedef.
2968 (Dwo_name_info_reader): New class.
2969 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2970 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2971 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2972 (Dwo_file::read_executable): New function.
2973 (Dwo_file::read): Move common setup code to ...
2974 (Dwo_file::make_object): ... here.
2975 (dwp_options): Add --exec/-e.
2976 (usage): Likewise.
2977 (main): Likewise.
29bd8b6b 2978
c6ac678d
ST
29792013-01-24 Sriraman Tallam <tmsriram@google.com>
2980
2981 * layout.cc (Layout::layout): Check for option text_reorder.
2982 (Layout::make_output_section): Ditto.
2983 * options.h (text_reorder): New option.
2984 * output.cc (Input_section_sort_compare): Remove special ordering
2985 of section names.
2986 (Output_section::
2987 Input_section_sort_section_name_special_ordering_compare::
2988 operator()): New function.
2989 (Output_section::sort_attached_input_sections): Use new sort function
2990 for .text.
2991 * output.h (Input_section_sort_section_name_special_ordering_compare):
2992 New struct.
2993 * testsuite/Makefile.am (text_section_grouping): Test option
2994 --no-text-reorder
2995 * testsuite/Makefile.in: Regenerate.
2996 * testsuite/text_section_grouping.sh: Check order of functions without
2997 default text reordering.
2998
50701cc1
MF
29992013-01-18 Mike Frysinger <vapier@gentoo.org>
3000
3001 * options.h (General_options): Change default to true for new_dtags.
3002
b1b00fcc
MF
30032013-01-18 Mike Frysinger <vapier@gentoo.org>
3004
3005 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3006 when enable_new_dtags is false. Only add DT_RUNPATH when
3007 enable_new_dtags is true.
3008
ec5b8187
AM
30092013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3010
3011 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3012 used in declaration and definition consistent.
3013 (Target_powerpc::symval_for_branch): Ditto.
3014
a880d4c4
ST
30152013-01-16 Sriraman Tallam <tmsriram@google.com>
3016
3017 * testsuite/plugin_final_layout.cc: Fix comment.
3018
7c381248
ST
30192013-01-16 Sriraman Tallam <tmsriram@google.com>
3020
3021 * layout.cc (Layout::layout): Do not do default sorting for
3022 text sections when section ordering is specified.
3023 (make_output_section): Ditto.
3024 * testsuite/plugin_final_layout.cc: Name the function sections
3025 to catch reordering issues.
3026
e2458743
AM
30272013-01-15 Alan Modra <amodra@gmail.com>
3028
3029 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3030 plt-thread-safe.
3031
431ed302
AM
30322013-01-15 Alan Modra <amodra@gmail.com>
3033
3034 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3035 * testsuite/Makefile.in: Regenerate.
3036
0ec6429b
AM
30372013-01-14 Alan Modra <amodra@gmail.com>
3038
3039 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3040 * testsuite/Makefile.in: Regenerate.
3041
0bf402d5
ILT
30422013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3043
36af3926 3044 PR bfd/14430
0bf402d5
ILT
3045 Fix mingw gold build with plugins enabled
3046 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3047 * configure.ac: Export DLOPEN_LIBS and add headers check.
3048 * plugin.cc: Handle non-dlfcn case.
3049 * Makefile.in: Regenerate.
3050 * config.in: Regenerate.
3051 * configure: Regenerate.
3052 * testsuite/Makefile.in: Regenerate.
3053
9e9143bc
ST
30542013-01-09 Sriraman Tallam <tmsriram@google.com>
3055
3056 * output.h (sort_attached_input_sections): Change to be public.
3057 * script-sections.cc
3058 (Output_section_definition::set_section_addresses): Sort
3059 attached input sections according to section order before linker
3060 script assigns section addresses.
3061 (Orphan_output_section::set_section_addresses): Sort
3062 attached input sections according to section order before linker
3063 script assigns section addresses.
3064 * Makefile.am (final_layout.sh): Use a simple linker script to
3065 check if section ordering still works.
3066 * Makefile.in: Regenerate.
3067
679af368
ILT
30682013-01-09 Ben Cheng <bccheng@google.com>
3069
3070 * arm.cc (Target_arm::attributes_accept_div): New function.
3071 (Target_arm::attributes_forbid_div): New function.
3072 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3073 attribute using the same new functions as what bfd/elf32_arm.c
3074 does.
3075
3136a00e
CC
30762013-01-07 Cary Coutant <ccoutant@google.com>
3077
3078 PR gold/14993
3079 * output.cc (Output_section::add_input_section): For incremental
3080 updates, don't track input sections that are allocated from patch
3081 space.
3082
f2a6224b
L
30832013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3084 Ian Lance Taylor <iant@google.com>
3085
3086 PR gold/14897
3087 * configure.ac (--enable-ld): Removed.
3088 (install_as_default): Set to yes only for --enable-gold=default
3089 or --disable-ld.
3090 * configure: Regenerated.
3091
4f46f626
L
30922013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3093
3094 * options.h (General_options): Add -fuse-ld= for GCC linker
3095 option compatibility.
3096
26e4ef59
CC
30972013-01-04 Cary Coutant <ccoutant@google.com>
3098
3099 * configure.ac: Fix typo restoring CXXFLAGS.
3100 * configure: Regenerate.
3101
3d587466
CC
31022013-01-04 Cary Coutant <ccoutant@google.com>
3103
4f46f626
L
3104 * testsuite/Makefile.am (CXXLINK_S): New macro.
3105 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3106 * testsuite/Makefile.in: Regenerate.
3d587466 3107
44db6695
L
31082013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3109
3110 * version.cc (print_version): Update copyright year to 2013.
3111
edcac0c1
ILT
31122012-12-20 Ian Lance Taylor <iant@google.com>
3113
3114 * layout.cc (Layout::special_ordering_of_input_section): New
3115 function.
3116 (Layout::layout): If input section requires special ordering, must
3117 sort input sections.
3118 (Layout::make_output_section): May sort .text input sections.
3119 (Layout::is_section_name_prefix_grouped): Remove.
3120 * layout.h (class Layout): Declare
3121 special_ordering_of_input_section. Don't declare
3122 is_section_name_prefix_grouped.
3123 * output.cc (Output_section::add_input_section): Revert last
3124 change.
3125 (Output_section::Input_section_sort::match_file_name): Don't crash
3126 if called on output section data.
3127 (Output_section::Input_section_sort_compare): Sort based on
3128 special ordering.
3129 (Output_section::Input_section_sort_section_order_index_compare):
3130 Revert last patch.
3131 (Output_section::sort_attached_input_sections): Likewise.
3132
28f2a4ac
ST
31332012-12-18 Sriraman Tallam <tmsriram@google.com>
3134
edcac0c1 3135 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3136 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3137 * output.cc (Output_section::add_input_section): Check if section
3138 name contains special prefix. Keep input sections to sort such
3139 sections.
3140 (Output_section::Input_section_sort_section_order_index_compare
3141 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3142 (Output_section::sort_attached_input_sections): Add condition to
3143 Input_section_entry constructor call.
28f2a4ac
ST
3144 * testsuite/Makefile.am (text_section_grouping): New test.
3145 * testsuite/Makefile.in: Regenerate.
3146 * testsuite/text_section_grouping.cc: New file.
3147 * testsuite/text_section_grouping.sh: New file.
3148
5bf135a7
NC
31492012-12-17 Nick Clifton <nickc@redhat.com>
3150
3151 * Makefile.am: Add copyright notice.
3152 * NEWS: Likewise.
3153 * README: Likewise.
3154 * configure.ac: Likewise.
3155 * ftruncate.c: Likewise.
3156 * Makefile.in: Regenerate.
3157
59965708
CC
31582012-12-14 Cary Coutant <ccoutant@google.com>
3159
a4034750
AM
3160 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3161 --no-as-needed flag.
3162 (exception_separate_shared_12_test): Likewise.
3163 (incremental_copy_test): Likewise.
3164 * testsuite/Makefile.in: Regenerate.
59965708 3165
2a77e2ab
CC
31662012-12-14 Cary Coutant <ccoutant@google.com>
3167
3168 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3169 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3170
e3deeb9c
AM
31712012-12-12 Alan Modra <amodra@gmail.com>
3172
3173 * powerpc.cc (class Track_tls): New.
3174 (class Relocate, class Scan): Inherit Track_tls.
3175 (Target_powerpc::Scan::local, global): Track tls optimization
3176 and avoid creating plt entry for __tls_get_addr if all uses
3177 are optimized away.
3178 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3179
d8f5a274
AM
31802012-12-12 Alan Modra <amodra@gmail.com>
3181
3182 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3183 Replace no_toc_optimize with toc_optimize.
3184 * output.h (Output_section::input_sections): Provide non-const variant.
3185 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3186 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3187 accessors.
3188 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3189 (class Sort_toc_sections): New.
3190 (Target_powerpc::do_finalize_sections): Sort toc sections.
3191 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3192
4c8a1de1
RM
31932012-12-10 Roland McGrath <mcgrathr@google.com>
3194
3195 * testsuite/binary_unittest.cc (read_all): New function.
3196 (Sized_binary_test): Use it instead of ::read.
3197 * fileread.cc (do_read): Don't assume pread always reads the whole
3198 amount in a single call.
3199
edc27beb
AM
32002012-12-10 Alan Modra <amodra@gmail.com>
3201
3202 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3203 Set EM_PPC64 or EM_PPC here.
3204 (Target_selector_powerpc::do_recognize): Delete.
3205
906b9150
AM
32062012-12-10 Alan Modra <amodra@gmail.com>
3207
3208 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3209 stub_table_.
3210 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3211
418c15ae
RM
32122012-12-07 Roland McGrath <mcgrathr@google.com>
3213
3214 * testsuite/binary_unittest.cc (Sized_binary_test):
3215 Use open_descriptor rather than ::open.
3216
decdd3bc
AM
32172012-12-07 Alan Modra <amodra@gmail.com>
3218
3219 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3220 typedef and invalid_address constant.
3221 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3222 instantiate constants.
3223
db399005
ILT
32242012-12-06 Roland McGrath <mcgrathr@google.com>
3225
3226 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3227 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3228 * aclocal.m4: Regenerate.
3229 * configure: Regenerate.
3230 * Makefile.in: Regenerate.
3231 * testsuite/Makefile.in: Regenerate.
3232
aba6bc71
AM
32332012-12-07 Alan Modra <amodra@gmail.com>
3234
3235 * options.h (General_options): Add no_toc_optimize.
3236 * powerpc.cc (ok_lo_toc_insn): New function.
3237 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3238
9e69ed50
AM
32392012-12-06 Alan Modra <amodra@gmail.com>
3240
3241 * options.h (General_options): Add plt_align, plt_static_chain,
3242 plt_thread_safe. Update stub_group_size help text.
3243 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3244 for new plt_thread_safe_ var.
3245 (use_plt_offset): Correct comments.
3246 (Target_powerpc::do_relax): Look for thread creation symbols to
3247 determine default plt_thread_safe value. Clear plt call stubs
3248 as well as branch stubs each iteration.
3249 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3250 insn constants.
3251 (l, hi, ha, write_insn): Move earlier.
3252 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3253 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3254 plt stubs too.
3255 (Stub_table::update_size): Adjust.
3256 (Stub_table::prev_size, set_prev_size): Delete.
3257 (Stub_table::stub_align): Let --plt-align affect result.
3258 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3259 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3260 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3261 (Stub_table::do_write): Support more stub variants.
3262
f43ba157
AM
32632012-12-04 Alan Modra <amodra@gmail.com>
3264
3265 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3266 (Target_powerpc::do_define_standard_symbols): New function.
3267
34171bc5
AM
32682012-12-03 Alan Modra <amodra@gmail.com>
3269
3270 * output.h: Formatting, whitespace.
3271
dc9589e9 32722012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3273
3274 * layout.h (Layout::get_executable_sections): Declare.
3275 * layout.cc (Layout::get_executable_sections): New function.
3276 * arm.cc (Target_arm::group_sections): Use it.
3277 (Arm_output_section::group_sections): Delete now redundant test.
3278 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3279 param to handle relative relocs.
3280 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3281 (Output_data_reloc::add_absolute): Adjust.
3282 (Output_data_reloc::add_relative): New function.
3283 (Output_data::reset_data_size): New function.
3284 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3285 (Output_section::set_addralign): New function.
3286 (Output_section::checkpoint_set_addralign): New function.
3287 (Output_section::clear_section_offsets_need_adjustment): New function.
3288 (Output_section::input_sections): Make public.
3289 * powerpc.cc (class Output_data_brlt_powerpc): New.
3290 (class Stub_table, class Stub_control): New.
3291 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3292 stub_table_, set_stub_table, stub_table): New vectors and accessor
3293 functions.
3294 (Target_powerpc::do_may_relax, do_relax, push_branch,
3295 new_stub_table, stub_tables, brlt_section, group_sections,
3296 add_branch_lookup_table, find_branch_lookup_table,
3297 write_branch_lookup_table, make_brlt_section): New functions.
3298 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3299 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3300 branch_info_): New vars.
3301 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3302 make call stubs here.
3303 (Output_data_glink): Remove all call stub handling from this class.
3304 (Target_powerpc::Scan::local, global): Save interesting branch
3305 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3306 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3307 functions on final link.
3308 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3309 Handle long branch destinations too.
3310 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3311 do_plt_address_for_local): Adjust lookup of plt call stubs.
3312
627b30b7
AM
33132012-11-30 Alan Modra <amodra@gmail.com>
3314
3315 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3316 relocs against protected symbols when building 32-bit shared libs.
3317
40b469d7
AM
33182012-11-30 Alan Modra <amodra@gmail.com>
3319
3320 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3321 param. Call got_section() to make .got. Update all callers
3322 and their callers and so on.
3323
bb66a627
AM
33242012-11-30 Alan Modra <amodra@gmail.com>
3325
3326 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3327 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3328 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3329 value if it already exists.
3330
d2cf1c6c
L
33312012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3332
3333 PR gold/14858
3334 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3335
edccdf7c
RM
33362012-11-14 Roland McGrath <mcgrathr@google.com>
3337
3338 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3339 than bfc instruction for data sandboxing.
3340
6febeb74
AM
33412012-11-08 Alan Modra <amodra@gmail.com>
3342
3343 * po/POTFILES.in: Regenerate.
3344
0a6f1bf2
AM
33452012-11-05 Alan Modra <amodra@gmail.com>
3346
3347 * configure.ac: Apply 2012-09-10 change to config.in here.
3348 * configure: Regenerate.
3349
26a4e9cb
AM
33502012-11-05 Alan Modra <amodra@gmail.com>
3351
3352 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3353 (struct Opd_ent): Use "Address" rather than "Offset".
3354 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3355 (Target_powerpc::got_section): Make public.
3356 (Target_powerpc::scan_relocs): Move code setting symbols..
3357 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3358 Create _SDA_BASE_ only when referenced.
3359
cc928013
RM
33602012-11-02 Roland McGrath <mcgrathr@google.com>
3361
3362 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3363 from last change.
3364
50ed5eb1
RM
33652012-11-01 Roland McGrath <mcgrathr@google.com>
3366
62fe925a
RM
3367 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3368 for offset_in_output_section parameter.
3369 (Sized_target::relocate_special_relocatable): Likewise.
3370 * arm.cc (Target_arm::relocate_relocs): Likewise.
3371 (Target_arm::relocate_special_relocatable): Likewise.
3372 * i386.cc (Target_i386::relocate_relocs): Likewise.
3373 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3374 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3375 * target-reloc.h (relocate_relocs): Likewise.
3376 * testsuite/testfile.cc (Target_test): Likewise.
3377 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3378 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3379
3380 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3381 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3382
3383 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3384 parameter, which is unused in the [!F_SETFD] case.
3385
50ed5eb1
RM
3386 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3387 SYMNDX to off_t before comparing it to this->data_size().
3388 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3389 * incremental.cc (Output_section_incremental_inputs::do_write):
3390 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3391
2cadc0bf
RM
3392 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3393
3bfcb652
NC
33942012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3395
3396 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3397 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3398 in EABI_VER5.
3399
c1a8d56e
CC
34002012-10-29 Cary Coutant <ccoutant@google.com>
3401
3402 * dwp.cc (usage): Add file and exit status parameters;
3403 add --help and --version options.
3404 (print_version): New function.
3405 (main): Add --help and --version options.
3406
b2490a7b
L
34072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3408
3409 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3410 final_layout_sequence.txt.
3411 * testsuite/Makefile.in: Regenerated.
3412
aa543512
L
34132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3414
3415 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3416 COMPILE generated by automake.
3417 (LINK1): Likewise.
3418 (CXXCOMPILE1): Likewise.
3419 (CXXLINK1): Likewise.
3420 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3421 (LINK): Likewise.
3422 (CXXCOMPILE): Likewise.
3423 (CXXLINK): Likewise.
3424 * testsuite/Makefile.in: Regenerated.
3425
d361fafb
L
34262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3427
3428 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3429 on bad fwrite return.
3430
598c7410
L
34312012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3432
3433 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3434 on val.
3435
35c813e2
CC
34362012-10-23 Cary Coutant <ccoutant@google.com>
3437
3438 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3439 * testsuite/Makefile.in: Regenerate.
3440 * testsuite/dwp_test.h: New source file.
3441 * testsuite/dwp_test_1.cc: New source file.
3442 * testsuite/dwp_test_1.s: New source file.
3443 * testsuite/dwp_test_1.sh: New source file.
3444 * testsuite/dwp_test_1b.cc: New source file.
3445 * testsuite/dwp_test_1b.s: New source file.
3446 * testsuite/dwp_test_2.cc: New source file.
3447 * testsuite/dwp_test_2.s: New source file.
3448 * testsuite/dwp_test_2.sh: New source file.
3449 * testsuite/dwp_test_main.cc: New source file.
3450 * testsuite/dwp_test_main.s: New source file.
3451
77429909
CC
34522012-10-23 Cary Coutant <ccoutant@google.com>
3453
3454 * dwp.h: New header file.
3455 * dwp.cc: New source file.
3456 * gold.h: Move shared declarations to system.h.
3457 * system.h: New header file.
3458 * Makefile.am: Add dwp.
3459 * Makefile.in: Regenerate.
3460
ed5d6712
CC
34612012-10-23 Cary Coutant <ccoutant@google.com>
3462
3463 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3464 Dwarf_info_reader::read_from_pointer.
3465 (Dwarf_pubnames_table::read_header): Likewise.
3466 (Dwarf_pubnames_table::next_name): Likewise.
3467 (Dwarf_die::read_attributes): Likewise.
3468 (Dwarf_die::skip_attributes): Likewise.
3469 (Dwarf_info_reader::read_from_pointer): New function template.
3470 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3471 (Dwarf_pubnames_table): Likewise.
3472 (Dwarf_info_reader::read_from_pointer): New function template.
3473 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3474 Dwarf_pubnames_table ctor.
3475
8787852d
CC
34762012-10-23 Cary Coutant <ccoutant@google.com>
3477
3478 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3479 abbrev_shndx.
3480 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3481 abbrev_shndx_.
3482 (Dwarf_info_reader::set_abbrev_shndx): New method.
3483 (Dwarf_info_reader::abbrev_shndx_): New data member.
3484
9fc236f3
CC
34852012-10-23 Cary Coutant <ccoutant@google.com>
3486
3487 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3488 from object, not parameters.
3489 (Dwarf_info_reader::parse): Likewise.
3490 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3491 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3492 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3493 methods.
3494
effe8365
CC
34952012-10-23 Cary Coutant <ccoutant@google.com>
3496
3497 * fileread.cc (Input_file::Input_file): New constructor.
3498 * fileread.h (class Input_file): Add new constructor.
3499
1698990d
AM
35002012-10-18 Alan Modra <amodra@gmail.com>
3501
3502 PR gold/14727
3503 * object.cc (Relobj::is_section_name_included): Also match
3504 .sdata personality section.
3505
168a4726
AM
35062012-10-18 Alan Modra <amodra@gmail.com>
3507
3508 * target-reloc.h (class Default_comdat_behavior): New, package up..
3509 (get_comdat_behaviour): ..this.
3510 (relocate_section): Add Relocate_comdat_behavior template arg,
3511 adjust code to suit.
3512 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3513 (Target_arm::scan_reloc_section): Likewise.
3514 * i386.cc (Target_i386::relocate_section): Likewise.
3515 * sparc.cc (Target_sparc::relocate_section): Likewise.
3516 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3517 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3518 * powerpc.cc (class Relocate_comdat_behavior): New.
3519 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3520 gold::relocate_section with new template arg.
3521
acc276d8
AM
35222012-10-18 Alan Modra <amodra@gmail.com>
3523
3524 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3525 dynamic relocs for GOT_TPREL got entries, without symbol if
3526 resolving locally.
3527 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3528 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3529 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3530
e10f9870
AM
35312012-10-17 Alan Modra <amodra@gmail.com>
3532
3533 PR gold/14726
3534 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3535
ae034989
ST
35362012-10-16 Sriraman Tallam <tmsriram@google.com>
3537
3538 * layout.cc (Layout::include_section): Keep sections marked
3539 SHF_EXCLUDE when doing relocatable links.
3540
f3a0ed29
AM
35412012-10-16 Alan Modra <amodra@gmail.com>
3542
3543 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3544 (Target_powerpc::do_finalize_sections): Call it.
3545 (Output_data_save_res): New class and supporting functions.
3546 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3547 normal symbols defined in object files.
3548
c6de8ed4
AM
35492012-10-12 Alan Modra <amodra@gmail.com>
3550
3551 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3552 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3553 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3554 section if scan_opd_relocs not yet called.
3555 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3556
03e25981
AM
35572012-10-12 Alan Modra <amodra@gmail.com>
3558
3559 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3560 add_local_ifunc_entry): Revert last change.
3561 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3562
c9824451
AM
35632012-10-05 Alan Modra <amodra@gmail.com>
3564
3565 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3566 do_plt_address_for_global): New functions.
3567 (Output_data_got_powerpc::do_write): Don't segfault when linking
3568 statically.
3569 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3570 add_local_ifunc_entry): Return true on adding entry..
3571 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3572 glink->add_entry call. Remove unused symtab param. Adjust calls.
3573 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3574 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3575 set up symbols here.
3576 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3577 syms here. Do so even when no .iplt. Don't segfault when linking
3578 statically.
3579 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3580 new variants without reloc param.
3581 (Glink_sym_ent::Glink_sym_ent): Likewise.
3582 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3583 reloc when refs will resolve to plt call stub.
3584 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3585 R_PPC_PLTREL24 to resolve locally.
3586 (Target_powerpc::Scan::global): Correct ifunc handling.
3587 (Target_powerpc::Relocate::relocate): Correct local sym glink
3588 lookup. Don't destroy "value" when we have a plt call stub,
3589 and when checking plt call validity.
3590 (Target_powerpc::do_dynsym_value): Simplify.
3591
19fec8c1
AM
35922012-10-05 Alan Modra <amodra@gmail.com>
3593
3594 * i386.cc (Output_data_plt_i386::address_for_global,
3595 address_for_local): Add plt offset to returned value. Adjust uses.
3596 * sparc.cc (Output_data_plt_sparc::address_for_global,
3597 address_for_local): Likewise.
3598 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3599 address_for_local): Likewise.
3600 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3601 address_for_local): Likewise.
3602 * target.h (Target::plt_address_for_global, plt_address_for_local):
3603 Update comment.
3604 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3605 (Output_data_got::Got_entry::write): Nor here.
3606 * output.h: Comment fix.
3607
e867b647
WL
36082012-10-02 Jiong Wang <jiwang@tilera.com>
3609
3610 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3611 global_offset_table_ value for larget got.
3612 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3613
e5d5f5ed
AM
36142012-09-29 Alan Modra <amodra@gmail.com>
3615
3616 * powerpc.cc (Target_powerpc::iplt_): New output section.
3617 (Target_powerpc::iplt_section, make_iplt_section,
3618 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3619 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3620 Target_powerpc::plt_entry_count): Count iplt entries too.
3621 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3622 reloc section in constructor. New params.
3623 (Target_powerpc::make_plt_section): Create reloc section here instead.
3624 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3625 functions.
3626 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3627 (Output_data_glink::add_entry, find_entry): New functions to
3628 deal with local syms.
3629 (Glink_sym_ent): Add support for local syms.
3630 (Output_data_glink::do_write): Handle ifunc plt entries.
3631 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3632 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3633 (Target_powerpc::Relocate::relocate): Likewise.
3634 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3635
ec4dbad3
AM
36362012-09-25 Alan Modra <amodra@gmail.com>
3637
3638 * object.h (Sized_relobj_file::adjust_local_symbol,
3639 do_adjust_local_symbol): New functions.
3640 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3641 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3642 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3643 and irregular opd entry spacing.
3644 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3645 (Global_symbol_visitor_opd): New functor.
3646 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3647 on deleted opd entries.
3648
5c0b3823
WL
36492012-09-15 Jiong Wang <jiwang@tilera.com>
3650
3651 * tilegx.cc: New file.
3652 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3653 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3654 * configure.tgt: Add entries for tilegx*.
3655 * configure.ac: Likewise.
3656 * Makefile.in: Rebuild.
3657 * configure: Likewise.
3658 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3659 tilegx.
3660
bfdfa4cd
AM
36612012-09-13 Alan Modra <amodra@gmail.com>
3662
3663 * target-reloc.h (scan_relocs): Call scan.local for relocs
3664 against symbols in discarded sections. Pass is_discarded
3665 param.
3666 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3667 Add is_discarded param.
3668 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3669 is_discarded to flag opd entry as discarded. Don't emit dyn
3670 relocs on such entries.
3671 (Target_powerpc::Scan::global): Similarly detect and handle
3672 such opd entries.
3673 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3674 opd_ent_. Update all uses.
3675 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3676 (Target_powerpc::relocate_section): Zero out discarded opd
3677 entry relocs.
3678
d77a0555
ILT
36792012-09-12 Ian Lance Taylor <iant@google.com>
3680
3681 PR gold/14570
3682 * output.cc: Rename Output_data_got template parameter from size
3683 to got_size for all functions. Compile all variants of
3684 Output_data_got.
3685 (Output_data_got::Got_entry::write): Correct use of size for
3686 symbol value. Use local_is_tls rather than casting to
3687 Sized_relobj_file.
3688 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3689 (class Sized_relobj_file): Add do_local_is_tls.
3690 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3691
815a1205
AM
36922012-09-11 Alan Modra <amodra@gmail.com>
3693
3694 PR gold/14566
3695 * layout.cc (Layout::set_segment_offsets): When using
3696 common-page-size alignment, ensure we are on a new max-page-size
3697 page.
3698 * output.cc (Output_segment::set_section_addresses): Use
3699 abi_pagesize, not common_pagesize for relro boundary.
3700 (Output_segment::set_offset): Likewise.
3701
bd73a62d
AM
37022012-09-11 Alan Modra <amodra@gmail.com>
3703
3704 * output.h (Output_data_got::add_global_tls, add_local_tls,
3705 add_local_tls_pair): New functions.
3706 (Output_data_got::add_local_pair_with_rel): Remove second
3707 reloc param. Expand comment.
3708 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3709 use_plt_or_tls_offset_, similarly for constructor param.
3710 (Output_data_got::Got_entry::write): Add got_index param.
3711 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3712 add_local_tls_pair): New functions.
3713 (Output_data_got::Got_entry::write): Handle tls symbols
3714 with use_plt_or_tls_offset_ set specially.
3715 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3716 (Output_data_got::do_write): Replace iterator with index, pass
3717 index to entry write function.
3718 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3719 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3720 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3721 call.
3722 * i386.cc (Target_i386::Scan::local): Likewise.
3723 * sparc.cc (Target_sparc::Scan::local): Likewise.
3724 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3725 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3726 do_tls_offset_for_global): New functions.
3727 (Target_powerpc::Scan::local): Correct TLS relocations and got
3728 entry values.
3729 (Target_powerpc::Scan::global): Don't emit unnecessary
3730 dynamic relocations on TLS GOT entries.
3731
00716ab1
AM
37322012-09-10 Matthias Klose <doko@ubuntu.com>
3733
3734 * config.in: Disable sanity check for kfreebsd.
3735
c891b3f9
SA
37362012-09-10 Sterling Augustine <saugustine@google.com>
3737
3738 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3739 (Gdb_index::pubtypes_read): New parameter.
3740 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3741 to calls.
3742 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3743 pubtypes_object_.
3744
e81fea4d
AM
37452012-09-09 Alan Modra <amodra@gmail.com>
3746
3747 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3748 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3749 * gc.h (gc_process_relocs): Call target gc_add_reference.
3750 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3751 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3752 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3753 unnecessary cast.
3754 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3755 to cater for when we don't need code offset. Update use.
3756 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3757 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3758 set_opd_valid): New functions.
3759 (Target_powerpc::do_gc_add_reference): New function.
3760 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3761 stashed refs.
3762 (Target_powerpc::do_gc_mark_symbol): New function.
3763
d2d60eef
CC
37642012-09-06 Cary Coutant <ccoutant@google.com>
3765
3766 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3767 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3768 (Dwarf_die::skip_attributes): Likewise.
3769 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3770 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3771 (main): Call it.
3772 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3773
32ed4573
L
37742012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3775
3776 * testsuite/script_test_3.t: Add .got.plt output section
3777 statement.
3778 * testsuite/script_test_4.t: Likewise.
3779
f4baf0d4
AM
37802012-09-05 Alan Modra <amodra@gmail.com>
3781
3782 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3783 update all uses and lose "enum" when using type.
3784
864a1b56
AM
37852012-09-05 Alan Modra <amodra@gmail.com>
3786
3787 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3788 * configure: Regenerate.
3789 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3790 (plugin_final_layout.stdout): Likewise.
3791 (memory_test): Set page sizes to 0x1000.
3792 * testsuite/Makefile.in: Regenerate.
3793 * testsuite/discard_locals_test.sh: Add FIXME comment.
3794 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3795 * testsuite/pr14265.t: Add .got output section statement.
3796 * testsuite/script_test_2.t: Likewise.
3797 * testsuite/script_test_3.t: Likewise.
3798 * testsuite/script_test_4.t: Likewise.
3799 * testsuite/script_test_5.t: Likewise.
3800 * testsuite/script_test_6.t: Likewise.
3801 * testsuite/script_test_7.t: Likewise.
3802 * testsuite/script_test_9.t: Likewise.
3803
3ea0a085
AM
38042012-09-05 Alan Modra <amodra@gmail.com>
3805
3806 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3807 (Powerpc_relocate_functions::Status): New typedef.
3808 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3809 (Target_powerpc::Scan::local): Handle REL64.
3810 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3811 for REL32 and REL64.
3812 (Target_powerpc::symval_for_branch): New function, extracted from..
3813 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3814 checks. Report overflow errors.
3815
7404fe1b
AM
38162012-09-05 Alan Modra <amodra@gmail.com>
3817
3818 * object.h (Sized_relobj_file::emit_relocs): Delete.
3819 (Sized_relobj_file::emit_relocs_reltype): Delete.
3820 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3821 relocate_relocs for --emit-relocs.
3822 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3823 * output.h: Update comment.
3824 (Output_segment::first_section): New function.
3825 (Output_segment::first_section_load_address): Use first_section.
3826 * output.cc (Output_segment::first_section): New function extracted..
3827 (Output_segment::first_section_load_address): ..from here. Delete.
3828 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3829 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3830 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3831 adjust call to target.h function.
3832 * i386.cc (Target_i386): Likewise.
3833 * sparc.cc (Target_sparc): Likewise.
3834 * x86_64.cc (Target_x86_64): Likewise.
3835 * powerpc.cc (Target_powerpc): Likewise.
3836 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3837 first tls section has section symbol for optimised local dynamic
3838 output relocs.
3839 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3840 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3841 optimised tls code.
3842 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3843 Rename to relocate_relocs. Update error message.
3844
957564c9
AS
38452012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3846
3847 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3848 --just-symbols.
3849
dd93cd0a
AM
38502012-08-31 Alan Modra <amodra@gmail.com>
3851
3852 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3853 (Powerpc_relobj::toc_base_offset): New stub function.
3854 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3855 got_mod_index_offset to tlsld_got_offset. Update all refs.
3856 (Target_powerpc::Relocate::enum skip_tls): New.
3857 (Target_powerpc::call_tls_get_addr_): New var.
3858 (Target_powerpc::is_branch_reloc): Move to file scope.
3859 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3860 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3861 New functions.
3862 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3863 (powerpc_info): Correct common_pagesize for ppc64.
3864 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3865 (Powerpc_relocate_functions): Add overflow check enums and functions.
3866 Add non-shift version of rela, rela_ua. Delete all rel public
3867 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3868 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3869 addr16_ha3, addr14 functions.
3870 (Output_data_got_powerpc::add_constant_pair): New function.
3871 (Output_data_got_powerpc::got_base_offset): Likewise.
3872 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3873 (instruction constants): Sort, add some more.
3874 (Output_data_glink::do_write): Add and use Address typedef. Use
3875 object->toc_base_offset() stub for 64-bit.
3876 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3877 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3878 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3879 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3880 Always treat .opd relocs as against locally defined symbol.
3881 Correct condition for RELATIVE relocs.
3882 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3883 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3884 for 32-bit syms with a plt entry. Correct ppc64 toc base
3885 calculations. Handle TLS relocs, and more. Add overflow
3886 checking and adjust for Powerpc_relocate_functions changes.
3887 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3888 Reinstate --emit-relocs code with FIXME.
3889
a1373b60
AM
38902012-08-30 Alan Modra <amodra@gmail.com>
3891
3892 * layout.cc (Layout::set_segment_offsets): Set p_align to
3893 abi_pagesize, not common_pagesize.
3894 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3895 to determine whether file header can go in segment.
3896
703d02da
AM
38972012-08-30 Alan Modra <amodra@gmail.com>
3898
3899 * output.h (Output_reloc::Output_reloc <output section>): Add
3900 is_relative param. Adjust calls.
3901 (Output_reloc::add_output_section_relative): New functions.
3902 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3903 is_relative.
3904 (Output_reloc::symbol_value): Handle SECTION_CODE.
3905
16164a6b
ST
39062012-08-24 Sriraman Tallam <tmsriram@google.com>
3907
3908 * gold.cc (queue_middle_tasks): Call layout again when unique
3909 segments for sections is desired.
3910 * layout.cc (Layout::Layout): Initialize new members.
3911 (Layout::get_output_section_flags): New function.
3912 (Layout::choose_output_section): Call get_output_section_flags.
3913 (Layout::layout): Make output section for mapping to a unique segment.
3914 (Layout::insert_section_segment_map): New function.
3915 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3916 output sections marked so.
16164a6b
ST
3917 (Layout::segment_precedes): Check for unique segments when sorting.
3918 * layout.h (Layout::Unique_segment_info): New struct.
3919 (Layout::Section_segment_map): New typedef.
3920 (Layout::insert_section_segment_map): New function.
3921 (Layout::get_output_section_flags): New function.
3922 (Layout::is_unique_segment_for_sections_specified): New function.
3923 (Layout::set_unique_segment_for_sections_specified): New function.
3924 (Layout::unique_segment_for_sections_specified_): New member.
3925 (Layout::section_segment_map_): New member.
3926 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3927 Rename is_gc_pass_one to is_pass_one.
3928 Rename is_gc_pass_two to is_pass_two.
3929 Rename is_gc_or_icf to is_two_pass.
3930 Check for which pass based on whether symbols data is present.
3931 Make it two pass when unique segments for sections is desired.
3932 * output.cc (Output_section::Output_section): Initialize new
3933 members.
3934 * output.h (Output_section::is_unique_segment): New function.
3935 (Output_section::set_is_unique_segment): New function.
3936 (Output_section::is_unique_segment_): New member.
3937 (Output_section::extra_segment_flags): New function.
3938 (Output_section::set_extra_segment_flags): New function.
3939 (Output_section::extra_segment_flags_): New member.
3940 (Output_section::segment_alignment): New function.
3941 (Output_section::set_segment_alignment): New function.
3942 (Output_section::segment_alignment_): New member.
3943 (Output_segment::Output_segment): Initialize is_unique_segment_.
3944 (Output_segment::is_unique_segment): New function.
3945 (Output_segment::set_is_unique_segment): New function.
3946 (Output_segment::is_unique_segment_): New member.
3947 * plugin.cc (allow_unique_segment_for_sections): New function.
3948 (unique_segment_for_sections): New function.
3949 (Plugin::load): Add new functions to transfer vector.
3950 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3951 * Makefile.in: Regenerate.
3952 * testsuite/plugin_final_layout.sh: Check if unique segment
3953 functionality works.
3954 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3955 are available.
3956 (allow_unique_segment_for_sections): New global.
3957 (unique_segment_for_sections): New global.
3958 (claim_file_hook): Call allow_unique_segment_for_sections.
3959 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3960
1e2bee4f
CC
39612012-08-22 Cary Coutant <ccoutant@google.com>
3962
3963 * layout.cc (Layout::include_section): Don't assert on GROUP
3964 sections with --emit-relocs.
3965
1d5dfe78
CC
39662012-08-21 Cary Coutant <ccoutant@google.com>
3967
3968 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3969 if --export-dynamic-symbol names an undef symbol.
3970
c9269dff
AM
39712012-08-18 Alan Modra <amodra@gmail.com>
3972
3973 * powerpc.cc: Formatting and white space.
3974 (Powerpc_relobj): Rename got2_section_ to special_.
3975 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3976 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3977 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3978 (Target_powerpc): Add Address typedef and invalid_address. Use
3979 throughout.
3980 (Target_powerpc::is_branch_reloc): New function.
3981 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3982 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3983 for dst_mask, value and addend.
3984 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3985 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3986 (Output_data_glink::do_write): Correct toc base. Don't try to use
3987 uint16_t for 24-bit offset. Use get_output_section_offset and
3988 check return.
3989 (Target_powerpc::Scan::local): Handle more relocs.
3990 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3991 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3992 Plug in toc restoring insn after plt calls. Translate branches
3993 to function descriptor symbols to corresponding entry point.
3994 (Target_powerpc::relocate_for_relocatable): Check return from
3995 get_output_section_offset.
3996 * symtab.h: Comment typo.
3997
b1759dce
ILT
39982012-08-14 Ian Lance Taylor <iant@google.com>
3999
4000 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4001 unsupported_relocal_local to call unsupported_reloc_global.
4002
b9b2ae8b
NC
40032012-08-14 Nick Clifton <nickc@redhat.com>
4004
4005 PR ld/14265
4006 * script-sections.cc (Sections_element::output_section_name): Add
4007 keep return parameter.
4008 (Output_section_element::match_name): Add keep return parameter.
4009 Return the value of the keep_ member.
4010 * script-sections.h (class Output_section): Update
4011 output_section_name prototype.
4012 * layout.cc (Layout::keep_input_section): New public member
4013 function.
4014 (Layout::choose_output_section): Pass keep parameter to
4015 output_section_name.
4016 * layout.h (class Layout): Add keep_input_section.
4017 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4018 sections.
4019 * testsuite/Makefile.am: Add a test.
4020 * testsuite/Makefile.in: Regenerate.
4021 * testsuite/pr14265.c: Source file for the test.
4022 * testsuite/pr14265.t: Linker script for the test.
4023 * testsuite/pr14265.sh: Shell script for the test.
4024
921b5322
AM
40252012-08-14 Alan Modra <amodra@gmail.com>
4026
4027 * target.h (Target::output_section_name): New function.
4028 (Target::do_output_section_name): New function.
4029 * layout.cc (Layout::choose_output_section): Call the above.
4030 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4031
6ce78956
AM
40322012-08-14 Alan Modra <amodra@gmail.com>
4033
4034 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4035 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4036 for replace_constant call.
4037 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4038 (Output_data_glink::do_print_to_mapfile): New function.
4039 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4040 (Target_powerpc::Relocate::relocate): Likewise.
4041
d1a8cabd
AM
40422012-08-14 Alan Modra <amodra@gmail.com>
4043
4044 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4045 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4046 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4047 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4048 all references to shndx_. Handle special case for R_PPC_PLTREL24
4049 here.
4050 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4051 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4052 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4053 here.
4054 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4055 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4056
d83ce4e3
AM
40572012-08-12 Alan Modra <amodra@gmail.com>
4058
4059 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4060 (glink insn constants): Use uint32_t.
4061 (Output_data_glink::add_entry): Use insert, not [] operator.
4062
cf43a2fe
AM
40632012-08-11 Alan Modra <amodra@gmail.com>
4064
4065 * object.h (Sized_relobj_file::find_shdr): New function.
4066 (Sized_relobj_file::find_special_sections): New function.
4067 * object.cc (Sized_relobj_file::find_shdr): New function.
4068 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4069 (Sized_relobj_file::find_special_sections): New function, split out..
4070 (Sized_relobj_file::do_read_symbols): ..from here.
4071 * output.h (Output_data_got::replace_constant): New function.
4072 (Output_data_got::num_entries): New function.
4073 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4074 (Output_data_got::got_offset): Protected rather than private.
4075 (Output_data_got::replace_got_entry): New function.
4076 * output.cc (Output_data_got::replace_got_entry): New function.
4077 * powerpc.cc (class Powerpc_relobj): New.
4078 (class Powerpc_relocate_functions): Delete all psymval variants or
4079 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4080 Implement _ha functions using corresponding _hi function.
4081 (Powerpc_relobj::find_special_sections): New function.
4082 (Target_powerpc::do_make_elf_object): New function.
4083 (class Output_data_got_powerpc): New.
4084 (class Output_data_glink): New.
4085 (class Powerpc_scan_relocatable_reloc): New.
4086 Many more changes througout file.
4087
3c892704
NC
40882012-08-09 Nick Clifton <nickc@redhat.com>
4089
4090 * po/vi.po: Updated Vietnamese translation.
4091
82435b3b
ILT
40922012-08-07 Ian Lance Taylor <iant@google.com>
4093
4094 * layout.cc (Layout::add_target_dynamic_tags): If
4095 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4096 plt_rel.
4097
a6dc81d2
NC
40982012-07-30 Nick Clifton <nickc@redhat.com>
4099
4100 * po/gold.pot: Updated template.
4101 * po/es.po: Updated Spanish translation.
4102
f1415016
CC
41032012-07-18 Cary Coutant <ccoutant@google.com>
4104
4105 PR gold/14344
4106 * configure.ac: Add check for -gpubnames support.
4107 * configure: Regenerate.
4108 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4109 support; force -gno-pubnames.
4110 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4111 support.
4112 (gdb_index_test_4): New test.
4113 * testsuite/Makefile.in: Regenerate.
4114 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4115 * testsuite/gdb_index_test_2.sh: Likewise.
4116 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4117 * testsuite/gdb_index_test_4.sh: New script.
4118 * testsuite/gdb_index_test_comm.sh: New script with common code;
4119 don't look for space after colon.
4120
b7fd7c37
ST
41212012-07-16 Sriraman Tallam <tmsriram@google.com>
4122
4123 * gold.cc (queue_middle_tasks): Update function order only after
4124 deferred objects due to plugins are processed.
4125
1f3212db
ILT
41262012-07-11 Ian Lance Taylor <iant@google.com>
4127
4128 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4129 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4130 (Target_arm::scan_reloc_for_stub): Likewise.
4131 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4132 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4133 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4134 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4135 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4136
81c82a68
ILT
41372012-07-10 Dodji Seketeli <dodji@redhat.com>
4138 Ian Lance Taylor <iant@google.com>
4139
4140 PR gold/14309
4141 * configure.ac: Test whether std::tr1::hash<off_t> works.
4142 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4143 needed.
4144 * output.h (class Output_fill): Add virtual destructor.
4145 * configure, config.in: Rebuild.
4146
eabc84f4
RM
41472012-06-22 Roland McGrath <mcgrathr@google.com>
4148
4149 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4150
370e30b6
RÁE
41512012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4152
4153 * plugin.cc (Plugin::load): Handle position independent executables.
4154
fb1b895d
CC
41552012-06-06 Cary Coutant <ccoutant@google.com>
4156
4157 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4158 add .debug_macro.
4159 (lines_only_debug_sections): Likewise.
4160 (gdb_fast_lookup_sections): New static array.
4161 (is_gdb_debug_section): Rename formal parameter.
4162 (is_lines_only_debug_section): Likewise.
4163 (is_gdb_fast_lookup_section): New function.
4164 (Layout::include_section): Check for ".zdebug_" prefix; pass
4165 section name suffix to is_gdb_debug_section, et al.; check for
4166 fast-lookup sections when building .gdb_index.
4167 * options.h (--strip-debug-gdb): Update GDB version number.
4168
7c0640fa
CC
41692012-06-06 Cary Coutant <ccoutant@google.com>
4170
4171 * configure.ac: Add check for fallocate.
4172 * configure: Regenerate.
4173 * config.in: Regenerate.
4174
4175 * options.h (class General_options): Add --mmap-output-file and
4176 --posix-fallocate options.
4177 * output.cc: (posix_fallocate): Remove; replace with...
4178 (gold_fallocate): New function.
4179 (Output_file::map_no_anonymous): Call gold_fallocate.
4180 (Output_file::map): Check --mmap-output-file option.
4181
2a49eb69
DK
41822012-06-05 Jing Yu <jingyu@google.com>
4183
4184 * gold.h (textdomain): Add do {} to empty while(0).
4185 (bindtextdomain): Likewise.
4186
fad072ac
CC
41872012-06-04 Cary Coutant <ccoutant@google.com>
4188
4189 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4190 has_dynsym_index.
4191
8cc69fb6
ST
41922012-05-25 Sriraman Tallam <tmsriram@google.com>
4193
4194 * symtab.cc (Symbol_table::define_special_symbol):
4195 Initialize *poldsym to prevent uninitialized variable errors.
4196
1be75daa
CC
41972012-05-23 Cary Coutant <ccoutant@google.com>
4198
4199 * layout.cc (Layout::section_name_mapping): Add rules to handle
4200 exact match on .data.rel.ro.local or .data.rel.ro.
4201 (Layout::output_section_name): Check for exact matches.
4202
9b689de0
CC
42032012-05-23 Cary Coutant <ccoutant@google.com>
4204
4205 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4206 more carefully.
4207
b24fdbf5
CC
42082012-05-22 Cary Coutant <ccoutant@google.com>
4209
4210 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4211 object before exporting symbol.
4212
e550e1a2
L
42132012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4214
4215 * testsuite/tls_test.cc: Include "config.h" first.
4216 * testsuite/tls_test_c.c: Likewise.
4217
df7b86aa
NC
42182012-05-17 Daniel Richard G. <skunk@iskunk.org>
4219 Nick Clifton <nickc@redhat.com>
4220
4221 PR 14072
4222 * configure.in: Add check that sysdep.h has been included before
4223 any system header files.
4224 * configure: Regenerate.
4225 * config.in: Regenerate.
4226
1007b503
CC
42272012-05-14 Cary Coutant <ccoutant@google.com>
4228
4229 * layout.cc (Layout::make_output_section): Mark .tdata section
4230 as RELRO.
4231 * testsuite/relro_test.cc: Add a TLS variable.
4232
fd885f3a
L
42332012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4234
4235 PR gold/14091
4236 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4237 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4238 R_X86_64_64.
4239
80f5885c
CC
42402012-05-08 Cary Coutant <ccoutant@google.com>
4241
4242 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4243 (lines_only_debug_sections): Likewise.
4244
2e702c99
RM
42452012-05-02 Roland McGrath <mcgrathr@google.com>
4246
4247 * nacl.cc: New file.
4248 * nacl.h: New file.
4249 * Makefile.am (CCFILES, HFILES): Add them.
4250 * Makefile.in: Regenerate.
4251 * i386.cc (Output_data_plt_i386_nacl): New class.
4252 (Output_data_plt_i386_nacl_exec): New class.
4253 (Output_data_plt_i386_nacl_dyn): New class.
4254 (Target_i386_nacl): New class.
4255 (Target_selector_i386_nacl): New class.
4256 (target_selector_i386): Use it instead of Target_selector_i386.
4257 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4258 (Target_x86_64_nacl): New class.
4259 (Target_selector_x86_64_nacl): New class.
4260 (target_selector_x86_64, target_selector_x32): Use it instead of
4261 Target_selector_x86_64.
4262 * arm.cc (Output_data_plt_arm_nacl): New class.
4263 (Target_arm_nacl): New class.
4264 (Target_selector_arm_nacl): New class.
4265 (target_selector_arm, target_selector_armbe): Use it instead of
4266 Target_selector_arm.
4267
4268 * target-select.cc (select_target): Take new Input_file* and off_t
4269 arguments, pass them on to recognize method of selector.
4270 * object.cc (make_elf_sized_object): Update caller.
4271 * parameters.cc (parameters_force_valid_target): Likewise.
4272 * incremental.cc (make_sized_incremental_binary): Likewise.
4273 * target-select.h: Update decl.
4274 (Target_selector::recognize): Take new Input_file* argument,
4275 pass it on to do_recognize.
4276 (Target_selector::do_recognize): Take new Input_file* argument.
4277 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4278 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4279 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4280 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4281
4282 * target.h (Target::Target_info): New members isolate_execinstr
4283 and rosegment_gap.
4284 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4285 * arm.cc (Target_arm::arm_info): Update initializer.
4286 * i386.cc (Target_i386::i386_info): Likewise.
4287 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4288 * sparc.cc (Target_sparc::sparc_info): Likewise.
4289 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4290 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4291 * layout.cc (Layout::attach_allocated_section_to_segment):
4292 Take new const Target* argument. If target->isolate_execinstr(), act
4293 like --rosegment.
4294 (Layout::find_first_load_seg): Take new const Target* argument;
4295 if target->isolate_execinstr(), reject PF_X segments.
4296 (Layout::relaxation_loop_body): Update caller.
4297 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4298 reset file offset to zero when we hit LOAD_SEG, and then do a second
4299 loop over the segments before LOAD_SEG to reassign offsets after
4300 addresses have been determined. Handle target->rosegment_gap().
4301 (Layout::attach_section_to_segment): Take new const Target* argument;
4302 pass it to attach_allocated_section_to_segment.
4303 (Layout::make_output_section): Update caller.
4304 (Layout::attach_sections_to_segments): Take new const Target* argument;
4305 pass it to attach_section_to_segment.
4306 * gold.cc (queue_middle_tasks): Update caller.
4307 * layout.h (Layout): Update method decls with new arguments.
4308
4309 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4310 Target_info pointer to use.
4311 (Target_arm::do_make_data_plt): New virtual method.
4312 (Target_arm::make_data_plt): New method that calls it.
4313 (Target_arm::make_plt_entry): Use it.
4314 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4315 for the section alignment.
4316 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4317 method.
4318 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4319 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4320 method.
4321 (Output_data_plt_arm::get_plt_entry_size): Call it.
4322 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4323 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4324 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4325 method.
4326 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4327 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4328 method instead of sizeof(plt_entry).
4329 (Output_data_plt_arm::add_entry): Likewise.
4330 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4331 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4332 than static method.
4333 (Target_arm::plt_entry_size): Likewise.
4334 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4335 Move to ...
4336 (Output_data_plt_arm_standard): ... here, new class.
4337 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4338 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4339 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4340
4341 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4342 Take additional argument for the PLT entry size.
4343 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4344 Use get_plt_entry_size method rather than plt_entry_size variable.
4345 (Output_data_plt_x86_64::reserve_slot): Likewise.
4346 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4347 (Output_data_plt_x86_64::add_entry): Likewise.
4348 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4349 (Output_data_plt_x86_64::address_for_global): Likewise.
4350 (Output_data_plt_x86_64::address_for_local): Likewise.
4351 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4352 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4353 Make method non-static.
4354 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4355 method.
4356 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4357 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4358 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4359 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4360 virtual method.
4361 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4362 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4363 virtual method.
4364 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4365 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4366 virtual method.
4367 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4368 (Output_data_plt_x86_64::plt_entry_size)
4369 (Output_data_plt_x86_64::first_plt_entry)
4370 (Output_data_plt_x86_64::plt_entry)
4371 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4372 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4373 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4374 (Output_data_plt_x86_64_standard): ... here, new class.
4375 (Target_x86_64::Target_x86_64): Take optional argument for the
4376 Target_info pointer to use.
4377 (Target_x86_64::do_make_data_plt): New virtual method.
4378 (Target_x86_64::make_data_plt): New method to call it.
4379 (Target_x86_64::init_got_plt_for_update): Use that.
4380 Call this->plt_->add_eh_frame method here.
4381 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4382 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4383 rather than static method.
4384 (Target_x86_64::plt_entry_size): Likewise.
4385 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4386 rather than plt_entry_size variable. Move guts of PLT filling to...
4387 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4388 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4389 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4390
4391 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4392 additional argument for the section alignment.
4393 Don't do add_eh_frame_for_plt here.
4394 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4395 non-static. Use get_plt_entry_size method rather than plt_entry_size
4396 variable.
4397 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4398 method.
4399 (Output_data_plt_i386::get_plt_entry_size): Call it.
4400 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4401 (Output_data_plt_i386::add_eh_frame): New method to call it.
4402 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4403 method.
4404 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4405 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4406 method.
4407 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4408 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4409 method instead of plt_entry_size.
4410 (Output_data_plt_i386::plt_entry_size)
4411 (Output_data_plt_i386::plt_eh_frame_fde_size)
4412 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4413 (Output_data_plt_i386_standard): ... here, new class.
4414 (Output_data_plt_i386_exec): New class.
4415 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4416 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4417 (Output_data_plt_i386::exec_plt_entry): Move to ...
4418 (Output_data_plt_i386_exec::plt_entry): ... here.
4419 (Output_data_plt_i386_dyn): New class.
4420 (Output_data_plt_i386::first_plt_entry): Move to ...
4421 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4422 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4423 (Output_data_plt_i386_dyn::plt_entry): ... here.
4424 (Target_i386::Target_i386): Take optional argument for the Target_info
4425 pointer to use.
4426 (Target_i386::do_make_data_plt): New virtual method.
4427 (Target_i386::make_data_plt): New method to call it.
4428 (Target_i386::make_plt_section): Use that.
4429 Call this->plt_->add_eh_frame method here.
4430 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4431 rather than plt_entry_size variable.
4432 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4433 (Output_data_plt_i386::address_for_local): Likewise.
4434 (Output_data_plt_i386::do_write): Likewise.
4435 Move guts of PLT filling to...
4436 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4437 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4438 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4439 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4440
b9b9f2ee
CC
44412012-05-01 Cary Coutant <ccoutant@google.com>
4442
4443 * dwarf_reader.cc (Dwarf_die::read_attributes)
4444 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4445 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4446 * reduced_debug_output.cc
4447 (Output_reduced_debug_info_section::get_die_end): Remove
4448 DW_FORM_GNU_ref_index. Add default case.
4449
57923f48
MW
44502012-04-26 Mark Wielaard <mjw@redhat.com>
4451
4452 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4453 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4454 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4455 DW_AT_high_pc as offset from DW_AT_low_pc.
4456
4457 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4458 * testsuite/Makefile.in: Regenerate.
4459 * testsuite/gdb_index_test_3.c: New test source file.
4460 * testsuite/gdb_index_test_3.sh: New test source file.
4461
2c54b4f4
ILT
44622012-04-25 Ian Lance Taylor <iant@google.com>
4463
4464 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4465 pointer.
4466 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4467 as a class, not a struct.
4468 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4469 (Target_arm::apply_cortex_a8_workaround): Likewise.
4470 * gc.h: Declare Reloc_types as a struct, not a class.
4471 * object.h: Declare Symbols_data as a struct.
4472 * reloc.h: Declare Read_relocs_data as a struct.
4473 * target.h: Declare Relocate_info as a struct.
4474
a5a5f7a3
DM
44752012-04-24 David S. Miller <davem@davemloft.net>
4476
4477 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4478 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4479 and R_SPARC_WPLT30.
4480
f038d496
CC
44812012-04-24 Cary Coutant <ccoutant@google.com>
4482
4483 * incremental-dump.cc (find_input_containing_global): Replace
4484 magic number with symbolic constant.
4485 (dump_incremental_inputs): Update version number.
4486 * incremental.cc (Output_section_incremental_inputs): Update version
4487 number; import symbolic constants from Incremental_inputs_reader.
4488 (Incremental_inputs::create_data_sections): Align relocations
4489 section correctly for 64-bit targets.
4490 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4491 constants; add padding.
4492 (Output_section_incremental_inputs::write_header): Add assert for
4493 header_size.
4494 (Output_section_incremental_inputs::write_input_files): Add assert
4495 for input_entry_size.
4496 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4497 add assert for object_info_size, input_section_entry_size,
4498 global_sym_entry_size.
4499 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4500 for data structure sizes; use them.
4501 (Incremental_input_entry_reader): Import symbolic constants from
4502 Incremental_inputs_reader; use them.
4503
a4d85145
DM
45042012-04-23 David S. Miller <davem@davemloft.net>
4505
4506 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4507 and elf_flags_set_.
4508 (Target_sparc::Target_sparc): Initialize new fields.
4509 (Target_sparc::do_make_elf_object): New function.
4510 (Target_sparc::do_adjust_elf_header): New function.
4511
1d509098
CC
45122012-04-23 Cary Coutant <ccoutant@google.com>
4513
4514 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4515 CU range table of gdb index.
4516
7ebeff7f
DM
45172012-04-20 David S. Miller <davem@davemloft.net>
4518
4519 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4520 instead of false.
4521
13cf9988
DM
45222012-04-16 David S. Miller <davem@davemloft.net>
4523
2a1079e8
DM
4524 * sparc.cc (Target_sparc::got_address): New function.
4525 (Sparc_relocate_functions::gdop_hix22): New function.
4526 (Sparc_relocate_functions::gdop_lox10): New function.
4527 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4528 relocs.
4529 (Target_sparc::Scan::local): Likewise if the global symbol is not
4530 preemptible and is not IFUNC.
4531 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4532 transformations for local and non-preemptible non-IFUNC global
4533 symbols.
4534
0bc964fc
DM
4535 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4536 writing out 64-bit part of ranges.
4537
661d7a80
DM
4538 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4539 -fpic and -fpie respectively.
4540 * Makefile.in: Regenerate.
4541
8c2bf391
DM
4542 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4543 (Target_sparc::Target_sparc): Initialize new field.
4544 (Target_sparc::do_plt_section_for_global): New function.
4545 (Target_sparc::do_plt_section_for_local): New function.
4546 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4547 (Target_sparc::make_plt_section): New function, broken out of
4548 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4549 (Target_sparc::make_plt_entry): Call make_plt_section.
4550 (Target_sparc::make_local_ifunc_plt_entry): New function.
4551 (Target_sparc::rela_ifunc_section): New function.
4552 (Target_sparc::plt_section): Remove const.
4553 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4554 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4555 and ifunc_count_ fields.
4556 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4557 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4558 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4559 (Output_data_plt_sparc::rela_ifunc): New function.
4560 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4561 (Output_data_plt_sparc::has_ifunc_section): New function.
4562 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4563 (Output_data_plt_sparc::address_for_global): New function.
4564 (Output_data_plt_sparc::address_for_local): New function.
4565 (Output_data_plt_sparc::plt_index_to_offset): New function.
4566 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4567 and entry_count.
4568 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4569 entry_count.
4570 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4571 R_SPARC_JMP_IREL to switch.
4572 (Target_sparc::Scan::check_non_pic): Likewise.
4573 (Target_sparc::Scan::local): Handle IFUNC symbols.
4574 (Target_sparc::Scan::local): Likewise.
4575 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4576 and plt_address_for_local.
4577 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4578 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4579
13cf9988
DM
4580 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4581 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4582 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4583 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4584 global relocs too.
4585 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4586 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4587 calls.
4588 * sparc.cc (Target_sparc::Scan::global): Likewise.
4589 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4590
31821be0
CC
45912012-04-16 Cary Coutant <ccoutant@google.com>
4592
4593 * archive.cc (Library_base::should_include_member): Check for
4594 --export-dynamic-symbol.
4595 * options.h (class General_options): Add --export-dynamic-symbol.
4596 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4597 --export-dynamic-symbol.
4598 (Symbol_table::gc_mark_undef_symbols): Likewise.
4599 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4600
2615994e
DM
46012012-04-12 David S. Miller <davem@davemloft.net>
4602
4603 * sparc.cc (Reloc::wdisp10): New relocation method.
4604 (Reloc::h34): Likewise.
4605 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4606 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4607 R_SPARC_WDISP10.
4608 (Target_sparc::Scan::local): Likewise.
4609 (Target_sparc::Scan::global): Likewise.
4610 (Target_sparc::Relocate::relocate): Likewise.
4611
6782735d
CC
46122012-04-09 Cary Coutant <ccoutant@google.com>
4613
4614 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4615 low_pc == 0.
4616
8c7a0b00
ILT
46172012-04-06 Ian Lance Taylor <iant@google.com>
4618
4619 * timer.cc: #include <unistd.h>.
4620
58797674
RM
46212012-04-06 Roland McGrath <mcgrathr@google.com>
4622
4623 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4624 * config.in: Regenerate.
4625 * configure: Regenerate.
4626
44350750
NC
46272012-04-05 Nick Clifton <nickc@redhat.com>
4628
4629 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4630 (AM_LC_MESSAGES): Add.
4631 * aclocal.m4: Regenerate.
4632 * config.in: Regenerate.
4633 * configure: Regenerate.
4634
c1027032
CC
46352012-03-21 Cary Coutant <ccoutant@google.com>
4636
4637 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4638 * Makefile.in: Regenerate.
4639 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4640 (Sized_elf_reloc_mapper::symbol_section): New function.
4641 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4642 (make_elf_reloc_mapper): New function.
4643 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4644 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4645 (Dwarf_abbrev_table::do_get_abbrev): New function.
4646 (Dwarf_ranges_table::read_ranges_table): New function.
4647 (Dwarf_ranges_table::read_range_list): New function.
4648 (Dwarf_pubnames_table::read_section): New function.
4649 (Dwarf_pubnames_table::read_header): New function.
4650 (Dwarf_pubnames_table::next_name): New function.
4651 (Dwarf_die::Dwarf_die): New function.
4652 (Dwarf_die::read_attributes): New function.
4653 (Dwarf_die::skip_attributes): New function.
4654 (Dwarf_die::set_name): New function.
4655 (Dwarf_die::set_linkage_name): New function.
4656 (Dwarf_die::attribute): New function.
4657 (Dwarf_die::string_attribute): New function.
4658 (Dwarf_die::int_attribute): New function.
4659 (Dwarf_die::uint_attribute): New function.
4660 (Dwarf_die::ref_attribute): New function.
4661 (Dwarf_die::child_offset): New function.
4662 (Dwarf_die::sibling_offset): New function.
4663 (Dwarf_info_reader::check_buffer): New function.
4664 (Dwarf_info_reader::parse): New function.
4665 (Dwarf_info_reader::do_parse): New function.
4666 (Dwarf_info_reader::do_read_string_table): New function.
4667 (Dwarf_info_reader::lookup_reloc): New function.
4668 (Dwarf_info_reader::get_string): New function.
4669 (Dwarf_info_reader::visit_compilation_unit): New function.
4670 (Dwarf_info_reader::visit_type_unit): New function.
4671 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4672 Sized_elf_reloc_mapper.
4673 (Sized_dwarf_line_info::symbol_section): Remove function.
4674 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4675 (Sized_dwarf_line_info::read_line_mappings): Remove object
4676 parameter, adjust callers.
4677 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4678 * dwarf_reader.h: Include <sys/types.h>.
4679 (class Track_relocs): Remove forward declaration.
4680 (class Elf_reloc_mapper): New class.
4681 (class Sized_elf_reloc_mapper): New class.
4682 (class Dwarf_abbrev_table): New class.
4683 (class Dwarf_range_list): New class.
4684 (class Dwarf_ranges_table): New class.
4685 (class Dwarf_pubnames_table): New class.
4686 (class Dwarf_die): New class.
4687 (class Dwarf_info_reader): New class.
4688 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4689 (Sized_dwarf_line_info::symbol_section): Remove member function.
4690 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4691 base class.
4692 * gdb-index.cc: New source file.
4693 * gdb-index.h: New source file.
4694 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4695 and .debug_types sections, call Layout::add_to_gdb_index.
4696 (Sized_relobj_incr::do_section_name): Implement.
4697 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4698 return type; Implement.
4699 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4700 return type.
4701 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4702 parameter list and return type.
4703 (Sized_incr_dynobj::do_section_contents): Likewise.
4704 * layout.cc: Include gdb-index.h.
4705 (Layout::Layout): Initialize gdb_index_data_.
4706 (Layout::init_fixed_output_section): Check for .gdb_index section.
4707 (Layout::add_to_gdb_index): New function. Instantiate.
4708 * layout.h: Add forward declaration for class Gdb_index.
4709 (Layout::add_to_gdb_index): New member function.
4710 (Layout::gdb_index_data_): New data member.
4711 * main.cc: Include gdb-index.h.
4712 (main): Print statistics for gdb index.
4713 * object.cc (Object::section_contents): Move code into
4714 do_section_contents.
4715 (need_decompressed_section): Check for sections needed when building
4716 gdb index.
4717 (build_compressed_section_map): Likewise.
4718 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4719 gdb index.
4720 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4721 sections; call Layout::add_to_gdb_index.
4722 (Sized_relobj_file::do_decompressed_section_contents): Call
4723 do_section_contents directly.
4724 * object.h (Object::do_section_contents): Adjust parameter list and
4725 return type.
4726 (Object::do_decompressed_section_contents): Call do_section_contents
4727 directly.
4728 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4729 return type.
4730 * options.h (class General_options): Add --gdb-index option.
4731 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4732 list and return type.
4733 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4734 * reloc.h (Track_relocs::checkpoint): New function.
4735 (Track_relocs::reset): New function.
4736
4737 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4738 New test cases.
4739 * testsuite/Makefile.in: Regenerate.
4740 * testsuite/gdb_index_test.cc: New test source file.
4741 * testsuite/gdb_index_test_1.sh: New test source file.
4742 * testsuite/gdb_index_test_2.sh: New test source file.
4743
647f1574
DK
47442012-03-19 Doug Kwan <dougkwan@google.com>
4745
4746 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4747 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4748 __exidx_start and __exidx_end. Make symbol table parameter
4749 anonymous as it is not used.
4750 * gold.cc (queue_middle_tasks): Call target hook to define any
4751 target-specific symbols.
4752 * target.h (Target::define_standard_symbols): New method.
4753 (Target::do_define_standard_symbols): Same.
4754 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4755 * testsuite/Makefile.in: Regenerate.
4756 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4757 and __exidx_end.
4758 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4759 relocations are generated for __exidx_start and __exidx_end.
4760
7c6109da
DK
47612012-03-16 Doug Kwan <dougkwan@google.com>
4762
4763 * testsuite/Makefile.am: Disable test initpri3b.
4764 * testsuite/Makefile.in: Regenerate.
4765
7b8957f8
DK
47662012-03-15 Doug Kwan <dougkwan@google.com>
4767
4768 * arm.cc (Target_arm::got_section): Make .got section read-only
4769 if -z now is given.
4770
14dc9ef7
ILT
47712012-03-15 Ian Lance Taylor <iant@google.com>
4772
4773 PR gold/13850
4774 * layout.cc (Layout::make_output_section): Correctly mark
4775 SHT_INIT_ARRAY, et. al., as relro.
4776
fa40b62a
DK
47772012-03-14 Doug Kwan <dougkwan@google.com>
4778
4779 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4780 dynamic relocations for protected symbols in shared objects.
4781
fd325007
ILT
47822012-03-13 Ian Lance Taylor <iant@google.com>
4783
4784 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4785 keep the larger alignment.
4786
e8dd54e1
CC
47872012-03-12 Cary Coutant <ccoutant@google.com>
4788
4789 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4790 handling of DW_LNE_define_file.
4791
feb5f3b0
CC
47922012-03-12 Cary Coutant <ccoutant@google.com>
4793
4794 * reduced_debug_output.cc
4795 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4796 codes to switch.
4797
a1fb4256
CC
47982012-02-29 Cary Coutant <ccoutant@google.com>
4799
4800 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4801
5dd8762a
CC
48022012-02-29 Cary Coutant <ccoutant@google.com>
4803
4804 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4805 Call Object::decompressed_section_contents.
4806 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4807 New dtor.
4808 (Sized_dwarf_line_info::buffer_start_): New data member.
4809 * merge.cc (Output_merge_data::do_add_input_section): Call
4810 Object::decompressed_section_contents.
4811 (Output_merge_string::do_add_input_section): Likewise.
4812 * object.cc (need_decompressed_section): New function.
4813 (build_compressed_section_map): Decompress sections needed later.
4814 (Sized_relobj_file::do_decompressed_section_contents): New function.
4815 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4816 * object.h (Object::decompressed_section_contents): New function.
4817 (Object::discard_decompressed_sections): New function.
4818 (Object::do_decompressed_section_contents): New function.
4819 (Object::do_discard_decompressed_sections): New function.
4820 (Compressed_section_info): New type.
4821 (Compressed_section_map): Include decompressed section contents.
4822 (Sized_relobj_file::do_decompressed_section_contents): New function.
4823 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4824
7b5de7ee
CC
48252012-02-16 Cary Coutant <ccoutant@google.com>
4826
4827 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4828 * testsuite/Makefile.in: Regenerate.
4829
f9fa4a63
CC
48302012-02-14 Cary Coutant <ccoutant@google.com>
4831
4832 * options.cc (General_options::finalize): Disallow -pie and -static.
4833
2c175ebc
DK
48342012-02-03 Doug Kwan <dougkwan@google.com>
4835
4836 * arm.cc (Arm_relocate_functions::abs8,
4837 Arm_relocate_functions::abs16): Use
4838 Bits::has_signed_unsigned_overflow32.
4839 (Arm_relocate_functions::thm_abs8): Correct range of
4840 overflow check.
4841 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4842 in assertions.
4843
90cff06f
DK
48442012-02-02 Doug Kwan <dougkwan@google.com>
4845
4846 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4847 position independent outputs, not just shared objects.
4848
63887f3d
L
48492012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4850
4851 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4852 * configure: Regenerated.
4853
bef2b434
ILT
48542012-01-27 Ian Lance Taylor <iant@google.com>
4855
4856 * reloc.h (Bits): New class with static functions, copied from
4857 namespace utils in arm.cc.
4858 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4859 instead.
4860
c335b55d
L
48612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4862
4863 * incremental.cc (write_info_blocks): Correct relocation offset.
4864
41194d9f
L
48652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4866
4867 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4868 (Relocate::tls_gd_to_le): Likewise.
4869
1bae613c
L
48702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4871
4872 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4873
24482ca0
L
48742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4875
4876 * configure.ac: Check if -mcmodel=medium works.
4877 * configure: Regenerated.
4878
c2c7840a
CC
48792012-01-24 Cary Coutant <ccoutant@google.com>
4880
4881 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4882 definition and ...
4883 (read_unsigned_LEB_128_x): ... this new function.
4884 (read_signed_LEB_128): Replaced with inline definition and ...
4885 (read_signed_LEB_128_x): ... this new function.
4886 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4887 (read_unsigned_LEB_128): Add inline definition.
4888 (read_signed_LEB_128_x): New function.
4889 (read_signed_LEB_128): Add inline definition.
4890 * testsuite/Makefile.am (leb128_unittest): New unit test.
4891 * testsuite/Makefile.in: Regenerate.
4892 * testsuite/leb128_unittest.cc: New unit test.
4893
833de760 48942012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4895
4896 PR gold/13617
4897 * i386.cc (Target_i386::do_code_fill): When using a jmp
4898 instruction, pad with nop instructions.
4899 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4900
618d6666
L
49012012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4902
4903 * x86_64.cc (gc_process_relocs): Add typename on types used in
4904 template.
4905 (scan_relocs): Likewise.
4906 (relocate_section): Likewise.
4907 (apply_relocation): Likewise.
4908
3660ff06
L
49092012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4910
4911 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4912 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4913 under x32.
4914
fc51264f
L
49152012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4916
4917 * x86_64.cc: Initial support for x32.
4918
dd74ae06
CC
49192012-01-03 Cary Coutant <ccoutant@google.com>
4920
4921 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4922 Use abstract base class for GOT.
4923 * gold/output.h (class Output_data_got_base): New abstract base class.
4924 (class Output_data_got): Derive from new base class, adjust ctors.
4925 (Output_data_got::reserve_slot): Make virtual; rename to
4926 do_reserve_slot; Adjust callers.
4927 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4928 pointer to abstract base class.
4929 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4930
83896202
ILT
49312011-12-18 Ian Lance Taylor <iant@google.com>
4932
4933 * object.h (Relobj::local_symbol_value): New function.
4934 (Relobj::local_plt_offset): New function.
4935 (Relobj::local_has_got_offset): New function.
4936 (Relobj::local_got_offset): New function.
4937 (Relobj::set_local_got_offset): New function.
4938 (Relobj::do_local_symbol_value): New pure virtual function.
4939 (Relobj::do_local_plt_offset): Likewise.
4940 (Relobj::do_local_has_got_offset): Likewise.
4941 (Relobj::do_local_got_offset): Likewise.
4942 (Relobj::do_set_local_got_offset): Likewise.
4943 (Sized_relobj::do_local_has_got_offset): Rename from
4944 local_has_got_offset.
4945 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4946 (Sized_relobj::do_set_local_got_offset): Rename from
4947 set_local_got_offset.
4948 (Sized_relobj_file::do_local_plt_offset): Rename from
4949 local_plt_offset.
4950 (Sized_relobj_file::do_local_symbol_value): New function.
4951 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4952 local_plt_offset.
4953 * output.cc (Output_data_got::Got_entry::write): Change object to
4954 Relobj. Use local_symbol_value.
4955 (Output_data_got::add_global_with_rel): Change rel_dyn to
4956 Output_data_reloc_generic*. Use add_global_generic.
4957 (Output_data_got::add_global_with_rela): Remove. Change all
4958 callers to use add_global_with_rel.
4959 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4960 Output_data_reloc_generic*. Use add_global_generic.
4961 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4962 callers to use add_global_pair_with_rel.
4963 (Output_data_got::add_local): Change object to Relobj*.
4964 (Output_data_got::add_local_plt): Likewise.
4965 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4966 change rel_dyn to Output_data_reloc_generic*. Use
4967 add_local_generic.
4968 (Output_data_got::add_local_with_rela): Remove. Change all
4969 callers to use all_local_with_rel.
4970 (Output_data_got::add_local_pair_with_rel): Change object to
4971 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4972 add_output_section_generic.
4973 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4974 callers to use add_local_pair_with_rel.
4975 (Output_data_got::reserve_local): Change object to Relobj*.
4976 * output.h: (class Output_data_reloc_generic): Add pure virtual
4977 declarations for add_global_generic, add_local_generic,
4978 add_output_section_generic.
4979 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4980 functions for Output_data_reloc_generic. Update declarations for
4981 changes listed in output.cc.
4982 (class Output_data_got): Change template parameter to got_size.
4983 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4984 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4985 function.
4986 (Sized_relobj_incr::do_local_plt_offset): New function.
4987 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4988 add_global_generic.
4989
76677ad0
CC
49902011-12-17 Cary Coutant <ccoutant@google.com>
4991
4992 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4993 * resolve.cc (Symbol_table::resolve): Likewise.
4994 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4995 arrays.
4996 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4997
8b8dd8d5
ILT
49982011-12-16 Ian Lance Taylor <iant@google.com>
4999
5000 * output.h (Output_data_reloc_generic::add): Only call
5001 add_dynamic_reloc if this is a dynamic reloc section.
5002
d55525b9
L
50032011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5004
5005 PR gold/13505
5006 * target-reloc.h (apply_relocation): Replace <64, false> with
5007 <size, big_endian>.
5008
ff81c7c1
NC
50092011-11-25 Nick Clifton <nickc@redhat.com>
5010
5011 * po/it.po: New Italian translation.
5012
628f39be
SA
50132011-11-17 Sterling Augustine <saugustine@google.com>
5014
5015 * script.cc (script_include_directive): Implement.
5016 (read_script_file): New local variables name and search_path. Update
5017 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5018 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5019 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5020
98ef3ea4
SA
50212011-11-11 Sterling Augustine <saugustine@google.com>
5022
5023 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5024 (file_or_sections_cmd): Likewise.
5025
f4a8b6d7
DK
50262011-11-11 Doug Kwan <dougkwan@google.com>
5027
5028 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5029 if --just-symbols is given.
5030
29ab395d
DK
50312011-11-10 Doug Kwan <dougkwan@google.com>
5032
5033 PR gold/13362
5034 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5035 when processing data relocs.
5036 * reloc.h (Relocate_functions::rel_unaligned): New method.
5037 (Relocate_functions::pcrel_unaligned): Ditto.
5038 (Relocate_functions::rel32_unaligned): Ditto.
5039 (Relocate_functions::pcrel32_unaligned): Ditto.
5040
2c339f71
DK
50412011-11-09 Doug Kwan <dougkwan@google.com>
5042
5043 PR gold/13362
5044 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5045 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5046 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5047 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5048 (Relocate_functions::rel_unaligned): New.
5049 (Relocate_functions::rel32_unaligned): New.
5050 * target-reloc.h (relocate_for_relocatable): Add code to handle
5051 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5052 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5053 arm_unaligned_reloc_r): New targets.
5054 * testsuite/Makefile.in: Regenerate.
5055 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5056 linking.
5057
3f3cddf1
ILT
50582011-11-02 Ian Lance Taylor <iant@google.com>
5059
5060 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5061 NATIVE_LINKER.
5062 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5063 * options.cc (General_options::finalize): Use library search path
5064 from configure script if specified. If not native and no sysroot,
5065 only search TOOLLIBDIR.
5066 * options.h (Search_directory::Search_directory): Change name to
5067 const std::string&.
5068 (General_options::add_to_library_path_with_sysroot): Change arg to
5069 const std::string&.
5070 * configure, Makefile.in, config.in: Rebuild.
5071
a8e2273b
ILT
50722011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5073
5074 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5075 we are working around the ARM1176 Erratum.
5076 * options.h (General_options::fix_arm1176): Add option.
5077 * testsuite/Makefile.am: Add testcases, and keep current ones
5078 working.
5079 * testsuite/Makefile.in: Regenerate.
5080 * testsuite/arm_fix_1176.s: New file.
5081 * testsuite/arm_fix_1176.sh: Likewise.
5082
cd6eab1c
ILT
50832011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5084
5085 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5086 may_use_blx_.
5087 (Target_arm::may_use_blx): Remove method.
5088 (Target_arm::set_may_use_blx): Likewise.
5089 (Target_arm::may_use_v4t_interworking): New method.
5090 (Target_arm::may_use_v5t_interworking): Likewise.
5091 (Target_arm::may_use_blx_): Remove member variable.
5092 (Arm_relocate_functions::arm_branch_common): Check for v5T
5093 interworking.
5094 (Arm_relocate_functions::thumb_branch_common): Likewise.
5095 (Reloc_stub::stub_type_for_reloc): Likewise.
5096 (Target_arm::do_finalize_sections): Correct interworking checks.
5097 * testsuite/Makefile.am: Add new tests.
5098 * testsuite/Makefile.in: Regenerate.
5099 * testsuite/arm_farcall_arm_arm.s: New test.
5100 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5101 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5102 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5103 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5104 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5105 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5106 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5107
286adcf4
CC
51082011-10-31 Cary Coutant <ccoutant@google.com>
5109
5110 PR gold/13023
5111 * expression.cc (Expression::eval_with_dot): Add
5112 is_section_dot_assignment parameter.
5113 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5114 absolute and assigning to dot within a section.
5115 * script-sections.cc
5116 (Output_section_element_assignment::set_section_addresses): Pass
5117 dot_section to set_if_absolute.
5118 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5119 as is_section_dot_assignment flag to eval_with_dot.
5120 (Output_section_element_dot_assignment::set_section_addresses):
5121 Likewise.
5122 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5123 parameter. Also set value if relative to dot_section; set the
5124 symbol's output_section.
5125 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5126 parameter. Adjust all callers.
5127 (Expression::eval_maybe_dot): Likewise.
5128 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5129 Adjust all callers.
5130 * testsuite/script_test_2.t: Test assignment of an absolute value
5131 to dot within an output section element.
5132
9634ed06
CC
51332011-10-31 Cary Coutant <ccoutant@google.com>
5134
5135 * options.h (class General_options): Add --[no-]gnu-unique options.
5136 * symtab.cc (Symbol_table::sized_write_globals): Convert
5137 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5138
de4101c7
CC
51392011-10-31 Cary Coutant <ccoutant@google.com>
5140
5141 PR gold/13359
5142 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5143 unnecessary assertion.
5144 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5145
7257cc92
ST
51462011-10-31 Sriraman Tallam <tmsriram@google.com>
5147
5148 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5149 gc_mark_symbol.
5150 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5151 gc_mark_symbol.
5152 Change to just keep the section associated with symbol.
5153 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5154 they are externally visible and --export-dynamic is turned on.
5155 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5156
bfc34b3f
ILT
51572011-10-19 Ian Lance Taylor <iant@google.com>
5158
5159 PR gold/13163
5160 * script-sections.cc
5161 (Output_section_element_dot_assignment::needs_output_section): New
5162 function.
5163
ea0d8c47
ILT
51642011-10-19 Ian Lance Taylor <iant@google.com>
5165
5166 PR gold/13204
5167 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5168 --section-start option was seen.
5169 * options.h (General_options::any_section_start): New function.
5170
abd242a9
DM
51712011-10-18 David S. Miller <davem@davemloft.net>
5172
5173 PR binutils/13301
5174 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5175 member to track relocation locations that have moved during TLS
5176 reloc optimizations.
5177 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5178 (Target_sparc::Relocate::relocate): Adjust view down by 4
5179 bytes if it matches reloc_adjust_addr_.
5180 (Target_sparc::Relocate::relocate_tls): Always move the
5181 __tls_get_addr call delay slot instruction forward 4 bytes when
5182 performing relaxation.
5183
bab9090f
CC
51842011-10-18 Cary Coutant <ccoutant@google.com>
5185
5186 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5187 (Output_file::map_no_anonymous): Check for non-zero
5188 return code from posix_fallocate.
5189
f7c5b166
CC
51902011-10-17 Cary Coutant <ccoutant@google.com>
5191
5192 PR gold/13245
5193 * plugin.cc (is_visible_from_outside): Check for symbols
5194 referenced from dynamic objects.
5195 * resolve.cc (Symbol_table::resolve): Don't count references
5196 from dynamic objects as references from real ELF files.
5197 * testsuite/plugin_test_2.sh: Adjust expected result.
5198
b490c0bb
CC
51992011-10-17 Cary Coutant <ccoutant@google.com>
5200
5201 * gold.cc: Include timer.h.
5202 (queue_middle_tasks): Stamp time.
5203 (queue_final_tasks): Likewise.
5204 * main.cc (main): Store timer in parameters. Print timers
5205 for each pass.
5206 * parameters.cc (Parameters::Parameters): Initialize timer_.
5207 (Parameters::set_timer): New function.
5208 (set_parameters_timer): New function.
5209 * parameters.h (Parameters::set_timer): New function.
5210 (Parameters::timer): New function.
5211 (Parameters::timer_): New data member.
5212 (set_parameters_timer): New function.
5213 * timer.cc (Timer::stamp): New function.
5214 (Timer::get_pass_time): New function.
5215 * timer.h (Timer::stamp): New function.
5216 (Timer::get_pass_time): New function.
5217 (Timer::pass_times_): New data member.
5218
f475cf7b
CC
52192011-10-17 Cary Coutant <ccoutant@google.com>
5220
5221 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5222 task for members of lib groups.
5223
cdd7e244
CC
52242011-10-17 Cary Coutant <ccoutant@google.com>
5225
5226 PR gold/13288
4f95c8b4 5227 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5228 (File_read::make_view): Move bounds check (replace with assert)...
5229 (File_read::find_or_make_view): ... to here.
5230
dfb45471
CC
52312011-10-12 Cary Coutant <ccoutant@google.com>
5232
4f95c8b4 5233 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5234 ::read returns less than requested size.
5235
53bbcc1b
CC
52362011-10-10 Cary Coutant <ccoutant@google.com>
5237
4f95c8b4 5238 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5239 Initialize defined_count_.
5240 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5241 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5242 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5243 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5244 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5245 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5246 member.
5247 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5248 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5249 Return zeroes instead of internal error.
5250
397b129b
CC
52512011-10-10 Cary Coutant <ccoutant@google.com>
5252
5253 PR gold/13249
4f95c8b4 5254 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5255 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5256 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5257 (Output_reloc::type_): Adjust size of bit field.
5258 (Output_reloc::use_plt_offset_): New bit field.
5259 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5260 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5261 flag. Adjust all callers.
4f95c8b4 5262 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5263 creating RELATIVE relocations.
5264
d5698657
NC
52652011-10-10 Nick Clifton <nickc@redhat.com>
5266
5267 * po/es.po: Updated Spanish translation.
5268 * po/fi.po: Updated Finnish translation.
5269
6a59a5c2
DN
52702011-10-03 Diego Novillo <dnovillo@google.com>
5271
5272 * options.cc (parse_uint): Fix dereference of RETVAL.
5273
f0558624
ST
52742011-09-29 Sriraman Tallam <tmsriram@google.com>
5275
5276 * layout.h (section_order_map_): New member.
5277 (get_section_order_map): New member function.
5278 * output.cc (Output_section::add_input_section): Check for patterns
5279 only when --section-ordering-file is specified.
5280 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5281 output_sections have been formed.
5282 * layout.cc (Layout_Layout): Initialize section_order_map_.
5283 * plugin.cc (update_section_order): Store order in order_map. Do not
5284 update the order.
5285 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5286 * testsuite/Makefile.in: Regenerate.
5287 * testsuite/plugin_section_order.c: New file.
5288 * testsuite/plugin_final_layout.cc: New file.
5289 * testsuite/plugin_final_layout.sh: New file.
5290
a7dac153
CC
52912011-09-29 Cary Coutant <ccoutant@google.com>
5292
4f95c8b4 5293 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5294 Check for NULL.
4f95c8b4 5295 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5296 symbols during incremental update.
5297 (Symbol_table::add_from_dynobj): Likewise.
5298
eebd87a5
ILT
52992011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5300 Ian Lance Taylor <iant@google.com>
5301
5302 * symtab.cc (Symbol_table::define_special_symbol): Always
5303 canonicalize version string.
5304
403a3331
CC
53052011-09-26 Cary Coutant <ccoutant@google.com>
5306
4f95c8b4
CC
5307 * gold.cc (queue_initial_tasks): Move option checks ...
5308 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5309 some options; make others fatal.
5310
235061c2
CC
53112011-09-26 Cary Coutant <ccoutant@google.com>
5312
5313 gcc PR lto/47247
5314 * plugin.cc (get_symbols_v2): New function.
5315 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5316 (is_referenced_from_outside): New function.
5317 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5318 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5319 (get_symbols): Pass version parameter.
5320 (get_symbols_v2): New function.
5321 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5322 parameter.
5323 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5324 (onload): Add LDPT_GET_SYMBOLS_V2.
5325 (all_symbols_read_hook): Use get_symbols_v2; check for
5326 LDPR_PREVAILING_DEF_IRONLY_EXP.
5327 * testsuite/plugin_test_3.sh: Update expected results.
5328
dc87f620
ILT
53292011-09-23 Simon Baldwin <simonb@google.com>
5330
5331 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5332 configuration options.
5333 * configure: Regenerate.
5334 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5335 * Makefile.in: Regenerate.
5336 * testsuite/Makefile.in: Regenerate.
5337
a8279f82
ST
53382011-09-19 Sriraman Tallam <tmsriram@google.com>
5339
5340 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5341
0c9350c8
CC
53422011-09-19 Cary Coutant <ccoutant@google.com>
5343
5344 * incremental.cc (can_incremental_update): Fix typo in comment.
5345 * incremental.h (can_incremental_update): Likewise.
5346
aa06ae28
CC
53472011-09-18 Cary Coutant <ccoutant@google.com>
5348
5349 * incremental.cc (can_incremental_update): New function.
5350 * incremental.h (can_incremental_update): New function.
5351 * layout.cc (Layout::init_fixed_output_section): Call it.
5352 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5353 * object.cc (Sized_relobj_file::do_layout): Call
5354 can_incremental_update.
5355
ebb300b2
CC
53562011-09-13 Cary Coutant <ccoutant@google.com>
5357
5358 * configure.ac: Check for glibc support for gnu_indirect_function
5359 support with static linking, setting automake conditional
5360 IFUNC_STATIC.
5361 * Makefile.in: Regenerate.
5362 * configure: Regenerate.
5363
5364 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5365 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5366 for IFUNC_STATIC.
5367 * testsuite/Makefile.in: Regenerate.
5368
1206d0d5
CC
53692011-09-13 Cary Coutant <ccoutant@google.com>
5370
5371 * incremental.cc (Sized_relobj_incr::do_layout): Call
5372 report_comdat_group for kept comdat sections.
5373 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5374 * testsuite/Makefile.in: Regenerate.
5375 * testsuite/incr_comdat_test_1.cc: New source file.
5376 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5377 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5378 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5379
40b29874
ILT
53802011-09-13 Ian Lance Taylor <iant@google.com>
5381
5382 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5383 variable external_symbols_offset.
5384
1b045aac
ILT
53852011-09-12 Ian Lance Taylor <iant@google.com>
5386
5387 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5388 triggered if object has no symbols.
5389
24c6c55a
DM
53902011-09-09 David S. Miller <davem@davemloft.net>
5391
5392 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5393 (Output_fill_debug_line::do_write): Likewise.
5394
66570254
CC
53952011-08-29 Cary Coutant <ccoutant@google.com>
5396
5397 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5398 casts to match formatting specs.
5399 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5400
8ea8cd50
CC
54012011-08-26 Cary Coutant <ccoutant@google.com>
5402
5403 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5404 remaining hole size when allocating.
5405 (Layout::make_output_section): Set fill methods for debug sections.
5406 * layout.h (Free_list::Free_list_node): Move from private to
5407 public.
5408 (Free_list::set_min_hole_size): New function.
5409 (Free_list::begin, Free_list::end): New functions.
5410 (Free_list::min_hole_): New data member.
5411 * output.cc: Include dwarf.h.
5412 (Output_fill_debug_info::do_minimum_hole_size): New function.
5413 (Output_fill_debug_info::do_write): New function.
5414 (Output_fill_debug_line::do_minimum_hole_size): New function.
5415 (Output_fill_debug_line::do_write): New function.
5416 (Output_section::Output_section): Initialize new data member.
5417 (Output_section::set_final_data_size): Ensure patch space is larger
5418 than minimum hole size.
5419 (Output_section::do_write): Fill holes in debug sections.
5420 * output.h (Output_fill): New class.
5421 (Output_fill_debug_info): New class.
5422 (Output_fill_debug_line): New class.
5423 (Output_section::set_free_space_fill): New function.
5424 (Output_section::free_space_fill_): New data member.
5425 * testsuite/Makefile.am (incremental_test_3): Add
5426 --incremental-patch option.
5427 (incremental_test_4): Likewise.
5428 (incremental_test_5): Likewise.
5429 (incremental_test_6): Likewise.
5430 (incremental_copy_test): Likewise.
5431 (incremental_common_test_1): Likewise.
5432 * testsuite/Makefile.in: Regenerate.
5433
7cf80422
NC
54342011-08-26 Nick Clifton <nickc@redhat.com>
5435
5436 * po/es.po: Updated Spanish translation.
5437
c3f7b0e5
CC
54382011-08-01 Cary Coutant <ccoutant@google.com>
5439
5440 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5441 * gold/testsuite/Makefile.in: Regenerate.
5442 * gold/testsuite/justsyms_exec.c: New source file.
5443 * gold/testsuite/justsyms_lib.c: New source file.
5444
9590bf25
CC
54452011-08-01 Cary Coutant <ccoutant@google.com>
5446
5447 * layout.cc (Layout::set_segment_offsets): Don't realign text
5448 segment if -Ttext was specified.
5449 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5450 file type.
5451 * object.h (Sized_relobj_file::e_type): New function.
5452 (Sized_relobj_file::e_type_): New data member.
5453 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5454 base address for ET_EXEC files.
5455 * target.cc (Target::do_make_elf_object_implementation): Allow
5456 ET_EXEC files with --just-symbols option.
5457
dcd8d12e
CC
54582011-07-28 Cary Coutant <ccoutant@google.com>
5459
5460 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5461 Add thread_number parameter.
5462 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5463 * workqueue-threads.cc
5464 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5465 current thread if its thread number is greater than desired thread
5466 count.
5467 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5468 Add thread_number parameter.
5469 (Workqueue::should_cancel_thread): Likewise.
5470 (Workqueue::find_runnable_or_wait): Pass thread_number to
5471 should_cancel_thread.
5472 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5473 parameter.
5474
804eb480
ST
54752011-07-22 Sriraman Tallam <tmsriram@google.com>
5476
5477 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5478 only after checking if it cannot be forced local.
5479 * symtab.h (is_externally_visible): Check if the symbol is not forced
5480 local.
5481
f1ddb600
ILT
54822011-07-15 Ian Lance Taylor <iant@google.com>
5483
5484 * options.h (class General_options): Add --print-output-format.
5485 Move -EL next to -EB, for better --help output.
5486 * target-select.cc: Include <cstdio>, "options.h", and
5487 "parameters.h".
5488 (Target_selector::do_target_bfd_name): New function.
5489 (print_output_format): New function.
5490 * target-select.h (class Target_selector): Update declarations.
5491 (Target_selector::target_bfd_name): New function.
5492 (print_output_format): Declare.
5493 * main.cc: Include "target-select.h".
5494 (main): Handle --print-output-format.
5495 * gold.cc: Include "target-select.h".
5496 (queue_initial_tasks): Handle --print-output-format when there are
5497 no input files.
5498 * parameters.cc (parameters_force_valid_target): Give a better
5499 error message if -EB/-EL does not match target.
5500 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5501 function.
5502
7d172687
ILT
55032011-07-15 Ian Lance Taylor <iant@google.com>
5504
5505 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5506 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5507 (Output_data_plt_i386::do_write): Write address of .dynamic
5508 section to first entry in .got.plt section.
5509 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5510 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5511 Initialize layout_.
5512 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5513 section to first entry in .got.plt section.
5514 * layout.h (Layout::dynamic_section): New function.
5515
e9552f7e
ST
55162011-07-13 Sriraman Tallam <tmsriram@google.com>
5517
5518 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5519 to claim_file call.
5520 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5521 input_section_position_, and input_section_glob_.
5522 (read_layout_from_file): Call function section_ordering_specified.
5523 * layout.h (is_section_ordering_specified): New function.
5524 (section_ordering_specified): New function.
5525 (section_ordering_specified_): New boolean member.
5526 * main.cc(main): Call load_plugins after layout object is defined.
5527 * output.cc (Output_section::add_input_section): Use
5528 function section_ordering_specified to check if section ordering is
5529 needed.
5530 * output.cc (Output_section::add_relaxed_input_section): Use
5531 function section_ordering_specified to check if section ordering is
5532 needed.
5533 (Output_section::update_section_layout): New function.
5534 (Output_section::sort_attached_input_sections): Check if input section
5535 must be reordered.
5536 * output.h (Output_section::update_section_layout): New function.
5537 * plugin.cc (get_section_count): New function.
5538 (get_section_type): New function.
5539 (get_section_name): New function.
5540 (get_section_contents): New function.
5541 (update_section_order): New function.
58797674 5542 (allow_section_ordering): New function.
e9552f7e
ST
5543 (Plugin::load): Add the new interfaces to the transfer vector.
5544 (Plugin_manager::load_plugins): New parameter.
5545 (Plugin_manager::all_symbols_read): New parameter.
5546 (Plugin_manager::claim_file): New parameter. Save the elf object for
5547 unclaimed objects.
5548 (Plugin_manager::get_elf_object): New function.
5549 (Plugin_manager::get_view): Change to directly use the bool to check
5550 if get_view is called from claim_file_hook.
5551 * plugin.h (input_objects): New function
5552 (Plugin__manager::load_plugins): New parameter.
5553 (Plugin_manager::claim_file): New parameter.
5554 (Plugin_manager::get_elf_object): New function.
5555 (Plugin_manager::in_claim_file_handler): New function.
5556 (Plugin_manager::in_claim_file_handler_): New member.
5557 (layout): New function.
5558 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5559 handler with an extra parameter. Make the elf object before calling
5560 claim_file handler.
5561 * testsuite/plugin_test.c (get_section_count): New function pointer.
5562 (get_section_type): New function pointer.
5563 (get_section_name): New function pointer.
5564 (get_section_contents): New function pointer.
5565 (update_section_order): New function pointer.
5566 (allow_section_ordering): New function pointer.
5567 (onload): Check if the new interfaces exist.
5568
9446efde
ILT
55692011-07-13 Ian Lance Taylor <iant@google.com>
5570
5571 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5572 relro section.
5573 * x86_64.cc (Target_x86_64::got_section): Likewise.
5574 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5575 (relro_now_test_SOURCES): New variable.
5576 (relro_now_test_DEPENDENCIES): New variable.
5577 (relro_now_test_LDFLAGS): New variable.
5578 (relro_now_test_LDADD): New variable.
5579 (relro_now_test.so): New target.
5580 * testsuite/Makefile.in: Rebuild.
5581
07aa62f2
ILT
55822011-07-12 Ian Lance Taylor <iant@google.com>
5583
5584 PR gold/12980
5585 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5586 GLOB_DAT relocation rather than a RELATIVE relocation for a
5587 protected symbol when creating a shared library.
5588 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5589 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5590 * testsuite/protected_main_1.cc (main): Test that protected
5591 function has same address.
5592
e2153196
ILT
55932011-07-11 Ian Lance Taylor <iant@google.com>
5594
5595 PR gold/12979
5596 * options.h (class General_options): Add -Bgroup.
5597 * options.cc (General_options::finalize): If -Bgroup is set,
5598 default to --unresolved-symbols=report-all.
5599 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5600 * target-reloc.h (issue_undefined_symbol_error): Handle
5601 --unresolved-symbols=report-all.
5602
6daf5215
ILT
56032011-07-08 Ian Lance Taylor <iant@google.com>
5604
5605 PR gold/11985
5606 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5607 if linker script discards key sections.
5608 (Layout::create_dynamic_symtab): Likewise.
5609 (Layout::assign_local_dynsym_offsets): Likewise.
5610 (Layout::sized_create_version_sections): Likewise.
5611 (Layout::create_interp): Likewise.
5612 (Layout::finish_dynamic_section): Likewise.
5613 (Layout::set_dynamic_symbol_size): Likewise.
5614
beabb2c6
ILT
56152011-07-08 Ian Lance Taylor <iant@google.com>
5616
5617 PR gold/12386
5618 * options.h (class General_options): Add --unresolved-symbols.
5619 * target-reloc.h (issue_undefined_symbol_error): Check
5620 --unresolved-symbols. Add comments.
5621
9c16daf1
ILT
56222011-07-08 Ian Lance Taylor <iant@google.com>
5623
5624 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5625 expression more complex.
5626
191f1a2d
ILT
56272011-07-08 Ian Lance Taylor <iant@google.com>
5628
5629 PR gold/11317
5630 * target-reloc.h (issue_undefined_symbol_error): New inline
5631 function, broken out of relocate_section.
5632 (relocate_section): Call issue_undefined_symbol_error.
5633 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5634 there is no TLS segment if we are about to issue an undefined
5635 symbol error.
5636 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5637
62855347
ILT
56382011-07-08 Ian Lance Taylor <iant@google.com>
5639
5640 PR gold/12279
5641 * resolve.cc (Symbol_table::should_override): Add fromtype
5642 parameter. Change all callers. Give error when linking together
5643 TLS and non-TLS symbol.
5644 (Symbol_table::should_override_with_special): Add fromtype
5645 parameter. Change all callers.
5646 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5647 there is no TLS segment if we have reported some errors.
5648 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5649
67181c72
ILT
56502011-07-08 Ian Lance Taylor <iant@google.com>
5651
5652 PR gold/12372
5653 * target.h (Target::plt_address_for_global): New function.
5654 (Target::plt_address_for_local): New function.
5655 (Target::plt_section_for_global): Remove.
5656 (Target::plt_section_for_local): Remove.
5657 (Target::do_plt_address_for_global): New virtual function.
5658 (Target::do_plt_address_for_local): New virtual function.
5659 (Target::do_plt_section_for_global): Remove.
5660 (Target::do_plt_section_for_local): Remove.
5661 (Target::register_global_plt_entry): Add Symbol_table and Layout
5662 parameters.
5663 * output.cc (Output_data_got::Got_entry::write): Use
5664 plt_address_for_global and plt_address_for_local.
5665 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5666 address of output section.
5667 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5668 got_irelative_, and irelative_count_ fields. Update
5669 declarations.
5670 (Output_data_plt_i386::has_irelative_section): New function.
5671 (Output_data_plt_i386::entry_count): Add irelative_count_.
5672 (Output_data_plt_i386::set_final_data_size): Likewise.
5673 (class Target_i386): Add got_irelative_ and rel_irelative_
5674 fields. Update declarations.
5675 (Target_i386::Target_i386): Initialize new fields.
5676 (Target_i386::do_plt_address_for_global): New function replacing
5677 do_plt_section_for_global.
5678 (Target_i386::do_plt_address_for_local): New function replacing
5679 do_plt_section_for_local.
5680 (Target_i386::got_section): Create got_irelative_.
5681 (Target_i386::rel_irelative_section): New function.
5682 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5683 fields. Don't define __rel_iplt_{start,end}.
5684 (Output_data_plt_i386::add_entry): Add symtab and layout
5685 parameters. Change all callers. Use different PLT and GOT for
5686 IFUNC symbols.
5687 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5688 layout parameters. Change all callers. Use different PLT and
5689 GOT.
5690 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5691 (Output_data_plt_i386::rel_irelative): New function.
5692 (Output_data_plt_i386::address_for_global): New function.
5693 (Output_data_plt_i386::address_for_local): New function.
5694 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5695 IRELATIVE GOT when changing IFUNC GOT entries.
5696 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5697 reloc.
5698 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5699 if we didn't create an IRELATIVE GOT.
5700 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5701 plt_address_for_local.
5702 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5703 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5704 got_irelative_, and irelative_count_ fields. Update
5705 declarations.
5706 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5707 Initialize new fields. Remove symtab parameter. Change all
5708 callers.
5709 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5710 irelative_count_.
5711 (Output_data_plt_x86_64::has_irelative_section): New function.
5712 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5713 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5714 fields. Update declarations.
5715 (Target_x86_64::Target_x86_64): Initialize new fields.
5716 (Target_x86_64::do_plt_address_for_global): New function replacing
5717 do_plt_section_for_global.
5718 (Target_x86_64::do_plt_address_for_local): New function replacing
5719 do_plt_section_for_local.
5720 (Target_x86_64::got_section): Create got_irelative_.
5721 (Target_x86_64::rela_irelative_section): New function.
5722 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5723 all callers. Don't create __rel_iplt_{start,end}.
5724 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5725 parameters. Change all callers. Use different PLT and GOT for
5726 IFUNC symbols.
5727 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5728 layout parameters. Change all callers. Use different PLT and
5729 GOT.
5730 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5731 parameters. Change all callers. Use different PLT and GOT for
5732 IFUNC symbols.
5733 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5734 (Output_data_plt_x86_64::rela_irelative): New function.
5735 (Output_data_plt_x86_64::address_for_global): New function.
5736 (Output_data_plt_x86_64::address_for_local): New function.
5737 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5738 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5739 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5740 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5741 parameters.
5742 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5743 reloc.
5744 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5745 symbols if we didn't create an IRELATIVE GOT.
5746 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5747 plt_address_for_local.
5748 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5749 * testsuite/ifuncvar1.c: New test file.
5750 * testsuite/ifuncvar2.c: New test file.
5751 * testsuite/ifuncvar3.c: New test file.
5752 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5753 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5754 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5755 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5756 * testsuite/Makefile.in: Rebuild.
5757
33c15b45
CC
57582011-07-07 Cary Coutant <ccoutant@google.com>
5759
5760 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5761 (two_file_test_1_ndebug.o): Likewise.
5762 (two_file_test_1b_ndebug.o): Likewise.
5763 (two_file_test_2_ndebug.o): Likewise.
5764 (two_file_test_main_ndebug.o): Likewise.
5765 (incremental_test_2): Link with no-debug versions.
5766
f48b5fb7
CC
57672011-07-06 Cary Coutant <ccoutant@google.com>
5768
5769 * gold/incremental.cc
5770 (Output_section_incremental_inputs::write_info_blocks): Check for
5771 hidden and internal symbols.
5772
221597a5
CC
57732011-07-06 Cary Coutant <ccoutant@google.com>
5774
5775 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5776 Check disposition for startup file.
5777 (Incremental_inputs::report_command_line): Ignore
5778 --incremental-startup-unchanged option.
5779 * options.cc (General_options::parse_incremental_startup_unchanged):
5780 New function.
5781 (General_options::General_options): Initialize new data member.
5782 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5783 (General_options): Add --incremental-startup-unchanged option.
5784 (General_options::incremental_startup_disposition): New function.
5785 (General_options::incremental_startup_disposition_): New data member.
5786
e24719f6
CC
57872011-07-06 Cary Coutant <ccoutant@google.com>
5788
5789 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5790 input file index to Script_info ctor.
5791 (Sized_incremental_binary::do_file_has_changed): Find the
5792 command-line argument for files named in scripts.
5793 * incremental.h (Script_info::Script_info): New ctor
5794 with input file index.
5795 (Script_info::input_file_index): New function.
5796 (Script_info::input_file_index_): New data member.
5797 (Incremental_binary::get_library): Add const.
5798 (Incremental_binary::get_script_info): Add const.
5799 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5800 * testsuite/Makefile.am (incremental_test_5): New test case.
5801 (incremental_test_6): New test case.
5802 * testsuite/Makefile.in: Regenerate.
5803
8f7c81e8
CC
58042011-07-06 Cary Coutant <ccoutant@google.com>
5805
5806 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5807 debug output when command lines differ.
5808
9fbd3822
CC
58092011-07-06 Cary Coutant <ccoutant@google.com>
5810
5811 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5812 --incremental-patch option.
5813 * layout.cc (Free_list::allocate): Extend allocation beyond original
5814 end if enabled.
5815 (Layout::make_output_section): Mark sections that should get
5816 patch space.
5817 * options.cc (parse_percent): New function.
5818 * options.h (parse_percent): New function.
5819 (DEFINE_percent): New macro.
5820 (General_options): Add --incremental-patch option.
5821 * output.cc (Output_section::Output_section): Initialize new data
5822 members.
5823 (Output_section::add_input_section): Print section name when out
5824 of patch space.
5825 (Output_section::add_output_section_data): Likewise.
5826 (Output_section::set_final_data_size): Add patch space when
5827 doing --incremental-full.
5828 (Output_section::do_reset_address_and_file_offset): Remove patch
5829 space.
5830 (Output_segment::set_section_list_addresses): Print debug output
5831 only if --incremental-update.
5832 * output.h (Output_section::set_is_patch_space_allowed): New function.
5833 (Output_section::is_patch_space_allowed_): New data member.
5834 (Output_section::patch_space_): New data member.
5835 * parameters.cc (Parameters::incremental_full): New function.
5836 * parameters.h (Parameters::incremental_full): New function
5837 * testsuite/Makefile.am (incremental_test_2): Add test for
5838 --incremental-patch option.
5839 * testsuite/Makefile.in: Regenerate.
5840 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5841 (t18): Remove function body.
5842
f6cccc2c
DK
58432011-07-05 Doug Kwan <dougkwan@google.com>
5844
5845 PR gold/12771
5846 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5847 Arm_Address type for relocation result.
5848 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5849 overflow check.
5850 (Arm_relocate_functions::abs32): Use unaligned access.
5851 (Arm_relocate_functions::rel32): Ditto.
5852 (Arm_relocate_functions::prel31): Ditto.
5853 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5854 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5855 static data relocations.
5856 * testsuite/Makefile.in: Regnerate.
5857 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5858
28a13fec
ILT
58592011-07-05 Ian Lance Taylor <iant@google.com>
5860
5861 PR gold/12392
5862 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5863 symbols if necessary.
5864 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5865
24d47b34
ILT
58662011-07-05 Ian Lance Taylor <iant@google.com>
5867
5868 PR gold/12952
5869 * resolve.cc (Symbol::override_base_with_special): Simply override
5870 version with special symbol version, ignoring previous version.
5871
41f9cbbe
ILT
58722011-07-05 Ian Lance Taylor <iant@google.com>
5873
5874 * object.cc (Sized_relobj_file::include_section_group): Add
5875 information to comment about signature location.
5876
886288f1
ILT
58772011-07-02 Ian Lance Taylor <iant@google.com>
5878
5879 PR gold/12957
5880 * options.h (class General_options): Add -f and -F.
5881 * options.cc (General_options::finalize): Fatal error if -f/-F
5882 are used without -shared.
5883 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5884
ae3a6d4f
ILT
58852011-07-02 Ian Lance Taylor <iant@google.com>
5886
5887 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5888
21131061
ILT
58892011-07-01 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/12525
5892 PR gold/12952
5893 * resolve.cc (Symbol::override_base_with_special): Don't override
5894 the version if the overriding symbol has a different name.
5895 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5896 all callers. If we give an error about an undefined version,
5897 define the base version if necessary.
5898 * dynobj.h (class Versions): Update declaration.
5899 * testsuite/weak_alias_test_5.cc: New file.
5900 * testsuite/weak_alias_test.script: New file.
5901 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5902 and versioned_alias have the right value, and call t2.
5903 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5904 weak_alias_test_5.so.
5905 (weak_alias_test_LDADD): Likewise.
5906 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5907 * testsuite/Makefile.in: Rebuild.
5908
611062c0
ILT
59092011-07-01 Ian Lance Taylor <iant@google.com>
5910
5911 PR gold/12525
5912 * options.h (class General_options): Support -z notext.
5913 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5914 -Wl,-z,notext.
5915 (two_file_shared_nonpic.so): Likewise.
5916 (two_file_shared_mixed.so): Likewise.
5917 (two_file_shared_mixed_1.so): Likewise.
5918 (weak_undef_lib_nonpic.so): Likewise.
5919 (alt/weak_undef_lib_nonpic.so): Likewise.
5920 (tls_test_shared_nonpic.so): Likewise.
5921 * testsuite/Makefile.in: Rebuild.
5922
328c7c2f
ILT
59232011-07-01 Ian Lance Taylor <iant@google.com>
5924
5925 PR gold/12525
5926 * configure.ac: Test whether static linking works, setting
5927 the automake conditional HAVE_STATIC.
5928 * testsuite/Makefile.am: Disable tests using -static if
5929 HAVE_STATIC is not true.
5930 * configure, testsuite/Makefile.in: Rebuild.
5931
02d7cd44
ILT
59322011-07-01 Ian Lance Taylor <iant@google.com>
5933
5934 PR gold/12525
5935 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5936 Assert if we see DW_EH_PE_indirect.
5937 * target.h (Target::ehframe_datarel_base): New function.
5938 (Target::do_ehframe_datarel_base): New target function.
5939 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5940 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5941 function.
5942
07a60597
ILT
59432011-07-01 Ian Lance Taylor <iant@google.com>
5944
5945 PR gold/12571
5946 * options.h (class General_options): Add
5947 --ld-generated-unwind-info.
5948 * ehframe.cc (Fde::write): Add address parameter. Change all
5949 callers. If associated with PLT, fill in address and size.
5950 (Cie::set_output_offset): Only add merge mapping if there is an
5951 object.
5952 (Cie::write): Add address parameter. Change all callers.
5953 (Eh_frame::add_ehframe_for_plt): New function.
5954 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5955 input_offset_ fields into union u_, with new plt field.
5956 (Fde::Fde): Adjust for new union field.
5957 (Fde::Fde) [Output_data version]: New constructor.
5958 (Fde::add_mapping): Only add merge mapping if there is an object.
5959 (class Cie): Update declarations.
5960 (class Eh_frame): Declare add_ehframe_for_plt.
5961 * layout.cc (Layout::layout_eh_frame): Break out code into
5962 make_eh_frame_section, and call it.
5963 (Layout::make_eh_frame_section): New function.
5964 (Layout::add_eh_frame_for_plt): New function.
5965 * layout.h (class Layout): Update declarations.
5966 * merge.cc (Merge_map::add_mapping): Add assertion.
5967 * i386.cc: Include "dwarf.h".
5968 (class Output_data_plt_i386): Make first_plt_entry,
5969 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5970 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5971 and plt_eh_frame_fde.
5972 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5973 boundary. Call add_eh_frame_for_plt if appropriate.
5974 * x86_64.cc: Include "dwarf.h".
5975 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5976 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5977 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5978 and plt_eh_frame_fde.
5979 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5980 appropriate.
5981
14788a3f
ILT
59822011-06-29 Ian Lance Taylor <iant@google.com>
5983
5984 PR gold/12629
5985 * object.cc (Sized_relobj_file::layout_section): Change shdr
5986 parameter to be const.
5987 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5988 out of do_layout.
5989 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5990 appropriate. Call layout_eh_frame_section.
5991 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5992 sections.
5993 * object.h (class Sized_relobj_file): Update declarations.
5994
6c21fce1
ILT
59952011-06-29 Ian Lance Taylor <iant@google.com>
5996
37e41b03 5997 PR gold/12652
6c21fce1
ILT
5998 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5999 modifier.
6000 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6001
4d5e4e62
ILT
60022011-06-29 Ian Lance Taylor <iant@google.com>
6003
6004 PR gold/12675
6005 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6006 SHT_X86_64_UNWIND.
6007 * layout.cc (Layout::layout_eh_frame): Likewise.
6008
886f533a
ILT
60092011-06-29 Ian Lance Taylor <iant@google.com>
6010
6011 PR gold/12695
6012 * layout.cc (Layout::symtab_section_shndx): New function.
6013 * layout.h (class Layout): Declare symtab_section_shndx.
6014 * output.cc (Output_section::write_header): Call it.
6015
f3ae1b28
ILT
60162011-06-29 Ian Lance Taylor <iant@google.com>
6017
6018 PR gold/12818
6019 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6020 symbols which are not used in a relocation.
6021
aecf301f
ILT
60222011-06-28 Ian Lance Taylor <iant@google.com>
6023
6024 PR gold/12898
6025 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6026 script create indistinguishable segments.
6027 (Layout::set_segment_offsets): Use stable_sort when sorting
6028 segments. Pass this to Compare_segments constructor.
6029 * layout.h (class Layout): Make segment_precedes non-static.
6030 (class Compare_segments): Change from struct to class. Add
6031 layout_ field. Add constructor.
6032 * script-sections.cc
6033 (Script_sections::attach_sections_using_phdrs_clause): Rename
6034 local orphan to is_orphan. Don't report failure to put empty
6035 section in segment. On attachment failure, report name of
6036 section, and attach to first PT_LOAD segment.
6037
03ef7571
ILT
60382011-06-28 Ian Lance Taylor <iant@google.com>
6039
6040 PR gold/12934
6041 * target-select.cc (Target_selector::Target_selector): Add
6042 emulation parameter. Change all callers.
6043 (select_target_by_bfd_name): Rename from select_target_by_name.
6044 Change all callers.
6045 (select_target_by_emulation): New function.
6046 (supported_emulation_names): New function.
6047 * target-select.h (class Target_selector): Add emulation_ field.
6048 Update declarations.
6049 (Target_selector::recognize_by_bfd_name): Rename from
6050 recognize_by_name. Change all callers.
6051 (Target_selector::supported_bfd_names): Rename from
6052 supported_names. Change all callers.
6053 (Target_selector::recognize_by_emulation): New function.
6054 (Target_selector::supported_emulations): New function.
6055 (Target_selector::emulation): New function.
6056 (Target_selector::do_recognize_by_bfd_name): Rename from
6057 do_recognize_by_name. Change all callers.
6058 (Target_selector::do_supported_bfd_names): Rename from
6059 do_supported_names. Change all callers.
6060 (Target_selector::do_recognize_by_emulation): New function.
6061 (Target_selector::do_supported_emulations): New function.
6062 (select_target_by_bfd_name): Change name in declaration.
6063 (select_target_by_emulation): Declare.
6064 (supported_emulation_names): Declare.
6065 * parameters.cc (parameters_force_valid_target): Try to find
6066 target based on emulation from -m option.
6067 * options.h (class General_options): Change doc string for -m.
6068 * options.cc (help): Print emulations.
6069 (General_options::parse_V): Likewise.
6070 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6071 Add emulation parameter. Change all callers.
6072
200b2bb9
ILT
60732011-06-28 Ian Lance Taylor <iant@google.com>
6074
6075 * target.h (class Target): Add osabi_ field.
6076 (Target::osabi): New function.
6077 (Target::set_osabi): New function.
6078 (Target::Target): Initialize osabi_.
6079 (Target::do_adjust_elf_header): Make pure virtual.
6080 (Sized_target::do_adjust_elf_header): Declare.
6081 * target.cc (Sized_target::do_adjust_elf_header): New function.
6082 (class Sized_target): Instantiate all versions.
6083 * freebsd.h (class Target_freebsd): Remove.
6084 (Target_selector_freebsd::do_recognize): Call set_osabi on
6085 Target.
6086 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6087 (Target_selector_freebsd::set_osabi): Remove.
6088 * i386.cc (class Target_i386): Inherit from Sized_target rather
6089 than Target_freebsd.
6090 * x86_64.cc (class Target_x86_64): Likewise.
6091
b3ce541e
ILT
60922011-06-28 Ian Lance Taylor <iant@google.com>
6093
6094 * target.h (Target::can_check_for_function_pointers): Rewrite.
6095 Make non-virtual.
6096 (Target::can_icf_inline_merge_sections): Likewise.
6097 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6098 (Target::Target_info): Add can_icf_inline_merge_sections field.
6099 (Target::do_can_check_for_function_pointers): New virtual
6100 function.
6101 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6102 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6103 from can_check_for_function_pointers, move in file.
6104 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6105 section_may_have_icf_unsafe_poineters, move in file.
6106 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6107 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6108 Rename from can_check_for_function_pointers, move in file.
6109 (Target_i386::can_icf_inline_merge_sections): Remove.
6110 (Target_i386::i386_info): Initialize
6111 can_icf_inline_merge_sections.
6112 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6113 Initialize can_icf_inline_merge_sections.
6114 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6115 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6116 Rename from can_check_for_function_pointers, move in file.
6117 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6118 (Target_x86_64::x86_64_info): Initialize
6119 can_icf_inline_merge_sections.
6120 * testsuite/testfile.cc (Target_test::test_target_info):
6121 Likewise.
6122 * icf.cc (get_section_contents): Correct formatting.
6123
6d1c4efb
ILT
61242011-06-27 Ian Lance Taylor <iant@google.com>
6125
6126 * symtab.cc (Symbol::versioned_name): New function.
6127 (Symbol_table::add_to_final_symtab): Use versioned_name when
6128 appropriate.
6129 (Symbol_table::sized_write_symbol): Likewise.
6130 * symtab.h (class Symbol): Declare versioned_name.
6131 * stringpool.h (class Stringpool_template): Add variant of add
6132 which takes a std::basic_string.
6133 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6134 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6135 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6136 (ver_test_12.o): New target.
6137 * testsuite/Makefile.in: Rebuild.
6138
57eb9b50
DK
61392011-06-27 Doug Kwan <dougkwan@google.com>
6140
6141 * arm.cc (Arm_relocate_functions::thm_jump8,
6142 Arm_relocate_functions::thm_jump11): Use a wider signed
6143 type to compute offset.
6144 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6145 arm_thm_jump8.
6146 * testsuite/Makefile.in: Regenerate.
6147 * testsuite/arm_branch_in_range.sh: Check test results of
6148 arm_thm_jump11 and arm_thm_jump8.
6149 * testsuite/arm_thm_jump11.s: New test source file.
6150 * testsuite/arm_thm_jump11.t: New linker script.
6151 * testsuite/arm_thm_jump8.s: New test source file.
6152 * testsuite/arm_thm_jump8.t: New linker script.
6153
487b39df
ILT
61542011-06-24 Ian Lance Taylor <iant@google.com>
6155
6156 * layout.cc: Include "object.h".
6157 (ctors_sections_in_init_array): New static variable.
6158 (Layout::is_ctors_in_init_array): New function.
6159 (Layout::layout): Add entry to ctors_sections_in_init_array if
6160 appropriate.
6161 * layout.h (class Layout): Declare is_ctors_in_init_array.
6162 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6163 is_ctors_reverse_view is set.
6164 (Sized_relobj_file::write_sections): Add layout parameter. Change
6165 all callers. Set is_ctors_reverse_view field of View_size.
6166 (Sized_relobj_file::reverse_words): New function.
6167 * object.h (Sized_relobj_file::View_size): Add
6168 is_ctors_reverse_view field.
6169 (class Sized_relobj_file): Update declarations.
6170 * testsuite/initpri3.c: New test.
6171 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6172 initpri3b.
6173 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6174 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6175 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6176 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6177 * testsuite/Makefile.in: Rebuild.
6178
472076e4
CC
61792011-06-24 Cary Coutant <ccoutant@google.com>
6180
6181 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6182 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6183 (debug_msg_cdebug.err): New targets.
6184 * testsuite/Makefile.in: Regenerate.
6185 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6186 Fix checks for link with shared library.
6187
a60af0db
DK
61882011-06-24 Doug Kwan <dougkwan@google.com>
6189
6190 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6191 skip empty text sections.
6192 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6193
5393d741
ILT
61942011-06-22 Ian Lance Taylor <iant@google.com>
6195
6196 PR gold/12910
6197 * options.h (class General_options): Add --ctors-in-init-array.
6198 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6199 friends as SHT_PROGBITS for merging sections.
6200 (Layout::layout): Remove special handling of .init_array and
6201 friends. Don't sort if doing relocatable link. Sort for .ctors
6202 and .dtors if ctors_in_init_array.
6203 (Layout::make_output_section): Force correct section types for
6204 .init_array and friends. Don't sort if doing relocatable link,
6205 Don't sort .ctors and .dtors if ctors_in_init_array.
6206 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6207 (Layout::output_section_name): Add relobj parameter. Change all
6208 callers. Handle .ctors. and .dtors. in code rather than table.
6209 Handle .ctors and .dtors if ctors_in_init_array.
6210 (Layout::match_file_name): New function, moved from output.cc.
6211 * layout.h (class Layout): Update declarations.
6212 * output.cc: Include "layout.h".
6213 (Input_section_sort_entry::get_priority): New function.
6214 (Input_section_sort_entry::match_file_name): Just call
6215 Layout::match_file_name.
6216 (Output_section::Input_section_sort_init_fini_compare::operator()):
6217 Handle .ctors and .dtors. Sort by explicit priority rather than
6218 by name.
6219 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6220 * testsuite/initpri2.c: New test.
6221 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6222 (check_PROGRAMS): Add initpri2.
6223 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6224 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6225 * configure, testsuite/Makefile.in: Rebuild.
6226
e1f74f98
ILT
62272011-06-19 Ian Lance Taylor <iant@google.com>
6228
6229 PR gold/12880
6230 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6231 .interp section to a PT_INTERP segment even if we have seen a
6232 --dynamic-linker option. Don't do it if we have seen a PHDRS
6233 clause in a linker script.
6234 (Layout::finalize): Don't create a .interp section if we've
6235 already create a PT_INTERP segment.
6236 (Layout::create_interp): Always call choose_output_section (revert
6237 patch of 2011-06-17). Don't create PT_INTERP segment.
6238 * script-sections.cc
6239 (Script_sections::create_note_and_tls_segments): Add a .interp
6240 section to a PT_INTERP segment even if we have seen a
6241 --dynamic-linker option.
6242
766f91bb
ILT
62432011-06-18 Ian Lance Taylor <iant@google.com>
6244
6245 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6246 merely because a non-PT_LOAD segment has a dynamic reloc.
6247
0d212c3a
ILT
62482011-06-18 Ian Lance Taylor <iant@google.com>
6249
6250 * layout.cc (Layout::finish_dynamic_section): Don't create
6251 DT_FLAGS entry if not needed.
6252
911a5072
ILT
62532011-06-18 Ian Lance Taylor <iant@google.com>
6254
6255 PR gold/12745
6256 * layout.cc (Layout::layout_eh_frame): Correct handling of
6257 writable .eh_frame section.
6258
534b4e5f
ILT
62592011-06-17 Ian Lance Taylor <iant@google.com>
6260
6261 PR gold/12893
6262 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6263 symbol is redefined with the exact same object and value.
6264
10b4f102
ILT
62652011-06-17 Ian Lance Taylor <iant@google.com>
6266
6267 PR gold/12880
6268 * layout.h (class Layout): Add interp_segment_ field.
6269 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6270 (Layout::attach_allocated_section_to_segment): If making shared
6271 library, put .interp section in PT_INTERP segment.
6272 (Layout::finalize): Also call create_interp if -dynamic-linker
6273 option was used.
6274 (Layout::create_interp): Assert that there is no PT_INTERP
6275 segment. If not using a SECTIONS clause, use make_output_section.
6276 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6277 * script-sections.cc
6278 (Script_sections::create_note_and_tls_segments): If making shared
6279 library, put .interp section in PT_INTERP segment.
6280
a29b0dad
ILT
62812011-06-17 Ian Lance Taylor <iant@google.com>
6282
e588ea8d
ILT
6283 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6284 when making a shared library.
6285
62862011-06-17 Ian Lance Taylor <iant@google.com>
6287
6288 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6289 parameter. Change all callers. Don't issue warning about PC32
6290 against locally defined symbol.
a29b0dad 6291
9d3b0698
ILT
62922011-06-16 Ian Lance Taylor <iant@google.com>
6293
6294 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6295 occurs in same object.
6296
85b0f90c
AM
62972011-06-14 Alan Modra <amodra@gmail.com>
6298
6299 * po/POTFILES.in: Regenerate.
6300
a94907d9
ILT
63012011-06-09 Ian Lance Taylor <iant@google.com>
6302
6303 * script-sections.cc
6304 (Orphan_output_section::set_section_addresses): For a relocatable
6305 link set address to 0.
6306
4fb3a1c3
CC
63072011-06-09 Cary Coutant <ccoutant@google.com>
6308
6309 PR gold/12804
6310 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6311 used with --compress-debug-sections.
6312 * gold/object.cc (Sized_relobj_file::do_layout): Report
6313 uncompressed size of compressed input sections.
6314
61220854
CC
63152011-06-08 Cary Coutant <ccoutant@google.com>
6316
6317 PR gold/12804
6318 * testsuite/two_file_test_2_v1.cc: Change initialization of
6319 v2 to keep it in .data.
6320
e6455dfb
CC
63212011-06-07 Cary Coutant <ccoutant@google.com>
6322
6323 * common.cc (Symbol_table::do_allocate_commons_list): Call
6324 gold_fallback.
6325 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6326 (Errors::fallback): New function.
6327 (gold_fallback): New function.
6328 * errors.h (Errors::fallback): New function.
6329 * gold.cc (gold_exit): Change status parameter to enum; adjust
6330 all callers.
6331 (queue_initial_tasks): Call gold_fallback.
6332 * gold.h: Include cstdlib.
6333 (Exit_status): New enum type.
6334 (gold_exit): Change status parameter to enum.
6335 (gold_fallback): New function.
6336 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6337 (Layout::create_symtab_sections): Likewise.
6338 (Layout::create_shdrs): Likewise.
6339 * main.cc (main): Adjust call to gold_exit.
6340 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6341 (Output_data_got::add_got_entry_pair): Likewise.
6342 (Output_section::add_input_section): Likewise.
6343 (Output_section::add_output_section_data): Likewise.
6344 (Output_segment::set_section_list_addresses): Likewise.
6345 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6346
fb0e076f
CC
63472011-06-07 Cary Coutant <ccoutant@google.com>
6348
6349 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6350 for incremental links.
6351 * output.cc (Output_segment::set_section_list_addresses): Remove
6352 FIXME and test for TLS or BSS.
6353
a5ee4d5d
CC
63542011-06-07 Cary Coutant <ccoutant@google.com>
6355
6356 * testsuite/Makefile.am: Add incremental_copy_test,
6357 incremental_common_test_1.
6358 * testsuite/Makefile.in: Regenerate.
6359 * testsuite/common_test_1_v1.c: New source file.
6360 * testsuite/common_test_1_v2.c: New source file.
6361 * testsuite/copy_test_v1.cc: New source file.
6362
5146f448
CC
63632011-06-07 Cary Coutant <ccoutant@google.com>
6364
6365 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6366 update, allocate common from bss section's free list.
6367 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6368 linker-defined symbols.
6369 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6370 Skip GOT and PLT entries that are no longer referenced.
6371 (Output_section_incremental_inputs::write_info_blocks): Mark
6372 linker-defined symbols.
6373 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6374 * output.cc (Output_section::allocate): New function.
6375 * output.h (Output_section::allocate): New function.
6376 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6377 linker-defined symbols.
6378 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6379 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6380 (Symbol::init_base_output_data): Likewise.
6381 (Symbol::init_base_output_segment): Likewise.
6382 (Symbol::init_base_constant): Likewise.
6383 (Sized_symbol::init_output_data): Likewise.
6384 (Sized_symbol::init_output_segment): Likewise.
6385 (Sized_symbol::init_constant): Likewise.
6386 (Symbol_table::do_define_in_output_data): Likewise.
6387 (Symbol_table::do_define_in_output_segment): Likewise.
6388 (Symbol_table::do_define_as_constant): Likewise.
6389 * symtab.h (Symbol::is_predefined): New function.
6390 (Symbol::init_base_output_data): Add is_predefined parameter.
6391 (Symbol::init_base_output_segment): Likewise.
6392 (Symbol::init_base_constant): Likewise.
6393 (Symbol::is_predefined_): New data member.
6394 (Sized_symbol::init_output_data): Add is_predefined parameter.
6395 (Sized_symbol::init_output_segment): Likewise.
6396 (Sized_symbol::init_constant): Likewise.
6397 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6398
26d3c67d
CC
63992011-06-07 Cary Coutant <ccoutant@google.com>
6400
6401 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6402 instead of emit_copy_reloc.
6403 (Copy_relocs::emit_copy_reloc): Refactor.
6404 (Copy_relocs::make_copy_reloc): New function.
6405 (Copy_relocs::add_copy_reloc): Remove.
6406 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6407 section.
6408 (Copy_relocs::make_copy_reloc): New function.
6409 (Copy_relocs::add_copy_reloc): Remove.
6410 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6411 unchanged input files.
6412 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6413 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6414 Reserve BSS space for COPY relocations.
6415 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6416 (Output_section_incremental_inputs::write_info_blocks): Record
6417 whether a symbol is copied from a shared object.
6418 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6419 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6420 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6421 (Incremental_input_entry_reader::get_output_symbol_index): Add
6422 is_copy parameter.
6423 (Incremental_binary::emit_copy_relocs): New function.
6424 (Incremental_binary::do_emit_copy_relocs): New function.
6425 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6426 new data member.
6427 (Sized_incremental_binary::add_copy_reloc): New function.
6428 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6429 (Sized_incremental_binary::Copy_reloc): New struct.
6430 (Sized_incremental_binary::Copy_relocs): New typedef.
6431 (Sized_incremental_binary::copy_relocs_): New data member.
6432 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6433 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6434 * target.h (Sized_target::emit_copy_reloc): New function.
6435 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6436
7cdb37d9
CC
64372011-06-02 Cary Coutant <ccoutant@google.com>
6438
6439 PR gold/12163
6440 * gold/archive.cc (Archive::Archive): Initialize new data member.
6441 (Archive::include_all_members): Return if archive has already been
6442 included.
6443 * gold/archive.h (Archive::include_all_members_): New data member.
6444
cc643b88
NC
64452011-06-02 Nick Clifton <nickc@redhat.com>
6446
6447 * dynobj.h: Fix spelling mistake in comment.
6448 * output.cc: Likewise.
6449
f62a3ca7 64502011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6451 Asier Llano
f62a3ca7
DK
6452
6453 PR gold/12826
cc643b88 6454 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6455 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6456 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6457 redundant arm_exidx_test.so.
6458 * testsuite/Makefile.in: Regenerate.
6459 (check_SCRIPTS): Add pr12826.sh
6460 (check_DATA): Add pr12826.stdout
6461 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6462 * testsuite/pr12826.sh: New file.
6463 * testsuite/pr12826_1.s: Ditto.
6464 * testsuite/pr12826_1.s: Ditto.
6465
8dbe1edc
ILT
64662011-05-30 Ian Lance Taylor <iant@google.com>
6467
6468 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6469 sections.
6470
c49875be
ILT
64712011-05-29 Ian Lance Taylor <iant@google.com>
6472
6473 PR gold/12804
6474 * testsuite/Makefile.am: Use different file name for two_file_test
6475 temporary file for each incremental test.
6476 * testsuite/Makefile.in: Rebuild.
6477
69d53f7a
ILT
64782011-05-29 Ian Lance Taylor <iant@google.com>
6479
6480 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6481 binary input file is empty.
6482
41d0ab5f
ILT
64832011-05-27 Ian Lance Taylor <iant@google.com>
6484
6485 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6486 (ver_test_9.so): Likewise.
6487 * testsuite/Makefile.in: Rebuild.
6488
89d8a36b
CC
64892011-05-26 Cary Coutant <ccoutant@google.com>
6490
6491 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6492 * incremental.cc (Incremental_inputs::report_input_section): Fix
6493 comment, indentation.
6494 (Incremental_inputs::report_comdat_group): New function.
6495 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6496 of data for incremental input file entry.
6497 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6498 group count, COMDAT group signatures.
6499 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6500 an unchanged input file.
6501 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6502 Initialize new data member.
6503 (Incremental_object_entry::add_comdat_group): New function.
6504 (Incremental_object_entry::get_comdat_group_count): New function.
6505 (Incremental_object_entry::get_comdat_signature_key): New function.
6506 (Incremental_object_entry::groups_): New data member.
6507 (Incremental_inputs::report_comdat_group): New function.
6508 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6509 data for incremental input file entry.
6510 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6511 (Incremental_input_entry_reader::get_input_section): Adjust size of
6512 data for incremental input file entry.
6513 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6514 (Incremental_input_entry_reader::get_comdat_group_signature): New
6515 function.
6516 * object.cc (Sized_relobj::include_section_group): Report kept
6517 COMDAT groups for incremental links.
6518
1706a06f
ILT
65192011-05-24 David Meyer <pdox@google.com>
6520
6521 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6522 with name parameter. Add found_name parameter.
6523 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6524 * dirsearch.h (class Dirsearch): Update declaration.
6525
a10ae760
ILT
65262011-05-24 Ian Lance Taylor <iant@google.com>
6527
6528 * archive.cc (Library_base::should_include_member): Pull in object
6529 from archive if it defines the entry symbol.
6530 * parameters.cc (Parameters::entry): New function.
6531 * parameters.h (class Parameters): Declare entry.
6532 * output.h (class Output_file_header): Remove entry_ field.
6533 * output.cc (Output_file_header::Output_file_header): Remove entry
6534 parameter. Change all callers.
6535 (Output_file_header::entry): Use parameters->entry.
6536 * gold.cc (queue_middle_tasks): Likewise.
6537 * plugin.cc (Plugin_hook::run): Likewise.
6538
aa92d6ed
CC
65392011-05-24 Cary Coutant <ccoutant@google.com>
6540
6541 * gold.cc (queue_initial_tasks): Pass incremental base filename
6542 to Output_file::open_base_file; don't print error message.
6543 * incremental-dump.cc (main): Adjust call to
6544 Output_file::open_for_modification.
6545 * incremental-dump.cc (main): Likewise.
6546 * incremental.cc (Incremental_inputs::report_command_line):
6547 Ignore --incremental-base option when comparing command lines.
6548 Ignore parameter when given as separate argument.
6549 * options.h (class General_options): Add --incremental-base.
6550 * output.cc (Output_file::Output_file):
6551 (Output_file::open_base_file): Add base_name and writable parameters;
6552 read base file into new file; print error message here.
6553 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6554 callers.
6555 * output.h (Output_file::open_for_modification): Rename to...
6556 (Output_file::open_base_file): ...this; add base_name and
6557 writable parameters; adjust all callers.
6558 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6559 callers.
6560 * testsuite/Makefile.am (incremental_test_4): Test
6561 --incremental-base.
6562 * testsuite/Makefile.in: Regenerate.
6563
2eedd706
CC
65642011-05-24 Cary Coutant <ccoutant@google.com>
6565
6566 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6567 incremental_test_4.
6568 * testsuite/Makefile.in: Regenerate.
6569 * testsuite/two_file_test_1_v1.cc: New test source file.
6570 * testsuite/two_file_test_1b_v1.cc: New test source file.
6571 * testsuite/two_file_test_2_v1.cc: New test source file.
6572
0f1c85a6
CC
65732011-05-24 Cary Coutant <ccoutant@google.com>
6574
6575 * dynobj.h (Dynobj::do_dynobj): New function.
6576 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6577 flag and soname for shared objects.
6578 * incremental.cc (Incremental_inputs::report_object): Make
6579 either Incremental_object_entry or Incremental_dynobj_entry; add
6580 soname to string table.
6581 (Incremental_inputs::report_input_section): Add assertion.
6582 (Output_section_incremental_inputs::set_final_data_size): Adjust
6583 type of input file entry for shared libraries; adjust size of
6584 shared library info entry.
6585 (Output_section_incremental_inputs::write_input_files): Write
6586 as_needed flag for shared libraries.
6587 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6588 of input file entry for shared libraries; write soname.
6589 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6590 soname from incremental info.
6591 * incremental.h (enum Incremental_input_flags): Add
6592 INCREMENTAL_INPUT_AS_NEEDED.
6593 (Incremental_input_entry::Incremental_input_entry): Initialize new
6594 data member.
6595 (Incremental_input_entry::set_as_needed): New function.
6596 (Incremental_input_entry::as_needed): New function.
6597 (Incremental_input_entry::do_dynobj_entry): New function.
6598 (Incremental_input_entry::as_needed_): New data member.
6599 (Incremental_object_entry::Incremental_object_entry): Don't check
6600 for shared library.
6601 (Incremental_object_entry::do_type): Likewise.
6602 (class Incremental_dynobj_entry): New class.
6603 (Incremental_input_entry_reader::as_needed): New function.
6604 (Incremental_input_entry_reader::get_soname): New function.
6605 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6606 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6607 size of shared library info entry.
58797674 6608 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6609 incremental link when adding DT_NEEDED entries.
6610 * object.h (Object::Object): Initialize new data member.
6611 (Object::dynobj): New function.
6612 (Object::set_as_needed): New function.
6613 (Object::as_needed): New function.
6614 (Object::do_dynobj): New function.
6615 (Object::as_needed_): New data member.
6616
6fa2a40b
CC
66172011-05-24 Cary Coutant <ccoutant@google.com>
6618
6619 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6620 info; adjust display of GOT entries.
6621 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6622 vector of input objects; remove file_status_.
6623 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6624 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6625 got_plt reader; call target hooks to reserve GOT entries.
6626 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6627 of input file info header and GOT info entry.
6628 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6629 relocation info.
6630 (Got_plt_view_info::got_descriptor): Remove.
6631 (Got_plt_view_info::sym_index): New data member.
6632 (Got_plt_view_info::input_index): New data member.
6633 (Local_got_offset_visitor::visit): Write input file index.
6634 (Global_got_offset_visitor::visit): Write 0 for input file index.
6635 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6636 with sym_index and input_index.
6637 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6638 incremental info GOT entry; replace got_descriptor with input_index.
6639 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6640 map from input file index to object.
6641 (Sized_relobj_incr::do_layout): Replace direct data member reference
6642 with accessor function.
6643 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6644 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6645 Adjust size of input file info header.
6646 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6647 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6648 (Incremental_input_entry_reader::get_input_section): Adjust size of
6649 input file info header.
6650 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6651 of incremental info GOT entry.
6652 (Incremental_got_plt_reader::get_got_desc): Remove.
6653 (Incremental_got_plt_reader::get_got_symndx): New function.
6654 (Incremental_got_plt_reader::get_got_input_index): New function.
6655 (Sized_incremental_binary::Sized_incremental_binary): Remove
6656 file_status_; add input_objects_.
6657 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6658 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6659 (Sized_incremental_binary::file_is_unchanged): Remove.
6660 (Sized_incremental_binary::set_input_object): New function.
6661 (Sized_incremental_binary::input_object): New function.
6662 (Sized_incremental_binary::file_status_): Remove.
6663 (Sized_incremental_binary::input_objects_): New data member.
6664 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6665 references.
6666 (Sized_relobj_incr::invalid_address): Move to base class.
6667 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6668 class.
6669 (Sized_relobj_incr::do_output_section_offset): Likewise.
6670 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6671 (Sized_relobj_incr::section_offsets_): Likewise.
6672 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6673 function.
6674 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6675 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6676 with accessor function.
6677 (Sized_relobj_file::do_layout): Likewise.
6678 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6679 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6680 (Sized_relobj_file::compute_final_local_value): Replace refs to
6681 section_offsets_ with accessor function.
6682 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6683 * object.h (Relobj::Relobj): Initialize new data members.
6684 (Relobj::add_dyn_reloc): New function.
6685 (Relobj::first_dyn_reloc): New function.
6686 (Relobj::dyn_reloc_count): New function.
6687 (Relobj::first_dyn_reloc_): New data member.
6688 (Relobj::dyn_reloc_count_): New data member.
6689 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6690 references.
6691 (Sized_relobj::Address): New typedef.
6692 (Sized_relobj::invalid_address): Move here from child class.
6693 (Sized_relobj::Sized_relobj): Initialize new data members.
6694 (Sized_relobj::sized_relobj): New function.
6695 (Sized_relobj::is_output_section_offset_invalid): Move here from
6696 child class.
6697 (Sized_relobj::get_output_section_offset): Likewise.
6698 (Sized_relobj::local_has_got_offset): Likewise.
6699 (Sized_relobj::local_got_offset): Likewise.
6700 (Sized_relobj::set_local_got_offset): Likewise.
6701 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6702 (Sized_relobj::clear_got_offsets): New function.
6703 (Sized_relobj::section_offsets): Move here from child class.
6704 (Sized_relobj::do_output_section_offset): Likewise.
6705 (Sized_relobj::do_set_section_offset): Likewise.
6706 (Sized_relobj::Local_got_offsets): Likewise.
6707 (Sized_relobj::local_got_offsets_): Likewise.
6708 (Sized_relobj::section_offsets_): Likewise.
6709 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6710 references.
6711 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6712 class.
6713 (Sized_relobj_file::sized_relobj): New function
6714 (Sized_relobj_file::local_has_got_offset): Move to base class.
6715 (Sized_relobj_file::local_got_offset): Likewise.
6716 (Sized_relobj_file::set_local_got_offset): Likewise.
6717 (Sized_relobj_file::get_output_section_offset): Likewise.
6718 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6719 (Sized_relobj_file::do_output_section_offset): Likewise.
6720 (Sized_relobj_file::do_set_section_offset): Likewise.
6721 (Sized_relobj_file::Local_got_offsets): Likewise.
6722 (Sized_relobj_file::local_got_offsets_): Likewise.
6723 (Sized_relobj_file::section_offsets_): Likewise.
6724 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6725 (all constructors).
6726 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6727 (Output_reloc::get_symbol_index): Likewise.
6728 (Output_reloc::local_section_offset): Likewise.
6729 (Output_reloc::get_address): Likewise.
6730 (Output_reloc::symbol_value): Likewise.
6731 (Output_data_got::reserve_slot): Move to class definition.
6732 (Output_data_got::reserve_local): New function.
6733 (Output_data_got::reserve_slot_for_global): Remove.
6734 (Output_data_got::reserve_global): New function.
6735 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6736 (all constructors, two instantiations).
6737 (Output_reloc::get_relobj): New function (two instantiations).
6738 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6739 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6740 (Output_data_reloc::add_global): Adjust type of relobj.
6741 (Output_data_reloc::add_global_relative): Likewise.
6742 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6743 (Output_data_reloc::add_local): Likewise.
6744 (Output_data_reloc::add_local_relative): Likewise.
6745 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6746 (Output_data_reloc::add_local_section): Likewise.
6747 (Output_data_reloc::add_output_section): Likewise.
6748 (Output_data_reloc::add_absolute): Likewise.
6749 (Output_data_reloc::add_target_specific): Likewise.
6750 (Output_data_got::reserve_slot): Move definition here.
6751 (Output_data_got::reserve_local): New function.
6752 (Output_data_got::reserve_global): New function.
6753 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6754 section_offsets_ with accessor function.
6755 (Sized_relobj_file::write_sections): Likewise.
6756 (Sized_relobj_file::do_relocate_sections): Likewise.
6757 * target.h (Sized_target::reserve_local_got_entry): New function.
6758 (Sized_target::reserve_global_got_entry): New function.
6759 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6760 (Target_x86_64::reserve_global_got_entry): New function.
6761 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6762
4829d394
CC
67632011-05-23 Cary Coutant <ccoutant@google.com>
6764
6765 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6766 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6767 bit when checking got_type.
6768 * incremental.cc (Sized_incremental_binary::setup_readers):
6769 Store symbol table and string table locations; initialize bit vector
6770 of file status flags.
6771 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6772 unchanged files.
6773 (Sized_incremental_binary::do_process_got_plt): New function.
6774 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6775 (Output_section_incremental_inputs::set_final_data_size): Record
6776 file index for each input file.
6777 (Output_section_incremental_inputs::write_got_plt): Store file index
6778 instead of input entry offset for each GOT entry.
6779 * incremental.h
6780 (Incremental_input_entry::Incremental_input_entry): Initialize new
6781 data member.
6782 (Incremental_input_entry::set_offset): Store file index.
6783 (Incremental_input_entry::get_file_index): New function.
6784 (Incremental_input_entry::file_index_): New data member.
6785 (Incremental_binary::process_got_plt): New function.
6786 (Incremental_binary::do_process_got_plt): New function.
6787 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6788 data members.
6789 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6790 (Sized_incremental_binary::set_file_is_unchanged): New function.
6791 (Sized_incremental_binary::file_is_unchanged): New function.
6792 (Sized_incremental_binary::do_process_got_plt): New function.
6793 (Sized_incremental_binary::file_status_): New data member.
6794 (Sized_incremental_binary::main_symtab_loc_): New data member.
6795 (Sized_incremental_binary::main_strtab_loc_): New data member.
6796 * output.cc (Output_data_got::Got_entry::write): Add case
6797 RESERVED_CODE.
6798 (Output_data_got::add_global): Call add_got_entry.
6799 (Output_data_got::add_global_plt): Likewise.
6800 (Output_data_got::add_global_with_rel): Likewise.
6801 (Output_data_got::add_global_with_rela): Likewise.
6802 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6803 (Output_data_got::add_global_pair_with_rela): Likewise.
6804 (Output_data_got::add_local): Call add_got_entry.
6805 (Output_data_got::add_local_plt): Likewise.
6806 (Output_data_got::add_local_with_rel): Likewise.
6807 (Output_data_got::add_local_with_rela): Likewise.
6808 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6809 (Output_data_got::add_local_pair_with_rela): Likewise.
6810 (Output_data_got::reserve_slot): New function.
6811 (Output_data_got::reserve_slot_for_global): New function.
6812 (Output_data_got::add_got_entry): New function.
6813 (Output_data_got::add_got_entry_pair): New function.
6814 (Output_section::add_output_section_data): Edit FIXME.
6815 * output.h
6816 (Output_section_data_build::Output_section_data_build): New
6817 constructor with size parameter.
6818 (Output_data_space::Output_data_space): Likewise.
6819 (Output_data_got::Output_data_got): Initialize new data member; new
6820 constructor with size parameter.
6821 (Output_data_got::add_constant): Call add_got_entry.
6822 (Output_data_got::reserve_slot): New function.
6823 (Output_data_got::reserve_slot_for_global): New function.
6824 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6825 (Output_data_got::add_got_entry): New function.
6826 (Output_data_got::add_got_entry_pair): New function.
6827 (Output_data_got::free_list_): New data member.
6828 * target.h (Sized_target::init_got_plt_for_update): New function.
6829 (Sized_target::register_global_plt_entry): New function.
6830 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6831 Initialize new data member; call init; add constructor with PLT count.
6832 (Output_data_plt_x86_64::init): New function.
6833 (Output_data_plt_x86_64::add_relocation): New function.
6834 (Output_data_plt_x86_64::reserve_slot): New function.
6835 (Output_data_plt_x86_64::free_list_): New data member.
6836 (Target_x86_64::init_got_plt_for_update): New function.
6837 (Target_x86_64::register_global_plt_entry): New function.
6838 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6839 incremental updates.
6840 (Output_data_plt_x86_64::add_relocation): New function.
6841 * testsuite/object_unittest.cc (Object_test): Set default options.
6842
ec69d6da
ILT
68432011-05-16 Ian Lance Taylor <iant@google.com>
6844
6845 * options.h (class General_options): Make -i a synonym for -r.
6846
732e31de
ILT
68472011-05-16 Ian Lance Taylor <iant@google.com>
6848
6849 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6850
403676b5
CC
68512011-05-10 Cary Coutant <ccoutant@google.com>
6852
6853 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6854 strip_all (-s).
6855
5b7b7d6e
ILT
68562011-05-06 Ian Lance Taylor <iant@google.com>
6857
6858 * layout.cc (Layout::layout): If the output section flags change,
6859 update the ordering.
6860
f0f9babf
CC
68612011-04-25 Cary Coutant <ccoutant@google.com>
6862
6863 * incremental-dump.cc (dump_incremental_inputs): Print local
6864 symbol info for each input file.
6865 * incremental.cc
6866 (Output_section_incremental_inputs::set_final_data_size): Add local
6867 symbol info to input file entries in incremental info.
6868 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6869 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6870 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6871 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6872 implementation.
6873 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6874 (Sized_incr_relobj::do_relocate): Write the local symbols.
6875 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6876 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6877 Adjust size of input file header.
6878 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6879 (Incremental_inputs_reader::get_local_symbol_count): New function.
6880 (Incremental_inputs_reader::get_input_section): Adjust size of input
6881 file header.
6882 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6883 (Sized_incr_relobj::This): New typedef.
6884 (Sized_incr_relobj::sym_size): New const data member.
6885 (Sized_incr_relobj::Local_symbol): New struct.
6886 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6887 (Sized_incr_relobj::do_local_symbol_offset): New function.
6888 (Sized_incr_relobj::local_symbol_count_): New data member.
6889 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6890 (Sized_incr_relobj::local_symbol_index_): New data member.
6891 (Sized_incr_relobj::local_symbol_offset_): New data member.
6892 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6893 (Sized_incr_relobj::local_symbols_): New data member.
6894 * object.h (Relobj::output_local_symbol_count): New function.
6895 (Relobj::local_symbol_offset): New function.
6896 (Relobj::do_output_local_symbol_count): New function.
6897 (Relobj::do_local_symbol_offset): New function.
6898 (Sized_relobj::do_output_local_symbol_count): New function.
6899 (Sized_relobj::do_local_symbol_offset): New function.
6900
d0a9ace3
ILT
69012011-04-22 Vladimir Simonov <sv@sw.ru>
6902
6903 * descriptors.cc (set_close_on_exec): New function.
6904 (Descriptors::open): Use set_close_on_exec.
6905 * output.cc (S_ISLNK): Define if not defined.
6906
94a3fc8b
CC
69072011-04-22 Cary Coutant <ccoutant@google.com>
6908
6909 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6910 global symbol map.
6911 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6912 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6913 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6914 relocations.
6915 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6916 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6917 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6918 * incremental.h
6919 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6920 function.
6921 (Incremental_binary::apply_incremental_relocs): New function.
6922 (Incremental_binary::do_apply_incremental_relocs): New function.
6923 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6924 data member.
6925 (Sized_incremental_binary::add_global_symbol): New function.
6926 (Sized_incremental_binary::global_symbol): New function.
6927 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6928 (Sized_incremental_binary::symbol_map_): New data member.
6929 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6930 * target.h (Sized_target::apply_relocation): New function.
6931 * target-reloc.h (apply_relocation): New function.
6932 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6933
c87e4302
DK
69342011-04-22 Doug Kwan <dougkwan@google.com>
6935
6936 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6937 flag of a SHT_ARM_EXIDX section.
2e702c99 6938 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6939 * testsuite/Makefile.in: Regenerate.
6940 * testsuite/arm_exidx_test.s: New file.
6941 * testsuite/arm_exidx_test.sh: Same.
6942
e7782cf6
CC
69432011-04-20 Cary Coutant <ccoutant@google.com>
6944
6945 PR gold/12689
6946 * archive.h (Incremental_archive_entry::Archive_member):
6947 Initialize arg_serial_ (second constructor).
6948
308ecdc7
ILT
69492011-04-17 Ian Lance Taylor <iant@google.com>
6950
6951 * object.cc (Relocate_info::location): Simplify location string.
6952 * errors.cc (Errors::error_at_location): Don't print program
6953 name.
6954 (Errors::warning_at_location): Likewise.
6955 (Errors::undefined_symbol): Likewise.
6956 * testsuite/debug_msg.sh: Update accordingly.
6957
bec5b579
CC
69582011-04-14 Cary Coutant <ccoutant@google.com>
6959
6960 * gold/layout.cc (Layout::symtab_section_offset): New function.
6961 * gold/layout.h (Layout::symtab_section_offset): New function.
6962 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6963
88597d34
ILT
69642011-04-12 Ian Lance Taylor <iant@google.com>
6965
6966 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6967 with MREMAP_MAYMOVE.
6968 * output.h (class Output_file): Add map_is_allocated_ field.
6969 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6970 not available, provide stubs. If mremap is not available, #define
6971 it to gold_mremap.
6972 (MREMAP_MAYMOVE): Define if not defined.
6973 (Output_file::Output_file): Initialize map_is_allocated_.
6974 (Output_file::resize): Check map_is_allocated_.
6975 (Output_file::map_anonymous): If mmap fails, use malloc.
6976 (Output_file::unmap): Don't do anything for an anonymous map.
6977 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6978 is not available, provide stubs.
6979 (File_read::View::~View): Use free rather than delete[].
6980 (File_read::make_view): Use malloc rather than new[]. If mmap
6981 fails, use malloc.
6982 (File_read::find_or_make_view): Use malloc rather than new[].
6983 * gold.h: Remove HAVE_REMAP code.
6984 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6985 exists. Rename mremap to gold_mremap. If mmap is not available
6986 don't do anything.
6987 * configure, config.in: Rebuild.
6988
11e361bc
ILT
69892011-04-11 Ian Lance Taylor <iant@google.com>
6990
6991 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6992 initialize local variable v.
6993
cdc29364
CC
69942011-04-11 Cary Coutant <ccoutant@google.com>
6995
6996 * archive.cc (Archive::include_member): Adjust call to
6997 report_object.
6998 (Add_archive_symbols::run): Track argument serial numbers.
6999 (Lib_group::include_member): Likewise.
7000 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7001 * archive.h (Incremental_archive_entry::Archive_member):
7002 Initialize arg_serial_.
7003 (Archive_member::arg_serial_): New data member.
7004 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7005 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7006 incremental link.
7007 (Sized_dynobj::do_for_all_local_got_entries): New function.
7008 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7009 function.
7010 * fileread.cc (get_mtime): New function.
7011 * fileread.h (get_mtime): New function.
7012 * gold.cc (queue_initial_tasks): Check for incremental update.
7013 (process_incremental_input): New function.
7014 (queue_middle_tasks): Don't force valid target for incremental
7015 update.
7016 * incremental-dump.cc (find_input_containing_global): Adjust
7017 size of symbol info entry.
7018 (dump_incremental_inputs): Dump argument serial number and
7019 in_system_directory flag; bias shndx by 1; print symbol names
7020 when dumping per-file symbol lists; use new symbol info readers.
7021 * incremental.cc
7022 (Output_section_incremental_inputs:update_data_size): New function.
7023 (Sized_incremental_binary::setup_readers): Setup input readers
7024 for each input file; build maps for files added from libraries
7025 and scripts.
7026 (Sized_incremental_binary::check_input_args): New function.
7027 (Sized_incremental_binary::do_check_inputs): Build map of argument
7028 serial numbers to input arguments.
7029 (Sized_incremental_binary::do_file_has_changed): Rename
7030 do_file_is_unchanged to this; compare file modification times.
7031 (Sized_incremental_binary::do_init_layout): New function.
7032 (Sized_incremental_binary::do_reserve_layout): New function.
7033 (Sized_incremental_binary::do_get_input_reader): Remove.
7034 (Sized_incremental_binary::get_symtab_view): New function.
7035 (Incremental_checker::can_incrementally_link_output_file): Remove.
7036 (Incremental_inputs::report_command_line): Exclude --debug options.
7037 (Incremental_inputs::report_archive_begin): Add parameter; track
7038 argument serial numbers; don't put input file entry for archive
7039 before archive members.
7040 (Incremental_inputs::report_archive_end): Put input file entry
7041 for archive after archive members.
7042 (Incremental_inputs::report_object): Add parameter; track argument
7043 serial numbers and in_system_directory flag.
7044 (Incremental_inputs::report_script): Add parameter; track argument
7045 serial numbers.
7046 (Output_section_incremental_inputs::set_final_data_size): Adjust
7047 size of symbol info entry; check for forwarding symbols.
7048 (Output_section_incremental_inputs::write_input_files): Write
7049 in_system_directory flag and argument serial number.
7050 (Output_section_incremental_inputs::write_info_blocks): Map section
7051 indices between incremental info and original input file; store
7052 input section index for each symbol.
7053 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7054 change operator() to visit().
7055 (class Global_got_offset_visitor): Likewise.
7056 (class Global_symbol_visitor_got_plt):
7057 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7058 classes.
7059 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7060 (Sized_incr_relobj::do_read_symbols): New function.
7061 (Sized_incr_relobj::do_layout): New function.
7062 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7063 (Sized_incr_relobj::do_add_symbols): New function.
7064 (Sized_incr_relobj::do_should_include_member): New function.
7065 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7066 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7067 (Sized_incr_relobj::do_section_size): New function.
7068 (Sized_incr_relobj::do_section_name): New function.
7069 (Sized_incr_relobj::do_section_contents): New function.
7070 (Sized_incr_relobj::do_section_flags): New function.
7071 (Sized_incr_relobj::do_section_entsize): New function.
7072 (Sized_incr_relobj::do_section_address): New function.
7073 (Sized_incr_relobj::do_section_type): New function.
7074 (Sized_incr_relobj::do_section_link): New function.
7075 (Sized_incr_relobj::do_section_info): New function.
7076 (Sized_incr_relobj::do_section_addralign): New function.
7077 (Sized_incr_relobj::do_initialize_xindex): New function.
7078 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7079 (Sized_incr_relobj::do_read_relocs): New function.
7080 (Sized_incr_relobj::do_gc_process_relocs): New function.
7081 (Sized_incr_relobj::do_scan_relocs): New function.
7082 (Sized_incr_relobj::do_count_local_symbols): New function.
7083 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7084 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7085 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7086 (Sized_incr_relobj::do_relocate): New function.
7087 (Sized_incr_relobj::do_set_section_offset): New function.
7088 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7089 (Sized_incr_dynobj::do_read_symbols): New function.
7090 (Sized_incr_dynobj::do_layout): New function.
7091 (Sized_incr_dynobj::do_add_symbols): New function.
7092 (Sized_incr_dynobj::do_should_include_member): New function.
7093 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7094 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7095 (Sized_incr_dynobj::do_section_size): New function.
7096 (Sized_incr_dynobj::do_section_name): New function.
7097 (Sized_incr_dynobj::do_section_contents): New function.
7098 (Sized_incr_dynobj::do_section_flags): New function.
7099 (Sized_incr_dynobj::do_section_entsize): New function.
7100 (Sized_incr_dynobj::do_section_address): New function.
7101 (Sized_incr_dynobj::do_section_type): New function.
7102 (Sized_incr_dynobj::do_section_link): New function.
7103 (Sized_incr_dynobj::do_section_info): New function.
7104 (Sized_incr_dynobj::do_section_addralign): New function.
7105 (Sized_incr_dynobj::do_initialize_xindex): New function.
7106 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7107 (make_sized_incremental_object): New function.
7108 (Incremental_library::copy_unused_symbols): New function.
7109 (Incremental_library::do_for_all_unused_symbols): New function.
7110 * incremental.h (enum Incremental_input_flags): New type.
7111 (class Incremental_checker): Remove.
7112 (Incremental_input_entry::Incremental_input_entry): Add argument
7113 serial number.
7114 (Incremental_input_entry::arg_serial): New function.
7115 (Incremental_input_entry::set_is_in_system_directory): New function.
7116 (Incremental_input_entry::is_in_system_directory): New function.
7117 (Incremental_input_entry::arg_serial_): New data member.
7118 (Incremental_input_entry::is_in_system_directory_): New data member.
7119 (class Script_info): Move here from script.h.
7120 (Script_info::Script_info): Add filename parameter.
7121 (Script_info::filename): New function.
7122 (Script_info::filename_): New data member.
7123 (Incremental_script_entry::Incremental_script_entry): Add argument
7124 serial number.
7125 (Incremental_object_entry::Incremental_object_entry): Likewise.
7126 (Incremental_object_entry::add_input_section): Build list of input
7127 sections with map to original shndx.
7128 (Incremental_object_entry::get_input_section_index): New function.
7129 (Incremental_object_entry::shndx_): New data member.
7130 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7131 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7132 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7133 serial number.
7134 (Incremental_inputs::report_archive_begin): Likewise.
7135 (Incremental_inputs::report_object): Likewise.
7136 (Incremental_inputs::report_script): Likewise.
7137 (class Incremental_global_symbol_reader): New class.
7138 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7139 and store flags and input file type.
7140 (Incremental_input_entry_reader::arg_serial): New function.
7141 (Incremental_input_entry_reader::type): Extract type from flags.
7142 (Incremental_input_entry_reader::is_in_system_directory): New function.
7143 (Incremental_input_entry_reader::get_input_section_count): Call
7144 accessor function for type.
7145 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7146 function for type; adjust size of global symbol entry.
7147 (Incremental_input_entry_reader::get_global_symbol_count): Call
7148 accessor function for type.
7149 (Incremental_input_entry_reader::get_object_count): Likewise.
7150 (Incremental_input_entry_reader::get_object_offset): Likewise.
7151 (Incremental_input_entry_reader::get_member_count): Likewise.
7152 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7153 (Incremental_input_entry_reader::get_member_offset): Likewise.
7154 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7155 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7156 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7157 (Incremental_input_entry_reader::get_global_symbol_reader): New
7158 function.
7159 (Incremental_input_entry_reader::get_output_symbol_index): New
7160 function.
7161 (Incremental_input_entry_reader::type_): Remove.
7162 (Incremental_input_entry_reader::flags_): New data member.
7163 (Incremental_inputs_reader::input_file_offset): New function.
7164 (Incremental_inputs_reader::input_file_index): New function.
7165 (Incremental_inputs_reader::input_file): Call input_file_offset.
7166 (Incremental_inputs_reader::input_file_at_offset): New function.
7167 (Incremental_relocs_reader::get_r_type): Reformat.
7168 (Incremental_relocs_reader::get_r_shndx): Reformat.
7169 (Incremental_relocs_reader::get_r_offset): Reformat.
7170 (Incremental_relocs_reader::data): New function.
7171 (Incremental_binary::Incremental_binary): Initialize new data members.
7172 (Incremental_binary::check_inputs): Add cmdline parameter.
7173 (Incremental_binary::file_is_unchanged): Remove.
7174 (Input_reader::arg_serial): New function.
7175 (Input_reader::get_unused_symbol_count): New function.
7176 (Input_reader::get_unused_symbol): New function.
7177 (Input_reader::do_arg_serial): New function.
7178 (Input_reader::do_get_unused_symbol_count): New function.
7179 (Input_reader::do_get_unused_symbol): New function.
7180 (Incremental_binary::input_file_count): New function.
7181 (Incremental_binary::get_input_reader): Change signature to use
7182 index instead of filename.
7183 (Incremental_binary::file_has_changed): New function.
7184 (Incremental_binary::get_input_argument): New function.
7185 (Incremental_binary::get_library): New function.
7186 (Incremental_binary::get_script_info): New function.
7187 (Incremental_binary::init_layout): New function.
7188 (Incremental_binary::reserve_layout): New function.
7189 (Incremental_binary::output_file): New function.
7190 (Incremental_binary::do_check_inputs): New function.
7191 (Incremental_binary::do_file_is_unchanged): Remove.
7192 (Incremental_binary::do_file_has_changed): New function.
7193 (Incremental_binary::do_init_layout): New function.
7194 (Incremental_binary::do_reserve_layout): New function.
7195 (Incremental_binary::do_input_file_count): New function.
7196 (Incremental_binary::do_get_input_reader): Change signature.
7197 (Incremental_binary::input_args_map_): New data member.
7198 (Incremental_binary::library_map_): New data member.
7199 (Incremental_binary::script_map_): New data member.
7200 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7201 new data members.
7202 (Sized_incremental_binary::output_section): New function.
7203 (Sized_incremental_binary::inputs_reader): Add const.
7204 (Sized_incremental_binary::symtab_reader): Add const.
7205 (Sized_incremental_binary::relocs_reader): Add const.
7206 (Sized_incremental_binary::got_plt_reader): Add const.
7207 (Sized_incremental_binary::get_symtab_view): New function.
7208 (Sized_incremental_binary::Inputs_reader): New typedef.
7209 (Sized_incremental_binary::Input_entry_reader): New typedef.
7210 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7211 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7212 (Sized_incremental_binary::do_file_has_changed): New function.
7213 (Sized_incremental_binary::do_init_layout): New function.
7214 (Sized_incremental_binary::do_reserve_layout): New function.
7215 (Sized_input_reader::Inputs_reader): Remove.
7216 (Sized_input_reader::Input_entry_reader): Remove.
7217 (Sized_input_reader::do_arg_serial): New function.
7218 (Sized_input_reader::do_get_unused_symbol_count): New function.
7219 (Sized_input_reader::do_get_unused_symbol): New function.
7220 (Sized_incremental_binary::do_input_file_count): New function.
7221 (Sized_incremental_binary::do_get_input_reader): Change signature;
7222 use index instead of filename.
7223 (Sized_incremental_binary::section_map_): New data member.
7224 (Sized_incremental_binary::input_entry_readers_): New data member.
7225 (class Sized_incr_relobj): New class.
7226 (class Sized_incr_dynobj): New class.
7227 (make_sized_incremental_object): New function.
7228 (class Incremental_library): New class.
7229 * layout.cc (Free_list::num_lists): New static data member.
7230 (Free_list::num_nodes): New static data member.
7231 (Free_list::num_removes): New static data member.
7232 (Free_list::num_remove_visits): New static data member.
7233 (Free_list::num_allocates): New static data member.
7234 (Free_list::num_allocate_visits): New static data member.
7235 (Free_list::init): New function.
7236 (Free_list::remove): New function.
7237 (Free_list::allocate): New function.
7238 (Free_list::dump): New function.
7239 (Free_list::print_stats): New function.
7240 (Layout_task_runner::run): Resize output file for incremental updates.
7241 (Layout::Layout): Initialize new data members.
7242 (Layout::set_incremental_base): New function.
7243 (Layout::init_fixed_output_section): New function.
7244 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7245 incremental updates.
7246 (Layout::create_gold_note): Do not create gold note section for
7247 incremental updates.
7248 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7249 for incremental updates.
7250 (Layout::set_section_offsets): For incremental updates, allocate space
7251 from free list.
7252 (Layout::create_symtab_sections): Layout with offsets relative to
7253 start of section; for incremental updates, allocate space from free
7254 list.
7255 (Layout::create_shdrs): For incremental updates, allocate space from
7256 free list.
7257 (Layout::finish_dynamic_section): For incremental updates, do not
7258 check --as-needed (fixed in subsequent patch).
7259 * layout.h (class Free_list): New class.
7260 (Layout::set_incremental_base): New function.
7261 (Layout::incremental_base): New function.
7262 (Layout::init_fixed_output_section): New function.
7263 (Layout::allocate): New function.
7264 (Layout::incremental_base_): New data member.
7265 (Layout::free_list_): New data member.
7266 * main.cc (main): Print Free_list statistics.
7267 * object.cc (Relobj::finalize_incremental_relocs): Add
7268 clear_counts parameter; clear counts only when clear_counts is set.
7269 (Sized_relobj::Sized_relobj): Initialize new base class.
7270 (Sized_relobj::do_layout): Don't report special sections.
7271 (Sized_relobj::do_for_all_local_got_entries): New function.
7272 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7273 symtab_off to all symbol table offsets.
7274 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7275 * object.h (class Got_offset_list): Move to top of file.
7276 (Object::Object): Allow case where input_file == NULL.
7277 (Object::~Object): Likewise.
7278 (Object::input_file): Assert that input_file != NULL.
7279 (Object::lock): Allow case where input_file == NULL.
7280 (Object::unlock): Likewise.
7281 (Object::is_locked): Likewise.
7282 (Object::token): Likewise.
7283 (Object::release): Likewise.
7284 (Object::is_incremental): New function.
7285 (Object::get_mtime): New function.
7286 (Object::for_all_local_got_entries): New function.
7287 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7288 (Object::set_is_in_system_directory): New function.
7289 (Object::is_in_system_directory): New function.
7290 (Object::do_is_incremental): New function.
7291 (Object::do_get_mtime): New function.
7292 (Object::do_for_all_local_got_entries): New function.
7293 (Object::is_in_system_directory_): New data member.
7294 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7295 (class Sized_relobj_base): New class.
7296 (class Sized_relobj): Derive from Sized_relobj_base.
7297 (class Sized_relobj::Symbols): Redeclare from base class.
7298 (class Sized_relobj::local_got_offset_list): Remove.
7299 (class Sized_relobj::Output_sections): Redeclare from base class.
7300 (class Sized_relobj::do_for_all_local_got_entries): New function.
7301 (class Sized_relobj::write_local_symbols): Add offset parameter.
7302 (class Sized_relobj::local_symbol_offset_): Update comment.
7303 (class Sized_relobj::local_dynsym_offset_): Update comment.
7304 * options.cc (Input_arguments::add_file): Remove const.
7305 * options.h (Input_file_argument::Input_file_argument):
7306 Initialize arg_serial_ (all constructors).
7307 (Input_file_argument::set_arg_serial): New function.
7308 (Input_file_argument::arg_serial): New function.
7309 (Input_file_argument::arg_serial_): New data member.
7310 (Input_arguments::Input_arguments): Initialize file_count_.
7311 (Input_arguments::add_file): Remove const.
7312 (Input_arguments::number_of_input_files): New function.
7313 (Input_arguments::file_count_): New data member.
7314 (Command_line::number_of_input_files): Call
7315 Input_arguments::number_of_input_files.
7316 * output.cc (Output_segment_headers::Output_segment_headers):
7317 Set current size.
7318 (Output_section::Input_section::current_data_size): New function.
7319 (Output_section::Output_section): Initialize new data members.
7320 (Output_section::add_input_section): Don't do merge sections for
7321 an incremental link; allocate space from free list for an
7322 incremental update.
7323 (Output_section::add_output_section_data): Allocate space from
7324 free list for an incremental update.
7325 (Output_section::update_data_size): New function.
7326 (Output_section::set_fixed_layout): New function.
7327 (Output_section::reserve): New function.
7328 (Output_segment::set_section_addresses): Remove const.
7329 (Output_segment::set_section_list_addresses): Remove const; allocate
7330 space from free list for an incremental update.
7331 (Output_segment::set_offset): Adjust size of RELRO segment for an
7332 incremental update.
7333 * output.h (Output_data::current_data_size): Move here from
7334 child classes.
7335 (Output_data::pre_finalize_data_size): New function.
7336 (Output_data::update_data_size): New function.
7337 (Output_section_headers::update_data_size): new function.
7338 (Output_section_data_build::current_data_size): Move to Output_data.
7339 (Output_data_strtab::update_data_size): New function.
7340 (Output_section::current_data_size): Move to Output_data.
7341 (Output_section::set_fixed_layout): New function.
7342 (Output_section::has_fixed_layout): New function.
7343 (Output_section::reserve): New function.
7344 (Output_section::update_data_size): New function.
7345 (Output_section::has_fixed_layout_): New data member.
7346 (Output_section::free_list_): New data member.
7347 (Output_segment::set_section_addresses): Remove const.
7348 (Output_segment::set_section_list_addresses): Remove const.
7349 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7350 New function.
7351 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7352 New function.
7353 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7354 parameter when calling Add_symbols constructor; store argument
7355 serial number for members of a lib group.
7356 (Add_symbols::locks): Allow case where token == NULL.
7357 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7358 (Read_member::~Read_member): New function.
7359 (Read_member::is_runnable): New function.
7360 (Read_member::locks): New function.
7361 (Read_member::run): New function.
7362 (Check_script::~Check_script): New function.
7363 (Check_script::is_runnable): New function.
7364 (Check_script::locks): New function.
7365 (Check_script::run): New function.
7366 (Check_library::~Check_library): New function.
7367 (Check_library::is_runnable): New function.
7368 (Check_library::locks): New function.
7369 (Check_library::run): New function.
7370 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7371 (Add_symbols::library_): New data member.
7372 (class Read_member): New class.
7373 (class Check_script): New class.
7374 (class Check_library): New class.
7375 * reloc.cc (Read_relocs::is_runnable): Allow case where
7376 token == NULL.
7377 (Read_relocs::locks): Likewise.
7378 (Scan_relocs::locks): Likewise.
7379 (Relocate_task::locks): Likewise.
7380 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7381 to clear counters.
7382 (Sized_relobj::incremental_relocs_scan): Fix comment.
7383 (Sized_relobj::do_relocate): Pass output file offset to
7384 write_local_symbols.
7385 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7386 from class declaration.
7387 * script.cc (read_input_script): Allocate Script_info; pass
7388 argument serial number to report_script.
7389 * script.h (class Script_info): Move to incremental.h.
7390 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7391 * symtab.h (Symbol_table::add_from_incrobj): New function.
7392 (Symbol_table::set_file_offset): New function.
7393
b961d0d7
CC
73942011-04-05 Cary Coutant <ccoutant@google.com>
7395
7396 * incremental-dump.cc (dump_incremental_inputs): Change signature
7397 to take a Sized_incremental_binary; change caller. Use readers
7398 in Sized_incremental_binary.
7399 * incremental.cc
7400 (Sized_incremental_binary::find_incremental_inputs_sections):
7401 Rename do_find_incremental_inputs_sections to this.
7402 (Sized_incremental_binary::setup_readers): New function.
7403 (Sized_incremental_binary::do_check_inputs): Check
7404 has_incremental_info_ flag; move setup code to setup_readers;
7405 use input readers.
7406 (Sized_incremental_binary::do_file_is_unchanged): New function.
7407 (Sized_incremental_binary::do_get_input_reader): New function.
7408 * incremental.h (class Incremental_binary): Move to end of file.
7409 (Incremental_binary::file_is_unchanged): New function.
7410 (Incremental_binary::do_file_is_unchanged): New function.
7411 (Incremental_binary::Input_reader): New class.
7412 (Incremental_binary::get_input_reader): New function.
7413 (class Sized_incremental_binary): Move to end of file.
7414 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7415 input section reader classes.
7416 (Sized_incremental_binary::has_incremental_info): New function.
7417 (Sized_incremental_binary::inputs_reader): New function.
7418 (Sized_incremental_binary::symtab_reader): New function.
7419 (Sized_incremental_binary::relocs_reader): New function.
7420 (Sized_incremental_binary::got_plt_reader): New function.
7421 (Sized_incremental_binary::do_file_is_unchanged): New function.
7422 (Sized_incremental_binary::Sized_input_reader): New class.
7423 (Sized_incremental_binary::get_input_reader): New function.
7424 (Sized_incremental_binary::find_incremental_inputs_sections):
7425 Rename do_find_incremental_inputs_sections to this.
7426 (Sized_incremental_binary::setup_readers): New function.
7427 (Sized_incremental_binary::has_incremental_info_): New data member.
7428 (Sized_incremental_binary::inputs_reader_): New data member.
7429 (Sized_incremental_binary::symtab_reader_): New data member.
7430 (Sized_incremental_binary::relocs_reader_): New data member.
7431 (Sized_incremental_binary::got_plt_reader_): New data member.
7432 (Sized_incremental_binary::current_input_file_): New data member.
7433
a869183f
PP
74342011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7435
7436 PR gold/12640
7437 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7438 violation.
7439
74402011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7441
7442 * archive.cc (Archive::include_member): Adjust call to report_object.
7443 (Add_archive_symbols::run): Add script_info to call to
7444 report_archive_begin.
7445 (Lib_group::include_member): Adjust call to report_object.
7446 (Add_lib_group_symbols::run): Adjust call to report_object.
7447 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7448 blocks. Add object count for script input files.
7449 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7450 script_info parameter; change all callers.
7451 (Incremental_inputs::report_object): Add script_info parameter;
7452 change all callers.
7453 (Incremental_inputs::report_script): Store backpointer to
7454 incremental info entry.
7455 (Output_section_incremental_inputs::set_final_data_size): Record
7456 additional information for scripts.
7457 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7458 * incremental.h (Incremental_script_entry::add_object): New function.
7459 (Incremental_script_entry::get_object_count): New function.
7460 (Incremental_script_entry::get_object): New function.
7461 (Incremental_script_entry::objects_): New data member; adjust
7462 constructor.
7463 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7464 (Incremental_inputs::report_object): Add script_info parameter.
7465 (Incremental_inputs_reader::get_object_count): New function.
7466 (Incremental_inputs_reader::get_object_offset): New function.
7467 * options.cc (Input_arguments::add_file): Return reference to
7468 new input argument.
7469 * options.h (Input_argument::set_script_info): New function.
7470 (Input_argument::script_info): New function.
7471 (Input_argument::script_info_): New data member; adjust all
7472 constructors.
7473 (Input_file_group::add_file): Return reference to new input argument.
7474 (Input_file_lib::add_file): Likewise.
7475 (Input_arguments::add_file): Likewise.
7476 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7477 * script.cc (Parser_closure::Parser_closure): Add script_info
7478 parameter; adjust all callers.
7479 (Parser_closure::script_info): New function.
7480 (Parser_closure::script_info_): New data member.
7481 (read_input_script): Report scripts earlier to incremental info.
7482 (script_add_file): Set script_info in Input_argument.
7483 (script_add_library): Likewise.
7484 * script.h (Script_options::Script_info): Rewrite class.
7485
a869183f 74862011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7487
7488 * archive.cc (Library_base::should_include_member): Move
7489 method here from class Archive.
7490 (Archive::Archive): Initialize base class.
7491 (Archive::should_include_member): Move to base class.
7492 (Archive::do_for_all_unused_symbols): New function.
7493 (Add_archive_symbols::run): Remove redundant access to
7494 incremental_inputs.
7495 (Lib_group::Lib_group): Initialize base class.
7496 (Lib_group::do_filename): New function.
7497 (Lib_group::include_member): Pass pointer to Lib_group to
7498 report_object.
7499 (Lib_group::do_for_all_unused_symbols): New function.
7500 (Add_lib_group_symbols::run): Report archive information for
7501 incremental links.
7502 * archive.h (class Library_base): New base class.
7503 (class Archive): Derive from Library_base.
7504 (Archive::filename): Move to base class.
7505 (Archive::set_incremental_info): Likewise.
7506 (Archive::incremental_info): Likewise.
7507 (Archive::Should_include): Likewise.
7508 (Archive::should_include_member): Likewise.
7509 (Archive::Armap_entry): Remove.
7510 (Archive::Unused_symbol_iterator): Remove.
7511 (Archive::unused_symbols_begin): Remove.
7512 (Archive::unused_symbols_end): Remove.
7513 (Archive::do_filename): New function.
7514 (Archive::do_get_mtime): New function.
7515 (Archive::do_for_all_unused_symbols): New function.
7516 (Archive::task_): Move to base class.
7517 (Archive::incremental_info_): Likewise.
7518 (class Lib_group): Derive from Library_base.
7519 (Lib_group::do_filename): New function.
7520 (Lib_group::do_get_mtime): New function.
7521 (Lib_group::do_for_all_unused_symbols): New function.
7522 (Lib_group::task_): Move to base class.
7523 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7524 function.
7525 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7526 function.
7527 * incremental.cc (Incremental_inputs::report_archive_begin):
7528 Use Library_base; call library's get_mtime; add incremental inputs
7529 entry before members.
7530 (class Unused_symbol_visitor): New class.
7531 (Incremental_inputs::report_archive_end): Use Library_base; use
7532 visitor class to record unused symbols; don't add incremental inputs
7533 entry after members.
7534 (Incremental_inputs::report_object): Use Library_base.
7535 * incremental.h
7536 (Incremental_archive_entry::Incremental_archive_entry): Remove
7537 unused Archive parameter.
7538 (Incremental_inputs::report_archive_begin): Use Library_base.
7539 (Incremental_inputs::report_archive_end): Likewise.
7540 (Incremental_inputs::report_object): Likewise.
7541 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7542 function.
7543 * object.h (Object::for_all_global_symbols): New function.
7544 (Object::do_for_all_global_symbols): New function.
7545 (Sized_relobj::do_for_all_global_symbols): New function.
7546 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7547 function.
7548 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7549 function.
7550
61ab3e40
ILT
75512011-03-27 Ian Lance Taylor <iant@google.com>
7552
7553 * archive.cc (Archive::interpret_header): Return -1 if something
7554 goes wrong. Change callers accordingly.
7555
30e1f9e6
CC
75562011-03-25 Cary Coutant <ccoutant@google.com>
7557
7558 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7559 * testsuite/Makefile.in: Regenerate.
7560
9370ce59 75612011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7562
7563 * plugin.cc (get_view): New.
7564 (Plugin::load): Pass get_view to the plugin.
7565 (Plugin_manager::get_view): New.
7566
9312bb0a
ILT
75672011-03-21 Ian Lance Taylor <iant@google.com>
7568
7569 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7570 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7571
7e12ba9e
ST
75722011-03-21 Sriraman Tallam <tmsriram@google.com>
7573
7574 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7575 Change == to -eq.
7576 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7577 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7578 Change == to -eq.
7579 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7580 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7581
fd7a005d
ILT
75822011-03-14 Ian Lance Taylor <iant@google.com>
7583
7584 * script-sections.cc (Sort_output_sections::script_compare):
7585 Rename from is_before, change return type.
7586 (Sort_output_sections::operator()): Adjust accordingly.
7587
ed16fd1b
ILT
75882011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7589
7590 PR gold/12572
7591 * testsuite/odr_violation2.cc: Add comment to make all error line
7592 numbers double digits.
7593 * testsuite/debug_msg.sh: Adjust expected errors.
7594
71ff8986
ILT
75952011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7596
7597 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7598 but mark earlier ones as non-canonical
7599 (offset_to_iterator): Update search target and example
7600 (do_addr2line): Return extra lines in a vector*
7601 (format_file_lineno): Extract from do_addr2line
7602 (one_addr2line): Add vector* out-param
7603 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7604 when a lineno entry appeared last for its instruction
7605 (Dwarf_line_info): Add vector* out-param
7606 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7607 * symtab.cc (Odr_violation_compare): Include the lineno in the
7608 comparison again.
7609 (linenos_from_loc): New. Combine the canonical line for an
7610 address with its other lines.
7611 (True_if_intersect): New. Helper functor to make
7612 std::set_intersection a query.
7613 (detect_odr_violations): Compare sets of lines instead of just
7614 one line for each function. This became less deterministic, but
7615 has fewer false positives.
7616 * symtab.h: Declarations.
7617 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7618 mix an optimized and non-optimized object in the same binary
7619 (odr_violation2.so): Same.
7620 * testsuite/Makefile.in: Regenerate from Makefile.am.
7621 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7622 * testsuite/debug_msg.sh: Update line numbers and add
7623 assertions.
7624 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7625 non-optimized context.
7626 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7627 isn't inlined, and use OdrDerived in an optimized context.
7628 * testsuite/odr_header1.h: Defines OdrDerived, where
7629 optimization will change the
7630 first-instruction-in-the-destructor's file and line number.
7631 * testsuite/odr_header2.h: Defines OdrBase.
7632
a19fefdc
ILT
76332011-03-09 Ian Lance Taylor <iant@google.com>
7634
7635 * fileread.cc (File_read::clear_views): Don't delete the whole
7636 file view.
7637
ecb351e9
ILT
76382011-03-08 Ian Lance Taylor <iant@google.com>
7639
7640 PR gold/12525
7641 * fileread.cc: #include <climits>.
7642 (GOLD_IOV_MAX): Define.
7643 (File_read::read_multiple): Limit number of entries by iov_max.
7644 * fileread.h (class File_read): Always set max_readv_entries to
7645 128.
7646
b821d13c
ILT
76472011-03-07 Ian Lance Taylor <iant@google.com>
7648
7649 PR gold/12525
7650 * options.h (class General_options): Add -dy and -dn.
7651
89243142
CC
76522011-03-02 Cary Coutant <ccoutant@google.com>
7653
7654 * testsuite/script_test_9.t: Add TLS segment.
7655
d0773f31
ILT
76562011-03-02 Simon Baldwin <simonb@google.com>
7657
7658 * configure.ac: Add check for gnu_indirect_function support in
7659 the toolchain building binutils.
7660 * configure: Rebuild.
7661
9370ce59 76622011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7663
7664 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7665 plugin only symbols.
7666 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7667 in plugin files as not needed in the symbol table.
7668
4cf7a849
ST
76692011-02-11 Sriraman Tallam <tmsriram@google.com>
7670
7671 * output.cc (Output_section::add_input_section): Delay fill
7672 generation for section ordering.
7673
b578bd7d
ILT
76742011-02-09 Ian Lance Taylor <iant@google.com>
7675
7676 PR gold/12316
7677 * object.h (class Sized_relobj): Remove clear_local_symbols.
7678 * reloc.cc (Sized_relobj::do_relocate): Don't call
7679 clear_local_symbols.
7680
9370ce59 76812011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7682
7683 * plugin.cc (is_visible_from_outside): Return true for symbols
7684 in the -u option.
7685
55382fb7
ILT
76862011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7687
7688 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7689 filename.
7690
4e271fff
ST
76912011-02-02 Sriraman Tallam <tmsriram@google.com>
7692
7693 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7694 to std::string.
4e271fff 7695 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7696 section_name to be std::string.
4e271fff
ST
7697 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7698
d433c3ac
ILT
76992011-01-25 Ian Lance Taylor <iant@google.com>
7700
7701 * script.cc (script_add_extern): Rewrite to use
7702 add_symbol_reference.
7703
880473a6
DK
77042011-01-25 Doug Kwan <dougkwan@google.com>
7705
d433c3ac 7706 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7707
f30f86fa
ILT
77082011-01-24 Ian Lance Taylor <iant@google.com>
7709
7710 * options.h (class General_options): Accept
7711 --no-detect-odr-violations.
7712
8e51a0b9
ILT
77132011-01-24 Ian Lance Taylor <iant@google.com>
7714
7715 * version.cc (version_string): Bump to 1.11.
7716
0f3b89d8
ILT
77172011-01-24 Ian Lance Taylor <iant@google.com>
7718
7719 * plugin.cc (class Plugin_rescan): Define new class.
7720 (Plugin_manager::claim_file): Set any_claimed_.
7721 (Plugin_manager::save_archive): New function.
7722 (Plugin_manager::save_input_group): New function.
7723 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7724 necessary.
7725 (Plugin_manager::new_undefined_symbol): New function.
7726 (Plugin_manager::rescan): New function.
7727 (Plugin_manager::rescannable_defines): New function.
7728 (Plugin_manager::add_input_file): Set any_added_.
7729 * plugin.h (class Plugin_manager): define new fields rescannable_,
7730 undefined_symbols_, any_claimed_, and any_added_. Declare
7731 Plugin_rescan as friend. Declare new functions.
7732 (Plugin_manager::Rescannable): Define type.
7733 (Plugin_manager::Rescannable_list): Define type.
7734 (Plugin_manager::Undefined_symbol_list): Define type.
7735 (Plugin_manager::Plugin_manager): Initialize new fields.
7736 * archive.cc (Archive::defines_symbol): New function.
7737 (Add_archive_symbols::run): Pass archive to plugins if any.
7738 * archive.h (class Archive): Declare defines_symbol.
7739 * readsyms.cc (Input_group::~Input_group): New function.
7740 (Finish_group::run): Pass input_group to plugins if any.
7741 * readsyms.h (class Input_group): Declare destructor.
7742 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7743 any.
7744
3bb951e5
ILT
77452011-01-10 Ian Lance Taylor <iant@google.com>
7746
7747 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7748 section as relro.
7749 (Layout::set_segment_offsets): Reset increase_relro before calling
7750 set_section_addresses a second time.
7751
0aa45fac
CC
77522011-01-04 Cary Coutant <ccoutant@google.com>
7753
7754 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7755 sections before NOBITS sections.
7756
0db46eb4
L
77572011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7758
7759 * version.cc (print_version): Update copyright to 2011.
7760
829c9745
CC
77612010-12-23 Cary Coutant <ccoutant@google.com>
7762
7763 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7764 of OS to this->add. Add OD parameter to second form of the function.
7765
7500420b
ILT
77662010-12-20 Ian Lance Taylor <iant@google.com>
7767
7768 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7769 second of two consecutive entries with same offset.
7770
f8e9a930
RW
77712010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7772
7773 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7774 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7775 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7776 to avoid unneeded links against $(LDADD).
7777 * testsuite/Makefile.in: Regenerate.
7778
2fbb4320
ILT
77792010-12-15 Ian Lance Taylor <iant@google.com>
7780
7781 PR gold/12324
7782 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7783 for R_X86_64_32 and R_X86_64_PC32.
7784 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7785 ver_matching_def_pic.o.
7786 (ver_matching_def_pic.o): New target.
7787
fedb228d
RW
77882010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7789
7790 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7791 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7792 Move definition before File_read::View member definitions.
7793 (File_read::View::~View): Initialize and hold lock before
7794 updating current_mapped_bytes.
7795
9b547ce6
RW
77962010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7797
7798 * dwarf_reader.cc: Remove outdated comment.
7799 * gold-threads.cc: Fix typo in error message.
7800 * archive.cc: Fix typos in comments.
7801 * archive.h: Likewise.
7802 * arm-reloc-property.cc: Likewise.
7803 * arm-reloc-property.h: Likewise.
7804 * arm-reloc.def: Likewise.
7805 * arm.cc: Likewise.
7806 * attributes.h: Likewise.
7807 * cref.cc: Likewise.
7808 * ehframe.cc: Likewise.
7809 * fileread.h: Likewise.
7810 * gold.h: Likewise.
7811 * i386.cc: Likewise.
7812 * icf.cc: Likewise.
7813 * incremental.h: Likewise.
7814 * int_encoding.cc: Likewise.
7815 * layout.h: Likewise.
7816 * main.cc: Likewise.
7817 * merge.h: Likewise.
7818 * object.cc: Likewise.
7819 * object.h: Likewise.
7820 * options.cc: Likewise.
7821 * readsyms.cc: Likewise.
7822 * reduced_debug_output.cc: Likewise.
7823 * reloc.cc: Likewise.
7824 * script-sections.cc: Likewise.
7825 * sparc.cc: Likewise.
7826 * symtab.h: Likewise.
7827 * target-reloc.h: Likewise.
7828 * target.cc: Likewise.
7829 * target.h: Likewise.
7830 * timer.cc: Likewise.
7831 * timer.h: Likewise.
7832 * x86_64.cc: Likewise.
7833
83e17bd5
CC
78342010-12-09 Cary Coutant <ccoutant@google.com>
7835
7836 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7837 stack.
7838 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7839 parameter; change all callers.
7840 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7841 * options.h (warn_execstack): New option.
7842
017257f8
DK
78432010-12-07 Doug Kwan <dougkwan@google.com>
7844
7845 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7846 like function call relocations.
7847
c20cbc06
ILT
78482010-12-07 Ian Lance Taylor <iant@google.com>
7849
7850 * archive.cc (Archive::get_elf_object_for_member): Permit
7851 punconfigured to be NULL.
7852 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7853 (Archive::include_member): Pass NULL to get_elf_object_for_member
7854 if we searched for the archive and this is the first included
7855 object.
7856
4dbfafcc
ILT
78572010-12-01 Ian Lance Taylor <iant@google.com>
7858
7859 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7860 track_relocs_type_ field.
7861 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7862 Set track_relocs_type_.
7863 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7864 contents when using RELA relocs.
7865 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7866 reloc_map_.
7867 * reloc.cc (Track_relocs::next_addend): New function.
7868 * reloc.h (class Track_relocs): Declare next_addend.
7869
e5e19edd
ILT
78702010-12-01 Ian Lance Taylor <iant@google.com>
7871
7872 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7873 virtual destructor.
7874
9a5ce24c
ILT
78752010-12-01 Ian Lance Taylor <iant@google.com>
7876
7877 * README: Update compilers known to work and fail.
7878
c7791212
NC
78792010-11-23 Matthias Klose <doko@ubuntu.com>
7880
7881 * configure.in: For --enable-gold, handle value `default' instead of
7882 `both*'. Always install ld as ld.bfd, install as ld if gold is
7883 not the default.
7884 * configure: Regenerate.
7885
0ad220c9
DK
78862010-11-18 Doug Kwan <dougkwan@google.com>
7887
7888 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7889 and right_alignment to be zero. Store result alignment only if it is
7890 greater than existing alignment.
7891
ab8056e0
CC
78922010-11-16 Cary Coutant <ccoutant@google.com>
7893
7894 PR gold/12220
7895 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7896 Check for ".zdebug_line".
7897
fd064a5b
CC
78982010-11-16 Doug Kwan <dougkwan@google.com>
7899 Cary Coutant <ccoutant@google.com>
7900
7901 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7902 by reference; adjust all callers.
7903 * output.cc (Output_segment::set_section_addresses): Adjust references
7904 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7905 list is empty.
7906 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7907 end at page boundary.
7908
6fc6ea19
CC
79092010-11-16 Cary Coutant <ccoutant@google.com>
7910
7911 PR gold/12220
7912 * layout.cc (Layout::choose_output_section): Transform names of
7913 compressed sections even when using a script with a SECTIONS clause.
7914 (Layout::output_section_name): Remove code to transform
7915 compressed debug section names.
7916 * output.cc (Output_section::add_input_section): Use uncompressed
7917 section size when tracking input sections.
7918
95a2c8d6
RS
79192010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7920
7921 * symtab.h (Symbol::NON_PIC_REF): Remove.
7922 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7923 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7924 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7925 (Symbol::use_plt_offset): Take a flags argument and pass it
7926 directly to needs_dynamic_reloc. Restrict check for undefined
7927 weak symbols to function calls.
7928 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7929 (Target_arm::Scan::global): Use it.
7930 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7931 (Target_arm::Relocate::relocate): Likewise.
7932 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7933 parameter with an r_type parameter. Use get_reference_flags
7934 to get the flags.
7935 (Target_arm::Relocate::relocate): Update accordingly.
7936 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7937 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7938 (Target_i386::Scan::global): Likewise.
7939 (Target_i386::Relocate::relocate): Likewise.
7940 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7941 parameter with an r_type parameter. Use get_reference_flags
7942 to get the flags.
7943 (Target_i386::Relocate::relocate): Update accordingly.
7944 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7945 (Target_powerpc::Scan::global): Use it.
7946 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7947 (Target_powerpc::Relocate::relocate): Likewise.
7948 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7949 (Target_sparc::Scan::global): Use it.
7950 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7951 (Target_sparc::Relocate::relocate): Likewise.
7952 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7953 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7954 (Target_x86_64::Scan::global): Likewise.
7955 (Target_x86_64::Relocate::relocate): Likewise.
7956
f625ae50
DK
79572010-11-08 Doug Kwan <dougkwan@google.com>
7958 Cary Coutant <ccoutant@google.com>
7959
7960 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7961 (Arm_exidx_merge_section::section_contents_): New data member.
7962 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7963 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7964 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7965 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7966 in parameters instead of calling Object::section_contents without
7967 locking.
7968 (Arm_output_section::group_section): New parameter TASK. Pass it
7969 to callees that need locking objects.
7970 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7971 to lock EXIDX input sections. Fix a formatting issue. Call
7972 Arm_exidx_merged_section::build_contents to create merged section
7973 contents.
7974 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7975 to lock object of stub table owner.
7976 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7977 TEXT_SIZE to initialize data member TEXT_SIZE_.
7978 (Arm_exidx_input_section::addralign): Fix typo in comment.
7979 (Arm_exidx_input_section::text_size): New method.
7980 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7981 that require locking objects. Lock objects before scanning for stubs
7982 and updating local symbols.
7983 (Arm_input_section<big_endian>::init): Copy contents of original
7984 input section.
2e702c99 7985 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7986 original input section instead of calling Object::section_contents
7987 without locking.
7988 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7989 size without calling Object::section_size().
7990 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7991 for size. Allocate a buffer for merged EXIDX entries.
7992 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7993 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7994 building code to Arm_exidx_merged_section::build_contetns. Write
7995 out contetns in buffer instead of building it on the fly.
7996 (Arm_relobj::make_exidx_input_section): Also pass text section size
7997 to Arm_exidx_input_section constructor.
7998 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7999 (Arm_dynobj::do_read_symbols): Fix memory leak.
8000 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8001 * target.h: (class Task): Add forward declaration.
8002 (Target::relax): Add new parameter TASK and pass it to
8003 Target::do_relax().
8004 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8005
5f9bcf58
CC
80062010-11-05 Cary Coutant <ccoutant@google.com>
8007
8008 PR gold/10708
8009 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8010 object when reading from the file.
8011 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8012 second layout pass.
8013 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8014 when reading section contents.
8015 (get_section_contents): Likewise.
8016 (icf::find_identical_sections): Likewise.
8017 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8018 object when reading from the file.
8019 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8020 the object when doing deferred section layout.
8021
e597fa08
NC
80222010-11-03 Nick Clifton <nickc@redhat.com>
8023
8024 PR gold/12001
8025 * script.h (class Symbol_assignment: name): New member. Returns
8026 the name of the symbol.
8027 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8028 Returns true if the given symbol name is on the list of
8029 assignments wating to be processed.
8030 * archive.cc (should_incldue_member): If the symbol is undefined,
8031 check to see if it is on the list of symbols pending assignment.
8032
3f9a3278
ILT
80332010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8034
8035 * script-sections.cc (Script_sections::find_memory_region): Check
8036 for a NULL output section pointer.
8037
d06fb4d1
DK
80382010-10-29 Doug Kwan <dougkwan@google.com>
8039
8040 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8041 Output_section::add_relaxed_input_section.
8042 * output.cc (Output_section::add_relaxed_input_section): Add new
8043 arguments LAYOUT and NAME. Set section order index.
8044 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8045 Copy section order index.
8046 * output.h (Output_section::add_relaxed_input_section): Add new
8047 arguments LAYOUT and NAME.
8048
90e24de5
ILT
80492010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8050
8051 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8052 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8053 * testsuite/Makefile.in: Regenerate.
8054
c9484ea5
DK
80552010-10-20 Doug Kwan <dougkwan@google.com>
8056
8057 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8058 without SHF_LINK_ORDER flags.
8059 * layout.cc (Layout::choose_output_section): Do not filter
8060 SHF_LINK_ORDER flag in a relocatable link.
8061
5bc2f5be
CC
80622010-10-17 Cary Coutant <ccoutant@google.com>
8063
8064 * output.h (Output_segment::set_section_addresses): Change function
8065 signature. Update all callers.
8066 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8067 sections.
8068 (Output_segment::set_section_addresses): Align after last TLS
8069 section. Add padding before last relro section instead of after.
8070
0c91cf04
DK
80712010-10-17 Doug Kwan <dougkwan@google.com>
8072
8073 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8074 GOT output section to be writable.
8075
8c21d9d3
CC
80762010-10-14 Cary Coutant <ccoutant@google.com>
8077
8078 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8079 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8080 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8081 mode.
8082 * incremental.cc (report_command_line): Ignore all forms of
8083 --incremental.
8084 * layout.cc (Layout::Layout): Check parameters for incremental link
8085 mode.
8086 * options.cc (General_options::parse_incremental): New function.
8087 (General_options::parse_no_incremental): New function.
8088 (General_options::parse_incremental_full): New function.
8089 (General_options::parse_incremental_update): New function.
8090 (General_options::incremental_mode_): New data member.
8091 (General_options::finalize): Check incremental_mode_.
8092 * options.h (General_options): Update help text for --incremental.
8093 Add --no-incremental, --incremental-full, --incremental-update.
8094 (General_options::Incremental_mode): New enum type.
8095 (General_options::incremental_mode): New function.
8096 (General_options::incremental_mode_): New data member.
8097 * parameters.cc (Parameters::incremental_mode_): New data member.
8098 (Parameters::set_options): Set incremental_mode_.
8099 (Parameters::set_incremental_full): New function.
8100 (Parameters::incremental): New function.
8101 (Parameters::incremental_update): New function.
8102 (set_parameters_incremental_full): New function.
8103 * parameters.h (Parameters::set_incremental_full): New function.
8104 (Parameters::incremental): New function.
8105 (Parameters::incremental_update): New function.
8106 (Parameters::incremental_mode_): New data member.
8107 (set_parameters_incremental_full): New function.
8108 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8109 incremental link mode.
8110 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8111 (Sized_relobj::do_relocate_sections): Likewise.
8112 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8113 option.
8114 * testsuite/Makefile.in: Regenerate.
8115 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8116
bb32aa18 81172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8118
8119 * script-sections.h (class Script_sections): Make
8120 Sections_elements typedef public.
8121 * script-sections.cc (class Sort_output_sections): Add elements_
8122 field. Add constructor which sets it; change all callers.
8123 (Sort_output_sections::is_before): New function.
8124 (Sort_output_sections::operator()): Call is_before.
8125 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8126 conditional.
8127 * testsuite/script_test_10.sh: New test. Test script section
8128 order.
8129 * testsuite/script_test_10.t: Likewise.
8130 * testsuite/script_test_10.s: Likewise.
8131 * testsuite/Makefile.am: Wrap the cross linker tests and the
8132 common tests into NATIVE_OR_CROSS_LINKER.
8133 (check_SCRIPTS): Add script_test_10.sh.
8134 (check_DATA): Add script_test_10.stdout.
8135 (script_test_10.o, script_test_10): New targets.
8136 (script_test_10.stdout): New target.
8137 * configure, testsuite/Makefile.in: Regenerate.
8138
3cef7179
ILT
81392010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8140
8141 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8142 error for the deprecated relocations.
8143 (Target_arm::Scan::global): Likewise.
8144 (Target_arm::Relocate::relocate): Likewise.
8145
7411e9a8
RS
81462010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8147
8148 * fileread.cc (Input_file::find_file): Initialize *found_name
8149 and *namep when using the fallback search for case 4.
8150
6a9da32a
CC
81512010-10-11 Cary Coutant <ccoutant@google.com>
8152
8153 * options.h (class General_options): Redefine -z lazy as an alias for
8154 the negation of -z now.
8155
ac897c20
ILT
81562010-10-11 Ian Lance Taylor <iant@google.com>
8157
8158 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8159 binding.
8160
ea5cae92
NC
81612010-10-06 Nick Clifton <nickc@redhat.com>
8162
8163 * script-sections.cc(class Memory_region): Remove
8164 current_lma_offset_ field. Rename current_vma_offset_ to
8165 current_offset_. Add last_section_ field.
8166 (Memory_region::get_current_vma_address): Rename to
8167 get_current_address.
8168 (Memory_region::get_current_lma_address): Delete.
8169 (Memory_region::increment_vma_offset): Rename to
8170 increment_offset.
8171 (Memory_region::increment_lma_offset): Delete.
8172 (Memory_region::attributes_compatible): New method. Returns
8173 true if the provided section is compatible with the region.
8174 (Memory_region::get_last_section): New method. Returns the last
8175 section to use the region.
8176 (Memory_region::set_last_section): New method. Stores the last
8177 section to use the region.
8178 (Script_sections::block_in_region): New method. Returns true if
8179 a block of memory is contained within a region.
8180 (Script_sections::find_memory_region): New method. Locates a
8181 memory region to be used to set a VMA or LMA address.
8182 (Output_section_definition::set_section_addresses): Add code to
8183 check for addresses set by memory regions.
8184 (Output_segment::set_section_addresses): Remove memory region
8185 walking code.
8186 (Script_sections::create_segment): Add a warning if a header
8187 segment is created outside of any region.
8188 * script-sections.h (class Script_sections): Add prototypes for
8189 find_memory_region and block_in_region methods.
8190 * testsuite/memory_test.s: Use .long instead of .word.
8191 * testsuite/memory_test.t: Add some more output sections.
8192 * testsuite/memory_test.sh: Update expected output.
8193
a9bfd952
DK
81942010-10-02 Doug Kwan <dougkwan@google.com>
8195
8196 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8197 defintion to symtab.h
8198 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8199 declaration to defintion.
8200
bacff3ab
NC
82012010-10-01 Nick Clifton <nickc@redhat.com>
8202
8203 * expression.cc (eval): Replace dummy argument with NULL.
8204 (eval_maybe_dot): Check for a NULL result section pointer.
8205 (Symbol_expression::value): Likewise.
8206 (Dot_expression::value): Likewise.
8207 (BINARY_EXPRESSION): Likewise.
8208 (Max_expression::value): Likewise.
8209 (Min_expression::value): Likewise.
8210 (Absolute_expression::value): Likewise.
8211 (Addr_expression::value_from_output_section): Likewise.
8212 (Loaddddr_expression::value_from_output_section): Likewise.
8213 (Segment_start_expression::value): Likewise.
8214 * script-sections.cc
8215 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8216 argument with NULL.
8217 (Sections_elememt_dot_assignment::set_section_addresses):
8218 Likewise.
8219 (Output_data_expression::do_write_to_buffer): Likewise.
8220 (Output_section_definition::finalize_symbols): Likewise.
8221 (Output_section_definition::set_section_addresses): Likewise.
8222
f81bc8b5
DK
82232010-09-30 Doug Kwan <dougkwan@google.com>
8224
8225 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8226
c95e9f27
ST
82272010-09-28 Sriraman Tallam <tmsriram@google.com>
8228
8229 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8230 function.
c95e9f27
ST
8231 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8232 virtual function.
8233 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8234 virtual function.
8235 * icf.cc (get_section_contents): Inline merge sections only when
8236 target allows it.
8237
3cac54d2
RW
82382010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8239
8240 * configure: Regenerate.
8241
2904037a
ILT
82422010-09-17 Ian Lance Taylor <iant@google.com>
8243
8244 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8245 * testsuite/Makefile.am (memory_test.o): New target.
8246 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8247 memory_test.t.
8248 * testsuite/Makefile.in: Rebuild.
2904037a 8249
bca7fb63
DK
82502010-09-17 Doug Kwan <dougkwan@google.com>
8251
8252 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8253 defintion if relocation uses GOT entries of the symbol.
8254 * testsuite/icf_safe_test.sh: Fix test.
8255 * testsuite/icf_safe_so_test.sh: Fix test.
8256
4ef28648
CC
82572010-09-16 Cary Coutant <ccoutant@google.com>
8258
8259 * script_sections.cc (class Memory_region): Remove "NULL" from
8260 vector initializations.
8261
793990de
CC
82622010-09-15 Cary Coutant <ccoutant@google.com>
8263
8264 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8265 Resolve forwarding symbols.
8266
81e015e2
DK
82672010-09-15 Doug Kwan <dougkwan@google.com>
8268
8269 * gold/testsuite/script_test_3.t: Add ARM special sections.
8270 * gold/testsuite/script_test_4.t: Same.
8271 * gold/testsuite/script_test_5.t: Same.
8272 * gold/testsuite/script_test_6.t: Same.
8273 * gold/testsuite/script_test_7.t: Same.
8274 * gold/testsuite/script_test_7.t: Same.
8275 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8276
36171d64
CC
82772010-09-14 Cary Coutant <ccoutant@google.com>
8278
8279 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8280 (Target_x86_64::Relocate::relocate_tls): Replace check for
8281 saw_tls_block_reloc_ with test for executable section.
8282
d89051bd
CC
82832010-09-12 Cary Coutant <ccoutant@google.com>
8284
8285 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8286 position-independent executables to shared libraries need dynamic
8287 relocations.
8288 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8289 position-independent executables.
8290 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8291 * testsuite/Makefile.in: Regenerate.
8292
fca41f0f
NC
82932010-09-10 Nick Clifton <nickc@redhat.com>
8294
8295 PR gold/11997
8296 * testsuite/memory_test.t: Discard any sections that are not
8297 needed.
8298
6695e4b3
L
82992010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8300
8301 PR gold/11996
8302 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8303 "This::" to work around a bug in gcc 4.2.
8304
8305 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8306
0f72bf6f
RÁE
83072010-09-09 Rafael Espindola <espindola@google.com>
8308
8309 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8310 sections with different PF_X flags in the same segment.
8311 (Layout::find_first_load_seg): Search all segments to find the first
8312 one.
8313 * options.h (rosegment): New.
8314
83152010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8316
05a79166 8317 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8318
aa98ff75
DK
83192010-09-08 Doug Kwan <dougkwan@google.com>
8320
8321 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8322 (Arm_relobj::do_relocate_sections): Add new parameter for output
8323 file to match the parent.
8324 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8325 of local symbols instead of input values. Update code to track
8326 changes in gold::relocate_section.
8327 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8328 (Sized_relobj::compute_final_local_value_internal): New methods.
8329 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8330 body into private version of Sized_relobj::compute_final_local_value.
8331 Call the inline method.
8332 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8333 merged symbol value if there is one.
8334 (Symbol_value::has_output_value): New method defintiion.
8335 (Sized_relobj::Compute_final_local_value_status): New enum type.
8336 (Sized_relobj::compute_final_local_value): New methods.
8337 (Sized_relobj::compute_final_local_value_internal): New methods.
8338 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8339 and arm_cortex_a8.sh.
8340 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8341 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8342 New tests.
8343 * Makefile.in: Regenerate.
8344 * testsuite/arm_bl_out_of_range.s: Update test.
8345 * testsuite/thumb_bl_out_of_range.s: Ditto.
8346 * testsuite/thumb_blx_out_of_range.s: Ditto.
8347 * testsuite/arm_branch_out_of_range.sh: New file.
8348 * testsuite/arm_cortex_a8.sh: Ditto.
8349 * testsuite/arm_cortex_a8_b.s: Ditto.
8350 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8351 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8352 * testsuite/arm_cortex_a8_bl.s: Ditto.
8353 * testsuite/arm_cortex_a8_blx.s: Ditto.
8354 * testsuite/arm_cortex_a8_local.s: Ditto.
8355 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8356 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8357
05a79166
L
83582010-09-08 Rafael Espindola <espindola@google.com>
8359
8360 * Makefile.am (memory_test.stdout): Run readelf with -W.
8361 * Makefile.in: Regenerate.
8362 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8363 64 bit output.
8364
33dbc701
RÁE
83652010-09-08 Rafael Espindola <espindola@google.com>
8366
8367 * script-sections.cc (Script_sections::add_memory_region): Convert
8368 field precision to int.
8369 * script.cc (script_set_section_region, script_set_section_region):
8370 Convert field precision to int.
8371
731ca54a
RÁE
83722010-09-08 Rafael Espindola <espindola@google.com>
8373
8374 * arm.cc (do_finalize_sections): Create the __exidx_start and
8375 __exdix_end symbols even when the section is missing.
8376
7f8cd844
NC
83772010-09-08 Nick Clifton <nickc@redhat.com>
8378
8379 * README: Remove claim that MEMORY is not supported.
8380 * expression.cc (script_exp_function_origin)
8381 (script_exp_function_length): Move from here to ...
8382 * script.cc: ... here.
8383 (script_set_section_region, script_add_memory)
8384 (script_parse_memory_attr, script_include_directive): New
8385 functions.
8386 * script-sections.cc
8387 (class Memory_region): New class.
8388 (class Output_section_definition): Add set_memory_region,
8389 set_section_vma, set_section_lma and get_section_name methods.
8390 (class Script_Sections): Add add_memory_region,
8391 find_memory_region, find_memory_region_origin,
8392 find_memory_region_length and set_memory_region methods.
8393 Have set_section_addresses method walk the list of set memory
8394 regions.
8395 Extend the print methos to display memory regions.
8396 * script-sections.h: Add prototypes for new methods.
8397 Add enum for MEMORY region attributes.
8398 * yyscript.y: Add support for parsing MEMORY regions.
8399 * script-c.h: Add prototypes for new functions.
8400 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8401 * testsuite/Makefile.in: Regenerate.
8402 * testsuite/memory_test.sh: New script.
8403 * testsuite/memory_test.s: New assembler source file.
8404 * testsuite/memory_test.t: New linker script.
8405
a4649286
DK
84062010-08-27 Doug Kwan <dougkwan@google.com>
8407
8408 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8409 reference override an existing dynamic weak reference.
8410 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8411 * testsuite/Makefile.in: Regenerate.
8412 * testsuite/dyn_weak_ref.sh: New file.
8413 * testsuite/dyn_weak_ref_1.c: Ditto.
8414 * testsuite/dyn_weak_ref_2.c: Ditto.
8415
b56648ad
ILT
84162010-08-27 Ian Lance Taylor <iant@google.com>
8417
8418 * incremental.h (class Incremental_input_entry): Add virtual
8419 destructor.
8420
809313cb
ILT
84212010-08-27 Ian Lance Taylor <iant@google.com>
8422
8423 * testsuite/start_lib_test_3.c: Mark t3 as used.
8424
11e32464
NC
84252010-08-27 Nick Clifton <nickc@redhat.com>
8426
8427 * options.cc (version_script): Fix small typo in previous
8428 whitespace tidyup.
8429
ca09d69a
NC
84302010-08-25 Nick Clifton <nickc@redhat.com>
8431
8432 * archive.cc: Formatting fixes: Remove whitespace between
8433 typename and following asterisk. Remove whitespace between
8434 function name and opening parenthesis.
8435 * archive.h: Likewise.
8436 * arm.cc: Likewise.
8437 * attributes.cc: Likewise.
8438 * attributes.h: Likewise.
8439 * common.cc: Likewise.
8440 * copy-relocs.cc: Likewise.
8441 * dirsearch.h: Likewise.
8442 * dynobj.cc: Likewise.
8443 * ehframe.cc: Likewise.
8444 * ehframe.h: Likewise.
8445 * expression.cc: Likewise.
8446 * fileread.cc: Likewise.
8447 * fileread.h: Likewise.
8448 * gc.h: Likewise.
8449 * gold-threads.cc: Likewise.
8450 * gold.cc: Likewise.
8451 * i386.cc: Likewise.
8452 * icf.h: Likewise.
8453 * incremental-dump.cc: Likewise.
8454 * incremental.cc: Likewise.
8455 * layout.cc: Likewise.
8456 * layout.h: Likewise.
8457 * main.cc: Likewise.
8458 * merge.cc: Likewise.
8459 * merge.h: Likewise.
8460 * object.cc: Likewise.
8461 * object.h: Likewise.
8462 * options.cc: Likewise.
8463 * options.h: Likewise.
8464 * output.cc: Likewise.
8465 * output.h: Likewise.
8466 * plugin.cc: Likewise.
8467 * plugin.h: Likewise.
8468 * powerpc.cc: Likewise.
8469 * reloc.cc: Likewise.
8470 * script-c.h: Likewise.
8471 * script-sections.cc: Likewise.
8472 * script.cc: Likewise.
8473 * stringpool.cc: Likewise.
8474 * symtab.cc: Likewise.
8475 * symtab.h: Likewise.
8476 * target.cc: Likewise.
8477 * timer.cc: Likewise.
8478 * timer.h: Likewise.
8479 * version.cc: Likewise.
8480 * x86_64.cc: Likewise.
8481
b8fa8750
NC
84822010-08-24 Nick Clifton <nickc@redhat.com>
8483
8484 PR 11899
8485 * layout.cc (segment_precedes): Sort segments by their physical
8486 addresses, if they have been set.
8487
9919d93b
CC
84882010-08-23 Cary Coutant <ccoutant@google.com>
8489
8490 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8491 symbols data.
8492 (Lib_group::include_member): Unlock object after deleting its
8493 symbols data.
8494 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8495 the bug fixed here.
8496
97b4be1c
CC
84972010-08-19 Neil Vachharajani <nvachhar@google.com>
8498 Cary Coutant <ccoutant@google.com>
8499
8500 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8501 constructor, and set_blocker.
8502 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8503 readsyms_blocker_.
8504 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8505 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8506 * testsuite/Makefile.am (start_lib_test): New test case.
8507 * testsuite/Makefile.in: Regenerate.
8508 * testsuite/start_lib_test_main.c: New file.
8509 * testsuite/start_lib_test_1.c: New file.
8510 * testsuite/start_lib_test_2.c: New file.
8511 * testsuite/start_lib_test_3.c: New file.
8512
dd0b1884
ILT
85132010-08-19 Ian Lance Taylor <iant@google.com>
8514
8515 * Makefile.in: Rebuild with automake 1.11.1.
8516 * aclocal.m4: Likewise.
8517 * testsuite/Makefile.in: Likewise.
8518
7223e9ca
ILT
85192010-08-19 Ian Lance Taylor <iant@google.com>
8520
8521 PR 10893
8522 * i386.cc (class Output_data_plt_i386): Update declarations.
8523 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8524 local_ifuncs_ fields.
8525 (Target_i386::do_plt_section_for_global): New function.
8526 (Target_i386::do_plt_section_for_local): New function.
8527 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8528 parameter; change all callers. Initialize global_ifuncs_ and
8529 local_ifuncs_. If doing a static link define __rel_iplt_start and
8530 __rel_iplt_end.
8531 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8532 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8533 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8534 symbols.
8535 (Target_i386::make_plt_section): New function, broken out of
8536 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8537 (Target_i386::make_plt_entry): Call make_plt_section.
8538 (Target_i386::make_local_ifunc_plt_entry): New function.
8539 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8540 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8541 R_386_IRELATIVE to switch.
8542 (Target_i386::Scan::global): Likewise.
8543 (Target_i386::Relocate::relocate): Likewise.
8544 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8545 switch.
8546 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8547 (Target_x86_64::do_plt_section_for_global): New function.
8548 (Target_x86_64::do_plt_section_for_local): New function.
8549 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8550 parameter; change all callers. If doing a static link define
8551 __rela_iplt_start and __rela_iplt_end.
8552 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8553 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8554 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8555 to point to .plt.
8556 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8557 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8558 switch.
8559 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8560 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8561 R_X86_64_IRELATIVE to switch.
8562 (Target_x86_64::Scan::global): Likewise.
8563 (Target_x86_64::Relocate::relocate): Likewise.
8564 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8565 switch.
8566 * target.h (class Target): Add plt_section_for_global and
8567 plt_section_for_local functions. Add do_plt_section_for_global
8568 and do_plt_section_for_local virtual functions.
8569 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8570 clarifying comments.
8571 (Symbol::use_plt_offset): Handle IFUNC symbol.
8572 * object.cc (Sized_relobj::Sized_relobj): Initialize
8573 local_plt_offsets_.
8574 (Sized_relobj::local_has_plt_offset): New function.
8575 (Sized_relobj::local_plt_offset): New function.
8576 (Sized_relobj::set_local_plt_offset): New function.
8577 (Sized_relobj::do_count): Handle IFUNC symbol.
8578 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8579 a bit away from input_shndx_ field. Add set_is_func_symbol and
8580 is_ifunc_symbol functions.
8581 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8582 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8583 local_plt_offsets_ field.
8584 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8585 * output.h (class Output_section_data): Add non-const
8586 output_section function.
8587 (class Output_data_got): Update declarations.
8588 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8589 Add use_plt_offset parameter to global and local constructors.
8590 Change all callers. Change local_sym_index_ field to 31 bits.
8591 Change GSYM_CODE and CONSTANT_CODE accordingly.
8592 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8593 doing a static link don't set sh_link field.
8594 (Output_data_got::Got_entry::write): Use PLT offset if
8595 appropriate.
8596 (Output_data_got::add_global_plt): New function.
8597 (Output_data_got::add_local_plt): New function.
8598 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8599 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8600 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8601 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8602 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8603 IFUNC conditional.
8604 * testsuite/ifunc-sel.h: New file.
8605 * testsuite/ifuncmain1.c: New file.
8606 * testsuite/ifuncmain1vis.c: New file.
8607 * testsuite/ifuncmod1.c: New file.
8608 * testsuite/ifuncdep2.c: New file.
8609 * testsuite/ifuncmain2.c: New file.
8610 * testsuite/ifuncmain3.c: New file.
8611 * testsuite/ifuncmod3.c: New file.
8612 * testsuite/ifuncmain4.c: New file.
8613 * testsuite/ifuncmain5.c: New file.
8614 * testsuite/ifuncmod5.c: New file.
8615 * testsuite/ifuncmain6pie.c: New file.
8616 * testsuite/ifuncmod6.c: New file.
8617 * testsuite/ifuncmain7.c: New file.
8618 * configure, testsuite/Makefile.in: Rebuild.
8619
56f75c03
ILT
86202010-08-18 Ian Lance Taylor <iant@google.com>
8621
8622 * incremental.cc
8623 (Output_section_incremental_inputs::write_input_files): Add cast
8624 to avoid signed/unsigned comparison warning.
8625 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8626
55455f89
CC
86272010-08-12 Cary Coutant <ccoutant@google.com>
8628
8629 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8630
e2054bcb
ILT
86312010-08-13 Ian Lance Taylor <iant@google.com>
8632
8633 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8634
74f67560
DK
86352010-08-12 Cary Coutant <ccoutant@google.com>
8636 Doug Kwan <dougkwan@google.com>
8637
8638 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8639 defintion overrides non-weak undef, remember that the original undef
8640 is not weak.
8641 * symtab.cc (Symbol_table::sized_write_global): For undef without
8642 an original weak binding, set binding to global in output.
8643 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8644 * testsuite/Makefile.in: Regenerate.
8645 * testsuite/strong_ref_weak_def.sh: New file.
8646 * testsuite/strong_ref_weak_def_1.c: Ditto.
8647 * testsuite/strong_ref_weak_def_2.c: Ditto.
8648
d1238d12
CC
86492010-08-12 Cary Coutant <ccoutant@google.com>
8650
8651 * testsuite/incremental_test.sh: Rewrite.
8652 * testsuite/incremental_test_1.c: Rewrite.
8653 * testsuite/incremental_test_2.c: Rewrite.
8654
0e70b911
CC
86552010-08-12 Cary Coutant <ccoutant@google.com>
8656
8657 * arm.cc (Target_arm::got_size): Add const.
8658 (Target_arm::got_entry_count): New function.
8659 (Target_arm::plt_entry_count): New function.
8660 (Target_arm::first_plt_entry_offset): New function.
8661 (Target_arm::plt_entry_size): New function.
8662 (Output_data_plt_arm::entry_count): New function.
8663 (Output_data_plt_arm::first_plt_entry_offset): New function.
8664 (Output_data_plt_arm::get_plt_entry_size): New function.
8665 * i386.cc (Target_i386::got_size): Add const.
8666 (Target_i386::got_entry_count): New function.
8667 (Target_i386::plt_entry_count): New function.
8668 (Target_i386::first_plt_entry_offset): New function.
8669 (Target_i386::plt_entry_size): New function.
8670 (Output_data_plt_i386::entry_count): New function.
8671 (Output_data_plt_i386::first_plt_entry_offset): New function.
8672 (Output_data_plt_i386::get_plt_entry_size): New function.
8673 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8674 find_incremental_inputs_sections. Dump incremental_got_plt section.
8675 * incremental.cc: Include target.h.
8676 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8677 parameter. Adjust all callers. Find incremental_got_plt section.
8678 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8679 section.
8680 (Output_section_incremental_inputs::set_final_data_size): Calculate
8681 size of incremental_got_plt section.
8682 (Output_section_incremental_inputs::do_write): Write the
8683 incremental_got_plt section.
8684 (Got_plt_view_info): New struct.
8685 (Local_got_offset_visitor): New class.
8686 (Global_got_offset_visitor): New class.
8687 (Global_symbol_visitor_got_plt): New class.
8688 (Output_section_incremental_inputs::write_got_plt): New function.
8689 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8690 Add parameter. Adjust all callers.
8691 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8692 (Incremental_inputs::got_plt_section): New function.
8693 (Incremental_inputs::got_plt_section_): New data member.
8694 (Incremental_got_plt_reader): New class.
8695 * layout.cc (Layout::create_incremental_info_sections): Add the
8696 incremental_got_plt section.
8697 * object.h (Got_offset_list::get_list): New function.
8698 (Got offset_list::for_all_got_offsets): New function.
8699 (Sized_relobj::local_got_offset_list): New function.
8700 * powerpc.cc (Target_powerpc::got_size): Add const.
8701 (Target_powerpc::got_entry_count): New function.
8702 (Target_powerpc::plt_entry_count): New function.
8703 (Target_powerpc::first_plt_entry_offset): New function.
8704 (Target_powerpc::plt_entry_size): New function.
8705 (Output_data_plt_powerpc::entry_count): New function.
8706 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8707 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8708 * sparc.cc (Target_sparc::got_size): Add const.
8709 (Target_sparc::got_entry_count): New function.
8710 (Target_sparc::plt_entry_count): New function.
8711 (Target_sparc::first_plt_entry_offset): New function.
8712 (Target_sparc::plt_entry_size): New function.
8713 (Output_data_plt_sparc::entry_count): New function.
8714 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8715 (Output_data_plt_sparc::get_plt_entry_size): New function.
8716 * symtab.h (Symbol::got_offset_list): New function.
8717 (Symbol_table::for_all_symbols): New function.
8718 * target.h (Sized_target::got_entry_count): New function.
8719 (Sized_target::plt_entry_count): New function.
8720 (Sized_target::plt_entry_size): New function.
8721 * x86_64.cc (Target_x86_64::got_size): Add const.
8722 (Target_x86_64::got_entry_count): New function.
8723 (Target_x86_64::plt_entry_count): New function.
8724 (Target_x86_64::first_plt_entry_offset): New function.
8725 (Target_x86_64::plt_entry_size): New function.
8726 (Output_data_plt_x86_64::entry_count): New function.
8727 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8728 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8729
09ec0418
CC
87302010-08-12 Cary Coutant <ccoutant@google.com>
8731
8732 * archive.cc: Include incremental.h.
8733 (Archive::Archive): Initialize incremental_info_.
8734 (Archive::include_member): Record archive members in incremental info.
8735 (Add_archive_symbols::run): Record begin and end of an archive in
8736 incremental info.
8737 (Lib_group::include_member): Record objects in incremental info.
8738 * archive.h (Incremental_archive_entry): Forward declaration.
8739 (Archive::set_incremental_info): New member function.
8740 (Archive::incremental_info): New member function.
8741 (Archive::Unused_symbol_iterator): New class.
8742 (Archive::unused_symbols_begin): New member function.
8743 (Archive::unused_symbols_end): New member function.
8744 (Archive::incremental_info_): New data member.
8745 * incremental-dump.cc (find_input_containing_global): New function.
8746 (dump_incremental_inputs): Dump new incremental info sections.
8747 * incremental.cc: Include symtab.h.
8748 (Output_section_incremental_inputs): New class.
8749 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8750 new incremental info sections.
8751 (Sized_incremental_binary::do_check_inputs): Likewise.
8752 (Incremental_inputs::report_archive): Remove.
8753 (Incremental_inputs::report_archive_begin): New function.
8754 (Incremental_inputs::report_archive_end): New function.
8755 (Incremental_inputs::report_object): New function.
8756 (Incremental_inputs::finalize_inputs): Remove.
8757 (Incremental_inputs::report_input_section): New function.
8758 (Incremental_inputs::report_script): Rewrite.
8759 (Incremental_inputs::finalize): Do nothing but finalize string table.
8760 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8761 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8762 (Incremental_inputs::create_data_sections): New function.
8763 (Incremental_inputs::relocs_entsize): New function.
8764 (Output_section_incremental_inputs::set_final_data_size): New function.
8765 (Output_section_incremental_inputs::do_write): New function.
8766 (Output_section_incremental_inputs::write_header): New function.
8767 (Output_section_incremental_inputs::write_input_files): New function.
8768 (Output_section_incremental_inputs::write_info_blocks): New function.
8769 (Output_section_incremental_inputs::write_symtab): New function.
8770 * incremental.h (Incremental_script_entry): Forward declaration.
8771 (Incremental_object_entry): Forward declaration.
8772 (Incremental_archive_entry): Forward declaration.
8773 (Incremental_inputs): Forward declaration.
8774 (Incremental_inputs_header_data): Remove.
8775 (Incremental_inputs_header): Remove.
8776 (Incremental_inputs_header_write): Remove.
8777 (Incremental_inputs_entry_data): Remove.
8778 (Incremental_inputs_entry): Remove.
8779 (Incremental_inputs_entry_write): Remove.
8780 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8781 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8782 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8783 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8784 Likewise.
8785 (Incremental_input_entry): New class.
8786 (Incremental_script_entry): New class.
8787 (Incremental_object_entry): New class.
8788 (Incremental_archive_entry): New class.
8789 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8790 (Incremental_inputs::report_inputs): Remove.
8791 (Incremental_inputs::report_archive): Remove.
8792 (Incremental_inputs::report_archive_begin): New function.
8793 (Incremental_inputs::report_archive_end): New function.
8794 (Incremental_inputs::report_object): Change prototype.
8795 (Incremental_inputs::report_input_section): New function.
8796 (Incremental_inputs::report_script): Change prototype.
8797 (Incremental_inputs::get_reloc_count): New function.
8798 (Incremental_inputs::set_reloc_count): New function.
8799 (Incremental_inputs::create_data_sections): New function.
8800 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8801 (Incremental_inputs::inputs_section): New function.
8802 (Incremental_inputs::symtab_section): New function.
8803 (Incremental_inputs::relocs_section): New function.
8804 (Incremental_inputs::get_stringpool): Add const.
8805 (Incremental_inputs::command_line): Add const.
8806 (Incremental_inputs::inputs): Remove.
8807 (Incremental_inputs::command_line_key): New function.
8808 (Incremental_inputs::input_file_count): New function.
8809 (Incremental_inputs::input_files): New function.
8810 (Incremental_inputs::relocs_entsize): New function.
8811 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8812 (Incremental_inputs::finalize_inputs): Remove.
8813 (Incremental_inputs::Input_info): Remove.
8814 (Incremental_inputs::lock_): Remove.
8815 (Incremental_inputs::inputs_): Change type.
8816 (Incremental_inputs::inputs_map_): Remove.
8817 (Incremental_inputs::current_object_entry_): New data member.
8818 (Incremental_inputs::inputs_section_): New data member.
8819 (Incremental_inputs::symtab_section_): New data member.
8820 (Incremental_inputs::relocs_section_): New data member.
8821 (Incremental_inputs::reloc_count_): New data member.
8822 (Incremental_inputs_reader): New class.
8823 (Incremental_symtab_reader): New class.
8824 (Incremental_relocs_reader): New class.
8825 * layout.cc (Layout::finalize): Move finalization of incremental info
8826 and creation of incremental info sections to follow finalization of
8827 symbol table. Set offsets for postprocessing sections.
8828 (Layout::create_incremental_info_sections): Call
8829 Incremental_inputs::create_data_sections. Add incremental symtab
8830 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8831 sections to layout after input sections.
8832 * layout.h (struct Timespec): Forward declaration.
8833 (Layout::incremental_inputs): Add const.
8834 (Layout::create_incremental_info_sections): Add parameter.
8835 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8836 * object.cc: Include incremental.h.
8837 (Relobj::finalize_incremental_relocs): New function.
8838 (Sized_relobj::do_layout): Record input sections in incremental info.
8839 * object.h (Object::output_section): New function.
8840 (Object::output_section_offset): Moved from Relobj.
8841 (Object::get_incremental_reloc_base): New function.
8842 (Object::get_incremental_reloc_count): New function.
8843 (Object::do_output_section): New function.
8844 (Object::do_output_section_offset): Moved from Relobj.
8845 (Object::do_get_incremental_reloc_base): New function.
8846 (Object::do_get_incremental_reloc_count): New function.
8847 (Object::Object): Initialize new data members.
8848 (Relobj::output_section): Renamed do_output_section and moved to
8849 protected.
8850 (Relobj::output_section_offset): Moved to Object.
8851 (Relobj::do_get_incremental_reloc_base): New function.
8852 (Relobj::do_get_incremental_reloc_count): New function.
8853 (Relobj::allocate_incremental_reloc_counts): New function.
8854 (Relobj::count_incremental_reloc): New function.
8855 (Relobj::finalize_incremental_relocs): New function.
8856 (Relobj::next_incremental_reloc_index): New function.
8857 (Relobj::reloc_counts_): New data member.
8858 (Relobj::reloc_bases_): New data member.
8859 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8860 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8861 (Sized_relobj::incremental_relocs_scan): New function.
8862 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8863 (Sized_relobj::incremental_relocs_write): New function.
8864 (Sized_relobj::incremental_relocs_write_reltype): New function.
8865 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8866 incremental link.
8867 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8868 archives and object files elsewhere.
8869 (Add_symbols::run): Report object files here.
8870 (Finish_group::run): Report end of archive at end of group.
8871 * reloc.cc: Include layout.h, incremental.h.
8872 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8873 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8874 (Sized_relobj::incremental_relocs_scan): New function.
8875 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8876 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8877 (Sized_relobj::incremental_relocs_write): New function.
8878 (Sized_relobj::incremental_relocs_write_reltype): New function.
8879 * script.cc (read_input_script): Rewrite test for incremental link.
8880 Change call to Incremental_inputs::report_script.
8881 * symtab.h (Symbol_table::first_global_index): New function.
8882 (Symbol_table::output_count): New function.
8883
ce0d1972
DK
88842010-08-12 Doug Kwan <dougkwan@google.com>
8885
8886 * arm.cc (Target_arm::merge_object_attributes): Check command line
8887 options --no-wchar-size-warning and --no-enum-size-warning.
8888 * options.h (General_options): Add ld-compatible options
8889 --no-enum-size-warning and --no-wchar-size-warning.
8890
6e5710ce
ILT
88912010-08-04 Ian Lance Taylor <iant@google.com>
8892
8893 * x86_64.cc (Target_x86_64::Scan::local): Use
8894 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8895 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8896 (Target_x86_64::Scan::global): Likewise.
8897 (Target_x86_64::Relocate::relocate): Likewise.
8898 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8899 Likewise.
8900
fef830db
CC
89012010-08-03 Cary Coutant <ccoutant@google.com>
8902
8903 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8904 to reserve space in merged_strings vector. Keep total input size
8905 for stats.
8906 (Output_merge_string::do_print_merge_stats): Print total input size.
8907 * merge.h (Output_merge_string): Add input_size_ field.
8908 * stringpool.cc (Stringpool_template::string_length): Move
8909 implementations out of Stringpool_template class and place in
8910 stringpool.h.
8911 * stringpool.h (string_length): Move out of Stringpool_template.
8912
1e3811b0
ILT
89132010-08-03 Ian Lance Taylor <iant@google.com>
8914
8915 PR 11712
8916 * layout.cc (relaxation_loop_body): If address of load segment is
8917 set, adjust address to include headers if possible.
8918
7af0c620
ILT
89192010-08-03 Ian Lance Taylor <iant@google.com>
8920
8921 * version.cc (version_string): Bump to 1.10.
8922
22f0da72
ILT
89232010-08-03 Ian Lance Taylor <iant@google.com>
8924
8925 PR 11805
8926 * layout.h (enum Output_section_order): Define.
8927 (class Layout): Update declarations.
8928 * layout.cc (Layout::get_output_section): Add order parameter.
8929 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8930 is_first_non_relro parameters. Change all callers.
8931 (Layout::choose_output_section): Likewise.
8932 (Layout::add_output_section_data): Likewise.
8933 (Layout::make_output_section): Likewise. Set order.
8934 (Layout::default_section_order): New function.
8935 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8936 * output.cc (Output_section::Output_section): Initialize order_.
8937 Don't initialize deleted fields.
8938 (Output_segment::Output_segment): Don't initialize deleted
8939 fields.
8940 (Output_segment::add_output_section_to_load): New function
8941 replacing add_output_section. Change all callers to call this or
8942 add_output_section_to_nonload.
8943 (Output_segment::add_output_section_to_nonload): New function.
8944 (Output_segment::remove_output_section): Rewrite.
8945 (Output_segment::add_initial_output_data): Likewise.
8946 (Output_segment::has_any_data_sections): Likewise.
8947 (Output_segment::is_first_section_relro): Likewise.
8948 (Output_segment::maximum_alignment): Likewise.
8949 (Output_segment::has_dynamic_reloc): New function replacing
8950 dynamic_reloc_count. Change all callers.
8951 (Output_segment::has_dynamic_reloc_list): New function replacing
8952 dynamic_reloc_count_list. Change all callers.
8953 (Output_segment::set_section_addresses): Rewrite.
8954 (Output_segment::set_offset): Rewrite.
8955 (Output_segment::find_first_and_last_list): Remove.
8956 (Output_segment::set_tls_offsets): Rewrite.
8957 (Output_segment::first_section_load_address): Likewise.
8958 (Output_segment::output_section_count): Likewise.
8959 (Output_segment::section_with_lowest_load_address): Likewise.
8960 (Output_segment::write_section_headers): Likewise.
8961 (Output_segment::print_sections_to_map): Likewise.
8962 * output.h (class Output_data): Remove dynamic_reloc_count_
8963 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8964 (Output_data::add_dynamic_reloc): Rewrite.
8965 (Output_data::has_dynamic_reloc): New function.
8966 (Output_data::dynamic_reloc_count): Remove.
8967 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8968 is_last_relro_, is_first_non_relro_, is_interp_,
8969 is_dynamic_linker_section_ fields. Add order and set_order
8970 functions. Remove is_relro_local, set_is_relro_local,
8971 is_last_relro, set_is_last_relro, is_first_non_relro,
8972 set_is_first_non_relro functions, is_interp, set_is_interp,
8973 is_dynamic_linker_section, and set_is_dynamic_linker_section
8974 functions.
8975 (class Output_segment): Change Output_data_list from std::list to
8976 std:;vector. Add output_lists_ field. Remove output_data_ and
8977 output_bss_ fields. Update declarations.
8978
3ff2ccb0
ILT
89792010-08-02 Ian Lance Taylor <iant@google.com>
8980
8981 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8982 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8983 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8984
88a4108b
ILT
89852010-08-02 Ian Lance Taylor <iant@google.com>
8986
8987 PR 11855
8988 * script.cc (Script_options::Script_options): Initialize
8989 symbol_definitions_ and symbol_references_.
8990 (Script_options::add_symbol_assignment): Update
8991 symbol_definitions_ and symbol_references_.
8992 (Script_options::add_symbol_reference): New function.
8993 (script_symbol): New function.
8994 * script.h (class Script_options): Add symbol_definitions_ and
8995 symbol_references_ fields.
8996 (Script_options::referenced_const_iterator): New type.
8997 (Script_options::referenced_begin): New function.
8998 (Script_options::referenced_end): New function.
8999 (Script_options::is_referenced): New function.
9000 (Script_options::any_unreferenced): New function.
9001 * script-c.h (script_symbol): Declare.
9002 * yyscript.y (exp): Call script_symbol.
9003 * symtab.cc: Include "script.h".
9004 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9005 Change all callers. Check symbols referenced by scripts.
9006 (Symbol_table::add_undefined_symbols_from_command_line): Add
9007 layout parameter. Change all callers.
9008 (Symbol_table::do_add_undefined_symbols_from_command_line):
9009 Likewise. Break out loop body. Check symbols referenced by
9010 scripts.
9011 (Symbol_table::add_undefined_symbol_from_command_line): New
9012 function broken out of
9013 do_add_undefined_symbols_from_command_line.
9014 * symtab.h (class Symbol_table): Update declarations.
9015 * archive.cc: Include "layout.h".
9016 (Archive::should_include_member): Add layout parameter. Change
9017 all callers. Check for symbol mentioned in expression.
9018 * archive.h (class Archive): Update declaration.
9019 * object.cc (Sized_relobj::do_should_include_member): Add layout
9020 parameter.
9021 * object.h (Object::should_include_member): Add layout parameter.
9022 Change all callers.
9023 (Object::do_should_include_member): Add layout parameter.
9024 (class Sized_relobj): Update declaration.
9025 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9026 parameter.
9027 * dynobj.h (class Sized_dynobj): Update declaration.
9028 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9029 layout parameter.
9030 * plugin.h (class Sized_pluginobj): Update declaration.
9031
5f1ab67a
ILT
90322010-08-02 Ian Lance Taylor <iant@google.com>
9033
9034 PR 11866
9035 * output.cc (Output_segment::set_offset): Search for the first and
9036 last sections rather than assuming that the list is in order.
9037 (Output_segment::find_first_and_last_list): New function.
9038 * output.h (class Output_segment): Update declarations.
9039 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9040 (relro_strip_test_SOURCES): New variable.
9041 (relro_strip_test_DEPENDENCIES): New variable.
9042 (relro_strip_test_LDFLAGS): New variable.
9043 (relro_strip_test_LDADD): New variable.
9044 (relro_strip_test.so): New target.
9045
a8df5856
ILT
90462010-08-02 Ian Lance Taylor <iant@google.com>
9047
9048 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9049 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9050 (Target_i386::got_tlsdesc_section): New function.
9051 (Target_i386::got_section): Create space for GOT entries for
9052 TLSDESC relocations.
9053 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9054 R_386_TLS_GOTDESC.
9055 (Target_i386::Scan::global): Likewise.
9056 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9057 using TLSDESC GOT.
9058 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9059 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9060 (Target_x86_64::got_tlsdesc_section): New function.
9061 (Target_x86_64::got_section): Create space for GOT entries for
9062 TLSDESC relocations.
9063 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9064 R_386_TLS_GOTDESC.
9065 (Target_x86_64::Scan::global): Likewise.
9066 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9067 using TLSDESC GOT.
9068
0c10a0a6
ILT
90692010-08-02 Ian Lance Taylor <iant@google.com>
9070
9071 * testsuite/final_layout.sh: Use dc to convert from hex to
9072 decimal.
9073
41cbeecc
ST
90742010-07-29 Sriraman Tallam <tmsriram@google.com>
9075
9076 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9077 paramter to the call to gold::gc_process_relocs.
9078 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9079 paramter to the call to gold::gc_process_relocs.
9080 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9081 parameter to the call to gold::gc_process_relocs.
9082 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9083 template parameter to the call to gold::gc_process_relocs.
9084 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9085 paramter to the call to gold::gc_process_relocs.
9086 * gc.h (get_embedded_addend_size): New function.
9087 (gc_process_relocs): Save the size of the reloc for use by ICF.
9088 * icf.cc (get_section_contents): Get the addend from the text section
9089 for SHT_REL relocation sections.
9090 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9091 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9092 * int_encoding.h (read_from_pointer): New overloaded function.
9093 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9094 * testsuite/icf_sht_rel_addend_test.sh: New file.
9095 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9096 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9097
6ea55b82
RW
90982010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9099
9100 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9101 * Makefile.in: Regenerate.
9102 * testsuite/Makefile.in: Regenerate.
9103
9691462b
ILT
91042010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9105
9106 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9107 * gold/testsuite/debug_msg.cc: Likewise.
9108 * gold/testsuite/odr_violation1.cc
9109 * gold/testsuite/odr_violation2.cc
9110
76897331
CC
91112010-07-21 Cary Coutant <ccoutant@google.com>
9112
9113 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9114 string, and length fields.
9115 (Output_merge_string::Merged_strings_list): New type.
9116 (Output_merge_string::Merged_strings_lists): New typedef.
9117 (Output_merge_string): Replace merged_strings_ with
9118 merged_strings_lists_.
9119 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9120 Merged_strings_list per input object and section. Don't store pointer
9121 to the string. Don't store length with each merged string entry.
9122 (Output_merge_string::finalize_merged_data): Loop over list of merged
9123 strings lists. Recompute length of each merged string.
9124
78384e8f
CC
91252010-07-15 Cary Coutant <ccoutant@google.com>
9126
9127 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9128 here.
9129
783659f9
ILT
91302010-07-14 Ian Lance Taylor <iant@google.com>
9131
9132 * descriptors.cc (Descriptors::open): Report correct name in error
9133 message.
9134
131687b4
DK
91352010-07-13 Doug Kwan <dougkwan@google.com>
9136
9137 * arm.cc (Arm_input_section::Arm_input_section): For a
9138 SHT_ARM_EXIDX section, always keeps the input sections.
9139 (Arm_input_section::set_exidx_section_link): New method.
9140 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9141 has_errors_ to false.
9142 (Arm_exidx_input_section::has_errors,
9143 Arm_exidx_input_section::set_has_errors): New methods.
9144 (Arm_exidx_input_section::has_errors_): New data member.
9145 (Arm_relobj::get_exidx_shndx_list): New method.
9146 (Arm_output_section::append_text_sections_to_list): Do not skip
9147 section without SHF_EXECINSTR.
9148 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9149 errors.
2e702c99 9150 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9151 section header. Make error messages more verbose. Check for
9152 a non-executable section linked to an EXIDX section.
9153 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9154 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9155 check that there is no deferred EXIDX section if we exit early.
9156 Instead of not making an EXIDX section in case of an error, make one
9157 and set the has_errors flag of it.
9158 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9159 in a relocatable link.
9160 (Target_arm::do_relax): Look for the EXIDX output section instead of
9161 assuming that it is called .ARM.exidx.
2e702c99 9162 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9163 section list. Do not check for SHF_EXECINSTR section flags but
9164 skip any input section with errors.
9165 * output.cc (Output_section::Output_section): Initialize
9166 always_keeps_input_sections_ to false.
9167 (Output_section::add_input_section): Check for
9168 always_keeps_input_sections_.
9169 * output.h (Output_section::always_keeps_input_sections,
9170 Output_section::set_always_keeps_input_sections): New methods.
9171 (Output_section::always_keeps_input_sections): New data member.
9172
69517287
RÁE
91732010-07-13 Rafael Espindola <espindola@google.com>
9174
9175 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9176 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9177
82742395
ILT
91782010-07-13 Philip Herron <herron.philip@googlemail.com>
9179 Ian Lance Taylor <iant@google.com>
9180
9181 * output.h (Output_section_lookup_maps::add_merge_section):
9182 Correct check of whether value was inserted.
9183 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9184 (Output_section_lookup_maps::add_relaxed_input_section):
9185 Likewise.
9186 * arm.cc (Target_arm::got_section): Remove used local os.
9187 * i386.cc (Target_i386::got_section): Likewise.
9188 * x86_64.cc (Target_x86_64::got_section): Likewise.
9189 * sparc.cc (Target_sparc::got_section): Likewise.
9190 (Target_sparc::relocate): Remove unused local have_got_offset.
9191 * powerpc.cc (Target_powerpc::relocate): Likewise.
9192
f2d707b5
ILT
91932010-07-13 Ian Lance Taylor <iant@google.com>
9194
241531d6
ILT
9195 * compressed_output.cc (zlib_decompress): Fix signature in
9196 !HAVE_ZLIB_H case.
9197
f2d707b5
ILT
9198 * archive.cc (Archive::include_member): Unlock an external member
9199 of a thin archive. Don't bother to delete an object we know is
9200 NULL.
9201
a2e47362
CC
92022010-07-12 Cary Coutant <ccoutant@google.com>
9203
9204 * compressed_output.cc (zlib_decompress): New function.
9205 (get_uncompressed_size): New function.
9206 (decompress_input_section): New function.
9207 * compressed_output.h (get_uncompressed_size): New function.
9208 (decompress_input_section): New function.
9209 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9210 Handle compressed debug sections.
9211 * layout.cc (is_compressed_debug_section): New function.
9212 (Layout::output_section_name): Map compressed section names to
9213 canonical names.
9214 * layout.h (is_compressed_debug_section): New function.
9215 (is_debug_info_section): Recognize compressed debug sections.
9216 * merge.cc: Include compressed_output.h.
9217 (Output_merge_data::do_add_input_section): Handle compressed
9218 debug sections.
9219 (Output_merge_string::do_add_input_section): Handle compressed
9220 debug sections.
9221 * object.cc: Include compressed_output.h.
9222 (Sized_relobj::Sized_relobj): Initialize new data members.
9223 (build_compressed_section_map): New function.
9224 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9225 * object.h (Object::section_is_compressed): New method.
9226 (Object::do_section_is_compressed): New method.
9227 (Sized_relobj::Compressed_section_map): New type.
9228 (Sized_relobj::do_section_is_compressed): New method.
9229 (Sized_relobj::compressed_sections_): New data member.
9230 * output.cc (Output_section::add_input_section): Handle compressed
9231 debug sections.
9232 * reloc.cc: Include compressed_output.h.
9233 (Sized_relobj::write_sections): Handle compressed debug sections.
9234
ce279a62
CC
92352010-07-08 Cary Coutant <ccoutant@google.com>
9236
9237 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9238 weak when resolving to a dynamic def.
9239 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9240 for weak undef/dynamic def cases. Adjust callers.
9241 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9242 undef_binding_weak_.
9243 (Symbol_table::sized_write_globals): Adjust symbol binding.
9244 (Symbol_table::sized_write_symbol): Add binding parameter.
9245 * symtab.h (Symbol::set_undef_binding): New method.
9246 (Symbol::is_undef_binding_weak): New method.
9247 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9248 (Symbol_table::should_override): Add new parameter.
9249 (Symbol_table::sized_write_symbol): Add new parameter.
9250
9251 * testsuite/weak_undef_file1.cc: Add new test case.
9252 * testsuite/weak_undef_file2.cc: Fix header comment.
9253 * testsuite/weak_undef_test.cc: Add new test case.
9254
b2286c10
DK
92552010-06-29 Doug Kwan <dougkwan@google.com>
9256
9257 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9258 Initialize USE_SYMBOL_.
9259 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9260 definition.
9261 (Arm_reloc_property::uses_symbol_): New data member declaration.
9262 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9263 uses symbol value and symbol is undefined but not weakly undefined.
9264
4802450a
RÁE
92652010-06-28 Rafael Espindola <espindola@google.com>
9266
9267 * plugin.cc (Plugin::load): Use dlerror.
9268
e5ca47ba
ILT
92692010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9270
9271 * symtab.cc (detect_odr_violations): When reporting an ODR
9272 violation, report an object where the symbol is defined.
9273
8a75a161
DK
92742010-06-25 Doug Kwan <dougkwan@google.com>
9275
9276 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9277 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9278 definition.
9279 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9280 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9281 target hook to detect function points.
9282 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9283 * icf.h (Icf::check_section_for_function_pointers): Change type of
9284 parameter SECTION_NAME to const reference to std::string. Use
9285 target hook to determine if section may have unsafe pointers.
9286 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9287 method definition.
9288
42218b9f
RÁE
92892010-06-21 Rafael Espindola <espindola@google.com>
9290
9291 * fileread.cc (Input_file::find_fie): New
9292 (Input_file::open): Use Input_file::find_fie.
9293 * fileread.h (Input_file::find_fie): New
9294 * plugin.cc (set_extra_library_path): New.
9295 (Plugin::load): Add set_extra_library_path to the transfer vector.
9296 (Plugin_manager::set_extra_library_path): New.
9297 (Plugin_manager::add_input_file): Use the extra search path if set.
9298 (set_extra_library_path(): New.
9299 * plugin.h (Plugin_manager): Add set_extra_library_path and
9300 extra_search_path_.
9301
a0506cca
CC
93022010-06-19 Cary Coutant <ccoutant@google.com>
9303
9304 * layout.cc (gdb_sections): Add .debug_types.
9305 (lines_only_debug_sections): Likewise.
9306
6508b958
RÁE
93072010-06-18 Rafael Espindola <espindola@google.com>
9308
9309 * plugin.cc (add_input_file,add_input_library)
9310 (Plugin_manager::add_input_file): Make filename arguments const.
9311 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9312 const.
9313
3e235302
DK
93142010-06-16 Doug Kwan <dougkwan@google.com>
9315
9316 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9317 .ARM.attributes section if we have not merged any input
9318 attributes sections.
9319
106e8a6c
DK
93202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9321
9322 * arm.cc: Allow combining objects with no EABI version
9323 information.
9324
91ff43fe
RÁE
93252010-06-15 Rafael Espindola <espindola@google.com>
9326
9327 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9328
68ed838c
ILT
93292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9330
9331 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9332 (struct iovec): Correct !HAVE_READV definition.
9333
f3a2388f
CC
93342010-06-10 Cary Coutant <ccoutant@google.com>
9335
9336 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9337 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9338 reloc sections.
9339 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9340
9341 PR 11683
9342 * symtab.h (Symbol::is_placeholder): New member function.
9343 * target-reloc.h (relocate_section): Check for placeholder symbols.
9344
9345 * testsuite/Makefile.am (plugin_test_8): New test.
9346 (plugin_test_9): New test.
9347 * testsuite/Makefile.in: Regenerate.
9348
e1df38aa
NC
93492010-06-09 Nick Clifton <nickc@redhat.com>
9350
9351 * yyscript.y (input_list_element): Allow strings prefixed with
9352 the '-' character. Treat these as libraries.
9353 * script.cc (script_add_library): New function. Adds a library
9354 specified by "-l<name>" found in an input script.
9355 * script-c.h: Add prototype for script_add_library.
9356
25bbe950
DK
93572010-06-07 Doug Kwan <dougkwan@google.com>
9358
9359 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9360 Restrict stub-group size to be within long conditional branch
9361 range when working around cortex-A8 erratum.
9362
0f32ea4c
ILT
93632010-06-07 Damien Diederen <dd@crosstwine.com>
9364
9365 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9366 #ifdef typo.
9367
8fe2a369
ST
93682010-06-03 Sriraman Tallam <tmsriram@google.com>
9369
9370 PR gold/11658
9371 * output.cc
9372 (Output_section::Input_section_sort_entry::compare_section_ordering):
9373 Change to return non-zero correctly.
9374 (Output_section::Input_section_sort_section_order_index_compare
9375 ::operator()): Change to fix ambiguity in comparisons.
9376
6e9ba2ca
ST
93772010-06-01 Sriraman Tallam <tmsriram@google.com>
9378
9379 * gold.h (is_wildcard_string): New function.
9380 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9381 (Layout::layout_eh_frame): Ditto.
9382 (Layout::find_section_order_index): New method.
9383 (Layout::read_layout_from_file): New method.
9384 * layout.h (Layout::find_section_order_index): New method.
9385 (Layout::read_layout_from_file): New method.
9386 (Layout::input_section_position_): New private member.
9387 (Layout::input_section_glob_): New private member.
9388 * main.cc (main): Call read_layout_from_file here.
9389 * options.h (--section-ordering-file): New option.
9390 * output.cc (Output_section::input_section_order_specified_): New
9391 member.
9392 (Output_section::Output_section): Initialize new member.
9393 (Output_section::add_input_section): Add new parameter.
9394 Keep input sections when --section-ordering-file is used.
9395 (Output_section::set_final_data_size): Sort input sections when
9396 section ordering file is specified.
9397 (Output_section::Input_section_sort_entry): Add new parameter.
9398 Check sorting type.
9399 (Output_section::Input_section_sort_entry::compare_section_ordering):
9400 New method.
9401 (Output_section::Input_section_sort_compare::operator()): Change to
9402 consider section_order_index.
9403 (Output_section::Input_section_sort_init_fini_compare::operator()):
9404 Change to consider section_order_index.
9405 (Output_section::Input_section_sort_section_order_index_compare
9406 ::operator()): New method.
9407 (Output_section::sort_attached_input_sections): Change to sort
9408 according to section order when specified.
e1df38aa
NC
9409 (Output_section::add_input_section<32, true>): Add new parameter.
9410 (Output_section::add_input_section<64, true>): Add new parameter.
9411 (Output_section::add_input_section<32, false>): Add new parameter.
9412 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9413 * output.h (Output_section::add_input_section): Add new parameter.
9414 (Output_section::input_section_order_specified): New
9415 method.
9416 (Output_section::set_input_section_order_specified): New method.
9417 (Input_section::Input_section): Initialize section_order_index_.
9418 (Input_section::section_order_index): New method.
9419 (Input_section::set_section_order_index): New method.
9420 (Input_section::section_order_index_): New member.
9421 (Input_section::Input_section_sort_section_order_index_compare): New
9422 struct.
9423 (Output_section::input_section_order_specified_): New member.
9424 * script-sections.cc (is_wildcard_string): Delete and move modified
9425 method to gold.h.
9426 (Output_section_element_input::Output_section_element_input): Modify
9427 call to is_wildcard_string.
9428 (Output_section_element_input::Input_section_pattern
9429 ::Input_section_pattern): Ditto.
9430 (Output_section_element_input::Output_section_element_input): Ditto.
9431 * testsuite/Makefile.am (final_layout): New test case.
9432 * testsuite/Makefile.in: Regenerate.
9433 * testsuite/final_layout.cc: New file.
9434 * testsuite/final_layout.sh: New file.
9435
3537c84b
RÁE
94362010-06-01 Rafael Espindola <espindola@google.com>
9437
9438 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9439
105b6afd
RÁE
94402010-06-01 Rafael Espindola <espindola@google.com>
9441
9442 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9443 visibility of symbols.
9444
29e11421
DK
94452010-05-27 Doug Kwan <dougkwan@google.com>
9446
9447 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9448 from start of output section instead of address for a local symbol
9449 in a merged or relaxed section when doing a relocatable link.
9450
5e0f337e
RÁE
94512010-05-26 Rafael Espindola <espindola@google.com>
9452
703d02da 9453 PR 11604
5e0f337e
RÁE
9454 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9455 adding sections the garbage collector removed.
9456 * gold/testsuite/Makefile.am: Add test.
9457 * gold/testsuite/Makefile.in: Regenerate.
9458 * gold/testsuite/plugin_test_7.sh: New.
9459 * gold/testsuite/plugin_test_7_1.c: New.
9460 * gold/testsuite/plugin_test_7_2.c: New.
9461
f4187277
RÁE
94622010-05-26 Rafael Espindola <espindola@google.com>
9463
9464 * script-sections.cc (Output_section_definition::set_section_addresses):
9465 Check for --section-start.
9466
5c388529
DK
94672010-05-26 Doug Kwan <dougkwan@google.com>
9468
9469 * arm.cc (Arm_scan_relocatable_relocs): New class.
9470 (Target_arm::relocate_special_relocatable): New method.
9471 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9472 (Arm_relocate_functions::thumb_branch_common): Same.
9473 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9474 instead of Default_scan_relocatable_relocs.
9475 * target-reloc.h (relocate_for_relocatable): Let target handle
9476 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9477 * target.h (Sized_target::relocate_special_relocatable): New method.
9478
bca1c3ae
ILT
94792010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9480
9481 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9482
0439c796
DK
94832010-05-23 Doug Kwan <dougkwan@google.com>
9484
9485 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9486 instead of a cast.
9487 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9488 with a direct branch, not a conditional branch, to a stub.
9489 * merge.cc (Output_merge_base::record_input_section): New method
9490 defintion.
9491 (Output_merge_data::do_add_input_section): Record input section if
9492 keeps-input-sections flag is set.
9493 (Output_merge_string::do_add_input_section): Ditto.
9494 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9495 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9496 INPUT_SECTIONS_.
9497 (Output_merge_base::keeps_input_sections,
9498 Output_merge_base::set_keeps_input_sections,
9499 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9500 method definitions.
9501 (Output_merge_base::Input_sections): New type declaration.
9502 (Output_merge_base::input_sections_begin,
9503 Output_merge_base::input_sections_end,
9504 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9505 (Output_merge_base::bool keeps_input_sections_,
9506 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9507 Output_merge_base::input_sections_): New data members.
9508 (Output_merge_data::do_set_keeps_input_sections): New method
9509 defintion.
9510 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9511 * output.cc (Output_section::Input_section::relobj): Move method
9512 defintion from class declaration to here and handle merge sections.
9513 (Output_section::Input_section::shndx): Ditto.
9514 (Output_section::Output_section): Remove initializations of removed
9515 data members and initialize new data member LOOKUP_MAPS_.
9516 (Output_section::add_input_section): Set keeps-input-sections flag
9517 for a newly created merge output section as appropriate. Adjust code
9518 to use Output_section_lookup_maps class.
9519 (Output_section::add_relaxed_input_section): Adjst code for lookup
9520 maps code refactoring.
2e702c99 9521 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9522 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9523 class. If adding input section to a newly created merge output
9524 section fails, remove the new merge section.
9525 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9526 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9527 (Output_section::find_merge_section): Ditto.
0439c796 9528 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9529 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9530 Output_section_lookup_maps class.
9531 (Output_section::get_input_sections): Export merge sections. Adjust
9532 code to use Output_section_lookup_maps class.
9533 (Output_section:::add_script_input_section): Adjust code to use
9534 Output_section_lookup_maps class. Update lookup maps for merge
9535 sections also.
9536 (Output_section::discard_states): Use Output_section_lookup_maps.
9537 (Output_section::restore_states): Same.
9538 * output.h (Merge_section_properties): Move class defintion out of
9539 Output_section.
9540 (Output_section_lookup_maps): New class.
9541 (Output_section::Input_section::is_merge_section): New method
9542 defintion.
9543 (Output_section::Input_section::relobj): Move defintion out of class
9544 defintion. Declare method only.
9545 (Output_section::Input_section::shndx): Ditto.
9546 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9547 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9548 (Output_section::Merge_section_by_properties_map,
9549 Output_section::Output_section_data_by_input_section_map,
9550 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9551 Remove types.
2e702c99 9552 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9553 KEEPS_INPUT_SECTIONS.
9554 (Output_section::build_lookup_maps): New method declaration.
9555 (Output_section::merge_section_map_,
9556 Output_section::merge_section_by_properties_map_,
9557 Output_section::relaxed_input_section_map_,
9558 Output_section::is_relaxed_input_section_map_valid_): Remove data
9559 members.
9560 (Output_section::lookup_maps_): New data member.
9561
76295588
L
95622010-05-21 Doug Kwan <dougkwan@google.com>
9563
9564 PR gold/11619
9565 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9566 avoid a compilation error.
9567
d103a984
RÁE
95682010-05-19 Rafael Espindola <espindola@google.com>
9569
9570 * script-sections.cc (Output_section_definition::allocate_to_segment):
9571 Update the phdrs_list even when the output section is NULL.
9572 * testsuite/Makefile.am: Add test.
9573 * testsuite/Makefile.in: Regenerate.
9574 * testsuite/script_test_9.cc: New.
9575 * testsuite/script_test_9.sh: New.
9576 * testsuite/script_test_9.t: New.
9577
6625d24e
DK
95782010-05-19 Doug Kwan <dougkwan@google.com>
9579
9580 * arm.cc (Arm_input_section::original_size): New method.
9581 (Arm_input_section::do_addralign): Add a cast.
9582 (Arm_input_section::do_output_offset): Remove static cast.
9583 (Arm_input_section::original_addralign,
9584 Arm_input_section::original_size_): Change type to uint32_t.
9585 (Arm_input_section::init): Add safe casts for section alignment
9586 and size.
9587 (Arm_input_section::set_final_data_size): Do not set address and
9588 offset of stub table.
9589 (Arm_output_section::fix_exidx_coverage): Change use of of
9590 Output_section::Simple_input_section to that of
9591 Output_section::Input_section.
9592 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9593 except for the first pass.
9594 * output.cc (Output_section::get_input_sections): Change type of
9595 input_sections to std::list<Input_section>.
9596 (Output_section::add_script_input_section): Rename from
9597 Output_section::add_simple_input_section. Change type of SIS
9598 parameter from Simple_input_section to Input_section.
9599 * output.h (Output_section::Simple_input_section): Remove class.
9600 (Output_section::Input_section): Change class visibility to public.
9601 (Output_section::Input_section::addralign): Use stored alignments
9602 for special input sections if set.
9603 (Output_section::Input_section::set_addralign): New method.
9604 (Output_section::get_input_sections): Change parameter type from
9605 list of Simple_input_section to list of Input_section.
9606 (Output_section::add_script_input_section): Rename from
9607 Output_section::add_simple_input_section. Change first parameter's
9608 type from Simple_input_section to Input_section and remove the
9609 second and third parameters.
9610 * script-sections.cc (Input_section::Input_section_list): Change
9611 type to list of Output_section::Input_section/
9612 (Input_section_info::Input_section_info): Change parameter type of
9613 INPUT_SECTION to Output_section::Input_section.
9614 (Input_section_info::input_section): Change return type.
9615 (Input_section_info::input_section_): Change type to
9616 Output_section::Input_section.
9617 (Output_section_element_input::set_section_addresses): Adjust code
9618 to use Output_section::Input_section instead of
9619 Output_section::Simple_input_section. Adjust code for renaming
9620 of Output_section::add_simple_input_section.
9621 (Orphan_output_section::set_section_addresses): Ditto.
9622
e1e82ea4
RW
96232010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9624
9625 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9626 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9627
91e75c8a
RÁE
96282010-05-18 Rafael Espindola <espindola@google.com>
9629
9630 * options.cc (General_options::finalize): Handle -nostdlib.
9631 * options.h (nostdlib): New option.
9632 * script.cc (script_add_search_dir): Handle -nostdlib.
9633
da59ad79
DK
96342010-05-12 Doug Kwan <dougkwan@google.com>
9635
9636 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9637 attributes section only if there no attributes section after merging.
9638 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9639 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9640 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9641 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9642 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9643 and arm_attr_merge_7.stdout.
9644 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9645 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9646 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9647 arm_attr_merge_7b.o): New rules.
9648 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9649 arm_attr_merge_7
9650 * testsuite/Makefile.in: Regenerate.
9651 * testsuite/arm_attr_merge.sh: New file.
9652 * testsuite/arm_attr_merge_[67][ab].s: Same.
9653
3e01a7fd
NC
96542010-05-05 Nick Clifton <nickc@redhat.com>
9655
9656 * po/es.po: Updated Spanish translation.
9657
7ad2014a
L
96582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9659
9660 * Makefile.am (install-exec-local): Properly install gold as
9661 default cross linker.
9662 * Makefile.in: Regenerated.
9663
4fda8867
NC
96642010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9665 Nick Clifton <nickc@redhat.com>
9666
9667 * configure.ac (install_as_default): Define and set to false
9668 unless --enable-gold or --enable-gold=both/gold has been
9669 specified.
9670 * configure: Regenerate.
9671
9672 * Makefile.am (install-exec-local): Install the executable as
9673 'ld.gold'. If install_as_default is true then also install it as
9674 'ld'.
9675 * Makefile.in: Regenerated.
9676
bd288ea2
ILT
96772010-04-24 Ian Lance Taylor <iant@google.com>
9678
9679 * layout.cc (Layout::layout_reloc): In relocatable link don't
9680 combine reloc sections for grouped sections.
9681
ef38fd8a
ST
96822010-04-23 Sriraman Tallam <tmsriram@google.com>
9683
9684 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9685 sections that are not ordinary to icf.
9686 * icf.cc (get_section_contents): Handle relocation pointing to section
9687 with no object or shndx information.
9688 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9689 * testsuite/Makefile.in: Regenerate.
9690 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9691 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9692
f6973bdc
ILT
96932010-04-22 Ian Lance Taylor <iant@google.com>
9694
9695 * expression.cc (Expression::Expression_eval_info): Add
9696 result_alignment_pointer field.
9697 (Expression::eval_with_dot): Add result_alignment_pointer
9698 parameter. Change all callers.
9699 (Expression::eval_maybe_dot): Likewise.
9700 (class Binary_expression): Add alignment_pointer parameter to
9701 left_value and right_value. Change all callers.
9702 (BINARY_EXPRESSION): Set result alignment.
9703 (class Trinary_expression): Add alignment_pointer parameter to
9704 arg2_value and arg3_value. Change all callers.
9705 (Trinary_cond::value): Set result alignment.
9706 (Max_expression::value, Min_expression::value): Likewise.
9707 (Align_expression::value): Likewise.
9708 * script-sections.cc (class Sections_element): Add dot_alignment
9709 parameter to set_section_addresses virtual function. Update
9710 instantiations.
9711 (class Output_section_element): Likewise.
9712 (Script_sections::create_segments): Add dot_alignment parameter.
9713 Change all callers.
9714 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9715 (Script_sections::set_phdrs_clause_addresses): Likewise.
9716 * script-sections.h: Update declarations.
9717 * script.h: Update declarations.
9718 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9719 min_p_align.
9720 * testsuite/script_test_3.t: Set large alignment.
9721 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9722 segment has expected alignment.
9723
9c9c98a5
NC
97242010-04-22 Nick Clifton <nickc@redhat.com>
9725
9726 * po/gold.pot: Updated by the Translation project.
9727 * po/vi.po: Updated Vietnamese translation.
9728
2253bfba
L
97292010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9730
9731 * testsuite/Makefile.am (check_PROGRAMS): Add
9732 icf_virtual_function_folding_test.
9733 * testsuite/Makefile.in: Regenerated.
9734
85fdf906
AH
97352010-04-15 Andrew Haley <aph@redhat.com>
9736
9737 * options.h (merge_exidx_entries): New option.
9738 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9739 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9740 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9741 (Target_arm::merge_exidx_entries): New function.
9742 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9743 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9744 to Arm_exidx_fixup constructor.
9745 Add new arg, merge_exidx_entries.
9746 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9747 Arm_output_section::fix_exidx_coverage.
9748
ce97fa81
ST
97492010-04-18 Sriraman Tallam <tmsriram@google.com>
9750
9751 * icf.cc (get_section_contents): Check for preemptible functions.
9752 Ignore addend when appropriate.
9753 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9754 section folded.
9755 (add_from_relobj): Check for section folded.
9756 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9757 * symtab.h (should_add_dynsym_entry): Add new parameter.
9758 * target-reloc.h (scan_relocs): Check for section folded.
9759 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9760 Check reloc types for function pointers in shared objects.
9761 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9762 case.
9763 (icf_preemptible_functions_test): New test case.
9764 (icf_string_merge_test): New test case.
9765 * testsuite.Makefile.in: Regenerate.
9766 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9767 bar_glob. Refactor code.
9768 * testsuite/icf_preemptible_functions_test.cc: New file.
9769 * testsuite/icf_preemptible_functions_test.sh: New file.
9770 * testsuite/icf_string_merge_test.cc: New file.
9771 * testsuite/icf_string_merge_test.sh: New file.
9772 * testsuite/icf_virtual_function_folding_test.cc: New file.
9773 * testsuite/icf_virtual_function_folding_test.sh: New file.
9774
04ceb17c
DK
97752010-04-14 Doug Kwan <dougkwan@google.com>
9776
9777 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9778 for local symbol recounting if we remove a section due to ICF.
9779 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9780 there are no regular objects in input.
9781
153e7da4
DK
97822010-04-13 Doug Kwan <dougkwan@google.com>
9783
9784 * arm.cc (Arm_input_section::set_final_data_size): Compute
9785 accurate final data size instead of using current data size.
9786
4dbd9faf
DK
97872010-04-09 Doug Kwan <dougkwan@google.com>
9788
9789 * layout.cc (Layout::choose_output_section): Handle script section
9790 types.
9791 (Layout::make_output_section_for_script): Add section type parameter.
9792 Handle script section types.
9793 * layout.h (Layout::make_output_section_for_script): Add section
9794 type parameter.
9795 * output.cc (Output_section::Output_section): Initialize data member
9796 is_noload_.
9797 (Output_section::do_reset_address_and_file_offset): Do not set address
9798 to 0 if section is a NOLOAD section.
9799 * output.h (Output_section::is_noload): New method.
9800 (Output_section::set_is_noload): Ditto.
9801 (Output_section::is_noload_): New data member.
9802 * script-c.h (Script_section_type): New enum type.
9803 (struct Parser_output_section_header): Add new file section_type.
9804 * script-sections.cc (Sections_element::output_section_name): Add
9805 parameter for returning script section type.
9806 (Output_section_definition::output_section_name): Ditto.
9807 (Output_section_definition::section_type)P; New method.
9808 (Output_section_definiton::script_section_type_name): Ditto.
9809 (Output_section_definition::script_section_type_): New data member.
9810 (Output_section_definition::Output_section_definition): Initialize
9811 data member Output_section_definition::script_section_type_.
9812 (Output_section_definition::create_sections): Pass script section type
9813 to Layout::make_output_section_for_script.
9814 (Output_section_definition::output_section_name): Return script
9815 section type to caller.
9816 (Output_section_definition::set_section_address): Do not advance
9817 dot value and load address if section type is NOLOAD. Set address
9818 of NOLOAD sections regardless of section flags.
9819 (Output_section_definition::print): Print section type if it is
9820 not SCRIPT_SECTION_TYPE_NONE.
9821 (Output_section_definition::section_type): New method.
9822 (Output_section_definition::script_section_type_name): Ditto.
9823 (Script_sections::output_section_name): Add new parameter
9824 PSECTION_TYPE for returning script section type. Pass it to
9825 section elements. Handle discard sections.
9826 (Sort_output_sections::operator()): Handle NOLOAD sections.
9827 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9828 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9829 returning script section type.
9830 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9831 INFO and NOLOAD.
9832 * yyscript.y (union): Add new field SECTION_TYPE.
9833 (COPY, DSECT, INFO, NOLOAD): New tokens.
9834 (opt_address_and_section_type): Change type to output_section_header.
9835 (section_type): New non-terminal
9836 (section_header): Handle section type.
2253bfba 9837 (opt_address_and_section_type): Return section type value.
4dbd9faf 9838
721ea635
L
98392010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9840
9841 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9842 * testsuite/plugin_common_test_2.c (foo): Likewise.
9843
6bf924b0
DK
98442010-04-08 Doug Kwan <dougkwan@google.com>
9845
9846 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9847 Output_merge_data.
9848 * output.cc (Output_section::add_merge_input_section): Simplify
9849 code and return status of Output_merge_base::add_input_section.
e1df38aa 9850 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9851 returns true.
9852
24af6f92
DK
98532010-04-07 Doug Kwan <dougkwan@google.com>
9854
9855 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9856 if section is marked as containing instructions but has no mapping
9857 symbols.
9858 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9859 correct section index.
9860 (Arm_relobj::find_linked_text_section): Ditto.
9861
00698fc5
CC
98622010-04-07 Cary Coutant <ccoutant@google.com>
9863
9864 * archive.cc (include_member): Destroy Read_symbols_data object before
9865 releasing file.
9866 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9867 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9868 (Read_symbols_data::~Read_symbols_data) New destructor.
9869 (Section_relocs::Section_relocs) New constructor.
9870 (Section_relocs::~Section_relocs) New destructor.
9871 (Read_relocs_data::Read_relocs_data) New constructor.
9872 (Read_relocs_data::~Read_relocs_data) New destructor.
9873 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9874 pointers to NULL after deleting.
9875
7296d933
DK
98762010-04-07 Doug Kwan <dougkwan@google.com>
9877
9878 * arm.cc: Replace "endianity" with "endianness" in comments.
9879 (Arm_exidx_cantunwind): Ditto.
9880 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9881 (Arm_relobj::merge_flags_and_attributes): New method.
9882 (Arm_relobj::merge_flags_and_attributes_): New data member.
9883 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9884 (Arm_relobj::scan_sections_for_stubs): Ditto.
9885 (Arm_relobj::do_read_symbols): Check to see if we really want to
9886 merge processor-specific flags and attributes. Exit early if
9887 an object is empty except for section names and the undefined symbol.
9888 (Target_arm::do_finalize_sections): Move check for ELF format to
9889 Arm_relobj::do_read_symbols. Merge processor specific flags and
9890 attributes from a regular object only when we have determined that
9891 it is aapropriate. Do not create an .ARM.attributes section in
9892 output if there is no regular input object.
9893 (Target_arm::merge_processor_specific_flags): Check
9894 --warn-mismatch before printing any error.
9895 (Target_arm::merge_object_attributes): Ditto.
9896 * gold.cc (queue_middle_tasks): Handle the case in which there is
9897 no regular object in input.
9898 * options.cc (General_options::parse_EB): New method.
9899 (General_options::parse_EL): Same.
9900 (General_options::General_options): Initialize endianness_.
9901 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9902 New options.
9903 (General_options::Endianness): New enum.
9904 (General_options::endianness): New method.
9905 (General_options::endianness_): New data member.
9906 * parameters.cc (Parameters::set_options): Check target endianness.
9907 (Parameters::set_target_once): Ditto.
9908 (Parameters::check_target_endianness): New method.
9909 (parameters_force_valid_target): If either -EL or -EB is specified,
9910 use it to define endianness of default target.
9911 * parameters.h (Parameters::check_target_endianness): New method
9912 declaration.
9913 * target.h (class Target): Change "endianity" to "endianness"
9914 in comments.
9915
efc8d4f2
RW
99162010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9917
9918 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9919 * configure: Regenerate.
9920 * Makefile.in: Regenerate.
9921 * testsuite/Makefile.in: Regenerate.
9922
be234d88
CC
99232010-04-06 Cary Coutant <ccoutant@google.com>
9924
9925 gcc PR lto/42757
9926 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9927 prevailing definitions of common symbols.
9928 * testsuite/plugin_test_6.sh: New test case.
9929 * testsuite/plugin_common_test_1.c: New test case.
9930 * testsuite/plugin_common_test_2.c: New test case.
9931 * testsuite/Makefile.am (plugin_test_6): New test case.
9932 * testsuite/Makefile.in: Regenerate.
9933
bd32c6bd
NC
99342010-04-06 Nick Clifton <nickc@redhat.com>
9935
9936 * po/vi.po: New Vietnamese translation.
9937
323c532f
DK
99382010-03-30 Doug Kwan <dougkwan@google.com>
9939
9940 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9941
4fcd97eb
DK
99422010-03-25 Doug Kwan <dougkwan@google.com>
9943
9944 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9945 to avoid a conversion warning on a 32-bit host.
9946
4ebf39db
ILT
99472010-03-24 Ian Lance Taylor <iant@google.com>
9948
9949 * testsuite/script_test_3.t: Add a TLS segment.
9950 * testsuite/Makefile.am (check_PROGRAMS): Add
9951 tls_phdrs_script_test.
9952 (tls_phdrs_script_test_SOURCES): Define.
9953 (tls_phdrs_script_test_DEPENDENCIES): Define.
9954 (tls_phdrs_script_test_LDFLAGS): Define.
9955 (tls_phdrs_script_test_LDADD): Define.
9956 * testsuite/Makefile.in: Rebuild.
9957
4a599bdd
CC
99582010-03-23 Cary Coutant <ccoutant@google.com>
9959
9960 * fileread.cc (find_or_make_view): Fix comment.
9961
6c93b22c
ILT
99622010-03-23 Ian Lance Taylor <iant@google.com>
9963
9964 * script-sections.cc (class Orphan_section_placement): Define
9965 PLACE_TLS and PLACE_TLS_BSS.
9966 (Orphan_section_placement::Orphan_section_placement): Initialize
9967 new places.
9968 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9969 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9970 (tls_script_test_SOURCES): Define.
9971 (tls_script_test_DEPENDENCIES): Define.
9972 (tls_script_test_LDFLAGS): Define.
9973 (tls_script_test_LDADD): Define.
9974 * testsuite/Makefile.in: Rebuild.
9975
a2c7281b
DK
99762010-03-22 Doug Kwan <dougkwan@google.com>
9977
9978 * arm.cc (Arm_relocate_functions::abs8,
9979 Arm_relocate_functions::abs16): Use correct check for overflow
9980 specified in the ARM ELF specs.
9981 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9982 target of a BLX instruction specially.
9983 (Reloc_stub::stub_type_for_reloc): Ditto.
9984 (Relocate::relocate): Use symbolic names instead of numeric relocation
9985 codes to report error.
9986 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9987 workaround.
9988 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9989 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9990 thumb2_blx_out_of_range.stdout
9991 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9992 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9993 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9994 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9995 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9996 thumb2_blx_in_range, thumb2_blx_in_range.o,
9997 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9998 thumb2_blx_out_of_range.o): New rules.
2e702c99 9999 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10000 thumb2_blx_in_range and thumb2_blx_out_of_range.
10001 * testsuite/Makefile.in: Regenerate.
10002 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10003 * testsuite/thumb_blx_in_range.s: New file.
10004 * testsuite/thumb_blx_out_of_range.s: New file.
10005
b0193076
RÁE
100062010-03-22 Rafael Espindola <espindola@google.com>
10007
10008 * archive.cc (Should_include): Move to archive.h.
10009 (should_include_member): Make it a member of Archive.
10010 (Lib_group): New.
10011 (Add_lib_group_symbols): New.
10012 * archive.h: Include options.h.
10013 (Archive_member): Moved from Archive.
10014 (Should_include): Moved from archive.cc.
10015 (Lib_group): New.
10016 (Add_lib_group_symbols): New.
10017 * dynobj.cc (do_should_include_member): New.
10018 * dynobj.h (do_should_include_member): New.
10019 * gold.cc (queue_initial_tasks): Update call to queue.
10020 * main.cc (main): Print lib group stats.
10021 * object.cc (do_should_include_member): New.
10022 * object.h: Include archive.h.
10023 (Object::should_include_member): New.
10024 (Object::do_should_include_member): New.
10025 (Sized_relobj::do_should_include_member): New.
10026 * options.cc (General_options::parse_start_lib): New.
10027 (General_options::parse_end_lib): New.
10028 (Input_arguments::add_file): Handle lib groups.
10029 (Input_arguments::start_group): Check we are not in a lib.
10030 (Input_arguments::start_lib): New.
10031 (Input_arguments::end_lib): New.
10032 * options.h (General_options): Add start_lib and end_lib.
10033 (Input_argument::lib_): New.
10034 (Input_argument::lib): New.
10035 (Input_argument::is_lib): New.
10036 (Input_file_lib): New.
10037 (Input_arguments::in_lib_): New.
10038 (Input_arguments::in_lib): New.
10039 (Input_arguments::start_lib): New.
10040 (Input_arguments::end_lib_): New.
10041 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10042 in unused members as preempted.
10043 (Sized_pluginobj::do_should_include_member): New.
10044 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10045 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10046 return the blocker.
10047 (Read_symbols::do_whole_lib_group): New.
10048 (Read_symbols::do_lib_group): New.
10049 (Read_symbols::do_read_symbols): Handle lib groups.
10050 (Read_symbols::get_name): Handle lib groups.
10051 * readsyms.h (Read_symbols): Add an archive member pointer.
10052 (Read_symbols::do_whole_lib_group): New.
10053 (Read_symbols::do_lib_group): New.
10054 (Read_symbols::member_): New.
10055 * script.cc (read_input_script): Update call to queue_soon.
10056
d099120c
DK
100572010-03-19 Doug Kwan <dougkwan@google.com>
10058
10059 * arm.cc (Stub_table::Stub_table): Initialize new data members
10060 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10061 (Stub_table::add_reloc_stub): Assign stub offset and update
10062 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10063 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10064 New data members.
2e702c99 10065 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10066 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10067 instead of going over all reloc stubs.
2e702c99 10068 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10069 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10070 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10071 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10072 Stringpool_template::offset_.
10073 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10074 Stringpool_template::offset_ to zero.
10075
1aa37384
DK
100762010-03-15 Doug Kwan <dougkwan@google.com>
10077
10078 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10079 offset_.
10080 (Stringpool_template::new_key_offset): New method.
10081 (Stringpool_template::add_string): Assign offsets when adding new
10082 strings.
10083 (Stringpool_template::set_string_offsets): Do not set string offsets
10084 when not optimizing.
10085 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10086 member size_.
2e702c99
RM
10087 (Chunked_vector::clear): Clear size_.
10088 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10089 (Chunked_vector::size): Return size_.
10090 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10091 (Chunked_vector::size_): New data member.
1aa37384
DK
10092 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10093 (Stringpool_template::new_key_offset): New method declaration.
10094 (Stringpool_template::offset_): New data member.
10095
b672b057
RÁE
100962010-03-15 Rafael Espindola <espindola@google.com>
10097
10098 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10099 Add_symbols' constructor.
10100 * readsyms.h (Add_symbols): Remove the input_group member.
10101
b6848d3c
ILT
101022010-03-10 Ian Lance Taylor <iant@google.com>
10103
10104 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10105 target to ask whether a reference to a symbol requires a stack
10106 split.
10107 * target.h (Target::is_call_to_non_split): New function.
10108 (Target::do_is_call_to_non_split): Declare virtual function.
10109 * target.cc: Include "symtab.h".
10110 (Target::do_is_call_to_non_split): New function.
10111 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10112
a2a5469e
CC
101132010-03-10 Cary Coutant <ccoutant@google.com>
10114
10115 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10116 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10117 (File_read::open[2]): Add whole_file_view_ to list of views.
10118 (File_read::make_view): Remove test of whole_file_view_.
10119 (File_read::find_or_make_view): Create whole_file_view_ if
10120 necessary.
10121 (File_read::clear_views): Replace bool parameter with enum;
10122 adjust all callers. Don't delete views with permanent data;
10123 do delete cached views and views from archives if
10124 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10125 if clearing the corresponding view.
10126 * fileread.h (File_read::Clear_views_mode): New enum.
10127 (File_read::View::is_permanent_view): New method.
10128 (File_read::clear_views): Replace bool parameter
10129 with enum; adjust all callers.
10130 * options.h (General_options): Change keep_files_mapped option;
10131 add map_whole_files.
10132 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10133 releasing the file.
10134 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10135 the file.
10136
8861f32b
DM
101372010-03-10 David S. Miller <davem@davemloft.net>
10138
10139 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10140
d62d0f5f
ST
101412010-03-09 Sriraman Tallam <tmsriram@google.com>
10142
10143 * icf.cc (get_section_contents): Add '@' marker after processing the
10144 merge reloc.
10145
9177756d
DK
101462010-03-08 Doug Kwan <dougkwan@google.com>
10147
10148 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10149 due to a conversion warning.
10150 (Arm_relobj::update_output_local_symbol_count): Check for local
10151 symbol with unset output index.
10152
9e9e071b
ILT
101532010-03-05 Ian Lance Taylor <iant@google.com>
10154
10155 * options.h (class General_options): Add --spare-dynamic-tags.
10156 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10157 --spare-dynamic-tags.
10158
a81ee015
ILT
101592010-03-05 Ian Lance Taylor <iant@google.com>
10160
10161 * incremental.cc: Include "libiberty.h".
10162
44ec90b9
RO
101632010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10164
10165 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10166 function, is_info_ member.
10167 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10168 (Versions::Versions): Update caller.
10169 (Versions::define_base_version): Likewise.
10170 (Versions::add_def): Likewise.
10171
0897ed3b
ST
101722010-03-03 Sriraman Tallam <tmsriram@google.com>
10173
10174 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10175 (Scan::possible_function_pointer_reloc): New function.
10176 (Scan::local_reloc_may_be_function_pointer): Change to call
10177 possible_function_pointer_reloc.
10178 (Scan::global_reloc_may_be_function_pointer): Ditto.
10179 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10180 relocations in ".data.rel.ro._ZTV" section.
10181 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10182 * testsuite/icf_safe_so_test.cc: Ditto.
10183 * testsuite/icf_safe_test.cc: Ditto.
10184 * testsuite/icf_safe_test.sh: Ditto.
10185
d3bbad62
ILT
101862010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10187 Ian Lance Taylor <iant@google.com>
10188
10189 * target-reloc.h (relocate_section): Check the symbol table index
10190 for -1U before setting the local symbol index.
10191 (scan_relocatable_relocs): If copying the relocation, record that
10192 the local symbol is required.
10193 * object.h (Symbol_value::is_output_symtab_index_set): New
10194 function.
10195 (Symbol_value::may_be_discarded_from_output_symtab): New
10196 function.
10197 (Symbol_value::has_output_symtab_entry): New function.
10198 (Symbol_value::needs_output_symtab_entry): Remove.
10199 (Symbol_value::output_symtab_index): Make sure the symbol index is
10200 set.
10201 (Symbol_value::set_output_symtab_index): Make sure the symbol
10202 index is not set. Make sure the new index is valid.
10203 (Symbol_value::set_must_have_output_symtab_entry): New function.
10204 (Symbol_value::has_output_dynsym_entry): New function.
10205 (Symbol_value::set_output_dynsym_index): Make sure the new index
10206 is valid.
10207 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10208 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10209 local symbol if permitted.
10210 (Sized_relobj::do_finalize_local_symbols): Call
10211 is_output_symtab_index_set rather than needs_output_symtab_entry.
10212 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10213 rather than needs_output_symtab_entry. Call
10214 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10215 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10216 is_output_symtab_index_set rather than needs_output_symtab_entry.
10217 * testsuite/discard_locals_relocatable_test.c: New file.
10218 * testsuite/discard_locals_test.sh: Test -r.
10219 * testsuite/Makefile.am (check_DATA): Add
10220 discard_locals_relocatable_test1.syms,
10221 discard_local_relocatable_test2.syms.
10222 (MOSTLYCLEANFILES): Likewise. Also add
10223 discard_locals_relocatable_test1.lout and
10224 discard_locals_relocatable_test2.out.
10225 (discard_locals_relocatable_test1.syms): New target.
10226 (discard_locals_relocatable_test.o): New target.
10227 (discard_locals_relocatable_test1.out): New target.
10228 (discard_locals_relocatable_test2.syms): New target.
10229 (discard_locals_relocatable_test2.out): New target.
10230 (various): Add missing ../ld-new dependencies.
10231 * testsuite/Makefile.in: Rebuild.
10232
7e8ccf26
NC
102332010-03-03 Nick Clifton <nickc@redhat.com>
10234
10235 * po/fi.po: New Finnish translation.
10236
2a0ff005
DK
102372010-03-01 Doug Kwan <dougkwan@google.com>
10238
10239 * layout.cc (Layout::Layout): Force section types of .init_array*,
10240 .preinit_array* and .fini_array* sections.
10241 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10242 Fix check of return value of std::string::find.().
10243 (Output_section::Input_section_sort_compare::operator()): Remove
10244 comment about .init_array.
10245 (Output_section::Input_section_sort_init_fini_compare::operator()):
10246 New method.
10247 (Output_section::sort_attached_input_sections): Handle .init_array
10248 and .fini_array specially.
10249 * output.h (Output_section::Inut_section_sort_compare): Update
10250 comment.
10251 (Output_section::Input_section_sort_init_fini_compare): New struct.
10252
c3e4ae29
DK
102532010-02-26 Doug Kwan <dougkwan@google.com>
10254
10255 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10256 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10257 * testsuite/debug_msg.sh: Avoid matching source line number for
10258 use of global variable undef_int.
10259
2fd9ae7a
DK
102602010-02-26 Doug Kwan <dougkwan@google.com>
10261
10262 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10263 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10264 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10265 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10266 * options.cc (General_options::General_options): Initialize member
10267 fix_v4bx_.
10268 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10269 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10270 and rm_no_fix_v4bx.stdout
10271 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10272 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10273 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10274 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10275 and arm_no_fix_v4bx.
10276 * Makefile.in: Regenerate.
10277 * testsuite/arm_fix_v4bx.s: New file.
10278 * testsuite/arm_fix_v4bx.sh: Ditto.
10279
67ec7d0b
DK
102802010-02-24 Doug Kwan <dougkwan@google.com>
10281
10282 * arm.cc (Target_arm::got_section): Make the .got section the first
10283 non RELRO section in the data segment.
10284 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10285 suffixes of section names.
10286
10165461
DK
102872010-02-24 Doug Kwan <dougkwan@google.com>
10288
10289 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10290 flags and attributes merging if an input file is a binary file.
10291 * fileread.cc (Input_file::open): Record format of original file.
10292 * fileread.h (Input_file::Format): New enum type.
2e702c99 10293 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10294 (Input_file::format): New method definition.
10295 (Input_file::format_):: New data member.
10296
4a54abbb
DK
102972010-02-24 Doug Kwan <dougkwan@google.com>
10298
10299 * arm.cc (Arm_output_data_got): New class.
10300 (ARM_TCB_SIZE): New constant
10301 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10302 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10303 If user uses a script with a SECTIONS clause, issue only a warning
10304 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10305 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10306 garbage collection.
10307 (Target_arm::got_mode_index_entry): Handle static linking.
10308 (Target_arm::Scan::local): Ditto.
10309 (Target_arm::Scan::global): Ditto.
10310 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10311 all incorrectly implemented relocations.
e1df38aa 10312 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10313 Arm_output_section::fix_exidx_coverage.
10314 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10315 from ".ARM.exidx." and ".ARM.extab.".
10316
ca419a6f
ILT
103172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10318
10319 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10320 section if it does not already exist.
10321 * attributes.cc (Attributes_section_data::Attributes_section_data):
10322 Don't crash if size is zero.
10323
135b9c78
ILT
103242010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10325 Ian Lance Taylor <iant@google.com>
10326
10327 * gold.cc (queue_middle_tasks): If no input files were opened,
10328 exit.
10329 * workqueue.h (Task_function::Task_function): Assert that there is
10330 a blocker.
10331
bb0bfe4f
DK
103322010-02-22 Doug Kwan <dougkwan@google.com>
10333
10334 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10335 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10336 types to avoid warnings due to different uint64_t implementations
10337 on different hosts.
10338
2a2b6d42
DK
103392010-02-21 Doug Kwan <dougkwan@google.com>
10340
10341 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10342 handling of the maximum backward branch offset.
2e702c99 10343 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10344 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10345 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10346 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10347 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10348 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10349 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10350 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10351 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10352 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10353 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10354 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10355 thumb2_bl_out_of_range.o): New rules.
10356 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10357 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10358 thumb2_bl_out_of_range
10359 * testsuite/Makefile.in: Regenerate.
10360 * testsuite/arm_bl_in_range.s: New file.
10361 * testsuite/arm_bl_out_of_range.s: Ditto.
10362 * testsuite/arm_branch_in_range.sh: Ditto.
10363 * testsuite/arm_branch_range.t: Ditto.
10364 * testsuite/thumb2_branch_range.t: Ditto.
10365 * testsuite/thumb_bl_in_range.s: Ditto.
10366 * testsuite/thumb_bl_out_of_range.s: Ditto.
10367 * testsuite/thumb_branch_range.t: Ditto.
10368
b487ad64
ST
103692010-02-20 Sriraman Tallam <tmsriram@google.com>
10370
10371 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10372 Add reloc offset information.
10373 * icf.cc (get_section_contents): Change iterators to point to the new
10374 vectors. Add reloc offset information to the contents.
10375 * icf.h (Icf::Sections_reachable_info): New typedef.
10376 (Icf::Sections_reachable_list): New typedef.
10377 (Icf::Offset_info): New typedef.
10378 (Icf::Reloc_info): New struct typedef.
10379 (Icf::Reloc_info_list): New typedef.
10380 (Icf::symbol_reloc_list): Delete method.
10381 (Icf::addend_reloc_list): Delete method.
10382 (Icf::section_reloc_list): Delete method.
10383 (Icf::reloc_info_list): New method.
10384 (Icf::reloc_info_list_): New member.
10385
f96accdf
DK
103862010-02-19 Doug Kwan <dougkwan@google.com>
10387
10388 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10389 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10390 * arm.cc (Arm_relocation_functions): New forward declaration.
10391 (Target_arm::Target_arm): Initialize new data members
10392 got_mod_index_offset_ and tls_base_symbol_defined_.
10393 (Target_arm::Relocate::relocate_tls): New method.
10394 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10395 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10396 New methods.
2e702c99 10397 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10398 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10399 (Target_arm::got_mod_index_offset_,
10400 Target_arm::tls_base_symbol_defined_): New data members.
10401 (Target_arm::Scan::local, Target::Scan::global,
10402 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10403 relocations.
10404
c8761b9a
DK
104052010-02-18 Doug Kwan <dougkwan@google.com>
10406
10407 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10408 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10409 text section as a parameter becuase some broken tools may not set
10410 the link in section header.
10411 (Target_arm::has_got_section): New method.
10412 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10413 without any mapping symbol as data only. Remove warning.
10414 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10415 link in its section header, try to discover the link by inspecting the
10416 REL31 relocation at the beginning of the section.
10417 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10418 in error message.
10419 (Target_arm::Scan::global): Treat any reference to the symbol
10420 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10421
21bb3914
ST
104222010-02-12 Sriraman Tallam <tmsriram@google.com>
10423
10424 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10425 (Scan::global_reloc_may_be_function_pointer): New function.
10426 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10427 (Scan::global_reloc_may_be_function_pointer): New function.
10428 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10429 (Scan::global_reloc_may_be_function_pointer): New function.
10430 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10431 (Scan::global_reloc_may_be_function_pointer): New function.
10432 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10433 (Scan::global_reloc_may_be_function_pointer): New function.
10434 (Scan::possible_function_pointer_reloc): New function.
10435 (Target_x86_64::can_check_for_function_pointers): New function.
10436 * gc.h (gc_process_relocs): Scan relocation types to determine if
10437 function pointers were taken for targets that support it.
10438 * icf.cc (Icf::find_identical_sections): Include functions for
10439 folding in safe ICF whose pointer is not taken.
10440 * icf.h (Secn_fptr_taken_set): New typedef.
10441 (fptr_section_id_): New member.
10442 (section_has_function_pointers): New function.
10443 (set_section_has_function_pointers): New function.
10444 (check_section_for_function_pointers): New function.
10445 * options.h: Fix comment for safe ICF option.
10446 * target.h (can_check_for_function_pointers): New function.
10447 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10448 Modify icf_safe_test for X86-64.
10449 * testsuite/Makefile.in: Regenerate.
10450 * testsuite/icf_safe_so_test.cc: New file.
10451 * testsuite/icf_safe_so_test.sh: New file.
10452 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10453 (main): Change to take pointer to function kept_func_3.
10454 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10455 folding is done correctly for X86-64.
10456
0da6fa6c
DM
104572010-02-12 David S. Miller <davem@davemloft.net>
10458
10459 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10460 is_symbolless parameter.
10461 (Output_reloc<SHT_REL>::is_symbolless): New.
10462 (Output_reloc<SHT_REL>::is_symbolless_): New.
10463 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10464 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10465 (Output_reloc<SHT_RELA>::is_symbolless): New.
10466 (Output_data_reloc::add_global): Handle is_symbolless.
10467 (Output_data_reloc::add_global_relative): Likewise.
10468 (Output_data_reloc::add_local): Likewise.
10469 (Output_data_reloc::add_local_relative): Likewise.
10470 (Output_data_reloc::add_symbolless_global_addend): New.
10471 (Output_data_reloc::add_symbolless_local_addend): New.
10472 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10473 is_symbolless.
10474 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10475 instead of ->is_relative_
10476 (Output_reloc::write): Likewise.
10477 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10478 (Output_reloc::write_rel): Simplify.
10479
10480 * sparc.cc (Target_sparc::Scan::local): Use
10481 ->add_symbolless_local_addend as needed.
10482 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10483 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10484 based upon relocation offset.
10485
e4782e83
DK
104862010-02-11 Doug Kwan <dougkwan@google.com>
10487
10488 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10489 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10490 beginning of function.
10491 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10492 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10493 parameter is_32bit in calls to should_apply_static_reloc.
10494 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10495 (check_DATA): Add arm_abs_global.stdout.
10496 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10497 arm_abs_global.stdout): New rules.
10498 (MOSTLLYCLEANFILES): Add arm_abs_global
10499 * Makefile.in: Regenerate.
10500 * testsuite/arm_abs_global.s: New file.
10501 * testsuite/arm_abs_global.sh: Ditto.
10502 * testsuite/arm_abs_lib.s: Ditto.
10503
93ceb764
ILT
105042010-02-11 Ian Lance Taylor <iant@google.com>
10505
10506 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10507 Read_relocs task.
10508 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10509 Allocate_commons_task first.
10510 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10511 task, rather than symtab_lock_.
10512 (Gc_process_relocs::~Gc_process_relocs): New function.
10513 (Gc_process_relocs::is_runnable): Check this_blocker_.
10514 (Gc_process_relocs::locks): Use next_blocker_ rather than
10515 blocker_.
10516 (Scan_relocs::~Scan_relocs): New function.
10517 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10518 symtab_lock_.
10519 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10520 next_blocker_.
10521 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10522 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10523 constructor accordingly.
10524 (class Gc_process_relocs): Likewise.
10525 (class Scan_relocs): Likewise.
10526 * common.h (class Allocate_commons_task): Remove symtab_lock_
10527 field, and corresponding constructor parameter.
10528 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10529 symtab_lock_.
10530 (Allocate_commons_task::locks): Likewise.
10531
114dfbe1
ILT
105322010-02-11 Ian Lance Taylor <iant@google.com>
10533
10534 * gold-threads.h (class Once): Define.
10535 (class Initialize_lock): Rewrite as child of Once.
10536 * gold-threads.cc (class Once_initialize): Define.
10537 (once_pointer_control): New static variable.
10538 (once_pointer, once_arg): New static variables.
10539 (c_run_once): New static function.
10540 (Once::Once, Once::run_once, Once::internal_run): New functions.
10541 (class Initialize_lock_once): Remove.
10542 (initialize_lock_control): Remove.
10543 (initialize_lock_pointer): Remove.
10544 (initialize_lock_once): Remove.
10545 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10546 (Initialize_lock::initialize): Rewrite.
10547 (Initialize_lock::do_run_once): New function.
10548 * archive.cc (Archive::interpret_header): Only clear name if it is
10549 not already empty.
10550 * fileread.cc: Include "gold-threads.h"
10551 (file_counts_lock): New static variable.
10552 (file_counts_initialize_lock): Likewise.
10553 (File_read::release): Only increment counts when using --stats.
10554 Use a lock around the increment.
10555 * parameters.cc (class Set_parameters_target_once): Define.
10556 (set_parameters_target_once): New static variable.
10557 (Parameters::Parameters): Move here from parameters.h.
10558 (Parameters::set_target): Rewrite.
10559 (Parameters::set_target_once): New function.
10560 (Parameters::clear_target): Move here and rewrite.
10561 * parameters.h (class Parameters): Update declarations. Add
10562 set_parameters_target_once_ field.
10563 (Parameters::Parameters): Move to parameters.cc.
10564 (Parameters::clear_target): Likewise.
10565 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10566 task.
10567 (Start_group::~Start_group): New function.
10568 (Start_group::is_runnable): New function.
10569 (Start_group::locks, Start_group::run): New functions.
10570 (Finish_group::run): Change saw_undefined to size_t.
10571 * readsyms.h (class Start_group): Define.
10572 (class Finish_group): Change saw_undefined_ field to size_t.
10573 (Finish_group::Finish_group): Remove saw_undefined and
10574 this_blocker parameters. Change all callers.
10575 (Finish_group::set_saw_undefined): New function.
10576 (Finish_group::set_blocker): New function.
10577 * symtab.h (class Symbol_table): Change saw_undefined to return
10578 size_t. Change saw_undefined_ field to size_t.
10579 * target-select.cc (Set_target_once::do_run_once): New function.
10580 (Target_selector::Target_selector): Initialize set_target_once_
10581 field. Don't initialize lock_ and initialize_lock_ fields.
10582 (Target_selector::instantiate_target): Rewrite.
10583 (Target_selector::set_target): New function.
10584 * target-select.h (class Set_target_once): Define.
10585 (class Target_selector): Update declarations. Make
10586 Set_target_once a friend. Remove lock_ and initialize_lock_
10587 fields. Add set_target_once_ field.
10588
fa17a3f4
ILT
105892010-02-10 Ian Lance Taylor <iant@google.com>
10590
10591 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10592 queueing any tasks.
10593 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10594 (queue_middle_tasks): Add all blockers before queueing any tasks.
10595 (queue_final_tasks): Likewise.
10596 * token.h (Task_token::add_blockers): New function.
10597 * object.h (Input_objects::number_of_relobjs): New function.
10598
c7177d31
ILT
105992010-02-10 Ian Lance Taylor <iant@google.com>
10600
5de0e392
ILT
10601 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10602 shared, not if not position independent.
10603 * x86_64.cc (Relocate::relocate_tls): Likewise.
10604 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10605 (tls_pie_pic_test): New target.
10606 * testsuite/Makefile.in: Rebuild.
10607
c7177d31
ILT
10608 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10609 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10610 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10611 * testsuite/Makefile.in: Rebuild.
10612
684b268a
DM
106132010-02-09 David S. Miller <davem@davemloft.net>
10614
10615 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10616 R_SPARC_RELATIVE using ->add_local_relative().
10617 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10618
612a8d3d
DM
10619 * output.h (Output_data_dynamic::add_section_size): New method
10620 that takes two Output_data objects.
10621 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10622 entry param. Handle it in initializers.
10623 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10624 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10625 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10626 arg.
10627 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10628 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10629 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10630 for dynrel_includes_plt.
10631 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10632 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10633 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10634 before .rela.plt
10635 (Target_sparc::do_finalize_sections): Update to pass true for
10636 dynrel_includes_plt.
10637 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10638 output before .rela.plt
10639 (Target_powerpc::do_finalize_sections): Update to pass true for
10640 dynrel_includes_plt when 32-bit.
10641
cb1be87e
DK
106422010-02-08 Doug Kwan <dougkwan@google.com>
10643
10644 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10645 method.
10646 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10647 Arm_relobj::scan_section_for_cortex_a8_stubs,
10648 Arm_relobj::do_relocation_section): Instead of calling
10649 Output_section::output_address, use faster
10650 Arm_relobj::simple_input_section_output_address.
10651
705b5121
DM
106522010-02-08 David S. Miller <davem@davemloft.net>
10653
10654 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10655 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10656 relocation helper function.
10657
024c4466
DM
10658 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10659 just like R_SPARC_GOT{10,13,22}.
10660 (Target_sparc::Scan::local): Likewise.
10661 (Target_sparc::Relocate:relocate): Likewise.
10662
9109c078
ILT
106632010-02-06 Ian Lance Taylor <iant@google.com>
10664
10665 * configure.ac: Rewrite targetobjs duplicate removal code to use
10666 only shell constructs.
10667 * configure: Rebuild.
10668
cf846138
DK
106692010-02-05 Doug Kwan <dougkwan@google.com>
10670
10671 PR 11247
10672 * arm.cc (Arm_relobj::section_is_scannable): New method.
10673 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10674 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10675
6cfaf60b
DK
106762010-02-04 Doug Kwan <dougkwan@google.com>
10677
10678 PR 11247
10679 * arm-reloc-property.cc (cstdio): Include.
10680 * configure.ac (targetobjs): Remove duplicates.
10681 * configure: Regenerate.
10682 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10683 big and little endian version for a given address size.
10684
5c57f1be
DK
106852010-02-03 Doug Kwan <dougkwan@google.com>
10686
10687 * arm-reloc-property.cc
10688 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10689 definition.
10690 * arm-reloc-property.h
10691 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10692 New method definition.
10693 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10694 declaration.
10695 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10696 overflow to N.
10697 (GOT_PREL): Change implemented to Y.
10698 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10699 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10700 (Arm_relocate_functions::movw_abs_nc): Remove method.
10701 (Arm_relocate_functions::movt_abs): Ditto.
10702 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10703 (Arm_relocate_functions::thm_movt_abs): Ditto.
10704 (Arm_relocate_functions::movw_rel_nc): Ditto.
10705 (Arm_relocate_functions::movw_rel): Ditto.
10706 (Arm_relocate_functions::movt_rel): Ditto.
10707 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10708 (Arm_relocate_functions:thm_movw_rel): Ditto.
10709 (Arm_relocate_functions:thm_movt_rel): Ditto.
10710 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10711 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10712 New method definitions.
10713 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10714 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10715 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10716 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10717 (Target_arm::Relocate::relocate): Check for non-static or
10718 unimplemented relocation code and exit early. Change calls to
10719 Target_arm::reloc_uses_thumb_bit and
10720 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10721 instead. Refactor code to handle similar relocations to increase
10722 code sharing. Remove check for unsupported relocation code in switch
10723 statement.
10724 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10725 relocation property table to find out size. Change error message to
10726 print out the name of a relocation code instead of the numeric value.
10727 (Target_arm::scan_reloc_for_stub): Use relocation property table
10728 instead of calling Target_arm::reloc_uses_thumb_bit().
10729
218c5831
DK
107302010-02-02 Doug Kwan <dougkwan@google.com>
10731
10732 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10733 types of relaxed input section.
10734
0d31c79d
DK
107352010-02-02 Doug Kwan <dougkwan@google.com>
10736
10737 * Makefile.am (HFILES): Add arm-reloc-property.h.
10738 (DEFFILES): New.
2e702c99
RM
10739 (TARGETSOURCES): Add arm-reloc-property.cc
10740 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10741 (libgold_a_SOURCES): $(DEFFILES)
10742 * Makefile.in: Regenerate.
10743 * arm-reloc-property.cc: New file.
10744 * arm-reloc-property.h: New file.
10745 * arm-reloc.def: New file.
10746 * arm.cc: Update comments.
10747 (arm-reloc-property.h): New included header.
10748 (arm_reloc_property_table): New global variable.
10749 (Target_arm::do_select_as_default_target): New method definition.
10750 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10751 arm-reloc-property to targ_extra_obj.
10752 * parameters.cc (set_parameters_target): Call
10753 Target::select_as_default_target().
10754 * target.h (Target::select_as_default_target): New method definition.
10755 (Target::do_select_as_default_target): Same.
10756
546c7457
DK
107572010-02-01 Doug Kwan <dougkwan@google.com>
10758
10759 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10760 first_output_text_section_.
10761 (Arm_exidx_fixup::first_output_text_section): New method definition.
10762 (Arm_exidx_fixup::first_output_text_section_): New data member.
10763 (Arm_exidx_fixup::process_exidx_section): Record the first text
10764 output section seen.
10765 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10766 and entsize in output section header.
10767
11b861d5
DK
107682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10769
10770 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10771 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10772 (Arm_relocate_functions::thm_alu11): New Method.
10773 (Arm_relocate_functions::thm_pc8): New Method.
10774 (Arm_relocate_functions::thm_pc12): New Method.
10775 (Target_arm::Scan::local): Handle the relocations.
10776 (Target_arm::Scan::global): Likewise.
10777 (Target_arm::Relocate::relocate): Likewise.
10778 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10779
c9a2c125
DK
107802010-01-29 Doug Kwan <dougkwan@google.com>
10781
10782 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10783 of relocation types as ld.
10784
1521477a
DK
107852010-01-29 Doug Kwan <dougkwan@google.com>
10786
10787 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10788 to public.
10789 (Arm_relocate_functions::thumb_branch_common): Ditto.
10790 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10791 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10792 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10793 Arm_relocate_functions::jump24): Remove.
10794 (Target_arm::Relocate::relocate): Adjust code to call
10795 Arm_relocation_functions::arm_branch_common and
10796 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10797 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10798
e7eca48c
DK
107992010-01-29 Doug Kwan <dougkwan@google.com>
10800
10801 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10802 output_local_symbol_count_needs_update_.
10803 (Arm_relobj::output_local_symbol_count_needs_update,
10804 Arm_relobj::set_output_local_symbol_count_needs_update,
10805 Arm_relobj::update_output_local_symbol_count): New methods.
10806 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10807 member.
10808 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10809 of pointed function as in a R_ARM_PREL31 relocation.
10810 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10811 for output local symbol count updating.
10812 (Target_arm::do_relax): Update output local symbol counts in objects
10813 if necessary.
10814 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10815
02961d7e
ILT
108162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10817
10818 * arm.cc: Added support for the ARM relocations:
10819 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10820 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10821 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10822 movw_prel_nc).
10823 (Arm_relocate_functions::movw_rel): New method.
10824 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10825 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10826 thm_movw_prel_nc).
10827 (Arm_relocate_functions::thm_movw_rel): New method.
10828 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10829 thm_movt_prel).
10830 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10831 relocations.
10832 (Target_arm::Scan::global): Likewise.
10833 (Target_arm::Relocate::relocate): Likewise.
10834 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10835 Likewise.
10836
b10d2873
ILT
108372010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10838
10839 * arm.cc: Added support for ARM group relocations.
10840 (Target_arm::reloc_needs_sym_origin): New method.
10841 (Arm_relocate_functions::calc_grp_kn): New method.
10842 (Arm_relocate_functions::calc_grp_residual): New method.
10843 (Arm_relocate_functions::calc_grp_gn): New method.
10844 (Arm_relocate_functions::arm_grp_alu): New Method.
10845 (Arm_relocate_functions::arm_grp_ldr): New Method.
10846 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10847 (Arm_relocate_functions::arm_grp_ldc): New Method.
10848 (Target_arm::Scan::local): Handle the ARM group relocations.
10849 (Target_arm::Scan::global): Likewise.
10850 (Target_arm::Relocate::relocate): Likewise.
10851 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10852 Likewise.
10853
2b328d4e
DK
108542010-01-26 Doug Kwan <dougkwan@google.com>
10855
10856 * arm.cc (set): Include.
10857 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10858 pointer type.
2e702c99 10859 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10860 (Arm_output_section::append_text_sections_to_list): New method.
10861 (Arm_output_section::fix_exidx_coverage): Ditto.
10862 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10863 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10864 Relobj::set_section_offset() instead of
10865 Sized_relobj::invalidate_section_offset().
2e702c99 10866 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10867 parameter for section headers. Ignore relocation sections for
10868 unallocated sections and EXIDX sections.
10869 (Target_arm::fix_exidx_coverage): New method.
10870 (Target_arm::output_section_address_less_than): New type.
10871 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10872 linked text section instead of the EXIDX section.
10873 (Arm_output_section::create_stub_group): Add an assertion to check
10874 that this is not an EXIDX output section.
10875 (Arm_output_section::append_text_sections_to_list): New method.
10876 (Arm_output_section::fix_exidx_coverage): Ditto.
10877 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10878 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10879 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10880 first pass.
10881 (Target_arm::fix_exidx_coverage): New method.
10882 * object.h (Relobj::set_output_section): New method.
10883 (Sized_relobj::invalidate_section_offset): Remove method.
10884 (Sized_relobj::do_invalidate_section_offset): Remove method.
10885 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10886
c7f3c371
DK
108872010-01-25 Doug Kwan <dougkwan@google.com>
10888
10889 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10890 Fix warning due to signed and unsigned comparison on a 32-bit host.
10891
8923b24c
DK
108922010-01-22 Doug Kwan <dougkwan@google.com>
10893
10894 * arm.cc (Target_arm::do_relax): Record an output section for section
10895 offset adjustment it contains any stub table that has changed.
10896 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10897 offsets in an output section if necessary.
10898 * output.cc (Output_section::Output_section): Initialize
10899 section_offsets_need_adjustments_.
10900 (Output_section::add_input_section_for_script): Renamed to
10901 Output_section::add_simple_input_section.
10902 (Output_section::save_states): Add a comment.
10903 (Output_section::discard_states): New method defintion.
10904 (Output_section::adjust_section_offsets): Same.
10905 * output.h (Output_section::add_input_section_for_script): Renamed to
10906 Output_section::add_simple_input_section.
10907 (Output_section::discard_states): New method declaration.
10908 (Output_section::adjust_section_offsets): Same.
10909 (Output_section::section_offsets_need_adjustment,
10910 Output_section::set_section_offsets_need_adjustment): New method
10911 definitions.
10912 (Output_section::section_offsets_need_adjustment_): New data member.
10913 * script-sections.cc
10914 (Output_section_element_input::set_section_address): Adjust code for
10915 renaming of Output_section::add_input_section_for_script.
10916 (Orphan_output_section::set_section_address): Same.
10917
9b2fd367
DK
109182010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10919
10920 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10921 Fix_v4bx enum values .
10922 * gold/options.h (General_options): New option definitions.
10923 (General_options::fix_v4bx): New method.
10924 (General_options::Fix_v4bx): New enum.
10925 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10926 (General_options::parse_fix_v4bx_interworking): New method.
10927
80d0d023
DK
109282010-01-22 Doug Kwan <dougkwan@google.com>
10929
10930 * arm.cc (Arm_exidx_fixup): New class.
10931
af2cdeae
DK
109322010-01-21 Doug Kwan <dougkwan@google.com>
10933
10934 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10935 classes.
10936 (Arm_exidx_section_offset_map): New type.
10937
993d07c1
DK
109382010-01-21 Doug Kwan <dougkwan@google.com>
10939
10940 * arm.cc (Arm_exidx_input_section): New class.
10941 (Arm_relobj::exidx_input_section_by_link,
10942 Arm_relobj::exidx_input_section_by_shndx,
10943 Arm_relobj::make_exidx_input_section): New methods.
10944 (read_arm_attributes_section): Remove.
10945 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10946 information about them.
10947 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10948 to here.
10949
5ac169d4
DK
109502010-01-20 Doug Kwan <dougkwan@google.com>
10951
10952 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10953 Input_section_specifier to Section_id.
10954 (Target_arm::new_arm_input_section: Adjust code for change of key
10955 type.
10956 (Target_arm::find_arm_input_section): Ditto.
10957 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10958 (Section_id): Remove.
10959 (Garbage_collection::Section_id_hash): Remove.
10960 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10961 (Section_id): Remove.
10962 (Icf::Section_id_hash): Remove.
10963 * object.h (Section_id, Const_section_id, Section_id_hash,
10964 Const_section_id_hash): New type definitions.
10965 * output.cc (Output_section::add_relaxed_input_section): Change to
10966 use Const_section_id instead of Input_section_specifier as key type.
10967 (Output_section::add_merge_input_section): Ditto.
10968 (Output_section::build_relaxation_map): Change to use Section_id
10969 instead of Input_section_specifier as key type.
2e702c99 10970 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10971 Ditto.
10972 (Output_section::convert_input_sections_to_relaxed_sections): Change
10973 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10974 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10975 (Output_section::find_relaxed_input_section): Ditto.
10976 * output.h (Input_section_specifier): Remove class.
10977 (Output_section::Output_section_data_by_input_section_map): Change
10978 key type to Const_section_id.
10979 (Output_section::Output_relaxed_input_section_by_input_section_map):
10980 Ditto.
10981 (Output_section::Relaxation_map): Change key type to Section_id.
10982
a2162063
ILT
109832010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10984
10985 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10986 (class Arm_v4bx_stub): New class.
10987 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10988 (Stub_factory::make_arm_v4bx_stub): New method.
10989 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10990 (Stub_table::empty): Handle v4bx stubs.
10991 (Stub_table::add_arm_v4bx_stub): New method.
10992 (Stub_table::find_arm_v4bx_stub): New method.
10993 (Arm_relocate_functions::v4bx): New method.
10994 (Target_arm::fix_v4bx): New method.
10995 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10996 (Stub_table::relocate_stubs): Likewise.
10997 (Stub_table::do_write): Likewise.
10998 (Stub_table::update_data_size_and_addralign): Likewise.
10999 (Stub_table::finalize_stubs): Likewise.
11000 (Target_arm::Scan::local): Likewise.
11001 (Target_arm::Scan::global): Likewise.
11002 (Target_arm::do_finalize_sections): Likewise.
11003 (Target_arm::Relocate::relocate): Likewise.
11004 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11005 Likewise.
11006 (Target_arm::scan_reloc_for_stub): Likewise.
11007 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11008
5696ab0b
ILT
110092010-01-19 Ian Lance Taylor <iant@google.com>
11010
11011 * output.cc (Output_section_headers::do_sized_write): Write large
11012 segment count to sh_info field.
11013 (Output_file_header::do_sized_write): For large segment count,
11014 write PN_XNUM to e_phnum field.
11015
800d0f56
ILT
110162010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11017
11018 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11019 (Arm_relocate_functions::thm_jump8): New function.
11020 (Arm_relocate_functions::thm_jump11): New function.
11021 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11022 R_ARM_THM_JUMP11.
11023 (Target_arm::Scan::global): Likewise.
11024 (Target_arm::Relocate::relocate): Likewise.
11025 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11026 Likewise.
11027
41263c05
DK
110282010-01-14 Doug Kwan <dougkwan@google.com>
11029
11030 * arm.cc (map, utility): Include headers.
11031 (Target_arm::apply_cortex_a8_workaround): New method.
11032 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11033 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11034 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11035 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11036 the --[no-]fix-cortex-a8 command line options.
11037 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11038 (Target_arm::relocate_stub): Use addend in instruction template.
11039 * options.h (DEFINE_bool): Set the user-set flag.
11040 (General_options): Add --[no-]-fix-cortex options.
11041 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11042 : Update fast look-up map after conversion.
41263c05 11043
459e9b03
ST
110442010-01-14 Sriraman Tallam <tmsriram@google.com>
11045
11046 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11047 in the first pass of do_layout.
11048
b521dfe4
DK
110492010-01-13 Doug Kwan <dougkwan@google.com>
11050
11051 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11052 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11053 apparent compiler problem of not folding static constant integral
11054 data members of elfcpp::Elf_sizes<32>.
11055
44272192
DK
110562010-01-13 Doug Kwan <dougkwan@google.com>
11057
11058 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11059 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11060 Arm_relobj::scan_section_for_cortex_a8_erratum,
11061 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11062 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11063 sections to scan for relocation stubs into a new method
11064 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11065 relocation and Cortex-A8 stub scanning.
11066 (Target_arm::do_relax): Force stubs to be after stubbed sections
11067 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11068 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11069 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11070
44b71ece
ILT
110712010-01-12 Ian Lance Taylor <iant@google.com>
11072
11073 * target-reloc.h (visibility_error): New inline function.
11074 (relocate_section): Call visibility_error.
11075 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11076 (MOSTLYCLEANFILES): Likewise.
11077 (protected_4_pic.o, protected_3.err): New targets.
11078 * testsuite/protected_4.cc: New file.
11079
a120bc7f
DK
110802010-01-12 Doug Kwan <dougkwan@google.com>
11081
11082 * arm.cc (Cortex_a8_reloc): New class.
11083 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11084 and cortex_a8_relocs_info_.
11085 (Target_arm::fix_cortex_a8): New method definition.
11086 (Target_arm::Cortex_a8_relocs_info): New type.
11087 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11088 New data member declarations.
11089 (Target_arm::scan_reloc_for_stub): Record information about
11090 relocations for THUMB branches that might be exempted from the
11091 Cortex-A8 workaround.
11092 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11093 at the beginning of a relaxation pass.
11094
20138696
DK
110952010-01-12 Doug Kwan <dougkwan@google.com>
11096
11097 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11098 (Arm_relobj::Mapping_symbol_position,
11099 Arm_reloj::Mapping_symbol_position_less,
11100 Arm_relobj::Mapping_symbols_info): New types.
11101 (Target_arm::is_mapping_symbol_name): New method definition.
11102 (Arm_relobj::do_count_local_symbols): Save information about mapping
11103 symbols.
11104
089d69dc
DK
111052010-01-11 Doug Kwan <dougkwan@google.com>
11106
11107 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11108 Arm_relocate_functions::thumb32_branch_upper,
11109 Arm_relocate_functions::thumb32_branch_lower,
11110 Arm_relocate_functions::thumb32_cond_branch_offset,
11111 Arm_relocate_functions::thumb32_cond_branch_upper,
11112 Arm_relocate_functions::thumb32_cond_branch_lower,
11113 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11114 branch offset encoding.
11115 (Arm_relocate_functions::thumb_branch_common): Use new branch
11116 offset encoding methods to avoid code duplication.
11117 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11118 (Stub_addend_reader::operator()): Use new branch encoding method
11119 to avoid code duplication.
11120
99e5bff2
DK
111212010-01-11 Doug Kwan <dougkwan@google.com>
11122
11123 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11124 (Target_arm::do_finalize_sections): Define special EXIDX section
11125 symbols only if referenced.
11126 * gc.h (Garbage_collection::add_reference): New method.
11127 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11128 code duplication.
11129
98e090bd
ILT
111302010-01-11 Ian Lance Taylor <iant@google.com>
11131
d0a91bd8
ILT
11132 * script.cc (Version_script_info::build_expression_list_lookup):
11133 Change complaing about duplicate wildcard match from error to
11134 warning.
11135
98e090bd
ILT
11136 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11137 of 2009-12-30.
11138 (Version_script_info::Version_script_info): Initialize globs_,
11139 default_version_, default_is_global_, and exact_. Don't
11140 initialize globals_ or locals_.
11141 (Version_script_info::build_lookup_tables): Build local symbols
11142 first.
11143 (Version_script_info::unquote): New function.
11144 (Version_script_info::add_exact_match): New function.
11145 (Version_script_info::build_expression_list_lookup): Remove lookup
11146 parameter. Add is_global parameter. Change all callers. Handle
11147 wildcard pattern specially. Unquote pattern. Call
11148 add_exact_match.
11149 (Version_script_info::get_name_to_match): New function.
11150 (Version_script_info::get_symbol_version): New function.
11151 (Version_script_info::get_symbol_version_helper): Remove.
11152 (Version_script_info::check_unmatched_names): Call unquote.
11153 * script.h (class Version_script_info): Change get_symbol_version
11154 to be non-inline and add is_global parameter; change all callers.
11155 Rewrite symbol_is_local. Update declarations. Define struct
11156 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11157 Remove globals_ and locals_ members. Add exact_, globs_,
11158 default_version_, is_global_.
11159 (Version_script_info::Glob): Remove pattern, add expression and
11160 is_global. Update constructor. Change all callers.
11161 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11162 default version.
11163 (Versions::symbol_section_contents): If a symbol is undefined, or
11164 defined in a dynamic object, set the version index to
11165 VER_NDX_LOCAL.
11166 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11167 symbol_is_local.
11168 (Symbol_table::add_from_pluginobj): Likewise.
11169 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11170
d56962d3
DK
111712010-01-11 Doug Kwan <dougkwan@google.com>
11172
11173 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11174 (incremental_dump_LDADD): Add linking option for libintl.
11175 * Makefile.in: Regenerate.
11176
94e6ee91
L
111772010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11178
11179 PR gold/11144
11180 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11181 instead of -Ds.
11182 * testsuite/Makefile.in: Regenerated.
11183
e96c574b
DK
111842010-01-10 Doug Kwan <dougkwan@google.com>
11185
11186 * options.h (DEFINE_var): Use parentheses around argument varname__
11187 in macro body to avoid any unintended subsequent substitutions.
11188
7198066b
ILT
111892010-01-10 Ian Lance Taylor <iant@google.com>
11190
ba4d53bf
ILT
11191 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11192 candidates before doing symbol resolution.
11193
7198066b
ILT
11194 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11195 ODR candidates if only one is weak.
11196
a2beed37
ILT
111972010-01-08 Ian Lance Taylor <iant@google.com>
11198
11199 * script.cc (Version_script_info::build_expression_list_lookup):
11200 Don't warn about ambiguous version, just record the ambiguity.
11201 (Version_script_info::get_symbol_version_helper): Give error if
11202 version is ambiguous.
11203
2fb7225c
DK
112042010-01-08 Doug Kwan <dougkwan@google.com>
11205
11206 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11207 prev_data_size_ and prev_addralign_. Remove initializer for
11208 deleted data member has_been_changed_.
11209 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11210 to determine if the table is empty.
11211 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11212 Remove.
11213 (Stub_table::add_reloc_stub): Define method in class definition
11214 instead of just declaring it there.
11215 (Stub_table::add_cortex_a8_stub): New method definition.
11216 (Stub_table::update_data_size_and_addralign): Ditto.
11217 (Stub_table::finalize_stubs): Ditto.
11218 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11219 (Stub_table::do_addralign_): Return address alignment in the
11220 (Stub_table::do_reset_address_and_file_offset): Define method in
11221 class definition instead of declaring it there. Set current data
11222 size to be the data size of the previous pass.
11223 (Stub_table::set_final_data_size): Use current data size as the
11224 final data size.
11225 (Stub_table::relocate_stub): Change parameter type of stub from
11226 Reloc_stub pointer to Stub pointer.
11227 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11228 (Stub_table::Cortex_a8_stub_list): New typedef.
11229 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11230 Stub_table::prev_addralign_): New data member.
11231 (Arm_relobj::Arm_relobj): Initialize data member
11232 section_has_cortex_a8_workaround_.
11233 (Arm_relobj::section_has_cortex_a8_workaround,
11234 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11235 definitions.
11236 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11237 declarations.
11238 (Target_arm::relocate_stub): Change parameter type of stub from
11239 Reloc_stub pointer to Stub pointer.
11240 (Insn_template::size, Insn_template::alignment): Handle
11241 THUMB16_SPECIAL_TYPE.
11242 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11243 Stub_table::update_data_size_and_addralign,
11244 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11245 definitions.
11246 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11247 (Stub_table::do_write): Ditto.
11248 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11249
880cd20d
ILT
112502010-01-08 Ian Lance Taylor <iant@google.com>
11251
11252 PR 11108
11253 * symtab.h (class Symbol): Remove fields is_target_special_ and
11254 has_plt_offset_. Add field is_defined_in_discarded_section_.
11255 (Symbol::is_defined_in_discarded_section): New function.
11256 (Symbol::set_is_defined_in_discarded_section): New function.
11257 (Symbol::has_plt_offset): Rewrite.
11258 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11259 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11260 Don't initialize is_target_special_ or has_plt_offset_.
11261 Initialize is_defined_in_discarded_section_.
11262 (Symbol_table::add_from_relobj): If appropriate, set
11263 is_defined_in_discarded_section.
11264 * resolve.cc (Symbol::override_base_with_special): Don't test
11265 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11266 * target-reloc.h (relocate_section): Do special handling for
11267 symbols defined in discarded sections for global symbols as well
11268 as local symbols.
11269
2703e3eb
ILT
112702010-01-08 Ian Lance Taylor <iant@google.com>
11271
11272 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11273 the SHT_SYMTAB case.
11274
339d40a3
ILT
112752010-01-08 Ian Lance Taylor <iant@google.com>
11276
11277 * object.cc (Sized_relobj::do_layout): Don't get confused if
11278 layout_eh_frame returns NULL.
11279
abecea76
ILT
112802010-01-08 Ian Lance Taylor <iant@google.com>
11281
11282 PR 11084
11283 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11284 dynamic symbol table, use the normal symbol table.
11285 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11286 symbol table.
11287
6b7dd3f3
ILT
112882010-01-08 Ian Lance Taylor <iant@google.com>
11289
11290 PR 11072
11291 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11292 sections.
11293
36c50e63
L
112942010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11295
11296 * version.cc (print_version): Change to "Copyright 2010".
11297
e291e7b9
ILT
112982010-01-08 Ian Lance Taylor <iant@google.com>
11299
11300 PR 10287
11301 PR 11063
11302 * i386.cc (class Target_i386): Change return type of plt_section
11303 to be non-const.
11304 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11305 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11306 tls_desc_rel_ field.
11307 (Output_data_plt_i386::rel_tls_desc): New function.
11308 (Target_i386::rel_tls_desc_section): New function.
11309 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11310 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11311 R_386_TLS_DESC reloc in rel_tls_desc_section.
11312 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11313 Define struct Tlsdesc_info.
11314 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11315 (Target_x86_64::do_reloc_symbol_index): New function.
11316 (Target_x86_64::add_tlsdesc_info): New function.
11317 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11318 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11319 tlsdesc_rel_ field.
11320 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11321 all callers.
11322 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11323 (Target_x86_64::rela_tlsdesc_section): New function.
11324 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11325 handling.
11326 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11327 (Target_x86_64::do_reloc_addend): New function.
11328 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11329 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11330 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11331 (Output_reloc::type): New function.
11332 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11333 (Output_reloc::is_target_specific): New function.
11334 (Output_reloc::target_arg): New function.
11335 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11336 absolute relocs and target specific relocs.
11337 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11338 add_target_specific.
11339 (class Output_data_reloc) [SHT_RELA]: Likewise.
11340 * output.cc (Output_reloc::Output_reloc): Add four new versions
11341 for absolute relocs and target specific relocs.
11342 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11343 (Output_reloc::get_symbol_index): Likewise.
11344 (Output_reloc::local_section_offset): Check that local_sym_index_
11345 is not TARGET_CODE or 0.
11346 (Output_reloc::symbol_value): Likewise.
11347 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11348 reloc.
11349 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11350 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11351 functions.
11352 * layout.cc (add_target_dynamic_tags): Use output section for
11353 DT_PLTRELSZ and DT_JMPREL.
11354
3a44184e
ILT
113552010-01-07 Ian Lance Taylor <iant@google.com>
11356
11357 PR 11061
11358 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11359 function.
11360 (class Output_data_reloc_generic): Define.
11361 (class Output_data_reloc_base): Change base class to
11362 Output_data_reloc_generic. Change add() method to call
11363 bump_relative_reloc_count for a relative reloc. Remove
11364 sort_relocs_ field.
11365 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11366 to sort_relocs().
11367 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11368 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11369 appropriate.
11370 * layout.h (class Layout): Update declaration.
11371
ea715a34
ILT
113722010-01-07 Ian Lance Taylor <iant@google.com>
11373
11374 * output.h (class Output_data): Add const version of
11375 output_section and do_output_section.
11376 (class Output_section_data): Add const version of
11377 do_output_section.
11378 (class Output_section): Likewise.
11379 * layout.cc (Layout::add_target_dynamic_tags): New function.
11380 * layout.h (class Layout): Update declarations.
11381 * arm.cc (Target_arm::do_finalize_sections): Use
11382 add_target_dynamic_tags.
11383 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11384 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11385 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11386 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11387
659948a4
ILT
113882010-01-07 Ian Lance Taylor <iant@google.com>
11389
11390 PR 11042
11391 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11392 object as needed.
11393
9d3b86f6
ILT
113942010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11395 Ian Lance Taylor <iant@google.com>
11396
11397 PR 11019
11398 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11399 Xindex::read_symtab_xindex.
11400
bb0d3eb0
DK
114012010-01-07 Doug Kwan <dougkwan@google.com>
11402
11403 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11404 (Insn_template::thumb16_bcond_insn): New method declaration.
11405 (Insn_template): Fix spelling.
11406 (Stub::thumb16_special): New method declaration.
11407 (Stub::do_write): Define virtual method which was previously pure
11408 virtual.
11409 (Stub::do_thumb16_special): New method declaration.
11410 (Stub::do_fixed_endian_write): New template member.
11411 (Reloc_stub::do_write): Remove.
11412 (Reloc_stub::do_fixed_endian_write): Remove.
11413 (Cortex_a8_stub): New class definition.
11414 (Stub_factory::make_cortex_a8_stub): New method definition.
11415 (Stub_factory::Stub_factory): Add missing static storage class
11416 qualifier for elf32_arm_stub_a8_veneer_blx.
11417
ffeef7df
ILT
114182010-01-07 Ian Lance Taylor <iant@google.com>
11419
dc3f80fe
ILT
11420 PR 10980
11421 * options.h (class General_options): Add --warn-unresolved-symbols
11422 and --error-unresolved-symbols.
11423 * errors.cc (Errors::undefined_symbol): Implement
11424 --warn-unresolved-symbols.
11425
ffeef7df
ILT
11426 * options.h (class General_options): Add -z text and -z textoff.
11427 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11428
f1ec9ded
ST
114292010-01-06 Sriraman Tallam <tmsriram@google.com>
11430
11431 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11432 (Garbage_collection::cident_sections): New function.
11433 (Garbage_collection::add_cident_section): New function.
11434 (Garbage_collection::cident_sections_): New member.
11435 (gc_process_relocs): Add references to sections whose names are C
11436 identifiers.
11437 * gold.h (cident_section_start_prefix): New constant.
11438 (cident_section_stop_prefix): New constant.
11439 (is_cident): New function.
11440 * layout.cc (Layout::define_section_symbols): Replace string constants
11441 with the newly defined constants.
11442 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11443 C identifiers.
11444 * testsuite/Makefile.am: Add gc_orphan_section_test.
11445 * testsuite/Makefile.in: Regenerate.
11446 * testsuite/gc_orphan_section_test.cc: New file.
11447 * testsuite/gc_orphan_section_test.sh: New file.
11448
6eda8c29
ILT
114492010-01-06 Ian Lance Taylor <iant@google.com>
11450
b9674e17
ILT
11451 PR 10980
11452 * options.h (class General_options): Add --warn-shared-textrel.
11453 * layout.cc (Layout::finish_dynamic_section): Implement
11454 --warn-shared-textrel.
11455
6eda8c29
ILT
11456 PR 10980
11457 * options.h (class General_options): Add --warn-multiple-gp.
11458
32dcd44e
ILT
114592010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11460
11461 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11462 $(THREADSLIB) and $(LIBDL).
11463 * Makefile.in: Rebuild.
11464
a192ba05
ILT
114652010-01-06 Ian Lance Taylor <iant@google.com>
11466
11467 PR 10980
11468 * options.cc (General_options::parse_section_start): New function.
11469 (General_options::section_start): New function.
11470 (General_options::General_options): Initialize all members.
11471 * options.h: Include <map>
11472 (class General_options): Add --section-start. Add section_starts_
11473 member.
11474 * layout.cc (Layout::attach_allocated_section_to_segment): If
11475 --section-start was used, set the address of the segment. Remove
11476 local sort_sections.
11477 (Layout::relaxation_loop_body): If the address of the load segment
11478 has been set by --section-start, don't use it.
11479 * output.h (Output_segment::update_flags_for_output_section): New
11480 function.
11481 * output.cc (Output_segment::add_output_section): Call
11482 update_flags_for_output_section.
11483
dde3f402
ILT
114842010-01-05 Ian Lance Taylor <iant@google.com>
11485
62dfdd4d
ILT
11486 PR 10980
11487 * options.h (class General_options): Add --undefined-version.
11488 * script.cc (struct Version_expression): Add was_matched_by_symbol
11489 field.
11490 (Version_script_info::matched_symbol): New function.
11491 (Version_script_info::get_symbol_version_helper): Call
11492 matched_symbol.
11493 (Version_script_info::check_unmatched_names): New function.
11494 * script.h (class Version_script_info): Update declarations.
11495 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11496
9c4ae156
ILT
11497 * options.h (class General_options): Use DEFINE_bool_alias for
11498 allow_multiple_definition.
11499 * resolve.cc (Symbol_table::should_override): Don't test
11500 allow_multiple_definition.
11501
dde3f402
ILT
11502 PR 10980
11503 * options.h (class General_options): Add --cref.
11504 * main.cc (main): Print cref table if --cref. Don't close mapfile
11505 until after printing cref table.
11506 * cref.cc: Include "symtab.h".
11507 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11508 (Cref_table_compare::operator()): New function.
11509 (Cref_inputs::gather_cref): New function.
11510 (filecol): New static const.
11511 (Cref_inputs::print_cref): New function.
11512 (Cref::print_cref): New function.
11513 * cref.h: Include <cstdio>.
11514 (class Cref): Update declarations.
11515 * mapfile.h (Mapfile::file): New function.
11516 * object.h (class Object): Define Symbols. Declare virtual
11517 do_get_global_symbols.
11518 (Object::get_global_symbols): New function.
11519 * object.cc (Input_objects::add_object): Pass object to cref_ if
11520 --cref.
11521 (Input_objects::archive_start): Likewise.
11522 (Input_objects::archive_stop): Likewise.
11523 (Input_objects::print_cref): New function.
11524 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11525 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11526 --cref.
11527 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11528 function.
11529 * plugin.h (class Sized_pluginobj): Update declarations.
11530
8781f709
ILT
115312010-01-05 Ian Lance Taylor <iant@google.com>
11532
11533 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11534 to is_default_version. Rename insdef to insdefault.
11535 (Symbol_table::add_from_relobj): Rename def to is_default_version
11536 and local to is_forced_local.
11537 (Symbol_table::add_from_pluginobj): Likewise.
11538 (Symbol_table::add_from_dynobj): Likewise.
11539 (Symbol_table::define_special_symbol): Rename insdef to
11540 insdefault.
11541
fe35d28d
ILT
115422010-01-04 Ian Lance Taylor <iant@google.com>
11543
30bc8c46
ILT
11544 PR 10980
11545 * options.h (class General_options): Add
11546 --allow-multiple-definition and -z muldefs.
11547 * resolve.cc (Symbol_table::should_override): Don't warn about a
11548 multiple symbol definition if --allow-multiple-definition or -z
11549 muldefs.
11550
7eaea549
ILT
11551 PR 10980
11552 * options.h (class General_options): Add --add-needed and
11553 --copy-dt-needed-entries. Tweak --as-needed help entry.
11554 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11555 error if --copy-dt-needed-entries aka --add-needed is used and
11556 would cause a change in behaviour.
11557
fe35d28d
ILT
11558 PR 10980
11559 * options.h (class General_options): Add -G as a short version of
11560 --shared. Add no-op options -assert, -g, and -i.
11561
55a2bb35
ST
115622010-01-04 Sriraman Tallam <tmsriram@google.com>
11563
11564 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11565 check for .text or .gnu.linkonce.t sections.
11566 * icf.cc (Icf::find_identical_sections): Ditto.
11567 Change the detection for mangled function name within the section
11568 name.
11569 * icf.h (is_section_foldable_candidate): New function.
11570
719328e1
ILT
115712009-12-30 Ian Lance Taylor <iant@google.com>
11572
11573 PR 10980
11574 * options.h (class General_options): Permit two dashes with
11575 --retain-symbols-file.
11576
d7bb5745
ILT
115772009-12-30 Ian Lance Taylor <iant@google.com>
11578
403a15dd
ILT
11579 PR 10979
11580 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11581 don't put the file header and segment headers in the text
11582 segment.
11583
eda294df
ILT
11584 PR 10979
11585 * common.cc (Sort_commons::operator()): Stabilize sort when both
11586 entries are NULL.
11587 (Symbol_table::do_allocate_commons_list): When allocating common
11588 symbols, skip a symbol which is no longer common.
11589 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11590 an object before checking its type.
11591 * testsuite/common_test_2.c: New file.
11592 * testsuite/common_test_3.c: New file.
11593 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11594 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11595 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11596 (common_test_2_pic.o, common_test_2.so): New targets.
11597 (common_test_3_pic.o, common_test_3.so): New targets.
11598 * testsuite/Makefile.in: Rebuild.
11599
d7bb5745
ILT
11600 PR 10979
11601 * script.cc (read_input_script): If we see a new SECTIONS clause,
11602 and we have added an input section, give an error.
11603 * layout.h (class Layout): Add have_added_input_section function.
11604 Add have_added_input_section_ field.
11605 * layout.cc (Layout::Layout): Initialize
11606 have_added_input_section_.
11607 (Layout::layout): Set have_added_input_section_.
11608 (Layout::layout_eh_frame): Likewise.
11609
fc59c572
ILT
116102009-12-30 Ian Lance Taylor <iant@google.com>
11611
11612 PR 10931
11613 * options.h (class General_options): Add --sort-common option.
11614 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11615 * common.cc (Sort_common): Add sort_order parameter to
11616 constructor. Add sort_order_ field.
11617 (Sort_commons::operator): Check sort_order_.
11618 (Symbol_table::allocate_commons): Determine the sort order.
11619 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11620 Change all callers.
11621 (Symbol_table::do_allocate_commons_list): Likewise.
11622
1c74fab0
ILT
116232009-12-30 Ian Lance Taylor <iant@google.com>
11624
11625 PR 10916
11626 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11627 symbols from this object, don't change the visibility of an
11628 undefined symbol.
11629 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11630
6affe781
ILT
116312009-12-30 Ian Lance Taylor <iant@google.com>
11632
11633 PR 10861
11634 * script.h (class Version_script_info): Define Language enum.
11635 Update declarations. Define Glob, Exact, and Lookup types. Add
11636 new fields globals_, locals_, and is_finalized_.
11637 * script.cc: Various formatting fixes.
11638 (class Parser_closure): Change language_stack_ from a vector of
11639 std::string to one of Version_script_info::Language. Adjust all
11640 uses accordingly.
11641 (class Lazy_demangler): Remove.
11642 (struct Version_expression): Change language from std::string to
11643 Version_script_info::Language.
11644 (Version_script_info::Version_script_info): New function.
11645 (Version_script_info::~Version_script_info): Don't call clear.
11646 (Version_script_info::finalize): New function.
11647 (Version_script_info::build_lookup_tables): New function.
11648 (Version_script_info::build_expression_list_lookup): New
11649 function.
11650 (Version_script_info::get_symbol_version_helper): Rewrite to use
11651 lookup tables.
11652 (Version_script_info::print_expression_list): Adjust to use
11653 Version_script_info::Language.
11654 (script_push_lex_into_version_mode): Check that the version script
11655 has not been finalized.
11656 (version_script_push_lang): Change language string to
11657 Version_script_info::Language.
11658 * options.cc (Command_line::version_script): New function.
11659 * options.h (class General_options): Add finalize_dynamic_list
11660 function. Change version_script from declaration to definition.
11661 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11662 * testsuite/version_script.map: Remove duplicate def of foo.
11663 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11664 version_script.map.
11665 * testsuite/Makefile.in: Rebuild.
11666
818bf354
ILT
116672009-12-30 Ian Lance Taylor <iant@google.com>
11668
11669 PR 10843
11670 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11671 if the input symbol index is 0, make the output symbol index 0.
11672
ebcc8304
ILT
116732009-12-30 Ian Lance Taylor <iant@google.com>
11674
11675 PR 10670
11676 * options.h (class General_options): Add -x/--discard-all.
11677 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11678 --discard-all. If the local symbol needs a dynamic entry, check
11679 that before handling --discard-locals.
11680
176fe33f
ILT
116812009-12-30 Ian Lance Taylor <iant@google.com>
11682
bb321bb1
ILT
11683 PR 10450
11684 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11685 flags to PF_R.
11686 (Output_segment::add_output_section): Don't change the flags if
11687 the type is PT_TLS.
11688
176fe33f
ILT
11689 PR 10450
11690 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11691 GNU hash table if they need a dynamic value. Otherwise, don't add
11692 them if they are defined in a dynamic object or are forced local.
11693
e8cd95c7
ILT
116942009-12-29 Ian Lance Taylor <iant@google.com>
11695
1b81fb71
ILT
11696 PR 10450
11697 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11698 .gnu.hash table for a 32-bit target.
11699
8d6d383d
ILT
11700 PR 10450
11701 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11702 regular and a dynamic object only needs a dynamic symbol table
11703 entry if it is externally visible.
11704
e785ec03
ILT
11705 PR 10450
11706 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11707 constructor. Add global_offset_table_ field.
11708 (Target_i386::got_section): Set global_offset_table_.
11709 (Target_i386::do_finalize_sections): Set global_offset_table_
11710 size.
11711 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11712 in constructor. Add global_offset_table_ field.
11713 (Target_x86_64::got_section): Set global_offset_table_.
11714 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11715 size.
11716
1a2dff53
ILT
11717 * layout.cc (Layout::Layout): Initialize increase_relro_.
11718 (Layout::get_output_section): Add is_relro, is_last_relro, and
11719 is_first_non_relro parameters. Change all callers.
11720 (Layout::choose_output_section): Likewise.
11721 (Layout::add_output_section_data): Likewise.
11722 (Layout::make_output_section): Likewise.
11723 (Layout::set_segment_offsets): Clear increase_relro when using a
11724 linker script.
11725 * layout.h (class Layout): Add increase_relro method. Add
11726 increase_relro_ field. Update declarations.
11727 * output.cc (Output_section::Output_section): Initialize
11728 is_last_relro_ and is_first_non_relro_.
11729 (Output_segment::add_output_section): Group relro sections is
11730 do_sort is true. Handle is_last_relro and is_first_non_relro.
11731 (Output_segment::maximum_alignment): Remove relro handling.
11732 (Output_segment::set_section_addresses): Add increase_relro
11733 parameter. Change all callers. Add initial alignment to align
11734 relro sections on separate page. Remove old relro handling.
11735 (Output_segment::set_section_list_addresses): Remove in_relro
11736 parameter. Change all callers.
11737 (Output_segment::set_offset): Add increase parameter. Change all
11738 callers. Remove old relro handling.
11739 * output.h (class Output_section): Add new methods: is_last_relro,
11740 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11741 Add is_last_relro_ and is_first_non_relro_ fields.
11742 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11743 Create separate .got.plt section. Call increase_relro.
11744 * x86_64.cc (Target_x86_64::got_section): Likewise.
11745 * testsuite/relro_script_test.t: Add .got.plt.
11746
f0ba79e2
ILT
11747 PR 10450
11748 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11749 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11750 (Layout::finalize): Call set_dynamic_symbol_size.
11751 (Layout::set_dynamic_symbol_size): New function.
11752 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11753 set_dynamic_symbol_size.
11754
e8cd95c7
ILT
11755 PR 10450
11756 * output.h (class Output_section): Add is_entsize_zero_ field.
11757 * output.cc (Output_section::Output_section): Initialize
11758 is_entsize_zero_.
11759 (Output_section::set_entsize): If two different entsizes are
11760 requested, force it to zero.
11761 (Output_section::add_input_section): Set flags for .debug_str
11762 before updating section flags. Set entsize.
11763 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11764 and SHF_STRING if all input sections have those flags.
11765
3e1b9a8a
RÁE
117662009-12-29 Rafael Espindola <espindola@google.com>
11767
11768 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11769 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11770 reporting.
3e1b9a8a 11771
3dcad376
ST
117722009-12-29 Sriraman Tallam <tmsriram@google.com>
11773
11774 * options.cc (General_options::parse_version): Allow -v to exit
11775 without an error if there is nothing to link.
11776
084e2665
ILT
117772009-12-29 Ian Lance Taylor <iant@google.com>
11778
11779 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11780 using a version of gcc before 4.1.
11781 * configure: Rebuild.
11782
250acde3
CD
117832009-12-28 Chris Demetriou <cgd@google.com>
11784
11785 * attributes.cc (Output_attributes_section_data::do_write): Use
11786 std::vector::front rather than std::vector::data.
11787
99fff23b
ILT
117882009-12-28 Ian Lance Taylor <iant@google.com>
11789
11790 * symtab.h (class Symbol_table): Add enum Defined.
11791 * resolve.cc (Symbol_table::should_override): Add defined
11792 parameter. Change all callers. Test whether object is NULL
11793 before calling a method on it.
11794 (Symbol_table::report_resolve_problem): Add defined parameter.
11795 Change all callers.
11796 (Symbol_table::should_override_with_special): Likewise.
11797 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11798 parameter. Change all callers.
11799 (Symbol_table::do_define_in_output_data): Likewise.
11800 (Symbol_table::define_in_output_segment): Likewise.
11801 (Symbol_table::do_define_in_output_segment): Likewise.
11802 (Symbol_table::define_as_constant): Likewise.
11803 (Symbol_table::do_define_as_constant): Likewise.
11804 * script.h (class Symbol_assignment): Add is_defsym parameter to
11805 constructor; change all callers.
11806 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11807 parameter. Change all callers. Add is_defsym_ field.
11808 (class Parser_closure): Add parsing_defsym parameter to
11809 constructor; change all callers. Add parsing_defsym accessor
11810 function. Add parsing_defsym_ field.
11811
556bd683
ILT
118122009-12-28 Ian Lance Taylor <iant@google.com>
11813
11814 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11815 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11816
1782c879
ILT
118172009-12-23 Ian Lance Taylor <iant@google.com>
11818
11819 * i386.cc (Target_i386::do_calls_non_split): Recognize
11820 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11821 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11822 -fsplit-stack prologue when using %r11.
1782c879 11823
329ca2b1
ST
118242009-12-21 Sriraman Tallam <tmsriram@google.com>
11825
11826 * options.cc (General_options::parse_version): Make -v continue and do
11827 the link like GNU ld does.
11828
d675ff46
RÁE
118292009-12-17 Rafael Avila de Espindola <espindola@google.com>
11830
11831 * Makefile.am (CCFILES): Add timer.cc.
11832 (HFILES): Add timer.h.
11833 * configure.ac: Check for sysconf and times.
11834 * main.cc: include timer.h.
11835 (main): Use Timer instead of get_run_time.
11836 * timer.cc: New.
11837 * timer.h: New.
11838 * workqueue.cc: include timer.h.
11839 (Workqueue::find_and_run_task):
11840 Report user, sys and wall time.
11841 * Makefile.in: Regenerate.
11842 * config.in: Regenerate.
11843 * configure: Regenerate.
11844
d6344fb5
DK
118452009-12-16 Doug Kwan <dougkwan@google.com>
11846
11847 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11848 sections.
11849 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11850 relaxed input sections.
11851 * output.cc (Output_section::find_relaxed_input_section): Change
11852 return type to Output_relaxed_input_section pointer. Adjust code
11853 for new type of relaxed_input_section_map_.
11854 * output.h (Output_section::find_relaxed_input_section): Change
11855 return type to Output_relaxed_input_section pointer.
11856 (Output_section::Output_relaxed_input_section_by_input_section_map):
11857 New type.
11858 (Output_section::relaxed_input_section_map_): Change type to
11859 Output_section::Output_relaxed_input_section_by_input_section_map.
11860 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11861 input section.
11862
0e0d5469
ILT
118632009-12-15 Ian Lance Taylor <iant@google.com>
11864
11865 * layout.cc (Layout::create_shstrtab): Only write out after input
11866 sections if we are compressing debug sections.
11867
0649a889
ILT
118682009-12-15 Ian Lance Taylor <iant@google.com>
11869
11870 * archive.cc (Archive::add_symbols): Only look up a symbol without
11871 a version if there is, in fact, a version.
11872
2ea97941
ILT
118732009-12-14 Ian Lance Taylor <iant@google.com>
11874
11875 Revert -Wshadow changes, all changes from:
11876 2009-12-11 Doug Kwan <dougkwan@google.com>
11877 2009-12-11 Nick Clifton <nickc@redhat.com>
11878 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11879
b0eec2cc
DK
118802009-12-11 Doug Kwan <dougkwan@google.com>
11881
11882 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11883 due to -Wshadow.
11884 * attributes.cc (Object_attribute::size): Ditto.
11885 (Attributes_section_data::size): Ditto.
11886 (Attributes_section_data::Attributes_section_data): Ditto.
11887 (Output_attributes_section_data::do_write): Ditto.
11888 * attributes.h (Object_attribute::set_type): Ditto.
11889 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11890
91d6fa6a
NC
118912009-12-11 Nick Clifton <nickc@redhat.com>
11892
11893 * archive.cc: Fix shadowed variable warnings.
11894 * arm.cc: Likewise.
11895 * compressed_output.cc: Likewise.
11896 * compressed_output.h: Likewise.
11897 * configure: Likewise.
11898 * dwarf_reader.cc: Likewise.
11899 * dynobj.cc: Likewise.
11900 * dynobj.h: Likewise.
11901 * ehframe.cc: Likewise.
11902 * ehframe.h: Likewise.
11903 * errors.cc: Likewise.
11904 * expression.cc: Likewise.
11905 * fileread.cc: Likewise.
11906 * fileread.h: Likewise.
11907 * freebsd.h: Likewise.
11908 * i386.cc: Likewise.
11909 * icf.cc: Likewise.
11910 * incremental.h: Likewise.
11911 * layout.cc: Likewise.
11912 * layout.h: Likewise.
11913 * mapfile.cc: Likewise.
11914 * merge.cc: Likewise.
11915 * merge.h: Likewise.
11916 * object.cc: Likewise.
11917 * object.h: Likewise.
11918 * options.h: Likewise.
11919 * output.cc: Likewise.
11920 * output.h: Likewise.
11921 * parameters.cc: Likewise.
11922 * plugin.cc: Likewise.
11923 * powerpc.cc: Likewise.
11924 * reduced_debug_output.cc: Likewise.
11925 * reduced_debug_output.h: Likewise.
11926 * reloc.cc: Likewise.
11927 * reloc.h: Likewise.
11928 * resolve.cc: Likewise.
11929 * script-sections.cc: Likewise.
11930 * script.cc: Likewise.
11931 * script.h: Likewise.
11932 * sparc.cc: Likewise.
11933 * symtab.cc: Likewise.
11934 * symtab.h: Likewise.
11935 * target-select.cc: Likewise.
11936 * target-select.h: Likewise.
11937 * token.h: Likewise.
11938 * workqueue.cc: Likewise.
11939 * workqueue.h: Likewise.
11940 * x86_64.cc: Likewise.
11941
a0351a69
DK
119422009-12-10 Doug Kwan <dougkwan@google.com>
11943
11944 * arm.cc (attributes.h): New include.
11945 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11946 (Arm_relobj::~Arm_relobj): Delete object pointed by
11947 attributes_section_data_.
11948 (Arm_relobj::attributes_section_data): New method definition.
11949 (Arm_relobj::attributes_section_data_): New data member declaration.
11950 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11951 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11952 attributes_section_data_.
11953 (Arm_dynobj::attributes_section_data): New method definition.
11954 (Arm_dynobj::attributes_section_data_): New data member declaration.
11955 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11956 initialization value of may_use_blx_ to false.
2e702c99 11957 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11958 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11959 object attributes to compute results instead of hard-coding.
11960 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11961 Target_arm::get_secondary_compatible_arch,
11962 Target_arm::set_secondary_compatible_arch
11963 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11964 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11965 New method declarations.
11966 (Target_arm::get_aeabi_object_attribute): New method definition.
11967 (Target_arm::attributes_section_data_): New data member declaration.
11968 (read_arm_attributes_section): New template definition.
11969 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11970 (Arm_dynobj::do_read_symbols): Ditto.
11971 (Target_arm::do_finalize_sections): Merge attributes sections from
11972 input. Check for BLX use after attributes section merging.
11973 Fix __exidx_start and __exidx_end visibility. Create an
11974 .ARM.attributes section if necessary.
11975 (Target_arm::get_secondary_compatible_arch,
11976 Target_arm::set_secondary_compatible_arch,
11977 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11978 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11979 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11980 New method definitions.
11981
b59befec
ILT
119822009-12-09 Ian Lance Taylor <iant@google.com>
11983
11984 * plugin.cc (Plugin::load): Don't cast from void* to a function
11985 pointer.
11986
1276bc89
ILT
119872009-12-09 Ian Lance Taylor <iant@google.com>
11988
11989 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11990 information fields.
11991
2f2de248
L
119922009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11993
11994 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11995 Replace two_file_shared_1.so with two_file_shared_2.so.
11996 * testsuite/Makefile.in: Regenerated.
11997
4f787271
DK
119982009-12-08 Doug Kwan <dougkwan@google.com>
11999
12000 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12001 (HFILES): Add attributes.h and int_encoding.h.
12002 * Makefile.in: Regenerate.
12003 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12004 function definitions to int_encoding.cc
12005 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12006 prototypes to int_encoding.h
12007 * reduced_debug_output.cc (int_encoding.h): New include.
12008 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12009 function definitions to int_encoding.cc
12010 (insert_into_vector, read_from_pointer): Move template definitions to
12011 int_encoding.h
12012 * attributes.cc: New file.
12013 * attributes.h: New file.
12014 * int_encoding.cc: New file.
12015 * int_encoding.h: New file.
12016
20b52f1a
RÁE
120172009-12-07 Rafael Avila de Espindola <espindola@google.com>
12018
12019 PR gold/11055
12020 * incremental-dump.cc (dump_incremental_inputs): New.
12021 (main): Use dump_incremental_inputs.
12022
53d7974c
L
120232009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12024
12025 PR gold/10893
12026 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12027 checking elfcpp::STT_FUNC.
12028 (Target_i386::Relocate::relocate): Likewise.
12029 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12030
12031 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12032 symbols from shared libraries into normal FUNC symbols.
12033
12034 * symtab.h (Symbol): Add is_func and use it.
12035
05a352e6
DK
120362009-12-05 Doug Kwan <dougkwan@google.com>
12037
12038 * arm.cc (Target_arm::arm_info): Initialize new fields
12039 attributes_section and attributes_vendor.
12040 * i386.cc (Target_i386::i386_info): Same.
12041 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12042 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12043 fields attributes_section and attributes_vendor.
53d7974c 12044 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12045 * target.h (Target::attributes_section, Target::attributes_vendor,
12046 Target::is_attributes_section, Target::attribute_arg_type,
12047 Target::attributes_order): New method definitions.
12048 (Target::Target_info::attributes_section,
12049 Target::Target_info::attributes_vendor): New fields.
12050 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12051 virtual method definitions.
12052 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12053 attributes_section and attributes_vendor.
12054 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12055
f4e5969c
DK
120562009-12-05 Doug Kwan <dougkwan@google.com>
12057
12058 * arm.cc: Update comments about interworking and stub generation.
12059 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12060 considered as non-PIC.
12061 (Arm_relocate_functions::base_abs): Fix formatting.
12062 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12063 of function to use GOT entry address instead of offset.
12064 (Target_arm::Scan::global): Issue an error if a symbol would need a
12065 PLT does not get one because it is untyped. Remove code to create
12066 dynamic symbols for relative branches.
12067 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12068 takes unsigned integer instead of boolean.
12069
1abce4a6
L
120702009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12071
12072 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12073 (two_file_test_LDADD): Likewise.
12074 (common_test_1_LDADD): Likewise.
12075 (exception_test_LDADD) Likewise.
12076 (weak_test_LDADD): Likewise.
12077 (many_sections_test_LDADD): Likewise.
12078 (initpri1_LDADD): Likewise.
12079 (script_test_1_LDADD): Likewise.
12080 (script_test_2_LDADD): Likewise.
12081 (justsyms_LDADD): Likewise.
12082 (binary_test_LDADD): Likewise.
12083 (large_LDADD): Likewise.
12084 * testsuite/Makefile.in: Regenerated.
12085
adcf2816 120862009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12087
adcf2816
L
12088 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12089 (Symbol_table::override_with_special): Likewise.
12090 (Symbol_table::add_from_object): Likewise.
12091
28e67f5d
RÁE
120922009-12-04 Rafael Avila de Espindola <espindola@google.com>
12093
12094 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12095 Don't set the data_offset twice.
12096
ae10a101
RÁE
120972009-12-04 Rafael Avila de Espindola <espindola@google.com>
12098
12099 * testsuite/Makefile.in: Regenerate.
12100
f59f41f3
DK
121012009-12-03 Doug Kwan <dougkwan@google.com>
12102
12103 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12104 (Target_arm::do_finalize_sections): Add parameter for symbol table
12105 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12106 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12107 parameter for symbol table pointer.
12108 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12109 an additional parameter for a pointer to symbol table.
12110 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12111 parameter for a symbol table pointer.
12112 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12113 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12114 Ditto.
12115 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12116 parameter for a symbol table pointer.
12117
ca55d848
RÁE
121182009-12-03 Rafael Avila de Espindola <espindola@google.com>
12119
12120 * incremental.cc (Incremental_inputs_header)
12121 (Incremental_inputs_header_write, Incremental_inputs_entry)
12122 (Incremental_inputs_entry_write): Move ...
12123 * incremental.h (Incremental_inputs_header)
12124 (Incremental_inputs_header_write, Incremental_inputs_entry)
12125 (Incremental_inputs_entry_write): here.
12126
3aec4f9c
RÁE
121272009-12-02 Rafael Avila de Espindola <espindola@google.com>
12128
12129 * incremental.cc (make_sized_incremental_binary): Set the target.
12130 Error if it is incompatible.
12131 * output.h (Output_file): Add filename method.
12132
9c0ae74d
RÁE
121332009-12-02 Rafael Avila de Espindola <espindola@google.com>
12134
12135 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12136 from the get_* methods.
12137
a45500ae
RÁE
121382009-12-02 Rafael Avila de Espindola <espindola@google.com>
12139
12140 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12141 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12142 Write 0 for the data_offset of scripts.
12143
325e6408
RÁE
121442009-12-02 Rafael Avila de Espindola <espindola@google.com>
12145
12146 * testsuite/Makefile.am: Add the incremental_test.sh test.
12147 * testsuite/incremental_test.sh: New.
12148 * testsuite/incremental_test_1.c: New.
12149 * testsuite/incremental_test_2.c: New.
12150
954c3e2e
RÁE
121512009-12-01 Rafael Avila de Espindola <espindola@google.com>
12152
703d02da 12153 * incremental-dump.cc (main): Fix typos.
954c3e2e 12154
f8086623
RÁE
121552009-11-27 Rafael Avila de Espindola <espindola@google.com>
12156
12157 PR gold/11025
12158 * incremental-dump.cc (main): Use llu to print 64 bit values.
12159
3b0dd6ac
L
121602009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12161 H.J. Lu <hongjiu.lu@intel.com>
12162
12163 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12164 $(LIBDL).
12165 (incremental_dump_LDADD): Likewise.
12166 * Makefile.in: Regenerated.
12167
a6d1ef57 121682009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12169
a6d1ef57
DK
12170 Revert:
12171
12172 2009-11-25 Doug Kwan <dougkwan@google.com>
12173
12174 * arm.cc (Target_arm::Target_arm): Move method definition
12175 outside of class definition. Add code to handle
12176 --target1-rel, --target1-abs and --target2= options.
12177 (Target_arm::get_reloc_reloc_type): Change method to be
12178 non-static and const.
12179 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12180 New data member declaration.
12181 (Target_arm::Scan::local, Target_arm::Scan::global,
12182 Target_arm::Relocate::relocate,
12183 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12184 Adjust call to Target_arm::get_real_reloc_type.
12185 (Target_arm::get_real_reloc_type): Use command line options
12186 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12187 * options.h (--target1-rel, --target1-abs, --target2): New
12188 ARM-only options.
12189
50aeb7d4
DK
121902009-11-25 Doug Kwan <dougkwan@google.com>
12191
12192 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12193 class definition. Add code to handle --target1-rel, --target1-abs
12194 and --target2= options.
12195 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12196 and const.
12197 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12198 member declaration.
12199 (Target_arm::Scan::local, Target_arm::Scan::global,
12200 Target_arm::Relocate::relocate,
12201 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12202 call to Target_arm::get_real_reloc_type.
12203 (Target_arm::get_real_reloc_type): Use command line options to
12204 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12205 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12206 options.
12207
51938283
DK
122082009-11-25 Doug Kwan <dougkwan@google.com>
12209
12210 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12211 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12212 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12213 formatting.
12214 (Arm_relocate_functions::thm_call): Replace body with a call to
12215 Arm_relocate_functions::thumb_branch_common.
12216 (Arm_relocate_functions::thm_jump24,
12217 Arm_relocate_functions::thm_xpc22): New method definitions.
12218 (Arm_relocate_functions::thumb_branch_common): New method definition.
12219 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12220 operator.
12221 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12222 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12223
e2b8f3c4
RÁE
122242009-11-24 Rafael Avila de Espindola <espindola@google.com>
12225
12226 * Makefile.am: Build incremental-dump
12227 * Makefile.in: Regenerate.
12228 * incremental-dump.cc: New.
12229 * incremental.cc (Incremental_inputs_header_data,
12230 Incremental_inputs_entry_data): Move to incremental.h
12231 * incremental.h: (Incremental_inputs_header_data,
12232 Incremental_inputs_entry_data): Move from incremental.cc
12233
bcba9aec
RÁE
122342009-11-24 Rafael Avila de Espindola <espindola@google.com>
12235
12236 * incremental.cc (Incremental_inputs_header,
12237 Incremental_inputs_header_write, Incremental_inputs_entry,
12238 Incremental_inputs_entry_write): Add a typedef with the data type.
12239
7c3afe08
RÁE
122402009-11-24 Rafael Avila de Espindola <espindola@google.com>
12241
12242 * incremental.cc (Incremental_inputs_header,
12243 Incremental_inputs_header_write, Incremental_inputs_entry,
12244 Incremental_inputs_entry_write): Update comment about which
12245 type has the filed descriptions.
12246
d204b6e9
DK
122472009-11-15 Doug Kwan <dougkwan@google.com>
12248
12249 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12250 (Arm_relocate_functions::arm_branch_common): Change method defintion
12251 in class definition to a method declaration and update list of formal
12252 parameters.
12253 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12254 Arm_relocation_functions::jump24): Adjust call to
12255 Arm_relocate_functions::arm_branch_common. Update list of formal
12256 parameters.
12257 (Arm_relocate_functions::xpc25): New method definition.
12258 (Arm_relocate_functions::arm_branch_common): Move method defintion
12259 out from class definition. Use stubs for mode-switching and extending
12260 branch ranges.
12261 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12262 specially. Change code to enable use of stubs in ARM branches.
12263
43d12afe
DK
122642009-11-10 Doug Kwan <dougkwan@google.com>
12265
12266 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12267 in method declaration.
12268 (Target_arm::relocate_stub): New method declaration.
12269 (Target_arm::default_target): Change to return a pointer instead of
12270 a const reference.
12271 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12272 Target_arm::default_target.
12273 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12274 method definition.
12275 (Target_arm::relocate_section): Adjust view.
12276 (Target_arm::relocate_stub): New method definition.
12277
ac33a407
DK
122782009-11-10 Doug Kwan <dougkwan@google.com>
12279
12280 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12281 a format warning.
12282 * incremental.cc (open_incremental_binary): Initialized local
12283 variables to avoid warnings.
12284 * object.cc (make_elf_object): Ditto.
12285 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12286 a format warning.
e1df38aa 12287
88ee28e9
L
12288009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12289
12290 PR gold/10930
12291 * testsuite/plugin_test.c: Include "config.h".
12292
2daedcd6
DK
122932009-11-09 Doug Kwan <dougkwan@google.com>
12294
12295 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12296 (arm_symbol_value): Remove.
12297 (Arm_relocate_functions::arm_branch_common,
12298 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12299 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12300 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12301 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12302 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12303 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12304 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12305 Arm_relocate_functions::thm_mobw_abs_nc,
12306 Arm_relocate_functions::thm_mov_abs,
12307 Arm_relocate_functions::movw_prel_nc,
12308 Arm_relocate_functions::thm_movt_abs,
12309 Arm_relocate_functions::movt_prel,
12310 Arm_relocate_functions::thm_movw_prel_nc,
12311 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12312 (Target_arm::Relocate::relocate): Only decompose address into two
12313 parts if relocation type uses the thumb-bit and pass the actual
12314 bit instead of a flag indicating that the thumb-bit is used. Adjust
12315 calls to methods in Arm_relocate_functions for this change.
12316
1276bc89 123172009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12318
12319 PR 10925
12320 * reloc.cc: Instantiate
12321 Sized_relobj::initialize_input_to_output_maps and
12322 Sized_relobj:free_input_to_output_maps.
12323
e53ad1b5
ILT
123242009-11-06 Ian Lance Taylor <iant@google.com>
12325
12326 PR 10876
12327 * defstd.cc (in_segment): Set only_if_ref true for "end".
12328
eb44217c
DK
123292009-11-06 Doug Kwan <dougkwan@google.com>
12330
12331 * arm.cc (class Reloc_stub): Correct a comment.
12332 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12333 (Target_arm::scan_section_for_stubs): New method declaration.
12334 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12335 Change methods from private to protected.
12336 (Target_arm::do_may_relax): New method definition.
12337 (Target_arm::do_relax, Target_arm::group_sections,
12338 Target_arm::scan_reloc_for_stub,
12339 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12340 (Target_arm::arm_input_section_map_): New data member declaration.
12341 (Target_arm::scan_reloc_for_stub,
12342 Target_arm::scan_reloc_section_for_stubs,
12343 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12344 Target_arm::do_relax): New method definitions.
12345
5d329b7d
ILT
123462009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12347
12348 * configure.ac: Check for (struct stat)::st_mtim
12349 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12350 * config.in: Regenerate.
12351 * configure: Regenerate.
12352
96a0d71b
ILT
123532009-11-05 Ian Lance Taylor <iant@google.com>
12354
12355 PR 10910
12356 * output.cc (Output_segment::add_output_section): Add missing
12357 return statement.
12358
594c8e5e
ILT
123592009-11-04 Ian Lance Taylor <iant@google.com>
12360
12361 PR 10880
12362 * object.h (class Object): Add is_needed and set_is_needed
12363 methods. Add is_needed_ field. Make bool fields into bitfields.
12364 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12365 defined in a dynamic object and referenced by a regular object,
12366 set is_needed for the dynamic object.
12367 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12368 if the file is marked with as_needed and it is not needed.
12369
22b127cc
ILT
123702009-11-04 Ian Lance Taylor <iant@google.com>
12371
12372 PR 10887
12373 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12374 tags if data is discarded by linker script.
12375 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12376 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12377 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12378 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12379
f5c870d2
ILT
123802009-11-04 Ian Lance Taylor <iant@google.com>
12381
12382 * layout.cc (Layout::get_output_section): Add is_interp and
12383 is_dynamic_linker_section parameters. Change all callers.
12384 (Layout::choose_output_section): Likewise.
12385 (Layout::make_output_section): Likewise.
12386 (Layout::add_output_section_data): Add is_dynamic_linker_section
12387 parameter. Change all callers.
12388 * layout.h (class Layout): Update declarations.
12389 * output.h (class Output_section): Add is_interp, set_is_interp,
12390 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12391 Add is_interp_, is_dynamic_linker_section_ fields. Change
12392 generate_code_fills_at_write_ to a bitfield.
12393 * output.cc (Output_section::Output_sections): Initialize new
12394 fields.
12395 (Output_segment::add_output_section): Add do_sort parameter.
12396 Change all callers.
12397
1ae4d23b
ILT
123982009-11-03 Ian Lance Taylor <iant@google.com>
12399
12400 PR 10860
12401 * options.h (class General_options): Add --warn-common.
12402 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12403 merging two common symbols.
12404 (Symbol_table::should_override): Handle --warn-common when merging
12405 a common symbol with a defined symbol. Use report_resolve_problem
12406 for multiple definitions.
12407 (Symbol_table::report_resolve_problem): New function.
12408 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12409
55da9579
DK
124102009-11-03 Doug Kwan <dougkwan@google.com>
12411
12412 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12413 stub_factory_.
12414 (Target_arm::stub_factory): New method definition.
12415 (Target_arm::new_arm_input_section,
12416 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12417 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12418 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12419 New type definitions.
12420 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12421 member declarations.
12422 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12423 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12424 New method definitions.
12425
37a9ac43
ILT
124262009-11-03 Ian Lance Taylor <iant@google.com>
12427
12428 * options.h (class General_options): Add --warn_constructors.
12429
b3d6a3d4
ILT
124302009-11-03 Ian Lance Taylor <iant@google.com>
12431
12432 PR 10893
12433 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12434 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12435
934b01dd
ILT
124362009-11-03 Ian Lance Taylor <iant@google.com>
12437
12438 PR 10895
12439 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12440 --msgid-bugs-address.
12441 (install-pdf): New target.
12442 (install-data_yes): Look up one directory to find mkinstalldirs.
12443
03c1939b
L
124442009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12445
12446 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12447 tree.
12448
ebd95253
DK
124492009-10-30 Doug Kwan <dougkwan@google.com>
12450
12451 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12452
e9bbb538
DK
124532009-10-30 Doug Kwan <dougkwan@google.com>
12454
12455 * arm.cc (Stub_addend_reader): New struct template definition
12456 and partial specializations.
12457 (Stub_addend_reader::operator()): New method definition for a
12458 partially specialized template.
12459
d5b40221
DK
124602009-10-30 Doug Kwan <dougkwan@google.com>
12461
12462 * arm.cc (Arm_relobj::processor_specific_flags): New method
12463 definition.
12464 (Arm_relobj::do_read_symbols): New method declaration.
12465 (Arm_relobj::processor_specific_flags_): New data member declaration.
12466 (Arm_dynobj): New class definition.
12467 (Target_arm::do_finalize_sections): Add input_objects parameter.
12468 (Target_arm::do_adjust_elf_header): New method declaration.
12469 (Target_arm::are_eabi_versions_compatible,
12470 (Target_arm::merge_processor_specific_flags): New method declaration.
12471 (Target_arm::do_make_elf_object): New overloaded method definitions
12472 and declaration.
12473 (Arm_relobj::do_read_symbols): New method definition.
12474 (Arm_dynobj::do_read_symbols): Ditto.
12475 (Target_arm::do_finalize_sections): Add input_objects parameters.
12476 Merge processor-specific flags from all input objects.
12477 (Target_arm::are_eabi_versions_compatible,
12478 Target_arm::merge_processor_specific_flags,
12479 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12480 New method definitions.
12481 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12482 Input_objects pointer type parameter.
12483 * layout.cc (Layout::finalize): Pass input objects to target's.
12484 finalize_sections function.
12485 * output.cc (Output_file_header::do_sized_write): Set ELF file
12486 header's processor-specific flags.
12487 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12488 Input_objects pointer type parameter.
12489 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12490 * target.h (Input_objects): New forward class declaration.
12491 (Target::processor_specific_flags,
12492 Target::are_processor_specific_flags_sect): New method definitions.
12493 (Target::finalize_sections): Add input_objects parameter.
12494 (Target::Target): Initialize processor_specific_flags_ and
12495 are_processor_specific_flags_set_.
12496 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12497 parameter.
12498 (Target::set_processor_specific_flags): New method definition.
12499 (Target::processor_specific_flags_,
12500 Target::are_processor_specific_flags_set_): New data member
12501 declarations.
12502 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12503 Input_objects pointer type parameter.
12504
ebabffbd
DK
125052009-10-30 Doug Kwan <dougkwan@google.com>
12506
12507 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12508
ad0f2072
ILT
125092009-10-28 Ian Lance Taylor <iant@google.com>
12510
12511 * object.h (class Relobj): Drop options parameter from
12512 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12513 do_scan_relocs, do_relocate. Change all callers.
12514 (class Sized_relobj): Drop options parameters from
12515 do_gc_process_relocs, do_scan_relocs, do_relocate,
12516 do_relocate_sections, relocate_sections, emit_relocs_scan,
12517 emit_relocs_scan_reltype. Change all callers.
12518 (struct Relocate_info): Remove options field and all references to
12519 it.
12520 * reloc.h (class Read_relocs): Remove options constructor
12521 parameter and options_ field. Change all callers.
12522 (class Gc_process_relocs, class Scan_relocs): Likewise.
12523 (class Relocate_task): Likewise.
12524 * target-reloc.h (scan_relocs): Remove options parameter. Change
12525 all callers.
12526 (scan_relocatable_relocs): Likewise.
12527 * target.h (class Sized_target): Remove options parameter from
12528 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12529 all callers.
12530 * gc.h (gc_process_relocs): Remove options parameter. Change all
12531 callers.
12532 * arm.cc: Update functions to remove options parameters.
12533 * i386.cc: Likewise.
12534 * powerpc.cc: Likewise.
12535 * sparc.cc: Likewise.
12536 * x86_64.cc: Likewise.
12537 * testsuite/testfile.cc: Likewise.
12538
8ffa3667
DK
125392009-10-28 Doug Kwan <dougkwan@google.com>
12540
12541 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12542 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12543 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12544 New method definitions.
12545
40f36857
CC
125462009-10-28 Cary Coutant <ccoutant@google.com>
12547
12548 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12549 (Plugin::cleanup_done_): New member.
12550 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12551 (Plugin_manager::cleanup_done_): Remove.
12552 (Plugin_manager::add_input_file): Edit error message.
12553 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12554 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12555
2c849493
ILT
125562009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12557
12558 * fileread.cc: (File_read::View::~View): Use the new
12559 data_ownership_ filed.
12560 (File_read::~File_read): Dispose the new whole_file_view_.
12561 (File_read::open): Mmap the whole file if needed.
12562 (File_read::open): Use whole_file_view_ instead of contents_.
12563 (File_read::find_view): Use whole_file_view_ if applicable.
12564 (File_read::do_read): Use whole_file_view_ instead of contents_.
12565 (File_read::make_view): Use whole_file_view_ instead of contents_,
12566 update File_read::View::View call.
12567 (File_read::find_or_make_view): Update File_read::View::View
12568 call.
12569 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12570 remove contents_
12571 (File_read::View::Data_ownership): New enum.
12572 (File_read::View::View): Replace bool mapped_ with Data_ownership
12573 argument.
12574 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12575 (File_read::View::data_ownership_): New field.
12576 (File_read::contents_): Remove (replaced by whole_file_view_).
12577 (File_read::whole_file_view_): New field.
12578 * options.h (class General_options): Add --keep-files-mapped.
12579
24998053
CC
125802009-10-27 Cary Coutant <ccoutant@google.com>
12581
12582 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12583 * testsuite/Makefile.am (plugin_test_5): New test case.
12584 * testsuite/Makefile.in: Regenerate.
12585
72adc4fa
DK
125862009-10-25 Doug Kwan <dougkwan@google.com>
12587
12588 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12589 from private to protected to allow access by child class.
12590 (Sized_relobj::do_relocate_sections): New method declaration.
12591 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12592 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12593 Sized_relobj::relocate_sections. Instantiate template explicitly
12594 for different target sizes and endianity.
12595
07f508a2
DK
125962009-10-24 Doug Kwan <dougkwan@google.com>
12597
12598 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12599 (Arm_input_section::as_arm_input_section): New method.
12600 (Arm_output_section): New class definition.
12601 (Arm_output_section::create_stub_group,
12602 Arm_output_section::group_sections): New method definitions.
12603
10ad9fe5
DK
126042009-10-22 Doug Kwan <dougkwan@google.com>
12605
12606 * arm.cc (Arm_input_section): New class definition.
12607 (Arm_input_section::init, Arm_input_section:do_write,
12608 Arm_input_section::set_final_data_size,
12609 Arm_input_section::do_reset_address_and_file_offset): New method
12610 definitions.
12611
56ee5e00
DK
126122009-10-21 Doug Kwan <dougkwan@google.com>
12613
12614 * arm.cc (Stub_table, Arm_input_section): New forward class
12615 declarations.
12616 (Stub_table): New class defintion.
12617 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12618 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12619 New method definition.
12620
b569affa
DK
126212009-10-21 Doug Kwan <dougkwan@google.com>
12622
12623 * arm.cc: Update copyright comments.
12624 (Target_arm): New forward class template declaration.
12625 (Arm_address): New type.
12626 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12627 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12628 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12629 constants.
12630 (Insn_template): Same.
12631 (DEF_STUBS): New macro.
12632 (Stub_type): New enum type.
12633 (Stub_template): New class definition.
12634 (Stub): Same.
12635 (Reloc_stub): Same.
12636 (Stub_factory): Same.
12637 (Target_arm::Target_arm): Initialize may_use_blx_ and
12638 should_force_pic_veneer_.
12639 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12640 Target_arm::should_force_pic_veneer,
12641 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12642 Target_arm::using_thumb_only, Target_arm:;default_target): New
12643 method defintions.
12644 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12645 New data member declarations.
12646 (Insn_template::size, Insn_template::alignment): New method defintions.
12647 (Stub_template::Stub_template): New method definition.
12648 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12649 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12650 (Stub_factory::Stub_factory): New method definition.
12651 * gold.h (string_hash): New template.
12652 * output.h (Input_section_specifier::hash_value): Use
12653 gold::string_hash.
12654 (Input_section_specifier::string_hash): Remove.
12655 * stringpool.cc (Stringpool_template::string_hash): Use
12656 gold::string_hash.
12657
6c172549
DK
126582009-10-20 Doug Kwan <dougkwan@google.com>
12659
12660 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12661 symbols of relaxed input sections.
12662 * output.h (Output_section::find_relaxed_input_section): Make
12663 method public.
12664
c5617f2f
DK
126652009-10-16 Doug Kwan <dougkwan@google.com>
12666
12667 * dynobj.cc (Versions::Versions): Initialize version_script_.
12668 Only insert base version symbol definition for a shared object
12669 if version script defines any version versions.
12670 (Versions::define_base_version): New method definition.
12671 (Versions::add_def): Check that base version is not needed.
12672 (Versions::add_need): Define base version lazily.
12673 * dynobj.h (Versions::define_base_version): New method declaration.
12674 (Versions::needs_base_version_): New data member declaration.
12675 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12676 (check_DATA): Add no_version_test.stdout.
12677 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12678 New make rules.
12679 * testsuite/Makefile.in: Regenerate.
12680 * testsuite/no_version_test.c: New file.
12681 * testsuite/no_version_test.sh: Ditto.
12682
3c12dcdb
DK
126832009-10-16 Doug Kwan <dougkwan@google.com>
12684
12685 * expression.cc (class Segment_start_expression): New class definition.
12686 (Segment_start_expression::value): New method definition.
12687 (script_exp_function_segment_start): Return a new
12688 Segment_start_expression.
12689 * gold/script-c.h (script_saw_segment_start_expression): New function
12690 prototype.
12691 * script-sections.cc (Script_sections::Script_sections): Initialize
12692 SAW_SEGMENT_START_EXPRESSION_ to false.
12693 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12694 and -Tbbs options to specify section addresses if given in
12695 command line and no SEGMENT_START expression is seen in a script.
12696 * script-sections.h (Script_sections::saw_segment_start_expression,
12697 Script_sections::set_saw_segment_start_expression): New method
12698 definition.
12699 (Script_sections::saw_segment_start_expression_): New data member
12700 declaration.
12701 * script.cc (script_saw_segment_start_expression): New function.
12702 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12703 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12704 script_test_7.sh and script_test_8.sh.
12705 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12706 script_test_8.stdout.
12707 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12708 (script_test_6, script_test_6.stdout, script_test_7,
12709 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12710 * Makefile.in: Regenerate.
12711 * testsuite/script_test_6.sh: New file.
12712 * testsuite/script_test_6.t: Same.
12713 * testsuite/script_test_7.sh: Same.
12714 * testsuite/script_test_7.t: Same.
12715 * testsuite/script_test_8.sh: Same.
12716
64b1ae37
DK
127172009-10-16 Doug Kwan <dougkwan@google.com>
12718
12719 * output.cc (Output_segment::set_section_list_address): Cast
12720 expressions to unsigned long long type to avoid format warnings.
12721
661be1e2
ILT
127222009-10-15 Ian Lance Taylor <iant@google.com>
12723
12edd763 12724 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12725 dot assignment to script_sections_.
12edd763
ILT
12726 * script-sections.cc (Script_sections::add_dot_assignment):
12727 Initialize if necessary.
12728
68b6574b
ILT
12729 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12730 program headers with no load segment if there is a linker script.
12731
661be1e2
ILT
12732 * layout.cc (Layout::set_segment_offsets): Align the file offset
12733 to the segment aligment for -N or -n with no load segment.
12734 * output.cc (Output_segment::add_output_section): Don't crash if
12735 the first section is a TLS section.
12736 (Output_segment::set_section_list_addresses): Print an error
12737 message if the address moves backward in a linker script.
12738 * script-sections.cc
12739 (Output_section_element_input::set_section_addresses): Don't
12740 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12741 (Orphan_output_section::set_section_addresses): Likewise.
12742
f15f61a7
DK
127432009-10-15 Doug Kwan <dougkwan@google.com>
12744
12745 * layout.cc (Layout::finish_dynamic_section): Generate tags
12746 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12747 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12748 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12749
82bb573a
ILT
127502009-10-14 Ian Lance Taylor <iant@google.com>
12751
12752 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12753 fields.
12754 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12755 data_shdr fields of relinfo.
12756 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12757 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12758 R_386_TLS_LDO_32, adjust based on section flags.
12759 (Target_i386::Relocate::fix_up_ldo): Remove.
12760
374ad285
ILT
127612009-10-13 Ian Lance Taylor <iant@google.com>
12762
12763 Add support for -pie.
12764 * options.h (class General_options): Add -pie and
12765 --pic-executable.
12766 (General_options::output_is_position_independent): Test -pie.
12767 (General_options::output_is_executable): Return true if not shared
12768 and not relocatable.
12769 (General_options::output_is_pie): Remove.
12770 * options.cc (General_options::finalize): Reject incompatible uses
12771 of -pie.
12772 * gold.cc (queue_middle_tasks): A -pie link is not static.
12773 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12774 * symtab.cc (Symbol::final_value_is_known): Return false if
12775 output_is_position_independent.
12776 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12777 output_is_position_independent.
12778 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12779 output_is_position_independent.
12780 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12781 output_is_position_independent.
12782 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12783 two_file_pie_test.
12784 (basic_pie_test.o, basic_pie_test): New targets.
12785 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12786 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12787 (two_file_pie_test): New target.
12788 * testsuite/Makefile.in: Rebuild.
12789 * README: Remove note saying that -pie is not supported.
12790
c6585162
ILT
127912009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12792
12793 * options.h (class General_options): Add -init and -fini.
12794 * layout.cc (Layout::finish_dynamic_section): Emit
12795 given init and fini functions.
12796
032ce4e9
ST
127972009-10-13 Sriraman Tallam <tmsriram@google.com>
12798
12799 * gc.h (gc_process_relocs): Check if icf is enabled using new
12800 function.
12801 * gold.cc (queue_initial_tasks): Likewise.
12802 (queue_middle_tasks): Likewise.
12803 * object.cc (do_layout): Likewise.
12804 * symtab.cc (is_section_folded): Likewise.
12805 * main.cc (main): Likewise.
12806 * reloc.cc (Read_relocs::run): Likewise.
12807 (Sized_relobj::do_scan_relocs): Likewise.
12808 * icf.cc (is_function_ctor_or_dtor): New function.
12809 (Icf::find_identical_sections): Check if function is ctor or dtor when
12810 safe icf is chosen.
12811 * options.h (General_options::icf): Change option to be an enum.
12812 (Icf_status): New enum.
12813 (icf_enabled): New method.
12814 (icf_safe_folding): New method.
12815 (set_icf_status): New method.
12816 (icf_status_): New variable.
12817 * (options.cc) (General_options::finalize): Set icf_status_.
12818 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12819 icf_test and icf_keep_unique_test to use the --icf enum flag.
12820 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12821 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12822
f345227a
ST
128232009-10-12 Sriraman Tallam <tmsriram@google.com>
12824
12825 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12826 includes to gc.h and icf.h.
12827 * arm.cc: Include gc.h.
12828 * gold.cc: Likewise.
12829 * i386.cc: Likewise.
12830 * powerpc.cc: Likewise.
12831 * sparc.cc: Likewise.
12832 * x86_64.cc: Likewise.
12833 * gc.h: Include icf.h.
12834
1c7814ed
ILT
128352009-10-11 Ian Lance Taylor <iant@google.com>
12836
12837 * plugin.cc: Include "gold.h" before other header files.
12838
ae3b5189
CD
128392009-10-10 Chris Demetriou <cgd@google.com>
12840
12841 * options.h (Input_file_argument::Input_file_type): New enum.
12842 (Input_file_argument::is_lib_): Replace with...
12843 (Input_file_argument::type_): New member.
12844 (Input_file_argument::Input_file_argument): Take Input_file_type
12845 'type' rather than boolean 'is_lib' as second argument.
12846 (Input_file_argument::is_lib): Use type_.
12847 (Input_file_argument::is_searched_file): New function.
12848 (Input_file_argument::may_need_search): Handle is_searched_file.
12849 * options.cc (General_options::parse_library): Support -l:filename.
12850 (General_options::parse_just_symbols): Update for Input_file_argument
12851 changes.
12852 (Command_line::process): Likewise.
12853 * archive.cc (Archive::get_file_and_offset): Likewise.
12854 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12855 * script.cc (read_script_file, script_add_file): Likewise.
12856 * fileread.cc (Input_file::Input_file): Likewise.
12857 (Input_file::will_search_for): Handle is_searched_file.
12858 (Input_file::open): Likewise.
12859 * readsyms.cc (Read_symbols::get_name): Likewise.
12860 * testsuite/Makefile.am (searched_file_test): New test.
12861 * testsuite/Makefile.in: Regenerate.
12862 * testsuite/searched_file_test.cc: New file.
12863 * testsuite/searched_file_test_lib.cc: New file.
12864
f3048a1d
ILT
128652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12866 Ian Lance Taylor <iant@google.com>
12867
12868 * descriptor.cc: Include <cstdio> and "binary-io.h".
12869 (Descriptors::open): Open the files in binary mode always.
12870 * script.cc (Lex::get_token): Treat \r as whitespace.
12871
d4780e57
ILT
128722009-10-09 Ian Lance Taylor <iant@google.com>
12873
12874 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12875
d9a893b8
ILT
128762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12877 Ian Lance Taylor <iant@google.com>
12878
12879 * configure.ac: Check for readv function also.
12880 * fileread.cc (readv): Define if not HAVE_READV.
12881 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12882 does not exist.
12883 * config.in: Regenerate.
12884 * configure: Regenerate.
12885
c0a62865
DK
128862009-10-09 Doug Kwan <dougkwan@google.com>
12887
12888 * layout.cc (Layout::make_output_section): Call target hook to make
12889 ordinary output section.
12890 (Layout::finalize): Adjust parameter list of call the
12891 Target::may_relax().
12892 * layout.h (class Layout::section_list): New method.
12893 * merge.h (Output_merge_base::entsize): Change visibility to public.
12894 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12895 New methods.
12896 (Output_merge_string::do_is_string): New method.
12897 * object.cc (Sized_relobj::do_setup): renamed from
12898 Sized_relobj::set_up.
12899 * object.h (Sized_relobj::adjust_shndx,
12900 Sized_relobj::initializ_input_to_output_maps,
12901 Sized_relobj::free_input_to_output_maps): Change visibilities to
12902 protected.
12903 (Sized_relobj::setup): Virtualize.
12904 (Sized_relobj::do_setup): New method declaration.
12905 (Sized_relobj::invalidate_section_offset,
12906 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12907 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12908 * options.cc (parse_int): New function.
12909 * options.h (parse_int): New declaration.
12910 (DEFINE_int): New macro.
12911 (stub_group_size): New option.
12912 * output.cc (Output_section::Output_section): Initialize memebers
12913 merge_section_map_, merge_section_by_properties_map_,
12914 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12915 (Output_section::add_input_section): Handled deferred code-fill
12916 generation and remove an old comment.
12917 (Output_section::add_relaxed_input_section): New method definition.
12918 (Output_section::add_merge_input_section): Use merge section by
12919 properties map to speed to search. Update merge section maps
12920 as appropriate.
12921 (Output_section::build_relaxation_map): New method definition.
12922 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12923 Same.
12924 (Output_section::relax_input_section): Renamed to
12925 Output_section::convert_input_sections_to_relaxed_sections and change
12926 interface to take a vector of pointers to relaxed sections.
12927 (Output_section::find_merge_section,
12928 Output_section::find_relaxed_input_section): New method definitions.
12929 (Output_section::is_input_address_mapped,
12930 Output_section::output_offset, Output_section::output_address):
12931 Use output section data maps to speed up searching.
12932 (Output_section::find_starting_output_address): Add comments.
12933 (Output_section::do_write,
12934 Output_section::write_to_postprocessing_buffer): Do code-fill
12935 generation as appropriate.
12936 (Output_section::get_input_sections): Invalidate relaxed input section
12937 map.
12938 (Output_section::restore_states): Adjust type of checkpoint .
12939 Invalidate relaxed input section map.
12940 * output.h (Output_merge_base): New class declaration.
12941 (Input_section_specifier): New class defintion.
12942 (class Output_relaxed_input_section) Change base class to
12943 Output_section_data_build.
12944 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12945 base class initializer.
12946 (Output_section::add_relaxed_input_section): New method declaration.
12947 (Output_section::Input_section): Change visibility to protected.
2e702c99 12948 (Output_section::Input_section::relobj,
c0a62865
DK
12949 Output_section::Input_section::shndx): Handle relaxed input sections.
12950 Output_section::input_sections) Change visibility to protected. Also
12951 define overload to return a non-const pointer.
12952 (Output_section::Merge_section_properties): New class defintion.
12953 (Output_section::Merge_section_by_properties_map,
12954 Output_section::Output_section_data_by_input_section_map,
12955 Output_section::Relaxation_map): New types.
12956 (Output_section::relax_input_section): Rename method to
12957 Output_section::convert_input_sections_to_relaxed_sections and change
12958 interface to take a vector of relaxed section pointers.
12959 (Output_section::find_merge_section,
12960 Output_section::find_relaxed_input_section,
12961 Output_section::build_relaxation_map,
12962 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12963 New method declarations.
12964 (Output_section::merge_section_map_
12965 Output_section::merge_section_by_properties_map_,
12966 Output_section::relaxed_input_section_map_,
12967 Output_section::is_relaxed_input_section_map_valid_,
12968 Output_section::generate_code_fills_at_write_): New data members.
12969 * script-sections.cc
12970 (Output_section_element_input::set_section_addresses): Call
12971 current_data_size and addralign methods of relaxed input sections.
12972 (Orphan_output_section::set_section_addresses): Call current_data_size
12973 and addralign methods of relaxed input sections.
12974 * symtab.cc (Symbol_table::compute_final_value): Extract template
12975 from the body of Symbol_table::sized_finalize_symbol.
12976 (Symbol_table::sized_finalized_symbol): Call
12977 Symbol_table::compute_final_value.
12978 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12979 (Symbol_table::compute_final_value): New templated method declaration.
12980 * target.cc (Target::do_make_output_section): New method defintion.
12981 * target.h (Target::make_output_section): New method declaration.
12982 (Target::relax): Add more parameters for input objects, symbol table
12983 and layout. Adjust call to do_relax.
12984 (Target::do_make_output_section): New method declaration.
12985 (Target::do_relax): Add parameters for input objects, symbol table
12986 and layout.
12987
d446d6c4
ILT
129882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12989
12990 * pread.c: Include stdio.h.
12991
bc06c745
ILT
129922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12993
12994 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12995 defined.
12996
75aea3d0
ILT
129972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12998
12999 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13000 Change read_shndx type to unsigned int.
13001 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13002 int.
13003 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13004 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13005 Change read_shndx type to unsigned int.
13006 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13007 int.
13008 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13009 * layout.cc (Layout::create_symtab_sections): Cast the result of
13010 local_symcount * symsize to off_t in the gold_assert.
13011
be8fcb75
ILT
130122009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13013
13014 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13015 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13016 R_ARM_BASE_ABS.
13017 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13018 (Arm_relocate_functions::thm_abs5): New function.
13019 (Arm_relocate_functions::abs12): New function.
13020 (Arm_relocate_functions::abs16): New function.
13021 (Arm_relocate_functions::base_abs): New function.
13022 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13023 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13024 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13025 R_ARM_BASE_ABS.
13026 (Scan::global): Likewise.
13027 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13028 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13029 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13030 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13031 R_ARM_BASE_ABS.
13032
c2a122b6
ILT
130332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13034
13035 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13036 (Arm_relocate_functions::movt_prel): New function.
13037 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13038 (Arm_relocate_functions::thm_movt_prel): New function.
13039 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13040 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13041 (Scan::global, Relocate::relocate): Likewise.
13042 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13043
c4aa1e2d
ILT
130442009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13045
13046 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13047 Incremental_checker.
13048 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13049 unsigned int.
13050 (class Incremental_inputs_header): New class.
13051 (Incremental_inputs_header_writer): Edit comment.
13052 (Incremental_inputs_entry): New class.
13053 (Incremental_inputs_entry_writer): Edit comment.
13054 (Sized_incremental_binary::do_find_incremental_inputs_section):
13055 Add *strtab_shndx parameter, fill it.
13056 (Sized_incremental_binary::do_check_inputs): New method.
13057 (Incremental_checker::can_incrementally_link_output_file): Use
13058 Sized_incremental_binary::check_inputs.
13059 (Incremental_inputs::report_command_line): Save command line in
13060 command_line_.
13061 * incremental.h:
13062 (Incremental_binary::find_incremental_inputs_section): New
13063 method.
13064 (Incremental_binary::do_find_incremental_inputs_section): Add
13065 strtab_shndx parameter.
13066 (Incremental_binary::do_check_inputs): New pure virtual method.
13067 (Sized_incremental_binary::do_check_inputs): Declare.
13068 (Incremental_checker::Incremental_checker): Add incremental_inputs
13069 parameter, use it to initialize incremental_inputs_.
13070 (Incremental_checker::incremental_inputs_): New field.
13071 (Incremental_checker::command_line): New method.
13072 (Incremental_checker::inputs): New method.
13073 (Incremental_checker::command_line_): New field.
13074
c549a694
ILT
130752009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13076
13077 * incremental.cc: Include <cstdarg> and "target-select.h".
13078 (vexplain_no_incremental): New function.
13079 (explain_no_incremental): New function.
13080 (Incremental_binary::error): New method.
13081 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13082 method.
13083 (make_sized_incremental_binary): New function.
13084 (open_incremental_binary): New function.
13085 (can_incrementally_link_file): Add checks if output is ELF and has
13086 inputs section.
13087 * incremental.h: Include "elfcpp_file.h" and "output.h".
13088 (Incremental_binary): New class.
13089 (Sized_incremental_binary): New class.
13090 (open_incremental_binary): Declare.
13091 * object.cc (is_elf_object): Use
13092 elfcpp::Elf_recognizer::is_elf_file.
13093 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13094 * output.h (Output_file::filesize): New method.
13095
fd3c5f0b
ILT
130962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13097
13098 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13099 New function.
13100 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13101 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13102 function.
13103 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13104 function.
13105 (Arm_relocate_functions::movw_abs_nc): New function.
13106 (Arm_relocate_functions::movt_abs): New function.
13107 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13108 (Arm_relocate_functions::thm_movt_abs): New function.
13109 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13110 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13111 (Scan::global): Likewise.
13112 (Relocate::relocate): Likewise.
13113 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13114
7f5309a5
ILT
131152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13116
13117 * arm.cc (Arm_relocate_functions::got_prel) New function.
13118 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13119 (Relocate::relocate): Likewise.
13120 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13121
364c7fa5
ILT
131222009-10-06 Ian Lance Taylor <iant@google.com>
13123
13124 * options.h (class General_options): Define
13125 split_stack_adjust_size parameter.
13126 * object.h (class Object): Add uses_split_stack_ and
13127 has_no_split_stack_ fields. Add uses_split_stack and
13128 has_no_split_stack accessor functions. Declare
13129 handle_split_stack_section.
13130 (class Reloc_symbol_changes): Define.
13131 (class Sized_relobj): Define Function_offsets. Declare
13132 split_stack_adjust, split_stack_adjust_reltype, and
13133 find_functions.
13134 * object.cc (Object::handle_split_stack_section): New function.
13135 (Sized_relobj::do_layout): Call handle_split_stack_section.
13136 * dynobj.cc (Sized_dynobj::do_layout): Call
13137 handle_split_stack_section.
13138 * reloc.cc (Sized_relobj::relocate_sections): Call
13139 split_stack_adjust for executable sections in split_stack
13140 objects. Pass reloc_map to relocate_section.
13141 (Sized_relobj::split_stack_adjust): New function.
13142 (Sized_relobj::split_stack_adjust_reltype): New function.
13143 (Sized_relobj::find_functions): New function.
13144 * target-reloc.h: Include "object.h".
13145 (relocate_section): Add reloc_symbol_changes parameter. Change
13146 all callers.
13147 * target.h (class Target): Add calls_non_split method. Declare
13148 do_calls_non_split virtual method. Declare match_view and
13149 set_view_to_nop.
13150 * target.cc: Include "elfcpp.h".
13151 (Target::do_calls_non_split): New function.
13152 (Target::match_view): New function.
13153 (Target::set_view_to_nop): New function.
13154 * gold.cc (queue_middle_tasks): Give an error if mixing
13155 split-stack and non-split-stack objects with -r.
13156 * i386.cc (Target_i386::relocate_section): Add
13157 reloc_symbol_changes parameter.
13158 (Target_i386::do_calls_non_split): New function.
13159 * x86_64.cc (Target_x86_64::relocate_section): Add
13160 reloc_symbol_changes parameter.
13161 (Target_x86_64::do_calls_non_split): New function.
13162 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13163 parameter.
13164 * powerpc.cc (Target_powerpc::relocate_section): Add
13165 reloc_symbol_changes parameter.
13166 * sparc.cc (Target_sparc::relocate_section): Add
13167 reloc_symbol_changes parameter.
13168 * configure.ac: Call AM_CONDITIONAL for the default target.
13169 * configure: Rebuild.
13170 * testsuite/Makefile.am (TEST_AS): New variable.
13171 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13172 (check_DATA): Add split_i386 and split_x86_64 files.
13173 (SPLIT_DEFSYMS): Define.
13174 (split_i386_[1234n].o): New targets.
13175 (split_i386_[124]): New targets.
13176 (split_i386_[1234r].stdout): New targets.
13177 (split_x86_64_[1234n].o): New targets.
13178 (split_x86_64_[124]): New targets.
13179 (split_x86_64_[1234r].stdout): New targets.
13180 (MOSTLYCLEANFILES): Add new executables.
13181 * testsuite/split_i386.sh: New file.
13182 * testsuite/split_x86_64.sh: New file.
13183 * testsuite/split_i386_1.s: New file.
13184 * testsuite/split_i386_2.s: New file.
13185 * testsuite/split_i386_3.s: New file.
13186 * testsuite/split_i386_4.s: New file.
13187 * testsuite/split_i386_n.s: New file.
13188 * testsuite/split_x86_64_1.s: New file.
13189 * testsuite/split_x86_64_2.s: New file.
13190 * testsuite/split_x86_64_3.s: New file.
13191 * testsuite/split_x86_64_4.s: New file.
13192 * testsuite/split_x86_64_n.s: New file.
13193 * testsuite/testfile.cc (Target_test): Update relocation_section
13194 function.
13195 * testsuite/Makefile.in: Rebuild.
13196
e8a9fcda
ILT
131972009-10-06 Ian Lance Taylor <iant@google.com>
13198
13199 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13200 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13201 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13202 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13203 the address on ldo_addrs_.
13204 (Target_i386::Relocate::fix_up_ldo): New function.
13205
e99daf92
ILT
132062009-10-06 Rafael Espindola <espindola@google.com>
13207
13208 * plugin.cc (add_input_library): New.
13209 (Plugin::load): Add add_input_library to tv.
13210 (Plugin_manager::add_input_file): Add the is_lib argument.
13211 (add_input_file): Update call to Plugin_manager::add_input_file.
13212 (add_input_library): New.
13213 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13214
966d4097
DK
132152009-09-30 Doug Kwan <dougkwan@google.com>
13216
13217 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13218 symbol and call Symbol::may_need_copy_reloc to determine if
13219 a copy reloc is needed.
13220 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13221 nocopyreloc is given in command line.
13222 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13223 given in command line.
13224 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13225 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13226 of the removed Target_i386::may_need_copy_reloc.
13227 * options.h (copyreloc): New option with default value false.
13228 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13229 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13230 instead of the removed Target_powerpc::may_need_copy_reloc.
13231 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13232 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13233 instead of the removed Target_sparc::may_need_copy_reloc.
13234 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13235 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13236 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13237 instead of the removed Target_x86_64::may_need_copy_reloc.
13238
029ba973
ILT
132392009-09-30 Ian Lance Taylor <iant@google.com>
13240
13241 * object.h (class Object): Remove target_ field, and target,
13242 sized_target, and set_target methods.
13243 (Object::sized_target): Remove.
13244 (class Sized_relobj): Update declarations. Remove sized_target.
13245 * object.cc (Sized_relobj::setup): Remove target parameter.
13246 Change all callers.
13247 (Input_objects::add_object): Don't do anything with the target.
13248 (make_elf_sized_object): Add punconfigured parameter. Change all
13249 callers. Set or test parameter target.
13250 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13251 Change all callers.
13252 * parameters.cc (Parameters::set_target): Change parameter type to
13253 be non-const.
13254 (Parameters::default_target): Remove.
13255 (set_parameters_target): Change parameter type to be non-const.
13256 (parameters_force_valid_target): New function.
13257 (parameters_clear_target): New function.
13258 * parameters.h (class Parameters): Update declarations. Remove
13259 default_target method. Add sized_target and clear_target
13260 methods. Change target_ to be non-const.
13261 (set_parameters_target): Update declaration.
13262 (parameters_force_valid_target): Declare.
13263 (parameters_clear_target): Declare.
13264 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13265 as NULL if we aren't searching.
13266 (Add_symbols::run): Don't check for compatible target.
13267 * fileread.cc (Input_file::open_binary): Call
13268 parameters_force_valid_target.
13269 * gold.cc (queue_middle_tasks): Likewise.
13270 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13271 set_target on object.
13272 * dynobj.h (class Sized_dynobj): Update declarations.
13273 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13274 make_elf_object returns NULL.
13275 (Archive::include_member): Don't check whether object target is
13276 compatible.
13277 * output.cc (Output_section::add_input_section): Get target from
13278 parameters.
13279 (Output_section::relax_input_section): Likewise.
13280 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13281 parameters.
13282 (Sized_relobj::do_scan_relocs): Likewise.
13283 (Sized_relobj::relocate_sections): Likewise.
13284 * resolve.cc (Symbol_table::resolve): Likewise.
13285 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13286 parameter. Change all callers.
13287 (Symbol_table::add_from_object): Get target from parameters.
13288 (Symbol_table::add_from_relobj): Don't check object target.
13289 (Symbol_table::add_from_dynobj): Likewise.
13290 (Symbol_table::define_special_symbol): Get target from
13291 parameters.
13292 * symtab.h (class Symbol_table): Update declaration.
13293 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13294 parameter. Change all callers. Clear parameter target.
13295 (Binary_test): Test target here.
13296 * testsuite/object_unittest.cc (gold_testsuite): Remove
13297 target_test_pointer parameter. Change all callers.
13298 (Object_test): Test target here.
13299
a6a22b83
ILT
133002009-09-26 Ian Lance Taylor <iant@google.com>
13301
13302 * testsuite/initpri1.c: Don't try to use constructor priorities if
13303 compiling with gcc before 4.3.
13304
6a8f49fe
ILT
133052009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13306
13307 * testsuite/retain_symbols_file_test.sh (check_present): Change
13308 output file name to retain_symbols_file_test.stdout.
13309 (check_absent): Likewise.
13310
8c604651
CS
133112009-09-18 Craig Silverstein <csilvers@google.com>
13312
13313 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13314 * options.cc: Include <cerrno> and <fstream>.
13315 (General_options::finalize): Parse -retain-symbols-file tag.
13316 * options.h: New flag.
13317 (General_options): New method should_retain_symbol, new
13318 variable symbols_to_retain.
13319 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13320 should_retain_symbol map.
13321 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13322 * testsuite/Makefile.in: Regenerate.
13323 * testsuite/retain_symbols_file_test.sh: New file.
13324
ca58b19f
NC
133252009-09-18 Nick Clifton <nickc@redhat.com>
13326
13327 * po/es.po: Updated Spanish translation.
13328
20e6d0d6
DK
133292009-09-17 Doug Kwan <dougkwan@google.com>
13330
13331 * debug.h (DEBUG_RELAXATION): New constant.
13332 (DEBUG_ALL): Add DEBUG_RELAXATION.
13333 (debug_string_to_enum): Add relaxation debug option.
13334 * layout.cc
13335 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13336 Layout::Relaxation_debug_check::read_sections,
13337 Layout::Relaxation_debug_check::read_sections): New method definitions.
13338 (Layout::Layout): Initialize data members
13339 record_output_section_data_from_scrips_,
13340 script_output_section_data_list_ and relaxation_debug_check_.
13341 (Layout::save_segments, Layout::restore_segments,
13342 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13343 Layout::relaxation_loop_body): New method definitions.
13344 (Layout::finalize): Support relaxation. Move section layout code to
13345 Layout::relaxation_loop_body.
13346 (Layout::set_asection_address_from_script): Move code for orphan
13347 section placement out.
13348 (Layout::place_orphan_sections_in_script): New method definition.
13349 * layout.h (Output_segment_headers, Output_file_header):
13350 New forward class declarations.
13351 (Layout::~Layout): Define.
13352 (Layout::new_output_section_data_from_script): New method definition.
13353 (Layout::place_orphan_sections_in_script): New method declaration.
13354 (Layout::Segment_states): New type declaration.
13355 (Layout::save_segments, Layout::restore_segments,
13356 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13357 Layout::relaxation_loop_body): New method declarations.
13358 (Layout::Output_section_data_list): New type declaration.
13359 (Layout::Relaxation_debug_check): New class definition.
13360 (Layout::record_output_section_data_from_script_,
13361 Layout::script_output_section_data_list_, Layout::segment_states_,
13362 Layout::relaxation_debug_check_): New data members.
13363 * output.cc: (Output_section_headers::do_size): New method definition.
13364 (Output_section_headers::Output_section_headers): Move size
13365 computation to Output_section_headers::do_size.
13366 (Output_segment_headers::do_size): New method definition.
e1df38aa 13367 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13368 Output_file_header::do_size and call it.
13369 (Output_file_header::do_size): New method definition.
13370 (Output_data_group::Output_data_group): Adjust call to
13371 Output_section_data.
13372 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13373 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13374 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13375 RELAXED_INPUT_SECTION_CODE.
13376 (Output_section::Output_section): Initialize data member checkpoint_.
13377 (Output_section::~Output_section): Delete checkpoint object pointed
13378 by checkpoint_.
13379 (Output_section::add_input_section): Always add an Input_section if
13380 relaxing.
13381 (Output_section::add_merge_input_section): Add assert.
13382 (Output_section::relax_input_section): New method definition.
13383 (Output_section::set_final_data_size): Set load address to zero for
13384 an unallocated section.
13385 (Output_section::do_address_and_file_offset_have_reset_values):
13386 New method definition.
13387 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13388 Handle relaxed input section.
13389 (Output_section::sort_attached_input_sections): Checkpoint input
13390 section list lazily.
13391 (Output_section::get_input_sections): Change type of input_sections to
13392 list of Simple_input_section pointers. Checkpoint input section list
13393 lazily. Also handle relaxed input sections.
13394 (Output_section::add_input_section_for_script): Take a reference to
13395 a Simple_input_section object instead of Relobj pointer and section
13396 index as parameter. Handle relaxed input sections.
13397 (Output_section::save_states, Output_section::restore_states): New
13398 method definitions.
13399 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13400 (Output_data::is_data_size_fixed): New method definition.
13401 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13402 if it is fixed.
13403 (Output_data::address_and_file_offset_have_reset_values): New method
13404 definition.
13405 (Output_data::do_address_and_file_offset_have_reset_values): New method
13406 definition.
13407 (Output_data::set_data_size): Check that data size is not fixed.
13408 (Output_data::fix_data_size): New method definition.
13409 (Output_data::is_data_size_fixed_): New data member.
13410 (Output_section_headers::set_final_data_size): New method definition.
13411 (Output_section_headers::do_size): New method declaration.
13412 (Output_segment_headers::set_final_data_size): New method definition.
13413 (Output_segment_headers::do_size): New method declaration.
13414 (Output_file_header::set_final_data_size)::New method definition.
13415 (Output_file_header::do_size)::New method declaration.
13416 (Output_section_data::Output_section_data): Add new parameter
13417 is_data_size_fixed and use it to fix data size.
13418 (Output_data_const::Output_data_const): Adjust call to base class
13419 constructor and fix data size.
13420 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13421 base class constructor and fix data size.
13422 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13423 base class constructor and fix data size.
13424 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13425 class constructor and fix data size.
13426 (Output_data_group::set_final_data_size): New method definition.
13427 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13428 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13429 class constructor and fix data size.
13430 (Output_relaxed_input_section): New class definition.
13431 (Output_section::Simple_input_section): New class definition.
13432 (Output_section::get_input_sections): Adjust parameter list.
13433 (Output_section::add_input_section_for_script): Same.
13434 (Output_section::save_states, Output_section::restore_states,
13435 Output_section::do_address_and_file_offset_have_reset_values,
13436 (Output_section::Input_section::Input_section): Handle
13437 RELAXED_INPUT_SECTION_CODE. Add new overload for
13438 Output_relaxed_input_section.
13439 (Output_section::Input_section::is_input_section,
13440 Output_section::Input_section::set_output_section): Handle relaxed
13441 input section.
13442 (Output_section::Input_section::is_relaxed_input_section,
13443 Output_section::Input_section::output_section_data,
13444 Output_section::Input_section::relaxed_input_section): New method
13445 definitions.
13446 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13447 value.
13448 (Output_section::Input_section::u1_): Update comments.
13449 (Output_section::Input_section::u2_): Add new union member poris.
13450 (Output_section::Checkpoint_output_section): New classs definition.
13451 (Output_section::relax_input_section): New method declaration.
13452 (Output_section::checkpoint_): New data member.
13453 (Output_segment): Update comments.
13454 (Output_segment::Output_segment): Un-privatize copy constructor.
13455 (Output_segment::operator=): Un-privatize.
13456 * script-sections.cc (Output_section_element::Input_section_list):
13457 Change element type to Output_section::Simple_input_section.
13458 (Output_section_element_dot_assignment::set_section_addresses):
13459 Register output section data for relaxation clean up.
13460 (Output_data_exression::Output_data_expression): Adjust call to base
13461 constructor to fix data size.
13462 (Output_section_element_data::set_section_addresses): Register
13463 Output_data_expression object for relaxation clean up.
13464 (struct Input_section_info): Replace Relobj pointer and section index
13465 pair with Output_section::Simple_input_section and Convert struct to a
13466 class.
13467 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13468 Input_section_info data member to use accessors.
20e6d0d6
DK
13469 (Output_section_element_input::set_section_addresses): Use layout
13470 parameter. Adjust code to use Output_section::Simple_input_section
13471 and Input_secction_info classes. Register filler for relaxation
13472 clean up.
13473 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13474 and section index pair with Output_section::Simple_input_section
13475 class. Adjust code accordingly.
13476 (Phdrs_element::release_segment): New method definition.
13477 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13478 segment list.
13479 (Script_sections::release_segments): New method definition.
13480 * gold/script-sections.h (Script_sections::release_segments): New
13481 method declaration.
13482 * gold/target.h (Target::may_relax, Target::relax,
13483 Target::do_may_relax, Target::do_relax): New method definitions.
13484
5e445df6
ILT
134852009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13486
13487 * arm.cc (has_signed_unsigned_overflow): New function.
13488 (Arm_relocate_functions::abs8): New function.
13489 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13490 (Target_arm::Scan::global): Likewise.
13491 (Target_arm::relocate::relocate): Likewise.
13492 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13493 Likewise.
13494
8c604651 134952009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13496
13497 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13498 * testsuite/Makefile.in: Regenerate.
13499
1e9cc1c2
NC
135002009-09-11 Nick Clifton <nickc@redhat.com>
13501
13502 * po/gold.pot: Updated by the Translation project.
13503
6a89f575
CC
135042009-09-08 Cary Coutant <ccoutant@google.com>
13505
13506 * output.cc (Output_file::open): Add execute permission to empty file.
13507 * testsuite/Makefile.am (permission_test): New test.
13508 * testsuite/Makefile.in: Regenerate.
13509
fdcac5af
ILT
135102009-09-02 Ian Lance Taylor <iant@google.com>
13511
13512 * output.cc (Output_file::resize): Call map_no_anonymous rather
13513 than map.
13514
44453f85
ILT
135152009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13516
13517 * gold.cc: Include "incremental.h".
13518 (queue_initial_tasks): Call Incremental_checker methods.
13519 * incremental.cc: Include "output.h".
13520 (Incremental_checker::can_incrementally_link_output_file): New
13521 method.
13522 * incremental.h (Incremental_checker): New class.
13523
13524 * output.cc (Output_file::open_for_modification): New method.
13525 (Output_file::map_anonymous): Changed return type to bool. Record
13526 map in base_ field.
13527 (Output_file::map_no_anonymous): New method, broken out of map.
13528 (Output_file::map): Use map_no_anonymous and map_anonymous.
13529 * output.h (class Output_file): Update declarations.
13530
293c1386
CC
135312009-08-24 Cary Coutant <ccoutant@google.com>
13532
13533 * options.h (Command_line::Pre_options): New class.
13534 (Command_line::pre_options): New member.
13535 * options.cc (gold::options::ready_to_register): New variable.
13536 (One_option::register_option): Do nothing if not registering options.
13537 Assert if same short option registered twice.
13538 (General_options::General_options): Turn off option registration when
13539 done constructing.
13540 (Command_line::Pre_options::Pre_options): New constructor.
13541
f773f3d2
CC
135422009-08-24 Cary Coutant <ccoutant@google.com>
13543
06a73cfe
CC
13544 * options.h (General_options::no_keep_memory): Remove incorrect
13545 short option.
f773f3d2 13546
a15af8e2
RW
135472009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13548
13549 * Makefile.am (am__skiplex, am__skipyacc): New.
13550 * Makefile.in: Regenerate.
13551
c462b41b
RW
135522009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13553
14ec8efd
RW
13554 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13555 (INCLUDES): ... this.
13556 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13557 (AM_CPPFLAGS): Renamed from ...
13558 (INCLUDE): ... this.
13559 * Makefile.in, testsuite/Makefile.in: Regenerate.
13560
81ecdfbb
RW
13561 * Makefile.in: Regenerate.
13562 * aclocal.m4: Likewise.
13563 * config.in: Likewise.
13564 * configure: Likewise.
13565 * testsuite/Makefile.in: Likewise.
13566
c462b41b
RW
13567 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13568 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13569 * Makefile.in: Regenerate.
13570 * testsuite/Makefile.in: Regenerate.
13571
2da73f13
CC
135722009-08-19 Cary Coutant <ccoutant@google.com>
13573
13574 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13575 symbols in shared libraries overridden by hidden or internal symbols
13576 in the main program.
13577
2db70501
CD
135782009-08-19 Chris Demetriou <cgd@google.com>
13579
13580 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13581 checking source file names in error messages.
13582
f733487b
DK
135832009-08-18 Doug Kwan <dougkwan@google.com>
13584
13585 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13586 an elcpp::Ehdr as parameter. Adjust call to set_target.
13587 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13588 an elfcpp::Ehdr as parameter.
13589 * object.cc (Object::set_target): Remove the version that looks up
13590 a target and sets it.
13591 (Sized_relobj::setup): Take a Target object instead of
13592 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13593 (make_elf_sized_object): Find target and ask target to
13594 make an ELF object.
13595 * object.h: (Object::set_target): Remove the version that looks up
13596 a target and sets it.
13597 (Sized_relobj::setup): Take a Target object instead of
13598 an elfcpp:Ehdr as parameter.
13599 * target.cc: Include dynobj.h.
13600 (Target::do_make_elf_object_implementation): New.
2e702c99 13601 (Target::do_make_elf_object): New.
f733487b
DK
13602 * target.h (Target::make_elf_object): New template declaration.
13603 (Target::do_make_elf_object): New method declarations.
13604 (Target::do_make_elf_object_implementation): New template declaration.
13605
cc70f101
ILT
136062009-08-14 Ian Lance Taylor <iant@google.com>
13607
13608 * gold.h (FUNCTION_NAME): Define.
13609 (gold_unreachable): Use FUNCTION_NAME.
13610
ef5e0cb1
ST
136112009-08-12 Sriraman Tallam <tmsriram@google.com>
13612
13613 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13614 symbol in the --keep-unique list is not found.
13615
48c187ce
ST
136162009-08-12 Sriraman Tallam <tmsriram@google.com>
13617
13618 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13619 been maked as --keep-unique.
13620 (Icf::unfold_section): New function.
13621 * icf.h (Icf::unfold_section): New function.
13622 * options.h (General_options::keep_unique): New option.
13623 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13624 * testsuite/Makefile.in: Regenerate.
13625 * testsuite/icf_keep_unique_test.sh: New file.
13626 * testsuite/icf_keep_unique_test.cc: New file.
13627
645afe0c
CC
136282009-08-12 Cary Coutant <ccoutant@google.com>
13629
13630 PR 10471
13631 * resolve.cc (Symbol_table::resolve): Check for references from
13632 dynamic objects to hidden and internal symbols.
13633 * testsuite/Makefile.am (hidden_test.sh): New test.
13634 * testsuite/Makefile.in: Regenerate.
13635 * testsuite/hidden_test.sh: New script.
13636 * testsuite/hidden_test_1.c: New test source.
13637 * testsuite/hidden_test_main.c: New test source.
13638
11af873f
DK
136392009-08-11 Doug Kwan <dougkwan@google.com>
13640
13641 * arm.cc: Update comments.
13642 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13643 segment to locate the .ARM.exidx section if present.
13644
b9f7d72d
DK
136452009-08-09 Doug Kwan <dougkwan@google.com>
13646
13647 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13648 patch.
13649
ddd3c53c
ST
136502009-08-07 Sriraman Tallam <tmsriram@google.com>
13651 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13652 compiler warnings.
13653
27721062
ST
136542009-08-06 Sriraman Tallam <tmsriram@google.com>
13655
13656 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13657 valid tls_segment only for non-debug-section relocations.
13658 * testsuite/Makefile.am: Add gc_tls_test.
13659 * testsuite/Makefile.in: Regenerate.
13660 * testsuite/gc_tls_test.cc: New file.
13661 * testsuite/gc_tls_test.sh: New file.
13662
ef15dade 136632009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13664
ef15dade
ST
13665 * icf.cc: New file.
13666 * icf.h: New file.
13667 * Makefile.am (CCFILES): Add icf.cc.
13668 (HFILES): Add icf.h
13669 * Makefile.in: Regenerate.
13670 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13671 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13672 section, symbol and addend information for the relocs.
13673 * gold.cc (queue_middle_tasks): Call identical code folding.
13674 * gold.h: Add defines for multimap.
13675 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13676 to the call of finalize_local_symbols.
13677 * main.cc (main): Create object of class Icf.
13678 * object.cc (Sized_relobj::do_layout): Allow this function to be
13679 called twice during icf.
13680 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13681 to sections marked as identical by icf.
13682 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13683 when available.
13684 (Sized_relobj::do_section_entsize): New function.
13685 * object.h (Object::section_entsize): New function.
13686 (Object::do_section_entsize): New pure virtual function.
13687 (Relobj::finalize_local_symbols): Add new parameter.
13688 (Relobj::do_section_entsize): New function.
13689 * options.h (General_options::icf): New option.
13690 (General_options::icf_iterations): New option.
13691 (General_options::print_icf_sections): New option.
13692 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13693 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13694 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13695 icf.
13696 * symtab.cc (Symbol_table::is_section_folded): New function.
13697 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13698 to sections marked as identical by icf.
13699 * symtab.h (Symbol_table::set_icf): New function.
13700 (Symbol_table::icf): New function.
13701 (Symbol_table::is_section_folded): New function.
13702 (Symbol_table::icf_): New data member.
13703 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13704 * testsuite/Makefile.am: Add commands to build icf_test.
13705 * testsuite/Makefile.in: Regenerate.
13706 * testsuite/icf_test.sh: New file.
13707 * testsuite/icf_test.cc: New file.
13708
c3b65ac4
CD
137092009-07-24 Chris Demetriou <cgd@google.com>
13710
13711 * layout.cc (is_compressible_debug_section): Fix incorrect
13712 comment about compressed section names.
13713
1caf2c51
ILT
137142009-07-20 Ian Lance Taylor <ian@airs.com>
13715
13716 PR 10419
13717 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13718
1ef4d87f
ILT
137192009-07-16 Ian Lance Taylor <iant@google.com>
13720
13721 PR 10400
13722 * layout.h: #include <map>.
13723 (class Kept_section): Change from struct to class. Add accessors
13724 and setters. Add section size to Comdat_group mapping. Change
13725 Comdat_group to std::map. Add is_comdat_ field. Add
13726 linkonce_size field in union.
13727 (class Layout): Update declaration of find_or_add_kept_section.
13728 Don't declare find_kept_object.
13729 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13730 parameter. Add object, shndx, is_comdat, and is_group_name
13731 parameters. Change all callers. Adjust for new Kept_section.
13732 (Layout::find_kept_object): Remove.
13733 * object.cc (Sized_relobj::include_section_group): Update use of
13734 Kept_section. Rename secnum to shndx. Only record
13735 Kept_comdat_section if sections are the same size.
13736 (Sized_relobj::include_linkonce_section): Update use of
13737 Kept_section. Only record Kept_comdat_section if sections are the
13738 same size. Set size of linkonce section.
13739 (Sized_relobj::map_to_kept_section): Update call to
13740 get_kept_comdat_section.
13741 * object.h (class Sized_relobj): Rename fields in
13742 Kept_comdat_section to drop trailing underscores; change object
13743 field to Relobj*. Change Kept_comdat_section_table to store
13744 struct rather than pointer.
13745 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13746 Add kept_object and kept_shndx parameters. Change all callers.
13747 (Sized_relobj::get_kept_comdat_section): Change return type to
13748 bool. Add kept_object and kept_shndx parameters. Change all
13749 callers.
13750 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13751 Layout::find_or_add_kept_section.
13752
37c3b7b0
ILT
137532009-07-09 Ian Lance Taylor <iant@google.com>
13754
13755 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13756 Reserve space in the hash table.
13757
98fa85cb
ILT
137582009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13759
13760 * fileread.cc (File_read::get_mtime): New method.
13761 * fileread.h (Timespec): New structure.
13762 (File_read::get_mtime): New method.
13763 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13764 Renamed from timestamp_nsec.
13765 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13766 Elf_Xword.
e1df38aa 13767 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13768 timestamp_nsec.
e1df38aa 13769 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13770 (Incremental_inputs::report_obejct): Save mtime; style fix.
13771 (Incremental_inputs::report_script): Save mtime; style fix.
13772 (Incremental_inputs::finalize_inputs): Style fix.
13773 (Incremental_inputs::finalize): Style fix.
13774 (Incremental_inputs::create_input_section_data): Store inputs
13775 mtime.
13776 * incremental.h (Incremental_inputs::report_script): Add mtime
13777 argument.
13778 (Incremental_inputs::Input_info::Input_info): Intialize only one
13779 union member.
13780 (Incremental_inputs::Input_info::archive): Move to nameless
13781 union.
13782 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13783 (Incremental_inputs::Input_info::script): Move to nameless union.
13784 (Incremental_inputs::mtime): New field.
13785 * script.cc (read_input_script): Pass file mtime to
13786 Incremental_input.
13787 * script.h (Script_info::inputs): Style fix.
13788
c9d70757
ILT
137892009-07-01 Ian Lance Taylor <ian@airs.com>
13790
13791 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13792 instead of 32.
13793
9c547ec3
ILT
137942009-06-24 Ian Lance Taylor <iant@google.com>
13795
13796 PR 10156
13797 * layout.cc (Layout::choose_output_section): If we find an
13798 existing section, update the flags.
13799 (Layout::create_notes): New function, broken out of
13800 Layout::finalize.
13801 (Layout::finalize): Don't create note sections.
13802 (Layout::create_note): Don't crash if linker script discards
13803 section.
13804 (Layout::create_gold_note): Likewise.
13805 (Layout::create_build_id): Likewise. Don't set
13806 after_input_sections on the section.
13807 (Layout::create_executable_stack_info): Remove target parameter.
13808 Change caller.
13809 * layout.h (class Layout): Declare create_notes. Update
13810 declaration of create_executable_stack_info.
13811 * gold.cc (queue_middle_tasks): Call create_notes.
13812 * output.cc (Output_section::update_flags_for_input_section): Move
13813 here from output.h. If SHF_ALLOC flag is newly set, mark address
13814 invalid.
13815 * output.h (Output_data::mark_address_invalid): New function.
13816 (class Output_section): Only declare, not define,
13817 update_flags_for_input_section. Remove set_flags.
13818
55458500
ILT
138192009-06-24 Ian Lance Taylor <iant@google.com>
13820
13821 * script-sections.cc (Output_section_definition::
13822 set_section_addresses): Rename shadowing local load_address to
13823 laddr.
13824
1307d6cd
ILT
138252009-06-24 Ian Lance Taylor <iant@google.com>
13826
13827 PR 10244
13828 * reloc.cc (relocate_sections): Skip empty relocation sections.
13829
ec3f783e
ILT
138302009-06-23 Ian Lance Taylor <iant@google.com>
13831
13832 PR 10156
13833 * layout.cc (Layout::create_note): Use choose_output_section
13834 rather than make_output_section.
13835
459c9f1c
ILT
138362009-06-23 Ian Lance Taylor <iant@google.com>
13837
13838 PR 10237
13839 * options.cc (General_options::parse_V): Set printed_version_.
13840 (General_options::General_options): Initialize printed_version_.
13841 * options.h (class General_options): Add printed_version_ field.
13842 * gold.cc (queue_initial_tasks): If there are no input files,
13843 don't give a fatal error if we printed the version information.
13844 (queue_middle_tasks): If using -r with a shared object, give a
13845 fatal error rather than an ordinary error.
13846
1518dc8f
ILT
138472009-06-23 Ian Lance Taylor <iant@google.com>
13848
13849 PR 10219
13850 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13851 (Layout::make_output_section): Set have_stabstr_section_ if we see
13852 a .stab*str section.
13853 (Layout::finalize): Call link_stabs_sections.
13854 (Layout::link_stabs_sections): New file.
13855 * layout.h (class Layout): Add have_stabstr_section_ field.
13856 Declare link_stabs_sections.
13857
3d857b98
DK
138582009-06-23 Doug Kwan <dougkwan@google.com>
13859
13860 * Makefile.am (libgold_a_LIBADD): New.
13861 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13862 * Makefile.in: Regenerate.
3d857b98
DK
13863 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13864 * configure: Regenerate.
13865 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13866 * fileread.cc: Include sys/state.h
13867 * gold.h: Declare memmem and strndup if found missing.
13868 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13869
0639a6f6
ILT
138702009-06-23 Ian Lance Taylor <iant@google.com>
13871
13872 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13873 * configure: Rebuild.
13874
8d63875c
ILT
138752009-06-23 Ian Lance Taylor <iant@google.com>
13876
13877 PR 10147
13878 * object.cc (Object::section_contents): Don't try to get a view if
13879 the section has length zero.
13880 (Object::handle_gnu_warning_section): If the section is empty, use
13881 the name of the section as the warning.
13882
f7c8a183
ILT
138832009-06-23 Ian Lance Taylor <iant@google.com>
13884
13885 PR 10133
13886 * stringpool.h (class Stringpool_template): Add optimize_ field.
13887 (Stringpool_template::set_optimize): New function.
13888 * stringpool.cc (Stringpool_template::Stringpool_template):
13889 Initialize optimize_ field.
13890 (Stringpool_template::set_string_offsets): Test local optimize
13891 fild rather than parameter.
13892 * layout.cc (Layout::Layout): Call set_optimize on the section
13893 name stringpool.
13894
e6a307ba
ILT
138952009-06-22 Ian Lance Taylor <iant@google.com>
13896
13897 PR 10030
13898 * yyscript.y: Parse TARGET.
13899 * script.cc (script_set_target): New function.
13900 * script-c.h (script_set_target): Declare.
13901 * options.cc (General_options::string_to_object_format): Rename
13902 from string_to_object_format in anonymous namespace. Change
13903 callers.
13904 * options.h (class General_options): Declare
13905 string_to_object_format.
13906
3ee173de
ILT
139072009-06-22 Ian Lance Taylor <iant@google.com>
13908
13909 * script-sections.cc (Script_sections::create_segments): Don't put
13910 program headers in a PT_LOAD segment if -n or -N.
13911
139122009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13913
13914 PR 10141
13915 * options.h (class General_options): Add -z lazy and -z now. Sort
13916 -z options into alphabetical order.
13917 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13918
cd6739a1 139192009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13920
13921 * layout.cc (Layout::make_output_section): Call
13922 Target::new_output_section.
13923 (Layout::attach_allocated_section_to_segment): Put large section
13924 sections in a separate load segment with the large segment flag
13925 set.
13926 (Layout::segment_precedes): Sort large data segments after other
13927 load segments.
13928 (align_file_offset): New static function.
13929 (Layout::set_segment_offsets): Use align_file_offset.
13930 * output.h (class Output_section): Add is_small_section_ and
13931 is_large_section_ fields.
13932 (Output_section::is_small_section): New function.
13933 (Output_section::set_is_small_section): New function.
13934 (Output_section::is_large_section): New function.
13935 (Output_section::set_is_large_section): New function.
13936 (Output_section::is_large_data_section): New function.
13937 (class Output_segment): Add is_large_data_segment_ field.
13938 (Output_segment::is_large_data_segment): New function.
13939 (Output_segment::set_is_large_data_segment): New function.
13940 * output.cc (Output_section::Output_section): Initialize new
13941 fields.
13942 (Output_segment::Output_segment): Likewise.
13943 (Output_segment::add_output_section): Add assertion that large
13944 data sections always go in large data segments. Force small data
13945 sections to the end of the list of data sections. Force small BSS
13946 sections to the start of the list of BSS sections. For large BSS
13947 sections to the end of the list of BSS sections.
13948 * symtab.h (class Symbol): Declare is_common_shndx.
13949 (Symbol::is_defined): Check Symbol::is_common_shndx.
13950 (Symbol::is_common): Likewise.
13951 (class Symbol_table): Define enum Commons_section_type. Update
13952 declarations. Add small_commons_ and large_commons_ fields.
13953 * symtab.cc (Symbol::is_common_shndx): New function.
13954 (Symbol_table::Symbol_table): Initialize new fields.
13955 (Symbol_table::add_from_object): Put small and large common
13956 symbols in the right list.
13957 (Symbol_table::sized_finalized_symbol): Check
13958 Symbol::is_common_shndx.
13959 (Symbol_table::sized_write_globals): Likewise.
13960 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13961 common symbol lists. Don't call do_allocate_commons_list if the
13962 list is empty.
13963 (Symbol_table::do_allocate_commons_list): Remove is_tls
13964 parameter. Add comons_section_type parameter. Change all
13965 callers. Handle small and large common symbols.
13966 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13967 Symbol::is_common_shndx.
13968 * resolve.cc (symbol_to_bits): Likewise.
13969 * target.h (Target::small_common_shndx): New function.
13970 (Target::small_common_section_flags): New function.
13971 (Target::large_common_shndx): New function.
13972 (Target::large_common_section_flags): New function.
13973 (Target::new_output_section): New function.
13974 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13975 small_common_section_flags, and large_common_section_flags
13976 fields.
13977 (Target::do_new_output_section): New virtual function.
13978 * arm.cc (Target_arm::arm_info): Initialize new fields.
13979 * i386.cc (Target_i386::i386_info): Likewise.
13980 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13981 Likewise.
13982 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13983 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13984 (Target_x86_64::do_new_output_section): New function.
13985 * configure.ac: Define conditional MCMODEL_MEDIUM.
13986 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13987 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13988 (large_LDFLAGS): Define.
13989 * testsuite/large.c: New file.
13990 * testsuite/testfile.cc (Target_test::test_target_info):
13991 Initialize new fields.
13992 * configure, testsuite/Makefile.in: Rebuild.
13993
bb04269c
DK
139942009-06-05 Doug Kwan <dougkwan@google.com>
13995
13996 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13997 * Makefile.in: Regenerate.
bb04269c
DK
13998 * i386.cc (class Target_i386): Define new virtual method to
13999 override do_is_local_label_name in parent.
14000 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14001 local symbols if --discard-locals or -X is given.
14002 * options.h (class General_options): Declare new options
14003 '--discard-locals' and '-X' for discarding locals.
14004 * target.h (class Target): Define new methods is_local_label_name.
14005 Declare new virtual method do_is_local_label_name.
14006 * target.cc: New file.
14007 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14008 (check_SCRIPTS): Add discard_locals_test.sh.
14009 (check_DATA): Add discard_local_tests.syms.
14010 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14011 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14012 * testsuite/Makefile.in: Regenerate.
14013 * testsuite/discard_locals_test.c: New file.
14014 * testsuite/discard_locals_test.sh: Same.
14015
805bb01c
DK
140162009-06-05 Doug Kwan <dougkwan@google.com>
14017
14018 * object.cc (Sized_relobj::Sized_relobj): Initialize
14019 discarded_eh_frame_shndx_ to -1U.
14020 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14021 section.
14022 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14023 a discarded .eh_frame section.
14024 (Sized_relobj::do_finalize_local_symbols): Ditto.
14025 * object.h (class Sized_relobj): Declare new member
14026 discarded_eh_frame_shndx_.
14027 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14028 (local_labels_test.o, local_labels_test): New rules.
14029 * testsuite/Makefile.in: Regenerate.
14030
1dcd334d
DK
140312009-06-04 Doug Kwan <dougkwan@google.com>
14032
14033 * layout.cc (Layout::section_name_mapping): Add mapping for
14034 special ARM sections.
14035
96d49306
DK
140362009-06-03 Doug Kwan <dougkwan@google.com>
14037
14038 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14039 (utils::has_overflow): Same.
14040
dff16297
ILT
140412009-06-03 Ian Lance Taylor <iant@google.com>
14042
14043 * layout.cc (Layout::section_name_mapping): New array, replacing
14044 Layout::linkonce_mapping.
14045 (Layout::section_name_mapping_count): New variable, replacing
14046 Layout::linkonce_mapping_count.
14047 (Layout::linkonce_output_name): Remove.
14048 (Layout::output_section_name): Rewrite.
14049 * layout.h (class Layout): Rename Linkonce_mapping to
14050 Section_name_mapping, linkonce_mapping to section_name_mapping,
14051 linkonce_mapping_count to section_name_mapping_count. Don't
14052 declare linkonce_output_name.
14053
c121c671
DK
140542009-06-03 Doug Kwan <dougkwan@google.com>
14055
14056 * gold/arm.cc (namespace utils): New.
14057 (Target_arm::reloc_is_non_pic): Define new method.
14058 (class Arm_relocate_functions): New.
14059 (Target_arm::Relocate::relocate): Handle relocation types used by
14060 Android.
14061
07800fab
ILT
140622009-06-03 Ian Lance Taylor <iant@google.com>
14063
14064 * arm.cc (Target_arm::scan::global): Use || instead of |.
14065
c121c671
DK
140662009-06-02 Doug Kwan <dougkwan@google.com>
14067
14068 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14069 issued_non_pic_error_.
14070 (class Target_arm::Scan): Declare new method check_non_pic.
14071 Define new method symbol_needs_plt_entry.
14072 Declare new data member issued_non_pic_error_.
14073 (class Target_arm::Relocate): Declare new method
14074 should_apply_static_reloc.
14075 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14076 (Target_arm::Scan::check_non_pic): Define new method.
14077 (Target_arm::Scan::local): Handle a small subset of reloc types used
14078 by Android.
14079 (Target_arm::Scan::local): Same.
14080 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14081
b19b0c6d
ILT
140822009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14083
14084 * incremental.cc (Incremental_inputs::report_command_line): Filter
14085 out --incremental-* options.
14086
94cdfcff
DK
140872009-05-29 Doug Kwan <dougkwan@google.com>
14088
14089 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14090 template class.
14091 (class Target_arm): Update comment.
14092 (Target_arm::Target_arm): Initialize new data members GOT_,
14093 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14094 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14095 and Target_arm::rel_dyn_section.
14096 Declare new_enum Target_arm::Got_type.
14097 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14098 and DYNBSS_.
14099 Update commments for member do_dynsym_value.
14100 (Target_arm::got_size, Target_arm::plt_section,
14101 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14102 new methods inside class defintion.
14103 (Target_arm::got_section): Define new method.
14104 (Target_arm::rel_dyn_section): Same.
14105 (Output_data_plt_arm): New template class.
14106 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14107 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14108 (Output_data_plt_arm::add_entry): Same.
14109 (Output_data_plt_arm::first_plt_entry): Define new
14110 static data member for PLT instruction template.
14111 (Output_data_plt_arm::plt_entry): Same.
14112 (Output_data_plt_arm::do_write): Define new method.
14113 (Target_arm::make_plt_entry): Same.
14114 (Target_arm::do_finalize_sections): Same.
14115 (Target_arm::do_dynsym_value): Same.
14116
4a657b0d
DK
141172009-05-28 Doug Kwan <dougkwan@google.com>
14118
14119 * Makefile.am (TARGETSOURCES): Add arm.cc.
14120 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14121 * Makefile.in: Regenerate.
14122 * arm.cc: New file.
14123 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14124
e7ae8c36
DK
141252009-05-26 Doug Kwan <dougkwan@google.com>
14126
14127 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14128 (General_options::check_excluded_libs): Strip off directories in
14129 archive name before matching like GNU ld does.
14130 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14131 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14132 (exclude_libs_test_LDFLAGS): Add linker option
14133 -Wl,--exclude-libs,libexclude_libs_test_3
14134 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14135 an explicit archive without using -l.
14136 (alt/libexclude_libs_test_3.a): New make rule.
14137 * testsuite/Makefile.in: Regenerate.
14138 * testsuite/exclude_libs_test.c : Declare lib3_default().
14139 (main): Call it.
14140 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14141 * exclude_libs_test_3.c: New file.
14142
f12e7348
NC
141432009-05-26 Nick Clifton <nickc@redhat.com>
14144
14145 * po/id.po: New Indonesian translation.
14146 * po/gold.pot: Updated template file.
14147
4daadc0d
ST
141482009-05-22 Sriraman Tallam <tmsriram@google.com>
14149
e1df38aa 14150 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14151 gc_comdat_test files. Add -Wl,--gc-sections to build
14152 gc_comdat_test.
14153 * testsuite/Makefile.in: Regenerate.
14154 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14155
531813ad
ST
141562009-05-21 Sriraman Tallam <tmsriram@google.com>
14157
14158 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14159 kept comdat section was garbage collected.
14160 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14161 * testsuite/Makefile.in: Regenerate.
14162 * testsuite/gc_comdat_test.sh: New file.
14163 * testsuite/gc_comdat_test_1.cc: New file.
14164 * testsuite/gc_comdat_test_2.cc: New file.
14165
65514900
CC
141662009-05-19 Doug Kwan <dougkwan@google.com>
14167
14168 * archive.cc (Archive::Archive): Move constructor from archive.h
14169 to here. Initialize no_export_.
14170 (Archive::get_elf_object_for_member): Set no_export flag of object.
14171 * archive.h (Archive::Archive): Move constructor body to
14172 archive.cc.
14173 (Archive::no_export): New method.
14174 (Archive::no_export_): New field.
14175 * object.h (Object::Object): Initialize no_export_ to false.
14176 (Object::no_export, Object::set_no_export): New methods.
14177 (Object::no_export_): New field.
14178 * options.cc (General_options::parse_exclude_libs): New method.
14179 (General_options::check_excluded_libs) Same.
14180 * options.h (exclude_libs): New option.
14181 (General_options::check_excluded_libs): New method declaration.
14182 (General_options::excluded_libs_): New field.
14183 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14184 default or protected visibility if an object has no-export flag set.
14185 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14186 (check_SCRIPTS): Add exclude_libs_test.sh.
14187 (check_DATA): Add exclude_libs_test.syms.
14188 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14189 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14190 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14191 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14192 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14193 libexclude_libs_test_2.a): New rules.
14194 * testsuite/Makefile.in: Regenerate.
14195 * testsuite/exclude_libs_test.c: New file.
14196 * testsuite/exclude_libs_test.sh: Ditto.
14197 * testsuite/exclude_libs_test_1.c: Ditto.
14198 * testsuite/exclude_libs_test_2.c: Ditto.
14199
1b77ea50
ILT
142002009-05-15 Ian Lance Taylor <iant@google.com>
14201
14202 * configure.ac: Check for declarations for cases where libiberty.h
14203 checks HAVE_DECL_xxx.
14204 * configure, config.in: Rebuild.
14205
072fe7ce
ILT
142062009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14207
14208 * gold.h (Incremental_argument_list): Remove (invalid) forward
14209 declaration.
14210 * incremental.cc (Incremental_inputs::report_achive): New method.
14211 (Incremental_inputs::report_object): New method.
14212 (Incremental_inputs::report_script): New method.
14213 (Incremental_inputs::finalize_inputs): New method.
14214 (Incremental_inputs::finalize): Call finalize_inputs().
14215 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14216 Create inputs entries.
14217 * incremental.h (Incremental_input_type): New enum.
14218 (Incremental_inputs::Incremental_input): Initialize new fields.
14219 (Incremental_inputs::report_inputs): New method.
14220 (Incremental_inputs::report_achive): New method.
14221 (Incremental_inputs::report_object): New method.
14222 (Incremental_inputs::report_script): New method.
14223 (Incremental_inputs::finalize_inputs): New method.
14224 (Incremental_inputs::Input_info): New struct.
14225 (Incremental_inputs::Input_info_map): New typedef.
14226 (Incremental_inputs::lock_): New field.
14227 (Incremental_inputs::Inputs_): New field.
14228 (Incremental_inputs::Inputs_map): New field.
14229 * main.cc (main): Call Incremental_input::report_inputs.
14230 * options.h (Input_argument_list): Typedef moved from
14231 Input_arguments.
14232 (Input_file_group::Files): Remove, use ::Input_argument_list.
14233 (Input_file_group::Input_argument_list): Remove, use
14234 ::Input_argument_list.
14235 * plugin.cc (Plugin_manager::add_input_file): Add error in
14236 incremental build.
14237 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14238 functions.
14239 * script.cc (read_input_script): Call
14240 Incremental_input::report_script.
14241 * script.h (Script_info): New class.
14242
b0481b0b
ILT
142432009-04-27 Ian Lance Taylor <iant@google.com>
14244
14245 * x86_64.cc (do_adjust_output_section): Set entsize to
14246 plt_entry_size.
14247
b22a5a41 142482009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14249
14250 * output.cc (Output_file::close): After short writes, continue
14251 writing from the correct offset in the buffer being written.
14252
40fde488
CD
142532009-04-23 Chris Demetriou <cgd@google.com>
14254
14255 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14256 * configure: Regenerate.
14257 * config.in: Regenerate.
14258 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14259 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14260
3ce2c28e
ILT
142612009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14262
14263 * incremental.cc (Incremental_inputs_header_data): Renamed from
14264 Incremental_input_header_data.
14265 (Incremental_inputs_header_data::data_size): New field.
14266 (Incremental_inputs_header_data::put_input_file_count): Renamed
14267 from input_file_count.
14268 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14269 from command_line_offset.
14270 (Incremental_inputs_header_data::put_reserved): Renamed from
14271 put_reserved.
14272 (Incremental_inputs_entry_data): Renamed from
14273 Incremental_input_entry_data.
14274 (Incremental_inputs_entry_data::data_size): New field.
14275 (Incremental_inputs::report_command_line): New method.
14276 (Incremental_inputs::finalize): New method.
14277 (Incremental_inputs::create_incremental_inputs_data): New method.
14278 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14279 * incremental.h: New file.
14280 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14281 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14282 incremental builds.
703d02da 14283 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14284 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14285 (Layout::create_incremental_info_sections): New method.
14286 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14287 * main.cc (main): Notify Incremental_input of the command line.
14288
e55bde5e
ILT
142892009-04-01 Ian Lance Taylor <iant@google.com>
14290 Mikolaj Zalewski <mikolajz@google.com>
14291
14292 * gold.h (reserve_unordered_map): Define, three versions, one for
14293 each version of Unordered_map.
14294 * layout.cc (Layout::Layout): Remove options parameter. Add
14295 number_of_input_files parameter. Don't initialize options_.
14296 Initialize number_of_input_files_ and resized_signatures_. Move
14297 sections_are_attached_.
14298 (Layout::layout_group): Reserve space for group_signatures_.
14299 (Layout::find_or_add_kept_section): Change name parameter to be a
14300 reference. Resize signatures_ map when it gets large enough.
14301 (Layout::layout_eh_frame): Use parameters->options() instead of
14302 this->options_.
14303 (Layout::make_output_section): Likewise.
14304 (Layout::attach_allocated_section_to_segment): Likewise.
14305 (Layout::finalize, Layout::create_executable_stack): Likewise.
14306 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14307 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14308 * layout.h (class Layout): Update declarations. Remove options_
14309 field. Add number_of_input_files_ and resized_signatures_
14310 fields. Move sections_are_attached_ field.
14311 * main.cc (main): Pass number of input files to Layout
14312 constructor. Don't pass options.
14313
154b857c
ILT
143142009-03-30 Ian Lance Taylor <iant@google.com>
14315
14316 * ffsll.c (ffsll): Correct implementation.
14317
2f35ab9b
ILT
143182009-03-27 Ian Lance Taylor <iant@google.com>
14319
fd03461a
ILT
14320 * ffsll.c: New file.
14321 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14322 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14323 * ftruncate.c (ftruncate): Declare before definition.
14324 * mremap.c (mremap): Likewise.
14325 * pread.c (pread): Likewise.
14326 * configure, Makefile.in, config.in: Rebuild.
14327
2f35ab9b
ILT
14328 * mremap.c: New file.
14329 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14330 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14331 (mremap): Declare if HAVE_MREMAP is not defined.
14332 * configure, Makefile.in, config.in: Rebuild.
14333
33aea2fd
CC
143342009-03-27 Cary Coutant <ccoutant@google.com>
14335
14336 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14337 position independent.
14338 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14339 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14340
6d479619
CC
143412009-03-24 Cary Coutant <ccoutant@google.com>
14342
14343 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14344 an executable.
14345 (needs_dynamic_reloc): Likewise.
14346
afc06bb8
ILT
143472009-03-24 Ian Lance Taylor <iant@google.com>
14348
14349 * yyscript.y (file_cmd): Recognize EXTERN.
14350 (extern_name_list, extern_name_list_body): New nonterminals.
14351 * script.cc (script_add_extern): Define.
14352 * script-c.h (script_add_extern): Declare.
14353
f6060a4d
ILT
143542009-03-24 Rafael Avila de Espindola <espindola@google.com>
14355
14356 * object.cc (is_elf_object): Define.
14357 * object.h (is_elf_object): Declare.
14358 * archive.cc (Archive::get_elf_object_for_member): Call
14359 is_elf_object.
33aea2fd 14360 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14361
26736d8e
ILT
143622009-03-24 Elliott Hughes <enh@google.com>
14363
14364 * output.cc (Output_file::map_anonymous): Define.
14365 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14366 try an anonymous one. Report the size if the mmap fails.
14367 * output.h (class Output_file): Declare map_anonymous.
14368
22fd9730
ILT
143692009-03-24 Ian Lance Taylor <iant@google.com>
14370
14371 * target-select.cc (instantiate_target): Don't acquire the lock if
14372 the instantiated_target_ field has already been set.
14373
cb010894
ILT
143742009-03-23 Ian Lance Taylor <iant@google.com>
14375
7f055c20
ILT
14376 * gold-threads.h (class Initialize_lock): Define.
14377 * gold-threads.cc (class Initialize_lock_once): Define.
14378 (initialize_lock_control): New static variable.
14379 (initialize_lock_pointer): New static variable.
14380 (initialize_lock_once): New static function.
14381 (Initialize_lock::Initialize_lock): Define.
14382 (Initialize_lock::initialize): Define.
14383 * target-select.h: Include "gold-threads.h".
14384 (class Target_selector): Add lock_ and initialize_lock_ fields.
14385 Don't define instantiate_target, just declare it.
14386 * target-select.cc (Target_selector::Target_selector): Initialize
14387 new fields.
14388 (Target_selector::instantiate_target): Define.
14389 * descriptors.h: Include "gold-threads.h".
14390 (class Descriptors): Add initialize_lock_ field.
14391 * descriptors.cc (Descriptors::Descriptors): Initialize new
14392 field.
14393 (Descriptors::open): Use initialize_lock_ field
14394 * errors.h (class Errors): Add initialize_lock_ field.
14395 * errors.cc (Errors::Errors): Initialize new field.
14396 (Errors::initialize_lock): Use initialize_lock_ field.
14397 * powerpc.cc (class Target_selector_powerpc): Remove
14398 instantiated_target_ field. In do_recognize call
14399 instantiate_target rather than do_instantiate_target. In
14400 do_instantiate_target just allocate a new target.
14401 * sparc.cc (class Target_selector_sparc): Likewise.
14402
36959681
ILT
14403 * freebsd.h: New file.
14404 * i386.cc: Include "freebsd.h".
14405 (Target_i386): Derive from Target_freebsd rather than
14406 Sized_target.
14407 (Target_selector_i386): Derive from Target_selector_freebsd rather
14408 than Target_selector.
14409 * x86_64.cc: Include "freebsd.h".
14410 (Target_x86_64): Derive from Target_freebsd rather than
14411 Sized_target.
14412 (Target_selector_x86_64): Derive from Target_selector_freebsd
14413 rather than Target_selector.
14414 * target.h (class Target): Add adjust_elf_header and
14415 do_adjust_elf_header.
14416 * output.cc (Output_file_header:: do_sized_write): Call target
14417 adjust_elf_header routine.
14418 * configure.tgt: Set targ_osabi.
14419 * configure.ac: Define GOLD_DEFAULT_OSABI.
14420 * parameters.cc (Parameters::default_target): Pass
14421 GOLD_DEFAULT_OSABI to select_target.
14422 * target-select.h (class Target_selector): Make instantiate_target
14423 protected rather than private.
14424 * Makefile.am (HFILES): Add freebsd.h.
14425 * configure, Makefile.in, config.in: Rebuild.
14426
cb010894
ILT
14427 * merge.cc (do_add_input_section): Correct pend value. Change
14428 message about last entry not being null terminated from error to
14429 warning.
14430
0e879927
ILT
144312009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14432
14433 * incremental.cc: New file.
14434 * Makefile.am (CCFILES): Add incremental.cc.
14435 * Makefile.in: Rebuild.
14436
41105937
PP
144372009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14438
14439 * layout.cc (Layout::output_section_name): Preserve names
14440 of '.note.' sections.
e1df38aa 14441
60439920
ILT
144422009-03-19 Ian Lance Taylor <iant@google.com>
14443
14444 * descriptors.cc (Descriptors::open): Check that the options are
14445 valid before using them.
14446
0d371ad3
ILT
144472009-03-18 Ian Lance Taylor <iant@google.com>
14448
14449 * script-sections.h: Include <list>.
14450 (class Script_sections): Change Sections_elements from std::vector
14451 to std::list. Typedef public Elements_iterator. Add
14452 orphan_section_placement_, data_segment_align_start_, and
14453 saw_data_segment_align_ fields. Remove data_segment_align_index_
14454 field.
14455 * script-sections.cc (class Orphan_section_placement): New class.
14456 (class Sections_element): Add virtual functions is_relro and
14457 orphan_section_init. Remove virtual function place_orphan_here.
14458 (class Output_section_definition): Add is_relro and
14459 orphan_section_init. Remove place_orphan_here.
14460 (class Orphan_output_section): Likewise.
14461 (Script_sections::Script_sections): Update for field changes.
14462 (Script_sections::data_segment_align): Set saw_data_segment_align_
14463 and data_segment_align_start_, not data_segment_align_index.
14464 (Script_sections::data_segment_relro_end): Check
14465 saw_data_segment_align_. Use data_segment_align_start_ rather
14466 than data_segment_align_index_.
14467 (Script_sections::place_orphan): Rewrite to use
14468 Orphan_section_placement.
14469
9201d894
ILT
144702009-03-17 Ian Lance Taylor <iant@google.com>
14471
9c5b8369
ILT
14472 * archive.cc (Archive::add_symbols): Check for a version attached
14473 to the symbol name in the archive map.
14474 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14475 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14476 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14477 (ver_test_11.a): New target.
14478 * testsuite/Makefile.in: Rebuild.
14479
9201d894
ILT
14480 * configure.ac: Check for chsize and posix_fallocate. Replace
14481 ftruncate.
14482 * ftruncate.c: New file, from gnulib.
14483 * output.cc (posix_fallocate): Define dummy version if not
14484 HAVE_POSIX_FALLOCATE.
14485 (Output_file::map): Call posix_fallocate rather than lseek and
14486 write.
14487 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14488 * configure, Makefile.in, config.in: Rebuild.
14489
ef4ab7a8 144902009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14491
ef4ab7a8
PP
14492 * layout.h (Layout::create_note): Add section_name parameter.
14493 * layout.cc (Layout::create_note): Likewise.
14494 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14495
8c500701
ILT
144962009-03-17 Ian Lance Taylor <iant@google.com>
14497
e85b18e1
ILT
14498 * descriptors.cc: Include "options.h".
14499 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14500 (Descriptors::open): Always use O_CLOEXEC when opening a new
14501 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14502 then set FD_CLOEXEC.
14503
9efe6174
ILT
14504 * sparc.cc (class Target_sparc): Add has_got_section.
14505 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14506 make sure we have a GOT section.
14507
14508 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14509 (Target_sparc::Scan::local): Likewise.
14510 (Target_sparc::Scan::global): Likewise.
14511 (Target_sparc::Relocate::relocate): Likewise.
14512 (Target_sparc::Relocate::relocate_tls): Likewise.
14513
8c500701
ILT
14514 * symtab.cc (Symbol_table::define_default_version): New function,
14515 broken out of add_from_object.
14516 (Symbol_table::add_from_object): Call define_default_version.
14517 (Symbol_table::define_special_symbol): Add resolve_oldsym
14518 parameter. Change all callers. If the version for a symbol comes
14519 from a version script, resolve it with the symbol with the same
14520 name with no version. Also add the symbol without a version if
14521 appropriate.
14522 (do_define_in_output_data): If resolving with oldsym, don't delete
14523 sym.
14524 (do_define_in_output_segment): Likewise.
14525 (do_define_as_constant): Likewise.
14526 * symtab.h (class Symbol_table): Update declarations.
14527
f1ed28fb
ILT
145282009-03-13 Ian Lance Taylor <iant@google.com>
14529
15f8229b
ILT
14530 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14531 (Read_symbols::requeue): New function.
14532 (Read_symbols::do_read_symbols): If make_elf_object fails because
14533 the target type is not configured, and the file was searched for,
14534 issue a warning and retry with the next directory.
14535 (Add_symbols::run): If the file has an incompatible format, and
14536 it was searched for, requeue the Read_symbols task. On error,
14537 release the object.
14538 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14539 dirindex parameter to constructor. Change all callers. Declare
14540 incompatible_warning and requeue.
14541 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14542 input_argument_ and input_group_ fields. Add them to
14543 constructor. Change all callers.
14544 (class Read_script): Add dirindex_ field. Add it to constructor.
14545 Change all callers.
14546 * archive.cc (Archive::setup): Remove input_objects parameter.
14547 Change all callers.
14548 (Archive::get_file_and_offset): Likewise.
14549 (Archive::read_all_symbols): Likewise.
14550 (Archive::read_symbols): Likewise.
14551 (Archive::get_elf_object_for_member): Remove input_objects
14552 parameter. Add punconfigured parameter. Change all callers.
14553 (Archive::add_symbols): Change return type to bool. Check return
14554 value of include_member.
14555 (Archive::include_all_members): Likewise.
14556 (Archive::include_member): Change return type to bool. Return
14557 false if first included object has incompatible target. Set
14558 included_member_ field.
14559 (Add_archive_symbols::run): If add_symbols returns false, requeue
14560 Read_symbols task.
14561 * archive.h (class Archive): Add included_member_ field.
14562 Initialize it in constructor. Add input_file and searched_for
14563 methods. Update declarations.
14564 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14565 input_argument_ fields. Add them to constructor. Change all
14566 callers.
14567 * script.cc: Include "target-select.h".
14568 (class Parser_closure): Add skip_on_incompatible_target_ and
14569 found_incompatible_target_ fields. Add
14570 skip_on_incompatible_target parameter to constructor. Change all
14571 callers. Add methods skip_on_incompatible_target,
14572 clear_skip_on_incompatible_target, found_incompatible_target, and
14573 set_found_incompatible_target.
14574 (read_input_script): Add dirindex parameter. Change all callers.
14575 If parser finds an incompatible target, requeue Read_symbols
14576 task.
14577 (script_set_symbol): Clear skip_on_incompatible_target in
14578 closure.
14579 (script_add_assertion, script_parse_option): Likewise.
14580 (script_start_sections, script_add_phdr): Likewise.
14581 (script_check_output_format): New function.
14582 * script.h (read_input_script): Update declaration.
14583 * script-c.h (script_check_output_format): Declare.
14584 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14585 (ignore_cmd): Remove OUTPUT_FORMAT.
14586 * fileread.cc (Input_file::Input_file): Add explicit this.
14587 (Input_file::will_search_for): New function.
14588 (Input_file::open): Add pindex parameter. Change all callers.
14589 * fileread.h (class Input_file): Add input_file_argument method.
14590 Declare will_search_for. Update declarations.
14591 * object.cc (make_elf_object): Add punconfigured parameter.
14592 Change all callers.
14593 * object.h (class Object): Make input_file public. Add
14594 searched_for method.
14595 (make_elf_object): Update declaration.
14596 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14597 restart search.
14598 * dirsearch.h (class Dirsearch): Update declaration.
14599 * options.h (class General_options): Add --warn-search-mismatch.
14600 * parameters.cc (Parameters::is_compatible_target): New function.
14601 * parameters.h (class Parameters): Declare is_compatible_target.
14602 * workqueue.cc (Workqueue::add_blocker): New function.
14603 * workqueue.h (class Workqueue): Declare add_blocker.
14604
f1ed28fb
ILT
14605 * fileread.cc (Input_file::open): Remove options parameter.
14606 Change all callers.
14607 (Input_file::open_binary): Likewise.
14608 * script.cc (read_input_script): Likewise.
14609 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14610 options parameter from constructor. Change all callers.
14611 (class Read_script): Likewise.
14612 * fileread.h (class Input_file): Update declarations.
14613 * script.h (read_input_script): Update declaration.
14614
34dd024a
NC
146152009-03-10 Nick Clifton <nickc@redhat.com>
14616
14617 * po/es.po: New Spanish translation.
14618
6d71b17c
CC
146192009-03-06 Cary Coutant <ccoutant@google.com>
14620
14621 * options.cc (parse_short_option): Keep dash_z from registering itself.
14622
031cdbed
ILT
146232009-03-03 Ian Lance Taylor <iant@google.com>
14624
14625 PR 9918
14626 * target-reloc.h (relocate_section): Pass output_section to
14627 relocate.
14628 * i386.cc (Target_i386::should_apply_static_reloc): Add
14629 output_section parameter. Change all callers.
14630 (Target_i386::Relocate::relocate): Add output_section parameter.
14631 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14632 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14633 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14634 * testsuite/two_file_shared.sh: New script.
14635 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14636 (check_DATA): Add two_file_shared.dbg.
14637 (two_file_shared.dbg): New target.
14638 * testsuite/Makefile.in: Rebuild.
14639
15d5fa16
ILT
146402009-03-01 Ian Lance Taylor <iant@google.com>
14641
14642 * configure.ac: Check for byteswap.h.
14643 * configure: Rebuild.
14644 * config.in: Rebuild.
14645
8a4c0b0d
ILT
146462009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14647
14648 * layout.cc (Layout::find_or_add_kept_section): New function.
14649 (Layout::add_comdat): Removed.
14650 * layout.h (struct Kept_section): Move out of class Layout.
14651 Remove trailing underscores from field names. Add group_sections
14652 field. Rename group_ field to is_group. Change all uses.
14653 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14654 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14655 comdat_groups_ field.
14656 (Sized_relobj::include_section_group): Use
14657 find_or_add_kept_section and Kept_section::group_sections.
14658 (Sized_relobj::include_linkonce_section): Likewise.
14659 * object.cc (class Sized_relobj): Don't define Comdat_group or
14660 Comdat_group_table. Remove find_comdat_group and
14661 add_comdat_group. Remove comdat_groups_ field.
14662 * plugin.cc (include_comdat_group): Use
14663 Layout::find_or_add_kept_section.
14664
b4ecf66b
ILT
146652009-02-28 Ian Lance Taylor <iant@google.com>
14666
14359ca0
ILT
14667 * README: --gc-sections and map files are now supported. Document
14668 some build requirements.
14669
b4ecf66b
ILT
14670 PR 6992
14671 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14672 relocatable link set the value of the section symbol to zero.
14673 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14674 relocatable link don't include the section address in the local
14675 symbol value.
14676
0602e05a
ILT
146772009-02-27 Ian Lance Taylor <iant@google.com>
14678
fd9d194f
ILT
14679 PR 6811
14680 * options.h (class Search_directory): Add is_system_directory.
14681 (class General_options): Declare is_in_system_directory.
14682 * options.cc (get_relative_sysroot): Make static.
14683 (get_default_sysroot): Make static.
14684 (General_optoins::is_in_system_directory): New function.
14685 * fileread.cc (Input_file::is_in_system_directory): New function.
14686 * fileread.h (class Input_file): Declare is_in_system_directory.
14687 * object.h (class Object): Add is_in_system_directory.
14688 (class Input_objects): Remove system_library_directory_ field.
14689 * object.cc (Input_objects::add_object): Don't set
14690 system_library_directory_.
14691 (input_objects::found_in_system_library_directory): Remove.
14692 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14693 parameter. Change all callers.
14694 (Symbol_table::sized_write_globals): Likewise.
14695 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14696 Call Object::is_in_system_directory.
14697 * symtab.h (class Symbol_table): Update declarations.
14698
61edd21f
ILT
14699 PR 5990
14700 * descriptors.h (Open_descriptor): Add is_on_stack field.
14701 * descriptors.cc (Descriptors::open): If the descriptor is on the
14702 top of the stack, remove it. Initialize is_on_stack field.
14703 (Descriptors::release): Only add pod to stack if it is not on the
14704 stack already.
14705 (Descriptors::close_some_descriptor): Clear stack_next and
14706 is_on_stack fields.
14707
e29e076a
ILT
14708 PR 7091
14709 * output.cc (Output_section::find_starting_output_address): Rename
14710 from starting_output_address; add PADDR parameter; change return
14711 type.
14712 * output.h (class Output_section): Declare
14713 find_starting_output_address instead of starting_output_address.
14714 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14715 section symbol for which we can't find a merge section.
14716
0602e05a
ILT
14717 PR 9836
14718 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14719 hidden or internal, force the symbol to be local.
14720 * resolve.cc (Symbol::override_visibility): Define.
14721 (Symbol::override_base): Use override_visibility.
14722 (Symbol_table::resolve): Likewise.
14723 (Symbol::override_base_with_special): Likewise.
14724 (Symbol_table::override_with_special): If the visibility is hidden
14725 or internal, force the symbol to be local.
14726 * symtab.h (class Symbol): Add set_visibility and
14727 override_visibility.
14728 * testsuite/ver_test_1.sh: New file.
14729 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14730 (check_DATA): Add ver_test_1.syms.
14731 (ver_test_1.syms): New target.
14732 * testsuite/Makefile.in: Rebuild.
14733
401a9a73
CC
147342009-02-25 Cary Coutant <ccoutant@google.com>
14735
14736 * layout.cc (Layout::choose_output_section): Don't rename sections
14737 when using a linker script that has a SECTIONS clause.
14738 * Makefile.in: Regenerate.
14739
14740 * testsuite/Makefile.am (script_test_5.sh): New test case.
14741 * testsuite/Makefile.in: Regenerate.
14742 * testsuite/script_test_5.cc: New file.
14743 * testsuite/script_test_5.sh: New file.
14744 * testsuite/script_test_5.t: New file.
14745
f488e4b0
CC
147462009-02-13 Rafael Avila de Espindola <espindola@google.com>
14747
14748 * archive.cc (Archive::include_member): Update calls to add_symbols.
14749 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14750 the Layout argument.
14751 * dynobj.h (do_add_symbols): Add the Layout argument.
14752 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14753 Layout argument.
14754 * object.h (Object::add_symbols): Add the Layout argument.
14755 (Object::do_add_symbols): Add the Layout argument.
14756 (Sized_relobj::do_add_symbols): Add the Layout argument.
14757 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14758 Unify the two versions.
14759 (Add_plugin_symbols): Remove.
14760 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14761 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14762 (Add_plugin_symbols): Remove.
14763 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14764 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14765 (Add_symbols::run): Make it work with Pulginobj.
14766
89dd1680
ILT
147672009-02-06 Ian Lance Taylor <iant@google.com>
14768
14769 * object.cc (Sized_relobj::do_layout): Make info message start
14770 with lower case letter.
14771
266d0a74
ILT
147722009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14773
602b464e
ILT
14774 * binary.cc: Fix file comment.
14775
266d0a74
ILT
14776 * options.h (enum Incremental_disposition): Define.
14777 (class General_options): Add new options: --incremental,
14778 --incremental_changed, --incremental_unchanged,
14779 --incremental_unknown. Add incremental_disposition_ and
14780 implicit_incremental_ fields.
14781 (General_options::incremental_disposition): New function.
14782 (class Position_dependent_options): Add incremental_disposition
14783 option.
14784 (Position_dependent_options::copy_from_options): Set incremental
14785 dispositions.
14786 * options.cc (General_options::parse_incremental_changed): New
14787 function.
2e702c99
RM
14788 (General_options::parse_incremental_unchanged): New function.
14789 (General_options::parse_incremental_unknown): New function.
14790 (General_options::General_options): Initialize new fields
266d0a74 14791 incremental_disposition_ and implicit_incremental_.
2e702c99 14792 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14793 without --incremental.
14794
f073bbf7
CD
147952009-02-06 Chris Demetriou <cgd@google.com>
14796
14797 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14798 pointer and to report location as the file name associated with
14799 the symbol.
14800 (gold_undefined_symbol_at_location): New function to replace the
14801 old gold_undefined_symbol functionality.
14802 * target-reloc.h (relocate_section): Update to use
14803 gold_undefined_symbol_at_location.
14804 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14805 Call gold_undefined_symbol function rather than gold_error.
14806 * errors.h (Errors::undefined_symbol): Take location as a
14807 string, rather than calculating it from a relocation.
14808 * errors.cc (Errors::fatal): Print "fatal error:" before the
14809 formatted message.
14810 (Errors::error, Errors::error_at_location): Print "error: "
14811 before the formatted message.
14812 (Errors::undefined_symbol): Take location as a string, rather
14813 than calculating it from a relocation.
14814 (gold_undefined_symbol_at_location): New function akin to
14815 old gold_undefined_symbol, calculates location from relocation.
14816 (gold_undefined_symbol): Change to take only a Symbol pointer
14817 and to report location as the file name associated with the symbol.
14818 * testsuite/debug_msg.sh: Update for changed error messages.
14819 * testsuite/undef_symbol.sh: Likewise.
14820
8e94a90c
ILT
148212009-02-04 Duncan Sands <baldrick@free.fr>
14822
14823 PR 9812
14824 * reduced_debug_output.h
14825 (Output_reduced_debug_abbrev_section::failed): Use format for
14826 gold_warning.
14827 (Output_reduced_debug_info_section::faild): Likewise.
14828
88a0e15b
ILT
148292009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14830
14831 * script.cc (Lazy_demangler): New class.
2e702c99 14832 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14833 symbol only once.
14834
5efc7cd2
CC
148352009-01-29 Cary Coutant <ccoutant@google.com>
14836
14837 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14838 to __tls_get_addr.
14839 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14840
e0ebcf42
ILT
148412009-01-28 Ian Lance Taylor <iant@google.com>
14842
5efc7cd2 14843 * version.cc (version_string): Bump to 1.9.
75fe7426 14844
e0ebcf42
ILT
14845 * gold.h: Include <cstring> and <stdint.h>.
14846 * version.cc: Include <cstdio>.
14847 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14848 warning.
14849 * reduced_debug_output.cc (insert_into_vector): Rename from
14850 Insert_into_vector; change all callers. Use Swap_unaligned to
14851 avoid aliasing issue; remove union since it is unnecessary.
14852
8e2813be 148532009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14854
14855 * Makefile.am (CCFILES): Add gc.cc.
14856 (HFILES): Add gc.h.
14857 * Makefile.in: Regenerate.
14858 * gold.cc (Gc_runner): New class.
14859 (queue_initial_tasks): Call garbage collection related tasks
14860 when corresponding options are invoked.
14861 (queue_middle_gc_tasks): New function.
14862 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14863 processed early before laying out sections during garbage collection.
14864 * gold.h (queue_middle_gc_tasks): New function.
14865 (is_prefix_of): Move from "layout.cc".
14866 * i386.cc (Target_i386::gc_process_relocs): New function.
14867 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14868 * main.cc (main): Create object of class "Garbage_collection".
14869 * object.cc (Relobj::copy_symbols_data): New function.
14870 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14871 (Sized_relobj::do_layout): Allow this function to be called twice
14872 during garbage collection and defer layout of section during the
6d03d481
ST
14873 first call.
14874 * object.h (Relobj::get_symbols_data): New function.
14875 (Relobj::is_section_name_included): New function.
14876 (Relobj::copy_symbols_data): New function.
14877 (Relobj::set_symbols_data): New function.
14878 (Relobj::get_relocs_data): New function.
14879 (Relobj::set_relocs_data): New function.
14880 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14881 (Relobj::gc_process_relocs): New function.
14882 (Relobj::do_gc_process_relocs): New pure virtual function.
14883 (Relobj::sd_): New data member.
14884 (Sized_relobj::is_output_section_offset_invalid): New function.
14885 (Sized_relobj::do_gc_process_relocs): New function.
14886 * options.h (General_options::gc_sections): Modify to not be a no-op.
14887 (General_options::print_gc_sections): New option.
14888 * plugin.cc (Plugin_finish::run): Remove function call to
14889 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14890 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14891 * reloc.cc (Read_relocs::run): Add task to process relocs and
14892 determine unreferenced sections when doing garbage collection.
14893 (Gc_process_relocs): New class.
14894 (Sized_relobj::do_gc_process_relocs): New function.
14895 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14896 sections that are garbage collected.
14897 * reloc.h (Gc_process_relocs): New class.
14898 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14899 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14900 symbols whose corresponding sections are garbage collected.
14901 (Symbol_table::Symbol_table): Add new parameter for the garbage
14902 collection object.
14903 (Symbol_table::gc_mark_undef_symbols): New function.
14904 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14905 (Symbol_table::gc_mark_dyn_syms): New function.
14906 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14907 as garbage.
14908 (Symbol_table::add_from_object): Likewise.
14909 (Symbol_table::add_from_relobj): When building shared objects, do not
14910 treat externally visible symbols as garbage.
14911 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14912 table information for static and relocatable links.
14913 * symtab.h (Symbol_table::set_gc): New function.
14914 (Symbol_table::gc): New function.
14915 (Symbol_table::gc_mark_undef_symbols): New function.
14916 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14917 (Symbol_table::gc_mark_dyn_syms): New function.
14918 (Symbol_table::gc_): New data member.
e1df38aa 14919 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14920 function.
14921 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14922 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14923
3b293544
CF
149242009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14925
14926 * options.h (General_options::gc_sections): Define as a no-op for now.
14927 (General_options::no_keep_memory): Ditto.
14928 (General_options::Bshareable): Define.
14929 * options.cc (General_options::finalize): Honor -Bshareable.
14930
83d22aa8
AS
149312009-01-20 Andreas Schwab <schwab@suse.de>
14932
14933 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14934 read the value in the contents, since we don't use it. Use the
14935 template endianness when writing.
14936 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14937
cd536b21
AS
149382009-01-19 Andreas Schwab <schwab@suse.de>
14939
14940 * configure.tgt (powerpc64-*): Fix targ_obj.
14941
99e9a495
ILT
149422009-01-15 Ian Lance Taylor <iant@google.com>
14943
14944 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14945 local symbols when stripping all symbols.
14946
bbbfea06
CC
149472009-01-14 Cary Coutant <ccoutant@google.com>
14948
99e9a495 14949 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14950
0f7c0701
CC
149512009-01-14 Cary Coutant <ccoutant@google.com>
14952
14953 * archive.cc (Archive::get_elf_object_for_member): Remove call
14954 to File_read::claim_for_plugin.
14955 * descriptors.cc (Descriptors::open): Remove reference to
14956 is_claimed.
14957 (Descriptors::claim_for_plugin): Remove.
14958 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14959 (Descriptors::is_claimed): Remove.
14960 (claim_descriptor_for_plugin): Remove.
14961 * fileread.cc (File_read::claim_for_plugin): Remove.
14962 * fileread.h (File_read::claim_for_plugin): Remove.
14963 (File_read::descriptor): Reopen descriptor if necessary.
14964 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14965 (Plugin_manager::all_symbols_read): Add task parameter. Change
14966 all callers.
14967 (Plugin_manager::get_input_file): New function.
14968 (Plugin_manager::release_input_file): New function.
14969 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14970 corresponding data member.
14971 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14972 and pass to base constructor. Change all callers.
14973 (get_input_file, release_input_file): New functions.
14974 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14975 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14976 (Plugin_manager::all_symbols_read): Add task parameter.
14977 (Plugin_manager::get_input_file): New function.
14978 (Plugin_manager::release_input_file): New function.
14979 (Plugin_manager::task_): New data member.
14980 (Pluginobj::Pluginobj): Add filesize parameter.
14981 (Pluginobj::filename): New function.
14982 (Pluginobj::descriptor): New function.
14983 (Pluginobj::filesize): New function.
14984 (Pluginobj::filesize_): New data member.
14985 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14986 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14987 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14988
14989 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14990 with archive libraries.
14991 * testsuite/Makefile.in: Regenerate.
14992 * testsuite/plugin_test.c (struct sym_info): New type.
14993 (get_input_file, release_input_file): New static variables.
14994 (onload): Capture new transfer vector entries.
14995 (claim_file_hook): Stop reading at end of file according to filesize.
14996 Factor out parsing of readelf output into separate function.
14997 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14998 APIs and get the source file name from the symbol table. Convert
14999 source file name to corresponding object file name. Print info
15000 message when adding new input files.
15001 (parse_readelf_line): New function.
15002 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15003 * testsuite/plugin_test_2.sh: Likewise.
15004 * testsuite/plugin_test_3.sh: Likewise.
15005 * testsuite/plugin_test_4.sh: New test case.
15006
62a6d109
ILT
150072009-01-07 Ian Lance Taylor <iant@google.com>
15008
15009 * version.cc (version_string): Bump to 1.8.
15010
483620e8
CC
150112008-12-23 Cary Coutant <ccoutant@google.com>
15012
15013 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15014 * plugin.cc (Plugin_manager::finish): Rename as
15015 layout_deferred_objects. Move cleanup to separate function.
15016 (Plugin_manager::cleanup): New function.
15017 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15018 separately.
15019 * plugin.h (Plugin_manager::finish): Rename as
15020 layout_deferred_objects.
15021 (Plugin_manager::cleanup): New function.
15022 (Plugin_manager::cleanup_done): New field.
15023
d66a9eb3
CC
150242008-12-23 Cary Coutant <ccoutant@google.com>
15025
15026 * plugin.cc (is_visible_from_outside): New function.
15027 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15028 so we don't return "IR only" status for exported symbols or -r links.
15029
15030 * testsuite/Makefile.am (plugin_test_3): New test case.
15031 * testsuite/Makefile.in: Regenerate.
15032 * testsuite/plugin_test_3.sh: New file.
15033
5995b570
CC
150342008-12-22 Cary Coutant <ccoutant@google.com>
15035
15036 * object.cc (Sized_relobj::layout_section): New function.
15037 (Sized_relobj::do_layout): Defer layout of input sections until after
15038 plugin has provided replacement files.
15039 (Sized_relobj::do_layout_deferred_sections): New function.
15040 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15041 (Relobj::layout_deferred_sections): New function.
15042 (Relobj::do_layout_deferred_sections): New function.
15043 (Sized_relobj::do_layout_deferred_sections): New function.
15044 (Sized_relobj::layout_section): New function.
15045 (Sized_relobj::Deferred_layout): New structure.
15046 (Sized_relobj::deferred_layout_): New field.
15047 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15048 Change all callers. Layout deferred sections.
15049 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15050 references.
15051 (Plugin_hook::run): Move code from do_plugin_hook inline.
15052 (Plugin_hook::do_plugin_hook): Remove.
15053 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15054 (Plugin_manager::finish): Renamed, was cleanup.
15055 (Plugin_manager::should_defer_layout): New function.
15056 (Plugin_manager::add_deferred_layout_object): New function.
15057 (Plugin_manager::Deferred_layout_list): New type.
15058 (Plugin_manager::deferred_layout_objects_): New field.
15059 (Plugin_hook::do_plugin_hook): Remove.
15060
ee769c88
ILT
150612008-12-17 Ian Lance Taylor <iant@google.com>
15062
15063 * options.h (class General_options): Add --no case for
15064 --export-dynamic.
15065
abc8dcba
CC
150662008-12-16 Cary Coutant <ccoutant@google.com>
15067
15068 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15069 vector.
15070 (Plugin_manager::claim_file): Create plugin object even if
15071 plugin did not call the add_symbols callback.
15072 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15073 asking for more symbols than were added.
15074 * testsuite/Makefile.am (plugin_test_1): Add test case with
15075 no global symbols.
15076 (empty.syms): New target.
15077 * testsuite/Makefile.in: Regenerate.
15078 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15079 message. Don't call add_symbols if no globals.
15080 (all_symbols_read_hook): Don't provide replacement for empty
15081 claimed file.
15082
b0074644
ILT
150832008-12-12 Ian Lance Taylor <iant@google.com>
15084
68943102
ILT
15085 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15086 r_type == 0 for a local symbol with r_sym == 0.
15087 (scan_relocatable_relocs): Pass r_sym to
15088 local_non_section_strategy.
15089 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15090 r_sym parameter.
15091
b0074644
ILT
15092 * configure.ac: Update test for TLS descriptors: they are
15093 supported as of glibc 2.9.
15094 * configure: Rebuild.
15095
c2508178
ILT
150962008-12-11 Ian Lance Taylor <iant@google.com>
15097
15098 PR 7091
15099 * target-reloc.h (Default_scan_relocatable_relocs): For each
15100 function, map r_type == 0 to RELOC_DISCARD.
15101
2756a258
CC
151022008-12-10 Cary Coutant <ccoutant@google.com>
15103
15104 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15105 object to override a kept COMDAT group from a plugin object.
15106
bb6f53d3
ILT
151072008-12-09 Ian Lance Taylor <iant@google.com>
15108
fbc558e1
ILT
15109 PR 7088
15110 * yyscript.y (file_cmd): Handle INPUT.
15111
bb6f53d3
ILT
15112 * testsuite/initpri1.c: Change all declarations to be full
15113 prototypes by adding void, to avoid compiler warnings.
15114
4674ecfc
CC
151152008-12-05 Rafael Avila de Espindola <espindola@google.com>
15116
15117 * options.cc (General_options::parse_plugin_opt): New.
15118 (General_options::add_plugin): The argument now is just the filename.
15119 (General_options::add_plugin_option): New.
15120 * options.h (plugin_opt): New.
15121 (add_plugin): Change argument name.
15122 (add_plugin_option): New.
15123 * plugin.cc (Plugin::load): Don't parse the plugin option.
15124 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15125 (Plugin::add_option): New.
15126 (Plugin::args_): Change type.
15127 (Plugin::filename_): New.
15128 (Plugin_manager::add_plugin_option): New.
15129 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15130 * testsuite/Makefile.in: Regenerate.
15131
fd06b4aa
CC
151322008-12-05 Cary Coutant <ccoutant@google.com>
15133
15134 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15135 Handle --strip-lto-sections option.
15136 * options.h (strip_lto_sections): New option.
15137
6c52134c
CC
151382008-12-01 Cary Coutant <ccoutant@google.com>
15139
15140 * plugin.cc (ld_plugin_message): Change format parameter to const.
15141 Fix mismatch between new[] and delete.
15142
a45248e0
CC
151432008-11-14 Cary Coutant <ccoutant@google.com>
15144
15145 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15146 instead of -1U.
15147
c82fbeee
CS
151482008-11-05 Craig Silverstein <csilvers@google.com>
15149
15150 * options.cc (General_options::parse_dynamic_list): New function.
15151 * options.h (General_options): New flags dynamic_list,
15152 dynamic_list_data, dynamic_list_cpp_new, and
15153 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15154 (General_options::in_dynamic_list): New function.
15155 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15156 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15157 (Lex::can_continue_name): Likewise.
15158 (yylex): Likewise.
15159 (read_script_file): New parameter script_options.
15160 (read_dynamic_list): New function.
15161 (Script_options::define_dynamic_list): New function.
15162 (dynamic_list_keyword_parsecodes): New variable.
15163 (dynamic_list_keywords): New variable.
15164 * script.h (Script_options::define_dynamic_list): New function
15165 prototype.
15166 (read_dynamic_list): New function prototype.
15167 * symtab.cc (strprefix): New macro.
15168 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15169 dynamic_list_data, dynamic_list_cpp_new, and
15170 dynamic_list_cpp_typeinfo.
15171 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15172 (dynamic_list_expr): New rule.
15173 (dynamic_list_nodes): Likewise.
15174 (dynamic_list_node): Likewise.
15175 * testsuite/Makefile.am (dynamic_list): New test.
15176 * testsuite/Makefile.in: Regenerated.
15177 * testsuite/dynamic_list.t: New file.
15178 * testsuite/dynamic_list.sh: New file.
15179
e0bb29a5
CS
151802008-11-05 Craig Silverstein <csilvers@google.com>
15181
15182 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15183 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15184 (t11_last): Likewise.
15185 * testsuite/ver_test_6.c (main): Likewise.
15186
4e1e25e0
CC
151872008-10-07 Cary Coutant <ccoutant@google.com>
15188
15189 * options.c (General_options::finalize): Add check for -static and
15190 -shared.
15191 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15192 is not empty.
15193
92f03fcb
CC
151942008-10-02 Cary Coutant <ccoutant@google.com>
15195
15196 * plugin.cc (make_sized_plugin_object): Fix conditional
15197 compilation to work when not all targets are enabled.
15198
fbd8a257
CC
151992008-09-29 Cary Coutant <ccoutant@google.com>
15200
15201 * archive.cc (Archive::get_file_and_offset): Use filename instead
15202 of name to get library path.
15203 (Archive::include_member): Unlock external member of a thin archive.
15204
15205 * testsuite/Makefile.am (TEST_AR): New variable.
15206 (thin_archive_test_1): New test.
15207 (thin_archive_test_2): New test.
81636b3f
CC
15208 * testsuite/Makefile.in: Regenerate.
15209 * testsuite/thin_archive_main.cc: New file.
15210 * testsuite/thin_archive_test_1.cc: New file.
15211 * testsuite/thin_archive_test_2.cc: New file.
15212 * testsuite/thin_archive_test_3.cc: New file.
15213 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15214
eff45813
CC
152152008-09-29 Cary Coutant <ccoutant@google.com>
15216
15217 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15218 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15219 instead of -1U.
15220 (Sized_relobj::do_finalize_local_symbols): Likewise.
15221 (Sized_relobj::map_to_kept_section): Likewise.
15222 * object.h (Sized_relobj::invalid_address): New constant.
15223 (Sized_relobj::do_output_section_offset): Check for invalid_address
15224 and return -1ULL.
15225 * output.cc (Output_reloc::local_section_offset): Use constant
15226 invalid_address instead of -1U.
15227 (Output_reloc::get_address): Likewise.
15228 (Output_section::output_address): Change -1U to -1ULL.
15229 * output.h (Output_reloc::invalid_address): New constant.
15230 * reloc.cc (Sized_relobj::write_sections): Use constant
15231 invalid_address instead of -1U.
15232 (Sized_relobj::relocate_sections): Likewise.
15233 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15234 values for merge sections.
15235 * target-reloc.h (relocate_for_relocatable): Use constant
15236 invalid_address instead of -1U.
15237
89fc3421
CC
152382008-09-19 Cary Coutant <ccoutant@google.com>
15239
15240 Add plugin functionality for link-time optimization (LTO).
15241 * configure.ac (plugins): Add --enable-plugins option.
15242 * configure: Regenerate.
15243 * config.in: Regenerate.
15244 * Makefile.am (LIBDL): New variable.
15245 (CCFILES): Add plugin.cc.
15246 (HFILES): Add plugin.h.
15247 (ldadd_var): Add LIBDL.
15248 * Makefile.in: Regenerate.
15249
15250 * archive.cc: Include "plugin.h".
15251 (Archive::setup): Don't preread archive symbols when using a plugin.
15252 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15253 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15254 files.
15255 (Archive::include_member): Add symbols from plugin objects.
15256 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15257 * descriptors.cc (Descriptors::open): Check for file descriptors
15258 abandoned by plugins.
15259 (Descriptors::claim_for_plugin): New function.
15260 * descriptors.h (Descriptors::claim_for_plugin): New function.
15261 (Open_descriptor::is_claimed): New field.
15262 (claim_descriptor_for_plugin): New function.
15263 * fileread.cc (File_read::claim_for_plugin): New function.
15264 * fileread.h (File_read::claim_for_plugin): New function.
15265 (File_read::descriptor): New function.
15266 * gold.cc: Include "plugin.h".
15267 (queue_initial_tasks): Add task to call plugin hooks for generating
15268 new object files.
15269 * main.cc: Include "plugin.h".
15270 (main): Load plugin libraries.
15271 * object.h (Pluginobj): Declare.
15272 (Object::pluginobj): New function.
15273 (Object::do_pluginobj): New function.
15274 (Object::set_target): New function.
15275 * options.cc: Include "plugin.h".
15276 (General_options::parse_plugin): New function.
15277 (General_options::General_options): Initialize plugins_ field.
15278 (General_options::add_plugin): New function.
15279 * options.h (Plugin_manager): Declare.
15280 (General_options): Add --plugin option.
15281 (General_options::has_plugins): New function.
15282 (General_options::plugins): New function.
15283 (General_options::add_plugin): New function.
15284 (General_options::plugins_): New field.
15285 * plugin.cc: New file.
15286 * plugin.h: New file.
15287 * readsyms.cc: Include "plugin.h".
15288 (Read_symbols::do_read_symbols): Check for archive before checking
15289 for ELF file. Call plugin hooks to claim files.
15290 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15291 from a real object file; force override when processing replacement
15292 files.
15293 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15294 (Symbol::init_base_object): Likewise.
15295 (Symbol::init_base_output_data): Likewise.
15296 (Symbol::init_base_output_segment): Likewise.
15297 (Symbol::init_base_constant): Likewise.
15298 (Symbol::init_base_undefined): Likewise.
15299 (Symbol::output_section): Assert that object is not a plugin.
15300 (Symbol_table::add_from_pluginobj): New function.
15301 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15302 undefined.
15303 (Symbol_table::sized_write_globals): Likewise.
15304 (Symbol_table::add_from_pluginobj): Instantiate template.
15305 * symtab.h (Sized_pluginobj): Declare.
15306 (Symbol::in_real_elf): New function.
15307 (Symbol::set_in_real_elf): New function.
15308 (Symbol::in_real_elf_): New field.
15309 (Symbol_table::add_from_pluginobj): New function.
15310
15311 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15312 (LIBDL): New variable.
15313 (LDADD): Add LIBDL.
15314 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15315 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15316 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15317 (MOSTLYCLEANFILES): Likewise.
15318 * testsuite/Makefile.in: Regenerate.
15319 * testsuite/plugin_test.c: New file.
15320 * testsuite/plugin_test_1.sh: New file.
15321 * testsuite/plugin_test_2.sh: New file.
15322
de31bda5
ILT
153232008-09-16 Ian Lance Taylor <iant@google.com>
15324
9c2d0ef9
ILT
15325 * target-reloc.h (relocate_section): Check whether a symbol is
15326 defined by the ABI before reporting an undefined symbol error.
15327 * target.h (Target::is_defined_by_abi): Make parameter const.
15328 (Target::do_is_defined_by_abi): Likewise.
15329 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15330 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15331 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15332 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15333 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15334 * testsuite/Makefile.in: Rebuild.
15335
de31bda5
ILT
15336 * fileread.cc (make_view): Add casts to avoid warning.
15337
9fa33bee
AO
153382008-09-16 Alexandre Oliva <aoliva@redhat.com>
15339
15340 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15341 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15342
183fd0e3
AO
153432008-09-16 Alexandre Oliva <aoliva@redhat.com>
15344
15345 * options.h (General_options::output_is_executable): New.
15346 (General_options::output_is_pie): New.
15347 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15348 for shared libraries.
15349 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15350
7be8330a
CD
153512008-09-11 Chris Demetriou <cgd@google.com>
15352
15353 * options.h (origin): New -z option.
15354 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15355 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15356 in DT_FLAGS_1.
15357
a9caad02
CC
153582008-09-05 Cary Coutant <ccoutant@google.com>
15359
15360 * fileread.cc (File_read::make_view): Add check for attempt to map
15361 beyond end of file.
15362
ae6dce4d
CC
153632008-09-05 Cary Coutant <ccoutant@google.com>
15364
15365 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15366 explicit instantiations.
15367
d7ab2a47
KVH
153682008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15369
15370 PR gold/6858
15371 * options.cc (General_options::finalize): Allow undefined symbols
15372 in shlibs if linking -shared.
15373
15374 PR gold/6859
15375 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15376 symbols as not needing a dynsym entry.
15377
1e52a9c1
CS
153782008-08-20 Craig Silverstein <csilvers@google.com>
15379
15380 * fileread.cc (File_read::open): Do not lock the file unless it
15381 was successfully opened.
15382
d85c80a3
CC
153832008-08-14 Cary Coutant <ccoutant@google.com>
15384
15385 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15386 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15387 * testsuite/tls_test.cc (struct int128): 128-bit struct
15388 for testing TLS relocs with non-zero addend.
15389 (v12): New TLS variable.
15390 (t12): New test.
15391 (t_last): Add check for v12.
15392 * testsuite/tls_test.h (t12): New function.
15393 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15394
2d924fd9
ILT
153952008-08-13 Ian Lance Taylor <iant@google.com>
15396
15397 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15398 set tls_segment_ or relro_segment_.
15399 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15400 when appropriate.
15401 * output.h (Output_section::clear_is_relro): New function.
15402 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15403 sections specially even when output_data_ is empty.
15404 (Output_segment::maximum_alignment): When first section is relro,
15405 only force alignment for PT_LOAD segments.
15406 * script.cc (script_data_segment_align): New function.
15407 (script_data_segment_relro_end): New function.
15408 * script-c.h (script_data_segment_align): Declare.
15409 (script_data_segment_relro_end): Declare.
15410 * script-sections.h (class Script_sections): Declare
15411 data_segment_align and data_segment_relro_end. Add fields
15412 segment_align_index_ and saw_relro_end_.
15413 * script-sections.cc (class Sections_element): Add set_is_relro
15414 virtual function. Add new bool* parameter to place_orphan_here.
15415 Add get_output_section virtual function.
15416 (class Output_section_definition): Add set_is_relro. Add new
15417 bool* parameter to place_orphan_here. Add get_output_section.
15418 Add is_relro_ field.
15419 (Output_section_definition::Output_section_definition): Initialize
15420 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15421 and is_relro_ fields.
15422 (Output_section_definition::place_orphan_here): Add is_relro
15423 parameter.
15424 (Output_section_definition::set_section_addresses): Set relro for
15425 output section.
15426 (Output_section_definition::alternate_constraint): Likewise.
15427 (class Orphan_output_section): Add new bool* parameter to
15428 place_orphan_here. Add get_output_section.
15429 (Orphan_output_section::place_orphan_here): Add is_relro
15430 parameter.
15431 (Script_sections::Script_sections): Initialize
15432 data_segment_align_index_ and saw_relro_end_.
15433 (Script_sections::data_segment_align): New function.
15434 (Script_sections::data_segment_relro_end): New function.
15435 (Script_sections::place_orphan): Set or clear is_relro.
15436 (Script_sections::set_section_addresses): Force alignment of first
15437 TLS section.
15438 * yyscript.y (exp): Call script_data_segment_align and
15439 script_data_segment_relro_end.
15440 * testsuite/relro_script_test.t: New file.
15441 * testsuite/relro_test.cc (using_script): Declare.
15442 (t1, t2): Test using_script.
15443 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15444 (relro_script_test_SOURCES): Define.
15445 (relro_script_test_DEPENDENCIES): Define.
15446 (relro_script_test_LDFLAGS): Define.
15447 (relro_script_test_LDADD): Define.
15448 (relro_script_test.so): New target.
15449 * testsuite/Makefile.in: Rebuild.
15450
f827c9a9
CC
154512008-08-06 Cary Coutant <ccoutant@google.com>
15452
15453 * archive.cc (Archive::total_archives, Archive::total_members)
15454 (Archive::total_members_loaded): New variables.
15455 (Archive::setup): Add parameter. Add option to preread
15456 archive symbols.
15457 (Archive::read_armap): Add counter.
15458 (Archive::get_file_and_offset): New function.
15459 (Archive::get_elf_object_for_member): New function.
15460 (Archive::read_all_symbols): New function.
15461 (Archive::read_symbols): New function.
15462 (Archive::add_symbols): Add counters.
15463 (Archive::include_all_members): Use armap to find members if it's
15464 already built.
15465 (Archive::include_member): Skip reading symbols if already read.
15466 Factored code into Archive::get_file_and_offset and
15467 Archive::get_elf_object_for_member. Changed call to
15468 Mapfile::report_include_archive_member.
15469 (Archive::print_stats): New function.
15470 * archive.h: Declare Object and Read_symbols_data classes.
15471 (Archive::Archive): Add initializers for new members.
15472 (Archive::setup): Add parameter.
15473 (Archive::print_stats): New function.
15474 (Archive::total_archives, Archive::total_members)
15475 (Archive::total_members_loaded): New variables.
15476 (Archive::get_file_and_offset): New function.
15477 (Archive::get_elf_object_for_member): New function.
15478 (Archive::read_all_symbols): New function.
15479 (Archive::read_symbols): New function.
15480 (Archive::Archive_member): New class.
15481 (Archive::members_): New member.
15482 (Archive::num_members_): New member.
15483 * main.cc: Include archive.h.
15484 (main): Call Archive::print_stats.
15485 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15486 archive parameter; member_name is now the fully-decorated name.
15487 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15488 * options.h: (General_options): Add --preread-archive-symbols option.
15489 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15490 Archive::setup.
15491
de4c45bd
ILT
154922008-08-04 Ian Lance Taylor <iant@google.com>
15493
15494 * symtab.h (Symbol::use_plt_offset): New function.
15495 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15496 * powerpc.cc (Relocate::relocate): Likewise.
15497 * sparc.cc (Relocate::relocate): Likewise.
15498 * x86_64.cc (Relocate::relocate): Likewise.
15499 * testsuite/weak_plt.sh: New test.
15500 * testsuite/weak_plt_main.cc: New test.
15501 * testsuite/weak_plt_shared.cc: New test.
15502 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15503 (check_PROGRAMS): Add weak_plt.
15504 (check_DATA): Add weak_plt_shared.so.
15505 (weak_plt_main_pic.o, weak_plt): New targets.
15506 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15507 * testsuite/Makefile.in: Rebuild.
15508
15509 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15510 gcctestdir/ld.
15511 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15512 * testsuite/Makefile.in: Rebuild.
15513
323ee3f4
AM
155142008-08-04 Alan Modra <amodra@bigpond.net.au>
15515
15516 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15517 * Makefile.in: Regenerate.
15518 * po/POTFILES.in: Regenerate.
15519
7c07ecec
ILT
155202008-07-29 Ian Lance Taylor <iant@google.com>
15521
15522 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15523 symbols before other symbols.
15524 * testsuite/script_test_2.cc (test_addr): Declare.
15525 (test_addr_alias): Declare.
15526 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15527 values.
7c07ecec
ILT
15528 * testsuite/script_test_2.t: Define test_addr_alias and
15529 test_addr.
15530
5778530e
ILT
155312008-07-24 Ian Lance Taylor <iant@google.com>
15532
2a00e4fb
ILT
15533 PR 5990
15534 * descriptors.cc: New file.
15535 * descriptors.h: New file.
15536 * gold-threads.h (class Hold_optional_lock): New class.
15537 * fileread.cc: Include "descriptors.h".
15538 (File_read::~File_read): Release descriptor rather than closing
15539 it.
15540 (File_read::open) [file]: Call open_descriptor rather than open.
15541 Set is_descriptor_opened_.
15542 (File_read::open) [memory]: Assert that descriptor is not open.
15543 (File_read::reopen_descriptor): New function.
15544 (File_read::release): Release descriptor.
15545 (File_read::do_read): Make non-const. Reopen descriptor.
15546 (File_read::read): Make non-const.
15547 (File_read::make_view): Reopen descriptor.
15548 (File_read::do_readv): Likewise.
15549 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15550 Update declarations.
15551 * layout.cc: Include "descriptors.h".
15552 (Layout::create_build_id): Use open_descriptor rather than open.
15553 * output.cc: Include "descriptors.h".
15554 (Output_file::open): Use open_descriptor rather than open.
15555 * archive.cc (Archive::const_iterator): Change Archive to be
15556 non-const.
15557 (Archive::begin, Archive::end): Make non-const.
15558 (Archive::count_members): Likewise.
15559 * archive.h (class Archive): Update declarations.
15560 * object.h (Object::read): Make non-const.
15561 * Makefile.am (CCFILES): Add descriptors.cc.
15562 (HFILES): Add descriptors.h.
15563 * Makefile.in: Rebuild.
15564
801647d1
ILT
15565 PR 6716
15566 * gold.h: Always include <clocale>. Add Solaris workarounds
15567 following code in binutils/sysdep.h.
15568
5edd166e
ILT
15569 PR 6048
15570 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15571 this->eh_frame_hdr_ is NULL before using it.
15572
c89ad728
ILT
15573 * dynobj.cc (Versions::Versions): Update comment.
15574
aa86f06b
ILT
15575 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15576 the base version name.
15577
5778530e
ILT
15578 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15579 array size plus one.
15580 (Stringpool_template::set_string_offsets): Subtract one from key
15581 before using it as an array index.
15582 (Stringpool_template::get_offset_with_length): Likewise.
15583 (Stringpool_template::write_to_buffer): Likewise.
15584 * stringpool.h (Stringpool_template::get_offset_from_key):
15585 Likewise.
15586
057ead22
ILT
155872008-07-23 Ian Lance Taylor <iant@google.com>
15588
7f649c59
ILT
15589 PR 6658
15590 * object.h (Merged_symbol_value::value): Do our best to handle a
15591 negative addend.
15592
057ead22
ILT
15593 PR 6647
15594 * script.cc (Version_script_info::get_versions): Don't add empty
15595 version tag to return value.
15596 (Version_script_info::get_symbol_version_helper): Change return
15597 type to bool. Add pversion parameter. Change all callers.
15598 (script_register_vers_node): Don't require a non-NULL tag.
15599 * script.h (class Version_script_info): Update declarations.
15600 (Version_script_info::get_symbol_version): Change return type to
15601 bool. Add version parameter. Change all callers.
15602 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15603 handling. Handle an empty version from a version script.
15604 (Symbol_table::define_special_symbol): Likewise.
15605 * testsuite/ver_test_10.script: New file.
15606 * testsuite/ver_test_10.sh: New file.
15607 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15608 (check_DATA): Add ver_test_10.syms.
15609 (ver_test_10.syms, ver_test_10.so): New target.
15610 * testsuite/Makefile.in: Rebuild.
15611
58e54ac2
CD
156122008-07-23 Simon Baldwin <simonb@google.com>
15613
15614 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15615 to zero for undefined symbols from dynamic libraries.
15616
95d14cd3
ILT
156172008-07-23 Ian Lance Taylor <iant@google.com>
15618
15619 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15620 Change all callers.
15621 * symtab.h (class Symbol_table): Update declaration.
15622 * testsuite/ver_test_9.cc: New file.
15623 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15624 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15625 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15626 (ver_test_9.so, ver_test_9.o): New targets.
15627 * testsuite/Makefile.in: Rebuild.
15628
92de84a6
ILT
156292008-07-22 Ian Lance Taylor <iant@google.com>
15630
34810851
ILT
15631 * options.h (class General_options): Define --check-sections.
15632 * layout.cc (Layout::set_segment_offsets): Handle
15633 --check-sections.
15634
af6156ef
ILT
15635 * options.h (class General_options): Define -n/--nmagic and
15636 -N/--omagic.
15637 * options.cc (General_options::finalize): For -n/--nmagic or
15638 -N/--omagic, set -static.
15639 * layout.cc (Layout::attach_allocated_section_to_segment): If
15640 -N/--omagic, don't put read-only and read-write sections in
15641 different segments.
15642 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15643 finding a read-only segment.
15644 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15645 don't set the minimum segment alignment to the common page size,
15646 and don't set the file offset to the address modulo the page size.
15647 * script-sections.cc (Script_sections::create_segments): If
15648 -n/--omagic, don't put read-only and read-write sections in
15649 different segments.
15650
92de84a6
ILT
15651 * cref.cc: New file.
15652 * cref.h: New file.
15653 * options.h (class General_options): Add --print-symbol-counts.
15654 * main.cc (main): Issue defined symbol report if requested.
15655 * archive.cc (Archive::interpret_header): Make into a const member
15656 function.
15657 (Archive::add_symbols): Call Input_objects::archive_start and
15658 archive_stop.
15659 (Archive::const_iterator): Define new class.
15660 (Archive::begin, Archive::end): New functions.
15661 (Archive::include_all_members): Rewrite to use iterator.
15662 (Archive::count_members): New function.
15663 * archive.h (class Archive): Update declarations.
15664 (Archive::filename): New function.
15665 * object.cc: Include "cref.h".
15666 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15667 (Sized_relobj::do_get_global_symbol_counts): New function.
15668 (Input_objects::add_object): Add object to cross-referencer.
15669 (Input_objects::archive_start): New function.
15670 (Input_objects::archive_stop): New function.
15671 (Input_objects::print_symbol_counts): New function.
15672 * object.h: Declare Cref and Archive.
15673 (Object::get_global_symbol_counts): New function.
15674 (Object::do_get_global_symbol_counts): New pure virtual function.
15675 (class Sized_relobj): Add defined_count_ field. Update
15676 declarations.
15677 (class Input_objects): Add cref_ field. Update constructor.
15678 Update declarations.
15679 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15680 defined_count_.
15681 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15682 symbol counts.
15683 (Sized_dynobj::do_get_global_symbol_counts): New function.
15684 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15685 defined_count_. Update declarations. Define Symbols typedef.
15686 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15687 parameter. Change all callers.
15688 (Symbol_table::add_from_dynobj): Add sympointers and defined
15689 parameters. Change all callers.
15690 * symtab.h (class Symbol_table): Update declarations.
15691 * Makefile.am (CCFILES): Add cref.cc.
15692 (HFILES): Add cref.h.
15693 * Makefile.in: Rebuild.
15694
3f7c5e1d
CD
156952008-07-22 Simon Baldwin <simonb@google.com>
15696
15697 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15698 to zero when writing undefined symbols.
15699
e0b64032
ILT
157002008-07-22 Ian Lance Taylor <iant@google.com>
15701
15702 * output.cc (Output_section::add_input_section): Don't try to
15703 merge empty merge sections.
15704
096b02cf
CS
157052008-07-21 Craig Silverstein <csilvers@google.com>
15706
15707 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15708 Include symbol version in error message.
cd536b21 15709
1d1f116d
CD
157102008-07-20 Chris Demetriou <cgd@google.com>
15711
cd536b21 15712 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15713 (RANDOM_SEED_CFLAGS): New substituted variable.
15714 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15715 * configure: Rebuild.
15716 * Makefile.in: Likewise.
15717 * testsuite/Makefile.in: Likewise.
15718
a18f591e
ILT
157192008-07-18 Ian Lance Taylor <iant@google.com>
15720
15721 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15722 where we see NAME/NULL and NAME/VERSION as separate symbols.
15723 * testsuite/ver_test_main.cc (main): Call t4.
15724 (t4, t4_2a): Define.
15725 * testsuite/ver_test_2.cc (t4_2): Define.
15726 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15727 * testsuite/ver_test_4.cc (t4_2a): Define.
15728 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15729 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15730
c6e3f6ed
ILT
157312008-07-17 Ian Lance Taylor <iant@google.com>
15732
15733 * dynobj.cc (Versions::add_def): If we give an error about a
15734 missing version, go ahead and create the version anyhow.
15735
ef9beddf
ILT
157362008-07-10 Ian Lance Taylor <iant@google.com>
15737
15738 Handle output sections with more than 0x7fffffff bytes.
15739 * object.h (class Relobj): Change map_to_output_ to
15740 output_sections_, and just keep a section pointer. Change all
15741 uses. Move comdat group support to Sized_relobj.
15742 (Relobj::is_section_specially_mapped): Remove.
15743 (Relobj::output_section): Remove poff parameter. Change all
15744 callers.
15745 (Relobj::output_section_offset): New function.
15746 (Relobj::set_section_offset): Rewrite.
15747 (Relobj::map_to_output): Remove.
15748 (Relobj::output_sections): New function.
15749 (Relobj::do_output_section_offset): New pure virtual function.
15750 (Relobj::do_set_section_offset): Likewise.
15751 (class Sized_relobj): Add section_offsets_ field. Add comdat
15752 group support from Relobj. Update declarations.
15753 (Sized_relobj::get_output_section_offset): New function.
15754 (Sized_relobj::do_output_section_offset): New function.
15755 (Sized_relobj::do_set_section_offset): New function.
15756 * object.cc (Relobj::output_section_address): Remove.
15757 (Sized_relobj::Sized_relobj): Initialize new fields.
15758 (Sized_relobj::include_section_group): Cast find_kept_object to
15759 Sized_relobj.
15760 (Sized_relobj::include_linkonce_section): Likewise.
15761 (Sized_relobj::do_layout): Use separate arrays for output section
15762 and output offset.
15763 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15764 output_sections.
15765 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15766 output_sections and section_offsets.
15767 (Sized_relobj::write_local_symbols): Likewise.
15768 (map_to_kept_section): Compute output address directly.
15769 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15770 output_sections and section_offsets.
15771 (Sized_relobj::write_sections): Likewise.
15772 (Sized_relobj::relocate_sections): Likewise.
15773 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15774 * output.h (class Output_reloc): Update declarations. Change
15775 u2_.relobj to Sized_relobj*.
15776 (class Output_data_reloc): Change add functions to use
15777 Sized_relobj*.
15778 * output.cc (Output_reloc::Output_reloc): Change relobj to
15779 Sized_relobj*.
15780 (Output_reloc::local_section_offset): Change return type to
15781 Elf_Addr. Use get_output_section_offset.
15782 (Output_reloc::get_address): Likewise.
15783 (Output_section::is_input_address_mapped): Don't call
15784 is_section_specially_mapped.
15785 (Output_section::output_offset): Likewise.
15786 (Output_section::output_address): Likewise.
15787 (Output_section::starting_output_address): Likewise.
15788 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15789 parameter to Sized_relobj*.
15790 (Copy_relocs::need_copy_reloc): Likewise.
15791 (Copy_relocs::save): Likewise.
15792 * copy-relocs.h (class Copy_relocs): Update declarations.
15793 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15794 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15795 * target-reloc.h (relocate_for_relocatable): Change
15796 offset_in_output_section type to Elf_Addr. Change code that uses
15797 it as well.
15798 * layout.cc (Layout::layout): Always set *off.
15799 * mapfile.cc (Mapfile::print_input_section): Use
15800 output_section_offset.
15801 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15802 Sized_relobj*.
15803 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15804 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15805 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15806
5cb66f97
ILT
158072008-07-03 Ian Lance Taylor <iant@google.com>
15808
15809 * layout.cc (Layout::include_section): Do not discard unrecognized
15810 SHT_STRTAB sections.
15811
afe47622
CS
158122008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15813
15814 * script.cc (Lex::can_continue_name): Make '?' allowable in
15815 version-script names.
15816 * testsuite/version_script.map: Change glob pattern to use '?'
15817
5adf9721
ILT
158182008-06-30 Manish Singh <yosh@gimp.org>
15819
15820 PR 6585
15821 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15822 Correct typo.
15823
e6fde208
ILT
158242008-06-30 Ian Lance Taylor <iant@google.com>
15825
15826 PR 6660
15827 PR 6682
15828 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15829 versions]: Don't try to read the value in the contents, since we
15830 don't use it. Use the template endianness when writing.
15831
3f2e6a2d
CC
158322008-06-25 Cary Coutant <ccoutant@google.com>
15833
15834 * fileread.cc (File_read::make_view): Assert on zero-length view.
15835 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15836 symbol table when there are no symbols to read.
15837
c43d3a48
CS
158382008-06-23 Craig Silverstein <csilvers@google.com>
15839
15840 * version.cc (version_string): Bump to 1.7
15841
5f494ea0
CS
158422008-06-18 Craig Silverstein <csilvers@google.com>
15843
15844 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15845 constant 0xFFFF to type Valtype.
15846 (Powerpc_relocate_functions::rel16_ha): Likewise.
15847
c42e122e
ILT
158482008-06-17 Ian Lance Taylor <iant@google.com>
15849
f34787f8
ILT
15850 * output.h (Output_section::Input_section): Initialize p2align_ to
15851 zero for Output_section_data constructors.
15852 (Output_section::Input_section::addralign): If not an input
15853 section, return the alignment of the Output_section_data.
15854 * testsuite/copy_test.cc: New file.
15855 * testsuite/copy_test_1.cc: New file.
15856 * testsuite/copy_test_2.cc: New file.
15857 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15858 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15859 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15860 (copy_test_1_pic.o, copy_test_1.so): New targets.
15861 (copy_test_2_pic.o, copy_test_2.so): New targets.
15862 * testsuite/Makefile.in: Rebuild.
15863
c42e122e
ILT
15864 * script-sections.cc (Script_sections::place_orphan): Initialize
15865 local variable exact.
15866
ce3ac18a
DE
158672008-06-13 David Edelsohn <edelsohn@gnu.org>
15868
15869 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15870
42cacb20
DE
158712008-06-12 David Edelsohn <edelsohn@gnu.org>
15872 David S. Miller <davem@davemloft.net>
15873
15874 * powerpc.cc: New file.
15875 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15876 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15877 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15878 * Makefile.in: Rebuild.
15879
7b308235
ILT
158802008-06-09 Ian Lance Taylor <iant@google.com>
15881
15882 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15883 <exception>.
15884 (throwing, orig_terminate): New static variables.
15885 (terminate_handler): New static function.
15886 (t2): Set terminate handler.
15887
f0b886e3
ILT
158882008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15889
15890 PR 6584
cd536b21 15891 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15892 alignment.
15893
3e90f135
CC
158942008-05-30 Cary Coutant <ccoutant@google.com>
15895
15896 * archive.cc (Archive::include_all_members) Correct to step
15897 over symbol table and extended name table in thin archives.
15898
e09ad04a
ILT
158992008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15900
15901 PR 6407
15902 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15903 calculation.
15904
62b01cb5
ILT
159052008-05-28 Caleb Howe <cshowe@google.com>
15906
15907 * reduced_debug_output.cc: New file.
15908 * reduced_debug_output.h: New file.
92de84a6 15909 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15910 * options.cc (General_options::finalize): Add strip_debug_non_line
15911 to the strip heirarchy.
15912 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15913 fields.
15914 * layout.cc: Include "reduced_debug_output.h".
15915 (Layout::Layout): Initialize new fields.
15916 (line_only_debug_sections): New static array.
15917 (is_lines_only_debug_sections): New static inline function.
15918 (Layout::include_section): Handle --strip-debug-non-line.
15919 (Layout::make_output_section): If --strip-debug-non-line, build
15920 new output sections for .debug_abbrev and .debug_info.
15921 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15922 gold. Warn about possible overflow.
15923 (read_signed_LEB_128): Likewise.
15924 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15925 (read_signed_LEB_128): Declare.
15926 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15927 (HFILES): Add reduced_debug_output.h.
15928 * Makefile.in: Rebuild.
15929
7d9e3d98
ILT
159302008-05-21 Ian Lance Taylor <iant@google.com>
15931
15932 * mapfile.cc: New file.
15933 * mapfile.h: New file.
15934 * options.h (class General_options): Add -M/--print-map and -Map.
15935 * options.cc (General_options::finalize): Make -M equivalent to
15936 -Map -.
15937 * main.cc: Include <cstdio> and "mapfile.h".
15938 (main): Open mapfile if requested.
15939 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15940 constructor. Change caller.
15941 (queue_initial_tasks): Add mapfile parameter. Change caller.
15942 (queue_middle_tasks): Likewise.
15943 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15944 declarations.
15945 * archive.cc: Include "mapfile.h".
15946 (Archive::add_symbols): Add mapfile parameter. Change all
15947 callers. Pass mapfile, symbol, and reason to include_member.
15948 (Archive::include_all_members): Add mapfile parameter. Change all
15949 callers.
15950 (Archive::include_member): Add mapfile, sym, and why parameters.
15951 Change all callers. Report inclusion to map file.
15952 * archive.h: Include "fileread.h".
15953 (class Archive): Update declarations.
15954 (Archive::file): New const method.
15955 (class Add_archive_symbols): Add mapfile_ field. Update
15956 constructor. Change all callers.
15957 * readsyms.h (class Read_symbols): Likewise.
15958 (class Finish_group): Likewise.
15959 (class Read_script): Likewise.
15960 * common.cc: Include "mapfile.h".
15961 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15962 all callers.
15963 (Symbol_table::do_allocate_commons): Likewise.
15964 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15965 symbol allocation to mapfile.
15966 * common.h (class Allocate_commons_task): Add mapfile_ field.
15967 Update constructor. Change all callers.
15968 * symtab.h (class Symbol_table): Update declarations.
15969 * layout.cc: Include "mapfile.h".
15970 (Layout_task_runner::run): Print information to mapfile.
15971 (Layout::create_gold_note): Change Output_data_fixed_space to
15972 Output_data_zero_fill.
15973 (Layout::create_build_id): Likewise.
15974 (Layout::print_to_mapfile): New function.
15975 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15976 constructor. Change caller.
15977 (class Layout): Declare print_to_mapfile.
15978 * output.cc (Output_section::Input_section::print_to_mapfile): New
15979 function.
15980 (Output_section::add_input_section): If producing a map, always
15981 add to input_sections_ list.
15982 (Output_section::do_print_to_mapfile): New function.
15983 (Output_segment::print_sections_to_mapfile): New function.
15984 (Output_segment::print_section_list_to_mapfile): New function.
15985 * output.h: Include "mapfile.h".
15986 (Output_data::print_to_mapfile): New function.
15987 (Output_data::do_print_to_mapfile): New virtual function.
15988 (Output_segment_headers::do_print_to_mapfile): New function.
15989 (Output_file_header::do_print_to_mapfile): New function.
15990 (Output_data_const::do_print_to_mapfile): New function.
15991 (class Output_data_const_buffer): Add map_name_ field. Update
15992 constructor. Change all callers. Add do_print_to_mapfile
15993 function.
15994 (class Output_data_fixed_space): Likewise.
15995 (class Output_data_space): Likewise.
15996 (class Output_data_zero_fill): New class.
15997 (Output_data_strtab::do_print_to_mapfile): New function.
15998 (Output_data_reloc_base::do_print_to_mapfile): New function.
15999 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16000 (Output_data_group::do_print_to_mapfile): New function.
16001 (Output_data_got::do_print_to_mapfile): New function.
16002 (Output_data_dynamic::do_print_to_mapfile): New function.
16003 (Output_symtab_xindex::do_print_to_mapfile): New function.
16004 (class Output_section): Declare do_print_to_mapflie. Declare
16005 print_to_mapfile in Input_section.
16006 (class Output_segment): Declare new functions.
16007 * object.h (Sized_relobj::symbol_count): New function.
16008 * script-sections.cc
16009 (Output_section_element_dot_assignment::set_section_addresses):
16010 Change Output_data_fixed_space to Output_data_zero_fill.
16011 (Output_data_expression::do_print_to_mapfile): New function.
16012 * script.cc (read_input_script): Add mapfile parameter. Change
16013 all callers.
16014 * script.h (read_input_script): Update declaration.
16015 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16016 (Eh_frame::do_print_to_mapfile): New function.
16017 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16018 (Output_merge_string::do_print_to_mapfile): New function.
16019 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16020 function.
16021 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16022 function.
16023 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16024 function.
16025 * Makefile.am (CCFILES): Add mapfile.cc.
16026 (HFILES): Add mapfile.h.
16027 * Makefile.in: Rebuild.
16028
9f1d377b
ILT
160292008-05-19 Ian Lance Taylor <iant@google.com>
16030
16031 * options.h (class General_options): Add -z relro.
16032 * layout.cc (Layout::Layout): Initialize relro_segment_.
16033 (Layout::add_output_section_data): Return the output section.
16034 (Layout::make_output_section): Rcognize relro sections and mark
16035 them appropriately.
16036 (Layout::attach_allocated_section_to_segment): Put relro sections
16037 in a PT_GNU_RELRO segment.
16038 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16039 section as relro.
16040 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16041 PT_TLS segments.
16042 (Layout::linkonce_mapping): Map d.rel.ro.local to
16043 .data.rel.ro.local.
16044 (Layout::output_section_name): Us .data.rel.ro.local for any
16045 section which begins with that.
16046 * layout.h (class Layout): Update add_output_section_data
16047 declaration. Add relro_segment_ field.
16048 * output.cc (Output_section::Output_section): Initialize is_relro_
16049 and is_relro_local_ fields.
16050 (Output_segment::add_output_section): Group relro sections.
16051 (Output_segment::is_first_section_relro): New function.
16052 (Output_segment::maximum_alignment): If there is a relro section,
16053 align the segment to the common page size.
16054 (Output_segment::set_section_addresses): Track whether we are
16055 looking at relro sections. If the last section is a relro
16056 section, align to the common page size.
16057 (Output_segment::set_section_list_addresses): Add in_relro
16058 parameter. Change all callers. Align to the page size when
16059 moving from relro to non-relro section.
16060 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16061 segment.
16062 * output.h (class Output_section): Add is_relro_ and
16063 is_relro_local_ fields.
16064 (Output_section::is_relro): New function.
16065 (Output_section::set_is_relro): New function.
16066 (Output_section::is_relro_local): New function.
16067 (Output_section::set_is_relro_local): New function.
16068 (class Output_segment): Update declarations.
16069 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16070 * sparc.cc (Target_sparc::got_section): Likewise.
16071 * x86_64.cc (Target_x86_64::got_section): Likewise.
16072 * testsuite/relro_test_main.cc: New file.
16073 * testsuite/relro_test.cc: New file.
16074 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16075 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16076 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16077 (relro_test.so, relro_test_pic.o): New targets.
16078 * testsuite/Makefile.in: Rebuild.
16079
a984ee1d
ILT
160802008-05-16 Ian Lance Taylor <iant@google.com>
16081
01676dcd
ILT
16082 * output.cc (Output_segment::add_output_section): Remove front
16083 parameter.
16084 * output.h (class Output_segment): Remove
16085 add_initial_output_section and overloaded add_output_section.
16086 Update declaration of remaining add_output_section.
16087 * layout.cc (Layout::create_interp): Call add_output_section
16088 rather than add_initial_output_section.
16089 (Layout::finish_dynamic_section): Likewise.
16090
497897f9
ILT
16091 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16092 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16093 know the dynamic type.
16094 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16095 field. Initialize it in constructor.
16096 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16097 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16098 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16099 reloc.
16100
a984ee1d
ILT
16101 * output.cc (Output_reloc::get_address): Change return type to
16102 Elf_Addr.
16103 * output.h (class Output_reloc): Update get_address declaration.
16104 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16105 for section addresses.
16106
55ba0940
ILT
161072008-05-09 Ian Lance Taylor <iant@google.com>
16108
16109 PR 6493
16110 * gold.cc (gold_nomem): Use return value of write.
16111
75517b77
ILT
161122008-05-08 Ian Lance Taylor <iant@google.com>
16113
16114 * symtab.c (Symbol::init_base_output_data): Add version
16115 parameter. Change all callers.
16116 (Symbol::init_base_output_segment): Likewise.
16117 (Symbol::init_base_constant): Likewise.
16118 (Symbol::init_base_undefined): Likewise.
16119 (Sized_symbol::init_output_data): Likewise.
16120 (Sized_symbol::init_output_segment): Likewise.
16121 (Sized_symbol::init_constant): Likewise.
16122 (Sized_symbol::init_undefined): Likewise.
16123 (Symbol_table::do_define_in_output_data): If the new symbol has a
16124 version, mark it as the default.
16125 (Symbol_table::do_define_in_output_segment): Likewise.
16126 (Symbol_table::do_define_as_constant): Likewise.
16127 * symtab.h (class Symbol): Update declarations.
16128 (class Sized_symbol): Likewise.
16129 * resolve.cc (Symbol::override_version): New function.
c42e122e 16130 (Symbol::override_base): Call override_version.
75517b77
ILT
16131 (Symbol::override_base_with_special): Likewise.
16132 * testsuite/ver_script_8.script: New file.
16133 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16134 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16135 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16136 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16137
f1f70eae
ILT
161382008-05-06 Ian Lance Taylor <iant@google.com>
16139
f3e9c5c5
ILT
16140 PR 6049
16141 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16142 functions.
16143 (class General_options): Remove existing --undefined, and add
16144 --no-undefined instead. Add new --undefined as synonym for -u.
16145 * archive.cc (Archive::add_symbols): Check whether symbol was
16146 named with -u.
16147 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16148 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16149 all uses. Add IS_UNDEFINED. Update declarations to split
16150 different versions of init_base. Declare init_base_undefined.
16151 (Symbol::is_defined): Handle IS_UNDEFINED.
16152 (Symbol::is_undefined): Likewise.
16153 (Symbol::is_weak_undefined): Call is_undefined.
16154 (Symbol::is_absolute): Handle IS_CONSTANT.
16155 (class Sized_symbol): Update declarations to split different
16156 versions of init. Declare init_undefined.
16157 (class Symbol_table): Declare new functions.
16158 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16159 Change all callers.
16160 (Symbol::init_base_output_data): Likewise.
16161 (Symbol::init_base_output_segment): Likewise.
16162 (Symbol::init_base_constant): Likewise.
16163 (Symbol::init_base_undefined): New function.
16164 (Sized_symbol::init_object): Rename from init. Change all
16165 callers.
16166 (Sized_symbol::init_output_data): Likewise.
16167 (Sized_symbol::init_output_segment): Likewise.
16168 (Sized_symbol::init_constant): Likewise.
16169 (Sized_symbol::init_undefined): New function.
16170 (Symbol_table::add_undefined_symbols_from_command_line): New
16171 function.
16172 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16173 function.
16174 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16175 (Symbol::output_section): Likewise.
16176 (Symbol::set_output_section): Likewise.
16177 (Symbol_table::sized_finalize_symbol): Likewise.
16178 (Symbol_table::sized_write_globals): Likewise.
16179 * resolve.cc (Symbol_table::should_override): Likewise.
16180 (Symbol::override_base_with_special): Likewise.
16181
8bdcdf2c
ILT
16182 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16183 symbol, change it to have default visibility.
16184 * testsuite/protected_1.cc: New file.
16185 * testsuite/protected_2.cc: New file.
16186 * testsuite/protected_3.cc: New file.
16187 * testsuite/protected_main_1.cc: New file.
16188 * testsuite/protected_main_2.cc: New file.
16189 * testsuite/protected_main_3.cc: New file.
16190 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16191 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16192 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16193 (protected_1.so): New target.
16194 (protected_1_pic.o, protected_2_pic.o): New targets.
16195 (protected_3_pic.o): New target.
16196 (check_PROGRAMS): Add protected_2.
16197 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16198 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16199 * testsuite/Makefile.in: Rebuild.
16200
2b706932
ILT
16201 * options.h (DEFINE_var): Add set_user_set_##varname__.
16202 (DEFINE_bool_alias): New macro.
16203 (class General_options): Define -Bstatic using DEFINE_bool_alias
16204 rather than DEFINE_special. Add --undefined as an alias for -z
16205 defs.
16206 * options.cc (General_options::parse_Bstatic): Remove.
16207
d82a5bcc
ILT
16208 * options.h (class General_options): Add --fatal-warnings.
16209 * main.cc (main): Implement --fatal-warnings.
16210 * errors.h (Errors::warning_count): New function.
16211
f1f70eae
ILT
16212 * options.h (class General_options): Add -Bsymbolic-functions.
16213 * symtab.h (Symbol::is_preemptible): Check for
16214 -Bsymbolic-functions.
16215
8825ac63
ILT
162162008-05-05 Ian Lance Taylor <iant@google.com>
16217
d98bc257
ILT
16218 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16219 as noVARNAME rather than no-VARNAME.
16220 (class General_options): Add option -z combreloc.
16221 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16222 get_address.
16223 (Output_reloc::sort_before) [SHT_REL]: New function.
16224 (Output_reloc::sort_before) [SHT_RELA]: New function.
16225 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16226 Sort_relocs_comparison.
16227 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16228 parameter. Change all callers.
16229 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16230 sort_relocs parameter. Change all callers.
16231 * output.cc (Output_reloc::get_address): New function, broken out
16232 of write_rel.
16233 (Output_reloc::write_rel): Call it.
16234 (Output_reloc::compare): New function.
16235 (Output_data_reloc_base::do_write): Optionally sort relocs.
16236
60b2b4e7
ILT
16237 * configure.ac: If targ_extra_obj is set, link it in.
16238 * configure.tgt: Initialize all variables.
16239 (x86_64*): Set targ_extra_obj and targ_extra_size.
16240 * configure: Rebuild.
16241
8825ac63
ILT
16242 * object.cc (Sized_relobj::include_section_group): Adjust section
16243 indexes read from group data. Build vector to pass to
16244 layout_group.
16245 * layout.cc (Layout::layout_group): Add flags and shndxes
16246 parameters. Remove contents parameter. Change caller. Update
16247 explicit instantiations.
16248 * layout.h (class Layout): Update layout_group declaration.
16249 * output.cc (Output_data_group::Output_data_group): Add flags and
16250 input_shndxes parameters. Remove contents parameter. Change
16251 caller.
16252 (Output_data_group::do_write): Change input_sections_ to
16253 input_shndxes_.
16254 * output.h (class Output_data_group): Update constructor
16255 declaration. Rename input_sections_ to input_shndxes_.
16256 * testsuite/many_sections_test.cc: Add template.
16257
e94cf127
CC
162582008-04-30 Cary Coutant <ccoutant@google.com>
16259
4418b2d5
CC
16260 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16261
e94cf127
CC
16262 * layout.cc (Layout::include_section): Refactored check for debug
16263 info section.
16264 (Layout::add_comdat): Add new parameters. Change type
16265 of signature parameter. Add object and shndx to signatures table.
16266 (Layout::find_kept_object): New function.
16267 * layout.h: Include <cstring>.
16268 (Layout::is_debug_info_section): New function.
16269 (Layout::add_comdat): Add new parameters.
16270 (Layout::find_kept_object): New function.
16271 (Layout::Kept_section): New struct.
16272 (Layout::Signatures): Change type of map range.
16273 * object.cc (Relobj::output_section_address): New function.
16274 (Sized_relobj::include_section_group): Add new parameters. Change
16275 calls to Layout::add_comdat. Change to build table of kept comdat
16276 groups and table mapping discarded sections to kept sections.
16277 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16278 (Sized_relobj::do_layout): Change calls to include_section_group and
16279 include_linkonce_section.
16280 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16281 value to zero when section is discarded.
16282 (Sized_relobj::map_to_kept_section): New function.
16283 * object.h (Relobj::output_section_address): New function.
16284 (Relobj::Comdat_group): New type.
16285 (Relobj::find_comdat_group): New function.
16286 (Relobj::Comdat_group_table): New type.
16287 (Relobj::Kept_comdat_section): New type.
16288 (Relobj::Kept_comdat_section_table): New type.
16289 (Relobj::add_comdat_group): New function.
16290 (Relobj::set_kept_comdat_section): New function.
16291 (Relobj::get_kept_comdat_section): New function.
16292 (Relobj::comdat_groups_): New field.
16293 (Relobj::kept_comdat_sections_): New field.
16294 (Symbol_value::input_value): Update comment.
16295 (Sized_relobj::map_to_kept_section) New function.
16296 (Sized_relobj::include_linkonce_section): Add new parameter.
16297 * target-reloc.h (Comdat_behavior): New type.
16298 (get_comdat_behavior): New function.
16299 (relocate_section): Add code to map a discarded section to the
16300 corresponding kept section when applying a relocation.
16301
e4e5049b
CS
163022008-04-30 Craig Silverstein <csilvers@google.com>
16303
16304 * dwarf_reader.cc (next_generation_count): New static var.
16305 (Addr2line_cache_entry): New struct.
16306 (addr2line_cache): New static var.
16307 (Dwarf_line_info::one_addr2line): Added caching.
16308 (Dwarf_line_info::clear_addr2line_cache): New function.
16309 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16310 cache-size parameter.
16311 (Dwarf_line_info::one_addr2line_cache): New function.
16312 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16313 new cache-size argument to one_addr2line(), and clear cache.
16314
d09e9154
CC
163152008-04-28 Cary Coutant <ccoutant@google.com>
16316
16317 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16318 R_386_PC8 relocations.
16319
7ef73768
ILT
163202008-04-23 Ian Lance Taylor <iant@google.com>
16321
55438702
ILT
16322 * object.cc (Sized_relobj::include_section_group): Check for
16323 invalid section group.
16324
c165fb93
ILT
16325 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16326 header size.
16327
7ef73768
ILT
16328 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16329 than read for file header.
16330 * archive.cc (Archive::include_member): Likewise.
16331
6194aaab
L
163322008-04-23 Paolo Bonzini <bonzini@gnu.org>
16333
16334 * aclocal.m4: Regenerate.
16335 * configure: Regenerate.
16336
d491d34e
ILT
163372008-04-19 Ian Lance Taylor <iant@google.com>
16338
5ea2bac6
ILT
16339 * version.cc (version_string): Bump to 1.6.
16340
7bc3e21a
ILT
16341 * testsuite/Makefile.am (many_sections_r_test): New target.
16342 (many_sections_r_test_SOURCES): Remove.
16343 (many_sections_r_test_DEPENDENCIES): Remove.
16344 (many_sections_r_test_LDFLAGS): Remove.
16345 (many_sections_r_test_LDADD): Remove.
16346
7fcd3aa9
ILT
16347 * object.cc (Sized_relobj::do_add_symbols): Always pass
16348 local_symbol_count_ to add_from_relobj.
16349
4c94d6ae
ILT
16350 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16351 every thousand variables.
16352 * testsuite/Makefile.in: Rebuild.
16353
d491d34e
ILT
16354 * object.cc (Xindex::initialize_symtab_xindex): New function.
16355 (Xindex::read_symtab_xindex): New function.
16356 (Xindex::sym_xindex_to_shndx): New function.
16357 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16358 available.
16359 (Sized_relobj::do_initialize_xindex): New function.
16360 (Sized_relobj::do_read_symbols): Adjust section links.
16361 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16362 parameter. Change all callers.
16363 (Sized_relobj::include_section_group): Adjust section links and
16364 symbol section indexes.
16365 (Sized_relobj::do_layout): Adjust section links.
16366 (Sized_relobj::do_count_local_symbols): Adjust section links and
16367 symbol section indexes.
16368 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16369 ordinary and special symbols.
16370 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16371 dynsym_xindex parameters. Change all callers. Adjust section
16372 links. Use SHN_XINDEX when needed.
16373 (Sized_relobj::get_symbol_location_info): Adjust section links.
16374 Don't get fooled by special symbols.
16375 * object.h (class Xindex): Define.
16376 (class Object): Add xindex_ parameter. Declare virtual functoin
16377 do_initialize_xindex.
16378 (Object::adjust_sym_shndx): New function.
16379 (Object::set_xindex): New protected function.
16380 (class Symbol_value): Add is_ordinary_shndx_ field.
16381 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16382 (Symbol_value::value): Assert ordinary section.
16383 (Symbol_value::initialize_input_to_output_map): Likewise.
16384 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16385 Change all callers.
16386 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16387 all callers.
16388 (class Sized_relobj): Update declarations.
16389 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16390 parameter. Change all callers.
16391 (Sized_relobj::adjust_shndx): New function.
16392 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16393 field.
16394 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16395 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16396 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16397 (Sized_dynobj::read_dynsym_section): Adjust section links.
16398 (Sized_dynobj::read_dynamic): Likewise.
16399 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16400 section links.
16401 (Sized_dynobj::do_initialize_xindex): New function.
16402 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16403 do_initialize_xindex.
16404 (Sized_dynobj::adjust_shndx): New function.
16405 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16406 dynsym_xindex_ fields.
16407 (Layout::finalize): Add a call to set_section_indexes before
16408 creating the symtab sections.
16409 (Layout::set_section_indexes): Don't do anything if the section
16410 already has a section index.
16411 (Layout::create_symtab_sections): Add shnum parameter. Change
16412 caller. Create .symtab_shndx section if needed.
16413 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16414 caller.
16415 (Layout::allocated_output_section_count): New function.
16416 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16417 needed.
16418 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16419 fields. Update declarations.
16420 (Layout::symtab_xindex): New function.
16421 (Layout::dynsym_xindex): New function.
16422 (class Write_symbols_task): Add layout_ field.
16423 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16424 Change caller.
16425 * output.cc (Output_section_headers::Output_section_headers): Add
16426 shstrtab_section parameter. Change all callers.
16427 (Output_section_headers::do_sized_write): Store overflow values
16428 for section count and section string table section index in
16429 section header zero.
16430 (Output_file_header::do_sized_write): Check for overflow of
16431 section count and section string table section index.
16432 (Output_symtab_xindex::do_write): New function.
16433 (Output_symtab_xindex::endian_do_write): New function.
16434 * output.h (class Output_section_headers): Add shstrtab_section_.
16435 Update declarations.
16436 (class Output_symtab_xindex): Define.
16437 (Output_section::has_out_shndx): New function.
16438 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16439 field.
16440 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16441 Change all callers.
16442 (Sized_symbol::init): Likewise.
16443 (Symbol::output_section): Check for ordinary symbol.
16444 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16445 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16446 callers.
16447 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16448 Change all callers. Simplify handling of symbols from sections
16449 not included in the link.
16450 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16451 distinction.
16452 (Weak_alias_sorter::operator()): Assert that symbols are
16453 ordinary.
16454 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16455 distinction.
16456 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16457 parameters. Change all callers.
16458 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16459 symbol distinction. Use SHN_XINDEX when needed.
16460 (Symbol_table::write_section_symbol): Add symtab_xindex
16461 parameter. Change all callers.
16462 (Symbol_table::sized_write_section_symbol): Likewise. Use
16463 SHN_XINDEX when needed.
16464 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16465 declarations.
16466 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16467 (Symbol::is_defined): Check is_ordinary.
16468 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16469 (Symbol::is_absolute, Symbol::is_common): Likewise.
16470 (class Sized_symbol): Update declarations.
16471 (class Symbol_table): Update declarations.
16472 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16473 parameters. Change all callers.
16474 (Sized_symbol::override): Likewise.
16475 (Symbol_table::override): Likewise.
16476 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16477 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16478 is_ordinary, and orig_st_shndx parameters. Change all callers.
16479 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16480 to be in an ordinary section.
16481 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16482 object and is_ordinary parameters. Change all callers.
16483 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16484 Change all callers. Don't add undefined or non-ordinary symbols
16485 to reloc_map_.
16486 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16487 Change all callers.
16488 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16489 declarations.
16490 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16491 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16492 (Sized_relobj::relocate_sections): Likewise.
16493 * target-reloc.h (scan_relocs): Adjust section symbol index.
16494 (scan_relocatable_relocs): Likewise.
16495 * i386.cc (Scan::local): Check for ordinary symbols.
16496 * sparc.cc (Scan::local): Likewise.
16497 * x86_64.cc (Scan::local): Likewise.
16498 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16499 to symbol_section_and_value.
16500 * testsuite/many_sections_test.cc: New file.
16501 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16502 (check_PROGRAMS): Add many_sections_test.
16503 (many_sections_test_SOURCES): Define.
16504 (many_sections_test_DEPENDENCIES): Define.
16505 (many_sections_test_LDFLAGS): Define.
16506 (BUILT_SOURCES): Add many_sections_define.h.
16507 (many_sections_define.h): New target.
16508 (BUILT_SOURCES): Add many_sections_check.h.
16509 (many_sections_check.h): New target.
16510 (check_PROGRAMS): Add many_sections_r_test.
16511 (many_sections_r_test_SOURCES): Define.
16512 (many_sections_r_test_DEPENDENCIES): Define.
16513 (many_sections_r_test_LDFLAGS): Define.
16514 (many_sections_r_test_LDADD): Define.
16515 (many_sections_r_test.o): New target.
16516 * testsuite/Makefile.in: Rebuild.
16517
c5818ff1
CC
165182008-04-17 Cary Coutant <ccoutant@google.com>
16519
16520 * errors.cc (Errors::info): New function.
16521 (gold_info): New function.
16522 * errors.h (Errors::info): New function.
16523 * gold.h (gold_info): New function.
16524 * object.cc (Input_objects::add_object): Print trace output.
16525 * options.cc (options::parse_set): New function.
16526 (General_options::parse_wrap): Deleted.
16527 (General_options::General_options): Deleted initializer.
16528 * options.h (options::String_set): New typedef.
16529 (options::parse_set): New function.
16530 (DEFINE_set): New macro.
16531 (General_options::wrap): Changed to use DEFINE_set. Changed
16532 callers of any_wrap_symbols and is_wrap_symbol.
16533 (General_options::trace, General_options::trace_symbol):
16534 New options.
16535 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16536 (General_options::wrap_symbols_): Deleted.
16537 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16538
b5be4a7c
DM
165392008-04-17 David S. Miller <davem@davemloft.net>
16540
16541 * options.cc (General_options::parse_V): New function.
16542 * options.h: Add entries for -V and -Qy.
16543
155a0dd7
ILT
165442008-04-17 Ian Lance Taylor <iant@google.com>
16545
16546 * common.cc (Symbol_table::allocate_commons): Remove options
16547 parameter. Change caller.
16548 (Symbol_table::do_allocate_commons): Remove options parameter.
16549 Change caller. Just call do_allocate_commons_list twice.
16550 (Symbol_table::do_allocate_commons_list): New function, broken out
16551 of do_allocate_commons.
16552 * common.h (class Allocate_commons_task): Remove options_ field.
16553 Update constructor.
16554 * symtab.cc (Symbol_table::Symbol_table): Initialize
16555 tls_commons_.
16556 (Symbol_table::add_from_object): Put TLS common symbols on
16557 tls_commons_ list.
16558 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16559 which are IN_OUTPUT_DATA.
16560 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16561 allocate_commons and do_allocate_commons declarations. Declare
16562 do_allocate_commons_list.
16563 * gold.cc (queue_middle_tasks): Update creation of
16564 Allocate_commons_task to not pass options.
16565 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16566 (TLS_TEST_C_FLAGS): New variable.
16567 (tls_test_c_pic.o): New target.
16568 (tls_test_shared.so): Link in tls_test_c_pic.o.
16569 (tls_test_c_pic_ie.o): New target.
16570 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16571 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16572 (tls_test_c.o): New target.
16573 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16574 (tls_pic_test_LDADD): Likewise.
16575 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16576 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16577 (tls_test_c_gnu2.o): New target.
16578 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16579 tls_test_c_gnu2.o.
16580 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16581 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16582 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16583 * testsuite/tls_test.cc: Include "config.h".
16584 (t_last): Call t11_last.
16585 * testsuite/tls_test.h (t11, t11_last): Declare.
16586 * testsuite/tls_test_c.c: New file.
16587 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16588 * configure.ac: Check for OpenMP support.
16589 * configure, config.in, Makefile.in: Rebuild.
16590 * testsuite/Makefile.in: Rebuild.
16591
edfbb029
CC
165922008-04-16 Cary Coutant <ccoutant@google.com>
16593
16594 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16595 (Target_i386::tls_base_symbol_defined_): New field.
16596 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16597 (Target_i386::Scan::global): Likewise.
16598 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16599 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16600 (Target_x86_64::tls_base_symbol_defined_): New field.
16601 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16602 (Target_x86_64::Scan::global): Likewise.
16603
f3c69fca
CC
166042008-04-16 Cary Coutant <ccoutant@google.com>
16605
16606 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16607 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16608 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16609 building shared libraries.
16610 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16611 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16612 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16613 * testsuite/Makefile.in: Rebuild.
16614 * testsuite/weak_undef.h: New file.
16615 * testsuite/weak_undef_file1.cc: Add extra test cases.
16616 * testsuite/weak_undef_file2.cc: Likewise.
16617 * testsuite/weak_undef_test.cc: Likewise.
16618
7c414435
DM
166192008-04-16 David S. Miller <davem@davemloft.net>
16620
32b769e1
DM
16621 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16622 Add issued_non_pic_error_ field. Declare check_non_pic.
16623 (Target_sparc::Scan::check_non_pic): New function.
16624 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16625 (Target_sparc::Scan::global): Likewise.
16626
11936fb1
DM
16627 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16628 * configure: Rebuild.
16629
7c414435
DM
16630 * options.h (DEFINE_enable): New macro.
16631 (new_dtags): New enable option.
16632 (initfirst, interpose, loadfltr, nodefaultlib,
16633 nodelete, nodlopen, nodump): New -z options.
16634 * layout.cc (Layout:finish_dynamic_section): If new
16635 dtags enabled, emit DT_RUNPATH. Also, emit a
16636 DT_FLAGS_1 containing any specified -z flags.
16637
85c7bf8b
ILT
166382008-04-16 Ian Lance Taylor <iant@google.com>
16639
12c0daef
ILT
16640 * copy-relocs.cc: New file.
16641 * copy-relocs.h: New file.
16642 * reloc.cc: Remove Copy_relocs code.
16643 * reloc.h: Likewise.
16644 * reloc-types.h (struct Reloc_types) [both versions]: Add
16645 get_reloc_addend_noerror.
16646 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16647 variants of add_global which take an addend which must be zero.
16648 * i386.cc: Include "copy-relocs.h".
16649 (class Target_i386): Change type of copy_relocs_ to variable,
16650 update initializer.
16651 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16652 Change all callers.
16653 (Target_i386::do_finalize_sections): Change handling of
16654 copy_relocs_.
16655 * sparc.cc: Include "copy-relocs.h".
16656 (class Target_sparc): Change type of copy_relocs_ to variable,
16657 update initializer.
16658 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16659 Change all callers.
16660 (Target_sparc::do_finalize_sections): Change handling of
16661 copy_relocs_.
16662 * x86_64.cc: Include "copy-relocs.h".
16663 (class Target_x86_64): Change type of copy_relocs_ to variable,
16664 update initializer.
16665 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16666 class. Change all callers.
16667 (Target_x86_64::do_finalize_sections): Change handling of
16668 copy_relocs_.
16669 * Makefile.am (CCFILES): Add copy-relocs.cc.
16670 (HFILES): Add copy-relocs.h.
16671
4f4995b6
ILT
16672 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16673
85c7bf8b
ILT
16674 * testsuite/script_test_4.sh: Permit leading zeroes.
16675
4f2a9edd
ILT
166762008-04-15 Ian Lance Taylor <iant@google.com>
16677
e6188289
ILT
16678 * script-sections.cc (Script_sections::create_segments): Use
16679 header_size_adjustment even when there is enough room for the
16680 headers.
16681 * testsuite/script_test_4.sh: New file.
16682 * testsuite/script_test_4.t: New file.
16683 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16684 (check_DATA): Add script_test_4.stdout.
16685 (MOSTLYCLEANFILES): Likewise.
16686 (script_test_4): New target.
16687 (script_test_4.stdout): New target.
16688 * testsuite/Makefile.in: Rebuild.
16689
4f2a9edd
ILT
16690 * sparc.cc: Add definitions for Output_data_plt_sparc class
16691 constants.
16692
f5314dd5
DM
166932008-04-14 David S. Miller <davem@davemloft.net>
16694
16695 * sparc.cc: New file.
16696 * Makefile.am (TARGETSOURCES): Add sparc.cc
16697 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16698 * configure.tgt: Document targ_extra_size and
16699 targ_extra_big_endian. Add entries for sparc-* and
16700 sparc64-*.
16701 * configure.ac: Handle targ_extra_size and
16702 targ_extra_big_endian.
16703 * Makefile.in: Rebuild.
16704 * configure: Likewise.
16705 * po/POTFILES.in: Likewise.
16706 * po/gold.pot: Likewise.
16707
154e0e9a
ILT
167082008-04-14 Ian Lance Taylor <iant@google.com>
16709
16710 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16711 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16712 in the name/type/flags to section mapping. Don't call
16713 allocate_output_section.
16714 (Layout::choose_output_section): Change parameter from adjust_name
16715 to is_input_section. Don't permit input sections after sections
16716 are attached to segments. Don't call allocate_output_section.
16717 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16718 not write_enable_output_section.
16719 (Layout::make_output_section): Don't push to
16720 unattached_section_list_ nor call attach_to_segment. Call
16721 attach_section_to_segment if sections are attached.
16722 (Layout::attach_sections_to_segments): New function.
16723 (Layout::attach_section_to_segment): New function.
16724 (Layout::attach_allocated_section_to_segment): Rename from
16725 attach_to_segment. Remove flags parameter.
16726 (Layout::allocate_output_section): Remove function.
16727 (Layout::write_enable_output_section): Remove function.
16728 * layout.h (class Layout): Update for above changes. Add new
16729 field sections_are_attached_.
16730 * output.h (Output_section::update_flags_for_input_section): New
16731 function.
16732 * output.cc (Output_section::add_input_section): Call
16733 update_flags_for_input_section.
16734 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16735
009a67a2
CC
167362008-04-11 Cary Coutant <ccoutant@google.com>
16737
16738 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16739 thought unnecessary.
16740 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16741
759b1a24
ILT
167422008-04-11 Ian Lance Taylor <iant@google.com>
16743
16744 * output.h (class Output_section_data): Remove inline definition
16745 of set_addralign.
16746 * output.cc (Output_section_data::set_addralign): New function.
16747
c2b45e22
CC
167482008-04-11 Cary Coutant <ccoutant@google.com>
16749
16750 Add support for TLS descriptors for i386 and x86_64.
16751 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16752 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16753 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16754 GOT_TYPE_TLS_DESC.
16755 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16756 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16757 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16758 relocations.
16759 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16760 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16761 Fix problem with initial-exec relocations.
16762 (Target_i386::Relocate::relocate_tls): Likewise.
16763 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16764 relaxation.
16765 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16766 support for section-plus-offset dynamic table entries.
16767 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16768 (Output_data_dynamic::Dynamic_entry): Add support for
16769 section-plus-offset dynamic table entries.
16770 (Output_data_dynamic::Classification): Likewise.
16771 (Output_data_dynamic::classification_): Renamed offset_.
16772 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16773 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16774 (Target_x86_64::make_plt_section): New function.
16775 (Target_x86_64::reserve_tlsdesc_entries): New function.
16776 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16777 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16778 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16779 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16780 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16781 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16782 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16783 add extra PLT entry for TLS descriptors.
16784 (Output_data_plt_x86_64::got_): New field.
16785 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16786 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16787 fields.
16788 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16789 descriptors.
16790 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16791 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16792 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16793 R_386_TLS_DESC_CALL relocations.
16794 (Target_x86_64::Scan::global): Likewise.
16795 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16796 for TLS descriptors.
16797 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16798 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16799 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16800 GD-to-IE relaxation.
16801 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16802 and TLS_DESCRIPTORS.
16803 * Makefile.in: Rebuild.
16804 * configure: Rebuild.
16805 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16806 (tls_test_shared2.so): New target.
16807 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16808 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16809 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16810 (tls_shared_gd_to_ie_test_LDADD): New variable.
16811 (tls_shared_gnu2_gd_to_ie_test): New target.
16812 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16813 New targets.
16814 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16815 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16816 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16817 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16818 (tls_shared_gnu2_test): New target.
16819 (tls_test_gnu2_shared.so): New target.
16820 (tls_shared_gnu2_test_SOURCES): New variable.
16821 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16822 (tls_shared_gnu2_test_LDFLAGS): New variable.
16823 (tls_shared_gnu2_test_LDADD): New variable.
16824 * testsuite/Makefile.in: Rebuild.
16825 * testsuite/Makefile.
16826
83bfb6b7
ILT
168272008-04-11 Ian Lance Taylor <iant@google.com>
16828
16829 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16830 justsyms.t.
16831 * testsuite/Makefile.in: Rebuild.
16832
16833 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16834 long.
16835 * testsuite/script_test_2.cc (main): Adjust test.
16836
706e1f5e
ILT
168372008-04-11 David S. Miller <davem@davemloft.net>
16838 Ian Lance Taylor <iant@google.com>
16839
16840 * options.h (General_options): Add entries for '-Y' and
16841 '-relax'.
16842 * options.cc (General_options:finalize): If -Y was used, add those
16843 entries to the library path instead of the default "/lib" and
16844 "/usr/lib".
16845
7c98e6bb
DM
168462008-04-11 David S. Miller <davem@davemloft.net>
16847
16848 * testsuite/justsyms.t: Start at 0x100.
16849 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16850 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16851 long.
16852 * testsuite/script_test_2.cc: Adjust string and section length
16853 checks.
7c98e6bb 16854
99a37bfd
ILT
168552008-04-09 Ian Lance Taylor <iant@google.com>
16856
2cefc357
ILT
16857 PR gold/5996
16858 * script-sections.cc (Sections_element::allocate_to_segment): Add
16859 orphan parameter.
16860 (Output_section_definition::allocate_to_segment): Likewise.
16861 (Orphan_output_section::allocate_to_segment): Likewise.
16862 (Script_sections::attach_sections_using_phdrs_clause): Don't
16863 propagate non-PT_LOAD segments to orphan sections.
16864 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16865 readelf rather than objdump.
16866 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16867 .interp section and PT_INTERP segment are the same size.
16868 * testsuite/Makefile.in: Rebuild.
16869
99a37bfd
ILT
16870 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16871 aliases for symbols defined in the same object.
16872 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16873 (weak_alias_test_SOURCES): New variable.
16874 (weak_alias_test_DEPENDENCIES): New variable.
16875 (weak_alias_test_LDFLAGS): New variable.
16876 (weak_alias_test_LDADD): New variable.
16877 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16878 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16879 (weak_alias_test_3.o): New target.
16880 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16881 * testsuite/weak_alias_test_main.cc: New file.
16882 * testsuite/weak_alias_test_1.cc: New file.
16883 * testsuite/weak_alias_test_2.cc: New file.
16884 * testsuite/weak_alias_test_3.cc: New file.
16885
780e49c5
ILT
168862008-04-08 Ian Lance Taylor <iant@google.com>
16887
cdb0b8f5
ILT
16888 * options.h (class General_options): Add --noinhibit-exec option.
16889 * main.cc (main): Check --noinhibit-exec.
16890
0864d551
ILT
16891 * options.h (class General_options): Define --wrap as a special
16892 option. Add wrap_symbols_ field.
16893 (General_options::any_wrap_symbols): New function.
16894 (General_options::is_wrap_symbol): New function.
16895 * options.cc (General_options::parse_wrap): New function.
16896 (General_options::General_options): Initialize wrap_symbols_.
16897 * symtab.cc (Symbol_table::wrap_symbol): New function.
16898 (Symbol_table::add_from_object): Handle --wrap.
16899 * symtab.h (class Symbol_table): Declare wrap_symbol.
16900 * target.h (Target::wrap_char): New function.
16901 (Target::Target_info): Add wrap_char field.
16902 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16903 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16904 * testsuite/testfile.cc (Target_test::test_target_info):
16905 Likewise.
16906
789aa6de
ILT
16907 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16908 there is one.
16909
2c38906f
ILT
16910 * layout.h (class Layout): Add added_eh_frame_data_ field.
16911 * layout.cc (Layout::Layout): Initialize new field.
16912 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16913 output section until we find a section we merged successfully.
16914 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16915 that the size be non-zero.
16916
780e49c5
ILT
16917 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16918 qualifier.
16919
7fcd0256
ILT
169202008-04-08 Craig Silverstein <csilvers@google.com>
16921
16922 * configure.ac: Export new conditional variable HAVE_ZLIB.
16923 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16924 on HAVE_ZLIB.
16925 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16926 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16927
6835af53
ILT
169282008-04-07 Ian Lance Taylor <iant@google.com>
16929
e24f324c
ILT
16930 * version.cc (version_string): Set to "1.5".
16931
a036edd8
ILT
16932 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16933 Add issued_non_pic_error_ field. Declare check_non_pic.
16934 (Target_x86_64::Scan::check_non_pic): New function.
16935 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16936 (Target_x86_64::Scan::global): Likewise.
16937
624f8810
ILT
16938 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16939 addend parameter. Change caller. Handle merge sections.
16940 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16941 Address to Addend. Don't add in the result of
16942 local_section_offset, pass down the addend and use the returned
16943 value.
16944 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16945 Update declarations of local_section_offset and symbol_value.
16946 * testsuite/two_file_test_1.cc (t18): New function.
16947 * testsuite/two_file_test_2.cc (f18): New function.
16948 * testsuite/two_file_test_main.cc (main): Call t18.
16949 * testsuite/two_file_test.h (t18, f18): Declare.
16950
6835af53
ILT
16951 * configure.ac: Don't test for objdump, c++filt, or readelf.
16952 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16953 conditionals.
16954 (TEST_READELF): New variable.
16955 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16956 (check_PROGRAMS): Add two_file_strip_test.
16957 (two_file_strip_test): New target.
16958 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16959 (two_file_same_shared_strip_test_SOURCES): New variable.
16960 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16961 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16962 (two_file_same_shared_strip_test_LDADD): New variable.
16963 (two_file_shared_strip.so): New target.
16964 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16965 (ver_test_5.syms, ver_test_7.syms): Likewise.
16966 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16967 (strip_test_3.stdout): Use TEST_OBJDUMP.
16968 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16969
86925eef
CC
169702008-04-04 Cary Coutant <ccoutant@google.com>
16971
16972 * symtab.h (Symbol::is_weak_undefined): New function.
16973 (Symbol::is_strong_undefined): New function.
16974 (Symbol::is_absolute): New function.
16975 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16976 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16977 absolute symbols.
16978 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16979 (weak_undef_test): New target.
16980 * testsuite/Makefile.in: Rebuild.
16981 * testsuite/weak_undef_file1.cc: New file.
16982 * testsuite/weak_undef_file2.cc: New file.
16983 * testsuite/weak_undef_test.cc: New file.
16984
126f3ece
ILT
169852008-04-03 Craig Silverstein <csilvers@google.com>
16986
16987 * compressed_output.h (class Output_compressed_section): Use
16988 unsigned buffer.
16989 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16990 add zlib header.
16991 (zlib_compressed_suffix): Removed.
16992 (Output_compressed_section::set_final_data_size): Use unsigned
16993 buffers.
16994 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16995 Fix linker invocation.
16996 (flagstest_o_specialfile_and_compress_debug_sections):
16997 Likewise.
16998 * testsuite/Makefile.in: Regenerated.
16999
deae2a14
DM
170002008-04-02 David S. Miller <davem@davemloft.net>
17001
17002 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17003 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17004
70752818
ILT
170052008-04-02 Craig Silverstein <csilvers@google.com>
17006
17007 * TODO: New file.
17008
39d0cb0e
ILT
170092008-04-02 Ian Lance Taylor <iant@google.com>
17010
17011 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17012 parameters. Update for new key type to views_. Change all
17013 callers.
17014 (File_read::read): Adjust for byteshift in returned view.
17015 (File_read::add_view): New function, broken out of
17016 find_and_make_view.
17017 (File_read::make_view): New function, broken out of
17018 find_and_make_view.
17019 (File_read::find_or_make_view): Add offset and aligned
17020 parameters. Rewrite accordingly. Change all callers.
17021 (File_read::get_view): Add offset and aligned parameters. Adjust
17022 for byteshift in return value.
17023 (File_read::get_lasting_view): Likewise.
17024 * fileread.h (class File_read): Update declarations.
17025 (class File_read::View): Add byteshift_ field. Add byteshift to
17026 constructor. Add byteshift method.
17027 * archive.h (Archive::clear_uncached_views): New function.
17028 (Archive::get_view): Add aligned parameter. Change all callers.
17029 * object.h (Object::get_view): Add aligned parameter. Change all
17030 callers.
17031 (Object::get_lasting_view): Likewise.
17032
17033 * fileread.cc (File_read::release): Don't call clear_views if
17034 there are multiple objects.
17035 * fileread.h (File_read::clear_uncached_views): New function.
17036 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17037 on the archive.
17038
a1207466
CC
170392008-03-31 Cary Coutant <ccoutant@google.com>
17040
17041 Add thin archive support.
17042 * archive.cc (Archive::armagt): New const.
17043 (Archive::setup): Remove task parameter and calls to unlock.
17044 (Archive::unlock_nested_archives): New function.
17045 (Archive::read_header): Add nested_off parameter. Change
17046 all callers.
17047 (Archive::interpret_header): Likewise.
17048 (Archive::include_all_members): Change to handle thin
17049 archives.
17050 (Archive::include_member): Likewise.
17051 * archive.h (Archive::Archive): Add new parameters and
17052 initializers.
17053 (Archive::armagt): New const.
17054 (Archive::setup): Remove task parameter.
17055 (Archive::unlock_nested_archives): New function.
17056 (Archive::read_header): Add nested_off parameter.
17057 (Archive::interpret_header): Likewise.
17058 (Archive::Nested_archive_table): New typedef.
17059 (Archive::is_thin_archive_): New field.
17060 (Archive::nested_archives_): New field.
17061 (Archive::options_): New field.
17062 (Archive::dirpath_): New field.
17063 (Archive::task_): New field.
17064 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17065 for thin archives. Pass additional parameters to
17066 Archive::Archive. Unlock the archive file after calling
17067 Archive::setup.
cd536b21 17068
479f6503
ILT
170692008-03-29 Ian Lance Taylor <iant@google.com>
17070
686c8caf
ILT
17071 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17072 version symbol to be local.
17073 * testsuite/ver_test_4.sh: New file.
17074 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17075 (check_DATA): Add ver_test_4.syms.
17076 (ver_test_4.syms): New target.
17077 * testsuite/Makefile.in: Rebuild.
17078
ab794b6b
ILT
17079 * output.cc
17080 (Output_section::Input_section_sort_entry::has_priority): New
17081 function.
17082 (Output_section::Input_section_sort_entry::match_file_name): New
17083 function.
17084 (Output_section::Input_section_sort_entry::match_section_name):
17085 Remove.
17086 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17087 Remove.
17088 (Output_section::Input_section_sort_entry::match_section_file):
17089 Remove.
17090 (Output_section::Input_section_sort_compare::operator()): Rewrite
17091 using new Input_section_sort_entry functions. Sort crtbegin and
17092 crtend first. Sort sections with no priority before sections with
17093 a priority.
17094 * testsuite/initpri1.c (d3): Check j != 4.
17095 (cd5): New constructor/destructor function.
17096 (main): Check j != 2.
17097
479f6503
ILT
17098 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17099 new symbol when resolving, don't call set_is_default.
17100 * testsuite/ver_test_7.cc: New file.
17101 * testsuite/ver_test_7.sh: New file.
17102 * testsuite/Makefile.am (ver_test_7.so): New target.
17103 (ver_test_7.o): New target.
17104 (check_SCRIPTS): Add ver_test_7.sh.
17105 (check_DATA): Add ver_test_7.syms.
17106 (ver_test_7.syms): New target.
17107
2fd32231
ILT
171082008-03-28 Ian Lance Taylor <iant@google.com>
17109
17110 * layout.cc (Layout::layout): If we see an input section with a
17111 name that needs sorting, set the must_sort flag for the output
17112 section.
17113 (Layout::make_output_section): If the name of the output section
17114 indicates that it might require sorting, set the may_sort flag.
17115 * output.h (Output_section::may_sort_attached_input_sections): New
17116 function.
17117 (Output_section::set_may_sort_attached_input_sections): New
17118 function.
17119 (Output_section::must_sort_attached_input_sections): New
17120 function.
17121 (Output_section::set_must_sort_attached_input_sections): New
17122 function.
17123 (class Output_section): Declare Input_section_sort_entry. Define
17124 Input_section_sort_compare. Declare
17125 sort_attached_input_sections. Add new fields:
17126 may_sort_attached_input_sections_,
17127 must_sort_attached_input_sections_,
17128 attached_input_sections_are_sorted_.
17129 * output.cc (Output_section::Output_section): Initialize new
17130 fields.
17131 (Output_section::add_input_section): Add an entry to
17132 input_sections_ if may_sort or must_sort are true.
17133 (Output_section::set_final_data_size): Call
17134 sort_attached_input_sections if necessary.
17135 (Output_section::Input_section_sort_entry): Define new class.
17136 (Output_section::Input_section_sort_compare::operator()): New
17137 function.
17138 (Output_section::sort_attached_input_sections): New function.
17139 * configure.ac: Check whether the compiler supports constructor
17140 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17141 * testsuite/initpri1.c: New file.
17142 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17143 CONSTRUCTOR_PRIORITY.
17144 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17145 (initpri1_LDFLAGS): New variable.
17146 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17147
18e6b24e
ILT
171482008-03-27 Ian Lance Taylor <iant@google.com>
17149
49bdd526
ILT
17150 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17151 * testsuite/common_test_1.c: New file.
17152 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17153 (common_test_1_SOURCES): New variable.
17154 (common_test_1_DEPENDENCIES): New variable.
17155 (common_test_1_LDFLAGS): New variable.
17156
18e6b24e
ILT
17157 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17158 and commons_ correctly when NAME/VERSION does not override
17159 NAME/NULL.
17160 * testsuite/ver_test_6.c: New file.
17161 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17162 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17163 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17164
04bf7072
ILT
171652008-03-26 Ian Lance Taylor <iant@google.com>
17166
5871526f
ILT
17167 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17168 of an undefined symbol from a version script.
17169 * testsuite/Makefile.am (ver_test_5.so): New target.
17170 (ver_test_5.o): New target.
17171 (check_SCRIPTS): Add ver_test_5.sh.
17172 (check_DATA): Add ver_test_5.syms.
17173 (ver_test_5.syms): New target.
17174 * testsuite/ver_test_5.cc: New file.
17175 * testsuite/ver_test_5.script: New file.
17176 * testsuite/ver_test_5.sh: New file.
17177 * Makefile.in, testsuite/Makefile.in: Rebuild.
17178
04bf7072
ILT
17179 PR gold/5986
17180 Fix problems building gold with gcc 4.3.0.
17181 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17182 (gold_error_at_location, gold_warning_at_location): Use it.
17183 * configure.ac: Check whether we can compile and use a template
17184 function with a printf attribute.
17185 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17186 when jumping over bytes.
17187 * object.cc: Instantiate Object::read_section_data.
17188 * debug.h: Include <cstring>
17189 * dwarf_reader.cc: Include <algorithm>
17190 * main.cc: Include <cstring>.
17191 * options.cc: Include <cstring>.
17192 * output.cc: Include <cstring>.
17193 * script.cc: Include <cstring>.
17194 * script.h: Include <string>.
17195 * symtab.cc: Include <cstring> and <algorithm>.
17196 * target-select.cc: Include <cstring>.
17197 * version.cc: Include <string>.
17198 * testsuite/testmain.cc: Include <cstdlib>.
17199 * configure, config.in: Rebuild.
17200
874c5b28
ILT
172012008-03-25 Ian Lance Taylor <iant@google.com>
17202
819d6c3a
ILT
17203 * options.cc: Include "../bfd/bfdver.h".
17204 (options::help): Print bug reporting address.
17205
f4b2c6f5
ILT
17206 * version.cc (print_version): Adjust output for current value of
17207 BFD_VERSION_STRING.
17208
17209 * NEWS: New file.
17210
e96caa79
ILT
17211 * options.cc (options::help): Print list of supported targets.
17212 * target-select.h: Include <vector>.
17213 (class Target_selector): Make machine_, size_, and is_big_endian_
17214 fields const. Add bfd_name_ and instantiated_target_ fields.
17215 (Target_selector::Target_selector): Add bfd_name parameter.
17216 (Target_selector::recognize): Make non-virtual, call
17217 do_recognize.
17218 (Target_selector::recognize_by_name): Make non-virtual, call
17219 do_recognize_by_name.
17220 (Target_selector::supported_names): New function.
17221 (Target_selector::bfd_name): New function.
17222 (Target_selector::do_instantiate_target): New pure virtual
17223 function.
17224 (Target_selector::do_recognize): New virtual function.
17225 (Target_selector::do_recognize_by_name): New virtual function.
17226 (Target_selector::instantiate_target): New private function.
17227 (supported_target_names): Declare.
17228 * target-select.cc (Target_selector::Target_selector): Update for
17229 new parameter and fields.
17230 (select_target_by_name): Check that the name matches before
17231 calling recognize_by_name.
17232 (supported_target_names): New function.
17233 * i386.cc (class Target_selector_i386): Update Target_selector
17234 constructor call. Remove recognize and recognize_by_name. Add
17235 do_instantiate_target.
17236 * x86_64.cc (class Target_selector_x86_64): Likewise.
17237 * testsuite/testfile.cc (class Target_selector_test): Update for
17238 changes to Target_selector.
17239
874c5b28
ILT
17240 * README: Rewrite, with some notes on unsupported features.
17241
0a65a3a7
CC
172422008-03-24 Cary Coutant <ccoutant@google.com>
17243
17244 * i386.cc (Target_i386::Got_type): New enum declaration.
17245 (Target_i386::Scan::local): Updated callers of Output_data_got
17246 member functions.
17247 (Target_i386::Scan::global): Likewise.
17248 (Target_i386::Relocate::relocate): Likewise.
17249 (Target_i386::Relocate::relocate_tls): Likewise.
17250 * object.h (Got_offset_list): New class.
17251 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17252 (Sized_relobj::local_got_offset): Likewise.
17253 (Sized_relobj::set_local_got_offset): Likewise.
17254 (Sized_relobj::local_has_tls_got_offset): Removed.
17255 (Sized_relobj::local_tls_got_offset): Removed.
17256 (Sized_relobj::set_local_tls_got_offset): Removed.
17257 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17258 * output.cc (Output_data_got::add_global): Added got_type parameter.
17259 (Output_data_got::add_global_with_rel): Likewise.
17260 (Output_data_got::add_global_with_rela): Likewise.
17261 (Output_data_got::add_global_pair_with_rel): New function.
17262 (Output_data_got::add_global_pair_with_rela): New function.
17263 (Output_data_got::add_local): Added got_type parameter.
17264 (Output_data_got::add_local_with_rel): Likewise.
17265 (Output_data_got::add_local_with_rela): Likewise.
17266 (Output_data_got::add_local_pair_with_rel): New function.
17267 (Output_data_got::add_local_pair_with_rela): New function.
17268 (Output_data_got::add_global_tls): Removed.
17269 (Output_data_got::add_global_tls_with_rel): Removed.
17270 (Output_data_got::add_global_tls_with_rela): Removed.
17271 (Output_data_got::add_local_tls): Removed.
17272 (Output_data_got::add_local_tls_with_rel): Removed.
17273 (Output_data_got::add_local_tls_with_rela): Removed.
17274 * output.h (Output_data_got::add_global): Added got_type parameter.
17275 (Output_data_got::add_global_with_rel): Likewise.
17276 (Output_data_got::add_global_with_rela): Likewise.
17277 (Output_data_got::add_global_pair_with_rel): New function.
17278 (Output_data_got::add_global_pair_with_rela): New function.
17279 (Output_data_got::add_local): Added got_type parameter.
17280 (Output_data_got::add_local_with_rel): Likewise.
17281 (Output_data_got::add_local_with_rela): Likewise.
17282 (Output_data_got::add_local_pair_with_rel): New function.
17283 (Output_data_got::add_local_pair_with_rela): New function.
17284 (Output_data_got::add_global_tls): Removed.
17285 (Output_data_got::add_global_tls_with_rel): Removed.
17286 (Output_data_got::add_global_tls_with_rela): Removed.
17287 (Output_data_got::add_local_tls): Removed.
17288 (Output_data_got::add_local_tls_with_rel): Removed.
17289 (Output_data_got::add_local_tls_with_rela): Removed.
17290 * resolve.cc (Symbol::override_base_with_special): Removed
17291 reference to has_got_offset_ field.
17292 * symtab.cc (Symbol::init_fields): Replaced initialization
17293 of got_offset_ with got_offsets_. Removed initialization
17294 of has_got_offset_
53fcba31 17295 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17296 (Symbol::got_offset): Likewise.
17297 (Symbol::set_got_offset): Likewise.
17298 (Symbol::has_tls_got_offset): Removed.
17299 (Symbol::tls_got_offset): Removed.
17300 (Symbol::set_tls_got_offset): Removed.
17301 (Symbol::got_offset_): Removed.
17302 (Symbol::tls_mod_got_offset_): Removed.
17303 (Symbol::tls_pair_got_offset_): Removed.
17304 (Symbol::got_offsets_): New field.
17305 (Symbol::has_got_offset): Removed.
17306 (Symbol::has_tls_mod_got_offset): Removed.
17307 (Symbol::has_tls_pair_got_offset): Removed.
17308 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17309 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17310 member functions.
17311 (Target_x86_64::Scan::global): Likewise.
17312 (Target_x86_64::Relocate::relocate): Likewise.
17313 (Target_x86_64::Relocate::relocate_tls): Likewise.
17314
bd52eafb
BE
173152008-03-25 Ben Elliston <bje@au.ibm.com>
17316
17317 * yyscript.y: Fix spelling error in comment.
17318
8b105e34
ILT
173192008-03-24 Ian Lance Taylor <iant@google.com>
17320
8ed814a9
ILT
17321 * options.h (class General_options): Define build_id option.
17322 * layout.h (class Layout): Declare write_build_id, create_note,
17323 create_build_id. Add build_id_note_ member.
17324 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17325 "libiberty.h", "md5.h", "sha1.h".
17326 (Layout::Layout): Initialize eh_frame_data_,
17327 eh_frame_hdr_section_, and build_id_note_.
17328 (Layout::finalize): Call create_build_id.
17329 (Layout::create_note): New function, broken out of
17330 Layout::create_gold_note.
17331 (Layout::create_gold_note): Call create_note.
17332 (Layout::create_build_id): New function.
17333 (Layout::write_build_id): New function.
17334 (Close_task_runner::run): Call write_build_id.
17335
8b105e34
ILT
17336 * x86_64.cc: Correct license to GPLv3.
17337
086a1841
ILT
173382008-03-23 Ian Lance Taylor <iant@google.com>
17339
17340 * options.cc: Include "demangle.h".
17341 (parse_optional_string): New function.
17342 (parse_long_option): Handle takes_optional_argument.
17343 (parse_short_option): Update dash_z initializer. Handle
17344 takes_optional_argument.
17345 (General_options::General_options): Initialize do_demangle_.
17346 (General_options::finalize): Set do_demangle_. Handle demangling
17347 style.
17348 * options.h (parse_optional_string): Declare.
17349 (struct One_option): Add optional_arg field. Update constructor.
17350 Update call constructor calls. Add takes_optional_argument
17351 function.
17352 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17353 (DEFINE_optional_string): Define.
17354 (General_options::demangle): Change from DEFINE_bool to
17355 DEFINE_optional_string.
17356 (General_options::no_demangle): New function.
17357 (General_options::do_demangle): New function.
17358 (General_options::set_do_demangle): New function.
17359 (General_options::execstack_status_): Move definition to end of
17360 class definition.
17361 (General_options::static_): Likewise.
17362 (General_options::do_demangle_): New field.
17363 * object.cc (big_endian>::get_symbol_location_info): Call
17364 Options::do_demangle, not Options::demangle.
17365 * symtab.cc (demangle): Likewise.
17366
cbb93e63
ILT
173672008-03-22 Ian Lance Taylor <iant@google.com>
17368
17369 * gold.h: Include <cstddef> and <sys/types.h>
17370 * options.h: Include <cstring>.
17371
ec531623
ILT
173722008-03-21 Ian Lance Taylor <iant@google.com>
17373
17374 * Added source code to GNU binutils.
752937aa 17375\f
b90efa5b 17376Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17377
17378Copying and distribution of this file, with or without modification,
17379are permitted in any medium without royalty provided the copyright
17380notice and this notice are preserved.
17381
17382Local Variables:
17383mode: change-log
17384left-margin: 8
17385fill-column: 74
17386version-control: never
17387End:
This page took 1.266774 seconds and 4 git commands to generate.