Fix RX GAS handling of integer bignums.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b8cf5075
CC
12015-06-07 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/18288
4 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
5 callers. Don't use STT_COMMON to check for common symbols.
6 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
7 symbol that's not in a common section.
8 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
9 common symbols.
10
bdd2d2b7
CC
112015-06-04 Cary Coutant <ccoutant@gmail.com>
12
13 PR gold/18200
14 * Makefile.am (diststuff): Add target.
15 * Makefile.in: Regenerate.
16
cd3c333f
CC
172015-06-04 Cary Coutant <ccoutant@gmail.com>
18
19 PR gold/17498
20 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
21 temporary locals in merge sections.
22 * options.cc (General_options::parse_discard_all): New method.
23 (General_options::parse_discard_locals): New method.
24 (General_options::parse_discard_none): New method.
25 (General_options::General_options): Initialize discard_locals_.
26 * options.h (--discard-all): Convert to special option.
27 (--discard-locals): Likewise.
28 (--discard-none): New option.
29 (General_options::discard_all): New method.
30 (General_options::discard_locals): New method.
31 (General_options::discard_sec_merge): New method.
32 (General_options::Discard_locals): New enum.
33 (General_options::discard_locals_): New data member.
34
8086551f
CC
352015-06-03 Cary Coutant <cary@google.com>
36
37 * script-sections.cc (Script_sections::Script_sections): Initialize
38 segments_created_.
39 (Script_sections::create_note_and_tls_segments): Set flag when
40 segments are created.
41 (Script_sections::expected_segment_count): Count PT_INTERP.
42 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
43 segments are created.
44 * script-sections.h (Script_sections::segments_created_): New data
45 member.
46
374082df
CC
472015-06-03 Cary Coutant <ccoutant@gmail.com>
48
49 PR gold/15370
50 * script-sections.cc
51 (Output_section_element_input::set_section_addresses): When there
52 are several patterns with no sort spec, put all sections in the same
53 bin.
54 * testsuite/Makefile.am (script_test_12): New testcase.
55 (script_test_12i): New testcase.
56 * testsuite/Makefile.in: Regenerate.
57 * testsuite/script_test_12.t: New test linker script.
58 * testsuite/script_test_12i.t: New test linker script.
59 * testsuite/script_test_12a.c: New test source file.
60 * testsuite/script_test_12b.c: New test source file.
61
775ed62e
CC
622015-06-02 Cary Coutant <ccoutant@gmail.com>
63
64 * nacl.h (Sniff_file): Switch parameters to get_view to get an
65 aligned view.
66
9c7fe3c5
CC
672015-06-03 Cary Coutant <ccoutant@gmail.com>
68
69 PR gold/17819
70 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
71 separate task to schedule the build id computation.
72 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
73 add Output_file and offset.
74 (Hash_task::run): Get and release the input views.
75 (Hash_task::is_runnable): Always return NULL (always runnable).
76 (Layout::queue_build_id_tasks): Remove.
77 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
78 parameters; use them instead of class members.
79 (Build_id_task_runner::run): New function.
80 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
81 to write_build_id.
82 * layout.h (Layout::queue_build_id_tasks): Remove.
83 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
84 parameters.
85 (Layout::array_of_hashes_): Remove.
86 (Layout::size_of_array_of_hashes_): Remove.
87 (Layout::input_view_): Remove.
88 (Build_id_task_runner): New class.
89 (Close_task_runner::Close_task_runner): Add array_of_hashes and
90 size_of_hashes parameters.
91 (Close_task_runner::array_of_hashes_): New data member.
92 (Close_task_runner::size_of_hashes_): New data member.
93 * testsuite/Makefile.am
94 (flagstest_compress_debug_sections_and_build_id_tree): New test.
95 * testsuite/Makefile.in: Regenerate.
96
400f8944
RÁE
972015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
98
99 * merge.cc (get_input_merge_map): Update for data structure change.
100 (get_or_make_input_merge_map): Update for data structure change.
101 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
102 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
103
bbec1a5d
AM
1042015-05-16 Alan Modra <amodra@gmail.com>
105
106 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
107 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
108 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
109 (lis_0): Rename from lis_0_0.
110
efc6fa12
CC
1112015-04-29 Cary Coutant <cary@google.com>
112 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
113
114 * gc.h (Garbage_collection::is_section_garbage): Change Object*
115 to Relobj*.
116 (Garbage_collection::add_reference): Likewise.
117 (Garbage_collection::gc_process_relocs): Likewise. Don't push
118 object/shndx pair onto *secvec for dynamic objects. Don't follow
119 relocations pointing to dynamic objects for GC.
120 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
121 (Icf::unfold_section): Likewise.
122 (Icf::is_section_folded): Likewise.
123 (Icf::get_folded_section): Likewise.
124 * icf.h: (Icf::get_folded_section): Likewise.
125 (Icf::unfold_section): Likewise.
126 (Icf::is_section_folded): Likewise.
127 (Icf::section_has_function_pointers): Likewise.
128 (Icf::set_section_has_function_pointers): Likewise.
129 * object.h (Section_id): Likewise.
130 (Const_section_id): Likewise.
131 * output.cc (Output_section::update_section_layout): Likewise.
132 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
133 Likewise.
134 * plugin.cc (update_section_order): Likewise.
135 (unique_segment_for_sections): Likewise.
136 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
137 (Target_powerpc::do_gc_add_reference): Likewise.
138 (Target_powerpc::gc_process_relocs): Likewise.
139 (Target_powerpc::do_gc_add_reference): Likewise.
140 * symtab.cc (Symbol_table::is_section_folded): Likewise.
141 (Symbol_table::gc_mark_symbol): Likewise.
142 * symtab.h: (Symbol_table::is_section_folded): Likewise.
143 * target.h: (Sized_target::gc_add_reference): Likewise.
144 (Sized_target::do_gc_add_reference): Likewise.
145
f9d3ecaa
NC
1462015-04-29 Nick Clifton <nickc@redhat.com>
147
148 * po/fi.po: Updated Finnish translation.
149
faa2211d
AM
1502015-04-28 Alan Modra <amodra@gmail.com>
151
152 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
153 than unsigned int for find_global_entry result temp. Compare
154 against invalid_address.
155 (Target_powerpc::do_plt_address_for_global): Likewise.
156 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
157 on plt call stub existence for debug info. Do assert for plt
158 and global entry stub existence if an alloc section.
159
6ec65f28
AM
1602015-04-28 Alan Modra <amodra@gmail.com>
161
162 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
163 on missing global entry stub due to bogus debug info.
164
7a2a1c79
HS
1652015-04-27 Han Shen <shenhan@google.com>
166
167 * options.h (--fix-cortex-a53-843419): Rename option.
168 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
169 option.
170 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
171
cfbf0e3c
RÁE
1722015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
173
174 PR gold/18327
175 * output.cc (Output_section::is_input_address_mapped): Assume a missing
176 entry is mapped.
177 * testsuite/Makefile.am: Add the eh_test test.
178 * testsuite/Makefile.in: Regenerate.
179 * testsuite/eh_test_a.cc: New test.
180 * testsuite/eh_test_b.cc: New test.
181
6ec65f28
AM
1822015-04-23 Sriraman Tallam <tmsriram@google.com>
183
a100d66f
ST
184 * options.h (--weak-unresolved-symbols): New option.
185 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
186 binding to weak with new option.
187 * symtab.h (is_weak_undefined): Check for new option.
188 (is_strong_undefined): Check for new option.
189 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
190 * testsuite/Makefile.in: Regenerate.
191 * testsuite/weak_unresolved_symbols_test.cc: New file.
192
4b889c30
IC
1932015-04-20 Ian Coolidge <icoolidge@google.com>
194
195 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
196 GNU_UNIQUE.
197
4277535c
RÁE
1982015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
199
200 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
201 push_back.
202 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
203 * object.cc (Sized_relobj_file::do_layout): Use push_back.
204 * powerpc.cc (process_gc_mark): Use push_back.
205 (Target_powerpc::do_gc_mark_symbol): Use push_back.
206 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
207
7a2a1c79 2082015-04-16 Han Shen <shenhan@google.com>
5019d64a 209
6ec65f28
AM
210 * aarch64.cc (AArch64_insn_utilities): New utility class.
211 (AArch64_relobj::Mapping_symbol_position): New struct.
212 (AArch64_relobj::Mapping_symbol_info): New typedef.
213 (AArch64_relobj::do_count_local_symbols): New function overriding
214 parent's implementation.
215 (AArch64_relobj::mapping_symbol_info_): New member
216 (AArch64_relobj::scan_erratum_843419): New method.
217 (Target_aarch64::scan_erratum_843419_span): New method.
218 (Target_aarch64::is_erratum_843419_sequence): New method.
219 * options.h (fix_cortex_a53): New option.
5019d64a 220
a6a17750
CC
2212015-04-09 Cary Coutant <ccoutant@google.com>
222
223 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
224 in a PIE link.
225 * testsuite/Makefile.am (tls_pie_test.sh): New test.
226 * testsuite/Makefile.in: Regenerate.
227 * testsuite/tls_pie_test.sh: New.
228
437ddf0c
CC
2292015-04-09 Cary Coutant <ccoutant@google.com>
230
231 * debug.h (DEBUG_LOCATION): New.
232 (DEBUG_ALL): Include DEBUG_LOCATION.
233 (debug_string_to_enum): Add DEBUG_LOCATION.
234 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
235 output to print correct context.
236 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
237 up to 4 more locations at the beginning of the function.
238 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
239 result before sorting list of line numbers.
240 * testsuite/debug_msg.sh: Allow range of line numbers for
241 canonical results on optimized code.
242
24491327
HS
2432015-04-07 HC Yen <hc.yen@mediatek.com>
244
245 Add AArch32 support for gold linker.
246 gold/
247 * arm.cc: Add V8 arch combine table.
248
7fa5525f
RÁE
2492015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
250
251 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
252
5368dcf2
RÁE
2532015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
254
255 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
256 to find by using the return value of insert.
257
9dbb4b02
RÁE
2582015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
259
260 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
261 constructor call.
262
1fa29f10
IT
2632015-04-06 Ilya Tocar <ilya.tocar@intel.com>
264
265 PR gold/17641
266 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
267 (Target_x86_64::Scan::local): Don't create GOT entry, when we
268 can convert mov to lea.
269 (Target_x86_64::Scan::global): Ditto.
270 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
271 %reg to lea foo(%rip), %reg if possible.
272 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
273 * testsuite/x86_64_mov_to_lea1.s: New.
274 * testsuite/x86_64_mov_to_lea2.s: Ditto.
275 * testsuite/x86_64_mov_to_lea3.s: Ditto.
276 * testsuite/x86_64_mov_to_lea4.s: Ditto.
277 * testsuite/x86_64_mov_to_lea.sh: Ditto.
278
39f3de7c
L
2792015-04-02 H.J. Lu <hongjiu.lu@intel.com>
280
281 * configure: Regenerated.
282
c4fc4724
IT
2832015-04-01 Ilya Tocar <ilya.tocar@intel.com>
284
285 PR gold/17640
286 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
287 (Target_i386::Scan::local): Don't create GOT entry, when we
288 can convert GOT to GOTOFF.
289 (Target_i386::Scan::global): Ditto.
290 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
291 lea foo@GOTOFF(%reg), %reg if possible.
292 * testsuite/Makefile.am (i386_mov_to_lea): New test.
293 * testsuite/i386_mov_to_lea1.s: New.
294 * testsuite/i386_mov_to_lea2.s: Ditto.
295 * testsuite/i386_mov_to_lea3.s: Ditto.
296 * testsuite/i386_mov_to_lea4.s: Ditto.
297 * testsuite/i386_mov_to_lea5.s: Ditto.
298 * testsuite/i386_mov_to_lea.sh: Ditto.
299
918357b9
L
3002015-04-01 H.J. Lu <hongjiu.lu@intel.com>
301
302 * Makefile.am (ZLIB): New.
303 (ZLIBINC): Likewise.
304 (AM_CFLAGS): Add $(ZLIBINC).
305 (AM_CXXFLAGS): Likewise.
306 (ldadd_varldadd_var): Add $(ZLIB).
307 (incremental_dump_LDADD): Likewise.
308 (dwp_LDADD): Likewise.
309 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
310 <zlib.h>.
311 (zlib_compress): Don't check HAVE_ZLIB_H.
312 (zlib_decompress): Likewise.
313 * options.h (compress_debug_sections): Likewise.
314 * configure.ac (AM_CONDITIONAL): Removed.
315 * testsuite/Makefile.am (ZLIB): New.
316 (LDADD): Add $(ZLIB).
317 Don't check HAVE_ZLIB.
318 * Makefile.in: Regenerated.
319 * config.in: Likewise.
320 * configure: Likewise.
321 * testsuite/Makefile.in: Likewise.
322
6b0ad2eb
JY
3232015-03-30 Jing Yu <jingyu@google.com>
324
325 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
326 TLSLD_ADD_DTPREL_LO12_NC.
327 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
328 _TLS_MODULE_BASE_ point to the start of tls segment.
329 (Target_aarch64::optimize_tls_reloc): Add cases for
330 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
331 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
332 (Target_aarch64::Scan::local): Likewise.
333 (Target_aarch64::Scan::global): Likewise.
334 (Target_aarch64::Relocate::relocate): Likewise.
335 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
336 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
337 relocations.
338
0916f9e7
RÁE
3392015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
340
341 * merge.cc (Object_merge_map::add_mapping): call
342 Object_merge_map::Input_merge_map::add_mapping.
343 (Object_merge_map::Input_merge_map::add_mapping): New.
344 (Output_merge_data::do_add_input_section): Call
345 get_or_make_input_merge_map before a loop.
346 (Output_merge_string<Char_type>::finalize_merged_data): Call
347 get_or_make_input_merge_map before a loop.
348 * merge.h (Object_merge_map): Make Input_merge_map public.
349 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
350 (Relobj::get_or_create_merge_map): New.
351 * object.h (Relobj::get_or_create_merge_map): New.
352
282c9750
AM
3532015-03-24 Alan Modra <amodra@gmail.com>
354
355 PR 18147
356 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
357 relocation errors for branches to strong undefined symbols.
358
67f95b96
RÁE
3592015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
360
361 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
362 (Object_merge_map::is_merge_section_for): Remove.
363 (Object_merge_map::find_merge_section): New.
364 * merge.h (Object_merge_map::is_merge_section_for): Remove.
365 (Object_merge_map::find_merge_section): New.
366 (Object_merge_map::get_input_merge_map): Add a const version.
367 * object.cc (Relobj::is_merge_section_for): Remove.
368 (Relobj::find_merge_section): New.
369 * object.h (Relobj::is_merge_section_for): Remove.
370 (Relobj::find_merge_section): New.
371 * output.cc
372 (Output_section::Input_section::is_merge_section_for): Remove.
373 (Output_section::add_merge_input_section): Don't call
374 add_merge_input_section.
375 (Output_section::find_merge_section): Return const. Use
376 object->find_merge_section.
377 (Output_section::build_lookup_maps): Don't build a map for
378 merge sections.
379 (Output_section::is_input_address_mapped): Return false if
380 section is not found.
381 (Output_section::find_starting_output_address): Use
382 find_merge_section instead of is_merge_section_for.
383 (Output_section::add_script_input_section): Don't build a map for
384 merge sections.
385 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
386 (Output_section_lookup_maps::find_merge_section): Remove.
387 (Output_section_lookup_maps::add_merge_input_section) Remove.
388 (Output_section::find_merge_section): Return const.
389
152f7024
CC
3902015-03-22 Cary Coutant <cary@google.com>
391
392 PR gold/18106
393 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
394 non-SIB form of lea, with nop after the call.
395
bccffdfd
CC
3962015-03-21 Cary Coutant <cary@google.com>
397
398 PR gold/14217
399 * output.cc (Output_segment::is_first_section_relro): Don't ignore
400 .tdata section.
401 (Output_segment::set_section_addresses): Don't align size of relro
402 segment for .tbss.
403
1c582fe7
CC
4042015-03-21 Cary Coutant <cary@google.com>
405
406 PR gold/18010
407 * stringpool.cc (Stringpool_template): Don't optimize if section
408 alignment is greater than sizeof(char).
409
410da591
CC
4102015-03-21 Cary Coutant <cary@google.com>
411
412 PR gold/18048
413 * script-c.h (script_include_directive): Add first_token parameter.
414 * script.cc (script_include_directive): Add first_token parameter, and
415 pass it to read_script_file.
416 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
417 (PARSING_MEMORY_DEF): New tokens.
418 (top): Add new productions for INCLUDE files.
419 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
420 Pass PARSING_LINKER_SCRIPT to script_include_directive.
421 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
422 (section_cmd): Pass PARSING_SECTION_CMDS.
423 (file_or_sections_cmd): Remove.
424 (memory_def): Pass PARSING_MEMORY_DEF.
425 * testsuite/Makefile.am (memory_test_2): New test.
426 * testsuite/Makefile.in: Regenerate.
427 * testsuite/memory_test_inc.t: New script file.
428 * testsuite/memory_test_inc_1.t.src: New script file.
429 * testsuite/memory_test_inc_2.t.src: New script file.
430 * testsuite/memory_test_inc_3.t.src: New script file.
431
0d5bbdb0
CC
4322015-03-21 Cary Coutant <cary@google.com>
433
434 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
435 (Sized_relobj_dwo::setup): Build compressed section map.
436 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
437 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
438 section map.
439 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
440 compressed_sections_ field.
441 (build_compressed_section_map): Take Object instead of
442 Sized_relobj_file parameter; add decompress_if_needed parameter.
443 (Sized_relobj_file::do_find_special_sections): Store compressed
444 section map in parent Object.
445 (Sized_relobj_file::do_decompressed_section_contents): Move
446 implementation to Object::decompressed_section_contents.
447 (Sized_relobj_file::do_discard_decompressed_sections): Move
448 implementation to Object::discard_decompressed_sections.
449 * object.h (build_compressed_section_map): Declare.
450 (Object::Object): Add compressed_sections_ field.
451 (Object::section_is_compressed): Move implementation here.
452 (Object::decompressed_section_contents): De-virtualize.
453 (Object::discard_decompressed_sections): De-virtualize.
454 (Object::do_section_is_compressed): Delete.
455 (Object::do_decompressed_section_contents): Delete.
456 (Object::set_compressed_sections): New method.
457 (Object::compressed_sections): New method.
458 (Object::compressed_sections_): New data member.
459 (Compressed_section_info, Compressed_section_map): Move to top of file.
460 (Sized_relobj_file::do_section_is_compressed): Delete.
461 (Sized_relobj_file::do_decompressed_section_contents): Delete.
462 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
463 (Sized_relobj_file::compressed_sections_): Move to Object class.
464
bd9e0d46
CC
4652015-03-21 Cary Coutant <ccoutant@google.com>
466
467 PR gold/18152
468 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
469 deferred objects.
470
943c8b43
CC
4712015-03-11 Cary Coutant <ccoutant@google.com>
472
473 * options.cc (General_options::finalize): Don't allow -z relro
474 with incremental linking.
475 * testsuite/Makefile.am (incremental_test): Add -z norelro.
476 (incremental_test_2): Likewise.
477 (incremental_test_3): Likewise.
478 (incremental_test_4): Likewise.
479 (incremental_test_5): Likewise.
480 (incremental_test_6): Likewise.
481 (incremental_copy_test): Likewise.
482 (incremental_common_test_1): Likewise.
483 (incremental_comdat_test_1): Likewise.
484 * testsuite/Makefile.in: Regenerate.
485
e1663197
CC
4862015-03-09 Cary Coutant <ccoutant@google.com>
487
488 PR gold/14675
489 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
490 return enum indicating whether .eh_frame section is empty, optimizable,
491 unrecognized, or an end marker. Adjust explicit instantiations.
492 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
493 (Eh_frame::add_ehframe_input_section): Change return type.
494 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
495 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
496 to the .eh_frame output section until we see the end marker.
497 (Layout::finalize_eh_frame_section): New.
498 * layout.h: (Layout::finalize_eh_frame_section): New.
499
beb8418f
L
5002015-03-05 H.J. Lu <hongjiu.lu@intel.com>
501
502 * output.cc (Relobj::initialize_input_to_output_map<size>):
503 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
504
48c73428
CC
5052015-03-04 Cary Coutant <ccoutant@google.com>
506
507 * parameters.cc (Parameters::set_target_once): Call
508 Target::select_as_default_target just once from here...
509 (set_parameters_target): ...instead of from here.
510
5112015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
512
513 * ehframe.cc (Cie::set_output_offset): Pass in and use a
514 Output_section_data instead of a Merge_map.
515 (Eh_frame::Eh_frame): Don't initialize merge_map_.
516 (Eh_frame::read_cie): Use add_merge_mapping instead of
517 Merge_map::add_mapping.
518 (Eh_frame::read_fde): Ditto.
519 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
520 (Eh_frame::do_output_offset): Use merge_output_offset istead of
521 merge_map_->get_output_offset.
522 (Eh_frame::do_is_merge_section_for): Delete.
523 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
524 instead of a Merge_map.
525 (Cie::set_output_offset): Pass in a Output_section_data instead of a
526 Merge_map.
527 (Eh_frame::do_is_merge_section_for): Delete.
528 (Eh_frame::merge_map_): Delete.
529 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
530 and use a Output_section_data instead of a Merge_map.
531 (Object_merge_map::add_mapping): Ditto.
532 (Object_merge_map::get_output_offset): Remove the merge_map argument.
533 (Object_merge_map::is_merge_section_for): Pass in and use a
534 Output_section_data instead of a Merge_map.
535 (Merge_map): Delete.
536 (Output_merge_base::do_output_offset): Use merge_output_offset instead
537 of merge_map_.get_output_offset.
538 (Output_merge_base::do_is_merge_section_for): Delete.
539 (Output_merge_data::do_add_input_section): Use
540 object->add_merge_mapping instead of add_mapping.
541 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
542 * merge.h (Merge_map): Delete forward declaration.
543 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
544 instead of a Merge_map.
545 (Object_merge_map::get_output_offset): Remove the merge_map argument.
546 (Object_merge_map::is_merge_section_for): Pass in and use a
547 Output_section_data instead of a Merge_map.
548 (Input_merge_map::Object_merge_map::merge_map): Replace with
549 output_data.
550 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
551 Output_section_data instead of a Merge_map.
552 (Merge_map): Delete.
553 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
554 (Output_merge_base::do_is_merge_section_for): Delete.
555 (Output_merge_base::add_mapping): Delete.
556 (Output_merge_base::merge_map_): Delete.
557 * object.cc (Relobj::initialize_input_to_output_map): New.
558 (Relobj::initialize_input_to_output_map): New.
559 (Relobj::merge_output_offset): New.
560 (Relobj::is_merge_section_for): New.
561 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
562 bits.
563 * object.h (Relobj::merge_map): Delete.
564 (initialize_input_to_output_map): New.
565 (set_merge_map): Delete.
566 (add_merge_mapping): New.
567 (merge_output_offset): New.
568 (is_merge_section_for): New.
569 * output.cc (Output_section::Input_section::is_merge_section_for):
570 Use object->is_merge_section_for.
571 * output.h (Output_section_data::is_merge_section_for): Delete.
572 (Output_section_data::do_is_merge_section_for): Delete.
573 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
574 Use object->initialize_input_to_output_map.
575 (Merged_symbol_value<size>::value_from_output_section): Use
576 object->merge_output_offset.
577
48c73428 5782015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
579 Cary Coutant <ccoutant@google.com>
580
581 * output.cc (Output_section::add_merge_input_section): Do not
582 attempt to merge sections with an entsize of 0.
583
48c73428 5842015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
585
586 * attributes.h (class Output_attributes_section_data ): Add
587 do_print_to_mapfile function.
588
ec86f434
AM
5892015-02-24 Alan Modra <amodra@gmail.com>
590
591 PR 18010
592 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
593 complain if value is not a multiple of four.
594 (Target_powerpc::Relocate::relocate): Correct handling of
595 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
596
be66981e
L
5972015-02-21 H.J. Lu <hongjiu.lu@intel.com>
598
599 * configure.ac (default_size): Set to 32 for x32.
600 * configure: Regenerated.
601
e3ee8ed4
AM
6022015-02-18 Alan Modra <amodra@gmail.com>
603
604 PR 17954
605 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
606 visibility.
607
3a935c6c
RÁE
6082015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
609
610 * gc.h (Garbage_collection::add_reference): Don't use find.
611
e0a1e121
RÁE
6122015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
613
614 * object.cc (write_local_symbols): avoid std::vector copy.
615
45a4fb1a
RÁE
6162015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
617
618 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
619
2d9afefe
MW
6202015-02-09 Mark Wielaard <mjw@redhat.com>
621
622 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
623 DW_LANG_Fortran03 and DW_LANG_Fortran08.
624
e9c1bdad
CC
6252015-02-16 Cary Coutant <ccoutant@google.com>
626
627 PR gold/13577
628 PR gold/16992
629 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
630 DF_SYMBOLIC if --dynamic-list option is used.
631 * options.cc (General_options::finalize): --dynamic-list is not
632 mutually exclusive with -Bsymbolic.
633 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
634 listed in --dynamic-list.
635 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
636 -Bsymbolic-functions.
637 * testsuite/Makefile.in: Regenerate.
638
0ed4b0bf
CC
6392015-02-16 Cary Coutant <ccoutant@google.com>
640
641 PR gold/17971
642 * incremental.cc: Remove redundant include of "output.h".
643
1a920511
JY
6442015-02-12 Jing Yu <jingyu@google.com>
645
646 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
647 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
648 New relocation.
649 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
650 TLSLE_MOVW_* relocations.
651 (Target_aarch64::Scan::global): Likewise.
652 (Target_aarch64::Relocate::relocate): Likewise.
653 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
654 for new TLSLE_MOVW_* relocations.
655
07f107f3
WN
6562015-02-11 Will Newton <will.newton@linaro.org>
657
658 PR gold/13321
659 * arm.cc (Target_arm::make_plt_section): Create an ARM
660 state mapping symbol at the start of the PLT.
661
e051a5b5
L
6622015-02-09 H.J. Lu <hongjiu.lu@intel.com>
663
664 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
665 Replace two_file_shared_2.so with two_file_shared_1.so.
666 * testsuite/Makefile.in: Regenerated.
667
dddcc5b9
AM
6682015-02-09 Alan Modra <amodra@gmail.com>
669
670 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
671 plugin_test_thin.a and defsym_test.
672 * testsuite/Makefile.in: Regenerate.
673
b39b8b9d
RÁE
6742015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
675
676 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
677 body.
678
b66d1c52
CC
6792015-02-04 Peter Collingbourne <pcc@google.com>
680
681 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
682 forwarding symbols when computing symbol resolution info for plugins.
683 * plugin.h (Plugin_manager::symtab): New method.
684 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
685
23081de0
CC
6862015-02-03 Cary Coutant <ccoutant@google.com>
687 Peter Collingbourne <pcc@google.com>
688
689 PR gold/15660
690 * archive.cc (Thin_archive_object_unlocker): New class.
691 (Archive::include_member): Unlock external members of thin archives.
692 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
693 (plugin_test_2): Likewise.
694 (plugin_test_3): Likewise.
695 (plugin_test_4): Likewise.
696 (plugin_test_5): Likewise.
697 (plugin_test_6): Likewise.
698 (plugin_test_7): Likewise.
699 (plugin_test_8): Likewise.
700 (plugin_test_9): Likewise.
701 (plugin_test_10): Likewise.
702 (plugin_test_11): New test case.
703 * testsuite/Makefile.in: Regenerate.
704 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
705 file to decide whether to claim file.
706 (all_symbols_read_hook): Likewise.
707 * testsuite/plugin_test_1.sh: Adjust expected output.
708 * testsuite/plugin_test_2.sh: Likewise.
709 * testsuite/plugin_test_3.sh: Likewise.
710 * testsuite/plugin_test_6.sh: Likewise.
711 * testsuite/plugin_test_tls.sh: Likewise.
712 * testsuite/plugin_test_11.sh: New testcase.
713
7142015-02-03 Cary Coutant <ccoutant@google.com>
715
716 * descriptors.cc (Descriptors::open): Set artificially-low limit for
717 file descriptors when debugging enabled. Add debug output.
718 (Descriptors::release): Add debug output.
719 (Descriptors::close_some_descriptor): Likewise.
720 (Descriptors::close_all): Likewise.
721 * fileread.cc (File_read::lock): Likewise.
722 (File_read::unlock): Likewise.
723
24dd5808
CC
7242015-02-02 Cary Coutant <ccoutant@google.com>
725
726 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
727 executable output file.
728
fa89cc82
HS
7292015-01-22 Han Shen <shenhan@google.com>
730
731 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
732 (Target_arm::do_plt_address_for_global): New method.
733 (Target_arm::do_plt_address_for_local): New method.
734 (Target_arm::rel_irelative_section): New method.
735 (Target_arm::make_data_plt): Add more parameters for plt ctor.
736 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
737 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
738 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
739 (Target_arm::Scan::check_non_pic): Add ifunc support.
740 (Target_arm::Scan::local): Add ifunc support.
741 (Target_arm::Scan::global): Add ifunc support.
742 (Target_arm::make_plt_section): New method.
743 (Target_arm::make_plt_entry): Change to call to make_plt_section.
744 (Target_arm::make_local_ifunc_plt_entry): New method.
745 (Target_arm::got_irelative_): New member.
746 (Target_arm::rel_irelative_): New member.
747 (Target_arm::got_section): Add creation for got_irelative_.
748 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
749 (Target_arm::Relocate::relocate): Properly set local ifunc address.
750 (Target_arm::do_dynsym_value): Properly set global ifunc address.
751 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
752 (Output_data_plt_arm::IRelative_data): New type.
753 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
754 (Output_data_plt_arm::add_entry): Add more parameters.
755 (Output_data_plt_arm::add_relocation): New method.
756 (Output_data_plt_arm::add_local_ifunc_entry): New method.
757 (Output_data_plt_arm::rel_irelative): New method.
758 (Output_data_plt_arm::entry_count): Modified.
759 (Output_data_plt_arm::address_for_global): New method.
760 (Output_data_plt_arm::address_for_local): New method.
23081de0 761gold/
fa89cc82
HS
762 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
763 (Output_data_plt_arm::insert_irelative_data): New method.
764 (Output_data_plt_arm::irelative_rel_): New member.
765 (Output_data_plt_arm::got_): New member.
766 (Output_data_plt_arm::got_irelative_): New member.
767 (Output_data_plt_arm::irelative_count_): New member.
768 (Output_data_plt_arm::IRelative_data_vec): New typedef.
769 (Output_data_plt_arm::irelative_data_vec_): New member.
770 (Output_data_plt_arm::do_write): Write out irelative entries.
771 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
772 more parameters to ctor.
773 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
774 more parameters to ctor.
775 * output.h (Output_data_reloc::add_local_relative): New method.
776 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
777
0f81d3f0
AM
7782015-01-29 Alan Modra <amodra@gmail.com>
779
780 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
781 and GOT_TLSGD to LE optimization.
782
65d92137
CC
7832015-01-28 Cary Coutant <ccoutant@google.com>
784
785 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
786 for undef TLS symbols.
787 (Target_x86_64::Relocate::relocate_tls): Likewise.
788 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
789
5485698a
CC
7902015-01-25 Cary Coutant <ccoutant@google.com>
791
792 * output.cc (Output_segment::set_section_addresses): Fix calculation
793 of size of relro segment.
794
b01a4b04
AM
7952015-01-22 Alan Modra <amodra@gmail.com>
796
797 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
798 condition for need of ifunc plt entry.
799 (Target_powerpc::Scan::global <got relocs>): Likewise.
800
3d0064a9
CC
8012015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
802
803 * mips.cc (reloc_high): Add r_sym.
804 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
805 reloc_high constructor.
806 (Mips_relocate_functions::relgot16_local): Likewise.
807 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
808 r_type to decide whether LO16 matches HI16.
809 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
810 rello16 and relgot16_local.
811
a5cd8f05
CC
8122015-01-09 Cary Coutant <ccoutant@google.com>
813
814 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
815 unless alignment is larger than page size.
816
4fc1b9d4
L
8172015-01-06 H.J. Lu <hongjiu.lu@intel.com>
818 Cary Coutant <ccoutant@google.com>
819
820 PR gold/17729
821 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
822 (DEFAULT_TARGET_X32): Set for x32.
823 * x86_64.cc (cmp_insn_32): New.
824 (lea_r10_insn_32): Likewise.
825 (lea_r11_insn_32): Likewise.
826 (cmp_insn_64): Likewise.
827 (lea_r10_insn_64): Likewise.
828 (lea_r11_insn_64): Likewise.
829 (Target_x86_64<size>::do_calls_non_split): Handle x32.
830 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
831 (check_DATA): Add split_x32 files.
832 (split_x32_[1234n].o): New targets.
833 (split_x32_[124]): New targets.
834 (split_x32_[1234r].stdout): New targets.
835 * testsuite/split_x32.sh: New file.
836 * testsuite/split_x32_1.s: Likewise.
837 * testsuite/split_x32_2.s: Likewise.
838 * testsuite/split_x32_3.s: Likewise.
839 * testsuite/split_x32_4.s: Likewise.
840 * testsuite/split_x32_n.s: Likewise.
841 * configure: Regenerated.
842 * testsuite/Makefile.in: Likewise.
843
e749cab8
L
8442015-01-06 H.J. Lu <hongjiu.lu@intel.com>
845
846 PR gold/17809
847 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
848 x32.
849
af759df0
AM
8502015-01-02 Alan Modra <amodra@gmail.com>
851
852 * version.cc (print_version): Just print current year.
853 * dwp.cc (print_version): Likewise.
854
b90efa5b
AM
8552015-01-01 Alan Modra <amodra@gmail.com>
856
857 Update year range in copyright notice of all files.
858
f12d1e8a
AM
8592014-12-25 Alan Modra <amodra@gmail.com>
860
861 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
862 new enums.
863 (Target_arm::merge_object_attributes, ): Likewise.
864
5c294fee
TG
8652014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
866
867 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
868 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
869 AEABI_VFP_args_vfp to check that.
870 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
871 value and replace hardcoded values by enum values.
872
e30880c2
CC
8732014-12-22 Cary Coutant <ccoutant@google.com>
874
875 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
876
bd040da1
L
8772014-12-20 H.J. Lu <hongjiu.lu@intel.com>
878
879 PR gold/14608
880 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
881 to "return i * i * 3;".
882
e02a4046
CC
8832014-12-16 Cary Coutant <ccoutant@google.com>
884
885 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
886 (Mapfile::print_output_data): Use current_data_size() to avoid
887 assert for sections requiring postprocessing; if address is not valid,
888 print 0.
889 (Mapfile::print_output_section): Use current_data_size(); print note
890 that addresses and sizes are before compression.
891
add6016b
L
8922014-12-14 H.J. Lu <hongjiu.lu@intel.com>
893
894 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
895 Cast current_group_size to unsigned long when reporting error.
896
0bf32ea9
JY
8972014-12-10 Jing Yu <jingyu@google.com>
898
899 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
900 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
901 Update error message.
902 (Target_aarch64::do_relax): Use absolute value of option
903 stub_group_size. Replace local variable with class member
904 stub_group_size_.
905
cbcb23fa
AM
9062014-12-04 Alan Modra <amodra@gmail.com>
907
908 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
909 addend of PLTREL24 reloc when not generating a plt stub. Make
910 max_branch_offset an "Address".
fbad6518 911 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
912 (Target_powerpc::Relocate::relocate): Likewise.
913
1611bc4a
AM
9142014-12-04 Alan Modra <amodra@gmail.com>
915
916 PR 17670
917 * symtab.cc (Symbol::set_undefined): Remove assertion.
918 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
919 on symbols defined in discarded sections, instead return false.
920 Rearrange params, update all callers.
921 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
922 branches to syms in discarded sections.
923 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
924 undefined and flag as discarded.
925 (Target_powerpc::Relocate::relocate): Localize variable.
926
4759c34e
L
9272014-12-03 H.J. Lu <hongjiu.lu@intel.com>
928
929 PR gold/17675
930 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
931 * testsuite/Makefile.in: Regenerated.
932
1f98a074
AM
9332014-12-03 Alan Modra <amodra@gmail.com>
934
935 PR 17566
936 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
937 when adding dynamic relocations against section symbols.
938
fb257835
DI
9392014-12-01 Dimitry Ivanov <dimitry@google.com>
940
941 * layout.cc (Layout::finish_dynamic_section): When '-z global'
942 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
943 * options.h (General_options): New -z option (global).
944
d8e60314
CC
9452014-12-01 Cary Coutant <ccoutant@google.com>
946
947 PR gold/17578
948 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
949 is given.
950 (Layout::create_executable_stack_info): Warn when -z noexecstack is
951 given but some inputs require executable stack.
952
982bbd97
CC
9532014-11-26 Cary Coutant <ccoutant@google.com>
954
955 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
956 .debug_str_offsets; strip .debug_gnu_pubnames and
957 .debug_gnu_pubtypes.
958 (lines_only_debug_sections): Strip all four new sections.
959
bb779192
HS
9602014-11-26 Jing Yu <jingyu@google.com>
961
962 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
963 register to be x0 when to relax TLSDESC_LD64_LO12.
964
a3e60ddb
AM
9652014-11-26 Alan Modra <amodra@gmail.com>
966
967 * powerpc.cc (struct Stub_table_owner): New.
968 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
969 unsigned int vector. Update all references.
970 (powerpc_relobj::set_stub_table): Take an unsigned int param
971 rather than a Stub_table. Update callers.
972 (Powerpc_relobj::clear_stub_table): New function.
973 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
974 stub_group_size_ vars.
975 (Target_powerpc::new_stub_table): Delete.
976 (max_branch_delta): New function, extracted from..
977 (Target_powerpc::Relocate::relocate): ..here..
978 (Target_powerpc::Branch_info::make_stub): ..and here. Return
979 status on whether stub created successfully.
980 (Stub_control::Stub_control): Add "no_size_errors" param. Move
981 default sizing to..
982 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
983 reduce on relax failure.
984 (Target_powerpc::group_sections): Add "no_size_errors" param.
985 Use stub_group_size_. Set up group info in a temp vector,
986 before building Stub_table vector. Account for input sections
987 possibly already converted to relaxed sections.
988 (Stub_table::init): Delete. Merge into..
989 (Stub_table::Stub_table): ..here.
990 (Stub_table::can_reach_stub): New function.
991 (Stub_table::add_plt_call_entry): Add "from" parameter and
992 return true iff stub could be reached.
993 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
994 param too.
995 (Stub_table::clear_stubs): Add "all" param.
996
a20605cf
AM
9972014-11-26 Alan Modra <amodra@gmail.com>
998
999 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1000 (Target_powerpc::group_sections): Use it.
1001
43b64deb
CC
10022014-11-25 Cary Coutant <ccoutant@google.com>
1003
1004 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1005 (Binary_to_elf::write_symbol): Add st_size parameter.
1006 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1007
c924eb67
CC
10082014-11-25 Cary Coutant <ccoutant@google.com>
1009
1010 PR gold/17639
1011 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1012 (Sized_relobj_file::do_layout): Handle deferred sections properly
1013 during GC pass 1. Don't add reloc sections to deferred list twice.
1014 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1015 (Sized_relobj_file::is_deferred_layout_): New data member.
1016
9d585188
L
10172014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1018
1019 PR gold/17619
1020 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1021 Check PC-relative offset overflow in PLT entry.
1022
3ffaac20
AM
10232014-11-21 Alan Modra <amodra@gmail.com>
1024
1025 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1026 for undefined weaks.
1027
0cfb0717
AM
10282014-11-20 Alan Modra <amodra@gmail.com>
1029
1030 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1031 from --stub-group-size parameter divided by 1024.
1032 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1033 template parameter. Update all uses.
1034 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1035 has_stub_value. Set for long branches. Don't report overflow for
1036 branch to undefined weak symbols. Print info message on
1037 overflowing branch to stub.
1038
f9dffbf0
AM
10392014-11-20 Alan Modra <amodra@gmail.com>
1040
1041 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1042
e88ba8d5
L
10432014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1044
1045 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1046 entry for R_X86_64_GOTPLT64.
1047 (Target_x86_64<size>::Relocate::relocate): Update comments for
1048 R_X86_64_GOTPLT64.
1049
d37ffe25
ED
10502014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1051
1052 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1053 * plugin.h: add lock definition
1054
9726c3c1
HS
10552014-10-29 Han Shen <shenhan@google.com>
1056 Jing Yu <jingyu@google.com>
1057
1058 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1059 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1060 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1061 Symbol::TLS_REF.
1062 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1063 method.
1064 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1065 (Target_aarch64::tls_ld_to_le): New method.
1066 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1067 for 64bit targets.
1068 (Output_data_plt_aarch64::irelative_rel_): New data member.
1069 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1070 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1071 (Output_data_plt_aarch64::add_relocation): New method.
1072 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1073 offset. Add got_irelative size to got size.
1074 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1075 type string with the new typename.
1076 (AArch64_relocate_functions::update_adr): Replace parameter x with
1077 immed.
1078 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1079 (AArch64_relocate_functions::reloc_common): New method.
1080 (AArch64_relocate_funcsions::rela_general): Extract common part out
1081 into reloc_common method.
1082 (AArch64_relocate_functions::rela_general): Likewise.
1083 (AArch64_relocate_functions::pcrela_general): Likewise.
1084 (AArch64_relocate_functions::adr): New method.
1085 (AArch64_relocate_functions::adrp): Calculate immed before calling
1086 update_adr.
1087 (AArch64_relocate_functions::adrp): Likewise.
1088 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1089 comparing x to 0. Calculate immed from ~x when x < 0.
1090 (Target_aarch64::optimize_tls_reloc): Add new cases for
1091 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1092 TLSLD_MOVW_DTPREL_G0_NC.
1093 (Target_aarch64::possible_function_pointer_reloc): Implement this
1094 method.
1095 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1096 comment.
1097 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1098 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1099 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1100 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1101 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1102 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1103 (Target_aarch64::make_plt_entry): Call add_entry with two more
1104 parameters.
1105 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1106 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1107 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1108 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1109 (Target_aarch64::Relocate::relocate_tls): Add cases for
1110 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1111 TLSLD_MOVW_DTPREL_G0_NC.
1112 * testsuite/icf_safe_so_test.cc: Correct test comment.
1113 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1114
80272b8c
AM
11152014-10-22 Alan Modra <amodra@gmail.com>
1116
1117 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1118 thread_starter.
1119
998a69f4
AS
11202014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1121
1122 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1123
aed56ec5
CC
11242014-10-17 Cary Coutant <ccoutant@google.com>
1125
1126 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1127 Add "typename" keyword.
1128
bb779192 11292014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1130 Jing Yu <jingyu@google.com>
1131
1132 Patch for gold aarch64 backend to support relaxation.
1133 * aarch64-reloc.def: Change format.
1134 * aarch64.cc (class Reloc_stub): New class.
1135 (class Stub_table): New class.
1136 (class AArch64_relobj): New class.
1137 (class AArch64_input_section): New class.
1138 (class AArch64_output_section): New class.
1139 (Target_aarch64::new_stub_table): New method.
1140 (Target_aarch64::new_aarch64_input_section): New method.
1141 (Target_aarch64::find_aarch64_input_section): New method.
1142 (Target_aarch64::scan_section_for_stubs): New method.
1143 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1144 (Target_aarch64::relocate_stub): New method.
1145 (Target_aarch64::current_target): New method.
1146 (Target_aarch64::do_make_elf_object): New method.
1147 (Target_aarch64::do_may_relax): New method.
1148 (Target_aarch64::do_relax): New method.
1149 (Target_aarch64::group_sections): New method.
1150 (Target_aarch64::scan_reloc_for_stub): New method.
1151 (Target_aarch64::do_make_output_section): New method.
1152 (Target_aarch64::stub_tables_): New data member.
1153 (Target_aarch64::aarch64_input_section_map_): New data member.
1154 (AArch64_relocate_functions::maybe_apply_stub): New method.
1155
db4c9594
CC
11562014-09-30 Cary Coutant <ccoutant@google.com>
1157
1158 PR gold/17432
1159 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1160
cd6da036
KC
11612014-09-30 Kito Cheng <kito@0xlab.org>
1162
1163 PR gold/13597
1164 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1165 hash table before sysv-style hash table.
1166
5f772412
ST
11672014-09-29 Sriraman Tallam <tmsriram@google.com>
1168
1169 * options.h (--pic-executable): Add negative to alias to -no-pie.
1170
5efeedf6
CC
11712014-09-26 Cary Coutant <ccoutant@google.com>
1172
1173 PR gold/16773
1174 * object.cc (Sized_relobj_file): Compute value of section symbols
1175 for TLS sections the same as TLS symbols.
1176
1707f183
CC
11772014-09-25 Cary Coutant <ccoutant@google.com>
1178
1179 PR gold/17432
1180 * resolve.cc (Symbol_table::resolve): Override common placeholder
1181 symbols, but adjust sizes.
1182 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1183 symbols to common lists.
1184
00cac886
AM
11852014-09-24 Alan Modra <amodra@gmail.com>
1186
1187 * po/POTFILES.in: Regenerate.
1188
635aa30e
CC
11892014-09-23 Taiju Tsuiki <tzik@google.com>
1190 Cary Coutant <ccoutant@google.com>
1191
71b9b91b 1192 PR gold/14860
635aa30e
CC
1193 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1194 on input_sections_blocker.
1195 * layout.cc (Write_sections_task::locks): Unblock
1196 input_sections_blocker_.
1197 * layout.h (Write_sections_task::Write_sections_task): Add
1198 input_sections_blocker.
1199 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1200 to DEPENDENCIES.
1201 * testsuite/Makefile.in: Regenerate.
1202
c0c71592
RÁE
12032014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1204
1205 * testsuite/Makefile.am (plugin_test_10): New test.
1206 * testsuite/Makefile.in: Regenerate
1207 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1208 * testsuite/plugin_test_10.sh: New file.
1209
6168c2a1
RÁE
12102014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1211
1212 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1213 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1214 during the replacement phase.
1215
3a531937
JY
12162014-09-17 Han Shen <shenhan@google.com>
1217 Jing Yu <jingyu@google.com>
1218
1219 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1220 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1221 * aarch64.cc (Target_aarch64): Add data members
1222 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1223 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1224 constructor.
1225 (Target_aarch64::do_reloc_symbol_index): New method.
1226 (Target_aarch64::do_reloc_addend): New method.
1227 (Target_aarch64::add_tlsdesc_info): New method.
1228 (Target_aarch64::do_dynsym_value): New method.
1229 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1230 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1231 (Target_aarch64::make_data_plt): Add new parameters: got,
1232 got_irelative. Pass them to do_make_data_plt.
1233 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1234 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1235 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1236 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1237 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1238 (Target_aarch64::got_tlsdesc_section): New method.
1239 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1240 (Target_aarch64::define_tls_base_symbol): New method.
1241 (Target_aarch64::reserve_tlsdesc_entries): New method.
1242 (Target_aarch64::got_mod_index_entry): New method.
1243 (Target_aarch64::rela_tlsdesc_section): New method.
1244 (Target_aarch64::rela_irelative_section): New method.
1245 (Target_aarch64::Tlsdesc_info): New struct.
1246 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1247 relocations and tlsdesc relocations.
1248 (Target_aarch64::optimize_tls_reloc): Implement method.
1249 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1250 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1251 in constructor.
1252 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1253 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1254 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1255 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1256 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1257 (Output_data_plt_aarch64::rela_irelative): New method.
1258 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1259 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1260 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1261 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1262 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1263 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1264 (Output_data_plt_aarch64_standard): New member variables:
1265 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1266 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1267 New parameter: got, got_irelative.
1268 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1269 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1270 (Output_data_plt_aarch64::do_write): Replace got_address with
1271 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1272 (AArch64_relocate_functions::update_movnz): New method.
1273 (AArch64_relocate_functions): Correct format.
1274 (AArch64_relocate_functions::movnz): New method.
1275 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1276 before the switch. Add new cases to switch.
00cac886 1277 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1278 tlsgd tlsdesc cases.
1279 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1280 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1281 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1282 Call reloc_name_in_error_message to print unsupported reloc.
1283 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1284 make_data_plt.
1285 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1286 relocs. Fill in some more dynamic tags.
1287 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1288 Skip call tls_get_addr when tlsgd is relaxed.
1289 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1290 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1291 tlsdesc->ie relaxation.
1292
62661c93
SS
12932014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1294
1295 * mips.cc (Target_mips_nacl): New class.
1296 (Target_selector_mips_nacl): New class.
1297 (target_selector_mips32): Rename from target_selector_mips32be and use
1298 Target_selector_mips_nacl instead of Target_selector_mips.
1299 (target_selector_mips32el): Rename from target_selector_mips32 and use
1300 Target_selector_mips_nacl instead of Target_selector_mips.
1301 (target_selector_mips64): Rename from target_selector_mips64be and use
1302 Target_selector_mips_nacl instead of Target_selector_mips.
1303 (target_selector_mips64el): Rename from target_selector_mips64 and use
1304 Target_selector_mips_nacl instead of Target_selector_mips.
1305 (Target_mips::mips_info): Add const attribute.
1306
54674d38
CC
13072014-09-02 Cary Coutant <ccoutant@google.com>
1308
1309 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1310 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1311 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1312 (Sized_incr_dynobj::do_section_name): Likewise.
1313 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1314 (Sized_incr_dynobj::do_section_name): Likewise.
1315 * object.h (Object::section_name): Likewise.
1316 (Object::do_section_name): Likewise.
1317 (Sized_relobj_file::do_section_name): Likewise.
1318 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1319 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1320
9860cbcf
CC
13212014-09-02 Cary Coutant <ccoutant@google.com>
1322
1323 PR gold/17005
1324 * ehframe.cc (Fde::write): Add output_offset parameter.
1325 (Cie::write): Likewise.
1326 (Eh_frame::set_final_data_size): Account for offset within output
1327 section.
1328 (Eh_frame::do_sized_write): Likewise.
1329 * ehframe.h (Fde::write): Add output_offset parameter.
1330 (Cie::write): Likewise.
1331 * output.cc (Output_section::Input_section_sort_entry): Remove
1332 section_has_name_; add output_section_name parameter. Use
1333 output section name for non-input sections.
1334 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1335 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1336 (Output_section::Input_section_sort_compare): Remove logic for
1337 sections without names.
1338 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1339 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1340 Likewise.
1341 (Output_section::Input_section_sort_section_name_compare): Likewise.
1342
8e33481e
HS
13432014-08-29 Han Shen <shenhan@google.com>
1344 Jing Yu <jingyu@google.com>
1345
1346 * aarch64-reloc-property.cc
1347 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1348 reference reloc property in the table.
1349 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1350 3 other entries.
1351 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1352 2 new overloaded methods.
1353 (Output_data_got_aarch64::do_write): Add code to write out
1354 static relocs.
1355 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1356 static relocs.
1357 (Output_data_got_aarch64::static_relocs): New vector to
1358 hold static relocs.
1359 (Target_aarch64::TCB_SIZE): New const static memeber.
1360 (Target_aarch64::tcb_size): New method.
1361 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1362 (Target_aarch64::Relocate::relocate_tls): New method.
1363 (Target_aarch64::Scan::local): Add code handling new reloc types.
1364 (Target_aarch64::Scan::global): Add code handling new reloc types.
1365
81233653
ST
13662014-08-13 Sriraman Tallam <tmsriram@google.com>
1367
1368 * options.h (-no-pie): Add option.
1369
9363c7c3
JY
13702014-08-08 Jing Yu <jingyu@google.com>
1371 Han Shen <shenhan@google.com>
1372
1373 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1374 (DEFFILES): add aarch64-reloc.def.
1375 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1376 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1377 * Makefile.in: Regenerate.
1378 * aarch64-reloc-property.cc: New file.
1379 * aarch64-reloc-property.h: New file.
1380 * aarch64-reloc.def: New file.
1381 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1382 with tab to make the format consistent.
1383 (Output_data_got_aarch64::symbol_table_): New method.
1384 (Target_aarch64::do_plt_address_for_global): New method.
1385 (Target_aarch64::do_plt_address_for_local): New method.
1386 (Target_aarch64::do_select_as_default_target): New method.
1387 (Target_aarch64::do_make_data_plt): New method.
1388 (Target_aarch64::make_data_plt): New method.
1389 (Output_data_plt_aarch64::has_irelative_section): New method.
1390 (Output_data_plt_aarch64::address_for_global): New method.
1391 (Output_data_plt_aarch64::address_for_local): New method.
1392 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1393 (Output_data_plt_aarch64::add_entry): Implement contents.
1394 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1395 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1396 the got_pov entry to plt0.
1397 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1398 Implement contents.
1399 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1400 (AArch64_howto): New struct.
1401 (aarch64_howto[]): New static const array.
1402 (AArch64_relocate_functions): New class.
1403 (Target_aarch64::Scan::get_reference_flags): Remove method.
1404 (Target_aarch64::Scan::local): Implement to support a few relocations.
1405 (Target_aarch64::Scan::global): Implement to support a few relocations.
1406 (Target_aarch64::make_plt_section): Implement contents.
1407 (Target_aarch64::make_plt_entry): Implement contents.
1408 (Target_aarch64::do_finalize_sections): Implement contents.
1409 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1410 (Target_aarch64::relocate_section): Implement contents.
1411
ad9fe6c1
AM
14122014-08-06 Alan Modra <amodra@gmail.com>
1413
1414 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1415
7cd4e5b7
AM
14162014-08-06 Alan Modra <amodra@gmail.com>
1417
1418 PR 13227
1419 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1420
5ad9b0a7
ST
14212014-07-21 Sriraman Tallam <tmsriram@google.com>
1422
1423 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1424 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1425
e051745c
CC
14262014-07-08 Cary Coutant <ccoutant@google.com>
1427
1428 * expression.cc (struct Expression::Expression_eval_info): Add
1429 new fields type_pointer, vis_pointer, and nonvis_pointer.
1430 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1431 nonvis_pointer parameters. Adjust all calls.
1432 (Symbol_expression::value): Update type, visibility, and nonvis bits
1433 in caller.
1434 * script.cc (Symbol_assignment::sized_finalize): Update type,
1435 visibility, and remaining st_other bits for new symbol.
1436 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1437 vis_pointer, and nonvis_pointer parameters.
1438 * symtab.h (Symbol::set_type): New method.
1439
1440 * testsuite/Makefile.am (defsym_test): New test.
1441 * testsuite/Makefile.in: Regenerate.
1442 * testsuite/defsym_test.c: New file.
1443 * testsuite/defsym_test.sh: New file.
1444
f35c4853
CC
14452014-07-08 Cary Coutant <ccoutant@google.com>
1446
1447 PR gold/15639
1448 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1449 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1450 (Sized_dynobj::base_read_symbols): ...new method.
1451 * object.h (Sized_relobj_file::base_read_symbols): New method.
1452 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1453 (Sized_relobj_file::base_read_symbols): ...new method.
1454 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1455 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1456 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1457
2900af2d
AM
14582014-07-04 Alan Modra <amodra@gmail.com>
1459
1460 * po/POTFILES.in: Regenerate.
1461
053a4d68
JY
14622014-07-02 Jing Yu <jingyu@google.com>
1463
1464 * aarch64.cc: New file
1465 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1466 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1467 * Makefile.in: Regenerate.
1468 * configure.tgt: Add entries for aarch64*.
1469 * configure.ac: Likewise.
1470 * configure: Likewise.
1471
7b549045
AM
14722014-06-27 Alan Modra <amodra@gmail.com>
1473
1474 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1475
cb818dbf
CC
14762014-06-24 Cary Coutant <ccoutant@google.com>
1477
1478 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1479 sections.
1480 (Dwo_file::sized_read_unit_index): Likewise.
1481
9810d34d
SS
14822014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1483
1484 * mips.cc: New file.
1485 * Makefile.am (TARGETSOURCES): Add mips.cc
1486 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1487 * configure.tgt: Add entries for mips*.
1488 * configure.ac: Likewise.
1489 * Makefile.in: Regenerate.
1490 * configure: Likewise.
1491
9baa787b
CC
14922014-06-09 Cary Coutant <ccoutant@google.com>
1493
1494 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1495 unit_length is within section bounds.
1496
8f89af0a
CC
14972014-06-09 Cary Coutant <ccoutant@google.com>
1498
1499 PR gold/16980
1500 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1501 map.
1502
a47622ac
AM
15032014-06-07 Alan Modra <amodra@gmail.com>
1504
1505 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1506
4320c691
CC
15072014-06-06 Cary Coutant <ccoutant@google.com>
1508
1509 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1510 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1511 (Dwarf_pubnames_table::read_header): Likewise.
1512 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1513 .debug_gnu_pubtypes.
1514
270c9937
JB
15152014-06-05 Joel Brobecker <brobecker@adacore.com>
1516
1517 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1518 * Makefile.in, configure: Regenerate.
1519
397998fc
AM
15202014-06-03 Alan Modra <amodra@gmail.com>
1521
1522 * powerpc.cc (addis_12_2): Define.
1523 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1524
61f5c66f
AM
15252014-06-03 Alan Modra <amodra@gmail.com>
1526
1527 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1528 st_other output.
1529
f6971787
AM
15302014-06-02 Alan Modra <amodra@gmail.com>
1531
1532 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1533 Only ignore relocs on ELFv1.
1534 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1535
f6fb8322
CC
15362014-05-30 Cary Coutant <ccoutant@google.com>
1537
1538 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1539 * testsuite/Makefile.in: Regenerate.
1540 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1541
c23dd342
L
15422014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1543
1544 PR gold/16945
1545 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1546 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1547
5fe7ffdc
AM
15482014-05-15 Alan Modra <amodra@gmail.com>
1549
1550 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1551 Compare FDE contents with DW_CFA_nop rather than 0.
1552
a82bef93
ST
15532014-05-13 Sriraman Tallam <tmsriram@google.com>
1554
1555 * symtab.h (may_need_copy_reloc): Remove check for position independent
1556 code.
1557 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1558 position independence before pc absolute may_need_copy_reloc call.
1559 Add check for executable output befor pc relative may_need_copy_reloc
1560 call.
1561 * i386.cc: Ditto.
1562 * arm.cc: Ditto.
1563 * sparc.cc: Ditto.
1564 * tilegx.cc: Ditto.
1565 * powerpc.cc: Add check for no position independence before
1566 may_need_copy_reloc calls.
1567 * testsuite/pie_copyrelocs_test.cc: New file.
1568 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1569 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1570 * Makefile.in: Regenerate.
a82bef93 1571
53c66605
ML
15722014-05-08 Martin Liška <mliska@suse.cz>
1573
1574 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1575
57b2284c
CC
15762014-05-06 Cary Coutant <ccoutant@google.com>
1577
1578 PR gold/16900
1579 * i386.cc (Output_data_got_plt_i386): New class.
1580 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1581 parameter. Change all callers.
1582 (Output_data_plt_i386::layout_): Remove.
1583 (Output_data_plt_i386::got_plt_): Change type.
1584 (Target_i386::got_plt_): Change type. Change all references.
1585 (Target_i386::got_section): Create instance of new class.
1586 (Output_data_got_plt_i386::do_write): New function.
1587 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1588 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1589 parameter. Change all callers.
1590 (Output_data_plt_x86_64::layout_): Remove.
1591 (Output_data_plt_x86_64::got_plt_): Change type.
1592 (Target_x86_64::got_plt_): Change type. Change all references.
1593 (Target_x86_64::got_section): Create instance of new class.
1594 (Output_data_got_plt_x86_64::do_write): New function.
1595 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1596 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1597 class.
1598
6b97515d 15992014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1600
6b97515d
CC
1601 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1602 if we have pubnames/pubtypes.
1603
d1bddd3c
CC
16042014-05-02 Cary Coutant <ccoutant@google.com>
1605
5fe7ffdc
AM
1606 * defstd.cc (in_segment): Define __ehdr_start here...
1607 * layout.cc (Layout::finalize): ...Instead of here. Set the
1608 output segment when known.
1609 * resolve.cc (Symbol::override_base_with_special): Remember
1610 the original binding.
1611 * symtab.cc (Symbol::set_output_segment): New function.
1612 (Symbol::set_undefined): New function.
1613 * symtab.h (Symbol::is_weak_undefined): Check original undef
1614 binding.
1615 (Symbol::is_strong_undefined): New function.
1616 (Symbol::set_output_segment): New function.
1617 (Symbol::set_undefined): New function.
1618 * target-reloc.h (is_strong_undefined): Remove.
1619 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1620 Check for hidden undefs.
1621 (relocate_section): Call Symbol::is_strong_undefined.
1622
1623 * testsuite/Makefile.am (ehdr_start_test_1)
1624 (ehdr_start_test_2, ehdr_start_test_3)
1625 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1626 * testsuite/Makefile.in: Regenerate.
1627 * testsuite/ehdr_start_def.cc: New source file.
1628 * testsuite/ehdr_start_test.cc: New source file.
1629 * testsuite/ehdr_start_test.t: New linker script.
1630 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1631
7849f6d8
CC
16322014-04-23 Cary Coutant <ccoutant@google.com>
1633
bf2cc635 1634 PR gold/16870
7849f6d8
CC
1635 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1636
99fd8cff
CC
16372014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1638
1639 * layout.cc (Layout::include_section): Allow a target to decide
1640 whether to include a section.
1641 * target.h (Target::should_include_section): New function.
1642 (Target::do_should_include_section): New function.
1643
91f43acd
CC
16442014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1645
1646 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1647 inline into ...
1648 (Copy_relocs::emit): ... here.
1649 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1650 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1651 (Copy_reloc_entry::entries_): Change from private to protected.
1652
c4eb27e1
ST
16532014-04-02 Sriraman Tallam <tmsriram@google.com>
1654
1655 * icf.cc (get_section_contents): Replace copies of reloc
1656 vectors with const references.
1657
ae447ddd
CC
16582014-04-02 Cary Coutant <ccoutant@google.com>
1659
1660 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1661 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1662 * configure: Regenerate.
1663 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1664 -fno-use-linker-plugin.
1665 (LINK1, CXXLINK1): Add it to the link command.
1666 * testsuite/Makefile.in: Regenerate.
1667
fa47fa92
AM
16682014-03-12 Alan Modra <amodra@gmail.com>
1669
1670 * Makefile.in: Regenerate.
1671
9b12c500
CC
16722014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1673
1674 * symtab.h (Symbol::set_nonvis): New function.
1675
beacaa96
CC
16762014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1677
1678 * symtab.cc (Sized_symbol<32>::init_output_data):
1679 Instantiate the template.
1680 (Sized_symbol<64>::init_output_data): Likewise.
1681
800d9823
CC
16822014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1683
1684 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1685 adjust dynamic symbol value.
1686 * target.h (Target::adjust_dyn_symbol): New function.
1687 (Target::do_adjust_dyn_symbol): New function.
1688
918fc1f8 16892014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1690
918fc1f8
CC
1691 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1692 Get the value of DYNAMIC_CUSTOM dynamic entry.
1693 * output.h (Output_data_dynamic::add_custom): New function.
1694 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1695 dynamic entry.
1696 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1697 * target.h (Target::dynamic_tag_custom_value): New function.
1698 (Target::do_dynamic_tag_custom_value): New function.
1699
98ff9231
CC
17002014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1701
1702 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1703 dynsym indexes.
1704 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1705 (Target::do_has_custom_set_dynsym_indexes): New function.
1706 (Target::set_dynsym_indexes): New function.
1707 (Target::do_set_dynsym_indexes): New function.
1708
b80eed39
AM
17092014-03-07 Alan Modra <amodra@gmail.com>
1710
1711 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1712 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1713 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1714 (Powerpc_relocate_functions::has_overflow_bitfield,
1715 overflowed): Use the above.
1716 (Target_powerpc::Relocate::relocate): Correct overflow checking
1717 for a number of relocations. Modify overflow test for 16-bit
1718 fields in instructions to signed/unsigned according to whether
1719 the field takes a signed or unsigned value.
1720
4b95cf5c
AM
17212014-03-05 Alan Modra <amodra@gmail.com>
1722
1723 Update copyright years.
1724
45965137
AM
17252014-03-05 Alan Modra <amodra@gmail.com>
1726
1727 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1728 R_PPC64_ADDR64_LOCAL.
1729 (Target_powerpc::Relocate::relocate): Likewise.
1730
2c80b753
AM
17312014-03-03 Alan Modra <amodra@gmail.com>
1732
1733 * dwp.cc (print_version): Update copyright year to current.
1734
c1c69e83
AM
17352014-02-10 Alan Modra <amodra@gmail.com>
1736
1737 * po/gold.pot: Regenerate.
1738
dd0c4e70
CC
17392014-02-06 Cary Coutant <ccoutant@google.com>
1740
1741 Fix problem where -u is ignored when a weak undef is seen.
1742
1743 * archive.cc (Library_base::should_include_member): Reorder
1744 code to check for -u option if a weak undef has already been seen.
1745 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1746 * testsuite/Makefile.in: Regenerate.
1747 * testsuite/weak_undef_file3.cc: New file.
1748 * testsuite/weak_undef_file4.cc: New file.
1749 * testsuite/weak_undef_test_2.cc: New file.
1750
1a221d3d
CC
17512014-02-05 Cary Coutant <ccoutant@google.com>
1752
1753 Fix issues with gold undefined symbol diagnostics.
1754
1755 PR binutils/15435
1756 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1757 check to here.
1758 * target-reloc.h (is_strong_undefined): New function.
1759 (relocate_section): Move undef vtable symbol check from here.
1760 Check for is_strong_undefined.
1761
e889f0a4 17622014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1763
e889f0a4
CC
1764 Fix problems with the --dynamic-list option.
1765
1766 PR gold/13577
1767 * options.cc (General_options::parse_dynamic_list):
1768 Set have_dynamic_list_.
1769 (General_options::General_options): Initialize have_dynamic_list_.
1770 (General_options::finalize): Turn off -Bsymbolic and
1771 -Bsymbolic-functions if --dynamic-list provided.
1772 * options.h (General_options::have_dynamic_list): New function.
1773 (General_options::have_dynamic_list_): New data member.
1774 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1775 correctly.
5fe7ffdc 1776
e889f0a4
CC
1777 PR gold/16530
1778 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1779 in --dynamic-list, mark it.
5fe7ffdc 1780
e889f0a4
CC
1781 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1782 (dynamic_list_2): New test case.
1783 * testsuite/Makefile.in: Regenerate.
1784 * testsuite/dynamic_list_2.cc: New file.
1785 * testsuite/dynamic_list_2.t: New file.
1786 * testsuite/dynamic_list_lib1.cc: New file.
1787 * testsuite/dynamic_list_lib2.cc: New file.
1788 * testsuite/gc_dynamic_list_test.c: New file.
1789 * testsuite/gc_dynamic_list_test.sh: New file.
1790 * testsuite/gc_dynamic_list_test.t: New file.
1791
ec673e64
CC
17922014-01-28 Cary Coutant <ccoutant@google.com>
1793
1794 Add .gdb_index version 7 support.
1795
1796 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1797 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1798 debug sections.
1799 (Dwarf_ranges_table::read_ranges_table): Likewise.
1800 (Dwarf_pubnames_table::read_section): Check for GNU-style
1801 sections, and for compressed debug sections.
1802 (Dwarf_pubnames_table::read_header): Compute end address of table.
1803 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1804 for end of list by offset, not by offset == 0.
1805 (Dwarf_info_reader::do_read_string_table): Check for compressed
1806 debug sections.
1807 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1808 Initialize new data members.
1809 (Dwarf_pubnames_table::next_name): return flag_byte.
1810 (Dwarf_pubnames_table::end_of_table_): New data member.
1811 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1812 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1813 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1814 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1815 read skeleton type unit DIEs.
1816 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1817 (Gdb_index::do_write): Write flag_byte.
1818 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1819 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1820 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1821 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1822
221fd5d5
L
18232014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1824
1825 * version.cc (print_version): Update copyright year to 2014.
1826
6c09fb0b
ILT
18272013-12-19 Dimitry Andric <dimitry@andric.com>
1828
1829 * stringpool.cc (Stringpool_template::reserve): Add
1830 HAVE_UNORDERED_MAP case.
1831 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1832
8356f2d0
CC
18332013-12-18 Cary Coutant <ccoutant@google.com>
1834
1835 * configure.ac: Check for <unordered_set> and <unordered_map>.
1836 * config.in: Regenerate.
1837 * configure: Regenerate.
1838 * system.h: Use <unordered_set> and <unordered_map> if available.
1839
f2c7d7ee
RM
18402013-12-10 Roland McGrath <mcgrathr@google.com>
1841
1842 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1843 with $(INSTALL_PROGRAM_ENV).
1844 * Makefile.in: Regenerate.
1845
6632e8cc
CC
18462013-11-22 Cary Coutant <ccoutant@google.com>
1847
1848 * configure.ac: Add check for which library is needed for
1849 dlopen.
1850 * configure: Regenerate.
1851
0c075858
CC
18522013-11-22 Cary Coutant <ccoutant@google.com>
1853
1854 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1855 assembler.
1856 * testsuite/Makefile.in: Regenerate.
1857
f49fe902
L
18582013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1859
1860 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1861 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1862 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1863 (Target_x86_64<size>::Scan::local): Likewise.
1864 (Target_x86_64<size>::Scan::global): Likewise.
1865 (Target_x86_64<size>::Relocate::relocate): Likewise.
1866 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1867 Likewise.
1868 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1869 R_X86_64_PC32_BND.
1870
1871 * testsuite/Makefile.am (check_PROGRAMS): Add
1872 exception_x86_64_bnd_test.
1873 (exception_x86_64_bnd_test_SOURCES): New macro.
1874 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1875 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1876 (exception_x86_64_bnd_test_LDADD): Likewise.
1877 (exception_x86_64_bnd_1.o): New rule.
1878 (exception_x86_64_bnd_2.o): Likewise.
1879 * testsuite/Makefile.in: Regenerated.
1880
9055360d
AM
18812013-11-15 Alan Modra <amodra@gmail.com>
1882
1883 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1884 accessor.
1885 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1886 Only call ppc64_local_entry_offset for 64-bit. Restrict
1887 symval_for_branch lookup to ELFv1.
1888 (Stub_table::add_plt_call_entry): Use unsigned int off.
1889 (Output_data_glink::Address, invalid_address): New.
1890 (Output_data_glink::add_eh_frame): Move out of line. Add
1891 support for ELFv2.
1892 (Output_data_glink::add_global_entry, find_global_entry,
1893 global_entry_address): New functions.
1894 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1895 ge_size): New variables.
1896 (Output_data_glink::set_final_data_size): Add global entry
1897 stub sizing.
1898 (Output_data_glink::do_write): Write global entry stubs.
1899 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1900 parameter. Return true for ELFv2. Adjust callers.
1901 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1902 ELFv1. Similarly for ifunc and dynamic relocation processing
1903 specific to ELFv1. Recognize that symbols are defined on
1904 their plt entries for ELFv2.
1905 (Target_powerpc::symval_for_branch): Assert if called for
1906 ELFv2 or ppc32.
1907 (Target_powerpc::Relocate::relocate): Use global entry plt
1908 stub for symbol value if such exists on ELFv2.
1909 (Target_powerpc::Relocate::relocate): Don't call
1910 symval_for_branch when ELFv2. Do adjust for local entry
1911 offset when ELFv2.
1912 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1913 plt stub for ELFv2.
1914 (Target_powerpc::do_plt_address_for_global): Similarly.
1915
cafdd569
CC
19162013-11-14 Cary Coutant <ccoutant@google.com>
1917
1918 Revert patch -- this did not fix the problem, and there is
1919 no race there.
1920
1921 2013-11-14 Cary Coutant <ccoutant@google.com>
1922
1923 PR gold/14860
1924 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1925 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1926 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1927 updating fde_offsets_.
1928 (Eh_frame_hdr::lock_): New data member.
1929
94e49e16
CC
19302013-11-14 Cary Coutant <ccoutant@google.com>
1931
1932 * dwp.cc (Dwo_file_entry): New type.
1933 (File_list): Use Dwo_file_entry.
1934 (Dwo_file::verify): New function.
1935 (Dwo_file::verify_dwo_list): New function.
1936 (Dwo_file::sized_verify_dwo_list): New function.
1937 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1938 list.
1939 (Dwp_options): New enum type.
1940 (dwp_options): Add --verify-only.
1941 (usage): Likewise.
1942 (main): Likewise.
1943 * dwp.h (gold_info): Add declaration.
1944
7cdd7d57
CC
19452013-11-14 Cary Coutant <ccoutant@google.com>
1946
1947 PR gold/14860
1948 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1949 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1950 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1951 updating fde_offsets_.
1952 (Eh_frame_hdr::lock_): New data member.
1953
1d946cb3
CC
19542013-11-06 Cary Coutant <ccoutant@google.com>
1955
1956 PR gold/15758
1957 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1958 before reloc sections.
1959
4f65b40e
AM
19602013-11-04 Alan Modra <amodra@gmail.com>
1961
1962 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1963 (Symbol::needs_dynamic_reloc): Test new flag.
1964 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1965 (Target_powerpc::Scan::get_reference_flags): Add target param.
1966 Return FUNC_DESC_ABI for 64-bit ELFv1.
1967 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1968 call.
1969 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1970 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1971
908794a9
CC
19722013-10-31 Cary Coutant <ccoutant@google.com>
1973
1974 Restore support for dwp v2 DWARF package file format.
1975
1976 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1977 tu_length parameter. Adjust all callers.
1978 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1979 * dwp.cc: Include dwarf.h.
1980 (Section_bounds): New struct type.
1981 (Unit_set): New struct type.
1982 (Dwo_file::Dwo_file): Initialize new data member.
1983 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1984 Combine and rename to...
1985 (Dwo_file::read_unit_index): ...this.
1986 (Dwo_file::sized_read_compunit_index)
1987 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1988 (Dwo_file::sized_read_unit_index): ...this.
1989 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1990 parameters; add section_id parameter.
1991 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1992 (Dwo_file::add_unit_set): ...this.
1993 (Dwo_file::shndx_map_): Remove.
1994 (Dwo_file::sect_offsets_): New data member.
1995 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1996 (Dwp_output_file::add_section): Rename to...
1997 (Dwp_output_file::add_contribution): ...this.
1998 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1999 (Dwp_output_file::add_tu_set): Likewise.
2000 (Dwp_output_file::Contribution): New type.
2001 (Dwp_output_file::Section::contributions): New data member.
2002 (Dwp_output_file::Cu_or_tu_set): Remove.
2003 (Dwp_output_file::Section::Section): New ctor.
2004 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2005 (Dwp_output_file::Dwp_index::Section_table): New type.
2006 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2007 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2008 parameter.
2009 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2010 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2011 (Dwp_output_file::Dwp_index::section_table): New member function.
2012 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2013 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2014 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2015 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2016 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2017 (Dwp_output_file::Dwp_index::section_table_): New data member.
2018 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2019 (Dwp_output_file::add_output_section): New member function.
2020 (Dwp_output_file::write_new_section): New member function.
2021 (Dwp_output_file::write_contributions): New member function.
2022 (Dwp_output_file::section_id_map_): New data member.
2023 (class Dwo_id_info_reader): Remove.
2024 (class Unit_reader): New class.
2025 (get_dwarf_section_name): New function.
2026 (Dwo_file::read_executable): Adjust initializations of class data.
2027 (Dwo_file::read): Add support for v2 package file format.
2028 (Dwo_file::read_unit_index): Likewise.
2029 (Dwo_file::sized_read_unit_index): Likewise.
2030 (Dwo_file::copy_section): Likewise.
2031 (Dwo_file::add_unit_set): Likewise.
2032 (Dwp_output_file::add_output_section): Likewise.
2033 (Dwp_output_file::add_contribution): Likewise.
2034 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2035 for empty slot.
2036 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2037 file format.
2038 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2039 slot.
2040 (Dwp_output_file::initialize): Remove unused function.
2041 (Dwp_output_file::finalize): Add support for v2 package file format.
2042 (Dwp_output_file::write_index): Likewise.
2043 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2044 function prototype.
2045
2500c017
CC
20462013-10-31 Cary Coutant <ccoutant@google.com>
2047
2048 * configure.ac: Fix check for -fmerge-constants.
2049 * configure.ac: Regenerate.
2050
dd0845d7
RM
20512013-10-30 Roland McGrath <mcgrathr@google.com>
2052
2053 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2054 Correct 9-byte nop sequence to match what the assembler generates.
2055
b4f7960d
AM
20562013-10-30 Alan Modra <amodra@gmail.com>
2057
2058 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2059 ppc64_local_entry_offset, ppc64_local_entry_offset,
2060 do_read_symbols): New functions.
2061 (Powerpc_relobj::e_flags_, st_other_): New vars.
2062 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2063 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2064 (Powerpc_relobj::e_flags_): New var.
2065 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2066 and adjust for ELFv2.
2067 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2068 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2069 (Powerpc_dynobj::do_find_special_sections): Likewise.
2070 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2071 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2072 to ELFv2 local entry.
2073 (Target_powerpc::do_relax): No thread safe barriers needed for
2074 ELFv2.
2075 (Output_data_plt_powerpc::initial_plt_entry_size_,
2076 plt_entry_size): Delete. Replace all uses with
2077 first_plt_entry_offset() and plt_entry_size().
2078 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2079 reserved_size parm. Update callers.
2080 (Output_data_plt_powerpc::entry_count): Update.
2081 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2082 and use Target_powerpc::first_plt_entry_offset().
2083 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2084 rename to plt_entry_size.
2085 (Output_data_plt_powerpc::add_ifunc_entry,
2086 add_local_ifunc_entry): Adjust reloc for ELFv2.
2087 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2088 (glink_eh_frame_fde_64v2): New.
2089 (Stub_table::plt_call_size): Support ELFv2 sizing.
2090 (Output_data_glink::add_eh_frame): Use the new FDE.
2091 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2092 (Stub_table::do_write): Write ELFv2 stubs and glink.
2093 (Target_powerpc::Relocate::relocate): Replaces nop after call
2094 with ld 2,24(1) and adjust local offset destination for ELFv2.
2095
f9c6b907
AM
20962013-10-30 Alan Modra <amodra@gmail.com>
2097
2098 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2099 (Target_powerpc::Scan::global, local): Likewise.
2100 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2101 on all ppc64 @h and @ha relocs.
2102
e84fe78f
AM
21032013-10-14 Alan Modra <amodra@gmail.com>
2104
2105 * output.h (Output_data_got::add_constant): Tidy.
2106 (Output_data_got::add_constant_pair): New function.
2107 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2108 methods used so as to first call reserve_ent().
2109
679e4abf
RM
21102013-10-11 Roland McGrath <mcgrathr@google.com>
2111
44dcb735
RM
2112 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2113 add_got_entry and add_got_entry_pair.
2114
13323c49
RM
2115 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2116 (HAVE_PUBNAMES): Likewise.
2117 * configure: Regenerate.
2118
1496b446
RM
2119 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2120 * testsuite/Makefile.in: Regenerate.
2121
cc84c10b
RM
2122 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2123 Remove const from declaration.
2124 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2125 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2126 * output.h (Output_file_header): Remove const from member target_
2127 and corresponding constructor argument.
2128 * output.cc (Output_file_header::Output_file_header): Update prototype.
2129 (Output_file_header::do_sized_write): Use this->target_ in place
2130 of parameters()->target().
2131
52f66a2c
RM
2132 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2133
2b64b551
RM
2134 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2135 * configure: Regenerate.
2136 * Makefile.in: Regenerate.
2137 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2138 * testsuite/merge_string_literals_2.c: Likewise.
2139 * testsuite/Makefile.am
2140 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2141 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2142 literal -fmerge-constants.
2143 * testsuite/Makefile.in: Regenerate.
2144
43819297
RM
2145 * i386.cc (Target_i386): Remove unused member dynbss_.
2146 * arm.cc (Target_arm): Likewise.
2147 * powerpc.cc (Target_powerpc): Likewise.
2148 * sparc.cc (Target_sparc): Likewise.
2149 * tilegx.cc (Target_tilegx): Likewise.
2150 * x86_64.cc (Target_x86_64): Likewise.
2151 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2152 type_signature_, type_offset_.
2153 * plugin.h (Plugin_hook): Remove unused member layout_.
2154 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2155 mapfile_.
2156 (Read_member): Remove unused members input_objects_, symtab_,
2157 mapfile_, layout_.
2158 (Check_library): Remove unused member symtab_.
2159 * archive.h (Lib_group): Remove unused member lib_.
2160 * archive.cc (Lib_group::Lib_group): Update initializer.
2161 * incremental.h (Incremental_binary): Remove unused member target_.
2162 (Incremental_script_entry): Removed unused member script_.
2163 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2164 * icf.h (Icf): Remove unused member num_tracked_relocs.
2165
39d9ead7
RM
2166 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2167 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2168 its only use.
2169 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2170
679e4abf
RM
2171 * archive.h: Use struct rather than class for forward declaration
2172 of Read_symbols_data.
2173
54de2ea6
CC
21742013-10-07 Cary Coutant <ccoutant@google.com>
2175
2176 PR gold/16010
2177 * testsuite/Makefile.am (icf_test): Fix dependencies.
2178 (icf_safe_test): Likewise.
2179 (icf_safe_so_test): Likewise.
2180 (large_symbol_alignment): Add empty _LDADD rule.
2181 * testsuite/Makefile.in: Regenerate.
2182
b14016f0
L
21832013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2184
2185 PR gold/15927
2186 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2187 relocation for R_X86_64_32 on x32.
2188
eb426534
RM
21892013-08-27 Roland McGrath <mcgrathr@google.com>
2190
2191 * output.cc (Output_segment::set_section_addresses): Take new
2192 Target* argument. If target->isolate_execinstr() and the segment
2193 is executable and starts at a target->abi_pagesize() boundary,
2194 pad its end out to a target->abi_pagesize() boundary with code fill.
2195 * output.h (Output_segment::set_section_addresses): Update decl.
2196 * layout.h (Layout::check_output_data_for_reset_values): Take new
2197 argument RELAX_OUTPUTS.
2198 (Layout): New member relax_output_list_.
2199 (Layout::add_relax_output): New method.
2200 * layout.cc (Layout::Layout): Update constructor.
2201 (Layout::reset_relax_output): New method.
2202 (Layout::clean_up_after_relaxation): Call it.
2203 (Layout::prepare_for_relaxation): Update caller.
2204 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2205 Call reset_relax_output before re-processing segments for
2206 isolate_execinstr case.
2207 (Layout::write_data): Handle relax_output_list_.
2208 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2209 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2210
9aff4b7a
NC
22112013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2212
2213 PR binutils/15834
2214 * object.h: Fix typos.
2215
93f8221c
RM
22162013-08-16 Roland McGrath <mcgrathr@google.com>
2217
2218 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2219 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2220
e44c3715
CC
22212013-08-07 Cary Coutant <ccoutant@google.com>
2222
2223 Revert support for v2 DWP files:
2224
2225 2013-03-01 Cary Coutant <ccoutant@google.com>
2226
2227 Add dwp support for v2 DWARF package file format.
2228 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2229 tu_length parameter. Adjust all callers.
2230 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2231 * dwp.cc: Include dwarf.h.
2232 (Section_bounds): New struct type.
2233 (Unit_set): New struct type.
2234 (Dwo_file::Dwo_file): Initialize new data member.
2235 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2236 Combine and rename to...
2237 (Dwo_file::read_unit_index): ...this.
2238 (Dwo_file::sized_read_compunit_index)
2239 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2240 (Dwo_file::sized_read_unit_index): ...this.
2241 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2242 parameters; add section_id parameter.
2243 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2244 (Dwo_file::add_unit_set): ...this.
2245 (Dwo_file::shndx_map_): Remove.
2246 (Dwo_file::sect_offsets_): New data member.
2247 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2248 (Dwp_output_file::add_section): Rename to...
2249 (Dwp_output_file::add_contribution): ...this.
2250 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2251 (Dwp_output_file::add_tu_set): Likewise.
2252 (Dwp_output_file::Contribution): New type.
2253 (Dwp_output_file::Section::contributions): New data member.
2254 (Dwp_output_file::Cu_or_tu_set): Remove.
2255 (Dwp_output_file::Section::Section): New ctor.
2256 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2257 (Dwp_output_file::Dwp_index::Section_table): New type.
2258 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2259 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2260 parameter.
2261 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2262 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2263 (Dwp_output_file::Dwp_index::section_table): New member function.
2264 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2265 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2266 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2267 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2268 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2269 (Dwp_output_file::Dwp_index::section_table_): New data member.
2270 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2271 (Dwp_output_file::add_output_section): New member function.
2272 (Dwp_output_file::write_new_section): New member function.
2273 (Dwp_output_file::write_contributions): New member function.
2274 (Dwp_output_file::section_id_map_): New data member.
2275 (class Dwo_id_info_reader): Remove.
2276 (class Unit_reader): New class.
2277 (get_dwarf_section_name): New function.
2278 (Dwo_file::read_executable): Adjust initializations of class data.
2279 (Dwo_file::read): Add support for v2 package file format.
2280 (Dwo_file::read_unit_index): Likewise.
2281 (Dwo_file::sized_read_unit_index): Likewise.
2282 (Dwo_file::copy_section): Likewise.
2283 (Dwo_file::add_unit_set): Likewise.
2284 (Dwp_output_file::add_output_section): Likewise.
2285 (Dwp_output_file::add_contribution): Likewise.
2286 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2287 for empty slot.
2288 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2289 file format.
2290 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2291 slot.
2292 (Dwp_output_file::initialize): Remove unused function.
2293 (Dwp_output_file::finalize): Add support for v2 package file format.
2294 (Dwp_output_file::write_index): Likewise.
2295 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2296 function prototype.
2297
c6905c28
CC
22982013-07-31 Cary Coutant <ccoutant@google.com>
2299
2300 * object.cc (Sized_relobj::do_output_section_address): New function.
2301 (Sized_relobj): Instantiate explicitly.
2302 * object.h (Object::output_section_address): New function.
2303 (Object::do_output_section_address): New function.
2304 (Sized_relobj::do_output_section_address): New function.
2305 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2306
23072013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2308 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2309
2310 * parameters.cc (Parameters::entry): Return target-specific entry
2311 symbol name.
2312 * target.h (Target::entry_symbol_name): New function.
2313 (Target_info::entry_symbol_name): New data member.
2314
2315 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2316 * i386.cc (Target_i386::i386_info): Likewise.
2317 (Target_i386_nacl::i386_nacl_info): Likewise.
2318 * sparc.cc (Target_sparc::sparc_info): Likewise.
2319 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2320 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2321 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2322 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2323
234d4ab8
SA
23242013-07-22 Sterling Augustine <saugustine@google.com>
2325
2326 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2327 Convert parameter shndx to local variable. Add parameters symtab
2328 and symtab_size. Scan over section names. Find relocation
2329 section corresponding to current section. Create and initialize
2330 reloc_mapper_ and reloc_type_.
2331 (Dwarf_pubnames_table::read_header): Add assertion. Change
2332 unit_length to off_t. Initialize member unit_length_. Fill in field
2333 cu_offset_.
2334 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2335 Initialize new fields unit_length_ and cu_offset_.
2336 (Dwarf_pubnames_table::read_section): Update prototype.
2337 (Dwarf_pubnames_table::cu_offset): New member function.
2338 (Dwarf_pubnames_table::subsection_size): Likewise.
2339 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2340 New fields.
2341 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2342 member functions public.
2343 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2344 Update comment. Rework logic. Move repeated parts to...
2345 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2346 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2347 pubtypes_table_, and stmt_list_offset.
2348 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2349 Gdb_index::find_pubtype_offset,
2350 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2351 (Gdb_index::pubnames_read): Update prototype and rework logic.
2352 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2353 Forward declare.
2354 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2355 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2356 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2357 Gdb_index::map_pubtable_to_dies):
2358 Declare functions.
2359 (Gdb_index::pubnames_read): Update declaration.
2360 (Gdb_index::Pubname_offset_map): New type.
2361 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2362 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2363 Gdb_index::stmt_list_offset): Declare.
2364 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2365 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2366 Gdb_index::pubtypes_offset_): Remove.
2367
a3ed37d8
RM
23682013-07-19 Roland McGrath <mcgrathr@google.com>
2369
2370 * options.h (General_options): Add -Trodata-segment option.
2371 * parameters.cc (Parameters::check_rodata_segment): New function.
2372 (Parameters::set_target_once): Call it.
2373 * parameters.h (Parameters): Declare it (private member function).
2374 * layout.cc (load_seg_unusable_for_headers): New function, broken
2375 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2376 then validate rodata segment rather than text segment.
2377 (relaxation_loop_body): Call that.
2378 (is_text_segment): New function. Don't admit a non-executable
2379 segment if TARGET->isolate_execinstr().
2380 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2381
eb5b4ded
CC
23822013-07-15 Shawn Landden <shawnlandden@gmail.com>
2383
2384 PR gold/15070
2385 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2386 * nacl.h (Sniff_file::View::View): Request aligned view.
2387
4d5effb9
CC
23882013-07-11 Cary Coutant <ccoutant@google.com>
2389
2390 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2391 correct BRLT entry size.
2392
ba8ca3e7
AM
23932013-07-03 Alan Modra <amodra@gmail.com>
2394
2395 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2396 comment.
2397
267257d2
CC
23982013-07-01 Cary Coutant <ccoutant@google.com>
2399
2400 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2401 reloc_type_.
2402 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2403 (Dwarf_ranges_table::lookup_reloc): New function.
2404 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2405 reloc_type_.
2406 (Dwarf_ranges_table::lookup_reloc): New function.
2407 (Dwarf_ranges_table::reloc_type_): New data member.
2408
06f30c9d
CC
24092013-06-27 Jing Yu <jingyu@google.com>
2410
2411 PR gold/15662
2412 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2413 function.
2414 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2415 (Target_powerpc::do_relax): Call the above.
2416
a2d7bf59
AM
24172013-06-27 Cary Coutant <ccoutant@google.com>
2418
2419 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2420 on garbage collected .opd section.
2421
24222013-06-27 Alan Modra <amodra@gmail.com>
2423
2424 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2425 is non-zero.
2426 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2427 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2428
32364e50
CC
24292013-06-14 Cary Coutant <ccoutant@google.com>
2430
2431 * resolve.cc (Symbol::override_base): Don't override st_type
2432 from plugin placeholder symbols.
2433 (Symbol_table::resolve): Likewise.
2434 (Symbol_table::should_override): Don't complain about TLS mismatch
2435 if the TO symbol is a plugin placeholder.
2436 * testsuite/Makefile.am (plugin_test_tls): New test.
2437 * testsuite/Makefile.in: Regenerate.
2438 * testsuite/plugin_test_tls.sh: New test script.
2439 * testsuite/two_file_test_2_tls.cc: New test source.
2440 * testsuite/two_file_test_tls.cc: New test source.
2441
7fb47cc9
CC
24422013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2443
2444 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2445 the maximum segment alignment is larger than the page size.
2446 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2447 correctly aligns the symbols with large alignemnt.
2448 * testsuite/Makefile.in: Regenerate.
2449 * testsuite/large_symbol_alignment.cc: New file.
2450
6934001a
CC
24512013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2452 Sriraman Tallam <tmsriram@google.com>
2453
2454 * options.h (sort_section): New option.
2455 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2456 Rename from Input_section_sort_section_name_special_ordering_compare.
2457 (Input_section_sort_section_name_compare): New struct.
2458 * output.cc (Output_section::Input_section_sort_section_name_compare::
2459 operator()): New function.
2460 (Output_section::sort_attached_input_sections): Use new sort function
2461 for .text if --sort-section=name is specified.
2462 * layout.cc (Layout::make_output_section):
2463 Add sorting by name when --sort-section=name is specified.
2464 * testsuite/Makefile.am (text_section_grouping): Test option
2465 --sort-section=name.
2466 * testsuite/Makefile.in: Regenerate.
2467 * testsuite/section_sorting_name.cc: New file.
2468 * testsuite/section_sorting_name.sh: New file.
2469
93acabad
CC
24702013-05-21 Cary Coutant <ccoutant@google.com>
2471
2472 * symtab.h (Symbol::is_cxx_vtable): New function.
2473 * target-reloc.h (relocate_section): Check for vtable symbol.
2474 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2475 * testsuite/Makefile.in: Regenerate.
2476 * testsuite/missing_key_func.cc: New test source.
2477 * testsuite/missing_key_func.sh: New test script.
2478
60e8b3fc
CC
24792013-05-21 Cary Coutant <ccoutant@google.com>
2480
2b64b551
RM
2481 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2482 type of enclosing symbol.
2483 (Relocate_info::location): Check symbol type when describing symbol.
2484 * object.h (Symbol_location_info): Remove unused line_number;
2485 add enclosing_symbol_type.
2486 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2487
9df9de2c
CC
24882013-05-13 Cary Coutant <ccoutant@google.com>
2489
2b64b551
RM
2490 * configure.ac: Export DEFAULT_TARGET.
2491 * configure: Regenerate.
2492 * Makefile.in: Regenerate.
2493 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2494 * testsuite/Makefile.in: Regenerate.
2495 * testsuite/debug_msg.sh: Delete duplicate tests.
2496 Don't check undef_int error message match for powerpc where the
2497 source file and line number aren't available.
9df9de2c 2498
bbc5ae17
RM
24992013-05-10 Roland McGrath <mcgrathr@google.com>
2500
2501 * options.h (General_options): Add --rosegment-gap option.
2502 * options.cc (finalize): --rosegment-gap implies --rosegment.
2503 * layout.cc (set_segment_offsets): Let user option override
2504 target->rosegment_gap().
2505
0c6e6c39
RM
25062013-05-10 Roland McGrath <mcgrathr@google.com>
2507
2508 * options.h (General_options): Remove leading space from help
2509 messages for -nostdlib and --rosegment.
2510
cde7cb01
MR
25112013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2512
2513 PR ld/15365
2514 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2515
f31ae5b8
AM
25162013-05-03 Alan Modra <amodra@gmail.com>
2517
2518 * merge.cc (Output_merge_string::do_add_input_section): Correct
2519 scan for number of strings. Rename vars to avoid shadowing.
2520 Include missing terminator in input_size_.
2521
d3a7cd45
L
25222013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2523
2524 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2525 Restore empty string handling.
2526
6ad3daba
CC
25272013-05-01 Cary Coutant <ccoutant@google.com>
2528
2529 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2530 uninitialized warning.
2531
e31908b6
CC
25322013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2533
2534 * output.cc (Output_section::add_merge_input_section): Allow
2535 to merge sections if the alignment is more than character size.
2536 * merge.h (Output_merge_string::Output_merge_string): Remove
2537 assert.
2538 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2539 only not-null strings. Check the alignment of strings.
2540 * stringpool.h
2541 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2542 alignment as the argument.
2543 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2544 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2545 Align non-zero length strings according to the addralign_.
2546 (Stringpool_template<Stringpool_char>::set_string_offsets):
2547 Updating offsets according to the given alignment.
2548 * testsuite/Makefile.am (text_section_grouping): Test if string
2549 literals are getting merged.
2550 * testsuite/Makefile.in: Regenerate.
2551 * testsuite/merge_string_literals_1.c: New file.
2552 * testsuite/merge_string_literals_2.c: Ditto.
2553 * testsuite/merge_string_literals.sh: Ditto.
2554
0e804863
ILT
25552013-04-26 Ian Lance Taylor <iant@google.com>
2556
2557 * target-reloc.h (relocate_section): If the reloc offset is out of
2558 range, pass VIEW as NULL to relocate.relocate.
2559 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2560 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2561 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2562 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2563 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2564 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2565
e7c5ea40
CC
25662013-04-26 Geoff Pike <gpike@chromium.org>
2567
2568 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2569 * layout.cc (Hash_task): New class.
2570 (Layout::queue_build_id_tasks): New function.
2571 (Layout::write_build_id): Handle single-thread portion of build ID
2572 computation. (In some cases, all of it is single-threaded.) Replace
2573 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2574 functionality in fewer lines of code.
2575 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2576 * options.h (General_options): make "--build-id" default to tree
2577 rather than sha1. Add two new options related to --build-id=tree:
2578 --build-id-chunk-size-for-treehash and
2579 --build-id-min-file-size-for-treehash.
2580 * Makefile.am: add testing of --build-id=tree and related new options
2581 (these tests will be invoked by "make check").
2582 * Makefile.in: Regenerate.
2583
49926cd0
AM
25842013-04-25 Alan Modra <amodra@gmail.com>
2585
2586 * configure.tgt: Add powerpcle and powerpc64le.
2587
a4034750
AM
25882013-04-22 Alan Modra <amodra@gmail.com>
2589
2590 PR gold/15355
2591 * layout.cc (Layout::segment_precedes): Allow more than one
2592 segment with the same type and flags.
2593
e79c84aa
CC
25942013-04-15 Cary Coutant <ccoutant@google.com>
2595
2596 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2597 allocate space in file for BSS sections.
2598
2199fbe7
CC
25992013-04-15 Cary Coutant <ccoutant@google.com>
2600
2601 * script-sections.cc (Orphan_output_section): Reset address
2602 to zero after each orphaned section for relocatable links.
2603
502e8a84
CC
26042013-04-15 Cary Coutant <ccoutant@google.com>
2605
a4034750
AM
2606 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2607 section starting address for relocatable link.
2608 * testsuite/Makefile.am (script_test_11): New test.
2609 * testsuite/Makefile.in: Regenerate.
2610 * testsuite/script_test_11.c: New source file.
2611 * testsuite/script_test_11.t: New linker script.
502e8a84 2612
0cfdc767
AM
26132013-04-13 Alan Modra <amodra@gmail.com>
2614
2615 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2616 owner when sections are not adjacent and exceed group size.
2617 (Target_powerpc::group_sections): Handle corner case.
2618 (Target_powerpc::Branch_info::make_stub): Handle case where
2619 stub table doesn't exist due to branches in non-exec sections.
2620 (Target_powerpc::Relocate::relocate): Likewise.
2621
6830ee24
AM
26222013-04-11 Alan Modra <amodra@gmail.com>
2623
2624 PR gold/15354
2625 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2626 .branch_lt to match bfd ld. Adjust comments throughout file.
2627
54a3d865
ILT
26282013-04-04 Ian Lance Taylor <iant@google.com>
2629
2630 GCC PR c++/56840
2631 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2632 sections before checking whether they are included in the link.
2633
9993ba11
ST
26342013-03-29 Sriraman Tallam <tmsriram@google.com>
2635
2636 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2637 object before calling the plugin claim_file handler. Pass the elf
2638 object of the archive to the plugin. Delete the elf object if the
2639 plugin claims the file.
2640
ebacd51e
AM
26412013-03-21 Alan Modra <amodra@gmail.com>
2642
2643 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2644 segment when omagic.
2645
117be58f
AM
26462013-03-21 Alan Modra <amodra@gmail.com>
2647
2648 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2649 comparison warning.
2650 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2651 uninitialized" warning.
2652
32e2b61d
AM
26532013-03-20 Alan Modra <amodra@gmail.com>
2654
2655 * symtab.h (Symbol::clear_version): New function.
2656 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2657 is_needed by weak references. Clear version for symbols defined
2658 in as-needed objects that are not needed.
2659
b3ccdeb5
AM
26602013-03-15 Alan Modra <amodra@gmail.com>
2661
2662 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2663 static and public. Add report_err param. Return false for data refs.
2664 (Target_powerpc::rela_dyn_section): New overloaded function.
2665 (Target_powerpc::plt_, iplt_): Elucidate.
2666 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2667 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2668 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2669 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2670 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2671 push_branch and make_plt_entry for ifunc syms when
2672 reloc_needs_plt_for_ifunc.
2673 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2674 for ifunc unless reloc_needs_plt_for_ifunc.
2675
ad3d8a2f
AM
26762013-03-15 Alan Modra <amodra@gmail.com>
2677
2678 * gc.h (gc_process_relocs): Don't look through function descriptors.
2679 * icf.cc (get_section_contents): Do so here instead.
2680
4d9aa155
AM
26812013-03-13 Alan Modra <amodra@gmail.com>
2682
2683 * powerpc.cc (is_branch_reloc): Forward declare.
2684 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2685 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2686 false for 64-bit, true for 32-bit non-branch relocs.
2687 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2688 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2689 nm output.
2690 (icf_safe_test): Generate linker map file as well as nm output.
2691 (icf_safe_so_test): Likewise.
2692 * testsuite/Makefile.in: Regenerate.
2693 * testsuite/icf_test.sh: Parse linker map file to determine
2694 section folding.
2695 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2696 * testsuite/icf_safe_so_test.sh: Likewise.
2697 (X86_32_or_ARM_specific_safe_fold): Merge into..
2698 (arch_specific_safe_fold): ..this.
2699 (X86_64_specific_safe_fold): Delete unused function.
2700
57420c20
AM
27012013-03-12 Alan Modra <amodra@gmail.com>
2702
2703 * gc.h (gc_process_relocs): Look through function descriptors
2704 to determine shndx, symvalue and addend used by ICF. Tidy
2705 variable duplication.
2706
dc3714f3
AM
27072013-03-11 Alan Modra <amodra@gmail.com>
2708
2709 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2710 * layout.cc (Layout_task_runner::run): ..to here.
2711 * symtab.h (struct Symbol_location): Extract from..
2712 (class Symbol_table): ..here.
2713 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2714 * target.h (class Target): Add function_location and
2715 do_function_location functions.
2716 (class Sized_target): Add do_function_location.
2717 * object.h (class Sized_relobj_file): Move find_shdr..
2718 (class Object): ..to here.
2719 * object.cc: Likewise. Update to suit. Instantiate.
2720 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2721 * powerpc.cc (class Powerpc_dynobj): New.
2722 (Target_powerpc::do_function_location): New function.
2723 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2724 (Powerpc_dynobj::do_read_symbols): New function.
2725 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2726
956b03bb
ILT
27272013-03-08 Ian Lance Taylor <iant@google.com>
2728
2729 * options.cc (General_options::string_to_object_format): Accept
2730 "default".
2731
4bead2d5
AM
27322013-03-08 Alan Modra <amodra@gmail.com>
2733
2734 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2735 pointer to Post_fde.
2736 (struct Post_fde): Move definition to here..
2737 * ehframe.cc (struct Post_fde): ..from here.
2738 (Cie::write): Don't alloc Post_fde.
2739 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2740
02e60bf7
AM
27412013-03-07 Alan Modra <amodra@gmail.com>
2742
2743 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2744 relocation referencing .LC0.
2745 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2746
8343f03a
AM
27472013-03-07 Alan Modra <amodra@gmail.com>
2748
2749 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2750 always_inline. Add assembly for powerpc to avoid GOT.
2751
3366d57c
AM
27522013-03-07 Alan Modra <amodra@gmail.com>
2753
2754 * testsuite/script_test_10.sh: Don't test .bss section
2755 header number.
2756
6c77229c
AM
27572013-03-06 Alan Modra <amodra@gmail.com>
2758
2759 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2760 (Target_powerpc::symval_for_branch): Add symtab param. Update
2761 all callers. Handle folded sections.
2762 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2763 to Powerpc_relobj.
2764 (Global_symbol_visitor_opd::operator()): Likewise.
2765
a39e4af6
AM
27662013-03-04 Alan Modra <amodra@gmail.com>
2767
2768 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2769 * testsuite/Makefile.in: Regenerate.
2770
d5834edb
CC
27712013-03-01 Cary Coutant <ccoutant@google.com>
2772
2773 Add dwp support for v2 DWARF package file format.
2774 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2775 tu_length parameter. Adjust all callers.
2776 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2777 * dwp.cc: Include dwarf.h.
2778 (Section_bounds): New struct type.
2779 (Unit_set): New struct type.
2780 (Dwo_file::Dwo_file): Initialize new data member.
2781 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2782 Combine and rename to...
2783 (Dwo_file::read_unit_index): ...this.
2784 (Dwo_file::sized_read_compunit_index)
2785 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2786 (Dwo_file::sized_read_unit_index): ...this.
2787 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2788 parameters; add section_id parameter.
2789 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2790 (Dwo_file::add_unit_set): ...this.
2791 (Dwo_file::shndx_map_): Remove.
2792 (Dwo_file::sect_offsets_): New data member.
2793 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2794 (Dwp_output_file::add_section): Rename to...
2795 (Dwp_output_file::add_contribution): ...this.
2796 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2797 (Dwp_output_file::add_tu_set): Likewise.
2798 (Dwp_output_file::Contribution): New type.
2799 (Dwp_output_file::Section::contributions): New data member.
2800 (Dwp_output_file::Cu_or_tu_set): Remove.
2801 (Dwp_output_file::Section::Section): New ctor.
2802 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2803 (Dwp_output_file::Dwp_index::Section_table): New type.
2804 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2805 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2806 parameter.
2807 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2808 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2809 (Dwp_output_file::Dwp_index::section_table): New member function.
2810 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2811 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2812 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2813 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2814 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2815 (Dwp_output_file::Dwp_index::section_table_): New data member.
2816 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2817 (Dwp_output_file::add_output_section): New member function.
2818 (Dwp_output_file::write_new_section): New member function.
2819 (Dwp_output_file::write_contributions): New member function.
2820 (Dwp_output_file::section_id_map_): New data member.
2821 (class Dwo_id_info_reader): Remove.
2822 (class Unit_reader): New class.
2823 (get_dwarf_section_name): New function.
2824 (Dwo_file::read_executable): Adjust initializations of class data.
2825 (Dwo_file::read): Add support for v2 package file format.
2826 (Dwo_file::read_unit_index): Likewise.
2827 (Dwo_file::sized_read_unit_index): Likewise.
2828 (Dwo_file::copy_section): Likewise.
2829 (Dwo_file::add_unit_set): Likewise.
2830 (Dwp_output_file::add_output_section): Likewise.
2831 (Dwp_output_file::add_contribution): Likewise.
2832 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2833 for empty slot.
2834 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2835 file format.
2836 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2837 slot.
2838 (Dwp_output_file::initialize): Remove unused function.
2839 (Dwp_output_file::finalize): Add support for v2 package file format.
2840 (Dwp_output_file::write_index): Likewise.
2841 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2842 function prototype.
2843
a68a081d
CC
28442013-03-01 Cary Coutant <ccoutant@google.com>
2845
2846 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2847 function into class definition in header file.
2848 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2849 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2850 New function.
2851 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2852
9d5781f8
AM
28532013-02-28 Alan Modra <amodra@gmail.com>
2854
2855 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2856 * target.cc (Target::do_plt_fde_location): New function.
2857 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2858 accessor function, and constructor param.
2859 (struct Post_fde, Post_fdes): Declare.
2860 (Cie::write): Add post_fdes param.
2861 * ehframe.cc (Fde::write): Use plt_fde_location.
2862 (struct Post_fde): Define.
2863 (Cie::write): Stash FDEs added post merge mapping.
2864 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2865 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2866 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2867 other FDEs.
2868 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2869 (Target_powerpc::has_glink): New function.
2870 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2871 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2872 glink_eh_frame_fde_32, default_fde): New data.
2873 (Stub_table::eh_frame_added_): New var.
2874 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2875 Make const.
2876 (Stub_table::add_eh_frame): New function.
2877 (Output_data_glink::add_eh_frame): New function.
2878 (Target_powerpc::make_glink_section): Call add_eh_frame.
2879
214383dd
ILT
28802013-02-15 Ian Lance Taylor <iant@google.com>
2881
2882 * options.h (DEFINE_uint64_alias): Define.
2883 (class General_options): Add -Ttext-segment as an alias for
2884 -Ttext.
2885
91c2b899
AM
28862013-02-15 Alan Modra <amodra@gmail.com>
2887
2888 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2889 (Stub_table::do_write): ..here, two places.
2890 (Stub_table::plt_call_size): Use it here too.
2891
20e2a8aa
ILT
28922013-02-11 Ian Lance Taylor <iant@google.com>
2893
2894 * descriptors.cc (Descriptors::close_all): New function.
2895 * descriptors.h (class Descriptors): Declare close_all.
2896 (close_all_descriptors): New inline function.
2897 * plugin.cc: Include "descriptors.h".
2898 (Plugin_manager::cleanup): Call close_all_descriptors.
2899
8952bc69
AM
29002013-02-06 Alan Modra <amodra@gmail.com>
2901
2902 * README: Update coding style link.
2903
29bd8b6b
CC
29042013-01-28 Cary Coutant <ccoutant@google.com>
2905
a4034750
AM
2906 * dwp.cc (File_list): New typedef.
2907 (Dwo_name_info_reader): New class.
2908 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2909 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2910 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2911 (Dwo_file::read_executable): New function.
2912 (Dwo_file::read): Move common setup code to ...
2913 (Dwo_file::make_object): ... here.
2914 (dwp_options): Add --exec/-e.
2915 (usage): Likewise.
2916 (main): Likewise.
29bd8b6b 2917
c6ac678d
ST
29182013-01-24 Sriraman Tallam <tmsriram@google.com>
2919
2920 * layout.cc (Layout::layout): Check for option text_reorder.
2921 (Layout::make_output_section): Ditto.
2922 * options.h (text_reorder): New option.
2923 * output.cc (Input_section_sort_compare): Remove special ordering
2924 of section names.
2925 (Output_section::
2926 Input_section_sort_section_name_special_ordering_compare::
2927 operator()): New function.
2928 (Output_section::sort_attached_input_sections): Use new sort function
2929 for .text.
2930 * output.h (Input_section_sort_section_name_special_ordering_compare):
2931 New struct.
2932 * testsuite/Makefile.am (text_section_grouping): Test option
2933 --no-text-reorder
2934 * testsuite/Makefile.in: Regenerate.
2935 * testsuite/text_section_grouping.sh: Check order of functions without
2936 default text reordering.
2937
50701cc1
MF
29382013-01-18 Mike Frysinger <vapier@gentoo.org>
2939
2940 * options.h (General_options): Change default to true for new_dtags.
2941
b1b00fcc
MF
29422013-01-18 Mike Frysinger <vapier@gentoo.org>
2943
2944 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2945 when enable_new_dtags is false. Only add DT_RUNPATH when
2946 enable_new_dtags is true.
2947
ec5b8187
AM
29482013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2949
2950 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2951 used in declaration and definition consistent.
2952 (Target_powerpc::symval_for_branch): Ditto.
2953
a880d4c4
ST
29542013-01-16 Sriraman Tallam <tmsriram@google.com>
2955
2956 * testsuite/plugin_final_layout.cc: Fix comment.
2957
7c381248
ST
29582013-01-16 Sriraman Tallam <tmsriram@google.com>
2959
2960 * layout.cc (Layout::layout): Do not do default sorting for
2961 text sections when section ordering is specified.
2962 (make_output_section): Ditto.
2963 * testsuite/plugin_final_layout.cc: Name the function sections
2964 to catch reordering issues.
2965
e2458743
AM
29662013-01-15 Alan Modra <amodra@gmail.com>
2967
2968 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2969 plt-thread-safe.
2970
431ed302
AM
29712013-01-15 Alan Modra <amodra@gmail.com>
2972
2973 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2974 * testsuite/Makefile.in: Regenerate.
2975
0ec6429b
AM
29762013-01-14 Alan Modra <amodra@gmail.com>
2977
2978 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2979 * testsuite/Makefile.in: Regenerate.
2980
0bf402d5
ILT
29812013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2982
36af3926 2983 PR bfd/14430
0bf402d5
ILT
2984 Fix mingw gold build with plugins enabled
2985 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2986 * configure.ac: Export DLOPEN_LIBS and add headers check.
2987 * plugin.cc: Handle non-dlfcn case.
2988 * Makefile.in: Regenerate.
2989 * config.in: Regenerate.
2990 * configure: Regenerate.
2991 * testsuite/Makefile.in: Regenerate.
2992
9e9143bc
ST
29932013-01-09 Sriraman Tallam <tmsriram@google.com>
2994
2995 * output.h (sort_attached_input_sections): Change to be public.
2996 * script-sections.cc
2997 (Output_section_definition::set_section_addresses): Sort
2998 attached input sections according to section order before linker
2999 script assigns section addresses.
3000 (Orphan_output_section::set_section_addresses): Sort
3001 attached input sections according to section order before linker
3002 script assigns section addresses.
3003 * Makefile.am (final_layout.sh): Use a simple linker script to
3004 check if section ordering still works.
3005 * Makefile.in: Regenerate.
3006
679af368
ILT
30072013-01-09 Ben Cheng <bccheng@google.com>
3008
3009 * arm.cc (Target_arm::attributes_accept_div): New function.
3010 (Target_arm::attributes_forbid_div): New function.
3011 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3012 attribute using the same new functions as what bfd/elf32_arm.c
3013 does.
3014
3136a00e
CC
30152013-01-07 Cary Coutant <ccoutant@google.com>
3016
3017 PR gold/14993
3018 * output.cc (Output_section::add_input_section): For incremental
3019 updates, don't track input sections that are allocated from patch
3020 space.
3021
f2a6224b
L
30222013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3023 Ian Lance Taylor <iant@google.com>
3024
3025 PR gold/14897
3026 * configure.ac (--enable-ld): Removed.
3027 (install_as_default): Set to yes only for --enable-gold=default
3028 or --disable-ld.
3029 * configure: Regenerated.
3030
4f46f626
L
30312013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3032
3033 * options.h (General_options): Add -fuse-ld= for GCC linker
3034 option compatibility.
3035
26e4ef59
CC
30362013-01-04 Cary Coutant <ccoutant@google.com>
3037
3038 * configure.ac: Fix typo restoring CXXFLAGS.
3039 * configure: Regenerate.
3040
3d587466
CC
30412013-01-04 Cary Coutant <ccoutant@google.com>
3042
4f46f626
L
3043 * testsuite/Makefile.am (CXXLINK_S): New macro.
3044 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3045 * testsuite/Makefile.in: Regenerate.
3d587466 3046
44db6695
L
30472013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3048
3049 * version.cc (print_version): Update copyright year to 2013.
3050
edcac0c1
ILT
30512012-12-20 Ian Lance Taylor <iant@google.com>
3052
3053 * layout.cc (Layout::special_ordering_of_input_section): New
3054 function.
3055 (Layout::layout): If input section requires special ordering, must
3056 sort input sections.
3057 (Layout::make_output_section): May sort .text input sections.
3058 (Layout::is_section_name_prefix_grouped): Remove.
3059 * layout.h (class Layout): Declare
3060 special_ordering_of_input_section. Don't declare
3061 is_section_name_prefix_grouped.
3062 * output.cc (Output_section::add_input_section): Revert last
3063 change.
3064 (Output_section::Input_section_sort::match_file_name): Don't crash
3065 if called on output section data.
3066 (Output_section::Input_section_sort_compare): Sort based on
3067 special ordering.
3068 (Output_section::Input_section_sort_section_order_index_compare):
3069 Revert last patch.
3070 (Output_section::sort_attached_input_sections): Likewise.
3071
28f2a4ac
ST
30722012-12-18 Sriraman Tallam <tmsriram@google.com>
3073
edcac0c1 3074 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3075 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3076 * output.cc (Output_section::add_input_section): Check if section
3077 name contains special prefix. Keep input sections to sort such
3078 sections.
3079 (Output_section::Input_section_sort_section_order_index_compare
3080 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3081 (Output_section::sort_attached_input_sections): Add condition to
3082 Input_section_entry constructor call.
28f2a4ac
ST
3083 * testsuite/Makefile.am (text_section_grouping): New test.
3084 * testsuite/Makefile.in: Regenerate.
3085 * testsuite/text_section_grouping.cc: New file.
3086 * testsuite/text_section_grouping.sh: New file.
3087
5bf135a7
NC
30882012-12-17 Nick Clifton <nickc@redhat.com>
3089
3090 * Makefile.am: Add copyright notice.
3091 * NEWS: Likewise.
3092 * README: Likewise.
3093 * configure.ac: Likewise.
3094 * ftruncate.c: Likewise.
3095 * Makefile.in: Regenerate.
3096
59965708
CC
30972012-12-14 Cary Coutant <ccoutant@google.com>
3098
a4034750
AM
3099 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3100 --no-as-needed flag.
3101 (exception_separate_shared_12_test): Likewise.
3102 (incremental_copy_test): Likewise.
3103 * testsuite/Makefile.in: Regenerate.
59965708 3104
2a77e2ab
CC
31052012-12-14 Cary Coutant <ccoutant@google.com>
3106
3107 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3108 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3109
e3deeb9c
AM
31102012-12-12 Alan Modra <amodra@gmail.com>
3111
3112 * powerpc.cc (class Track_tls): New.
3113 (class Relocate, class Scan): Inherit Track_tls.
3114 (Target_powerpc::Scan::local, global): Track tls optimization
3115 and avoid creating plt entry for __tls_get_addr if all uses
3116 are optimized away.
3117 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3118
d8f5a274
AM
31192012-12-12 Alan Modra <amodra@gmail.com>
3120
3121 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3122 Replace no_toc_optimize with toc_optimize.
3123 * output.h (Output_section::input_sections): Provide non-const variant.
3124 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3125 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3126 accessors.
3127 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3128 (class Sort_toc_sections): New.
3129 (Target_powerpc::do_finalize_sections): Sort toc sections.
3130 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3131
4c8a1de1
RM
31322012-12-10 Roland McGrath <mcgrathr@google.com>
3133
3134 * testsuite/binary_unittest.cc (read_all): New function.
3135 (Sized_binary_test): Use it instead of ::read.
3136 * fileread.cc (do_read): Don't assume pread always reads the whole
3137 amount in a single call.
3138
edc27beb
AM
31392012-12-10 Alan Modra <amodra@gmail.com>
3140
3141 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3142 Set EM_PPC64 or EM_PPC here.
3143 (Target_selector_powerpc::do_recognize): Delete.
3144
906b9150
AM
31452012-12-10 Alan Modra <amodra@gmail.com>
3146
3147 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3148 stub_table_.
3149 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3150
418c15ae
RM
31512012-12-07 Roland McGrath <mcgrathr@google.com>
3152
3153 * testsuite/binary_unittest.cc (Sized_binary_test):
3154 Use open_descriptor rather than ::open.
3155
decdd3bc
AM
31562012-12-07 Alan Modra <amodra@gmail.com>
3157
3158 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3159 typedef and invalid_address constant.
3160 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3161 instantiate constants.
3162
db399005
ILT
31632012-12-06 Roland McGrath <mcgrathr@google.com>
3164
3165 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3166 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3167 * aclocal.m4: Regenerate.
3168 * configure: Regenerate.
3169 * Makefile.in: Regenerate.
3170 * testsuite/Makefile.in: Regenerate.
3171
aba6bc71
AM
31722012-12-07 Alan Modra <amodra@gmail.com>
3173
3174 * options.h (General_options): Add no_toc_optimize.
3175 * powerpc.cc (ok_lo_toc_insn): New function.
3176 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3177
9e69ed50
AM
31782012-12-06 Alan Modra <amodra@gmail.com>
3179
3180 * options.h (General_options): Add plt_align, plt_static_chain,
3181 plt_thread_safe. Update stub_group_size help text.
3182 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3183 for new plt_thread_safe_ var.
3184 (use_plt_offset): Correct comments.
3185 (Target_powerpc::do_relax): Look for thread creation symbols to
3186 determine default plt_thread_safe value. Clear plt call stubs
3187 as well as branch stubs each iteration.
3188 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3189 insn constants.
3190 (l, hi, ha, write_insn): Move earlier.
3191 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3192 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3193 plt stubs too.
3194 (Stub_table::update_size): Adjust.
3195 (Stub_table::prev_size, set_prev_size): Delete.
3196 (Stub_table::stub_align): Let --plt-align affect result.
3197 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3198 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3199 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3200 (Stub_table::do_write): Support more stub variants.
3201
f43ba157
AM
32022012-12-04 Alan Modra <amodra@gmail.com>
3203
3204 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3205 (Target_powerpc::do_define_standard_symbols): New function.
3206
34171bc5
AM
32072012-12-03 Alan Modra <amodra@gmail.com>
3208
3209 * output.h: Formatting, whitespace.
3210
dc9589e9 32112012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3212
3213 * layout.h (Layout::get_executable_sections): Declare.
3214 * layout.cc (Layout::get_executable_sections): New function.
3215 * arm.cc (Target_arm::group_sections): Use it.
3216 (Arm_output_section::group_sections): Delete now redundant test.
3217 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3218 param to handle relative relocs.
3219 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3220 (Output_data_reloc::add_absolute): Adjust.
3221 (Output_data_reloc::add_relative): New function.
3222 (Output_data::reset_data_size): New function.
3223 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3224 (Output_section::set_addralign): New function.
3225 (Output_section::checkpoint_set_addralign): New function.
3226 (Output_section::clear_section_offsets_need_adjustment): New function.
3227 (Output_section::input_sections): Make public.
3228 * powerpc.cc (class Output_data_brlt_powerpc): New.
3229 (class Stub_table, class Stub_control): New.
3230 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3231 stub_table_, set_stub_table, stub_table): New vectors and accessor
3232 functions.
3233 (Target_powerpc::do_may_relax, do_relax, push_branch,
3234 new_stub_table, stub_tables, brlt_section, group_sections,
3235 add_branch_lookup_table, find_branch_lookup_table,
3236 write_branch_lookup_table, make_brlt_section): New functions.
3237 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3238 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3239 branch_info_): New vars.
3240 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3241 make call stubs here.
3242 (Output_data_glink): Remove all call stub handling from this class.
3243 (Target_powerpc::Scan::local, global): Save interesting branch
3244 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3245 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3246 functions on final link.
3247 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3248 Handle long branch destinations too.
3249 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3250 do_plt_address_for_local): Adjust lookup of plt call stubs.
3251
627b30b7
AM
32522012-11-30 Alan Modra <amodra@gmail.com>
3253
3254 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3255 relocs against protected symbols when building 32-bit shared libs.
3256
40b469d7
AM
32572012-11-30 Alan Modra <amodra@gmail.com>
3258
3259 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3260 param. Call got_section() to make .got. Update all callers
3261 and their callers and so on.
3262
bb66a627
AM
32632012-11-30 Alan Modra <amodra@gmail.com>
3264
3265 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3266 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3267 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3268 value if it already exists.
3269
d2cf1c6c
L
32702012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3271
3272 PR gold/14858
3273 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3274
edccdf7c
RM
32752012-11-14 Roland McGrath <mcgrathr@google.com>
3276
3277 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3278 than bfc instruction for data sandboxing.
3279
6febeb74
AM
32802012-11-08 Alan Modra <amodra@gmail.com>
3281
3282 * po/POTFILES.in: Regenerate.
3283
0a6f1bf2
AM
32842012-11-05 Alan Modra <amodra@gmail.com>
3285
3286 * configure.ac: Apply 2012-09-10 change to config.in here.
3287 * configure: Regenerate.
3288
26a4e9cb
AM
32892012-11-05 Alan Modra <amodra@gmail.com>
3290
3291 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3292 (struct Opd_ent): Use "Address" rather than "Offset".
3293 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3294 (Target_powerpc::got_section): Make public.
3295 (Target_powerpc::scan_relocs): Move code setting symbols..
3296 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3297 Create _SDA_BASE_ only when referenced.
3298
cc928013
RM
32992012-11-02 Roland McGrath <mcgrathr@google.com>
3300
3301 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3302 from last change.
3303
50ed5eb1
RM
33042012-11-01 Roland McGrath <mcgrathr@google.com>
3305
62fe925a
RM
3306 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3307 for offset_in_output_section parameter.
3308 (Sized_target::relocate_special_relocatable): Likewise.
3309 * arm.cc (Target_arm::relocate_relocs): Likewise.
3310 (Target_arm::relocate_special_relocatable): Likewise.
3311 * i386.cc (Target_i386::relocate_relocs): Likewise.
3312 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3313 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3314 * target-reloc.h (relocate_relocs): Likewise.
3315 * testsuite/testfile.cc (Target_test): Likewise.
3316 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3317 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3318
3319 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3320 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3321
3322 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3323 parameter, which is unused in the [!F_SETFD] case.
3324
50ed5eb1
RM
3325 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3326 SYMNDX to off_t before comparing it to this->data_size().
3327 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3328 * incremental.cc (Output_section_incremental_inputs::do_write):
3329 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3330
2cadc0bf
RM
3331 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3332
3bfcb652
NC
33332012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3334
3335 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3336 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3337 in EABI_VER5.
3338
c1a8d56e
CC
33392012-10-29 Cary Coutant <ccoutant@google.com>
3340
3341 * dwp.cc (usage): Add file and exit status parameters;
3342 add --help and --version options.
3343 (print_version): New function.
3344 (main): Add --help and --version options.
3345
b2490a7b
L
33462012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3347
3348 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3349 final_layout_sequence.txt.
3350 * testsuite/Makefile.in: Regenerated.
3351
aa543512
L
33522012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3353
3354 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3355 COMPILE generated by automake.
3356 (LINK1): Likewise.
3357 (CXXCOMPILE1): Likewise.
3358 (CXXLINK1): Likewise.
3359 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3360 (LINK): Likewise.
3361 (CXXCOMPILE): Likewise.
3362 (CXXLINK): Likewise.
3363 * testsuite/Makefile.in: Regenerated.
3364
d361fafb
L
33652012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3366
3367 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3368 on bad fwrite return.
3369
598c7410
L
33702012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3371
3372 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3373 on val.
3374
35c813e2
CC
33752012-10-23 Cary Coutant <ccoutant@google.com>
3376
3377 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3378 * testsuite/Makefile.in: Regenerate.
3379 * testsuite/dwp_test.h: New source file.
3380 * testsuite/dwp_test_1.cc: New source file.
3381 * testsuite/dwp_test_1.s: New source file.
3382 * testsuite/dwp_test_1.sh: New source file.
3383 * testsuite/dwp_test_1b.cc: New source file.
3384 * testsuite/dwp_test_1b.s: New source file.
3385 * testsuite/dwp_test_2.cc: New source file.
3386 * testsuite/dwp_test_2.s: New source file.
3387 * testsuite/dwp_test_2.sh: New source file.
3388 * testsuite/dwp_test_main.cc: New source file.
3389 * testsuite/dwp_test_main.s: New source file.
3390
77429909
CC
33912012-10-23 Cary Coutant <ccoutant@google.com>
3392
3393 * dwp.h: New header file.
3394 * dwp.cc: New source file.
3395 * gold.h: Move shared declarations to system.h.
3396 * system.h: New header file.
3397 * Makefile.am: Add dwp.
3398 * Makefile.in: Regenerate.
3399
ed5d6712
CC
34002012-10-23 Cary Coutant <ccoutant@google.com>
3401
3402 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3403 Dwarf_info_reader::read_from_pointer.
3404 (Dwarf_pubnames_table::read_header): Likewise.
3405 (Dwarf_pubnames_table::next_name): Likewise.
3406 (Dwarf_die::read_attributes): Likewise.
3407 (Dwarf_die::skip_attributes): Likewise.
3408 (Dwarf_info_reader::read_from_pointer): New function template.
3409 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3410 (Dwarf_pubnames_table): Likewise.
3411 (Dwarf_info_reader::read_from_pointer): New function template.
3412 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3413 Dwarf_pubnames_table ctor.
3414
8787852d
CC
34152012-10-23 Cary Coutant <ccoutant@google.com>
3416
3417 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3418 abbrev_shndx.
3419 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3420 abbrev_shndx_.
3421 (Dwarf_info_reader::set_abbrev_shndx): New method.
3422 (Dwarf_info_reader::abbrev_shndx_): New data member.
3423
9fc236f3
CC
34242012-10-23 Cary Coutant <ccoutant@google.com>
3425
3426 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3427 from object, not parameters.
3428 (Dwarf_info_reader::parse): Likewise.
3429 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3430 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3431 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3432 methods.
3433
effe8365
CC
34342012-10-23 Cary Coutant <ccoutant@google.com>
3435
3436 * fileread.cc (Input_file::Input_file): New constructor.
3437 * fileread.h (class Input_file): Add new constructor.
3438
1698990d
AM
34392012-10-18 Alan Modra <amodra@gmail.com>
3440
3441 PR gold/14727
3442 * object.cc (Relobj::is_section_name_included): Also match
3443 .sdata personality section.
3444
168a4726
AM
34452012-10-18 Alan Modra <amodra@gmail.com>
3446
3447 * target-reloc.h (class Default_comdat_behavior): New, package up..
3448 (get_comdat_behaviour): ..this.
3449 (relocate_section): Add Relocate_comdat_behavior template arg,
3450 adjust code to suit.
3451 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3452 (Target_arm::scan_reloc_section): Likewise.
3453 * i386.cc (Target_i386::relocate_section): Likewise.
3454 * sparc.cc (Target_sparc::relocate_section): Likewise.
3455 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3456 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3457 * powerpc.cc (class Relocate_comdat_behavior): New.
3458 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3459 gold::relocate_section with new template arg.
3460
acc276d8
AM
34612012-10-18 Alan Modra <amodra@gmail.com>
3462
3463 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3464 dynamic relocs for GOT_TPREL got entries, without symbol if
3465 resolving locally.
3466 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3467 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3468 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3469
e10f9870
AM
34702012-10-17 Alan Modra <amodra@gmail.com>
3471
3472 PR gold/14726
3473 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3474
ae034989
ST
34752012-10-16 Sriraman Tallam <tmsriram@google.com>
3476
3477 * layout.cc (Layout::include_section): Keep sections marked
3478 SHF_EXCLUDE when doing relocatable links.
3479
f3a0ed29
AM
34802012-10-16 Alan Modra <amodra@gmail.com>
3481
3482 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3483 (Target_powerpc::do_finalize_sections): Call it.
3484 (Output_data_save_res): New class and supporting functions.
3485 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3486 normal symbols defined in object files.
3487
c6de8ed4
AM
34882012-10-12 Alan Modra <amodra@gmail.com>
3489
3490 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3491 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3492 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3493 section if scan_opd_relocs not yet called.
3494 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3495
03e25981
AM
34962012-10-12 Alan Modra <amodra@gmail.com>
3497
3498 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3499 add_local_ifunc_entry): Revert last change.
3500 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3501
c9824451
AM
35022012-10-05 Alan Modra <amodra@gmail.com>
3503
3504 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3505 do_plt_address_for_global): New functions.
3506 (Output_data_got_powerpc::do_write): Don't segfault when linking
3507 statically.
3508 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3509 add_local_ifunc_entry): Return true on adding entry..
3510 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3511 glink->add_entry call. Remove unused symtab param. Adjust calls.
3512 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3513 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3514 set up symbols here.
3515 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3516 syms here. Do so even when no .iplt. Don't segfault when linking
3517 statically.
3518 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3519 new variants without reloc param.
3520 (Glink_sym_ent::Glink_sym_ent): Likewise.
3521 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3522 reloc when refs will resolve to plt call stub.
3523 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3524 R_PPC_PLTREL24 to resolve locally.
3525 (Target_powerpc::Scan::global): Correct ifunc handling.
3526 (Target_powerpc::Relocate::relocate): Correct local sym glink
3527 lookup. Don't destroy "value" when we have a plt call stub,
3528 and when checking plt call validity.
3529 (Target_powerpc::do_dynsym_value): Simplify.
3530
19fec8c1
AM
35312012-10-05 Alan Modra <amodra@gmail.com>
3532
3533 * i386.cc (Output_data_plt_i386::address_for_global,
3534 address_for_local): Add plt offset to returned value. Adjust uses.
3535 * sparc.cc (Output_data_plt_sparc::address_for_global,
3536 address_for_local): Likewise.
3537 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3538 address_for_local): Likewise.
3539 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3540 address_for_local): Likewise.
3541 * target.h (Target::plt_address_for_global, plt_address_for_local):
3542 Update comment.
3543 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3544 (Output_data_got::Got_entry::write): Nor here.
3545 * output.h: Comment fix.
3546
e867b647
WL
35472012-10-02 Jiong Wang <jiwang@tilera.com>
3548
3549 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3550 global_offset_table_ value for larget got.
3551 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3552
e5d5f5ed
AM
35532012-09-29 Alan Modra <amodra@gmail.com>
3554
3555 * powerpc.cc (Target_powerpc::iplt_): New output section.
3556 (Target_powerpc::iplt_section, make_iplt_section,
3557 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3558 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3559 Target_powerpc::plt_entry_count): Count iplt entries too.
3560 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3561 reloc section in constructor. New params.
3562 (Target_powerpc::make_plt_section): Create reloc section here instead.
3563 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3564 functions.
3565 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3566 (Output_data_glink::add_entry, find_entry): New functions to
3567 deal with local syms.
3568 (Glink_sym_ent): Add support for local syms.
3569 (Output_data_glink::do_write): Handle ifunc plt entries.
3570 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3571 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3572 (Target_powerpc::Relocate::relocate): Likewise.
3573 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3574
ec4dbad3
AM
35752012-09-25 Alan Modra <amodra@gmail.com>
3576
3577 * object.h (Sized_relobj_file::adjust_local_symbol,
3578 do_adjust_local_symbol): New functions.
3579 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3580 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3581 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3582 and irregular opd entry spacing.
3583 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3584 (Global_symbol_visitor_opd): New functor.
3585 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3586 on deleted opd entries.
3587
5c0b3823
WL
35882012-09-15 Jiong Wang <jiwang@tilera.com>
3589
3590 * tilegx.cc: New file.
3591 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3592 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3593 * configure.tgt: Add entries for tilegx*.
3594 * configure.ac: Likewise.
3595 * Makefile.in: Rebuild.
3596 * configure: Likewise.
3597 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3598 tilegx.
3599
bfdfa4cd
AM
36002012-09-13 Alan Modra <amodra@gmail.com>
3601
3602 * target-reloc.h (scan_relocs): Call scan.local for relocs
3603 against symbols in discarded sections. Pass is_discarded
3604 param.
3605 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3606 Add is_discarded param.
3607 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3608 is_discarded to flag opd entry as discarded. Don't emit dyn
3609 relocs on such entries.
3610 (Target_powerpc::Scan::global): Similarly detect and handle
3611 such opd entries.
3612 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3613 opd_ent_. Update all uses.
3614 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3615 (Target_powerpc::relocate_section): Zero out discarded opd
3616 entry relocs.
3617
d77a0555
ILT
36182012-09-12 Ian Lance Taylor <iant@google.com>
3619
3620 PR gold/14570
3621 * output.cc: Rename Output_data_got template parameter from size
3622 to got_size for all functions. Compile all variants of
3623 Output_data_got.
3624 (Output_data_got::Got_entry::write): Correct use of size for
3625 symbol value. Use local_is_tls rather than casting to
3626 Sized_relobj_file.
3627 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3628 (class Sized_relobj_file): Add do_local_is_tls.
3629 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3630
815a1205
AM
36312012-09-11 Alan Modra <amodra@gmail.com>
3632
3633 PR gold/14566
3634 * layout.cc (Layout::set_segment_offsets): When using
3635 common-page-size alignment, ensure we are on a new max-page-size
3636 page.
3637 * output.cc (Output_segment::set_section_addresses): Use
3638 abi_pagesize, not common_pagesize for relro boundary.
3639 (Output_segment::set_offset): Likewise.
3640
bd73a62d
AM
36412012-09-11 Alan Modra <amodra@gmail.com>
3642
3643 * output.h (Output_data_got::add_global_tls, add_local_tls,
3644 add_local_tls_pair): New functions.
3645 (Output_data_got::add_local_pair_with_rel): Remove second
3646 reloc param. Expand comment.
3647 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3648 use_plt_or_tls_offset_, similarly for constructor param.
3649 (Output_data_got::Got_entry::write): Add got_index param.
3650 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3651 add_local_tls_pair): New functions.
3652 (Output_data_got::Got_entry::write): Handle tls symbols
3653 with use_plt_or_tls_offset_ set specially.
3654 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3655 (Output_data_got::do_write): Replace iterator with index, pass
3656 index to entry write function.
3657 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3658 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3659 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3660 call.
3661 * i386.cc (Target_i386::Scan::local): Likewise.
3662 * sparc.cc (Target_sparc::Scan::local): Likewise.
3663 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3664 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3665 do_tls_offset_for_global): New functions.
3666 (Target_powerpc::Scan::local): Correct TLS relocations and got
3667 entry values.
3668 (Target_powerpc::Scan::global): Don't emit unnecessary
3669 dynamic relocations on TLS GOT entries.
3670
00716ab1
AM
36712012-09-10 Matthias Klose <doko@ubuntu.com>
3672
3673 * config.in: Disable sanity check for kfreebsd.
3674
c891b3f9
SA
36752012-09-10 Sterling Augustine <saugustine@google.com>
3676
3677 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3678 (Gdb_index::pubtypes_read): New parameter.
3679 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3680 to calls.
3681 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3682 pubtypes_object_.
3683
e81fea4d
AM
36842012-09-09 Alan Modra <amodra@gmail.com>
3685
3686 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3687 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3688 * gc.h (gc_process_relocs): Call target gc_add_reference.
3689 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3690 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3691 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3692 unnecessary cast.
3693 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3694 to cater for when we don't need code offset. Update use.
3695 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3696 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3697 set_opd_valid): New functions.
3698 (Target_powerpc::do_gc_add_reference): New function.
3699 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3700 stashed refs.
3701 (Target_powerpc::do_gc_mark_symbol): New function.
3702
d2d60eef
CC
37032012-09-06 Cary Coutant <ccoutant@google.com>
3704
3705 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3706 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3707 (Dwarf_die::skip_attributes): Likewise.
3708 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3709 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3710 (main): Call it.
3711 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3712
32ed4573
L
37132012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3714
3715 * testsuite/script_test_3.t: Add .got.plt output section
3716 statement.
3717 * testsuite/script_test_4.t: Likewise.
3718
f4baf0d4
AM
37192012-09-05 Alan Modra <amodra@gmail.com>
3720
3721 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3722 update all uses and lose "enum" when using type.
3723
864a1b56
AM
37242012-09-05 Alan Modra <amodra@gmail.com>
3725
3726 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3727 * configure: Regenerate.
3728 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3729 (plugin_final_layout.stdout): Likewise.
3730 (memory_test): Set page sizes to 0x1000.
3731 * testsuite/Makefile.in: Regenerate.
3732 * testsuite/discard_locals_test.sh: Add FIXME comment.
3733 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3734 * testsuite/pr14265.t: Add .got output section statement.
3735 * testsuite/script_test_2.t: Likewise.
3736 * testsuite/script_test_3.t: Likewise.
3737 * testsuite/script_test_4.t: Likewise.
3738 * testsuite/script_test_5.t: Likewise.
3739 * testsuite/script_test_6.t: Likewise.
3740 * testsuite/script_test_7.t: Likewise.
3741 * testsuite/script_test_9.t: Likewise.
3742
3ea0a085
AM
37432012-09-05 Alan Modra <amodra@gmail.com>
3744
3745 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3746 (Powerpc_relocate_functions::Status): New typedef.
3747 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3748 (Target_powerpc::Scan::local): Handle REL64.
3749 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3750 for REL32 and REL64.
3751 (Target_powerpc::symval_for_branch): New function, extracted from..
3752 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3753 checks. Report overflow errors.
3754
7404fe1b
AM
37552012-09-05 Alan Modra <amodra@gmail.com>
3756
3757 * object.h (Sized_relobj_file::emit_relocs): Delete.
3758 (Sized_relobj_file::emit_relocs_reltype): Delete.
3759 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3760 relocate_relocs for --emit-relocs.
3761 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3762 * output.h: Update comment.
3763 (Output_segment::first_section): New function.
3764 (Output_segment::first_section_load_address): Use first_section.
3765 * output.cc (Output_segment::first_section): New function extracted..
3766 (Output_segment::first_section_load_address): ..from here. Delete.
3767 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3768 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3769 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3770 adjust call to target.h function.
3771 * i386.cc (Target_i386): Likewise.
3772 * sparc.cc (Target_sparc): Likewise.
3773 * x86_64.cc (Target_x86_64): Likewise.
3774 * powerpc.cc (Target_powerpc): Likewise.
3775 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3776 first tls section has section symbol for optimised local dynamic
3777 output relocs.
3778 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3779 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3780 optimised tls code.
3781 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3782 Rename to relocate_relocs. Update error message.
3783
957564c9
AS
37842012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3785
3786 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3787 --just-symbols.
3788
dd93cd0a
AM
37892012-08-31 Alan Modra <amodra@gmail.com>
3790
3791 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3792 (Powerpc_relobj::toc_base_offset): New stub function.
3793 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3794 got_mod_index_offset to tlsld_got_offset. Update all refs.
3795 (Target_powerpc::Relocate::enum skip_tls): New.
3796 (Target_powerpc::call_tls_get_addr_): New var.
3797 (Target_powerpc::is_branch_reloc): Move to file scope.
3798 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3799 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3800 New functions.
3801 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3802 (powerpc_info): Correct common_pagesize for ppc64.
3803 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3804 (Powerpc_relocate_functions): Add overflow check enums and functions.
3805 Add non-shift version of rela, rela_ua. Delete all rel public
3806 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3807 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3808 addr16_ha3, addr14 functions.
3809 (Output_data_got_powerpc::add_constant_pair): New function.
3810 (Output_data_got_powerpc::got_base_offset): Likewise.
3811 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3812 (instruction constants): Sort, add some more.
3813 (Output_data_glink::do_write): Add and use Address typedef. Use
3814 object->toc_base_offset() stub for 64-bit.
3815 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3816 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3817 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3818 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3819 Always treat .opd relocs as against locally defined symbol.
3820 Correct condition for RELATIVE relocs.
3821 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3822 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3823 for 32-bit syms with a plt entry. Correct ppc64 toc base
3824 calculations. Handle TLS relocs, and more. Add overflow
3825 checking and adjust for Powerpc_relocate_functions changes.
3826 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3827 Reinstate --emit-relocs code with FIXME.
3828
a1373b60
AM
38292012-08-30 Alan Modra <amodra@gmail.com>
3830
3831 * layout.cc (Layout::set_segment_offsets): Set p_align to
3832 abi_pagesize, not common_pagesize.
3833 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3834 to determine whether file header can go in segment.
3835
703d02da
AM
38362012-08-30 Alan Modra <amodra@gmail.com>
3837
3838 * output.h (Output_reloc::Output_reloc <output section>): Add
3839 is_relative param. Adjust calls.
3840 (Output_reloc::add_output_section_relative): New functions.
3841 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3842 is_relative.
3843 (Output_reloc::symbol_value): Handle SECTION_CODE.
3844
16164a6b
ST
38452012-08-24 Sriraman Tallam <tmsriram@google.com>
3846
3847 * gold.cc (queue_middle_tasks): Call layout again when unique
3848 segments for sections is desired.
3849 * layout.cc (Layout::Layout): Initialize new members.
3850 (Layout::get_output_section_flags): New function.
3851 (Layout::choose_output_section): Call get_output_section_flags.
3852 (Layout::layout): Make output section for mapping to a unique segment.
3853 (Layout::insert_section_segment_map): New function.
3854 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3855 output sections marked so.
16164a6b
ST
3856 (Layout::segment_precedes): Check for unique segments when sorting.
3857 * layout.h (Layout::Unique_segment_info): New struct.
3858 (Layout::Section_segment_map): New typedef.
3859 (Layout::insert_section_segment_map): New function.
3860 (Layout::get_output_section_flags): New function.
3861 (Layout::is_unique_segment_for_sections_specified): New function.
3862 (Layout::set_unique_segment_for_sections_specified): New function.
3863 (Layout::unique_segment_for_sections_specified_): New member.
3864 (Layout::section_segment_map_): New member.
3865 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3866 Rename is_gc_pass_one to is_pass_one.
3867 Rename is_gc_pass_two to is_pass_two.
3868 Rename is_gc_or_icf to is_two_pass.
3869 Check for which pass based on whether symbols data is present.
3870 Make it two pass when unique segments for sections is desired.
3871 * output.cc (Output_section::Output_section): Initialize new
3872 members.
3873 * output.h (Output_section::is_unique_segment): New function.
3874 (Output_section::set_is_unique_segment): New function.
3875 (Output_section::is_unique_segment_): New member.
3876 (Output_section::extra_segment_flags): New function.
3877 (Output_section::set_extra_segment_flags): New function.
3878 (Output_section::extra_segment_flags_): New member.
3879 (Output_section::segment_alignment): New function.
3880 (Output_section::set_segment_alignment): New function.
3881 (Output_section::segment_alignment_): New member.
3882 (Output_segment::Output_segment): Initialize is_unique_segment_.
3883 (Output_segment::is_unique_segment): New function.
3884 (Output_segment::set_is_unique_segment): New function.
3885 (Output_segment::is_unique_segment_): New member.
3886 * plugin.cc (allow_unique_segment_for_sections): New function.
3887 (unique_segment_for_sections): New function.
3888 (Plugin::load): Add new functions to transfer vector.
3889 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3890 * Makefile.in: Regenerate.
3891 * testsuite/plugin_final_layout.sh: Check if unique segment
3892 functionality works.
3893 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3894 are available.
3895 (allow_unique_segment_for_sections): New global.
3896 (unique_segment_for_sections): New global.
3897 (claim_file_hook): Call allow_unique_segment_for_sections.
3898 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3899
1e2bee4f
CC
39002012-08-22 Cary Coutant <ccoutant@google.com>
3901
3902 * layout.cc (Layout::include_section): Don't assert on GROUP
3903 sections with --emit-relocs.
3904
1d5dfe78
CC
39052012-08-21 Cary Coutant <ccoutant@google.com>
3906
3907 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3908 if --export-dynamic-symbol names an undef symbol.
3909
c9269dff
AM
39102012-08-18 Alan Modra <amodra@gmail.com>
3911
3912 * powerpc.cc: Formatting and white space.
3913 (Powerpc_relobj): Rename got2_section_ to special_.
3914 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3915 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3916 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3917 (Target_powerpc): Add Address typedef and invalid_address. Use
3918 throughout.
3919 (Target_powerpc::is_branch_reloc): New function.
3920 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3921 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3922 for dst_mask, value and addend.
3923 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3924 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3925 (Output_data_glink::do_write): Correct toc base. Don't try to use
3926 uint16_t for 24-bit offset. Use get_output_section_offset and
3927 check return.
3928 (Target_powerpc::Scan::local): Handle more relocs.
3929 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3930 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3931 Plug in toc restoring insn after plt calls. Translate branches
3932 to function descriptor symbols to corresponding entry point.
3933 (Target_powerpc::relocate_for_relocatable): Check return from
3934 get_output_section_offset.
3935 * symtab.h: Comment typo.
3936
b1759dce
ILT
39372012-08-14 Ian Lance Taylor <iant@google.com>
3938
3939 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3940 unsupported_relocal_local to call unsupported_reloc_global.
3941
b9b2ae8b
NC
39422012-08-14 Nick Clifton <nickc@redhat.com>
3943
3944 PR ld/14265
3945 * script-sections.cc (Sections_element::output_section_name): Add
3946 keep return parameter.
3947 (Output_section_element::match_name): Add keep return parameter.
3948 Return the value of the keep_ member.
3949 * script-sections.h (class Output_section): Update
3950 output_section_name prototype.
3951 * layout.cc (Layout::keep_input_section): New public member
3952 function.
3953 (Layout::choose_output_section): Pass keep parameter to
3954 output_section_name.
3955 * layout.h (class Layout): Add keep_input_section.
3956 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3957 sections.
3958 * testsuite/Makefile.am: Add a test.
3959 * testsuite/Makefile.in: Regenerate.
3960 * testsuite/pr14265.c: Source file for the test.
3961 * testsuite/pr14265.t: Linker script for the test.
3962 * testsuite/pr14265.sh: Shell script for the test.
3963
921b5322
AM
39642012-08-14 Alan Modra <amodra@gmail.com>
3965
3966 * target.h (Target::output_section_name): New function.
3967 (Target::do_output_section_name): New function.
3968 * layout.cc (Layout::choose_output_section): Call the above.
3969 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3970
6ce78956
AM
39712012-08-14 Alan Modra <amodra@gmail.com>
3972
3973 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3974 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3975 for replace_constant call.
3976 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3977 (Output_data_glink::do_print_to_mapfile): New function.
3978 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3979 (Target_powerpc::Relocate::relocate): Likewise.
3980
d1a8cabd
AM
39812012-08-14 Alan Modra <amodra@gmail.com>
3982
3983 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3984 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3985 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3986 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3987 all references to shndx_. Handle special case for R_PPC_PLTREL24
3988 here.
3989 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3990 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3991 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3992 here.
3993 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3994 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3995
d83ce4e3
AM
39962012-08-12 Alan Modra <amodra@gmail.com>
3997
3998 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3999 (glink insn constants): Use uint32_t.
4000 (Output_data_glink::add_entry): Use insert, not [] operator.
4001
cf43a2fe
AM
40022012-08-11 Alan Modra <amodra@gmail.com>
4003
4004 * object.h (Sized_relobj_file::find_shdr): New function.
4005 (Sized_relobj_file::find_special_sections): New function.
4006 * object.cc (Sized_relobj_file::find_shdr): New function.
4007 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4008 (Sized_relobj_file::find_special_sections): New function, split out..
4009 (Sized_relobj_file::do_read_symbols): ..from here.
4010 * output.h (Output_data_got::replace_constant): New function.
4011 (Output_data_got::num_entries): New function.
4012 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4013 (Output_data_got::got_offset): Protected rather than private.
4014 (Output_data_got::replace_got_entry): New function.
4015 * output.cc (Output_data_got::replace_got_entry): New function.
4016 * powerpc.cc (class Powerpc_relobj): New.
4017 (class Powerpc_relocate_functions): Delete all psymval variants or
4018 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4019 Implement _ha functions using corresponding _hi function.
4020 (Powerpc_relobj::find_special_sections): New function.
4021 (Target_powerpc::do_make_elf_object): New function.
4022 (class Output_data_got_powerpc): New.
4023 (class Output_data_glink): New.
4024 (class Powerpc_scan_relocatable_reloc): New.
4025 Many more changes througout file.
4026
3c892704
NC
40272012-08-09 Nick Clifton <nickc@redhat.com>
4028
4029 * po/vi.po: Updated Vietnamese translation.
4030
82435b3b
ILT
40312012-08-07 Ian Lance Taylor <iant@google.com>
4032
4033 * layout.cc (Layout::add_target_dynamic_tags): If
4034 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4035 plt_rel.
4036
a6dc81d2
NC
40372012-07-30 Nick Clifton <nickc@redhat.com>
4038
4039 * po/gold.pot: Updated template.
4040 * po/es.po: Updated Spanish translation.
4041
f1415016
CC
40422012-07-18 Cary Coutant <ccoutant@google.com>
4043
4044 PR gold/14344
4045 * configure.ac: Add check for -gpubnames support.
4046 * configure: Regenerate.
4047 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4048 support; force -gno-pubnames.
4049 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4050 support.
4051 (gdb_index_test_4): New test.
4052 * testsuite/Makefile.in: Regenerate.
4053 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4054 * testsuite/gdb_index_test_2.sh: Likewise.
4055 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4056 * testsuite/gdb_index_test_4.sh: New script.
4057 * testsuite/gdb_index_test_comm.sh: New script with common code;
4058 don't look for space after colon.
4059
b7fd7c37
ST
40602012-07-16 Sriraman Tallam <tmsriram@google.com>
4061
4062 * gold.cc (queue_middle_tasks): Update function order only after
4063 deferred objects due to plugins are processed.
4064
1f3212db
ILT
40652012-07-11 Ian Lance Taylor <iant@google.com>
4066
4067 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4068 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4069 (Target_arm::scan_reloc_for_stub): Likewise.
4070 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4071 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4072 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4073 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4074 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4075
81c82a68
ILT
40762012-07-10 Dodji Seketeli <dodji@redhat.com>
4077 Ian Lance Taylor <iant@google.com>
4078
4079 PR gold/14309
4080 * configure.ac: Test whether std::tr1::hash<off_t> works.
4081 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4082 needed.
4083 * output.h (class Output_fill): Add virtual destructor.
4084 * configure, config.in: Rebuild.
4085
eabc84f4
RM
40862012-06-22 Roland McGrath <mcgrathr@google.com>
4087
4088 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4089
370e30b6
RÁE
40902012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4091
4092 * plugin.cc (Plugin::load): Handle position independent executables.
4093
fb1b895d
CC
40942012-06-06 Cary Coutant <ccoutant@google.com>
4095
4096 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4097 add .debug_macro.
4098 (lines_only_debug_sections): Likewise.
4099 (gdb_fast_lookup_sections): New static array.
4100 (is_gdb_debug_section): Rename formal parameter.
4101 (is_lines_only_debug_section): Likewise.
4102 (is_gdb_fast_lookup_section): New function.
4103 (Layout::include_section): Check for ".zdebug_" prefix; pass
4104 section name suffix to is_gdb_debug_section, et al.; check for
4105 fast-lookup sections when building .gdb_index.
4106 * options.h (--strip-debug-gdb): Update GDB version number.
4107
7c0640fa
CC
41082012-06-06 Cary Coutant <ccoutant@google.com>
4109
4110 * configure.ac: Add check for fallocate.
4111 * configure: Regenerate.
4112 * config.in: Regenerate.
4113
4114 * options.h (class General_options): Add --mmap-output-file and
4115 --posix-fallocate options.
4116 * output.cc: (posix_fallocate): Remove; replace with...
4117 (gold_fallocate): New function.
4118 (Output_file::map_no_anonymous): Call gold_fallocate.
4119 (Output_file::map): Check --mmap-output-file option.
4120
2a49eb69
DK
41212012-06-05 Jing Yu <jingyu@google.com>
4122
4123 * gold.h (textdomain): Add do {} to empty while(0).
4124 (bindtextdomain): Likewise.
4125
fad072ac
CC
41262012-06-04 Cary Coutant <ccoutant@google.com>
4127
4128 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4129 has_dynsym_index.
4130
8cc69fb6
ST
41312012-05-25 Sriraman Tallam <tmsriram@google.com>
4132
4133 * symtab.cc (Symbol_table::define_special_symbol):
4134 Initialize *poldsym to prevent uninitialized variable errors.
4135
1be75daa
CC
41362012-05-23 Cary Coutant <ccoutant@google.com>
4137
4138 * layout.cc (Layout::section_name_mapping): Add rules to handle
4139 exact match on .data.rel.ro.local or .data.rel.ro.
4140 (Layout::output_section_name): Check for exact matches.
4141
9b689de0
CC
41422012-05-23 Cary Coutant <ccoutant@google.com>
4143
4144 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4145 more carefully.
4146
b24fdbf5
CC
41472012-05-22 Cary Coutant <ccoutant@google.com>
4148
4149 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4150 object before exporting symbol.
4151
e550e1a2
L
41522012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4153
4154 * testsuite/tls_test.cc: Include "config.h" first.
4155 * testsuite/tls_test_c.c: Likewise.
4156
df7b86aa
NC
41572012-05-17 Daniel Richard G. <skunk@iskunk.org>
4158 Nick Clifton <nickc@redhat.com>
4159
4160 PR 14072
4161 * configure.in: Add check that sysdep.h has been included before
4162 any system header files.
4163 * configure: Regenerate.
4164 * config.in: Regenerate.
4165
1007b503
CC
41662012-05-14 Cary Coutant <ccoutant@google.com>
4167
4168 * layout.cc (Layout::make_output_section): Mark .tdata section
4169 as RELRO.
4170 * testsuite/relro_test.cc: Add a TLS variable.
4171
fd885f3a
L
41722012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4173
4174 PR gold/14091
4175 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4176 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4177 R_X86_64_64.
4178
80f5885c
CC
41792012-05-08 Cary Coutant <ccoutant@google.com>
4180
4181 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4182 (lines_only_debug_sections): Likewise.
4183
2e702c99
RM
41842012-05-02 Roland McGrath <mcgrathr@google.com>
4185
4186 * nacl.cc: New file.
4187 * nacl.h: New file.
4188 * Makefile.am (CCFILES, HFILES): Add them.
4189 * Makefile.in: Regenerate.
4190 * i386.cc (Output_data_plt_i386_nacl): New class.
4191 (Output_data_plt_i386_nacl_exec): New class.
4192 (Output_data_plt_i386_nacl_dyn): New class.
4193 (Target_i386_nacl): New class.
4194 (Target_selector_i386_nacl): New class.
4195 (target_selector_i386): Use it instead of Target_selector_i386.
4196 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4197 (Target_x86_64_nacl): New class.
4198 (Target_selector_x86_64_nacl): New class.
4199 (target_selector_x86_64, target_selector_x32): Use it instead of
4200 Target_selector_x86_64.
4201 * arm.cc (Output_data_plt_arm_nacl): New class.
4202 (Target_arm_nacl): New class.
4203 (Target_selector_arm_nacl): New class.
4204 (target_selector_arm, target_selector_armbe): Use it instead of
4205 Target_selector_arm.
4206
4207 * target-select.cc (select_target): Take new Input_file* and off_t
4208 arguments, pass them on to recognize method of selector.
4209 * object.cc (make_elf_sized_object): Update caller.
4210 * parameters.cc (parameters_force_valid_target): Likewise.
4211 * incremental.cc (make_sized_incremental_binary): Likewise.
4212 * target-select.h: Update decl.
4213 (Target_selector::recognize): Take new Input_file* argument,
4214 pass it on to do_recognize.
4215 (Target_selector::do_recognize): Take new Input_file* argument.
4216 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4217 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4218 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4219 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4220
4221 * target.h (Target::Target_info): New members isolate_execinstr
4222 and rosegment_gap.
4223 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4224 * arm.cc (Target_arm::arm_info): Update initializer.
4225 * i386.cc (Target_i386::i386_info): Likewise.
4226 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4227 * sparc.cc (Target_sparc::sparc_info): Likewise.
4228 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4229 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4230 * layout.cc (Layout::attach_allocated_section_to_segment):
4231 Take new const Target* argument. If target->isolate_execinstr(), act
4232 like --rosegment.
4233 (Layout::find_first_load_seg): Take new const Target* argument;
4234 if target->isolate_execinstr(), reject PF_X segments.
4235 (Layout::relaxation_loop_body): Update caller.
4236 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4237 reset file offset to zero when we hit LOAD_SEG, and then do a second
4238 loop over the segments before LOAD_SEG to reassign offsets after
4239 addresses have been determined. Handle target->rosegment_gap().
4240 (Layout::attach_section_to_segment): Take new const Target* argument;
4241 pass it to attach_allocated_section_to_segment.
4242 (Layout::make_output_section): Update caller.
4243 (Layout::attach_sections_to_segments): Take new const Target* argument;
4244 pass it to attach_section_to_segment.
4245 * gold.cc (queue_middle_tasks): Update caller.
4246 * layout.h (Layout): Update method decls with new arguments.
4247
4248 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4249 Target_info pointer to use.
4250 (Target_arm::do_make_data_plt): New virtual method.
4251 (Target_arm::make_data_plt): New method that calls it.
4252 (Target_arm::make_plt_entry): Use it.
4253 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4254 for the section alignment.
4255 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4256 method.
4257 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4258 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4259 method.
4260 (Output_data_plt_arm::get_plt_entry_size): Call it.
4261 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4262 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4263 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4264 method.
4265 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4266 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4267 method instead of sizeof(plt_entry).
4268 (Output_data_plt_arm::add_entry): Likewise.
4269 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4270 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4271 than static method.
4272 (Target_arm::plt_entry_size): Likewise.
4273 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4274 Move to ...
4275 (Output_data_plt_arm_standard): ... here, new class.
4276 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4277 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4278 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4279
4280 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4281 Take additional argument for the PLT entry size.
4282 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4283 Use get_plt_entry_size method rather than plt_entry_size variable.
4284 (Output_data_plt_x86_64::reserve_slot): Likewise.
4285 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4286 (Output_data_plt_x86_64::add_entry): Likewise.
4287 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4288 (Output_data_plt_x86_64::address_for_global): Likewise.
4289 (Output_data_plt_x86_64::address_for_local): Likewise.
4290 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4291 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4292 Make method non-static.
4293 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4294 method.
4295 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4296 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4297 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4298 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4299 virtual method.
4300 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4301 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4302 virtual method.
4303 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4304 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4305 virtual method.
4306 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4307 (Output_data_plt_x86_64::plt_entry_size)
4308 (Output_data_plt_x86_64::first_plt_entry)
4309 (Output_data_plt_x86_64::plt_entry)
4310 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4311 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4312 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4313 (Output_data_plt_x86_64_standard): ... here, new class.
4314 (Target_x86_64::Target_x86_64): Take optional argument for the
4315 Target_info pointer to use.
4316 (Target_x86_64::do_make_data_plt): New virtual method.
4317 (Target_x86_64::make_data_plt): New method to call it.
4318 (Target_x86_64::init_got_plt_for_update): Use that.
4319 Call this->plt_->add_eh_frame method here.
4320 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4321 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4322 rather than static method.
4323 (Target_x86_64::plt_entry_size): Likewise.
4324 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4325 rather than plt_entry_size variable. Move guts of PLT filling to...
4326 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4327 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4328 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4329
4330 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4331 additional argument for the section alignment.
4332 Don't do add_eh_frame_for_plt here.
4333 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4334 non-static. Use get_plt_entry_size method rather than plt_entry_size
4335 variable.
4336 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4337 method.
4338 (Output_data_plt_i386::get_plt_entry_size): Call it.
4339 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4340 (Output_data_plt_i386::add_eh_frame): New method to call it.
4341 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4342 method.
4343 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4344 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4345 method.
4346 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4347 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4348 method instead of plt_entry_size.
4349 (Output_data_plt_i386::plt_entry_size)
4350 (Output_data_plt_i386::plt_eh_frame_fde_size)
4351 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4352 (Output_data_plt_i386_standard): ... here, new class.
4353 (Output_data_plt_i386_exec): New class.
4354 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4355 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4356 (Output_data_plt_i386::exec_plt_entry): Move to ...
4357 (Output_data_plt_i386_exec::plt_entry): ... here.
4358 (Output_data_plt_i386_dyn): New class.
4359 (Output_data_plt_i386::first_plt_entry): Move to ...
4360 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4361 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4362 (Output_data_plt_i386_dyn::plt_entry): ... here.
4363 (Target_i386::Target_i386): Take optional argument for the Target_info
4364 pointer to use.
4365 (Target_i386::do_make_data_plt): New virtual method.
4366 (Target_i386::make_data_plt): New method to call it.
4367 (Target_i386::make_plt_section): Use that.
4368 Call this->plt_->add_eh_frame method here.
4369 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4370 rather than plt_entry_size variable.
4371 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4372 (Output_data_plt_i386::address_for_local): Likewise.
4373 (Output_data_plt_i386::do_write): Likewise.
4374 Move guts of PLT filling to...
4375 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4376 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4377 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4378 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4379
b9b9f2ee
CC
43802012-05-01 Cary Coutant <ccoutant@google.com>
4381
4382 * dwarf_reader.cc (Dwarf_die::read_attributes)
4383 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4384 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4385 * reduced_debug_output.cc
4386 (Output_reduced_debug_info_section::get_die_end): Remove
4387 DW_FORM_GNU_ref_index. Add default case.
4388
57923f48
MW
43892012-04-26 Mark Wielaard <mjw@redhat.com>
4390
4391 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4392 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4393 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4394 DW_AT_high_pc as offset from DW_AT_low_pc.
4395
4396 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4397 * testsuite/Makefile.in: Regenerate.
4398 * testsuite/gdb_index_test_3.c: New test source file.
4399 * testsuite/gdb_index_test_3.sh: New test source file.
4400
2c54b4f4
ILT
44012012-04-25 Ian Lance Taylor <iant@google.com>
4402
4403 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4404 pointer.
4405 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4406 as a class, not a struct.
4407 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4408 (Target_arm::apply_cortex_a8_workaround): Likewise.
4409 * gc.h: Declare Reloc_types as a struct, not a class.
4410 * object.h: Declare Symbols_data as a struct.
4411 * reloc.h: Declare Read_relocs_data as a struct.
4412 * target.h: Declare Relocate_info as a struct.
4413
a5a5f7a3
DM
44142012-04-24 David S. Miller <davem@davemloft.net>
4415
4416 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4417 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4418 and R_SPARC_WPLT30.
4419
f038d496
CC
44202012-04-24 Cary Coutant <ccoutant@google.com>
4421
4422 * incremental-dump.cc (find_input_containing_global): Replace
4423 magic number with symbolic constant.
4424 (dump_incremental_inputs): Update version number.
4425 * incremental.cc (Output_section_incremental_inputs): Update version
4426 number; import symbolic constants from Incremental_inputs_reader.
4427 (Incremental_inputs::create_data_sections): Align relocations
4428 section correctly for 64-bit targets.
4429 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4430 constants; add padding.
4431 (Output_section_incremental_inputs::write_header): Add assert for
4432 header_size.
4433 (Output_section_incremental_inputs::write_input_files): Add assert
4434 for input_entry_size.
4435 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4436 add assert for object_info_size, input_section_entry_size,
4437 global_sym_entry_size.
4438 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4439 for data structure sizes; use them.
4440 (Incremental_input_entry_reader): Import symbolic constants from
4441 Incremental_inputs_reader; use them.
4442
a4d85145
DM
44432012-04-23 David S. Miller <davem@davemloft.net>
4444
4445 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4446 and elf_flags_set_.
4447 (Target_sparc::Target_sparc): Initialize new fields.
4448 (Target_sparc::do_make_elf_object): New function.
4449 (Target_sparc::do_adjust_elf_header): New function.
4450
1d509098
CC
44512012-04-23 Cary Coutant <ccoutant@google.com>
4452
4453 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4454 CU range table of gdb index.
4455
7ebeff7f
DM
44562012-04-20 David S. Miller <davem@davemloft.net>
4457
4458 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4459 instead of false.
4460
13cf9988
DM
44612012-04-16 David S. Miller <davem@davemloft.net>
4462
2a1079e8
DM
4463 * sparc.cc (Target_sparc::got_address): New function.
4464 (Sparc_relocate_functions::gdop_hix22): New function.
4465 (Sparc_relocate_functions::gdop_lox10): New function.
4466 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4467 relocs.
4468 (Target_sparc::Scan::local): Likewise if the global symbol is not
4469 preemptible and is not IFUNC.
4470 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4471 transformations for local and non-preemptible non-IFUNC global
4472 symbols.
4473
0bc964fc
DM
4474 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4475 writing out 64-bit part of ranges.
4476
661d7a80
DM
4477 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4478 -fpic and -fpie respectively.
4479 * Makefile.in: Regenerate.
4480
8c2bf391
DM
4481 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4482 (Target_sparc::Target_sparc): Initialize new field.
4483 (Target_sparc::do_plt_section_for_global): New function.
4484 (Target_sparc::do_plt_section_for_local): New function.
4485 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4486 (Target_sparc::make_plt_section): New function, broken out of
4487 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4488 (Target_sparc::make_plt_entry): Call make_plt_section.
4489 (Target_sparc::make_local_ifunc_plt_entry): New function.
4490 (Target_sparc::rela_ifunc_section): New function.
4491 (Target_sparc::plt_section): Remove const.
4492 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4493 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4494 and ifunc_count_ fields.
4495 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4496 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4497 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4498 (Output_data_plt_sparc::rela_ifunc): New function.
4499 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4500 (Output_data_plt_sparc::has_ifunc_section): New function.
4501 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4502 (Output_data_plt_sparc::address_for_global): New function.
4503 (Output_data_plt_sparc::address_for_local): New function.
4504 (Output_data_plt_sparc::plt_index_to_offset): New function.
4505 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4506 and entry_count.
4507 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4508 entry_count.
4509 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4510 R_SPARC_JMP_IREL to switch.
4511 (Target_sparc::Scan::check_non_pic): Likewise.
4512 (Target_sparc::Scan::local): Handle IFUNC symbols.
4513 (Target_sparc::Scan::local): Likewise.
4514 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4515 and plt_address_for_local.
4516 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4517 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4518
13cf9988
DM
4519 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4520 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4521 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4522 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4523 global relocs too.
4524 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4525 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4526 calls.
4527 * sparc.cc (Target_sparc::Scan::global): Likewise.
4528 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4529
31821be0
CC
45302012-04-16 Cary Coutant <ccoutant@google.com>
4531
4532 * archive.cc (Library_base::should_include_member): Check for
4533 --export-dynamic-symbol.
4534 * options.h (class General_options): Add --export-dynamic-symbol.
4535 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4536 --export-dynamic-symbol.
4537 (Symbol_table::gc_mark_undef_symbols): Likewise.
4538 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4539
2615994e
DM
45402012-04-12 David S. Miller <davem@davemloft.net>
4541
4542 * sparc.cc (Reloc::wdisp10): New relocation method.
4543 (Reloc::h34): Likewise.
4544 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4545 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4546 R_SPARC_WDISP10.
4547 (Target_sparc::Scan::local): Likewise.
4548 (Target_sparc::Scan::global): Likewise.
4549 (Target_sparc::Relocate::relocate): Likewise.
4550
6782735d
CC
45512012-04-09 Cary Coutant <ccoutant@google.com>
4552
4553 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4554 low_pc == 0.
4555
8c7a0b00
ILT
45562012-04-06 Ian Lance Taylor <iant@google.com>
4557
4558 * timer.cc: #include <unistd.h>.
4559
58797674
RM
45602012-04-06 Roland McGrath <mcgrathr@google.com>
4561
4562 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4563 * config.in: Regenerate.
4564 * configure: Regenerate.
4565
44350750
NC
45662012-04-05 Nick Clifton <nickc@redhat.com>
4567
4568 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4569 (AM_LC_MESSAGES): Add.
4570 * aclocal.m4: Regenerate.
4571 * config.in: Regenerate.
4572 * configure: Regenerate.
4573
c1027032
CC
45742012-03-21 Cary Coutant <ccoutant@google.com>
4575
4576 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4577 * Makefile.in: Regenerate.
4578 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4579 (Sized_elf_reloc_mapper::symbol_section): New function.
4580 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4581 (make_elf_reloc_mapper): New function.
4582 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4583 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4584 (Dwarf_abbrev_table::do_get_abbrev): New function.
4585 (Dwarf_ranges_table::read_ranges_table): New function.
4586 (Dwarf_ranges_table::read_range_list): New function.
4587 (Dwarf_pubnames_table::read_section): New function.
4588 (Dwarf_pubnames_table::read_header): New function.
4589 (Dwarf_pubnames_table::next_name): New function.
4590 (Dwarf_die::Dwarf_die): New function.
4591 (Dwarf_die::read_attributes): New function.
4592 (Dwarf_die::skip_attributes): New function.
4593 (Dwarf_die::set_name): New function.
4594 (Dwarf_die::set_linkage_name): New function.
4595 (Dwarf_die::attribute): New function.
4596 (Dwarf_die::string_attribute): New function.
4597 (Dwarf_die::int_attribute): New function.
4598 (Dwarf_die::uint_attribute): New function.
4599 (Dwarf_die::ref_attribute): New function.
4600 (Dwarf_die::child_offset): New function.
4601 (Dwarf_die::sibling_offset): New function.
4602 (Dwarf_info_reader::check_buffer): New function.
4603 (Dwarf_info_reader::parse): New function.
4604 (Dwarf_info_reader::do_parse): New function.
4605 (Dwarf_info_reader::do_read_string_table): New function.
4606 (Dwarf_info_reader::lookup_reloc): New function.
4607 (Dwarf_info_reader::get_string): New function.
4608 (Dwarf_info_reader::visit_compilation_unit): New function.
4609 (Dwarf_info_reader::visit_type_unit): New function.
4610 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4611 Sized_elf_reloc_mapper.
4612 (Sized_dwarf_line_info::symbol_section): Remove function.
4613 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4614 (Sized_dwarf_line_info::read_line_mappings): Remove object
4615 parameter, adjust callers.
4616 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4617 * dwarf_reader.h: Include <sys/types.h>.
4618 (class Track_relocs): Remove forward declaration.
4619 (class Elf_reloc_mapper): New class.
4620 (class Sized_elf_reloc_mapper): New class.
4621 (class Dwarf_abbrev_table): New class.
4622 (class Dwarf_range_list): New class.
4623 (class Dwarf_ranges_table): New class.
4624 (class Dwarf_pubnames_table): New class.
4625 (class Dwarf_die): New class.
4626 (class Dwarf_info_reader): New class.
4627 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4628 (Sized_dwarf_line_info::symbol_section): Remove member function.
4629 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4630 base class.
4631 * gdb-index.cc: New source file.
4632 * gdb-index.h: New source file.
4633 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4634 and .debug_types sections, call Layout::add_to_gdb_index.
4635 (Sized_relobj_incr::do_section_name): Implement.
4636 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4637 return type; Implement.
4638 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4639 return type.
4640 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4641 parameter list and return type.
4642 (Sized_incr_dynobj::do_section_contents): Likewise.
4643 * layout.cc: Include gdb-index.h.
4644 (Layout::Layout): Initialize gdb_index_data_.
4645 (Layout::init_fixed_output_section): Check for .gdb_index section.
4646 (Layout::add_to_gdb_index): New function. Instantiate.
4647 * layout.h: Add forward declaration for class Gdb_index.
4648 (Layout::add_to_gdb_index): New member function.
4649 (Layout::gdb_index_data_): New data member.
4650 * main.cc: Include gdb-index.h.
4651 (main): Print statistics for gdb index.
4652 * object.cc (Object::section_contents): Move code into
4653 do_section_contents.
4654 (need_decompressed_section): Check for sections needed when building
4655 gdb index.
4656 (build_compressed_section_map): Likewise.
4657 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4658 gdb index.
4659 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4660 sections; call Layout::add_to_gdb_index.
4661 (Sized_relobj_file::do_decompressed_section_contents): Call
4662 do_section_contents directly.
4663 * object.h (Object::do_section_contents): Adjust parameter list and
4664 return type.
4665 (Object::do_decompressed_section_contents): Call do_section_contents
4666 directly.
4667 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4668 return type.
4669 * options.h (class General_options): Add --gdb-index option.
4670 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4671 list and return type.
4672 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4673 * reloc.h (Track_relocs::checkpoint): New function.
4674 (Track_relocs::reset): New function.
4675
4676 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4677 New test cases.
4678 * testsuite/Makefile.in: Regenerate.
4679 * testsuite/gdb_index_test.cc: New test source file.
4680 * testsuite/gdb_index_test_1.sh: New test source file.
4681 * testsuite/gdb_index_test_2.sh: New test source file.
4682
647f1574
DK
46832012-03-19 Doug Kwan <dougkwan@google.com>
4684
4685 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4686 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4687 __exidx_start and __exidx_end. Make symbol table parameter
4688 anonymous as it is not used.
4689 * gold.cc (queue_middle_tasks): Call target hook to define any
4690 target-specific symbols.
4691 * target.h (Target::define_standard_symbols): New method.
4692 (Target::do_define_standard_symbols): Same.
4693 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4694 * testsuite/Makefile.in: Regenerate.
4695 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4696 and __exidx_end.
4697 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4698 relocations are generated for __exidx_start and __exidx_end.
4699
7c6109da
DK
47002012-03-16 Doug Kwan <dougkwan@google.com>
4701
4702 * testsuite/Makefile.am: Disable test initpri3b.
4703 * testsuite/Makefile.in: Regenerate.
4704
7b8957f8
DK
47052012-03-15 Doug Kwan <dougkwan@google.com>
4706
4707 * arm.cc (Target_arm::got_section): Make .got section read-only
4708 if -z now is given.
4709
14dc9ef7
ILT
47102012-03-15 Ian Lance Taylor <iant@google.com>
4711
4712 PR gold/13850
4713 * layout.cc (Layout::make_output_section): Correctly mark
4714 SHT_INIT_ARRAY, et. al., as relro.
4715
fa40b62a
DK
47162012-03-14 Doug Kwan <dougkwan@google.com>
4717
4718 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4719 dynamic relocations for protected symbols in shared objects.
4720
fd325007
ILT
47212012-03-13 Ian Lance Taylor <iant@google.com>
4722
4723 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4724 keep the larger alignment.
4725
e8dd54e1
CC
47262012-03-12 Cary Coutant <ccoutant@google.com>
4727
4728 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4729 handling of DW_LNE_define_file.
4730
feb5f3b0
CC
47312012-03-12 Cary Coutant <ccoutant@google.com>
4732
4733 * reduced_debug_output.cc
4734 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4735 codes to switch.
4736
a1fb4256
CC
47372012-02-29 Cary Coutant <ccoutant@google.com>
4738
4739 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4740
5dd8762a
CC
47412012-02-29 Cary Coutant <ccoutant@google.com>
4742
4743 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4744 Call Object::decompressed_section_contents.
4745 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4746 New dtor.
4747 (Sized_dwarf_line_info::buffer_start_): New data member.
4748 * merge.cc (Output_merge_data::do_add_input_section): Call
4749 Object::decompressed_section_contents.
4750 (Output_merge_string::do_add_input_section): Likewise.
4751 * object.cc (need_decompressed_section): New function.
4752 (build_compressed_section_map): Decompress sections needed later.
4753 (Sized_relobj_file::do_decompressed_section_contents): New function.
4754 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4755 * object.h (Object::decompressed_section_contents): New function.
4756 (Object::discard_decompressed_sections): New function.
4757 (Object::do_decompressed_section_contents): New function.
4758 (Object::do_discard_decompressed_sections): New function.
4759 (Compressed_section_info): New type.
4760 (Compressed_section_map): Include decompressed section contents.
4761 (Sized_relobj_file::do_decompressed_section_contents): New function.
4762 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4763
7b5de7ee
CC
47642012-02-16 Cary Coutant <ccoutant@google.com>
4765
4766 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4767 * testsuite/Makefile.in: Regenerate.
4768
f9fa4a63
CC
47692012-02-14 Cary Coutant <ccoutant@google.com>
4770
4771 * options.cc (General_options::finalize): Disallow -pie and -static.
4772
2c175ebc
DK
47732012-02-03 Doug Kwan <dougkwan@google.com>
4774
4775 * arm.cc (Arm_relocate_functions::abs8,
4776 Arm_relocate_functions::abs16): Use
4777 Bits::has_signed_unsigned_overflow32.
4778 (Arm_relocate_functions::thm_abs8): Correct range of
4779 overflow check.
4780 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4781 in assertions.
4782
90cff06f
DK
47832012-02-02 Doug Kwan <dougkwan@google.com>
4784
4785 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4786 position independent outputs, not just shared objects.
4787
63887f3d
L
47882012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4789
4790 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4791 * configure: Regenerated.
4792
bef2b434
ILT
47932012-01-27 Ian Lance Taylor <iant@google.com>
4794
4795 * reloc.h (Bits): New class with static functions, copied from
4796 namespace utils in arm.cc.
4797 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4798 instead.
4799
c335b55d
L
48002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4801
4802 * incremental.cc (write_info_blocks): Correct relocation offset.
4803
41194d9f
L
48042012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4805
4806 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4807 (Relocate::tls_gd_to_le): Likewise.
4808
1bae613c
L
48092012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4810
4811 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4812
24482ca0
L
48132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4814
4815 * configure.ac: Check if -mcmodel=medium works.
4816 * configure: Regenerated.
4817
c2c7840a
CC
48182012-01-24 Cary Coutant <ccoutant@google.com>
4819
4820 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4821 definition and ...
4822 (read_unsigned_LEB_128_x): ... this new function.
4823 (read_signed_LEB_128): Replaced with inline definition and ...
4824 (read_signed_LEB_128_x): ... this new function.
4825 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4826 (read_unsigned_LEB_128): Add inline definition.
4827 (read_signed_LEB_128_x): New function.
4828 (read_signed_LEB_128): Add inline definition.
4829 * testsuite/Makefile.am (leb128_unittest): New unit test.
4830 * testsuite/Makefile.in: Regenerate.
4831 * testsuite/leb128_unittest.cc: New unit test.
4832
833de760 48332012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4834
4835 PR gold/13617
4836 * i386.cc (Target_i386::do_code_fill): When using a jmp
4837 instruction, pad with nop instructions.
4838 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4839
618d6666
L
48402012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4841
4842 * x86_64.cc (gc_process_relocs): Add typename on types used in
4843 template.
4844 (scan_relocs): Likewise.
4845 (relocate_section): Likewise.
4846 (apply_relocation): Likewise.
4847
3660ff06
L
48482012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4849
4850 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4851 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4852 under x32.
4853
fc51264f
L
48542012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4855
4856 * x86_64.cc: Initial support for x32.
4857
dd74ae06
CC
48582012-01-03 Cary Coutant <ccoutant@google.com>
4859
4860 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4861 Use abstract base class for GOT.
4862 * gold/output.h (class Output_data_got_base): New abstract base class.
4863 (class Output_data_got): Derive from new base class, adjust ctors.
4864 (Output_data_got::reserve_slot): Make virtual; rename to
4865 do_reserve_slot; Adjust callers.
4866 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4867 pointer to abstract base class.
4868 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4869
83896202
ILT
48702011-12-18 Ian Lance Taylor <iant@google.com>
4871
4872 * object.h (Relobj::local_symbol_value): New function.
4873 (Relobj::local_plt_offset): New function.
4874 (Relobj::local_has_got_offset): New function.
4875 (Relobj::local_got_offset): New function.
4876 (Relobj::set_local_got_offset): New function.
4877 (Relobj::do_local_symbol_value): New pure virtual function.
4878 (Relobj::do_local_plt_offset): Likewise.
4879 (Relobj::do_local_has_got_offset): Likewise.
4880 (Relobj::do_local_got_offset): Likewise.
4881 (Relobj::do_set_local_got_offset): Likewise.
4882 (Sized_relobj::do_local_has_got_offset): Rename from
4883 local_has_got_offset.
4884 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4885 (Sized_relobj::do_set_local_got_offset): Rename from
4886 set_local_got_offset.
4887 (Sized_relobj_file::do_local_plt_offset): Rename from
4888 local_plt_offset.
4889 (Sized_relobj_file::do_local_symbol_value): New function.
4890 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4891 local_plt_offset.
4892 * output.cc (Output_data_got::Got_entry::write): Change object to
4893 Relobj. Use local_symbol_value.
4894 (Output_data_got::add_global_with_rel): Change rel_dyn to
4895 Output_data_reloc_generic*. Use add_global_generic.
4896 (Output_data_got::add_global_with_rela): Remove. Change all
4897 callers to use add_global_with_rel.
4898 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4899 Output_data_reloc_generic*. Use add_global_generic.
4900 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4901 callers to use add_global_pair_with_rel.
4902 (Output_data_got::add_local): Change object to Relobj*.
4903 (Output_data_got::add_local_plt): Likewise.
4904 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4905 change rel_dyn to Output_data_reloc_generic*. Use
4906 add_local_generic.
4907 (Output_data_got::add_local_with_rela): Remove. Change all
4908 callers to use all_local_with_rel.
4909 (Output_data_got::add_local_pair_with_rel): Change object to
4910 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4911 add_output_section_generic.
4912 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4913 callers to use add_local_pair_with_rel.
4914 (Output_data_got::reserve_local): Change object to Relobj*.
4915 * output.h: (class Output_data_reloc_generic): Add pure virtual
4916 declarations for add_global_generic, add_local_generic,
4917 add_output_section_generic.
4918 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4919 functions for Output_data_reloc_generic. Update declarations for
4920 changes listed in output.cc.
4921 (class Output_data_got): Change template parameter to got_size.
4922 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4923 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4924 function.
4925 (Sized_relobj_incr::do_local_plt_offset): New function.
4926 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4927 add_global_generic.
4928
76677ad0
CC
49292011-12-17 Cary Coutant <ccoutant@google.com>
4930
4931 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4932 * resolve.cc (Symbol_table::resolve): Likewise.
4933 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4934 arrays.
4935 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4936
8b8dd8d5
ILT
49372011-12-16 Ian Lance Taylor <iant@google.com>
4938
4939 * output.h (Output_data_reloc_generic::add): Only call
4940 add_dynamic_reloc if this is a dynamic reloc section.
4941
d55525b9
L
49422011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4943
4944 PR gold/13505
4945 * target-reloc.h (apply_relocation): Replace <64, false> with
4946 <size, big_endian>.
4947
ff81c7c1
NC
49482011-11-25 Nick Clifton <nickc@redhat.com>
4949
4950 * po/it.po: New Italian translation.
4951
628f39be
SA
49522011-11-17 Sterling Augustine <saugustine@google.com>
4953
4954 * script.cc (script_include_directive): Implement.
4955 (read_script_file): New local variables name and search_path. Update
4956 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4957 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4958 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4959
98ef3ea4
SA
49602011-11-11 Sterling Augustine <saugustine@google.com>
4961
4962 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4963 (file_or_sections_cmd): Likewise.
4964
f4a8b6d7
DK
49652011-11-11 Doug Kwan <dougkwan@google.com>
4966
4967 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4968 if --just-symbols is given.
4969
29ab395d
DK
49702011-11-10 Doug Kwan <dougkwan@google.com>
4971
4972 PR gold/13362
4973 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4974 when processing data relocs.
4975 * reloc.h (Relocate_functions::rel_unaligned): New method.
4976 (Relocate_functions::pcrel_unaligned): Ditto.
4977 (Relocate_functions::rel32_unaligned): Ditto.
4978 (Relocate_functions::pcrel32_unaligned): Ditto.
4979
2c339f71
DK
49802011-11-09 Doug Kwan <dougkwan@google.com>
4981
4982 PR gold/13362
4983 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4984 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4985 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4986 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4987 (Relocate_functions::rel_unaligned): New.
4988 (Relocate_functions::rel32_unaligned): New.
4989 * target-reloc.h (relocate_for_relocatable): Add code to handle
4990 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4991 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4992 arm_unaligned_reloc_r): New targets.
4993 * testsuite/Makefile.in: Regenerate.
4994 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4995 linking.
4996
3f3cddf1
ILT
49972011-11-02 Ian Lance Taylor <iant@google.com>
4998
4999 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5000 NATIVE_LINKER.
5001 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5002 * options.cc (General_options::finalize): Use library search path
5003 from configure script if specified. If not native and no sysroot,
5004 only search TOOLLIBDIR.
5005 * options.h (Search_directory::Search_directory): Change name to
5006 const std::string&.
5007 (General_options::add_to_library_path_with_sysroot): Change arg to
5008 const std::string&.
5009 * configure, Makefile.in, config.in: Rebuild.
5010
a8e2273b
ILT
50112011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5012
5013 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5014 we are working around the ARM1176 Erratum.
5015 * options.h (General_options::fix_arm1176): Add option.
5016 * testsuite/Makefile.am: Add testcases, and keep current ones
5017 working.
5018 * testsuite/Makefile.in: Regenerate.
5019 * testsuite/arm_fix_1176.s: New file.
5020 * testsuite/arm_fix_1176.sh: Likewise.
5021
cd6eab1c
ILT
50222011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5023
5024 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5025 may_use_blx_.
5026 (Target_arm::may_use_blx): Remove method.
5027 (Target_arm::set_may_use_blx): Likewise.
5028 (Target_arm::may_use_v4t_interworking): New method.
5029 (Target_arm::may_use_v5t_interworking): Likewise.
5030 (Target_arm::may_use_blx_): Remove member variable.
5031 (Arm_relocate_functions::arm_branch_common): Check for v5T
5032 interworking.
5033 (Arm_relocate_functions::thumb_branch_common): Likewise.
5034 (Reloc_stub::stub_type_for_reloc): Likewise.
5035 (Target_arm::do_finalize_sections): Correct interworking checks.
5036 * testsuite/Makefile.am: Add new tests.
5037 * testsuite/Makefile.in: Regenerate.
5038 * testsuite/arm_farcall_arm_arm.s: New test.
5039 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5040 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5041 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5042 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5043 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5044 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5045 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5046
286adcf4
CC
50472011-10-31 Cary Coutant <ccoutant@google.com>
5048
5049 PR gold/13023
5050 * expression.cc (Expression::eval_with_dot): Add
5051 is_section_dot_assignment parameter.
5052 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5053 absolute and assigning to dot within a section.
5054 * script-sections.cc
5055 (Output_section_element_assignment::set_section_addresses): Pass
5056 dot_section to set_if_absolute.
5057 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5058 as is_section_dot_assignment flag to eval_with_dot.
5059 (Output_section_element_dot_assignment::set_section_addresses):
5060 Likewise.
5061 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5062 parameter. Also set value if relative to dot_section; set the
5063 symbol's output_section.
5064 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5065 parameter. Adjust all callers.
5066 (Expression::eval_maybe_dot): Likewise.
5067 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5068 Adjust all callers.
5069 * testsuite/script_test_2.t: Test assignment of an absolute value
5070 to dot within an output section element.
5071
9634ed06
CC
50722011-10-31 Cary Coutant <ccoutant@google.com>
5073
5074 * options.h (class General_options): Add --[no-]gnu-unique options.
5075 * symtab.cc (Symbol_table::sized_write_globals): Convert
5076 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5077
de4101c7
CC
50782011-10-31 Cary Coutant <ccoutant@google.com>
5079
5080 PR gold/13359
5081 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5082 unnecessary assertion.
5083 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5084
7257cc92
ST
50852011-10-31 Sriraman Tallam <tmsriram@google.com>
5086
5087 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5088 gc_mark_symbol.
5089 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5090 gc_mark_symbol.
5091 Change to just keep the section associated with symbol.
5092 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5093 they are externally visible and --export-dynamic is turned on.
5094 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5095
bfc34b3f
ILT
50962011-10-19 Ian Lance Taylor <iant@google.com>
5097
5098 PR gold/13163
5099 * script-sections.cc
5100 (Output_section_element_dot_assignment::needs_output_section): New
5101 function.
5102
ea0d8c47
ILT
51032011-10-19 Ian Lance Taylor <iant@google.com>
5104
5105 PR gold/13204
5106 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5107 --section-start option was seen.
5108 * options.h (General_options::any_section_start): New function.
5109
abd242a9
DM
51102011-10-18 David S. Miller <davem@davemloft.net>
5111
5112 PR binutils/13301
5113 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5114 member to track relocation locations that have moved during TLS
5115 reloc optimizations.
5116 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5117 (Target_sparc::Relocate::relocate): Adjust view down by 4
5118 bytes if it matches reloc_adjust_addr_.
5119 (Target_sparc::Relocate::relocate_tls): Always move the
5120 __tls_get_addr call delay slot instruction forward 4 bytes when
5121 performing relaxation.
5122
bab9090f
CC
51232011-10-18 Cary Coutant <ccoutant@google.com>
5124
5125 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5126 (Output_file::map_no_anonymous): Check for non-zero
5127 return code from posix_fallocate.
5128
f7c5b166
CC
51292011-10-17 Cary Coutant <ccoutant@google.com>
5130
5131 PR gold/13245
5132 * plugin.cc (is_visible_from_outside): Check for symbols
5133 referenced from dynamic objects.
5134 * resolve.cc (Symbol_table::resolve): Don't count references
5135 from dynamic objects as references from real ELF files.
5136 * testsuite/plugin_test_2.sh: Adjust expected result.
5137
b490c0bb
CC
51382011-10-17 Cary Coutant <ccoutant@google.com>
5139
5140 * gold.cc: Include timer.h.
5141 (queue_middle_tasks): Stamp time.
5142 (queue_final_tasks): Likewise.
5143 * main.cc (main): Store timer in parameters. Print timers
5144 for each pass.
5145 * parameters.cc (Parameters::Parameters): Initialize timer_.
5146 (Parameters::set_timer): New function.
5147 (set_parameters_timer): New function.
5148 * parameters.h (Parameters::set_timer): New function.
5149 (Parameters::timer): New function.
5150 (Parameters::timer_): New data member.
5151 (set_parameters_timer): New function.
5152 * timer.cc (Timer::stamp): New function.
5153 (Timer::get_pass_time): New function.
5154 * timer.h (Timer::stamp): New function.
5155 (Timer::get_pass_time): New function.
5156 (Timer::pass_times_): New data member.
5157
f475cf7b
CC
51582011-10-17 Cary Coutant <ccoutant@google.com>
5159
5160 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5161 task for members of lib groups.
5162
cdd7e244
CC
51632011-10-17 Cary Coutant <ccoutant@google.com>
5164
5165 PR gold/13288
4f95c8b4 5166 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5167 (File_read::make_view): Move bounds check (replace with assert)...
5168 (File_read::find_or_make_view): ... to here.
5169
dfb45471
CC
51702011-10-12 Cary Coutant <ccoutant@google.com>
5171
4f95c8b4 5172 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5173 ::read returns less than requested size.
5174
53bbcc1b
CC
51752011-10-10 Cary Coutant <ccoutant@google.com>
5176
4f95c8b4 5177 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5178 Initialize defined_count_.
5179 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5180 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5181 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5182 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5183 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5184 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5185 member.
5186 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5187 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5188 Return zeroes instead of internal error.
5189
397b129b
CC
51902011-10-10 Cary Coutant <ccoutant@google.com>
5191
5192 PR gold/13249
4f95c8b4 5193 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5194 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5195 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5196 (Output_reloc::type_): Adjust size of bit field.
5197 (Output_reloc::use_plt_offset_): New bit field.
5198 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5199 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5200 flag. Adjust all callers.
4f95c8b4 5201 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5202 creating RELATIVE relocations.
5203
d5698657
NC
52042011-10-10 Nick Clifton <nickc@redhat.com>
5205
5206 * po/es.po: Updated Spanish translation.
5207 * po/fi.po: Updated Finnish translation.
5208
6a59a5c2
DN
52092011-10-03 Diego Novillo <dnovillo@google.com>
5210
5211 * options.cc (parse_uint): Fix dereference of RETVAL.
5212
f0558624
ST
52132011-09-29 Sriraman Tallam <tmsriram@google.com>
5214
5215 * layout.h (section_order_map_): New member.
5216 (get_section_order_map): New member function.
5217 * output.cc (Output_section::add_input_section): Check for patterns
5218 only when --section-ordering-file is specified.
5219 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5220 output_sections have been formed.
5221 * layout.cc (Layout_Layout): Initialize section_order_map_.
5222 * plugin.cc (update_section_order): Store order in order_map. Do not
5223 update the order.
5224 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5225 * testsuite/Makefile.in: Regenerate.
5226 * testsuite/plugin_section_order.c: New file.
5227 * testsuite/plugin_final_layout.cc: New file.
5228 * testsuite/plugin_final_layout.sh: New file.
5229
a7dac153
CC
52302011-09-29 Cary Coutant <ccoutant@google.com>
5231
4f95c8b4 5232 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5233 Check for NULL.
4f95c8b4 5234 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5235 symbols during incremental update.
5236 (Symbol_table::add_from_dynobj): Likewise.
5237
eebd87a5
ILT
52382011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5239 Ian Lance Taylor <iant@google.com>
5240
5241 * symtab.cc (Symbol_table::define_special_symbol): Always
5242 canonicalize version string.
5243
403a3331
CC
52442011-09-26 Cary Coutant <ccoutant@google.com>
5245
4f95c8b4
CC
5246 * gold.cc (queue_initial_tasks): Move option checks ...
5247 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5248 some options; make others fatal.
5249
235061c2
CC
52502011-09-26 Cary Coutant <ccoutant@google.com>
5251
5252 gcc PR lto/47247
5253 * plugin.cc (get_symbols_v2): New function.
5254 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5255 (is_referenced_from_outside): New function.
5256 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5257 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5258 (get_symbols): Pass version parameter.
5259 (get_symbols_v2): New function.
5260 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5261 parameter.
5262 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5263 (onload): Add LDPT_GET_SYMBOLS_V2.
5264 (all_symbols_read_hook): Use get_symbols_v2; check for
5265 LDPR_PREVAILING_DEF_IRONLY_EXP.
5266 * testsuite/plugin_test_3.sh: Update expected results.
5267
dc87f620
ILT
52682011-09-23 Simon Baldwin <simonb@google.com>
5269
5270 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5271 configuration options.
5272 * configure: Regenerate.
5273 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5274 * Makefile.in: Regenerate.
5275 * testsuite/Makefile.in: Regenerate.
5276
a8279f82
ST
52772011-09-19 Sriraman Tallam <tmsriram@google.com>
5278
5279 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5280
0c9350c8
CC
52812011-09-19 Cary Coutant <ccoutant@google.com>
5282
5283 * incremental.cc (can_incremental_update): Fix typo in comment.
5284 * incremental.h (can_incremental_update): Likewise.
5285
aa06ae28
CC
52862011-09-18 Cary Coutant <ccoutant@google.com>
5287
5288 * incremental.cc (can_incremental_update): New function.
5289 * incremental.h (can_incremental_update): New function.
5290 * layout.cc (Layout::init_fixed_output_section): Call it.
5291 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5292 * object.cc (Sized_relobj_file::do_layout): Call
5293 can_incremental_update.
5294
ebb300b2
CC
52952011-09-13 Cary Coutant <ccoutant@google.com>
5296
5297 * configure.ac: Check for glibc support for gnu_indirect_function
5298 support with static linking, setting automake conditional
5299 IFUNC_STATIC.
5300 * Makefile.in: Regenerate.
5301 * configure: Regenerate.
5302
5303 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5304 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5305 for IFUNC_STATIC.
5306 * testsuite/Makefile.in: Regenerate.
5307
1206d0d5
CC
53082011-09-13 Cary Coutant <ccoutant@google.com>
5309
5310 * incremental.cc (Sized_relobj_incr::do_layout): Call
5311 report_comdat_group for kept comdat sections.
5312 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5313 * testsuite/Makefile.in: Regenerate.
5314 * testsuite/incr_comdat_test_1.cc: New source file.
5315 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5316 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5317 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5318
40b29874
ILT
53192011-09-13 Ian Lance Taylor <iant@google.com>
5320
5321 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5322 variable external_symbols_offset.
5323
1b045aac
ILT
53242011-09-12 Ian Lance Taylor <iant@google.com>
5325
5326 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5327 triggered if object has no symbols.
5328
24c6c55a
DM
53292011-09-09 David S. Miller <davem@davemloft.net>
5330
5331 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5332 (Output_fill_debug_line::do_write): Likewise.
5333
66570254
CC
53342011-08-29 Cary Coutant <ccoutant@google.com>
5335
5336 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5337 casts to match formatting specs.
5338 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5339
8ea8cd50
CC
53402011-08-26 Cary Coutant <ccoutant@google.com>
5341
5342 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5343 remaining hole size when allocating.
5344 (Layout::make_output_section): Set fill methods for debug sections.
5345 * layout.h (Free_list::Free_list_node): Move from private to
5346 public.
5347 (Free_list::set_min_hole_size): New function.
5348 (Free_list::begin, Free_list::end): New functions.
5349 (Free_list::min_hole_): New data member.
5350 * output.cc: Include dwarf.h.
5351 (Output_fill_debug_info::do_minimum_hole_size): New function.
5352 (Output_fill_debug_info::do_write): New function.
5353 (Output_fill_debug_line::do_minimum_hole_size): New function.
5354 (Output_fill_debug_line::do_write): New function.
5355 (Output_section::Output_section): Initialize new data member.
5356 (Output_section::set_final_data_size): Ensure patch space is larger
5357 than minimum hole size.
5358 (Output_section::do_write): Fill holes in debug sections.
5359 * output.h (Output_fill): New class.
5360 (Output_fill_debug_info): New class.
5361 (Output_fill_debug_line): New class.
5362 (Output_section::set_free_space_fill): New function.
5363 (Output_section::free_space_fill_): New data member.
5364 * testsuite/Makefile.am (incremental_test_3): Add
5365 --incremental-patch option.
5366 (incremental_test_4): Likewise.
5367 (incremental_test_5): Likewise.
5368 (incremental_test_6): Likewise.
5369 (incremental_copy_test): Likewise.
5370 (incremental_common_test_1): Likewise.
5371 * testsuite/Makefile.in: Regenerate.
5372
7cf80422
NC
53732011-08-26 Nick Clifton <nickc@redhat.com>
5374
5375 * po/es.po: Updated Spanish translation.
5376
c3f7b0e5
CC
53772011-08-01 Cary Coutant <ccoutant@google.com>
5378
5379 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5380 * gold/testsuite/Makefile.in: Regenerate.
5381 * gold/testsuite/justsyms_exec.c: New source file.
5382 * gold/testsuite/justsyms_lib.c: New source file.
5383
9590bf25
CC
53842011-08-01 Cary Coutant <ccoutant@google.com>
5385
5386 * layout.cc (Layout::set_segment_offsets): Don't realign text
5387 segment if -Ttext was specified.
5388 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5389 file type.
5390 * object.h (Sized_relobj_file::e_type): New function.
5391 (Sized_relobj_file::e_type_): New data member.
5392 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5393 base address for ET_EXEC files.
5394 * target.cc (Target::do_make_elf_object_implementation): Allow
5395 ET_EXEC files with --just-symbols option.
5396
dcd8d12e
CC
53972011-07-28 Cary Coutant <ccoutant@google.com>
5398
5399 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5400 Add thread_number parameter.
5401 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5402 * workqueue-threads.cc
5403 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5404 current thread if its thread number is greater than desired thread
5405 count.
5406 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5407 Add thread_number parameter.
5408 (Workqueue::should_cancel_thread): Likewise.
5409 (Workqueue::find_runnable_or_wait): Pass thread_number to
5410 should_cancel_thread.
5411 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5412 parameter.
5413
804eb480
ST
54142011-07-22 Sriraman Tallam <tmsriram@google.com>
5415
5416 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5417 only after checking if it cannot be forced local.
5418 * symtab.h (is_externally_visible): Check if the symbol is not forced
5419 local.
5420
f1ddb600
ILT
54212011-07-15 Ian Lance Taylor <iant@google.com>
5422
5423 * options.h (class General_options): Add --print-output-format.
5424 Move -EL next to -EB, for better --help output.
5425 * target-select.cc: Include <cstdio>, "options.h", and
5426 "parameters.h".
5427 (Target_selector::do_target_bfd_name): New function.
5428 (print_output_format): New function.
5429 * target-select.h (class Target_selector): Update declarations.
5430 (Target_selector::target_bfd_name): New function.
5431 (print_output_format): Declare.
5432 * main.cc: Include "target-select.h".
5433 (main): Handle --print-output-format.
5434 * gold.cc: Include "target-select.h".
5435 (queue_initial_tasks): Handle --print-output-format when there are
5436 no input files.
5437 * parameters.cc (parameters_force_valid_target): Give a better
5438 error message if -EB/-EL does not match target.
5439 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5440 function.
5441
7d172687
ILT
54422011-07-15 Ian Lance Taylor <iant@google.com>
5443
5444 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5445 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5446 (Output_data_plt_i386::do_write): Write address of .dynamic
5447 section to first entry in .got.plt section.
5448 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5449 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5450 Initialize layout_.
5451 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5452 section to first entry in .got.plt section.
5453 * layout.h (Layout::dynamic_section): New function.
5454
e9552f7e
ST
54552011-07-13 Sriraman Tallam <tmsriram@google.com>
5456
5457 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5458 to claim_file call.
5459 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5460 input_section_position_, and input_section_glob_.
5461 (read_layout_from_file): Call function section_ordering_specified.
5462 * layout.h (is_section_ordering_specified): New function.
5463 (section_ordering_specified): New function.
5464 (section_ordering_specified_): New boolean member.
5465 * main.cc(main): Call load_plugins after layout object is defined.
5466 * output.cc (Output_section::add_input_section): Use
5467 function section_ordering_specified to check if section ordering is
5468 needed.
5469 * output.cc (Output_section::add_relaxed_input_section): Use
5470 function section_ordering_specified to check if section ordering is
5471 needed.
5472 (Output_section::update_section_layout): New function.
5473 (Output_section::sort_attached_input_sections): Check if input section
5474 must be reordered.
5475 * output.h (Output_section::update_section_layout): New function.
5476 * plugin.cc (get_section_count): New function.
5477 (get_section_type): New function.
5478 (get_section_name): New function.
5479 (get_section_contents): New function.
5480 (update_section_order): New function.
58797674 5481 (allow_section_ordering): New function.
e9552f7e
ST
5482 (Plugin::load): Add the new interfaces to the transfer vector.
5483 (Plugin_manager::load_plugins): New parameter.
5484 (Plugin_manager::all_symbols_read): New parameter.
5485 (Plugin_manager::claim_file): New parameter. Save the elf object for
5486 unclaimed objects.
5487 (Plugin_manager::get_elf_object): New function.
5488 (Plugin_manager::get_view): Change to directly use the bool to check
5489 if get_view is called from claim_file_hook.
5490 * plugin.h (input_objects): New function
5491 (Plugin__manager::load_plugins): New parameter.
5492 (Plugin_manager::claim_file): New parameter.
5493 (Plugin_manager::get_elf_object): New function.
5494 (Plugin_manager::in_claim_file_handler): New function.
5495 (Plugin_manager::in_claim_file_handler_): New member.
5496 (layout): New function.
5497 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5498 handler with an extra parameter. Make the elf object before calling
5499 claim_file handler.
5500 * testsuite/plugin_test.c (get_section_count): New function pointer.
5501 (get_section_type): New function pointer.
5502 (get_section_name): New function pointer.
5503 (get_section_contents): New function pointer.
5504 (update_section_order): New function pointer.
5505 (allow_section_ordering): New function pointer.
5506 (onload): Check if the new interfaces exist.
5507
9446efde
ILT
55082011-07-13 Ian Lance Taylor <iant@google.com>
5509
5510 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5511 relro section.
5512 * x86_64.cc (Target_x86_64::got_section): Likewise.
5513 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5514 (relro_now_test_SOURCES): New variable.
5515 (relro_now_test_DEPENDENCIES): New variable.
5516 (relro_now_test_LDFLAGS): New variable.
5517 (relro_now_test_LDADD): New variable.
5518 (relro_now_test.so): New target.
5519 * testsuite/Makefile.in: Rebuild.
5520
07aa62f2
ILT
55212011-07-12 Ian Lance Taylor <iant@google.com>
5522
5523 PR gold/12980
5524 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5525 GLOB_DAT relocation rather than a RELATIVE relocation for a
5526 protected symbol when creating a shared library.
5527 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5528 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5529 * testsuite/protected_main_1.cc (main): Test that protected
5530 function has same address.
5531
e2153196
ILT
55322011-07-11 Ian Lance Taylor <iant@google.com>
5533
5534 PR gold/12979
5535 * options.h (class General_options): Add -Bgroup.
5536 * options.cc (General_options::finalize): If -Bgroup is set,
5537 default to --unresolved-symbols=report-all.
5538 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5539 * target-reloc.h (issue_undefined_symbol_error): Handle
5540 --unresolved-symbols=report-all.
5541
6daf5215
ILT
55422011-07-08 Ian Lance Taylor <iant@google.com>
5543
5544 PR gold/11985
5545 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5546 if linker script discards key sections.
5547 (Layout::create_dynamic_symtab): Likewise.
5548 (Layout::assign_local_dynsym_offsets): Likewise.
5549 (Layout::sized_create_version_sections): Likewise.
5550 (Layout::create_interp): Likewise.
5551 (Layout::finish_dynamic_section): Likewise.
5552 (Layout::set_dynamic_symbol_size): Likewise.
5553
beabb2c6
ILT
55542011-07-08 Ian Lance Taylor <iant@google.com>
5555
5556 PR gold/12386
5557 * options.h (class General_options): Add --unresolved-symbols.
5558 * target-reloc.h (issue_undefined_symbol_error): Check
5559 --unresolved-symbols. Add comments.
5560
9c16daf1
ILT
55612011-07-08 Ian Lance Taylor <iant@google.com>
5562
5563 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5564 expression more complex.
5565
191f1a2d
ILT
55662011-07-08 Ian Lance Taylor <iant@google.com>
5567
5568 PR gold/11317
5569 * target-reloc.h (issue_undefined_symbol_error): New inline
5570 function, broken out of relocate_section.
5571 (relocate_section): Call issue_undefined_symbol_error.
5572 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5573 there is no TLS segment if we are about to issue an undefined
5574 symbol error.
5575 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5576
62855347
ILT
55772011-07-08 Ian Lance Taylor <iant@google.com>
5578
5579 PR gold/12279
5580 * resolve.cc (Symbol_table::should_override): Add fromtype
5581 parameter. Change all callers. Give error when linking together
5582 TLS and non-TLS symbol.
5583 (Symbol_table::should_override_with_special): Add fromtype
5584 parameter. Change all callers.
5585 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5586 there is no TLS segment if we have reported some errors.
5587 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5588
67181c72
ILT
55892011-07-08 Ian Lance Taylor <iant@google.com>
5590
5591 PR gold/12372
5592 * target.h (Target::plt_address_for_global): New function.
5593 (Target::plt_address_for_local): New function.
5594 (Target::plt_section_for_global): Remove.
5595 (Target::plt_section_for_local): Remove.
5596 (Target::do_plt_address_for_global): New virtual function.
5597 (Target::do_plt_address_for_local): New virtual function.
5598 (Target::do_plt_section_for_global): Remove.
5599 (Target::do_plt_section_for_local): Remove.
5600 (Target::register_global_plt_entry): Add Symbol_table and Layout
5601 parameters.
5602 * output.cc (Output_data_got::Got_entry::write): Use
5603 plt_address_for_global and plt_address_for_local.
5604 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5605 address of output section.
5606 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5607 got_irelative_, and irelative_count_ fields. Update
5608 declarations.
5609 (Output_data_plt_i386::has_irelative_section): New function.
5610 (Output_data_plt_i386::entry_count): Add irelative_count_.
5611 (Output_data_plt_i386::set_final_data_size): Likewise.
5612 (class Target_i386): Add got_irelative_ and rel_irelative_
5613 fields. Update declarations.
5614 (Target_i386::Target_i386): Initialize new fields.
5615 (Target_i386::do_plt_address_for_global): New function replacing
5616 do_plt_section_for_global.
5617 (Target_i386::do_plt_address_for_local): New function replacing
5618 do_plt_section_for_local.
5619 (Target_i386::got_section): Create got_irelative_.
5620 (Target_i386::rel_irelative_section): New function.
5621 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5622 fields. Don't define __rel_iplt_{start,end}.
5623 (Output_data_plt_i386::add_entry): Add symtab and layout
5624 parameters. Change all callers. Use different PLT and GOT for
5625 IFUNC symbols.
5626 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5627 layout parameters. Change all callers. Use different PLT and
5628 GOT.
5629 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5630 (Output_data_plt_i386::rel_irelative): New function.
5631 (Output_data_plt_i386::address_for_global): New function.
5632 (Output_data_plt_i386::address_for_local): New function.
5633 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5634 IRELATIVE GOT when changing IFUNC GOT entries.
5635 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5636 reloc.
5637 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5638 if we didn't create an IRELATIVE GOT.
5639 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5640 plt_address_for_local.
5641 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5642 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5643 got_irelative_, and irelative_count_ fields. Update
5644 declarations.
5645 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5646 Initialize new fields. Remove symtab parameter. Change all
5647 callers.
5648 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5649 irelative_count_.
5650 (Output_data_plt_x86_64::has_irelative_section): New function.
5651 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5652 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5653 fields. Update declarations.
5654 (Target_x86_64::Target_x86_64): Initialize new fields.
5655 (Target_x86_64::do_plt_address_for_global): New function replacing
5656 do_plt_section_for_global.
5657 (Target_x86_64::do_plt_address_for_local): New function replacing
5658 do_plt_section_for_local.
5659 (Target_x86_64::got_section): Create got_irelative_.
5660 (Target_x86_64::rela_irelative_section): New function.
5661 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5662 all callers. Don't create __rel_iplt_{start,end}.
5663 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5664 parameters. Change all callers. Use different PLT and GOT for
5665 IFUNC symbols.
5666 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5667 layout parameters. Change all callers. Use different PLT and
5668 GOT.
5669 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5670 parameters. Change all callers. Use different PLT and GOT for
5671 IFUNC symbols.
5672 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5673 (Output_data_plt_x86_64::rela_irelative): New function.
5674 (Output_data_plt_x86_64::address_for_global): New function.
5675 (Output_data_plt_x86_64::address_for_local): New function.
5676 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5677 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5678 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5679 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5680 parameters.
5681 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5682 reloc.
5683 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5684 symbols if we didn't create an IRELATIVE GOT.
5685 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5686 plt_address_for_local.
5687 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5688 * testsuite/ifuncvar1.c: New test file.
5689 * testsuite/ifuncvar2.c: New test file.
5690 * testsuite/ifuncvar3.c: New test file.
5691 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5692 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5693 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5694 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5695 * testsuite/Makefile.in: Rebuild.
5696
33c15b45
CC
56972011-07-07 Cary Coutant <ccoutant@google.com>
5698
5699 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5700 (two_file_test_1_ndebug.o): Likewise.
5701 (two_file_test_1b_ndebug.o): Likewise.
5702 (two_file_test_2_ndebug.o): Likewise.
5703 (two_file_test_main_ndebug.o): Likewise.
5704 (incremental_test_2): Link with no-debug versions.
5705
f48b5fb7
CC
57062011-07-06 Cary Coutant <ccoutant@google.com>
5707
5708 * gold/incremental.cc
5709 (Output_section_incremental_inputs::write_info_blocks): Check for
5710 hidden and internal symbols.
5711
221597a5
CC
57122011-07-06 Cary Coutant <ccoutant@google.com>
5713
5714 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5715 Check disposition for startup file.
5716 (Incremental_inputs::report_command_line): Ignore
5717 --incremental-startup-unchanged option.
5718 * options.cc (General_options::parse_incremental_startup_unchanged):
5719 New function.
5720 (General_options::General_options): Initialize new data member.
5721 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5722 (General_options): Add --incremental-startup-unchanged option.
5723 (General_options::incremental_startup_disposition): New function.
5724 (General_options::incremental_startup_disposition_): New data member.
5725
e24719f6
CC
57262011-07-06 Cary Coutant <ccoutant@google.com>
5727
5728 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5729 input file index to Script_info ctor.
5730 (Sized_incremental_binary::do_file_has_changed): Find the
5731 command-line argument for files named in scripts.
5732 * incremental.h (Script_info::Script_info): New ctor
5733 with input file index.
5734 (Script_info::input_file_index): New function.
5735 (Script_info::input_file_index_): New data member.
5736 (Incremental_binary::get_library): Add const.
5737 (Incremental_binary::get_script_info): Add const.
5738 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5739 * testsuite/Makefile.am (incremental_test_5): New test case.
5740 (incremental_test_6): New test case.
5741 * testsuite/Makefile.in: Regenerate.
5742
8f7c81e8
CC
57432011-07-06 Cary Coutant <ccoutant@google.com>
5744
5745 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5746 debug output when command lines differ.
5747
9fbd3822
CC
57482011-07-06 Cary Coutant <ccoutant@google.com>
5749
5750 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5751 --incremental-patch option.
5752 * layout.cc (Free_list::allocate): Extend allocation beyond original
5753 end if enabled.
5754 (Layout::make_output_section): Mark sections that should get
5755 patch space.
5756 * options.cc (parse_percent): New function.
5757 * options.h (parse_percent): New function.
5758 (DEFINE_percent): New macro.
5759 (General_options): Add --incremental-patch option.
5760 * output.cc (Output_section::Output_section): Initialize new data
5761 members.
5762 (Output_section::add_input_section): Print section name when out
5763 of patch space.
5764 (Output_section::add_output_section_data): Likewise.
5765 (Output_section::set_final_data_size): Add patch space when
5766 doing --incremental-full.
5767 (Output_section::do_reset_address_and_file_offset): Remove patch
5768 space.
5769 (Output_segment::set_section_list_addresses): Print debug output
5770 only if --incremental-update.
5771 * output.h (Output_section::set_is_patch_space_allowed): New function.
5772 (Output_section::is_patch_space_allowed_): New data member.
5773 (Output_section::patch_space_): New data member.
5774 * parameters.cc (Parameters::incremental_full): New function.
5775 * parameters.h (Parameters::incremental_full): New function
5776 * testsuite/Makefile.am (incremental_test_2): Add test for
5777 --incremental-patch option.
5778 * testsuite/Makefile.in: Regenerate.
5779 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5780 (t18): Remove function body.
5781
f6cccc2c
DK
57822011-07-05 Doug Kwan <dougkwan@google.com>
5783
5784 PR gold/12771
5785 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5786 Arm_Address type for relocation result.
5787 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5788 overflow check.
5789 (Arm_relocate_functions::abs32): Use unaligned access.
5790 (Arm_relocate_functions::rel32): Ditto.
5791 (Arm_relocate_functions::prel31): Ditto.
5792 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5793 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5794 static data relocations.
5795 * testsuite/Makefile.in: Regnerate.
5796 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5797
28a13fec
ILT
57982011-07-05 Ian Lance Taylor <iant@google.com>
5799
5800 PR gold/12392
5801 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5802 symbols if necessary.
5803 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5804
24d47b34
ILT
58052011-07-05 Ian Lance Taylor <iant@google.com>
5806
5807 PR gold/12952
5808 * resolve.cc (Symbol::override_base_with_special): Simply override
5809 version with special symbol version, ignoring previous version.
5810
41f9cbbe
ILT
58112011-07-05 Ian Lance Taylor <iant@google.com>
5812
5813 * object.cc (Sized_relobj_file::include_section_group): Add
5814 information to comment about signature location.
5815
886288f1
ILT
58162011-07-02 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/12957
5819 * options.h (class General_options): Add -f and -F.
5820 * options.cc (General_options::finalize): Fatal error if -f/-F
5821 are used without -shared.
5822 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5823
ae3a6d4f
ILT
58242011-07-02 Ian Lance Taylor <iant@google.com>
5825
5826 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5827
21131061
ILT
58282011-07-01 Ian Lance Taylor <iant@google.com>
5829
5830 PR gold/12525
5831 PR gold/12952
5832 * resolve.cc (Symbol::override_base_with_special): Don't override
5833 the version if the overriding symbol has a different name.
5834 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5835 all callers. If we give an error about an undefined version,
5836 define the base version if necessary.
5837 * dynobj.h (class Versions): Update declaration.
5838 * testsuite/weak_alias_test_5.cc: New file.
5839 * testsuite/weak_alias_test.script: New file.
5840 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5841 and versioned_alias have the right value, and call t2.
5842 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5843 weak_alias_test_5.so.
5844 (weak_alias_test_LDADD): Likewise.
5845 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5846 * testsuite/Makefile.in: Rebuild.
5847
611062c0
ILT
58482011-07-01 Ian Lance Taylor <iant@google.com>
5849
5850 PR gold/12525
5851 * options.h (class General_options): Support -z notext.
5852 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5853 -Wl,-z,notext.
5854 (two_file_shared_nonpic.so): Likewise.
5855 (two_file_shared_mixed.so): Likewise.
5856 (two_file_shared_mixed_1.so): Likewise.
5857 (weak_undef_lib_nonpic.so): Likewise.
5858 (alt/weak_undef_lib_nonpic.so): Likewise.
5859 (tls_test_shared_nonpic.so): Likewise.
5860 * testsuite/Makefile.in: Rebuild.
5861
328c7c2f
ILT
58622011-07-01 Ian Lance Taylor <iant@google.com>
5863
5864 PR gold/12525
5865 * configure.ac: Test whether static linking works, setting
5866 the automake conditional HAVE_STATIC.
5867 * testsuite/Makefile.am: Disable tests using -static if
5868 HAVE_STATIC is not true.
5869 * configure, testsuite/Makefile.in: Rebuild.
5870
02d7cd44
ILT
58712011-07-01 Ian Lance Taylor <iant@google.com>
5872
5873 PR gold/12525
5874 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5875 Assert if we see DW_EH_PE_indirect.
5876 * target.h (Target::ehframe_datarel_base): New function.
5877 (Target::do_ehframe_datarel_base): New target function.
5878 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5879 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5880 function.
5881
07a60597
ILT
58822011-07-01 Ian Lance Taylor <iant@google.com>
5883
5884 PR gold/12571
5885 * options.h (class General_options): Add
5886 --ld-generated-unwind-info.
5887 * ehframe.cc (Fde::write): Add address parameter. Change all
5888 callers. If associated with PLT, fill in address and size.
5889 (Cie::set_output_offset): Only add merge mapping if there is an
5890 object.
5891 (Cie::write): Add address parameter. Change all callers.
5892 (Eh_frame::add_ehframe_for_plt): New function.
5893 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5894 input_offset_ fields into union u_, with new plt field.
5895 (Fde::Fde): Adjust for new union field.
5896 (Fde::Fde) [Output_data version]: New constructor.
5897 (Fde::add_mapping): Only add merge mapping if there is an object.
5898 (class Cie): Update declarations.
5899 (class Eh_frame): Declare add_ehframe_for_plt.
5900 * layout.cc (Layout::layout_eh_frame): Break out code into
5901 make_eh_frame_section, and call it.
5902 (Layout::make_eh_frame_section): New function.
5903 (Layout::add_eh_frame_for_plt): New function.
5904 * layout.h (class Layout): Update declarations.
5905 * merge.cc (Merge_map::add_mapping): Add assertion.
5906 * i386.cc: Include "dwarf.h".
5907 (class Output_data_plt_i386): Make first_plt_entry,
5908 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5909 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5910 and plt_eh_frame_fde.
5911 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5912 boundary. Call add_eh_frame_for_plt if appropriate.
5913 * x86_64.cc: Include "dwarf.h".
5914 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5915 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5916 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5917 and plt_eh_frame_fde.
5918 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5919 appropriate.
5920
14788a3f
ILT
59212011-06-29 Ian Lance Taylor <iant@google.com>
5922
5923 PR gold/12629
5924 * object.cc (Sized_relobj_file::layout_section): Change shdr
5925 parameter to be const.
5926 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5927 out of do_layout.
5928 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5929 appropriate. Call layout_eh_frame_section.
5930 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5931 sections.
5932 * object.h (class Sized_relobj_file): Update declarations.
5933
6c21fce1
ILT
59342011-06-29 Ian Lance Taylor <iant@google.com>
5935
37e41b03 5936 PR gold/12652
6c21fce1
ILT
5937 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5938 modifier.
5939 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5940
4d5e4e62
ILT
59412011-06-29 Ian Lance Taylor <iant@google.com>
5942
5943 PR gold/12675
5944 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5945 SHT_X86_64_UNWIND.
5946 * layout.cc (Layout::layout_eh_frame): Likewise.
5947
886f533a
ILT
59482011-06-29 Ian Lance Taylor <iant@google.com>
5949
5950 PR gold/12695
5951 * layout.cc (Layout::symtab_section_shndx): New function.
5952 * layout.h (class Layout): Declare symtab_section_shndx.
5953 * output.cc (Output_section::write_header): Call it.
5954
f3ae1b28
ILT
59552011-06-29 Ian Lance Taylor <iant@google.com>
5956
5957 PR gold/12818
5958 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5959 symbols which are not used in a relocation.
5960
aecf301f
ILT
59612011-06-28 Ian Lance Taylor <iant@google.com>
5962
5963 PR gold/12898
5964 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5965 script create indistinguishable segments.
5966 (Layout::set_segment_offsets): Use stable_sort when sorting
5967 segments. Pass this to Compare_segments constructor.
5968 * layout.h (class Layout): Make segment_precedes non-static.
5969 (class Compare_segments): Change from struct to class. Add
5970 layout_ field. Add constructor.
5971 * script-sections.cc
5972 (Script_sections::attach_sections_using_phdrs_clause): Rename
5973 local orphan to is_orphan. Don't report failure to put empty
5974 section in segment. On attachment failure, report name of
5975 section, and attach to first PT_LOAD segment.
5976
03ef7571
ILT
59772011-06-28 Ian Lance Taylor <iant@google.com>
5978
5979 PR gold/12934
5980 * target-select.cc (Target_selector::Target_selector): Add
5981 emulation parameter. Change all callers.
5982 (select_target_by_bfd_name): Rename from select_target_by_name.
5983 Change all callers.
5984 (select_target_by_emulation): New function.
5985 (supported_emulation_names): New function.
5986 * target-select.h (class Target_selector): Add emulation_ field.
5987 Update declarations.
5988 (Target_selector::recognize_by_bfd_name): Rename from
5989 recognize_by_name. Change all callers.
5990 (Target_selector::supported_bfd_names): Rename from
5991 supported_names. Change all callers.
5992 (Target_selector::recognize_by_emulation): New function.
5993 (Target_selector::supported_emulations): New function.
5994 (Target_selector::emulation): New function.
5995 (Target_selector::do_recognize_by_bfd_name): Rename from
5996 do_recognize_by_name. Change all callers.
5997 (Target_selector::do_supported_bfd_names): Rename from
5998 do_supported_names. Change all callers.
5999 (Target_selector::do_recognize_by_emulation): New function.
6000 (Target_selector::do_supported_emulations): New function.
6001 (select_target_by_bfd_name): Change name in declaration.
6002 (select_target_by_emulation): Declare.
6003 (supported_emulation_names): Declare.
6004 * parameters.cc (parameters_force_valid_target): Try to find
6005 target based on emulation from -m option.
6006 * options.h (class General_options): Change doc string for -m.
6007 * options.cc (help): Print emulations.
6008 (General_options::parse_V): Likewise.
6009 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6010 Add emulation parameter. Change all callers.
6011
200b2bb9
ILT
60122011-06-28 Ian Lance Taylor <iant@google.com>
6013
6014 * target.h (class Target): Add osabi_ field.
6015 (Target::osabi): New function.
6016 (Target::set_osabi): New function.
6017 (Target::Target): Initialize osabi_.
6018 (Target::do_adjust_elf_header): Make pure virtual.
6019 (Sized_target::do_adjust_elf_header): Declare.
6020 * target.cc (Sized_target::do_adjust_elf_header): New function.
6021 (class Sized_target): Instantiate all versions.
6022 * freebsd.h (class Target_freebsd): Remove.
6023 (Target_selector_freebsd::do_recognize): Call set_osabi on
6024 Target.
6025 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6026 (Target_selector_freebsd::set_osabi): Remove.
6027 * i386.cc (class Target_i386): Inherit from Sized_target rather
6028 than Target_freebsd.
6029 * x86_64.cc (class Target_x86_64): Likewise.
6030
b3ce541e
ILT
60312011-06-28 Ian Lance Taylor <iant@google.com>
6032
6033 * target.h (Target::can_check_for_function_pointers): Rewrite.
6034 Make non-virtual.
6035 (Target::can_icf_inline_merge_sections): Likewise.
6036 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6037 (Target::Target_info): Add can_icf_inline_merge_sections field.
6038 (Target::do_can_check_for_function_pointers): New virtual
6039 function.
6040 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6041 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6042 from can_check_for_function_pointers, move in file.
6043 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6044 section_may_have_icf_unsafe_poineters, move in file.
6045 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6046 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6047 Rename from can_check_for_function_pointers, move in file.
6048 (Target_i386::can_icf_inline_merge_sections): Remove.
6049 (Target_i386::i386_info): Initialize
6050 can_icf_inline_merge_sections.
6051 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6052 Initialize can_icf_inline_merge_sections.
6053 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6054 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6055 Rename from can_check_for_function_pointers, move in file.
6056 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6057 (Target_x86_64::x86_64_info): Initialize
6058 can_icf_inline_merge_sections.
6059 * testsuite/testfile.cc (Target_test::test_target_info):
6060 Likewise.
6061 * icf.cc (get_section_contents): Correct formatting.
6062
6d1c4efb
ILT
60632011-06-27 Ian Lance Taylor <iant@google.com>
6064
6065 * symtab.cc (Symbol::versioned_name): New function.
6066 (Symbol_table::add_to_final_symtab): Use versioned_name when
6067 appropriate.
6068 (Symbol_table::sized_write_symbol): Likewise.
6069 * symtab.h (class Symbol): Declare versioned_name.
6070 * stringpool.h (class Stringpool_template): Add variant of add
6071 which takes a std::basic_string.
6072 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6073 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6074 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6075 (ver_test_12.o): New target.
6076 * testsuite/Makefile.in: Rebuild.
6077
57eb9b50
DK
60782011-06-27 Doug Kwan <dougkwan@google.com>
6079
6080 * arm.cc (Arm_relocate_functions::thm_jump8,
6081 Arm_relocate_functions::thm_jump11): Use a wider signed
6082 type to compute offset.
6083 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6084 arm_thm_jump8.
6085 * testsuite/Makefile.in: Regenerate.
6086 * testsuite/arm_branch_in_range.sh: Check test results of
6087 arm_thm_jump11 and arm_thm_jump8.
6088 * testsuite/arm_thm_jump11.s: New test source file.
6089 * testsuite/arm_thm_jump11.t: New linker script.
6090 * testsuite/arm_thm_jump8.s: New test source file.
6091 * testsuite/arm_thm_jump8.t: New linker script.
6092
487b39df
ILT
60932011-06-24 Ian Lance Taylor <iant@google.com>
6094
6095 * layout.cc: Include "object.h".
6096 (ctors_sections_in_init_array): New static variable.
6097 (Layout::is_ctors_in_init_array): New function.
6098 (Layout::layout): Add entry to ctors_sections_in_init_array if
6099 appropriate.
6100 * layout.h (class Layout): Declare is_ctors_in_init_array.
6101 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6102 is_ctors_reverse_view is set.
6103 (Sized_relobj_file::write_sections): Add layout parameter. Change
6104 all callers. Set is_ctors_reverse_view field of View_size.
6105 (Sized_relobj_file::reverse_words): New function.
6106 * object.h (Sized_relobj_file::View_size): Add
6107 is_ctors_reverse_view field.
6108 (class Sized_relobj_file): Update declarations.
6109 * testsuite/initpri3.c: New test.
6110 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6111 initpri3b.
6112 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6113 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6114 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6115 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6116 * testsuite/Makefile.in: Rebuild.
6117
472076e4
CC
61182011-06-24 Cary Coutant <ccoutant@google.com>
6119
6120 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6121 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6122 (debug_msg_cdebug.err): New targets.
6123 * testsuite/Makefile.in: Regenerate.
6124 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6125 Fix checks for link with shared library.
6126
a60af0db
DK
61272011-06-24 Doug Kwan <dougkwan@google.com>
6128
6129 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6130 skip empty text sections.
6131 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6132
5393d741
ILT
61332011-06-22 Ian Lance Taylor <iant@google.com>
6134
6135 PR gold/12910
6136 * options.h (class General_options): Add --ctors-in-init-array.
6137 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6138 friends as SHT_PROGBITS for merging sections.
6139 (Layout::layout): Remove special handling of .init_array and
6140 friends. Don't sort if doing relocatable link. Sort for .ctors
6141 and .dtors if ctors_in_init_array.
6142 (Layout::make_output_section): Force correct section types for
6143 .init_array and friends. Don't sort if doing relocatable link,
6144 Don't sort .ctors and .dtors if ctors_in_init_array.
6145 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6146 (Layout::output_section_name): Add relobj parameter. Change all
6147 callers. Handle .ctors. and .dtors. in code rather than table.
6148 Handle .ctors and .dtors if ctors_in_init_array.
6149 (Layout::match_file_name): New function, moved from output.cc.
6150 * layout.h (class Layout): Update declarations.
6151 * output.cc: Include "layout.h".
6152 (Input_section_sort_entry::get_priority): New function.
6153 (Input_section_sort_entry::match_file_name): Just call
6154 Layout::match_file_name.
6155 (Output_section::Input_section_sort_init_fini_compare::operator()):
6156 Handle .ctors and .dtors. Sort by explicit priority rather than
6157 by name.
6158 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6159 * testsuite/initpri2.c: New test.
6160 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6161 (check_PROGRAMS): Add initpri2.
6162 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6163 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6164 * configure, testsuite/Makefile.in: Rebuild.
6165
e1f74f98
ILT
61662011-06-19 Ian Lance Taylor <iant@google.com>
6167
6168 PR gold/12880
6169 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6170 .interp section to a PT_INTERP segment even if we have seen a
6171 --dynamic-linker option. Don't do it if we have seen a PHDRS
6172 clause in a linker script.
6173 (Layout::finalize): Don't create a .interp section if we've
6174 already create a PT_INTERP segment.
6175 (Layout::create_interp): Always call choose_output_section (revert
6176 patch of 2011-06-17). Don't create PT_INTERP segment.
6177 * script-sections.cc
6178 (Script_sections::create_note_and_tls_segments): Add a .interp
6179 section to a PT_INTERP segment even if we have seen a
6180 --dynamic-linker option.
6181
766f91bb
ILT
61822011-06-18 Ian Lance Taylor <iant@google.com>
6183
6184 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6185 merely because a non-PT_LOAD segment has a dynamic reloc.
6186
0d212c3a
ILT
61872011-06-18 Ian Lance Taylor <iant@google.com>
6188
6189 * layout.cc (Layout::finish_dynamic_section): Don't create
6190 DT_FLAGS entry if not needed.
6191
911a5072
ILT
61922011-06-18 Ian Lance Taylor <iant@google.com>
6193
6194 PR gold/12745
6195 * layout.cc (Layout::layout_eh_frame): Correct handling of
6196 writable .eh_frame section.
6197
534b4e5f
ILT
61982011-06-17 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12893
6201 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6202 symbol is redefined with the exact same object and value.
6203
10b4f102
ILT
62042011-06-17 Ian Lance Taylor <iant@google.com>
6205
6206 PR gold/12880
6207 * layout.h (class Layout): Add interp_segment_ field.
6208 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6209 (Layout::attach_allocated_section_to_segment): If making shared
6210 library, put .interp section in PT_INTERP segment.
6211 (Layout::finalize): Also call create_interp if -dynamic-linker
6212 option was used.
6213 (Layout::create_interp): Assert that there is no PT_INTERP
6214 segment. If not using a SECTIONS clause, use make_output_section.
6215 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6216 * script-sections.cc
6217 (Script_sections::create_note_and_tls_segments): If making shared
6218 library, put .interp section in PT_INTERP segment.
6219
a29b0dad
ILT
62202011-06-17 Ian Lance Taylor <iant@google.com>
6221
e588ea8d
ILT
6222 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6223 when making a shared library.
6224
62252011-06-17 Ian Lance Taylor <iant@google.com>
6226
6227 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6228 parameter. Change all callers. Don't issue warning about PC32
6229 against locally defined symbol.
a29b0dad 6230
9d3b0698
ILT
62312011-06-16 Ian Lance Taylor <iant@google.com>
6232
6233 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6234 occurs in same object.
6235
85b0f90c
AM
62362011-06-14 Alan Modra <amodra@gmail.com>
6237
6238 * po/POTFILES.in: Regenerate.
6239
a94907d9
ILT
62402011-06-09 Ian Lance Taylor <iant@google.com>
6241
6242 * script-sections.cc
6243 (Orphan_output_section::set_section_addresses): For a relocatable
6244 link set address to 0.
6245
4fb3a1c3
CC
62462011-06-09 Cary Coutant <ccoutant@google.com>
6247
6248 PR gold/12804
6249 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6250 used with --compress-debug-sections.
6251 * gold/object.cc (Sized_relobj_file::do_layout): Report
6252 uncompressed size of compressed input sections.
6253
61220854
CC
62542011-06-08 Cary Coutant <ccoutant@google.com>
6255
6256 PR gold/12804
6257 * testsuite/two_file_test_2_v1.cc: Change initialization of
6258 v2 to keep it in .data.
6259
e6455dfb
CC
62602011-06-07 Cary Coutant <ccoutant@google.com>
6261
6262 * common.cc (Symbol_table::do_allocate_commons_list): Call
6263 gold_fallback.
6264 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6265 (Errors::fallback): New function.
6266 (gold_fallback): New function.
6267 * errors.h (Errors::fallback): New function.
6268 * gold.cc (gold_exit): Change status parameter to enum; adjust
6269 all callers.
6270 (queue_initial_tasks): Call gold_fallback.
6271 * gold.h: Include cstdlib.
6272 (Exit_status): New enum type.
6273 (gold_exit): Change status parameter to enum.
6274 (gold_fallback): New function.
6275 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6276 (Layout::create_symtab_sections): Likewise.
6277 (Layout::create_shdrs): Likewise.
6278 * main.cc (main): Adjust call to gold_exit.
6279 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6280 (Output_data_got::add_got_entry_pair): Likewise.
6281 (Output_section::add_input_section): Likewise.
6282 (Output_section::add_output_section_data): Likewise.
6283 (Output_segment::set_section_list_addresses): Likewise.
6284 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6285
fb0e076f
CC
62862011-06-07 Cary Coutant <ccoutant@google.com>
6287
6288 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6289 for incremental links.
6290 * output.cc (Output_segment::set_section_list_addresses): Remove
6291 FIXME and test for TLS or BSS.
6292
a5ee4d5d
CC
62932011-06-07 Cary Coutant <ccoutant@google.com>
6294
6295 * testsuite/Makefile.am: Add incremental_copy_test,
6296 incremental_common_test_1.
6297 * testsuite/Makefile.in: Regenerate.
6298 * testsuite/common_test_1_v1.c: New source file.
6299 * testsuite/common_test_1_v2.c: New source file.
6300 * testsuite/copy_test_v1.cc: New source file.
6301
5146f448
CC
63022011-06-07 Cary Coutant <ccoutant@google.com>
6303
6304 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6305 update, allocate common from bss section's free list.
6306 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6307 linker-defined symbols.
6308 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6309 Skip GOT and PLT entries that are no longer referenced.
6310 (Output_section_incremental_inputs::write_info_blocks): Mark
6311 linker-defined symbols.
6312 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6313 * output.cc (Output_section::allocate): New function.
6314 * output.h (Output_section::allocate): New function.
6315 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6316 linker-defined symbols.
6317 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6318 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6319 (Symbol::init_base_output_data): Likewise.
6320 (Symbol::init_base_output_segment): Likewise.
6321 (Symbol::init_base_constant): Likewise.
6322 (Sized_symbol::init_output_data): Likewise.
6323 (Sized_symbol::init_output_segment): Likewise.
6324 (Sized_symbol::init_constant): Likewise.
6325 (Symbol_table::do_define_in_output_data): Likewise.
6326 (Symbol_table::do_define_in_output_segment): Likewise.
6327 (Symbol_table::do_define_as_constant): Likewise.
6328 * symtab.h (Symbol::is_predefined): New function.
6329 (Symbol::init_base_output_data): Add is_predefined parameter.
6330 (Symbol::init_base_output_segment): Likewise.
6331 (Symbol::init_base_constant): Likewise.
6332 (Symbol::is_predefined_): New data member.
6333 (Sized_symbol::init_output_data): Add is_predefined parameter.
6334 (Sized_symbol::init_output_segment): Likewise.
6335 (Sized_symbol::init_constant): Likewise.
6336 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6337
26d3c67d
CC
63382011-06-07 Cary Coutant <ccoutant@google.com>
6339
6340 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6341 instead of emit_copy_reloc.
6342 (Copy_relocs::emit_copy_reloc): Refactor.
6343 (Copy_relocs::make_copy_reloc): New function.
6344 (Copy_relocs::add_copy_reloc): Remove.
6345 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6346 section.
6347 (Copy_relocs::make_copy_reloc): New function.
6348 (Copy_relocs::add_copy_reloc): Remove.
6349 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6350 unchanged input files.
6351 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6352 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6353 Reserve BSS space for COPY relocations.
6354 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6355 (Output_section_incremental_inputs::write_info_blocks): Record
6356 whether a symbol is copied from a shared object.
6357 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6358 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6359 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6360 (Incremental_input_entry_reader::get_output_symbol_index): Add
6361 is_copy parameter.
6362 (Incremental_binary::emit_copy_relocs): New function.
6363 (Incremental_binary::do_emit_copy_relocs): New function.
6364 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6365 new data member.
6366 (Sized_incremental_binary::add_copy_reloc): New function.
6367 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6368 (Sized_incremental_binary::Copy_reloc): New struct.
6369 (Sized_incremental_binary::Copy_relocs): New typedef.
6370 (Sized_incremental_binary::copy_relocs_): New data member.
6371 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6372 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6373 * target.h (Sized_target::emit_copy_reloc): New function.
6374 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6375
7cdb37d9
CC
63762011-06-02 Cary Coutant <ccoutant@google.com>
6377
6378 PR gold/12163
6379 * gold/archive.cc (Archive::Archive): Initialize new data member.
6380 (Archive::include_all_members): Return if archive has already been
6381 included.
6382 * gold/archive.h (Archive::include_all_members_): New data member.
6383
cc643b88
NC
63842011-06-02 Nick Clifton <nickc@redhat.com>
6385
6386 * dynobj.h: Fix spelling mistake in comment.
6387 * output.cc: Likewise.
6388
f62a3ca7 63892011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6390 Asier Llano
f62a3ca7
DK
6391
6392 PR gold/12826
cc643b88 6393 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6394 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6395 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6396 redundant arm_exidx_test.so.
6397 * testsuite/Makefile.in: Regenerate.
6398 (check_SCRIPTS): Add pr12826.sh
6399 (check_DATA): Add pr12826.stdout
6400 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6401 * testsuite/pr12826.sh: New file.
6402 * testsuite/pr12826_1.s: Ditto.
6403 * testsuite/pr12826_1.s: Ditto.
6404
8dbe1edc
ILT
64052011-05-30 Ian Lance Taylor <iant@google.com>
6406
6407 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6408 sections.
6409
c49875be
ILT
64102011-05-29 Ian Lance Taylor <iant@google.com>
6411
6412 PR gold/12804
6413 * testsuite/Makefile.am: Use different file name for two_file_test
6414 temporary file for each incremental test.
6415 * testsuite/Makefile.in: Rebuild.
6416
69d53f7a
ILT
64172011-05-29 Ian Lance Taylor <iant@google.com>
6418
6419 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6420 binary input file is empty.
6421
41d0ab5f
ILT
64222011-05-27 Ian Lance Taylor <iant@google.com>
6423
6424 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6425 (ver_test_9.so): Likewise.
6426 * testsuite/Makefile.in: Rebuild.
6427
89d8a36b
CC
64282011-05-26 Cary Coutant <ccoutant@google.com>
6429
6430 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6431 * incremental.cc (Incremental_inputs::report_input_section): Fix
6432 comment, indentation.
6433 (Incremental_inputs::report_comdat_group): New function.
6434 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6435 of data for incremental input file entry.
6436 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6437 group count, COMDAT group signatures.
6438 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6439 an unchanged input file.
6440 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6441 Initialize new data member.
6442 (Incremental_object_entry::add_comdat_group): New function.
6443 (Incremental_object_entry::get_comdat_group_count): New function.
6444 (Incremental_object_entry::get_comdat_signature_key): New function.
6445 (Incremental_object_entry::groups_): New data member.
6446 (Incremental_inputs::report_comdat_group): New function.
6447 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6448 data for incremental input file entry.
6449 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6450 (Incremental_input_entry_reader::get_input_section): Adjust size of
6451 data for incremental input file entry.
6452 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6453 (Incremental_input_entry_reader::get_comdat_group_signature): New
6454 function.
6455 * object.cc (Sized_relobj::include_section_group): Report kept
6456 COMDAT groups for incremental links.
6457
1706a06f
ILT
64582011-05-24 David Meyer <pdox@google.com>
6459
6460 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6461 with name parameter. Add found_name parameter.
6462 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6463 * dirsearch.h (class Dirsearch): Update declaration.
6464
a10ae760
ILT
64652011-05-24 Ian Lance Taylor <iant@google.com>
6466
6467 * archive.cc (Library_base::should_include_member): Pull in object
6468 from archive if it defines the entry symbol.
6469 * parameters.cc (Parameters::entry): New function.
6470 * parameters.h (class Parameters): Declare entry.
6471 * output.h (class Output_file_header): Remove entry_ field.
6472 * output.cc (Output_file_header::Output_file_header): Remove entry
6473 parameter. Change all callers.
6474 (Output_file_header::entry): Use parameters->entry.
6475 * gold.cc (queue_middle_tasks): Likewise.
6476 * plugin.cc (Plugin_hook::run): Likewise.
6477
aa92d6ed
CC
64782011-05-24 Cary Coutant <ccoutant@google.com>
6479
6480 * gold.cc (queue_initial_tasks): Pass incremental base filename
6481 to Output_file::open_base_file; don't print error message.
6482 * incremental-dump.cc (main): Adjust call to
6483 Output_file::open_for_modification.
6484 * incremental-dump.cc (main): Likewise.
6485 * incremental.cc (Incremental_inputs::report_command_line):
6486 Ignore --incremental-base option when comparing command lines.
6487 Ignore parameter when given as separate argument.
6488 * options.h (class General_options): Add --incremental-base.
6489 * output.cc (Output_file::Output_file):
6490 (Output_file::open_base_file): Add base_name and writable parameters;
6491 read base file into new file; print error message here.
6492 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6493 callers.
6494 * output.h (Output_file::open_for_modification): Rename to...
6495 (Output_file::open_base_file): ...this; add base_name and
6496 writable parameters; adjust all callers.
6497 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6498 callers.
6499 * testsuite/Makefile.am (incremental_test_4): Test
6500 --incremental-base.
6501 * testsuite/Makefile.in: Regenerate.
6502
2eedd706
CC
65032011-05-24 Cary Coutant <ccoutant@google.com>
6504
6505 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6506 incremental_test_4.
6507 * testsuite/Makefile.in: Regenerate.
6508 * testsuite/two_file_test_1_v1.cc: New test source file.
6509 * testsuite/two_file_test_1b_v1.cc: New test source file.
6510 * testsuite/two_file_test_2_v1.cc: New test source file.
6511
0f1c85a6
CC
65122011-05-24 Cary Coutant <ccoutant@google.com>
6513
6514 * dynobj.h (Dynobj::do_dynobj): New function.
6515 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6516 flag and soname for shared objects.
6517 * incremental.cc (Incremental_inputs::report_object): Make
6518 either Incremental_object_entry or Incremental_dynobj_entry; add
6519 soname to string table.
6520 (Incremental_inputs::report_input_section): Add assertion.
6521 (Output_section_incremental_inputs::set_final_data_size): Adjust
6522 type of input file entry for shared libraries; adjust size of
6523 shared library info entry.
6524 (Output_section_incremental_inputs::write_input_files): Write
6525 as_needed flag for shared libraries.
6526 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6527 of input file entry for shared libraries; write soname.
6528 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6529 soname from incremental info.
6530 * incremental.h (enum Incremental_input_flags): Add
6531 INCREMENTAL_INPUT_AS_NEEDED.
6532 (Incremental_input_entry::Incremental_input_entry): Initialize new
6533 data member.
6534 (Incremental_input_entry::set_as_needed): New function.
6535 (Incremental_input_entry::as_needed): New function.
6536 (Incremental_input_entry::do_dynobj_entry): New function.
6537 (Incremental_input_entry::as_needed_): New data member.
6538 (Incremental_object_entry::Incremental_object_entry): Don't check
6539 for shared library.
6540 (Incremental_object_entry::do_type): Likewise.
6541 (class Incremental_dynobj_entry): New class.
6542 (Incremental_input_entry_reader::as_needed): New function.
6543 (Incremental_input_entry_reader::get_soname): New function.
6544 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6545 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6546 size of shared library info entry.
58797674 6547 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6548 incremental link when adding DT_NEEDED entries.
6549 * object.h (Object::Object): Initialize new data member.
6550 (Object::dynobj): New function.
6551 (Object::set_as_needed): New function.
6552 (Object::as_needed): New function.
6553 (Object::do_dynobj): New function.
6554 (Object::as_needed_): New data member.
6555
6fa2a40b
CC
65562011-05-24 Cary Coutant <ccoutant@google.com>
6557
6558 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6559 info; adjust display of GOT entries.
6560 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6561 vector of input objects; remove file_status_.
6562 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6563 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6564 got_plt reader; call target hooks to reserve GOT entries.
6565 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6566 of input file info header and GOT info entry.
6567 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6568 relocation info.
6569 (Got_plt_view_info::got_descriptor): Remove.
6570 (Got_plt_view_info::sym_index): New data member.
6571 (Got_plt_view_info::input_index): New data member.
6572 (Local_got_offset_visitor::visit): Write input file index.
6573 (Global_got_offset_visitor::visit): Write 0 for input file index.
6574 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6575 with sym_index and input_index.
6576 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6577 incremental info GOT entry; replace got_descriptor with input_index.
6578 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6579 map from input file index to object.
6580 (Sized_relobj_incr::do_layout): Replace direct data member reference
6581 with accessor function.
6582 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6583 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6584 Adjust size of input file info header.
6585 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6586 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6587 (Incremental_input_entry_reader::get_input_section): Adjust size of
6588 input file info header.
6589 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6590 of incremental info GOT entry.
6591 (Incremental_got_plt_reader::get_got_desc): Remove.
6592 (Incremental_got_plt_reader::get_got_symndx): New function.
6593 (Incremental_got_plt_reader::get_got_input_index): New function.
6594 (Sized_incremental_binary::Sized_incremental_binary): Remove
6595 file_status_; add input_objects_.
6596 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6597 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6598 (Sized_incremental_binary::file_is_unchanged): Remove.
6599 (Sized_incremental_binary::set_input_object): New function.
6600 (Sized_incremental_binary::input_object): New function.
6601 (Sized_incremental_binary::file_status_): Remove.
6602 (Sized_incremental_binary::input_objects_): New data member.
6603 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6604 references.
6605 (Sized_relobj_incr::invalid_address): Move to base class.
6606 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6607 class.
6608 (Sized_relobj_incr::do_output_section_offset): Likewise.
6609 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6610 (Sized_relobj_incr::section_offsets_): Likewise.
6611 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6612 function.
6613 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6614 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6615 with accessor function.
6616 (Sized_relobj_file::do_layout): Likewise.
6617 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6618 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6619 (Sized_relobj_file::compute_final_local_value): Replace refs to
6620 section_offsets_ with accessor function.
6621 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6622 * object.h (Relobj::Relobj): Initialize new data members.
6623 (Relobj::add_dyn_reloc): New function.
6624 (Relobj::first_dyn_reloc): New function.
6625 (Relobj::dyn_reloc_count): New function.
6626 (Relobj::first_dyn_reloc_): New data member.
6627 (Relobj::dyn_reloc_count_): New data member.
6628 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6629 references.
6630 (Sized_relobj::Address): New typedef.
6631 (Sized_relobj::invalid_address): Move here from child class.
6632 (Sized_relobj::Sized_relobj): Initialize new data members.
6633 (Sized_relobj::sized_relobj): New function.
6634 (Sized_relobj::is_output_section_offset_invalid): Move here from
6635 child class.
6636 (Sized_relobj::get_output_section_offset): Likewise.
6637 (Sized_relobj::local_has_got_offset): Likewise.
6638 (Sized_relobj::local_got_offset): Likewise.
6639 (Sized_relobj::set_local_got_offset): Likewise.
6640 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6641 (Sized_relobj::clear_got_offsets): New function.
6642 (Sized_relobj::section_offsets): Move here from child class.
6643 (Sized_relobj::do_output_section_offset): Likewise.
6644 (Sized_relobj::do_set_section_offset): Likewise.
6645 (Sized_relobj::Local_got_offsets): Likewise.
6646 (Sized_relobj::local_got_offsets_): Likewise.
6647 (Sized_relobj::section_offsets_): Likewise.
6648 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6649 references.
6650 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6651 class.
6652 (Sized_relobj_file::sized_relobj): New function
6653 (Sized_relobj_file::local_has_got_offset): Move to base class.
6654 (Sized_relobj_file::local_got_offset): Likewise.
6655 (Sized_relobj_file::set_local_got_offset): Likewise.
6656 (Sized_relobj_file::get_output_section_offset): Likewise.
6657 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6658 (Sized_relobj_file::do_output_section_offset): Likewise.
6659 (Sized_relobj_file::do_set_section_offset): Likewise.
6660 (Sized_relobj_file::Local_got_offsets): Likewise.
6661 (Sized_relobj_file::local_got_offsets_): Likewise.
6662 (Sized_relobj_file::section_offsets_): Likewise.
6663 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6664 (all constructors).
6665 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6666 (Output_reloc::get_symbol_index): Likewise.
6667 (Output_reloc::local_section_offset): Likewise.
6668 (Output_reloc::get_address): Likewise.
6669 (Output_reloc::symbol_value): Likewise.
6670 (Output_data_got::reserve_slot): Move to class definition.
6671 (Output_data_got::reserve_local): New function.
6672 (Output_data_got::reserve_slot_for_global): Remove.
6673 (Output_data_got::reserve_global): New function.
6674 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6675 (all constructors, two instantiations).
6676 (Output_reloc::get_relobj): New function (two instantiations).
6677 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6678 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6679 (Output_data_reloc::add_global): Adjust type of relobj.
6680 (Output_data_reloc::add_global_relative): Likewise.
6681 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6682 (Output_data_reloc::add_local): Likewise.
6683 (Output_data_reloc::add_local_relative): Likewise.
6684 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6685 (Output_data_reloc::add_local_section): Likewise.
6686 (Output_data_reloc::add_output_section): Likewise.
6687 (Output_data_reloc::add_absolute): Likewise.
6688 (Output_data_reloc::add_target_specific): Likewise.
6689 (Output_data_got::reserve_slot): Move definition here.
6690 (Output_data_got::reserve_local): New function.
6691 (Output_data_got::reserve_global): New function.
6692 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6693 section_offsets_ with accessor function.
6694 (Sized_relobj_file::write_sections): Likewise.
6695 (Sized_relobj_file::do_relocate_sections): Likewise.
6696 * target.h (Sized_target::reserve_local_got_entry): New function.
6697 (Sized_target::reserve_global_got_entry): New function.
6698 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6699 (Target_x86_64::reserve_global_got_entry): New function.
6700 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6701
4829d394
CC
67022011-05-23 Cary Coutant <ccoutant@google.com>
6703
6704 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6705 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6706 bit when checking got_type.
6707 * incremental.cc (Sized_incremental_binary::setup_readers):
6708 Store symbol table and string table locations; initialize bit vector
6709 of file status flags.
6710 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6711 unchanged files.
6712 (Sized_incremental_binary::do_process_got_plt): New function.
6713 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6714 (Output_section_incremental_inputs::set_final_data_size): Record
6715 file index for each input file.
6716 (Output_section_incremental_inputs::write_got_plt): Store file index
6717 instead of input entry offset for each GOT entry.
6718 * incremental.h
6719 (Incremental_input_entry::Incremental_input_entry): Initialize new
6720 data member.
6721 (Incremental_input_entry::set_offset): Store file index.
6722 (Incremental_input_entry::get_file_index): New function.
6723 (Incremental_input_entry::file_index_): New data member.
6724 (Incremental_binary::process_got_plt): New function.
6725 (Incremental_binary::do_process_got_plt): New function.
6726 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6727 data members.
6728 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6729 (Sized_incremental_binary::set_file_is_unchanged): New function.
6730 (Sized_incremental_binary::file_is_unchanged): New function.
6731 (Sized_incremental_binary::do_process_got_plt): New function.
6732 (Sized_incremental_binary::file_status_): New data member.
6733 (Sized_incremental_binary::main_symtab_loc_): New data member.
6734 (Sized_incremental_binary::main_strtab_loc_): New data member.
6735 * output.cc (Output_data_got::Got_entry::write): Add case
6736 RESERVED_CODE.
6737 (Output_data_got::add_global): Call add_got_entry.
6738 (Output_data_got::add_global_plt): Likewise.
6739 (Output_data_got::add_global_with_rel): Likewise.
6740 (Output_data_got::add_global_with_rela): Likewise.
6741 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6742 (Output_data_got::add_global_pair_with_rela): Likewise.
6743 (Output_data_got::add_local): Call add_got_entry.
6744 (Output_data_got::add_local_plt): Likewise.
6745 (Output_data_got::add_local_with_rel): Likewise.
6746 (Output_data_got::add_local_with_rela): Likewise.
6747 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6748 (Output_data_got::add_local_pair_with_rela): Likewise.
6749 (Output_data_got::reserve_slot): New function.
6750 (Output_data_got::reserve_slot_for_global): New function.
6751 (Output_data_got::add_got_entry): New function.
6752 (Output_data_got::add_got_entry_pair): New function.
6753 (Output_section::add_output_section_data): Edit FIXME.
6754 * output.h
6755 (Output_section_data_build::Output_section_data_build): New
6756 constructor with size parameter.
6757 (Output_data_space::Output_data_space): Likewise.
6758 (Output_data_got::Output_data_got): Initialize new data member; new
6759 constructor with size parameter.
6760 (Output_data_got::add_constant): Call add_got_entry.
6761 (Output_data_got::reserve_slot): New function.
6762 (Output_data_got::reserve_slot_for_global): New function.
6763 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6764 (Output_data_got::add_got_entry): New function.
6765 (Output_data_got::add_got_entry_pair): New function.
6766 (Output_data_got::free_list_): New data member.
6767 * target.h (Sized_target::init_got_plt_for_update): New function.
6768 (Sized_target::register_global_plt_entry): New function.
6769 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6770 Initialize new data member; call init; add constructor with PLT count.
6771 (Output_data_plt_x86_64::init): New function.
6772 (Output_data_plt_x86_64::add_relocation): New function.
6773 (Output_data_plt_x86_64::reserve_slot): New function.
6774 (Output_data_plt_x86_64::free_list_): New data member.
6775 (Target_x86_64::init_got_plt_for_update): New function.
6776 (Target_x86_64::register_global_plt_entry): New function.
6777 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6778 incremental updates.
6779 (Output_data_plt_x86_64::add_relocation): New function.
6780 * testsuite/object_unittest.cc (Object_test): Set default options.
6781
ec69d6da
ILT
67822011-05-16 Ian Lance Taylor <iant@google.com>
6783
6784 * options.h (class General_options): Make -i a synonym for -r.
6785
732e31de
ILT
67862011-05-16 Ian Lance Taylor <iant@google.com>
6787
6788 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6789
403676b5
CC
67902011-05-10 Cary Coutant <ccoutant@google.com>
6791
6792 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6793 strip_all (-s).
6794
5b7b7d6e
ILT
67952011-05-06 Ian Lance Taylor <iant@google.com>
6796
6797 * layout.cc (Layout::layout): If the output section flags change,
6798 update the ordering.
6799
f0f9babf
CC
68002011-04-25 Cary Coutant <ccoutant@google.com>
6801
6802 * incremental-dump.cc (dump_incremental_inputs): Print local
6803 symbol info for each input file.
6804 * incremental.cc
6805 (Output_section_incremental_inputs::set_final_data_size): Add local
6806 symbol info to input file entries in incremental info.
6807 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6808 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6809 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6810 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6811 implementation.
6812 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6813 (Sized_incr_relobj::do_relocate): Write the local symbols.
6814 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6815 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6816 Adjust size of input file header.
6817 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6818 (Incremental_inputs_reader::get_local_symbol_count): New function.
6819 (Incremental_inputs_reader::get_input_section): Adjust size of input
6820 file header.
6821 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6822 (Sized_incr_relobj::This): New typedef.
6823 (Sized_incr_relobj::sym_size): New const data member.
6824 (Sized_incr_relobj::Local_symbol): New struct.
6825 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6826 (Sized_incr_relobj::do_local_symbol_offset): New function.
6827 (Sized_incr_relobj::local_symbol_count_): New data member.
6828 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6829 (Sized_incr_relobj::local_symbol_index_): New data member.
6830 (Sized_incr_relobj::local_symbol_offset_): New data member.
6831 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6832 (Sized_incr_relobj::local_symbols_): New data member.
6833 * object.h (Relobj::output_local_symbol_count): New function.
6834 (Relobj::local_symbol_offset): New function.
6835 (Relobj::do_output_local_symbol_count): New function.
6836 (Relobj::do_local_symbol_offset): New function.
6837 (Sized_relobj::do_output_local_symbol_count): New function.
6838 (Sized_relobj::do_local_symbol_offset): New function.
6839
d0a9ace3
ILT
68402011-04-22 Vladimir Simonov <sv@sw.ru>
6841
6842 * descriptors.cc (set_close_on_exec): New function.
6843 (Descriptors::open): Use set_close_on_exec.
6844 * output.cc (S_ISLNK): Define if not defined.
6845
94a3fc8b
CC
68462011-04-22 Cary Coutant <ccoutant@google.com>
6847
6848 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6849 global symbol map.
6850 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6851 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6852 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6853 relocations.
6854 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6855 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6856 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6857 * incremental.h
6858 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6859 function.
6860 (Incremental_binary::apply_incremental_relocs): New function.
6861 (Incremental_binary::do_apply_incremental_relocs): New function.
6862 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6863 data member.
6864 (Sized_incremental_binary::add_global_symbol): New function.
6865 (Sized_incremental_binary::global_symbol): New function.
6866 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6867 (Sized_incremental_binary::symbol_map_): New data member.
6868 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6869 * target.h (Sized_target::apply_relocation): New function.
6870 * target-reloc.h (apply_relocation): New function.
6871 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6872
c87e4302
DK
68732011-04-22 Doug Kwan <dougkwan@google.com>
6874
6875 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6876 flag of a SHT_ARM_EXIDX section.
2e702c99 6877 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6878 * testsuite/Makefile.in: Regenerate.
6879 * testsuite/arm_exidx_test.s: New file.
6880 * testsuite/arm_exidx_test.sh: Same.
6881
e7782cf6
CC
68822011-04-20 Cary Coutant <ccoutant@google.com>
6883
6884 PR gold/12689
6885 * archive.h (Incremental_archive_entry::Archive_member):
6886 Initialize arg_serial_ (second constructor).
6887
308ecdc7
ILT
68882011-04-17 Ian Lance Taylor <iant@google.com>
6889
6890 * object.cc (Relocate_info::location): Simplify location string.
6891 * errors.cc (Errors::error_at_location): Don't print program
6892 name.
6893 (Errors::warning_at_location): Likewise.
6894 (Errors::undefined_symbol): Likewise.
6895 * testsuite/debug_msg.sh: Update accordingly.
6896
bec5b579
CC
68972011-04-14 Cary Coutant <ccoutant@google.com>
6898
6899 * gold/layout.cc (Layout::symtab_section_offset): New function.
6900 * gold/layout.h (Layout::symtab_section_offset): New function.
6901 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6902
88597d34
ILT
69032011-04-12 Ian Lance Taylor <iant@google.com>
6904
6905 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6906 with MREMAP_MAYMOVE.
6907 * output.h (class Output_file): Add map_is_allocated_ field.
6908 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6909 not available, provide stubs. If mremap is not available, #define
6910 it to gold_mremap.
6911 (MREMAP_MAYMOVE): Define if not defined.
6912 (Output_file::Output_file): Initialize map_is_allocated_.
6913 (Output_file::resize): Check map_is_allocated_.
6914 (Output_file::map_anonymous): If mmap fails, use malloc.
6915 (Output_file::unmap): Don't do anything for an anonymous map.
6916 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6917 is not available, provide stubs.
6918 (File_read::View::~View): Use free rather than delete[].
6919 (File_read::make_view): Use malloc rather than new[]. If mmap
6920 fails, use malloc.
6921 (File_read::find_or_make_view): Use malloc rather than new[].
6922 * gold.h: Remove HAVE_REMAP code.
6923 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6924 exists. Rename mremap to gold_mremap. If mmap is not available
6925 don't do anything.
6926 * configure, config.in: Rebuild.
6927
11e361bc
ILT
69282011-04-11 Ian Lance Taylor <iant@google.com>
6929
6930 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6931 initialize local variable v.
6932
cdc29364
CC
69332011-04-11 Cary Coutant <ccoutant@google.com>
6934
6935 * archive.cc (Archive::include_member): Adjust call to
6936 report_object.
6937 (Add_archive_symbols::run): Track argument serial numbers.
6938 (Lib_group::include_member): Likewise.
6939 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6940 * archive.h (Incremental_archive_entry::Archive_member):
6941 Initialize arg_serial_.
6942 (Archive_member::arg_serial_): New data member.
6943 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6944 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6945 incremental link.
6946 (Sized_dynobj::do_for_all_local_got_entries): New function.
6947 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6948 function.
6949 * fileread.cc (get_mtime): New function.
6950 * fileread.h (get_mtime): New function.
6951 * gold.cc (queue_initial_tasks): Check for incremental update.
6952 (process_incremental_input): New function.
6953 (queue_middle_tasks): Don't force valid target for incremental
6954 update.
6955 * incremental-dump.cc (find_input_containing_global): Adjust
6956 size of symbol info entry.
6957 (dump_incremental_inputs): Dump argument serial number and
6958 in_system_directory flag; bias shndx by 1; print symbol names
6959 when dumping per-file symbol lists; use new symbol info readers.
6960 * incremental.cc
6961 (Output_section_incremental_inputs:update_data_size): New function.
6962 (Sized_incremental_binary::setup_readers): Setup input readers
6963 for each input file; build maps for files added from libraries
6964 and scripts.
6965 (Sized_incremental_binary::check_input_args): New function.
6966 (Sized_incremental_binary::do_check_inputs): Build map of argument
6967 serial numbers to input arguments.
6968 (Sized_incremental_binary::do_file_has_changed): Rename
6969 do_file_is_unchanged to this; compare file modification times.
6970 (Sized_incremental_binary::do_init_layout): New function.
6971 (Sized_incremental_binary::do_reserve_layout): New function.
6972 (Sized_incremental_binary::do_get_input_reader): Remove.
6973 (Sized_incremental_binary::get_symtab_view): New function.
6974 (Incremental_checker::can_incrementally_link_output_file): Remove.
6975 (Incremental_inputs::report_command_line): Exclude --debug options.
6976 (Incremental_inputs::report_archive_begin): Add parameter; track
6977 argument serial numbers; don't put input file entry for archive
6978 before archive members.
6979 (Incremental_inputs::report_archive_end): Put input file entry
6980 for archive after archive members.
6981 (Incremental_inputs::report_object): Add parameter; track argument
6982 serial numbers and in_system_directory flag.
6983 (Incremental_inputs::report_script): Add parameter; track argument
6984 serial numbers.
6985 (Output_section_incremental_inputs::set_final_data_size): Adjust
6986 size of symbol info entry; check for forwarding symbols.
6987 (Output_section_incremental_inputs::write_input_files): Write
6988 in_system_directory flag and argument serial number.
6989 (Output_section_incremental_inputs::write_info_blocks): Map section
6990 indices between incremental info and original input file; store
6991 input section index for each symbol.
6992 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6993 change operator() to visit().
6994 (class Global_got_offset_visitor): Likewise.
6995 (class Global_symbol_visitor_got_plt):
6996 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6997 classes.
6998 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6999 (Sized_incr_relobj::do_read_symbols): New function.
7000 (Sized_incr_relobj::do_layout): New function.
7001 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7002 (Sized_incr_relobj::do_add_symbols): New function.
7003 (Sized_incr_relobj::do_should_include_member): New function.
7004 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7005 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7006 (Sized_incr_relobj::do_section_size): New function.
7007 (Sized_incr_relobj::do_section_name): New function.
7008 (Sized_incr_relobj::do_section_contents): New function.
7009 (Sized_incr_relobj::do_section_flags): New function.
7010 (Sized_incr_relobj::do_section_entsize): New function.
7011 (Sized_incr_relobj::do_section_address): New function.
7012 (Sized_incr_relobj::do_section_type): New function.
7013 (Sized_incr_relobj::do_section_link): New function.
7014 (Sized_incr_relobj::do_section_info): New function.
7015 (Sized_incr_relobj::do_section_addralign): New function.
7016 (Sized_incr_relobj::do_initialize_xindex): New function.
7017 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7018 (Sized_incr_relobj::do_read_relocs): New function.
7019 (Sized_incr_relobj::do_gc_process_relocs): New function.
7020 (Sized_incr_relobj::do_scan_relocs): New function.
7021 (Sized_incr_relobj::do_count_local_symbols): New function.
7022 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7023 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7024 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7025 (Sized_incr_relobj::do_relocate): New function.
7026 (Sized_incr_relobj::do_set_section_offset): New function.
7027 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7028 (Sized_incr_dynobj::do_read_symbols): New function.
7029 (Sized_incr_dynobj::do_layout): New function.
7030 (Sized_incr_dynobj::do_add_symbols): New function.
7031 (Sized_incr_dynobj::do_should_include_member): New function.
7032 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7033 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7034 (Sized_incr_dynobj::do_section_size): New function.
7035 (Sized_incr_dynobj::do_section_name): New function.
7036 (Sized_incr_dynobj::do_section_contents): New function.
7037 (Sized_incr_dynobj::do_section_flags): New function.
7038 (Sized_incr_dynobj::do_section_entsize): New function.
7039 (Sized_incr_dynobj::do_section_address): New function.
7040 (Sized_incr_dynobj::do_section_type): New function.
7041 (Sized_incr_dynobj::do_section_link): New function.
7042 (Sized_incr_dynobj::do_section_info): New function.
7043 (Sized_incr_dynobj::do_section_addralign): New function.
7044 (Sized_incr_dynobj::do_initialize_xindex): New function.
7045 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7046 (make_sized_incremental_object): New function.
7047 (Incremental_library::copy_unused_symbols): New function.
7048 (Incremental_library::do_for_all_unused_symbols): New function.
7049 * incremental.h (enum Incremental_input_flags): New type.
7050 (class Incremental_checker): Remove.
7051 (Incremental_input_entry::Incremental_input_entry): Add argument
7052 serial number.
7053 (Incremental_input_entry::arg_serial): New function.
7054 (Incremental_input_entry::set_is_in_system_directory): New function.
7055 (Incremental_input_entry::is_in_system_directory): New function.
7056 (Incremental_input_entry::arg_serial_): New data member.
7057 (Incremental_input_entry::is_in_system_directory_): New data member.
7058 (class Script_info): Move here from script.h.
7059 (Script_info::Script_info): Add filename parameter.
7060 (Script_info::filename): New function.
7061 (Script_info::filename_): New data member.
7062 (Incremental_script_entry::Incremental_script_entry): Add argument
7063 serial number.
7064 (Incremental_object_entry::Incremental_object_entry): Likewise.
7065 (Incremental_object_entry::add_input_section): Build list of input
7066 sections with map to original shndx.
7067 (Incremental_object_entry::get_input_section_index): New function.
7068 (Incremental_object_entry::shndx_): New data member.
7069 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7070 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7071 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7072 serial number.
7073 (Incremental_inputs::report_archive_begin): Likewise.
7074 (Incremental_inputs::report_object): Likewise.
7075 (Incremental_inputs::report_script): Likewise.
7076 (class Incremental_global_symbol_reader): New class.
7077 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7078 and store flags and input file type.
7079 (Incremental_input_entry_reader::arg_serial): New function.
7080 (Incremental_input_entry_reader::type): Extract type from flags.
7081 (Incremental_input_entry_reader::is_in_system_directory): New function.
7082 (Incremental_input_entry_reader::get_input_section_count): Call
7083 accessor function for type.
7084 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7085 function for type; adjust size of global symbol entry.
7086 (Incremental_input_entry_reader::get_global_symbol_count): Call
7087 accessor function for type.
7088 (Incremental_input_entry_reader::get_object_count): Likewise.
7089 (Incremental_input_entry_reader::get_object_offset): Likewise.
7090 (Incremental_input_entry_reader::get_member_count): Likewise.
7091 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7092 (Incremental_input_entry_reader::get_member_offset): Likewise.
7093 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7094 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7095 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7096 (Incremental_input_entry_reader::get_global_symbol_reader): New
7097 function.
7098 (Incremental_input_entry_reader::get_output_symbol_index): New
7099 function.
7100 (Incremental_input_entry_reader::type_): Remove.
7101 (Incremental_input_entry_reader::flags_): New data member.
7102 (Incremental_inputs_reader::input_file_offset): New function.
7103 (Incremental_inputs_reader::input_file_index): New function.
7104 (Incremental_inputs_reader::input_file): Call input_file_offset.
7105 (Incremental_inputs_reader::input_file_at_offset): New function.
7106 (Incremental_relocs_reader::get_r_type): Reformat.
7107 (Incremental_relocs_reader::get_r_shndx): Reformat.
7108 (Incremental_relocs_reader::get_r_offset): Reformat.
7109 (Incremental_relocs_reader::data): New function.
7110 (Incremental_binary::Incremental_binary): Initialize new data members.
7111 (Incremental_binary::check_inputs): Add cmdline parameter.
7112 (Incremental_binary::file_is_unchanged): Remove.
7113 (Input_reader::arg_serial): New function.
7114 (Input_reader::get_unused_symbol_count): New function.
7115 (Input_reader::get_unused_symbol): New function.
7116 (Input_reader::do_arg_serial): New function.
7117 (Input_reader::do_get_unused_symbol_count): New function.
7118 (Input_reader::do_get_unused_symbol): New function.
7119 (Incremental_binary::input_file_count): New function.
7120 (Incremental_binary::get_input_reader): Change signature to use
7121 index instead of filename.
7122 (Incremental_binary::file_has_changed): New function.
7123 (Incremental_binary::get_input_argument): New function.
7124 (Incremental_binary::get_library): New function.
7125 (Incremental_binary::get_script_info): New function.
7126 (Incremental_binary::init_layout): New function.
7127 (Incremental_binary::reserve_layout): New function.
7128 (Incremental_binary::output_file): New function.
7129 (Incremental_binary::do_check_inputs): New function.
7130 (Incremental_binary::do_file_is_unchanged): Remove.
7131 (Incremental_binary::do_file_has_changed): New function.
7132 (Incremental_binary::do_init_layout): New function.
7133 (Incremental_binary::do_reserve_layout): New function.
7134 (Incremental_binary::do_input_file_count): New function.
7135 (Incremental_binary::do_get_input_reader): Change signature.
7136 (Incremental_binary::input_args_map_): New data member.
7137 (Incremental_binary::library_map_): New data member.
7138 (Incremental_binary::script_map_): New data member.
7139 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7140 new data members.
7141 (Sized_incremental_binary::output_section): New function.
7142 (Sized_incremental_binary::inputs_reader): Add const.
7143 (Sized_incremental_binary::symtab_reader): Add const.
7144 (Sized_incremental_binary::relocs_reader): Add const.
7145 (Sized_incremental_binary::got_plt_reader): Add const.
7146 (Sized_incremental_binary::get_symtab_view): New function.
7147 (Sized_incremental_binary::Inputs_reader): New typedef.
7148 (Sized_incremental_binary::Input_entry_reader): New typedef.
7149 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7150 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7151 (Sized_incremental_binary::do_file_has_changed): New function.
7152 (Sized_incremental_binary::do_init_layout): New function.
7153 (Sized_incremental_binary::do_reserve_layout): New function.
7154 (Sized_input_reader::Inputs_reader): Remove.
7155 (Sized_input_reader::Input_entry_reader): Remove.
7156 (Sized_input_reader::do_arg_serial): New function.
7157 (Sized_input_reader::do_get_unused_symbol_count): New function.
7158 (Sized_input_reader::do_get_unused_symbol): New function.
7159 (Sized_incremental_binary::do_input_file_count): New function.
7160 (Sized_incremental_binary::do_get_input_reader): Change signature;
7161 use index instead of filename.
7162 (Sized_incremental_binary::section_map_): New data member.
7163 (Sized_incremental_binary::input_entry_readers_): New data member.
7164 (class Sized_incr_relobj): New class.
7165 (class Sized_incr_dynobj): New class.
7166 (make_sized_incremental_object): New function.
7167 (class Incremental_library): New class.
7168 * layout.cc (Free_list::num_lists): New static data member.
7169 (Free_list::num_nodes): New static data member.
7170 (Free_list::num_removes): New static data member.
7171 (Free_list::num_remove_visits): New static data member.
7172 (Free_list::num_allocates): New static data member.
7173 (Free_list::num_allocate_visits): New static data member.
7174 (Free_list::init): New function.
7175 (Free_list::remove): New function.
7176 (Free_list::allocate): New function.
7177 (Free_list::dump): New function.
7178 (Free_list::print_stats): New function.
7179 (Layout_task_runner::run): Resize output file for incremental updates.
7180 (Layout::Layout): Initialize new data members.
7181 (Layout::set_incremental_base): New function.
7182 (Layout::init_fixed_output_section): New function.
7183 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7184 incremental updates.
7185 (Layout::create_gold_note): Do not create gold note section for
7186 incremental updates.
7187 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7188 for incremental updates.
7189 (Layout::set_section_offsets): For incremental updates, allocate space
7190 from free list.
7191 (Layout::create_symtab_sections): Layout with offsets relative to
7192 start of section; for incremental updates, allocate space from free
7193 list.
7194 (Layout::create_shdrs): For incremental updates, allocate space from
7195 free list.
7196 (Layout::finish_dynamic_section): For incremental updates, do not
7197 check --as-needed (fixed in subsequent patch).
7198 * layout.h (class Free_list): New class.
7199 (Layout::set_incremental_base): New function.
7200 (Layout::incremental_base): New function.
7201 (Layout::init_fixed_output_section): New function.
7202 (Layout::allocate): New function.
7203 (Layout::incremental_base_): New data member.
7204 (Layout::free_list_): New data member.
7205 * main.cc (main): Print Free_list statistics.
7206 * object.cc (Relobj::finalize_incremental_relocs): Add
7207 clear_counts parameter; clear counts only when clear_counts is set.
7208 (Sized_relobj::Sized_relobj): Initialize new base class.
7209 (Sized_relobj::do_layout): Don't report special sections.
7210 (Sized_relobj::do_for_all_local_got_entries): New function.
7211 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7212 symtab_off to all symbol table offsets.
7213 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7214 * object.h (class Got_offset_list): Move to top of file.
7215 (Object::Object): Allow case where input_file == NULL.
7216 (Object::~Object): Likewise.
7217 (Object::input_file): Assert that input_file != NULL.
7218 (Object::lock): Allow case where input_file == NULL.
7219 (Object::unlock): Likewise.
7220 (Object::is_locked): Likewise.
7221 (Object::token): Likewise.
7222 (Object::release): Likewise.
7223 (Object::is_incremental): New function.
7224 (Object::get_mtime): New function.
7225 (Object::for_all_local_got_entries): New function.
7226 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7227 (Object::set_is_in_system_directory): New function.
7228 (Object::is_in_system_directory): New function.
7229 (Object::do_is_incremental): New function.
7230 (Object::do_get_mtime): New function.
7231 (Object::do_for_all_local_got_entries): New function.
7232 (Object::is_in_system_directory_): New data member.
7233 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7234 (class Sized_relobj_base): New class.
7235 (class Sized_relobj): Derive from Sized_relobj_base.
7236 (class Sized_relobj::Symbols): Redeclare from base class.
7237 (class Sized_relobj::local_got_offset_list): Remove.
7238 (class Sized_relobj::Output_sections): Redeclare from base class.
7239 (class Sized_relobj::do_for_all_local_got_entries): New function.
7240 (class Sized_relobj::write_local_symbols): Add offset parameter.
7241 (class Sized_relobj::local_symbol_offset_): Update comment.
7242 (class Sized_relobj::local_dynsym_offset_): Update comment.
7243 * options.cc (Input_arguments::add_file): Remove const.
7244 * options.h (Input_file_argument::Input_file_argument):
7245 Initialize arg_serial_ (all constructors).
7246 (Input_file_argument::set_arg_serial): New function.
7247 (Input_file_argument::arg_serial): New function.
7248 (Input_file_argument::arg_serial_): New data member.
7249 (Input_arguments::Input_arguments): Initialize file_count_.
7250 (Input_arguments::add_file): Remove const.
7251 (Input_arguments::number_of_input_files): New function.
7252 (Input_arguments::file_count_): New data member.
7253 (Command_line::number_of_input_files): Call
7254 Input_arguments::number_of_input_files.
7255 * output.cc (Output_segment_headers::Output_segment_headers):
7256 Set current size.
7257 (Output_section::Input_section::current_data_size): New function.
7258 (Output_section::Output_section): Initialize new data members.
7259 (Output_section::add_input_section): Don't do merge sections for
7260 an incremental link; allocate space from free list for an
7261 incremental update.
7262 (Output_section::add_output_section_data): Allocate space from
7263 free list for an incremental update.
7264 (Output_section::update_data_size): New function.
7265 (Output_section::set_fixed_layout): New function.
7266 (Output_section::reserve): New function.
7267 (Output_segment::set_section_addresses): Remove const.
7268 (Output_segment::set_section_list_addresses): Remove const; allocate
7269 space from free list for an incremental update.
7270 (Output_segment::set_offset): Adjust size of RELRO segment for an
7271 incremental update.
7272 * output.h (Output_data::current_data_size): Move here from
7273 child classes.
7274 (Output_data::pre_finalize_data_size): New function.
7275 (Output_data::update_data_size): New function.
7276 (Output_section_headers::update_data_size): new function.
7277 (Output_section_data_build::current_data_size): Move to Output_data.
7278 (Output_data_strtab::update_data_size): New function.
7279 (Output_section::current_data_size): Move to Output_data.
7280 (Output_section::set_fixed_layout): New function.
7281 (Output_section::has_fixed_layout): New function.
7282 (Output_section::reserve): New function.
7283 (Output_section::update_data_size): New function.
7284 (Output_section::has_fixed_layout_): New data member.
7285 (Output_section::free_list_): New data member.
7286 (Output_segment::set_section_addresses): Remove const.
7287 (Output_segment::set_section_list_addresses): Remove const.
7288 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7289 New function.
7290 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7291 New function.
7292 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7293 parameter when calling Add_symbols constructor; store argument
7294 serial number for members of a lib group.
7295 (Add_symbols::locks): Allow case where token == NULL.
7296 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7297 (Read_member::~Read_member): New function.
7298 (Read_member::is_runnable): New function.
7299 (Read_member::locks): New function.
7300 (Read_member::run): New function.
7301 (Check_script::~Check_script): New function.
7302 (Check_script::is_runnable): New function.
7303 (Check_script::locks): New function.
7304 (Check_script::run): New function.
7305 (Check_library::~Check_library): New function.
7306 (Check_library::is_runnable): New function.
7307 (Check_library::locks): New function.
7308 (Check_library::run): New function.
7309 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7310 (Add_symbols::library_): New data member.
7311 (class Read_member): New class.
7312 (class Check_script): New class.
7313 (class Check_library): New class.
7314 * reloc.cc (Read_relocs::is_runnable): Allow case where
7315 token == NULL.
7316 (Read_relocs::locks): Likewise.
7317 (Scan_relocs::locks): Likewise.
7318 (Relocate_task::locks): Likewise.
7319 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7320 to clear counters.
7321 (Sized_relobj::incremental_relocs_scan): Fix comment.
7322 (Sized_relobj::do_relocate): Pass output file offset to
7323 write_local_symbols.
7324 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7325 from class declaration.
7326 * script.cc (read_input_script): Allocate Script_info; pass
7327 argument serial number to report_script.
7328 * script.h (class Script_info): Move to incremental.h.
7329 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7330 * symtab.h (Symbol_table::add_from_incrobj): New function.
7331 (Symbol_table::set_file_offset): New function.
7332
b961d0d7
CC
73332011-04-05 Cary Coutant <ccoutant@google.com>
7334
7335 * incremental-dump.cc (dump_incremental_inputs): Change signature
7336 to take a Sized_incremental_binary; change caller. Use readers
7337 in Sized_incremental_binary.
7338 * incremental.cc
7339 (Sized_incremental_binary::find_incremental_inputs_sections):
7340 Rename do_find_incremental_inputs_sections to this.
7341 (Sized_incremental_binary::setup_readers): New function.
7342 (Sized_incremental_binary::do_check_inputs): Check
7343 has_incremental_info_ flag; move setup code to setup_readers;
7344 use input readers.
7345 (Sized_incremental_binary::do_file_is_unchanged): New function.
7346 (Sized_incremental_binary::do_get_input_reader): New function.
7347 * incremental.h (class Incremental_binary): Move to end of file.
7348 (Incremental_binary::file_is_unchanged): New function.
7349 (Incremental_binary::do_file_is_unchanged): New function.
7350 (Incremental_binary::Input_reader): New class.
7351 (Incremental_binary::get_input_reader): New function.
7352 (class Sized_incremental_binary): Move to end of file.
7353 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7354 input section reader classes.
7355 (Sized_incremental_binary::has_incremental_info): New function.
7356 (Sized_incremental_binary::inputs_reader): New function.
7357 (Sized_incremental_binary::symtab_reader): New function.
7358 (Sized_incremental_binary::relocs_reader): New function.
7359 (Sized_incremental_binary::got_plt_reader): New function.
7360 (Sized_incremental_binary::do_file_is_unchanged): New function.
7361 (Sized_incremental_binary::Sized_input_reader): New class.
7362 (Sized_incremental_binary::get_input_reader): New function.
7363 (Sized_incremental_binary::find_incremental_inputs_sections):
7364 Rename do_find_incremental_inputs_sections to this.
7365 (Sized_incremental_binary::setup_readers): New function.
7366 (Sized_incremental_binary::has_incremental_info_): New data member.
7367 (Sized_incremental_binary::inputs_reader_): New data member.
7368 (Sized_incremental_binary::symtab_reader_): New data member.
7369 (Sized_incremental_binary::relocs_reader_): New data member.
7370 (Sized_incremental_binary::got_plt_reader_): New data member.
7371 (Sized_incremental_binary::current_input_file_): New data member.
7372
a869183f
PP
73732011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7374
7375 PR gold/12640
7376 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7377 violation.
7378
73792011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7380
7381 * archive.cc (Archive::include_member): Adjust call to report_object.
7382 (Add_archive_symbols::run): Add script_info to call to
7383 report_archive_begin.
7384 (Lib_group::include_member): Adjust call to report_object.
7385 (Add_lib_group_symbols::run): Adjust call to report_object.
7386 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7387 blocks. Add object count for script input files.
7388 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7389 script_info parameter; change all callers.
7390 (Incremental_inputs::report_object): Add script_info parameter;
7391 change all callers.
7392 (Incremental_inputs::report_script): Store backpointer to
7393 incremental info entry.
7394 (Output_section_incremental_inputs::set_final_data_size): Record
7395 additional information for scripts.
7396 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7397 * incremental.h (Incremental_script_entry::add_object): New function.
7398 (Incremental_script_entry::get_object_count): New function.
7399 (Incremental_script_entry::get_object): New function.
7400 (Incremental_script_entry::objects_): New data member; adjust
7401 constructor.
7402 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7403 (Incremental_inputs::report_object): Add script_info parameter.
7404 (Incremental_inputs_reader::get_object_count): New function.
7405 (Incremental_inputs_reader::get_object_offset): New function.
7406 * options.cc (Input_arguments::add_file): Return reference to
7407 new input argument.
7408 * options.h (Input_argument::set_script_info): New function.
7409 (Input_argument::script_info): New function.
7410 (Input_argument::script_info_): New data member; adjust all
7411 constructors.
7412 (Input_file_group::add_file): Return reference to new input argument.
7413 (Input_file_lib::add_file): Likewise.
7414 (Input_arguments::add_file): Likewise.
7415 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7416 * script.cc (Parser_closure::Parser_closure): Add script_info
7417 parameter; adjust all callers.
7418 (Parser_closure::script_info): New function.
7419 (Parser_closure::script_info_): New data member.
7420 (read_input_script): Report scripts earlier to incremental info.
7421 (script_add_file): Set script_info in Input_argument.
7422 (script_add_library): Likewise.
7423 * script.h (Script_options::Script_info): Rewrite class.
7424
a869183f 74252011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7426
7427 * archive.cc (Library_base::should_include_member): Move
7428 method here from class Archive.
7429 (Archive::Archive): Initialize base class.
7430 (Archive::should_include_member): Move to base class.
7431 (Archive::do_for_all_unused_symbols): New function.
7432 (Add_archive_symbols::run): Remove redundant access to
7433 incremental_inputs.
7434 (Lib_group::Lib_group): Initialize base class.
7435 (Lib_group::do_filename): New function.
7436 (Lib_group::include_member): Pass pointer to Lib_group to
7437 report_object.
7438 (Lib_group::do_for_all_unused_symbols): New function.
7439 (Add_lib_group_symbols::run): Report archive information for
7440 incremental links.
7441 * archive.h (class Library_base): New base class.
7442 (class Archive): Derive from Library_base.
7443 (Archive::filename): Move to base class.
7444 (Archive::set_incremental_info): Likewise.
7445 (Archive::incremental_info): Likewise.
7446 (Archive::Should_include): Likewise.
7447 (Archive::should_include_member): Likewise.
7448 (Archive::Armap_entry): Remove.
7449 (Archive::Unused_symbol_iterator): Remove.
7450 (Archive::unused_symbols_begin): Remove.
7451 (Archive::unused_symbols_end): Remove.
7452 (Archive::do_filename): New function.
7453 (Archive::do_get_mtime): New function.
7454 (Archive::do_for_all_unused_symbols): New function.
7455 (Archive::task_): Move to base class.
7456 (Archive::incremental_info_): Likewise.
7457 (class Lib_group): Derive from Library_base.
7458 (Lib_group::do_filename): New function.
7459 (Lib_group::do_get_mtime): New function.
7460 (Lib_group::do_for_all_unused_symbols): New function.
7461 (Lib_group::task_): Move to base class.
7462 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7463 function.
7464 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7465 function.
7466 * incremental.cc (Incremental_inputs::report_archive_begin):
7467 Use Library_base; call library's get_mtime; add incremental inputs
7468 entry before members.
7469 (class Unused_symbol_visitor): New class.
7470 (Incremental_inputs::report_archive_end): Use Library_base; use
7471 visitor class to record unused symbols; don't add incremental inputs
7472 entry after members.
7473 (Incremental_inputs::report_object): Use Library_base.
7474 * incremental.h
7475 (Incremental_archive_entry::Incremental_archive_entry): Remove
7476 unused Archive parameter.
7477 (Incremental_inputs::report_archive_begin): Use Library_base.
7478 (Incremental_inputs::report_archive_end): Likewise.
7479 (Incremental_inputs::report_object): Likewise.
7480 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7481 function.
7482 * object.h (Object::for_all_global_symbols): New function.
7483 (Object::do_for_all_global_symbols): New function.
7484 (Sized_relobj::do_for_all_global_symbols): New function.
7485 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7486 function.
7487 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7488 function.
7489
61ab3e40
ILT
74902011-03-27 Ian Lance Taylor <iant@google.com>
7491
7492 * archive.cc (Archive::interpret_header): Return -1 if something
7493 goes wrong. Change callers accordingly.
7494
30e1f9e6
CC
74952011-03-25 Cary Coutant <ccoutant@google.com>
7496
7497 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7498 * testsuite/Makefile.in: Regenerate.
7499
9370ce59 75002011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7501
7502 * plugin.cc (get_view): New.
7503 (Plugin::load): Pass get_view to the plugin.
7504 (Plugin_manager::get_view): New.
7505
9312bb0a
ILT
75062011-03-21 Ian Lance Taylor <iant@google.com>
7507
7508 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7509 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7510
7e12ba9e
ST
75112011-03-21 Sriraman Tallam <tmsriram@google.com>
7512
7513 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7514 Change == to -eq.
7515 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7516 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7517 Change == to -eq.
7518 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7519 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7520
fd7a005d
ILT
75212011-03-14 Ian Lance Taylor <iant@google.com>
7522
7523 * script-sections.cc (Sort_output_sections::script_compare):
7524 Rename from is_before, change return type.
7525 (Sort_output_sections::operator()): Adjust accordingly.
7526
ed16fd1b
ILT
75272011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7528
7529 PR gold/12572
7530 * testsuite/odr_violation2.cc: Add comment to make all error line
7531 numbers double digits.
7532 * testsuite/debug_msg.sh: Adjust expected errors.
7533
71ff8986
ILT
75342011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7535
7536 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7537 but mark earlier ones as non-canonical
7538 (offset_to_iterator): Update search target and example
7539 (do_addr2line): Return extra lines in a vector*
7540 (format_file_lineno): Extract from do_addr2line
7541 (one_addr2line): Add vector* out-param
7542 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7543 when a lineno entry appeared last for its instruction
7544 (Dwarf_line_info): Add vector* out-param
7545 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7546 * symtab.cc (Odr_violation_compare): Include the lineno in the
7547 comparison again.
7548 (linenos_from_loc): New. Combine the canonical line for an
7549 address with its other lines.
7550 (True_if_intersect): New. Helper functor to make
7551 std::set_intersection a query.
7552 (detect_odr_violations): Compare sets of lines instead of just
7553 one line for each function. This became less deterministic, but
7554 has fewer false positives.
7555 * symtab.h: Declarations.
7556 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7557 mix an optimized and non-optimized object in the same binary
7558 (odr_violation2.so): Same.
7559 * testsuite/Makefile.in: Regenerate from Makefile.am.
7560 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7561 * testsuite/debug_msg.sh: Update line numbers and add
7562 assertions.
7563 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7564 non-optimized context.
7565 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7566 isn't inlined, and use OdrDerived in an optimized context.
7567 * testsuite/odr_header1.h: Defines OdrDerived, where
7568 optimization will change the
7569 first-instruction-in-the-destructor's file and line number.
7570 * testsuite/odr_header2.h: Defines OdrBase.
7571
a19fefdc
ILT
75722011-03-09 Ian Lance Taylor <iant@google.com>
7573
7574 * fileread.cc (File_read::clear_views): Don't delete the whole
7575 file view.
7576
ecb351e9
ILT
75772011-03-08 Ian Lance Taylor <iant@google.com>
7578
7579 PR gold/12525
7580 * fileread.cc: #include <climits>.
7581 (GOLD_IOV_MAX): Define.
7582 (File_read::read_multiple): Limit number of entries by iov_max.
7583 * fileread.h (class File_read): Always set max_readv_entries to
7584 128.
7585
b821d13c
ILT
75862011-03-07 Ian Lance Taylor <iant@google.com>
7587
7588 PR gold/12525
7589 * options.h (class General_options): Add -dy and -dn.
7590
89243142
CC
75912011-03-02 Cary Coutant <ccoutant@google.com>
7592
7593 * testsuite/script_test_9.t: Add TLS segment.
7594
d0773f31
ILT
75952011-03-02 Simon Baldwin <simonb@google.com>
7596
7597 * configure.ac: Add check for gnu_indirect_function support in
7598 the toolchain building binutils.
7599 * configure: Rebuild.
7600
9370ce59 76012011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7602
7603 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7604 plugin only symbols.
7605 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7606 in plugin files as not needed in the symbol table.
7607
4cf7a849
ST
76082011-02-11 Sriraman Tallam <tmsriram@google.com>
7609
7610 * output.cc (Output_section::add_input_section): Delay fill
7611 generation for section ordering.
7612
b578bd7d
ILT
76132011-02-09 Ian Lance Taylor <iant@google.com>
7614
7615 PR gold/12316
7616 * object.h (class Sized_relobj): Remove clear_local_symbols.
7617 * reloc.cc (Sized_relobj::do_relocate): Don't call
7618 clear_local_symbols.
7619
9370ce59 76202011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7621
7622 * plugin.cc (is_visible_from_outside): Return true for symbols
7623 in the -u option.
7624
55382fb7
ILT
76252011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7626
7627 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7628 filename.
7629
4e271fff
ST
76302011-02-02 Sriraman Tallam <tmsriram@google.com>
7631
7632 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7633 to std::string.
4e271fff 7634 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7635 section_name to be std::string.
4e271fff
ST
7636 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7637
d433c3ac
ILT
76382011-01-25 Ian Lance Taylor <iant@google.com>
7639
7640 * script.cc (script_add_extern): Rewrite to use
7641 add_symbol_reference.
7642
880473a6
DK
76432011-01-25 Doug Kwan <dougkwan@google.com>
7644
d433c3ac 7645 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7646
f30f86fa
ILT
76472011-01-24 Ian Lance Taylor <iant@google.com>
7648
7649 * options.h (class General_options): Accept
7650 --no-detect-odr-violations.
7651
8e51a0b9
ILT
76522011-01-24 Ian Lance Taylor <iant@google.com>
7653
7654 * version.cc (version_string): Bump to 1.11.
7655
0f3b89d8
ILT
76562011-01-24 Ian Lance Taylor <iant@google.com>
7657
7658 * plugin.cc (class Plugin_rescan): Define new class.
7659 (Plugin_manager::claim_file): Set any_claimed_.
7660 (Plugin_manager::save_archive): New function.
7661 (Plugin_manager::save_input_group): New function.
7662 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7663 necessary.
7664 (Plugin_manager::new_undefined_symbol): New function.
7665 (Plugin_manager::rescan): New function.
7666 (Plugin_manager::rescannable_defines): New function.
7667 (Plugin_manager::add_input_file): Set any_added_.
7668 * plugin.h (class Plugin_manager): define new fields rescannable_,
7669 undefined_symbols_, any_claimed_, and any_added_. Declare
7670 Plugin_rescan as friend. Declare new functions.
7671 (Plugin_manager::Rescannable): Define type.
7672 (Plugin_manager::Rescannable_list): Define type.
7673 (Plugin_manager::Undefined_symbol_list): Define type.
7674 (Plugin_manager::Plugin_manager): Initialize new fields.
7675 * archive.cc (Archive::defines_symbol): New function.
7676 (Add_archive_symbols::run): Pass archive to plugins if any.
7677 * archive.h (class Archive): Declare defines_symbol.
7678 * readsyms.cc (Input_group::~Input_group): New function.
7679 (Finish_group::run): Pass input_group to plugins if any.
7680 * readsyms.h (class Input_group): Declare destructor.
7681 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7682 any.
7683
3bb951e5
ILT
76842011-01-10 Ian Lance Taylor <iant@google.com>
7685
7686 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7687 section as relro.
7688 (Layout::set_segment_offsets): Reset increase_relro before calling
7689 set_section_addresses a second time.
7690
0aa45fac
CC
76912011-01-04 Cary Coutant <ccoutant@google.com>
7692
7693 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7694 sections before NOBITS sections.
7695
0db46eb4
L
76962011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7697
7698 * version.cc (print_version): Update copyright to 2011.
7699
829c9745
CC
77002010-12-23 Cary Coutant <ccoutant@google.com>
7701
7702 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7703 of OS to this->add. Add OD parameter to second form of the function.
7704
7500420b
ILT
77052010-12-20 Ian Lance Taylor <iant@google.com>
7706
7707 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7708 second of two consecutive entries with same offset.
7709
f8e9a930
RW
77102010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7711
7712 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7713 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7714 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7715 to avoid unneeded links against $(LDADD).
7716 * testsuite/Makefile.in: Regenerate.
7717
2fbb4320
ILT
77182010-12-15 Ian Lance Taylor <iant@google.com>
7719
7720 PR gold/12324
7721 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7722 for R_X86_64_32 and R_X86_64_PC32.
7723 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7724 ver_matching_def_pic.o.
7725 (ver_matching_def_pic.o): New target.
7726
fedb228d
RW
77272010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7728
7729 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7730 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7731 Move definition before File_read::View member definitions.
7732 (File_read::View::~View): Initialize and hold lock before
7733 updating current_mapped_bytes.
7734
9b547ce6
RW
77352010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7736
7737 * dwarf_reader.cc: Remove outdated comment.
7738 * gold-threads.cc: Fix typo in error message.
7739 * archive.cc: Fix typos in comments.
7740 * archive.h: Likewise.
7741 * arm-reloc-property.cc: Likewise.
7742 * arm-reloc-property.h: Likewise.
7743 * arm-reloc.def: Likewise.
7744 * arm.cc: Likewise.
7745 * attributes.h: Likewise.
7746 * cref.cc: Likewise.
7747 * ehframe.cc: Likewise.
7748 * fileread.h: Likewise.
7749 * gold.h: Likewise.
7750 * i386.cc: Likewise.
7751 * icf.cc: Likewise.
7752 * incremental.h: Likewise.
7753 * int_encoding.cc: Likewise.
7754 * layout.h: Likewise.
7755 * main.cc: Likewise.
7756 * merge.h: Likewise.
7757 * object.cc: Likewise.
7758 * object.h: Likewise.
7759 * options.cc: Likewise.
7760 * readsyms.cc: Likewise.
7761 * reduced_debug_output.cc: Likewise.
7762 * reloc.cc: Likewise.
7763 * script-sections.cc: Likewise.
7764 * sparc.cc: Likewise.
7765 * symtab.h: Likewise.
7766 * target-reloc.h: Likewise.
7767 * target.cc: Likewise.
7768 * target.h: Likewise.
7769 * timer.cc: Likewise.
7770 * timer.h: Likewise.
7771 * x86_64.cc: Likewise.
7772
83e17bd5
CC
77732010-12-09 Cary Coutant <ccoutant@google.com>
7774
7775 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7776 stack.
7777 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7778 parameter; change all callers.
7779 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7780 * options.h (warn_execstack): New option.
7781
017257f8
DK
77822010-12-07 Doug Kwan <dougkwan@google.com>
7783
7784 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7785 like function call relocations.
7786
c20cbc06
ILT
77872010-12-07 Ian Lance Taylor <iant@google.com>
7788
7789 * archive.cc (Archive::get_elf_object_for_member): Permit
7790 punconfigured to be NULL.
7791 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7792 (Archive::include_member): Pass NULL to get_elf_object_for_member
7793 if we searched for the archive and this is the first included
7794 object.
7795
4dbfafcc
ILT
77962010-12-01 Ian Lance Taylor <iant@google.com>
7797
7798 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7799 track_relocs_type_ field.
7800 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7801 Set track_relocs_type_.
7802 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7803 contents when using RELA relocs.
7804 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7805 reloc_map_.
7806 * reloc.cc (Track_relocs::next_addend): New function.
7807 * reloc.h (class Track_relocs): Declare next_addend.
7808
e5e19edd
ILT
78092010-12-01 Ian Lance Taylor <iant@google.com>
7810
7811 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7812 virtual destructor.
7813
9a5ce24c
ILT
78142010-12-01 Ian Lance Taylor <iant@google.com>
7815
7816 * README: Update compilers known to work and fail.
7817
c7791212
NC
78182010-11-23 Matthias Klose <doko@ubuntu.com>
7819
7820 * configure.in: For --enable-gold, handle value `default' instead of
7821 `both*'. Always install ld as ld.bfd, install as ld if gold is
7822 not the default.
7823 * configure: Regenerate.
7824
0ad220c9
DK
78252010-11-18 Doug Kwan <dougkwan@google.com>
7826
7827 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7828 and right_alignment to be zero. Store result alignment only if it is
7829 greater than existing alignment.
7830
ab8056e0
CC
78312010-11-16 Cary Coutant <ccoutant@google.com>
7832
7833 PR gold/12220
7834 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7835 Check for ".zdebug_line".
7836
fd064a5b
CC
78372010-11-16 Doug Kwan <dougkwan@google.com>
7838 Cary Coutant <ccoutant@google.com>
7839
7840 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7841 by reference; adjust all callers.
7842 * output.cc (Output_segment::set_section_addresses): Adjust references
7843 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7844 list is empty.
7845 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7846 end at page boundary.
7847
6fc6ea19
CC
78482010-11-16 Cary Coutant <ccoutant@google.com>
7849
7850 PR gold/12220
7851 * layout.cc (Layout::choose_output_section): Transform names of
7852 compressed sections even when using a script with a SECTIONS clause.
7853 (Layout::output_section_name): Remove code to transform
7854 compressed debug section names.
7855 * output.cc (Output_section::add_input_section): Use uncompressed
7856 section size when tracking input sections.
7857
95a2c8d6
RS
78582010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7859
7860 * symtab.h (Symbol::NON_PIC_REF): Remove.
7861 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7862 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7863 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7864 (Symbol::use_plt_offset): Take a flags argument and pass it
7865 directly to needs_dynamic_reloc. Restrict check for undefined
7866 weak symbols to function calls.
7867 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7868 (Target_arm::Scan::global): Use it.
7869 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7870 (Target_arm::Relocate::relocate): Likewise.
7871 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7872 parameter with an r_type parameter. Use get_reference_flags
7873 to get the flags.
7874 (Target_arm::Relocate::relocate): Update accordingly.
7875 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7876 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7877 (Target_i386::Scan::global): Likewise.
7878 (Target_i386::Relocate::relocate): Likewise.
7879 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7880 parameter with an r_type parameter. Use get_reference_flags
7881 to get the flags.
7882 (Target_i386::Relocate::relocate): Update accordingly.
7883 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7884 (Target_powerpc::Scan::global): Use it.
7885 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7886 (Target_powerpc::Relocate::relocate): Likewise.
7887 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7888 (Target_sparc::Scan::global): Use it.
7889 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7890 (Target_sparc::Relocate::relocate): Likewise.
7891 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7892 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7893 (Target_x86_64::Scan::global): Likewise.
7894 (Target_x86_64::Relocate::relocate): Likewise.
7895
f625ae50
DK
78962010-11-08 Doug Kwan <dougkwan@google.com>
7897 Cary Coutant <ccoutant@google.com>
7898
7899 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7900 (Arm_exidx_merge_section::section_contents_): New data member.
7901 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7902 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7903 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7904 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7905 in parameters instead of calling Object::section_contents without
7906 locking.
7907 (Arm_output_section::group_section): New parameter TASK. Pass it
7908 to callees that need locking objects.
7909 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7910 to lock EXIDX input sections. Fix a formatting issue. Call
7911 Arm_exidx_merged_section::build_contents to create merged section
7912 contents.
7913 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7914 to lock object of stub table owner.
7915 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7916 TEXT_SIZE to initialize data member TEXT_SIZE_.
7917 (Arm_exidx_input_section::addralign): Fix typo in comment.
7918 (Arm_exidx_input_section::text_size): New method.
7919 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7920 that require locking objects. Lock objects before scanning for stubs
7921 and updating local symbols.
7922 (Arm_input_section<big_endian>::init): Copy contents of original
7923 input section.
2e702c99 7924 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7925 original input section instead of calling Object::section_contents
7926 without locking.
7927 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7928 size without calling Object::section_size().
7929 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7930 for size. Allocate a buffer for merged EXIDX entries.
7931 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7932 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7933 building code to Arm_exidx_merged_section::build_contetns. Write
7934 out contetns in buffer instead of building it on the fly.
7935 (Arm_relobj::make_exidx_input_section): Also pass text section size
7936 to Arm_exidx_input_section constructor.
7937 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7938 (Arm_dynobj::do_read_symbols): Fix memory leak.
7939 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7940 * target.h: (class Task): Add forward declaration.
7941 (Target::relax): Add new parameter TASK and pass it to
7942 Target::do_relax().
7943 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7944
5f9bcf58
CC
79452010-11-05 Cary Coutant <ccoutant@google.com>
7946
7947 PR gold/10708
7948 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7949 object when reading from the file.
7950 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7951 second layout pass.
7952 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7953 when reading section contents.
7954 (get_section_contents): Likewise.
7955 (icf::find_identical_sections): Likewise.
7956 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7957 object when reading from the file.
7958 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7959 the object when doing deferred section layout.
7960
e597fa08
NC
79612010-11-03 Nick Clifton <nickc@redhat.com>
7962
7963 PR gold/12001
7964 * script.h (class Symbol_assignment: name): New member. Returns
7965 the name of the symbol.
7966 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7967 Returns true if the given symbol name is on the list of
7968 assignments wating to be processed.
7969 * archive.cc (should_incldue_member): If the symbol is undefined,
7970 check to see if it is on the list of symbols pending assignment.
7971
3f9a3278
ILT
79722010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7973
7974 * script-sections.cc (Script_sections::find_memory_region): Check
7975 for a NULL output section pointer.
7976
d06fb4d1
DK
79772010-10-29 Doug Kwan <dougkwan@google.com>
7978
7979 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7980 Output_section::add_relaxed_input_section.
7981 * output.cc (Output_section::add_relaxed_input_section): Add new
7982 arguments LAYOUT and NAME. Set section order index.
7983 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7984 Copy section order index.
7985 * output.h (Output_section::add_relaxed_input_section): Add new
7986 arguments LAYOUT and NAME.
7987
90e24de5
ILT
79882010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7989
7990 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7991 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7992 * testsuite/Makefile.in: Regenerate.
7993
c9484ea5
DK
79942010-10-20 Doug Kwan <dougkwan@google.com>
7995
7996 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7997 without SHF_LINK_ORDER flags.
7998 * layout.cc (Layout::choose_output_section): Do not filter
7999 SHF_LINK_ORDER flag in a relocatable link.
8000
5bc2f5be
CC
80012010-10-17 Cary Coutant <ccoutant@google.com>
8002
8003 * output.h (Output_segment::set_section_addresses): Change function
8004 signature. Update all callers.
8005 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8006 sections.
8007 (Output_segment::set_section_addresses): Align after last TLS
8008 section. Add padding before last relro section instead of after.
8009
0c91cf04
DK
80102010-10-17 Doug Kwan <dougkwan@google.com>
8011
8012 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8013 GOT output section to be writable.
8014
8c21d9d3
CC
80152010-10-14 Cary Coutant <ccoutant@google.com>
8016
8017 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8018 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8019 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8020 mode.
8021 * incremental.cc (report_command_line): Ignore all forms of
8022 --incremental.
8023 * layout.cc (Layout::Layout): Check parameters for incremental link
8024 mode.
8025 * options.cc (General_options::parse_incremental): New function.
8026 (General_options::parse_no_incremental): New function.
8027 (General_options::parse_incremental_full): New function.
8028 (General_options::parse_incremental_update): New function.
8029 (General_options::incremental_mode_): New data member.
8030 (General_options::finalize): Check incremental_mode_.
8031 * options.h (General_options): Update help text for --incremental.
8032 Add --no-incremental, --incremental-full, --incremental-update.
8033 (General_options::Incremental_mode): New enum type.
8034 (General_options::incremental_mode): New function.
8035 (General_options::incremental_mode_): New data member.
8036 * parameters.cc (Parameters::incremental_mode_): New data member.
8037 (Parameters::set_options): Set incremental_mode_.
8038 (Parameters::set_incremental_full): New function.
8039 (Parameters::incremental): New function.
8040 (Parameters::incremental_update): New function.
8041 (set_parameters_incremental_full): New function.
8042 * parameters.h (Parameters::set_incremental_full): New function.
8043 (Parameters::incremental): New function.
8044 (Parameters::incremental_update): New function.
8045 (Parameters::incremental_mode_): New data member.
8046 (set_parameters_incremental_full): New function.
8047 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8048 incremental link mode.
8049 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8050 (Sized_relobj::do_relocate_sections): Likewise.
8051 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8052 option.
8053 * testsuite/Makefile.in: Regenerate.
8054 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8055
bb32aa18 80562010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8057
8058 * script-sections.h (class Script_sections): Make
8059 Sections_elements typedef public.
8060 * script-sections.cc (class Sort_output_sections): Add elements_
8061 field. Add constructor which sets it; change all callers.
8062 (Sort_output_sections::is_before): New function.
8063 (Sort_output_sections::operator()): Call is_before.
8064 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8065 conditional.
8066 * testsuite/script_test_10.sh: New test. Test script section
8067 order.
8068 * testsuite/script_test_10.t: Likewise.
8069 * testsuite/script_test_10.s: Likewise.
8070 * testsuite/Makefile.am: Wrap the cross linker tests and the
8071 common tests into NATIVE_OR_CROSS_LINKER.
8072 (check_SCRIPTS): Add script_test_10.sh.
8073 (check_DATA): Add script_test_10.stdout.
8074 (script_test_10.o, script_test_10): New targets.
8075 (script_test_10.stdout): New target.
8076 * configure, testsuite/Makefile.in: Regenerate.
8077
3cef7179
ILT
80782010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8079
8080 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8081 error for the deprecated relocations.
8082 (Target_arm::Scan::global): Likewise.
8083 (Target_arm::Relocate::relocate): Likewise.
8084
7411e9a8
RS
80852010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8086
8087 * fileread.cc (Input_file::find_file): Initialize *found_name
8088 and *namep when using the fallback search for case 4.
8089
6a9da32a
CC
80902010-10-11 Cary Coutant <ccoutant@google.com>
8091
8092 * options.h (class General_options): Redefine -z lazy as an alias for
8093 the negation of -z now.
8094
ac897c20
ILT
80952010-10-11 Ian Lance Taylor <iant@google.com>
8096
8097 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8098 binding.
8099
ea5cae92
NC
81002010-10-06 Nick Clifton <nickc@redhat.com>
8101
8102 * script-sections.cc(class Memory_region): Remove
8103 current_lma_offset_ field. Rename current_vma_offset_ to
8104 current_offset_. Add last_section_ field.
8105 (Memory_region::get_current_vma_address): Rename to
8106 get_current_address.
8107 (Memory_region::get_current_lma_address): Delete.
8108 (Memory_region::increment_vma_offset): Rename to
8109 increment_offset.
8110 (Memory_region::increment_lma_offset): Delete.
8111 (Memory_region::attributes_compatible): New method. Returns
8112 true if the provided section is compatible with the region.
8113 (Memory_region::get_last_section): New method. Returns the last
8114 section to use the region.
8115 (Memory_region::set_last_section): New method. Stores the last
8116 section to use the region.
8117 (Script_sections::block_in_region): New method. Returns true if
8118 a block of memory is contained within a region.
8119 (Script_sections::find_memory_region): New method. Locates a
8120 memory region to be used to set a VMA or LMA address.
8121 (Output_section_definition::set_section_addresses): Add code to
8122 check for addresses set by memory regions.
8123 (Output_segment::set_section_addresses): Remove memory region
8124 walking code.
8125 (Script_sections::create_segment): Add a warning if a header
8126 segment is created outside of any region.
8127 * script-sections.h (class Script_sections): Add prototypes for
8128 find_memory_region and block_in_region methods.
8129 * testsuite/memory_test.s: Use .long instead of .word.
8130 * testsuite/memory_test.t: Add some more output sections.
8131 * testsuite/memory_test.sh: Update expected output.
8132
a9bfd952
DK
81332010-10-02 Doug Kwan <dougkwan@google.com>
8134
8135 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8136 defintion to symtab.h
8137 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8138 declaration to defintion.
8139
bacff3ab
NC
81402010-10-01 Nick Clifton <nickc@redhat.com>
8141
8142 * expression.cc (eval): Replace dummy argument with NULL.
8143 (eval_maybe_dot): Check for a NULL result section pointer.
8144 (Symbol_expression::value): Likewise.
8145 (Dot_expression::value): Likewise.
8146 (BINARY_EXPRESSION): Likewise.
8147 (Max_expression::value): Likewise.
8148 (Min_expression::value): Likewise.
8149 (Absolute_expression::value): Likewise.
8150 (Addr_expression::value_from_output_section): Likewise.
8151 (Loaddddr_expression::value_from_output_section): Likewise.
8152 (Segment_start_expression::value): Likewise.
8153 * script-sections.cc
8154 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8155 argument with NULL.
8156 (Sections_elememt_dot_assignment::set_section_addresses):
8157 Likewise.
8158 (Output_data_expression::do_write_to_buffer): Likewise.
8159 (Output_section_definition::finalize_symbols): Likewise.
8160 (Output_section_definition::set_section_addresses): Likewise.
8161
f81bc8b5
DK
81622010-09-30 Doug Kwan <dougkwan@google.com>
8163
8164 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8165
c95e9f27
ST
81662010-09-28 Sriraman Tallam <tmsriram@google.com>
8167
8168 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8169 function.
c95e9f27
ST
8170 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8171 virtual function.
8172 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8173 virtual function.
8174 * icf.cc (get_section_contents): Inline merge sections only when
8175 target allows it.
8176
3cac54d2
RW
81772010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8178
8179 * configure: Regenerate.
8180
2904037a
ILT
81812010-09-17 Ian Lance Taylor <iant@google.com>
8182
8183 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8184 * testsuite/Makefile.am (memory_test.o): New target.
8185 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8186 memory_test.t.
8187 * testsuite/Makefile.in: Rebuild.
2904037a 8188
bca7fb63
DK
81892010-09-17 Doug Kwan <dougkwan@google.com>
8190
8191 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8192 defintion if relocation uses GOT entries of the symbol.
8193 * testsuite/icf_safe_test.sh: Fix test.
8194 * testsuite/icf_safe_so_test.sh: Fix test.
8195
4ef28648
CC
81962010-09-16 Cary Coutant <ccoutant@google.com>
8197
8198 * script_sections.cc (class Memory_region): Remove "NULL" from
8199 vector initializations.
8200
793990de
CC
82012010-09-15 Cary Coutant <ccoutant@google.com>
8202
8203 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8204 Resolve forwarding symbols.
8205
81e015e2
DK
82062010-09-15 Doug Kwan <dougkwan@google.com>
8207
8208 * gold/testsuite/script_test_3.t: Add ARM special sections.
8209 * gold/testsuite/script_test_4.t: Same.
8210 * gold/testsuite/script_test_5.t: Same.
8211 * gold/testsuite/script_test_6.t: Same.
8212 * gold/testsuite/script_test_7.t: Same.
8213 * gold/testsuite/script_test_7.t: Same.
8214 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8215
36171d64
CC
82162010-09-14 Cary Coutant <ccoutant@google.com>
8217
8218 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8219 (Target_x86_64::Relocate::relocate_tls): Replace check for
8220 saw_tls_block_reloc_ with test for executable section.
8221
d89051bd
CC
82222010-09-12 Cary Coutant <ccoutant@google.com>
8223
8224 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8225 position-independent executables to shared libraries need dynamic
8226 relocations.
8227 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8228 position-independent executables.
8229 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8230 * testsuite/Makefile.in: Regenerate.
8231
fca41f0f
NC
82322010-09-10 Nick Clifton <nickc@redhat.com>
8233
8234 PR gold/11997
8235 * testsuite/memory_test.t: Discard any sections that are not
8236 needed.
8237
6695e4b3
L
82382010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8239
8240 PR gold/11996
8241 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8242 "This::" to work around a bug in gcc 4.2.
8243
8244 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8245
0f72bf6f
RÁE
82462010-09-09 Rafael Espindola <espindola@google.com>
8247
8248 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8249 sections with different PF_X flags in the same segment.
8250 (Layout::find_first_load_seg): Search all segments to find the first
8251 one.
8252 * options.h (rosegment): New.
8253
82542010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8255
05a79166 8256 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8257
aa98ff75
DK
82582010-09-08 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8261 (Arm_relobj::do_relocate_sections): Add new parameter for output
8262 file to match the parent.
8263 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8264 of local symbols instead of input values. Update code to track
8265 changes in gold::relocate_section.
8266 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8267 (Sized_relobj::compute_final_local_value_internal): New methods.
8268 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8269 body into private version of Sized_relobj::compute_final_local_value.
8270 Call the inline method.
8271 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8272 merged symbol value if there is one.
8273 (Symbol_value::has_output_value): New method defintiion.
8274 (Sized_relobj::Compute_final_local_value_status): New enum type.
8275 (Sized_relobj::compute_final_local_value): New methods.
8276 (Sized_relobj::compute_final_local_value_internal): New methods.
8277 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8278 and arm_cortex_a8.sh.
8279 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8280 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8281 New tests.
8282 * Makefile.in: Regenerate.
8283 * testsuite/arm_bl_out_of_range.s: Update test.
8284 * testsuite/thumb_bl_out_of_range.s: Ditto.
8285 * testsuite/thumb_blx_out_of_range.s: Ditto.
8286 * testsuite/arm_branch_out_of_range.sh: New file.
8287 * testsuite/arm_cortex_a8.sh: Ditto.
8288 * testsuite/arm_cortex_a8_b.s: Ditto.
8289 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8290 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8291 * testsuite/arm_cortex_a8_bl.s: Ditto.
8292 * testsuite/arm_cortex_a8_blx.s: Ditto.
8293 * testsuite/arm_cortex_a8_local.s: Ditto.
8294 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8295 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8296
05a79166
L
82972010-09-08 Rafael Espindola <espindola@google.com>
8298
8299 * Makefile.am (memory_test.stdout): Run readelf with -W.
8300 * Makefile.in: Regenerate.
8301 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8302 64 bit output.
8303
33dbc701
RÁE
83042010-09-08 Rafael Espindola <espindola@google.com>
8305
8306 * script-sections.cc (Script_sections::add_memory_region): Convert
8307 field precision to int.
8308 * script.cc (script_set_section_region, script_set_section_region):
8309 Convert field precision to int.
8310
731ca54a
RÁE
83112010-09-08 Rafael Espindola <espindola@google.com>
8312
8313 * arm.cc (do_finalize_sections): Create the __exidx_start and
8314 __exdix_end symbols even when the section is missing.
8315
7f8cd844
NC
83162010-09-08 Nick Clifton <nickc@redhat.com>
8317
8318 * README: Remove claim that MEMORY is not supported.
8319 * expression.cc (script_exp_function_origin)
8320 (script_exp_function_length): Move from here to ...
8321 * script.cc: ... here.
8322 (script_set_section_region, script_add_memory)
8323 (script_parse_memory_attr, script_include_directive): New
8324 functions.
8325 * script-sections.cc
8326 (class Memory_region): New class.
8327 (class Output_section_definition): Add set_memory_region,
8328 set_section_vma, set_section_lma and get_section_name methods.
8329 (class Script_Sections): Add add_memory_region,
8330 find_memory_region, find_memory_region_origin,
8331 find_memory_region_length and set_memory_region methods.
8332 Have set_section_addresses method walk the list of set memory
8333 regions.
8334 Extend the print methos to display memory regions.
8335 * script-sections.h: Add prototypes for new methods.
8336 Add enum for MEMORY region attributes.
8337 * yyscript.y: Add support for parsing MEMORY regions.
8338 * script-c.h: Add prototypes for new functions.
8339 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8340 * testsuite/Makefile.in: Regenerate.
8341 * testsuite/memory_test.sh: New script.
8342 * testsuite/memory_test.s: New assembler source file.
8343 * testsuite/memory_test.t: New linker script.
8344
a4649286
DK
83452010-08-27 Doug Kwan <dougkwan@google.com>
8346
8347 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8348 reference override an existing dynamic weak reference.
8349 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8350 * testsuite/Makefile.in: Regenerate.
8351 * testsuite/dyn_weak_ref.sh: New file.
8352 * testsuite/dyn_weak_ref_1.c: Ditto.
8353 * testsuite/dyn_weak_ref_2.c: Ditto.
8354
b56648ad
ILT
83552010-08-27 Ian Lance Taylor <iant@google.com>
8356
8357 * incremental.h (class Incremental_input_entry): Add virtual
8358 destructor.
8359
809313cb
ILT
83602010-08-27 Ian Lance Taylor <iant@google.com>
8361
8362 * testsuite/start_lib_test_3.c: Mark t3 as used.
8363
11e32464
NC
83642010-08-27 Nick Clifton <nickc@redhat.com>
8365
8366 * options.cc (version_script): Fix small typo in previous
8367 whitespace tidyup.
8368
ca09d69a
NC
83692010-08-25 Nick Clifton <nickc@redhat.com>
8370
8371 * archive.cc: Formatting fixes: Remove whitespace between
8372 typename and following asterisk. Remove whitespace between
8373 function name and opening parenthesis.
8374 * archive.h: Likewise.
8375 * arm.cc: Likewise.
8376 * attributes.cc: Likewise.
8377 * attributes.h: Likewise.
8378 * common.cc: Likewise.
8379 * copy-relocs.cc: Likewise.
8380 * dirsearch.h: Likewise.
8381 * dynobj.cc: Likewise.
8382 * ehframe.cc: Likewise.
8383 * ehframe.h: Likewise.
8384 * expression.cc: Likewise.
8385 * fileread.cc: Likewise.
8386 * fileread.h: Likewise.
8387 * gc.h: Likewise.
8388 * gold-threads.cc: Likewise.
8389 * gold.cc: Likewise.
8390 * i386.cc: Likewise.
8391 * icf.h: Likewise.
8392 * incremental-dump.cc: Likewise.
8393 * incremental.cc: Likewise.
8394 * layout.cc: Likewise.
8395 * layout.h: Likewise.
8396 * main.cc: Likewise.
8397 * merge.cc: Likewise.
8398 * merge.h: Likewise.
8399 * object.cc: Likewise.
8400 * object.h: Likewise.
8401 * options.cc: Likewise.
8402 * options.h: Likewise.
8403 * output.cc: Likewise.
8404 * output.h: Likewise.
8405 * plugin.cc: Likewise.
8406 * plugin.h: Likewise.
8407 * powerpc.cc: Likewise.
8408 * reloc.cc: Likewise.
8409 * script-c.h: Likewise.
8410 * script-sections.cc: Likewise.
8411 * script.cc: Likewise.
8412 * stringpool.cc: Likewise.
8413 * symtab.cc: Likewise.
8414 * symtab.h: Likewise.
8415 * target.cc: Likewise.
8416 * timer.cc: Likewise.
8417 * timer.h: Likewise.
8418 * version.cc: Likewise.
8419 * x86_64.cc: Likewise.
8420
b8fa8750
NC
84212010-08-24 Nick Clifton <nickc@redhat.com>
8422
8423 PR 11899
8424 * layout.cc (segment_precedes): Sort segments by their physical
8425 addresses, if they have been set.
8426
9919d93b
CC
84272010-08-23 Cary Coutant <ccoutant@google.com>
8428
8429 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8430 symbols data.
8431 (Lib_group::include_member): Unlock object after deleting its
8432 symbols data.
8433 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8434 the bug fixed here.
8435
97b4be1c
CC
84362010-08-19 Neil Vachharajani <nvachhar@google.com>
8437 Cary Coutant <ccoutant@google.com>
8438
8439 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8440 constructor, and set_blocker.
8441 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8442 readsyms_blocker_.
8443 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8444 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8445 * testsuite/Makefile.am (start_lib_test): New test case.
8446 * testsuite/Makefile.in: Regenerate.
8447 * testsuite/start_lib_test_main.c: New file.
8448 * testsuite/start_lib_test_1.c: New file.
8449 * testsuite/start_lib_test_2.c: New file.
8450 * testsuite/start_lib_test_3.c: New file.
8451
dd0b1884
ILT
84522010-08-19 Ian Lance Taylor <iant@google.com>
8453
8454 * Makefile.in: Rebuild with automake 1.11.1.
8455 * aclocal.m4: Likewise.
8456 * testsuite/Makefile.in: Likewise.
8457
7223e9ca
ILT
84582010-08-19 Ian Lance Taylor <iant@google.com>
8459
8460 PR 10893
8461 * i386.cc (class Output_data_plt_i386): Update declarations.
8462 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8463 local_ifuncs_ fields.
8464 (Target_i386::do_plt_section_for_global): New function.
8465 (Target_i386::do_plt_section_for_local): New function.
8466 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8467 parameter; change all callers. Initialize global_ifuncs_ and
8468 local_ifuncs_. If doing a static link define __rel_iplt_start and
8469 __rel_iplt_end.
8470 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8471 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8472 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8473 symbols.
8474 (Target_i386::make_plt_section): New function, broken out of
8475 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8476 (Target_i386::make_plt_entry): Call make_plt_section.
8477 (Target_i386::make_local_ifunc_plt_entry): New function.
8478 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8479 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8480 R_386_IRELATIVE to switch.
8481 (Target_i386::Scan::global): Likewise.
8482 (Target_i386::Relocate::relocate): Likewise.
8483 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8484 switch.
8485 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8486 (Target_x86_64::do_plt_section_for_global): New function.
8487 (Target_x86_64::do_plt_section_for_local): New function.
8488 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8489 parameter; change all callers. If doing a static link define
8490 __rela_iplt_start and __rela_iplt_end.
8491 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8492 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8493 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8494 to point to .plt.
8495 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8496 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8497 switch.
8498 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8499 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8500 R_X86_64_IRELATIVE to switch.
8501 (Target_x86_64::Scan::global): Likewise.
8502 (Target_x86_64::Relocate::relocate): Likewise.
8503 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8504 switch.
8505 * target.h (class Target): Add plt_section_for_global and
8506 plt_section_for_local functions. Add do_plt_section_for_global
8507 and do_plt_section_for_local virtual functions.
8508 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8509 clarifying comments.
8510 (Symbol::use_plt_offset): Handle IFUNC symbol.
8511 * object.cc (Sized_relobj::Sized_relobj): Initialize
8512 local_plt_offsets_.
8513 (Sized_relobj::local_has_plt_offset): New function.
8514 (Sized_relobj::local_plt_offset): New function.
8515 (Sized_relobj::set_local_plt_offset): New function.
8516 (Sized_relobj::do_count): Handle IFUNC symbol.
8517 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8518 a bit away from input_shndx_ field. Add set_is_func_symbol and
8519 is_ifunc_symbol functions.
8520 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8521 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8522 local_plt_offsets_ field.
8523 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8524 * output.h (class Output_section_data): Add non-const
8525 output_section function.
8526 (class Output_data_got): Update declarations.
8527 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8528 Add use_plt_offset parameter to global and local constructors.
8529 Change all callers. Change local_sym_index_ field to 31 bits.
8530 Change GSYM_CODE and CONSTANT_CODE accordingly.
8531 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8532 doing a static link don't set sh_link field.
8533 (Output_data_got::Got_entry::write): Use PLT offset if
8534 appropriate.
8535 (Output_data_got::add_global_plt): New function.
8536 (Output_data_got::add_local_plt): New function.
8537 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8538 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8539 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8540 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8541 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8542 IFUNC conditional.
8543 * testsuite/ifunc-sel.h: New file.
8544 * testsuite/ifuncmain1.c: New file.
8545 * testsuite/ifuncmain1vis.c: New file.
8546 * testsuite/ifuncmod1.c: New file.
8547 * testsuite/ifuncdep2.c: New file.
8548 * testsuite/ifuncmain2.c: New file.
8549 * testsuite/ifuncmain3.c: New file.
8550 * testsuite/ifuncmod3.c: New file.
8551 * testsuite/ifuncmain4.c: New file.
8552 * testsuite/ifuncmain5.c: New file.
8553 * testsuite/ifuncmod5.c: New file.
8554 * testsuite/ifuncmain6pie.c: New file.
8555 * testsuite/ifuncmod6.c: New file.
8556 * testsuite/ifuncmain7.c: New file.
8557 * configure, testsuite/Makefile.in: Rebuild.
8558
56f75c03
ILT
85592010-08-18 Ian Lance Taylor <iant@google.com>
8560
8561 * incremental.cc
8562 (Output_section_incremental_inputs::write_input_files): Add cast
8563 to avoid signed/unsigned comparison warning.
8564 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8565
55455f89
CC
85662010-08-12 Cary Coutant <ccoutant@google.com>
8567
8568 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8569
e2054bcb
ILT
85702010-08-13 Ian Lance Taylor <iant@google.com>
8571
8572 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8573
74f67560
DK
85742010-08-12 Cary Coutant <ccoutant@google.com>
8575 Doug Kwan <dougkwan@google.com>
8576
8577 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8578 defintion overrides non-weak undef, remember that the original undef
8579 is not weak.
8580 * symtab.cc (Symbol_table::sized_write_global): For undef without
8581 an original weak binding, set binding to global in output.
8582 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8583 * testsuite/Makefile.in: Regenerate.
8584 * testsuite/strong_ref_weak_def.sh: New file.
8585 * testsuite/strong_ref_weak_def_1.c: Ditto.
8586 * testsuite/strong_ref_weak_def_2.c: Ditto.
8587
d1238d12
CC
85882010-08-12 Cary Coutant <ccoutant@google.com>
8589
8590 * testsuite/incremental_test.sh: Rewrite.
8591 * testsuite/incremental_test_1.c: Rewrite.
8592 * testsuite/incremental_test_2.c: Rewrite.
8593
0e70b911
CC
85942010-08-12 Cary Coutant <ccoutant@google.com>
8595
8596 * arm.cc (Target_arm::got_size): Add const.
8597 (Target_arm::got_entry_count): New function.
8598 (Target_arm::plt_entry_count): New function.
8599 (Target_arm::first_plt_entry_offset): New function.
8600 (Target_arm::plt_entry_size): New function.
8601 (Output_data_plt_arm::entry_count): New function.
8602 (Output_data_plt_arm::first_plt_entry_offset): New function.
8603 (Output_data_plt_arm::get_plt_entry_size): New function.
8604 * i386.cc (Target_i386::got_size): Add const.
8605 (Target_i386::got_entry_count): New function.
8606 (Target_i386::plt_entry_count): New function.
8607 (Target_i386::first_plt_entry_offset): New function.
8608 (Target_i386::plt_entry_size): New function.
8609 (Output_data_plt_i386::entry_count): New function.
8610 (Output_data_plt_i386::first_plt_entry_offset): New function.
8611 (Output_data_plt_i386::get_plt_entry_size): New function.
8612 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8613 find_incremental_inputs_sections. Dump incremental_got_plt section.
8614 * incremental.cc: Include target.h.
8615 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8616 parameter. Adjust all callers. Find incremental_got_plt section.
8617 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8618 section.
8619 (Output_section_incremental_inputs::set_final_data_size): Calculate
8620 size of incremental_got_plt section.
8621 (Output_section_incremental_inputs::do_write): Write the
8622 incremental_got_plt section.
8623 (Got_plt_view_info): New struct.
8624 (Local_got_offset_visitor): New class.
8625 (Global_got_offset_visitor): New class.
8626 (Global_symbol_visitor_got_plt): New class.
8627 (Output_section_incremental_inputs::write_got_plt): New function.
8628 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8629 Add parameter. Adjust all callers.
8630 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8631 (Incremental_inputs::got_plt_section): New function.
8632 (Incremental_inputs::got_plt_section_): New data member.
8633 (Incremental_got_plt_reader): New class.
8634 * layout.cc (Layout::create_incremental_info_sections): Add the
8635 incremental_got_plt section.
8636 * object.h (Got_offset_list::get_list): New function.
8637 (Got offset_list::for_all_got_offsets): New function.
8638 (Sized_relobj::local_got_offset_list): New function.
8639 * powerpc.cc (Target_powerpc::got_size): Add const.
8640 (Target_powerpc::got_entry_count): New function.
8641 (Target_powerpc::plt_entry_count): New function.
8642 (Target_powerpc::first_plt_entry_offset): New function.
8643 (Target_powerpc::plt_entry_size): New function.
8644 (Output_data_plt_powerpc::entry_count): New function.
8645 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8646 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8647 * sparc.cc (Target_sparc::got_size): Add const.
8648 (Target_sparc::got_entry_count): New function.
8649 (Target_sparc::plt_entry_count): New function.
8650 (Target_sparc::first_plt_entry_offset): New function.
8651 (Target_sparc::plt_entry_size): New function.
8652 (Output_data_plt_sparc::entry_count): New function.
8653 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8654 (Output_data_plt_sparc::get_plt_entry_size): New function.
8655 * symtab.h (Symbol::got_offset_list): New function.
8656 (Symbol_table::for_all_symbols): New function.
8657 * target.h (Sized_target::got_entry_count): New function.
8658 (Sized_target::plt_entry_count): New function.
8659 (Sized_target::plt_entry_size): New function.
8660 * x86_64.cc (Target_x86_64::got_size): Add const.
8661 (Target_x86_64::got_entry_count): New function.
8662 (Target_x86_64::plt_entry_count): New function.
8663 (Target_x86_64::first_plt_entry_offset): New function.
8664 (Target_x86_64::plt_entry_size): New function.
8665 (Output_data_plt_x86_64::entry_count): New function.
8666 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8667 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8668
09ec0418
CC
86692010-08-12 Cary Coutant <ccoutant@google.com>
8670
8671 * archive.cc: Include incremental.h.
8672 (Archive::Archive): Initialize incremental_info_.
8673 (Archive::include_member): Record archive members in incremental info.
8674 (Add_archive_symbols::run): Record begin and end of an archive in
8675 incremental info.
8676 (Lib_group::include_member): Record objects in incremental info.
8677 * archive.h (Incremental_archive_entry): Forward declaration.
8678 (Archive::set_incremental_info): New member function.
8679 (Archive::incremental_info): New member function.
8680 (Archive::Unused_symbol_iterator): New class.
8681 (Archive::unused_symbols_begin): New member function.
8682 (Archive::unused_symbols_end): New member function.
8683 (Archive::incremental_info_): New data member.
8684 * incremental-dump.cc (find_input_containing_global): New function.
8685 (dump_incremental_inputs): Dump new incremental info sections.
8686 * incremental.cc: Include symtab.h.
8687 (Output_section_incremental_inputs): New class.
8688 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8689 new incremental info sections.
8690 (Sized_incremental_binary::do_check_inputs): Likewise.
8691 (Incremental_inputs::report_archive): Remove.
8692 (Incremental_inputs::report_archive_begin): New function.
8693 (Incremental_inputs::report_archive_end): New function.
8694 (Incremental_inputs::report_object): New function.
8695 (Incremental_inputs::finalize_inputs): Remove.
8696 (Incremental_inputs::report_input_section): New function.
8697 (Incremental_inputs::report_script): Rewrite.
8698 (Incremental_inputs::finalize): Do nothing but finalize string table.
8699 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8700 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8701 (Incremental_inputs::create_data_sections): New function.
8702 (Incremental_inputs::relocs_entsize): New function.
8703 (Output_section_incremental_inputs::set_final_data_size): New function.
8704 (Output_section_incremental_inputs::do_write): New function.
8705 (Output_section_incremental_inputs::write_header): New function.
8706 (Output_section_incremental_inputs::write_input_files): New function.
8707 (Output_section_incremental_inputs::write_info_blocks): New function.
8708 (Output_section_incremental_inputs::write_symtab): New function.
8709 * incremental.h (Incremental_script_entry): Forward declaration.
8710 (Incremental_object_entry): Forward declaration.
8711 (Incremental_archive_entry): Forward declaration.
8712 (Incremental_inputs): Forward declaration.
8713 (Incremental_inputs_header_data): Remove.
8714 (Incremental_inputs_header): Remove.
8715 (Incremental_inputs_header_write): Remove.
8716 (Incremental_inputs_entry_data): Remove.
8717 (Incremental_inputs_entry): Remove.
8718 (Incremental_inputs_entry_write): Remove.
8719 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8720 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8721 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8722 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8723 Likewise.
8724 (Incremental_input_entry): New class.
8725 (Incremental_script_entry): New class.
8726 (Incremental_object_entry): New class.
8727 (Incremental_archive_entry): New class.
8728 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8729 (Incremental_inputs::report_inputs): Remove.
8730 (Incremental_inputs::report_archive): Remove.
8731 (Incremental_inputs::report_archive_begin): New function.
8732 (Incremental_inputs::report_archive_end): New function.
8733 (Incremental_inputs::report_object): Change prototype.
8734 (Incremental_inputs::report_input_section): New function.
8735 (Incremental_inputs::report_script): Change prototype.
8736 (Incremental_inputs::get_reloc_count): New function.
8737 (Incremental_inputs::set_reloc_count): New function.
8738 (Incremental_inputs::create_data_sections): New function.
8739 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8740 (Incremental_inputs::inputs_section): New function.
8741 (Incremental_inputs::symtab_section): New function.
8742 (Incremental_inputs::relocs_section): New function.
8743 (Incremental_inputs::get_stringpool): Add const.
8744 (Incremental_inputs::command_line): Add const.
8745 (Incremental_inputs::inputs): Remove.
8746 (Incremental_inputs::command_line_key): New function.
8747 (Incremental_inputs::input_file_count): New function.
8748 (Incremental_inputs::input_files): New function.
8749 (Incremental_inputs::relocs_entsize): New function.
8750 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8751 (Incremental_inputs::finalize_inputs): Remove.
8752 (Incremental_inputs::Input_info): Remove.
8753 (Incremental_inputs::lock_): Remove.
8754 (Incremental_inputs::inputs_): Change type.
8755 (Incremental_inputs::inputs_map_): Remove.
8756 (Incremental_inputs::current_object_entry_): New data member.
8757 (Incremental_inputs::inputs_section_): New data member.
8758 (Incremental_inputs::symtab_section_): New data member.
8759 (Incremental_inputs::relocs_section_): New data member.
8760 (Incremental_inputs::reloc_count_): New data member.
8761 (Incremental_inputs_reader): New class.
8762 (Incremental_symtab_reader): New class.
8763 (Incremental_relocs_reader): New class.
8764 * layout.cc (Layout::finalize): Move finalization of incremental info
8765 and creation of incremental info sections to follow finalization of
8766 symbol table. Set offsets for postprocessing sections.
8767 (Layout::create_incremental_info_sections): Call
8768 Incremental_inputs::create_data_sections. Add incremental symtab
8769 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8770 sections to layout after input sections.
8771 * layout.h (struct Timespec): Forward declaration.
8772 (Layout::incremental_inputs): Add const.
8773 (Layout::create_incremental_info_sections): Add parameter.
8774 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8775 * object.cc: Include incremental.h.
8776 (Relobj::finalize_incremental_relocs): New function.
8777 (Sized_relobj::do_layout): Record input sections in incremental info.
8778 * object.h (Object::output_section): New function.
8779 (Object::output_section_offset): Moved from Relobj.
8780 (Object::get_incremental_reloc_base): New function.
8781 (Object::get_incremental_reloc_count): New function.
8782 (Object::do_output_section): New function.
8783 (Object::do_output_section_offset): Moved from Relobj.
8784 (Object::do_get_incremental_reloc_base): New function.
8785 (Object::do_get_incremental_reloc_count): New function.
8786 (Object::Object): Initialize new data members.
8787 (Relobj::output_section): Renamed do_output_section and moved to
8788 protected.
8789 (Relobj::output_section_offset): Moved to Object.
8790 (Relobj::do_get_incremental_reloc_base): New function.
8791 (Relobj::do_get_incremental_reloc_count): New function.
8792 (Relobj::allocate_incremental_reloc_counts): New function.
8793 (Relobj::count_incremental_reloc): New function.
8794 (Relobj::finalize_incremental_relocs): New function.
8795 (Relobj::next_incremental_reloc_index): New function.
8796 (Relobj::reloc_counts_): New data member.
8797 (Relobj::reloc_bases_): New data member.
8798 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8799 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8800 (Sized_relobj::incremental_relocs_scan): New function.
8801 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8802 (Sized_relobj::incremental_relocs_write): New function.
8803 (Sized_relobj::incremental_relocs_write_reltype): New function.
8804 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8805 incremental link.
8806 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8807 archives and object files elsewhere.
8808 (Add_symbols::run): Report object files here.
8809 (Finish_group::run): Report end of archive at end of group.
8810 * reloc.cc: Include layout.h, incremental.h.
8811 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8812 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8813 (Sized_relobj::incremental_relocs_scan): New function.
8814 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8815 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8816 (Sized_relobj::incremental_relocs_write): New function.
8817 (Sized_relobj::incremental_relocs_write_reltype): New function.
8818 * script.cc (read_input_script): Rewrite test for incremental link.
8819 Change call to Incremental_inputs::report_script.
8820 * symtab.h (Symbol_table::first_global_index): New function.
8821 (Symbol_table::output_count): New function.
8822
ce0d1972
DK
88232010-08-12 Doug Kwan <dougkwan@google.com>
8824
8825 * arm.cc (Target_arm::merge_object_attributes): Check command line
8826 options --no-wchar-size-warning and --no-enum-size-warning.
8827 * options.h (General_options): Add ld-compatible options
8828 --no-enum-size-warning and --no-wchar-size-warning.
8829
6e5710ce
ILT
88302010-08-04 Ian Lance Taylor <iant@google.com>
8831
8832 * x86_64.cc (Target_x86_64::Scan::local): Use
8833 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8834 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8835 (Target_x86_64::Scan::global): Likewise.
8836 (Target_x86_64::Relocate::relocate): Likewise.
8837 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8838 Likewise.
8839
fef830db
CC
88402010-08-03 Cary Coutant <ccoutant@google.com>
8841
8842 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8843 to reserve space in merged_strings vector. Keep total input size
8844 for stats.
8845 (Output_merge_string::do_print_merge_stats): Print total input size.
8846 * merge.h (Output_merge_string): Add input_size_ field.
8847 * stringpool.cc (Stringpool_template::string_length): Move
8848 implementations out of Stringpool_template class and place in
8849 stringpool.h.
8850 * stringpool.h (string_length): Move out of Stringpool_template.
8851
1e3811b0
ILT
88522010-08-03 Ian Lance Taylor <iant@google.com>
8853
8854 PR 11712
8855 * layout.cc (relaxation_loop_body): If address of load segment is
8856 set, adjust address to include headers if possible.
8857
7af0c620
ILT
88582010-08-03 Ian Lance Taylor <iant@google.com>
8859
8860 * version.cc (version_string): Bump to 1.10.
8861
22f0da72
ILT
88622010-08-03 Ian Lance Taylor <iant@google.com>
8863
8864 PR 11805
8865 * layout.h (enum Output_section_order): Define.
8866 (class Layout): Update declarations.
8867 * layout.cc (Layout::get_output_section): Add order parameter.
8868 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8869 is_first_non_relro parameters. Change all callers.
8870 (Layout::choose_output_section): Likewise.
8871 (Layout::add_output_section_data): Likewise.
8872 (Layout::make_output_section): Likewise. Set order.
8873 (Layout::default_section_order): New function.
8874 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8875 * output.cc (Output_section::Output_section): Initialize order_.
8876 Don't initialize deleted fields.
8877 (Output_segment::Output_segment): Don't initialize deleted
8878 fields.
8879 (Output_segment::add_output_section_to_load): New function
8880 replacing add_output_section. Change all callers to call this or
8881 add_output_section_to_nonload.
8882 (Output_segment::add_output_section_to_nonload): New function.
8883 (Output_segment::remove_output_section): Rewrite.
8884 (Output_segment::add_initial_output_data): Likewise.
8885 (Output_segment::has_any_data_sections): Likewise.
8886 (Output_segment::is_first_section_relro): Likewise.
8887 (Output_segment::maximum_alignment): Likewise.
8888 (Output_segment::has_dynamic_reloc): New function replacing
8889 dynamic_reloc_count. Change all callers.
8890 (Output_segment::has_dynamic_reloc_list): New function replacing
8891 dynamic_reloc_count_list. Change all callers.
8892 (Output_segment::set_section_addresses): Rewrite.
8893 (Output_segment::set_offset): Rewrite.
8894 (Output_segment::find_first_and_last_list): Remove.
8895 (Output_segment::set_tls_offsets): Rewrite.
8896 (Output_segment::first_section_load_address): Likewise.
8897 (Output_segment::output_section_count): Likewise.
8898 (Output_segment::section_with_lowest_load_address): Likewise.
8899 (Output_segment::write_section_headers): Likewise.
8900 (Output_segment::print_sections_to_map): Likewise.
8901 * output.h (class Output_data): Remove dynamic_reloc_count_
8902 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8903 (Output_data::add_dynamic_reloc): Rewrite.
8904 (Output_data::has_dynamic_reloc): New function.
8905 (Output_data::dynamic_reloc_count): Remove.
8906 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8907 is_last_relro_, is_first_non_relro_, is_interp_,
8908 is_dynamic_linker_section_ fields. Add order and set_order
8909 functions. Remove is_relro_local, set_is_relro_local,
8910 is_last_relro, set_is_last_relro, is_first_non_relro,
8911 set_is_first_non_relro functions, is_interp, set_is_interp,
8912 is_dynamic_linker_section, and set_is_dynamic_linker_section
8913 functions.
8914 (class Output_segment): Change Output_data_list from std::list to
8915 std:;vector. Add output_lists_ field. Remove output_data_ and
8916 output_bss_ fields. Update declarations.
8917
3ff2ccb0
ILT
89182010-08-02 Ian Lance Taylor <iant@google.com>
8919
8920 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8921 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8922 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8923
88a4108b
ILT
89242010-08-02 Ian Lance Taylor <iant@google.com>
8925
8926 PR 11855
8927 * script.cc (Script_options::Script_options): Initialize
8928 symbol_definitions_ and symbol_references_.
8929 (Script_options::add_symbol_assignment): Update
8930 symbol_definitions_ and symbol_references_.
8931 (Script_options::add_symbol_reference): New function.
8932 (script_symbol): New function.
8933 * script.h (class Script_options): Add symbol_definitions_ and
8934 symbol_references_ fields.
8935 (Script_options::referenced_const_iterator): New type.
8936 (Script_options::referenced_begin): New function.
8937 (Script_options::referenced_end): New function.
8938 (Script_options::is_referenced): New function.
8939 (Script_options::any_unreferenced): New function.
8940 * script-c.h (script_symbol): Declare.
8941 * yyscript.y (exp): Call script_symbol.
8942 * symtab.cc: Include "script.h".
8943 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8944 Change all callers. Check symbols referenced by scripts.
8945 (Symbol_table::add_undefined_symbols_from_command_line): Add
8946 layout parameter. Change all callers.
8947 (Symbol_table::do_add_undefined_symbols_from_command_line):
8948 Likewise. Break out loop body. Check symbols referenced by
8949 scripts.
8950 (Symbol_table::add_undefined_symbol_from_command_line): New
8951 function broken out of
8952 do_add_undefined_symbols_from_command_line.
8953 * symtab.h (class Symbol_table): Update declarations.
8954 * archive.cc: Include "layout.h".
8955 (Archive::should_include_member): Add layout parameter. Change
8956 all callers. Check for symbol mentioned in expression.
8957 * archive.h (class Archive): Update declaration.
8958 * object.cc (Sized_relobj::do_should_include_member): Add layout
8959 parameter.
8960 * object.h (Object::should_include_member): Add layout parameter.
8961 Change all callers.
8962 (Object::do_should_include_member): Add layout parameter.
8963 (class Sized_relobj): Update declaration.
8964 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8965 parameter.
8966 * dynobj.h (class Sized_dynobj): Update declaration.
8967 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8968 layout parameter.
8969 * plugin.h (class Sized_pluginobj): Update declaration.
8970
5f1ab67a
ILT
89712010-08-02 Ian Lance Taylor <iant@google.com>
8972
8973 PR 11866
8974 * output.cc (Output_segment::set_offset): Search for the first and
8975 last sections rather than assuming that the list is in order.
8976 (Output_segment::find_first_and_last_list): New function.
8977 * output.h (class Output_segment): Update declarations.
8978 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8979 (relro_strip_test_SOURCES): New variable.
8980 (relro_strip_test_DEPENDENCIES): New variable.
8981 (relro_strip_test_LDFLAGS): New variable.
8982 (relro_strip_test_LDADD): New variable.
8983 (relro_strip_test.so): New target.
8984
a8df5856
ILT
89852010-08-02 Ian Lance Taylor <iant@google.com>
8986
8987 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8988 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8989 (Target_i386::got_tlsdesc_section): New function.
8990 (Target_i386::got_section): Create space for GOT entries for
8991 TLSDESC relocations.
8992 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8993 R_386_TLS_GOTDESC.
8994 (Target_i386::Scan::global): Likewise.
8995 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8996 using TLSDESC GOT.
8997 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8998 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8999 (Target_x86_64::got_tlsdesc_section): New function.
9000 (Target_x86_64::got_section): Create space for GOT entries for
9001 TLSDESC relocations.
9002 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9003 R_386_TLS_GOTDESC.
9004 (Target_x86_64::Scan::global): Likewise.
9005 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9006 using TLSDESC GOT.
9007
0c10a0a6
ILT
90082010-08-02 Ian Lance Taylor <iant@google.com>
9009
9010 * testsuite/final_layout.sh: Use dc to convert from hex to
9011 decimal.
9012
41cbeecc
ST
90132010-07-29 Sriraman Tallam <tmsriram@google.com>
9014
9015 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9016 paramter to the call to gold::gc_process_relocs.
9017 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9018 paramter to the call to gold::gc_process_relocs.
9019 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9020 parameter to the call to gold::gc_process_relocs.
9021 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9022 template parameter to the call to gold::gc_process_relocs.
9023 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9024 paramter to the call to gold::gc_process_relocs.
9025 * gc.h (get_embedded_addend_size): New function.
9026 (gc_process_relocs): Save the size of the reloc for use by ICF.
9027 * icf.cc (get_section_contents): Get the addend from the text section
9028 for SHT_REL relocation sections.
9029 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9030 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9031 * int_encoding.h (read_from_pointer): New overloaded function.
9032 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9033 * testsuite/icf_sht_rel_addend_test.sh: New file.
9034 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9035 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9036
6ea55b82
RW
90372010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9038
9039 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9040 * Makefile.in: Regenerate.
9041 * testsuite/Makefile.in: Regenerate.
9042
9691462b
ILT
90432010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9044
9045 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9046 * gold/testsuite/debug_msg.cc: Likewise.
9047 * gold/testsuite/odr_violation1.cc
9048 * gold/testsuite/odr_violation2.cc
9049
76897331
CC
90502010-07-21 Cary Coutant <ccoutant@google.com>
9051
9052 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9053 string, and length fields.
9054 (Output_merge_string::Merged_strings_list): New type.
9055 (Output_merge_string::Merged_strings_lists): New typedef.
9056 (Output_merge_string): Replace merged_strings_ with
9057 merged_strings_lists_.
9058 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9059 Merged_strings_list per input object and section. Don't store pointer
9060 to the string. Don't store length with each merged string entry.
9061 (Output_merge_string::finalize_merged_data): Loop over list of merged
9062 strings lists. Recompute length of each merged string.
9063
78384e8f
CC
90642010-07-15 Cary Coutant <ccoutant@google.com>
9065
9066 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9067 here.
9068
783659f9
ILT
90692010-07-14 Ian Lance Taylor <iant@google.com>
9070
9071 * descriptors.cc (Descriptors::open): Report correct name in error
9072 message.
9073
131687b4
DK
90742010-07-13 Doug Kwan <dougkwan@google.com>
9075
9076 * arm.cc (Arm_input_section::Arm_input_section): For a
9077 SHT_ARM_EXIDX section, always keeps the input sections.
9078 (Arm_input_section::set_exidx_section_link): New method.
9079 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9080 has_errors_ to false.
9081 (Arm_exidx_input_section::has_errors,
9082 Arm_exidx_input_section::set_has_errors): New methods.
9083 (Arm_exidx_input_section::has_errors_): New data member.
9084 (Arm_relobj::get_exidx_shndx_list): New method.
9085 (Arm_output_section::append_text_sections_to_list): Do not skip
9086 section without SHF_EXECINSTR.
9087 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9088 errors.
2e702c99 9089 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9090 section header. Make error messages more verbose. Check for
9091 a non-executable section linked to an EXIDX section.
9092 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9093 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9094 check that there is no deferred EXIDX section if we exit early.
9095 Instead of not making an EXIDX section in case of an error, make one
9096 and set the has_errors flag of it.
9097 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9098 in a relocatable link.
9099 (Target_arm::do_relax): Look for the EXIDX output section instead of
9100 assuming that it is called .ARM.exidx.
2e702c99 9101 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9102 section list. Do not check for SHF_EXECINSTR section flags but
9103 skip any input section with errors.
9104 * output.cc (Output_section::Output_section): Initialize
9105 always_keeps_input_sections_ to false.
9106 (Output_section::add_input_section): Check for
9107 always_keeps_input_sections_.
9108 * output.h (Output_section::always_keeps_input_sections,
9109 Output_section::set_always_keeps_input_sections): New methods.
9110 (Output_section::always_keeps_input_sections): New data member.
9111
69517287
RÁE
91122010-07-13 Rafael Espindola <espindola@google.com>
9113
9114 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9115 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9116
82742395
ILT
91172010-07-13 Philip Herron <herron.philip@googlemail.com>
9118 Ian Lance Taylor <iant@google.com>
9119
9120 * output.h (Output_section_lookup_maps::add_merge_section):
9121 Correct check of whether value was inserted.
9122 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9123 (Output_section_lookup_maps::add_relaxed_input_section):
9124 Likewise.
9125 * arm.cc (Target_arm::got_section): Remove used local os.
9126 * i386.cc (Target_i386::got_section): Likewise.
9127 * x86_64.cc (Target_x86_64::got_section): Likewise.
9128 * sparc.cc (Target_sparc::got_section): Likewise.
9129 (Target_sparc::relocate): Remove unused local have_got_offset.
9130 * powerpc.cc (Target_powerpc::relocate): Likewise.
9131
f2d707b5
ILT
91322010-07-13 Ian Lance Taylor <iant@google.com>
9133
241531d6
ILT
9134 * compressed_output.cc (zlib_decompress): Fix signature in
9135 !HAVE_ZLIB_H case.
9136
f2d707b5
ILT
9137 * archive.cc (Archive::include_member): Unlock an external member
9138 of a thin archive. Don't bother to delete an object we know is
9139 NULL.
9140
a2e47362
CC
91412010-07-12 Cary Coutant <ccoutant@google.com>
9142
9143 * compressed_output.cc (zlib_decompress): New function.
9144 (get_uncompressed_size): New function.
9145 (decompress_input_section): New function.
9146 * compressed_output.h (get_uncompressed_size): New function.
9147 (decompress_input_section): New function.
9148 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9149 Handle compressed debug sections.
9150 * layout.cc (is_compressed_debug_section): New function.
9151 (Layout::output_section_name): Map compressed section names to
9152 canonical names.
9153 * layout.h (is_compressed_debug_section): New function.
9154 (is_debug_info_section): Recognize compressed debug sections.
9155 * merge.cc: Include compressed_output.h.
9156 (Output_merge_data::do_add_input_section): Handle compressed
9157 debug sections.
9158 (Output_merge_string::do_add_input_section): Handle compressed
9159 debug sections.
9160 * object.cc: Include compressed_output.h.
9161 (Sized_relobj::Sized_relobj): Initialize new data members.
9162 (build_compressed_section_map): New function.
9163 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9164 * object.h (Object::section_is_compressed): New method.
9165 (Object::do_section_is_compressed): New method.
9166 (Sized_relobj::Compressed_section_map): New type.
9167 (Sized_relobj::do_section_is_compressed): New method.
9168 (Sized_relobj::compressed_sections_): New data member.
9169 * output.cc (Output_section::add_input_section): Handle compressed
9170 debug sections.
9171 * reloc.cc: Include compressed_output.h.
9172 (Sized_relobj::write_sections): Handle compressed debug sections.
9173
ce279a62
CC
91742010-07-08 Cary Coutant <ccoutant@google.com>
9175
9176 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9177 weak when resolving to a dynamic def.
9178 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9179 for weak undef/dynamic def cases. Adjust callers.
9180 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9181 undef_binding_weak_.
9182 (Symbol_table::sized_write_globals): Adjust symbol binding.
9183 (Symbol_table::sized_write_symbol): Add binding parameter.
9184 * symtab.h (Symbol::set_undef_binding): New method.
9185 (Symbol::is_undef_binding_weak): New method.
9186 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9187 (Symbol_table::should_override): Add new parameter.
9188 (Symbol_table::sized_write_symbol): Add new parameter.
9189
9190 * testsuite/weak_undef_file1.cc: Add new test case.
9191 * testsuite/weak_undef_file2.cc: Fix header comment.
9192 * testsuite/weak_undef_test.cc: Add new test case.
9193
b2286c10
DK
91942010-06-29 Doug Kwan <dougkwan@google.com>
9195
9196 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9197 Initialize USE_SYMBOL_.
9198 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9199 definition.
9200 (Arm_reloc_property::uses_symbol_): New data member declaration.
9201 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9202 uses symbol value and symbol is undefined but not weakly undefined.
9203
4802450a
RÁE
92042010-06-28 Rafael Espindola <espindola@google.com>
9205
9206 * plugin.cc (Plugin::load): Use dlerror.
9207
e5ca47ba
ILT
92082010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9209
9210 * symtab.cc (detect_odr_violations): When reporting an ODR
9211 violation, report an object where the symbol is defined.
9212
8a75a161
DK
92132010-06-25 Doug Kwan <dougkwan@google.com>
9214
9215 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9216 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9217 definition.
9218 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9219 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9220 target hook to detect function points.
9221 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9222 * icf.h (Icf::check_section_for_function_pointers): Change type of
9223 parameter SECTION_NAME to const reference to std::string. Use
9224 target hook to determine if section may have unsafe pointers.
9225 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9226 method definition.
9227
42218b9f
RÁE
92282010-06-21 Rafael Espindola <espindola@google.com>
9229
9230 * fileread.cc (Input_file::find_fie): New
9231 (Input_file::open): Use Input_file::find_fie.
9232 * fileread.h (Input_file::find_fie): New
9233 * plugin.cc (set_extra_library_path): New.
9234 (Plugin::load): Add set_extra_library_path to the transfer vector.
9235 (Plugin_manager::set_extra_library_path): New.
9236 (Plugin_manager::add_input_file): Use the extra search path if set.
9237 (set_extra_library_path(): New.
9238 * plugin.h (Plugin_manager): Add set_extra_library_path and
9239 extra_search_path_.
9240
a0506cca
CC
92412010-06-19 Cary Coutant <ccoutant@google.com>
9242
9243 * layout.cc (gdb_sections): Add .debug_types.
9244 (lines_only_debug_sections): Likewise.
9245
6508b958
RÁE
92462010-06-18 Rafael Espindola <espindola@google.com>
9247
9248 * plugin.cc (add_input_file,add_input_library)
9249 (Plugin_manager::add_input_file): Make filename arguments const.
9250 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9251 const.
9252
3e235302
DK
92532010-06-16 Doug Kwan <dougkwan@google.com>
9254
9255 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9256 .ARM.attributes section if we have not merged any input
9257 attributes sections.
9258
106e8a6c
DK
92592010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9260
9261 * arm.cc: Allow combining objects with no EABI version
9262 information.
9263
91ff43fe
RÁE
92642010-06-15 Rafael Espindola <espindola@google.com>
9265
9266 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9267
68ed838c
ILT
92682010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9269
9270 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9271 (struct iovec): Correct !HAVE_READV definition.
9272
f3a2388f
CC
92732010-06-10 Cary Coutant <ccoutant@google.com>
9274
9275 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9276 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9277 reloc sections.
9278 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9279
9280 PR 11683
9281 * symtab.h (Symbol::is_placeholder): New member function.
9282 * target-reloc.h (relocate_section): Check for placeholder symbols.
9283
9284 * testsuite/Makefile.am (plugin_test_8): New test.
9285 (plugin_test_9): New test.
9286 * testsuite/Makefile.in: Regenerate.
9287
e1df38aa
NC
92882010-06-09 Nick Clifton <nickc@redhat.com>
9289
9290 * yyscript.y (input_list_element): Allow strings prefixed with
9291 the '-' character. Treat these as libraries.
9292 * script.cc (script_add_library): New function. Adds a library
9293 specified by "-l<name>" found in an input script.
9294 * script-c.h: Add prototype for script_add_library.
9295
25bbe950
DK
92962010-06-07 Doug Kwan <dougkwan@google.com>
9297
9298 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9299 Restrict stub-group size to be within long conditional branch
9300 range when working around cortex-A8 erratum.
9301
0f32ea4c
ILT
93022010-06-07 Damien Diederen <dd@crosstwine.com>
9303
9304 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9305 #ifdef typo.
9306
8fe2a369
ST
93072010-06-03 Sriraman Tallam <tmsriram@google.com>
9308
9309 PR gold/11658
9310 * output.cc
9311 (Output_section::Input_section_sort_entry::compare_section_ordering):
9312 Change to return non-zero correctly.
9313 (Output_section::Input_section_sort_section_order_index_compare
9314 ::operator()): Change to fix ambiguity in comparisons.
9315
6e9ba2ca
ST
93162010-06-01 Sriraman Tallam <tmsriram@google.com>
9317
9318 * gold.h (is_wildcard_string): New function.
9319 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9320 (Layout::layout_eh_frame): Ditto.
9321 (Layout::find_section_order_index): New method.
9322 (Layout::read_layout_from_file): New method.
9323 * layout.h (Layout::find_section_order_index): New method.
9324 (Layout::read_layout_from_file): New method.
9325 (Layout::input_section_position_): New private member.
9326 (Layout::input_section_glob_): New private member.
9327 * main.cc (main): Call read_layout_from_file here.
9328 * options.h (--section-ordering-file): New option.
9329 * output.cc (Output_section::input_section_order_specified_): New
9330 member.
9331 (Output_section::Output_section): Initialize new member.
9332 (Output_section::add_input_section): Add new parameter.
9333 Keep input sections when --section-ordering-file is used.
9334 (Output_section::set_final_data_size): Sort input sections when
9335 section ordering file is specified.
9336 (Output_section::Input_section_sort_entry): Add new parameter.
9337 Check sorting type.
9338 (Output_section::Input_section_sort_entry::compare_section_ordering):
9339 New method.
9340 (Output_section::Input_section_sort_compare::operator()): Change to
9341 consider section_order_index.
9342 (Output_section::Input_section_sort_init_fini_compare::operator()):
9343 Change to consider section_order_index.
9344 (Output_section::Input_section_sort_section_order_index_compare
9345 ::operator()): New method.
9346 (Output_section::sort_attached_input_sections): Change to sort
9347 according to section order when specified.
e1df38aa
NC
9348 (Output_section::add_input_section<32, true>): Add new parameter.
9349 (Output_section::add_input_section<64, true>): Add new parameter.
9350 (Output_section::add_input_section<32, false>): Add new parameter.
9351 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9352 * output.h (Output_section::add_input_section): Add new parameter.
9353 (Output_section::input_section_order_specified): New
9354 method.
9355 (Output_section::set_input_section_order_specified): New method.
9356 (Input_section::Input_section): Initialize section_order_index_.
9357 (Input_section::section_order_index): New method.
9358 (Input_section::set_section_order_index): New method.
9359 (Input_section::section_order_index_): New member.
9360 (Input_section::Input_section_sort_section_order_index_compare): New
9361 struct.
9362 (Output_section::input_section_order_specified_): New member.
9363 * script-sections.cc (is_wildcard_string): Delete and move modified
9364 method to gold.h.
9365 (Output_section_element_input::Output_section_element_input): Modify
9366 call to is_wildcard_string.
9367 (Output_section_element_input::Input_section_pattern
9368 ::Input_section_pattern): Ditto.
9369 (Output_section_element_input::Output_section_element_input): Ditto.
9370 * testsuite/Makefile.am (final_layout): New test case.
9371 * testsuite/Makefile.in: Regenerate.
9372 * testsuite/final_layout.cc: New file.
9373 * testsuite/final_layout.sh: New file.
9374
3537c84b
RÁE
93752010-06-01 Rafael Espindola <espindola@google.com>
9376
9377 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9378
105b6afd
RÁE
93792010-06-01 Rafael Espindola <espindola@google.com>
9380
9381 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9382 visibility of symbols.
9383
29e11421
DK
93842010-05-27 Doug Kwan <dougkwan@google.com>
9385
9386 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9387 from start of output section instead of address for a local symbol
9388 in a merged or relaxed section when doing a relocatable link.
9389
5e0f337e
RÁE
93902010-05-26 Rafael Espindola <espindola@google.com>
9391
703d02da 9392 PR 11604
5e0f337e
RÁE
9393 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9394 adding sections the garbage collector removed.
9395 * gold/testsuite/Makefile.am: Add test.
9396 * gold/testsuite/Makefile.in: Regenerate.
9397 * gold/testsuite/plugin_test_7.sh: New.
9398 * gold/testsuite/plugin_test_7_1.c: New.
9399 * gold/testsuite/plugin_test_7_2.c: New.
9400
f4187277
RÁE
94012010-05-26 Rafael Espindola <espindola@google.com>
9402
9403 * script-sections.cc (Output_section_definition::set_section_addresses):
9404 Check for --section-start.
9405
5c388529
DK
94062010-05-26 Doug Kwan <dougkwan@google.com>
9407
9408 * arm.cc (Arm_scan_relocatable_relocs): New class.
9409 (Target_arm::relocate_special_relocatable): New method.
9410 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9411 (Arm_relocate_functions::thumb_branch_common): Same.
9412 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9413 instead of Default_scan_relocatable_relocs.
9414 * target-reloc.h (relocate_for_relocatable): Let target handle
9415 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9416 * target.h (Sized_target::relocate_special_relocatable): New method.
9417
bca1c3ae
ILT
94182010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9419
9420 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9421
0439c796
DK
94222010-05-23 Doug Kwan <dougkwan@google.com>
9423
9424 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9425 instead of a cast.
9426 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9427 with a direct branch, not a conditional branch, to a stub.
9428 * merge.cc (Output_merge_base::record_input_section): New method
9429 defintion.
9430 (Output_merge_data::do_add_input_section): Record input section if
9431 keeps-input-sections flag is set.
9432 (Output_merge_string::do_add_input_section): Ditto.
9433 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9434 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9435 INPUT_SECTIONS_.
9436 (Output_merge_base::keeps_input_sections,
9437 Output_merge_base::set_keeps_input_sections,
9438 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9439 method definitions.
9440 (Output_merge_base::Input_sections): New type declaration.
9441 (Output_merge_base::input_sections_begin,
9442 Output_merge_base::input_sections_end,
9443 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9444 (Output_merge_base::bool keeps_input_sections_,
9445 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9446 Output_merge_base::input_sections_): New data members.
9447 (Output_merge_data::do_set_keeps_input_sections): New method
9448 defintion.
9449 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9450 * output.cc (Output_section::Input_section::relobj): Move method
9451 defintion from class declaration to here and handle merge sections.
9452 (Output_section::Input_section::shndx): Ditto.
9453 (Output_section::Output_section): Remove initializations of removed
9454 data members and initialize new data member LOOKUP_MAPS_.
9455 (Output_section::add_input_section): Set keeps-input-sections flag
9456 for a newly created merge output section as appropriate. Adjust code
9457 to use Output_section_lookup_maps class.
9458 (Output_section::add_relaxed_input_section): Adjst code for lookup
9459 maps code refactoring.
2e702c99 9460 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9461 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9462 class. If adding input section to a newly created merge output
9463 section fails, remove the new merge section.
9464 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9465 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9466 (Output_section::find_merge_section): Ditto.
0439c796 9467 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9468 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9469 Output_section_lookup_maps class.
9470 (Output_section::get_input_sections): Export merge sections. Adjust
9471 code to use Output_section_lookup_maps class.
9472 (Output_section:::add_script_input_section): Adjust code to use
9473 Output_section_lookup_maps class. Update lookup maps for merge
9474 sections also.
9475 (Output_section::discard_states): Use Output_section_lookup_maps.
9476 (Output_section::restore_states): Same.
9477 * output.h (Merge_section_properties): Move class defintion out of
9478 Output_section.
9479 (Output_section_lookup_maps): New class.
9480 (Output_section::Input_section::is_merge_section): New method
9481 defintion.
9482 (Output_section::Input_section::relobj): Move defintion out of class
9483 defintion. Declare method only.
9484 (Output_section::Input_section::shndx): Ditto.
9485 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9486 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9487 (Output_section::Merge_section_by_properties_map,
9488 Output_section::Output_section_data_by_input_section_map,
9489 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9490 Remove types.
2e702c99 9491 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9492 KEEPS_INPUT_SECTIONS.
9493 (Output_section::build_lookup_maps): New method declaration.
9494 (Output_section::merge_section_map_,
9495 Output_section::merge_section_by_properties_map_,
9496 Output_section::relaxed_input_section_map_,
9497 Output_section::is_relaxed_input_section_map_valid_): Remove data
9498 members.
9499 (Output_section::lookup_maps_): New data member.
9500
76295588
L
95012010-05-21 Doug Kwan <dougkwan@google.com>
9502
9503 PR gold/11619
9504 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9505 avoid a compilation error.
9506
d103a984
RÁE
95072010-05-19 Rafael Espindola <espindola@google.com>
9508
9509 * script-sections.cc (Output_section_definition::allocate_to_segment):
9510 Update the phdrs_list even when the output section is NULL.
9511 * testsuite/Makefile.am: Add test.
9512 * testsuite/Makefile.in: Regenerate.
9513 * testsuite/script_test_9.cc: New.
9514 * testsuite/script_test_9.sh: New.
9515 * testsuite/script_test_9.t: New.
9516
6625d24e
DK
95172010-05-19 Doug Kwan <dougkwan@google.com>
9518
9519 * arm.cc (Arm_input_section::original_size): New method.
9520 (Arm_input_section::do_addralign): Add a cast.
9521 (Arm_input_section::do_output_offset): Remove static cast.
9522 (Arm_input_section::original_addralign,
9523 Arm_input_section::original_size_): Change type to uint32_t.
9524 (Arm_input_section::init): Add safe casts for section alignment
9525 and size.
9526 (Arm_input_section::set_final_data_size): Do not set address and
9527 offset of stub table.
9528 (Arm_output_section::fix_exidx_coverage): Change use of of
9529 Output_section::Simple_input_section to that of
9530 Output_section::Input_section.
9531 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9532 except for the first pass.
9533 * output.cc (Output_section::get_input_sections): Change type of
9534 input_sections to std::list<Input_section>.
9535 (Output_section::add_script_input_section): Rename from
9536 Output_section::add_simple_input_section. Change type of SIS
9537 parameter from Simple_input_section to Input_section.
9538 * output.h (Output_section::Simple_input_section): Remove class.
9539 (Output_section::Input_section): Change class visibility to public.
9540 (Output_section::Input_section::addralign): Use stored alignments
9541 for special input sections if set.
9542 (Output_section::Input_section::set_addralign): New method.
9543 (Output_section::get_input_sections): Change parameter type from
9544 list of Simple_input_section to list of Input_section.
9545 (Output_section::add_script_input_section): Rename from
9546 Output_section::add_simple_input_section. Change first parameter's
9547 type from Simple_input_section to Input_section and remove the
9548 second and third parameters.
9549 * script-sections.cc (Input_section::Input_section_list): Change
9550 type to list of Output_section::Input_section/
9551 (Input_section_info::Input_section_info): Change parameter type of
9552 INPUT_SECTION to Output_section::Input_section.
9553 (Input_section_info::input_section): Change return type.
9554 (Input_section_info::input_section_): Change type to
9555 Output_section::Input_section.
9556 (Output_section_element_input::set_section_addresses): Adjust code
9557 to use Output_section::Input_section instead of
9558 Output_section::Simple_input_section. Adjust code for renaming
9559 of Output_section::add_simple_input_section.
9560 (Orphan_output_section::set_section_addresses): Ditto.
9561
e1e82ea4
RW
95622010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9563
9564 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9565 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9566
91e75c8a
RÁE
95672010-05-18 Rafael Espindola <espindola@google.com>
9568
9569 * options.cc (General_options::finalize): Handle -nostdlib.
9570 * options.h (nostdlib): New option.
9571 * script.cc (script_add_search_dir): Handle -nostdlib.
9572
da59ad79
DK
95732010-05-12 Doug Kwan <dougkwan@google.com>
9574
9575 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9576 attributes section only if there no attributes section after merging.
9577 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9578 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9579 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9580 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9581 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9582 and arm_attr_merge_7.stdout.
9583 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9584 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9585 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9586 arm_attr_merge_7b.o): New rules.
9587 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9588 arm_attr_merge_7
9589 * testsuite/Makefile.in: Regenerate.
9590 * testsuite/arm_attr_merge.sh: New file.
9591 * testsuite/arm_attr_merge_[67][ab].s: Same.
9592
3e01a7fd
NC
95932010-05-05 Nick Clifton <nickc@redhat.com>
9594
9595 * po/es.po: Updated Spanish translation.
9596
7ad2014a
L
95972010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9598
9599 * Makefile.am (install-exec-local): Properly install gold as
9600 default cross linker.
9601 * Makefile.in: Regenerated.
9602
4fda8867
NC
96032010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9604 Nick Clifton <nickc@redhat.com>
9605
9606 * configure.ac (install_as_default): Define and set to false
9607 unless --enable-gold or --enable-gold=both/gold has been
9608 specified.
9609 * configure: Regenerate.
9610
9611 * Makefile.am (install-exec-local): Install the executable as
9612 'ld.gold'. If install_as_default is true then also install it as
9613 'ld'.
9614 * Makefile.in: Regenerated.
9615
bd288ea2
ILT
96162010-04-24 Ian Lance Taylor <iant@google.com>
9617
9618 * layout.cc (Layout::layout_reloc): In relocatable link don't
9619 combine reloc sections for grouped sections.
9620
ef38fd8a
ST
96212010-04-23 Sriraman Tallam <tmsriram@google.com>
9622
9623 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9624 sections that are not ordinary to icf.
9625 * icf.cc (get_section_contents): Handle relocation pointing to section
9626 with no object or shndx information.
9627 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9628 * testsuite/Makefile.in: Regenerate.
9629 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9630 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9631
f6973bdc
ILT
96322010-04-22 Ian Lance Taylor <iant@google.com>
9633
9634 * expression.cc (Expression::Expression_eval_info): Add
9635 result_alignment_pointer field.
9636 (Expression::eval_with_dot): Add result_alignment_pointer
9637 parameter. Change all callers.
9638 (Expression::eval_maybe_dot): Likewise.
9639 (class Binary_expression): Add alignment_pointer parameter to
9640 left_value and right_value. Change all callers.
9641 (BINARY_EXPRESSION): Set result alignment.
9642 (class Trinary_expression): Add alignment_pointer parameter to
9643 arg2_value and arg3_value. Change all callers.
9644 (Trinary_cond::value): Set result alignment.
9645 (Max_expression::value, Min_expression::value): Likewise.
9646 (Align_expression::value): Likewise.
9647 * script-sections.cc (class Sections_element): Add dot_alignment
9648 parameter to set_section_addresses virtual function. Update
9649 instantiations.
9650 (class Output_section_element): Likewise.
9651 (Script_sections::create_segments): Add dot_alignment parameter.
9652 Change all callers.
9653 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9654 (Script_sections::set_phdrs_clause_addresses): Likewise.
9655 * script-sections.h: Update declarations.
9656 * script.h: Update declarations.
9657 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9658 min_p_align.
9659 * testsuite/script_test_3.t: Set large alignment.
9660 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9661 segment has expected alignment.
9662
9c9c98a5
NC
96632010-04-22 Nick Clifton <nickc@redhat.com>
9664
9665 * po/gold.pot: Updated by the Translation project.
9666 * po/vi.po: Updated Vietnamese translation.
9667
2253bfba
L
96682010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9669
9670 * testsuite/Makefile.am (check_PROGRAMS): Add
9671 icf_virtual_function_folding_test.
9672 * testsuite/Makefile.in: Regenerated.
9673
85fdf906
AH
96742010-04-15 Andrew Haley <aph@redhat.com>
9675
9676 * options.h (merge_exidx_entries): New option.
9677 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9678 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9679 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9680 (Target_arm::merge_exidx_entries): New function.
9681 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9682 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9683 to Arm_exidx_fixup constructor.
9684 Add new arg, merge_exidx_entries.
9685 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9686 Arm_output_section::fix_exidx_coverage.
9687
ce97fa81
ST
96882010-04-18 Sriraman Tallam <tmsriram@google.com>
9689
9690 * icf.cc (get_section_contents): Check for preemptible functions.
9691 Ignore addend when appropriate.
9692 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9693 section folded.
9694 (add_from_relobj): Check for section folded.
9695 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9696 * symtab.h (should_add_dynsym_entry): Add new parameter.
9697 * target-reloc.h (scan_relocs): Check for section folded.
9698 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9699 Check reloc types for function pointers in shared objects.
9700 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9701 case.
9702 (icf_preemptible_functions_test): New test case.
9703 (icf_string_merge_test): New test case.
9704 * testsuite.Makefile.in: Regenerate.
9705 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9706 bar_glob. Refactor code.
9707 * testsuite/icf_preemptible_functions_test.cc: New file.
9708 * testsuite/icf_preemptible_functions_test.sh: New file.
9709 * testsuite/icf_string_merge_test.cc: New file.
9710 * testsuite/icf_string_merge_test.sh: New file.
9711 * testsuite/icf_virtual_function_folding_test.cc: New file.
9712 * testsuite/icf_virtual_function_folding_test.sh: New file.
9713
04ceb17c
DK
97142010-04-14 Doug Kwan <dougkwan@google.com>
9715
9716 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9717 for local symbol recounting if we remove a section due to ICF.
9718 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9719 there are no regular objects in input.
9720
153e7da4
DK
97212010-04-13 Doug Kwan <dougkwan@google.com>
9722
9723 * arm.cc (Arm_input_section::set_final_data_size): Compute
9724 accurate final data size instead of using current data size.
9725
4dbd9faf
DK
97262010-04-09 Doug Kwan <dougkwan@google.com>
9727
9728 * layout.cc (Layout::choose_output_section): Handle script section
9729 types.
9730 (Layout::make_output_section_for_script): Add section type parameter.
9731 Handle script section types.
9732 * layout.h (Layout::make_output_section_for_script): Add section
9733 type parameter.
9734 * output.cc (Output_section::Output_section): Initialize data member
9735 is_noload_.
9736 (Output_section::do_reset_address_and_file_offset): Do not set address
9737 to 0 if section is a NOLOAD section.
9738 * output.h (Output_section::is_noload): New method.
9739 (Output_section::set_is_noload): Ditto.
9740 (Output_section::is_noload_): New data member.
9741 * script-c.h (Script_section_type): New enum type.
9742 (struct Parser_output_section_header): Add new file section_type.
9743 * script-sections.cc (Sections_element::output_section_name): Add
9744 parameter for returning script section type.
9745 (Output_section_definition::output_section_name): Ditto.
9746 (Output_section_definition::section_type)P; New method.
9747 (Output_section_definiton::script_section_type_name): Ditto.
9748 (Output_section_definition::script_section_type_): New data member.
9749 (Output_section_definition::Output_section_definition): Initialize
9750 data member Output_section_definition::script_section_type_.
9751 (Output_section_definition::create_sections): Pass script section type
9752 to Layout::make_output_section_for_script.
9753 (Output_section_definition::output_section_name): Return script
9754 section type to caller.
9755 (Output_section_definition::set_section_address): Do not advance
9756 dot value and load address if section type is NOLOAD. Set address
9757 of NOLOAD sections regardless of section flags.
9758 (Output_section_definition::print): Print section type if it is
9759 not SCRIPT_SECTION_TYPE_NONE.
9760 (Output_section_definition::section_type): New method.
9761 (Output_section_definition::script_section_type_name): Ditto.
9762 (Script_sections::output_section_name): Add new parameter
9763 PSECTION_TYPE for returning script section type. Pass it to
9764 section elements. Handle discard sections.
9765 (Sort_output_sections::operator()): Handle NOLOAD sections.
9766 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9767 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9768 returning script section type.
9769 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9770 INFO and NOLOAD.
9771 * yyscript.y (union): Add new field SECTION_TYPE.
9772 (COPY, DSECT, INFO, NOLOAD): New tokens.
9773 (opt_address_and_section_type): Change type to output_section_header.
9774 (section_type): New non-terminal
9775 (section_header): Handle section type.
2253bfba 9776 (opt_address_and_section_type): Return section type value.
4dbd9faf 9777
721ea635
L
97782010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9779
9780 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9781 * testsuite/plugin_common_test_2.c (foo): Likewise.
9782
6bf924b0
DK
97832010-04-08 Doug Kwan <dougkwan@google.com>
9784
9785 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9786 Output_merge_data.
9787 * output.cc (Output_section::add_merge_input_section): Simplify
9788 code and return status of Output_merge_base::add_input_section.
e1df38aa 9789 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9790 returns true.
9791
24af6f92
DK
97922010-04-07 Doug Kwan <dougkwan@google.com>
9793
9794 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9795 if section is marked as containing instructions but has no mapping
9796 symbols.
9797 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9798 correct section index.
9799 (Arm_relobj::find_linked_text_section): Ditto.
9800
00698fc5
CC
98012010-04-07 Cary Coutant <ccoutant@google.com>
9802
9803 * archive.cc (include_member): Destroy Read_symbols_data object before
9804 releasing file.
9805 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9806 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9807 (Read_symbols_data::~Read_symbols_data) New destructor.
9808 (Section_relocs::Section_relocs) New constructor.
9809 (Section_relocs::~Section_relocs) New destructor.
9810 (Read_relocs_data::Read_relocs_data) New constructor.
9811 (Read_relocs_data::~Read_relocs_data) New destructor.
9812 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9813 pointers to NULL after deleting.
9814
7296d933
DK
98152010-04-07 Doug Kwan <dougkwan@google.com>
9816
9817 * arm.cc: Replace "endianity" with "endianness" in comments.
9818 (Arm_exidx_cantunwind): Ditto.
9819 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9820 (Arm_relobj::merge_flags_and_attributes): New method.
9821 (Arm_relobj::merge_flags_and_attributes_): New data member.
9822 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9823 (Arm_relobj::scan_sections_for_stubs): Ditto.
9824 (Arm_relobj::do_read_symbols): Check to see if we really want to
9825 merge processor-specific flags and attributes. Exit early if
9826 an object is empty except for section names and the undefined symbol.
9827 (Target_arm::do_finalize_sections): Move check for ELF format to
9828 Arm_relobj::do_read_symbols. Merge processor specific flags and
9829 attributes from a regular object only when we have determined that
9830 it is aapropriate. Do not create an .ARM.attributes section in
9831 output if there is no regular input object.
9832 (Target_arm::merge_processor_specific_flags): Check
9833 --warn-mismatch before printing any error.
9834 (Target_arm::merge_object_attributes): Ditto.
9835 * gold.cc (queue_middle_tasks): Handle the case in which there is
9836 no regular object in input.
9837 * options.cc (General_options::parse_EB): New method.
9838 (General_options::parse_EL): Same.
9839 (General_options::General_options): Initialize endianness_.
9840 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9841 New options.
9842 (General_options::Endianness): New enum.
9843 (General_options::endianness): New method.
9844 (General_options::endianness_): New data member.
9845 * parameters.cc (Parameters::set_options): Check target endianness.
9846 (Parameters::set_target_once): Ditto.
9847 (Parameters::check_target_endianness): New method.
9848 (parameters_force_valid_target): If either -EL or -EB is specified,
9849 use it to define endianness of default target.
9850 * parameters.h (Parameters::check_target_endianness): New method
9851 declaration.
9852 * target.h (class Target): Change "endianity" to "endianness"
9853 in comments.
9854
efc8d4f2
RW
98552010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9856
9857 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9858 * configure: Regenerate.
9859 * Makefile.in: Regenerate.
9860 * testsuite/Makefile.in: Regenerate.
9861
be234d88
CC
98622010-04-06 Cary Coutant <ccoutant@google.com>
9863
9864 gcc PR lto/42757
9865 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9866 prevailing definitions of common symbols.
9867 * testsuite/plugin_test_6.sh: New test case.
9868 * testsuite/plugin_common_test_1.c: New test case.
9869 * testsuite/plugin_common_test_2.c: New test case.
9870 * testsuite/Makefile.am (plugin_test_6): New test case.
9871 * testsuite/Makefile.in: Regenerate.
9872
bd32c6bd
NC
98732010-04-06 Nick Clifton <nickc@redhat.com>
9874
9875 * po/vi.po: New Vietnamese translation.
9876
323c532f
DK
98772010-03-30 Doug Kwan <dougkwan@google.com>
9878
9879 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9880
4fcd97eb
DK
98812010-03-25 Doug Kwan <dougkwan@google.com>
9882
9883 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9884 to avoid a conversion warning on a 32-bit host.
9885
4ebf39db
ILT
98862010-03-24 Ian Lance Taylor <iant@google.com>
9887
9888 * testsuite/script_test_3.t: Add a TLS segment.
9889 * testsuite/Makefile.am (check_PROGRAMS): Add
9890 tls_phdrs_script_test.
9891 (tls_phdrs_script_test_SOURCES): Define.
9892 (tls_phdrs_script_test_DEPENDENCIES): Define.
9893 (tls_phdrs_script_test_LDFLAGS): Define.
9894 (tls_phdrs_script_test_LDADD): Define.
9895 * testsuite/Makefile.in: Rebuild.
9896
4a599bdd
CC
98972010-03-23 Cary Coutant <ccoutant@google.com>
9898
9899 * fileread.cc (find_or_make_view): Fix comment.
9900
6c93b22c
ILT
99012010-03-23 Ian Lance Taylor <iant@google.com>
9902
9903 * script-sections.cc (class Orphan_section_placement): Define
9904 PLACE_TLS and PLACE_TLS_BSS.
9905 (Orphan_section_placement::Orphan_section_placement): Initialize
9906 new places.
9907 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9908 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9909 (tls_script_test_SOURCES): Define.
9910 (tls_script_test_DEPENDENCIES): Define.
9911 (tls_script_test_LDFLAGS): Define.
9912 (tls_script_test_LDADD): Define.
9913 * testsuite/Makefile.in: Rebuild.
9914
a2c7281b
DK
99152010-03-22 Doug Kwan <dougkwan@google.com>
9916
9917 * arm.cc (Arm_relocate_functions::abs8,
9918 Arm_relocate_functions::abs16): Use correct check for overflow
9919 specified in the ARM ELF specs.
9920 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9921 target of a BLX instruction specially.
9922 (Reloc_stub::stub_type_for_reloc): Ditto.
9923 (Relocate::relocate): Use symbolic names instead of numeric relocation
9924 codes to report error.
9925 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9926 workaround.
9927 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9928 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9929 thumb2_blx_out_of_range.stdout
9930 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9931 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9932 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9933 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9934 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9935 thumb2_blx_in_range, thumb2_blx_in_range.o,
9936 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9937 thumb2_blx_out_of_range.o): New rules.
2e702c99 9938 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9939 thumb2_blx_in_range and thumb2_blx_out_of_range.
9940 * testsuite/Makefile.in: Regenerate.
9941 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9942 * testsuite/thumb_blx_in_range.s: New file.
9943 * testsuite/thumb_blx_out_of_range.s: New file.
9944
b0193076
RÁE
99452010-03-22 Rafael Espindola <espindola@google.com>
9946
9947 * archive.cc (Should_include): Move to archive.h.
9948 (should_include_member): Make it a member of Archive.
9949 (Lib_group): New.
9950 (Add_lib_group_symbols): New.
9951 * archive.h: Include options.h.
9952 (Archive_member): Moved from Archive.
9953 (Should_include): Moved from archive.cc.
9954 (Lib_group): New.
9955 (Add_lib_group_symbols): New.
9956 * dynobj.cc (do_should_include_member): New.
9957 * dynobj.h (do_should_include_member): New.
9958 * gold.cc (queue_initial_tasks): Update call to queue.
9959 * main.cc (main): Print lib group stats.
9960 * object.cc (do_should_include_member): New.
9961 * object.h: Include archive.h.
9962 (Object::should_include_member): New.
9963 (Object::do_should_include_member): New.
9964 (Sized_relobj::do_should_include_member): New.
9965 * options.cc (General_options::parse_start_lib): New.
9966 (General_options::parse_end_lib): New.
9967 (Input_arguments::add_file): Handle lib groups.
9968 (Input_arguments::start_group): Check we are not in a lib.
9969 (Input_arguments::start_lib): New.
9970 (Input_arguments::end_lib): New.
9971 * options.h (General_options): Add start_lib and end_lib.
9972 (Input_argument::lib_): New.
9973 (Input_argument::lib): New.
9974 (Input_argument::is_lib): New.
9975 (Input_file_lib): New.
9976 (Input_arguments::in_lib_): New.
9977 (Input_arguments::in_lib): New.
9978 (Input_arguments::start_lib): New.
9979 (Input_arguments::end_lib_): New.
9980 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9981 in unused members as preempted.
9982 (Sized_pluginobj::do_should_include_member): New.
9983 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9984 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9985 return the blocker.
9986 (Read_symbols::do_whole_lib_group): New.
9987 (Read_symbols::do_lib_group): New.
9988 (Read_symbols::do_read_symbols): Handle lib groups.
9989 (Read_symbols::get_name): Handle lib groups.
9990 * readsyms.h (Read_symbols): Add an archive member pointer.
9991 (Read_symbols::do_whole_lib_group): New.
9992 (Read_symbols::do_lib_group): New.
9993 (Read_symbols::member_): New.
9994 * script.cc (read_input_script): Update call to queue_soon.
9995
d099120c
DK
99962010-03-19 Doug Kwan <dougkwan@google.com>
9997
9998 * arm.cc (Stub_table::Stub_table): Initialize new data members
9999 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10000 (Stub_table::add_reloc_stub): Assign stub offset and update
10001 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10002 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10003 New data members.
2e702c99 10004 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10005 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10006 instead of going over all reloc stubs.
2e702c99 10007 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10008 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10009 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10010 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10011 Stringpool_template::offset_.
10012 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10013 Stringpool_template::offset_ to zero.
10014
1aa37384
DK
100152010-03-15 Doug Kwan <dougkwan@google.com>
10016
10017 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10018 offset_.
10019 (Stringpool_template::new_key_offset): New method.
10020 (Stringpool_template::add_string): Assign offsets when adding new
10021 strings.
10022 (Stringpool_template::set_string_offsets): Do not set string offsets
10023 when not optimizing.
10024 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10025 member size_.
2e702c99
RM
10026 (Chunked_vector::clear): Clear size_.
10027 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10028 (Chunked_vector::size): Return size_.
10029 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10030 (Chunked_vector::size_): New data member.
1aa37384
DK
10031 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10032 (Stringpool_template::new_key_offset): New method declaration.
10033 (Stringpool_template::offset_): New data member.
10034
b672b057
RÁE
100352010-03-15 Rafael Espindola <espindola@google.com>
10036
10037 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10038 Add_symbols' constructor.
10039 * readsyms.h (Add_symbols): Remove the input_group member.
10040
b6848d3c
ILT
100412010-03-10 Ian Lance Taylor <iant@google.com>
10042
10043 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10044 target to ask whether a reference to a symbol requires a stack
10045 split.
10046 * target.h (Target::is_call_to_non_split): New function.
10047 (Target::do_is_call_to_non_split): Declare virtual function.
10048 * target.cc: Include "symtab.h".
10049 (Target::do_is_call_to_non_split): New function.
10050 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10051
a2a5469e
CC
100522010-03-10 Cary Coutant <ccoutant@google.com>
10053
10054 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10055 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10056 (File_read::open[2]): Add whole_file_view_ to list of views.
10057 (File_read::make_view): Remove test of whole_file_view_.
10058 (File_read::find_or_make_view): Create whole_file_view_ if
10059 necessary.
10060 (File_read::clear_views): Replace bool parameter with enum;
10061 adjust all callers. Don't delete views with permanent data;
10062 do delete cached views and views from archives if
10063 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10064 if clearing the corresponding view.
10065 * fileread.h (File_read::Clear_views_mode): New enum.
10066 (File_read::View::is_permanent_view): New method.
10067 (File_read::clear_views): Replace bool parameter
10068 with enum; adjust all callers.
10069 * options.h (General_options): Change keep_files_mapped option;
10070 add map_whole_files.
10071 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10072 releasing the file.
10073 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10074 the file.
10075
8861f32b
DM
100762010-03-10 David S. Miller <davem@davemloft.net>
10077
10078 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10079
d62d0f5f
ST
100802010-03-09 Sriraman Tallam <tmsriram@google.com>
10081
10082 * icf.cc (get_section_contents): Add '@' marker after processing the
10083 merge reloc.
10084
9177756d
DK
100852010-03-08 Doug Kwan <dougkwan@google.com>
10086
10087 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10088 due to a conversion warning.
10089 (Arm_relobj::update_output_local_symbol_count): Check for local
10090 symbol with unset output index.
10091
9e9e071b
ILT
100922010-03-05 Ian Lance Taylor <iant@google.com>
10093
10094 * options.h (class General_options): Add --spare-dynamic-tags.
10095 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10096 --spare-dynamic-tags.
10097
a81ee015
ILT
100982010-03-05 Ian Lance Taylor <iant@google.com>
10099
10100 * incremental.cc: Include "libiberty.h".
10101
44ec90b9
RO
101022010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10103
10104 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10105 function, is_info_ member.
10106 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10107 (Versions::Versions): Update caller.
10108 (Versions::define_base_version): Likewise.
10109 (Versions::add_def): Likewise.
10110
0897ed3b
ST
101112010-03-03 Sriraman Tallam <tmsriram@google.com>
10112
10113 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10114 (Scan::possible_function_pointer_reloc): New function.
10115 (Scan::local_reloc_may_be_function_pointer): Change to call
10116 possible_function_pointer_reloc.
10117 (Scan::global_reloc_may_be_function_pointer): Ditto.
10118 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10119 relocations in ".data.rel.ro._ZTV" section.
10120 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10121 * testsuite/icf_safe_so_test.cc: Ditto.
10122 * testsuite/icf_safe_test.cc: Ditto.
10123 * testsuite/icf_safe_test.sh: Ditto.
10124
d3bbad62
ILT
101252010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10126 Ian Lance Taylor <iant@google.com>
10127
10128 * target-reloc.h (relocate_section): Check the symbol table index
10129 for -1U before setting the local symbol index.
10130 (scan_relocatable_relocs): If copying the relocation, record that
10131 the local symbol is required.
10132 * object.h (Symbol_value::is_output_symtab_index_set): New
10133 function.
10134 (Symbol_value::may_be_discarded_from_output_symtab): New
10135 function.
10136 (Symbol_value::has_output_symtab_entry): New function.
10137 (Symbol_value::needs_output_symtab_entry): Remove.
10138 (Symbol_value::output_symtab_index): Make sure the symbol index is
10139 set.
10140 (Symbol_value::set_output_symtab_index): Make sure the symbol
10141 index is not set. Make sure the new index is valid.
10142 (Symbol_value::set_must_have_output_symtab_entry): New function.
10143 (Symbol_value::has_output_dynsym_entry): New function.
10144 (Symbol_value::set_output_dynsym_index): Make sure the new index
10145 is valid.
10146 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10147 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10148 local symbol if permitted.
10149 (Sized_relobj::do_finalize_local_symbols): Call
10150 is_output_symtab_index_set rather than needs_output_symtab_entry.
10151 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10152 rather than needs_output_symtab_entry. Call
10153 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10154 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10155 is_output_symtab_index_set rather than needs_output_symtab_entry.
10156 * testsuite/discard_locals_relocatable_test.c: New file.
10157 * testsuite/discard_locals_test.sh: Test -r.
10158 * testsuite/Makefile.am (check_DATA): Add
10159 discard_locals_relocatable_test1.syms,
10160 discard_local_relocatable_test2.syms.
10161 (MOSTLYCLEANFILES): Likewise. Also add
10162 discard_locals_relocatable_test1.lout and
10163 discard_locals_relocatable_test2.out.
10164 (discard_locals_relocatable_test1.syms): New target.
10165 (discard_locals_relocatable_test.o): New target.
10166 (discard_locals_relocatable_test1.out): New target.
10167 (discard_locals_relocatable_test2.syms): New target.
10168 (discard_locals_relocatable_test2.out): New target.
10169 (various): Add missing ../ld-new dependencies.
10170 * testsuite/Makefile.in: Rebuild.
10171
7e8ccf26
NC
101722010-03-03 Nick Clifton <nickc@redhat.com>
10173
10174 * po/fi.po: New Finnish translation.
10175
2a0ff005
DK
101762010-03-01 Doug Kwan <dougkwan@google.com>
10177
10178 * layout.cc (Layout::Layout): Force section types of .init_array*,
10179 .preinit_array* and .fini_array* sections.
10180 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10181 Fix check of return value of std::string::find.().
10182 (Output_section::Input_section_sort_compare::operator()): Remove
10183 comment about .init_array.
10184 (Output_section::Input_section_sort_init_fini_compare::operator()):
10185 New method.
10186 (Output_section::sort_attached_input_sections): Handle .init_array
10187 and .fini_array specially.
10188 * output.h (Output_section::Inut_section_sort_compare): Update
10189 comment.
10190 (Output_section::Input_section_sort_init_fini_compare): New struct.
10191
c3e4ae29
DK
101922010-02-26 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10195 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10196 * testsuite/debug_msg.sh: Avoid matching source line number for
10197 use of global variable undef_int.
10198
2fd9ae7a
DK
101992010-02-26 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10202 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10203 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10204 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10205 * options.cc (General_options::General_options): Initialize member
10206 fix_v4bx_.
10207 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10208 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10209 and rm_no_fix_v4bx.stdout
10210 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10211 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10212 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10213 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10214 and arm_no_fix_v4bx.
10215 * Makefile.in: Regenerate.
10216 * testsuite/arm_fix_v4bx.s: New file.
10217 * testsuite/arm_fix_v4bx.sh: Ditto.
10218
67ec7d0b
DK
102192010-02-24 Doug Kwan <dougkwan@google.com>
10220
10221 * arm.cc (Target_arm::got_section): Make the .got section the first
10222 non RELRO section in the data segment.
10223 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10224 suffixes of section names.
10225
10165461
DK
102262010-02-24 Doug Kwan <dougkwan@google.com>
10227
10228 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10229 flags and attributes merging if an input file is a binary file.
10230 * fileread.cc (Input_file::open): Record format of original file.
10231 * fileread.h (Input_file::Format): New enum type.
2e702c99 10232 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10233 (Input_file::format): New method definition.
10234 (Input_file::format_):: New data member.
10235
4a54abbb
DK
102362010-02-24 Doug Kwan <dougkwan@google.com>
10237
10238 * arm.cc (Arm_output_data_got): New class.
10239 (ARM_TCB_SIZE): New constant
10240 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10241 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10242 If user uses a script with a SECTIONS clause, issue only a warning
10243 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10244 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10245 garbage collection.
10246 (Target_arm::got_mode_index_entry): Handle static linking.
10247 (Target_arm::Scan::local): Ditto.
10248 (Target_arm::Scan::global): Ditto.
10249 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10250 all incorrectly implemented relocations.
e1df38aa 10251 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10252 Arm_output_section::fix_exidx_coverage.
10253 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10254 from ".ARM.exidx." and ".ARM.extab.".
10255
ca419a6f
ILT
102562010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10257
10258 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10259 section if it does not already exist.
10260 * attributes.cc (Attributes_section_data::Attributes_section_data):
10261 Don't crash if size is zero.
10262
135b9c78
ILT
102632010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10264 Ian Lance Taylor <iant@google.com>
10265
10266 * gold.cc (queue_middle_tasks): If no input files were opened,
10267 exit.
10268 * workqueue.h (Task_function::Task_function): Assert that there is
10269 a blocker.
10270
bb0bfe4f
DK
102712010-02-22 Doug Kwan <dougkwan@google.com>
10272
10273 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10274 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10275 types to avoid warnings due to different uint64_t implementations
10276 on different hosts.
10277
2a2b6d42
DK
102782010-02-21 Doug Kwan <dougkwan@google.com>
10279
10280 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10281 handling of the maximum backward branch offset.
2e702c99 10282 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10283 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10284 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10285 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10286 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10287 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10288 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10289 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10290 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10291 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10292 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10293 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10294 thumb2_bl_out_of_range.o): New rules.
10295 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10296 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10297 thumb2_bl_out_of_range
10298 * testsuite/Makefile.in: Regenerate.
10299 * testsuite/arm_bl_in_range.s: New file.
10300 * testsuite/arm_bl_out_of_range.s: Ditto.
10301 * testsuite/arm_branch_in_range.sh: Ditto.
10302 * testsuite/arm_branch_range.t: Ditto.
10303 * testsuite/thumb2_branch_range.t: Ditto.
10304 * testsuite/thumb_bl_in_range.s: Ditto.
10305 * testsuite/thumb_bl_out_of_range.s: Ditto.
10306 * testsuite/thumb_branch_range.t: Ditto.
10307
b487ad64
ST
103082010-02-20 Sriraman Tallam <tmsriram@google.com>
10309
10310 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10311 Add reloc offset information.
10312 * icf.cc (get_section_contents): Change iterators to point to the new
10313 vectors. Add reloc offset information to the contents.
10314 * icf.h (Icf::Sections_reachable_info): New typedef.
10315 (Icf::Sections_reachable_list): New typedef.
10316 (Icf::Offset_info): New typedef.
10317 (Icf::Reloc_info): New struct typedef.
10318 (Icf::Reloc_info_list): New typedef.
10319 (Icf::symbol_reloc_list): Delete method.
10320 (Icf::addend_reloc_list): Delete method.
10321 (Icf::section_reloc_list): Delete method.
10322 (Icf::reloc_info_list): New method.
10323 (Icf::reloc_info_list_): New member.
10324
f96accdf
DK
103252010-02-19 Doug Kwan <dougkwan@google.com>
10326
10327 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10328 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10329 * arm.cc (Arm_relocation_functions): New forward declaration.
10330 (Target_arm::Target_arm): Initialize new data members
10331 got_mod_index_offset_ and tls_base_symbol_defined_.
10332 (Target_arm::Relocate::relocate_tls): New method.
10333 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10334 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10335 New methods.
2e702c99 10336 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10337 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10338 (Target_arm::got_mod_index_offset_,
10339 Target_arm::tls_base_symbol_defined_): New data members.
10340 (Target_arm::Scan::local, Target::Scan::global,
10341 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10342 relocations.
10343
c8761b9a
DK
103442010-02-18 Doug Kwan <dougkwan@google.com>
10345
10346 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10347 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10348 text section as a parameter becuase some broken tools may not set
10349 the link in section header.
10350 (Target_arm::has_got_section): New method.
10351 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10352 without any mapping symbol as data only. Remove warning.
10353 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10354 link in its section header, try to discover the link by inspecting the
10355 REL31 relocation at the beginning of the section.
10356 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10357 in error message.
10358 (Target_arm::Scan::global): Treat any reference to the symbol
10359 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10360
21bb3914
ST
103612010-02-12 Sriraman Tallam <tmsriram@google.com>
10362
10363 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10364 (Scan::global_reloc_may_be_function_pointer): New function.
10365 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10366 (Scan::global_reloc_may_be_function_pointer): New function.
10367 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10368 (Scan::global_reloc_may_be_function_pointer): New function.
10369 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10370 (Scan::global_reloc_may_be_function_pointer): New function.
10371 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10372 (Scan::global_reloc_may_be_function_pointer): New function.
10373 (Scan::possible_function_pointer_reloc): New function.
10374 (Target_x86_64::can_check_for_function_pointers): New function.
10375 * gc.h (gc_process_relocs): Scan relocation types to determine if
10376 function pointers were taken for targets that support it.
10377 * icf.cc (Icf::find_identical_sections): Include functions for
10378 folding in safe ICF whose pointer is not taken.
10379 * icf.h (Secn_fptr_taken_set): New typedef.
10380 (fptr_section_id_): New member.
10381 (section_has_function_pointers): New function.
10382 (set_section_has_function_pointers): New function.
10383 (check_section_for_function_pointers): New function.
10384 * options.h: Fix comment for safe ICF option.
10385 * target.h (can_check_for_function_pointers): New function.
10386 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10387 Modify icf_safe_test for X86-64.
10388 * testsuite/Makefile.in: Regenerate.
10389 * testsuite/icf_safe_so_test.cc: New file.
10390 * testsuite/icf_safe_so_test.sh: New file.
10391 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10392 (main): Change to take pointer to function kept_func_3.
10393 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10394 folding is done correctly for X86-64.
10395
0da6fa6c
DM
103962010-02-12 David S. Miller <davem@davemloft.net>
10397
10398 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10399 is_symbolless parameter.
10400 (Output_reloc<SHT_REL>::is_symbolless): New.
10401 (Output_reloc<SHT_REL>::is_symbolless_): New.
10402 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10403 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10404 (Output_reloc<SHT_RELA>::is_symbolless): New.
10405 (Output_data_reloc::add_global): Handle is_symbolless.
10406 (Output_data_reloc::add_global_relative): Likewise.
10407 (Output_data_reloc::add_local): Likewise.
10408 (Output_data_reloc::add_local_relative): Likewise.
10409 (Output_data_reloc::add_symbolless_global_addend): New.
10410 (Output_data_reloc::add_symbolless_local_addend): New.
10411 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10412 is_symbolless.
10413 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10414 instead of ->is_relative_
10415 (Output_reloc::write): Likewise.
10416 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10417 (Output_reloc::write_rel): Simplify.
10418
10419 * sparc.cc (Target_sparc::Scan::local): Use
10420 ->add_symbolless_local_addend as needed.
10421 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10422 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10423 based upon relocation offset.
10424
e4782e83
DK
104252010-02-11 Doug Kwan <dougkwan@google.com>
10426
10427 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10428 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10429 beginning of function.
10430 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10431 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10432 parameter is_32bit in calls to should_apply_static_reloc.
10433 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10434 (check_DATA): Add arm_abs_global.stdout.
10435 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10436 arm_abs_global.stdout): New rules.
10437 (MOSTLLYCLEANFILES): Add arm_abs_global
10438 * Makefile.in: Regenerate.
10439 * testsuite/arm_abs_global.s: New file.
10440 * testsuite/arm_abs_global.sh: Ditto.
10441 * testsuite/arm_abs_lib.s: Ditto.
10442
93ceb764
ILT
104432010-02-11 Ian Lance Taylor <iant@google.com>
10444
10445 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10446 Read_relocs task.
10447 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10448 Allocate_commons_task first.
10449 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10450 task, rather than symtab_lock_.
10451 (Gc_process_relocs::~Gc_process_relocs): New function.
10452 (Gc_process_relocs::is_runnable): Check this_blocker_.
10453 (Gc_process_relocs::locks): Use next_blocker_ rather than
10454 blocker_.
10455 (Scan_relocs::~Scan_relocs): New function.
10456 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10457 symtab_lock_.
10458 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10459 next_blocker_.
10460 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10461 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10462 constructor accordingly.
10463 (class Gc_process_relocs): Likewise.
10464 (class Scan_relocs): Likewise.
10465 * common.h (class Allocate_commons_task): Remove symtab_lock_
10466 field, and corresponding constructor parameter.
10467 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10468 symtab_lock_.
10469 (Allocate_commons_task::locks): Likewise.
10470
114dfbe1
ILT
104712010-02-11 Ian Lance Taylor <iant@google.com>
10472
10473 * gold-threads.h (class Once): Define.
10474 (class Initialize_lock): Rewrite as child of Once.
10475 * gold-threads.cc (class Once_initialize): Define.
10476 (once_pointer_control): New static variable.
10477 (once_pointer, once_arg): New static variables.
10478 (c_run_once): New static function.
10479 (Once::Once, Once::run_once, Once::internal_run): New functions.
10480 (class Initialize_lock_once): Remove.
10481 (initialize_lock_control): Remove.
10482 (initialize_lock_pointer): Remove.
10483 (initialize_lock_once): Remove.
10484 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10485 (Initialize_lock::initialize): Rewrite.
10486 (Initialize_lock::do_run_once): New function.
10487 * archive.cc (Archive::interpret_header): Only clear name if it is
10488 not already empty.
10489 * fileread.cc: Include "gold-threads.h"
10490 (file_counts_lock): New static variable.
10491 (file_counts_initialize_lock): Likewise.
10492 (File_read::release): Only increment counts when using --stats.
10493 Use a lock around the increment.
10494 * parameters.cc (class Set_parameters_target_once): Define.
10495 (set_parameters_target_once): New static variable.
10496 (Parameters::Parameters): Move here from parameters.h.
10497 (Parameters::set_target): Rewrite.
10498 (Parameters::set_target_once): New function.
10499 (Parameters::clear_target): Move here and rewrite.
10500 * parameters.h (class Parameters): Update declarations. Add
10501 set_parameters_target_once_ field.
10502 (Parameters::Parameters): Move to parameters.cc.
10503 (Parameters::clear_target): Likewise.
10504 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10505 task.
10506 (Start_group::~Start_group): New function.
10507 (Start_group::is_runnable): New function.
10508 (Start_group::locks, Start_group::run): New functions.
10509 (Finish_group::run): Change saw_undefined to size_t.
10510 * readsyms.h (class Start_group): Define.
10511 (class Finish_group): Change saw_undefined_ field to size_t.
10512 (Finish_group::Finish_group): Remove saw_undefined and
10513 this_blocker parameters. Change all callers.
10514 (Finish_group::set_saw_undefined): New function.
10515 (Finish_group::set_blocker): New function.
10516 * symtab.h (class Symbol_table): Change saw_undefined to return
10517 size_t. Change saw_undefined_ field to size_t.
10518 * target-select.cc (Set_target_once::do_run_once): New function.
10519 (Target_selector::Target_selector): Initialize set_target_once_
10520 field. Don't initialize lock_ and initialize_lock_ fields.
10521 (Target_selector::instantiate_target): Rewrite.
10522 (Target_selector::set_target): New function.
10523 * target-select.h (class Set_target_once): Define.
10524 (class Target_selector): Update declarations. Make
10525 Set_target_once a friend. Remove lock_ and initialize_lock_
10526 fields. Add set_target_once_ field.
10527
fa17a3f4
ILT
105282010-02-10 Ian Lance Taylor <iant@google.com>
10529
10530 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10531 queueing any tasks.
10532 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10533 (queue_middle_tasks): Add all blockers before queueing any tasks.
10534 (queue_final_tasks): Likewise.
10535 * token.h (Task_token::add_blockers): New function.
10536 * object.h (Input_objects::number_of_relobjs): New function.
10537
c7177d31
ILT
105382010-02-10 Ian Lance Taylor <iant@google.com>
10539
5de0e392
ILT
10540 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10541 shared, not if not position independent.
10542 * x86_64.cc (Relocate::relocate_tls): Likewise.
10543 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10544 (tls_pie_pic_test): New target.
10545 * testsuite/Makefile.in: Rebuild.
10546
c7177d31
ILT
10547 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10548 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10549 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10550 * testsuite/Makefile.in: Rebuild.
10551
684b268a
DM
105522010-02-09 David S. Miller <davem@davemloft.net>
10553
10554 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10555 R_SPARC_RELATIVE using ->add_local_relative().
10556 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10557
612a8d3d
DM
10558 * output.h (Output_data_dynamic::add_section_size): New method
10559 that takes two Output_data objects.
10560 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10561 entry param. Handle it in initializers.
10562 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10563 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10564 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10565 arg.
10566 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10567 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10568 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10569 for dynrel_includes_plt.
10570 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10571 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10572 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10573 before .rela.plt
10574 (Target_sparc::do_finalize_sections): Update to pass true for
10575 dynrel_includes_plt.
10576 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10577 output before .rela.plt
10578 (Target_powerpc::do_finalize_sections): Update to pass true for
10579 dynrel_includes_plt when 32-bit.
10580
cb1be87e
DK
105812010-02-08 Doug Kwan <dougkwan@google.com>
10582
10583 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10584 method.
10585 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10586 Arm_relobj::scan_section_for_cortex_a8_stubs,
10587 Arm_relobj::do_relocation_section): Instead of calling
10588 Output_section::output_address, use faster
10589 Arm_relobj::simple_input_section_output_address.
10590
705b5121
DM
105912010-02-08 David S. Miller <davem@davemloft.net>
10592
10593 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10594 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10595 relocation helper function.
10596
024c4466
DM
10597 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10598 just like R_SPARC_GOT{10,13,22}.
10599 (Target_sparc::Scan::local): Likewise.
10600 (Target_sparc::Relocate:relocate): Likewise.
10601
9109c078
ILT
106022010-02-06 Ian Lance Taylor <iant@google.com>
10603
10604 * configure.ac: Rewrite targetobjs duplicate removal code to use
10605 only shell constructs.
10606 * configure: Rebuild.
10607
cf846138
DK
106082010-02-05 Doug Kwan <dougkwan@google.com>
10609
10610 PR 11247
10611 * arm.cc (Arm_relobj::section_is_scannable): New method.
10612 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10613 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10614
6cfaf60b
DK
106152010-02-04 Doug Kwan <dougkwan@google.com>
10616
10617 PR 11247
10618 * arm-reloc-property.cc (cstdio): Include.
10619 * configure.ac (targetobjs): Remove duplicates.
10620 * configure: Regenerate.
10621 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10622 big and little endian version for a given address size.
10623
5c57f1be
DK
106242010-02-03 Doug Kwan <dougkwan@google.com>
10625
10626 * arm-reloc-property.cc
10627 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10628 definition.
10629 * arm-reloc-property.h
10630 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10631 New method definition.
10632 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10633 declaration.
10634 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10635 overflow to N.
10636 (GOT_PREL): Change implemented to Y.
10637 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10638 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10639 (Arm_relocate_functions::movw_abs_nc): Remove method.
10640 (Arm_relocate_functions::movt_abs): Ditto.
10641 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10642 (Arm_relocate_functions::thm_movt_abs): Ditto.
10643 (Arm_relocate_functions::movw_rel_nc): Ditto.
10644 (Arm_relocate_functions::movw_rel): Ditto.
10645 (Arm_relocate_functions::movt_rel): Ditto.
10646 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10647 (Arm_relocate_functions:thm_movw_rel): Ditto.
10648 (Arm_relocate_functions:thm_movt_rel): Ditto.
10649 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10650 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10651 New method definitions.
10652 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10653 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10654 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10655 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10656 (Target_arm::Relocate::relocate): Check for non-static or
10657 unimplemented relocation code and exit early. Change calls to
10658 Target_arm::reloc_uses_thumb_bit and
10659 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10660 instead. Refactor code to handle similar relocations to increase
10661 code sharing. Remove check for unsupported relocation code in switch
10662 statement.
10663 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10664 relocation property table to find out size. Change error message to
10665 print out the name of a relocation code instead of the numeric value.
10666 (Target_arm::scan_reloc_for_stub): Use relocation property table
10667 instead of calling Target_arm::reloc_uses_thumb_bit().
10668
218c5831
DK
106692010-02-02 Doug Kwan <dougkwan@google.com>
10670
10671 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10672 types of relaxed input section.
10673
0d31c79d
DK
106742010-02-02 Doug Kwan <dougkwan@google.com>
10675
10676 * Makefile.am (HFILES): Add arm-reloc-property.h.
10677 (DEFFILES): New.
2e702c99
RM
10678 (TARGETSOURCES): Add arm-reloc-property.cc
10679 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10680 (libgold_a_SOURCES): $(DEFFILES)
10681 * Makefile.in: Regenerate.
10682 * arm-reloc-property.cc: New file.
10683 * arm-reloc-property.h: New file.
10684 * arm-reloc.def: New file.
10685 * arm.cc: Update comments.
10686 (arm-reloc-property.h): New included header.
10687 (arm_reloc_property_table): New global variable.
10688 (Target_arm::do_select_as_default_target): New method definition.
10689 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10690 arm-reloc-property to targ_extra_obj.
10691 * parameters.cc (set_parameters_target): Call
10692 Target::select_as_default_target().
10693 * target.h (Target::select_as_default_target): New method definition.
10694 (Target::do_select_as_default_target): Same.
10695
546c7457
DK
106962010-02-01 Doug Kwan <dougkwan@google.com>
10697
10698 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10699 first_output_text_section_.
10700 (Arm_exidx_fixup::first_output_text_section): New method definition.
10701 (Arm_exidx_fixup::first_output_text_section_): New data member.
10702 (Arm_exidx_fixup::process_exidx_section): Record the first text
10703 output section seen.
10704 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10705 and entsize in output section header.
10706
11b861d5
DK
107072010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10708
10709 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10710 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10711 (Arm_relocate_functions::thm_alu11): New Method.
10712 (Arm_relocate_functions::thm_pc8): New Method.
10713 (Arm_relocate_functions::thm_pc12): New Method.
10714 (Target_arm::Scan::local): Handle the relocations.
10715 (Target_arm::Scan::global): Likewise.
10716 (Target_arm::Relocate::relocate): Likewise.
10717 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10718
c9a2c125
DK
107192010-01-29 Doug Kwan <dougkwan@google.com>
10720
10721 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10722 of relocation types as ld.
10723
1521477a
DK
107242010-01-29 Doug Kwan <dougkwan@google.com>
10725
10726 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10727 to public.
10728 (Arm_relocate_functions::thumb_branch_common): Ditto.
10729 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10730 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10731 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10732 Arm_relocate_functions::jump24): Remove.
10733 (Target_arm::Relocate::relocate): Adjust code to call
10734 Arm_relocation_functions::arm_branch_common and
10735 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10736 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10737
e7eca48c
DK
107382010-01-29 Doug Kwan <dougkwan@google.com>
10739
10740 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10741 output_local_symbol_count_needs_update_.
10742 (Arm_relobj::output_local_symbol_count_needs_update,
10743 Arm_relobj::set_output_local_symbol_count_needs_update,
10744 Arm_relobj::update_output_local_symbol_count): New methods.
10745 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10746 member.
10747 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10748 of pointed function as in a R_ARM_PREL31 relocation.
10749 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10750 for output local symbol count updating.
10751 (Target_arm::do_relax): Update output local symbol counts in objects
10752 if necessary.
10753 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10754
02961d7e
ILT
107552010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10756
10757 * arm.cc: Added support for the ARM relocations:
10758 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10759 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10760 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10761 movw_prel_nc).
10762 (Arm_relocate_functions::movw_rel): New method.
10763 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10764 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10765 thm_movw_prel_nc).
10766 (Arm_relocate_functions::thm_movw_rel): New method.
10767 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10768 thm_movt_prel).
10769 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10770 relocations.
10771 (Target_arm::Scan::global): Likewise.
10772 (Target_arm::Relocate::relocate): Likewise.
10773 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10774 Likewise.
10775
b10d2873
ILT
107762010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10777
10778 * arm.cc: Added support for ARM group relocations.
10779 (Target_arm::reloc_needs_sym_origin): New method.
10780 (Arm_relocate_functions::calc_grp_kn): New method.
10781 (Arm_relocate_functions::calc_grp_residual): New method.
10782 (Arm_relocate_functions::calc_grp_gn): New method.
10783 (Arm_relocate_functions::arm_grp_alu): New Method.
10784 (Arm_relocate_functions::arm_grp_ldr): New Method.
10785 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10786 (Arm_relocate_functions::arm_grp_ldc): New Method.
10787 (Target_arm::Scan::local): Handle the ARM group relocations.
10788 (Target_arm::Scan::global): Likewise.
10789 (Target_arm::Relocate::relocate): Likewise.
10790 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10791 Likewise.
10792
2b328d4e
DK
107932010-01-26 Doug Kwan <dougkwan@google.com>
10794
10795 * arm.cc (set): Include.
10796 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10797 pointer type.
2e702c99 10798 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10799 (Arm_output_section::append_text_sections_to_list): New method.
10800 (Arm_output_section::fix_exidx_coverage): Ditto.
10801 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10802 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10803 Relobj::set_section_offset() instead of
10804 Sized_relobj::invalidate_section_offset().
2e702c99 10805 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10806 parameter for section headers. Ignore relocation sections for
10807 unallocated sections and EXIDX sections.
10808 (Target_arm::fix_exidx_coverage): New method.
10809 (Target_arm::output_section_address_less_than): New type.
10810 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10811 linked text section instead of the EXIDX section.
10812 (Arm_output_section::create_stub_group): Add an assertion to check
10813 that this is not an EXIDX output section.
10814 (Arm_output_section::append_text_sections_to_list): New method.
10815 (Arm_output_section::fix_exidx_coverage): Ditto.
10816 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10817 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10818 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10819 first pass.
10820 (Target_arm::fix_exidx_coverage): New method.
10821 * object.h (Relobj::set_output_section): New method.
10822 (Sized_relobj::invalidate_section_offset): Remove method.
10823 (Sized_relobj::do_invalidate_section_offset): Remove method.
10824 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10825
c7f3c371
DK
108262010-01-25 Doug Kwan <dougkwan@google.com>
10827
10828 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10829 Fix warning due to signed and unsigned comparison on a 32-bit host.
10830
8923b24c
DK
108312010-01-22 Doug Kwan <dougkwan@google.com>
10832
10833 * arm.cc (Target_arm::do_relax): Record an output section for section
10834 offset adjustment it contains any stub table that has changed.
10835 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10836 offsets in an output section if necessary.
10837 * output.cc (Output_section::Output_section): Initialize
10838 section_offsets_need_adjustments_.
10839 (Output_section::add_input_section_for_script): Renamed to
10840 Output_section::add_simple_input_section.
10841 (Output_section::save_states): Add a comment.
10842 (Output_section::discard_states): New method defintion.
10843 (Output_section::adjust_section_offsets): Same.
10844 * output.h (Output_section::add_input_section_for_script): Renamed to
10845 Output_section::add_simple_input_section.
10846 (Output_section::discard_states): New method declaration.
10847 (Output_section::adjust_section_offsets): Same.
10848 (Output_section::section_offsets_need_adjustment,
10849 Output_section::set_section_offsets_need_adjustment): New method
10850 definitions.
10851 (Output_section::section_offsets_need_adjustment_): New data member.
10852 * script-sections.cc
10853 (Output_section_element_input::set_section_address): Adjust code for
10854 renaming of Output_section::add_input_section_for_script.
10855 (Orphan_output_section::set_section_address): Same.
10856
9b2fd367
DK
108572010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10858
10859 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10860 Fix_v4bx enum values .
10861 * gold/options.h (General_options): New option definitions.
10862 (General_options::fix_v4bx): New method.
10863 (General_options::Fix_v4bx): New enum.
10864 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10865 (General_options::parse_fix_v4bx_interworking): New method.
10866
80d0d023
DK
108672010-01-22 Doug Kwan <dougkwan@google.com>
10868
10869 * arm.cc (Arm_exidx_fixup): New class.
10870
af2cdeae
DK
108712010-01-21 Doug Kwan <dougkwan@google.com>
10872
10873 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10874 classes.
10875 (Arm_exidx_section_offset_map): New type.
10876
993d07c1
DK
108772010-01-21 Doug Kwan <dougkwan@google.com>
10878
10879 * arm.cc (Arm_exidx_input_section): New class.
10880 (Arm_relobj::exidx_input_section_by_link,
10881 Arm_relobj::exidx_input_section_by_shndx,
10882 Arm_relobj::make_exidx_input_section): New methods.
10883 (read_arm_attributes_section): Remove.
10884 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10885 information about them.
10886 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10887 to here.
10888
5ac169d4
DK
108892010-01-20 Doug Kwan <dougkwan@google.com>
10890
10891 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10892 Input_section_specifier to Section_id.
10893 (Target_arm::new_arm_input_section: Adjust code for change of key
10894 type.
10895 (Target_arm::find_arm_input_section): Ditto.
10896 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10897 (Section_id): Remove.
10898 (Garbage_collection::Section_id_hash): Remove.
10899 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10900 (Section_id): Remove.
10901 (Icf::Section_id_hash): Remove.
10902 * object.h (Section_id, Const_section_id, Section_id_hash,
10903 Const_section_id_hash): New type definitions.
10904 * output.cc (Output_section::add_relaxed_input_section): Change to
10905 use Const_section_id instead of Input_section_specifier as key type.
10906 (Output_section::add_merge_input_section): Ditto.
10907 (Output_section::build_relaxation_map): Change to use Section_id
10908 instead of Input_section_specifier as key type.
2e702c99 10909 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10910 Ditto.
10911 (Output_section::convert_input_sections_to_relaxed_sections): Change
10912 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10913 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10914 (Output_section::find_relaxed_input_section): Ditto.
10915 * output.h (Input_section_specifier): Remove class.
10916 (Output_section::Output_section_data_by_input_section_map): Change
10917 key type to Const_section_id.
10918 (Output_section::Output_relaxed_input_section_by_input_section_map):
10919 Ditto.
10920 (Output_section::Relaxation_map): Change key type to Section_id.
10921
a2162063
ILT
109222010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10923
10924 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10925 (class Arm_v4bx_stub): New class.
10926 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10927 (Stub_factory::make_arm_v4bx_stub): New method.
10928 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10929 (Stub_table::empty): Handle v4bx stubs.
10930 (Stub_table::add_arm_v4bx_stub): New method.
10931 (Stub_table::find_arm_v4bx_stub): New method.
10932 (Arm_relocate_functions::v4bx): New method.
10933 (Target_arm::fix_v4bx): New method.
10934 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10935 (Stub_table::relocate_stubs): Likewise.
10936 (Stub_table::do_write): Likewise.
10937 (Stub_table::update_data_size_and_addralign): Likewise.
10938 (Stub_table::finalize_stubs): Likewise.
10939 (Target_arm::Scan::local): Likewise.
10940 (Target_arm::Scan::global): Likewise.
10941 (Target_arm::do_finalize_sections): Likewise.
10942 (Target_arm::Relocate::relocate): Likewise.
10943 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10944 Likewise.
10945 (Target_arm::scan_reloc_for_stub): Likewise.
10946 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10947
5696ab0b
ILT
109482010-01-19 Ian Lance Taylor <iant@google.com>
10949
10950 * output.cc (Output_section_headers::do_sized_write): Write large
10951 segment count to sh_info field.
10952 (Output_file_header::do_sized_write): For large segment count,
10953 write PN_XNUM to e_phnum field.
10954
800d0f56
ILT
109552010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10956
10957 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10958 (Arm_relocate_functions::thm_jump8): New function.
10959 (Arm_relocate_functions::thm_jump11): New function.
10960 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10961 R_ARM_THM_JUMP11.
10962 (Target_arm::Scan::global): Likewise.
10963 (Target_arm::Relocate::relocate): Likewise.
10964 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10965 Likewise.
10966
41263c05
DK
109672010-01-14 Doug Kwan <dougkwan@google.com>
10968
10969 * arm.cc (map, utility): Include headers.
10970 (Target_arm::apply_cortex_a8_workaround): New method.
10971 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10972 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10973 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10974 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10975 the --[no-]fix-cortex-a8 command line options.
10976 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10977 (Target_arm::relocate_stub): Use addend in instruction template.
10978 * options.h (DEFINE_bool): Set the user-set flag.
10979 (General_options): Add --[no-]-fix-cortex options.
10980 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10981 : Update fast look-up map after conversion.
41263c05 10982
459e9b03
ST
109832010-01-14 Sriraman Tallam <tmsriram@google.com>
10984
10985 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10986 in the first pass of do_layout.
10987
b521dfe4
DK
109882010-01-13 Doug Kwan <dougkwan@google.com>
10989
10990 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10991 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10992 apparent compiler problem of not folding static constant integral
10993 data members of elfcpp::Elf_sizes<32>.
10994
44272192
DK
109952010-01-13 Doug Kwan <dougkwan@google.com>
10996
10997 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10998 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10999 Arm_relobj::scan_section_for_cortex_a8_erratum,
11000 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11001 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11002 sections to scan for relocation stubs into a new method
11003 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11004 relocation and Cortex-A8 stub scanning.
11005 (Target_arm::do_relax): Force stubs to be after stubbed sections
11006 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11007 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11008 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11009
44b71ece
ILT
110102010-01-12 Ian Lance Taylor <iant@google.com>
11011
11012 * target-reloc.h (visibility_error): New inline function.
11013 (relocate_section): Call visibility_error.
11014 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11015 (MOSTLYCLEANFILES): Likewise.
11016 (protected_4_pic.o, protected_3.err): New targets.
11017 * testsuite/protected_4.cc: New file.
11018
a120bc7f
DK
110192010-01-12 Doug Kwan <dougkwan@google.com>
11020
11021 * arm.cc (Cortex_a8_reloc): New class.
11022 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11023 and cortex_a8_relocs_info_.
11024 (Target_arm::fix_cortex_a8): New method definition.
11025 (Target_arm::Cortex_a8_relocs_info): New type.
11026 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11027 New data member declarations.
11028 (Target_arm::scan_reloc_for_stub): Record information about
11029 relocations for THUMB branches that might be exempted from the
11030 Cortex-A8 workaround.
11031 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11032 at the beginning of a relaxation pass.
11033
20138696
DK
110342010-01-12 Doug Kwan <dougkwan@google.com>
11035
11036 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11037 (Arm_relobj::Mapping_symbol_position,
11038 Arm_reloj::Mapping_symbol_position_less,
11039 Arm_relobj::Mapping_symbols_info): New types.
11040 (Target_arm::is_mapping_symbol_name): New method definition.
11041 (Arm_relobj::do_count_local_symbols): Save information about mapping
11042 symbols.
11043
089d69dc
DK
110442010-01-11 Doug Kwan <dougkwan@google.com>
11045
11046 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11047 Arm_relocate_functions::thumb32_branch_upper,
11048 Arm_relocate_functions::thumb32_branch_lower,
11049 Arm_relocate_functions::thumb32_cond_branch_offset,
11050 Arm_relocate_functions::thumb32_cond_branch_upper,
11051 Arm_relocate_functions::thumb32_cond_branch_lower,
11052 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11053 branch offset encoding.
11054 (Arm_relocate_functions::thumb_branch_common): Use new branch
11055 offset encoding methods to avoid code duplication.
11056 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11057 (Stub_addend_reader::operator()): Use new branch encoding method
11058 to avoid code duplication.
11059
99e5bff2
DK
110602010-01-11 Doug Kwan <dougkwan@google.com>
11061
11062 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11063 (Target_arm::do_finalize_sections): Define special EXIDX section
11064 symbols only if referenced.
11065 * gc.h (Garbage_collection::add_reference): New method.
11066 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11067 code duplication.
11068
98e090bd
ILT
110692010-01-11 Ian Lance Taylor <iant@google.com>
11070
d0a91bd8
ILT
11071 * script.cc (Version_script_info::build_expression_list_lookup):
11072 Change complaing about duplicate wildcard match from error to
11073 warning.
11074
98e090bd
ILT
11075 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11076 of 2009-12-30.
11077 (Version_script_info::Version_script_info): Initialize globs_,
11078 default_version_, default_is_global_, and exact_. Don't
11079 initialize globals_ or locals_.
11080 (Version_script_info::build_lookup_tables): Build local symbols
11081 first.
11082 (Version_script_info::unquote): New function.
11083 (Version_script_info::add_exact_match): New function.
11084 (Version_script_info::build_expression_list_lookup): Remove lookup
11085 parameter. Add is_global parameter. Change all callers. Handle
11086 wildcard pattern specially. Unquote pattern. Call
11087 add_exact_match.
11088 (Version_script_info::get_name_to_match): New function.
11089 (Version_script_info::get_symbol_version): New function.
11090 (Version_script_info::get_symbol_version_helper): Remove.
11091 (Version_script_info::check_unmatched_names): Call unquote.
11092 * script.h (class Version_script_info): Change get_symbol_version
11093 to be non-inline and add is_global parameter; change all callers.
11094 Rewrite symbol_is_local. Update declarations. Define struct
11095 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11096 Remove globals_ and locals_ members. Add exact_, globs_,
11097 default_version_, is_global_.
11098 (Version_script_info::Glob): Remove pattern, add expression and
11099 is_global. Update constructor. Change all callers.
11100 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11101 default version.
11102 (Versions::symbol_section_contents): If a symbol is undefined, or
11103 defined in a dynamic object, set the version index to
11104 VER_NDX_LOCAL.
11105 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11106 symbol_is_local.
11107 (Symbol_table::add_from_pluginobj): Likewise.
11108 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11109
d56962d3
DK
111102010-01-11 Doug Kwan <dougkwan@google.com>
11111
11112 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11113 (incremental_dump_LDADD): Add linking option for libintl.
11114 * Makefile.in: Regenerate.
11115
94e6ee91
L
111162010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11117
11118 PR gold/11144
11119 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11120 instead of -Ds.
11121 * testsuite/Makefile.in: Regenerated.
11122
e96c574b
DK
111232010-01-10 Doug Kwan <dougkwan@google.com>
11124
11125 * options.h (DEFINE_var): Use parentheses around argument varname__
11126 in macro body to avoid any unintended subsequent substitutions.
11127
7198066b
ILT
111282010-01-10 Ian Lance Taylor <iant@google.com>
11129
ba4d53bf
ILT
11130 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11131 candidates before doing symbol resolution.
11132
7198066b
ILT
11133 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11134 ODR candidates if only one is weak.
11135
a2beed37
ILT
111362010-01-08 Ian Lance Taylor <iant@google.com>
11137
11138 * script.cc (Version_script_info::build_expression_list_lookup):
11139 Don't warn about ambiguous version, just record the ambiguity.
11140 (Version_script_info::get_symbol_version_helper): Give error if
11141 version is ambiguous.
11142
2fb7225c
DK
111432010-01-08 Doug Kwan <dougkwan@google.com>
11144
11145 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11146 prev_data_size_ and prev_addralign_. Remove initializer for
11147 deleted data member has_been_changed_.
11148 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11149 to determine if the table is empty.
11150 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11151 Remove.
11152 (Stub_table::add_reloc_stub): Define method in class definition
11153 instead of just declaring it there.
11154 (Stub_table::add_cortex_a8_stub): New method definition.
11155 (Stub_table::update_data_size_and_addralign): Ditto.
11156 (Stub_table::finalize_stubs): Ditto.
11157 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11158 (Stub_table::do_addralign_): Return address alignment in the
11159 (Stub_table::do_reset_address_and_file_offset): Define method in
11160 class definition instead of declaring it there. Set current data
11161 size to be the data size of the previous pass.
11162 (Stub_table::set_final_data_size): Use current data size as the
11163 final data size.
11164 (Stub_table::relocate_stub): Change parameter type of stub from
11165 Reloc_stub pointer to Stub pointer.
11166 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11167 (Stub_table::Cortex_a8_stub_list): New typedef.
11168 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11169 Stub_table::prev_addralign_): New data member.
11170 (Arm_relobj::Arm_relobj): Initialize data member
11171 section_has_cortex_a8_workaround_.
11172 (Arm_relobj::section_has_cortex_a8_workaround,
11173 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11174 definitions.
11175 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11176 declarations.
11177 (Target_arm::relocate_stub): Change parameter type of stub from
11178 Reloc_stub pointer to Stub pointer.
11179 (Insn_template::size, Insn_template::alignment): Handle
11180 THUMB16_SPECIAL_TYPE.
11181 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11182 Stub_table::update_data_size_and_addralign,
11183 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11184 definitions.
11185 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11186 (Stub_table::do_write): Ditto.
11187 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11188
880cd20d
ILT
111892010-01-08 Ian Lance Taylor <iant@google.com>
11190
11191 PR 11108
11192 * symtab.h (class Symbol): Remove fields is_target_special_ and
11193 has_plt_offset_. Add field is_defined_in_discarded_section_.
11194 (Symbol::is_defined_in_discarded_section): New function.
11195 (Symbol::set_is_defined_in_discarded_section): New function.
11196 (Symbol::has_plt_offset): Rewrite.
11197 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11198 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11199 Don't initialize is_target_special_ or has_plt_offset_.
11200 Initialize is_defined_in_discarded_section_.
11201 (Symbol_table::add_from_relobj): If appropriate, set
11202 is_defined_in_discarded_section.
11203 * resolve.cc (Symbol::override_base_with_special): Don't test
11204 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11205 * target-reloc.h (relocate_section): Do special handling for
11206 symbols defined in discarded sections for global symbols as well
11207 as local symbols.
11208
2703e3eb
ILT
112092010-01-08 Ian Lance Taylor <iant@google.com>
11210
11211 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11212 the SHT_SYMTAB case.
11213
339d40a3
ILT
112142010-01-08 Ian Lance Taylor <iant@google.com>
11215
11216 * object.cc (Sized_relobj::do_layout): Don't get confused if
11217 layout_eh_frame returns NULL.
11218
abecea76
ILT
112192010-01-08 Ian Lance Taylor <iant@google.com>
11220
11221 PR 11084
11222 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11223 dynamic symbol table, use the normal symbol table.
11224 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11225 symbol table.
11226
6b7dd3f3
ILT
112272010-01-08 Ian Lance Taylor <iant@google.com>
11228
11229 PR 11072
11230 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11231 sections.
11232
36c50e63
L
112332010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11234
11235 * version.cc (print_version): Change to "Copyright 2010".
11236
e291e7b9
ILT
112372010-01-08 Ian Lance Taylor <iant@google.com>
11238
11239 PR 10287
11240 PR 11063
11241 * i386.cc (class Target_i386): Change return type of plt_section
11242 to be non-const.
11243 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11244 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11245 tls_desc_rel_ field.
11246 (Output_data_plt_i386::rel_tls_desc): New function.
11247 (Target_i386::rel_tls_desc_section): New function.
11248 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11249 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11250 R_386_TLS_DESC reloc in rel_tls_desc_section.
11251 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11252 Define struct Tlsdesc_info.
11253 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11254 (Target_x86_64::do_reloc_symbol_index): New function.
11255 (Target_x86_64::add_tlsdesc_info): New function.
11256 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11257 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11258 tlsdesc_rel_ field.
11259 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11260 all callers.
11261 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11262 (Target_x86_64::rela_tlsdesc_section): New function.
11263 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11264 handling.
11265 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11266 (Target_x86_64::do_reloc_addend): New function.
11267 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11268 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11269 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11270 (Output_reloc::type): New function.
11271 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11272 (Output_reloc::is_target_specific): New function.
11273 (Output_reloc::target_arg): New function.
11274 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11275 absolute relocs and target specific relocs.
11276 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11277 add_target_specific.
11278 (class Output_data_reloc) [SHT_RELA]: Likewise.
11279 * output.cc (Output_reloc::Output_reloc): Add four new versions
11280 for absolute relocs and target specific relocs.
11281 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11282 (Output_reloc::get_symbol_index): Likewise.
11283 (Output_reloc::local_section_offset): Check that local_sym_index_
11284 is not TARGET_CODE or 0.
11285 (Output_reloc::symbol_value): Likewise.
11286 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11287 reloc.
11288 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11289 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11290 functions.
11291 * layout.cc (add_target_dynamic_tags): Use output section for
11292 DT_PLTRELSZ and DT_JMPREL.
11293
3a44184e
ILT
112942010-01-07 Ian Lance Taylor <iant@google.com>
11295
11296 PR 11061
11297 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11298 function.
11299 (class Output_data_reloc_generic): Define.
11300 (class Output_data_reloc_base): Change base class to
11301 Output_data_reloc_generic. Change add() method to call
11302 bump_relative_reloc_count for a relative reloc. Remove
11303 sort_relocs_ field.
11304 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11305 to sort_relocs().
11306 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11307 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11308 appropriate.
11309 * layout.h (class Layout): Update declaration.
11310
ea715a34
ILT
113112010-01-07 Ian Lance Taylor <iant@google.com>
11312
11313 * output.h (class Output_data): Add const version of
11314 output_section and do_output_section.
11315 (class Output_section_data): Add const version of
11316 do_output_section.
11317 (class Output_section): Likewise.
11318 * layout.cc (Layout::add_target_dynamic_tags): New function.
11319 * layout.h (class Layout): Update declarations.
11320 * arm.cc (Target_arm::do_finalize_sections): Use
11321 add_target_dynamic_tags.
11322 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11323 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11324 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11325 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11326
659948a4
ILT
113272010-01-07 Ian Lance Taylor <iant@google.com>
11328
11329 PR 11042
11330 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11331 object as needed.
11332
9d3b86f6
ILT
113332010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11334 Ian Lance Taylor <iant@google.com>
11335
11336 PR 11019
11337 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11338 Xindex::read_symtab_xindex.
11339
bb0d3eb0
DK
113402010-01-07 Doug Kwan <dougkwan@google.com>
11341
11342 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11343 (Insn_template::thumb16_bcond_insn): New method declaration.
11344 (Insn_template): Fix spelling.
11345 (Stub::thumb16_special): New method declaration.
11346 (Stub::do_write): Define virtual method which was previously pure
11347 virtual.
11348 (Stub::do_thumb16_special): New method declaration.
11349 (Stub::do_fixed_endian_write): New template member.
11350 (Reloc_stub::do_write): Remove.
11351 (Reloc_stub::do_fixed_endian_write): Remove.
11352 (Cortex_a8_stub): New class definition.
11353 (Stub_factory::make_cortex_a8_stub): New method definition.
11354 (Stub_factory::Stub_factory): Add missing static storage class
11355 qualifier for elf32_arm_stub_a8_veneer_blx.
11356
ffeef7df
ILT
113572010-01-07 Ian Lance Taylor <iant@google.com>
11358
dc3f80fe
ILT
11359 PR 10980
11360 * options.h (class General_options): Add --warn-unresolved-symbols
11361 and --error-unresolved-symbols.
11362 * errors.cc (Errors::undefined_symbol): Implement
11363 --warn-unresolved-symbols.
11364
ffeef7df
ILT
11365 * options.h (class General_options): Add -z text and -z textoff.
11366 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11367
f1ec9ded
ST
113682010-01-06 Sriraman Tallam <tmsriram@google.com>
11369
11370 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11371 (Garbage_collection::cident_sections): New function.
11372 (Garbage_collection::add_cident_section): New function.
11373 (Garbage_collection::cident_sections_): New member.
11374 (gc_process_relocs): Add references to sections whose names are C
11375 identifiers.
11376 * gold.h (cident_section_start_prefix): New constant.
11377 (cident_section_stop_prefix): New constant.
11378 (is_cident): New function.
11379 * layout.cc (Layout::define_section_symbols): Replace string constants
11380 with the newly defined constants.
11381 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11382 C identifiers.
11383 * testsuite/Makefile.am: Add gc_orphan_section_test.
11384 * testsuite/Makefile.in: Regenerate.
11385 * testsuite/gc_orphan_section_test.cc: New file.
11386 * testsuite/gc_orphan_section_test.sh: New file.
11387
6eda8c29
ILT
113882010-01-06 Ian Lance Taylor <iant@google.com>
11389
b9674e17
ILT
11390 PR 10980
11391 * options.h (class General_options): Add --warn-shared-textrel.
11392 * layout.cc (Layout::finish_dynamic_section): Implement
11393 --warn-shared-textrel.
11394
6eda8c29
ILT
11395 PR 10980
11396 * options.h (class General_options): Add --warn-multiple-gp.
11397
32dcd44e
ILT
113982010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11399
11400 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11401 $(THREADSLIB) and $(LIBDL).
11402 * Makefile.in: Rebuild.
11403
a192ba05
ILT
114042010-01-06 Ian Lance Taylor <iant@google.com>
11405
11406 PR 10980
11407 * options.cc (General_options::parse_section_start): New function.
11408 (General_options::section_start): New function.
11409 (General_options::General_options): Initialize all members.
11410 * options.h: Include <map>
11411 (class General_options): Add --section-start. Add section_starts_
11412 member.
11413 * layout.cc (Layout::attach_allocated_section_to_segment): If
11414 --section-start was used, set the address of the segment. Remove
11415 local sort_sections.
11416 (Layout::relaxation_loop_body): If the address of the load segment
11417 has been set by --section-start, don't use it.
11418 * output.h (Output_segment::update_flags_for_output_section): New
11419 function.
11420 * output.cc (Output_segment::add_output_section): Call
11421 update_flags_for_output_section.
11422
dde3f402
ILT
114232010-01-05 Ian Lance Taylor <iant@google.com>
11424
62dfdd4d
ILT
11425 PR 10980
11426 * options.h (class General_options): Add --undefined-version.
11427 * script.cc (struct Version_expression): Add was_matched_by_symbol
11428 field.
11429 (Version_script_info::matched_symbol): New function.
11430 (Version_script_info::get_symbol_version_helper): Call
11431 matched_symbol.
11432 (Version_script_info::check_unmatched_names): New function.
11433 * script.h (class Version_script_info): Update declarations.
11434 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11435
9c4ae156
ILT
11436 * options.h (class General_options): Use DEFINE_bool_alias for
11437 allow_multiple_definition.
11438 * resolve.cc (Symbol_table::should_override): Don't test
11439 allow_multiple_definition.
11440
dde3f402
ILT
11441 PR 10980
11442 * options.h (class General_options): Add --cref.
11443 * main.cc (main): Print cref table if --cref. Don't close mapfile
11444 until after printing cref table.
11445 * cref.cc: Include "symtab.h".
11446 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11447 (Cref_table_compare::operator()): New function.
11448 (Cref_inputs::gather_cref): New function.
11449 (filecol): New static const.
11450 (Cref_inputs::print_cref): New function.
11451 (Cref::print_cref): New function.
11452 * cref.h: Include <cstdio>.
11453 (class Cref): Update declarations.
11454 * mapfile.h (Mapfile::file): New function.
11455 * object.h (class Object): Define Symbols. Declare virtual
11456 do_get_global_symbols.
11457 (Object::get_global_symbols): New function.
11458 * object.cc (Input_objects::add_object): Pass object to cref_ if
11459 --cref.
11460 (Input_objects::archive_start): Likewise.
11461 (Input_objects::archive_stop): Likewise.
11462 (Input_objects::print_cref): New function.
11463 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11464 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11465 --cref.
11466 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11467 function.
11468 * plugin.h (class Sized_pluginobj): Update declarations.
11469
8781f709
ILT
114702010-01-05 Ian Lance Taylor <iant@google.com>
11471
11472 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11473 to is_default_version. Rename insdef to insdefault.
11474 (Symbol_table::add_from_relobj): Rename def to is_default_version
11475 and local to is_forced_local.
11476 (Symbol_table::add_from_pluginobj): Likewise.
11477 (Symbol_table::add_from_dynobj): Likewise.
11478 (Symbol_table::define_special_symbol): Rename insdef to
11479 insdefault.
11480
fe35d28d
ILT
114812010-01-04 Ian Lance Taylor <iant@google.com>
11482
30bc8c46
ILT
11483 PR 10980
11484 * options.h (class General_options): Add
11485 --allow-multiple-definition and -z muldefs.
11486 * resolve.cc (Symbol_table::should_override): Don't warn about a
11487 multiple symbol definition if --allow-multiple-definition or -z
11488 muldefs.
11489
7eaea549
ILT
11490 PR 10980
11491 * options.h (class General_options): Add --add-needed and
11492 --copy-dt-needed-entries. Tweak --as-needed help entry.
11493 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11494 error if --copy-dt-needed-entries aka --add-needed is used and
11495 would cause a change in behaviour.
11496
fe35d28d
ILT
11497 PR 10980
11498 * options.h (class General_options): Add -G as a short version of
11499 --shared. Add no-op options -assert, -g, and -i.
11500
55a2bb35
ST
115012010-01-04 Sriraman Tallam <tmsriram@google.com>
11502
11503 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11504 check for .text or .gnu.linkonce.t sections.
11505 * icf.cc (Icf::find_identical_sections): Ditto.
11506 Change the detection for mangled function name within the section
11507 name.
11508 * icf.h (is_section_foldable_candidate): New function.
11509
719328e1
ILT
115102009-12-30 Ian Lance Taylor <iant@google.com>
11511
11512 PR 10980
11513 * options.h (class General_options): Permit two dashes with
11514 --retain-symbols-file.
11515
d7bb5745
ILT
115162009-12-30 Ian Lance Taylor <iant@google.com>
11517
403a15dd
ILT
11518 PR 10979
11519 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11520 don't put the file header and segment headers in the text
11521 segment.
11522
eda294df
ILT
11523 PR 10979
11524 * common.cc (Sort_commons::operator()): Stabilize sort when both
11525 entries are NULL.
11526 (Symbol_table::do_allocate_commons_list): When allocating common
11527 symbols, skip a symbol which is no longer common.
11528 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11529 an object before checking its type.
11530 * testsuite/common_test_2.c: New file.
11531 * testsuite/common_test_3.c: New file.
11532 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11533 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11534 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11535 (common_test_2_pic.o, common_test_2.so): New targets.
11536 (common_test_3_pic.o, common_test_3.so): New targets.
11537 * testsuite/Makefile.in: Rebuild.
11538
d7bb5745
ILT
11539 PR 10979
11540 * script.cc (read_input_script): If we see a new SECTIONS clause,
11541 and we have added an input section, give an error.
11542 * layout.h (class Layout): Add have_added_input_section function.
11543 Add have_added_input_section_ field.
11544 * layout.cc (Layout::Layout): Initialize
11545 have_added_input_section_.
11546 (Layout::layout): Set have_added_input_section_.
11547 (Layout::layout_eh_frame): Likewise.
11548
fc59c572
ILT
115492009-12-30 Ian Lance Taylor <iant@google.com>
11550
11551 PR 10931
11552 * options.h (class General_options): Add --sort-common option.
11553 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11554 * common.cc (Sort_common): Add sort_order parameter to
11555 constructor. Add sort_order_ field.
11556 (Sort_commons::operator): Check sort_order_.
11557 (Symbol_table::allocate_commons): Determine the sort order.
11558 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11559 Change all callers.
11560 (Symbol_table::do_allocate_commons_list): Likewise.
11561
1c74fab0
ILT
115622009-12-30 Ian Lance Taylor <iant@google.com>
11563
11564 PR 10916
11565 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11566 symbols from this object, don't change the visibility of an
11567 undefined symbol.
11568 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11569
6affe781
ILT
115702009-12-30 Ian Lance Taylor <iant@google.com>
11571
11572 PR 10861
11573 * script.h (class Version_script_info): Define Language enum.
11574 Update declarations. Define Glob, Exact, and Lookup types. Add
11575 new fields globals_, locals_, and is_finalized_.
11576 * script.cc: Various formatting fixes.
11577 (class Parser_closure): Change language_stack_ from a vector of
11578 std::string to one of Version_script_info::Language. Adjust all
11579 uses accordingly.
11580 (class Lazy_demangler): Remove.
11581 (struct Version_expression): Change language from std::string to
11582 Version_script_info::Language.
11583 (Version_script_info::Version_script_info): New function.
11584 (Version_script_info::~Version_script_info): Don't call clear.
11585 (Version_script_info::finalize): New function.
11586 (Version_script_info::build_lookup_tables): New function.
11587 (Version_script_info::build_expression_list_lookup): New
11588 function.
11589 (Version_script_info::get_symbol_version_helper): Rewrite to use
11590 lookup tables.
11591 (Version_script_info::print_expression_list): Adjust to use
11592 Version_script_info::Language.
11593 (script_push_lex_into_version_mode): Check that the version script
11594 has not been finalized.
11595 (version_script_push_lang): Change language string to
11596 Version_script_info::Language.
11597 * options.cc (Command_line::version_script): New function.
11598 * options.h (class General_options): Add finalize_dynamic_list
11599 function. Change version_script from declaration to definition.
11600 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11601 * testsuite/version_script.map: Remove duplicate def of foo.
11602 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11603 version_script.map.
11604 * testsuite/Makefile.in: Rebuild.
11605
818bf354
ILT
116062009-12-30 Ian Lance Taylor <iant@google.com>
11607
11608 PR 10843
11609 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11610 if the input symbol index is 0, make the output symbol index 0.
11611
ebcc8304
ILT
116122009-12-30 Ian Lance Taylor <iant@google.com>
11613
11614 PR 10670
11615 * options.h (class General_options): Add -x/--discard-all.
11616 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11617 --discard-all. If the local symbol needs a dynamic entry, check
11618 that before handling --discard-locals.
11619
176fe33f
ILT
116202009-12-30 Ian Lance Taylor <iant@google.com>
11621
bb321bb1
ILT
11622 PR 10450
11623 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11624 flags to PF_R.
11625 (Output_segment::add_output_section): Don't change the flags if
11626 the type is PT_TLS.
11627
176fe33f
ILT
11628 PR 10450
11629 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11630 GNU hash table if they need a dynamic value. Otherwise, don't add
11631 them if they are defined in a dynamic object or are forced local.
11632
e8cd95c7
ILT
116332009-12-29 Ian Lance Taylor <iant@google.com>
11634
1b81fb71
ILT
11635 PR 10450
11636 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11637 .gnu.hash table for a 32-bit target.
11638
8d6d383d
ILT
11639 PR 10450
11640 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11641 regular and a dynamic object only needs a dynamic symbol table
11642 entry if it is externally visible.
11643
e785ec03
ILT
11644 PR 10450
11645 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11646 constructor. Add global_offset_table_ field.
11647 (Target_i386::got_section): Set global_offset_table_.
11648 (Target_i386::do_finalize_sections): Set global_offset_table_
11649 size.
11650 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11651 in constructor. Add global_offset_table_ field.
11652 (Target_x86_64::got_section): Set global_offset_table_.
11653 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11654 size.
11655
1a2dff53
ILT
11656 * layout.cc (Layout::Layout): Initialize increase_relro_.
11657 (Layout::get_output_section): Add is_relro, is_last_relro, and
11658 is_first_non_relro parameters. Change all callers.
11659 (Layout::choose_output_section): Likewise.
11660 (Layout::add_output_section_data): Likewise.
11661 (Layout::make_output_section): Likewise.
11662 (Layout::set_segment_offsets): Clear increase_relro when using a
11663 linker script.
11664 * layout.h (class Layout): Add increase_relro method. Add
11665 increase_relro_ field. Update declarations.
11666 * output.cc (Output_section::Output_section): Initialize
11667 is_last_relro_ and is_first_non_relro_.
11668 (Output_segment::add_output_section): Group relro sections is
11669 do_sort is true. Handle is_last_relro and is_first_non_relro.
11670 (Output_segment::maximum_alignment): Remove relro handling.
11671 (Output_segment::set_section_addresses): Add increase_relro
11672 parameter. Change all callers. Add initial alignment to align
11673 relro sections on separate page. Remove old relro handling.
11674 (Output_segment::set_section_list_addresses): Remove in_relro
11675 parameter. Change all callers.
11676 (Output_segment::set_offset): Add increase parameter. Change all
11677 callers. Remove old relro handling.
11678 * output.h (class Output_section): Add new methods: is_last_relro,
11679 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11680 Add is_last_relro_ and is_first_non_relro_ fields.
11681 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11682 Create separate .got.plt section. Call increase_relro.
11683 * x86_64.cc (Target_x86_64::got_section): Likewise.
11684 * testsuite/relro_script_test.t: Add .got.plt.
11685
f0ba79e2
ILT
11686 PR 10450
11687 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11688 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11689 (Layout::finalize): Call set_dynamic_symbol_size.
11690 (Layout::set_dynamic_symbol_size): New function.
11691 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11692 set_dynamic_symbol_size.
11693
e8cd95c7
ILT
11694 PR 10450
11695 * output.h (class Output_section): Add is_entsize_zero_ field.
11696 * output.cc (Output_section::Output_section): Initialize
11697 is_entsize_zero_.
11698 (Output_section::set_entsize): If two different entsizes are
11699 requested, force it to zero.
11700 (Output_section::add_input_section): Set flags for .debug_str
11701 before updating section flags. Set entsize.
11702 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11703 and SHF_STRING if all input sections have those flags.
11704
3e1b9a8a
RÁE
117052009-12-29 Rafael Espindola <espindola@google.com>
11706
11707 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11708 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11709 reporting.
3e1b9a8a 11710
3dcad376
ST
117112009-12-29 Sriraman Tallam <tmsriram@google.com>
11712
11713 * options.cc (General_options::parse_version): Allow -v to exit
11714 without an error if there is nothing to link.
11715
084e2665
ILT
117162009-12-29 Ian Lance Taylor <iant@google.com>
11717
11718 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11719 using a version of gcc before 4.1.
11720 * configure: Rebuild.
11721
250acde3
CD
117222009-12-28 Chris Demetriou <cgd@google.com>
11723
11724 * attributes.cc (Output_attributes_section_data::do_write): Use
11725 std::vector::front rather than std::vector::data.
11726
99fff23b
ILT
117272009-12-28 Ian Lance Taylor <iant@google.com>
11728
11729 * symtab.h (class Symbol_table): Add enum Defined.
11730 * resolve.cc (Symbol_table::should_override): Add defined
11731 parameter. Change all callers. Test whether object is NULL
11732 before calling a method on it.
11733 (Symbol_table::report_resolve_problem): Add defined parameter.
11734 Change all callers.
11735 (Symbol_table::should_override_with_special): Likewise.
11736 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11737 parameter. Change all callers.
11738 (Symbol_table::do_define_in_output_data): Likewise.
11739 (Symbol_table::define_in_output_segment): Likewise.
11740 (Symbol_table::do_define_in_output_segment): Likewise.
11741 (Symbol_table::define_as_constant): Likewise.
11742 (Symbol_table::do_define_as_constant): Likewise.
11743 * script.h (class Symbol_assignment): Add is_defsym parameter to
11744 constructor; change all callers.
11745 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11746 parameter. Change all callers. Add is_defsym_ field.
11747 (class Parser_closure): Add parsing_defsym parameter to
11748 constructor; change all callers. Add parsing_defsym accessor
11749 function. Add parsing_defsym_ field.
11750
556bd683
ILT
117512009-12-28 Ian Lance Taylor <iant@google.com>
11752
11753 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11754 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11755
1782c879
ILT
117562009-12-23 Ian Lance Taylor <iant@google.com>
11757
11758 * i386.cc (Target_i386::do_calls_non_split): Recognize
11759 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11760 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11761 -fsplit-stack prologue when using %r11.
1782c879 11762
329ca2b1
ST
117632009-12-21 Sriraman Tallam <tmsriram@google.com>
11764
11765 * options.cc (General_options::parse_version): Make -v continue and do
11766 the link like GNU ld does.
11767
d675ff46
RÁE
117682009-12-17 Rafael Avila de Espindola <espindola@google.com>
11769
11770 * Makefile.am (CCFILES): Add timer.cc.
11771 (HFILES): Add timer.h.
11772 * configure.ac: Check for sysconf and times.
11773 * main.cc: include timer.h.
11774 (main): Use Timer instead of get_run_time.
11775 * timer.cc: New.
11776 * timer.h: New.
11777 * workqueue.cc: include timer.h.
11778 (Workqueue::find_and_run_task):
11779 Report user, sys and wall time.
11780 * Makefile.in: Regenerate.
11781 * config.in: Regenerate.
11782 * configure: Regenerate.
11783
d6344fb5
DK
117842009-12-16 Doug Kwan <dougkwan@google.com>
11785
11786 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11787 sections.
11788 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11789 relaxed input sections.
11790 * output.cc (Output_section::find_relaxed_input_section): Change
11791 return type to Output_relaxed_input_section pointer. Adjust code
11792 for new type of relaxed_input_section_map_.
11793 * output.h (Output_section::find_relaxed_input_section): Change
11794 return type to Output_relaxed_input_section pointer.
11795 (Output_section::Output_relaxed_input_section_by_input_section_map):
11796 New type.
11797 (Output_section::relaxed_input_section_map_): Change type to
11798 Output_section::Output_relaxed_input_section_by_input_section_map.
11799 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11800 input section.
11801
0e0d5469
ILT
118022009-12-15 Ian Lance Taylor <iant@google.com>
11803
11804 * layout.cc (Layout::create_shstrtab): Only write out after input
11805 sections if we are compressing debug sections.
11806
0649a889
ILT
118072009-12-15 Ian Lance Taylor <iant@google.com>
11808
11809 * archive.cc (Archive::add_symbols): Only look up a symbol without
11810 a version if there is, in fact, a version.
11811
2ea97941
ILT
118122009-12-14 Ian Lance Taylor <iant@google.com>
11813
11814 Revert -Wshadow changes, all changes from:
11815 2009-12-11 Doug Kwan <dougkwan@google.com>
11816 2009-12-11 Nick Clifton <nickc@redhat.com>
11817 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11818
b0eec2cc
DK
118192009-12-11 Doug Kwan <dougkwan@google.com>
11820
11821 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11822 due to -Wshadow.
11823 * attributes.cc (Object_attribute::size): Ditto.
11824 (Attributes_section_data::size): Ditto.
11825 (Attributes_section_data::Attributes_section_data): Ditto.
11826 (Output_attributes_section_data::do_write): Ditto.
11827 * attributes.h (Object_attribute::set_type): Ditto.
11828 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11829
91d6fa6a
NC
118302009-12-11 Nick Clifton <nickc@redhat.com>
11831
11832 * archive.cc: Fix shadowed variable warnings.
11833 * arm.cc: Likewise.
11834 * compressed_output.cc: Likewise.
11835 * compressed_output.h: Likewise.
11836 * configure: Likewise.
11837 * dwarf_reader.cc: Likewise.
11838 * dynobj.cc: Likewise.
11839 * dynobj.h: Likewise.
11840 * ehframe.cc: Likewise.
11841 * ehframe.h: Likewise.
11842 * errors.cc: Likewise.
11843 * expression.cc: Likewise.
11844 * fileread.cc: Likewise.
11845 * fileread.h: Likewise.
11846 * freebsd.h: Likewise.
11847 * i386.cc: Likewise.
11848 * icf.cc: Likewise.
11849 * incremental.h: Likewise.
11850 * layout.cc: Likewise.
11851 * layout.h: Likewise.
11852 * mapfile.cc: Likewise.
11853 * merge.cc: Likewise.
11854 * merge.h: Likewise.
11855 * object.cc: Likewise.
11856 * object.h: Likewise.
11857 * options.h: Likewise.
11858 * output.cc: Likewise.
11859 * output.h: Likewise.
11860 * parameters.cc: Likewise.
11861 * plugin.cc: Likewise.
11862 * powerpc.cc: Likewise.
11863 * reduced_debug_output.cc: Likewise.
11864 * reduced_debug_output.h: Likewise.
11865 * reloc.cc: Likewise.
11866 * reloc.h: Likewise.
11867 * resolve.cc: Likewise.
11868 * script-sections.cc: Likewise.
11869 * script.cc: Likewise.
11870 * script.h: Likewise.
11871 * sparc.cc: Likewise.
11872 * symtab.cc: Likewise.
11873 * symtab.h: Likewise.
11874 * target-select.cc: Likewise.
11875 * target-select.h: Likewise.
11876 * token.h: Likewise.
11877 * workqueue.cc: Likewise.
11878 * workqueue.h: Likewise.
11879 * x86_64.cc: Likewise.
11880
a0351a69
DK
118812009-12-10 Doug Kwan <dougkwan@google.com>
11882
11883 * arm.cc (attributes.h): New include.
11884 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11885 (Arm_relobj::~Arm_relobj): Delete object pointed by
11886 attributes_section_data_.
11887 (Arm_relobj::attributes_section_data): New method definition.
11888 (Arm_relobj::attributes_section_data_): New data member declaration.
11889 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11890 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11891 attributes_section_data_.
11892 (Arm_dynobj::attributes_section_data): New method definition.
11893 (Arm_dynobj::attributes_section_data_): New data member declaration.
11894 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11895 initialization value of may_use_blx_ to false.
2e702c99 11896 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11897 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11898 object attributes to compute results instead of hard-coding.
11899 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11900 Target_arm::get_secondary_compatible_arch,
11901 Target_arm::set_secondary_compatible_arch
11902 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11903 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11904 New method declarations.
11905 (Target_arm::get_aeabi_object_attribute): New method definition.
11906 (Target_arm::attributes_section_data_): New data member declaration.
11907 (read_arm_attributes_section): New template definition.
11908 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11909 (Arm_dynobj::do_read_symbols): Ditto.
11910 (Target_arm::do_finalize_sections): Merge attributes sections from
11911 input. Check for BLX use after attributes section merging.
11912 Fix __exidx_start and __exidx_end visibility. Create an
11913 .ARM.attributes section if necessary.
11914 (Target_arm::get_secondary_compatible_arch,
11915 Target_arm::set_secondary_compatible_arch,
11916 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11917 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11918 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11919 New method definitions.
11920
b59befec
ILT
119212009-12-09 Ian Lance Taylor <iant@google.com>
11922
11923 * plugin.cc (Plugin::load): Don't cast from void* to a function
11924 pointer.
11925
1276bc89
ILT
119262009-12-09 Ian Lance Taylor <iant@google.com>
11927
11928 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11929 information fields.
11930
2f2de248
L
119312009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11932
11933 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11934 Replace two_file_shared_1.so with two_file_shared_2.so.
11935 * testsuite/Makefile.in: Regenerated.
11936
4f787271
DK
119372009-12-08 Doug Kwan <dougkwan@google.com>
11938
11939 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11940 (HFILES): Add attributes.h and int_encoding.h.
11941 * Makefile.in: Regenerate.
11942 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11943 function definitions to int_encoding.cc
11944 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11945 prototypes to int_encoding.h
11946 * reduced_debug_output.cc (int_encoding.h): New include.
11947 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11948 function definitions to int_encoding.cc
11949 (insert_into_vector, read_from_pointer): Move template definitions to
11950 int_encoding.h
11951 * attributes.cc: New file.
11952 * attributes.h: New file.
11953 * int_encoding.cc: New file.
11954 * int_encoding.h: New file.
11955
20b52f1a
RÁE
119562009-12-07 Rafael Avila de Espindola <espindola@google.com>
11957
11958 PR gold/11055
11959 * incremental-dump.cc (dump_incremental_inputs): New.
11960 (main): Use dump_incremental_inputs.
11961
53d7974c
L
119622009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11963
11964 PR gold/10893
11965 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11966 checking elfcpp::STT_FUNC.
11967 (Target_i386::Relocate::relocate): Likewise.
11968 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11969
11970 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11971 symbols from shared libraries into normal FUNC symbols.
11972
11973 * symtab.h (Symbol): Add is_func and use it.
11974
05a352e6
DK
119752009-12-05 Doug Kwan <dougkwan@google.com>
11976
11977 * arm.cc (Target_arm::arm_info): Initialize new fields
11978 attributes_section and attributes_vendor.
11979 * i386.cc (Target_i386::i386_info): Same.
11980 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11981 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11982 fields attributes_section and attributes_vendor.
53d7974c 11983 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11984 * target.h (Target::attributes_section, Target::attributes_vendor,
11985 Target::is_attributes_section, Target::attribute_arg_type,
11986 Target::attributes_order): New method definitions.
11987 (Target::Target_info::attributes_section,
11988 Target::Target_info::attributes_vendor): New fields.
11989 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11990 virtual method definitions.
11991 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11992 attributes_section and attributes_vendor.
11993 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11994
f4e5969c
DK
119952009-12-05 Doug Kwan <dougkwan@google.com>
11996
11997 * arm.cc: Update comments about interworking and stub generation.
11998 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11999 considered as non-PIC.
12000 (Arm_relocate_functions::base_abs): Fix formatting.
12001 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12002 of function to use GOT entry address instead of offset.
12003 (Target_arm::Scan::global): Issue an error if a symbol would need a
12004 PLT does not get one because it is untyped. Remove code to create
12005 dynamic symbols for relative branches.
12006 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12007 takes unsigned integer instead of boolean.
12008
1abce4a6
L
120092009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12010
12011 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12012 (two_file_test_LDADD): Likewise.
12013 (common_test_1_LDADD): Likewise.
12014 (exception_test_LDADD) Likewise.
12015 (weak_test_LDADD): Likewise.
12016 (many_sections_test_LDADD): Likewise.
12017 (initpri1_LDADD): Likewise.
12018 (script_test_1_LDADD): Likewise.
12019 (script_test_2_LDADD): Likewise.
12020 (justsyms_LDADD): Likewise.
12021 (binary_test_LDADD): Likewise.
12022 (large_LDADD): Likewise.
12023 * testsuite/Makefile.in: Regenerated.
12024
adcf2816 120252009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12026
adcf2816
L
12027 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12028 (Symbol_table::override_with_special): Likewise.
12029 (Symbol_table::add_from_object): Likewise.
12030
28e67f5d
RÁE
120312009-12-04 Rafael Avila de Espindola <espindola@google.com>
12032
12033 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12034 Don't set the data_offset twice.
12035
ae10a101
RÁE
120362009-12-04 Rafael Avila de Espindola <espindola@google.com>
12037
12038 * testsuite/Makefile.in: Regenerate.
12039
f59f41f3
DK
120402009-12-03 Doug Kwan <dougkwan@google.com>
12041
12042 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12043 (Target_arm::do_finalize_sections): Add parameter for symbol table
12044 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12045 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12046 parameter for symbol table pointer.
12047 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12048 an additional parameter for a pointer to symbol table.
12049 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12050 parameter for a symbol table pointer.
12051 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12052 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12053 Ditto.
12054 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12055 parameter for a symbol table pointer.
12056
ca55d848
RÁE
120572009-12-03 Rafael Avila de Espindola <espindola@google.com>
12058
12059 * incremental.cc (Incremental_inputs_header)
12060 (Incremental_inputs_header_write, Incremental_inputs_entry)
12061 (Incremental_inputs_entry_write): Move ...
12062 * incremental.h (Incremental_inputs_header)
12063 (Incremental_inputs_header_write, Incremental_inputs_entry)
12064 (Incremental_inputs_entry_write): here.
12065
3aec4f9c
RÁE
120662009-12-02 Rafael Avila de Espindola <espindola@google.com>
12067
12068 * incremental.cc (make_sized_incremental_binary): Set the target.
12069 Error if it is incompatible.
12070 * output.h (Output_file): Add filename method.
12071
9c0ae74d
RÁE
120722009-12-02 Rafael Avila de Espindola <espindola@google.com>
12073
12074 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12075 from the get_* methods.
12076
a45500ae
RÁE
120772009-12-02 Rafael Avila de Espindola <espindola@google.com>
12078
12079 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12080 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12081 Write 0 for the data_offset of scripts.
12082
325e6408
RÁE
120832009-12-02 Rafael Avila de Espindola <espindola@google.com>
12084
12085 * testsuite/Makefile.am: Add the incremental_test.sh test.
12086 * testsuite/incremental_test.sh: New.
12087 * testsuite/incremental_test_1.c: New.
12088 * testsuite/incremental_test_2.c: New.
12089
954c3e2e
RÁE
120902009-12-01 Rafael Avila de Espindola <espindola@google.com>
12091
703d02da 12092 * incremental-dump.cc (main): Fix typos.
954c3e2e 12093
f8086623
RÁE
120942009-11-27 Rafael Avila de Espindola <espindola@google.com>
12095
12096 PR gold/11025
12097 * incremental-dump.cc (main): Use llu to print 64 bit values.
12098
3b0dd6ac
L
120992009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12100 H.J. Lu <hongjiu.lu@intel.com>
12101
12102 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12103 $(LIBDL).
12104 (incremental_dump_LDADD): Likewise.
12105 * Makefile.in: Regenerated.
12106
a6d1ef57 121072009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12108
a6d1ef57
DK
12109 Revert:
12110
12111 2009-11-25 Doug Kwan <dougkwan@google.com>
12112
12113 * arm.cc (Target_arm::Target_arm): Move method definition
12114 outside of class definition. Add code to handle
12115 --target1-rel, --target1-abs and --target2= options.
12116 (Target_arm::get_reloc_reloc_type): Change method to be
12117 non-static and const.
12118 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12119 New data member declaration.
12120 (Target_arm::Scan::local, Target_arm::Scan::global,
12121 Target_arm::Relocate::relocate,
12122 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12123 Adjust call to Target_arm::get_real_reloc_type.
12124 (Target_arm::get_real_reloc_type): Use command line options
12125 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12126 * options.h (--target1-rel, --target1-abs, --target2): New
12127 ARM-only options.
12128
50aeb7d4
DK
121292009-11-25 Doug Kwan <dougkwan@google.com>
12130
12131 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12132 class definition. Add code to handle --target1-rel, --target1-abs
12133 and --target2= options.
12134 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12135 and const.
12136 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12137 member declaration.
12138 (Target_arm::Scan::local, Target_arm::Scan::global,
12139 Target_arm::Relocate::relocate,
12140 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12141 call to Target_arm::get_real_reloc_type.
12142 (Target_arm::get_real_reloc_type): Use command line options to
12143 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12144 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12145 options.
12146
51938283
DK
121472009-11-25 Doug Kwan <dougkwan@google.com>
12148
12149 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12150 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12151 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12152 formatting.
12153 (Arm_relocate_functions::thm_call): Replace body with a call to
12154 Arm_relocate_functions::thumb_branch_common.
12155 (Arm_relocate_functions::thm_jump24,
12156 Arm_relocate_functions::thm_xpc22): New method definitions.
12157 (Arm_relocate_functions::thumb_branch_common): New method definition.
12158 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12159 operator.
12160 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12161 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12162
e2b8f3c4
RÁE
121632009-11-24 Rafael Avila de Espindola <espindola@google.com>
12164
12165 * Makefile.am: Build incremental-dump
12166 * Makefile.in: Regenerate.
12167 * incremental-dump.cc: New.
12168 * incremental.cc (Incremental_inputs_header_data,
12169 Incremental_inputs_entry_data): Move to incremental.h
12170 * incremental.h: (Incremental_inputs_header_data,
12171 Incremental_inputs_entry_data): Move from incremental.cc
12172
bcba9aec
RÁE
121732009-11-24 Rafael Avila de Espindola <espindola@google.com>
12174
12175 * incremental.cc (Incremental_inputs_header,
12176 Incremental_inputs_header_write, Incremental_inputs_entry,
12177 Incremental_inputs_entry_write): Add a typedef with the data type.
12178
7c3afe08
RÁE
121792009-11-24 Rafael Avila de Espindola <espindola@google.com>
12180
12181 * incremental.cc (Incremental_inputs_header,
12182 Incremental_inputs_header_write, Incremental_inputs_entry,
12183 Incremental_inputs_entry_write): Update comment about which
12184 type has the filed descriptions.
12185
d204b6e9
DK
121862009-11-15 Doug Kwan <dougkwan@google.com>
12187
12188 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12189 (Arm_relocate_functions::arm_branch_common): Change method defintion
12190 in class definition to a method declaration and update list of formal
12191 parameters.
12192 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12193 Arm_relocation_functions::jump24): Adjust call to
12194 Arm_relocate_functions::arm_branch_common. Update list of formal
12195 parameters.
12196 (Arm_relocate_functions::xpc25): New method definition.
12197 (Arm_relocate_functions::arm_branch_common): Move method defintion
12198 out from class definition. Use stubs for mode-switching and extending
12199 branch ranges.
12200 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12201 specially. Change code to enable use of stubs in ARM branches.
12202
43d12afe
DK
122032009-11-10 Doug Kwan <dougkwan@google.com>
12204
12205 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12206 in method declaration.
12207 (Target_arm::relocate_stub): New method declaration.
12208 (Target_arm::default_target): Change to return a pointer instead of
12209 a const reference.
12210 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12211 Target_arm::default_target.
12212 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12213 method definition.
12214 (Target_arm::relocate_section): Adjust view.
12215 (Target_arm::relocate_stub): New method definition.
12216
ac33a407
DK
122172009-11-10 Doug Kwan <dougkwan@google.com>
12218
12219 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12220 a format warning.
12221 * incremental.cc (open_incremental_binary): Initialized local
12222 variables to avoid warnings.
12223 * object.cc (make_elf_object): Ditto.
12224 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12225 a format warning.
e1df38aa 12226
88ee28e9
L
12227009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12228
12229 PR gold/10930
12230 * testsuite/plugin_test.c: Include "config.h".
12231
2daedcd6
DK
122322009-11-09 Doug Kwan <dougkwan@google.com>
12233
12234 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12235 (arm_symbol_value): Remove.
12236 (Arm_relocate_functions::arm_branch_common,
12237 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12238 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12239 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12240 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12241 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12242 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12243 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12244 Arm_relocate_functions::thm_mobw_abs_nc,
12245 Arm_relocate_functions::thm_mov_abs,
12246 Arm_relocate_functions::movw_prel_nc,
12247 Arm_relocate_functions::thm_movt_abs,
12248 Arm_relocate_functions::movt_prel,
12249 Arm_relocate_functions::thm_movw_prel_nc,
12250 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12251 (Target_arm::Relocate::relocate): Only decompose address into two
12252 parts if relocation type uses the thumb-bit and pass the actual
12253 bit instead of a flag indicating that the thumb-bit is used. Adjust
12254 calls to methods in Arm_relocate_functions for this change.
12255
1276bc89 122562009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12257
12258 PR 10925
12259 * reloc.cc: Instantiate
12260 Sized_relobj::initialize_input_to_output_maps and
12261 Sized_relobj:free_input_to_output_maps.
12262
e53ad1b5
ILT
122632009-11-06 Ian Lance Taylor <iant@google.com>
12264
12265 PR 10876
12266 * defstd.cc (in_segment): Set only_if_ref true for "end".
12267
eb44217c
DK
122682009-11-06 Doug Kwan <dougkwan@google.com>
12269
12270 * arm.cc (class Reloc_stub): Correct a comment.
12271 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12272 (Target_arm::scan_section_for_stubs): New method declaration.
12273 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12274 Change methods from private to protected.
12275 (Target_arm::do_may_relax): New method definition.
12276 (Target_arm::do_relax, Target_arm::group_sections,
12277 Target_arm::scan_reloc_for_stub,
12278 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12279 (Target_arm::arm_input_section_map_): New data member declaration.
12280 (Target_arm::scan_reloc_for_stub,
12281 Target_arm::scan_reloc_section_for_stubs,
12282 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12283 Target_arm::do_relax): New method definitions.
12284
5d329b7d
ILT
122852009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12286
12287 * configure.ac: Check for (struct stat)::st_mtim
12288 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12289 * config.in: Regenerate.
12290 * configure: Regenerate.
12291
96a0d71b
ILT
122922009-11-05 Ian Lance Taylor <iant@google.com>
12293
12294 PR 10910
12295 * output.cc (Output_segment::add_output_section): Add missing
12296 return statement.
12297
594c8e5e
ILT
122982009-11-04 Ian Lance Taylor <iant@google.com>
12299
12300 PR 10880
12301 * object.h (class Object): Add is_needed and set_is_needed
12302 methods. Add is_needed_ field. Make bool fields into bitfields.
12303 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12304 defined in a dynamic object and referenced by a regular object,
12305 set is_needed for the dynamic object.
12306 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12307 if the file is marked with as_needed and it is not needed.
12308
22b127cc
ILT
123092009-11-04 Ian Lance Taylor <iant@google.com>
12310
12311 PR 10887
12312 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12313 tags if data is discarded by linker script.
12314 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12315 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12316 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12317 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12318
f5c870d2
ILT
123192009-11-04 Ian Lance Taylor <iant@google.com>
12320
12321 * layout.cc (Layout::get_output_section): Add is_interp and
12322 is_dynamic_linker_section parameters. Change all callers.
12323 (Layout::choose_output_section): Likewise.
12324 (Layout::make_output_section): Likewise.
12325 (Layout::add_output_section_data): Add is_dynamic_linker_section
12326 parameter. Change all callers.
12327 * layout.h (class Layout): Update declarations.
12328 * output.h (class Output_section): Add is_interp, set_is_interp,
12329 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12330 Add is_interp_, is_dynamic_linker_section_ fields. Change
12331 generate_code_fills_at_write_ to a bitfield.
12332 * output.cc (Output_section::Output_sections): Initialize new
12333 fields.
12334 (Output_segment::add_output_section): Add do_sort parameter.
12335 Change all callers.
12336
1ae4d23b
ILT
123372009-11-03 Ian Lance Taylor <iant@google.com>
12338
12339 PR 10860
12340 * options.h (class General_options): Add --warn-common.
12341 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12342 merging two common symbols.
12343 (Symbol_table::should_override): Handle --warn-common when merging
12344 a common symbol with a defined symbol. Use report_resolve_problem
12345 for multiple definitions.
12346 (Symbol_table::report_resolve_problem): New function.
12347 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12348
55da9579
DK
123492009-11-03 Doug Kwan <dougkwan@google.com>
12350
12351 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12352 stub_factory_.
12353 (Target_arm::stub_factory): New method definition.
12354 (Target_arm::new_arm_input_section,
12355 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12356 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12357 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12358 New type definitions.
12359 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12360 member declarations.
12361 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12362 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12363 New method definitions.
12364
37a9ac43
ILT
123652009-11-03 Ian Lance Taylor <iant@google.com>
12366
12367 * options.h (class General_options): Add --warn_constructors.
12368
b3d6a3d4
ILT
123692009-11-03 Ian Lance Taylor <iant@google.com>
12370
12371 PR 10893
12372 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12373 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12374
934b01dd
ILT
123752009-11-03 Ian Lance Taylor <iant@google.com>
12376
12377 PR 10895
12378 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12379 --msgid-bugs-address.
12380 (install-pdf): New target.
12381 (install-data_yes): Look up one directory to find mkinstalldirs.
12382
03c1939b
L
123832009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12384
12385 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12386 tree.
12387
ebd95253
DK
123882009-10-30 Doug Kwan <dougkwan@google.com>
12389
12390 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12391
e9bbb538
DK
123922009-10-30 Doug Kwan <dougkwan@google.com>
12393
12394 * arm.cc (Stub_addend_reader): New struct template definition
12395 and partial specializations.
12396 (Stub_addend_reader::operator()): New method definition for a
12397 partially specialized template.
12398
d5b40221
DK
123992009-10-30 Doug Kwan <dougkwan@google.com>
12400
12401 * arm.cc (Arm_relobj::processor_specific_flags): New method
12402 definition.
12403 (Arm_relobj::do_read_symbols): New method declaration.
12404 (Arm_relobj::processor_specific_flags_): New data member declaration.
12405 (Arm_dynobj): New class definition.
12406 (Target_arm::do_finalize_sections): Add input_objects parameter.
12407 (Target_arm::do_adjust_elf_header): New method declaration.
12408 (Target_arm::are_eabi_versions_compatible,
12409 (Target_arm::merge_processor_specific_flags): New method declaration.
12410 (Target_arm::do_make_elf_object): New overloaded method definitions
12411 and declaration.
12412 (Arm_relobj::do_read_symbols): New method definition.
12413 (Arm_dynobj::do_read_symbols): Ditto.
12414 (Target_arm::do_finalize_sections): Add input_objects parameters.
12415 Merge processor-specific flags from all input objects.
12416 (Target_arm::are_eabi_versions_compatible,
12417 Target_arm::merge_processor_specific_flags,
12418 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12419 New method definitions.
12420 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12421 Input_objects pointer type parameter.
12422 * layout.cc (Layout::finalize): Pass input objects to target's.
12423 finalize_sections function.
12424 * output.cc (Output_file_header::do_sized_write): Set ELF file
12425 header's processor-specific flags.
12426 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12427 Input_objects pointer type parameter.
12428 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12429 * target.h (Input_objects): New forward class declaration.
12430 (Target::processor_specific_flags,
12431 Target::are_processor_specific_flags_sect): New method definitions.
12432 (Target::finalize_sections): Add input_objects parameter.
12433 (Target::Target): Initialize processor_specific_flags_ and
12434 are_processor_specific_flags_set_.
12435 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12436 parameter.
12437 (Target::set_processor_specific_flags): New method definition.
12438 (Target::processor_specific_flags_,
12439 Target::are_processor_specific_flags_set_): New data member
12440 declarations.
12441 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12442 Input_objects pointer type parameter.
12443
ebabffbd
DK
124442009-10-30 Doug Kwan <dougkwan@google.com>
12445
12446 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12447
ad0f2072
ILT
124482009-10-28 Ian Lance Taylor <iant@google.com>
12449
12450 * object.h (class Relobj): Drop options parameter from
12451 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12452 do_scan_relocs, do_relocate. Change all callers.
12453 (class Sized_relobj): Drop options parameters from
12454 do_gc_process_relocs, do_scan_relocs, do_relocate,
12455 do_relocate_sections, relocate_sections, emit_relocs_scan,
12456 emit_relocs_scan_reltype. Change all callers.
12457 (struct Relocate_info): Remove options field and all references to
12458 it.
12459 * reloc.h (class Read_relocs): Remove options constructor
12460 parameter and options_ field. Change all callers.
12461 (class Gc_process_relocs, class Scan_relocs): Likewise.
12462 (class Relocate_task): Likewise.
12463 * target-reloc.h (scan_relocs): Remove options parameter. Change
12464 all callers.
12465 (scan_relocatable_relocs): Likewise.
12466 * target.h (class Sized_target): Remove options parameter from
12467 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12468 all callers.
12469 * gc.h (gc_process_relocs): Remove options parameter. Change all
12470 callers.
12471 * arm.cc: Update functions to remove options parameters.
12472 * i386.cc: Likewise.
12473 * powerpc.cc: Likewise.
12474 * sparc.cc: Likewise.
12475 * x86_64.cc: Likewise.
12476 * testsuite/testfile.cc: Likewise.
12477
8ffa3667
DK
124782009-10-28 Doug Kwan <dougkwan@google.com>
12479
12480 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12481 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12482 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12483 New method definitions.
12484
40f36857
CC
124852009-10-28 Cary Coutant <ccoutant@google.com>
12486
12487 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12488 (Plugin::cleanup_done_): New member.
12489 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12490 (Plugin_manager::cleanup_done_): Remove.
12491 (Plugin_manager::add_input_file): Edit error message.
12492 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12493 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12494
2c849493
ILT
124952009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12496
12497 * fileread.cc: (File_read::View::~View): Use the new
12498 data_ownership_ filed.
12499 (File_read::~File_read): Dispose the new whole_file_view_.
12500 (File_read::open): Mmap the whole file if needed.
12501 (File_read::open): Use whole_file_view_ instead of contents_.
12502 (File_read::find_view): Use whole_file_view_ if applicable.
12503 (File_read::do_read): Use whole_file_view_ instead of contents_.
12504 (File_read::make_view): Use whole_file_view_ instead of contents_,
12505 update File_read::View::View call.
12506 (File_read::find_or_make_view): Update File_read::View::View
12507 call.
12508 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12509 remove contents_
12510 (File_read::View::Data_ownership): New enum.
12511 (File_read::View::View): Replace bool mapped_ with Data_ownership
12512 argument.
12513 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12514 (File_read::View::data_ownership_): New field.
12515 (File_read::contents_): Remove (replaced by whole_file_view_).
12516 (File_read::whole_file_view_): New field.
12517 * options.h (class General_options): Add --keep-files-mapped.
12518
24998053
CC
125192009-10-27 Cary Coutant <ccoutant@google.com>
12520
12521 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12522 * testsuite/Makefile.am (plugin_test_5): New test case.
12523 * testsuite/Makefile.in: Regenerate.
12524
72adc4fa
DK
125252009-10-25 Doug Kwan <dougkwan@google.com>
12526
12527 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12528 from private to protected to allow access by child class.
12529 (Sized_relobj::do_relocate_sections): New method declaration.
12530 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12531 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12532 Sized_relobj::relocate_sections. Instantiate template explicitly
12533 for different target sizes and endianity.
12534
07f508a2
DK
125352009-10-24 Doug Kwan <dougkwan@google.com>
12536
12537 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12538 (Arm_input_section::as_arm_input_section): New method.
12539 (Arm_output_section): New class definition.
12540 (Arm_output_section::create_stub_group,
12541 Arm_output_section::group_sections): New method definitions.
12542
10ad9fe5
DK
125432009-10-22 Doug Kwan <dougkwan@google.com>
12544
12545 * arm.cc (Arm_input_section): New class definition.
12546 (Arm_input_section::init, Arm_input_section:do_write,
12547 Arm_input_section::set_final_data_size,
12548 Arm_input_section::do_reset_address_and_file_offset): New method
12549 definitions.
12550
56ee5e00
DK
125512009-10-21 Doug Kwan <dougkwan@google.com>
12552
12553 * arm.cc (Stub_table, Arm_input_section): New forward class
12554 declarations.
12555 (Stub_table): New class defintion.
12556 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12557 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12558 New method definition.
12559
b569affa
DK
125602009-10-21 Doug Kwan <dougkwan@google.com>
12561
12562 * arm.cc: Update copyright comments.
12563 (Target_arm): New forward class template declaration.
12564 (Arm_address): New type.
12565 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12566 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12567 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12568 constants.
12569 (Insn_template): Same.
12570 (DEF_STUBS): New macro.
12571 (Stub_type): New enum type.
12572 (Stub_template): New class definition.
12573 (Stub): Same.
12574 (Reloc_stub): Same.
12575 (Stub_factory): Same.
12576 (Target_arm::Target_arm): Initialize may_use_blx_ and
12577 should_force_pic_veneer_.
12578 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12579 Target_arm::should_force_pic_veneer,
12580 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12581 Target_arm::using_thumb_only, Target_arm:;default_target): New
12582 method defintions.
12583 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12584 New data member declarations.
12585 (Insn_template::size, Insn_template::alignment): New method defintions.
12586 (Stub_template::Stub_template): New method definition.
12587 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12588 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12589 (Stub_factory::Stub_factory): New method definition.
12590 * gold.h (string_hash): New template.
12591 * output.h (Input_section_specifier::hash_value): Use
12592 gold::string_hash.
12593 (Input_section_specifier::string_hash): Remove.
12594 * stringpool.cc (Stringpool_template::string_hash): Use
12595 gold::string_hash.
12596
6c172549
DK
125972009-10-20 Doug Kwan <dougkwan@google.com>
12598
12599 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12600 symbols of relaxed input sections.
12601 * output.h (Output_section::find_relaxed_input_section): Make
12602 method public.
12603
c5617f2f
DK
126042009-10-16 Doug Kwan <dougkwan@google.com>
12605
12606 * dynobj.cc (Versions::Versions): Initialize version_script_.
12607 Only insert base version symbol definition for a shared object
12608 if version script defines any version versions.
12609 (Versions::define_base_version): New method definition.
12610 (Versions::add_def): Check that base version is not needed.
12611 (Versions::add_need): Define base version lazily.
12612 * dynobj.h (Versions::define_base_version): New method declaration.
12613 (Versions::needs_base_version_): New data member declaration.
12614 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12615 (check_DATA): Add no_version_test.stdout.
12616 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12617 New make rules.
12618 * testsuite/Makefile.in: Regenerate.
12619 * testsuite/no_version_test.c: New file.
12620 * testsuite/no_version_test.sh: Ditto.
12621
3c12dcdb
DK
126222009-10-16 Doug Kwan <dougkwan@google.com>
12623
12624 * expression.cc (class Segment_start_expression): New class definition.
12625 (Segment_start_expression::value): New method definition.
12626 (script_exp_function_segment_start): Return a new
12627 Segment_start_expression.
12628 * gold/script-c.h (script_saw_segment_start_expression): New function
12629 prototype.
12630 * script-sections.cc (Script_sections::Script_sections): Initialize
12631 SAW_SEGMENT_START_EXPRESSION_ to false.
12632 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12633 and -Tbbs options to specify section addresses if given in
12634 command line and no SEGMENT_START expression is seen in a script.
12635 * script-sections.h (Script_sections::saw_segment_start_expression,
12636 Script_sections::set_saw_segment_start_expression): New method
12637 definition.
12638 (Script_sections::saw_segment_start_expression_): New data member
12639 declaration.
12640 * script.cc (script_saw_segment_start_expression): New function.
12641 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12642 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12643 script_test_7.sh and script_test_8.sh.
12644 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12645 script_test_8.stdout.
12646 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12647 (script_test_6, script_test_6.stdout, script_test_7,
12648 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12649 * Makefile.in: Regenerate.
12650 * testsuite/script_test_6.sh: New file.
12651 * testsuite/script_test_6.t: Same.
12652 * testsuite/script_test_7.sh: Same.
12653 * testsuite/script_test_7.t: Same.
12654 * testsuite/script_test_8.sh: Same.
12655
64b1ae37
DK
126562009-10-16 Doug Kwan <dougkwan@google.com>
12657
12658 * output.cc (Output_segment::set_section_list_address): Cast
12659 expressions to unsigned long long type to avoid format warnings.
12660
661be1e2
ILT
126612009-10-15 Ian Lance Taylor <iant@google.com>
12662
12edd763 12663 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12664 dot assignment to script_sections_.
12edd763
ILT
12665 * script-sections.cc (Script_sections::add_dot_assignment):
12666 Initialize if necessary.
12667
68b6574b
ILT
12668 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12669 program headers with no load segment if there is a linker script.
12670
661be1e2
ILT
12671 * layout.cc (Layout::set_segment_offsets): Align the file offset
12672 to the segment aligment for -N or -n with no load segment.
12673 * output.cc (Output_segment::add_output_section): Don't crash if
12674 the first section is a TLS section.
12675 (Output_segment::set_section_list_addresses): Print an error
12676 message if the address moves backward in a linker script.
12677 * script-sections.cc
12678 (Output_section_element_input::set_section_addresses): Don't
12679 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12680 (Orphan_output_section::set_section_addresses): Likewise.
12681
f15f61a7
DK
126822009-10-15 Doug Kwan <dougkwan@google.com>
12683
12684 * layout.cc (Layout::finish_dynamic_section): Generate tags
12685 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12686 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12687 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12688
82bb573a
ILT
126892009-10-14 Ian Lance Taylor <iant@google.com>
12690
12691 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12692 fields.
12693 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12694 data_shdr fields of relinfo.
12695 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12696 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12697 R_386_TLS_LDO_32, adjust based on section flags.
12698 (Target_i386::Relocate::fix_up_ldo): Remove.
12699
374ad285
ILT
127002009-10-13 Ian Lance Taylor <iant@google.com>
12701
12702 Add support for -pie.
12703 * options.h (class General_options): Add -pie and
12704 --pic-executable.
12705 (General_options::output_is_position_independent): Test -pie.
12706 (General_options::output_is_executable): Return true if not shared
12707 and not relocatable.
12708 (General_options::output_is_pie): Remove.
12709 * options.cc (General_options::finalize): Reject incompatible uses
12710 of -pie.
12711 * gold.cc (queue_middle_tasks): A -pie link is not static.
12712 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12713 * symtab.cc (Symbol::final_value_is_known): Return false if
12714 output_is_position_independent.
12715 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12716 output_is_position_independent.
12717 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12718 output_is_position_independent.
12719 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12720 output_is_position_independent.
12721 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12722 two_file_pie_test.
12723 (basic_pie_test.o, basic_pie_test): New targets.
12724 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12725 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12726 (two_file_pie_test): New target.
12727 * testsuite/Makefile.in: Rebuild.
12728 * README: Remove note saying that -pie is not supported.
12729
c6585162
ILT
127302009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12731
12732 * options.h (class General_options): Add -init and -fini.
12733 * layout.cc (Layout::finish_dynamic_section): Emit
12734 given init and fini functions.
12735
032ce4e9
ST
127362009-10-13 Sriraman Tallam <tmsriram@google.com>
12737
12738 * gc.h (gc_process_relocs): Check if icf is enabled using new
12739 function.
12740 * gold.cc (queue_initial_tasks): Likewise.
12741 (queue_middle_tasks): Likewise.
12742 * object.cc (do_layout): Likewise.
12743 * symtab.cc (is_section_folded): Likewise.
12744 * main.cc (main): Likewise.
12745 * reloc.cc (Read_relocs::run): Likewise.
12746 (Sized_relobj::do_scan_relocs): Likewise.
12747 * icf.cc (is_function_ctor_or_dtor): New function.
12748 (Icf::find_identical_sections): Check if function is ctor or dtor when
12749 safe icf is chosen.
12750 * options.h (General_options::icf): Change option to be an enum.
12751 (Icf_status): New enum.
12752 (icf_enabled): New method.
12753 (icf_safe_folding): New method.
12754 (set_icf_status): New method.
12755 (icf_status_): New variable.
12756 * (options.cc) (General_options::finalize): Set icf_status_.
12757 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12758 icf_test and icf_keep_unique_test to use the --icf enum flag.
12759 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12760 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12761
f345227a
ST
127622009-10-12 Sriraman Tallam <tmsriram@google.com>
12763
12764 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12765 includes to gc.h and icf.h.
12766 * arm.cc: Include gc.h.
12767 * gold.cc: Likewise.
12768 * i386.cc: Likewise.
12769 * powerpc.cc: Likewise.
12770 * sparc.cc: Likewise.
12771 * x86_64.cc: Likewise.
12772 * gc.h: Include icf.h.
12773
1c7814ed
ILT
127742009-10-11 Ian Lance Taylor <iant@google.com>
12775
12776 * plugin.cc: Include "gold.h" before other header files.
12777
ae3b5189
CD
127782009-10-10 Chris Demetriou <cgd@google.com>
12779
12780 * options.h (Input_file_argument::Input_file_type): New enum.
12781 (Input_file_argument::is_lib_): Replace with...
12782 (Input_file_argument::type_): New member.
12783 (Input_file_argument::Input_file_argument): Take Input_file_type
12784 'type' rather than boolean 'is_lib' as second argument.
12785 (Input_file_argument::is_lib): Use type_.
12786 (Input_file_argument::is_searched_file): New function.
12787 (Input_file_argument::may_need_search): Handle is_searched_file.
12788 * options.cc (General_options::parse_library): Support -l:filename.
12789 (General_options::parse_just_symbols): Update for Input_file_argument
12790 changes.
12791 (Command_line::process): Likewise.
12792 * archive.cc (Archive::get_file_and_offset): Likewise.
12793 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12794 * script.cc (read_script_file, script_add_file): Likewise.
12795 * fileread.cc (Input_file::Input_file): Likewise.
12796 (Input_file::will_search_for): Handle is_searched_file.
12797 (Input_file::open): Likewise.
12798 * readsyms.cc (Read_symbols::get_name): Likewise.
12799 * testsuite/Makefile.am (searched_file_test): New test.
12800 * testsuite/Makefile.in: Regenerate.
12801 * testsuite/searched_file_test.cc: New file.
12802 * testsuite/searched_file_test_lib.cc: New file.
12803
f3048a1d
ILT
128042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12805 Ian Lance Taylor <iant@google.com>
12806
12807 * descriptor.cc: Include <cstdio> and "binary-io.h".
12808 (Descriptors::open): Open the files in binary mode always.
12809 * script.cc (Lex::get_token): Treat \r as whitespace.
12810
d4780e57
ILT
128112009-10-09 Ian Lance Taylor <iant@google.com>
12812
12813 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12814
d9a893b8
ILT
128152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12816 Ian Lance Taylor <iant@google.com>
12817
12818 * configure.ac: Check for readv function also.
12819 * fileread.cc (readv): Define if not HAVE_READV.
12820 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12821 does not exist.
12822 * config.in: Regenerate.
12823 * configure: Regenerate.
12824
c0a62865
DK
128252009-10-09 Doug Kwan <dougkwan@google.com>
12826
12827 * layout.cc (Layout::make_output_section): Call target hook to make
12828 ordinary output section.
12829 (Layout::finalize): Adjust parameter list of call the
12830 Target::may_relax().
12831 * layout.h (class Layout::section_list): New method.
12832 * merge.h (Output_merge_base::entsize): Change visibility to public.
12833 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12834 New methods.
12835 (Output_merge_string::do_is_string): New method.
12836 * object.cc (Sized_relobj::do_setup): renamed from
12837 Sized_relobj::set_up.
12838 * object.h (Sized_relobj::adjust_shndx,
12839 Sized_relobj::initializ_input_to_output_maps,
12840 Sized_relobj::free_input_to_output_maps): Change visibilities to
12841 protected.
12842 (Sized_relobj::setup): Virtualize.
12843 (Sized_relobj::do_setup): New method declaration.
12844 (Sized_relobj::invalidate_section_offset,
12845 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12846 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12847 * options.cc (parse_int): New function.
12848 * options.h (parse_int): New declaration.
12849 (DEFINE_int): New macro.
12850 (stub_group_size): New option.
12851 * output.cc (Output_section::Output_section): Initialize memebers
12852 merge_section_map_, merge_section_by_properties_map_,
12853 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12854 (Output_section::add_input_section): Handled deferred code-fill
12855 generation and remove an old comment.
12856 (Output_section::add_relaxed_input_section): New method definition.
12857 (Output_section::add_merge_input_section): Use merge section by
12858 properties map to speed to search. Update merge section maps
12859 as appropriate.
12860 (Output_section::build_relaxation_map): New method definition.
12861 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12862 Same.
12863 (Output_section::relax_input_section): Renamed to
12864 Output_section::convert_input_sections_to_relaxed_sections and change
12865 interface to take a vector of pointers to relaxed sections.
12866 (Output_section::find_merge_section,
12867 Output_section::find_relaxed_input_section): New method definitions.
12868 (Output_section::is_input_address_mapped,
12869 Output_section::output_offset, Output_section::output_address):
12870 Use output section data maps to speed up searching.
12871 (Output_section::find_starting_output_address): Add comments.
12872 (Output_section::do_write,
12873 Output_section::write_to_postprocessing_buffer): Do code-fill
12874 generation as appropriate.
12875 (Output_section::get_input_sections): Invalidate relaxed input section
12876 map.
12877 (Output_section::restore_states): Adjust type of checkpoint .
12878 Invalidate relaxed input section map.
12879 * output.h (Output_merge_base): New class declaration.
12880 (Input_section_specifier): New class defintion.
12881 (class Output_relaxed_input_section) Change base class to
12882 Output_section_data_build.
12883 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12884 base class initializer.
12885 (Output_section::add_relaxed_input_section): New method declaration.
12886 (Output_section::Input_section): Change visibility to protected.
2e702c99 12887 (Output_section::Input_section::relobj,
c0a62865
DK
12888 Output_section::Input_section::shndx): Handle relaxed input sections.
12889 Output_section::input_sections) Change visibility to protected. Also
12890 define overload to return a non-const pointer.
12891 (Output_section::Merge_section_properties): New class defintion.
12892 (Output_section::Merge_section_by_properties_map,
12893 Output_section::Output_section_data_by_input_section_map,
12894 Output_section::Relaxation_map): New types.
12895 (Output_section::relax_input_section): Rename method to
12896 Output_section::convert_input_sections_to_relaxed_sections and change
12897 interface to take a vector of relaxed section pointers.
12898 (Output_section::find_merge_section,
12899 Output_section::find_relaxed_input_section,
12900 Output_section::build_relaxation_map,
12901 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12902 New method declarations.
12903 (Output_section::merge_section_map_
12904 Output_section::merge_section_by_properties_map_,
12905 Output_section::relaxed_input_section_map_,
12906 Output_section::is_relaxed_input_section_map_valid_,
12907 Output_section::generate_code_fills_at_write_): New data members.
12908 * script-sections.cc
12909 (Output_section_element_input::set_section_addresses): Call
12910 current_data_size and addralign methods of relaxed input sections.
12911 (Orphan_output_section::set_section_addresses): Call current_data_size
12912 and addralign methods of relaxed input sections.
12913 * symtab.cc (Symbol_table::compute_final_value): Extract template
12914 from the body of Symbol_table::sized_finalize_symbol.
12915 (Symbol_table::sized_finalized_symbol): Call
12916 Symbol_table::compute_final_value.
12917 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12918 (Symbol_table::compute_final_value): New templated method declaration.
12919 * target.cc (Target::do_make_output_section): New method defintion.
12920 * target.h (Target::make_output_section): New method declaration.
12921 (Target::relax): Add more parameters for input objects, symbol table
12922 and layout. Adjust call to do_relax.
12923 (Target::do_make_output_section): New method declaration.
12924 (Target::do_relax): Add parameters for input objects, symbol table
12925 and layout.
12926
d446d6c4
ILT
129272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12928
12929 * pread.c: Include stdio.h.
12930
bc06c745
ILT
129312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12932
12933 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12934 defined.
12935
75aea3d0
ILT
129362009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12937
12938 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12939 Change read_shndx type to unsigned int.
12940 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12941 int.
12942 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12943 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12944 Change read_shndx type to unsigned int.
12945 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12946 int.
12947 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12948 * layout.cc (Layout::create_symtab_sections): Cast the result of
12949 local_symcount * symsize to off_t in the gold_assert.
12950
be8fcb75
ILT
129512009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12952
12953 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12954 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12955 R_ARM_BASE_ABS.
12956 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12957 (Arm_relocate_functions::thm_abs5): New function.
12958 (Arm_relocate_functions::abs12): New function.
12959 (Arm_relocate_functions::abs16): New function.
12960 (Arm_relocate_functions::base_abs): New function.
12961 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12962 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12963 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12964 R_ARM_BASE_ABS.
12965 (Scan::global): Likewise.
12966 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12967 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12968 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12969 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12970 R_ARM_BASE_ABS.
12971
c2a122b6
ILT
129722009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12973
12974 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12975 (Arm_relocate_functions::movt_prel): New function.
12976 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12977 (Arm_relocate_functions::thm_movt_prel): New function.
12978 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12979 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12980 (Scan::global, Relocate::relocate): Likewise.
12981 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12982
c4aa1e2d
ILT
129832009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12984
12985 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12986 Incremental_checker.
12987 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12988 unsigned int.
12989 (class Incremental_inputs_header): New class.
12990 (Incremental_inputs_header_writer): Edit comment.
12991 (Incremental_inputs_entry): New class.
12992 (Incremental_inputs_entry_writer): Edit comment.
12993 (Sized_incremental_binary::do_find_incremental_inputs_section):
12994 Add *strtab_shndx parameter, fill it.
12995 (Sized_incremental_binary::do_check_inputs): New method.
12996 (Incremental_checker::can_incrementally_link_output_file): Use
12997 Sized_incremental_binary::check_inputs.
12998 (Incremental_inputs::report_command_line): Save command line in
12999 command_line_.
13000 * incremental.h:
13001 (Incremental_binary::find_incremental_inputs_section): New
13002 method.
13003 (Incremental_binary::do_find_incremental_inputs_section): Add
13004 strtab_shndx parameter.
13005 (Incremental_binary::do_check_inputs): New pure virtual method.
13006 (Sized_incremental_binary::do_check_inputs): Declare.
13007 (Incremental_checker::Incremental_checker): Add incremental_inputs
13008 parameter, use it to initialize incremental_inputs_.
13009 (Incremental_checker::incremental_inputs_): New field.
13010 (Incremental_checker::command_line): New method.
13011 (Incremental_checker::inputs): New method.
13012 (Incremental_checker::command_line_): New field.
13013
c549a694
ILT
130142009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13015
13016 * incremental.cc: Include <cstdarg> and "target-select.h".
13017 (vexplain_no_incremental): New function.
13018 (explain_no_incremental): New function.
13019 (Incremental_binary::error): New method.
13020 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13021 method.
13022 (make_sized_incremental_binary): New function.
13023 (open_incremental_binary): New function.
13024 (can_incrementally_link_file): Add checks if output is ELF and has
13025 inputs section.
13026 * incremental.h: Include "elfcpp_file.h" and "output.h".
13027 (Incremental_binary): New class.
13028 (Sized_incremental_binary): New class.
13029 (open_incremental_binary): Declare.
13030 * object.cc (is_elf_object): Use
13031 elfcpp::Elf_recognizer::is_elf_file.
13032 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13033 * output.h (Output_file::filesize): New method.
13034
fd3c5f0b
ILT
130352009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13036
13037 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13038 New function.
13039 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13040 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13041 function.
13042 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13043 function.
13044 (Arm_relocate_functions::movw_abs_nc): New function.
13045 (Arm_relocate_functions::movt_abs): New function.
13046 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13047 (Arm_relocate_functions::thm_movt_abs): New function.
13048 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13049 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13050 (Scan::global): Likewise.
13051 (Relocate::relocate): Likewise.
13052 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13053
7f5309a5
ILT
130542009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13055
13056 * arm.cc (Arm_relocate_functions::got_prel) New function.
13057 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13058 (Relocate::relocate): Likewise.
13059 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13060
364c7fa5
ILT
130612009-10-06 Ian Lance Taylor <iant@google.com>
13062
13063 * options.h (class General_options): Define
13064 split_stack_adjust_size parameter.
13065 * object.h (class Object): Add uses_split_stack_ and
13066 has_no_split_stack_ fields. Add uses_split_stack and
13067 has_no_split_stack accessor functions. Declare
13068 handle_split_stack_section.
13069 (class Reloc_symbol_changes): Define.
13070 (class Sized_relobj): Define Function_offsets. Declare
13071 split_stack_adjust, split_stack_adjust_reltype, and
13072 find_functions.
13073 * object.cc (Object::handle_split_stack_section): New function.
13074 (Sized_relobj::do_layout): Call handle_split_stack_section.
13075 * dynobj.cc (Sized_dynobj::do_layout): Call
13076 handle_split_stack_section.
13077 * reloc.cc (Sized_relobj::relocate_sections): Call
13078 split_stack_adjust for executable sections in split_stack
13079 objects. Pass reloc_map to relocate_section.
13080 (Sized_relobj::split_stack_adjust): New function.
13081 (Sized_relobj::split_stack_adjust_reltype): New function.
13082 (Sized_relobj::find_functions): New function.
13083 * target-reloc.h: Include "object.h".
13084 (relocate_section): Add reloc_symbol_changes parameter. Change
13085 all callers.
13086 * target.h (class Target): Add calls_non_split method. Declare
13087 do_calls_non_split virtual method. Declare match_view and
13088 set_view_to_nop.
13089 * target.cc: Include "elfcpp.h".
13090 (Target::do_calls_non_split): New function.
13091 (Target::match_view): New function.
13092 (Target::set_view_to_nop): New function.
13093 * gold.cc (queue_middle_tasks): Give an error if mixing
13094 split-stack and non-split-stack objects with -r.
13095 * i386.cc (Target_i386::relocate_section): Add
13096 reloc_symbol_changes parameter.
13097 (Target_i386::do_calls_non_split): New function.
13098 * x86_64.cc (Target_x86_64::relocate_section): Add
13099 reloc_symbol_changes parameter.
13100 (Target_x86_64::do_calls_non_split): New function.
13101 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13102 parameter.
13103 * powerpc.cc (Target_powerpc::relocate_section): Add
13104 reloc_symbol_changes parameter.
13105 * sparc.cc (Target_sparc::relocate_section): Add
13106 reloc_symbol_changes parameter.
13107 * configure.ac: Call AM_CONDITIONAL for the default target.
13108 * configure: Rebuild.
13109 * testsuite/Makefile.am (TEST_AS): New variable.
13110 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13111 (check_DATA): Add split_i386 and split_x86_64 files.
13112 (SPLIT_DEFSYMS): Define.
13113 (split_i386_[1234n].o): New targets.
13114 (split_i386_[124]): New targets.
13115 (split_i386_[1234r].stdout): New targets.
13116 (split_x86_64_[1234n].o): New targets.
13117 (split_x86_64_[124]): New targets.
13118 (split_x86_64_[1234r].stdout): New targets.
13119 (MOSTLYCLEANFILES): Add new executables.
13120 * testsuite/split_i386.sh: New file.
13121 * testsuite/split_x86_64.sh: New file.
13122 * testsuite/split_i386_1.s: New file.
13123 * testsuite/split_i386_2.s: New file.
13124 * testsuite/split_i386_3.s: New file.
13125 * testsuite/split_i386_4.s: New file.
13126 * testsuite/split_i386_n.s: New file.
13127 * testsuite/split_x86_64_1.s: New file.
13128 * testsuite/split_x86_64_2.s: New file.
13129 * testsuite/split_x86_64_3.s: New file.
13130 * testsuite/split_x86_64_4.s: New file.
13131 * testsuite/split_x86_64_n.s: New file.
13132 * testsuite/testfile.cc (Target_test): Update relocation_section
13133 function.
13134 * testsuite/Makefile.in: Rebuild.
13135
e8a9fcda
ILT
131362009-10-06 Ian Lance Taylor <iant@google.com>
13137
13138 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13139 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13140 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13141 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13142 the address on ldo_addrs_.
13143 (Target_i386::Relocate::fix_up_ldo): New function.
13144
e99daf92
ILT
131452009-10-06 Rafael Espindola <espindola@google.com>
13146
13147 * plugin.cc (add_input_library): New.
13148 (Plugin::load): Add add_input_library to tv.
13149 (Plugin_manager::add_input_file): Add the is_lib argument.
13150 (add_input_file): Update call to Plugin_manager::add_input_file.
13151 (add_input_library): New.
13152 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13153
966d4097
DK
131542009-09-30 Doug Kwan <dougkwan@google.com>
13155
13156 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13157 symbol and call Symbol::may_need_copy_reloc to determine if
13158 a copy reloc is needed.
13159 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13160 nocopyreloc is given in command line.
13161 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13162 given in command line.
13163 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13164 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13165 of the removed Target_i386::may_need_copy_reloc.
13166 * options.h (copyreloc): New option with default value false.
13167 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13168 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13169 instead of the removed Target_powerpc::may_need_copy_reloc.
13170 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13171 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13172 instead of the removed Target_sparc::may_need_copy_reloc.
13173 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13174 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13175 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13176 instead of the removed Target_x86_64::may_need_copy_reloc.
13177
029ba973
ILT
131782009-09-30 Ian Lance Taylor <iant@google.com>
13179
13180 * object.h (class Object): Remove target_ field, and target,
13181 sized_target, and set_target methods.
13182 (Object::sized_target): Remove.
13183 (class Sized_relobj): Update declarations. Remove sized_target.
13184 * object.cc (Sized_relobj::setup): Remove target parameter.
13185 Change all callers.
13186 (Input_objects::add_object): Don't do anything with the target.
13187 (make_elf_sized_object): Add punconfigured parameter. Change all
13188 callers. Set or test parameter target.
13189 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13190 Change all callers.
13191 * parameters.cc (Parameters::set_target): Change parameter type to
13192 be non-const.
13193 (Parameters::default_target): Remove.
13194 (set_parameters_target): Change parameter type to be non-const.
13195 (parameters_force_valid_target): New function.
13196 (parameters_clear_target): New function.
13197 * parameters.h (class Parameters): Update declarations. Remove
13198 default_target method. Add sized_target and clear_target
13199 methods. Change target_ to be non-const.
13200 (set_parameters_target): Update declaration.
13201 (parameters_force_valid_target): Declare.
13202 (parameters_clear_target): Declare.
13203 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13204 as NULL if we aren't searching.
13205 (Add_symbols::run): Don't check for compatible target.
13206 * fileread.cc (Input_file::open_binary): Call
13207 parameters_force_valid_target.
13208 * gold.cc (queue_middle_tasks): Likewise.
13209 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13210 set_target on object.
13211 * dynobj.h (class Sized_dynobj): Update declarations.
13212 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13213 make_elf_object returns NULL.
13214 (Archive::include_member): Don't check whether object target is
13215 compatible.
13216 * output.cc (Output_section::add_input_section): Get target from
13217 parameters.
13218 (Output_section::relax_input_section): Likewise.
13219 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13220 parameters.
13221 (Sized_relobj::do_scan_relocs): Likewise.
13222 (Sized_relobj::relocate_sections): Likewise.
13223 * resolve.cc (Symbol_table::resolve): Likewise.
13224 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13225 parameter. Change all callers.
13226 (Symbol_table::add_from_object): Get target from parameters.
13227 (Symbol_table::add_from_relobj): Don't check object target.
13228 (Symbol_table::add_from_dynobj): Likewise.
13229 (Symbol_table::define_special_symbol): Get target from
13230 parameters.
13231 * symtab.h (class Symbol_table): Update declaration.
13232 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13233 parameter. Change all callers. Clear parameter target.
13234 (Binary_test): Test target here.
13235 * testsuite/object_unittest.cc (gold_testsuite): Remove
13236 target_test_pointer parameter. Change all callers.
13237 (Object_test): Test target here.
13238
a6a22b83
ILT
132392009-09-26 Ian Lance Taylor <iant@google.com>
13240
13241 * testsuite/initpri1.c: Don't try to use constructor priorities if
13242 compiling with gcc before 4.3.
13243
6a8f49fe
ILT
132442009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13245
13246 * testsuite/retain_symbols_file_test.sh (check_present): Change
13247 output file name to retain_symbols_file_test.stdout.
13248 (check_absent): Likewise.
13249
8c604651
CS
132502009-09-18 Craig Silverstein <csilvers@google.com>
13251
13252 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13253 * options.cc: Include <cerrno> and <fstream>.
13254 (General_options::finalize): Parse -retain-symbols-file tag.
13255 * options.h: New flag.
13256 (General_options): New method should_retain_symbol, new
13257 variable symbols_to_retain.
13258 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13259 should_retain_symbol map.
13260 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13261 * testsuite/Makefile.in: Regenerate.
13262 * testsuite/retain_symbols_file_test.sh: New file.
13263
ca58b19f
NC
132642009-09-18 Nick Clifton <nickc@redhat.com>
13265
13266 * po/es.po: Updated Spanish translation.
13267
20e6d0d6
DK
132682009-09-17 Doug Kwan <dougkwan@google.com>
13269
13270 * debug.h (DEBUG_RELAXATION): New constant.
13271 (DEBUG_ALL): Add DEBUG_RELAXATION.
13272 (debug_string_to_enum): Add relaxation debug option.
13273 * layout.cc
13274 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13275 Layout::Relaxation_debug_check::read_sections,
13276 Layout::Relaxation_debug_check::read_sections): New method definitions.
13277 (Layout::Layout): Initialize data members
13278 record_output_section_data_from_scrips_,
13279 script_output_section_data_list_ and relaxation_debug_check_.
13280 (Layout::save_segments, Layout::restore_segments,
13281 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13282 Layout::relaxation_loop_body): New method definitions.
13283 (Layout::finalize): Support relaxation. Move section layout code to
13284 Layout::relaxation_loop_body.
13285 (Layout::set_asection_address_from_script): Move code for orphan
13286 section placement out.
13287 (Layout::place_orphan_sections_in_script): New method definition.
13288 * layout.h (Output_segment_headers, Output_file_header):
13289 New forward class declarations.
13290 (Layout::~Layout): Define.
13291 (Layout::new_output_section_data_from_script): New method definition.
13292 (Layout::place_orphan_sections_in_script): New method declaration.
13293 (Layout::Segment_states): New type declaration.
13294 (Layout::save_segments, Layout::restore_segments,
13295 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13296 Layout::relaxation_loop_body): New method declarations.
13297 (Layout::Output_section_data_list): New type declaration.
13298 (Layout::Relaxation_debug_check): New class definition.
13299 (Layout::record_output_section_data_from_script_,
13300 Layout::script_output_section_data_list_, Layout::segment_states_,
13301 Layout::relaxation_debug_check_): New data members.
13302 * output.cc: (Output_section_headers::do_size): New method definition.
13303 (Output_section_headers::Output_section_headers): Move size
13304 computation to Output_section_headers::do_size.
13305 (Output_segment_headers::do_size): New method definition.
e1df38aa 13306 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13307 Output_file_header::do_size and call it.
13308 (Output_file_header::do_size): New method definition.
13309 (Output_data_group::Output_data_group): Adjust call to
13310 Output_section_data.
13311 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13312 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13313 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13314 RELAXED_INPUT_SECTION_CODE.
13315 (Output_section::Output_section): Initialize data member checkpoint_.
13316 (Output_section::~Output_section): Delete checkpoint object pointed
13317 by checkpoint_.
13318 (Output_section::add_input_section): Always add an Input_section if
13319 relaxing.
13320 (Output_section::add_merge_input_section): Add assert.
13321 (Output_section::relax_input_section): New method definition.
13322 (Output_section::set_final_data_size): Set load address to zero for
13323 an unallocated section.
13324 (Output_section::do_address_and_file_offset_have_reset_values):
13325 New method definition.
13326 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13327 Handle relaxed input section.
13328 (Output_section::sort_attached_input_sections): Checkpoint input
13329 section list lazily.
13330 (Output_section::get_input_sections): Change type of input_sections to
13331 list of Simple_input_section pointers. Checkpoint input section list
13332 lazily. Also handle relaxed input sections.
13333 (Output_section::add_input_section_for_script): Take a reference to
13334 a Simple_input_section object instead of Relobj pointer and section
13335 index as parameter. Handle relaxed input sections.
13336 (Output_section::save_states, Output_section::restore_states): New
13337 method definitions.
13338 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13339 (Output_data::is_data_size_fixed): New method definition.
13340 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13341 if it is fixed.
13342 (Output_data::address_and_file_offset_have_reset_values): New method
13343 definition.
13344 (Output_data::do_address_and_file_offset_have_reset_values): New method
13345 definition.
13346 (Output_data::set_data_size): Check that data size is not fixed.
13347 (Output_data::fix_data_size): New method definition.
13348 (Output_data::is_data_size_fixed_): New data member.
13349 (Output_section_headers::set_final_data_size): New method definition.
13350 (Output_section_headers::do_size): New method declaration.
13351 (Output_segment_headers::set_final_data_size): New method definition.
13352 (Output_segment_headers::do_size): New method declaration.
13353 (Output_file_header::set_final_data_size)::New method definition.
13354 (Output_file_header::do_size)::New method declaration.
13355 (Output_section_data::Output_section_data): Add new parameter
13356 is_data_size_fixed and use it to fix data size.
13357 (Output_data_const::Output_data_const): Adjust call to base class
13358 constructor and fix data size.
13359 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13360 base class constructor and fix data size.
13361 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13362 base class constructor and fix data size.
13363 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13364 class constructor and fix data size.
13365 (Output_data_group::set_final_data_size): New method definition.
13366 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13367 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13368 class constructor and fix data size.
13369 (Output_relaxed_input_section): New class definition.
13370 (Output_section::Simple_input_section): New class definition.
13371 (Output_section::get_input_sections): Adjust parameter list.
13372 (Output_section::add_input_section_for_script): Same.
13373 (Output_section::save_states, Output_section::restore_states,
13374 Output_section::do_address_and_file_offset_have_reset_values,
13375 (Output_section::Input_section::Input_section): Handle
13376 RELAXED_INPUT_SECTION_CODE. Add new overload for
13377 Output_relaxed_input_section.
13378 (Output_section::Input_section::is_input_section,
13379 Output_section::Input_section::set_output_section): Handle relaxed
13380 input section.
13381 (Output_section::Input_section::is_relaxed_input_section,
13382 Output_section::Input_section::output_section_data,
13383 Output_section::Input_section::relaxed_input_section): New method
13384 definitions.
13385 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13386 value.
13387 (Output_section::Input_section::u1_): Update comments.
13388 (Output_section::Input_section::u2_): Add new union member poris.
13389 (Output_section::Checkpoint_output_section): New classs definition.
13390 (Output_section::relax_input_section): New method declaration.
13391 (Output_section::checkpoint_): New data member.
13392 (Output_segment): Update comments.
13393 (Output_segment::Output_segment): Un-privatize copy constructor.
13394 (Output_segment::operator=): Un-privatize.
13395 * script-sections.cc (Output_section_element::Input_section_list):
13396 Change element type to Output_section::Simple_input_section.
13397 (Output_section_element_dot_assignment::set_section_addresses):
13398 Register output section data for relaxation clean up.
13399 (Output_data_exression::Output_data_expression): Adjust call to base
13400 constructor to fix data size.
13401 (Output_section_element_data::set_section_addresses): Register
13402 Output_data_expression object for relaxation clean up.
13403 (struct Input_section_info): Replace Relobj pointer and section index
13404 pair with Output_section::Simple_input_section and Convert struct to a
13405 class.
13406 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13407 Input_section_info data member to use accessors.
20e6d0d6
DK
13408 (Output_section_element_input::set_section_addresses): Use layout
13409 parameter. Adjust code to use Output_section::Simple_input_section
13410 and Input_secction_info classes. Register filler for relaxation
13411 clean up.
13412 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13413 and section index pair with Output_section::Simple_input_section
13414 class. Adjust code accordingly.
13415 (Phdrs_element::release_segment): New method definition.
13416 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13417 segment list.
13418 (Script_sections::release_segments): New method definition.
13419 * gold/script-sections.h (Script_sections::release_segments): New
13420 method declaration.
13421 * gold/target.h (Target::may_relax, Target::relax,
13422 Target::do_may_relax, Target::do_relax): New method definitions.
13423
5e445df6
ILT
134242009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13425
13426 * arm.cc (has_signed_unsigned_overflow): New function.
13427 (Arm_relocate_functions::abs8): New function.
13428 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13429 (Target_arm::Scan::global): Likewise.
13430 (Target_arm::relocate::relocate): Likewise.
13431 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13432 Likewise.
13433
8c604651 134342009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13435
13436 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13437 * testsuite/Makefile.in: Regenerate.
13438
1e9cc1c2
NC
134392009-09-11 Nick Clifton <nickc@redhat.com>
13440
13441 * po/gold.pot: Updated by the Translation project.
13442
6a89f575
CC
134432009-09-08 Cary Coutant <ccoutant@google.com>
13444
13445 * output.cc (Output_file::open): Add execute permission to empty file.
13446 * testsuite/Makefile.am (permission_test): New test.
13447 * testsuite/Makefile.in: Regenerate.
13448
fdcac5af
ILT
134492009-09-02 Ian Lance Taylor <iant@google.com>
13450
13451 * output.cc (Output_file::resize): Call map_no_anonymous rather
13452 than map.
13453
44453f85
ILT
134542009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13455
13456 * gold.cc: Include "incremental.h".
13457 (queue_initial_tasks): Call Incremental_checker methods.
13458 * incremental.cc: Include "output.h".
13459 (Incremental_checker::can_incrementally_link_output_file): New
13460 method.
13461 * incremental.h (Incremental_checker): New class.
13462
13463 * output.cc (Output_file::open_for_modification): New method.
13464 (Output_file::map_anonymous): Changed return type to bool. Record
13465 map in base_ field.
13466 (Output_file::map_no_anonymous): New method, broken out of map.
13467 (Output_file::map): Use map_no_anonymous and map_anonymous.
13468 * output.h (class Output_file): Update declarations.
13469
293c1386
CC
134702009-08-24 Cary Coutant <ccoutant@google.com>
13471
13472 * options.h (Command_line::Pre_options): New class.
13473 (Command_line::pre_options): New member.
13474 * options.cc (gold::options::ready_to_register): New variable.
13475 (One_option::register_option): Do nothing if not registering options.
13476 Assert if same short option registered twice.
13477 (General_options::General_options): Turn off option registration when
13478 done constructing.
13479 (Command_line::Pre_options::Pre_options): New constructor.
13480
f773f3d2
CC
134812009-08-24 Cary Coutant <ccoutant@google.com>
13482
06a73cfe
CC
13483 * options.h (General_options::no_keep_memory): Remove incorrect
13484 short option.
f773f3d2 13485
a15af8e2
RW
134862009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13487
13488 * Makefile.am (am__skiplex, am__skipyacc): New.
13489 * Makefile.in: Regenerate.
13490
c462b41b
RW
134912009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13492
14ec8efd
RW
13493 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13494 (INCLUDES): ... this.
13495 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13496 (AM_CPPFLAGS): Renamed from ...
13497 (INCLUDE): ... this.
13498 * Makefile.in, testsuite/Makefile.in: Regenerate.
13499
81ecdfbb
RW
13500 * Makefile.in: Regenerate.
13501 * aclocal.m4: Likewise.
13502 * config.in: Likewise.
13503 * configure: Likewise.
13504 * testsuite/Makefile.in: Likewise.
13505
c462b41b
RW
13506 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13507 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13508 * Makefile.in: Regenerate.
13509 * testsuite/Makefile.in: Regenerate.
13510
2da73f13
CC
135112009-08-19 Cary Coutant <ccoutant@google.com>
13512
13513 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13514 symbols in shared libraries overridden by hidden or internal symbols
13515 in the main program.
13516
2db70501
CD
135172009-08-19 Chris Demetriou <cgd@google.com>
13518
13519 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13520 checking source file names in error messages.
13521
f733487b
DK
135222009-08-18 Doug Kwan <dougkwan@google.com>
13523
13524 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13525 an elcpp::Ehdr as parameter. Adjust call to set_target.
13526 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13527 an elfcpp::Ehdr as parameter.
13528 * object.cc (Object::set_target): Remove the version that looks up
13529 a target and sets it.
13530 (Sized_relobj::setup): Take a Target object instead of
13531 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13532 (make_elf_sized_object): Find target and ask target to
13533 make an ELF object.
13534 * object.h: (Object::set_target): Remove the version that looks up
13535 a target and sets it.
13536 (Sized_relobj::setup): Take a Target object instead of
13537 an elfcpp:Ehdr as parameter.
13538 * target.cc: Include dynobj.h.
13539 (Target::do_make_elf_object_implementation): New.
2e702c99 13540 (Target::do_make_elf_object): New.
f733487b
DK
13541 * target.h (Target::make_elf_object): New template declaration.
13542 (Target::do_make_elf_object): New method declarations.
13543 (Target::do_make_elf_object_implementation): New template declaration.
13544
cc70f101
ILT
135452009-08-14 Ian Lance Taylor <iant@google.com>
13546
13547 * gold.h (FUNCTION_NAME): Define.
13548 (gold_unreachable): Use FUNCTION_NAME.
13549
ef5e0cb1
ST
135502009-08-12 Sriraman Tallam <tmsriram@google.com>
13551
13552 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13553 symbol in the --keep-unique list is not found.
13554
48c187ce
ST
135552009-08-12 Sriraman Tallam <tmsriram@google.com>
13556
13557 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13558 been maked as --keep-unique.
13559 (Icf::unfold_section): New function.
13560 * icf.h (Icf::unfold_section): New function.
13561 * options.h (General_options::keep_unique): New option.
13562 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13563 * testsuite/Makefile.in: Regenerate.
13564 * testsuite/icf_keep_unique_test.sh: New file.
13565 * testsuite/icf_keep_unique_test.cc: New file.
13566
645afe0c
CC
135672009-08-12 Cary Coutant <ccoutant@google.com>
13568
13569 PR 10471
13570 * resolve.cc (Symbol_table::resolve): Check for references from
13571 dynamic objects to hidden and internal symbols.
13572 * testsuite/Makefile.am (hidden_test.sh): New test.
13573 * testsuite/Makefile.in: Regenerate.
13574 * testsuite/hidden_test.sh: New script.
13575 * testsuite/hidden_test_1.c: New test source.
13576 * testsuite/hidden_test_main.c: New test source.
13577
11af873f
DK
135782009-08-11 Doug Kwan <dougkwan@google.com>
13579
13580 * arm.cc: Update comments.
13581 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13582 segment to locate the .ARM.exidx section if present.
13583
b9f7d72d
DK
135842009-08-09 Doug Kwan <dougkwan@google.com>
13585
13586 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13587 patch.
13588
ddd3c53c
ST
135892009-08-07 Sriraman Tallam <tmsriram@google.com>
13590 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13591 compiler warnings.
13592
27721062
ST
135932009-08-06 Sriraman Tallam <tmsriram@google.com>
13594
13595 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13596 valid tls_segment only for non-debug-section relocations.
13597 * testsuite/Makefile.am: Add gc_tls_test.
13598 * testsuite/Makefile.in: Regenerate.
13599 * testsuite/gc_tls_test.cc: New file.
13600 * testsuite/gc_tls_test.sh: New file.
13601
ef15dade 136022009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13603
ef15dade
ST
13604 * icf.cc: New file.
13605 * icf.h: New file.
13606 * Makefile.am (CCFILES): Add icf.cc.
13607 (HFILES): Add icf.h
13608 * Makefile.in: Regenerate.
13609 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13610 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13611 section, symbol and addend information for the relocs.
13612 * gold.cc (queue_middle_tasks): Call identical code folding.
13613 * gold.h: Add defines for multimap.
13614 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13615 to the call of finalize_local_symbols.
13616 * main.cc (main): Create object of class Icf.
13617 * object.cc (Sized_relobj::do_layout): Allow this function to be
13618 called twice during icf.
13619 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13620 to sections marked as identical by icf.
13621 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13622 when available.
13623 (Sized_relobj::do_section_entsize): New function.
13624 * object.h (Object::section_entsize): New function.
13625 (Object::do_section_entsize): New pure virtual function.
13626 (Relobj::finalize_local_symbols): Add new parameter.
13627 (Relobj::do_section_entsize): New function.
13628 * options.h (General_options::icf): New option.
13629 (General_options::icf_iterations): New option.
13630 (General_options::print_icf_sections): New option.
13631 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13632 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13633 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13634 icf.
13635 * symtab.cc (Symbol_table::is_section_folded): New function.
13636 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13637 to sections marked as identical by icf.
13638 * symtab.h (Symbol_table::set_icf): New function.
13639 (Symbol_table::icf): New function.
13640 (Symbol_table::is_section_folded): New function.
13641 (Symbol_table::icf_): New data member.
13642 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13643 * testsuite/Makefile.am: Add commands to build icf_test.
13644 * testsuite/Makefile.in: Regenerate.
13645 * testsuite/icf_test.sh: New file.
13646 * testsuite/icf_test.cc: New file.
13647
c3b65ac4
CD
136482009-07-24 Chris Demetriou <cgd@google.com>
13649
13650 * layout.cc (is_compressible_debug_section): Fix incorrect
13651 comment about compressed section names.
13652
1caf2c51
ILT
136532009-07-20 Ian Lance Taylor <ian@airs.com>
13654
13655 PR 10419
13656 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13657
1ef4d87f
ILT
136582009-07-16 Ian Lance Taylor <iant@google.com>
13659
13660 PR 10400
13661 * layout.h: #include <map>.
13662 (class Kept_section): Change from struct to class. Add accessors
13663 and setters. Add section size to Comdat_group mapping. Change
13664 Comdat_group to std::map. Add is_comdat_ field. Add
13665 linkonce_size field in union.
13666 (class Layout): Update declaration of find_or_add_kept_section.
13667 Don't declare find_kept_object.
13668 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13669 parameter. Add object, shndx, is_comdat, and is_group_name
13670 parameters. Change all callers. Adjust for new Kept_section.
13671 (Layout::find_kept_object): Remove.
13672 * object.cc (Sized_relobj::include_section_group): Update use of
13673 Kept_section. Rename secnum to shndx. Only record
13674 Kept_comdat_section if sections are the same size.
13675 (Sized_relobj::include_linkonce_section): Update use of
13676 Kept_section. Only record Kept_comdat_section if sections are the
13677 same size. Set size of linkonce section.
13678 (Sized_relobj::map_to_kept_section): Update call to
13679 get_kept_comdat_section.
13680 * object.h (class Sized_relobj): Rename fields in
13681 Kept_comdat_section to drop trailing underscores; change object
13682 field to Relobj*. Change Kept_comdat_section_table to store
13683 struct rather than pointer.
13684 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13685 Add kept_object and kept_shndx parameters. Change all callers.
13686 (Sized_relobj::get_kept_comdat_section): Change return type to
13687 bool. Add kept_object and kept_shndx parameters. Change all
13688 callers.
13689 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13690 Layout::find_or_add_kept_section.
13691
37c3b7b0
ILT
136922009-07-09 Ian Lance Taylor <iant@google.com>
13693
13694 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13695 Reserve space in the hash table.
13696
98fa85cb
ILT
136972009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13698
13699 * fileread.cc (File_read::get_mtime): New method.
13700 * fileread.h (Timespec): New structure.
13701 (File_read::get_mtime): New method.
13702 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13703 Renamed from timestamp_nsec.
13704 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13705 Elf_Xword.
e1df38aa 13706 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13707 timestamp_nsec.
e1df38aa 13708 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13709 (Incremental_inputs::report_obejct): Save mtime; style fix.
13710 (Incremental_inputs::report_script): Save mtime; style fix.
13711 (Incremental_inputs::finalize_inputs): Style fix.
13712 (Incremental_inputs::finalize): Style fix.
13713 (Incremental_inputs::create_input_section_data): Store inputs
13714 mtime.
13715 * incremental.h (Incremental_inputs::report_script): Add mtime
13716 argument.
13717 (Incremental_inputs::Input_info::Input_info): Intialize only one
13718 union member.
13719 (Incremental_inputs::Input_info::archive): Move to nameless
13720 union.
13721 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13722 (Incremental_inputs::Input_info::script): Move to nameless union.
13723 (Incremental_inputs::mtime): New field.
13724 * script.cc (read_input_script): Pass file mtime to
13725 Incremental_input.
13726 * script.h (Script_info::inputs): Style fix.
13727
c9d70757
ILT
137282009-07-01 Ian Lance Taylor <ian@airs.com>
13729
13730 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13731 instead of 32.
13732
9c547ec3
ILT
137332009-06-24 Ian Lance Taylor <iant@google.com>
13734
13735 PR 10156
13736 * layout.cc (Layout::choose_output_section): If we find an
13737 existing section, update the flags.
13738 (Layout::create_notes): New function, broken out of
13739 Layout::finalize.
13740 (Layout::finalize): Don't create note sections.
13741 (Layout::create_note): Don't crash if linker script discards
13742 section.
13743 (Layout::create_gold_note): Likewise.
13744 (Layout::create_build_id): Likewise. Don't set
13745 after_input_sections on the section.
13746 (Layout::create_executable_stack_info): Remove target parameter.
13747 Change caller.
13748 * layout.h (class Layout): Declare create_notes. Update
13749 declaration of create_executable_stack_info.
13750 * gold.cc (queue_middle_tasks): Call create_notes.
13751 * output.cc (Output_section::update_flags_for_input_section): Move
13752 here from output.h. If SHF_ALLOC flag is newly set, mark address
13753 invalid.
13754 * output.h (Output_data::mark_address_invalid): New function.
13755 (class Output_section): Only declare, not define,
13756 update_flags_for_input_section. Remove set_flags.
13757
55458500
ILT
137582009-06-24 Ian Lance Taylor <iant@google.com>
13759
13760 * script-sections.cc (Output_section_definition::
13761 set_section_addresses): Rename shadowing local load_address to
13762 laddr.
13763
1307d6cd
ILT
137642009-06-24 Ian Lance Taylor <iant@google.com>
13765
13766 PR 10244
13767 * reloc.cc (relocate_sections): Skip empty relocation sections.
13768
ec3f783e
ILT
137692009-06-23 Ian Lance Taylor <iant@google.com>
13770
13771 PR 10156
13772 * layout.cc (Layout::create_note): Use choose_output_section
13773 rather than make_output_section.
13774
459c9f1c
ILT
137752009-06-23 Ian Lance Taylor <iant@google.com>
13776
13777 PR 10237
13778 * options.cc (General_options::parse_V): Set printed_version_.
13779 (General_options::General_options): Initialize printed_version_.
13780 * options.h (class General_options): Add printed_version_ field.
13781 * gold.cc (queue_initial_tasks): If there are no input files,
13782 don't give a fatal error if we printed the version information.
13783 (queue_middle_tasks): If using -r with a shared object, give a
13784 fatal error rather than an ordinary error.
13785
1518dc8f
ILT
137862009-06-23 Ian Lance Taylor <iant@google.com>
13787
13788 PR 10219
13789 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13790 (Layout::make_output_section): Set have_stabstr_section_ if we see
13791 a .stab*str section.
13792 (Layout::finalize): Call link_stabs_sections.
13793 (Layout::link_stabs_sections): New file.
13794 * layout.h (class Layout): Add have_stabstr_section_ field.
13795 Declare link_stabs_sections.
13796
3d857b98
DK
137972009-06-23 Doug Kwan <dougkwan@google.com>
13798
13799 * Makefile.am (libgold_a_LIBADD): New.
13800 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13801 * Makefile.in: Regenerate.
3d857b98
DK
13802 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13803 * configure: Regenerate.
13804 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13805 * fileread.cc: Include sys/state.h
13806 * gold.h: Declare memmem and strndup if found missing.
13807 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13808
0639a6f6
ILT
138092009-06-23 Ian Lance Taylor <iant@google.com>
13810
13811 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13812 * configure: Rebuild.
13813
8d63875c
ILT
138142009-06-23 Ian Lance Taylor <iant@google.com>
13815
13816 PR 10147
13817 * object.cc (Object::section_contents): Don't try to get a view if
13818 the section has length zero.
13819 (Object::handle_gnu_warning_section): If the section is empty, use
13820 the name of the section as the warning.
13821
f7c8a183
ILT
138222009-06-23 Ian Lance Taylor <iant@google.com>
13823
13824 PR 10133
13825 * stringpool.h (class Stringpool_template): Add optimize_ field.
13826 (Stringpool_template::set_optimize): New function.
13827 * stringpool.cc (Stringpool_template::Stringpool_template):
13828 Initialize optimize_ field.
13829 (Stringpool_template::set_string_offsets): Test local optimize
13830 fild rather than parameter.
13831 * layout.cc (Layout::Layout): Call set_optimize on the section
13832 name stringpool.
13833
e6a307ba
ILT
138342009-06-22 Ian Lance Taylor <iant@google.com>
13835
13836 PR 10030
13837 * yyscript.y: Parse TARGET.
13838 * script.cc (script_set_target): New function.
13839 * script-c.h (script_set_target): Declare.
13840 * options.cc (General_options::string_to_object_format): Rename
13841 from string_to_object_format in anonymous namespace. Change
13842 callers.
13843 * options.h (class General_options): Declare
13844 string_to_object_format.
13845
3ee173de
ILT
138462009-06-22 Ian Lance Taylor <iant@google.com>
13847
13848 * script-sections.cc (Script_sections::create_segments): Don't put
13849 program headers in a PT_LOAD segment if -n or -N.
13850
138512009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13852
13853 PR 10141
13854 * options.h (class General_options): Add -z lazy and -z now. Sort
13855 -z options into alphabetical order.
13856 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13857
cd6739a1 138582009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13859
13860 * layout.cc (Layout::make_output_section): Call
13861 Target::new_output_section.
13862 (Layout::attach_allocated_section_to_segment): Put large section
13863 sections in a separate load segment with the large segment flag
13864 set.
13865 (Layout::segment_precedes): Sort large data segments after other
13866 load segments.
13867 (align_file_offset): New static function.
13868 (Layout::set_segment_offsets): Use align_file_offset.
13869 * output.h (class Output_section): Add is_small_section_ and
13870 is_large_section_ fields.
13871 (Output_section::is_small_section): New function.
13872 (Output_section::set_is_small_section): New function.
13873 (Output_section::is_large_section): New function.
13874 (Output_section::set_is_large_section): New function.
13875 (Output_section::is_large_data_section): New function.
13876 (class Output_segment): Add is_large_data_segment_ field.
13877 (Output_segment::is_large_data_segment): New function.
13878 (Output_segment::set_is_large_data_segment): New function.
13879 * output.cc (Output_section::Output_section): Initialize new
13880 fields.
13881 (Output_segment::Output_segment): Likewise.
13882 (Output_segment::add_output_section): Add assertion that large
13883 data sections always go in large data segments. Force small data
13884 sections to the end of the list of data sections. Force small BSS
13885 sections to the start of the list of BSS sections. For large BSS
13886 sections to the end of the list of BSS sections.
13887 * symtab.h (class Symbol): Declare is_common_shndx.
13888 (Symbol::is_defined): Check Symbol::is_common_shndx.
13889 (Symbol::is_common): Likewise.
13890 (class Symbol_table): Define enum Commons_section_type. Update
13891 declarations. Add small_commons_ and large_commons_ fields.
13892 * symtab.cc (Symbol::is_common_shndx): New function.
13893 (Symbol_table::Symbol_table): Initialize new fields.
13894 (Symbol_table::add_from_object): Put small and large common
13895 symbols in the right list.
13896 (Symbol_table::sized_finalized_symbol): Check
13897 Symbol::is_common_shndx.
13898 (Symbol_table::sized_write_globals): Likewise.
13899 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13900 common symbol lists. Don't call do_allocate_commons_list if the
13901 list is empty.
13902 (Symbol_table::do_allocate_commons_list): Remove is_tls
13903 parameter. Add comons_section_type parameter. Change all
13904 callers. Handle small and large common symbols.
13905 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13906 Symbol::is_common_shndx.
13907 * resolve.cc (symbol_to_bits): Likewise.
13908 * target.h (Target::small_common_shndx): New function.
13909 (Target::small_common_section_flags): New function.
13910 (Target::large_common_shndx): New function.
13911 (Target::large_common_section_flags): New function.
13912 (Target::new_output_section): New function.
13913 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13914 small_common_section_flags, and large_common_section_flags
13915 fields.
13916 (Target::do_new_output_section): New virtual function.
13917 * arm.cc (Target_arm::arm_info): Initialize new fields.
13918 * i386.cc (Target_i386::i386_info): Likewise.
13919 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13920 Likewise.
13921 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13922 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13923 (Target_x86_64::do_new_output_section): New function.
13924 * configure.ac: Define conditional MCMODEL_MEDIUM.
13925 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13926 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13927 (large_LDFLAGS): Define.
13928 * testsuite/large.c: New file.
13929 * testsuite/testfile.cc (Target_test::test_target_info):
13930 Initialize new fields.
13931 * configure, testsuite/Makefile.in: Rebuild.
13932
bb04269c
DK
139332009-06-05 Doug Kwan <dougkwan@google.com>
13934
13935 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13936 * Makefile.in: Regenerate.
bb04269c
DK
13937 * i386.cc (class Target_i386): Define new virtual method to
13938 override do_is_local_label_name in parent.
13939 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13940 local symbols if --discard-locals or -X is given.
13941 * options.h (class General_options): Declare new options
13942 '--discard-locals' and '-X' for discarding locals.
13943 * target.h (class Target): Define new methods is_local_label_name.
13944 Declare new virtual method do_is_local_label_name.
13945 * target.cc: New file.
13946 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13947 (check_SCRIPTS): Add discard_locals_test.sh.
13948 (check_DATA): Add discard_local_tests.syms.
13949 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13950 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13951 * testsuite/Makefile.in: Regenerate.
13952 * testsuite/discard_locals_test.c: New file.
13953 * testsuite/discard_locals_test.sh: Same.
13954
805bb01c
DK
139552009-06-05 Doug Kwan <dougkwan@google.com>
13956
13957 * object.cc (Sized_relobj::Sized_relobj): Initialize
13958 discarded_eh_frame_shndx_ to -1U.
13959 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13960 section.
13961 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13962 a discarded .eh_frame section.
13963 (Sized_relobj::do_finalize_local_symbols): Ditto.
13964 * object.h (class Sized_relobj): Declare new member
13965 discarded_eh_frame_shndx_.
13966 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13967 (local_labels_test.o, local_labels_test): New rules.
13968 * testsuite/Makefile.in: Regenerate.
13969
1dcd334d
DK
139702009-06-04 Doug Kwan <dougkwan@google.com>
13971
13972 * layout.cc (Layout::section_name_mapping): Add mapping for
13973 special ARM sections.
13974
96d49306
DK
139752009-06-03 Doug Kwan <dougkwan@google.com>
13976
13977 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13978 (utils::has_overflow): Same.
13979
dff16297
ILT
139802009-06-03 Ian Lance Taylor <iant@google.com>
13981
13982 * layout.cc (Layout::section_name_mapping): New array, replacing
13983 Layout::linkonce_mapping.
13984 (Layout::section_name_mapping_count): New variable, replacing
13985 Layout::linkonce_mapping_count.
13986 (Layout::linkonce_output_name): Remove.
13987 (Layout::output_section_name): Rewrite.
13988 * layout.h (class Layout): Rename Linkonce_mapping to
13989 Section_name_mapping, linkonce_mapping to section_name_mapping,
13990 linkonce_mapping_count to section_name_mapping_count. Don't
13991 declare linkonce_output_name.
13992
c121c671
DK
139932009-06-03 Doug Kwan <dougkwan@google.com>
13994
13995 * gold/arm.cc (namespace utils): New.
13996 (Target_arm::reloc_is_non_pic): Define new method.
13997 (class Arm_relocate_functions): New.
13998 (Target_arm::Relocate::relocate): Handle relocation types used by
13999 Android.
14000
07800fab
ILT
140012009-06-03 Ian Lance Taylor <iant@google.com>
14002
14003 * arm.cc (Target_arm::scan::global): Use || instead of |.
14004
c121c671
DK
140052009-06-02 Doug Kwan <dougkwan@google.com>
14006
14007 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14008 issued_non_pic_error_.
14009 (class Target_arm::Scan): Declare new method check_non_pic.
14010 Define new method symbol_needs_plt_entry.
14011 Declare new data member issued_non_pic_error_.
14012 (class Target_arm::Relocate): Declare new method
14013 should_apply_static_reloc.
14014 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14015 (Target_arm::Scan::check_non_pic): Define new method.
14016 (Target_arm::Scan::local): Handle a small subset of reloc types used
14017 by Android.
14018 (Target_arm::Scan::local): Same.
14019 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14020
b19b0c6d
ILT
140212009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14022
14023 * incremental.cc (Incremental_inputs::report_command_line): Filter
14024 out --incremental-* options.
14025
94cdfcff
DK
140262009-05-29 Doug Kwan <dougkwan@google.com>
14027
14028 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14029 template class.
14030 (class Target_arm): Update comment.
14031 (Target_arm::Target_arm): Initialize new data members GOT_,
14032 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14033 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14034 and Target_arm::rel_dyn_section.
14035 Declare new_enum Target_arm::Got_type.
14036 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14037 and DYNBSS_.
14038 Update commments for member do_dynsym_value.
14039 (Target_arm::got_size, Target_arm::plt_section,
14040 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14041 new methods inside class defintion.
14042 (Target_arm::got_section): Define new method.
14043 (Target_arm::rel_dyn_section): Same.
14044 (Output_data_plt_arm): New template class.
14045 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14046 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14047 (Output_data_plt_arm::add_entry): Same.
14048 (Output_data_plt_arm::first_plt_entry): Define new
14049 static data member for PLT instruction template.
14050 (Output_data_plt_arm::plt_entry): Same.
14051 (Output_data_plt_arm::do_write): Define new method.
14052 (Target_arm::make_plt_entry): Same.
14053 (Target_arm::do_finalize_sections): Same.
14054 (Target_arm::do_dynsym_value): Same.
14055
4a657b0d
DK
140562009-05-28 Doug Kwan <dougkwan@google.com>
14057
14058 * Makefile.am (TARGETSOURCES): Add arm.cc.
14059 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14060 * Makefile.in: Regenerate.
14061 * arm.cc: New file.
14062 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14063
e7ae8c36
DK
140642009-05-26 Doug Kwan <dougkwan@google.com>
14065
14066 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14067 (General_options::check_excluded_libs): Strip off directories in
14068 archive name before matching like GNU ld does.
14069 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14070 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14071 (exclude_libs_test_LDFLAGS): Add linker option
14072 -Wl,--exclude-libs,libexclude_libs_test_3
14073 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14074 an explicit archive without using -l.
14075 (alt/libexclude_libs_test_3.a): New make rule.
14076 * testsuite/Makefile.in: Regenerate.
14077 * testsuite/exclude_libs_test.c : Declare lib3_default().
14078 (main): Call it.
14079 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14080 * exclude_libs_test_3.c: New file.
14081
f12e7348
NC
140822009-05-26 Nick Clifton <nickc@redhat.com>
14083
14084 * po/id.po: New Indonesian translation.
14085 * po/gold.pot: Updated template file.
14086
4daadc0d
ST
140872009-05-22 Sriraman Tallam <tmsriram@google.com>
14088
e1df38aa 14089 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14090 gc_comdat_test files. Add -Wl,--gc-sections to build
14091 gc_comdat_test.
14092 * testsuite/Makefile.in: Regenerate.
14093 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14094
531813ad
ST
140952009-05-21 Sriraman Tallam <tmsriram@google.com>
14096
14097 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14098 kept comdat section was garbage collected.
14099 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14100 * testsuite/Makefile.in: Regenerate.
14101 * testsuite/gc_comdat_test.sh: New file.
14102 * testsuite/gc_comdat_test_1.cc: New file.
14103 * testsuite/gc_comdat_test_2.cc: New file.
14104
65514900
CC
141052009-05-19 Doug Kwan <dougkwan@google.com>
14106
14107 * archive.cc (Archive::Archive): Move constructor from archive.h
14108 to here. Initialize no_export_.
14109 (Archive::get_elf_object_for_member): Set no_export flag of object.
14110 * archive.h (Archive::Archive): Move constructor body to
14111 archive.cc.
14112 (Archive::no_export): New method.
14113 (Archive::no_export_): New field.
14114 * object.h (Object::Object): Initialize no_export_ to false.
14115 (Object::no_export, Object::set_no_export): New methods.
14116 (Object::no_export_): New field.
14117 * options.cc (General_options::parse_exclude_libs): New method.
14118 (General_options::check_excluded_libs) Same.
14119 * options.h (exclude_libs): New option.
14120 (General_options::check_excluded_libs): New method declaration.
14121 (General_options::excluded_libs_): New field.
14122 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14123 default or protected visibility if an object has no-export flag set.
14124 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14125 (check_SCRIPTS): Add exclude_libs_test.sh.
14126 (check_DATA): Add exclude_libs_test.syms.
14127 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14128 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14129 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14130 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14131 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14132 libexclude_libs_test_2.a): New rules.
14133 * testsuite/Makefile.in: Regenerate.
14134 * testsuite/exclude_libs_test.c: New file.
14135 * testsuite/exclude_libs_test.sh: Ditto.
14136 * testsuite/exclude_libs_test_1.c: Ditto.
14137 * testsuite/exclude_libs_test_2.c: Ditto.
14138
1b77ea50
ILT
141392009-05-15 Ian Lance Taylor <iant@google.com>
14140
14141 * configure.ac: Check for declarations for cases where libiberty.h
14142 checks HAVE_DECL_xxx.
14143 * configure, config.in: Rebuild.
14144
072fe7ce
ILT
141452009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14146
14147 * gold.h (Incremental_argument_list): Remove (invalid) forward
14148 declaration.
14149 * incremental.cc (Incremental_inputs::report_achive): New method.
14150 (Incremental_inputs::report_object): New method.
14151 (Incremental_inputs::report_script): New method.
14152 (Incremental_inputs::finalize_inputs): New method.
14153 (Incremental_inputs::finalize): Call finalize_inputs().
14154 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14155 Create inputs entries.
14156 * incremental.h (Incremental_input_type): New enum.
14157 (Incremental_inputs::Incremental_input): Initialize new fields.
14158 (Incremental_inputs::report_inputs): New method.
14159 (Incremental_inputs::report_achive): New method.
14160 (Incremental_inputs::report_object): New method.
14161 (Incremental_inputs::report_script): New method.
14162 (Incremental_inputs::finalize_inputs): New method.
14163 (Incremental_inputs::Input_info): New struct.
14164 (Incremental_inputs::Input_info_map): New typedef.
14165 (Incremental_inputs::lock_): New field.
14166 (Incremental_inputs::Inputs_): New field.
14167 (Incremental_inputs::Inputs_map): New field.
14168 * main.cc (main): Call Incremental_input::report_inputs.
14169 * options.h (Input_argument_list): Typedef moved from
14170 Input_arguments.
14171 (Input_file_group::Files): Remove, use ::Input_argument_list.
14172 (Input_file_group::Input_argument_list): Remove, use
14173 ::Input_argument_list.
14174 * plugin.cc (Plugin_manager::add_input_file): Add error in
14175 incremental build.
14176 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14177 functions.
14178 * script.cc (read_input_script): Call
14179 Incremental_input::report_script.
14180 * script.h (Script_info): New class.
14181
b0481b0b
ILT
141822009-04-27 Ian Lance Taylor <iant@google.com>
14183
14184 * x86_64.cc (do_adjust_output_section): Set entsize to
14185 plt_entry_size.
14186
b22a5a41 141872009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14188
14189 * output.cc (Output_file::close): After short writes, continue
14190 writing from the correct offset in the buffer being written.
14191
40fde488
CD
141922009-04-23 Chris Demetriou <cgd@google.com>
14193
14194 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14195 * configure: Regenerate.
14196 * config.in: Regenerate.
14197 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14198 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14199
3ce2c28e
ILT
142002009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14201
14202 * incremental.cc (Incremental_inputs_header_data): Renamed from
14203 Incremental_input_header_data.
14204 (Incremental_inputs_header_data::data_size): New field.
14205 (Incremental_inputs_header_data::put_input_file_count): Renamed
14206 from input_file_count.
14207 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14208 from command_line_offset.
14209 (Incremental_inputs_header_data::put_reserved): Renamed from
14210 put_reserved.
14211 (Incremental_inputs_entry_data): Renamed from
14212 Incremental_input_entry_data.
14213 (Incremental_inputs_entry_data::data_size): New field.
14214 (Incremental_inputs::report_command_line): New method.
14215 (Incremental_inputs::finalize): New method.
14216 (Incremental_inputs::create_incremental_inputs_data): New method.
14217 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14218 * incremental.h: New file.
14219 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14220 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14221 incremental builds.
703d02da 14222 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14223 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14224 (Layout::create_incremental_info_sections): New method.
14225 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14226 * main.cc (main): Notify Incremental_input of the command line.
14227
e55bde5e
ILT
142282009-04-01 Ian Lance Taylor <iant@google.com>
14229 Mikolaj Zalewski <mikolajz@google.com>
14230
14231 * gold.h (reserve_unordered_map): Define, three versions, one for
14232 each version of Unordered_map.
14233 * layout.cc (Layout::Layout): Remove options parameter. Add
14234 number_of_input_files parameter. Don't initialize options_.
14235 Initialize number_of_input_files_ and resized_signatures_. Move
14236 sections_are_attached_.
14237 (Layout::layout_group): Reserve space for group_signatures_.
14238 (Layout::find_or_add_kept_section): Change name parameter to be a
14239 reference. Resize signatures_ map when it gets large enough.
14240 (Layout::layout_eh_frame): Use parameters->options() instead of
14241 this->options_.
14242 (Layout::make_output_section): Likewise.
14243 (Layout::attach_allocated_section_to_segment): Likewise.
14244 (Layout::finalize, Layout::create_executable_stack): Likewise.
14245 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14246 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14247 * layout.h (class Layout): Update declarations. Remove options_
14248 field. Add number_of_input_files_ and resized_signatures_
14249 fields. Move sections_are_attached_ field.
14250 * main.cc (main): Pass number of input files to Layout
14251 constructor. Don't pass options.
14252
154b857c
ILT
142532009-03-30 Ian Lance Taylor <iant@google.com>
14254
14255 * ffsll.c (ffsll): Correct implementation.
14256
2f35ab9b
ILT
142572009-03-27 Ian Lance Taylor <iant@google.com>
14258
fd03461a
ILT
14259 * ffsll.c: New file.
14260 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14261 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14262 * ftruncate.c (ftruncate): Declare before definition.
14263 * mremap.c (mremap): Likewise.
14264 * pread.c (pread): Likewise.
14265 * configure, Makefile.in, config.in: Rebuild.
14266
2f35ab9b
ILT
14267 * mremap.c: New file.
14268 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14269 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14270 (mremap): Declare if HAVE_MREMAP is not defined.
14271 * configure, Makefile.in, config.in: Rebuild.
14272
33aea2fd
CC
142732009-03-27 Cary Coutant <ccoutant@google.com>
14274
14275 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14276 position independent.
14277 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14278 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14279
6d479619
CC
142802009-03-24 Cary Coutant <ccoutant@google.com>
14281
14282 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14283 an executable.
14284 (needs_dynamic_reloc): Likewise.
14285
afc06bb8
ILT
142862009-03-24 Ian Lance Taylor <iant@google.com>
14287
14288 * yyscript.y (file_cmd): Recognize EXTERN.
14289 (extern_name_list, extern_name_list_body): New nonterminals.
14290 * script.cc (script_add_extern): Define.
14291 * script-c.h (script_add_extern): Declare.
14292
f6060a4d
ILT
142932009-03-24 Rafael Avila de Espindola <espindola@google.com>
14294
14295 * object.cc (is_elf_object): Define.
14296 * object.h (is_elf_object): Declare.
14297 * archive.cc (Archive::get_elf_object_for_member): Call
14298 is_elf_object.
33aea2fd 14299 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14300
26736d8e
ILT
143012009-03-24 Elliott Hughes <enh@google.com>
14302
14303 * output.cc (Output_file::map_anonymous): Define.
14304 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14305 try an anonymous one. Report the size if the mmap fails.
14306 * output.h (class Output_file): Declare map_anonymous.
14307
22fd9730
ILT
143082009-03-24 Ian Lance Taylor <iant@google.com>
14309
14310 * target-select.cc (instantiate_target): Don't acquire the lock if
14311 the instantiated_target_ field has already been set.
14312
cb010894
ILT
143132009-03-23 Ian Lance Taylor <iant@google.com>
14314
7f055c20
ILT
14315 * gold-threads.h (class Initialize_lock): Define.
14316 * gold-threads.cc (class Initialize_lock_once): Define.
14317 (initialize_lock_control): New static variable.
14318 (initialize_lock_pointer): New static variable.
14319 (initialize_lock_once): New static function.
14320 (Initialize_lock::Initialize_lock): Define.
14321 (Initialize_lock::initialize): Define.
14322 * target-select.h: Include "gold-threads.h".
14323 (class Target_selector): Add lock_ and initialize_lock_ fields.
14324 Don't define instantiate_target, just declare it.
14325 * target-select.cc (Target_selector::Target_selector): Initialize
14326 new fields.
14327 (Target_selector::instantiate_target): Define.
14328 * descriptors.h: Include "gold-threads.h".
14329 (class Descriptors): Add initialize_lock_ field.
14330 * descriptors.cc (Descriptors::Descriptors): Initialize new
14331 field.
14332 (Descriptors::open): Use initialize_lock_ field
14333 * errors.h (class Errors): Add initialize_lock_ field.
14334 * errors.cc (Errors::Errors): Initialize new field.
14335 (Errors::initialize_lock): Use initialize_lock_ field.
14336 * powerpc.cc (class Target_selector_powerpc): Remove
14337 instantiated_target_ field. In do_recognize call
14338 instantiate_target rather than do_instantiate_target. In
14339 do_instantiate_target just allocate a new target.
14340 * sparc.cc (class Target_selector_sparc): Likewise.
14341
36959681
ILT
14342 * freebsd.h: New file.
14343 * i386.cc: Include "freebsd.h".
14344 (Target_i386): Derive from Target_freebsd rather than
14345 Sized_target.
14346 (Target_selector_i386): Derive from Target_selector_freebsd rather
14347 than Target_selector.
14348 * x86_64.cc: Include "freebsd.h".
14349 (Target_x86_64): Derive from Target_freebsd rather than
14350 Sized_target.
14351 (Target_selector_x86_64): Derive from Target_selector_freebsd
14352 rather than Target_selector.
14353 * target.h (class Target): Add adjust_elf_header and
14354 do_adjust_elf_header.
14355 * output.cc (Output_file_header:: do_sized_write): Call target
14356 adjust_elf_header routine.
14357 * configure.tgt: Set targ_osabi.
14358 * configure.ac: Define GOLD_DEFAULT_OSABI.
14359 * parameters.cc (Parameters::default_target): Pass
14360 GOLD_DEFAULT_OSABI to select_target.
14361 * target-select.h (class Target_selector): Make instantiate_target
14362 protected rather than private.
14363 * Makefile.am (HFILES): Add freebsd.h.
14364 * configure, Makefile.in, config.in: Rebuild.
14365
cb010894
ILT
14366 * merge.cc (do_add_input_section): Correct pend value. Change
14367 message about last entry not being null terminated from error to
14368 warning.
14369
0e879927
ILT
143702009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14371
14372 * incremental.cc: New file.
14373 * Makefile.am (CCFILES): Add incremental.cc.
14374 * Makefile.in: Rebuild.
14375
41105937
PP
143762009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14377
14378 * layout.cc (Layout::output_section_name): Preserve names
14379 of '.note.' sections.
e1df38aa 14380
60439920
ILT
143812009-03-19 Ian Lance Taylor <iant@google.com>
14382
14383 * descriptors.cc (Descriptors::open): Check that the options are
14384 valid before using them.
14385
0d371ad3
ILT
143862009-03-18 Ian Lance Taylor <iant@google.com>
14387
14388 * script-sections.h: Include <list>.
14389 (class Script_sections): Change Sections_elements from std::vector
14390 to std::list. Typedef public Elements_iterator. Add
14391 orphan_section_placement_, data_segment_align_start_, and
14392 saw_data_segment_align_ fields. Remove data_segment_align_index_
14393 field.
14394 * script-sections.cc (class Orphan_section_placement): New class.
14395 (class Sections_element): Add virtual functions is_relro and
14396 orphan_section_init. Remove virtual function place_orphan_here.
14397 (class Output_section_definition): Add is_relro and
14398 orphan_section_init. Remove place_orphan_here.
14399 (class Orphan_output_section): Likewise.
14400 (Script_sections::Script_sections): Update for field changes.
14401 (Script_sections::data_segment_align): Set saw_data_segment_align_
14402 and data_segment_align_start_, not data_segment_align_index.
14403 (Script_sections::data_segment_relro_end): Check
14404 saw_data_segment_align_. Use data_segment_align_start_ rather
14405 than data_segment_align_index_.
14406 (Script_sections::place_orphan): Rewrite to use
14407 Orphan_section_placement.
14408
9201d894
ILT
144092009-03-17 Ian Lance Taylor <iant@google.com>
14410
9c5b8369
ILT
14411 * archive.cc (Archive::add_symbols): Check for a version attached
14412 to the symbol name in the archive map.
14413 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14414 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14415 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14416 (ver_test_11.a): New target.
14417 * testsuite/Makefile.in: Rebuild.
14418
9201d894
ILT
14419 * configure.ac: Check for chsize and posix_fallocate. Replace
14420 ftruncate.
14421 * ftruncate.c: New file, from gnulib.
14422 * output.cc (posix_fallocate): Define dummy version if not
14423 HAVE_POSIX_FALLOCATE.
14424 (Output_file::map): Call posix_fallocate rather than lseek and
14425 write.
14426 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14427 * configure, Makefile.in, config.in: Rebuild.
14428
ef4ab7a8 144292009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14430
ef4ab7a8
PP
14431 * layout.h (Layout::create_note): Add section_name parameter.
14432 * layout.cc (Layout::create_note): Likewise.
14433 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14434
8c500701
ILT
144352009-03-17 Ian Lance Taylor <iant@google.com>
14436
e85b18e1
ILT
14437 * descriptors.cc: Include "options.h".
14438 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14439 (Descriptors::open): Always use O_CLOEXEC when opening a new
14440 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14441 then set FD_CLOEXEC.
14442
9efe6174
ILT
14443 * sparc.cc (class Target_sparc): Add has_got_section.
14444 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14445 make sure we have a GOT section.
14446
14447 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14448 (Target_sparc::Scan::local): Likewise.
14449 (Target_sparc::Scan::global): Likewise.
14450 (Target_sparc::Relocate::relocate): Likewise.
14451 (Target_sparc::Relocate::relocate_tls): Likewise.
14452
8c500701
ILT
14453 * symtab.cc (Symbol_table::define_default_version): New function,
14454 broken out of add_from_object.
14455 (Symbol_table::add_from_object): Call define_default_version.
14456 (Symbol_table::define_special_symbol): Add resolve_oldsym
14457 parameter. Change all callers. If the version for a symbol comes
14458 from a version script, resolve it with the symbol with the same
14459 name with no version. Also add the symbol without a version if
14460 appropriate.
14461 (do_define_in_output_data): If resolving with oldsym, don't delete
14462 sym.
14463 (do_define_in_output_segment): Likewise.
14464 (do_define_as_constant): Likewise.
14465 * symtab.h (class Symbol_table): Update declarations.
14466
f1ed28fb
ILT
144672009-03-13 Ian Lance Taylor <iant@google.com>
14468
15f8229b
ILT
14469 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14470 (Read_symbols::requeue): New function.
14471 (Read_symbols::do_read_symbols): If make_elf_object fails because
14472 the target type is not configured, and the file was searched for,
14473 issue a warning and retry with the next directory.
14474 (Add_symbols::run): If the file has an incompatible format, and
14475 it was searched for, requeue the Read_symbols task. On error,
14476 release the object.
14477 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14478 dirindex parameter to constructor. Change all callers. Declare
14479 incompatible_warning and requeue.
14480 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14481 input_argument_ and input_group_ fields. Add them to
14482 constructor. Change all callers.
14483 (class Read_script): Add dirindex_ field. Add it to constructor.
14484 Change all callers.
14485 * archive.cc (Archive::setup): Remove input_objects parameter.
14486 Change all callers.
14487 (Archive::get_file_and_offset): Likewise.
14488 (Archive::read_all_symbols): Likewise.
14489 (Archive::read_symbols): Likewise.
14490 (Archive::get_elf_object_for_member): Remove input_objects
14491 parameter. Add punconfigured parameter. Change all callers.
14492 (Archive::add_symbols): Change return type to bool. Check return
14493 value of include_member.
14494 (Archive::include_all_members): Likewise.
14495 (Archive::include_member): Change return type to bool. Return
14496 false if first included object has incompatible target. Set
14497 included_member_ field.
14498 (Add_archive_symbols::run): If add_symbols returns false, requeue
14499 Read_symbols task.
14500 * archive.h (class Archive): Add included_member_ field.
14501 Initialize it in constructor. Add input_file and searched_for
14502 methods. Update declarations.
14503 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14504 input_argument_ fields. Add them to constructor. Change all
14505 callers.
14506 * script.cc: Include "target-select.h".
14507 (class Parser_closure): Add skip_on_incompatible_target_ and
14508 found_incompatible_target_ fields. Add
14509 skip_on_incompatible_target parameter to constructor. Change all
14510 callers. Add methods skip_on_incompatible_target,
14511 clear_skip_on_incompatible_target, found_incompatible_target, and
14512 set_found_incompatible_target.
14513 (read_input_script): Add dirindex parameter. Change all callers.
14514 If parser finds an incompatible target, requeue Read_symbols
14515 task.
14516 (script_set_symbol): Clear skip_on_incompatible_target in
14517 closure.
14518 (script_add_assertion, script_parse_option): Likewise.
14519 (script_start_sections, script_add_phdr): Likewise.
14520 (script_check_output_format): New function.
14521 * script.h (read_input_script): Update declaration.
14522 * script-c.h (script_check_output_format): Declare.
14523 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14524 (ignore_cmd): Remove OUTPUT_FORMAT.
14525 * fileread.cc (Input_file::Input_file): Add explicit this.
14526 (Input_file::will_search_for): New function.
14527 (Input_file::open): Add pindex parameter. Change all callers.
14528 * fileread.h (class Input_file): Add input_file_argument method.
14529 Declare will_search_for. Update declarations.
14530 * object.cc (make_elf_object): Add punconfigured parameter.
14531 Change all callers.
14532 * object.h (class Object): Make input_file public. Add
14533 searched_for method.
14534 (make_elf_object): Update declaration.
14535 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14536 restart search.
14537 * dirsearch.h (class Dirsearch): Update declaration.
14538 * options.h (class General_options): Add --warn-search-mismatch.
14539 * parameters.cc (Parameters::is_compatible_target): New function.
14540 * parameters.h (class Parameters): Declare is_compatible_target.
14541 * workqueue.cc (Workqueue::add_blocker): New function.
14542 * workqueue.h (class Workqueue): Declare add_blocker.
14543
f1ed28fb
ILT
14544 * fileread.cc (Input_file::open): Remove options parameter.
14545 Change all callers.
14546 (Input_file::open_binary): Likewise.
14547 * script.cc (read_input_script): Likewise.
14548 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14549 options parameter from constructor. Change all callers.
14550 (class Read_script): Likewise.
14551 * fileread.h (class Input_file): Update declarations.
14552 * script.h (read_input_script): Update declaration.
14553
34dd024a
NC
145542009-03-10 Nick Clifton <nickc@redhat.com>
14555
14556 * po/es.po: New Spanish translation.
14557
6d71b17c
CC
145582009-03-06 Cary Coutant <ccoutant@google.com>
14559
14560 * options.cc (parse_short_option): Keep dash_z from registering itself.
14561
031cdbed
ILT
145622009-03-03 Ian Lance Taylor <iant@google.com>
14563
14564 PR 9918
14565 * target-reloc.h (relocate_section): Pass output_section to
14566 relocate.
14567 * i386.cc (Target_i386::should_apply_static_reloc): Add
14568 output_section parameter. Change all callers.
14569 (Target_i386::Relocate::relocate): Add output_section parameter.
14570 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14571 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14572 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14573 * testsuite/two_file_shared.sh: New script.
14574 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14575 (check_DATA): Add two_file_shared.dbg.
14576 (two_file_shared.dbg): New target.
14577 * testsuite/Makefile.in: Rebuild.
14578
15d5fa16
ILT
145792009-03-01 Ian Lance Taylor <iant@google.com>
14580
14581 * configure.ac: Check for byteswap.h.
14582 * configure: Rebuild.
14583 * config.in: Rebuild.
14584
8a4c0b0d
ILT
145852009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14586
14587 * layout.cc (Layout::find_or_add_kept_section): New function.
14588 (Layout::add_comdat): Removed.
14589 * layout.h (struct Kept_section): Move out of class Layout.
14590 Remove trailing underscores from field names. Add group_sections
14591 field. Rename group_ field to is_group. Change all uses.
14592 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14593 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14594 comdat_groups_ field.
14595 (Sized_relobj::include_section_group): Use
14596 find_or_add_kept_section and Kept_section::group_sections.
14597 (Sized_relobj::include_linkonce_section): Likewise.
14598 * object.cc (class Sized_relobj): Don't define Comdat_group or
14599 Comdat_group_table. Remove find_comdat_group and
14600 add_comdat_group. Remove comdat_groups_ field.
14601 * plugin.cc (include_comdat_group): Use
14602 Layout::find_or_add_kept_section.
14603
b4ecf66b
ILT
146042009-02-28 Ian Lance Taylor <iant@google.com>
14605
14359ca0
ILT
14606 * README: --gc-sections and map files are now supported. Document
14607 some build requirements.
14608
b4ecf66b
ILT
14609 PR 6992
14610 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14611 relocatable link set the value of the section symbol to zero.
14612 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14613 relocatable link don't include the section address in the local
14614 symbol value.
14615
0602e05a
ILT
146162009-02-27 Ian Lance Taylor <iant@google.com>
14617
fd9d194f
ILT
14618 PR 6811
14619 * options.h (class Search_directory): Add is_system_directory.
14620 (class General_options): Declare is_in_system_directory.
14621 * options.cc (get_relative_sysroot): Make static.
14622 (get_default_sysroot): Make static.
14623 (General_optoins::is_in_system_directory): New function.
14624 * fileread.cc (Input_file::is_in_system_directory): New function.
14625 * fileread.h (class Input_file): Declare is_in_system_directory.
14626 * object.h (class Object): Add is_in_system_directory.
14627 (class Input_objects): Remove system_library_directory_ field.
14628 * object.cc (Input_objects::add_object): Don't set
14629 system_library_directory_.
14630 (input_objects::found_in_system_library_directory): Remove.
14631 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14632 parameter. Change all callers.
14633 (Symbol_table::sized_write_globals): Likewise.
14634 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14635 Call Object::is_in_system_directory.
14636 * symtab.h (class Symbol_table): Update declarations.
14637
61edd21f
ILT
14638 PR 5990
14639 * descriptors.h (Open_descriptor): Add is_on_stack field.
14640 * descriptors.cc (Descriptors::open): If the descriptor is on the
14641 top of the stack, remove it. Initialize is_on_stack field.
14642 (Descriptors::release): Only add pod to stack if it is not on the
14643 stack already.
14644 (Descriptors::close_some_descriptor): Clear stack_next and
14645 is_on_stack fields.
14646
e29e076a
ILT
14647 PR 7091
14648 * output.cc (Output_section::find_starting_output_address): Rename
14649 from starting_output_address; add PADDR parameter; change return
14650 type.
14651 * output.h (class Output_section): Declare
14652 find_starting_output_address instead of starting_output_address.
14653 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14654 section symbol for which we can't find a merge section.
14655
0602e05a
ILT
14656 PR 9836
14657 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14658 hidden or internal, force the symbol to be local.
14659 * resolve.cc (Symbol::override_visibility): Define.
14660 (Symbol::override_base): Use override_visibility.
14661 (Symbol_table::resolve): Likewise.
14662 (Symbol::override_base_with_special): Likewise.
14663 (Symbol_table::override_with_special): If the visibility is hidden
14664 or internal, force the symbol to be local.
14665 * symtab.h (class Symbol): Add set_visibility and
14666 override_visibility.
14667 * testsuite/ver_test_1.sh: New file.
14668 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14669 (check_DATA): Add ver_test_1.syms.
14670 (ver_test_1.syms): New target.
14671 * testsuite/Makefile.in: Rebuild.
14672
401a9a73
CC
146732009-02-25 Cary Coutant <ccoutant@google.com>
14674
14675 * layout.cc (Layout::choose_output_section): Don't rename sections
14676 when using a linker script that has a SECTIONS clause.
14677 * Makefile.in: Regenerate.
14678
14679 * testsuite/Makefile.am (script_test_5.sh): New test case.
14680 * testsuite/Makefile.in: Regenerate.
14681 * testsuite/script_test_5.cc: New file.
14682 * testsuite/script_test_5.sh: New file.
14683 * testsuite/script_test_5.t: New file.
14684
f488e4b0
CC
146852009-02-13 Rafael Avila de Espindola <espindola@google.com>
14686
14687 * archive.cc (Archive::include_member): Update calls to add_symbols.
14688 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14689 the Layout argument.
14690 * dynobj.h (do_add_symbols): Add the Layout argument.
14691 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14692 Layout argument.
14693 * object.h (Object::add_symbols): Add the Layout argument.
14694 (Object::do_add_symbols): Add the Layout argument.
14695 (Sized_relobj::do_add_symbols): Add the Layout argument.
14696 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14697 Unify the two versions.
14698 (Add_plugin_symbols): Remove.
14699 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14700 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14701 (Add_plugin_symbols): Remove.
14702 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14703 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14704 (Add_symbols::run): Make it work with Pulginobj.
14705
89dd1680
ILT
147062009-02-06 Ian Lance Taylor <iant@google.com>
14707
14708 * object.cc (Sized_relobj::do_layout): Make info message start
14709 with lower case letter.
14710
266d0a74
ILT
147112009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14712
602b464e
ILT
14713 * binary.cc: Fix file comment.
14714
266d0a74
ILT
14715 * options.h (enum Incremental_disposition): Define.
14716 (class General_options): Add new options: --incremental,
14717 --incremental_changed, --incremental_unchanged,
14718 --incremental_unknown. Add incremental_disposition_ and
14719 implicit_incremental_ fields.
14720 (General_options::incremental_disposition): New function.
14721 (class Position_dependent_options): Add incremental_disposition
14722 option.
14723 (Position_dependent_options::copy_from_options): Set incremental
14724 dispositions.
14725 * options.cc (General_options::parse_incremental_changed): New
14726 function.
2e702c99
RM
14727 (General_options::parse_incremental_unchanged): New function.
14728 (General_options::parse_incremental_unknown): New function.
14729 (General_options::General_options): Initialize new fields
266d0a74 14730 incremental_disposition_ and implicit_incremental_.
2e702c99 14731 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14732 without --incremental.
14733
f073bbf7
CD
147342009-02-06 Chris Demetriou <cgd@google.com>
14735
14736 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14737 pointer and to report location as the file name associated with
14738 the symbol.
14739 (gold_undefined_symbol_at_location): New function to replace the
14740 old gold_undefined_symbol functionality.
14741 * target-reloc.h (relocate_section): Update to use
14742 gold_undefined_symbol_at_location.
14743 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14744 Call gold_undefined_symbol function rather than gold_error.
14745 * errors.h (Errors::undefined_symbol): Take location as a
14746 string, rather than calculating it from a relocation.
14747 * errors.cc (Errors::fatal): Print "fatal error:" before the
14748 formatted message.
14749 (Errors::error, Errors::error_at_location): Print "error: "
14750 before the formatted message.
14751 (Errors::undefined_symbol): Take location as a string, rather
14752 than calculating it from a relocation.
14753 (gold_undefined_symbol_at_location): New function akin to
14754 old gold_undefined_symbol, calculates location from relocation.
14755 (gold_undefined_symbol): Change to take only a Symbol pointer
14756 and to report location as the file name associated with the symbol.
14757 * testsuite/debug_msg.sh: Update for changed error messages.
14758 * testsuite/undef_symbol.sh: Likewise.
14759
8e94a90c
ILT
147602009-02-04 Duncan Sands <baldrick@free.fr>
14761
14762 PR 9812
14763 * reduced_debug_output.h
14764 (Output_reduced_debug_abbrev_section::failed): Use format for
14765 gold_warning.
14766 (Output_reduced_debug_info_section::faild): Likewise.
14767
88a0e15b
ILT
147682009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14769
14770 * script.cc (Lazy_demangler): New class.
2e702c99 14771 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14772 symbol only once.
14773
5efc7cd2
CC
147742009-01-29 Cary Coutant <ccoutant@google.com>
14775
14776 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14777 to __tls_get_addr.
14778 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14779
e0ebcf42
ILT
147802009-01-28 Ian Lance Taylor <iant@google.com>
14781
5efc7cd2 14782 * version.cc (version_string): Bump to 1.9.
75fe7426 14783
e0ebcf42
ILT
14784 * gold.h: Include <cstring> and <stdint.h>.
14785 * version.cc: Include <cstdio>.
14786 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14787 warning.
14788 * reduced_debug_output.cc (insert_into_vector): Rename from
14789 Insert_into_vector; change all callers. Use Swap_unaligned to
14790 avoid aliasing issue; remove union since it is unnecessary.
14791
8e2813be 147922009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14793
14794 * Makefile.am (CCFILES): Add gc.cc.
14795 (HFILES): Add gc.h.
14796 * Makefile.in: Regenerate.
14797 * gold.cc (Gc_runner): New class.
14798 (queue_initial_tasks): Call garbage collection related tasks
14799 when corresponding options are invoked.
14800 (queue_middle_gc_tasks): New function.
14801 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14802 processed early before laying out sections during garbage collection.
14803 * gold.h (queue_middle_gc_tasks): New function.
14804 (is_prefix_of): Move from "layout.cc".
14805 * i386.cc (Target_i386::gc_process_relocs): New function.
14806 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14807 * main.cc (main): Create object of class "Garbage_collection".
14808 * object.cc (Relobj::copy_symbols_data): New function.
14809 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14810 (Sized_relobj::do_layout): Allow this function to be called twice
14811 during garbage collection and defer layout of section during the
6d03d481
ST
14812 first call.
14813 * object.h (Relobj::get_symbols_data): New function.
14814 (Relobj::is_section_name_included): New function.
14815 (Relobj::copy_symbols_data): New function.
14816 (Relobj::set_symbols_data): New function.
14817 (Relobj::get_relocs_data): New function.
14818 (Relobj::set_relocs_data): New function.
14819 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14820 (Relobj::gc_process_relocs): New function.
14821 (Relobj::do_gc_process_relocs): New pure virtual function.
14822 (Relobj::sd_): New data member.
14823 (Sized_relobj::is_output_section_offset_invalid): New function.
14824 (Sized_relobj::do_gc_process_relocs): New function.
14825 * options.h (General_options::gc_sections): Modify to not be a no-op.
14826 (General_options::print_gc_sections): New option.
14827 * plugin.cc (Plugin_finish::run): Remove function call to
14828 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14829 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14830 * reloc.cc (Read_relocs::run): Add task to process relocs and
14831 determine unreferenced sections when doing garbage collection.
14832 (Gc_process_relocs): New class.
14833 (Sized_relobj::do_gc_process_relocs): New function.
14834 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14835 sections that are garbage collected.
14836 * reloc.h (Gc_process_relocs): New class.
14837 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14838 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14839 symbols whose corresponding sections are garbage collected.
14840 (Symbol_table::Symbol_table): Add new parameter for the garbage
14841 collection object.
14842 (Symbol_table::gc_mark_undef_symbols): New function.
14843 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14844 (Symbol_table::gc_mark_dyn_syms): New function.
14845 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14846 as garbage.
14847 (Symbol_table::add_from_object): Likewise.
14848 (Symbol_table::add_from_relobj): When building shared objects, do not
14849 treat externally visible symbols as garbage.
14850 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14851 table information for static and relocatable links.
14852 * symtab.h (Symbol_table::set_gc): New function.
14853 (Symbol_table::gc): New function.
14854 (Symbol_table::gc_mark_undef_symbols): New function.
14855 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14856 (Symbol_table::gc_mark_dyn_syms): New function.
14857 (Symbol_table::gc_): New data member.
e1df38aa 14858 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14859 function.
14860 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14861 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14862
3b293544
CF
148632009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14864
14865 * options.h (General_options::gc_sections): Define as a no-op for now.
14866 (General_options::no_keep_memory): Ditto.
14867 (General_options::Bshareable): Define.
14868 * options.cc (General_options::finalize): Honor -Bshareable.
14869
83d22aa8
AS
148702009-01-20 Andreas Schwab <schwab@suse.de>
14871
14872 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14873 read the value in the contents, since we don't use it. Use the
14874 template endianness when writing.
14875 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14876
cd536b21
AS
148772009-01-19 Andreas Schwab <schwab@suse.de>
14878
14879 * configure.tgt (powerpc64-*): Fix targ_obj.
14880
99e9a495
ILT
148812009-01-15 Ian Lance Taylor <iant@google.com>
14882
14883 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14884 local symbols when stripping all symbols.
14885
bbbfea06
CC
148862009-01-14 Cary Coutant <ccoutant@google.com>
14887
99e9a495 14888 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14889
0f7c0701
CC
148902009-01-14 Cary Coutant <ccoutant@google.com>
14891
14892 * archive.cc (Archive::get_elf_object_for_member): Remove call
14893 to File_read::claim_for_plugin.
14894 * descriptors.cc (Descriptors::open): Remove reference to
14895 is_claimed.
14896 (Descriptors::claim_for_plugin): Remove.
14897 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14898 (Descriptors::is_claimed): Remove.
14899 (claim_descriptor_for_plugin): Remove.
14900 * fileread.cc (File_read::claim_for_plugin): Remove.
14901 * fileread.h (File_read::claim_for_plugin): Remove.
14902 (File_read::descriptor): Reopen descriptor if necessary.
14903 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14904 (Plugin_manager::all_symbols_read): Add task parameter. Change
14905 all callers.
14906 (Plugin_manager::get_input_file): New function.
14907 (Plugin_manager::release_input_file): New function.
14908 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14909 corresponding data member.
14910 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14911 and pass to base constructor. Change all callers.
14912 (get_input_file, release_input_file): New functions.
14913 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14914 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14915 (Plugin_manager::all_symbols_read): Add task parameter.
14916 (Plugin_manager::get_input_file): New function.
14917 (Plugin_manager::release_input_file): New function.
14918 (Plugin_manager::task_): New data member.
14919 (Pluginobj::Pluginobj): Add filesize parameter.
14920 (Pluginobj::filename): New function.
14921 (Pluginobj::descriptor): New function.
14922 (Pluginobj::filesize): New function.
14923 (Pluginobj::filesize_): New data member.
14924 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14925 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14926 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14927
14928 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14929 with archive libraries.
14930 * testsuite/Makefile.in: Regenerate.
14931 * testsuite/plugin_test.c (struct sym_info): New type.
14932 (get_input_file, release_input_file): New static variables.
14933 (onload): Capture new transfer vector entries.
14934 (claim_file_hook): Stop reading at end of file according to filesize.
14935 Factor out parsing of readelf output into separate function.
14936 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14937 APIs and get the source file name from the symbol table. Convert
14938 source file name to corresponding object file name. Print info
14939 message when adding new input files.
14940 (parse_readelf_line): New function.
14941 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14942 * testsuite/plugin_test_2.sh: Likewise.
14943 * testsuite/plugin_test_3.sh: Likewise.
14944 * testsuite/plugin_test_4.sh: New test case.
14945
62a6d109
ILT
149462009-01-07 Ian Lance Taylor <iant@google.com>
14947
14948 * version.cc (version_string): Bump to 1.8.
14949
483620e8
CC
149502008-12-23 Cary Coutant <ccoutant@google.com>
14951
14952 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14953 * plugin.cc (Plugin_manager::finish): Rename as
14954 layout_deferred_objects. Move cleanup to separate function.
14955 (Plugin_manager::cleanup): New function.
14956 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14957 separately.
14958 * plugin.h (Plugin_manager::finish): Rename as
14959 layout_deferred_objects.
14960 (Plugin_manager::cleanup): New function.
14961 (Plugin_manager::cleanup_done): New field.
14962
d66a9eb3
CC
149632008-12-23 Cary Coutant <ccoutant@google.com>
14964
14965 * plugin.cc (is_visible_from_outside): New function.
14966 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14967 so we don't return "IR only" status for exported symbols or -r links.
14968
14969 * testsuite/Makefile.am (plugin_test_3): New test case.
14970 * testsuite/Makefile.in: Regenerate.
14971 * testsuite/plugin_test_3.sh: New file.
14972
5995b570
CC
149732008-12-22 Cary Coutant <ccoutant@google.com>
14974
14975 * object.cc (Sized_relobj::layout_section): New function.
14976 (Sized_relobj::do_layout): Defer layout of input sections until after
14977 plugin has provided replacement files.
14978 (Sized_relobj::do_layout_deferred_sections): New function.
14979 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14980 (Relobj::layout_deferred_sections): New function.
14981 (Relobj::do_layout_deferred_sections): New function.
14982 (Sized_relobj::do_layout_deferred_sections): New function.
14983 (Sized_relobj::layout_section): New function.
14984 (Sized_relobj::Deferred_layout): New structure.
14985 (Sized_relobj::deferred_layout_): New field.
14986 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14987 Change all callers. Layout deferred sections.
14988 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14989 references.
14990 (Plugin_hook::run): Move code from do_plugin_hook inline.
14991 (Plugin_hook::do_plugin_hook): Remove.
14992 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14993 (Plugin_manager::finish): Renamed, was cleanup.
14994 (Plugin_manager::should_defer_layout): New function.
14995 (Plugin_manager::add_deferred_layout_object): New function.
14996 (Plugin_manager::Deferred_layout_list): New type.
14997 (Plugin_manager::deferred_layout_objects_): New field.
14998 (Plugin_hook::do_plugin_hook): Remove.
14999
ee769c88
ILT
150002008-12-17 Ian Lance Taylor <iant@google.com>
15001
15002 * options.h (class General_options): Add --no case for
15003 --export-dynamic.
15004
abc8dcba
CC
150052008-12-16 Cary Coutant <ccoutant@google.com>
15006
15007 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15008 vector.
15009 (Plugin_manager::claim_file): Create plugin object even if
15010 plugin did not call the add_symbols callback.
15011 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15012 asking for more symbols than were added.
15013 * testsuite/Makefile.am (plugin_test_1): Add test case with
15014 no global symbols.
15015 (empty.syms): New target.
15016 * testsuite/Makefile.in: Regenerate.
15017 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15018 message. Don't call add_symbols if no globals.
15019 (all_symbols_read_hook): Don't provide replacement for empty
15020 claimed file.
15021
b0074644
ILT
150222008-12-12 Ian Lance Taylor <iant@google.com>
15023
68943102
ILT
15024 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15025 r_type == 0 for a local symbol with r_sym == 0.
15026 (scan_relocatable_relocs): Pass r_sym to
15027 local_non_section_strategy.
15028 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15029 r_sym parameter.
15030
b0074644
ILT
15031 * configure.ac: Update test for TLS descriptors: they are
15032 supported as of glibc 2.9.
15033 * configure: Rebuild.
15034
c2508178
ILT
150352008-12-11 Ian Lance Taylor <iant@google.com>
15036
15037 PR 7091
15038 * target-reloc.h (Default_scan_relocatable_relocs): For each
15039 function, map r_type == 0 to RELOC_DISCARD.
15040
2756a258
CC
150412008-12-10 Cary Coutant <ccoutant@google.com>
15042
15043 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15044 object to override a kept COMDAT group from a plugin object.
15045
bb6f53d3
ILT
150462008-12-09 Ian Lance Taylor <iant@google.com>
15047
fbc558e1
ILT
15048 PR 7088
15049 * yyscript.y (file_cmd): Handle INPUT.
15050
bb6f53d3
ILT
15051 * testsuite/initpri1.c: Change all declarations to be full
15052 prototypes by adding void, to avoid compiler warnings.
15053
4674ecfc
CC
150542008-12-05 Rafael Avila de Espindola <espindola@google.com>
15055
15056 * options.cc (General_options::parse_plugin_opt): New.
15057 (General_options::add_plugin): The argument now is just the filename.
15058 (General_options::add_plugin_option): New.
15059 * options.h (plugin_opt): New.
15060 (add_plugin): Change argument name.
15061 (add_plugin_option): New.
15062 * plugin.cc (Plugin::load): Don't parse the plugin option.
15063 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15064 (Plugin::add_option): New.
15065 (Plugin::args_): Change type.
15066 (Plugin::filename_): New.
15067 (Plugin_manager::add_plugin_option): New.
15068 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15069 * testsuite/Makefile.in: Regenerate.
15070
fd06b4aa
CC
150712008-12-05 Cary Coutant <ccoutant@google.com>
15072
15073 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15074 Handle --strip-lto-sections option.
15075 * options.h (strip_lto_sections): New option.
15076
6c52134c
CC
150772008-12-01 Cary Coutant <ccoutant@google.com>
15078
15079 * plugin.cc (ld_plugin_message): Change format parameter to const.
15080 Fix mismatch between new[] and delete.
15081
a45248e0
CC
150822008-11-14 Cary Coutant <ccoutant@google.com>
15083
15084 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15085 instead of -1U.
15086
c82fbeee
CS
150872008-11-05 Craig Silverstein <csilvers@google.com>
15088
15089 * options.cc (General_options::parse_dynamic_list): New function.
15090 * options.h (General_options): New flags dynamic_list,
15091 dynamic_list_data, dynamic_list_cpp_new, and
15092 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15093 (General_options::in_dynamic_list): New function.
15094 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15095 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15096 (Lex::can_continue_name): Likewise.
15097 (yylex): Likewise.
15098 (read_script_file): New parameter script_options.
15099 (read_dynamic_list): New function.
15100 (Script_options::define_dynamic_list): New function.
15101 (dynamic_list_keyword_parsecodes): New variable.
15102 (dynamic_list_keywords): New variable.
15103 * script.h (Script_options::define_dynamic_list): New function
15104 prototype.
15105 (read_dynamic_list): New function prototype.
15106 * symtab.cc (strprefix): New macro.
15107 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15108 dynamic_list_data, dynamic_list_cpp_new, and
15109 dynamic_list_cpp_typeinfo.
15110 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15111 (dynamic_list_expr): New rule.
15112 (dynamic_list_nodes): Likewise.
15113 (dynamic_list_node): Likewise.
15114 * testsuite/Makefile.am (dynamic_list): New test.
15115 * testsuite/Makefile.in: Regenerated.
15116 * testsuite/dynamic_list.t: New file.
15117 * testsuite/dynamic_list.sh: New file.
15118
e0bb29a5
CS
151192008-11-05 Craig Silverstein <csilvers@google.com>
15120
15121 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15122 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15123 (t11_last): Likewise.
15124 * testsuite/ver_test_6.c (main): Likewise.
15125
4e1e25e0
CC
151262008-10-07 Cary Coutant <ccoutant@google.com>
15127
15128 * options.c (General_options::finalize): Add check for -static and
15129 -shared.
15130 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15131 is not empty.
15132
92f03fcb
CC
151332008-10-02 Cary Coutant <ccoutant@google.com>
15134
15135 * plugin.cc (make_sized_plugin_object): Fix conditional
15136 compilation to work when not all targets are enabled.
15137
fbd8a257
CC
151382008-09-29 Cary Coutant <ccoutant@google.com>
15139
15140 * archive.cc (Archive::get_file_and_offset): Use filename instead
15141 of name to get library path.
15142 (Archive::include_member): Unlock external member of a thin archive.
15143
15144 * testsuite/Makefile.am (TEST_AR): New variable.
15145 (thin_archive_test_1): New test.
15146 (thin_archive_test_2): New test.
81636b3f
CC
15147 * testsuite/Makefile.in: Regenerate.
15148 * testsuite/thin_archive_main.cc: New file.
15149 * testsuite/thin_archive_test_1.cc: New file.
15150 * testsuite/thin_archive_test_2.cc: New file.
15151 * testsuite/thin_archive_test_3.cc: New file.
15152 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15153
eff45813
CC
151542008-09-29 Cary Coutant <ccoutant@google.com>
15155
15156 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15157 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15158 instead of -1U.
15159 (Sized_relobj::do_finalize_local_symbols): Likewise.
15160 (Sized_relobj::map_to_kept_section): Likewise.
15161 * object.h (Sized_relobj::invalid_address): New constant.
15162 (Sized_relobj::do_output_section_offset): Check for invalid_address
15163 and return -1ULL.
15164 * output.cc (Output_reloc::local_section_offset): Use constant
15165 invalid_address instead of -1U.
15166 (Output_reloc::get_address): Likewise.
15167 (Output_section::output_address): Change -1U to -1ULL.
15168 * output.h (Output_reloc::invalid_address): New constant.
15169 * reloc.cc (Sized_relobj::write_sections): Use constant
15170 invalid_address instead of -1U.
15171 (Sized_relobj::relocate_sections): Likewise.
15172 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15173 values for merge sections.
15174 * target-reloc.h (relocate_for_relocatable): Use constant
15175 invalid_address instead of -1U.
15176
89fc3421
CC
151772008-09-19 Cary Coutant <ccoutant@google.com>
15178
15179 Add plugin functionality for link-time optimization (LTO).
15180 * configure.ac (plugins): Add --enable-plugins option.
15181 * configure: Regenerate.
15182 * config.in: Regenerate.
15183 * Makefile.am (LIBDL): New variable.
15184 (CCFILES): Add plugin.cc.
15185 (HFILES): Add plugin.h.
15186 (ldadd_var): Add LIBDL.
15187 * Makefile.in: Regenerate.
15188
15189 * archive.cc: Include "plugin.h".
15190 (Archive::setup): Don't preread archive symbols when using a plugin.
15191 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15192 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15193 files.
15194 (Archive::include_member): Add symbols from plugin objects.
15195 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15196 * descriptors.cc (Descriptors::open): Check for file descriptors
15197 abandoned by plugins.
15198 (Descriptors::claim_for_plugin): New function.
15199 * descriptors.h (Descriptors::claim_for_plugin): New function.
15200 (Open_descriptor::is_claimed): New field.
15201 (claim_descriptor_for_plugin): New function.
15202 * fileread.cc (File_read::claim_for_plugin): New function.
15203 * fileread.h (File_read::claim_for_plugin): New function.
15204 (File_read::descriptor): New function.
15205 * gold.cc: Include "plugin.h".
15206 (queue_initial_tasks): Add task to call plugin hooks for generating
15207 new object files.
15208 * main.cc: Include "plugin.h".
15209 (main): Load plugin libraries.
15210 * object.h (Pluginobj): Declare.
15211 (Object::pluginobj): New function.
15212 (Object::do_pluginobj): New function.
15213 (Object::set_target): New function.
15214 * options.cc: Include "plugin.h".
15215 (General_options::parse_plugin): New function.
15216 (General_options::General_options): Initialize plugins_ field.
15217 (General_options::add_plugin): New function.
15218 * options.h (Plugin_manager): Declare.
15219 (General_options): Add --plugin option.
15220 (General_options::has_plugins): New function.
15221 (General_options::plugins): New function.
15222 (General_options::add_plugin): New function.
15223 (General_options::plugins_): New field.
15224 * plugin.cc: New file.
15225 * plugin.h: New file.
15226 * readsyms.cc: Include "plugin.h".
15227 (Read_symbols::do_read_symbols): Check for archive before checking
15228 for ELF file. Call plugin hooks to claim files.
15229 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15230 from a real object file; force override when processing replacement
15231 files.
15232 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15233 (Symbol::init_base_object): Likewise.
15234 (Symbol::init_base_output_data): Likewise.
15235 (Symbol::init_base_output_segment): Likewise.
15236 (Symbol::init_base_constant): Likewise.
15237 (Symbol::init_base_undefined): Likewise.
15238 (Symbol::output_section): Assert that object is not a plugin.
15239 (Symbol_table::add_from_pluginobj): New function.
15240 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15241 undefined.
15242 (Symbol_table::sized_write_globals): Likewise.
15243 (Symbol_table::add_from_pluginobj): Instantiate template.
15244 * symtab.h (Sized_pluginobj): Declare.
15245 (Symbol::in_real_elf): New function.
15246 (Symbol::set_in_real_elf): New function.
15247 (Symbol::in_real_elf_): New field.
15248 (Symbol_table::add_from_pluginobj): New function.
15249
15250 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15251 (LIBDL): New variable.
15252 (LDADD): Add LIBDL.
15253 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15254 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15255 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15256 (MOSTLYCLEANFILES): Likewise.
15257 * testsuite/Makefile.in: Regenerate.
15258 * testsuite/plugin_test.c: New file.
15259 * testsuite/plugin_test_1.sh: New file.
15260 * testsuite/plugin_test_2.sh: New file.
15261
de31bda5
ILT
152622008-09-16 Ian Lance Taylor <iant@google.com>
15263
9c2d0ef9
ILT
15264 * target-reloc.h (relocate_section): Check whether a symbol is
15265 defined by the ABI before reporting an undefined symbol error.
15266 * target.h (Target::is_defined_by_abi): Make parameter const.
15267 (Target::do_is_defined_by_abi): Likewise.
15268 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15269 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15270 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15271 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15272 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15273 * testsuite/Makefile.in: Rebuild.
15274
de31bda5
ILT
15275 * fileread.cc (make_view): Add casts to avoid warning.
15276
9fa33bee
AO
152772008-09-16 Alexandre Oliva <aoliva@redhat.com>
15278
15279 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15280 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15281
183fd0e3
AO
152822008-09-16 Alexandre Oliva <aoliva@redhat.com>
15283
15284 * options.h (General_options::output_is_executable): New.
15285 (General_options::output_is_pie): New.
15286 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15287 for shared libraries.
15288 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15289
7be8330a
CD
152902008-09-11 Chris Demetriou <cgd@google.com>
15291
15292 * options.h (origin): New -z option.
15293 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15294 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15295 in DT_FLAGS_1.
15296
a9caad02
CC
152972008-09-05 Cary Coutant <ccoutant@google.com>
15298
15299 * fileread.cc (File_read::make_view): Add check for attempt to map
15300 beyond end of file.
15301
ae6dce4d
CC
153022008-09-05 Cary Coutant <ccoutant@google.com>
15303
15304 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15305 explicit instantiations.
15306
d7ab2a47
KVH
153072008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15308
15309 PR gold/6858
15310 * options.cc (General_options::finalize): Allow undefined symbols
15311 in shlibs if linking -shared.
15312
15313 PR gold/6859
15314 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15315 symbols as not needing a dynsym entry.
15316
1e52a9c1
CS
153172008-08-20 Craig Silverstein <csilvers@google.com>
15318
15319 * fileread.cc (File_read::open): Do not lock the file unless it
15320 was successfully opened.
15321
d85c80a3
CC
153222008-08-14 Cary Coutant <ccoutant@google.com>
15323
15324 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15325 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15326 * testsuite/tls_test.cc (struct int128): 128-bit struct
15327 for testing TLS relocs with non-zero addend.
15328 (v12): New TLS variable.
15329 (t12): New test.
15330 (t_last): Add check for v12.
15331 * testsuite/tls_test.h (t12): New function.
15332 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15333
2d924fd9
ILT
153342008-08-13 Ian Lance Taylor <iant@google.com>
15335
15336 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15337 set tls_segment_ or relro_segment_.
15338 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15339 when appropriate.
15340 * output.h (Output_section::clear_is_relro): New function.
15341 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15342 sections specially even when output_data_ is empty.
15343 (Output_segment::maximum_alignment): When first section is relro,
15344 only force alignment for PT_LOAD segments.
15345 * script.cc (script_data_segment_align): New function.
15346 (script_data_segment_relro_end): New function.
15347 * script-c.h (script_data_segment_align): Declare.
15348 (script_data_segment_relro_end): Declare.
15349 * script-sections.h (class Script_sections): Declare
15350 data_segment_align and data_segment_relro_end. Add fields
15351 segment_align_index_ and saw_relro_end_.
15352 * script-sections.cc (class Sections_element): Add set_is_relro
15353 virtual function. Add new bool* parameter to place_orphan_here.
15354 Add get_output_section virtual function.
15355 (class Output_section_definition): Add set_is_relro. Add new
15356 bool* parameter to place_orphan_here. Add get_output_section.
15357 Add is_relro_ field.
15358 (Output_section_definition::Output_section_definition): Initialize
15359 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15360 and is_relro_ fields.
15361 (Output_section_definition::place_orphan_here): Add is_relro
15362 parameter.
15363 (Output_section_definition::set_section_addresses): Set relro for
15364 output section.
15365 (Output_section_definition::alternate_constraint): Likewise.
15366 (class Orphan_output_section): Add new bool* parameter to
15367 place_orphan_here. Add get_output_section.
15368 (Orphan_output_section::place_orphan_here): Add is_relro
15369 parameter.
15370 (Script_sections::Script_sections): Initialize
15371 data_segment_align_index_ and saw_relro_end_.
15372 (Script_sections::data_segment_align): New function.
15373 (Script_sections::data_segment_relro_end): New function.
15374 (Script_sections::place_orphan): Set or clear is_relro.
15375 (Script_sections::set_section_addresses): Force alignment of first
15376 TLS section.
15377 * yyscript.y (exp): Call script_data_segment_align and
15378 script_data_segment_relro_end.
15379 * testsuite/relro_script_test.t: New file.
15380 * testsuite/relro_test.cc (using_script): Declare.
15381 (t1, t2): Test using_script.
15382 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15383 (relro_script_test_SOURCES): Define.
15384 (relro_script_test_DEPENDENCIES): Define.
15385 (relro_script_test_LDFLAGS): Define.
15386 (relro_script_test_LDADD): Define.
15387 (relro_script_test.so): New target.
15388 * testsuite/Makefile.in: Rebuild.
15389
f827c9a9
CC
153902008-08-06 Cary Coutant <ccoutant@google.com>
15391
15392 * archive.cc (Archive::total_archives, Archive::total_members)
15393 (Archive::total_members_loaded): New variables.
15394 (Archive::setup): Add parameter. Add option to preread
15395 archive symbols.
15396 (Archive::read_armap): Add counter.
15397 (Archive::get_file_and_offset): New function.
15398 (Archive::get_elf_object_for_member): New function.
15399 (Archive::read_all_symbols): New function.
15400 (Archive::read_symbols): New function.
15401 (Archive::add_symbols): Add counters.
15402 (Archive::include_all_members): Use armap to find members if it's
15403 already built.
15404 (Archive::include_member): Skip reading symbols if already read.
15405 Factored code into Archive::get_file_and_offset and
15406 Archive::get_elf_object_for_member. Changed call to
15407 Mapfile::report_include_archive_member.
15408 (Archive::print_stats): New function.
15409 * archive.h: Declare Object and Read_symbols_data classes.
15410 (Archive::Archive): Add initializers for new members.
15411 (Archive::setup): Add parameter.
15412 (Archive::print_stats): New function.
15413 (Archive::total_archives, Archive::total_members)
15414 (Archive::total_members_loaded): New variables.
15415 (Archive::get_file_and_offset): New function.
15416 (Archive::get_elf_object_for_member): New function.
15417 (Archive::read_all_symbols): New function.
15418 (Archive::read_symbols): New function.
15419 (Archive::Archive_member): New class.
15420 (Archive::members_): New member.
15421 (Archive::num_members_): New member.
15422 * main.cc: Include archive.h.
15423 (main): Call Archive::print_stats.
15424 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15425 archive parameter; member_name is now the fully-decorated name.
15426 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15427 * options.h: (General_options): Add --preread-archive-symbols option.
15428 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15429 Archive::setup.
15430
de4c45bd
ILT
154312008-08-04 Ian Lance Taylor <iant@google.com>
15432
15433 * symtab.h (Symbol::use_plt_offset): New function.
15434 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15435 * powerpc.cc (Relocate::relocate): Likewise.
15436 * sparc.cc (Relocate::relocate): Likewise.
15437 * x86_64.cc (Relocate::relocate): Likewise.
15438 * testsuite/weak_plt.sh: New test.
15439 * testsuite/weak_plt_main.cc: New test.
15440 * testsuite/weak_plt_shared.cc: New test.
15441 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15442 (check_PROGRAMS): Add weak_plt.
15443 (check_DATA): Add weak_plt_shared.so.
15444 (weak_plt_main_pic.o, weak_plt): New targets.
15445 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15446 * testsuite/Makefile.in: Rebuild.
15447
15448 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15449 gcctestdir/ld.
15450 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15451 * testsuite/Makefile.in: Rebuild.
15452
323ee3f4
AM
154532008-08-04 Alan Modra <amodra@bigpond.net.au>
15454
15455 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15456 * Makefile.in: Regenerate.
15457 * po/POTFILES.in: Regenerate.
15458
7c07ecec
ILT
154592008-07-29 Ian Lance Taylor <iant@google.com>
15460
15461 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15462 symbols before other symbols.
15463 * testsuite/script_test_2.cc (test_addr): Declare.
15464 (test_addr_alias): Declare.
15465 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15466 values.
7c07ecec
ILT
15467 * testsuite/script_test_2.t: Define test_addr_alias and
15468 test_addr.
15469
5778530e
ILT
154702008-07-24 Ian Lance Taylor <iant@google.com>
15471
2a00e4fb
ILT
15472 PR 5990
15473 * descriptors.cc: New file.
15474 * descriptors.h: New file.
15475 * gold-threads.h (class Hold_optional_lock): New class.
15476 * fileread.cc: Include "descriptors.h".
15477 (File_read::~File_read): Release descriptor rather than closing
15478 it.
15479 (File_read::open) [file]: Call open_descriptor rather than open.
15480 Set is_descriptor_opened_.
15481 (File_read::open) [memory]: Assert that descriptor is not open.
15482 (File_read::reopen_descriptor): New function.
15483 (File_read::release): Release descriptor.
15484 (File_read::do_read): Make non-const. Reopen descriptor.
15485 (File_read::read): Make non-const.
15486 (File_read::make_view): Reopen descriptor.
15487 (File_read::do_readv): Likewise.
15488 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15489 Update declarations.
15490 * layout.cc: Include "descriptors.h".
15491 (Layout::create_build_id): Use open_descriptor rather than open.
15492 * output.cc: Include "descriptors.h".
15493 (Output_file::open): Use open_descriptor rather than open.
15494 * archive.cc (Archive::const_iterator): Change Archive to be
15495 non-const.
15496 (Archive::begin, Archive::end): Make non-const.
15497 (Archive::count_members): Likewise.
15498 * archive.h (class Archive): Update declarations.
15499 * object.h (Object::read): Make non-const.
15500 * Makefile.am (CCFILES): Add descriptors.cc.
15501 (HFILES): Add descriptors.h.
15502 * Makefile.in: Rebuild.
15503
801647d1
ILT
15504 PR 6716
15505 * gold.h: Always include <clocale>. Add Solaris workarounds
15506 following code in binutils/sysdep.h.
15507
5edd166e
ILT
15508 PR 6048
15509 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15510 this->eh_frame_hdr_ is NULL before using it.
15511
c89ad728
ILT
15512 * dynobj.cc (Versions::Versions): Update comment.
15513
aa86f06b
ILT
15514 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15515 the base version name.
15516
5778530e
ILT
15517 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15518 array size plus one.
15519 (Stringpool_template::set_string_offsets): Subtract one from key
15520 before using it as an array index.
15521 (Stringpool_template::get_offset_with_length): Likewise.
15522 (Stringpool_template::write_to_buffer): Likewise.
15523 * stringpool.h (Stringpool_template::get_offset_from_key):
15524 Likewise.
15525
057ead22
ILT
155262008-07-23 Ian Lance Taylor <iant@google.com>
15527
7f649c59
ILT
15528 PR 6658
15529 * object.h (Merged_symbol_value::value): Do our best to handle a
15530 negative addend.
15531
057ead22
ILT
15532 PR 6647
15533 * script.cc (Version_script_info::get_versions): Don't add empty
15534 version tag to return value.
15535 (Version_script_info::get_symbol_version_helper): Change return
15536 type to bool. Add pversion parameter. Change all callers.
15537 (script_register_vers_node): Don't require a non-NULL tag.
15538 * script.h (class Version_script_info): Update declarations.
15539 (Version_script_info::get_symbol_version): Change return type to
15540 bool. Add version parameter. Change all callers.
15541 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15542 handling. Handle an empty version from a version script.
15543 (Symbol_table::define_special_symbol): Likewise.
15544 * testsuite/ver_test_10.script: New file.
15545 * testsuite/ver_test_10.sh: New file.
15546 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15547 (check_DATA): Add ver_test_10.syms.
15548 (ver_test_10.syms, ver_test_10.so): New target.
15549 * testsuite/Makefile.in: Rebuild.
15550
58e54ac2
CD
155512008-07-23 Simon Baldwin <simonb@google.com>
15552
15553 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15554 to zero for undefined symbols from dynamic libraries.
15555
95d14cd3
ILT
155562008-07-23 Ian Lance Taylor <iant@google.com>
15557
15558 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15559 Change all callers.
15560 * symtab.h (class Symbol_table): Update declaration.
15561 * testsuite/ver_test_9.cc: New file.
15562 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15563 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15564 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15565 (ver_test_9.so, ver_test_9.o): New targets.
15566 * testsuite/Makefile.in: Rebuild.
15567
92de84a6
ILT
155682008-07-22 Ian Lance Taylor <iant@google.com>
15569
34810851
ILT
15570 * options.h (class General_options): Define --check-sections.
15571 * layout.cc (Layout::set_segment_offsets): Handle
15572 --check-sections.
15573
af6156ef
ILT
15574 * options.h (class General_options): Define -n/--nmagic and
15575 -N/--omagic.
15576 * options.cc (General_options::finalize): For -n/--nmagic or
15577 -N/--omagic, set -static.
15578 * layout.cc (Layout::attach_allocated_section_to_segment): If
15579 -N/--omagic, don't put read-only and read-write sections in
15580 different segments.
15581 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15582 finding a read-only segment.
15583 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15584 don't set the minimum segment alignment to the common page size,
15585 and don't set the file offset to the address modulo the page size.
15586 * script-sections.cc (Script_sections::create_segments): If
15587 -n/--omagic, don't put read-only and read-write sections in
15588 different segments.
15589
92de84a6
ILT
15590 * cref.cc: New file.
15591 * cref.h: New file.
15592 * options.h (class General_options): Add --print-symbol-counts.
15593 * main.cc (main): Issue defined symbol report if requested.
15594 * archive.cc (Archive::interpret_header): Make into a const member
15595 function.
15596 (Archive::add_symbols): Call Input_objects::archive_start and
15597 archive_stop.
15598 (Archive::const_iterator): Define new class.
15599 (Archive::begin, Archive::end): New functions.
15600 (Archive::include_all_members): Rewrite to use iterator.
15601 (Archive::count_members): New function.
15602 * archive.h (class Archive): Update declarations.
15603 (Archive::filename): New function.
15604 * object.cc: Include "cref.h".
15605 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15606 (Sized_relobj::do_get_global_symbol_counts): New function.
15607 (Input_objects::add_object): Add object to cross-referencer.
15608 (Input_objects::archive_start): New function.
15609 (Input_objects::archive_stop): New function.
15610 (Input_objects::print_symbol_counts): New function.
15611 * object.h: Declare Cref and Archive.
15612 (Object::get_global_symbol_counts): New function.
15613 (Object::do_get_global_symbol_counts): New pure virtual function.
15614 (class Sized_relobj): Add defined_count_ field. Update
15615 declarations.
15616 (class Input_objects): Add cref_ field. Update constructor.
15617 Update declarations.
15618 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15619 defined_count_.
15620 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15621 symbol counts.
15622 (Sized_dynobj::do_get_global_symbol_counts): New function.
15623 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15624 defined_count_. Update declarations. Define Symbols typedef.
15625 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15626 parameter. Change all callers.
15627 (Symbol_table::add_from_dynobj): Add sympointers and defined
15628 parameters. Change all callers.
15629 * symtab.h (class Symbol_table): Update declarations.
15630 * Makefile.am (CCFILES): Add cref.cc.
15631 (HFILES): Add cref.h.
15632 * Makefile.in: Rebuild.
15633
3f7c5e1d
CD
156342008-07-22 Simon Baldwin <simonb@google.com>
15635
15636 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15637 to zero when writing undefined symbols.
15638
e0b64032
ILT
156392008-07-22 Ian Lance Taylor <iant@google.com>
15640
15641 * output.cc (Output_section::add_input_section): Don't try to
15642 merge empty merge sections.
15643
096b02cf
CS
156442008-07-21 Craig Silverstein <csilvers@google.com>
15645
15646 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15647 Include symbol version in error message.
cd536b21 15648
1d1f116d
CD
156492008-07-20 Chris Demetriou <cgd@google.com>
15650
cd536b21 15651 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15652 (RANDOM_SEED_CFLAGS): New substituted variable.
15653 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15654 * configure: Rebuild.
15655 * Makefile.in: Likewise.
15656 * testsuite/Makefile.in: Likewise.
15657
a18f591e
ILT
156582008-07-18 Ian Lance Taylor <iant@google.com>
15659
15660 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15661 where we see NAME/NULL and NAME/VERSION as separate symbols.
15662 * testsuite/ver_test_main.cc (main): Call t4.
15663 (t4, t4_2a): Define.
15664 * testsuite/ver_test_2.cc (t4_2): Define.
15665 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15666 * testsuite/ver_test_4.cc (t4_2a): Define.
15667 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15668 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15669
c6e3f6ed
ILT
156702008-07-17 Ian Lance Taylor <iant@google.com>
15671
15672 * dynobj.cc (Versions::add_def): If we give an error about a
15673 missing version, go ahead and create the version anyhow.
15674
ef9beddf
ILT
156752008-07-10 Ian Lance Taylor <iant@google.com>
15676
15677 Handle output sections with more than 0x7fffffff bytes.
15678 * object.h (class Relobj): Change map_to_output_ to
15679 output_sections_, and just keep a section pointer. Change all
15680 uses. Move comdat group support to Sized_relobj.
15681 (Relobj::is_section_specially_mapped): Remove.
15682 (Relobj::output_section): Remove poff parameter. Change all
15683 callers.
15684 (Relobj::output_section_offset): New function.
15685 (Relobj::set_section_offset): Rewrite.
15686 (Relobj::map_to_output): Remove.
15687 (Relobj::output_sections): New function.
15688 (Relobj::do_output_section_offset): New pure virtual function.
15689 (Relobj::do_set_section_offset): Likewise.
15690 (class Sized_relobj): Add section_offsets_ field. Add comdat
15691 group support from Relobj. Update declarations.
15692 (Sized_relobj::get_output_section_offset): New function.
15693 (Sized_relobj::do_output_section_offset): New function.
15694 (Sized_relobj::do_set_section_offset): New function.
15695 * object.cc (Relobj::output_section_address): Remove.
15696 (Sized_relobj::Sized_relobj): Initialize new fields.
15697 (Sized_relobj::include_section_group): Cast find_kept_object to
15698 Sized_relobj.
15699 (Sized_relobj::include_linkonce_section): Likewise.
15700 (Sized_relobj::do_layout): Use separate arrays for output section
15701 and output offset.
15702 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15703 output_sections.
15704 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15705 output_sections and section_offsets.
15706 (Sized_relobj::write_local_symbols): Likewise.
15707 (map_to_kept_section): Compute output address directly.
15708 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15709 output_sections and section_offsets.
15710 (Sized_relobj::write_sections): Likewise.
15711 (Sized_relobj::relocate_sections): Likewise.
15712 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15713 * output.h (class Output_reloc): Update declarations. Change
15714 u2_.relobj to Sized_relobj*.
15715 (class Output_data_reloc): Change add functions to use
15716 Sized_relobj*.
15717 * output.cc (Output_reloc::Output_reloc): Change relobj to
15718 Sized_relobj*.
15719 (Output_reloc::local_section_offset): Change return type to
15720 Elf_Addr. Use get_output_section_offset.
15721 (Output_reloc::get_address): Likewise.
15722 (Output_section::is_input_address_mapped): Don't call
15723 is_section_specially_mapped.
15724 (Output_section::output_offset): Likewise.
15725 (Output_section::output_address): Likewise.
15726 (Output_section::starting_output_address): Likewise.
15727 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15728 parameter to Sized_relobj*.
15729 (Copy_relocs::need_copy_reloc): Likewise.
15730 (Copy_relocs::save): Likewise.
15731 * copy-relocs.h (class Copy_relocs): Update declarations.
15732 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15733 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15734 * target-reloc.h (relocate_for_relocatable): Change
15735 offset_in_output_section type to Elf_Addr. Change code that uses
15736 it as well.
15737 * layout.cc (Layout::layout): Always set *off.
15738 * mapfile.cc (Mapfile::print_input_section): Use
15739 output_section_offset.
15740 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15741 Sized_relobj*.
15742 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15743 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15744 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15745
5cb66f97
ILT
157462008-07-03 Ian Lance Taylor <iant@google.com>
15747
15748 * layout.cc (Layout::include_section): Do not discard unrecognized
15749 SHT_STRTAB sections.
15750
afe47622
CS
157512008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15752
15753 * script.cc (Lex::can_continue_name): Make '?' allowable in
15754 version-script names.
15755 * testsuite/version_script.map: Change glob pattern to use '?'
15756
5adf9721
ILT
157572008-06-30 Manish Singh <yosh@gimp.org>
15758
15759 PR 6585
15760 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15761 Correct typo.
15762
e6fde208
ILT
157632008-06-30 Ian Lance Taylor <iant@google.com>
15764
15765 PR 6660
15766 PR 6682
15767 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15768 versions]: Don't try to read the value in the contents, since we
15769 don't use it. Use the template endianness when writing.
15770
3f2e6a2d
CC
157712008-06-25 Cary Coutant <ccoutant@google.com>
15772
15773 * fileread.cc (File_read::make_view): Assert on zero-length view.
15774 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15775 symbol table when there are no symbols to read.
15776
c43d3a48
CS
157772008-06-23 Craig Silverstein <csilvers@google.com>
15778
15779 * version.cc (version_string): Bump to 1.7
15780
5f494ea0
CS
157812008-06-18 Craig Silverstein <csilvers@google.com>
15782
15783 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15784 constant 0xFFFF to type Valtype.
15785 (Powerpc_relocate_functions::rel16_ha): Likewise.
15786
c42e122e
ILT
157872008-06-17 Ian Lance Taylor <iant@google.com>
15788
f34787f8
ILT
15789 * output.h (Output_section::Input_section): Initialize p2align_ to
15790 zero for Output_section_data constructors.
15791 (Output_section::Input_section::addralign): If not an input
15792 section, return the alignment of the Output_section_data.
15793 * testsuite/copy_test.cc: New file.
15794 * testsuite/copy_test_1.cc: New file.
15795 * testsuite/copy_test_2.cc: New file.
15796 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15797 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15798 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15799 (copy_test_1_pic.o, copy_test_1.so): New targets.
15800 (copy_test_2_pic.o, copy_test_2.so): New targets.
15801 * testsuite/Makefile.in: Rebuild.
15802
c42e122e
ILT
15803 * script-sections.cc (Script_sections::place_orphan): Initialize
15804 local variable exact.
15805
ce3ac18a
DE
158062008-06-13 David Edelsohn <edelsohn@gnu.org>
15807
15808 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15809
42cacb20
DE
158102008-06-12 David Edelsohn <edelsohn@gnu.org>
15811 David S. Miller <davem@davemloft.net>
15812
15813 * powerpc.cc: New file.
15814 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15815 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15816 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15817 * Makefile.in: Rebuild.
15818
7b308235
ILT
158192008-06-09 Ian Lance Taylor <iant@google.com>
15820
15821 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15822 <exception>.
15823 (throwing, orig_terminate): New static variables.
15824 (terminate_handler): New static function.
15825 (t2): Set terminate handler.
15826
f0b886e3
ILT
158272008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15828
15829 PR 6584
cd536b21 15830 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15831 alignment.
15832
3e90f135
CC
158332008-05-30 Cary Coutant <ccoutant@google.com>
15834
15835 * archive.cc (Archive::include_all_members) Correct to step
15836 over symbol table and extended name table in thin archives.
15837
e09ad04a
ILT
158382008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15839
15840 PR 6407
15841 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15842 calculation.
15843
62b01cb5
ILT
158442008-05-28 Caleb Howe <cshowe@google.com>
15845
15846 * reduced_debug_output.cc: New file.
15847 * reduced_debug_output.h: New file.
92de84a6 15848 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15849 * options.cc (General_options::finalize): Add strip_debug_non_line
15850 to the strip heirarchy.
15851 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15852 fields.
15853 * layout.cc: Include "reduced_debug_output.h".
15854 (Layout::Layout): Initialize new fields.
15855 (line_only_debug_sections): New static array.
15856 (is_lines_only_debug_sections): New static inline function.
15857 (Layout::include_section): Handle --strip-debug-non-line.
15858 (Layout::make_output_section): If --strip-debug-non-line, build
15859 new output sections for .debug_abbrev and .debug_info.
15860 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15861 gold. Warn about possible overflow.
15862 (read_signed_LEB_128): Likewise.
15863 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15864 (read_signed_LEB_128): Declare.
15865 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15866 (HFILES): Add reduced_debug_output.h.
15867 * Makefile.in: Rebuild.
15868
7d9e3d98
ILT
158692008-05-21 Ian Lance Taylor <iant@google.com>
15870
15871 * mapfile.cc: New file.
15872 * mapfile.h: New file.
15873 * options.h (class General_options): Add -M/--print-map and -Map.
15874 * options.cc (General_options::finalize): Make -M equivalent to
15875 -Map -.
15876 * main.cc: Include <cstdio> and "mapfile.h".
15877 (main): Open mapfile if requested.
15878 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15879 constructor. Change caller.
15880 (queue_initial_tasks): Add mapfile parameter. Change caller.
15881 (queue_middle_tasks): Likewise.
15882 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15883 declarations.
15884 * archive.cc: Include "mapfile.h".
15885 (Archive::add_symbols): Add mapfile parameter. Change all
15886 callers. Pass mapfile, symbol, and reason to include_member.
15887 (Archive::include_all_members): Add mapfile parameter. Change all
15888 callers.
15889 (Archive::include_member): Add mapfile, sym, and why parameters.
15890 Change all callers. Report inclusion to map file.
15891 * archive.h: Include "fileread.h".
15892 (class Archive): Update declarations.
15893 (Archive::file): New const method.
15894 (class Add_archive_symbols): Add mapfile_ field. Update
15895 constructor. Change all callers.
15896 * readsyms.h (class Read_symbols): Likewise.
15897 (class Finish_group): Likewise.
15898 (class Read_script): Likewise.
15899 * common.cc: Include "mapfile.h".
15900 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15901 all callers.
15902 (Symbol_table::do_allocate_commons): Likewise.
15903 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15904 symbol allocation to mapfile.
15905 * common.h (class Allocate_commons_task): Add mapfile_ field.
15906 Update constructor. Change all callers.
15907 * symtab.h (class Symbol_table): Update declarations.
15908 * layout.cc: Include "mapfile.h".
15909 (Layout_task_runner::run): Print information to mapfile.
15910 (Layout::create_gold_note): Change Output_data_fixed_space to
15911 Output_data_zero_fill.
15912 (Layout::create_build_id): Likewise.
15913 (Layout::print_to_mapfile): New function.
15914 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15915 constructor. Change caller.
15916 (class Layout): Declare print_to_mapfile.
15917 * output.cc (Output_section::Input_section::print_to_mapfile): New
15918 function.
15919 (Output_section::add_input_section): If producing a map, always
15920 add to input_sections_ list.
15921 (Output_section::do_print_to_mapfile): New function.
15922 (Output_segment::print_sections_to_mapfile): New function.
15923 (Output_segment::print_section_list_to_mapfile): New function.
15924 * output.h: Include "mapfile.h".
15925 (Output_data::print_to_mapfile): New function.
15926 (Output_data::do_print_to_mapfile): New virtual function.
15927 (Output_segment_headers::do_print_to_mapfile): New function.
15928 (Output_file_header::do_print_to_mapfile): New function.
15929 (Output_data_const::do_print_to_mapfile): New function.
15930 (class Output_data_const_buffer): Add map_name_ field. Update
15931 constructor. Change all callers. Add do_print_to_mapfile
15932 function.
15933 (class Output_data_fixed_space): Likewise.
15934 (class Output_data_space): Likewise.
15935 (class Output_data_zero_fill): New class.
15936 (Output_data_strtab::do_print_to_mapfile): New function.
15937 (Output_data_reloc_base::do_print_to_mapfile): New function.
15938 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15939 (Output_data_group::do_print_to_mapfile): New function.
15940 (Output_data_got::do_print_to_mapfile): New function.
15941 (Output_data_dynamic::do_print_to_mapfile): New function.
15942 (Output_symtab_xindex::do_print_to_mapfile): New function.
15943 (class Output_section): Declare do_print_to_mapflie. Declare
15944 print_to_mapfile in Input_section.
15945 (class Output_segment): Declare new functions.
15946 * object.h (Sized_relobj::symbol_count): New function.
15947 * script-sections.cc
15948 (Output_section_element_dot_assignment::set_section_addresses):
15949 Change Output_data_fixed_space to Output_data_zero_fill.
15950 (Output_data_expression::do_print_to_mapfile): New function.
15951 * script.cc (read_input_script): Add mapfile parameter. Change
15952 all callers.
15953 * script.h (read_input_script): Update declaration.
15954 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15955 (Eh_frame::do_print_to_mapfile): New function.
15956 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15957 (Output_merge_string::do_print_to_mapfile): New function.
15958 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15959 function.
15960 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15961 function.
15962 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15963 function.
15964 * Makefile.am (CCFILES): Add mapfile.cc.
15965 (HFILES): Add mapfile.h.
15966 * Makefile.in: Rebuild.
15967
9f1d377b
ILT
159682008-05-19 Ian Lance Taylor <iant@google.com>
15969
15970 * options.h (class General_options): Add -z relro.
15971 * layout.cc (Layout::Layout): Initialize relro_segment_.
15972 (Layout::add_output_section_data): Return the output section.
15973 (Layout::make_output_section): Rcognize relro sections and mark
15974 them appropriately.
15975 (Layout::attach_allocated_section_to_segment): Put relro sections
15976 in a PT_GNU_RELRO segment.
15977 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15978 section as relro.
15979 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15980 PT_TLS segments.
15981 (Layout::linkonce_mapping): Map d.rel.ro.local to
15982 .data.rel.ro.local.
15983 (Layout::output_section_name): Us .data.rel.ro.local for any
15984 section which begins with that.
15985 * layout.h (class Layout): Update add_output_section_data
15986 declaration. Add relro_segment_ field.
15987 * output.cc (Output_section::Output_section): Initialize is_relro_
15988 and is_relro_local_ fields.
15989 (Output_segment::add_output_section): Group relro sections.
15990 (Output_segment::is_first_section_relro): New function.
15991 (Output_segment::maximum_alignment): If there is a relro section,
15992 align the segment to the common page size.
15993 (Output_segment::set_section_addresses): Track whether we are
15994 looking at relro sections. If the last section is a relro
15995 section, align to the common page size.
15996 (Output_segment::set_section_list_addresses): Add in_relro
15997 parameter. Change all callers. Align to the page size when
15998 moving from relro to non-relro section.
15999 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16000 segment.
16001 * output.h (class Output_section): Add is_relro_ and
16002 is_relro_local_ fields.
16003 (Output_section::is_relro): New function.
16004 (Output_section::set_is_relro): New function.
16005 (Output_section::is_relro_local): New function.
16006 (Output_section::set_is_relro_local): New function.
16007 (class Output_segment): Update declarations.
16008 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16009 * sparc.cc (Target_sparc::got_section): Likewise.
16010 * x86_64.cc (Target_x86_64::got_section): Likewise.
16011 * testsuite/relro_test_main.cc: New file.
16012 * testsuite/relro_test.cc: New file.
16013 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16014 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16015 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16016 (relro_test.so, relro_test_pic.o): New targets.
16017 * testsuite/Makefile.in: Rebuild.
16018
a984ee1d
ILT
160192008-05-16 Ian Lance Taylor <iant@google.com>
16020
01676dcd
ILT
16021 * output.cc (Output_segment::add_output_section): Remove front
16022 parameter.
16023 * output.h (class Output_segment): Remove
16024 add_initial_output_section and overloaded add_output_section.
16025 Update declaration of remaining add_output_section.
16026 * layout.cc (Layout::create_interp): Call add_output_section
16027 rather than add_initial_output_section.
16028 (Layout::finish_dynamic_section): Likewise.
16029
497897f9
ILT
16030 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16031 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16032 know the dynamic type.
16033 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16034 field. Initialize it in constructor.
16035 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16036 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16037 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16038 reloc.
16039
a984ee1d
ILT
16040 * output.cc (Output_reloc::get_address): Change return type to
16041 Elf_Addr.
16042 * output.h (class Output_reloc): Update get_address declaration.
16043 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16044 for section addresses.
16045
55ba0940
ILT
160462008-05-09 Ian Lance Taylor <iant@google.com>
16047
16048 PR 6493
16049 * gold.cc (gold_nomem): Use return value of write.
16050
75517b77
ILT
160512008-05-08 Ian Lance Taylor <iant@google.com>
16052
16053 * symtab.c (Symbol::init_base_output_data): Add version
16054 parameter. Change all callers.
16055 (Symbol::init_base_output_segment): Likewise.
16056 (Symbol::init_base_constant): Likewise.
16057 (Symbol::init_base_undefined): Likewise.
16058 (Sized_symbol::init_output_data): Likewise.
16059 (Sized_symbol::init_output_segment): Likewise.
16060 (Sized_symbol::init_constant): Likewise.
16061 (Sized_symbol::init_undefined): Likewise.
16062 (Symbol_table::do_define_in_output_data): If the new symbol has a
16063 version, mark it as the default.
16064 (Symbol_table::do_define_in_output_segment): Likewise.
16065 (Symbol_table::do_define_as_constant): Likewise.
16066 * symtab.h (class Symbol): Update declarations.
16067 (class Sized_symbol): Likewise.
16068 * resolve.cc (Symbol::override_version): New function.
c42e122e 16069 (Symbol::override_base): Call override_version.
75517b77
ILT
16070 (Symbol::override_base_with_special): Likewise.
16071 * testsuite/ver_script_8.script: New file.
16072 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16073 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16074 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16075 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16076
f1f70eae
ILT
160772008-05-06 Ian Lance Taylor <iant@google.com>
16078
f3e9c5c5
ILT
16079 PR 6049
16080 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16081 functions.
16082 (class General_options): Remove existing --undefined, and add
16083 --no-undefined instead. Add new --undefined as synonym for -u.
16084 * archive.cc (Archive::add_symbols): Check whether symbol was
16085 named with -u.
16086 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16087 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16088 all uses. Add IS_UNDEFINED. Update declarations to split
16089 different versions of init_base. Declare init_base_undefined.
16090 (Symbol::is_defined): Handle IS_UNDEFINED.
16091 (Symbol::is_undefined): Likewise.
16092 (Symbol::is_weak_undefined): Call is_undefined.
16093 (Symbol::is_absolute): Handle IS_CONSTANT.
16094 (class Sized_symbol): Update declarations to split different
16095 versions of init. Declare init_undefined.
16096 (class Symbol_table): Declare new functions.
16097 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16098 Change all callers.
16099 (Symbol::init_base_output_data): Likewise.
16100 (Symbol::init_base_output_segment): Likewise.
16101 (Symbol::init_base_constant): Likewise.
16102 (Symbol::init_base_undefined): New function.
16103 (Sized_symbol::init_object): Rename from init. Change all
16104 callers.
16105 (Sized_symbol::init_output_data): Likewise.
16106 (Sized_symbol::init_output_segment): Likewise.
16107 (Sized_symbol::init_constant): Likewise.
16108 (Sized_symbol::init_undefined): New function.
16109 (Symbol_table::add_undefined_symbols_from_command_line): New
16110 function.
16111 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16112 function.
16113 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16114 (Symbol::output_section): Likewise.
16115 (Symbol::set_output_section): Likewise.
16116 (Symbol_table::sized_finalize_symbol): Likewise.
16117 (Symbol_table::sized_write_globals): Likewise.
16118 * resolve.cc (Symbol_table::should_override): Likewise.
16119 (Symbol::override_base_with_special): Likewise.
16120
8bdcdf2c
ILT
16121 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16122 symbol, change it to have default visibility.
16123 * testsuite/protected_1.cc: New file.
16124 * testsuite/protected_2.cc: New file.
16125 * testsuite/protected_3.cc: New file.
16126 * testsuite/protected_main_1.cc: New file.
16127 * testsuite/protected_main_2.cc: New file.
16128 * testsuite/protected_main_3.cc: New file.
16129 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16130 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16131 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16132 (protected_1.so): New target.
16133 (protected_1_pic.o, protected_2_pic.o): New targets.
16134 (protected_3_pic.o): New target.
16135 (check_PROGRAMS): Add protected_2.
16136 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16137 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16138 * testsuite/Makefile.in: Rebuild.
16139
2b706932
ILT
16140 * options.h (DEFINE_var): Add set_user_set_##varname__.
16141 (DEFINE_bool_alias): New macro.
16142 (class General_options): Define -Bstatic using DEFINE_bool_alias
16143 rather than DEFINE_special. Add --undefined as an alias for -z
16144 defs.
16145 * options.cc (General_options::parse_Bstatic): Remove.
16146
d82a5bcc
ILT
16147 * options.h (class General_options): Add --fatal-warnings.
16148 * main.cc (main): Implement --fatal-warnings.
16149 * errors.h (Errors::warning_count): New function.
16150
f1f70eae
ILT
16151 * options.h (class General_options): Add -Bsymbolic-functions.
16152 * symtab.h (Symbol::is_preemptible): Check for
16153 -Bsymbolic-functions.
16154
8825ac63
ILT
161552008-05-05 Ian Lance Taylor <iant@google.com>
16156
d98bc257
ILT
16157 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16158 as noVARNAME rather than no-VARNAME.
16159 (class General_options): Add option -z combreloc.
16160 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16161 get_address.
16162 (Output_reloc::sort_before) [SHT_REL]: New function.
16163 (Output_reloc::sort_before) [SHT_RELA]: New function.
16164 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16165 Sort_relocs_comparison.
16166 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16167 parameter. Change all callers.
16168 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16169 sort_relocs parameter. Change all callers.
16170 * output.cc (Output_reloc::get_address): New function, broken out
16171 of write_rel.
16172 (Output_reloc::write_rel): Call it.
16173 (Output_reloc::compare): New function.
16174 (Output_data_reloc_base::do_write): Optionally sort relocs.
16175
60b2b4e7
ILT
16176 * configure.ac: If targ_extra_obj is set, link it in.
16177 * configure.tgt: Initialize all variables.
16178 (x86_64*): Set targ_extra_obj and targ_extra_size.
16179 * configure: Rebuild.
16180
8825ac63
ILT
16181 * object.cc (Sized_relobj::include_section_group): Adjust section
16182 indexes read from group data. Build vector to pass to
16183 layout_group.
16184 * layout.cc (Layout::layout_group): Add flags and shndxes
16185 parameters. Remove contents parameter. Change caller. Update
16186 explicit instantiations.
16187 * layout.h (class Layout): Update layout_group declaration.
16188 * output.cc (Output_data_group::Output_data_group): Add flags and
16189 input_shndxes parameters. Remove contents parameter. Change
16190 caller.
16191 (Output_data_group::do_write): Change input_sections_ to
16192 input_shndxes_.
16193 * output.h (class Output_data_group): Update constructor
16194 declaration. Rename input_sections_ to input_shndxes_.
16195 * testsuite/many_sections_test.cc: Add template.
16196
e94cf127
CC
161972008-04-30 Cary Coutant <ccoutant@google.com>
16198
4418b2d5
CC
16199 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16200
e94cf127
CC
16201 * layout.cc (Layout::include_section): Refactored check for debug
16202 info section.
16203 (Layout::add_comdat): Add new parameters. Change type
16204 of signature parameter. Add object and shndx to signatures table.
16205 (Layout::find_kept_object): New function.
16206 * layout.h: Include <cstring>.
16207 (Layout::is_debug_info_section): New function.
16208 (Layout::add_comdat): Add new parameters.
16209 (Layout::find_kept_object): New function.
16210 (Layout::Kept_section): New struct.
16211 (Layout::Signatures): Change type of map range.
16212 * object.cc (Relobj::output_section_address): New function.
16213 (Sized_relobj::include_section_group): Add new parameters. Change
16214 calls to Layout::add_comdat. Change to build table of kept comdat
16215 groups and table mapping discarded sections to kept sections.
16216 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16217 (Sized_relobj::do_layout): Change calls to include_section_group and
16218 include_linkonce_section.
16219 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16220 value to zero when section is discarded.
16221 (Sized_relobj::map_to_kept_section): New function.
16222 * object.h (Relobj::output_section_address): New function.
16223 (Relobj::Comdat_group): New type.
16224 (Relobj::find_comdat_group): New function.
16225 (Relobj::Comdat_group_table): New type.
16226 (Relobj::Kept_comdat_section): New type.
16227 (Relobj::Kept_comdat_section_table): New type.
16228 (Relobj::add_comdat_group): New function.
16229 (Relobj::set_kept_comdat_section): New function.
16230 (Relobj::get_kept_comdat_section): New function.
16231 (Relobj::comdat_groups_): New field.
16232 (Relobj::kept_comdat_sections_): New field.
16233 (Symbol_value::input_value): Update comment.
16234 (Sized_relobj::map_to_kept_section) New function.
16235 (Sized_relobj::include_linkonce_section): Add new parameter.
16236 * target-reloc.h (Comdat_behavior): New type.
16237 (get_comdat_behavior): New function.
16238 (relocate_section): Add code to map a discarded section to the
16239 corresponding kept section when applying a relocation.
16240
e4e5049b
CS
162412008-04-30 Craig Silverstein <csilvers@google.com>
16242
16243 * dwarf_reader.cc (next_generation_count): New static var.
16244 (Addr2line_cache_entry): New struct.
16245 (addr2line_cache): New static var.
16246 (Dwarf_line_info::one_addr2line): Added caching.
16247 (Dwarf_line_info::clear_addr2line_cache): New function.
16248 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16249 cache-size parameter.
16250 (Dwarf_line_info::one_addr2line_cache): New function.
16251 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16252 new cache-size argument to one_addr2line(), and clear cache.
16253
d09e9154
CC
162542008-04-28 Cary Coutant <ccoutant@google.com>
16255
16256 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16257 R_386_PC8 relocations.
16258
7ef73768
ILT
162592008-04-23 Ian Lance Taylor <iant@google.com>
16260
55438702
ILT
16261 * object.cc (Sized_relobj::include_section_group): Check for
16262 invalid section group.
16263
c165fb93
ILT
16264 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16265 header size.
16266
7ef73768
ILT
16267 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16268 than read for file header.
16269 * archive.cc (Archive::include_member): Likewise.
16270
6194aaab
L
162712008-04-23 Paolo Bonzini <bonzini@gnu.org>
16272
16273 * aclocal.m4: Regenerate.
16274 * configure: Regenerate.
16275
d491d34e
ILT
162762008-04-19 Ian Lance Taylor <iant@google.com>
16277
5ea2bac6
ILT
16278 * version.cc (version_string): Bump to 1.6.
16279
7bc3e21a
ILT
16280 * testsuite/Makefile.am (many_sections_r_test): New target.
16281 (many_sections_r_test_SOURCES): Remove.
16282 (many_sections_r_test_DEPENDENCIES): Remove.
16283 (many_sections_r_test_LDFLAGS): Remove.
16284 (many_sections_r_test_LDADD): Remove.
16285
7fcd3aa9
ILT
16286 * object.cc (Sized_relobj::do_add_symbols): Always pass
16287 local_symbol_count_ to add_from_relobj.
16288
4c94d6ae
ILT
16289 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16290 every thousand variables.
16291 * testsuite/Makefile.in: Rebuild.
16292
d491d34e
ILT
16293 * object.cc (Xindex::initialize_symtab_xindex): New function.
16294 (Xindex::read_symtab_xindex): New function.
16295 (Xindex::sym_xindex_to_shndx): New function.
16296 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16297 available.
16298 (Sized_relobj::do_initialize_xindex): New function.
16299 (Sized_relobj::do_read_symbols): Adjust section links.
16300 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16301 parameter. Change all callers.
16302 (Sized_relobj::include_section_group): Adjust section links and
16303 symbol section indexes.
16304 (Sized_relobj::do_layout): Adjust section links.
16305 (Sized_relobj::do_count_local_symbols): Adjust section links and
16306 symbol section indexes.
16307 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16308 ordinary and special symbols.
16309 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16310 dynsym_xindex parameters. Change all callers. Adjust section
16311 links. Use SHN_XINDEX when needed.
16312 (Sized_relobj::get_symbol_location_info): Adjust section links.
16313 Don't get fooled by special symbols.
16314 * object.h (class Xindex): Define.
16315 (class Object): Add xindex_ parameter. Declare virtual functoin
16316 do_initialize_xindex.
16317 (Object::adjust_sym_shndx): New function.
16318 (Object::set_xindex): New protected function.
16319 (class Symbol_value): Add is_ordinary_shndx_ field.
16320 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16321 (Symbol_value::value): Assert ordinary section.
16322 (Symbol_value::initialize_input_to_output_map): Likewise.
16323 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16324 Change all callers.
16325 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16326 all callers.
16327 (class Sized_relobj): Update declarations.
16328 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16329 parameter. Change all callers.
16330 (Sized_relobj::adjust_shndx): New function.
16331 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16332 field.
16333 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16334 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16335 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16336 (Sized_dynobj::read_dynsym_section): Adjust section links.
16337 (Sized_dynobj::read_dynamic): Likewise.
16338 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16339 section links.
16340 (Sized_dynobj::do_initialize_xindex): New function.
16341 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16342 do_initialize_xindex.
16343 (Sized_dynobj::adjust_shndx): New function.
16344 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16345 dynsym_xindex_ fields.
16346 (Layout::finalize): Add a call to set_section_indexes before
16347 creating the symtab sections.
16348 (Layout::set_section_indexes): Don't do anything if the section
16349 already has a section index.
16350 (Layout::create_symtab_sections): Add shnum parameter. Change
16351 caller. Create .symtab_shndx section if needed.
16352 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16353 caller.
16354 (Layout::allocated_output_section_count): New function.
16355 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16356 needed.
16357 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16358 fields. Update declarations.
16359 (Layout::symtab_xindex): New function.
16360 (Layout::dynsym_xindex): New function.
16361 (class Write_symbols_task): Add layout_ field.
16362 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16363 Change caller.
16364 * output.cc (Output_section_headers::Output_section_headers): Add
16365 shstrtab_section parameter. Change all callers.
16366 (Output_section_headers::do_sized_write): Store overflow values
16367 for section count and section string table section index in
16368 section header zero.
16369 (Output_file_header::do_sized_write): Check for overflow of
16370 section count and section string table section index.
16371 (Output_symtab_xindex::do_write): New function.
16372 (Output_symtab_xindex::endian_do_write): New function.
16373 * output.h (class Output_section_headers): Add shstrtab_section_.
16374 Update declarations.
16375 (class Output_symtab_xindex): Define.
16376 (Output_section::has_out_shndx): New function.
16377 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16378 field.
16379 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16380 Change all callers.
16381 (Sized_symbol::init): Likewise.
16382 (Symbol::output_section): Check for ordinary symbol.
16383 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16384 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16385 callers.
16386 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16387 Change all callers. Simplify handling of symbols from sections
16388 not included in the link.
16389 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16390 distinction.
16391 (Weak_alias_sorter::operator()): Assert that symbols are
16392 ordinary.
16393 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16394 distinction.
16395 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16396 parameters. Change all callers.
16397 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16398 symbol distinction. Use SHN_XINDEX when needed.
16399 (Symbol_table::write_section_symbol): Add symtab_xindex
16400 parameter. Change all callers.
16401 (Symbol_table::sized_write_section_symbol): Likewise. Use
16402 SHN_XINDEX when needed.
16403 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16404 declarations.
16405 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16406 (Symbol::is_defined): Check is_ordinary.
16407 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16408 (Symbol::is_absolute, Symbol::is_common): Likewise.
16409 (class Sized_symbol): Update declarations.
16410 (class Symbol_table): Update declarations.
16411 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16412 parameters. Change all callers.
16413 (Sized_symbol::override): Likewise.
16414 (Symbol_table::override): Likewise.
16415 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16416 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16417 is_ordinary, and orig_st_shndx parameters. Change all callers.
16418 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16419 to be in an ordinary section.
16420 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16421 object and is_ordinary parameters. Change all callers.
16422 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16423 Change all callers. Don't add undefined or non-ordinary symbols
16424 to reloc_map_.
16425 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16426 Change all callers.
16427 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16428 declarations.
16429 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16430 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16431 (Sized_relobj::relocate_sections): Likewise.
16432 * target-reloc.h (scan_relocs): Adjust section symbol index.
16433 (scan_relocatable_relocs): Likewise.
16434 * i386.cc (Scan::local): Check for ordinary symbols.
16435 * sparc.cc (Scan::local): Likewise.
16436 * x86_64.cc (Scan::local): Likewise.
16437 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16438 to symbol_section_and_value.
16439 * testsuite/many_sections_test.cc: New file.
16440 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16441 (check_PROGRAMS): Add many_sections_test.
16442 (many_sections_test_SOURCES): Define.
16443 (many_sections_test_DEPENDENCIES): Define.
16444 (many_sections_test_LDFLAGS): Define.
16445 (BUILT_SOURCES): Add many_sections_define.h.
16446 (many_sections_define.h): New target.
16447 (BUILT_SOURCES): Add many_sections_check.h.
16448 (many_sections_check.h): New target.
16449 (check_PROGRAMS): Add many_sections_r_test.
16450 (many_sections_r_test_SOURCES): Define.
16451 (many_sections_r_test_DEPENDENCIES): Define.
16452 (many_sections_r_test_LDFLAGS): Define.
16453 (many_sections_r_test_LDADD): Define.
16454 (many_sections_r_test.o): New target.
16455 * testsuite/Makefile.in: Rebuild.
16456
c5818ff1
CC
164572008-04-17 Cary Coutant <ccoutant@google.com>
16458
16459 * errors.cc (Errors::info): New function.
16460 (gold_info): New function.
16461 * errors.h (Errors::info): New function.
16462 * gold.h (gold_info): New function.
16463 * object.cc (Input_objects::add_object): Print trace output.
16464 * options.cc (options::parse_set): New function.
16465 (General_options::parse_wrap): Deleted.
16466 (General_options::General_options): Deleted initializer.
16467 * options.h (options::String_set): New typedef.
16468 (options::parse_set): New function.
16469 (DEFINE_set): New macro.
16470 (General_options::wrap): Changed to use DEFINE_set. Changed
16471 callers of any_wrap_symbols and is_wrap_symbol.
16472 (General_options::trace, General_options::trace_symbol):
16473 New options.
16474 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16475 (General_options::wrap_symbols_): Deleted.
16476 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16477
b5be4a7c
DM
164782008-04-17 David S. Miller <davem@davemloft.net>
16479
16480 * options.cc (General_options::parse_V): New function.
16481 * options.h: Add entries for -V and -Qy.
16482
155a0dd7
ILT
164832008-04-17 Ian Lance Taylor <iant@google.com>
16484
16485 * common.cc (Symbol_table::allocate_commons): Remove options
16486 parameter. Change caller.
16487 (Symbol_table::do_allocate_commons): Remove options parameter.
16488 Change caller. Just call do_allocate_commons_list twice.
16489 (Symbol_table::do_allocate_commons_list): New function, broken out
16490 of do_allocate_commons.
16491 * common.h (class Allocate_commons_task): Remove options_ field.
16492 Update constructor.
16493 * symtab.cc (Symbol_table::Symbol_table): Initialize
16494 tls_commons_.
16495 (Symbol_table::add_from_object): Put TLS common symbols on
16496 tls_commons_ list.
16497 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16498 which are IN_OUTPUT_DATA.
16499 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16500 allocate_commons and do_allocate_commons declarations. Declare
16501 do_allocate_commons_list.
16502 * gold.cc (queue_middle_tasks): Update creation of
16503 Allocate_commons_task to not pass options.
16504 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16505 (TLS_TEST_C_FLAGS): New variable.
16506 (tls_test_c_pic.o): New target.
16507 (tls_test_shared.so): Link in tls_test_c_pic.o.
16508 (tls_test_c_pic_ie.o): New target.
16509 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16510 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16511 (tls_test_c.o): New target.
16512 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16513 (tls_pic_test_LDADD): Likewise.
16514 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16515 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16516 (tls_test_c_gnu2.o): New target.
16517 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16518 tls_test_c_gnu2.o.
16519 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16520 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16521 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16522 * testsuite/tls_test.cc: Include "config.h".
16523 (t_last): Call t11_last.
16524 * testsuite/tls_test.h (t11, t11_last): Declare.
16525 * testsuite/tls_test_c.c: New file.
16526 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16527 * configure.ac: Check for OpenMP support.
16528 * configure, config.in, Makefile.in: Rebuild.
16529 * testsuite/Makefile.in: Rebuild.
16530
edfbb029
CC
165312008-04-16 Cary Coutant <ccoutant@google.com>
16532
16533 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16534 (Target_i386::tls_base_symbol_defined_): New field.
16535 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16536 (Target_i386::Scan::global): Likewise.
16537 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16538 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16539 (Target_x86_64::tls_base_symbol_defined_): New field.
16540 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16541 (Target_x86_64::Scan::global): Likewise.
16542
f3c69fca
CC
165432008-04-16 Cary Coutant <ccoutant@google.com>
16544
16545 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16546 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16547 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16548 building shared libraries.
16549 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16550 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16551 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16552 * testsuite/Makefile.in: Rebuild.
16553 * testsuite/weak_undef.h: New file.
16554 * testsuite/weak_undef_file1.cc: Add extra test cases.
16555 * testsuite/weak_undef_file2.cc: Likewise.
16556 * testsuite/weak_undef_test.cc: Likewise.
16557
7c414435
DM
165582008-04-16 David S. Miller <davem@davemloft.net>
16559
32b769e1
DM
16560 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16561 Add issued_non_pic_error_ field. Declare check_non_pic.
16562 (Target_sparc::Scan::check_non_pic): New function.
16563 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16564 (Target_sparc::Scan::global): Likewise.
16565
11936fb1
DM
16566 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16567 * configure: Rebuild.
16568
7c414435
DM
16569 * options.h (DEFINE_enable): New macro.
16570 (new_dtags): New enable option.
16571 (initfirst, interpose, loadfltr, nodefaultlib,
16572 nodelete, nodlopen, nodump): New -z options.
16573 * layout.cc (Layout:finish_dynamic_section): If new
16574 dtags enabled, emit DT_RUNPATH. Also, emit a
16575 DT_FLAGS_1 containing any specified -z flags.
16576
85c7bf8b
ILT
165772008-04-16 Ian Lance Taylor <iant@google.com>
16578
12c0daef
ILT
16579 * copy-relocs.cc: New file.
16580 * copy-relocs.h: New file.
16581 * reloc.cc: Remove Copy_relocs code.
16582 * reloc.h: Likewise.
16583 * reloc-types.h (struct Reloc_types) [both versions]: Add
16584 get_reloc_addend_noerror.
16585 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16586 variants of add_global which take an addend which must be zero.
16587 * i386.cc: Include "copy-relocs.h".
16588 (class Target_i386): Change type of copy_relocs_ to variable,
16589 update initializer.
16590 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16591 Change all callers.
16592 (Target_i386::do_finalize_sections): Change handling of
16593 copy_relocs_.
16594 * sparc.cc: Include "copy-relocs.h".
16595 (class Target_sparc): Change type of copy_relocs_ to variable,
16596 update initializer.
16597 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16598 Change all callers.
16599 (Target_sparc::do_finalize_sections): Change handling of
16600 copy_relocs_.
16601 * x86_64.cc: Include "copy-relocs.h".
16602 (class Target_x86_64): Change type of copy_relocs_ to variable,
16603 update initializer.
16604 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16605 class. Change all callers.
16606 (Target_x86_64::do_finalize_sections): Change handling of
16607 copy_relocs_.
16608 * Makefile.am (CCFILES): Add copy-relocs.cc.
16609 (HFILES): Add copy-relocs.h.
16610
4f4995b6
ILT
16611 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16612
85c7bf8b
ILT
16613 * testsuite/script_test_4.sh: Permit leading zeroes.
16614
4f2a9edd
ILT
166152008-04-15 Ian Lance Taylor <iant@google.com>
16616
e6188289
ILT
16617 * script-sections.cc (Script_sections::create_segments): Use
16618 header_size_adjustment even when there is enough room for the
16619 headers.
16620 * testsuite/script_test_4.sh: New file.
16621 * testsuite/script_test_4.t: New file.
16622 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16623 (check_DATA): Add script_test_4.stdout.
16624 (MOSTLYCLEANFILES): Likewise.
16625 (script_test_4): New target.
16626 (script_test_4.stdout): New target.
16627 * testsuite/Makefile.in: Rebuild.
16628
4f2a9edd
ILT
16629 * sparc.cc: Add definitions for Output_data_plt_sparc class
16630 constants.
16631
f5314dd5
DM
166322008-04-14 David S. Miller <davem@davemloft.net>
16633
16634 * sparc.cc: New file.
16635 * Makefile.am (TARGETSOURCES): Add sparc.cc
16636 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16637 * configure.tgt: Document targ_extra_size and
16638 targ_extra_big_endian. Add entries for sparc-* and
16639 sparc64-*.
16640 * configure.ac: Handle targ_extra_size and
16641 targ_extra_big_endian.
16642 * Makefile.in: Rebuild.
16643 * configure: Likewise.
16644 * po/POTFILES.in: Likewise.
16645 * po/gold.pot: Likewise.
16646
154e0e9a
ILT
166472008-04-14 Ian Lance Taylor <iant@google.com>
16648
16649 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16650 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16651 in the name/type/flags to section mapping. Don't call
16652 allocate_output_section.
16653 (Layout::choose_output_section): Change parameter from adjust_name
16654 to is_input_section. Don't permit input sections after sections
16655 are attached to segments. Don't call allocate_output_section.
16656 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16657 not write_enable_output_section.
16658 (Layout::make_output_section): Don't push to
16659 unattached_section_list_ nor call attach_to_segment. Call
16660 attach_section_to_segment if sections are attached.
16661 (Layout::attach_sections_to_segments): New function.
16662 (Layout::attach_section_to_segment): New function.
16663 (Layout::attach_allocated_section_to_segment): Rename from
16664 attach_to_segment. Remove flags parameter.
16665 (Layout::allocate_output_section): Remove function.
16666 (Layout::write_enable_output_section): Remove function.
16667 * layout.h (class Layout): Update for above changes. Add new
16668 field sections_are_attached_.
16669 * output.h (Output_section::update_flags_for_input_section): New
16670 function.
16671 * output.cc (Output_section::add_input_section): Call
16672 update_flags_for_input_section.
16673 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16674
009a67a2
CC
166752008-04-11 Cary Coutant <ccoutant@google.com>
16676
16677 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16678 thought unnecessary.
16679 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16680
759b1a24
ILT
166812008-04-11 Ian Lance Taylor <iant@google.com>
16682
16683 * output.h (class Output_section_data): Remove inline definition
16684 of set_addralign.
16685 * output.cc (Output_section_data::set_addralign): New function.
16686
c2b45e22
CC
166872008-04-11 Cary Coutant <ccoutant@google.com>
16688
16689 Add support for TLS descriptors for i386 and x86_64.
16690 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16691 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16692 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16693 GOT_TYPE_TLS_DESC.
16694 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16695 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16696 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16697 relocations.
16698 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16699 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16700 Fix problem with initial-exec relocations.
16701 (Target_i386::Relocate::relocate_tls): Likewise.
16702 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16703 relaxation.
16704 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16705 support for section-plus-offset dynamic table entries.
16706 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16707 (Output_data_dynamic::Dynamic_entry): Add support for
16708 section-plus-offset dynamic table entries.
16709 (Output_data_dynamic::Classification): Likewise.
16710 (Output_data_dynamic::classification_): Renamed offset_.
16711 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16712 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16713 (Target_x86_64::make_plt_section): New function.
16714 (Target_x86_64::reserve_tlsdesc_entries): New function.
16715 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16716 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16717 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16718 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16719 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16720 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16721 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16722 add extra PLT entry for TLS descriptors.
16723 (Output_data_plt_x86_64::got_): New field.
16724 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16725 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16726 fields.
16727 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16728 descriptors.
16729 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16730 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16731 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16732 R_386_TLS_DESC_CALL relocations.
16733 (Target_x86_64::Scan::global): Likewise.
16734 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16735 for TLS descriptors.
16736 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16737 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16738 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16739 GD-to-IE relaxation.
16740 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16741 and TLS_DESCRIPTORS.
16742 * Makefile.in: Rebuild.
16743 * configure: Rebuild.
16744 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16745 (tls_test_shared2.so): New target.
16746 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16747 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16748 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16749 (tls_shared_gd_to_ie_test_LDADD): New variable.
16750 (tls_shared_gnu2_gd_to_ie_test): New target.
16751 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16752 New targets.
16753 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16754 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16755 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16756 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16757 (tls_shared_gnu2_test): New target.
16758 (tls_test_gnu2_shared.so): New target.
16759 (tls_shared_gnu2_test_SOURCES): New variable.
16760 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16761 (tls_shared_gnu2_test_LDFLAGS): New variable.
16762 (tls_shared_gnu2_test_LDADD): New variable.
16763 * testsuite/Makefile.in: Rebuild.
16764 * testsuite/Makefile.
16765
83bfb6b7
ILT
167662008-04-11 Ian Lance Taylor <iant@google.com>
16767
16768 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16769 justsyms.t.
16770 * testsuite/Makefile.in: Rebuild.
16771
16772 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16773 long.
16774 * testsuite/script_test_2.cc (main): Adjust test.
16775
706e1f5e
ILT
167762008-04-11 David S. Miller <davem@davemloft.net>
16777 Ian Lance Taylor <iant@google.com>
16778
16779 * options.h (General_options): Add entries for '-Y' and
16780 '-relax'.
16781 * options.cc (General_options:finalize): If -Y was used, add those
16782 entries to the library path instead of the default "/lib" and
16783 "/usr/lib".
16784
7c98e6bb
DM
167852008-04-11 David S. Miller <davem@davemloft.net>
16786
16787 * testsuite/justsyms.t: Start at 0x100.
16788 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16789 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16790 long.
16791 * testsuite/script_test_2.cc: Adjust string and section length
16792 checks.
7c98e6bb 16793
99a37bfd
ILT
167942008-04-09 Ian Lance Taylor <iant@google.com>
16795
2cefc357
ILT
16796 PR gold/5996
16797 * script-sections.cc (Sections_element::allocate_to_segment): Add
16798 orphan parameter.
16799 (Output_section_definition::allocate_to_segment): Likewise.
16800 (Orphan_output_section::allocate_to_segment): Likewise.
16801 (Script_sections::attach_sections_using_phdrs_clause): Don't
16802 propagate non-PT_LOAD segments to orphan sections.
16803 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16804 readelf rather than objdump.
16805 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16806 .interp section and PT_INTERP segment are the same size.
16807 * testsuite/Makefile.in: Rebuild.
16808
99a37bfd
ILT
16809 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16810 aliases for symbols defined in the same object.
16811 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16812 (weak_alias_test_SOURCES): New variable.
16813 (weak_alias_test_DEPENDENCIES): New variable.
16814 (weak_alias_test_LDFLAGS): New variable.
16815 (weak_alias_test_LDADD): New variable.
16816 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16817 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16818 (weak_alias_test_3.o): New target.
16819 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16820 * testsuite/weak_alias_test_main.cc: New file.
16821 * testsuite/weak_alias_test_1.cc: New file.
16822 * testsuite/weak_alias_test_2.cc: New file.
16823 * testsuite/weak_alias_test_3.cc: New file.
16824
780e49c5
ILT
168252008-04-08 Ian Lance Taylor <iant@google.com>
16826
cdb0b8f5
ILT
16827 * options.h (class General_options): Add --noinhibit-exec option.
16828 * main.cc (main): Check --noinhibit-exec.
16829
0864d551
ILT
16830 * options.h (class General_options): Define --wrap as a special
16831 option. Add wrap_symbols_ field.
16832 (General_options::any_wrap_symbols): New function.
16833 (General_options::is_wrap_symbol): New function.
16834 * options.cc (General_options::parse_wrap): New function.
16835 (General_options::General_options): Initialize wrap_symbols_.
16836 * symtab.cc (Symbol_table::wrap_symbol): New function.
16837 (Symbol_table::add_from_object): Handle --wrap.
16838 * symtab.h (class Symbol_table): Declare wrap_symbol.
16839 * target.h (Target::wrap_char): New function.
16840 (Target::Target_info): Add wrap_char field.
16841 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16842 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16843 * testsuite/testfile.cc (Target_test::test_target_info):
16844 Likewise.
16845
789aa6de
ILT
16846 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16847 there is one.
16848
2c38906f
ILT
16849 * layout.h (class Layout): Add added_eh_frame_data_ field.
16850 * layout.cc (Layout::Layout): Initialize new field.
16851 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16852 output section until we find a section we merged successfully.
16853 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16854 that the size be non-zero.
16855
780e49c5
ILT
16856 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16857 qualifier.
16858
7fcd0256
ILT
168592008-04-08 Craig Silverstein <csilvers@google.com>
16860
16861 * configure.ac: Export new conditional variable HAVE_ZLIB.
16862 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16863 on HAVE_ZLIB.
16864 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16865 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16866
6835af53
ILT
168672008-04-07 Ian Lance Taylor <iant@google.com>
16868
e24f324c
ILT
16869 * version.cc (version_string): Set to "1.5".
16870
a036edd8
ILT
16871 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16872 Add issued_non_pic_error_ field. Declare check_non_pic.
16873 (Target_x86_64::Scan::check_non_pic): New function.
16874 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16875 (Target_x86_64::Scan::global): Likewise.
16876
624f8810
ILT
16877 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16878 addend parameter. Change caller. Handle merge sections.
16879 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16880 Address to Addend. Don't add in the result of
16881 local_section_offset, pass down the addend and use the returned
16882 value.
16883 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16884 Update declarations of local_section_offset and symbol_value.
16885 * testsuite/two_file_test_1.cc (t18): New function.
16886 * testsuite/two_file_test_2.cc (f18): New function.
16887 * testsuite/two_file_test_main.cc (main): Call t18.
16888 * testsuite/two_file_test.h (t18, f18): Declare.
16889
6835af53
ILT
16890 * configure.ac: Don't test for objdump, c++filt, or readelf.
16891 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16892 conditionals.
16893 (TEST_READELF): New variable.
16894 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16895 (check_PROGRAMS): Add two_file_strip_test.
16896 (two_file_strip_test): New target.
16897 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16898 (two_file_same_shared_strip_test_SOURCES): New variable.
16899 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16900 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16901 (two_file_same_shared_strip_test_LDADD): New variable.
16902 (two_file_shared_strip.so): New target.
16903 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16904 (ver_test_5.syms, ver_test_7.syms): Likewise.
16905 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16906 (strip_test_3.stdout): Use TEST_OBJDUMP.
16907 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16908
86925eef
CC
169092008-04-04 Cary Coutant <ccoutant@google.com>
16910
16911 * symtab.h (Symbol::is_weak_undefined): New function.
16912 (Symbol::is_strong_undefined): New function.
16913 (Symbol::is_absolute): New function.
16914 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16915 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16916 absolute symbols.
16917 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16918 (weak_undef_test): New target.
16919 * testsuite/Makefile.in: Rebuild.
16920 * testsuite/weak_undef_file1.cc: New file.
16921 * testsuite/weak_undef_file2.cc: New file.
16922 * testsuite/weak_undef_test.cc: New file.
16923
126f3ece
ILT
169242008-04-03 Craig Silverstein <csilvers@google.com>
16925
16926 * compressed_output.h (class Output_compressed_section): Use
16927 unsigned buffer.
16928 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16929 add zlib header.
16930 (zlib_compressed_suffix): Removed.
16931 (Output_compressed_section::set_final_data_size): Use unsigned
16932 buffers.
16933 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16934 Fix linker invocation.
16935 (flagstest_o_specialfile_and_compress_debug_sections):
16936 Likewise.
16937 * testsuite/Makefile.in: Regenerated.
16938
deae2a14
DM
169392008-04-02 David S. Miller <davem@davemloft.net>
16940
16941 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16942 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16943
70752818
ILT
169442008-04-02 Craig Silverstein <csilvers@google.com>
16945
16946 * TODO: New file.
16947
39d0cb0e
ILT
169482008-04-02 Ian Lance Taylor <iant@google.com>
16949
16950 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16951 parameters. Update for new key type to views_. Change all
16952 callers.
16953 (File_read::read): Adjust for byteshift in returned view.
16954 (File_read::add_view): New function, broken out of
16955 find_and_make_view.
16956 (File_read::make_view): New function, broken out of
16957 find_and_make_view.
16958 (File_read::find_or_make_view): Add offset and aligned
16959 parameters. Rewrite accordingly. Change all callers.
16960 (File_read::get_view): Add offset and aligned parameters. Adjust
16961 for byteshift in return value.
16962 (File_read::get_lasting_view): Likewise.
16963 * fileread.h (class File_read): Update declarations.
16964 (class File_read::View): Add byteshift_ field. Add byteshift to
16965 constructor. Add byteshift method.
16966 * archive.h (Archive::clear_uncached_views): New function.
16967 (Archive::get_view): Add aligned parameter. Change all callers.
16968 * object.h (Object::get_view): Add aligned parameter. Change all
16969 callers.
16970 (Object::get_lasting_view): Likewise.
16971
16972 * fileread.cc (File_read::release): Don't call clear_views if
16973 there are multiple objects.
16974 * fileread.h (File_read::clear_uncached_views): New function.
16975 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16976 on the archive.
16977
a1207466
CC
169782008-03-31 Cary Coutant <ccoutant@google.com>
16979
16980 Add thin archive support.
16981 * archive.cc (Archive::armagt): New const.
16982 (Archive::setup): Remove task parameter and calls to unlock.
16983 (Archive::unlock_nested_archives): New function.
16984 (Archive::read_header): Add nested_off parameter. Change
16985 all callers.
16986 (Archive::interpret_header): Likewise.
16987 (Archive::include_all_members): Change to handle thin
16988 archives.
16989 (Archive::include_member): Likewise.
16990 * archive.h (Archive::Archive): Add new parameters and
16991 initializers.
16992 (Archive::armagt): New const.
16993 (Archive::setup): Remove task parameter.
16994 (Archive::unlock_nested_archives): New function.
16995 (Archive::read_header): Add nested_off parameter.
16996 (Archive::interpret_header): Likewise.
16997 (Archive::Nested_archive_table): New typedef.
16998 (Archive::is_thin_archive_): New field.
16999 (Archive::nested_archives_): New field.
17000 (Archive::options_): New field.
17001 (Archive::dirpath_): New field.
17002 (Archive::task_): New field.
17003 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17004 for thin archives. Pass additional parameters to
17005 Archive::Archive. Unlock the archive file after calling
17006 Archive::setup.
cd536b21 17007
479f6503
ILT
170082008-03-29 Ian Lance Taylor <iant@google.com>
17009
686c8caf
ILT
17010 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17011 version symbol to be local.
17012 * testsuite/ver_test_4.sh: New file.
17013 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17014 (check_DATA): Add ver_test_4.syms.
17015 (ver_test_4.syms): New target.
17016 * testsuite/Makefile.in: Rebuild.
17017
ab794b6b
ILT
17018 * output.cc
17019 (Output_section::Input_section_sort_entry::has_priority): New
17020 function.
17021 (Output_section::Input_section_sort_entry::match_file_name): New
17022 function.
17023 (Output_section::Input_section_sort_entry::match_section_name):
17024 Remove.
17025 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17026 Remove.
17027 (Output_section::Input_section_sort_entry::match_section_file):
17028 Remove.
17029 (Output_section::Input_section_sort_compare::operator()): Rewrite
17030 using new Input_section_sort_entry functions. Sort crtbegin and
17031 crtend first. Sort sections with no priority before sections with
17032 a priority.
17033 * testsuite/initpri1.c (d3): Check j != 4.
17034 (cd5): New constructor/destructor function.
17035 (main): Check j != 2.
17036
479f6503
ILT
17037 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17038 new symbol when resolving, don't call set_is_default.
17039 * testsuite/ver_test_7.cc: New file.
17040 * testsuite/ver_test_7.sh: New file.
17041 * testsuite/Makefile.am (ver_test_7.so): New target.
17042 (ver_test_7.o): New target.
17043 (check_SCRIPTS): Add ver_test_7.sh.
17044 (check_DATA): Add ver_test_7.syms.
17045 (ver_test_7.syms): New target.
17046
2fd32231
ILT
170472008-03-28 Ian Lance Taylor <iant@google.com>
17048
17049 * layout.cc (Layout::layout): If we see an input section with a
17050 name that needs sorting, set the must_sort flag for the output
17051 section.
17052 (Layout::make_output_section): If the name of the output section
17053 indicates that it might require sorting, set the may_sort flag.
17054 * output.h (Output_section::may_sort_attached_input_sections): New
17055 function.
17056 (Output_section::set_may_sort_attached_input_sections): New
17057 function.
17058 (Output_section::must_sort_attached_input_sections): New
17059 function.
17060 (Output_section::set_must_sort_attached_input_sections): New
17061 function.
17062 (class Output_section): Declare Input_section_sort_entry. Define
17063 Input_section_sort_compare. Declare
17064 sort_attached_input_sections. Add new fields:
17065 may_sort_attached_input_sections_,
17066 must_sort_attached_input_sections_,
17067 attached_input_sections_are_sorted_.
17068 * output.cc (Output_section::Output_section): Initialize new
17069 fields.
17070 (Output_section::add_input_section): Add an entry to
17071 input_sections_ if may_sort or must_sort are true.
17072 (Output_section::set_final_data_size): Call
17073 sort_attached_input_sections if necessary.
17074 (Output_section::Input_section_sort_entry): Define new class.
17075 (Output_section::Input_section_sort_compare::operator()): New
17076 function.
17077 (Output_section::sort_attached_input_sections): New function.
17078 * configure.ac: Check whether the compiler supports constructor
17079 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17080 * testsuite/initpri1.c: New file.
17081 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17082 CONSTRUCTOR_PRIORITY.
17083 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17084 (initpri1_LDFLAGS): New variable.
17085 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17086
18e6b24e
ILT
170872008-03-27 Ian Lance Taylor <iant@google.com>
17088
49bdd526
ILT
17089 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17090 * testsuite/common_test_1.c: New file.
17091 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17092 (common_test_1_SOURCES): New variable.
17093 (common_test_1_DEPENDENCIES): New variable.
17094 (common_test_1_LDFLAGS): New variable.
17095
18e6b24e
ILT
17096 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17097 and commons_ correctly when NAME/VERSION does not override
17098 NAME/NULL.
17099 * testsuite/ver_test_6.c: New file.
17100 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17101 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17102 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17103
04bf7072
ILT
171042008-03-26 Ian Lance Taylor <iant@google.com>
17105
5871526f
ILT
17106 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17107 of an undefined symbol from a version script.
17108 * testsuite/Makefile.am (ver_test_5.so): New target.
17109 (ver_test_5.o): New target.
17110 (check_SCRIPTS): Add ver_test_5.sh.
17111 (check_DATA): Add ver_test_5.syms.
17112 (ver_test_5.syms): New target.
17113 * testsuite/ver_test_5.cc: New file.
17114 * testsuite/ver_test_5.script: New file.
17115 * testsuite/ver_test_5.sh: New file.
17116 * Makefile.in, testsuite/Makefile.in: Rebuild.
17117
04bf7072
ILT
17118 PR gold/5986
17119 Fix problems building gold with gcc 4.3.0.
17120 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17121 (gold_error_at_location, gold_warning_at_location): Use it.
17122 * configure.ac: Check whether we can compile and use a template
17123 function with a printf attribute.
17124 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17125 when jumping over bytes.
17126 * object.cc: Instantiate Object::read_section_data.
17127 * debug.h: Include <cstring>
17128 * dwarf_reader.cc: Include <algorithm>
17129 * main.cc: Include <cstring>.
17130 * options.cc: Include <cstring>.
17131 * output.cc: Include <cstring>.
17132 * script.cc: Include <cstring>.
17133 * script.h: Include <string>.
17134 * symtab.cc: Include <cstring> and <algorithm>.
17135 * target-select.cc: Include <cstring>.
17136 * version.cc: Include <string>.
17137 * testsuite/testmain.cc: Include <cstdlib>.
17138 * configure, config.in: Rebuild.
17139
874c5b28
ILT
171402008-03-25 Ian Lance Taylor <iant@google.com>
17141
819d6c3a
ILT
17142 * options.cc: Include "../bfd/bfdver.h".
17143 (options::help): Print bug reporting address.
17144
f4b2c6f5
ILT
17145 * version.cc (print_version): Adjust output for current value of
17146 BFD_VERSION_STRING.
17147
17148 * NEWS: New file.
17149
e96caa79
ILT
17150 * options.cc (options::help): Print list of supported targets.
17151 * target-select.h: Include <vector>.
17152 (class Target_selector): Make machine_, size_, and is_big_endian_
17153 fields const. Add bfd_name_ and instantiated_target_ fields.
17154 (Target_selector::Target_selector): Add bfd_name parameter.
17155 (Target_selector::recognize): Make non-virtual, call
17156 do_recognize.
17157 (Target_selector::recognize_by_name): Make non-virtual, call
17158 do_recognize_by_name.
17159 (Target_selector::supported_names): New function.
17160 (Target_selector::bfd_name): New function.
17161 (Target_selector::do_instantiate_target): New pure virtual
17162 function.
17163 (Target_selector::do_recognize): New virtual function.
17164 (Target_selector::do_recognize_by_name): New virtual function.
17165 (Target_selector::instantiate_target): New private function.
17166 (supported_target_names): Declare.
17167 * target-select.cc (Target_selector::Target_selector): Update for
17168 new parameter and fields.
17169 (select_target_by_name): Check that the name matches before
17170 calling recognize_by_name.
17171 (supported_target_names): New function.
17172 * i386.cc (class Target_selector_i386): Update Target_selector
17173 constructor call. Remove recognize and recognize_by_name. Add
17174 do_instantiate_target.
17175 * x86_64.cc (class Target_selector_x86_64): Likewise.
17176 * testsuite/testfile.cc (class Target_selector_test): Update for
17177 changes to Target_selector.
17178
874c5b28
ILT
17179 * README: Rewrite, with some notes on unsupported features.
17180
0a65a3a7
CC
171812008-03-24 Cary Coutant <ccoutant@google.com>
17182
17183 * i386.cc (Target_i386::Got_type): New enum declaration.
17184 (Target_i386::Scan::local): Updated callers of Output_data_got
17185 member functions.
17186 (Target_i386::Scan::global): Likewise.
17187 (Target_i386::Relocate::relocate): Likewise.
17188 (Target_i386::Relocate::relocate_tls): Likewise.
17189 * object.h (Got_offset_list): New class.
17190 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17191 (Sized_relobj::local_got_offset): Likewise.
17192 (Sized_relobj::set_local_got_offset): Likewise.
17193 (Sized_relobj::local_has_tls_got_offset): Removed.
17194 (Sized_relobj::local_tls_got_offset): Removed.
17195 (Sized_relobj::set_local_tls_got_offset): Removed.
17196 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17197 * output.cc (Output_data_got::add_global): Added got_type parameter.
17198 (Output_data_got::add_global_with_rel): Likewise.
17199 (Output_data_got::add_global_with_rela): Likewise.
17200 (Output_data_got::add_global_pair_with_rel): New function.
17201 (Output_data_got::add_global_pair_with_rela): New function.
17202 (Output_data_got::add_local): Added got_type parameter.
17203 (Output_data_got::add_local_with_rel): Likewise.
17204 (Output_data_got::add_local_with_rela): Likewise.
17205 (Output_data_got::add_local_pair_with_rel): New function.
17206 (Output_data_got::add_local_pair_with_rela): New function.
17207 (Output_data_got::add_global_tls): Removed.
17208 (Output_data_got::add_global_tls_with_rel): Removed.
17209 (Output_data_got::add_global_tls_with_rela): Removed.
17210 (Output_data_got::add_local_tls): Removed.
17211 (Output_data_got::add_local_tls_with_rel): Removed.
17212 (Output_data_got::add_local_tls_with_rela): Removed.
17213 * output.h (Output_data_got::add_global): Added got_type parameter.
17214 (Output_data_got::add_global_with_rel): Likewise.
17215 (Output_data_got::add_global_with_rela): Likewise.
17216 (Output_data_got::add_global_pair_with_rel): New function.
17217 (Output_data_got::add_global_pair_with_rela): New function.
17218 (Output_data_got::add_local): Added got_type parameter.
17219 (Output_data_got::add_local_with_rel): Likewise.
17220 (Output_data_got::add_local_with_rela): Likewise.
17221 (Output_data_got::add_local_pair_with_rel): New function.
17222 (Output_data_got::add_local_pair_with_rela): New function.
17223 (Output_data_got::add_global_tls): Removed.
17224 (Output_data_got::add_global_tls_with_rel): Removed.
17225 (Output_data_got::add_global_tls_with_rela): Removed.
17226 (Output_data_got::add_local_tls): Removed.
17227 (Output_data_got::add_local_tls_with_rel): Removed.
17228 (Output_data_got::add_local_tls_with_rela): Removed.
17229 * resolve.cc (Symbol::override_base_with_special): Removed
17230 reference to has_got_offset_ field.
17231 * symtab.cc (Symbol::init_fields): Replaced initialization
17232 of got_offset_ with got_offsets_. Removed initialization
17233 of has_got_offset_
53fcba31 17234 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17235 (Symbol::got_offset): Likewise.
17236 (Symbol::set_got_offset): Likewise.
17237 (Symbol::has_tls_got_offset): Removed.
17238 (Symbol::tls_got_offset): Removed.
17239 (Symbol::set_tls_got_offset): Removed.
17240 (Symbol::got_offset_): Removed.
17241 (Symbol::tls_mod_got_offset_): Removed.
17242 (Symbol::tls_pair_got_offset_): Removed.
17243 (Symbol::got_offsets_): New field.
17244 (Symbol::has_got_offset): Removed.
17245 (Symbol::has_tls_mod_got_offset): Removed.
17246 (Symbol::has_tls_pair_got_offset): Removed.
17247 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17248 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17249 member functions.
17250 (Target_x86_64::Scan::global): Likewise.
17251 (Target_x86_64::Relocate::relocate): Likewise.
17252 (Target_x86_64::Relocate::relocate_tls): Likewise.
17253
bd52eafb
BE
172542008-03-25 Ben Elliston <bje@au.ibm.com>
17255
17256 * yyscript.y: Fix spelling error in comment.
17257
8b105e34
ILT
172582008-03-24 Ian Lance Taylor <iant@google.com>
17259
8ed814a9
ILT
17260 * options.h (class General_options): Define build_id option.
17261 * layout.h (class Layout): Declare write_build_id, create_note,
17262 create_build_id. Add build_id_note_ member.
17263 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17264 "libiberty.h", "md5.h", "sha1.h".
17265 (Layout::Layout): Initialize eh_frame_data_,
17266 eh_frame_hdr_section_, and build_id_note_.
17267 (Layout::finalize): Call create_build_id.
17268 (Layout::create_note): New function, broken out of
17269 Layout::create_gold_note.
17270 (Layout::create_gold_note): Call create_note.
17271 (Layout::create_build_id): New function.
17272 (Layout::write_build_id): New function.
17273 (Close_task_runner::run): Call write_build_id.
17274
8b105e34
ILT
17275 * x86_64.cc: Correct license to GPLv3.
17276
086a1841
ILT
172772008-03-23 Ian Lance Taylor <iant@google.com>
17278
17279 * options.cc: Include "demangle.h".
17280 (parse_optional_string): New function.
17281 (parse_long_option): Handle takes_optional_argument.
17282 (parse_short_option): Update dash_z initializer. Handle
17283 takes_optional_argument.
17284 (General_options::General_options): Initialize do_demangle_.
17285 (General_options::finalize): Set do_demangle_. Handle demangling
17286 style.
17287 * options.h (parse_optional_string): Declare.
17288 (struct One_option): Add optional_arg field. Update constructor.
17289 Update call constructor calls. Add takes_optional_argument
17290 function.
17291 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17292 (DEFINE_optional_string): Define.
17293 (General_options::demangle): Change from DEFINE_bool to
17294 DEFINE_optional_string.
17295 (General_options::no_demangle): New function.
17296 (General_options::do_demangle): New function.
17297 (General_options::set_do_demangle): New function.
17298 (General_options::execstack_status_): Move definition to end of
17299 class definition.
17300 (General_options::static_): Likewise.
17301 (General_options::do_demangle_): New field.
17302 * object.cc (big_endian>::get_symbol_location_info): Call
17303 Options::do_demangle, not Options::demangle.
17304 * symtab.cc (demangle): Likewise.
17305
cbb93e63
ILT
173062008-03-22 Ian Lance Taylor <iant@google.com>
17307
17308 * gold.h: Include <cstddef> and <sys/types.h>
17309 * options.h: Include <cstring>.
17310
ec531623
ILT
173112008-03-21 Ian Lance Taylor <iant@google.com>
17312
17313 * Added source code to GNU binutils.
752937aa 17314\f
b90efa5b 17315Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17316
17317Copying and distribution of this file, with or without modification,
17318are permitted in any medium without royalty provided the copyright
17319notice and this notice are preserved.
17320
17321Local Variables:
17322mode: change-log
17323left-margin: 8
17324fill-column: 74
17325version-control: never
17326End:
This page took 1.185149 seconds and 4 git commands to generate.