Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f9d3ecaa
NC
12015-04-29 Nick Clifton <nickc@redhat.com>
2
3 * po/fi.po: Updated Finnish translation.
4
faa2211d
AM
52015-04-28 Alan Modra <amodra@gmail.com>
6
7 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
8 than unsigned int for find_global_entry result temp. Compare
9 against invalid_address.
10 (Target_powerpc::do_plt_address_for_global): Likewise.
11 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
12 on plt call stub existence for debug info. Do assert for plt
13 and global entry stub existence if an alloc section.
14
6ec65f28
AM
152015-04-28 Alan Modra <amodra@gmail.com>
16
17 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
18 on missing global entry stub due to bogus debug info.
19
7a2a1c79
HS
202015-04-27 Han Shen <shenhan@google.com>
21
22 * options.h (--fix-cortex-a53-843419): Rename option.
23 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
24 option.
25 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
26
cfbf0e3c
RÁE
272015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
28
29 PR gold/18327
30 * output.cc (Output_section::is_input_address_mapped): Assume a missing
31 entry is mapped.
32 * testsuite/Makefile.am: Add the eh_test test.
33 * testsuite/Makefile.in: Regenerate.
34 * testsuite/eh_test_a.cc: New test.
35 * testsuite/eh_test_b.cc: New test.
36
6ec65f28
AM
372015-04-23 Sriraman Tallam <tmsriram@google.com>
38
a100d66f
ST
39 * options.h (--weak-unresolved-symbols): New option.
40 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
41 binding to weak with new option.
42 * symtab.h (is_weak_undefined): Check for new option.
43 (is_strong_undefined): Check for new option.
44 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
45 * testsuite/Makefile.in: Regenerate.
46 * testsuite/weak_unresolved_symbols_test.cc: New file.
47
4b889c30
IC
482015-04-20 Ian Coolidge <icoolidge@google.com>
49
50 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
51 GNU_UNIQUE.
52
4277535c
RÁE
532015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
54
55 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
56 push_back.
57 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
58 * object.cc (Sized_relobj_file::do_layout): Use push_back.
59 * powerpc.cc (process_gc_mark): Use push_back.
60 (Target_powerpc::do_gc_mark_symbol): Use push_back.
61 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
62
7a2a1c79 632015-04-16 Han Shen <shenhan@google.com>
5019d64a 64
6ec65f28
AM
65 * aarch64.cc (AArch64_insn_utilities): New utility class.
66 (AArch64_relobj::Mapping_symbol_position): New struct.
67 (AArch64_relobj::Mapping_symbol_info): New typedef.
68 (AArch64_relobj::do_count_local_symbols): New function overriding
69 parent's implementation.
70 (AArch64_relobj::mapping_symbol_info_): New member
71 (AArch64_relobj::scan_erratum_843419): New method.
72 (Target_aarch64::scan_erratum_843419_span): New method.
73 (Target_aarch64::is_erratum_843419_sequence): New method.
74 * options.h (fix_cortex_a53): New option.
5019d64a 75
a6a17750
CC
762015-04-09 Cary Coutant <ccoutant@google.com>
77
78 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
79 in a PIE link.
80 * testsuite/Makefile.am (tls_pie_test.sh): New test.
81 * testsuite/Makefile.in: Regenerate.
82 * testsuite/tls_pie_test.sh: New.
83
437ddf0c
CC
842015-04-09 Cary Coutant <ccoutant@google.com>
85
86 * debug.h (DEBUG_LOCATION): New.
87 (DEBUG_ALL): Include DEBUG_LOCATION.
88 (debug_string_to_enum): Add DEBUG_LOCATION.
89 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
90 output to print correct context.
91 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
92 up to 4 more locations at the beginning of the function.
93 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
94 result before sorting list of line numbers.
95 * testsuite/debug_msg.sh: Allow range of line numbers for
96 canonical results on optimized code.
97
24491327
HS
982015-04-07 HC Yen <hc.yen@mediatek.com>
99
100 Add AArch32 support for gold linker.
101 gold/
102 * arm.cc: Add V8 arch combine table.
103
7fa5525f
RÁE
1042015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
105
106 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
107
5368dcf2
RÁE
1082015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
109
110 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
111 to find by using the return value of insert.
112
9dbb4b02
RÁE
1132015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
114
115 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
116 constructor call.
117
1fa29f10
IT
1182015-04-06 Ilya Tocar <ilya.tocar@intel.com>
119
120 PR gold/17641
121 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
122 (Target_x86_64::Scan::local): Don't create GOT entry, when we
123 can convert mov to lea.
124 (Target_x86_64::Scan::global): Ditto.
125 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
126 %reg to lea foo(%rip), %reg if possible.
127 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
128 * testsuite/x86_64_mov_to_lea1.s: New.
129 * testsuite/x86_64_mov_to_lea2.s: Ditto.
130 * testsuite/x86_64_mov_to_lea3.s: Ditto.
131 * testsuite/x86_64_mov_to_lea4.s: Ditto.
132 * testsuite/x86_64_mov_to_lea.sh: Ditto.
133
39f3de7c
L
1342015-04-02 H.J. Lu <hongjiu.lu@intel.com>
135
136 * configure: Regenerated.
137
c4fc4724
IT
1382015-04-01 Ilya Tocar <ilya.tocar@intel.com>
139
140 PR gold/17640
141 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
142 (Target_i386::Scan::local): Don't create GOT entry, when we
143 can convert GOT to GOTOFF.
144 (Target_i386::Scan::global): Ditto.
145 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
146 lea foo@GOTOFF(%reg), %reg if possible.
147 * testsuite/Makefile.am (i386_mov_to_lea): New test.
148 * testsuite/i386_mov_to_lea1.s: New.
149 * testsuite/i386_mov_to_lea2.s: Ditto.
150 * testsuite/i386_mov_to_lea3.s: Ditto.
151 * testsuite/i386_mov_to_lea4.s: Ditto.
152 * testsuite/i386_mov_to_lea5.s: Ditto.
153 * testsuite/i386_mov_to_lea.sh: Ditto.
154
918357b9
L
1552015-04-01 H.J. Lu <hongjiu.lu@intel.com>
156
157 * Makefile.am (ZLIB): New.
158 (ZLIBINC): Likewise.
159 (AM_CFLAGS): Add $(ZLIBINC).
160 (AM_CXXFLAGS): Likewise.
161 (ldadd_varldadd_var): Add $(ZLIB).
162 (incremental_dump_LDADD): Likewise.
163 (dwp_LDADD): Likewise.
164 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
165 <zlib.h>.
166 (zlib_compress): Don't check HAVE_ZLIB_H.
167 (zlib_decompress): Likewise.
168 * options.h (compress_debug_sections): Likewise.
169 * configure.ac (AM_CONDITIONAL): Removed.
170 * testsuite/Makefile.am (ZLIB): New.
171 (LDADD): Add $(ZLIB).
172 Don't check HAVE_ZLIB.
173 * Makefile.in: Regenerated.
174 * config.in: Likewise.
175 * configure: Likewise.
176 * testsuite/Makefile.in: Likewise.
177
6b0ad2eb
JY
1782015-03-30 Jing Yu <jingyu@google.com>
179
180 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
181 TLSLD_ADD_DTPREL_LO12_NC.
182 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
183 _TLS_MODULE_BASE_ point to the start of tls segment.
184 (Target_aarch64::optimize_tls_reloc): Add cases for
185 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
186 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
187 (Target_aarch64::Scan::local): Likewise.
188 (Target_aarch64::Scan::global): Likewise.
189 (Target_aarch64::Relocate::relocate): Likewise.
190 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
191 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
192 relocations.
193
0916f9e7
RÁE
1942015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
195
196 * merge.cc (Object_merge_map::add_mapping): call
197 Object_merge_map::Input_merge_map::add_mapping.
198 (Object_merge_map::Input_merge_map::add_mapping): New.
199 (Output_merge_data::do_add_input_section): Call
200 get_or_make_input_merge_map before a loop.
201 (Output_merge_string<Char_type>::finalize_merged_data): Call
202 get_or_make_input_merge_map before a loop.
203 * merge.h (Object_merge_map): Make Input_merge_map public.
204 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
205 (Relobj::get_or_create_merge_map): New.
206 * object.h (Relobj::get_or_create_merge_map): New.
207
282c9750
AM
2082015-03-24 Alan Modra <amodra@gmail.com>
209
210 PR 18147
211 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
212 relocation errors for branches to strong undefined symbols.
213
67f95b96
RÁE
2142015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
215
216 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
217 (Object_merge_map::is_merge_section_for): Remove.
218 (Object_merge_map::find_merge_section): New.
219 * merge.h (Object_merge_map::is_merge_section_for): Remove.
220 (Object_merge_map::find_merge_section): New.
221 (Object_merge_map::get_input_merge_map): Add a const version.
222 * object.cc (Relobj::is_merge_section_for): Remove.
223 (Relobj::find_merge_section): New.
224 * object.h (Relobj::is_merge_section_for): Remove.
225 (Relobj::find_merge_section): New.
226 * output.cc
227 (Output_section::Input_section::is_merge_section_for): Remove.
228 (Output_section::add_merge_input_section): Don't call
229 add_merge_input_section.
230 (Output_section::find_merge_section): Return const. Use
231 object->find_merge_section.
232 (Output_section::build_lookup_maps): Don't build a map for
233 merge sections.
234 (Output_section::is_input_address_mapped): Return false if
235 section is not found.
236 (Output_section::find_starting_output_address): Use
237 find_merge_section instead of is_merge_section_for.
238 (Output_section::add_script_input_section): Don't build a map for
239 merge sections.
240 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
241 (Output_section_lookup_maps::find_merge_section): Remove.
242 (Output_section_lookup_maps::add_merge_input_section) Remove.
243 (Output_section::find_merge_section): Return const.
244
152f7024
CC
2452015-03-22 Cary Coutant <cary@google.com>
246
247 PR gold/18106
248 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
249 non-SIB form of lea, with nop after the call.
250
bccffdfd
CC
2512015-03-21 Cary Coutant <cary@google.com>
252
253 PR gold/14217
254 * output.cc (Output_segment::is_first_section_relro): Don't ignore
255 .tdata section.
256 (Output_segment::set_section_addresses): Don't align size of relro
257 segment for .tbss.
258
1c582fe7
CC
2592015-03-21 Cary Coutant <cary@google.com>
260
261 PR gold/18010
262 * stringpool.cc (Stringpool_template): Don't optimize if section
263 alignment is greater than sizeof(char).
264
410da591
CC
2652015-03-21 Cary Coutant <cary@google.com>
266
267 PR gold/18048
268 * script-c.h (script_include_directive): Add first_token parameter.
269 * script.cc (script_include_directive): Add first_token parameter, and
270 pass it to read_script_file.
271 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
272 (PARSING_MEMORY_DEF): New tokens.
273 (top): Add new productions for INCLUDE files.
274 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
275 Pass PARSING_LINKER_SCRIPT to script_include_directive.
276 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
277 (section_cmd): Pass PARSING_SECTION_CMDS.
278 (file_or_sections_cmd): Remove.
279 (memory_def): Pass PARSING_MEMORY_DEF.
280 * testsuite/Makefile.am (memory_test_2): New test.
281 * testsuite/Makefile.in: Regenerate.
282 * testsuite/memory_test_inc.t: New script file.
283 * testsuite/memory_test_inc_1.t.src: New script file.
284 * testsuite/memory_test_inc_2.t.src: New script file.
285 * testsuite/memory_test_inc_3.t.src: New script file.
286
0d5bbdb0
CC
2872015-03-21 Cary Coutant <cary@google.com>
288
289 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
290 (Sized_relobj_dwo::setup): Build compressed section map.
291 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
292 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
293 section map.
294 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
295 compressed_sections_ field.
296 (build_compressed_section_map): Take Object instead of
297 Sized_relobj_file parameter; add decompress_if_needed parameter.
298 (Sized_relobj_file::do_find_special_sections): Store compressed
299 section map in parent Object.
300 (Sized_relobj_file::do_decompressed_section_contents): Move
301 implementation to Object::decompressed_section_contents.
302 (Sized_relobj_file::do_discard_decompressed_sections): Move
303 implementation to Object::discard_decompressed_sections.
304 * object.h (build_compressed_section_map): Declare.
305 (Object::Object): Add compressed_sections_ field.
306 (Object::section_is_compressed): Move implementation here.
307 (Object::decompressed_section_contents): De-virtualize.
308 (Object::discard_decompressed_sections): De-virtualize.
309 (Object::do_section_is_compressed): Delete.
310 (Object::do_decompressed_section_contents): Delete.
311 (Object::set_compressed_sections): New method.
312 (Object::compressed_sections): New method.
313 (Object::compressed_sections_): New data member.
314 (Compressed_section_info, Compressed_section_map): Move to top of file.
315 (Sized_relobj_file::do_section_is_compressed): Delete.
316 (Sized_relobj_file::do_decompressed_section_contents): Delete.
317 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
318 (Sized_relobj_file::compressed_sections_): Move to Object class.
319
bd9e0d46
CC
3202015-03-21 Cary Coutant <ccoutant@google.com>
321
322 PR gold/18152
323 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
324 deferred objects.
325
943c8b43
CC
3262015-03-11 Cary Coutant <ccoutant@google.com>
327
328 * options.cc (General_options::finalize): Don't allow -z relro
329 with incremental linking.
330 * testsuite/Makefile.am (incremental_test): Add -z norelro.
331 (incremental_test_2): Likewise.
332 (incremental_test_3): Likewise.
333 (incremental_test_4): Likewise.
334 (incremental_test_5): Likewise.
335 (incremental_test_6): Likewise.
336 (incremental_copy_test): Likewise.
337 (incremental_common_test_1): Likewise.
338 (incremental_comdat_test_1): Likewise.
339 * testsuite/Makefile.in: Regenerate.
340
e1663197
CC
3412015-03-09 Cary Coutant <ccoutant@google.com>
342
343 PR gold/14675
344 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
345 return enum indicating whether .eh_frame section is empty, optimizable,
346 unrecognized, or an end marker. Adjust explicit instantiations.
347 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
348 (Eh_frame::add_ehframe_input_section): Change return type.
349 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
350 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
351 to the .eh_frame output section until we see the end marker.
352 (Layout::finalize_eh_frame_section): New.
353 * layout.h: (Layout::finalize_eh_frame_section): New.
354
beb8418f
L
3552015-03-05 H.J. Lu <hongjiu.lu@intel.com>
356
357 * output.cc (Relobj::initialize_input_to_output_map<size>):
358 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
359
48c73428
CC
3602015-03-04 Cary Coutant <ccoutant@google.com>
361
362 * parameters.cc (Parameters::set_target_once): Call
363 Target::select_as_default_target just once from here...
364 (set_parameters_target): ...instead of from here.
365
3662015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
367
368 * ehframe.cc (Cie::set_output_offset): Pass in and use a
369 Output_section_data instead of a Merge_map.
370 (Eh_frame::Eh_frame): Don't initialize merge_map_.
371 (Eh_frame::read_cie): Use add_merge_mapping instead of
372 Merge_map::add_mapping.
373 (Eh_frame::read_fde): Ditto.
374 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
375 (Eh_frame::do_output_offset): Use merge_output_offset istead of
376 merge_map_->get_output_offset.
377 (Eh_frame::do_is_merge_section_for): Delete.
378 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
379 instead of a Merge_map.
380 (Cie::set_output_offset): Pass in a Output_section_data instead of a
381 Merge_map.
382 (Eh_frame::do_is_merge_section_for): Delete.
383 (Eh_frame::merge_map_): Delete.
384 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
385 and use a Output_section_data instead of a Merge_map.
386 (Object_merge_map::add_mapping): Ditto.
387 (Object_merge_map::get_output_offset): Remove the merge_map argument.
388 (Object_merge_map::is_merge_section_for): Pass in and use a
389 Output_section_data instead of a Merge_map.
390 (Merge_map): Delete.
391 (Output_merge_base::do_output_offset): Use merge_output_offset instead
392 of merge_map_.get_output_offset.
393 (Output_merge_base::do_is_merge_section_for): Delete.
394 (Output_merge_data::do_add_input_section): Use
395 object->add_merge_mapping instead of add_mapping.
396 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
397 * merge.h (Merge_map): Delete forward declaration.
398 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
399 instead of a Merge_map.
400 (Object_merge_map::get_output_offset): Remove the merge_map argument.
401 (Object_merge_map::is_merge_section_for): Pass in and use a
402 Output_section_data instead of a Merge_map.
403 (Input_merge_map::Object_merge_map::merge_map): Replace with
404 output_data.
405 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
406 Output_section_data instead of a Merge_map.
407 (Merge_map): Delete.
408 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
409 (Output_merge_base::do_is_merge_section_for): Delete.
410 (Output_merge_base::add_mapping): Delete.
411 (Output_merge_base::merge_map_): Delete.
412 * object.cc (Relobj::initialize_input_to_output_map): New.
413 (Relobj::initialize_input_to_output_map): New.
414 (Relobj::merge_output_offset): New.
415 (Relobj::is_merge_section_for): New.
416 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
417 bits.
418 * object.h (Relobj::merge_map): Delete.
419 (initialize_input_to_output_map): New.
420 (set_merge_map): Delete.
421 (add_merge_mapping): New.
422 (merge_output_offset): New.
423 (is_merge_section_for): New.
424 * output.cc (Output_section::Input_section::is_merge_section_for):
425 Use object->is_merge_section_for.
426 * output.h (Output_section_data::is_merge_section_for): Delete.
427 (Output_section_data::do_is_merge_section_for): Delete.
428 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
429 Use object->initialize_input_to_output_map.
430 (Merged_symbol_value<size>::value_from_output_section): Use
431 object->merge_output_offset.
432
48c73428 4332015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
434 Cary Coutant <ccoutant@google.com>
435
436 * output.cc (Output_section::add_merge_input_section): Do not
437 attempt to merge sections with an entsize of 0.
438
48c73428 4392015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
440
441 * attributes.h (class Output_attributes_section_data ): Add
442 do_print_to_mapfile function.
443
ec86f434
AM
4442015-02-24 Alan Modra <amodra@gmail.com>
445
446 PR 18010
447 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
448 complain if value is not a multiple of four.
449 (Target_powerpc::Relocate::relocate): Correct handling of
450 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
451
be66981e
L
4522015-02-21 H.J. Lu <hongjiu.lu@intel.com>
453
454 * configure.ac (default_size): Set to 32 for x32.
455 * configure: Regenerated.
456
e3ee8ed4
AM
4572015-02-18 Alan Modra <amodra@gmail.com>
458
459 PR 17954
460 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
461 visibility.
462
3a935c6c
RÁE
4632015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
464
465 * gc.h (Garbage_collection::add_reference): Don't use find.
466
e0a1e121
RÁE
4672015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
468
469 * object.cc (write_local_symbols): avoid std::vector copy.
470
45a4fb1a
RÁE
4712015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
472
473 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
474
2d9afefe
MW
4752015-02-09 Mark Wielaard <mjw@redhat.com>
476
477 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
478 DW_LANG_Fortran03 and DW_LANG_Fortran08.
479
e9c1bdad
CC
4802015-02-16 Cary Coutant <ccoutant@google.com>
481
482 PR gold/13577
483 PR gold/16992
484 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
485 DF_SYMBOLIC if --dynamic-list option is used.
486 * options.cc (General_options::finalize): --dynamic-list is not
487 mutually exclusive with -Bsymbolic.
488 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
489 listed in --dynamic-list.
490 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
491 -Bsymbolic-functions.
492 * testsuite/Makefile.in: Regenerate.
493
0ed4b0bf
CC
4942015-02-16 Cary Coutant <ccoutant@google.com>
495
496 PR gold/17971
497 * incremental.cc: Remove redundant include of "output.h".
498
1a920511
JY
4992015-02-12 Jing Yu <jingyu@google.com>
500
501 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
502 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
503 New relocation.
504 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
505 TLSLE_MOVW_* relocations.
506 (Target_aarch64::Scan::global): Likewise.
507 (Target_aarch64::Relocate::relocate): Likewise.
508 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
509 for new TLSLE_MOVW_* relocations.
510
07f107f3
WN
5112015-02-11 Will Newton <will.newton@linaro.org>
512
513 PR gold/13321
514 * arm.cc (Target_arm::make_plt_section): Create an ARM
515 state mapping symbol at the start of the PLT.
516
e051a5b5
L
5172015-02-09 H.J. Lu <hongjiu.lu@intel.com>
518
519 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
520 Replace two_file_shared_2.so with two_file_shared_1.so.
521 * testsuite/Makefile.in: Regenerated.
522
dddcc5b9
AM
5232015-02-09 Alan Modra <amodra@gmail.com>
524
525 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
526 plugin_test_thin.a and defsym_test.
527 * testsuite/Makefile.in: Regenerate.
528
b39b8b9d
RÁE
5292015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
530
531 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
532 body.
533
b66d1c52
CC
5342015-02-04 Peter Collingbourne <pcc@google.com>
535
536 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
537 forwarding symbols when computing symbol resolution info for plugins.
538 * plugin.h (Plugin_manager::symtab): New method.
539 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
540
23081de0
CC
5412015-02-03 Cary Coutant <ccoutant@google.com>
542 Peter Collingbourne <pcc@google.com>
543
544 PR gold/15660
545 * archive.cc (Thin_archive_object_unlocker): New class.
546 (Archive::include_member): Unlock external members of thin archives.
547 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
548 (plugin_test_2): Likewise.
549 (plugin_test_3): Likewise.
550 (plugin_test_4): Likewise.
551 (plugin_test_5): Likewise.
552 (plugin_test_6): Likewise.
553 (plugin_test_7): Likewise.
554 (plugin_test_8): Likewise.
555 (plugin_test_9): Likewise.
556 (plugin_test_10): Likewise.
557 (plugin_test_11): New test case.
558 * testsuite/Makefile.in: Regenerate.
559 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
560 file to decide whether to claim file.
561 (all_symbols_read_hook): Likewise.
562 * testsuite/plugin_test_1.sh: Adjust expected output.
563 * testsuite/plugin_test_2.sh: Likewise.
564 * testsuite/plugin_test_3.sh: Likewise.
565 * testsuite/plugin_test_6.sh: Likewise.
566 * testsuite/plugin_test_tls.sh: Likewise.
567 * testsuite/plugin_test_11.sh: New testcase.
568
5692015-02-03 Cary Coutant <ccoutant@google.com>
570
571 * descriptors.cc (Descriptors::open): Set artificially-low limit for
572 file descriptors when debugging enabled. Add debug output.
573 (Descriptors::release): Add debug output.
574 (Descriptors::close_some_descriptor): Likewise.
575 (Descriptors::close_all): Likewise.
576 * fileread.cc (File_read::lock): Likewise.
577 (File_read::unlock): Likewise.
578
24dd5808
CC
5792015-02-02 Cary Coutant <ccoutant@google.com>
580
581 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
582 executable output file.
583
fa89cc82
HS
5842015-01-22 Han Shen <shenhan@google.com>
585
586 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
587 (Target_arm::do_plt_address_for_global): New method.
588 (Target_arm::do_plt_address_for_local): New method.
589 (Target_arm::rel_irelative_section): New method.
590 (Target_arm::make_data_plt): Add more parameters for plt ctor.
591 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
592 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
593 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
594 (Target_arm::Scan::check_non_pic): Add ifunc support.
595 (Target_arm::Scan::local): Add ifunc support.
596 (Target_arm::Scan::global): Add ifunc support.
597 (Target_arm::make_plt_section): New method.
598 (Target_arm::make_plt_entry): Change to call to make_plt_section.
599 (Target_arm::make_local_ifunc_plt_entry): New method.
600 (Target_arm::got_irelative_): New member.
601 (Target_arm::rel_irelative_): New member.
602 (Target_arm::got_section): Add creation for got_irelative_.
603 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
604 (Target_arm::Relocate::relocate): Properly set local ifunc address.
605 (Target_arm::do_dynsym_value): Properly set global ifunc address.
606 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
607 (Output_data_plt_arm::IRelative_data): New type.
608 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
609 (Output_data_plt_arm::add_entry): Add more parameters.
610 (Output_data_plt_arm::add_relocation): New method.
611 (Output_data_plt_arm::add_local_ifunc_entry): New method.
612 (Output_data_plt_arm::rel_irelative): New method.
613 (Output_data_plt_arm::entry_count): Modified.
614 (Output_data_plt_arm::address_for_global): New method.
615 (Output_data_plt_arm::address_for_local): New method.
23081de0 616gold/
fa89cc82
HS
617 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
618 (Output_data_plt_arm::insert_irelative_data): New method.
619 (Output_data_plt_arm::irelative_rel_): New member.
620 (Output_data_plt_arm::got_): New member.
621 (Output_data_plt_arm::got_irelative_): New member.
622 (Output_data_plt_arm::irelative_count_): New member.
623 (Output_data_plt_arm::IRelative_data_vec): New typedef.
624 (Output_data_plt_arm::irelative_data_vec_): New member.
625 (Output_data_plt_arm::do_write): Write out irelative entries.
626 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
627 more parameters to ctor.
628 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
629 more parameters to ctor.
630 * output.h (Output_data_reloc::add_local_relative): New method.
631 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
632
0f81d3f0
AM
6332015-01-29 Alan Modra <amodra@gmail.com>
634
635 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
636 and GOT_TLSGD to LE optimization.
637
65d92137
CC
6382015-01-28 Cary Coutant <ccoutant@google.com>
639
640 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
641 for undef TLS symbols.
642 (Target_x86_64::Relocate::relocate_tls): Likewise.
643 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
644
5485698a
CC
6452015-01-25 Cary Coutant <ccoutant@google.com>
646
647 * output.cc (Output_segment::set_section_addresses): Fix calculation
648 of size of relro segment.
649
b01a4b04
AM
6502015-01-22 Alan Modra <amodra@gmail.com>
651
652 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
653 condition for need of ifunc plt entry.
654 (Target_powerpc::Scan::global <got relocs>): Likewise.
655
3d0064a9
CC
6562015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
657
658 * mips.cc (reloc_high): Add r_sym.
659 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
660 reloc_high constructor.
661 (Mips_relocate_functions::relgot16_local): Likewise.
662 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
663 r_type to decide whether LO16 matches HI16.
664 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
665 rello16 and relgot16_local.
666
a5cd8f05
CC
6672015-01-09 Cary Coutant <ccoutant@google.com>
668
669 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
670 unless alignment is larger than page size.
671
4fc1b9d4
L
6722015-01-06 H.J. Lu <hongjiu.lu@intel.com>
673 Cary Coutant <ccoutant@google.com>
674
675 PR gold/17729
676 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
677 (DEFAULT_TARGET_X32): Set for x32.
678 * x86_64.cc (cmp_insn_32): New.
679 (lea_r10_insn_32): Likewise.
680 (lea_r11_insn_32): Likewise.
681 (cmp_insn_64): Likewise.
682 (lea_r10_insn_64): Likewise.
683 (lea_r11_insn_64): Likewise.
684 (Target_x86_64<size>::do_calls_non_split): Handle x32.
685 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
686 (check_DATA): Add split_x32 files.
687 (split_x32_[1234n].o): New targets.
688 (split_x32_[124]): New targets.
689 (split_x32_[1234r].stdout): New targets.
690 * testsuite/split_x32.sh: New file.
691 * testsuite/split_x32_1.s: Likewise.
692 * testsuite/split_x32_2.s: Likewise.
693 * testsuite/split_x32_3.s: Likewise.
694 * testsuite/split_x32_4.s: Likewise.
695 * testsuite/split_x32_n.s: Likewise.
696 * configure: Regenerated.
697 * testsuite/Makefile.in: Likewise.
698
e749cab8
L
6992015-01-06 H.J. Lu <hongjiu.lu@intel.com>
700
701 PR gold/17809
702 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
703 x32.
704
af759df0
AM
7052015-01-02 Alan Modra <amodra@gmail.com>
706
707 * version.cc (print_version): Just print current year.
708 * dwp.cc (print_version): Likewise.
709
b90efa5b
AM
7102015-01-01 Alan Modra <amodra@gmail.com>
711
712 Update year range in copyright notice of all files.
713
f12d1e8a
AM
7142014-12-25 Alan Modra <amodra@gmail.com>
715
716 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
717 new enums.
718 (Target_arm::merge_object_attributes, ): Likewise.
719
5c294fee
TG
7202014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
721
722 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
723 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
724 AEABI_VFP_args_vfp to check that.
725 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
726 value and replace hardcoded values by enum values.
727
e30880c2
CC
7282014-12-22 Cary Coutant <ccoutant@google.com>
729
730 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
731
bd040da1
L
7322014-12-20 H.J. Lu <hongjiu.lu@intel.com>
733
734 PR gold/14608
735 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
736 to "return i * i * 3;".
737
e02a4046
CC
7382014-12-16 Cary Coutant <ccoutant@google.com>
739
740 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
741 (Mapfile::print_output_data): Use current_data_size() to avoid
742 assert for sections requiring postprocessing; if address is not valid,
743 print 0.
744 (Mapfile::print_output_section): Use current_data_size(); print note
745 that addresses and sizes are before compression.
746
add6016b
L
7472014-12-14 H.J. Lu <hongjiu.lu@intel.com>
748
749 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
750 Cast current_group_size to unsigned long when reporting error.
751
0bf32ea9
JY
7522014-12-10 Jing Yu <jingyu@google.com>
753
754 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
755 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
756 Update error message.
757 (Target_aarch64::do_relax): Use absolute value of option
758 stub_group_size. Replace local variable with class member
759 stub_group_size_.
760
cbcb23fa
AM
7612014-12-04 Alan Modra <amodra@gmail.com>
762
763 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
764 addend of PLTREL24 reloc when not generating a plt stub. Make
765 max_branch_offset an "Address".
fbad6518 766 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
767 (Target_powerpc::Relocate::relocate): Likewise.
768
1611bc4a
AM
7692014-12-04 Alan Modra <amodra@gmail.com>
770
771 PR 17670
772 * symtab.cc (Symbol::set_undefined): Remove assertion.
773 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
774 on symbols defined in discarded sections, instead return false.
775 Rearrange params, update all callers.
776 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
777 branches to syms in discarded sections.
778 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
779 undefined and flag as discarded.
780 (Target_powerpc::Relocate::relocate): Localize variable.
781
4759c34e
L
7822014-12-03 H.J. Lu <hongjiu.lu@intel.com>
783
784 PR gold/17675
785 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
786 * testsuite/Makefile.in: Regenerated.
787
1f98a074
AM
7882014-12-03 Alan Modra <amodra@gmail.com>
789
790 PR 17566
791 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
792 when adding dynamic relocations against section symbols.
793
fb257835
DI
7942014-12-01 Dimitry Ivanov <dimitry@google.com>
795
796 * layout.cc (Layout::finish_dynamic_section): When '-z global'
797 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
798 * options.h (General_options): New -z option (global).
799
d8e60314
CC
8002014-12-01 Cary Coutant <ccoutant@google.com>
801
802 PR gold/17578
803 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
804 is given.
805 (Layout::create_executable_stack_info): Warn when -z noexecstack is
806 given but some inputs require executable stack.
807
982bbd97
CC
8082014-11-26 Cary Coutant <ccoutant@google.com>
809
810 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
811 .debug_str_offsets; strip .debug_gnu_pubnames and
812 .debug_gnu_pubtypes.
813 (lines_only_debug_sections): Strip all four new sections.
814
bb779192
HS
8152014-11-26 Jing Yu <jingyu@google.com>
816
817 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
818 register to be x0 when to relax TLSDESC_LD64_LO12.
819
a3e60ddb
AM
8202014-11-26 Alan Modra <amodra@gmail.com>
821
822 * powerpc.cc (struct Stub_table_owner): New.
823 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
824 unsigned int vector. Update all references.
825 (powerpc_relobj::set_stub_table): Take an unsigned int param
826 rather than a Stub_table. Update callers.
827 (Powerpc_relobj::clear_stub_table): New function.
828 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
829 stub_group_size_ vars.
830 (Target_powerpc::new_stub_table): Delete.
831 (max_branch_delta): New function, extracted from..
832 (Target_powerpc::Relocate::relocate): ..here..
833 (Target_powerpc::Branch_info::make_stub): ..and here. Return
834 status on whether stub created successfully.
835 (Stub_control::Stub_control): Add "no_size_errors" param. Move
836 default sizing to..
837 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
838 reduce on relax failure.
839 (Target_powerpc::group_sections): Add "no_size_errors" param.
840 Use stub_group_size_. Set up group info in a temp vector,
841 before building Stub_table vector. Account for input sections
842 possibly already converted to relaxed sections.
843 (Stub_table::init): Delete. Merge into..
844 (Stub_table::Stub_table): ..here.
845 (Stub_table::can_reach_stub): New function.
846 (Stub_table::add_plt_call_entry): Add "from" parameter and
847 return true iff stub could be reached.
848 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
849 param too.
850 (Stub_table::clear_stubs): Add "all" param.
851
a20605cf
AM
8522014-11-26 Alan Modra <amodra@gmail.com>
853
854 * powerpc.cc (Stub_control::set_output_and_owner): New function.
855 (Target_powerpc::group_sections): Use it.
856
43b64deb
CC
8572014-11-25 Cary Coutant <ccoutant@google.com>
858
859 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
860 (Binary_to_elf::write_symbol): Add st_size parameter.
861 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
862
c924eb67
CC
8632014-11-25 Cary Coutant <ccoutant@google.com>
864
865 PR gold/17639
866 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
867 (Sized_relobj_file::do_layout): Handle deferred sections properly
868 during GC pass 1. Don't add reloc sections to deferred list twice.
869 * object.h (Sized_relobj_file::is_deferred_layout): New function.
870 (Sized_relobj_file::is_deferred_layout_): New data member.
871
9d585188
L
8722014-11-21 H.J. Lu <hongjiu.lu@intel.com>
873
874 PR gold/17619
875 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
876 Check PC-relative offset overflow in PLT entry.
877
3ffaac20
AM
8782014-11-21 Alan Modra <amodra@gmail.com>
879
880 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
881 for undefined weaks.
882
0cfb0717
AM
8832014-11-20 Alan Modra <amodra@gmail.com>
884
885 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
886 from --stub-group-size parameter divided by 1024.
887 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
888 template parameter. Update all uses.
889 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
890 has_stub_value. Set for long branches. Don't report overflow for
891 branch to undefined weak symbols. Print info message on
892 overflowing branch to stub.
893
f9dffbf0
AM
8942014-11-20 Alan Modra <amodra@gmail.com>
895
896 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
897
e88ba8d5
L
8982014-11-13 H.J. Lu <hongjiu.lu@intel.com>
899
900 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
901 entry for R_X86_64_GOTPLT64.
902 (Target_x86_64<size>::Relocate::relocate): Update comments for
903 R_X86_64_GOTPLT64.
904
d37ffe25
ED
9052014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
906
907 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
908 * plugin.h: add lock definition
909
9726c3c1
HS
9102014-10-29 Han Shen <shenhan@google.com>
911 Jing Yu <jingyu@google.com>
912
913 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
914 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
915 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
916 Symbol::TLS_REF.
917 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
918 method.
919 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
920 (Target_aarch64::tls_ld_to_le): New method.
921 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
922 for 64bit targets.
923 (Output_data_plt_aarch64::irelative_rel_): New data member.
924 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
925 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
926 (Output_data_plt_aarch64::add_relocation): New method.
927 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
928 offset. Add got_irelative size to got size.
929 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
930 type string with the new typename.
931 (AArch64_relocate_functions::update_adr): Replace parameter x with
932 immed.
933 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
934 (AArch64_relocate_functions::reloc_common): New method.
935 (AArch64_relocate_funcsions::rela_general): Extract common part out
936 into reloc_common method.
937 (AArch64_relocate_functions::rela_general): Likewise.
938 (AArch64_relocate_functions::pcrela_general): Likewise.
939 (AArch64_relocate_functions::adr): New method.
940 (AArch64_relocate_functions::adrp): Calculate immed before calling
941 update_adr.
942 (AArch64_relocate_functions::adrp): Likewise.
943 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
944 comparing x to 0. Calculate immed from ~x when x < 0.
945 (Target_aarch64::optimize_tls_reloc): Add new cases for
946 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
947 TLSLD_MOVW_DTPREL_G0_NC.
948 (Target_aarch64::possible_function_pointer_reloc): Implement this
949 method.
950 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
951 comment.
952 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
953 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
954 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
955 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
956 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
957 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
958 (Target_aarch64::make_plt_entry): Call add_entry with two more
959 parameters.
960 (Target_aarch64::make_local_ifunc_plt_entry): New method.
961 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
962 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
963 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
964 (Target_aarch64::Relocate::relocate_tls): Add cases for
965 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
966 TLSLD_MOVW_DTPREL_G0_NC.
967 * testsuite/icf_safe_so_test.cc: Correct test comment.
968 * testsuite/icf_safe_test.sh: Add AArch64 arch.
969
80272b8c
AM
9702014-10-22 Alan Modra <amodra@gmail.com>
971
972 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
973 thread_starter.
974
998a69f4
AS
9752014-10-18 Andreas Schwab <schwab@linux-m68k.org>
976
977 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
978
aed56ec5
CC
9792014-10-17 Cary Coutant <ccoutant@google.com>
980
981 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
982 Add "typename" keyword.
983
bb779192 9842014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
985 Jing Yu <jingyu@google.com>
986
987 Patch for gold aarch64 backend to support relaxation.
988 * aarch64-reloc.def: Change format.
989 * aarch64.cc (class Reloc_stub): New class.
990 (class Stub_table): New class.
991 (class AArch64_relobj): New class.
992 (class AArch64_input_section): New class.
993 (class AArch64_output_section): New class.
994 (Target_aarch64::new_stub_table): New method.
995 (Target_aarch64::new_aarch64_input_section): New method.
996 (Target_aarch64::find_aarch64_input_section): New method.
997 (Target_aarch64::scan_section_for_stubs): New method.
998 (Target_aarch64::scan_reloc_section_for_stubs): New method.
999 (Target_aarch64::relocate_stub): New method.
1000 (Target_aarch64::current_target): New method.
1001 (Target_aarch64::do_make_elf_object): New method.
1002 (Target_aarch64::do_may_relax): New method.
1003 (Target_aarch64::do_relax): New method.
1004 (Target_aarch64::group_sections): New method.
1005 (Target_aarch64::scan_reloc_for_stub): New method.
1006 (Target_aarch64::do_make_output_section): New method.
1007 (Target_aarch64::stub_tables_): New data member.
1008 (Target_aarch64::aarch64_input_section_map_): New data member.
1009 (AArch64_relocate_functions::maybe_apply_stub): New method.
1010
db4c9594
CC
10112014-09-30 Cary Coutant <ccoutant@google.com>
1012
1013 PR gold/17432
1014 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1015
cd6da036
KC
10162014-09-30 Kito Cheng <kito@0xlab.org>
1017
1018 PR gold/13597
1019 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1020 hash table before sysv-style hash table.
1021
5f772412
ST
10222014-09-29 Sriraman Tallam <tmsriram@google.com>
1023
1024 * options.h (--pic-executable): Add negative to alias to -no-pie.
1025
5efeedf6
CC
10262014-09-26 Cary Coutant <ccoutant@google.com>
1027
1028 PR gold/16773
1029 * object.cc (Sized_relobj_file): Compute value of section symbols
1030 for TLS sections the same as TLS symbols.
1031
1707f183
CC
10322014-09-25 Cary Coutant <ccoutant@google.com>
1033
1034 PR gold/17432
1035 * resolve.cc (Symbol_table::resolve): Override common placeholder
1036 symbols, but adjust sizes.
1037 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1038 symbols to common lists.
1039
00cac886
AM
10402014-09-24 Alan Modra <amodra@gmail.com>
1041
1042 * po/POTFILES.in: Regenerate.
1043
635aa30e
CC
10442014-09-23 Taiju Tsuiki <tzik@google.com>
1045 Cary Coutant <ccoutant@google.com>
1046
71b9b91b 1047 PR gold/14860
635aa30e
CC
1048 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1049 on input_sections_blocker.
1050 * layout.cc (Write_sections_task::locks): Unblock
1051 input_sections_blocker_.
1052 * layout.h (Write_sections_task::Write_sections_task): Add
1053 input_sections_blocker.
1054 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1055 to DEPENDENCIES.
1056 * testsuite/Makefile.in: Regenerate.
1057
c0c71592
RÁE
10582014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1059
1060 * testsuite/Makefile.am (plugin_test_10): New test.
1061 * testsuite/Makefile.in: Regenerate
1062 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1063 * testsuite/plugin_test_10.sh: New file.
1064
6168c2a1
RÁE
10652014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1066
1067 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1068 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1069 during the replacement phase.
1070
3a531937
JY
10712014-09-17 Han Shen <shenhan@google.com>
1072 Jing Yu <jingyu@google.com>
1073
1074 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1075 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1076 * aarch64.cc (Target_aarch64): Add data members
1077 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1078 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1079 constructor.
1080 (Target_aarch64::do_reloc_symbol_index): New method.
1081 (Target_aarch64::do_reloc_addend): New method.
1082 (Target_aarch64::add_tlsdesc_info): New method.
1083 (Target_aarch64::do_dynsym_value): New method.
1084 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1085 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1086 (Target_aarch64::make_data_plt): Add new parameters: got,
1087 got_irelative. Pass them to do_make_data_plt.
1088 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1089 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1090 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1091 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1092 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1093 (Target_aarch64::got_tlsdesc_section): New method.
1094 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1095 (Target_aarch64::define_tls_base_symbol): New method.
1096 (Target_aarch64::reserve_tlsdesc_entries): New method.
1097 (Target_aarch64::got_mod_index_entry): New method.
1098 (Target_aarch64::rela_tlsdesc_section): New method.
1099 (Target_aarch64::rela_irelative_section): New method.
1100 (Target_aarch64::Tlsdesc_info): New struct.
1101 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1102 relocations and tlsdesc relocations.
1103 (Target_aarch64::optimize_tls_reloc): Implement method.
1104 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1105 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1106 in constructor.
1107 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1108 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1109 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1110 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1111 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1112 (Output_data_plt_aarch64::rela_irelative): New method.
1113 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1114 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1115 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1116 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1117 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1118 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1119 (Output_data_plt_aarch64_standard): New member variables:
1120 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1121 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1122 New parameter: got, got_irelative.
1123 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1124 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1125 (Output_data_plt_aarch64::do_write): Replace got_address with
1126 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1127 (AArch64_relocate_functions::update_movnz): New method.
1128 (AArch64_relocate_functions): Correct format.
1129 (AArch64_relocate_functions::movnz): New method.
1130 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1131 before the switch. Add new cases to switch.
00cac886 1132 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1133 tlsgd tlsdesc cases.
1134 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1135 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1136 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1137 Call reloc_name_in_error_message to print unsupported reloc.
1138 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1139 make_data_plt.
1140 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1141 relocs. Fill in some more dynamic tags.
1142 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1143 Skip call tls_get_addr when tlsgd is relaxed.
1144 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1145 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1146 tlsdesc->ie relaxation.
1147
62661c93
SS
11482014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1149
1150 * mips.cc (Target_mips_nacl): New class.
1151 (Target_selector_mips_nacl): New class.
1152 (target_selector_mips32): Rename from target_selector_mips32be and use
1153 Target_selector_mips_nacl instead of Target_selector_mips.
1154 (target_selector_mips32el): Rename from target_selector_mips32 and use
1155 Target_selector_mips_nacl instead of Target_selector_mips.
1156 (target_selector_mips64): Rename from target_selector_mips64be and use
1157 Target_selector_mips_nacl instead of Target_selector_mips.
1158 (target_selector_mips64el): Rename from target_selector_mips64 and use
1159 Target_selector_mips_nacl instead of Target_selector_mips.
1160 (Target_mips::mips_info): Add const attribute.
1161
54674d38
CC
11622014-09-02 Cary Coutant <ccoutant@google.com>
1163
1164 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1165 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1166 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1167 (Sized_incr_dynobj::do_section_name): Likewise.
1168 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1169 (Sized_incr_dynobj::do_section_name): Likewise.
1170 * object.h (Object::section_name): Likewise.
1171 (Object::do_section_name): Likewise.
1172 (Sized_relobj_file::do_section_name): Likewise.
1173 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1174 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1175
9860cbcf
CC
11762014-09-02 Cary Coutant <ccoutant@google.com>
1177
1178 PR gold/17005
1179 * ehframe.cc (Fde::write): Add output_offset parameter.
1180 (Cie::write): Likewise.
1181 (Eh_frame::set_final_data_size): Account for offset within output
1182 section.
1183 (Eh_frame::do_sized_write): Likewise.
1184 * ehframe.h (Fde::write): Add output_offset parameter.
1185 (Cie::write): Likewise.
1186 * output.cc (Output_section::Input_section_sort_entry): Remove
1187 section_has_name_; add output_section_name parameter. Use
1188 output section name for non-input sections.
1189 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1190 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1191 (Output_section::Input_section_sort_compare): Remove logic for
1192 sections without names.
1193 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1194 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1195 Likewise.
1196 (Output_section::Input_section_sort_section_name_compare): Likewise.
1197
8e33481e
HS
11982014-08-29 Han Shen <shenhan@google.com>
1199 Jing Yu <jingyu@google.com>
1200
1201 * aarch64-reloc-property.cc
1202 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1203 reference reloc property in the table.
1204 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1205 3 other entries.
1206 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1207 2 new overloaded methods.
1208 (Output_data_got_aarch64::do_write): Add code to write out
1209 static relocs.
1210 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1211 static relocs.
1212 (Output_data_got_aarch64::static_relocs): New vector to
1213 hold static relocs.
1214 (Target_aarch64::TCB_SIZE): New const static memeber.
1215 (Target_aarch64::tcb_size): New method.
1216 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1217 (Target_aarch64::Relocate::relocate_tls): New method.
1218 (Target_aarch64::Scan::local): Add code handling new reloc types.
1219 (Target_aarch64::Scan::global): Add code handling new reloc types.
1220
81233653
ST
12212014-08-13 Sriraman Tallam <tmsriram@google.com>
1222
1223 * options.h (-no-pie): Add option.
1224
9363c7c3
JY
12252014-08-08 Jing Yu <jingyu@google.com>
1226 Han Shen <shenhan@google.com>
1227
1228 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1229 (DEFFILES): add aarch64-reloc.def.
1230 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1231 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1232 * Makefile.in: Regenerate.
1233 * aarch64-reloc-property.cc: New file.
1234 * aarch64-reloc-property.h: New file.
1235 * aarch64-reloc.def: New file.
1236 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1237 with tab to make the format consistent.
1238 (Output_data_got_aarch64::symbol_table_): New method.
1239 (Target_aarch64::do_plt_address_for_global): New method.
1240 (Target_aarch64::do_plt_address_for_local): New method.
1241 (Target_aarch64::do_select_as_default_target): New method.
1242 (Target_aarch64::do_make_data_plt): New method.
1243 (Target_aarch64::make_data_plt): New method.
1244 (Output_data_plt_aarch64::has_irelative_section): New method.
1245 (Output_data_plt_aarch64::address_for_global): New method.
1246 (Output_data_plt_aarch64::address_for_local): New method.
1247 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1248 (Output_data_plt_aarch64::add_entry): Implement contents.
1249 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1250 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1251 the got_pov entry to plt0.
1252 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1253 Implement contents.
1254 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1255 (AArch64_howto): New struct.
1256 (aarch64_howto[]): New static const array.
1257 (AArch64_relocate_functions): New class.
1258 (Target_aarch64::Scan::get_reference_flags): Remove method.
1259 (Target_aarch64::Scan::local): Implement to support a few relocations.
1260 (Target_aarch64::Scan::global): Implement to support a few relocations.
1261 (Target_aarch64::make_plt_section): Implement contents.
1262 (Target_aarch64::make_plt_entry): Implement contents.
1263 (Target_aarch64::do_finalize_sections): Implement contents.
1264 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1265 (Target_aarch64::relocate_section): Implement contents.
1266
ad9fe6c1
AM
12672014-08-06 Alan Modra <amodra@gmail.com>
1268
1269 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1270
7cd4e5b7
AM
12712014-08-06 Alan Modra <amodra@gmail.com>
1272
1273 PR 13227
1274 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1275
5ad9b0a7
ST
12762014-07-21 Sriraman Tallam <tmsriram@google.com>
1277
1278 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1279 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1280
e051745c
CC
12812014-07-08 Cary Coutant <ccoutant@google.com>
1282
1283 * expression.cc (struct Expression::Expression_eval_info): Add
1284 new fields type_pointer, vis_pointer, and nonvis_pointer.
1285 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1286 nonvis_pointer parameters. Adjust all calls.
1287 (Symbol_expression::value): Update type, visibility, and nonvis bits
1288 in caller.
1289 * script.cc (Symbol_assignment::sized_finalize): Update type,
1290 visibility, and remaining st_other bits for new symbol.
1291 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1292 vis_pointer, and nonvis_pointer parameters.
1293 * symtab.h (Symbol::set_type): New method.
1294
1295 * testsuite/Makefile.am (defsym_test): New test.
1296 * testsuite/Makefile.in: Regenerate.
1297 * testsuite/defsym_test.c: New file.
1298 * testsuite/defsym_test.sh: New file.
1299
f35c4853
CC
13002014-07-08 Cary Coutant <ccoutant@google.com>
1301
1302 PR gold/15639
1303 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1304 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1305 (Sized_dynobj::base_read_symbols): ...new method.
1306 * object.h (Sized_relobj_file::base_read_symbols): New method.
1307 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1308 (Sized_relobj_file::base_read_symbols): ...new method.
1309 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1310 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1311 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1312
2900af2d
AM
13132014-07-04 Alan Modra <amodra@gmail.com>
1314
1315 * po/POTFILES.in: Regenerate.
1316
053a4d68
JY
13172014-07-02 Jing Yu <jingyu@google.com>
1318
1319 * aarch64.cc: New file
1320 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1321 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1322 * Makefile.in: Regenerate.
1323 * configure.tgt: Add entries for aarch64*.
1324 * configure.ac: Likewise.
1325 * configure: Likewise.
1326
7b549045
AM
13272014-06-27 Alan Modra <amodra@gmail.com>
1328
1329 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1330
cb818dbf
CC
13312014-06-24 Cary Coutant <ccoutant@google.com>
1332
1333 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1334 sections.
1335 (Dwo_file::sized_read_unit_index): Likewise.
1336
9810d34d
SS
13372014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1338
1339 * mips.cc: New file.
1340 * Makefile.am (TARGETSOURCES): Add mips.cc
1341 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1342 * configure.tgt: Add entries for mips*.
1343 * configure.ac: Likewise.
1344 * Makefile.in: Regenerate.
1345 * configure: Likewise.
1346
9baa787b
CC
13472014-06-09 Cary Coutant <ccoutant@google.com>
1348
1349 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1350 unit_length is within section bounds.
1351
8f89af0a
CC
13522014-06-09 Cary Coutant <ccoutant@google.com>
1353
1354 PR gold/16980
1355 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1356 map.
1357
a47622ac
AM
13582014-06-07 Alan Modra <amodra@gmail.com>
1359
1360 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1361
4320c691
CC
13622014-06-06 Cary Coutant <ccoutant@google.com>
1363
1364 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1365 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1366 (Dwarf_pubnames_table::read_header): Likewise.
1367 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1368 .debug_gnu_pubtypes.
1369
270c9937
JB
13702014-06-05 Joel Brobecker <brobecker@adacore.com>
1371
1372 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1373 * Makefile.in, configure: Regenerate.
1374
397998fc
AM
13752014-06-03 Alan Modra <amodra@gmail.com>
1376
1377 * powerpc.cc (addis_12_2): Define.
1378 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1379
61f5c66f
AM
13802014-06-03 Alan Modra <amodra@gmail.com>
1381
1382 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1383 st_other output.
1384
f6971787
AM
13852014-06-02 Alan Modra <amodra@gmail.com>
1386
1387 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1388 Only ignore relocs on ELFv1.
1389 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1390
f6fb8322
CC
13912014-05-30 Cary Coutant <ccoutant@google.com>
1392
1393 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1394 * testsuite/Makefile.in: Regenerate.
1395 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1396
c23dd342
L
13972014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1398
1399 PR gold/16945
1400 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1401 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1402
5fe7ffdc
AM
14032014-05-15 Alan Modra <amodra@gmail.com>
1404
1405 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1406 Compare FDE contents with DW_CFA_nop rather than 0.
1407
a82bef93
ST
14082014-05-13 Sriraman Tallam <tmsriram@google.com>
1409
1410 * symtab.h (may_need_copy_reloc): Remove check for position independent
1411 code.
1412 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1413 position independence before pc absolute may_need_copy_reloc call.
1414 Add check for executable output befor pc relative may_need_copy_reloc
1415 call.
1416 * i386.cc: Ditto.
1417 * arm.cc: Ditto.
1418 * sparc.cc: Ditto.
1419 * tilegx.cc: Ditto.
1420 * powerpc.cc: Add check for no position independence before
1421 may_need_copy_reloc calls.
1422 * testsuite/pie_copyrelocs_test.cc: New file.
1423 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1424 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1425 * Makefile.in: Regenerate.
a82bef93 1426
53c66605
ML
14272014-05-08 Martin Liška <mliska@suse.cz>
1428
1429 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1430
57b2284c
CC
14312014-05-06 Cary Coutant <ccoutant@google.com>
1432
1433 PR gold/16900
1434 * i386.cc (Output_data_got_plt_i386): New class.
1435 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1436 parameter. Change all callers.
1437 (Output_data_plt_i386::layout_): Remove.
1438 (Output_data_plt_i386::got_plt_): Change type.
1439 (Target_i386::got_plt_): Change type. Change all references.
1440 (Target_i386::got_section): Create instance of new class.
1441 (Output_data_got_plt_i386::do_write): New function.
1442 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1443 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1444 parameter. Change all callers.
1445 (Output_data_plt_x86_64::layout_): Remove.
1446 (Output_data_plt_x86_64::got_plt_): Change type.
1447 (Target_x86_64::got_plt_): Change type. Change all references.
1448 (Target_x86_64::got_section): Create instance of new class.
1449 (Output_data_got_plt_x86_64::do_write): New function.
1450 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1451 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1452 class.
1453
6b97515d 14542014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1455
6b97515d
CC
1456 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1457 if we have pubnames/pubtypes.
1458
d1bddd3c
CC
14592014-05-02 Cary Coutant <ccoutant@google.com>
1460
5fe7ffdc
AM
1461 * defstd.cc (in_segment): Define __ehdr_start here...
1462 * layout.cc (Layout::finalize): ...Instead of here. Set the
1463 output segment when known.
1464 * resolve.cc (Symbol::override_base_with_special): Remember
1465 the original binding.
1466 * symtab.cc (Symbol::set_output_segment): New function.
1467 (Symbol::set_undefined): New function.
1468 * symtab.h (Symbol::is_weak_undefined): Check original undef
1469 binding.
1470 (Symbol::is_strong_undefined): New function.
1471 (Symbol::set_output_segment): New function.
1472 (Symbol::set_undefined): New function.
1473 * target-reloc.h (is_strong_undefined): Remove.
1474 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1475 Check for hidden undefs.
1476 (relocate_section): Call Symbol::is_strong_undefined.
1477
1478 * testsuite/Makefile.am (ehdr_start_test_1)
1479 (ehdr_start_test_2, ehdr_start_test_3)
1480 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1481 * testsuite/Makefile.in: Regenerate.
1482 * testsuite/ehdr_start_def.cc: New source file.
1483 * testsuite/ehdr_start_test.cc: New source file.
1484 * testsuite/ehdr_start_test.t: New linker script.
1485 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1486
7849f6d8
CC
14872014-04-23 Cary Coutant <ccoutant@google.com>
1488
bf2cc635 1489 PR gold/16870
7849f6d8
CC
1490 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1491
99fd8cff
CC
14922014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1493
1494 * layout.cc (Layout::include_section): Allow a target to decide
1495 whether to include a section.
1496 * target.h (Target::should_include_section): New function.
1497 (Target::do_should_include_section): New function.
1498
91f43acd
CC
14992014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1500
1501 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1502 inline into ...
1503 (Copy_relocs::emit): ... here.
1504 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1505 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1506 (Copy_reloc_entry::entries_): Change from private to protected.
1507
c4eb27e1
ST
15082014-04-02 Sriraman Tallam <tmsriram@google.com>
1509
1510 * icf.cc (get_section_contents): Replace copies of reloc
1511 vectors with const references.
1512
ae447ddd
CC
15132014-04-02 Cary Coutant <ccoutant@google.com>
1514
1515 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1516 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1517 * configure: Regenerate.
1518 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1519 -fno-use-linker-plugin.
1520 (LINK1, CXXLINK1): Add it to the link command.
1521 * testsuite/Makefile.in: Regenerate.
1522
fa47fa92
AM
15232014-03-12 Alan Modra <amodra@gmail.com>
1524
1525 * Makefile.in: Regenerate.
1526
9b12c500
CC
15272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1528
1529 * symtab.h (Symbol::set_nonvis): New function.
1530
beacaa96
CC
15312014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1532
1533 * symtab.cc (Sized_symbol<32>::init_output_data):
1534 Instantiate the template.
1535 (Sized_symbol<64>::init_output_data): Likewise.
1536
800d9823
CC
15372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1538
1539 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1540 adjust dynamic symbol value.
1541 * target.h (Target::adjust_dyn_symbol): New function.
1542 (Target::do_adjust_dyn_symbol): New function.
1543
918fc1f8 15442014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1545
918fc1f8
CC
1546 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1547 Get the value of DYNAMIC_CUSTOM dynamic entry.
1548 * output.h (Output_data_dynamic::add_custom): New function.
1549 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1550 dynamic entry.
1551 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1552 * target.h (Target::dynamic_tag_custom_value): New function.
1553 (Target::do_dynamic_tag_custom_value): New function.
1554
98ff9231
CC
15552014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1556
1557 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1558 dynsym indexes.
1559 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1560 (Target::do_has_custom_set_dynsym_indexes): New function.
1561 (Target::set_dynsym_indexes): New function.
1562 (Target::do_set_dynsym_indexes): New function.
1563
b80eed39
AM
15642014-03-07 Alan Modra <amodra@gmail.com>
1565
1566 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1567 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1568 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1569 (Powerpc_relocate_functions::has_overflow_bitfield,
1570 overflowed): Use the above.
1571 (Target_powerpc::Relocate::relocate): Correct overflow checking
1572 for a number of relocations. Modify overflow test for 16-bit
1573 fields in instructions to signed/unsigned according to whether
1574 the field takes a signed or unsigned value.
1575
4b95cf5c
AM
15762014-03-05 Alan Modra <amodra@gmail.com>
1577
1578 Update copyright years.
1579
45965137
AM
15802014-03-05 Alan Modra <amodra@gmail.com>
1581
1582 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1583 R_PPC64_ADDR64_LOCAL.
1584 (Target_powerpc::Relocate::relocate): Likewise.
1585
2c80b753
AM
15862014-03-03 Alan Modra <amodra@gmail.com>
1587
1588 * dwp.cc (print_version): Update copyright year to current.
1589
c1c69e83
AM
15902014-02-10 Alan Modra <amodra@gmail.com>
1591
1592 * po/gold.pot: Regenerate.
1593
dd0c4e70
CC
15942014-02-06 Cary Coutant <ccoutant@google.com>
1595
1596 Fix problem where -u is ignored when a weak undef is seen.
1597
1598 * archive.cc (Library_base::should_include_member): Reorder
1599 code to check for -u option if a weak undef has already been seen.
1600 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1601 * testsuite/Makefile.in: Regenerate.
1602 * testsuite/weak_undef_file3.cc: New file.
1603 * testsuite/weak_undef_file4.cc: New file.
1604 * testsuite/weak_undef_test_2.cc: New file.
1605
1a221d3d
CC
16062014-02-05 Cary Coutant <ccoutant@google.com>
1607
1608 Fix issues with gold undefined symbol diagnostics.
1609
1610 PR binutils/15435
1611 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1612 check to here.
1613 * target-reloc.h (is_strong_undefined): New function.
1614 (relocate_section): Move undef vtable symbol check from here.
1615 Check for is_strong_undefined.
1616
e889f0a4 16172014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1618
e889f0a4
CC
1619 Fix problems with the --dynamic-list option.
1620
1621 PR gold/13577
1622 * options.cc (General_options::parse_dynamic_list):
1623 Set have_dynamic_list_.
1624 (General_options::General_options): Initialize have_dynamic_list_.
1625 (General_options::finalize): Turn off -Bsymbolic and
1626 -Bsymbolic-functions if --dynamic-list provided.
1627 * options.h (General_options::have_dynamic_list): New function.
1628 (General_options::have_dynamic_list_): New data member.
1629 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1630 correctly.
5fe7ffdc 1631
e889f0a4
CC
1632 PR gold/16530
1633 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1634 in --dynamic-list, mark it.
5fe7ffdc 1635
e889f0a4
CC
1636 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1637 (dynamic_list_2): New test case.
1638 * testsuite/Makefile.in: Regenerate.
1639 * testsuite/dynamic_list_2.cc: New file.
1640 * testsuite/dynamic_list_2.t: New file.
1641 * testsuite/dynamic_list_lib1.cc: New file.
1642 * testsuite/dynamic_list_lib2.cc: New file.
1643 * testsuite/gc_dynamic_list_test.c: New file.
1644 * testsuite/gc_dynamic_list_test.sh: New file.
1645 * testsuite/gc_dynamic_list_test.t: New file.
1646
ec673e64
CC
16472014-01-28 Cary Coutant <ccoutant@google.com>
1648
1649 Add .gdb_index version 7 support.
1650
1651 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1652 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1653 debug sections.
1654 (Dwarf_ranges_table::read_ranges_table): Likewise.
1655 (Dwarf_pubnames_table::read_section): Check for GNU-style
1656 sections, and for compressed debug sections.
1657 (Dwarf_pubnames_table::read_header): Compute end address of table.
1658 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1659 for end of list by offset, not by offset == 0.
1660 (Dwarf_info_reader::do_read_string_table): Check for compressed
1661 debug sections.
1662 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1663 Initialize new data members.
1664 (Dwarf_pubnames_table::next_name): return flag_byte.
1665 (Dwarf_pubnames_table::end_of_table_): New data member.
1666 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1667 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1668 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1669 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1670 read skeleton type unit DIEs.
1671 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1672 (Gdb_index::do_write): Write flag_byte.
1673 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1674 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1675 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1676 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1677
221fd5d5
L
16782014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1679
1680 * version.cc (print_version): Update copyright year to 2014.
1681
6c09fb0b
ILT
16822013-12-19 Dimitry Andric <dimitry@andric.com>
1683
1684 * stringpool.cc (Stringpool_template::reserve): Add
1685 HAVE_UNORDERED_MAP case.
1686 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1687
8356f2d0
CC
16882013-12-18 Cary Coutant <ccoutant@google.com>
1689
1690 * configure.ac: Check for <unordered_set> and <unordered_map>.
1691 * config.in: Regenerate.
1692 * configure: Regenerate.
1693 * system.h: Use <unordered_set> and <unordered_map> if available.
1694
f2c7d7ee
RM
16952013-12-10 Roland McGrath <mcgrathr@google.com>
1696
1697 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1698 with $(INSTALL_PROGRAM_ENV).
1699 * Makefile.in: Regenerate.
1700
6632e8cc
CC
17012013-11-22 Cary Coutant <ccoutant@google.com>
1702
1703 * configure.ac: Add check for which library is needed for
1704 dlopen.
1705 * configure: Regenerate.
1706
0c075858
CC
17072013-11-22 Cary Coutant <ccoutant@google.com>
1708
1709 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1710 assembler.
1711 * testsuite/Makefile.in: Regenerate.
1712
f49fe902
L
17132013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1714
1715 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1716 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1717 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1718 (Target_x86_64<size>::Scan::local): Likewise.
1719 (Target_x86_64<size>::Scan::global): Likewise.
1720 (Target_x86_64<size>::Relocate::relocate): Likewise.
1721 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1722 Likewise.
1723 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1724 R_X86_64_PC32_BND.
1725
1726 * testsuite/Makefile.am (check_PROGRAMS): Add
1727 exception_x86_64_bnd_test.
1728 (exception_x86_64_bnd_test_SOURCES): New macro.
1729 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1730 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1731 (exception_x86_64_bnd_test_LDADD): Likewise.
1732 (exception_x86_64_bnd_1.o): New rule.
1733 (exception_x86_64_bnd_2.o): Likewise.
1734 * testsuite/Makefile.in: Regenerated.
1735
9055360d
AM
17362013-11-15 Alan Modra <amodra@gmail.com>
1737
1738 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1739 accessor.
1740 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1741 Only call ppc64_local_entry_offset for 64-bit. Restrict
1742 symval_for_branch lookup to ELFv1.
1743 (Stub_table::add_plt_call_entry): Use unsigned int off.
1744 (Output_data_glink::Address, invalid_address): New.
1745 (Output_data_glink::add_eh_frame): Move out of line. Add
1746 support for ELFv2.
1747 (Output_data_glink::add_global_entry, find_global_entry,
1748 global_entry_address): New functions.
1749 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1750 ge_size): New variables.
1751 (Output_data_glink::set_final_data_size): Add global entry
1752 stub sizing.
1753 (Output_data_glink::do_write): Write global entry stubs.
1754 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1755 parameter. Return true for ELFv2. Adjust callers.
1756 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1757 ELFv1. Similarly for ifunc and dynamic relocation processing
1758 specific to ELFv1. Recognize that symbols are defined on
1759 their plt entries for ELFv2.
1760 (Target_powerpc::symval_for_branch): Assert if called for
1761 ELFv2 or ppc32.
1762 (Target_powerpc::Relocate::relocate): Use global entry plt
1763 stub for symbol value if such exists on ELFv2.
1764 (Target_powerpc::Relocate::relocate): Don't call
1765 symval_for_branch when ELFv2. Do adjust for local entry
1766 offset when ELFv2.
1767 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1768 plt stub for ELFv2.
1769 (Target_powerpc::do_plt_address_for_global): Similarly.
1770
cafdd569
CC
17712013-11-14 Cary Coutant <ccoutant@google.com>
1772
1773 Revert patch -- this did not fix the problem, and there is
1774 no race there.
1775
1776 2013-11-14 Cary Coutant <ccoutant@google.com>
1777
1778 PR gold/14860
1779 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1780 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1781 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1782 updating fde_offsets_.
1783 (Eh_frame_hdr::lock_): New data member.
1784
94e49e16
CC
17852013-11-14 Cary Coutant <ccoutant@google.com>
1786
1787 * dwp.cc (Dwo_file_entry): New type.
1788 (File_list): Use Dwo_file_entry.
1789 (Dwo_file::verify): New function.
1790 (Dwo_file::verify_dwo_list): New function.
1791 (Dwo_file::sized_verify_dwo_list): New function.
1792 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1793 list.
1794 (Dwp_options): New enum type.
1795 (dwp_options): Add --verify-only.
1796 (usage): Likewise.
1797 (main): Likewise.
1798 * dwp.h (gold_info): Add declaration.
1799
7cdd7d57
CC
18002013-11-14 Cary Coutant <ccoutant@google.com>
1801
1802 PR gold/14860
1803 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1804 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1805 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1806 updating fde_offsets_.
1807 (Eh_frame_hdr::lock_): New data member.
1808
1d946cb3
CC
18092013-11-06 Cary Coutant <ccoutant@google.com>
1810
1811 PR gold/15758
1812 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1813 before reloc sections.
1814
4f65b40e
AM
18152013-11-04 Alan Modra <amodra@gmail.com>
1816
1817 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1818 (Symbol::needs_dynamic_reloc): Test new flag.
1819 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1820 (Target_powerpc::Scan::get_reference_flags): Add target param.
1821 Return FUNC_DESC_ABI for 64-bit ELFv1.
1822 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1823 call.
1824 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1825 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1826
908794a9
CC
18272013-10-31 Cary Coutant <ccoutant@google.com>
1828
1829 Restore support for dwp v2 DWARF package file format.
1830
1831 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1832 tu_length parameter. Adjust all callers.
1833 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1834 * dwp.cc: Include dwarf.h.
1835 (Section_bounds): New struct type.
1836 (Unit_set): New struct type.
1837 (Dwo_file::Dwo_file): Initialize new data member.
1838 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1839 Combine and rename to...
1840 (Dwo_file::read_unit_index): ...this.
1841 (Dwo_file::sized_read_compunit_index)
1842 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1843 (Dwo_file::sized_read_unit_index): ...this.
1844 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1845 parameters; add section_id parameter.
1846 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1847 (Dwo_file::add_unit_set): ...this.
1848 (Dwo_file::shndx_map_): Remove.
1849 (Dwo_file::sect_offsets_): New data member.
1850 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1851 (Dwp_output_file::add_section): Rename to...
1852 (Dwp_output_file::add_contribution): ...this.
1853 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1854 (Dwp_output_file::add_tu_set): Likewise.
1855 (Dwp_output_file::Contribution): New type.
1856 (Dwp_output_file::Section::contributions): New data member.
1857 (Dwp_output_file::Cu_or_tu_set): Remove.
1858 (Dwp_output_file::Section::Section): New ctor.
1859 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1860 (Dwp_output_file::Dwp_index::Section_table): New type.
1861 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1862 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1863 parameter.
1864 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1865 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1866 (Dwp_output_file::Dwp_index::section_table): New member function.
1867 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1868 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1869 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1870 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1871 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1872 (Dwp_output_file::Dwp_index::section_table_): New data member.
1873 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1874 (Dwp_output_file::add_output_section): New member function.
1875 (Dwp_output_file::write_new_section): New member function.
1876 (Dwp_output_file::write_contributions): New member function.
1877 (Dwp_output_file::section_id_map_): New data member.
1878 (class Dwo_id_info_reader): Remove.
1879 (class Unit_reader): New class.
1880 (get_dwarf_section_name): New function.
1881 (Dwo_file::read_executable): Adjust initializations of class data.
1882 (Dwo_file::read): Add support for v2 package file format.
1883 (Dwo_file::read_unit_index): Likewise.
1884 (Dwo_file::sized_read_unit_index): Likewise.
1885 (Dwo_file::copy_section): Likewise.
1886 (Dwo_file::add_unit_set): Likewise.
1887 (Dwp_output_file::add_output_section): Likewise.
1888 (Dwp_output_file::add_contribution): Likewise.
1889 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1890 for empty slot.
1891 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1892 file format.
1893 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1894 slot.
1895 (Dwp_output_file::initialize): Remove unused function.
1896 (Dwp_output_file::finalize): Add support for v2 package file format.
1897 (Dwp_output_file::write_index): Likewise.
1898 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1899 function prototype.
1900
2500c017
CC
19012013-10-31 Cary Coutant <ccoutant@google.com>
1902
1903 * configure.ac: Fix check for -fmerge-constants.
1904 * configure.ac: Regenerate.
1905
dd0845d7
RM
19062013-10-30 Roland McGrath <mcgrathr@google.com>
1907
1908 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1909 Correct 9-byte nop sequence to match what the assembler generates.
1910
b4f7960d
AM
19112013-10-30 Alan Modra <amodra@gmail.com>
1912
1913 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1914 ppc64_local_entry_offset, ppc64_local_entry_offset,
1915 do_read_symbols): New functions.
1916 (Powerpc_relobj::e_flags_, st_other_): New vars.
1917 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1918 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1919 (Powerpc_relobj::e_flags_): New var.
1920 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1921 and adjust for ELFv2.
1922 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1923 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1924 (Powerpc_dynobj::do_find_special_sections): Likewise.
1925 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1926 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1927 to ELFv2 local entry.
1928 (Target_powerpc::do_relax): No thread safe barriers needed for
1929 ELFv2.
1930 (Output_data_plt_powerpc::initial_plt_entry_size_,
1931 plt_entry_size): Delete. Replace all uses with
1932 first_plt_entry_offset() and plt_entry_size().
1933 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1934 reserved_size parm. Update callers.
1935 (Output_data_plt_powerpc::entry_count): Update.
1936 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1937 and use Target_powerpc::first_plt_entry_offset().
1938 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1939 rename to plt_entry_size.
1940 (Output_data_plt_powerpc::add_ifunc_entry,
1941 add_local_ifunc_entry): Adjust reloc for ELFv2.
1942 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1943 (glink_eh_frame_fde_64v2): New.
1944 (Stub_table::plt_call_size): Support ELFv2 sizing.
1945 (Output_data_glink::add_eh_frame): Use the new FDE.
1946 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1947 (Stub_table::do_write): Write ELFv2 stubs and glink.
1948 (Target_powerpc::Relocate::relocate): Replaces nop after call
1949 with ld 2,24(1) and adjust local offset destination for ELFv2.
1950
f9c6b907
AM
19512013-10-30 Alan Modra <amodra@gmail.com>
1952
1953 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1954 (Target_powerpc::Scan::global, local): Likewise.
1955 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1956 on all ppc64 @h and @ha relocs.
1957
e84fe78f
AM
19582013-10-14 Alan Modra <amodra@gmail.com>
1959
1960 * output.h (Output_data_got::add_constant): Tidy.
1961 (Output_data_got::add_constant_pair): New function.
1962 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1963 methods used so as to first call reserve_ent().
1964
679e4abf
RM
19652013-10-11 Roland McGrath <mcgrathr@google.com>
1966
44dcb735
RM
1967 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1968 add_got_entry and add_got_entry_pair.
1969
13323c49
RM
1970 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1971 (HAVE_PUBNAMES): Likewise.
1972 * configure: Regenerate.
1973
1496b446
RM
1974 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1975 * testsuite/Makefile.in: Regenerate.
1976
cc84c10b
RM
1977 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1978 Remove const from declaration.
1979 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1980 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1981 * output.h (Output_file_header): Remove const from member target_
1982 and corresponding constructor argument.
1983 * output.cc (Output_file_header::Output_file_header): Update prototype.
1984 (Output_file_header::do_sized_write): Use this->target_ in place
1985 of parameters()->target().
1986
52f66a2c
RM
1987 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1988
2b64b551
RM
1989 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1990 * configure: Regenerate.
1991 * Makefile.in: Regenerate.
1992 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1993 * testsuite/merge_string_literals_2.c: Likewise.
1994 * testsuite/Makefile.am
1995 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1996 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1997 literal -fmerge-constants.
1998 * testsuite/Makefile.in: Regenerate.
1999
43819297
RM
2000 * i386.cc (Target_i386): Remove unused member dynbss_.
2001 * arm.cc (Target_arm): Likewise.
2002 * powerpc.cc (Target_powerpc): Likewise.
2003 * sparc.cc (Target_sparc): Likewise.
2004 * tilegx.cc (Target_tilegx): Likewise.
2005 * x86_64.cc (Target_x86_64): Likewise.
2006 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2007 type_signature_, type_offset_.
2008 * plugin.h (Plugin_hook): Remove unused member layout_.
2009 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2010 mapfile_.
2011 (Read_member): Remove unused members input_objects_, symtab_,
2012 mapfile_, layout_.
2013 (Check_library): Remove unused member symtab_.
2014 * archive.h (Lib_group): Remove unused member lib_.
2015 * archive.cc (Lib_group::Lib_group): Update initializer.
2016 * incremental.h (Incremental_binary): Remove unused member target_.
2017 (Incremental_script_entry): Removed unused member script_.
2018 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2019 * icf.h (Icf): Remove unused member num_tracked_relocs.
2020
39d9ead7
RM
2021 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2022 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2023 its only use.
2024 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2025
679e4abf
RM
2026 * archive.h: Use struct rather than class for forward declaration
2027 of Read_symbols_data.
2028
54de2ea6
CC
20292013-10-07 Cary Coutant <ccoutant@google.com>
2030
2031 PR gold/16010
2032 * testsuite/Makefile.am (icf_test): Fix dependencies.
2033 (icf_safe_test): Likewise.
2034 (icf_safe_so_test): Likewise.
2035 (large_symbol_alignment): Add empty _LDADD rule.
2036 * testsuite/Makefile.in: Regenerate.
2037
b14016f0
L
20382013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2039
2040 PR gold/15927
2041 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2042 relocation for R_X86_64_32 on x32.
2043
eb426534
RM
20442013-08-27 Roland McGrath <mcgrathr@google.com>
2045
2046 * output.cc (Output_segment::set_section_addresses): Take new
2047 Target* argument. If target->isolate_execinstr() and the segment
2048 is executable and starts at a target->abi_pagesize() boundary,
2049 pad its end out to a target->abi_pagesize() boundary with code fill.
2050 * output.h (Output_segment::set_section_addresses): Update decl.
2051 * layout.h (Layout::check_output_data_for_reset_values): Take new
2052 argument RELAX_OUTPUTS.
2053 (Layout): New member relax_output_list_.
2054 (Layout::add_relax_output): New method.
2055 * layout.cc (Layout::Layout): Update constructor.
2056 (Layout::reset_relax_output): New method.
2057 (Layout::clean_up_after_relaxation): Call it.
2058 (Layout::prepare_for_relaxation): Update caller.
2059 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2060 Call reset_relax_output before re-processing segments for
2061 isolate_execinstr case.
2062 (Layout::write_data): Handle relax_output_list_.
2063 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2064 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2065
9aff4b7a
NC
20662013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2067
2068 PR binutils/15834
2069 * object.h: Fix typos.
2070
93f8221c
RM
20712013-08-16 Roland McGrath <mcgrathr@google.com>
2072
2073 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2074 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2075
e44c3715
CC
20762013-08-07 Cary Coutant <ccoutant@google.com>
2077
2078 Revert support for v2 DWP files:
2079
2080 2013-03-01 Cary Coutant <ccoutant@google.com>
2081
2082 Add dwp support for v2 DWARF package file format.
2083 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2084 tu_length parameter. Adjust all callers.
2085 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2086 * dwp.cc: Include dwarf.h.
2087 (Section_bounds): New struct type.
2088 (Unit_set): New struct type.
2089 (Dwo_file::Dwo_file): Initialize new data member.
2090 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2091 Combine and rename to...
2092 (Dwo_file::read_unit_index): ...this.
2093 (Dwo_file::sized_read_compunit_index)
2094 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2095 (Dwo_file::sized_read_unit_index): ...this.
2096 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2097 parameters; add section_id parameter.
2098 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2099 (Dwo_file::add_unit_set): ...this.
2100 (Dwo_file::shndx_map_): Remove.
2101 (Dwo_file::sect_offsets_): New data member.
2102 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2103 (Dwp_output_file::add_section): Rename to...
2104 (Dwp_output_file::add_contribution): ...this.
2105 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2106 (Dwp_output_file::add_tu_set): Likewise.
2107 (Dwp_output_file::Contribution): New type.
2108 (Dwp_output_file::Section::contributions): New data member.
2109 (Dwp_output_file::Cu_or_tu_set): Remove.
2110 (Dwp_output_file::Section::Section): New ctor.
2111 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2112 (Dwp_output_file::Dwp_index::Section_table): New type.
2113 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2114 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2115 parameter.
2116 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2117 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2118 (Dwp_output_file::Dwp_index::section_table): New member function.
2119 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2120 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2121 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2122 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2123 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2124 (Dwp_output_file::Dwp_index::section_table_): New data member.
2125 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2126 (Dwp_output_file::add_output_section): New member function.
2127 (Dwp_output_file::write_new_section): New member function.
2128 (Dwp_output_file::write_contributions): New member function.
2129 (Dwp_output_file::section_id_map_): New data member.
2130 (class Dwo_id_info_reader): Remove.
2131 (class Unit_reader): New class.
2132 (get_dwarf_section_name): New function.
2133 (Dwo_file::read_executable): Adjust initializations of class data.
2134 (Dwo_file::read): Add support for v2 package file format.
2135 (Dwo_file::read_unit_index): Likewise.
2136 (Dwo_file::sized_read_unit_index): Likewise.
2137 (Dwo_file::copy_section): Likewise.
2138 (Dwo_file::add_unit_set): Likewise.
2139 (Dwp_output_file::add_output_section): Likewise.
2140 (Dwp_output_file::add_contribution): Likewise.
2141 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2142 for empty slot.
2143 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2144 file format.
2145 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2146 slot.
2147 (Dwp_output_file::initialize): Remove unused function.
2148 (Dwp_output_file::finalize): Add support for v2 package file format.
2149 (Dwp_output_file::write_index): Likewise.
2150 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2151 function prototype.
2152
c6905c28
CC
21532013-07-31 Cary Coutant <ccoutant@google.com>
2154
2155 * object.cc (Sized_relobj::do_output_section_address): New function.
2156 (Sized_relobj): Instantiate explicitly.
2157 * object.h (Object::output_section_address): New function.
2158 (Object::do_output_section_address): New function.
2159 (Sized_relobj::do_output_section_address): New function.
2160 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2161
21622013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2163 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2164
2165 * parameters.cc (Parameters::entry): Return target-specific entry
2166 symbol name.
2167 * target.h (Target::entry_symbol_name): New function.
2168 (Target_info::entry_symbol_name): New data member.
2169
2170 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2171 * i386.cc (Target_i386::i386_info): Likewise.
2172 (Target_i386_nacl::i386_nacl_info): Likewise.
2173 * sparc.cc (Target_sparc::sparc_info): Likewise.
2174 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2175 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2176 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2177 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2178
234d4ab8
SA
21792013-07-22 Sterling Augustine <saugustine@google.com>
2180
2181 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2182 Convert parameter shndx to local variable. Add parameters symtab
2183 and symtab_size. Scan over section names. Find relocation
2184 section corresponding to current section. Create and initialize
2185 reloc_mapper_ and reloc_type_.
2186 (Dwarf_pubnames_table::read_header): Add assertion. Change
2187 unit_length to off_t. Initialize member unit_length_. Fill in field
2188 cu_offset_.
2189 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2190 Initialize new fields unit_length_ and cu_offset_.
2191 (Dwarf_pubnames_table::read_section): Update prototype.
2192 (Dwarf_pubnames_table::cu_offset): New member function.
2193 (Dwarf_pubnames_table::subsection_size): Likewise.
2194 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2195 New fields.
2196 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2197 member functions public.
2198 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2199 Update comment. Rework logic. Move repeated parts to...
2200 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2201 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2202 pubtypes_table_, and stmt_list_offset.
2203 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2204 Gdb_index::find_pubtype_offset,
2205 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2206 (Gdb_index::pubnames_read): Update prototype and rework logic.
2207 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2208 Forward declare.
2209 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2210 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2211 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2212 Gdb_index::map_pubtable_to_dies):
2213 Declare functions.
2214 (Gdb_index::pubnames_read): Update declaration.
2215 (Gdb_index::Pubname_offset_map): New type.
2216 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2217 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2218 Gdb_index::stmt_list_offset): Declare.
2219 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2220 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2221 Gdb_index::pubtypes_offset_): Remove.
2222
a3ed37d8
RM
22232013-07-19 Roland McGrath <mcgrathr@google.com>
2224
2225 * options.h (General_options): Add -Trodata-segment option.
2226 * parameters.cc (Parameters::check_rodata_segment): New function.
2227 (Parameters::set_target_once): Call it.
2228 * parameters.h (Parameters): Declare it (private member function).
2229 * layout.cc (load_seg_unusable_for_headers): New function, broken
2230 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2231 then validate rodata segment rather than text segment.
2232 (relaxation_loop_body): Call that.
2233 (is_text_segment): New function. Don't admit a non-executable
2234 segment if TARGET->isolate_execinstr().
2235 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2236
eb5b4ded
CC
22372013-07-15 Shawn Landden <shawnlandden@gmail.com>
2238
2239 PR gold/15070
2240 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2241 * nacl.h (Sniff_file::View::View): Request aligned view.
2242
4d5effb9
CC
22432013-07-11 Cary Coutant <ccoutant@google.com>
2244
2245 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2246 correct BRLT entry size.
2247
ba8ca3e7
AM
22482013-07-03 Alan Modra <amodra@gmail.com>
2249
2250 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2251 comment.
2252
267257d2
CC
22532013-07-01 Cary Coutant <ccoutant@google.com>
2254
2255 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2256 reloc_type_.
2257 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2258 (Dwarf_ranges_table::lookup_reloc): New function.
2259 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2260 reloc_type_.
2261 (Dwarf_ranges_table::lookup_reloc): New function.
2262 (Dwarf_ranges_table::reloc_type_): New data member.
2263
06f30c9d
CC
22642013-06-27 Jing Yu <jingyu@google.com>
2265
2266 PR gold/15662
2267 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2268 function.
2269 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2270 (Target_powerpc::do_relax): Call the above.
2271
a2d7bf59
AM
22722013-06-27 Cary Coutant <ccoutant@google.com>
2273
2274 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2275 on garbage collected .opd section.
2276
22772013-06-27 Alan Modra <amodra@gmail.com>
2278
2279 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2280 is non-zero.
2281 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2282 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2283
32364e50
CC
22842013-06-14 Cary Coutant <ccoutant@google.com>
2285
2286 * resolve.cc (Symbol::override_base): Don't override st_type
2287 from plugin placeholder symbols.
2288 (Symbol_table::resolve): Likewise.
2289 (Symbol_table::should_override): Don't complain about TLS mismatch
2290 if the TO symbol is a plugin placeholder.
2291 * testsuite/Makefile.am (plugin_test_tls): New test.
2292 * testsuite/Makefile.in: Regenerate.
2293 * testsuite/plugin_test_tls.sh: New test script.
2294 * testsuite/two_file_test_2_tls.cc: New test source.
2295 * testsuite/two_file_test_tls.cc: New test source.
2296
7fb47cc9
CC
22972013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2298
2299 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2300 the maximum segment alignment is larger than the page size.
2301 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2302 correctly aligns the symbols with large alignemnt.
2303 * testsuite/Makefile.in: Regenerate.
2304 * testsuite/large_symbol_alignment.cc: New file.
2305
6934001a
CC
23062013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2307 Sriraman Tallam <tmsriram@google.com>
2308
2309 * options.h (sort_section): New option.
2310 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2311 Rename from Input_section_sort_section_name_special_ordering_compare.
2312 (Input_section_sort_section_name_compare): New struct.
2313 * output.cc (Output_section::Input_section_sort_section_name_compare::
2314 operator()): New function.
2315 (Output_section::sort_attached_input_sections): Use new sort function
2316 for .text if --sort-section=name is specified.
2317 * layout.cc (Layout::make_output_section):
2318 Add sorting by name when --sort-section=name is specified.
2319 * testsuite/Makefile.am (text_section_grouping): Test option
2320 --sort-section=name.
2321 * testsuite/Makefile.in: Regenerate.
2322 * testsuite/section_sorting_name.cc: New file.
2323 * testsuite/section_sorting_name.sh: New file.
2324
93acabad
CC
23252013-05-21 Cary Coutant <ccoutant@google.com>
2326
2327 * symtab.h (Symbol::is_cxx_vtable): New function.
2328 * target-reloc.h (relocate_section): Check for vtable symbol.
2329 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2330 * testsuite/Makefile.in: Regenerate.
2331 * testsuite/missing_key_func.cc: New test source.
2332 * testsuite/missing_key_func.sh: New test script.
2333
60e8b3fc
CC
23342013-05-21 Cary Coutant <ccoutant@google.com>
2335
2b64b551
RM
2336 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2337 type of enclosing symbol.
2338 (Relocate_info::location): Check symbol type when describing symbol.
2339 * object.h (Symbol_location_info): Remove unused line_number;
2340 add enclosing_symbol_type.
2341 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2342
9df9de2c
CC
23432013-05-13 Cary Coutant <ccoutant@google.com>
2344
2b64b551
RM
2345 * configure.ac: Export DEFAULT_TARGET.
2346 * configure: Regenerate.
2347 * Makefile.in: Regenerate.
2348 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2349 * testsuite/Makefile.in: Regenerate.
2350 * testsuite/debug_msg.sh: Delete duplicate tests.
2351 Don't check undef_int error message match for powerpc where the
2352 source file and line number aren't available.
9df9de2c 2353
bbc5ae17
RM
23542013-05-10 Roland McGrath <mcgrathr@google.com>
2355
2356 * options.h (General_options): Add --rosegment-gap option.
2357 * options.cc (finalize): --rosegment-gap implies --rosegment.
2358 * layout.cc (set_segment_offsets): Let user option override
2359 target->rosegment_gap().
2360
0c6e6c39
RM
23612013-05-10 Roland McGrath <mcgrathr@google.com>
2362
2363 * options.h (General_options): Remove leading space from help
2364 messages for -nostdlib and --rosegment.
2365
cde7cb01
MR
23662013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2367
2368 PR ld/15365
2369 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2370
f31ae5b8
AM
23712013-05-03 Alan Modra <amodra@gmail.com>
2372
2373 * merge.cc (Output_merge_string::do_add_input_section): Correct
2374 scan for number of strings. Rename vars to avoid shadowing.
2375 Include missing terminator in input_size_.
2376
d3a7cd45
L
23772013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2378
2379 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2380 Restore empty string handling.
2381
6ad3daba
CC
23822013-05-01 Cary Coutant <ccoutant@google.com>
2383
2384 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2385 uninitialized warning.
2386
e31908b6
CC
23872013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2388
2389 * output.cc (Output_section::add_merge_input_section): Allow
2390 to merge sections if the alignment is more than character size.
2391 * merge.h (Output_merge_string::Output_merge_string): Remove
2392 assert.
2393 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2394 only not-null strings. Check the alignment of strings.
2395 * stringpool.h
2396 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2397 alignment as the argument.
2398 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2399 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2400 Align non-zero length strings according to the addralign_.
2401 (Stringpool_template<Stringpool_char>::set_string_offsets):
2402 Updating offsets according to the given alignment.
2403 * testsuite/Makefile.am (text_section_grouping): Test if string
2404 literals are getting merged.
2405 * testsuite/Makefile.in: Regenerate.
2406 * testsuite/merge_string_literals_1.c: New file.
2407 * testsuite/merge_string_literals_2.c: Ditto.
2408 * testsuite/merge_string_literals.sh: Ditto.
2409
0e804863
ILT
24102013-04-26 Ian Lance Taylor <iant@google.com>
2411
2412 * target-reloc.h (relocate_section): If the reloc offset is out of
2413 range, pass VIEW as NULL to relocate.relocate.
2414 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2415 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2416 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2417 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2418 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2419 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2420
e7c5ea40
CC
24212013-04-26 Geoff Pike <gpike@chromium.org>
2422
2423 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2424 * layout.cc (Hash_task): New class.
2425 (Layout::queue_build_id_tasks): New function.
2426 (Layout::write_build_id): Handle single-thread portion of build ID
2427 computation. (In some cases, all of it is single-threaded.) Replace
2428 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2429 functionality in fewer lines of code.
2430 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2431 * options.h (General_options): make "--build-id" default to tree
2432 rather than sha1. Add two new options related to --build-id=tree:
2433 --build-id-chunk-size-for-treehash and
2434 --build-id-min-file-size-for-treehash.
2435 * Makefile.am: add testing of --build-id=tree and related new options
2436 (these tests will be invoked by "make check").
2437 * Makefile.in: Regenerate.
2438
49926cd0
AM
24392013-04-25 Alan Modra <amodra@gmail.com>
2440
2441 * configure.tgt: Add powerpcle and powerpc64le.
2442
a4034750
AM
24432013-04-22 Alan Modra <amodra@gmail.com>
2444
2445 PR gold/15355
2446 * layout.cc (Layout::segment_precedes): Allow more than one
2447 segment with the same type and flags.
2448
e79c84aa
CC
24492013-04-15 Cary Coutant <ccoutant@google.com>
2450
2451 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2452 allocate space in file for BSS sections.
2453
2199fbe7
CC
24542013-04-15 Cary Coutant <ccoutant@google.com>
2455
2456 * script-sections.cc (Orphan_output_section): Reset address
2457 to zero after each orphaned section for relocatable links.
2458
502e8a84
CC
24592013-04-15 Cary Coutant <ccoutant@google.com>
2460
a4034750
AM
2461 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2462 section starting address for relocatable link.
2463 * testsuite/Makefile.am (script_test_11): New test.
2464 * testsuite/Makefile.in: Regenerate.
2465 * testsuite/script_test_11.c: New source file.
2466 * testsuite/script_test_11.t: New linker script.
502e8a84 2467
0cfdc767
AM
24682013-04-13 Alan Modra <amodra@gmail.com>
2469
2470 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2471 owner when sections are not adjacent and exceed group size.
2472 (Target_powerpc::group_sections): Handle corner case.
2473 (Target_powerpc::Branch_info::make_stub): Handle case where
2474 stub table doesn't exist due to branches in non-exec sections.
2475 (Target_powerpc::Relocate::relocate): Likewise.
2476
6830ee24
AM
24772013-04-11 Alan Modra <amodra@gmail.com>
2478
2479 PR gold/15354
2480 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2481 .branch_lt to match bfd ld. Adjust comments throughout file.
2482
54a3d865
ILT
24832013-04-04 Ian Lance Taylor <iant@google.com>
2484
2485 GCC PR c++/56840
2486 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2487 sections before checking whether they are included in the link.
2488
9993ba11
ST
24892013-03-29 Sriraman Tallam <tmsriram@google.com>
2490
2491 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2492 object before calling the plugin claim_file handler. Pass the elf
2493 object of the archive to the plugin. Delete the elf object if the
2494 plugin claims the file.
2495
ebacd51e
AM
24962013-03-21 Alan Modra <amodra@gmail.com>
2497
2498 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2499 segment when omagic.
2500
117be58f
AM
25012013-03-21 Alan Modra <amodra@gmail.com>
2502
2503 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2504 comparison warning.
2505 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2506 uninitialized" warning.
2507
32e2b61d
AM
25082013-03-20 Alan Modra <amodra@gmail.com>
2509
2510 * symtab.h (Symbol::clear_version): New function.
2511 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2512 is_needed by weak references. Clear version for symbols defined
2513 in as-needed objects that are not needed.
2514
b3ccdeb5
AM
25152013-03-15 Alan Modra <amodra@gmail.com>
2516
2517 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2518 static and public. Add report_err param. Return false for data refs.
2519 (Target_powerpc::rela_dyn_section): New overloaded function.
2520 (Target_powerpc::plt_, iplt_): Elucidate.
2521 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2522 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2523 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2524 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2525 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2526 push_branch and make_plt_entry for ifunc syms when
2527 reloc_needs_plt_for_ifunc.
2528 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2529 for ifunc unless reloc_needs_plt_for_ifunc.
2530
ad3d8a2f
AM
25312013-03-15 Alan Modra <amodra@gmail.com>
2532
2533 * gc.h (gc_process_relocs): Don't look through function descriptors.
2534 * icf.cc (get_section_contents): Do so here instead.
2535
4d9aa155
AM
25362013-03-13 Alan Modra <amodra@gmail.com>
2537
2538 * powerpc.cc (is_branch_reloc): Forward declare.
2539 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2540 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2541 false for 64-bit, true for 32-bit non-branch relocs.
2542 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2543 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2544 nm output.
2545 (icf_safe_test): Generate linker map file as well as nm output.
2546 (icf_safe_so_test): Likewise.
2547 * testsuite/Makefile.in: Regenerate.
2548 * testsuite/icf_test.sh: Parse linker map file to determine
2549 section folding.
2550 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2551 * testsuite/icf_safe_so_test.sh: Likewise.
2552 (X86_32_or_ARM_specific_safe_fold): Merge into..
2553 (arch_specific_safe_fold): ..this.
2554 (X86_64_specific_safe_fold): Delete unused function.
2555
57420c20
AM
25562013-03-12 Alan Modra <amodra@gmail.com>
2557
2558 * gc.h (gc_process_relocs): Look through function descriptors
2559 to determine shndx, symvalue and addend used by ICF. Tidy
2560 variable duplication.
2561
dc3714f3
AM
25622013-03-11 Alan Modra <amodra@gmail.com>
2563
2564 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2565 * layout.cc (Layout_task_runner::run): ..to here.
2566 * symtab.h (struct Symbol_location): Extract from..
2567 (class Symbol_table): ..here.
2568 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2569 * target.h (class Target): Add function_location and
2570 do_function_location functions.
2571 (class Sized_target): Add do_function_location.
2572 * object.h (class Sized_relobj_file): Move find_shdr..
2573 (class Object): ..to here.
2574 * object.cc: Likewise. Update to suit. Instantiate.
2575 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2576 * powerpc.cc (class Powerpc_dynobj): New.
2577 (Target_powerpc::do_function_location): New function.
2578 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2579 (Powerpc_dynobj::do_read_symbols): New function.
2580 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2581
956b03bb
ILT
25822013-03-08 Ian Lance Taylor <iant@google.com>
2583
2584 * options.cc (General_options::string_to_object_format): Accept
2585 "default".
2586
4bead2d5
AM
25872013-03-08 Alan Modra <amodra@gmail.com>
2588
2589 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2590 pointer to Post_fde.
2591 (struct Post_fde): Move definition to here..
2592 * ehframe.cc (struct Post_fde): ..from here.
2593 (Cie::write): Don't alloc Post_fde.
2594 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2595
02e60bf7
AM
25962013-03-07 Alan Modra <amodra@gmail.com>
2597
2598 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2599 relocation referencing .LC0.
2600 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2601
8343f03a
AM
26022013-03-07 Alan Modra <amodra@gmail.com>
2603
2604 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2605 always_inline. Add assembly for powerpc to avoid GOT.
2606
3366d57c
AM
26072013-03-07 Alan Modra <amodra@gmail.com>
2608
2609 * testsuite/script_test_10.sh: Don't test .bss section
2610 header number.
2611
6c77229c
AM
26122013-03-06 Alan Modra <amodra@gmail.com>
2613
2614 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2615 (Target_powerpc::symval_for_branch): Add symtab param. Update
2616 all callers. Handle folded sections.
2617 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2618 to Powerpc_relobj.
2619 (Global_symbol_visitor_opd::operator()): Likewise.
2620
a39e4af6
AM
26212013-03-04 Alan Modra <amodra@gmail.com>
2622
2623 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2624 * testsuite/Makefile.in: Regenerate.
2625
d5834edb
CC
26262013-03-01 Cary Coutant <ccoutant@google.com>
2627
2628 Add dwp support for v2 DWARF package file format.
2629 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2630 tu_length parameter. Adjust all callers.
2631 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2632 * dwp.cc: Include dwarf.h.
2633 (Section_bounds): New struct type.
2634 (Unit_set): New struct type.
2635 (Dwo_file::Dwo_file): Initialize new data member.
2636 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2637 Combine and rename to...
2638 (Dwo_file::read_unit_index): ...this.
2639 (Dwo_file::sized_read_compunit_index)
2640 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2641 (Dwo_file::sized_read_unit_index): ...this.
2642 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2643 parameters; add section_id parameter.
2644 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2645 (Dwo_file::add_unit_set): ...this.
2646 (Dwo_file::shndx_map_): Remove.
2647 (Dwo_file::sect_offsets_): New data member.
2648 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2649 (Dwp_output_file::add_section): Rename to...
2650 (Dwp_output_file::add_contribution): ...this.
2651 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2652 (Dwp_output_file::add_tu_set): Likewise.
2653 (Dwp_output_file::Contribution): New type.
2654 (Dwp_output_file::Section::contributions): New data member.
2655 (Dwp_output_file::Cu_or_tu_set): Remove.
2656 (Dwp_output_file::Section::Section): New ctor.
2657 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2658 (Dwp_output_file::Dwp_index::Section_table): New type.
2659 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2660 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2661 parameter.
2662 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2663 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2664 (Dwp_output_file::Dwp_index::section_table): New member function.
2665 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2666 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2667 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2668 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2669 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2670 (Dwp_output_file::Dwp_index::section_table_): New data member.
2671 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2672 (Dwp_output_file::add_output_section): New member function.
2673 (Dwp_output_file::write_new_section): New member function.
2674 (Dwp_output_file::write_contributions): New member function.
2675 (Dwp_output_file::section_id_map_): New data member.
2676 (class Dwo_id_info_reader): Remove.
2677 (class Unit_reader): New class.
2678 (get_dwarf_section_name): New function.
2679 (Dwo_file::read_executable): Adjust initializations of class data.
2680 (Dwo_file::read): Add support for v2 package file format.
2681 (Dwo_file::read_unit_index): Likewise.
2682 (Dwo_file::sized_read_unit_index): Likewise.
2683 (Dwo_file::copy_section): Likewise.
2684 (Dwo_file::add_unit_set): Likewise.
2685 (Dwp_output_file::add_output_section): Likewise.
2686 (Dwp_output_file::add_contribution): Likewise.
2687 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2688 for empty slot.
2689 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2690 file format.
2691 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2692 slot.
2693 (Dwp_output_file::initialize): Remove unused function.
2694 (Dwp_output_file::finalize): Add support for v2 package file format.
2695 (Dwp_output_file::write_index): Likewise.
2696 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2697 function prototype.
2698
a68a081d
CC
26992013-03-01 Cary Coutant <ccoutant@google.com>
2700
2701 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2702 function into class definition in header file.
2703 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2704 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2705 New function.
2706 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2707
9d5781f8
AM
27082013-02-28 Alan Modra <amodra@gmail.com>
2709
2710 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2711 * target.cc (Target::do_plt_fde_location): New function.
2712 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2713 accessor function, and constructor param.
2714 (struct Post_fde, Post_fdes): Declare.
2715 (Cie::write): Add post_fdes param.
2716 * ehframe.cc (Fde::write): Use plt_fde_location.
2717 (struct Post_fde): Define.
2718 (Cie::write): Stash FDEs added post merge mapping.
2719 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2720 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2721 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2722 other FDEs.
2723 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2724 (Target_powerpc::has_glink): New function.
2725 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2726 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2727 glink_eh_frame_fde_32, default_fde): New data.
2728 (Stub_table::eh_frame_added_): New var.
2729 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2730 Make const.
2731 (Stub_table::add_eh_frame): New function.
2732 (Output_data_glink::add_eh_frame): New function.
2733 (Target_powerpc::make_glink_section): Call add_eh_frame.
2734
214383dd
ILT
27352013-02-15 Ian Lance Taylor <iant@google.com>
2736
2737 * options.h (DEFINE_uint64_alias): Define.
2738 (class General_options): Add -Ttext-segment as an alias for
2739 -Ttext.
2740
91c2b899
AM
27412013-02-15 Alan Modra <amodra@gmail.com>
2742
2743 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2744 (Stub_table::do_write): ..here, two places.
2745 (Stub_table::plt_call_size): Use it here too.
2746
20e2a8aa
ILT
27472013-02-11 Ian Lance Taylor <iant@google.com>
2748
2749 * descriptors.cc (Descriptors::close_all): New function.
2750 * descriptors.h (class Descriptors): Declare close_all.
2751 (close_all_descriptors): New inline function.
2752 * plugin.cc: Include "descriptors.h".
2753 (Plugin_manager::cleanup): Call close_all_descriptors.
2754
8952bc69
AM
27552013-02-06 Alan Modra <amodra@gmail.com>
2756
2757 * README: Update coding style link.
2758
29bd8b6b
CC
27592013-01-28 Cary Coutant <ccoutant@google.com>
2760
a4034750
AM
2761 * dwp.cc (File_list): New typedef.
2762 (Dwo_name_info_reader): New class.
2763 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2764 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2765 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2766 (Dwo_file::read_executable): New function.
2767 (Dwo_file::read): Move common setup code to ...
2768 (Dwo_file::make_object): ... here.
2769 (dwp_options): Add --exec/-e.
2770 (usage): Likewise.
2771 (main): Likewise.
29bd8b6b 2772
c6ac678d
ST
27732013-01-24 Sriraman Tallam <tmsriram@google.com>
2774
2775 * layout.cc (Layout::layout): Check for option text_reorder.
2776 (Layout::make_output_section): Ditto.
2777 * options.h (text_reorder): New option.
2778 * output.cc (Input_section_sort_compare): Remove special ordering
2779 of section names.
2780 (Output_section::
2781 Input_section_sort_section_name_special_ordering_compare::
2782 operator()): New function.
2783 (Output_section::sort_attached_input_sections): Use new sort function
2784 for .text.
2785 * output.h (Input_section_sort_section_name_special_ordering_compare):
2786 New struct.
2787 * testsuite/Makefile.am (text_section_grouping): Test option
2788 --no-text-reorder
2789 * testsuite/Makefile.in: Regenerate.
2790 * testsuite/text_section_grouping.sh: Check order of functions without
2791 default text reordering.
2792
50701cc1
MF
27932013-01-18 Mike Frysinger <vapier@gentoo.org>
2794
2795 * options.h (General_options): Change default to true for new_dtags.
2796
b1b00fcc
MF
27972013-01-18 Mike Frysinger <vapier@gentoo.org>
2798
2799 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2800 when enable_new_dtags is false. Only add DT_RUNPATH when
2801 enable_new_dtags is true.
2802
ec5b8187
AM
28032013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2804
2805 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2806 used in declaration and definition consistent.
2807 (Target_powerpc::symval_for_branch): Ditto.
2808
a880d4c4
ST
28092013-01-16 Sriraman Tallam <tmsriram@google.com>
2810
2811 * testsuite/plugin_final_layout.cc: Fix comment.
2812
7c381248
ST
28132013-01-16 Sriraman Tallam <tmsriram@google.com>
2814
2815 * layout.cc (Layout::layout): Do not do default sorting for
2816 text sections when section ordering is specified.
2817 (make_output_section): Ditto.
2818 * testsuite/plugin_final_layout.cc: Name the function sections
2819 to catch reordering issues.
2820
e2458743
AM
28212013-01-15 Alan Modra <amodra@gmail.com>
2822
2823 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2824 plt-thread-safe.
2825
431ed302
AM
28262013-01-15 Alan Modra <amodra@gmail.com>
2827
2828 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2829 * testsuite/Makefile.in: Regenerate.
2830
0ec6429b
AM
28312013-01-14 Alan Modra <amodra@gmail.com>
2832
2833 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2834 * testsuite/Makefile.in: Regenerate.
2835
0bf402d5
ILT
28362013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2837
36af3926 2838 PR bfd/14430
0bf402d5
ILT
2839 Fix mingw gold build with plugins enabled
2840 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2841 * configure.ac: Export DLOPEN_LIBS and add headers check.
2842 * plugin.cc: Handle non-dlfcn case.
2843 * Makefile.in: Regenerate.
2844 * config.in: Regenerate.
2845 * configure: Regenerate.
2846 * testsuite/Makefile.in: Regenerate.
2847
9e9143bc
ST
28482013-01-09 Sriraman Tallam <tmsriram@google.com>
2849
2850 * output.h (sort_attached_input_sections): Change to be public.
2851 * script-sections.cc
2852 (Output_section_definition::set_section_addresses): Sort
2853 attached input sections according to section order before linker
2854 script assigns section addresses.
2855 (Orphan_output_section::set_section_addresses): Sort
2856 attached input sections according to section order before linker
2857 script assigns section addresses.
2858 * Makefile.am (final_layout.sh): Use a simple linker script to
2859 check if section ordering still works.
2860 * Makefile.in: Regenerate.
2861
679af368
ILT
28622013-01-09 Ben Cheng <bccheng@google.com>
2863
2864 * arm.cc (Target_arm::attributes_accept_div): New function.
2865 (Target_arm::attributes_forbid_div): New function.
2866 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2867 attribute using the same new functions as what bfd/elf32_arm.c
2868 does.
2869
3136a00e
CC
28702013-01-07 Cary Coutant <ccoutant@google.com>
2871
2872 PR gold/14993
2873 * output.cc (Output_section::add_input_section): For incremental
2874 updates, don't track input sections that are allocated from patch
2875 space.
2876
f2a6224b
L
28772013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2878 Ian Lance Taylor <iant@google.com>
2879
2880 PR gold/14897
2881 * configure.ac (--enable-ld): Removed.
2882 (install_as_default): Set to yes only for --enable-gold=default
2883 or --disable-ld.
2884 * configure: Regenerated.
2885
4f46f626
L
28862013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2887
2888 * options.h (General_options): Add -fuse-ld= for GCC linker
2889 option compatibility.
2890
26e4ef59
CC
28912013-01-04 Cary Coutant <ccoutant@google.com>
2892
2893 * configure.ac: Fix typo restoring CXXFLAGS.
2894 * configure: Regenerate.
2895
3d587466
CC
28962013-01-04 Cary Coutant <ccoutant@google.com>
2897
4f46f626
L
2898 * testsuite/Makefile.am (CXXLINK_S): New macro.
2899 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2900 * testsuite/Makefile.in: Regenerate.
3d587466 2901
44db6695
L
29022013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2903
2904 * version.cc (print_version): Update copyright year to 2013.
2905
edcac0c1
ILT
29062012-12-20 Ian Lance Taylor <iant@google.com>
2907
2908 * layout.cc (Layout::special_ordering_of_input_section): New
2909 function.
2910 (Layout::layout): If input section requires special ordering, must
2911 sort input sections.
2912 (Layout::make_output_section): May sort .text input sections.
2913 (Layout::is_section_name_prefix_grouped): Remove.
2914 * layout.h (class Layout): Declare
2915 special_ordering_of_input_section. Don't declare
2916 is_section_name_prefix_grouped.
2917 * output.cc (Output_section::add_input_section): Revert last
2918 change.
2919 (Output_section::Input_section_sort::match_file_name): Don't crash
2920 if called on output section data.
2921 (Output_section::Input_section_sort_compare): Sort based on
2922 special ordering.
2923 (Output_section::Input_section_sort_section_order_index_compare):
2924 Revert last patch.
2925 (Output_section::sort_attached_input_sections): Likewise.
2926
28f2a4ac
ST
29272012-12-18 Sriraman Tallam <tmsriram@google.com>
2928
edcac0c1 2929 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2930 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2931 * output.cc (Output_section::add_input_section): Check if section
2932 name contains special prefix. Keep input sections to sort such
2933 sections.
2934 (Output_section::Input_section_sort_section_order_index_compare
2935 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2936 (Output_section::sort_attached_input_sections): Add condition to
2937 Input_section_entry constructor call.
28f2a4ac
ST
2938 * testsuite/Makefile.am (text_section_grouping): New test.
2939 * testsuite/Makefile.in: Regenerate.
2940 * testsuite/text_section_grouping.cc: New file.
2941 * testsuite/text_section_grouping.sh: New file.
2942
5bf135a7
NC
29432012-12-17 Nick Clifton <nickc@redhat.com>
2944
2945 * Makefile.am: Add copyright notice.
2946 * NEWS: Likewise.
2947 * README: Likewise.
2948 * configure.ac: Likewise.
2949 * ftruncate.c: Likewise.
2950 * Makefile.in: Regenerate.
2951
59965708
CC
29522012-12-14 Cary Coutant <ccoutant@google.com>
2953
a4034750
AM
2954 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2955 --no-as-needed flag.
2956 (exception_separate_shared_12_test): Likewise.
2957 (incremental_copy_test): Likewise.
2958 * testsuite/Makefile.in: Regenerate.
59965708 2959
2a77e2ab
CC
29602012-12-14 Cary Coutant <ccoutant@google.com>
2961
2962 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2963 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2964
e3deeb9c
AM
29652012-12-12 Alan Modra <amodra@gmail.com>
2966
2967 * powerpc.cc (class Track_tls): New.
2968 (class Relocate, class Scan): Inherit Track_tls.
2969 (Target_powerpc::Scan::local, global): Track tls optimization
2970 and avoid creating plt entry for __tls_get_addr if all uses
2971 are optimized away.
2972 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2973
d8f5a274
AM
29742012-12-12 Alan Modra <amodra@gmail.com>
2975
2976 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2977 Replace no_toc_optimize with toc_optimize.
2978 * output.h (Output_section::input_sections): Provide non-const variant.
2979 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2980 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2981 accessors.
2982 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2983 (class Sort_toc_sections): New.
2984 (Target_powerpc::do_finalize_sections): Sort toc sections.
2985 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2986
4c8a1de1
RM
29872012-12-10 Roland McGrath <mcgrathr@google.com>
2988
2989 * testsuite/binary_unittest.cc (read_all): New function.
2990 (Sized_binary_test): Use it instead of ::read.
2991 * fileread.cc (do_read): Don't assume pread always reads the whole
2992 amount in a single call.
2993
edc27beb
AM
29942012-12-10 Alan Modra <amodra@gmail.com>
2995
2996 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2997 Set EM_PPC64 or EM_PPC here.
2998 (Target_selector_powerpc::do_recognize): Delete.
2999
906b9150
AM
30002012-12-10 Alan Modra <amodra@gmail.com>
3001
3002 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3003 stub_table_.
3004 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3005
418c15ae
RM
30062012-12-07 Roland McGrath <mcgrathr@google.com>
3007
3008 * testsuite/binary_unittest.cc (Sized_binary_test):
3009 Use open_descriptor rather than ::open.
3010
decdd3bc
AM
30112012-12-07 Alan Modra <amodra@gmail.com>
3012
3013 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3014 typedef and invalid_address constant.
3015 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3016 instantiate constants.
3017
db399005
ILT
30182012-12-06 Roland McGrath <mcgrathr@google.com>
3019
3020 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3021 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3022 * aclocal.m4: Regenerate.
3023 * configure: Regenerate.
3024 * Makefile.in: Regenerate.
3025 * testsuite/Makefile.in: Regenerate.
3026
aba6bc71
AM
30272012-12-07 Alan Modra <amodra@gmail.com>
3028
3029 * options.h (General_options): Add no_toc_optimize.
3030 * powerpc.cc (ok_lo_toc_insn): New function.
3031 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3032
9e69ed50
AM
30332012-12-06 Alan Modra <amodra@gmail.com>
3034
3035 * options.h (General_options): Add plt_align, plt_static_chain,
3036 plt_thread_safe. Update stub_group_size help text.
3037 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3038 for new plt_thread_safe_ var.
3039 (use_plt_offset): Correct comments.
3040 (Target_powerpc::do_relax): Look for thread creation symbols to
3041 determine default plt_thread_safe value. Clear plt call stubs
3042 as well as branch stubs each iteration.
3043 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3044 insn constants.
3045 (l, hi, ha, write_insn): Move earlier.
3046 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3047 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3048 plt stubs too.
3049 (Stub_table::update_size): Adjust.
3050 (Stub_table::prev_size, set_prev_size): Delete.
3051 (Stub_table::stub_align): Let --plt-align affect result.
3052 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3053 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3054 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3055 (Stub_table::do_write): Support more stub variants.
3056
f43ba157
AM
30572012-12-04 Alan Modra <amodra@gmail.com>
3058
3059 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3060 (Target_powerpc::do_define_standard_symbols): New function.
3061
34171bc5
AM
30622012-12-03 Alan Modra <amodra@gmail.com>
3063
3064 * output.h: Formatting, whitespace.
3065
dc9589e9 30662012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3067
3068 * layout.h (Layout::get_executable_sections): Declare.
3069 * layout.cc (Layout::get_executable_sections): New function.
3070 * arm.cc (Target_arm::group_sections): Use it.
3071 (Arm_output_section::group_sections): Delete now redundant test.
3072 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3073 param to handle relative relocs.
3074 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3075 (Output_data_reloc::add_absolute): Adjust.
3076 (Output_data_reloc::add_relative): New function.
3077 (Output_data::reset_data_size): New function.
3078 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3079 (Output_section::set_addralign): New function.
3080 (Output_section::checkpoint_set_addralign): New function.
3081 (Output_section::clear_section_offsets_need_adjustment): New function.
3082 (Output_section::input_sections): Make public.
3083 * powerpc.cc (class Output_data_brlt_powerpc): New.
3084 (class Stub_table, class Stub_control): New.
3085 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3086 stub_table_, set_stub_table, stub_table): New vectors and accessor
3087 functions.
3088 (Target_powerpc::do_may_relax, do_relax, push_branch,
3089 new_stub_table, stub_tables, brlt_section, group_sections,
3090 add_branch_lookup_table, find_branch_lookup_table,
3091 write_branch_lookup_table, make_brlt_section): New functions.
3092 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3093 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3094 branch_info_): New vars.
3095 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3096 make call stubs here.
3097 (Output_data_glink): Remove all call stub handling from this class.
3098 (Target_powerpc::Scan::local, global): Save interesting branch
3099 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3100 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3101 functions on final link.
3102 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3103 Handle long branch destinations too.
3104 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3105 do_plt_address_for_local): Adjust lookup of plt call stubs.
3106
627b30b7
AM
31072012-11-30 Alan Modra <amodra@gmail.com>
3108
3109 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3110 relocs against protected symbols when building 32-bit shared libs.
3111
40b469d7
AM
31122012-11-30 Alan Modra <amodra@gmail.com>
3113
3114 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3115 param. Call got_section() to make .got. Update all callers
3116 and their callers and so on.
3117
bb66a627
AM
31182012-11-30 Alan Modra <amodra@gmail.com>
3119
3120 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3121 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3122 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3123 value if it already exists.
3124
d2cf1c6c
L
31252012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3126
3127 PR gold/14858
3128 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3129
edccdf7c
RM
31302012-11-14 Roland McGrath <mcgrathr@google.com>
3131
3132 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3133 than bfc instruction for data sandboxing.
3134
6febeb74
AM
31352012-11-08 Alan Modra <amodra@gmail.com>
3136
3137 * po/POTFILES.in: Regenerate.
3138
0a6f1bf2
AM
31392012-11-05 Alan Modra <amodra@gmail.com>
3140
3141 * configure.ac: Apply 2012-09-10 change to config.in here.
3142 * configure: Regenerate.
3143
26a4e9cb
AM
31442012-11-05 Alan Modra <amodra@gmail.com>
3145
3146 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3147 (struct Opd_ent): Use "Address" rather than "Offset".
3148 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3149 (Target_powerpc::got_section): Make public.
3150 (Target_powerpc::scan_relocs): Move code setting symbols..
3151 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3152 Create _SDA_BASE_ only when referenced.
3153
cc928013
RM
31542012-11-02 Roland McGrath <mcgrathr@google.com>
3155
3156 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3157 from last change.
3158
50ed5eb1
RM
31592012-11-01 Roland McGrath <mcgrathr@google.com>
3160
62fe925a
RM
3161 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3162 for offset_in_output_section parameter.
3163 (Sized_target::relocate_special_relocatable): Likewise.
3164 * arm.cc (Target_arm::relocate_relocs): Likewise.
3165 (Target_arm::relocate_special_relocatable): Likewise.
3166 * i386.cc (Target_i386::relocate_relocs): Likewise.
3167 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3168 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3169 * target-reloc.h (relocate_relocs): Likewise.
3170 * testsuite/testfile.cc (Target_test): Likewise.
3171 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3172 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3173
3174 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3175 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3176
3177 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3178 parameter, which is unused in the [!F_SETFD] case.
3179
50ed5eb1
RM
3180 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3181 SYMNDX to off_t before comparing it to this->data_size().
3182 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3183 * incremental.cc (Output_section_incremental_inputs::do_write):
3184 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3185
2cadc0bf
RM
3186 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3187
3bfcb652
NC
31882012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3189
3190 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3191 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3192 in EABI_VER5.
3193
c1a8d56e
CC
31942012-10-29 Cary Coutant <ccoutant@google.com>
3195
3196 * dwp.cc (usage): Add file and exit status parameters;
3197 add --help and --version options.
3198 (print_version): New function.
3199 (main): Add --help and --version options.
3200
b2490a7b
L
32012012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3202
3203 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3204 final_layout_sequence.txt.
3205 * testsuite/Makefile.in: Regenerated.
3206
aa543512
L
32072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3208
3209 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3210 COMPILE generated by automake.
3211 (LINK1): Likewise.
3212 (CXXCOMPILE1): Likewise.
3213 (CXXLINK1): Likewise.
3214 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3215 (LINK): Likewise.
3216 (CXXCOMPILE): Likewise.
3217 (CXXLINK): Likewise.
3218 * testsuite/Makefile.in: Regenerated.
3219
d361fafb
L
32202012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3221
3222 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3223 on bad fwrite return.
3224
598c7410
L
32252012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3226
3227 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3228 on val.
3229
35c813e2
CC
32302012-10-23 Cary Coutant <ccoutant@google.com>
3231
3232 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3233 * testsuite/Makefile.in: Regenerate.
3234 * testsuite/dwp_test.h: New source file.
3235 * testsuite/dwp_test_1.cc: New source file.
3236 * testsuite/dwp_test_1.s: New source file.
3237 * testsuite/dwp_test_1.sh: New source file.
3238 * testsuite/dwp_test_1b.cc: New source file.
3239 * testsuite/dwp_test_1b.s: New source file.
3240 * testsuite/dwp_test_2.cc: New source file.
3241 * testsuite/dwp_test_2.s: New source file.
3242 * testsuite/dwp_test_2.sh: New source file.
3243 * testsuite/dwp_test_main.cc: New source file.
3244 * testsuite/dwp_test_main.s: New source file.
3245
77429909
CC
32462012-10-23 Cary Coutant <ccoutant@google.com>
3247
3248 * dwp.h: New header file.
3249 * dwp.cc: New source file.
3250 * gold.h: Move shared declarations to system.h.
3251 * system.h: New header file.
3252 * Makefile.am: Add dwp.
3253 * Makefile.in: Regenerate.
3254
ed5d6712
CC
32552012-10-23 Cary Coutant <ccoutant@google.com>
3256
3257 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3258 Dwarf_info_reader::read_from_pointer.
3259 (Dwarf_pubnames_table::read_header): Likewise.
3260 (Dwarf_pubnames_table::next_name): Likewise.
3261 (Dwarf_die::read_attributes): Likewise.
3262 (Dwarf_die::skip_attributes): Likewise.
3263 (Dwarf_info_reader::read_from_pointer): New function template.
3264 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3265 (Dwarf_pubnames_table): Likewise.
3266 (Dwarf_info_reader::read_from_pointer): New function template.
3267 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3268 Dwarf_pubnames_table ctor.
3269
8787852d
CC
32702012-10-23 Cary Coutant <ccoutant@google.com>
3271
3272 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3273 abbrev_shndx.
3274 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3275 abbrev_shndx_.
3276 (Dwarf_info_reader::set_abbrev_shndx): New method.
3277 (Dwarf_info_reader::abbrev_shndx_): New data member.
3278
9fc236f3
CC
32792012-10-23 Cary Coutant <ccoutant@google.com>
3280
3281 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3282 from object, not parameters.
3283 (Dwarf_info_reader::parse): Likewise.
3284 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3285 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3286 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3287 methods.
3288
effe8365
CC
32892012-10-23 Cary Coutant <ccoutant@google.com>
3290
3291 * fileread.cc (Input_file::Input_file): New constructor.
3292 * fileread.h (class Input_file): Add new constructor.
3293
1698990d
AM
32942012-10-18 Alan Modra <amodra@gmail.com>
3295
3296 PR gold/14727
3297 * object.cc (Relobj::is_section_name_included): Also match
3298 .sdata personality section.
3299
168a4726
AM
33002012-10-18 Alan Modra <amodra@gmail.com>
3301
3302 * target-reloc.h (class Default_comdat_behavior): New, package up..
3303 (get_comdat_behaviour): ..this.
3304 (relocate_section): Add Relocate_comdat_behavior template arg,
3305 adjust code to suit.
3306 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3307 (Target_arm::scan_reloc_section): Likewise.
3308 * i386.cc (Target_i386::relocate_section): Likewise.
3309 * sparc.cc (Target_sparc::relocate_section): Likewise.
3310 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3311 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3312 * powerpc.cc (class Relocate_comdat_behavior): New.
3313 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3314 gold::relocate_section with new template arg.
3315
acc276d8
AM
33162012-10-18 Alan Modra <amodra@gmail.com>
3317
3318 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3319 dynamic relocs for GOT_TPREL got entries, without symbol if
3320 resolving locally.
3321 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3322 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3323 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3324
e10f9870
AM
33252012-10-17 Alan Modra <amodra@gmail.com>
3326
3327 PR gold/14726
3328 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3329
ae034989
ST
33302012-10-16 Sriraman Tallam <tmsriram@google.com>
3331
3332 * layout.cc (Layout::include_section): Keep sections marked
3333 SHF_EXCLUDE when doing relocatable links.
3334
f3a0ed29
AM
33352012-10-16 Alan Modra <amodra@gmail.com>
3336
3337 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3338 (Target_powerpc::do_finalize_sections): Call it.
3339 (Output_data_save_res): New class and supporting functions.
3340 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3341 normal symbols defined in object files.
3342
c6de8ed4
AM
33432012-10-12 Alan Modra <amodra@gmail.com>
3344
3345 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3346 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3347 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3348 section if scan_opd_relocs not yet called.
3349 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3350
03e25981
AM
33512012-10-12 Alan Modra <amodra@gmail.com>
3352
3353 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3354 add_local_ifunc_entry): Revert last change.
3355 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3356
c9824451
AM
33572012-10-05 Alan Modra <amodra@gmail.com>
3358
3359 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3360 do_plt_address_for_global): New functions.
3361 (Output_data_got_powerpc::do_write): Don't segfault when linking
3362 statically.
3363 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3364 add_local_ifunc_entry): Return true on adding entry..
3365 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3366 glink->add_entry call. Remove unused symtab param. Adjust calls.
3367 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3368 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3369 set up symbols here.
3370 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3371 syms here. Do so even when no .iplt. Don't segfault when linking
3372 statically.
3373 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3374 new variants without reloc param.
3375 (Glink_sym_ent::Glink_sym_ent): Likewise.
3376 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3377 reloc when refs will resolve to plt call stub.
3378 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3379 R_PPC_PLTREL24 to resolve locally.
3380 (Target_powerpc::Scan::global): Correct ifunc handling.
3381 (Target_powerpc::Relocate::relocate): Correct local sym glink
3382 lookup. Don't destroy "value" when we have a plt call stub,
3383 and when checking plt call validity.
3384 (Target_powerpc::do_dynsym_value): Simplify.
3385
19fec8c1
AM
33862012-10-05 Alan Modra <amodra@gmail.com>
3387
3388 * i386.cc (Output_data_plt_i386::address_for_global,
3389 address_for_local): Add plt offset to returned value. Adjust uses.
3390 * sparc.cc (Output_data_plt_sparc::address_for_global,
3391 address_for_local): Likewise.
3392 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3393 address_for_local): Likewise.
3394 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3395 address_for_local): Likewise.
3396 * target.h (Target::plt_address_for_global, plt_address_for_local):
3397 Update comment.
3398 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3399 (Output_data_got::Got_entry::write): Nor here.
3400 * output.h: Comment fix.
3401
e867b647
WL
34022012-10-02 Jiong Wang <jiwang@tilera.com>
3403
3404 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3405 global_offset_table_ value for larget got.
3406 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3407
e5d5f5ed
AM
34082012-09-29 Alan Modra <amodra@gmail.com>
3409
3410 * powerpc.cc (Target_powerpc::iplt_): New output section.
3411 (Target_powerpc::iplt_section, make_iplt_section,
3412 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3413 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3414 Target_powerpc::plt_entry_count): Count iplt entries too.
3415 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3416 reloc section in constructor. New params.
3417 (Target_powerpc::make_plt_section): Create reloc section here instead.
3418 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3419 functions.
3420 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3421 (Output_data_glink::add_entry, find_entry): New functions to
3422 deal with local syms.
3423 (Glink_sym_ent): Add support for local syms.
3424 (Output_data_glink::do_write): Handle ifunc plt entries.
3425 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3426 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3427 (Target_powerpc::Relocate::relocate): Likewise.
3428 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3429
ec4dbad3
AM
34302012-09-25 Alan Modra <amodra@gmail.com>
3431
3432 * object.h (Sized_relobj_file::adjust_local_symbol,
3433 do_adjust_local_symbol): New functions.
3434 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3435 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3436 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3437 and irregular opd entry spacing.
3438 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3439 (Global_symbol_visitor_opd): New functor.
3440 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3441 on deleted opd entries.
3442
5c0b3823
WL
34432012-09-15 Jiong Wang <jiwang@tilera.com>
3444
3445 * tilegx.cc: New file.
3446 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3447 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3448 * configure.tgt: Add entries for tilegx*.
3449 * configure.ac: Likewise.
3450 * Makefile.in: Rebuild.
3451 * configure: Likewise.
3452 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3453 tilegx.
3454
bfdfa4cd
AM
34552012-09-13 Alan Modra <amodra@gmail.com>
3456
3457 * target-reloc.h (scan_relocs): Call scan.local for relocs
3458 against symbols in discarded sections. Pass is_discarded
3459 param.
3460 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3461 Add is_discarded param.
3462 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3463 is_discarded to flag opd entry as discarded. Don't emit dyn
3464 relocs on such entries.
3465 (Target_powerpc::Scan::global): Similarly detect and handle
3466 such opd entries.
3467 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3468 opd_ent_. Update all uses.
3469 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3470 (Target_powerpc::relocate_section): Zero out discarded opd
3471 entry relocs.
3472
d77a0555
ILT
34732012-09-12 Ian Lance Taylor <iant@google.com>
3474
3475 PR gold/14570
3476 * output.cc: Rename Output_data_got template parameter from size
3477 to got_size for all functions. Compile all variants of
3478 Output_data_got.
3479 (Output_data_got::Got_entry::write): Correct use of size for
3480 symbol value. Use local_is_tls rather than casting to
3481 Sized_relobj_file.
3482 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3483 (class Sized_relobj_file): Add do_local_is_tls.
3484 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3485
815a1205
AM
34862012-09-11 Alan Modra <amodra@gmail.com>
3487
3488 PR gold/14566
3489 * layout.cc (Layout::set_segment_offsets): When using
3490 common-page-size alignment, ensure we are on a new max-page-size
3491 page.
3492 * output.cc (Output_segment::set_section_addresses): Use
3493 abi_pagesize, not common_pagesize for relro boundary.
3494 (Output_segment::set_offset): Likewise.
3495
bd73a62d
AM
34962012-09-11 Alan Modra <amodra@gmail.com>
3497
3498 * output.h (Output_data_got::add_global_tls, add_local_tls,
3499 add_local_tls_pair): New functions.
3500 (Output_data_got::add_local_pair_with_rel): Remove second
3501 reloc param. Expand comment.
3502 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3503 use_plt_or_tls_offset_, similarly for constructor param.
3504 (Output_data_got::Got_entry::write): Add got_index param.
3505 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3506 add_local_tls_pair): New functions.
3507 (Output_data_got::Got_entry::write): Handle tls symbols
3508 with use_plt_or_tls_offset_ set specially.
3509 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3510 (Output_data_got::do_write): Replace iterator with index, pass
3511 index to entry write function.
3512 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3513 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3514 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3515 call.
3516 * i386.cc (Target_i386::Scan::local): Likewise.
3517 * sparc.cc (Target_sparc::Scan::local): Likewise.
3518 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3519 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3520 do_tls_offset_for_global): New functions.
3521 (Target_powerpc::Scan::local): Correct TLS relocations and got
3522 entry values.
3523 (Target_powerpc::Scan::global): Don't emit unnecessary
3524 dynamic relocations on TLS GOT entries.
3525
00716ab1
AM
35262012-09-10 Matthias Klose <doko@ubuntu.com>
3527
3528 * config.in: Disable sanity check for kfreebsd.
3529
c891b3f9
SA
35302012-09-10 Sterling Augustine <saugustine@google.com>
3531
3532 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3533 (Gdb_index::pubtypes_read): New parameter.
3534 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3535 to calls.
3536 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3537 pubtypes_object_.
3538
e81fea4d
AM
35392012-09-09 Alan Modra <amodra@gmail.com>
3540
3541 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3542 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3543 * gc.h (gc_process_relocs): Call target gc_add_reference.
3544 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3545 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3546 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3547 unnecessary cast.
3548 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3549 to cater for when we don't need code offset. Update use.
3550 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3551 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3552 set_opd_valid): New functions.
3553 (Target_powerpc::do_gc_add_reference): New function.
3554 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3555 stashed refs.
3556 (Target_powerpc::do_gc_mark_symbol): New function.
3557
d2d60eef
CC
35582012-09-06 Cary Coutant <ccoutant@google.com>
3559
3560 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3561 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3562 (Dwarf_die::skip_attributes): Likewise.
3563 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3564 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3565 (main): Call it.
3566 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3567
32ed4573
L
35682012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3569
3570 * testsuite/script_test_3.t: Add .got.plt output section
3571 statement.
3572 * testsuite/script_test_4.t: Likewise.
3573
f4baf0d4
AM
35742012-09-05 Alan Modra <amodra@gmail.com>
3575
3576 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3577 update all uses and lose "enum" when using type.
3578
864a1b56
AM
35792012-09-05 Alan Modra <amodra@gmail.com>
3580
3581 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3582 * configure: Regenerate.
3583 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3584 (plugin_final_layout.stdout): Likewise.
3585 (memory_test): Set page sizes to 0x1000.
3586 * testsuite/Makefile.in: Regenerate.
3587 * testsuite/discard_locals_test.sh: Add FIXME comment.
3588 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3589 * testsuite/pr14265.t: Add .got output section statement.
3590 * testsuite/script_test_2.t: Likewise.
3591 * testsuite/script_test_3.t: Likewise.
3592 * testsuite/script_test_4.t: Likewise.
3593 * testsuite/script_test_5.t: Likewise.
3594 * testsuite/script_test_6.t: Likewise.
3595 * testsuite/script_test_7.t: Likewise.
3596 * testsuite/script_test_9.t: Likewise.
3597
3ea0a085
AM
35982012-09-05 Alan Modra <amodra@gmail.com>
3599
3600 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3601 (Powerpc_relocate_functions::Status): New typedef.
3602 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3603 (Target_powerpc::Scan::local): Handle REL64.
3604 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3605 for REL32 and REL64.
3606 (Target_powerpc::symval_for_branch): New function, extracted from..
3607 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3608 checks. Report overflow errors.
3609
7404fe1b
AM
36102012-09-05 Alan Modra <amodra@gmail.com>
3611
3612 * object.h (Sized_relobj_file::emit_relocs): Delete.
3613 (Sized_relobj_file::emit_relocs_reltype): Delete.
3614 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3615 relocate_relocs for --emit-relocs.
3616 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3617 * output.h: Update comment.
3618 (Output_segment::first_section): New function.
3619 (Output_segment::first_section_load_address): Use first_section.
3620 * output.cc (Output_segment::first_section): New function extracted..
3621 (Output_segment::first_section_load_address): ..from here. Delete.
3622 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3623 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3624 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3625 adjust call to target.h function.
3626 * i386.cc (Target_i386): Likewise.
3627 * sparc.cc (Target_sparc): Likewise.
3628 * x86_64.cc (Target_x86_64): Likewise.
3629 * powerpc.cc (Target_powerpc): Likewise.
3630 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3631 first tls section has section symbol for optimised local dynamic
3632 output relocs.
3633 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3634 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3635 optimised tls code.
3636 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3637 Rename to relocate_relocs. Update error message.
3638
957564c9
AS
36392012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3640
3641 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3642 --just-symbols.
3643
dd93cd0a
AM
36442012-08-31 Alan Modra <amodra@gmail.com>
3645
3646 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3647 (Powerpc_relobj::toc_base_offset): New stub function.
3648 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3649 got_mod_index_offset to tlsld_got_offset. Update all refs.
3650 (Target_powerpc::Relocate::enum skip_tls): New.
3651 (Target_powerpc::call_tls_get_addr_): New var.
3652 (Target_powerpc::is_branch_reloc): Move to file scope.
3653 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3654 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3655 New functions.
3656 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3657 (powerpc_info): Correct common_pagesize for ppc64.
3658 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3659 (Powerpc_relocate_functions): Add overflow check enums and functions.
3660 Add non-shift version of rela, rela_ua. Delete all rel public
3661 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3662 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3663 addr16_ha3, addr14 functions.
3664 (Output_data_got_powerpc::add_constant_pair): New function.
3665 (Output_data_got_powerpc::got_base_offset): Likewise.
3666 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3667 (instruction constants): Sort, add some more.
3668 (Output_data_glink::do_write): Add and use Address typedef. Use
3669 object->toc_base_offset() stub for 64-bit.
3670 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3671 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3672 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3673 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3674 Always treat .opd relocs as against locally defined symbol.
3675 Correct condition for RELATIVE relocs.
3676 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3677 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3678 for 32-bit syms with a plt entry. Correct ppc64 toc base
3679 calculations. Handle TLS relocs, and more. Add overflow
3680 checking and adjust for Powerpc_relocate_functions changes.
3681 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3682 Reinstate --emit-relocs code with FIXME.
3683
a1373b60
AM
36842012-08-30 Alan Modra <amodra@gmail.com>
3685
3686 * layout.cc (Layout::set_segment_offsets): Set p_align to
3687 abi_pagesize, not common_pagesize.
3688 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3689 to determine whether file header can go in segment.
3690
703d02da
AM
36912012-08-30 Alan Modra <amodra@gmail.com>
3692
3693 * output.h (Output_reloc::Output_reloc <output section>): Add
3694 is_relative param. Adjust calls.
3695 (Output_reloc::add_output_section_relative): New functions.
3696 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3697 is_relative.
3698 (Output_reloc::symbol_value): Handle SECTION_CODE.
3699
16164a6b
ST
37002012-08-24 Sriraman Tallam <tmsriram@google.com>
3701
3702 * gold.cc (queue_middle_tasks): Call layout again when unique
3703 segments for sections is desired.
3704 * layout.cc (Layout::Layout): Initialize new members.
3705 (Layout::get_output_section_flags): New function.
3706 (Layout::choose_output_section): Call get_output_section_flags.
3707 (Layout::layout): Make output section for mapping to a unique segment.
3708 (Layout::insert_section_segment_map): New function.
3709 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3710 output sections marked so.
16164a6b
ST
3711 (Layout::segment_precedes): Check for unique segments when sorting.
3712 * layout.h (Layout::Unique_segment_info): New struct.
3713 (Layout::Section_segment_map): New typedef.
3714 (Layout::insert_section_segment_map): New function.
3715 (Layout::get_output_section_flags): New function.
3716 (Layout::is_unique_segment_for_sections_specified): New function.
3717 (Layout::set_unique_segment_for_sections_specified): New function.
3718 (Layout::unique_segment_for_sections_specified_): New member.
3719 (Layout::section_segment_map_): New member.
3720 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3721 Rename is_gc_pass_one to is_pass_one.
3722 Rename is_gc_pass_two to is_pass_two.
3723 Rename is_gc_or_icf to is_two_pass.
3724 Check for which pass based on whether symbols data is present.
3725 Make it two pass when unique segments for sections is desired.
3726 * output.cc (Output_section::Output_section): Initialize new
3727 members.
3728 * output.h (Output_section::is_unique_segment): New function.
3729 (Output_section::set_is_unique_segment): New function.
3730 (Output_section::is_unique_segment_): New member.
3731 (Output_section::extra_segment_flags): New function.
3732 (Output_section::set_extra_segment_flags): New function.
3733 (Output_section::extra_segment_flags_): New member.
3734 (Output_section::segment_alignment): New function.
3735 (Output_section::set_segment_alignment): New function.
3736 (Output_section::segment_alignment_): New member.
3737 (Output_segment::Output_segment): Initialize is_unique_segment_.
3738 (Output_segment::is_unique_segment): New function.
3739 (Output_segment::set_is_unique_segment): New function.
3740 (Output_segment::is_unique_segment_): New member.
3741 * plugin.cc (allow_unique_segment_for_sections): New function.
3742 (unique_segment_for_sections): New function.
3743 (Plugin::load): Add new functions to transfer vector.
3744 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3745 * Makefile.in: Regenerate.
3746 * testsuite/plugin_final_layout.sh: Check if unique segment
3747 functionality works.
3748 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3749 are available.
3750 (allow_unique_segment_for_sections): New global.
3751 (unique_segment_for_sections): New global.
3752 (claim_file_hook): Call allow_unique_segment_for_sections.
3753 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3754
1e2bee4f
CC
37552012-08-22 Cary Coutant <ccoutant@google.com>
3756
3757 * layout.cc (Layout::include_section): Don't assert on GROUP
3758 sections with --emit-relocs.
3759
1d5dfe78
CC
37602012-08-21 Cary Coutant <ccoutant@google.com>
3761
3762 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3763 if --export-dynamic-symbol names an undef symbol.
3764
c9269dff
AM
37652012-08-18 Alan Modra <amodra@gmail.com>
3766
3767 * powerpc.cc: Formatting and white space.
3768 (Powerpc_relobj): Rename got2_section_ to special_.
3769 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3770 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3771 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3772 (Target_powerpc): Add Address typedef and invalid_address. Use
3773 throughout.
3774 (Target_powerpc::is_branch_reloc): New function.
3775 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3776 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3777 for dst_mask, value and addend.
3778 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3779 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3780 (Output_data_glink::do_write): Correct toc base. Don't try to use
3781 uint16_t for 24-bit offset. Use get_output_section_offset and
3782 check return.
3783 (Target_powerpc::Scan::local): Handle more relocs.
3784 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3785 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3786 Plug in toc restoring insn after plt calls. Translate branches
3787 to function descriptor symbols to corresponding entry point.
3788 (Target_powerpc::relocate_for_relocatable): Check return from
3789 get_output_section_offset.
3790 * symtab.h: Comment typo.
3791
b1759dce
ILT
37922012-08-14 Ian Lance Taylor <iant@google.com>
3793
3794 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3795 unsupported_relocal_local to call unsupported_reloc_global.
3796
b9b2ae8b
NC
37972012-08-14 Nick Clifton <nickc@redhat.com>
3798
3799 PR ld/14265
3800 * script-sections.cc (Sections_element::output_section_name): Add
3801 keep return parameter.
3802 (Output_section_element::match_name): Add keep return parameter.
3803 Return the value of the keep_ member.
3804 * script-sections.h (class Output_section): Update
3805 output_section_name prototype.
3806 * layout.cc (Layout::keep_input_section): New public member
3807 function.
3808 (Layout::choose_output_section): Pass keep parameter to
3809 output_section_name.
3810 * layout.h (class Layout): Add keep_input_section.
3811 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3812 sections.
3813 * testsuite/Makefile.am: Add a test.
3814 * testsuite/Makefile.in: Regenerate.
3815 * testsuite/pr14265.c: Source file for the test.
3816 * testsuite/pr14265.t: Linker script for the test.
3817 * testsuite/pr14265.sh: Shell script for the test.
3818
921b5322
AM
38192012-08-14 Alan Modra <amodra@gmail.com>
3820
3821 * target.h (Target::output_section_name): New function.
3822 (Target::do_output_section_name): New function.
3823 * layout.cc (Layout::choose_output_section): Call the above.
3824 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3825
6ce78956
AM
38262012-08-14 Alan Modra <amodra@gmail.com>
3827
3828 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3829 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3830 for replace_constant call.
3831 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3832 (Output_data_glink::do_print_to_mapfile): New function.
3833 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3834 (Target_powerpc::Relocate::relocate): Likewise.
3835
d1a8cabd
AM
38362012-08-14 Alan Modra <amodra@gmail.com>
3837
3838 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3839 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3840 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3841 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3842 all references to shndx_. Handle special case for R_PPC_PLTREL24
3843 here.
3844 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3845 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3846 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3847 here.
3848 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3849 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3850
d83ce4e3
AM
38512012-08-12 Alan Modra <amodra@gmail.com>
3852
3853 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3854 (glink insn constants): Use uint32_t.
3855 (Output_data_glink::add_entry): Use insert, not [] operator.
3856
cf43a2fe
AM
38572012-08-11 Alan Modra <amodra@gmail.com>
3858
3859 * object.h (Sized_relobj_file::find_shdr): New function.
3860 (Sized_relobj_file::find_special_sections): New function.
3861 * object.cc (Sized_relobj_file::find_shdr): New function.
3862 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3863 (Sized_relobj_file::find_special_sections): New function, split out..
3864 (Sized_relobj_file::do_read_symbols): ..from here.
3865 * output.h (Output_data_got::replace_constant): New function.
3866 (Output_data_got::num_entries): New function.
3867 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3868 (Output_data_got::got_offset): Protected rather than private.
3869 (Output_data_got::replace_got_entry): New function.
3870 * output.cc (Output_data_got::replace_got_entry): New function.
3871 * powerpc.cc (class Powerpc_relobj): New.
3872 (class Powerpc_relocate_functions): Delete all psymval variants or
3873 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3874 Implement _ha functions using corresponding _hi function.
3875 (Powerpc_relobj::find_special_sections): New function.
3876 (Target_powerpc::do_make_elf_object): New function.
3877 (class Output_data_got_powerpc): New.
3878 (class Output_data_glink): New.
3879 (class Powerpc_scan_relocatable_reloc): New.
3880 Many more changes througout file.
3881
3c892704
NC
38822012-08-09 Nick Clifton <nickc@redhat.com>
3883
3884 * po/vi.po: Updated Vietnamese translation.
3885
82435b3b
ILT
38862012-08-07 Ian Lance Taylor <iant@google.com>
3887
3888 * layout.cc (Layout::add_target_dynamic_tags): If
3889 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3890 plt_rel.
3891
a6dc81d2
NC
38922012-07-30 Nick Clifton <nickc@redhat.com>
3893
3894 * po/gold.pot: Updated template.
3895 * po/es.po: Updated Spanish translation.
3896
f1415016
CC
38972012-07-18 Cary Coutant <ccoutant@google.com>
3898
3899 PR gold/14344
3900 * configure.ac: Add check for -gpubnames support.
3901 * configure: Regenerate.
3902 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3903 support; force -gno-pubnames.
3904 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3905 support.
3906 (gdb_index_test_4): New test.
3907 * testsuite/Makefile.in: Regenerate.
3908 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3909 * testsuite/gdb_index_test_2.sh: Likewise.
3910 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3911 * testsuite/gdb_index_test_4.sh: New script.
3912 * testsuite/gdb_index_test_comm.sh: New script with common code;
3913 don't look for space after colon.
3914
b7fd7c37
ST
39152012-07-16 Sriraman Tallam <tmsriram@google.com>
3916
3917 * gold.cc (queue_middle_tasks): Update function order only after
3918 deferred objects due to plugins are processed.
3919
1f3212db
ILT
39202012-07-11 Ian Lance Taylor <iant@google.com>
3921
3922 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3923 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3924 (Target_arm::scan_reloc_for_stub): Likewise.
3925 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3926 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3927 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3928 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3929 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3930
81c82a68
ILT
39312012-07-10 Dodji Seketeli <dodji@redhat.com>
3932 Ian Lance Taylor <iant@google.com>
3933
3934 PR gold/14309
3935 * configure.ac: Test whether std::tr1::hash<off_t> works.
3936 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3937 needed.
3938 * output.h (class Output_fill): Add virtual destructor.
3939 * configure, config.in: Rebuild.
3940
eabc84f4
RM
39412012-06-22 Roland McGrath <mcgrathr@google.com>
3942
3943 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3944
370e30b6
RÁE
39452012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3946
3947 * plugin.cc (Plugin::load): Handle position independent executables.
3948
fb1b895d
CC
39492012-06-06 Cary Coutant <ccoutant@google.com>
3950
3951 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3952 add .debug_macro.
3953 (lines_only_debug_sections): Likewise.
3954 (gdb_fast_lookup_sections): New static array.
3955 (is_gdb_debug_section): Rename formal parameter.
3956 (is_lines_only_debug_section): Likewise.
3957 (is_gdb_fast_lookup_section): New function.
3958 (Layout::include_section): Check for ".zdebug_" prefix; pass
3959 section name suffix to is_gdb_debug_section, et al.; check for
3960 fast-lookup sections when building .gdb_index.
3961 * options.h (--strip-debug-gdb): Update GDB version number.
3962
7c0640fa
CC
39632012-06-06 Cary Coutant <ccoutant@google.com>
3964
3965 * configure.ac: Add check for fallocate.
3966 * configure: Regenerate.
3967 * config.in: Regenerate.
3968
3969 * options.h (class General_options): Add --mmap-output-file and
3970 --posix-fallocate options.
3971 * output.cc: (posix_fallocate): Remove; replace with...
3972 (gold_fallocate): New function.
3973 (Output_file::map_no_anonymous): Call gold_fallocate.
3974 (Output_file::map): Check --mmap-output-file option.
3975
2a49eb69
DK
39762012-06-05 Jing Yu <jingyu@google.com>
3977
3978 * gold.h (textdomain): Add do {} to empty while(0).
3979 (bindtextdomain): Likewise.
3980
fad072ac
CC
39812012-06-04 Cary Coutant <ccoutant@google.com>
3982
3983 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3984 has_dynsym_index.
3985
8cc69fb6
ST
39862012-05-25 Sriraman Tallam <tmsriram@google.com>
3987
3988 * symtab.cc (Symbol_table::define_special_symbol):
3989 Initialize *poldsym to prevent uninitialized variable errors.
3990
1be75daa
CC
39912012-05-23 Cary Coutant <ccoutant@google.com>
3992
3993 * layout.cc (Layout::section_name_mapping): Add rules to handle
3994 exact match on .data.rel.ro.local or .data.rel.ro.
3995 (Layout::output_section_name): Check for exact matches.
3996
9b689de0
CC
39972012-05-23 Cary Coutant <ccoutant@google.com>
3998
3999 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4000 more carefully.
4001
b24fdbf5
CC
40022012-05-22 Cary Coutant <ccoutant@google.com>
4003
4004 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4005 object before exporting symbol.
4006
e550e1a2
L
40072012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4008
4009 * testsuite/tls_test.cc: Include "config.h" first.
4010 * testsuite/tls_test_c.c: Likewise.
4011
df7b86aa
NC
40122012-05-17 Daniel Richard G. <skunk@iskunk.org>
4013 Nick Clifton <nickc@redhat.com>
4014
4015 PR 14072
4016 * configure.in: Add check that sysdep.h has been included before
4017 any system header files.
4018 * configure: Regenerate.
4019 * config.in: Regenerate.
4020
1007b503
CC
40212012-05-14 Cary Coutant <ccoutant@google.com>
4022
4023 * layout.cc (Layout::make_output_section): Mark .tdata section
4024 as RELRO.
4025 * testsuite/relro_test.cc: Add a TLS variable.
4026
fd885f3a
L
40272012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4028
4029 PR gold/14091
4030 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4031 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4032 R_X86_64_64.
4033
80f5885c
CC
40342012-05-08 Cary Coutant <ccoutant@google.com>
4035
4036 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4037 (lines_only_debug_sections): Likewise.
4038
2e702c99
RM
40392012-05-02 Roland McGrath <mcgrathr@google.com>
4040
4041 * nacl.cc: New file.
4042 * nacl.h: New file.
4043 * Makefile.am (CCFILES, HFILES): Add them.
4044 * Makefile.in: Regenerate.
4045 * i386.cc (Output_data_plt_i386_nacl): New class.
4046 (Output_data_plt_i386_nacl_exec): New class.
4047 (Output_data_plt_i386_nacl_dyn): New class.
4048 (Target_i386_nacl): New class.
4049 (Target_selector_i386_nacl): New class.
4050 (target_selector_i386): Use it instead of Target_selector_i386.
4051 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4052 (Target_x86_64_nacl): New class.
4053 (Target_selector_x86_64_nacl): New class.
4054 (target_selector_x86_64, target_selector_x32): Use it instead of
4055 Target_selector_x86_64.
4056 * arm.cc (Output_data_plt_arm_nacl): New class.
4057 (Target_arm_nacl): New class.
4058 (Target_selector_arm_nacl): New class.
4059 (target_selector_arm, target_selector_armbe): Use it instead of
4060 Target_selector_arm.
4061
4062 * target-select.cc (select_target): Take new Input_file* and off_t
4063 arguments, pass them on to recognize method of selector.
4064 * object.cc (make_elf_sized_object): Update caller.
4065 * parameters.cc (parameters_force_valid_target): Likewise.
4066 * incremental.cc (make_sized_incremental_binary): Likewise.
4067 * target-select.h: Update decl.
4068 (Target_selector::recognize): Take new Input_file* argument,
4069 pass it on to do_recognize.
4070 (Target_selector::do_recognize): Take new Input_file* argument.
4071 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4072 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4073 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4074 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4075
4076 * target.h (Target::Target_info): New members isolate_execinstr
4077 and rosegment_gap.
4078 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4079 * arm.cc (Target_arm::arm_info): Update initializer.
4080 * i386.cc (Target_i386::i386_info): Likewise.
4081 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4082 * sparc.cc (Target_sparc::sparc_info): Likewise.
4083 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4084 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4085 * layout.cc (Layout::attach_allocated_section_to_segment):
4086 Take new const Target* argument. If target->isolate_execinstr(), act
4087 like --rosegment.
4088 (Layout::find_first_load_seg): Take new const Target* argument;
4089 if target->isolate_execinstr(), reject PF_X segments.
4090 (Layout::relaxation_loop_body): Update caller.
4091 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4092 reset file offset to zero when we hit LOAD_SEG, and then do a second
4093 loop over the segments before LOAD_SEG to reassign offsets after
4094 addresses have been determined. Handle target->rosegment_gap().
4095 (Layout::attach_section_to_segment): Take new const Target* argument;
4096 pass it to attach_allocated_section_to_segment.
4097 (Layout::make_output_section): Update caller.
4098 (Layout::attach_sections_to_segments): Take new const Target* argument;
4099 pass it to attach_section_to_segment.
4100 * gold.cc (queue_middle_tasks): Update caller.
4101 * layout.h (Layout): Update method decls with new arguments.
4102
4103 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4104 Target_info pointer to use.
4105 (Target_arm::do_make_data_plt): New virtual method.
4106 (Target_arm::make_data_plt): New method that calls it.
4107 (Target_arm::make_plt_entry): Use it.
4108 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4109 for the section alignment.
4110 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4111 method.
4112 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4113 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4114 method.
4115 (Output_data_plt_arm::get_plt_entry_size): Call it.
4116 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4117 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4118 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4119 method.
4120 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4121 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4122 method instead of sizeof(plt_entry).
4123 (Output_data_plt_arm::add_entry): Likewise.
4124 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4125 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4126 than static method.
4127 (Target_arm::plt_entry_size): Likewise.
4128 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4129 Move to ...
4130 (Output_data_plt_arm_standard): ... here, new class.
4131 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4132 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4133 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4134
4135 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4136 Take additional argument for the PLT entry size.
4137 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4138 Use get_plt_entry_size method rather than plt_entry_size variable.
4139 (Output_data_plt_x86_64::reserve_slot): Likewise.
4140 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4141 (Output_data_plt_x86_64::add_entry): Likewise.
4142 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4143 (Output_data_plt_x86_64::address_for_global): Likewise.
4144 (Output_data_plt_x86_64::address_for_local): Likewise.
4145 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4146 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4147 Make method non-static.
4148 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4149 method.
4150 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4151 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4152 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4153 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4154 virtual method.
4155 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4156 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4157 virtual method.
4158 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4159 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4160 virtual method.
4161 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4162 (Output_data_plt_x86_64::plt_entry_size)
4163 (Output_data_plt_x86_64::first_plt_entry)
4164 (Output_data_plt_x86_64::plt_entry)
4165 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4166 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4167 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4168 (Output_data_plt_x86_64_standard): ... here, new class.
4169 (Target_x86_64::Target_x86_64): Take optional argument for the
4170 Target_info pointer to use.
4171 (Target_x86_64::do_make_data_plt): New virtual method.
4172 (Target_x86_64::make_data_plt): New method to call it.
4173 (Target_x86_64::init_got_plt_for_update): Use that.
4174 Call this->plt_->add_eh_frame method here.
4175 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4176 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4177 rather than static method.
4178 (Target_x86_64::plt_entry_size): Likewise.
4179 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4180 rather than plt_entry_size variable. Move guts of PLT filling to...
4181 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4182 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4183 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4184
4185 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4186 additional argument for the section alignment.
4187 Don't do add_eh_frame_for_plt here.
4188 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4189 non-static. Use get_plt_entry_size method rather than plt_entry_size
4190 variable.
4191 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4192 method.
4193 (Output_data_plt_i386::get_plt_entry_size): Call it.
4194 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4195 (Output_data_plt_i386::add_eh_frame): New method to call it.
4196 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4197 method.
4198 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4199 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4200 method.
4201 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4202 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4203 method instead of plt_entry_size.
4204 (Output_data_plt_i386::plt_entry_size)
4205 (Output_data_plt_i386::plt_eh_frame_fde_size)
4206 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4207 (Output_data_plt_i386_standard): ... here, new class.
4208 (Output_data_plt_i386_exec): New class.
4209 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4210 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4211 (Output_data_plt_i386::exec_plt_entry): Move to ...
4212 (Output_data_plt_i386_exec::plt_entry): ... here.
4213 (Output_data_plt_i386_dyn): New class.
4214 (Output_data_plt_i386::first_plt_entry): Move to ...
4215 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4216 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4217 (Output_data_plt_i386_dyn::plt_entry): ... here.
4218 (Target_i386::Target_i386): Take optional argument for the Target_info
4219 pointer to use.
4220 (Target_i386::do_make_data_plt): New virtual method.
4221 (Target_i386::make_data_plt): New method to call it.
4222 (Target_i386::make_plt_section): Use that.
4223 Call this->plt_->add_eh_frame method here.
4224 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4225 rather than plt_entry_size variable.
4226 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4227 (Output_data_plt_i386::address_for_local): Likewise.
4228 (Output_data_plt_i386::do_write): Likewise.
4229 Move guts of PLT filling to...
4230 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4231 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4232 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4233 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4234
b9b9f2ee
CC
42352012-05-01 Cary Coutant <ccoutant@google.com>
4236
4237 * dwarf_reader.cc (Dwarf_die::read_attributes)
4238 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4239 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4240 * reduced_debug_output.cc
4241 (Output_reduced_debug_info_section::get_die_end): Remove
4242 DW_FORM_GNU_ref_index. Add default case.
4243
57923f48
MW
42442012-04-26 Mark Wielaard <mjw@redhat.com>
4245
4246 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4247 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4248 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4249 DW_AT_high_pc as offset from DW_AT_low_pc.
4250
4251 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4252 * testsuite/Makefile.in: Regenerate.
4253 * testsuite/gdb_index_test_3.c: New test source file.
4254 * testsuite/gdb_index_test_3.sh: New test source file.
4255
2c54b4f4
ILT
42562012-04-25 Ian Lance Taylor <iant@google.com>
4257
4258 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4259 pointer.
4260 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4261 as a class, not a struct.
4262 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4263 (Target_arm::apply_cortex_a8_workaround): Likewise.
4264 * gc.h: Declare Reloc_types as a struct, not a class.
4265 * object.h: Declare Symbols_data as a struct.
4266 * reloc.h: Declare Read_relocs_data as a struct.
4267 * target.h: Declare Relocate_info as a struct.
4268
a5a5f7a3
DM
42692012-04-24 David S. Miller <davem@davemloft.net>
4270
4271 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4272 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4273 and R_SPARC_WPLT30.
4274
f038d496
CC
42752012-04-24 Cary Coutant <ccoutant@google.com>
4276
4277 * incremental-dump.cc (find_input_containing_global): Replace
4278 magic number with symbolic constant.
4279 (dump_incremental_inputs): Update version number.
4280 * incremental.cc (Output_section_incremental_inputs): Update version
4281 number; import symbolic constants from Incremental_inputs_reader.
4282 (Incremental_inputs::create_data_sections): Align relocations
4283 section correctly for 64-bit targets.
4284 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4285 constants; add padding.
4286 (Output_section_incremental_inputs::write_header): Add assert for
4287 header_size.
4288 (Output_section_incremental_inputs::write_input_files): Add assert
4289 for input_entry_size.
4290 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4291 add assert for object_info_size, input_section_entry_size,
4292 global_sym_entry_size.
4293 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4294 for data structure sizes; use them.
4295 (Incremental_input_entry_reader): Import symbolic constants from
4296 Incremental_inputs_reader; use them.
4297
a4d85145
DM
42982012-04-23 David S. Miller <davem@davemloft.net>
4299
4300 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4301 and elf_flags_set_.
4302 (Target_sparc::Target_sparc): Initialize new fields.
4303 (Target_sparc::do_make_elf_object): New function.
4304 (Target_sparc::do_adjust_elf_header): New function.
4305
1d509098
CC
43062012-04-23 Cary Coutant <ccoutant@google.com>
4307
4308 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4309 CU range table of gdb index.
4310
7ebeff7f
DM
43112012-04-20 David S. Miller <davem@davemloft.net>
4312
4313 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4314 instead of false.
4315
13cf9988
DM
43162012-04-16 David S. Miller <davem@davemloft.net>
4317
2a1079e8
DM
4318 * sparc.cc (Target_sparc::got_address): New function.
4319 (Sparc_relocate_functions::gdop_hix22): New function.
4320 (Sparc_relocate_functions::gdop_lox10): New function.
4321 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4322 relocs.
4323 (Target_sparc::Scan::local): Likewise if the global symbol is not
4324 preemptible and is not IFUNC.
4325 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4326 transformations for local and non-preemptible non-IFUNC global
4327 symbols.
4328
0bc964fc
DM
4329 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4330 writing out 64-bit part of ranges.
4331
661d7a80
DM
4332 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4333 -fpic and -fpie respectively.
4334 * Makefile.in: Regenerate.
4335
8c2bf391
DM
4336 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4337 (Target_sparc::Target_sparc): Initialize new field.
4338 (Target_sparc::do_plt_section_for_global): New function.
4339 (Target_sparc::do_plt_section_for_local): New function.
4340 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4341 (Target_sparc::make_plt_section): New function, broken out of
4342 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4343 (Target_sparc::make_plt_entry): Call make_plt_section.
4344 (Target_sparc::make_local_ifunc_plt_entry): New function.
4345 (Target_sparc::rela_ifunc_section): New function.
4346 (Target_sparc::plt_section): Remove const.
4347 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4348 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4349 and ifunc_count_ fields.
4350 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4351 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4352 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4353 (Output_data_plt_sparc::rela_ifunc): New function.
4354 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4355 (Output_data_plt_sparc::has_ifunc_section): New function.
4356 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4357 (Output_data_plt_sparc::address_for_global): New function.
4358 (Output_data_plt_sparc::address_for_local): New function.
4359 (Output_data_plt_sparc::plt_index_to_offset): New function.
4360 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4361 and entry_count.
4362 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4363 entry_count.
4364 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4365 R_SPARC_JMP_IREL to switch.
4366 (Target_sparc::Scan::check_non_pic): Likewise.
4367 (Target_sparc::Scan::local): Handle IFUNC symbols.
4368 (Target_sparc::Scan::local): Likewise.
4369 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4370 and plt_address_for_local.
4371 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4372 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4373
13cf9988
DM
4374 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4375 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4376 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4377 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4378 global relocs too.
4379 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4380 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4381 calls.
4382 * sparc.cc (Target_sparc::Scan::global): Likewise.
4383 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4384
31821be0
CC
43852012-04-16 Cary Coutant <ccoutant@google.com>
4386
4387 * archive.cc (Library_base::should_include_member): Check for
4388 --export-dynamic-symbol.
4389 * options.h (class General_options): Add --export-dynamic-symbol.
4390 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4391 --export-dynamic-symbol.
4392 (Symbol_table::gc_mark_undef_symbols): Likewise.
4393 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4394
2615994e
DM
43952012-04-12 David S. Miller <davem@davemloft.net>
4396
4397 * sparc.cc (Reloc::wdisp10): New relocation method.
4398 (Reloc::h34): Likewise.
4399 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4400 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4401 R_SPARC_WDISP10.
4402 (Target_sparc::Scan::local): Likewise.
4403 (Target_sparc::Scan::global): Likewise.
4404 (Target_sparc::Relocate::relocate): Likewise.
4405
6782735d
CC
44062012-04-09 Cary Coutant <ccoutant@google.com>
4407
4408 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4409 low_pc == 0.
4410
8c7a0b00
ILT
44112012-04-06 Ian Lance Taylor <iant@google.com>
4412
4413 * timer.cc: #include <unistd.h>.
4414
58797674
RM
44152012-04-06 Roland McGrath <mcgrathr@google.com>
4416
4417 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4418 * config.in: Regenerate.
4419 * configure: Regenerate.
4420
44350750
NC
44212012-04-05 Nick Clifton <nickc@redhat.com>
4422
4423 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4424 (AM_LC_MESSAGES): Add.
4425 * aclocal.m4: Regenerate.
4426 * config.in: Regenerate.
4427 * configure: Regenerate.
4428
c1027032
CC
44292012-03-21 Cary Coutant <ccoutant@google.com>
4430
4431 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4432 * Makefile.in: Regenerate.
4433 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4434 (Sized_elf_reloc_mapper::symbol_section): New function.
4435 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4436 (make_elf_reloc_mapper): New function.
4437 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4438 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4439 (Dwarf_abbrev_table::do_get_abbrev): New function.
4440 (Dwarf_ranges_table::read_ranges_table): New function.
4441 (Dwarf_ranges_table::read_range_list): New function.
4442 (Dwarf_pubnames_table::read_section): New function.
4443 (Dwarf_pubnames_table::read_header): New function.
4444 (Dwarf_pubnames_table::next_name): New function.
4445 (Dwarf_die::Dwarf_die): New function.
4446 (Dwarf_die::read_attributes): New function.
4447 (Dwarf_die::skip_attributes): New function.
4448 (Dwarf_die::set_name): New function.
4449 (Dwarf_die::set_linkage_name): New function.
4450 (Dwarf_die::attribute): New function.
4451 (Dwarf_die::string_attribute): New function.
4452 (Dwarf_die::int_attribute): New function.
4453 (Dwarf_die::uint_attribute): New function.
4454 (Dwarf_die::ref_attribute): New function.
4455 (Dwarf_die::child_offset): New function.
4456 (Dwarf_die::sibling_offset): New function.
4457 (Dwarf_info_reader::check_buffer): New function.
4458 (Dwarf_info_reader::parse): New function.
4459 (Dwarf_info_reader::do_parse): New function.
4460 (Dwarf_info_reader::do_read_string_table): New function.
4461 (Dwarf_info_reader::lookup_reloc): New function.
4462 (Dwarf_info_reader::get_string): New function.
4463 (Dwarf_info_reader::visit_compilation_unit): New function.
4464 (Dwarf_info_reader::visit_type_unit): New function.
4465 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4466 Sized_elf_reloc_mapper.
4467 (Sized_dwarf_line_info::symbol_section): Remove function.
4468 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4469 (Sized_dwarf_line_info::read_line_mappings): Remove object
4470 parameter, adjust callers.
4471 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4472 * dwarf_reader.h: Include <sys/types.h>.
4473 (class Track_relocs): Remove forward declaration.
4474 (class Elf_reloc_mapper): New class.
4475 (class Sized_elf_reloc_mapper): New class.
4476 (class Dwarf_abbrev_table): New class.
4477 (class Dwarf_range_list): New class.
4478 (class Dwarf_ranges_table): New class.
4479 (class Dwarf_pubnames_table): New class.
4480 (class Dwarf_die): New class.
4481 (class Dwarf_info_reader): New class.
4482 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4483 (Sized_dwarf_line_info::symbol_section): Remove member function.
4484 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4485 base class.
4486 * gdb-index.cc: New source file.
4487 * gdb-index.h: New source file.
4488 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4489 and .debug_types sections, call Layout::add_to_gdb_index.
4490 (Sized_relobj_incr::do_section_name): Implement.
4491 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4492 return type; Implement.
4493 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4494 return type.
4495 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4496 parameter list and return type.
4497 (Sized_incr_dynobj::do_section_contents): Likewise.
4498 * layout.cc: Include gdb-index.h.
4499 (Layout::Layout): Initialize gdb_index_data_.
4500 (Layout::init_fixed_output_section): Check for .gdb_index section.
4501 (Layout::add_to_gdb_index): New function. Instantiate.
4502 * layout.h: Add forward declaration for class Gdb_index.
4503 (Layout::add_to_gdb_index): New member function.
4504 (Layout::gdb_index_data_): New data member.
4505 * main.cc: Include gdb-index.h.
4506 (main): Print statistics for gdb index.
4507 * object.cc (Object::section_contents): Move code into
4508 do_section_contents.
4509 (need_decompressed_section): Check for sections needed when building
4510 gdb index.
4511 (build_compressed_section_map): Likewise.
4512 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4513 gdb index.
4514 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4515 sections; call Layout::add_to_gdb_index.
4516 (Sized_relobj_file::do_decompressed_section_contents): Call
4517 do_section_contents directly.
4518 * object.h (Object::do_section_contents): Adjust parameter list and
4519 return type.
4520 (Object::do_decompressed_section_contents): Call do_section_contents
4521 directly.
4522 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4523 return type.
4524 * options.h (class General_options): Add --gdb-index option.
4525 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4526 list and return type.
4527 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4528 * reloc.h (Track_relocs::checkpoint): New function.
4529 (Track_relocs::reset): New function.
4530
4531 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4532 New test cases.
4533 * testsuite/Makefile.in: Regenerate.
4534 * testsuite/gdb_index_test.cc: New test source file.
4535 * testsuite/gdb_index_test_1.sh: New test source file.
4536 * testsuite/gdb_index_test_2.sh: New test source file.
4537
647f1574
DK
45382012-03-19 Doug Kwan <dougkwan@google.com>
4539
4540 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4541 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4542 __exidx_start and __exidx_end. Make symbol table parameter
4543 anonymous as it is not used.
4544 * gold.cc (queue_middle_tasks): Call target hook to define any
4545 target-specific symbols.
4546 * target.h (Target::define_standard_symbols): New method.
4547 (Target::do_define_standard_symbols): Same.
4548 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4549 * testsuite/Makefile.in: Regenerate.
4550 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4551 and __exidx_end.
4552 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4553 relocations are generated for __exidx_start and __exidx_end.
4554
7c6109da
DK
45552012-03-16 Doug Kwan <dougkwan@google.com>
4556
4557 * testsuite/Makefile.am: Disable test initpri3b.
4558 * testsuite/Makefile.in: Regenerate.
4559
7b8957f8
DK
45602012-03-15 Doug Kwan <dougkwan@google.com>
4561
4562 * arm.cc (Target_arm::got_section): Make .got section read-only
4563 if -z now is given.
4564
14dc9ef7
ILT
45652012-03-15 Ian Lance Taylor <iant@google.com>
4566
4567 PR gold/13850
4568 * layout.cc (Layout::make_output_section): Correctly mark
4569 SHT_INIT_ARRAY, et. al., as relro.
4570
fa40b62a
DK
45712012-03-14 Doug Kwan <dougkwan@google.com>
4572
4573 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4574 dynamic relocations for protected symbols in shared objects.
4575
fd325007
ILT
45762012-03-13 Ian Lance Taylor <iant@google.com>
4577
4578 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4579 keep the larger alignment.
4580
e8dd54e1
CC
45812012-03-12 Cary Coutant <ccoutant@google.com>
4582
4583 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4584 handling of DW_LNE_define_file.
4585
feb5f3b0
CC
45862012-03-12 Cary Coutant <ccoutant@google.com>
4587
4588 * reduced_debug_output.cc
4589 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4590 codes to switch.
4591
a1fb4256
CC
45922012-02-29 Cary Coutant <ccoutant@google.com>
4593
4594 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4595
5dd8762a
CC
45962012-02-29 Cary Coutant <ccoutant@google.com>
4597
4598 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4599 Call Object::decompressed_section_contents.
4600 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4601 New dtor.
4602 (Sized_dwarf_line_info::buffer_start_): New data member.
4603 * merge.cc (Output_merge_data::do_add_input_section): Call
4604 Object::decompressed_section_contents.
4605 (Output_merge_string::do_add_input_section): Likewise.
4606 * object.cc (need_decompressed_section): New function.
4607 (build_compressed_section_map): Decompress sections needed later.
4608 (Sized_relobj_file::do_decompressed_section_contents): New function.
4609 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4610 * object.h (Object::decompressed_section_contents): New function.
4611 (Object::discard_decompressed_sections): New function.
4612 (Object::do_decompressed_section_contents): New function.
4613 (Object::do_discard_decompressed_sections): New function.
4614 (Compressed_section_info): New type.
4615 (Compressed_section_map): Include decompressed section contents.
4616 (Sized_relobj_file::do_decompressed_section_contents): New function.
4617 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4618
7b5de7ee
CC
46192012-02-16 Cary Coutant <ccoutant@google.com>
4620
4621 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4622 * testsuite/Makefile.in: Regenerate.
4623
f9fa4a63
CC
46242012-02-14 Cary Coutant <ccoutant@google.com>
4625
4626 * options.cc (General_options::finalize): Disallow -pie and -static.
4627
2c175ebc
DK
46282012-02-03 Doug Kwan <dougkwan@google.com>
4629
4630 * arm.cc (Arm_relocate_functions::abs8,
4631 Arm_relocate_functions::abs16): Use
4632 Bits::has_signed_unsigned_overflow32.
4633 (Arm_relocate_functions::thm_abs8): Correct range of
4634 overflow check.
4635 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4636 in assertions.
4637
90cff06f
DK
46382012-02-02 Doug Kwan <dougkwan@google.com>
4639
4640 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4641 position independent outputs, not just shared objects.
4642
63887f3d
L
46432012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4644
4645 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4646 * configure: Regenerated.
4647
bef2b434
ILT
46482012-01-27 Ian Lance Taylor <iant@google.com>
4649
4650 * reloc.h (Bits): New class with static functions, copied from
4651 namespace utils in arm.cc.
4652 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4653 instead.
4654
c335b55d
L
46552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4656
4657 * incremental.cc (write_info_blocks): Correct relocation offset.
4658
41194d9f
L
46592012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4660
4661 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4662 (Relocate::tls_gd_to_le): Likewise.
4663
1bae613c
L
46642012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4665
4666 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4667
24482ca0
L
46682012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4669
4670 * configure.ac: Check if -mcmodel=medium works.
4671 * configure: Regenerated.
4672
c2c7840a
CC
46732012-01-24 Cary Coutant <ccoutant@google.com>
4674
4675 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4676 definition and ...
4677 (read_unsigned_LEB_128_x): ... this new function.
4678 (read_signed_LEB_128): Replaced with inline definition and ...
4679 (read_signed_LEB_128_x): ... this new function.
4680 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4681 (read_unsigned_LEB_128): Add inline definition.
4682 (read_signed_LEB_128_x): New function.
4683 (read_signed_LEB_128): Add inline definition.
4684 * testsuite/Makefile.am (leb128_unittest): New unit test.
4685 * testsuite/Makefile.in: Regenerate.
4686 * testsuite/leb128_unittest.cc: New unit test.
4687
833de760 46882012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4689
4690 PR gold/13617
4691 * i386.cc (Target_i386::do_code_fill): When using a jmp
4692 instruction, pad with nop instructions.
4693 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4694
618d6666
L
46952012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4696
4697 * x86_64.cc (gc_process_relocs): Add typename on types used in
4698 template.
4699 (scan_relocs): Likewise.
4700 (relocate_section): Likewise.
4701 (apply_relocation): Likewise.
4702
3660ff06
L
47032012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4704
4705 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4706 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4707 under x32.
4708
fc51264f
L
47092012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4710
4711 * x86_64.cc: Initial support for x32.
4712
dd74ae06
CC
47132012-01-03 Cary Coutant <ccoutant@google.com>
4714
4715 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4716 Use abstract base class for GOT.
4717 * gold/output.h (class Output_data_got_base): New abstract base class.
4718 (class Output_data_got): Derive from new base class, adjust ctors.
4719 (Output_data_got::reserve_slot): Make virtual; rename to
4720 do_reserve_slot; Adjust callers.
4721 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4722 pointer to abstract base class.
4723 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4724
83896202
ILT
47252011-12-18 Ian Lance Taylor <iant@google.com>
4726
4727 * object.h (Relobj::local_symbol_value): New function.
4728 (Relobj::local_plt_offset): New function.
4729 (Relobj::local_has_got_offset): New function.
4730 (Relobj::local_got_offset): New function.
4731 (Relobj::set_local_got_offset): New function.
4732 (Relobj::do_local_symbol_value): New pure virtual function.
4733 (Relobj::do_local_plt_offset): Likewise.
4734 (Relobj::do_local_has_got_offset): Likewise.
4735 (Relobj::do_local_got_offset): Likewise.
4736 (Relobj::do_set_local_got_offset): Likewise.
4737 (Sized_relobj::do_local_has_got_offset): Rename from
4738 local_has_got_offset.
4739 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4740 (Sized_relobj::do_set_local_got_offset): Rename from
4741 set_local_got_offset.
4742 (Sized_relobj_file::do_local_plt_offset): Rename from
4743 local_plt_offset.
4744 (Sized_relobj_file::do_local_symbol_value): New function.
4745 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4746 local_plt_offset.
4747 * output.cc (Output_data_got::Got_entry::write): Change object to
4748 Relobj. Use local_symbol_value.
4749 (Output_data_got::add_global_with_rel): Change rel_dyn to
4750 Output_data_reloc_generic*. Use add_global_generic.
4751 (Output_data_got::add_global_with_rela): Remove. Change all
4752 callers to use add_global_with_rel.
4753 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4754 Output_data_reloc_generic*. Use add_global_generic.
4755 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4756 callers to use add_global_pair_with_rel.
4757 (Output_data_got::add_local): Change object to Relobj*.
4758 (Output_data_got::add_local_plt): Likewise.
4759 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4760 change rel_dyn to Output_data_reloc_generic*. Use
4761 add_local_generic.
4762 (Output_data_got::add_local_with_rela): Remove. Change all
4763 callers to use all_local_with_rel.
4764 (Output_data_got::add_local_pair_with_rel): Change object to
4765 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4766 add_output_section_generic.
4767 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4768 callers to use add_local_pair_with_rel.
4769 (Output_data_got::reserve_local): Change object to Relobj*.
4770 * output.h: (class Output_data_reloc_generic): Add pure virtual
4771 declarations for add_global_generic, add_local_generic,
4772 add_output_section_generic.
4773 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4774 functions for Output_data_reloc_generic. Update declarations for
4775 changes listed in output.cc.
4776 (class Output_data_got): Change template parameter to got_size.
4777 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4778 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4779 function.
4780 (Sized_relobj_incr::do_local_plt_offset): New function.
4781 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4782 add_global_generic.
4783
76677ad0
CC
47842011-12-17 Cary Coutant <ccoutant@google.com>
4785
4786 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4787 * resolve.cc (Symbol_table::resolve): Likewise.
4788 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4789 arrays.
4790 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4791
8b8dd8d5
ILT
47922011-12-16 Ian Lance Taylor <iant@google.com>
4793
4794 * output.h (Output_data_reloc_generic::add): Only call
4795 add_dynamic_reloc if this is a dynamic reloc section.
4796
d55525b9
L
47972011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4798
4799 PR gold/13505
4800 * target-reloc.h (apply_relocation): Replace <64, false> with
4801 <size, big_endian>.
4802
ff81c7c1
NC
48032011-11-25 Nick Clifton <nickc@redhat.com>
4804
4805 * po/it.po: New Italian translation.
4806
628f39be
SA
48072011-11-17 Sterling Augustine <saugustine@google.com>
4808
4809 * script.cc (script_include_directive): Implement.
4810 (read_script_file): New local variables name and search_path. Update
4811 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4812 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4813 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4814
98ef3ea4
SA
48152011-11-11 Sterling Augustine <saugustine@google.com>
4816
4817 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4818 (file_or_sections_cmd): Likewise.
4819
f4a8b6d7
DK
48202011-11-11 Doug Kwan <dougkwan@google.com>
4821
4822 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4823 if --just-symbols is given.
4824
29ab395d
DK
48252011-11-10 Doug Kwan <dougkwan@google.com>
4826
4827 PR gold/13362
4828 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4829 when processing data relocs.
4830 * reloc.h (Relocate_functions::rel_unaligned): New method.
4831 (Relocate_functions::pcrel_unaligned): Ditto.
4832 (Relocate_functions::rel32_unaligned): Ditto.
4833 (Relocate_functions::pcrel32_unaligned): Ditto.
4834
2c339f71
DK
48352011-11-09 Doug Kwan <dougkwan@google.com>
4836
4837 PR gold/13362
4838 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4839 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4840 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4841 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4842 (Relocate_functions::rel_unaligned): New.
4843 (Relocate_functions::rel32_unaligned): New.
4844 * target-reloc.h (relocate_for_relocatable): Add code to handle
4845 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4846 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4847 arm_unaligned_reloc_r): New targets.
4848 * testsuite/Makefile.in: Regenerate.
4849 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4850 linking.
4851
3f3cddf1
ILT
48522011-11-02 Ian Lance Taylor <iant@google.com>
4853
4854 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4855 NATIVE_LINKER.
4856 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4857 * options.cc (General_options::finalize): Use library search path
4858 from configure script if specified. If not native and no sysroot,
4859 only search TOOLLIBDIR.
4860 * options.h (Search_directory::Search_directory): Change name to
4861 const std::string&.
4862 (General_options::add_to_library_path_with_sysroot): Change arg to
4863 const std::string&.
4864 * configure, Makefile.in, config.in: Rebuild.
4865
a8e2273b
ILT
48662011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4867
4868 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4869 we are working around the ARM1176 Erratum.
4870 * options.h (General_options::fix_arm1176): Add option.
4871 * testsuite/Makefile.am: Add testcases, and keep current ones
4872 working.
4873 * testsuite/Makefile.in: Regenerate.
4874 * testsuite/arm_fix_1176.s: New file.
4875 * testsuite/arm_fix_1176.sh: Likewise.
4876
cd6eab1c
ILT
48772011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4878
4879 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4880 may_use_blx_.
4881 (Target_arm::may_use_blx): Remove method.
4882 (Target_arm::set_may_use_blx): Likewise.
4883 (Target_arm::may_use_v4t_interworking): New method.
4884 (Target_arm::may_use_v5t_interworking): Likewise.
4885 (Target_arm::may_use_blx_): Remove member variable.
4886 (Arm_relocate_functions::arm_branch_common): Check for v5T
4887 interworking.
4888 (Arm_relocate_functions::thumb_branch_common): Likewise.
4889 (Reloc_stub::stub_type_for_reloc): Likewise.
4890 (Target_arm::do_finalize_sections): Correct interworking checks.
4891 * testsuite/Makefile.am: Add new tests.
4892 * testsuite/Makefile.in: Regenerate.
4893 * testsuite/arm_farcall_arm_arm.s: New test.
4894 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4895 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4896 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4897 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4898 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4899 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4900 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4901
286adcf4
CC
49022011-10-31 Cary Coutant <ccoutant@google.com>
4903
4904 PR gold/13023
4905 * expression.cc (Expression::eval_with_dot): Add
4906 is_section_dot_assignment parameter.
4907 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4908 absolute and assigning to dot within a section.
4909 * script-sections.cc
4910 (Output_section_element_assignment::set_section_addresses): Pass
4911 dot_section to set_if_absolute.
4912 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4913 as is_section_dot_assignment flag to eval_with_dot.
4914 (Output_section_element_dot_assignment::set_section_addresses):
4915 Likewise.
4916 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4917 parameter. Also set value if relative to dot_section; set the
4918 symbol's output_section.
4919 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4920 parameter. Adjust all callers.
4921 (Expression::eval_maybe_dot): Likewise.
4922 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4923 Adjust all callers.
4924 * testsuite/script_test_2.t: Test assignment of an absolute value
4925 to dot within an output section element.
4926
9634ed06
CC
49272011-10-31 Cary Coutant <ccoutant@google.com>
4928
4929 * options.h (class General_options): Add --[no-]gnu-unique options.
4930 * symtab.cc (Symbol_table::sized_write_globals): Convert
4931 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4932
de4101c7
CC
49332011-10-31 Cary Coutant <ccoutant@google.com>
4934
4935 PR gold/13359
4936 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4937 unnecessary assertion.
4938 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4939
7257cc92
ST
49402011-10-31 Sriraman Tallam <tmsriram@google.com>
4941
4942 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4943 gc_mark_symbol.
4944 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4945 gc_mark_symbol.
4946 Change to just keep the section associated with symbol.
4947 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4948 they are externally visible and --export-dynamic is turned on.
4949 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4950
bfc34b3f
ILT
49512011-10-19 Ian Lance Taylor <iant@google.com>
4952
4953 PR gold/13163
4954 * script-sections.cc
4955 (Output_section_element_dot_assignment::needs_output_section): New
4956 function.
4957
ea0d8c47
ILT
49582011-10-19 Ian Lance Taylor <iant@google.com>
4959
4960 PR gold/13204
4961 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4962 --section-start option was seen.
4963 * options.h (General_options::any_section_start): New function.
4964
abd242a9
DM
49652011-10-18 David S. Miller <davem@davemloft.net>
4966
4967 PR binutils/13301
4968 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4969 member to track relocation locations that have moved during TLS
4970 reloc optimizations.
4971 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4972 (Target_sparc::Relocate::relocate): Adjust view down by 4
4973 bytes if it matches reloc_adjust_addr_.
4974 (Target_sparc::Relocate::relocate_tls): Always move the
4975 __tls_get_addr call delay slot instruction forward 4 bytes when
4976 performing relaxation.
4977
bab9090f
CC
49782011-10-18 Cary Coutant <ccoutant@google.com>
4979
4980 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4981 (Output_file::map_no_anonymous): Check for non-zero
4982 return code from posix_fallocate.
4983
f7c5b166
CC
49842011-10-17 Cary Coutant <ccoutant@google.com>
4985
4986 PR gold/13245
4987 * plugin.cc (is_visible_from_outside): Check for symbols
4988 referenced from dynamic objects.
4989 * resolve.cc (Symbol_table::resolve): Don't count references
4990 from dynamic objects as references from real ELF files.
4991 * testsuite/plugin_test_2.sh: Adjust expected result.
4992
b490c0bb
CC
49932011-10-17 Cary Coutant <ccoutant@google.com>
4994
4995 * gold.cc: Include timer.h.
4996 (queue_middle_tasks): Stamp time.
4997 (queue_final_tasks): Likewise.
4998 * main.cc (main): Store timer in parameters. Print timers
4999 for each pass.
5000 * parameters.cc (Parameters::Parameters): Initialize timer_.
5001 (Parameters::set_timer): New function.
5002 (set_parameters_timer): New function.
5003 * parameters.h (Parameters::set_timer): New function.
5004 (Parameters::timer): New function.
5005 (Parameters::timer_): New data member.
5006 (set_parameters_timer): New function.
5007 * timer.cc (Timer::stamp): New function.
5008 (Timer::get_pass_time): New function.
5009 * timer.h (Timer::stamp): New function.
5010 (Timer::get_pass_time): New function.
5011 (Timer::pass_times_): New data member.
5012
f475cf7b
CC
50132011-10-17 Cary Coutant <ccoutant@google.com>
5014
5015 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5016 task for members of lib groups.
5017
cdd7e244
CC
50182011-10-17 Cary Coutant <ccoutant@google.com>
5019
5020 PR gold/13288
4f95c8b4 5021 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5022 (File_read::make_view): Move bounds check (replace with assert)...
5023 (File_read::find_or_make_view): ... to here.
5024
dfb45471
CC
50252011-10-12 Cary Coutant <ccoutant@google.com>
5026
4f95c8b4 5027 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5028 ::read returns less than requested size.
5029
53bbcc1b
CC
50302011-10-10 Cary Coutant <ccoutant@google.com>
5031
4f95c8b4 5032 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5033 Initialize defined_count_.
5034 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5035 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5036 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5037 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5038 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5039 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5040 member.
5041 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5042 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5043 Return zeroes instead of internal error.
5044
397b129b
CC
50452011-10-10 Cary Coutant <ccoutant@google.com>
5046
5047 PR gold/13249
4f95c8b4 5048 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5049 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5050 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5051 (Output_reloc::type_): Adjust size of bit field.
5052 (Output_reloc::use_plt_offset_): New bit field.
5053 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5054 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5055 flag. Adjust all callers.
4f95c8b4 5056 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5057 creating RELATIVE relocations.
5058
d5698657
NC
50592011-10-10 Nick Clifton <nickc@redhat.com>
5060
5061 * po/es.po: Updated Spanish translation.
5062 * po/fi.po: Updated Finnish translation.
5063
6a59a5c2
DN
50642011-10-03 Diego Novillo <dnovillo@google.com>
5065
5066 * options.cc (parse_uint): Fix dereference of RETVAL.
5067
f0558624
ST
50682011-09-29 Sriraman Tallam <tmsriram@google.com>
5069
5070 * layout.h (section_order_map_): New member.
5071 (get_section_order_map): New member function.
5072 * output.cc (Output_section::add_input_section): Check for patterns
5073 only when --section-ordering-file is specified.
5074 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5075 output_sections have been formed.
5076 * layout.cc (Layout_Layout): Initialize section_order_map_.
5077 * plugin.cc (update_section_order): Store order in order_map. Do not
5078 update the order.
5079 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5080 * testsuite/Makefile.in: Regenerate.
5081 * testsuite/plugin_section_order.c: New file.
5082 * testsuite/plugin_final_layout.cc: New file.
5083 * testsuite/plugin_final_layout.sh: New file.
5084
a7dac153
CC
50852011-09-29 Cary Coutant <ccoutant@google.com>
5086
4f95c8b4 5087 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5088 Check for NULL.
4f95c8b4 5089 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5090 symbols during incremental update.
5091 (Symbol_table::add_from_dynobj): Likewise.
5092
eebd87a5
ILT
50932011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5094 Ian Lance Taylor <iant@google.com>
5095
5096 * symtab.cc (Symbol_table::define_special_symbol): Always
5097 canonicalize version string.
5098
403a3331
CC
50992011-09-26 Cary Coutant <ccoutant@google.com>
5100
4f95c8b4
CC
5101 * gold.cc (queue_initial_tasks): Move option checks ...
5102 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5103 some options; make others fatal.
5104
235061c2
CC
51052011-09-26 Cary Coutant <ccoutant@google.com>
5106
5107 gcc PR lto/47247
5108 * plugin.cc (get_symbols_v2): New function.
5109 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5110 (is_referenced_from_outside): New function.
5111 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5112 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5113 (get_symbols): Pass version parameter.
5114 (get_symbols_v2): New function.
5115 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5116 parameter.
5117 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5118 (onload): Add LDPT_GET_SYMBOLS_V2.
5119 (all_symbols_read_hook): Use get_symbols_v2; check for
5120 LDPR_PREVAILING_DEF_IRONLY_EXP.
5121 * testsuite/plugin_test_3.sh: Update expected results.
5122
dc87f620
ILT
51232011-09-23 Simon Baldwin <simonb@google.com>
5124
5125 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5126 configuration options.
5127 * configure: Regenerate.
5128 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5129 * Makefile.in: Regenerate.
5130 * testsuite/Makefile.in: Regenerate.
5131
a8279f82
ST
51322011-09-19 Sriraman Tallam <tmsriram@google.com>
5133
5134 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5135
0c9350c8
CC
51362011-09-19 Cary Coutant <ccoutant@google.com>
5137
5138 * incremental.cc (can_incremental_update): Fix typo in comment.
5139 * incremental.h (can_incremental_update): Likewise.
5140
aa06ae28
CC
51412011-09-18 Cary Coutant <ccoutant@google.com>
5142
5143 * incremental.cc (can_incremental_update): New function.
5144 * incremental.h (can_incremental_update): New function.
5145 * layout.cc (Layout::init_fixed_output_section): Call it.
5146 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5147 * object.cc (Sized_relobj_file::do_layout): Call
5148 can_incremental_update.
5149
ebb300b2
CC
51502011-09-13 Cary Coutant <ccoutant@google.com>
5151
5152 * configure.ac: Check for glibc support for gnu_indirect_function
5153 support with static linking, setting automake conditional
5154 IFUNC_STATIC.
5155 * Makefile.in: Regenerate.
5156 * configure: Regenerate.
5157
5158 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5159 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5160 for IFUNC_STATIC.
5161 * testsuite/Makefile.in: Regenerate.
5162
1206d0d5
CC
51632011-09-13 Cary Coutant <ccoutant@google.com>
5164
5165 * incremental.cc (Sized_relobj_incr::do_layout): Call
5166 report_comdat_group for kept comdat sections.
5167 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5168 * testsuite/Makefile.in: Regenerate.
5169 * testsuite/incr_comdat_test_1.cc: New source file.
5170 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5171 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5172 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5173
40b29874
ILT
51742011-09-13 Ian Lance Taylor <iant@google.com>
5175
5176 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5177 variable external_symbols_offset.
5178
1b045aac
ILT
51792011-09-12 Ian Lance Taylor <iant@google.com>
5180
5181 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5182 triggered if object has no symbols.
5183
24c6c55a
DM
51842011-09-09 David S. Miller <davem@davemloft.net>
5185
5186 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5187 (Output_fill_debug_line::do_write): Likewise.
5188
66570254
CC
51892011-08-29 Cary Coutant <ccoutant@google.com>
5190
5191 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5192 casts to match formatting specs.
5193 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5194
8ea8cd50
CC
51952011-08-26 Cary Coutant <ccoutant@google.com>
5196
5197 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5198 remaining hole size when allocating.
5199 (Layout::make_output_section): Set fill methods for debug sections.
5200 * layout.h (Free_list::Free_list_node): Move from private to
5201 public.
5202 (Free_list::set_min_hole_size): New function.
5203 (Free_list::begin, Free_list::end): New functions.
5204 (Free_list::min_hole_): New data member.
5205 * output.cc: Include dwarf.h.
5206 (Output_fill_debug_info::do_minimum_hole_size): New function.
5207 (Output_fill_debug_info::do_write): New function.
5208 (Output_fill_debug_line::do_minimum_hole_size): New function.
5209 (Output_fill_debug_line::do_write): New function.
5210 (Output_section::Output_section): Initialize new data member.
5211 (Output_section::set_final_data_size): Ensure patch space is larger
5212 than minimum hole size.
5213 (Output_section::do_write): Fill holes in debug sections.
5214 * output.h (Output_fill): New class.
5215 (Output_fill_debug_info): New class.
5216 (Output_fill_debug_line): New class.
5217 (Output_section::set_free_space_fill): New function.
5218 (Output_section::free_space_fill_): New data member.
5219 * testsuite/Makefile.am (incremental_test_3): Add
5220 --incremental-patch option.
5221 (incremental_test_4): Likewise.
5222 (incremental_test_5): Likewise.
5223 (incremental_test_6): Likewise.
5224 (incremental_copy_test): Likewise.
5225 (incremental_common_test_1): Likewise.
5226 * testsuite/Makefile.in: Regenerate.
5227
7cf80422
NC
52282011-08-26 Nick Clifton <nickc@redhat.com>
5229
5230 * po/es.po: Updated Spanish translation.
5231
c3f7b0e5
CC
52322011-08-01 Cary Coutant <ccoutant@google.com>
5233
5234 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5235 * gold/testsuite/Makefile.in: Regenerate.
5236 * gold/testsuite/justsyms_exec.c: New source file.
5237 * gold/testsuite/justsyms_lib.c: New source file.
5238
9590bf25
CC
52392011-08-01 Cary Coutant <ccoutant@google.com>
5240
5241 * layout.cc (Layout::set_segment_offsets): Don't realign text
5242 segment if -Ttext was specified.
5243 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5244 file type.
5245 * object.h (Sized_relobj_file::e_type): New function.
5246 (Sized_relobj_file::e_type_): New data member.
5247 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5248 base address for ET_EXEC files.
5249 * target.cc (Target::do_make_elf_object_implementation): Allow
5250 ET_EXEC files with --just-symbols option.
5251
dcd8d12e
CC
52522011-07-28 Cary Coutant <ccoutant@google.com>
5253
5254 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5255 Add thread_number parameter.
5256 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5257 * workqueue-threads.cc
5258 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5259 current thread if its thread number is greater than desired thread
5260 count.
5261 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5262 Add thread_number parameter.
5263 (Workqueue::should_cancel_thread): Likewise.
5264 (Workqueue::find_runnable_or_wait): Pass thread_number to
5265 should_cancel_thread.
5266 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5267 parameter.
5268
804eb480
ST
52692011-07-22 Sriraman Tallam <tmsriram@google.com>
5270
5271 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5272 only after checking if it cannot be forced local.
5273 * symtab.h (is_externally_visible): Check if the symbol is not forced
5274 local.
5275
f1ddb600
ILT
52762011-07-15 Ian Lance Taylor <iant@google.com>
5277
5278 * options.h (class General_options): Add --print-output-format.
5279 Move -EL next to -EB, for better --help output.
5280 * target-select.cc: Include <cstdio>, "options.h", and
5281 "parameters.h".
5282 (Target_selector::do_target_bfd_name): New function.
5283 (print_output_format): New function.
5284 * target-select.h (class Target_selector): Update declarations.
5285 (Target_selector::target_bfd_name): New function.
5286 (print_output_format): Declare.
5287 * main.cc: Include "target-select.h".
5288 (main): Handle --print-output-format.
5289 * gold.cc: Include "target-select.h".
5290 (queue_initial_tasks): Handle --print-output-format when there are
5291 no input files.
5292 * parameters.cc (parameters_force_valid_target): Give a better
5293 error message if -EB/-EL does not match target.
5294 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5295 function.
5296
7d172687
ILT
52972011-07-15 Ian Lance Taylor <iant@google.com>
5298
5299 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5300 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5301 (Output_data_plt_i386::do_write): Write address of .dynamic
5302 section to first entry in .got.plt section.
5303 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5304 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5305 Initialize layout_.
5306 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5307 section to first entry in .got.plt section.
5308 * layout.h (Layout::dynamic_section): New function.
5309
e9552f7e
ST
53102011-07-13 Sriraman Tallam <tmsriram@google.com>
5311
5312 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5313 to claim_file call.
5314 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5315 input_section_position_, and input_section_glob_.
5316 (read_layout_from_file): Call function section_ordering_specified.
5317 * layout.h (is_section_ordering_specified): New function.
5318 (section_ordering_specified): New function.
5319 (section_ordering_specified_): New boolean member.
5320 * main.cc(main): Call load_plugins after layout object is defined.
5321 * output.cc (Output_section::add_input_section): Use
5322 function section_ordering_specified to check if section ordering is
5323 needed.
5324 * output.cc (Output_section::add_relaxed_input_section): Use
5325 function section_ordering_specified to check if section ordering is
5326 needed.
5327 (Output_section::update_section_layout): New function.
5328 (Output_section::sort_attached_input_sections): Check if input section
5329 must be reordered.
5330 * output.h (Output_section::update_section_layout): New function.
5331 * plugin.cc (get_section_count): New function.
5332 (get_section_type): New function.
5333 (get_section_name): New function.
5334 (get_section_contents): New function.
5335 (update_section_order): New function.
58797674 5336 (allow_section_ordering): New function.
e9552f7e
ST
5337 (Plugin::load): Add the new interfaces to the transfer vector.
5338 (Plugin_manager::load_plugins): New parameter.
5339 (Plugin_manager::all_symbols_read): New parameter.
5340 (Plugin_manager::claim_file): New parameter. Save the elf object for
5341 unclaimed objects.
5342 (Plugin_manager::get_elf_object): New function.
5343 (Plugin_manager::get_view): Change to directly use the bool to check
5344 if get_view is called from claim_file_hook.
5345 * plugin.h (input_objects): New function
5346 (Plugin__manager::load_plugins): New parameter.
5347 (Plugin_manager::claim_file): New parameter.
5348 (Plugin_manager::get_elf_object): New function.
5349 (Plugin_manager::in_claim_file_handler): New function.
5350 (Plugin_manager::in_claim_file_handler_): New member.
5351 (layout): New function.
5352 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5353 handler with an extra parameter. Make the elf object before calling
5354 claim_file handler.
5355 * testsuite/plugin_test.c (get_section_count): New function pointer.
5356 (get_section_type): New function pointer.
5357 (get_section_name): New function pointer.
5358 (get_section_contents): New function pointer.
5359 (update_section_order): New function pointer.
5360 (allow_section_ordering): New function pointer.
5361 (onload): Check if the new interfaces exist.
5362
9446efde
ILT
53632011-07-13 Ian Lance Taylor <iant@google.com>
5364
5365 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5366 relro section.
5367 * x86_64.cc (Target_x86_64::got_section): Likewise.
5368 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5369 (relro_now_test_SOURCES): New variable.
5370 (relro_now_test_DEPENDENCIES): New variable.
5371 (relro_now_test_LDFLAGS): New variable.
5372 (relro_now_test_LDADD): New variable.
5373 (relro_now_test.so): New target.
5374 * testsuite/Makefile.in: Rebuild.
5375
07aa62f2
ILT
53762011-07-12 Ian Lance Taylor <iant@google.com>
5377
5378 PR gold/12980
5379 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5380 GLOB_DAT relocation rather than a RELATIVE relocation for a
5381 protected symbol when creating a shared library.
5382 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5383 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5384 * testsuite/protected_main_1.cc (main): Test that protected
5385 function has same address.
5386
e2153196
ILT
53872011-07-11 Ian Lance Taylor <iant@google.com>
5388
5389 PR gold/12979
5390 * options.h (class General_options): Add -Bgroup.
5391 * options.cc (General_options::finalize): If -Bgroup is set,
5392 default to --unresolved-symbols=report-all.
5393 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5394 * target-reloc.h (issue_undefined_symbol_error): Handle
5395 --unresolved-symbols=report-all.
5396
6daf5215
ILT
53972011-07-08 Ian Lance Taylor <iant@google.com>
5398
5399 PR gold/11985
5400 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5401 if linker script discards key sections.
5402 (Layout::create_dynamic_symtab): Likewise.
5403 (Layout::assign_local_dynsym_offsets): Likewise.
5404 (Layout::sized_create_version_sections): Likewise.
5405 (Layout::create_interp): Likewise.
5406 (Layout::finish_dynamic_section): Likewise.
5407 (Layout::set_dynamic_symbol_size): Likewise.
5408
beabb2c6
ILT
54092011-07-08 Ian Lance Taylor <iant@google.com>
5410
5411 PR gold/12386
5412 * options.h (class General_options): Add --unresolved-symbols.
5413 * target-reloc.h (issue_undefined_symbol_error): Check
5414 --unresolved-symbols. Add comments.
5415
9c16daf1
ILT
54162011-07-08 Ian Lance Taylor <iant@google.com>
5417
5418 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5419 expression more complex.
5420
191f1a2d
ILT
54212011-07-08 Ian Lance Taylor <iant@google.com>
5422
5423 PR gold/11317
5424 * target-reloc.h (issue_undefined_symbol_error): New inline
5425 function, broken out of relocate_section.
5426 (relocate_section): Call issue_undefined_symbol_error.
5427 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5428 there is no TLS segment if we are about to issue an undefined
5429 symbol error.
5430 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5431
62855347
ILT
54322011-07-08 Ian Lance Taylor <iant@google.com>
5433
5434 PR gold/12279
5435 * resolve.cc (Symbol_table::should_override): Add fromtype
5436 parameter. Change all callers. Give error when linking together
5437 TLS and non-TLS symbol.
5438 (Symbol_table::should_override_with_special): Add fromtype
5439 parameter. Change all callers.
5440 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5441 there is no TLS segment if we have reported some errors.
5442 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5443
67181c72
ILT
54442011-07-08 Ian Lance Taylor <iant@google.com>
5445
5446 PR gold/12372
5447 * target.h (Target::plt_address_for_global): New function.
5448 (Target::plt_address_for_local): New function.
5449 (Target::plt_section_for_global): Remove.
5450 (Target::plt_section_for_local): Remove.
5451 (Target::do_plt_address_for_global): New virtual function.
5452 (Target::do_plt_address_for_local): New virtual function.
5453 (Target::do_plt_section_for_global): Remove.
5454 (Target::do_plt_section_for_local): Remove.
5455 (Target::register_global_plt_entry): Add Symbol_table and Layout
5456 parameters.
5457 * output.cc (Output_data_got::Got_entry::write): Use
5458 plt_address_for_global and plt_address_for_local.
5459 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5460 address of output section.
5461 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5462 got_irelative_, and irelative_count_ fields. Update
5463 declarations.
5464 (Output_data_plt_i386::has_irelative_section): New function.
5465 (Output_data_plt_i386::entry_count): Add irelative_count_.
5466 (Output_data_plt_i386::set_final_data_size): Likewise.
5467 (class Target_i386): Add got_irelative_ and rel_irelative_
5468 fields. Update declarations.
5469 (Target_i386::Target_i386): Initialize new fields.
5470 (Target_i386::do_plt_address_for_global): New function replacing
5471 do_plt_section_for_global.
5472 (Target_i386::do_plt_address_for_local): New function replacing
5473 do_plt_section_for_local.
5474 (Target_i386::got_section): Create got_irelative_.
5475 (Target_i386::rel_irelative_section): New function.
5476 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5477 fields. Don't define __rel_iplt_{start,end}.
5478 (Output_data_plt_i386::add_entry): Add symtab and layout
5479 parameters. Change all callers. Use different PLT and GOT for
5480 IFUNC symbols.
5481 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5482 layout parameters. Change all callers. Use different PLT and
5483 GOT.
5484 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5485 (Output_data_plt_i386::rel_irelative): New function.
5486 (Output_data_plt_i386::address_for_global): New function.
5487 (Output_data_plt_i386::address_for_local): New function.
5488 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5489 IRELATIVE GOT when changing IFUNC GOT entries.
5490 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5491 reloc.
5492 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5493 if we didn't create an IRELATIVE GOT.
5494 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5495 plt_address_for_local.
5496 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5497 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5498 got_irelative_, and irelative_count_ fields. Update
5499 declarations.
5500 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5501 Initialize new fields. Remove symtab parameter. Change all
5502 callers.
5503 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5504 irelative_count_.
5505 (Output_data_plt_x86_64::has_irelative_section): New function.
5506 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5507 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5508 fields. Update declarations.
5509 (Target_x86_64::Target_x86_64): Initialize new fields.
5510 (Target_x86_64::do_plt_address_for_global): New function replacing
5511 do_plt_section_for_global.
5512 (Target_x86_64::do_plt_address_for_local): New function replacing
5513 do_plt_section_for_local.
5514 (Target_x86_64::got_section): Create got_irelative_.
5515 (Target_x86_64::rela_irelative_section): New function.
5516 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5517 all callers. Don't create __rel_iplt_{start,end}.
5518 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5519 parameters. Change all callers. Use different PLT and GOT for
5520 IFUNC symbols.
5521 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5522 layout parameters. Change all callers. Use different PLT and
5523 GOT.
5524 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5525 parameters. Change all callers. Use different PLT and GOT for
5526 IFUNC symbols.
5527 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5528 (Output_data_plt_x86_64::rela_irelative): New function.
5529 (Output_data_plt_x86_64::address_for_global): New function.
5530 (Output_data_plt_x86_64::address_for_local): New function.
5531 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5532 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5533 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5534 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5535 parameters.
5536 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5537 reloc.
5538 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5539 symbols if we didn't create an IRELATIVE GOT.
5540 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5541 plt_address_for_local.
5542 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5543 * testsuite/ifuncvar1.c: New test file.
5544 * testsuite/ifuncvar2.c: New test file.
5545 * testsuite/ifuncvar3.c: New test file.
5546 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5547 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5548 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5549 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5550 * testsuite/Makefile.in: Rebuild.
5551
33c15b45
CC
55522011-07-07 Cary Coutant <ccoutant@google.com>
5553
5554 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5555 (two_file_test_1_ndebug.o): Likewise.
5556 (two_file_test_1b_ndebug.o): Likewise.
5557 (two_file_test_2_ndebug.o): Likewise.
5558 (two_file_test_main_ndebug.o): Likewise.
5559 (incremental_test_2): Link with no-debug versions.
5560
f48b5fb7
CC
55612011-07-06 Cary Coutant <ccoutant@google.com>
5562
5563 * gold/incremental.cc
5564 (Output_section_incremental_inputs::write_info_blocks): Check for
5565 hidden and internal symbols.
5566
221597a5
CC
55672011-07-06 Cary Coutant <ccoutant@google.com>
5568
5569 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5570 Check disposition for startup file.
5571 (Incremental_inputs::report_command_line): Ignore
5572 --incremental-startup-unchanged option.
5573 * options.cc (General_options::parse_incremental_startup_unchanged):
5574 New function.
5575 (General_options::General_options): Initialize new data member.
5576 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5577 (General_options): Add --incremental-startup-unchanged option.
5578 (General_options::incremental_startup_disposition): New function.
5579 (General_options::incremental_startup_disposition_): New data member.
5580
e24719f6
CC
55812011-07-06 Cary Coutant <ccoutant@google.com>
5582
5583 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5584 input file index to Script_info ctor.
5585 (Sized_incremental_binary::do_file_has_changed): Find the
5586 command-line argument for files named in scripts.
5587 * incremental.h (Script_info::Script_info): New ctor
5588 with input file index.
5589 (Script_info::input_file_index): New function.
5590 (Script_info::input_file_index_): New data member.
5591 (Incremental_binary::get_library): Add const.
5592 (Incremental_binary::get_script_info): Add const.
5593 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5594 * testsuite/Makefile.am (incremental_test_5): New test case.
5595 (incremental_test_6): New test case.
5596 * testsuite/Makefile.in: Regenerate.
5597
8f7c81e8
CC
55982011-07-06 Cary Coutant <ccoutant@google.com>
5599
5600 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5601 debug output when command lines differ.
5602
9fbd3822
CC
56032011-07-06 Cary Coutant <ccoutant@google.com>
5604
5605 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5606 --incremental-patch option.
5607 * layout.cc (Free_list::allocate): Extend allocation beyond original
5608 end if enabled.
5609 (Layout::make_output_section): Mark sections that should get
5610 patch space.
5611 * options.cc (parse_percent): New function.
5612 * options.h (parse_percent): New function.
5613 (DEFINE_percent): New macro.
5614 (General_options): Add --incremental-patch option.
5615 * output.cc (Output_section::Output_section): Initialize new data
5616 members.
5617 (Output_section::add_input_section): Print section name when out
5618 of patch space.
5619 (Output_section::add_output_section_data): Likewise.
5620 (Output_section::set_final_data_size): Add patch space when
5621 doing --incremental-full.
5622 (Output_section::do_reset_address_and_file_offset): Remove patch
5623 space.
5624 (Output_segment::set_section_list_addresses): Print debug output
5625 only if --incremental-update.
5626 * output.h (Output_section::set_is_patch_space_allowed): New function.
5627 (Output_section::is_patch_space_allowed_): New data member.
5628 (Output_section::patch_space_): New data member.
5629 * parameters.cc (Parameters::incremental_full): New function.
5630 * parameters.h (Parameters::incremental_full): New function
5631 * testsuite/Makefile.am (incremental_test_2): Add test for
5632 --incremental-patch option.
5633 * testsuite/Makefile.in: Regenerate.
5634 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5635 (t18): Remove function body.
5636
f6cccc2c
DK
56372011-07-05 Doug Kwan <dougkwan@google.com>
5638
5639 PR gold/12771
5640 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5641 Arm_Address type for relocation result.
5642 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5643 overflow check.
5644 (Arm_relocate_functions::abs32): Use unaligned access.
5645 (Arm_relocate_functions::rel32): Ditto.
5646 (Arm_relocate_functions::prel31): Ditto.
5647 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5648 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5649 static data relocations.
5650 * testsuite/Makefile.in: Regnerate.
5651 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5652
28a13fec
ILT
56532011-07-05 Ian Lance Taylor <iant@google.com>
5654
5655 PR gold/12392
5656 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5657 symbols if necessary.
5658 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5659
24d47b34
ILT
56602011-07-05 Ian Lance Taylor <iant@google.com>
5661
5662 PR gold/12952
5663 * resolve.cc (Symbol::override_base_with_special): Simply override
5664 version with special symbol version, ignoring previous version.
5665
41f9cbbe
ILT
56662011-07-05 Ian Lance Taylor <iant@google.com>
5667
5668 * object.cc (Sized_relobj_file::include_section_group): Add
5669 information to comment about signature location.
5670
886288f1
ILT
56712011-07-02 Ian Lance Taylor <iant@google.com>
5672
5673 PR gold/12957
5674 * options.h (class General_options): Add -f and -F.
5675 * options.cc (General_options::finalize): Fatal error if -f/-F
5676 are used without -shared.
5677 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5678
ae3a6d4f
ILT
56792011-07-02 Ian Lance Taylor <iant@google.com>
5680
5681 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5682
21131061
ILT
56832011-07-01 Ian Lance Taylor <iant@google.com>
5684
5685 PR gold/12525
5686 PR gold/12952
5687 * resolve.cc (Symbol::override_base_with_special): Don't override
5688 the version if the overriding symbol has a different name.
5689 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5690 all callers. If we give an error about an undefined version,
5691 define the base version if necessary.
5692 * dynobj.h (class Versions): Update declaration.
5693 * testsuite/weak_alias_test_5.cc: New file.
5694 * testsuite/weak_alias_test.script: New file.
5695 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5696 and versioned_alias have the right value, and call t2.
5697 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5698 weak_alias_test_5.so.
5699 (weak_alias_test_LDADD): Likewise.
5700 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5701 * testsuite/Makefile.in: Rebuild.
5702
611062c0
ILT
57032011-07-01 Ian Lance Taylor <iant@google.com>
5704
5705 PR gold/12525
5706 * options.h (class General_options): Support -z notext.
5707 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5708 -Wl,-z,notext.
5709 (two_file_shared_nonpic.so): Likewise.
5710 (two_file_shared_mixed.so): Likewise.
5711 (two_file_shared_mixed_1.so): Likewise.
5712 (weak_undef_lib_nonpic.so): Likewise.
5713 (alt/weak_undef_lib_nonpic.so): Likewise.
5714 (tls_test_shared_nonpic.so): Likewise.
5715 * testsuite/Makefile.in: Rebuild.
5716
328c7c2f
ILT
57172011-07-01 Ian Lance Taylor <iant@google.com>
5718
5719 PR gold/12525
5720 * configure.ac: Test whether static linking works, setting
5721 the automake conditional HAVE_STATIC.
5722 * testsuite/Makefile.am: Disable tests using -static if
5723 HAVE_STATIC is not true.
5724 * configure, testsuite/Makefile.in: Rebuild.
5725
02d7cd44
ILT
57262011-07-01 Ian Lance Taylor <iant@google.com>
5727
5728 PR gold/12525
5729 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5730 Assert if we see DW_EH_PE_indirect.
5731 * target.h (Target::ehframe_datarel_base): New function.
5732 (Target::do_ehframe_datarel_base): New target function.
5733 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5734 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5735 function.
5736
07a60597
ILT
57372011-07-01 Ian Lance Taylor <iant@google.com>
5738
5739 PR gold/12571
5740 * options.h (class General_options): Add
5741 --ld-generated-unwind-info.
5742 * ehframe.cc (Fde::write): Add address parameter. Change all
5743 callers. If associated with PLT, fill in address and size.
5744 (Cie::set_output_offset): Only add merge mapping if there is an
5745 object.
5746 (Cie::write): Add address parameter. Change all callers.
5747 (Eh_frame::add_ehframe_for_plt): New function.
5748 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5749 input_offset_ fields into union u_, with new plt field.
5750 (Fde::Fde): Adjust for new union field.
5751 (Fde::Fde) [Output_data version]: New constructor.
5752 (Fde::add_mapping): Only add merge mapping if there is an object.
5753 (class Cie): Update declarations.
5754 (class Eh_frame): Declare add_ehframe_for_plt.
5755 * layout.cc (Layout::layout_eh_frame): Break out code into
5756 make_eh_frame_section, and call it.
5757 (Layout::make_eh_frame_section): New function.
5758 (Layout::add_eh_frame_for_plt): New function.
5759 * layout.h (class Layout): Update declarations.
5760 * merge.cc (Merge_map::add_mapping): Add assertion.
5761 * i386.cc: Include "dwarf.h".
5762 (class Output_data_plt_i386): Make first_plt_entry,
5763 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5764 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5765 and plt_eh_frame_fde.
5766 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5767 boundary. Call add_eh_frame_for_plt if appropriate.
5768 * x86_64.cc: Include "dwarf.h".
5769 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5770 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5771 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5772 and plt_eh_frame_fde.
5773 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5774 appropriate.
5775
14788a3f
ILT
57762011-06-29 Ian Lance Taylor <iant@google.com>
5777
5778 PR gold/12629
5779 * object.cc (Sized_relobj_file::layout_section): Change shdr
5780 parameter to be const.
5781 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5782 out of do_layout.
5783 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5784 appropriate. Call layout_eh_frame_section.
5785 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5786 sections.
5787 * object.h (class Sized_relobj_file): Update declarations.
5788
6c21fce1
ILT
57892011-06-29 Ian Lance Taylor <iant@google.com>
5790
37e41b03 5791 PR gold/12652
6c21fce1
ILT
5792 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5793 modifier.
5794 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5795
4d5e4e62
ILT
57962011-06-29 Ian Lance Taylor <iant@google.com>
5797
5798 PR gold/12675
5799 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5800 SHT_X86_64_UNWIND.
5801 * layout.cc (Layout::layout_eh_frame): Likewise.
5802
886f533a
ILT
58032011-06-29 Ian Lance Taylor <iant@google.com>
5804
5805 PR gold/12695
5806 * layout.cc (Layout::symtab_section_shndx): New function.
5807 * layout.h (class Layout): Declare symtab_section_shndx.
5808 * output.cc (Output_section::write_header): Call it.
5809
f3ae1b28
ILT
58102011-06-29 Ian Lance Taylor <iant@google.com>
5811
5812 PR gold/12818
5813 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5814 symbols which are not used in a relocation.
5815
aecf301f
ILT
58162011-06-28 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/12898
5819 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5820 script create indistinguishable segments.
5821 (Layout::set_segment_offsets): Use stable_sort when sorting
5822 segments. Pass this to Compare_segments constructor.
5823 * layout.h (class Layout): Make segment_precedes non-static.
5824 (class Compare_segments): Change from struct to class. Add
5825 layout_ field. Add constructor.
5826 * script-sections.cc
5827 (Script_sections::attach_sections_using_phdrs_clause): Rename
5828 local orphan to is_orphan. Don't report failure to put empty
5829 section in segment. On attachment failure, report name of
5830 section, and attach to first PT_LOAD segment.
5831
03ef7571
ILT
58322011-06-28 Ian Lance Taylor <iant@google.com>
5833
5834 PR gold/12934
5835 * target-select.cc (Target_selector::Target_selector): Add
5836 emulation parameter. Change all callers.
5837 (select_target_by_bfd_name): Rename from select_target_by_name.
5838 Change all callers.
5839 (select_target_by_emulation): New function.
5840 (supported_emulation_names): New function.
5841 * target-select.h (class Target_selector): Add emulation_ field.
5842 Update declarations.
5843 (Target_selector::recognize_by_bfd_name): Rename from
5844 recognize_by_name. Change all callers.
5845 (Target_selector::supported_bfd_names): Rename from
5846 supported_names. Change all callers.
5847 (Target_selector::recognize_by_emulation): New function.
5848 (Target_selector::supported_emulations): New function.
5849 (Target_selector::emulation): New function.
5850 (Target_selector::do_recognize_by_bfd_name): Rename from
5851 do_recognize_by_name. Change all callers.
5852 (Target_selector::do_supported_bfd_names): Rename from
5853 do_supported_names. Change all callers.
5854 (Target_selector::do_recognize_by_emulation): New function.
5855 (Target_selector::do_supported_emulations): New function.
5856 (select_target_by_bfd_name): Change name in declaration.
5857 (select_target_by_emulation): Declare.
5858 (supported_emulation_names): Declare.
5859 * parameters.cc (parameters_force_valid_target): Try to find
5860 target based on emulation from -m option.
5861 * options.h (class General_options): Change doc string for -m.
5862 * options.cc (help): Print emulations.
5863 (General_options::parse_V): Likewise.
5864 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5865 Add emulation parameter. Change all callers.
5866
200b2bb9
ILT
58672011-06-28 Ian Lance Taylor <iant@google.com>
5868
5869 * target.h (class Target): Add osabi_ field.
5870 (Target::osabi): New function.
5871 (Target::set_osabi): New function.
5872 (Target::Target): Initialize osabi_.
5873 (Target::do_adjust_elf_header): Make pure virtual.
5874 (Sized_target::do_adjust_elf_header): Declare.
5875 * target.cc (Sized_target::do_adjust_elf_header): New function.
5876 (class Sized_target): Instantiate all versions.
5877 * freebsd.h (class Target_freebsd): Remove.
5878 (Target_selector_freebsd::do_recognize): Call set_osabi on
5879 Target.
5880 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5881 (Target_selector_freebsd::set_osabi): Remove.
5882 * i386.cc (class Target_i386): Inherit from Sized_target rather
5883 than Target_freebsd.
5884 * x86_64.cc (class Target_x86_64): Likewise.
5885
b3ce541e
ILT
58862011-06-28 Ian Lance Taylor <iant@google.com>
5887
5888 * target.h (Target::can_check_for_function_pointers): Rewrite.
5889 Make non-virtual.
5890 (Target::can_icf_inline_merge_sections): Likewise.
5891 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5892 (Target::Target_info): Add can_icf_inline_merge_sections field.
5893 (Target::do_can_check_for_function_pointers): New virtual
5894 function.
5895 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5896 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5897 from can_check_for_function_pointers, move in file.
5898 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5899 section_may_have_icf_unsafe_poineters, move in file.
5900 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5901 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5902 Rename from can_check_for_function_pointers, move in file.
5903 (Target_i386::can_icf_inline_merge_sections): Remove.
5904 (Target_i386::i386_info): Initialize
5905 can_icf_inline_merge_sections.
5906 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5907 Initialize can_icf_inline_merge_sections.
5908 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5909 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5910 Rename from can_check_for_function_pointers, move in file.
5911 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5912 (Target_x86_64::x86_64_info): Initialize
5913 can_icf_inline_merge_sections.
5914 * testsuite/testfile.cc (Target_test::test_target_info):
5915 Likewise.
5916 * icf.cc (get_section_contents): Correct formatting.
5917
6d1c4efb
ILT
59182011-06-27 Ian Lance Taylor <iant@google.com>
5919
5920 * symtab.cc (Symbol::versioned_name): New function.
5921 (Symbol_table::add_to_final_symtab): Use versioned_name when
5922 appropriate.
5923 (Symbol_table::sized_write_symbol): Likewise.
5924 * symtab.h (class Symbol): Declare versioned_name.
5925 * stringpool.h (class Stringpool_template): Add variant of add
5926 which takes a std::basic_string.
5927 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5928 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5929 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5930 (ver_test_12.o): New target.
5931 * testsuite/Makefile.in: Rebuild.
5932
57eb9b50
DK
59332011-06-27 Doug Kwan <dougkwan@google.com>
5934
5935 * arm.cc (Arm_relocate_functions::thm_jump8,
5936 Arm_relocate_functions::thm_jump11): Use a wider signed
5937 type to compute offset.
5938 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5939 arm_thm_jump8.
5940 * testsuite/Makefile.in: Regenerate.
5941 * testsuite/arm_branch_in_range.sh: Check test results of
5942 arm_thm_jump11 and arm_thm_jump8.
5943 * testsuite/arm_thm_jump11.s: New test source file.
5944 * testsuite/arm_thm_jump11.t: New linker script.
5945 * testsuite/arm_thm_jump8.s: New test source file.
5946 * testsuite/arm_thm_jump8.t: New linker script.
5947
487b39df
ILT
59482011-06-24 Ian Lance Taylor <iant@google.com>
5949
5950 * layout.cc: Include "object.h".
5951 (ctors_sections_in_init_array): New static variable.
5952 (Layout::is_ctors_in_init_array): New function.
5953 (Layout::layout): Add entry to ctors_sections_in_init_array if
5954 appropriate.
5955 * layout.h (class Layout): Declare is_ctors_in_init_array.
5956 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5957 is_ctors_reverse_view is set.
5958 (Sized_relobj_file::write_sections): Add layout parameter. Change
5959 all callers. Set is_ctors_reverse_view field of View_size.
5960 (Sized_relobj_file::reverse_words): New function.
5961 * object.h (Sized_relobj_file::View_size): Add
5962 is_ctors_reverse_view field.
5963 (class Sized_relobj_file): Update declarations.
5964 * testsuite/initpri3.c: New test.
5965 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5966 initpri3b.
5967 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5968 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5969 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5970 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5971 * testsuite/Makefile.in: Rebuild.
5972
472076e4
CC
59732011-06-24 Cary Coutant <ccoutant@google.com>
5974
5975 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5976 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5977 (debug_msg_cdebug.err): New targets.
5978 * testsuite/Makefile.in: Regenerate.
5979 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5980 Fix checks for link with shared library.
5981
a60af0db
DK
59822011-06-24 Doug Kwan <dougkwan@google.com>
5983
5984 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5985 skip empty text sections.
5986 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5987
5393d741
ILT
59882011-06-22 Ian Lance Taylor <iant@google.com>
5989
5990 PR gold/12910
5991 * options.h (class General_options): Add --ctors-in-init-array.
5992 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5993 friends as SHT_PROGBITS for merging sections.
5994 (Layout::layout): Remove special handling of .init_array and
5995 friends. Don't sort if doing relocatable link. Sort for .ctors
5996 and .dtors if ctors_in_init_array.
5997 (Layout::make_output_section): Force correct section types for
5998 .init_array and friends. Don't sort if doing relocatable link,
5999 Don't sort .ctors and .dtors if ctors_in_init_array.
6000 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6001 (Layout::output_section_name): Add relobj parameter. Change all
6002 callers. Handle .ctors. and .dtors. in code rather than table.
6003 Handle .ctors and .dtors if ctors_in_init_array.
6004 (Layout::match_file_name): New function, moved from output.cc.
6005 * layout.h (class Layout): Update declarations.
6006 * output.cc: Include "layout.h".
6007 (Input_section_sort_entry::get_priority): New function.
6008 (Input_section_sort_entry::match_file_name): Just call
6009 Layout::match_file_name.
6010 (Output_section::Input_section_sort_init_fini_compare::operator()):
6011 Handle .ctors and .dtors. Sort by explicit priority rather than
6012 by name.
6013 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6014 * testsuite/initpri2.c: New test.
6015 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6016 (check_PROGRAMS): Add initpri2.
6017 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6018 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6019 * configure, testsuite/Makefile.in: Rebuild.
6020
e1f74f98
ILT
60212011-06-19 Ian Lance Taylor <iant@google.com>
6022
6023 PR gold/12880
6024 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6025 .interp section to a PT_INTERP segment even if we have seen a
6026 --dynamic-linker option. Don't do it if we have seen a PHDRS
6027 clause in a linker script.
6028 (Layout::finalize): Don't create a .interp section if we've
6029 already create a PT_INTERP segment.
6030 (Layout::create_interp): Always call choose_output_section (revert
6031 patch of 2011-06-17). Don't create PT_INTERP segment.
6032 * script-sections.cc
6033 (Script_sections::create_note_and_tls_segments): Add a .interp
6034 section to a PT_INTERP segment even if we have seen a
6035 --dynamic-linker option.
6036
766f91bb
ILT
60372011-06-18 Ian Lance Taylor <iant@google.com>
6038
6039 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6040 merely because a non-PT_LOAD segment has a dynamic reloc.
6041
0d212c3a
ILT
60422011-06-18 Ian Lance Taylor <iant@google.com>
6043
6044 * layout.cc (Layout::finish_dynamic_section): Don't create
6045 DT_FLAGS entry if not needed.
6046
911a5072
ILT
60472011-06-18 Ian Lance Taylor <iant@google.com>
6048
6049 PR gold/12745
6050 * layout.cc (Layout::layout_eh_frame): Correct handling of
6051 writable .eh_frame section.
6052
534b4e5f
ILT
60532011-06-17 Ian Lance Taylor <iant@google.com>
6054
6055 PR gold/12893
6056 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6057 symbol is redefined with the exact same object and value.
6058
10b4f102
ILT
60592011-06-17 Ian Lance Taylor <iant@google.com>
6060
6061 PR gold/12880
6062 * layout.h (class Layout): Add interp_segment_ field.
6063 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6064 (Layout::attach_allocated_section_to_segment): If making shared
6065 library, put .interp section in PT_INTERP segment.
6066 (Layout::finalize): Also call create_interp if -dynamic-linker
6067 option was used.
6068 (Layout::create_interp): Assert that there is no PT_INTERP
6069 segment. If not using a SECTIONS clause, use make_output_section.
6070 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6071 * script-sections.cc
6072 (Script_sections::create_note_and_tls_segments): If making shared
6073 library, put .interp section in PT_INTERP segment.
6074
a29b0dad
ILT
60752011-06-17 Ian Lance Taylor <iant@google.com>
6076
e588ea8d
ILT
6077 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6078 when making a shared library.
6079
60802011-06-17 Ian Lance Taylor <iant@google.com>
6081
6082 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6083 parameter. Change all callers. Don't issue warning about PC32
6084 against locally defined symbol.
a29b0dad 6085
9d3b0698
ILT
60862011-06-16 Ian Lance Taylor <iant@google.com>
6087
6088 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6089 occurs in same object.
6090
85b0f90c
AM
60912011-06-14 Alan Modra <amodra@gmail.com>
6092
6093 * po/POTFILES.in: Regenerate.
6094
a94907d9
ILT
60952011-06-09 Ian Lance Taylor <iant@google.com>
6096
6097 * script-sections.cc
6098 (Orphan_output_section::set_section_addresses): For a relocatable
6099 link set address to 0.
6100
4fb3a1c3
CC
61012011-06-09 Cary Coutant <ccoutant@google.com>
6102
6103 PR gold/12804
6104 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6105 used with --compress-debug-sections.
6106 * gold/object.cc (Sized_relobj_file::do_layout): Report
6107 uncompressed size of compressed input sections.
6108
61220854
CC
61092011-06-08 Cary Coutant <ccoutant@google.com>
6110
6111 PR gold/12804
6112 * testsuite/two_file_test_2_v1.cc: Change initialization of
6113 v2 to keep it in .data.
6114
e6455dfb
CC
61152011-06-07 Cary Coutant <ccoutant@google.com>
6116
6117 * common.cc (Symbol_table::do_allocate_commons_list): Call
6118 gold_fallback.
6119 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6120 (Errors::fallback): New function.
6121 (gold_fallback): New function.
6122 * errors.h (Errors::fallback): New function.
6123 * gold.cc (gold_exit): Change status parameter to enum; adjust
6124 all callers.
6125 (queue_initial_tasks): Call gold_fallback.
6126 * gold.h: Include cstdlib.
6127 (Exit_status): New enum type.
6128 (gold_exit): Change status parameter to enum.
6129 (gold_fallback): New function.
6130 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6131 (Layout::create_symtab_sections): Likewise.
6132 (Layout::create_shdrs): Likewise.
6133 * main.cc (main): Adjust call to gold_exit.
6134 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6135 (Output_data_got::add_got_entry_pair): Likewise.
6136 (Output_section::add_input_section): Likewise.
6137 (Output_section::add_output_section_data): Likewise.
6138 (Output_segment::set_section_list_addresses): Likewise.
6139 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6140
fb0e076f
CC
61412011-06-07 Cary Coutant <ccoutant@google.com>
6142
6143 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6144 for incremental links.
6145 * output.cc (Output_segment::set_section_list_addresses): Remove
6146 FIXME and test for TLS or BSS.
6147
a5ee4d5d
CC
61482011-06-07 Cary Coutant <ccoutant@google.com>
6149
6150 * testsuite/Makefile.am: Add incremental_copy_test,
6151 incremental_common_test_1.
6152 * testsuite/Makefile.in: Regenerate.
6153 * testsuite/common_test_1_v1.c: New source file.
6154 * testsuite/common_test_1_v2.c: New source file.
6155 * testsuite/copy_test_v1.cc: New source file.
6156
5146f448
CC
61572011-06-07 Cary Coutant <ccoutant@google.com>
6158
6159 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6160 update, allocate common from bss section's free list.
6161 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6162 linker-defined symbols.
6163 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6164 Skip GOT and PLT entries that are no longer referenced.
6165 (Output_section_incremental_inputs::write_info_blocks): Mark
6166 linker-defined symbols.
6167 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6168 * output.cc (Output_section::allocate): New function.
6169 * output.h (Output_section::allocate): New function.
6170 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6171 linker-defined symbols.
6172 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6173 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6174 (Symbol::init_base_output_data): Likewise.
6175 (Symbol::init_base_output_segment): Likewise.
6176 (Symbol::init_base_constant): Likewise.
6177 (Sized_symbol::init_output_data): Likewise.
6178 (Sized_symbol::init_output_segment): Likewise.
6179 (Sized_symbol::init_constant): Likewise.
6180 (Symbol_table::do_define_in_output_data): Likewise.
6181 (Symbol_table::do_define_in_output_segment): Likewise.
6182 (Symbol_table::do_define_as_constant): Likewise.
6183 * symtab.h (Symbol::is_predefined): New function.
6184 (Symbol::init_base_output_data): Add is_predefined parameter.
6185 (Symbol::init_base_output_segment): Likewise.
6186 (Symbol::init_base_constant): Likewise.
6187 (Symbol::is_predefined_): New data member.
6188 (Sized_symbol::init_output_data): Add is_predefined parameter.
6189 (Sized_symbol::init_output_segment): Likewise.
6190 (Sized_symbol::init_constant): Likewise.
6191 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6192
26d3c67d
CC
61932011-06-07 Cary Coutant <ccoutant@google.com>
6194
6195 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6196 instead of emit_copy_reloc.
6197 (Copy_relocs::emit_copy_reloc): Refactor.
6198 (Copy_relocs::make_copy_reloc): New function.
6199 (Copy_relocs::add_copy_reloc): Remove.
6200 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6201 section.
6202 (Copy_relocs::make_copy_reloc): New function.
6203 (Copy_relocs::add_copy_reloc): Remove.
6204 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6205 unchanged input files.
6206 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6207 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6208 Reserve BSS space for COPY relocations.
6209 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6210 (Output_section_incremental_inputs::write_info_blocks): Record
6211 whether a symbol is copied from a shared object.
6212 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6213 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6214 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6215 (Incremental_input_entry_reader::get_output_symbol_index): Add
6216 is_copy parameter.
6217 (Incremental_binary::emit_copy_relocs): New function.
6218 (Incremental_binary::do_emit_copy_relocs): New function.
6219 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6220 new data member.
6221 (Sized_incremental_binary::add_copy_reloc): New function.
6222 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6223 (Sized_incremental_binary::Copy_reloc): New struct.
6224 (Sized_incremental_binary::Copy_relocs): New typedef.
6225 (Sized_incremental_binary::copy_relocs_): New data member.
6226 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6227 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6228 * target.h (Sized_target::emit_copy_reloc): New function.
6229 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6230
7cdb37d9
CC
62312011-06-02 Cary Coutant <ccoutant@google.com>
6232
6233 PR gold/12163
6234 * gold/archive.cc (Archive::Archive): Initialize new data member.
6235 (Archive::include_all_members): Return if archive has already been
6236 included.
6237 * gold/archive.h (Archive::include_all_members_): New data member.
6238
cc643b88
NC
62392011-06-02 Nick Clifton <nickc@redhat.com>
6240
6241 * dynobj.h: Fix spelling mistake in comment.
6242 * output.cc: Likewise.
6243
f62a3ca7 62442011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6245 Asier Llano
f62a3ca7
DK
6246
6247 PR gold/12826
cc643b88 6248 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6249 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6250 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6251 redundant arm_exidx_test.so.
6252 * testsuite/Makefile.in: Regenerate.
6253 (check_SCRIPTS): Add pr12826.sh
6254 (check_DATA): Add pr12826.stdout
6255 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6256 * testsuite/pr12826.sh: New file.
6257 * testsuite/pr12826_1.s: Ditto.
6258 * testsuite/pr12826_1.s: Ditto.
6259
8dbe1edc
ILT
62602011-05-30 Ian Lance Taylor <iant@google.com>
6261
6262 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6263 sections.
6264
c49875be
ILT
62652011-05-29 Ian Lance Taylor <iant@google.com>
6266
6267 PR gold/12804
6268 * testsuite/Makefile.am: Use different file name for two_file_test
6269 temporary file for each incremental test.
6270 * testsuite/Makefile.in: Rebuild.
6271
69d53f7a
ILT
62722011-05-29 Ian Lance Taylor <iant@google.com>
6273
6274 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6275 binary input file is empty.
6276
41d0ab5f
ILT
62772011-05-27 Ian Lance Taylor <iant@google.com>
6278
6279 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6280 (ver_test_9.so): Likewise.
6281 * testsuite/Makefile.in: Rebuild.
6282
89d8a36b
CC
62832011-05-26 Cary Coutant <ccoutant@google.com>
6284
6285 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6286 * incremental.cc (Incremental_inputs::report_input_section): Fix
6287 comment, indentation.
6288 (Incremental_inputs::report_comdat_group): New function.
6289 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6290 of data for incremental input file entry.
6291 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6292 group count, COMDAT group signatures.
6293 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6294 an unchanged input file.
6295 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6296 Initialize new data member.
6297 (Incremental_object_entry::add_comdat_group): New function.
6298 (Incremental_object_entry::get_comdat_group_count): New function.
6299 (Incremental_object_entry::get_comdat_signature_key): New function.
6300 (Incremental_object_entry::groups_): New data member.
6301 (Incremental_inputs::report_comdat_group): New function.
6302 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6303 data for incremental input file entry.
6304 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6305 (Incremental_input_entry_reader::get_input_section): Adjust size of
6306 data for incremental input file entry.
6307 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6308 (Incremental_input_entry_reader::get_comdat_group_signature): New
6309 function.
6310 * object.cc (Sized_relobj::include_section_group): Report kept
6311 COMDAT groups for incremental links.
6312
1706a06f
ILT
63132011-05-24 David Meyer <pdox@google.com>
6314
6315 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6316 with name parameter. Add found_name parameter.
6317 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6318 * dirsearch.h (class Dirsearch): Update declaration.
6319
a10ae760
ILT
63202011-05-24 Ian Lance Taylor <iant@google.com>
6321
6322 * archive.cc (Library_base::should_include_member): Pull in object
6323 from archive if it defines the entry symbol.
6324 * parameters.cc (Parameters::entry): New function.
6325 * parameters.h (class Parameters): Declare entry.
6326 * output.h (class Output_file_header): Remove entry_ field.
6327 * output.cc (Output_file_header::Output_file_header): Remove entry
6328 parameter. Change all callers.
6329 (Output_file_header::entry): Use parameters->entry.
6330 * gold.cc (queue_middle_tasks): Likewise.
6331 * plugin.cc (Plugin_hook::run): Likewise.
6332
aa92d6ed
CC
63332011-05-24 Cary Coutant <ccoutant@google.com>
6334
6335 * gold.cc (queue_initial_tasks): Pass incremental base filename
6336 to Output_file::open_base_file; don't print error message.
6337 * incremental-dump.cc (main): Adjust call to
6338 Output_file::open_for_modification.
6339 * incremental-dump.cc (main): Likewise.
6340 * incremental.cc (Incremental_inputs::report_command_line):
6341 Ignore --incremental-base option when comparing command lines.
6342 Ignore parameter when given as separate argument.
6343 * options.h (class General_options): Add --incremental-base.
6344 * output.cc (Output_file::Output_file):
6345 (Output_file::open_base_file): Add base_name and writable parameters;
6346 read base file into new file; print error message here.
6347 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6348 callers.
6349 * output.h (Output_file::open_for_modification): Rename to...
6350 (Output_file::open_base_file): ...this; add base_name and
6351 writable parameters; adjust all callers.
6352 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6353 callers.
6354 * testsuite/Makefile.am (incremental_test_4): Test
6355 --incremental-base.
6356 * testsuite/Makefile.in: Regenerate.
6357
2eedd706
CC
63582011-05-24 Cary Coutant <ccoutant@google.com>
6359
6360 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6361 incremental_test_4.
6362 * testsuite/Makefile.in: Regenerate.
6363 * testsuite/two_file_test_1_v1.cc: New test source file.
6364 * testsuite/two_file_test_1b_v1.cc: New test source file.
6365 * testsuite/two_file_test_2_v1.cc: New test source file.
6366
0f1c85a6
CC
63672011-05-24 Cary Coutant <ccoutant@google.com>
6368
6369 * dynobj.h (Dynobj::do_dynobj): New function.
6370 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6371 flag and soname for shared objects.
6372 * incremental.cc (Incremental_inputs::report_object): Make
6373 either Incremental_object_entry or Incremental_dynobj_entry; add
6374 soname to string table.
6375 (Incremental_inputs::report_input_section): Add assertion.
6376 (Output_section_incremental_inputs::set_final_data_size): Adjust
6377 type of input file entry for shared libraries; adjust size of
6378 shared library info entry.
6379 (Output_section_incremental_inputs::write_input_files): Write
6380 as_needed flag for shared libraries.
6381 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6382 of input file entry for shared libraries; write soname.
6383 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6384 soname from incremental info.
6385 * incremental.h (enum Incremental_input_flags): Add
6386 INCREMENTAL_INPUT_AS_NEEDED.
6387 (Incremental_input_entry::Incremental_input_entry): Initialize new
6388 data member.
6389 (Incremental_input_entry::set_as_needed): New function.
6390 (Incremental_input_entry::as_needed): New function.
6391 (Incremental_input_entry::do_dynobj_entry): New function.
6392 (Incremental_input_entry::as_needed_): New data member.
6393 (Incremental_object_entry::Incremental_object_entry): Don't check
6394 for shared library.
6395 (Incremental_object_entry::do_type): Likewise.
6396 (class Incremental_dynobj_entry): New class.
6397 (Incremental_input_entry_reader::as_needed): New function.
6398 (Incremental_input_entry_reader::get_soname): New function.
6399 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6400 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6401 size of shared library info entry.
58797674 6402 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6403 incremental link when adding DT_NEEDED entries.
6404 * object.h (Object::Object): Initialize new data member.
6405 (Object::dynobj): New function.
6406 (Object::set_as_needed): New function.
6407 (Object::as_needed): New function.
6408 (Object::do_dynobj): New function.
6409 (Object::as_needed_): New data member.
6410
6fa2a40b
CC
64112011-05-24 Cary Coutant <ccoutant@google.com>
6412
6413 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6414 info; adjust display of GOT entries.
6415 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6416 vector of input objects; remove file_status_.
6417 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6418 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6419 got_plt reader; call target hooks to reserve GOT entries.
6420 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6421 of input file info header and GOT info entry.
6422 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6423 relocation info.
6424 (Got_plt_view_info::got_descriptor): Remove.
6425 (Got_plt_view_info::sym_index): New data member.
6426 (Got_plt_view_info::input_index): New data member.
6427 (Local_got_offset_visitor::visit): Write input file index.
6428 (Global_got_offset_visitor::visit): Write 0 for input file index.
6429 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6430 with sym_index and input_index.
6431 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6432 incremental info GOT entry; replace got_descriptor with input_index.
6433 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6434 map from input file index to object.
6435 (Sized_relobj_incr::do_layout): Replace direct data member reference
6436 with accessor function.
6437 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6438 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6439 Adjust size of input file info header.
6440 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6441 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6442 (Incremental_input_entry_reader::get_input_section): Adjust size of
6443 input file info header.
6444 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6445 of incremental info GOT entry.
6446 (Incremental_got_plt_reader::get_got_desc): Remove.
6447 (Incremental_got_plt_reader::get_got_symndx): New function.
6448 (Incremental_got_plt_reader::get_got_input_index): New function.
6449 (Sized_incremental_binary::Sized_incremental_binary): Remove
6450 file_status_; add input_objects_.
6451 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6452 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6453 (Sized_incremental_binary::file_is_unchanged): Remove.
6454 (Sized_incremental_binary::set_input_object): New function.
6455 (Sized_incremental_binary::input_object): New function.
6456 (Sized_incremental_binary::file_status_): Remove.
6457 (Sized_incremental_binary::input_objects_): New data member.
6458 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6459 references.
6460 (Sized_relobj_incr::invalid_address): Move to base class.
6461 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6462 class.
6463 (Sized_relobj_incr::do_output_section_offset): Likewise.
6464 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6465 (Sized_relobj_incr::section_offsets_): Likewise.
6466 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6467 function.
6468 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6469 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6470 with accessor function.
6471 (Sized_relobj_file::do_layout): Likewise.
6472 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6473 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6474 (Sized_relobj_file::compute_final_local_value): Replace refs to
6475 section_offsets_ with accessor function.
6476 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6477 * object.h (Relobj::Relobj): Initialize new data members.
6478 (Relobj::add_dyn_reloc): New function.
6479 (Relobj::first_dyn_reloc): New function.
6480 (Relobj::dyn_reloc_count): New function.
6481 (Relobj::first_dyn_reloc_): New data member.
6482 (Relobj::dyn_reloc_count_): New data member.
6483 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6484 references.
6485 (Sized_relobj::Address): New typedef.
6486 (Sized_relobj::invalid_address): Move here from child class.
6487 (Sized_relobj::Sized_relobj): Initialize new data members.
6488 (Sized_relobj::sized_relobj): New function.
6489 (Sized_relobj::is_output_section_offset_invalid): Move here from
6490 child class.
6491 (Sized_relobj::get_output_section_offset): Likewise.
6492 (Sized_relobj::local_has_got_offset): Likewise.
6493 (Sized_relobj::local_got_offset): Likewise.
6494 (Sized_relobj::set_local_got_offset): Likewise.
6495 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6496 (Sized_relobj::clear_got_offsets): New function.
6497 (Sized_relobj::section_offsets): Move here from child class.
6498 (Sized_relobj::do_output_section_offset): Likewise.
6499 (Sized_relobj::do_set_section_offset): Likewise.
6500 (Sized_relobj::Local_got_offsets): Likewise.
6501 (Sized_relobj::local_got_offsets_): Likewise.
6502 (Sized_relobj::section_offsets_): Likewise.
6503 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6504 references.
6505 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6506 class.
6507 (Sized_relobj_file::sized_relobj): New function
6508 (Sized_relobj_file::local_has_got_offset): Move to base class.
6509 (Sized_relobj_file::local_got_offset): Likewise.
6510 (Sized_relobj_file::set_local_got_offset): Likewise.
6511 (Sized_relobj_file::get_output_section_offset): Likewise.
6512 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6513 (Sized_relobj_file::do_output_section_offset): Likewise.
6514 (Sized_relobj_file::do_set_section_offset): Likewise.
6515 (Sized_relobj_file::Local_got_offsets): Likewise.
6516 (Sized_relobj_file::local_got_offsets_): Likewise.
6517 (Sized_relobj_file::section_offsets_): Likewise.
6518 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6519 (all constructors).
6520 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6521 (Output_reloc::get_symbol_index): Likewise.
6522 (Output_reloc::local_section_offset): Likewise.
6523 (Output_reloc::get_address): Likewise.
6524 (Output_reloc::symbol_value): Likewise.
6525 (Output_data_got::reserve_slot): Move to class definition.
6526 (Output_data_got::reserve_local): New function.
6527 (Output_data_got::reserve_slot_for_global): Remove.
6528 (Output_data_got::reserve_global): New function.
6529 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6530 (all constructors, two instantiations).
6531 (Output_reloc::get_relobj): New function (two instantiations).
6532 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6533 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6534 (Output_data_reloc::add_global): Adjust type of relobj.
6535 (Output_data_reloc::add_global_relative): Likewise.
6536 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6537 (Output_data_reloc::add_local): Likewise.
6538 (Output_data_reloc::add_local_relative): Likewise.
6539 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6540 (Output_data_reloc::add_local_section): Likewise.
6541 (Output_data_reloc::add_output_section): Likewise.
6542 (Output_data_reloc::add_absolute): Likewise.
6543 (Output_data_reloc::add_target_specific): Likewise.
6544 (Output_data_got::reserve_slot): Move definition here.
6545 (Output_data_got::reserve_local): New function.
6546 (Output_data_got::reserve_global): New function.
6547 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6548 section_offsets_ with accessor function.
6549 (Sized_relobj_file::write_sections): Likewise.
6550 (Sized_relobj_file::do_relocate_sections): Likewise.
6551 * target.h (Sized_target::reserve_local_got_entry): New function.
6552 (Sized_target::reserve_global_got_entry): New function.
6553 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6554 (Target_x86_64::reserve_global_got_entry): New function.
6555 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6556
4829d394
CC
65572011-05-23 Cary Coutant <ccoutant@google.com>
6558
6559 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6560 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6561 bit when checking got_type.
6562 * incremental.cc (Sized_incremental_binary::setup_readers):
6563 Store symbol table and string table locations; initialize bit vector
6564 of file status flags.
6565 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6566 unchanged files.
6567 (Sized_incremental_binary::do_process_got_plt): New function.
6568 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6569 (Output_section_incremental_inputs::set_final_data_size): Record
6570 file index for each input file.
6571 (Output_section_incremental_inputs::write_got_plt): Store file index
6572 instead of input entry offset for each GOT entry.
6573 * incremental.h
6574 (Incremental_input_entry::Incremental_input_entry): Initialize new
6575 data member.
6576 (Incremental_input_entry::set_offset): Store file index.
6577 (Incremental_input_entry::get_file_index): New function.
6578 (Incremental_input_entry::file_index_): New data member.
6579 (Incremental_binary::process_got_plt): New function.
6580 (Incremental_binary::do_process_got_plt): New function.
6581 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6582 data members.
6583 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6584 (Sized_incremental_binary::set_file_is_unchanged): New function.
6585 (Sized_incremental_binary::file_is_unchanged): New function.
6586 (Sized_incremental_binary::do_process_got_plt): New function.
6587 (Sized_incremental_binary::file_status_): New data member.
6588 (Sized_incremental_binary::main_symtab_loc_): New data member.
6589 (Sized_incremental_binary::main_strtab_loc_): New data member.
6590 * output.cc (Output_data_got::Got_entry::write): Add case
6591 RESERVED_CODE.
6592 (Output_data_got::add_global): Call add_got_entry.
6593 (Output_data_got::add_global_plt): Likewise.
6594 (Output_data_got::add_global_with_rel): Likewise.
6595 (Output_data_got::add_global_with_rela): Likewise.
6596 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6597 (Output_data_got::add_global_pair_with_rela): Likewise.
6598 (Output_data_got::add_local): Call add_got_entry.
6599 (Output_data_got::add_local_plt): Likewise.
6600 (Output_data_got::add_local_with_rel): Likewise.
6601 (Output_data_got::add_local_with_rela): Likewise.
6602 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6603 (Output_data_got::add_local_pair_with_rela): Likewise.
6604 (Output_data_got::reserve_slot): New function.
6605 (Output_data_got::reserve_slot_for_global): New function.
6606 (Output_data_got::add_got_entry): New function.
6607 (Output_data_got::add_got_entry_pair): New function.
6608 (Output_section::add_output_section_data): Edit FIXME.
6609 * output.h
6610 (Output_section_data_build::Output_section_data_build): New
6611 constructor with size parameter.
6612 (Output_data_space::Output_data_space): Likewise.
6613 (Output_data_got::Output_data_got): Initialize new data member; new
6614 constructor with size parameter.
6615 (Output_data_got::add_constant): Call add_got_entry.
6616 (Output_data_got::reserve_slot): New function.
6617 (Output_data_got::reserve_slot_for_global): New function.
6618 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6619 (Output_data_got::add_got_entry): New function.
6620 (Output_data_got::add_got_entry_pair): New function.
6621 (Output_data_got::free_list_): New data member.
6622 * target.h (Sized_target::init_got_plt_for_update): New function.
6623 (Sized_target::register_global_plt_entry): New function.
6624 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6625 Initialize new data member; call init; add constructor with PLT count.
6626 (Output_data_plt_x86_64::init): New function.
6627 (Output_data_plt_x86_64::add_relocation): New function.
6628 (Output_data_plt_x86_64::reserve_slot): New function.
6629 (Output_data_plt_x86_64::free_list_): New data member.
6630 (Target_x86_64::init_got_plt_for_update): New function.
6631 (Target_x86_64::register_global_plt_entry): New function.
6632 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6633 incremental updates.
6634 (Output_data_plt_x86_64::add_relocation): New function.
6635 * testsuite/object_unittest.cc (Object_test): Set default options.
6636
ec69d6da
ILT
66372011-05-16 Ian Lance Taylor <iant@google.com>
6638
6639 * options.h (class General_options): Make -i a synonym for -r.
6640
732e31de
ILT
66412011-05-16 Ian Lance Taylor <iant@google.com>
6642
6643 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6644
403676b5
CC
66452011-05-10 Cary Coutant <ccoutant@google.com>
6646
6647 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6648 strip_all (-s).
6649
5b7b7d6e
ILT
66502011-05-06 Ian Lance Taylor <iant@google.com>
6651
6652 * layout.cc (Layout::layout): If the output section flags change,
6653 update the ordering.
6654
f0f9babf
CC
66552011-04-25 Cary Coutant <ccoutant@google.com>
6656
6657 * incremental-dump.cc (dump_incremental_inputs): Print local
6658 symbol info for each input file.
6659 * incremental.cc
6660 (Output_section_incremental_inputs::set_final_data_size): Add local
6661 symbol info to input file entries in incremental info.
6662 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6663 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6664 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6665 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6666 implementation.
6667 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6668 (Sized_incr_relobj::do_relocate): Write the local symbols.
6669 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6670 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6671 Adjust size of input file header.
6672 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6673 (Incremental_inputs_reader::get_local_symbol_count): New function.
6674 (Incremental_inputs_reader::get_input_section): Adjust size of input
6675 file header.
6676 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6677 (Sized_incr_relobj::This): New typedef.
6678 (Sized_incr_relobj::sym_size): New const data member.
6679 (Sized_incr_relobj::Local_symbol): New struct.
6680 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6681 (Sized_incr_relobj::do_local_symbol_offset): New function.
6682 (Sized_incr_relobj::local_symbol_count_): New data member.
6683 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6684 (Sized_incr_relobj::local_symbol_index_): New data member.
6685 (Sized_incr_relobj::local_symbol_offset_): New data member.
6686 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6687 (Sized_incr_relobj::local_symbols_): New data member.
6688 * object.h (Relobj::output_local_symbol_count): New function.
6689 (Relobj::local_symbol_offset): New function.
6690 (Relobj::do_output_local_symbol_count): New function.
6691 (Relobj::do_local_symbol_offset): New function.
6692 (Sized_relobj::do_output_local_symbol_count): New function.
6693 (Sized_relobj::do_local_symbol_offset): New function.
6694
d0a9ace3
ILT
66952011-04-22 Vladimir Simonov <sv@sw.ru>
6696
6697 * descriptors.cc (set_close_on_exec): New function.
6698 (Descriptors::open): Use set_close_on_exec.
6699 * output.cc (S_ISLNK): Define if not defined.
6700
94a3fc8b
CC
67012011-04-22 Cary Coutant <ccoutant@google.com>
6702
6703 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6704 global symbol map.
6705 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6706 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6707 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6708 relocations.
6709 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6710 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6711 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6712 * incremental.h
6713 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6714 function.
6715 (Incremental_binary::apply_incremental_relocs): New function.
6716 (Incremental_binary::do_apply_incremental_relocs): New function.
6717 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6718 data member.
6719 (Sized_incremental_binary::add_global_symbol): New function.
6720 (Sized_incremental_binary::global_symbol): New function.
6721 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6722 (Sized_incremental_binary::symbol_map_): New data member.
6723 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6724 * target.h (Sized_target::apply_relocation): New function.
6725 * target-reloc.h (apply_relocation): New function.
6726 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6727
c87e4302
DK
67282011-04-22 Doug Kwan <dougkwan@google.com>
6729
6730 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6731 flag of a SHT_ARM_EXIDX section.
2e702c99 6732 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6733 * testsuite/Makefile.in: Regenerate.
6734 * testsuite/arm_exidx_test.s: New file.
6735 * testsuite/arm_exidx_test.sh: Same.
6736
e7782cf6
CC
67372011-04-20 Cary Coutant <ccoutant@google.com>
6738
6739 PR gold/12689
6740 * archive.h (Incremental_archive_entry::Archive_member):
6741 Initialize arg_serial_ (second constructor).
6742
308ecdc7
ILT
67432011-04-17 Ian Lance Taylor <iant@google.com>
6744
6745 * object.cc (Relocate_info::location): Simplify location string.
6746 * errors.cc (Errors::error_at_location): Don't print program
6747 name.
6748 (Errors::warning_at_location): Likewise.
6749 (Errors::undefined_symbol): Likewise.
6750 * testsuite/debug_msg.sh: Update accordingly.
6751
bec5b579
CC
67522011-04-14 Cary Coutant <ccoutant@google.com>
6753
6754 * gold/layout.cc (Layout::symtab_section_offset): New function.
6755 * gold/layout.h (Layout::symtab_section_offset): New function.
6756 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6757
88597d34
ILT
67582011-04-12 Ian Lance Taylor <iant@google.com>
6759
6760 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6761 with MREMAP_MAYMOVE.
6762 * output.h (class Output_file): Add map_is_allocated_ field.
6763 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6764 not available, provide stubs. If mremap is not available, #define
6765 it to gold_mremap.
6766 (MREMAP_MAYMOVE): Define if not defined.
6767 (Output_file::Output_file): Initialize map_is_allocated_.
6768 (Output_file::resize): Check map_is_allocated_.
6769 (Output_file::map_anonymous): If mmap fails, use malloc.
6770 (Output_file::unmap): Don't do anything for an anonymous map.
6771 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6772 is not available, provide stubs.
6773 (File_read::View::~View): Use free rather than delete[].
6774 (File_read::make_view): Use malloc rather than new[]. If mmap
6775 fails, use malloc.
6776 (File_read::find_or_make_view): Use malloc rather than new[].
6777 * gold.h: Remove HAVE_REMAP code.
6778 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6779 exists. Rename mremap to gold_mremap. If mmap is not available
6780 don't do anything.
6781 * configure, config.in: Rebuild.
6782
11e361bc
ILT
67832011-04-11 Ian Lance Taylor <iant@google.com>
6784
6785 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6786 initialize local variable v.
6787
cdc29364
CC
67882011-04-11 Cary Coutant <ccoutant@google.com>
6789
6790 * archive.cc (Archive::include_member): Adjust call to
6791 report_object.
6792 (Add_archive_symbols::run): Track argument serial numbers.
6793 (Lib_group::include_member): Likewise.
6794 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6795 * archive.h (Incremental_archive_entry::Archive_member):
6796 Initialize arg_serial_.
6797 (Archive_member::arg_serial_): New data member.
6798 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6799 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6800 incremental link.
6801 (Sized_dynobj::do_for_all_local_got_entries): New function.
6802 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6803 function.
6804 * fileread.cc (get_mtime): New function.
6805 * fileread.h (get_mtime): New function.
6806 * gold.cc (queue_initial_tasks): Check for incremental update.
6807 (process_incremental_input): New function.
6808 (queue_middle_tasks): Don't force valid target for incremental
6809 update.
6810 * incremental-dump.cc (find_input_containing_global): Adjust
6811 size of symbol info entry.
6812 (dump_incremental_inputs): Dump argument serial number and
6813 in_system_directory flag; bias shndx by 1; print symbol names
6814 when dumping per-file symbol lists; use new symbol info readers.
6815 * incremental.cc
6816 (Output_section_incremental_inputs:update_data_size): New function.
6817 (Sized_incremental_binary::setup_readers): Setup input readers
6818 for each input file; build maps for files added from libraries
6819 and scripts.
6820 (Sized_incremental_binary::check_input_args): New function.
6821 (Sized_incremental_binary::do_check_inputs): Build map of argument
6822 serial numbers to input arguments.
6823 (Sized_incremental_binary::do_file_has_changed): Rename
6824 do_file_is_unchanged to this; compare file modification times.
6825 (Sized_incremental_binary::do_init_layout): New function.
6826 (Sized_incremental_binary::do_reserve_layout): New function.
6827 (Sized_incremental_binary::do_get_input_reader): Remove.
6828 (Sized_incremental_binary::get_symtab_view): New function.
6829 (Incremental_checker::can_incrementally_link_output_file): Remove.
6830 (Incremental_inputs::report_command_line): Exclude --debug options.
6831 (Incremental_inputs::report_archive_begin): Add parameter; track
6832 argument serial numbers; don't put input file entry for archive
6833 before archive members.
6834 (Incremental_inputs::report_archive_end): Put input file entry
6835 for archive after archive members.
6836 (Incremental_inputs::report_object): Add parameter; track argument
6837 serial numbers and in_system_directory flag.
6838 (Incremental_inputs::report_script): Add parameter; track argument
6839 serial numbers.
6840 (Output_section_incremental_inputs::set_final_data_size): Adjust
6841 size of symbol info entry; check for forwarding symbols.
6842 (Output_section_incremental_inputs::write_input_files): Write
6843 in_system_directory flag and argument serial number.
6844 (Output_section_incremental_inputs::write_info_blocks): Map section
6845 indices between incremental info and original input file; store
6846 input section index for each symbol.
6847 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6848 change operator() to visit().
6849 (class Global_got_offset_visitor): Likewise.
6850 (class Global_symbol_visitor_got_plt):
6851 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6852 classes.
6853 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6854 (Sized_incr_relobj::do_read_symbols): New function.
6855 (Sized_incr_relobj::do_layout): New function.
6856 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6857 (Sized_incr_relobj::do_add_symbols): New function.
6858 (Sized_incr_relobj::do_should_include_member): New function.
6859 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6860 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6861 (Sized_incr_relobj::do_section_size): New function.
6862 (Sized_incr_relobj::do_section_name): New function.
6863 (Sized_incr_relobj::do_section_contents): New function.
6864 (Sized_incr_relobj::do_section_flags): New function.
6865 (Sized_incr_relobj::do_section_entsize): New function.
6866 (Sized_incr_relobj::do_section_address): New function.
6867 (Sized_incr_relobj::do_section_type): New function.
6868 (Sized_incr_relobj::do_section_link): New function.
6869 (Sized_incr_relobj::do_section_info): New function.
6870 (Sized_incr_relobj::do_section_addralign): New function.
6871 (Sized_incr_relobj::do_initialize_xindex): New function.
6872 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6873 (Sized_incr_relobj::do_read_relocs): New function.
6874 (Sized_incr_relobj::do_gc_process_relocs): New function.
6875 (Sized_incr_relobj::do_scan_relocs): New function.
6876 (Sized_incr_relobj::do_count_local_symbols): New function.
6877 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6878 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6879 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6880 (Sized_incr_relobj::do_relocate): New function.
6881 (Sized_incr_relobj::do_set_section_offset): New function.
6882 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6883 (Sized_incr_dynobj::do_read_symbols): New function.
6884 (Sized_incr_dynobj::do_layout): New function.
6885 (Sized_incr_dynobj::do_add_symbols): New function.
6886 (Sized_incr_dynobj::do_should_include_member): New function.
6887 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6888 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6889 (Sized_incr_dynobj::do_section_size): New function.
6890 (Sized_incr_dynobj::do_section_name): New function.
6891 (Sized_incr_dynobj::do_section_contents): New function.
6892 (Sized_incr_dynobj::do_section_flags): New function.
6893 (Sized_incr_dynobj::do_section_entsize): New function.
6894 (Sized_incr_dynobj::do_section_address): New function.
6895 (Sized_incr_dynobj::do_section_type): New function.
6896 (Sized_incr_dynobj::do_section_link): New function.
6897 (Sized_incr_dynobj::do_section_info): New function.
6898 (Sized_incr_dynobj::do_section_addralign): New function.
6899 (Sized_incr_dynobj::do_initialize_xindex): New function.
6900 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6901 (make_sized_incremental_object): New function.
6902 (Incremental_library::copy_unused_symbols): New function.
6903 (Incremental_library::do_for_all_unused_symbols): New function.
6904 * incremental.h (enum Incremental_input_flags): New type.
6905 (class Incremental_checker): Remove.
6906 (Incremental_input_entry::Incremental_input_entry): Add argument
6907 serial number.
6908 (Incremental_input_entry::arg_serial): New function.
6909 (Incremental_input_entry::set_is_in_system_directory): New function.
6910 (Incremental_input_entry::is_in_system_directory): New function.
6911 (Incremental_input_entry::arg_serial_): New data member.
6912 (Incremental_input_entry::is_in_system_directory_): New data member.
6913 (class Script_info): Move here from script.h.
6914 (Script_info::Script_info): Add filename parameter.
6915 (Script_info::filename): New function.
6916 (Script_info::filename_): New data member.
6917 (Incremental_script_entry::Incremental_script_entry): Add argument
6918 serial number.
6919 (Incremental_object_entry::Incremental_object_entry): Likewise.
6920 (Incremental_object_entry::add_input_section): Build list of input
6921 sections with map to original shndx.
6922 (Incremental_object_entry::get_input_section_index): New function.
6923 (Incremental_object_entry::shndx_): New data member.
6924 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6925 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6926 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6927 serial number.
6928 (Incremental_inputs::report_archive_begin): Likewise.
6929 (Incremental_inputs::report_object): Likewise.
6930 (Incremental_inputs::report_script): Likewise.
6931 (class Incremental_global_symbol_reader): New class.
6932 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6933 and store flags and input file type.
6934 (Incremental_input_entry_reader::arg_serial): New function.
6935 (Incremental_input_entry_reader::type): Extract type from flags.
6936 (Incremental_input_entry_reader::is_in_system_directory): New function.
6937 (Incremental_input_entry_reader::get_input_section_count): Call
6938 accessor function for type.
6939 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6940 function for type; adjust size of global symbol entry.
6941 (Incremental_input_entry_reader::get_global_symbol_count): Call
6942 accessor function for type.
6943 (Incremental_input_entry_reader::get_object_count): Likewise.
6944 (Incremental_input_entry_reader::get_object_offset): Likewise.
6945 (Incremental_input_entry_reader::get_member_count): Likewise.
6946 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6947 (Incremental_input_entry_reader::get_member_offset): Likewise.
6948 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6949 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6950 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6951 (Incremental_input_entry_reader::get_global_symbol_reader): New
6952 function.
6953 (Incremental_input_entry_reader::get_output_symbol_index): New
6954 function.
6955 (Incremental_input_entry_reader::type_): Remove.
6956 (Incremental_input_entry_reader::flags_): New data member.
6957 (Incremental_inputs_reader::input_file_offset): New function.
6958 (Incremental_inputs_reader::input_file_index): New function.
6959 (Incremental_inputs_reader::input_file): Call input_file_offset.
6960 (Incremental_inputs_reader::input_file_at_offset): New function.
6961 (Incremental_relocs_reader::get_r_type): Reformat.
6962 (Incremental_relocs_reader::get_r_shndx): Reformat.
6963 (Incremental_relocs_reader::get_r_offset): Reformat.
6964 (Incremental_relocs_reader::data): New function.
6965 (Incremental_binary::Incremental_binary): Initialize new data members.
6966 (Incremental_binary::check_inputs): Add cmdline parameter.
6967 (Incremental_binary::file_is_unchanged): Remove.
6968 (Input_reader::arg_serial): New function.
6969 (Input_reader::get_unused_symbol_count): New function.
6970 (Input_reader::get_unused_symbol): New function.
6971 (Input_reader::do_arg_serial): New function.
6972 (Input_reader::do_get_unused_symbol_count): New function.
6973 (Input_reader::do_get_unused_symbol): New function.
6974 (Incremental_binary::input_file_count): New function.
6975 (Incremental_binary::get_input_reader): Change signature to use
6976 index instead of filename.
6977 (Incremental_binary::file_has_changed): New function.
6978 (Incremental_binary::get_input_argument): New function.
6979 (Incremental_binary::get_library): New function.
6980 (Incremental_binary::get_script_info): New function.
6981 (Incremental_binary::init_layout): New function.
6982 (Incremental_binary::reserve_layout): New function.
6983 (Incremental_binary::output_file): New function.
6984 (Incremental_binary::do_check_inputs): New function.
6985 (Incremental_binary::do_file_is_unchanged): Remove.
6986 (Incremental_binary::do_file_has_changed): New function.
6987 (Incremental_binary::do_init_layout): New function.
6988 (Incremental_binary::do_reserve_layout): New function.
6989 (Incremental_binary::do_input_file_count): New function.
6990 (Incremental_binary::do_get_input_reader): Change signature.
6991 (Incremental_binary::input_args_map_): New data member.
6992 (Incremental_binary::library_map_): New data member.
6993 (Incremental_binary::script_map_): New data member.
6994 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6995 new data members.
6996 (Sized_incremental_binary::output_section): New function.
6997 (Sized_incremental_binary::inputs_reader): Add const.
6998 (Sized_incremental_binary::symtab_reader): Add const.
6999 (Sized_incremental_binary::relocs_reader): Add const.
7000 (Sized_incremental_binary::got_plt_reader): Add const.
7001 (Sized_incremental_binary::get_symtab_view): New function.
7002 (Sized_incremental_binary::Inputs_reader): New typedef.
7003 (Sized_incremental_binary::Input_entry_reader): New typedef.
7004 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7005 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7006 (Sized_incremental_binary::do_file_has_changed): New function.
7007 (Sized_incremental_binary::do_init_layout): New function.
7008 (Sized_incremental_binary::do_reserve_layout): New function.
7009 (Sized_input_reader::Inputs_reader): Remove.
7010 (Sized_input_reader::Input_entry_reader): Remove.
7011 (Sized_input_reader::do_arg_serial): New function.
7012 (Sized_input_reader::do_get_unused_symbol_count): New function.
7013 (Sized_input_reader::do_get_unused_symbol): New function.
7014 (Sized_incremental_binary::do_input_file_count): New function.
7015 (Sized_incremental_binary::do_get_input_reader): Change signature;
7016 use index instead of filename.
7017 (Sized_incremental_binary::section_map_): New data member.
7018 (Sized_incremental_binary::input_entry_readers_): New data member.
7019 (class Sized_incr_relobj): New class.
7020 (class Sized_incr_dynobj): New class.
7021 (make_sized_incremental_object): New function.
7022 (class Incremental_library): New class.
7023 * layout.cc (Free_list::num_lists): New static data member.
7024 (Free_list::num_nodes): New static data member.
7025 (Free_list::num_removes): New static data member.
7026 (Free_list::num_remove_visits): New static data member.
7027 (Free_list::num_allocates): New static data member.
7028 (Free_list::num_allocate_visits): New static data member.
7029 (Free_list::init): New function.
7030 (Free_list::remove): New function.
7031 (Free_list::allocate): New function.
7032 (Free_list::dump): New function.
7033 (Free_list::print_stats): New function.
7034 (Layout_task_runner::run): Resize output file for incremental updates.
7035 (Layout::Layout): Initialize new data members.
7036 (Layout::set_incremental_base): New function.
7037 (Layout::init_fixed_output_section): New function.
7038 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7039 incremental updates.
7040 (Layout::create_gold_note): Do not create gold note section for
7041 incremental updates.
7042 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7043 for incremental updates.
7044 (Layout::set_section_offsets): For incremental updates, allocate space
7045 from free list.
7046 (Layout::create_symtab_sections): Layout with offsets relative to
7047 start of section; for incremental updates, allocate space from free
7048 list.
7049 (Layout::create_shdrs): For incremental updates, allocate space from
7050 free list.
7051 (Layout::finish_dynamic_section): For incremental updates, do not
7052 check --as-needed (fixed in subsequent patch).
7053 * layout.h (class Free_list): New class.
7054 (Layout::set_incremental_base): New function.
7055 (Layout::incremental_base): New function.
7056 (Layout::init_fixed_output_section): New function.
7057 (Layout::allocate): New function.
7058 (Layout::incremental_base_): New data member.
7059 (Layout::free_list_): New data member.
7060 * main.cc (main): Print Free_list statistics.
7061 * object.cc (Relobj::finalize_incremental_relocs): Add
7062 clear_counts parameter; clear counts only when clear_counts is set.
7063 (Sized_relobj::Sized_relobj): Initialize new base class.
7064 (Sized_relobj::do_layout): Don't report special sections.
7065 (Sized_relobj::do_for_all_local_got_entries): New function.
7066 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7067 symtab_off to all symbol table offsets.
7068 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7069 * object.h (class Got_offset_list): Move to top of file.
7070 (Object::Object): Allow case where input_file == NULL.
7071 (Object::~Object): Likewise.
7072 (Object::input_file): Assert that input_file != NULL.
7073 (Object::lock): Allow case where input_file == NULL.
7074 (Object::unlock): Likewise.
7075 (Object::is_locked): Likewise.
7076 (Object::token): Likewise.
7077 (Object::release): Likewise.
7078 (Object::is_incremental): New function.
7079 (Object::get_mtime): New function.
7080 (Object::for_all_local_got_entries): New function.
7081 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7082 (Object::set_is_in_system_directory): New function.
7083 (Object::is_in_system_directory): New function.
7084 (Object::do_is_incremental): New function.
7085 (Object::do_get_mtime): New function.
7086 (Object::do_for_all_local_got_entries): New function.
7087 (Object::is_in_system_directory_): New data member.
7088 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7089 (class Sized_relobj_base): New class.
7090 (class Sized_relobj): Derive from Sized_relobj_base.
7091 (class Sized_relobj::Symbols): Redeclare from base class.
7092 (class Sized_relobj::local_got_offset_list): Remove.
7093 (class Sized_relobj::Output_sections): Redeclare from base class.
7094 (class Sized_relobj::do_for_all_local_got_entries): New function.
7095 (class Sized_relobj::write_local_symbols): Add offset parameter.
7096 (class Sized_relobj::local_symbol_offset_): Update comment.
7097 (class Sized_relobj::local_dynsym_offset_): Update comment.
7098 * options.cc (Input_arguments::add_file): Remove const.
7099 * options.h (Input_file_argument::Input_file_argument):
7100 Initialize arg_serial_ (all constructors).
7101 (Input_file_argument::set_arg_serial): New function.
7102 (Input_file_argument::arg_serial): New function.
7103 (Input_file_argument::arg_serial_): New data member.
7104 (Input_arguments::Input_arguments): Initialize file_count_.
7105 (Input_arguments::add_file): Remove const.
7106 (Input_arguments::number_of_input_files): New function.
7107 (Input_arguments::file_count_): New data member.
7108 (Command_line::number_of_input_files): Call
7109 Input_arguments::number_of_input_files.
7110 * output.cc (Output_segment_headers::Output_segment_headers):
7111 Set current size.
7112 (Output_section::Input_section::current_data_size): New function.
7113 (Output_section::Output_section): Initialize new data members.
7114 (Output_section::add_input_section): Don't do merge sections for
7115 an incremental link; allocate space from free list for an
7116 incremental update.
7117 (Output_section::add_output_section_data): Allocate space from
7118 free list for an incremental update.
7119 (Output_section::update_data_size): New function.
7120 (Output_section::set_fixed_layout): New function.
7121 (Output_section::reserve): New function.
7122 (Output_segment::set_section_addresses): Remove const.
7123 (Output_segment::set_section_list_addresses): Remove const; allocate
7124 space from free list for an incremental update.
7125 (Output_segment::set_offset): Adjust size of RELRO segment for an
7126 incremental update.
7127 * output.h (Output_data::current_data_size): Move here from
7128 child classes.
7129 (Output_data::pre_finalize_data_size): New function.
7130 (Output_data::update_data_size): New function.
7131 (Output_section_headers::update_data_size): new function.
7132 (Output_section_data_build::current_data_size): Move to Output_data.
7133 (Output_data_strtab::update_data_size): New function.
7134 (Output_section::current_data_size): Move to Output_data.
7135 (Output_section::set_fixed_layout): New function.
7136 (Output_section::has_fixed_layout): New function.
7137 (Output_section::reserve): New function.
7138 (Output_section::update_data_size): New function.
7139 (Output_section::has_fixed_layout_): New data member.
7140 (Output_section::free_list_): New data member.
7141 (Output_segment::set_section_addresses): Remove const.
7142 (Output_segment::set_section_list_addresses): Remove const.
7143 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7144 New function.
7145 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7146 New function.
7147 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7148 parameter when calling Add_symbols constructor; store argument
7149 serial number for members of a lib group.
7150 (Add_symbols::locks): Allow case where token == NULL.
7151 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7152 (Read_member::~Read_member): New function.
7153 (Read_member::is_runnable): New function.
7154 (Read_member::locks): New function.
7155 (Read_member::run): New function.
7156 (Check_script::~Check_script): New function.
7157 (Check_script::is_runnable): New function.
7158 (Check_script::locks): New function.
7159 (Check_script::run): New function.
7160 (Check_library::~Check_library): New function.
7161 (Check_library::is_runnable): New function.
7162 (Check_library::locks): New function.
7163 (Check_library::run): New function.
7164 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7165 (Add_symbols::library_): New data member.
7166 (class Read_member): New class.
7167 (class Check_script): New class.
7168 (class Check_library): New class.
7169 * reloc.cc (Read_relocs::is_runnable): Allow case where
7170 token == NULL.
7171 (Read_relocs::locks): Likewise.
7172 (Scan_relocs::locks): Likewise.
7173 (Relocate_task::locks): Likewise.
7174 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7175 to clear counters.
7176 (Sized_relobj::incremental_relocs_scan): Fix comment.
7177 (Sized_relobj::do_relocate): Pass output file offset to
7178 write_local_symbols.
7179 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7180 from class declaration.
7181 * script.cc (read_input_script): Allocate Script_info; pass
7182 argument serial number to report_script.
7183 * script.h (class Script_info): Move to incremental.h.
7184 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7185 * symtab.h (Symbol_table::add_from_incrobj): New function.
7186 (Symbol_table::set_file_offset): New function.
7187
b961d0d7
CC
71882011-04-05 Cary Coutant <ccoutant@google.com>
7189
7190 * incremental-dump.cc (dump_incremental_inputs): Change signature
7191 to take a Sized_incremental_binary; change caller. Use readers
7192 in Sized_incremental_binary.
7193 * incremental.cc
7194 (Sized_incremental_binary::find_incremental_inputs_sections):
7195 Rename do_find_incremental_inputs_sections to this.
7196 (Sized_incremental_binary::setup_readers): New function.
7197 (Sized_incremental_binary::do_check_inputs): Check
7198 has_incremental_info_ flag; move setup code to setup_readers;
7199 use input readers.
7200 (Sized_incremental_binary::do_file_is_unchanged): New function.
7201 (Sized_incremental_binary::do_get_input_reader): New function.
7202 * incremental.h (class Incremental_binary): Move to end of file.
7203 (Incremental_binary::file_is_unchanged): New function.
7204 (Incremental_binary::do_file_is_unchanged): New function.
7205 (Incremental_binary::Input_reader): New class.
7206 (Incremental_binary::get_input_reader): New function.
7207 (class Sized_incremental_binary): Move to end of file.
7208 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7209 input section reader classes.
7210 (Sized_incremental_binary::has_incremental_info): New function.
7211 (Sized_incremental_binary::inputs_reader): New function.
7212 (Sized_incremental_binary::symtab_reader): New function.
7213 (Sized_incremental_binary::relocs_reader): New function.
7214 (Sized_incremental_binary::got_plt_reader): New function.
7215 (Sized_incremental_binary::do_file_is_unchanged): New function.
7216 (Sized_incremental_binary::Sized_input_reader): New class.
7217 (Sized_incremental_binary::get_input_reader): New function.
7218 (Sized_incremental_binary::find_incremental_inputs_sections):
7219 Rename do_find_incremental_inputs_sections to this.
7220 (Sized_incremental_binary::setup_readers): New function.
7221 (Sized_incremental_binary::has_incremental_info_): New data member.
7222 (Sized_incremental_binary::inputs_reader_): New data member.
7223 (Sized_incremental_binary::symtab_reader_): New data member.
7224 (Sized_incremental_binary::relocs_reader_): New data member.
7225 (Sized_incremental_binary::got_plt_reader_): New data member.
7226 (Sized_incremental_binary::current_input_file_): New data member.
7227
a869183f
PP
72282011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7229
7230 PR gold/12640
7231 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7232 violation.
7233
72342011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7235
7236 * archive.cc (Archive::include_member): Adjust call to report_object.
7237 (Add_archive_symbols::run): Add script_info to call to
7238 report_archive_begin.
7239 (Lib_group::include_member): Adjust call to report_object.
7240 (Add_lib_group_symbols::run): Adjust call to report_object.
7241 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7242 blocks. Add object count for script input files.
7243 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7244 script_info parameter; change all callers.
7245 (Incremental_inputs::report_object): Add script_info parameter;
7246 change all callers.
7247 (Incremental_inputs::report_script): Store backpointer to
7248 incremental info entry.
7249 (Output_section_incremental_inputs::set_final_data_size): Record
7250 additional information for scripts.
7251 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7252 * incremental.h (Incremental_script_entry::add_object): New function.
7253 (Incremental_script_entry::get_object_count): New function.
7254 (Incremental_script_entry::get_object): New function.
7255 (Incremental_script_entry::objects_): New data member; adjust
7256 constructor.
7257 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7258 (Incremental_inputs::report_object): Add script_info parameter.
7259 (Incremental_inputs_reader::get_object_count): New function.
7260 (Incremental_inputs_reader::get_object_offset): New function.
7261 * options.cc (Input_arguments::add_file): Return reference to
7262 new input argument.
7263 * options.h (Input_argument::set_script_info): New function.
7264 (Input_argument::script_info): New function.
7265 (Input_argument::script_info_): New data member; adjust all
7266 constructors.
7267 (Input_file_group::add_file): Return reference to new input argument.
7268 (Input_file_lib::add_file): Likewise.
7269 (Input_arguments::add_file): Likewise.
7270 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7271 * script.cc (Parser_closure::Parser_closure): Add script_info
7272 parameter; adjust all callers.
7273 (Parser_closure::script_info): New function.
7274 (Parser_closure::script_info_): New data member.
7275 (read_input_script): Report scripts earlier to incremental info.
7276 (script_add_file): Set script_info in Input_argument.
7277 (script_add_library): Likewise.
7278 * script.h (Script_options::Script_info): Rewrite class.
7279
a869183f 72802011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7281
7282 * archive.cc (Library_base::should_include_member): Move
7283 method here from class Archive.
7284 (Archive::Archive): Initialize base class.
7285 (Archive::should_include_member): Move to base class.
7286 (Archive::do_for_all_unused_symbols): New function.
7287 (Add_archive_symbols::run): Remove redundant access to
7288 incremental_inputs.
7289 (Lib_group::Lib_group): Initialize base class.
7290 (Lib_group::do_filename): New function.
7291 (Lib_group::include_member): Pass pointer to Lib_group to
7292 report_object.
7293 (Lib_group::do_for_all_unused_symbols): New function.
7294 (Add_lib_group_symbols::run): Report archive information for
7295 incremental links.
7296 * archive.h (class Library_base): New base class.
7297 (class Archive): Derive from Library_base.
7298 (Archive::filename): Move to base class.
7299 (Archive::set_incremental_info): Likewise.
7300 (Archive::incremental_info): Likewise.
7301 (Archive::Should_include): Likewise.
7302 (Archive::should_include_member): Likewise.
7303 (Archive::Armap_entry): Remove.
7304 (Archive::Unused_symbol_iterator): Remove.
7305 (Archive::unused_symbols_begin): Remove.
7306 (Archive::unused_symbols_end): Remove.
7307 (Archive::do_filename): New function.
7308 (Archive::do_get_mtime): New function.
7309 (Archive::do_for_all_unused_symbols): New function.
7310 (Archive::task_): Move to base class.
7311 (Archive::incremental_info_): Likewise.
7312 (class Lib_group): Derive from Library_base.
7313 (Lib_group::do_filename): New function.
7314 (Lib_group::do_get_mtime): New function.
7315 (Lib_group::do_for_all_unused_symbols): New function.
7316 (Lib_group::task_): Move to base class.
7317 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7318 function.
7319 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7320 function.
7321 * incremental.cc (Incremental_inputs::report_archive_begin):
7322 Use Library_base; call library's get_mtime; add incremental inputs
7323 entry before members.
7324 (class Unused_symbol_visitor): New class.
7325 (Incremental_inputs::report_archive_end): Use Library_base; use
7326 visitor class to record unused symbols; don't add incremental inputs
7327 entry after members.
7328 (Incremental_inputs::report_object): Use Library_base.
7329 * incremental.h
7330 (Incremental_archive_entry::Incremental_archive_entry): Remove
7331 unused Archive parameter.
7332 (Incremental_inputs::report_archive_begin): Use Library_base.
7333 (Incremental_inputs::report_archive_end): Likewise.
7334 (Incremental_inputs::report_object): Likewise.
7335 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7336 function.
7337 * object.h (Object::for_all_global_symbols): New function.
7338 (Object::do_for_all_global_symbols): New function.
7339 (Sized_relobj::do_for_all_global_symbols): New function.
7340 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7341 function.
7342 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7343 function.
7344
61ab3e40
ILT
73452011-03-27 Ian Lance Taylor <iant@google.com>
7346
7347 * archive.cc (Archive::interpret_header): Return -1 if something
7348 goes wrong. Change callers accordingly.
7349
30e1f9e6
CC
73502011-03-25 Cary Coutant <ccoutant@google.com>
7351
7352 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7353 * testsuite/Makefile.in: Regenerate.
7354
9370ce59 73552011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7356
7357 * plugin.cc (get_view): New.
7358 (Plugin::load): Pass get_view to the plugin.
7359 (Plugin_manager::get_view): New.
7360
9312bb0a
ILT
73612011-03-21 Ian Lance Taylor <iant@google.com>
7362
7363 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7364 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7365
7e12ba9e
ST
73662011-03-21 Sriraman Tallam <tmsriram@google.com>
7367
7368 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7369 Change == to -eq.
7370 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7371 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7372 Change == to -eq.
7373 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7374 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7375
fd7a005d
ILT
73762011-03-14 Ian Lance Taylor <iant@google.com>
7377
7378 * script-sections.cc (Sort_output_sections::script_compare):
7379 Rename from is_before, change return type.
7380 (Sort_output_sections::operator()): Adjust accordingly.
7381
ed16fd1b
ILT
73822011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7383
7384 PR gold/12572
7385 * testsuite/odr_violation2.cc: Add comment to make all error line
7386 numbers double digits.
7387 * testsuite/debug_msg.sh: Adjust expected errors.
7388
71ff8986
ILT
73892011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7390
7391 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7392 but mark earlier ones as non-canonical
7393 (offset_to_iterator): Update search target and example
7394 (do_addr2line): Return extra lines in a vector*
7395 (format_file_lineno): Extract from do_addr2line
7396 (one_addr2line): Add vector* out-param
7397 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7398 when a lineno entry appeared last for its instruction
7399 (Dwarf_line_info): Add vector* out-param
7400 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7401 * symtab.cc (Odr_violation_compare): Include the lineno in the
7402 comparison again.
7403 (linenos_from_loc): New. Combine the canonical line for an
7404 address with its other lines.
7405 (True_if_intersect): New. Helper functor to make
7406 std::set_intersection a query.
7407 (detect_odr_violations): Compare sets of lines instead of just
7408 one line for each function. This became less deterministic, but
7409 has fewer false positives.
7410 * symtab.h: Declarations.
7411 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7412 mix an optimized and non-optimized object in the same binary
7413 (odr_violation2.so): Same.
7414 * testsuite/Makefile.in: Regenerate from Makefile.am.
7415 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7416 * testsuite/debug_msg.sh: Update line numbers and add
7417 assertions.
7418 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7419 non-optimized context.
7420 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7421 isn't inlined, and use OdrDerived in an optimized context.
7422 * testsuite/odr_header1.h: Defines OdrDerived, where
7423 optimization will change the
7424 first-instruction-in-the-destructor's file and line number.
7425 * testsuite/odr_header2.h: Defines OdrBase.
7426
a19fefdc
ILT
74272011-03-09 Ian Lance Taylor <iant@google.com>
7428
7429 * fileread.cc (File_read::clear_views): Don't delete the whole
7430 file view.
7431
ecb351e9
ILT
74322011-03-08 Ian Lance Taylor <iant@google.com>
7433
7434 PR gold/12525
7435 * fileread.cc: #include <climits>.
7436 (GOLD_IOV_MAX): Define.
7437 (File_read::read_multiple): Limit number of entries by iov_max.
7438 * fileread.h (class File_read): Always set max_readv_entries to
7439 128.
7440
b821d13c
ILT
74412011-03-07 Ian Lance Taylor <iant@google.com>
7442
7443 PR gold/12525
7444 * options.h (class General_options): Add -dy and -dn.
7445
89243142
CC
74462011-03-02 Cary Coutant <ccoutant@google.com>
7447
7448 * testsuite/script_test_9.t: Add TLS segment.
7449
d0773f31
ILT
74502011-03-02 Simon Baldwin <simonb@google.com>
7451
7452 * configure.ac: Add check for gnu_indirect_function support in
7453 the toolchain building binutils.
7454 * configure: Rebuild.
7455
9370ce59 74562011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7457
7458 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7459 plugin only symbols.
7460 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7461 in plugin files as not needed in the symbol table.
7462
4cf7a849
ST
74632011-02-11 Sriraman Tallam <tmsriram@google.com>
7464
7465 * output.cc (Output_section::add_input_section): Delay fill
7466 generation for section ordering.
7467
b578bd7d
ILT
74682011-02-09 Ian Lance Taylor <iant@google.com>
7469
7470 PR gold/12316
7471 * object.h (class Sized_relobj): Remove clear_local_symbols.
7472 * reloc.cc (Sized_relobj::do_relocate): Don't call
7473 clear_local_symbols.
7474
9370ce59 74752011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7476
7477 * plugin.cc (is_visible_from_outside): Return true for symbols
7478 in the -u option.
7479
55382fb7
ILT
74802011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7481
7482 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7483 filename.
7484
4e271fff
ST
74852011-02-02 Sriraman Tallam <tmsriram@google.com>
7486
7487 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7488 to std::string.
4e271fff 7489 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7490 section_name to be std::string.
4e271fff
ST
7491 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7492
d433c3ac
ILT
74932011-01-25 Ian Lance Taylor <iant@google.com>
7494
7495 * script.cc (script_add_extern): Rewrite to use
7496 add_symbol_reference.
7497
880473a6
DK
74982011-01-25 Doug Kwan <dougkwan@google.com>
7499
d433c3ac 7500 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7501
f30f86fa
ILT
75022011-01-24 Ian Lance Taylor <iant@google.com>
7503
7504 * options.h (class General_options): Accept
7505 --no-detect-odr-violations.
7506
8e51a0b9
ILT
75072011-01-24 Ian Lance Taylor <iant@google.com>
7508
7509 * version.cc (version_string): Bump to 1.11.
7510
0f3b89d8
ILT
75112011-01-24 Ian Lance Taylor <iant@google.com>
7512
7513 * plugin.cc (class Plugin_rescan): Define new class.
7514 (Plugin_manager::claim_file): Set any_claimed_.
7515 (Plugin_manager::save_archive): New function.
7516 (Plugin_manager::save_input_group): New function.
7517 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7518 necessary.
7519 (Plugin_manager::new_undefined_symbol): New function.
7520 (Plugin_manager::rescan): New function.
7521 (Plugin_manager::rescannable_defines): New function.
7522 (Plugin_manager::add_input_file): Set any_added_.
7523 * plugin.h (class Plugin_manager): define new fields rescannable_,
7524 undefined_symbols_, any_claimed_, and any_added_. Declare
7525 Plugin_rescan as friend. Declare new functions.
7526 (Plugin_manager::Rescannable): Define type.
7527 (Plugin_manager::Rescannable_list): Define type.
7528 (Plugin_manager::Undefined_symbol_list): Define type.
7529 (Plugin_manager::Plugin_manager): Initialize new fields.
7530 * archive.cc (Archive::defines_symbol): New function.
7531 (Add_archive_symbols::run): Pass archive to plugins if any.
7532 * archive.h (class Archive): Declare defines_symbol.
7533 * readsyms.cc (Input_group::~Input_group): New function.
7534 (Finish_group::run): Pass input_group to plugins if any.
7535 * readsyms.h (class Input_group): Declare destructor.
7536 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7537 any.
7538
3bb951e5
ILT
75392011-01-10 Ian Lance Taylor <iant@google.com>
7540
7541 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7542 section as relro.
7543 (Layout::set_segment_offsets): Reset increase_relro before calling
7544 set_section_addresses a second time.
7545
0aa45fac
CC
75462011-01-04 Cary Coutant <ccoutant@google.com>
7547
7548 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7549 sections before NOBITS sections.
7550
0db46eb4
L
75512011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7552
7553 * version.cc (print_version): Update copyright to 2011.
7554
829c9745
CC
75552010-12-23 Cary Coutant <ccoutant@google.com>
7556
7557 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7558 of OS to this->add. Add OD parameter to second form of the function.
7559
7500420b
ILT
75602010-12-20 Ian Lance Taylor <iant@google.com>
7561
7562 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7563 second of two consecutive entries with same offset.
7564
f8e9a930
RW
75652010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7566
7567 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7568 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7569 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7570 to avoid unneeded links against $(LDADD).
7571 * testsuite/Makefile.in: Regenerate.
7572
2fbb4320
ILT
75732010-12-15 Ian Lance Taylor <iant@google.com>
7574
7575 PR gold/12324
7576 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7577 for R_X86_64_32 and R_X86_64_PC32.
7578 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7579 ver_matching_def_pic.o.
7580 (ver_matching_def_pic.o): New target.
7581
fedb228d
RW
75822010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7583
7584 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7585 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7586 Move definition before File_read::View member definitions.
7587 (File_read::View::~View): Initialize and hold lock before
7588 updating current_mapped_bytes.
7589
9b547ce6
RW
75902010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7591
7592 * dwarf_reader.cc: Remove outdated comment.
7593 * gold-threads.cc: Fix typo in error message.
7594 * archive.cc: Fix typos in comments.
7595 * archive.h: Likewise.
7596 * arm-reloc-property.cc: Likewise.
7597 * arm-reloc-property.h: Likewise.
7598 * arm-reloc.def: Likewise.
7599 * arm.cc: Likewise.
7600 * attributes.h: Likewise.
7601 * cref.cc: Likewise.
7602 * ehframe.cc: Likewise.
7603 * fileread.h: Likewise.
7604 * gold.h: Likewise.
7605 * i386.cc: Likewise.
7606 * icf.cc: Likewise.
7607 * incremental.h: Likewise.
7608 * int_encoding.cc: Likewise.
7609 * layout.h: Likewise.
7610 * main.cc: Likewise.
7611 * merge.h: Likewise.
7612 * object.cc: Likewise.
7613 * object.h: Likewise.
7614 * options.cc: Likewise.
7615 * readsyms.cc: Likewise.
7616 * reduced_debug_output.cc: Likewise.
7617 * reloc.cc: Likewise.
7618 * script-sections.cc: Likewise.
7619 * sparc.cc: Likewise.
7620 * symtab.h: Likewise.
7621 * target-reloc.h: Likewise.
7622 * target.cc: Likewise.
7623 * target.h: Likewise.
7624 * timer.cc: Likewise.
7625 * timer.h: Likewise.
7626 * x86_64.cc: Likewise.
7627
83e17bd5
CC
76282010-12-09 Cary Coutant <ccoutant@google.com>
7629
7630 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7631 stack.
7632 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7633 parameter; change all callers.
7634 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7635 * options.h (warn_execstack): New option.
7636
017257f8
DK
76372010-12-07 Doug Kwan <dougkwan@google.com>
7638
7639 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7640 like function call relocations.
7641
c20cbc06
ILT
76422010-12-07 Ian Lance Taylor <iant@google.com>
7643
7644 * archive.cc (Archive::get_elf_object_for_member): Permit
7645 punconfigured to be NULL.
7646 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7647 (Archive::include_member): Pass NULL to get_elf_object_for_member
7648 if we searched for the archive and this is the first included
7649 object.
7650
4dbfafcc
ILT
76512010-12-01 Ian Lance Taylor <iant@google.com>
7652
7653 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7654 track_relocs_type_ field.
7655 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7656 Set track_relocs_type_.
7657 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7658 contents when using RELA relocs.
7659 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7660 reloc_map_.
7661 * reloc.cc (Track_relocs::next_addend): New function.
7662 * reloc.h (class Track_relocs): Declare next_addend.
7663
e5e19edd
ILT
76642010-12-01 Ian Lance Taylor <iant@google.com>
7665
7666 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7667 virtual destructor.
7668
9a5ce24c
ILT
76692010-12-01 Ian Lance Taylor <iant@google.com>
7670
7671 * README: Update compilers known to work and fail.
7672
c7791212
NC
76732010-11-23 Matthias Klose <doko@ubuntu.com>
7674
7675 * configure.in: For --enable-gold, handle value `default' instead of
7676 `both*'. Always install ld as ld.bfd, install as ld if gold is
7677 not the default.
7678 * configure: Regenerate.
7679
0ad220c9
DK
76802010-11-18 Doug Kwan <dougkwan@google.com>
7681
7682 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7683 and right_alignment to be zero. Store result alignment only if it is
7684 greater than existing alignment.
7685
ab8056e0
CC
76862010-11-16 Cary Coutant <ccoutant@google.com>
7687
7688 PR gold/12220
7689 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7690 Check for ".zdebug_line".
7691
fd064a5b
CC
76922010-11-16 Doug Kwan <dougkwan@google.com>
7693 Cary Coutant <ccoutant@google.com>
7694
7695 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7696 by reference; adjust all callers.
7697 * output.cc (Output_segment::set_section_addresses): Adjust references
7698 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7699 list is empty.
7700 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7701 end at page boundary.
7702
6fc6ea19
CC
77032010-11-16 Cary Coutant <ccoutant@google.com>
7704
7705 PR gold/12220
7706 * layout.cc (Layout::choose_output_section): Transform names of
7707 compressed sections even when using a script with a SECTIONS clause.
7708 (Layout::output_section_name): Remove code to transform
7709 compressed debug section names.
7710 * output.cc (Output_section::add_input_section): Use uncompressed
7711 section size when tracking input sections.
7712
95a2c8d6
RS
77132010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7714
7715 * symtab.h (Symbol::NON_PIC_REF): Remove.
7716 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7717 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7718 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7719 (Symbol::use_plt_offset): Take a flags argument and pass it
7720 directly to needs_dynamic_reloc. Restrict check for undefined
7721 weak symbols to function calls.
7722 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7723 (Target_arm::Scan::global): Use it.
7724 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7725 (Target_arm::Relocate::relocate): Likewise.
7726 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7727 parameter with an r_type parameter. Use get_reference_flags
7728 to get the flags.
7729 (Target_arm::Relocate::relocate): Update accordingly.
7730 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7731 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7732 (Target_i386::Scan::global): Likewise.
7733 (Target_i386::Relocate::relocate): Likewise.
7734 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7735 parameter with an r_type parameter. Use get_reference_flags
7736 to get the flags.
7737 (Target_i386::Relocate::relocate): Update accordingly.
7738 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7739 (Target_powerpc::Scan::global): Use it.
7740 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7741 (Target_powerpc::Relocate::relocate): Likewise.
7742 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7743 (Target_sparc::Scan::global): Use it.
7744 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7745 (Target_sparc::Relocate::relocate): Likewise.
7746 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7747 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7748 (Target_x86_64::Scan::global): Likewise.
7749 (Target_x86_64::Relocate::relocate): Likewise.
7750
f625ae50
DK
77512010-11-08 Doug Kwan <dougkwan@google.com>
7752 Cary Coutant <ccoutant@google.com>
7753
7754 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7755 (Arm_exidx_merge_section::section_contents_): New data member.
7756 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7757 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7758 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7759 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7760 in parameters instead of calling Object::section_contents without
7761 locking.
7762 (Arm_output_section::group_section): New parameter TASK. Pass it
7763 to callees that need locking objects.
7764 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7765 to lock EXIDX input sections. Fix a formatting issue. Call
7766 Arm_exidx_merged_section::build_contents to create merged section
7767 contents.
7768 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7769 to lock object of stub table owner.
7770 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7771 TEXT_SIZE to initialize data member TEXT_SIZE_.
7772 (Arm_exidx_input_section::addralign): Fix typo in comment.
7773 (Arm_exidx_input_section::text_size): New method.
7774 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7775 that require locking objects. Lock objects before scanning for stubs
7776 and updating local symbols.
7777 (Arm_input_section<big_endian>::init): Copy contents of original
7778 input section.
2e702c99 7779 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7780 original input section instead of calling Object::section_contents
7781 without locking.
7782 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7783 size without calling Object::section_size().
7784 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7785 for size. Allocate a buffer for merged EXIDX entries.
7786 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7787 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7788 building code to Arm_exidx_merged_section::build_contetns. Write
7789 out contetns in buffer instead of building it on the fly.
7790 (Arm_relobj::make_exidx_input_section): Also pass text section size
7791 to Arm_exidx_input_section constructor.
7792 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7793 (Arm_dynobj::do_read_symbols): Fix memory leak.
7794 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7795 * target.h: (class Task): Add forward declaration.
7796 (Target::relax): Add new parameter TASK and pass it to
7797 Target::do_relax().
7798 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7799
5f9bcf58
CC
78002010-11-05 Cary Coutant <ccoutant@google.com>
7801
7802 PR gold/10708
7803 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7804 object when reading from the file.
7805 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7806 second layout pass.
7807 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7808 when reading section contents.
7809 (get_section_contents): Likewise.
7810 (icf::find_identical_sections): Likewise.
7811 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7812 object when reading from the file.
7813 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7814 the object when doing deferred section layout.
7815
e597fa08
NC
78162010-11-03 Nick Clifton <nickc@redhat.com>
7817
7818 PR gold/12001
7819 * script.h (class Symbol_assignment: name): New member. Returns
7820 the name of the symbol.
7821 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7822 Returns true if the given symbol name is on the list of
7823 assignments wating to be processed.
7824 * archive.cc (should_incldue_member): If the symbol is undefined,
7825 check to see if it is on the list of symbols pending assignment.
7826
3f9a3278
ILT
78272010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7828
7829 * script-sections.cc (Script_sections::find_memory_region): Check
7830 for a NULL output section pointer.
7831
d06fb4d1
DK
78322010-10-29 Doug Kwan <dougkwan@google.com>
7833
7834 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7835 Output_section::add_relaxed_input_section.
7836 * output.cc (Output_section::add_relaxed_input_section): Add new
7837 arguments LAYOUT and NAME. Set section order index.
7838 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7839 Copy section order index.
7840 * output.h (Output_section::add_relaxed_input_section): Add new
7841 arguments LAYOUT and NAME.
7842
90e24de5
ILT
78432010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7844
7845 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7846 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7847 * testsuite/Makefile.in: Regenerate.
7848
c9484ea5
DK
78492010-10-20 Doug Kwan <dougkwan@google.com>
7850
7851 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7852 without SHF_LINK_ORDER flags.
7853 * layout.cc (Layout::choose_output_section): Do not filter
7854 SHF_LINK_ORDER flag in a relocatable link.
7855
5bc2f5be
CC
78562010-10-17 Cary Coutant <ccoutant@google.com>
7857
7858 * output.h (Output_segment::set_section_addresses): Change function
7859 signature. Update all callers.
7860 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7861 sections.
7862 (Output_segment::set_section_addresses): Align after last TLS
7863 section. Add padding before last relro section instead of after.
7864
0c91cf04
DK
78652010-10-17 Doug Kwan <dougkwan@google.com>
7866
7867 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7868 GOT output section to be writable.
7869
8c21d9d3
CC
78702010-10-14 Cary Coutant <ccoutant@google.com>
7871
7872 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7873 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7874 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7875 mode.
7876 * incremental.cc (report_command_line): Ignore all forms of
7877 --incremental.
7878 * layout.cc (Layout::Layout): Check parameters for incremental link
7879 mode.
7880 * options.cc (General_options::parse_incremental): New function.
7881 (General_options::parse_no_incremental): New function.
7882 (General_options::parse_incremental_full): New function.
7883 (General_options::parse_incremental_update): New function.
7884 (General_options::incremental_mode_): New data member.
7885 (General_options::finalize): Check incremental_mode_.
7886 * options.h (General_options): Update help text for --incremental.
7887 Add --no-incremental, --incremental-full, --incremental-update.
7888 (General_options::Incremental_mode): New enum type.
7889 (General_options::incremental_mode): New function.
7890 (General_options::incremental_mode_): New data member.
7891 * parameters.cc (Parameters::incremental_mode_): New data member.
7892 (Parameters::set_options): Set incremental_mode_.
7893 (Parameters::set_incremental_full): New function.
7894 (Parameters::incremental): New function.
7895 (Parameters::incremental_update): New function.
7896 (set_parameters_incremental_full): New function.
7897 * parameters.h (Parameters::set_incremental_full): New function.
7898 (Parameters::incremental): New function.
7899 (Parameters::incremental_update): New function.
7900 (Parameters::incremental_mode_): New data member.
7901 (set_parameters_incremental_full): New function.
7902 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7903 incremental link mode.
7904 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7905 (Sized_relobj::do_relocate_sections): Likewise.
7906 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7907 option.
7908 * testsuite/Makefile.in: Regenerate.
7909 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7910
bb32aa18 79112010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7912
7913 * script-sections.h (class Script_sections): Make
7914 Sections_elements typedef public.
7915 * script-sections.cc (class Sort_output_sections): Add elements_
7916 field. Add constructor which sets it; change all callers.
7917 (Sort_output_sections::is_before): New function.
7918 (Sort_output_sections::operator()): Call is_before.
7919 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7920 conditional.
7921 * testsuite/script_test_10.sh: New test. Test script section
7922 order.
7923 * testsuite/script_test_10.t: Likewise.
7924 * testsuite/script_test_10.s: Likewise.
7925 * testsuite/Makefile.am: Wrap the cross linker tests and the
7926 common tests into NATIVE_OR_CROSS_LINKER.
7927 (check_SCRIPTS): Add script_test_10.sh.
7928 (check_DATA): Add script_test_10.stdout.
7929 (script_test_10.o, script_test_10): New targets.
7930 (script_test_10.stdout): New target.
7931 * configure, testsuite/Makefile.in: Regenerate.
7932
3cef7179
ILT
79332010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7934
7935 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7936 error for the deprecated relocations.
7937 (Target_arm::Scan::global): Likewise.
7938 (Target_arm::Relocate::relocate): Likewise.
7939
7411e9a8
RS
79402010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7941
7942 * fileread.cc (Input_file::find_file): Initialize *found_name
7943 and *namep when using the fallback search for case 4.
7944
6a9da32a
CC
79452010-10-11 Cary Coutant <ccoutant@google.com>
7946
7947 * options.h (class General_options): Redefine -z lazy as an alias for
7948 the negation of -z now.
7949
ac897c20
ILT
79502010-10-11 Ian Lance Taylor <iant@google.com>
7951
7952 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7953 binding.
7954
ea5cae92
NC
79552010-10-06 Nick Clifton <nickc@redhat.com>
7956
7957 * script-sections.cc(class Memory_region): Remove
7958 current_lma_offset_ field. Rename current_vma_offset_ to
7959 current_offset_. Add last_section_ field.
7960 (Memory_region::get_current_vma_address): Rename to
7961 get_current_address.
7962 (Memory_region::get_current_lma_address): Delete.
7963 (Memory_region::increment_vma_offset): Rename to
7964 increment_offset.
7965 (Memory_region::increment_lma_offset): Delete.
7966 (Memory_region::attributes_compatible): New method. Returns
7967 true if the provided section is compatible with the region.
7968 (Memory_region::get_last_section): New method. Returns the last
7969 section to use the region.
7970 (Memory_region::set_last_section): New method. Stores the last
7971 section to use the region.
7972 (Script_sections::block_in_region): New method. Returns true if
7973 a block of memory is contained within a region.
7974 (Script_sections::find_memory_region): New method. Locates a
7975 memory region to be used to set a VMA or LMA address.
7976 (Output_section_definition::set_section_addresses): Add code to
7977 check for addresses set by memory regions.
7978 (Output_segment::set_section_addresses): Remove memory region
7979 walking code.
7980 (Script_sections::create_segment): Add a warning if a header
7981 segment is created outside of any region.
7982 * script-sections.h (class Script_sections): Add prototypes for
7983 find_memory_region and block_in_region methods.
7984 * testsuite/memory_test.s: Use .long instead of .word.
7985 * testsuite/memory_test.t: Add some more output sections.
7986 * testsuite/memory_test.sh: Update expected output.
7987
a9bfd952
DK
79882010-10-02 Doug Kwan <dougkwan@google.com>
7989
7990 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7991 defintion to symtab.h
7992 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7993 declaration to defintion.
7994
bacff3ab
NC
79952010-10-01 Nick Clifton <nickc@redhat.com>
7996
7997 * expression.cc (eval): Replace dummy argument with NULL.
7998 (eval_maybe_dot): Check for a NULL result section pointer.
7999 (Symbol_expression::value): Likewise.
8000 (Dot_expression::value): Likewise.
8001 (BINARY_EXPRESSION): Likewise.
8002 (Max_expression::value): Likewise.
8003 (Min_expression::value): Likewise.
8004 (Absolute_expression::value): Likewise.
8005 (Addr_expression::value_from_output_section): Likewise.
8006 (Loaddddr_expression::value_from_output_section): Likewise.
8007 (Segment_start_expression::value): Likewise.
8008 * script-sections.cc
8009 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8010 argument with NULL.
8011 (Sections_elememt_dot_assignment::set_section_addresses):
8012 Likewise.
8013 (Output_data_expression::do_write_to_buffer): Likewise.
8014 (Output_section_definition::finalize_symbols): Likewise.
8015 (Output_section_definition::set_section_addresses): Likewise.
8016
f81bc8b5
DK
80172010-09-30 Doug Kwan <dougkwan@google.com>
8018
8019 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8020
c95e9f27
ST
80212010-09-28 Sriraman Tallam <tmsriram@google.com>
8022
8023 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8024 function.
c95e9f27
ST
8025 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8026 virtual function.
8027 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8028 virtual function.
8029 * icf.cc (get_section_contents): Inline merge sections only when
8030 target allows it.
8031
3cac54d2
RW
80322010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8033
8034 * configure: Regenerate.
8035
2904037a
ILT
80362010-09-17 Ian Lance Taylor <iant@google.com>
8037
8038 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8039 * testsuite/Makefile.am (memory_test.o): New target.
8040 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8041 memory_test.t.
8042 * testsuite/Makefile.in: Rebuild.
2904037a 8043
bca7fb63
DK
80442010-09-17 Doug Kwan <dougkwan@google.com>
8045
8046 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8047 defintion if relocation uses GOT entries of the symbol.
8048 * testsuite/icf_safe_test.sh: Fix test.
8049 * testsuite/icf_safe_so_test.sh: Fix test.
8050
4ef28648
CC
80512010-09-16 Cary Coutant <ccoutant@google.com>
8052
8053 * script_sections.cc (class Memory_region): Remove "NULL" from
8054 vector initializations.
8055
793990de
CC
80562010-09-15 Cary Coutant <ccoutant@google.com>
8057
8058 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8059 Resolve forwarding symbols.
8060
81e015e2
DK
80612010-09-15 Doug Kwan <dougkwan@google.com>
8062
8063 * gold/testsuite/script_test_3.t: Add ARM special sections.
8064 * gold/testsuite/script_test_4.t: Same.
8065 * gold/testsuite/script_test_5.t: Same.
8066 * gold/testsuite/script_test_6.t: Same.
8067 * gold/testsuite/script_test_7.t: Same.
8068 * gold/testsuite/script_test_7.t: Same.
8069 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8070
36171d64
CC
80712010-09-14 Cary Coutant <ccoutant@google.com>
8072
8073 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8074 (Target_x86_64::Relocate::relocate_tls): Replace check for
8075 saw_tls_block_reloc_ with test for executable section.
8076
d89051bd
CC
80772010-09-12 Cary Coutant <ccoutant@google.com>
8078
8079 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8080 position-independent executables to shared libraries need dynamic
8081 relocations.
8082 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8083 position-independent executables.
8084 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8085 * testsuite/Makefile.in: Regenerate.
8086
fca41f0f
NC
80872010-09-10 Nick Clifton <nickc@redhat.com>
8088
8089 PR gold/11997
8090 * testsuite/memory_test.t: Discard any sections that are not
8091 needed.
8092
6695e4b3
L
80932010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8094
8095 PR gold/11996
8096 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8097 "This::" to work around a bug in gcc 4.2.
8098
8099 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8100
0f72bf6f
RÁE
81012010-09-09 Rafael Espindola <espindola@google.com>
8102
8103 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8104 sections with different PF_X flags in the same segment.
8105 (Layout::find_first_load_seg): Search all segments to find the first
8106 one.
8107 * options.h (rosegment): New.
8108
81092010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8110
05a79166 8111 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8112
aa98ff75
DK
81132010-09-08 Doug Kwan <dougkwan@google.com>
8114
8115 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8116 (Arm_relobj::do_relocate_sections): Add new parameter for output
8117 file to match the parent.
8118 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8119 of local symbols instead of input values. Update code to track
8120 changes in gold::relocate_section.
8121 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8122 (Sized_relobj::compute_final_local_value_internal): New methods.
8123 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8124 body into private version of Sized_relobj::compute_final_local_value.
8125 Call the inline method.
8126 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8127 merged symbol value if there is one.
8128 (Symbol_value::has_output_value): New method defintiion.
8129 (Sized_relobj::Compute_final_local_value_status): New enum type.
8130 (Sized_relobj::compute_final_local_value): New methods.
8131 (Sized_relobj::compute_final_local_value_internal): New methods.
8132 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8133 and arm_cortex_a8.sh.
8134 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8135 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8136 New tests.
8137 * Makefile.in: Regenerate.
8138 * testsuite/arm_bl_out_of_range.s: Update test.
8139 * testsuite/thumb_bl_out_of_range.s: Ditto.
8140 * testsuite/thumb_blx_out_of_range.s: Ditto.
8141 * testsuite/arm_branch_out_of_range.sh: New file.
8142 * testsuite/arm_cortex_a8.sh: Ditto.
8143 * testsuite/arm_cortex_a8_b.s: Ditto.
8144 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8145 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8146 * testsuite/arm_cortex_a8_bl.s: Ditto.
8147 * testsuite/arm_cortex_a8_blx.s: Ditto.
8148 * testsuite/arm_cortex_a8_local.s: Ditto.
8149 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8150 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8151
05a79166
L
81522010-09-08 Rafael Espindola <espindola@google.com>
8153
8154 * Makefile.am (memory_test.stdout): Run readelf with -W.
8155 * Makefile.in: Regenerate.
8156 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8157 64 bit output.
8158
33dbc701
RÁE
81592010-09-08 Rafael Espindola <espindola@google.com>
8160
8161 * script-sections.cc (Script_sections::add_memory_region): Convert
8162 field precision to int.
8163 * script.cc (script_set_section_region, script_set_section_region):
8164 Convert field precision to int.
8165
731ca54a
RÁE
81662010-09-08 Rafael Espindola <espindola@google.com>
8167
8168 * arm.cc (do_finalize_sections): Create the __exidx_start and
8169 __exdix_end symbols even when the section is missing.
8170
7f8cd844
NC
81712010-09-08 Nick Clifton <nickc@redhat.com>
8172
8173 * README: Remove claim that MEMORY is not supported.
8174 * expression.cc (script_exp_function_origin)
8175 (script_exp_function_length): Move from here to ...
8176 * script.cc: ... here.
8177 (script_set_section_region, script_add_memory)
8178 (script_parse_memory_attr, script_include_directive): New
8179 functions.
8180 * script-sections.cc
8181 (class Memory_region): New class.
8182 (class Output_section_definition): Add set_memory_region,
8183 set_section_vma, set_section_lma and get_section_name methods.
8184 (class Script_Sections): Add add_memory_region,
8185 find_memory_region, find_memory_region_origin,
8186 find_memory_region_length and set_memory_region methods.
8187 Have set_section_addresses method walk the list of set memory
8188 regions.
8189 Extend the print methos to display memory regions.
8190 * script-sections.h: Add prototypes for new methods.
8191 Add enum for MEMORY region attributes.
8192 * yyscript.y: Add support for parsing MEMORY regions.
8193 * script-c.h: Add prototypes for new functions.
8194 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8195 * testsuite/Makefile.in: Regenerate.
8196 * testsuite/memory_test.sh: New script.
8197 * testsuite/memory_test.s: New assembler source file.
8198 * testsuite/memory_test.t: New linker script.
8199
a4649286
DK
82002010-08-27 Doug Kwan <dougkwan@google.com>
8201
8202 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8203 reference override an existing dynamic weak reference.
8204 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8205 * testsuite/Makefile.in: Regenerate.
8206 * testsuite/dyn_weak_ref.sh: New file.
8207 * testsuite/dyn_weak_ref_1.c: Ditto.
8208 * testsuite/dyn_weak_ref_2.c: Ditto.
8209
b56648ad
ILT
82102010-08-27 Ian Lance Taylor <iant@google.com>
8211
8212 * incremental.h (class Incremental_input_entry): Add virtual
8213 destructor.
8214
809313cb
ILT
82152010-08-27 Ian Lance Taylor <iant@google.com>
8216
8217 * testsuite/start_lib_test_3.c: Mark t3 as used.
8218
11e32464
NC
82192010-08-27 Nick Clifton <nickc@redhat.com>
8220
8221 * options.cc (version_script): Fix small typo in previous
8222 whitespace tidyup.
8223
ca09d69a
NC
82242010-08-25 Nick Clifton <nickc@redhat.com>
8225
8226 * archive.cc: Formatting fixes: Remove whitespace between
8227 typename and following asterisk. Remove whitespace between
8228 function name and opening parenthesis.
8229 * archive.h: Likewise.
8230 * arm.cc: Likewise.
8231 * attributes.cc: Likewise.
8232 * attributes.h: Likewise.
8233 * common.cc: Likewise.
8234 * copy-relocs.cc: Likewise.
8235 * dirsearch.h: Likewise.
8236 * dynobj.cc: Likewise.
8237 * ehframe.cc: Likewise.
8238 * ehframe.h: Likewise.
8239 * expression.cc: Likewise.
8240 * fileread.cc: Likewise.
8241 * fileread.h: Likewise.
8242 * gc.h: Likewise.
8243 * gold-threads.cc: Likewise.
8244 * gold.cc: Likewise.
8245 * i386.cc: Likewise.
8246 * icf.h: Likewise.
8247 * incremental-dump.cc: Likewise.
8248 * incremental.cc: Likewise.
8249 * layout.cc: Likewise.
8250 * layout.h: Likewise.
8251 * main.cc: Likewise.
8252 * merge.cc: Likewise.
8253 * merge.h: Likewise.
8254 * object.cc: Likewise.
8255 * object.h: Likewise.
8256 * options.cc: Likewise.
8257 * options.h: Likewise.
8258 * output.cc: Likewise.
8259 * output.h: Likewise.
8260 * plugin.cc: Likewise.
8261 * plugin.h: Likewise.
8262 * powerpc.cc: Likewise.
8263 * reloc.cc: Likewise.
8264 * script-c.h: Likewise.
8265 * script-sections.cc: Likewise.
8266 * script.cc: Likewise.
8267 * stringpool.cc: Likewise.
8268 * symtab.cc: Likewise.
8269 * symtab.h: Likewise.
8270 * target.cc: Likewise.
8271 * timer.cc: Likewise.
8272 * timer.h: Likewise.
8273 * version.cc: Likewise.
8274 * x86_64.cc: Likewise.
8275
b8fa8750
NC
82762010-08-24 Nick Clifton <nickc@redhat.com>
8277
8278 PR 11899
8279 * layout.cc (segment_precedes): Sort segments by their physical
8280 addresses, if they have been set.
8281
9919d93b
CC
82822010-08-23 Cary Coutant <ccoutant@google.com>
8283
8284 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8285 symbols data.
8286 (Lib_group::include_member): Unlock object after deleting its
8287 symbols data.
8288 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8289 the bug fixed here.
8290
97b4be1c
CC
82912010-08-19 Neil Vachharajani <nvachhar@google.com>
8292 Cary Coutant <ccoutant@google.com>
8293
8294 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8295 constructor, and set_blocker.
8296 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8297 readsyms_blocker_.
8298 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8299 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8300 * testsuite/Makefile.am (start_lib_test): New test case.
8301 * testsuite/Makefile.in: Regenerate.
8302 * testsuite/start_lib_test_main.c: New file.
8303 * testsuite/start_lib_test_1.c: New file.
8304 * testsuite/start_lib_test_2.c: New file.
8305 * testsuite/start_lib_test_3.c: New file.
8306
dd0b1884
ILT
83072010-08-19 Ian Lance Taylor <iant@google.com>
8308
8309 * Makefile.in: Rebuild with automake 1.11.1.
8310 * aclocal.m4: Likewise.
8311 * testsuite/Makefile.in: Likewise.
8312
7223e9ca
ILT
83132010-08-19 Ian Lance Taylor <iant@google.com>
8314
8315 PR 10893
8316 * i386.cc (class Output_data_plt_i386): Update declarations.
8317 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8318 local_ifuncs_ fields.
8319 (Target_i386::do_plt_section_for_global): New function.
8320 (Target_i386::do_plt_section_for_local): New function.
8321 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8322 parameter; change all callers. Initialize global_ifuncs_ and
8323 local_ifuncs_. If doing a static link define __rel_iplt_start and
8324 __rel_iplt_end.
8325 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8326 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8327 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8328 symbols.
8329 (Target_i386::make_plt_section): New function, broken out of
8330 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8331 (Target_i386::make_plt_entry): Call make_plt_section.
8332 (Target_i386::make_local_ifunc_plt_entry): New function.
8333 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8334 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8335 R_386_IRELATIVE to switch.
8336 (Target_i386::Scan::global): Likewise.
8337 (Target_i386::Relocate::relocate): Likewise.
8338 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8339 switch.
8340 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8341 (Target_x86_64::do_plt_section_for_global): New function.
8342 (Target_x86_64::do_plt_section_for_local): New function.
8343 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8344 parameter; change all callers. If doing a static link define
8345 __rela_iplt_start and __rela_iplt_end.
8346 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8347 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8348 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8349 to point to .plt.
8350 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8351 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8352 switch.
8353 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8354 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8355 R_X86_64_IRELATIVE to switch.
8356 (Target_x86_64::Scan::global): Likewise.
8357 (Target_x86_64::Relocate::relocate): Likewise.
8358 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8359 switch.
8360 * target.h (class Target): Add plt_section_for_global and
8361 plt_section_for_local functions. Add do_plt_section_for_global
8362 and do_plt_section_for_local virtual functions.
8363 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8364 clarifying comments.
8365 (Symbol::use_plt_offset): Handle IFUNC symbol.
8366 * object.cc (Sized_relobj::Sized_relobj): Initialize
8367 local_plt_offsets_.
8368 (Sized_relobj::local_has_plt_offset): New function.
8369 (Sized_relobj::local_plt_offset): New function.
8370 (Sized_relobj::set_local_plt_offset): New function.
8371 (Sized_relobj::do_count): Handle IFUNC symbol.
8372 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8373 a bit away from input_shndx_ field. Add set_is_func_symbol and
8374 is_ifunc_symbol functions.
8375 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8376 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8377 local_plt_offsets_ field.
8378 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8379 * output.h (class Output_section_data): Add non-const
8380 output_section function.
8381 (class Output_data_got): Update declarations.
8382 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8383 Add use_plt_offset parameter to global and local constructors.
8384 Change all callers. Change local_sym_index_ field to 31 bits.
8385 Change GSYM_CODE and CONSTANT_CODE accordingly.
8386 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8387 doing a static link don't set sh_link field.
8388 (Output_data_got::Got_entry::write): Use PLT offset if
8389 appropriate.
8390 (Output_data_got::add_global_plt): New function.
8391 (Output_data_got::add_local_plt): New function.
8392 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8393 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8394 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8395 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8396 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8397 IFUNC conditional.
8398 * testsuite/ifunc-sel.h: New file.
8399 * testsuite/ifuncmain1.c: New file.
8400 * testsuite/ifuncmain1vis.c: New file.
8401 * testsuite/ifuncmod1.c: New file.
8402 * testsuite/ifuncdep2.c: New file.
8403 * testsuite/ifuncmain2.c: New file.
8404 * testsuite/ifuncmain3.c: New file.
8405 * testsuite/ifuncmod3.c: New file.
8406 * testsuite/ifuncmain4.c: New file.
8407 * testsuite/ifuncmain5.c: New file.
8408 * testsuite/ifuncmod5.c: New file.
8409 * testsuite/ifuncmain6pie.c: New file.
8410 * testsuite/ifuncmod6.c: New file.
8411 * testsuite/ifuncmain7.c: New file.
8412 * configure, testsuite/Makefile.in: Rebuild.
8413
56f75c03
ILT
84142010-08-18 Ian Lance Taylor <iant@google.com>
8415
8416 * incremental.cc
8417 (Output_section_incremental_inputs::write_input_files): Add cast
8418 to avoid signed/unsigned comparison warning.
8419 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8420
55455f89
CC
84212010-08-12 Cary Coutant <ccoutant@google.com>
8422
8423 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8424
e2054bcb
ILT
84252010-08-13 Ian Lance Taylor <iant@google.com>
8426
8427 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8428
74f67560
DK
84292010-08-12 Cary Coutant <ccoutant@google.com>
8430 Doug Kwan <dougkwan@google.com>
8431
8432 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8433 defintion overrides non-weak undef, remember that the original undef
8434 is not weak.
8435 * symtab.cc (Symbol_table::sized_write_global): For undef without
8436 an original weak binding, set binding to global in output.
8437 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8438 * testsuite/Makefile.in: Regenerate.
8439 * testsuite/strong_ref_weak_def.sh: New file.
8440 * testsuite/strong_ref_weak_def_1.c: Ditto.
8441 * testsuite/strong_ref_weak_def_2.c: Ditto.
8442
d1238d12
CC
84432010-08-12 Cary Coutant <ccoutant@google.com>
8444
8445 * testsuite/incremental_test.sh: Rewrite.
8446 * testsuite/incremental_test_1.c: Rewrite.
8447 * testsuite/incremental_test_2.c: Rewrite.
8448
0e70b911
CC
84492010-08-12 Cary Coutant <ccoutant@google.com>
8450
8451 * arm.cc (Target_arm::got_size): Add const.
8452 (Target_arm::got_entry_count): New function.
8453 (Target_arm::plt_entry_count): New function.
8454 (Target_arm::first_plt_entry_offset): New function.
8455 (Target_arm::plt_entry_size): New function.
8456 (Output_data_plt_arm::entry_count): New function.
8457 (Output_data_plt_arm::first_plt_entry_offset): New function.
8458 (Output_data_plt_arm::get_plt_entry_size): New function.
8459 * i386.cc (Target_i386::got_size): Add const.
8460 (Target_i386::got_entry_count): New function.
8461 (Target_i386::plt_entry_count): New function.
8462 (Target_i386::first_plt_entry_offset): New function.
8463 (Target_i386::plt_entry_size): New function.
8464 (Output_data_plt_i386::entry_count): New function.
8465 (Output_data_plt_i386::first_plt_entry_offset): New function.
8466 (Output_data_plt_i386::get_plt_entry_size): New function.
8467 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8468 find_incremental_inputs_sections. Dump incremental_got_plt section.
8469 * incremental.cc: Include target.h.
8470 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8471 parameter. Adjust all callers. Find incremental_got_plt section.
8472 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8473 section.
8474 (Output_section_incremental_inputs::set_final_data_size): Calculate
8475 size of incremental_got_plt section.
8476 (Output_section_incremental_inputs::do_write): Write the
8477 incremental_got_plt section.
8478 (Got_plt_view_info): New struct.
8479 (Local_got_offset_visitor): New class.
8480 (Global_got_offset_visitor): New class.
8481 (Global_symbol_visitor_got_plt): New class.
8482 (Output_section_incremental_inputs::write_got_plt): New function.
8483 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8484 Add parameter. Adjust all callers.
8485 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8486 (Incremental_inputs::got_plt_section): New function.
8487 (Incremental_inputs::got_plt_section_): New data member.
8488 (Incremental_got_plt_reader): New class.
8489 * layout.cc (Layout::create_incremental_info_sections): Add the
8490 incremental_got_plt section.
8491 * object.h (Got_offset_list::get_list): New function.
8492 (Got offset_list::for_all_got_offsets): New function.
8493 (Sized_relobj::local_got_offset_list): New function.
8494 * powerpc.cc (Target_powerpc::got_size): Add const.
8495 (Target_powerpc::got_entry_count): New function.
8496 (Target_powerpc::plt_entry_count): New function.
8497 (Target_powerpc::first_plt_entry_offset): New function.
8498 (Target_powerpc::plt_entry_size): New function.
8499 (Output_data_plt_powerpc::entry_count): New function.
8500 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8501 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8502 * sparc.cc (Target_sparc::got_size): Add const.
8503 (Target_sparc::got_entry_count): New function.
8504 (Target_sparc::plt_entry_count): New function.
8505 (Target_sparc::first_plt_entry_offset): New function.
8506 (Target_sparc::plt_entry_size): New function.
8507 (Output_data_plt_sparc::entry_count): New function.
8508 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8509 (Output_data_plt_sparc::get_plt_entry_size): New function.
8510 * symtab.h (Symbol::got_offset_list): New function.
8511 (Symbol_table::for_all_symbols): New function.
8512 * target.h (Sized_target::got_entry_count): New function.
8513 (Sized_target::plt_entry_count): New function.
8514 (Sized_target::plt_entry_size): New function.
8515 * x86_64.cc (Target_x86_64::got_size): Add const.
8516 (Target_x86_64::got_entry_count): New function.
8517 (Target_x86_64::plt_entry_count): New function.
8518 (Target_x86_64::first_plt_entry_offset): New function.
8519 (Target_x86_64::plt_entry_size): New function.
8520 (Output_data_plt_x86_64::entry_count): New function.
8521 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8522 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8523
09ec0418
CC
85242010-08-12 Cary Coutant <ccoutant@google.com>
8525
8526 * archive.cc: Include incremental.h.
8527 (Archive::Archive): Initialize incremental_info_.
8528 (Archive::include_member): Record archive members in incremental info.
8529 (Add_archive_symbols::run): Record begin and end of an archive in
8530 incremental info.
8531 (Lib_group::include_member): Record objects in incremental info.
8532 * archive.h (Incremental_archive_entry): Forward declaration.
8533 (Archive::set_incremental_info): New member function.
8534 (Archive::incremental_info): New member function.
8535 (Archive::Unused_symbol_iterator): New class.
8536 (Archive::unused_symbols_begin): New member function.
8537 (Archive::unused_symbols_end): New member function.
8538 (Archive::incremental_info_): New data member.
8539 * incremental-dump.cc (find_input_containing_global): New function.
8540 (dump_incremental_inputs): Dump new incremental info sections.
8541 * incremental.cc: Include symtab.h.
8542 (Output_section_incremental_inputs): New class.
8543 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8544 new incremental info sections.
8545 (Sized_incremental_binary::do_check_inputs): Likewise.
8546 (Incremental_inputs::report_archive): Remove.
8547 (Incremental_inputs::report_archive_begin): New function.
8548 (Incremental_inputs::report_archive_end): New function.
8549 (Incremental_inputs::report_object): New function.
8550 (Incremental_inputs::finalize_inputs): Remove.
8551 (Incremental_inputs::report_input_section): New function.
8552 (Incremental_inputs::report_script): Rewrite.
8553 (Incremental_inputs::finalize): Do nothing but finalize string table.
8554 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8555 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8556 (Incremental_inputs::create_data_sections): New function.
8557 (Incremental_inputs::relocs_entsize): New function.
8558 (Output_section_incremental_inputs::set_final_data_size): New function.
8559 (Output_section_incremental_inputs::do_write): New function.
8560 (Output_section_incremental_inputs::write_header): New function.
8561 (Output_section_incremental_inputs::write_input_files): New function.
8562 (Output_section_incremental_inputs::write_info_blocks): New function.
8563 (Output_section_incremental_inputs::write_symtab): New function.
8564 * incremental.h (Incremental_script_entry): Forward declaration.
8565 (Incremental_object_entry): Forward declaration.
8566 (Incremental_archive_entry): Forward declaration.
8567 (Incremental_inputs): Forward declaration.
8568 (Incremental_inputs_header_data): Remove.
8569 (Incremental_inputs_header): Remove.
8570 (Incremental_inputs_header_write): Remove.
8571 (Incremental_inputs_entry_data): Remove.
8572 (Incremental_inputs_entry): Remove.
8573 (Incremental_inputs_entry_write): Remove.
8574 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8575 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8576 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8577 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8578 Likewise.
8579 (Incremental_input_entry): New class.
8580 (Incremental_script_entry): New class.
8581 (Incremental_object_entry): New class.
8582 (Incremental_archive_entry): New class.
8583 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8584 (Incremental_inputs::report_inputs): Remove.
8585 (Incremental_inputs::report_archive): Remove.
8586 (Incremental_inputs::report_archive_begin): New function.
8587 (Incremental_inputs::report_archive_end): New function.
8588 (Incremental_inputs::report_object): Change prototype.
8589 (Incremental_inputs::report_input_section): New function.
8590 (Incremental_inputs::report_script): Change prototype.
8591 (Incremental_inputs::get_reloc_count): New function.
8592 (Incremental_inputs::set_reloc_count): New function.
8593 (Incremental_inputs::create_data_sections): New function.
8594 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8595 (Incremental_inputs::inputs_section): New function.
8596 (Incremental_inputs::symtab_section): New function.
8597 (Incremental_inputs::relocs_section): New function.
8598 (Incremental_inputs::get_stringpool): Add const.
8599 (Incremental_inputs::command_line): Add const.
8600 (Incremental_inputs::inputs): Remove.
8601 (Incremental_inputs::command_line_key): New function.
8602 (Incremental_inputs::input_file_count): New function.
8603 (Incremental_inputs::input_files): New function.
8604 (Incremental_inputs::relocs_entsize): New function.
8605 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8606 (Incremental_inputs::finalize_inputs): Remove.
8607 (Incremental_inputs::Input_info): Remove.
8608 (Incremental_inputs::lock_): Remove.
8609 (Incremental_inputs::inputs_): Change type.
8610 (Incremental_inputs::inputs_map_): Remove.
8611 (Incremental_inputs::current_object_entry_): New data member.
8612 (Incremental_inputs::inputs_section_): New data member.
8613 (Incremental_inputs::symtab_section_): New data member.
8614 (Incremental_inputs::relocs_section_): New data member.
8615 (Incremental_inputs::reloc_count_): New data member.
8616 (Incremental_inputs_reader): New class.
8617 (Incremental_symtab_reader): New class.
8618 (Incremental_relocs_reader): New class.
8619 * layout.cc (Layout::finalize): Move finalization of incremental info
8620 and creation of incremental info sections to follow finalization of
8621 symbol table. Set offsets for postprocessing sections.
8622 (Layout::create_incremental_info_sections): Call
8623 Incremental_inputs::create_data_sections. Add incremental symtab
8624 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8625 sections to layout after input sections.
8626 * layout.h (struct Timespec): Forward declaration.
8627 (Layout::incremental_inputs): Add const.
8628 (Layout::create_incremental_info_sections): Add parameter.
8629 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8630 * object.cc: Include incremental.h.
8631 (Relobj::finalize_incremental_relocs): New function.
8632 (Sized_relobj::do_layout): Record input sections in incremental info.
8633 * object.h (Object::output_section): New function.
8634 (Object::output_section_offset): Moved from Relobj.
8635 (Object::get_incremental_reloc_base): New function.
8636 (Object::get_incremental_reloc_count): New function.
8637 (Object::do_output_section): New function.
8638 (Object::do_output_section_offset): Moved from Relobj.
8639 (Object::do_get_incremental_reloc_base): New function.
8640 (Object::do_get_incremental_reloc_count): New function.
8641 (Object::Object): Initialize new data members.
8642 (Relobj::output_section): Renamed do_output_section and moved to
8643 protected.
8644 (Relobj::output_section_offset): Moved to Object.
8645 (Relobj::do_get_incremental_reloc_base): New function.
8646 (Relobj::do_get_incremental_reloc_count): New function.
8647 (Relobj::allocate_incremental_reloc_counts): New function.
8648 (Relobj::count_incremental_reloc): New function.
8649 (Relobj::finalize_incremental_relocs): New function.
8650 (Relobj::next_incremental_reloc_index): New function.
8651 (Relobj::reloc_counts_): New data member.
8652 (Relobj::reloc_bases_): New data member.
8653 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8654 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8655 (Sized_relobj::incremental_relocs_scan): New function.
8656 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8657 (Sized_relobj::incremental_relocs_write): New function.
8658 (Sized_relobj::incremental_relocs_write_reltype): New function.
8659 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8660 incremental link.
8661 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8662 archives and object files elsewhere.
8663 (Add_symbols::run): Report object files here.
8664 (Finish_group::run): Report end of archive at end of group.
8665 * reloc.cc: Include layout.h, incremental.h.
8666 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8667 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8668 (Sized_relobj::incremental_relocs_scan): New function.
8669 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8670 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8671 (Sized_relobj::incremental_relocs_write): New function.
8672 (Sized_relobj::incremental_relocs_write_reltype): New function.
8673 * script.cc (read_input_script): Rewrite test for incremental link.
8674 Change call to Incremental_inputs::report_script.
8675 * symtab.h (Symbol_table::first_global_index): New function.
8676 (Symbol_table::output_count): New function.
8677
ce0d1972
DK
86782010-08-12 Doug Kwan <dougkwan@google.com>
8679
8680 * arm.cc (Target_arm::merge_object_attributes): Check command line
8681 options --no-wchar-size-warning and --no-enum-size-warning.
8682 * options.h (General_options): Add ld-compatible options
8683 --no-enum-size-warning and --no-wchar-size-warning.
8684
6e5710ce
ILT
86852010-08-04 Ian Lance Taylor <iant@google.com>
8686
8687 * x86_64.cc (Target_x86_64::Scan::local): Use
8688 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8689 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8690 (Target_x86_64::Scan::global): Likewise.
8691 (Target_x86_64::Relocate::relocate): Likewise.
8692 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8693 Likewise.
8694
fef830db
CC
86952010-08-03 Cary Coutant <ccoutant@google.com>
8696
8697 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8698 to reserve space in merged_strings vector. Keep total input size
8699 for stats.
8700 (Output_merge_string::do_print_merge_stats): Print total input size.
8701 * merge.h (Output_merge_string): Add input_size_ field.
8702 * stringpool.cc (Stringpool_template::string_length): Move
8703 implementations out of Stringpool_template class and place in
8704 stringpool.h.
8705 * stringpool.h (string_length): Move out of Stringpool_template.
8706
1e3811b0
ILT
87072010-08-03 Ian Lance Taylor <iant@google.com>
8708
8709 PR 11712
8710 * layout.cc (relaxation_loop_body): If address of load segment is
8711 set, adjust address to include headers if possible.
8712
7af0c620
ILT
87132010-08-03 Ian Lance Taylor <iant@google.com>
8714
8715 * version.cc (version_string): Bump to 1.10.
8716
22f0da72
ILT
87172010-08-03 Ian Lance Taylor <iant@google.com>
8718
8719 PR 11805
8720 * layout.h (enum Output_section_order): Define.
8721 (class Layout): Update declarations.
8722 * layout.cc (Layout::get_output_section): Add order parameter.
8723 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8724 is_first_non_relro parameters. Change all callers.
8725 (Layout::choose_output_section): Likewise.
8726 (Layout::add_output_section_data): Likewise.
8727 (Layout::make_output_section): Likewise. Set order.
8728 (Layout::default_section_order): New function.
8729 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8730 * output.cc (Output_section::Output_section): Initialize order_.
8731 Don't initialize deleted fields.
8732 (Output_segment::Output_segment): Don't initialize deleted
8733 fields.
8734 (Output_segment::add_output_section_to_load): New function
8735 replacing add_output_section. Change all callers to call this or
8736 add_output_section_to_nonload.
8737 (Output_segment::add_output_section_to_nonload): New function.
8738 (Output_segment::remove_output_section): Rewrite.
8739 (Output_segment::add_initial_output_data): Likewise.
8740 (Output_segment::has_any_data_sections): Likewise.
8741 (Output_segment::is_first_section_relro): Likewise.
8742 (Output_segment::maximum_alignment): Likewise.
8743 (Output_segment::has_dynamic_reloc): New function replacing
8744 dynamic_reloc_count. Change all callers.
8745 (Output_segment::has_dynamic_reloc_list): New function replacing
8746 dynamic_reloc_count_list. Change all callers.
8747 (Output_segment::set_section_addresses): Rewrite.
8748 (Output_segment::set_offset): Rewrite.
8749 (Output_segment::find_first_and_last_list): Remove.
8750 (Output_segment::set_tls_offsets): Rewrite.
8751 (Output_segment::first_section_load_address): Likewise.
8752 (Output_segment::output_section_count): Likewise.
8753 (Output_segment::section_with_lowest_load_address): Likewise.
8754 (Output_segment::write_section_headers): Likewise.
8755 (Output_segment::print_sections_to_map): Likewise.
8756 * output.h (class Output_data): Remove dynamic_reloc_count_
8757 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8758 (Output_data::add_dynamic_reloc): Rewrite.
8759 (Output_data::has_dynamic_reloc): New function.
8760 (Output_data::dynamic_reloc_count): Remove.
8761 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8762 is_last_relro_, is_first_non_relro_, is_interp_,
8763 is_dynamic_linker_section_ fields. Add order and set_order
8764 functions. Remove is_relro_local, set_is_relro_local,
8765 is_last_relro, set_is_last_relro, is_first_non_relro,
8766 set_is_first_non_relro functions, is_interp, set_is_interp,
8767 is_dynamic_linker_section, and set_is_dynamic_linker_section
8768 functions.
8769 (class Output_segment): Change Output_data_list from std::list to
8770 std:;vector. Add output_lists_ field. Remove output_data_ and
8771 output_bss_ fields. Update declarations.
8772
3ff2ccb0
ILT
87732010-08-02 Ian Lance Taylor <iant@google.com>
8774
8775 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8776 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8777 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8778
88a4108b
ILT
87792010-08-02 Ian Lance Taylor <iant@google.com>
8780
8781 PR 11855
8782 * script.cc (Script_options::Script_options): Initialize
8783 symbol_definitions_ and symbol_references_.
8784 (Script_options::add_symbol_assignment): Update
8785 symbol_definitions_ and symbol_references_.
8786 (Script_options::add_symbol_reference): New function.
8787 (script_symbol): New function.
8788 * script.h (class Script_options): Add symbol_definitions_ and
8789 symbol_references_ fields.
8790 (Script_options::referenced_const_iterator): New type.
8791 (Script_options::referenced_begin): New function.
8792 (Script_options::referenced_end): New function.
8793 (Script_options::is_referenced): New function.
8794 (Script_options::any_unreferenced): New function.
8795 * script-c.h (script_symbol): Declare.
8796 * yyscript.y (exp): Call script_symbol.
8797 * symtab.cc: Include "script.h".
8798 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8799 Change all callers. Check symbols referenced by scripts.
8800 (Symbol_table::add_undefined_symbols_from_command_line): Add
8801 layout parameter. Change all callers.
8802 (Symbol_table::do_add_undefined_symbols_from_command_line):
8803 Likewise. Break out loop body. Check symbols referenced by
8804 scripts.
8805 (Symbol_table::add_undefined_symbol_from_command_line): New
8806 function broken out of
8807 do_add_undefined_symbols_from_command_line.
8808 * symtab.h (class Symbol_table): Update declarations.
8809 * archive.cc: Include "layout.h".
8810 (Archive::should_include_member): Add layout parameter. Change
8811 all callers. Check for symbol mentioned in expression.
8812 * archive.h (class Archive): Update declaration.
8813 * object.cc (Sized_relobj::do_should_include_member): Add layout
8814 parameter.
8815 * object.h (Object::should_include_member): Add layout parameter.
8816 Change all callers.
8817 (Object::do_should_include_member): Add layout parameter.
8818 (class Sized_relobj): Update declaration.
8819 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8820 parameter.
8821 * dynobj.h (class Sized_dynobj): Update declaration.
8822 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8823 layout parameter.
8824 * plugin.h (class Sized_pluginobj): Update declaration.
8825
5f1ab67a
ILT
88262010-08-02 Ian Lance Taylor <iant@google.com>
8827
8828 PR 11866
8829 * output.cc (Output_segment::set_offset): Search for the first and
8830 last sections rather than assuming that the list is in order.
8831 (Output_segment::find_first_and_last_list): New function.
8832 * output.h (class Output_segment): Update declarations.
8833 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8834 (relro_strip_test_SOURCES): New variable.
8835 (relro_strip_test_DEPENDENCIES): New variable.
8836 (relro_strip_test_LDFLAGS): New variable.
8837 (relro_strip_test_LDADD): New variable.
8838 (relro_strip_test.so): New target.
8839
a8df5856
ILT
88402010-08-02 Ian Lance Taylor <iant@google.com>
8841
8842 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8843 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8844 (Target_i386::got_tlsdesc_section): New function.
8845 (Target_i386::got_section): Create space for GOT entries for
8846 TLSDESC relocations.
8847 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8848 R_386_TLS_GOTDESC.
8849 (Target_i386::Scan::global): Likewise.
8850 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8851 using TLSDESC GOT.
8852 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8853 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8854 (Target_x86_64::got_tlsdesc_section): New function.
8855 (Target_x86_64::got_section): Create space for GOT entries for
8856 TLSDESC relocations.
8857 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8858 R_386_TLS_GOTDESC.
8859 (Target_x86_64::Scan::global): Likewise.
8860 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8861 using TLSDESC GOT.
8862
0c10a0a6
ILT
88632010-08-02 Ian Lance Taylor <iant@google.com>
8864
8865 * testsuite/final_layout.sh: Use dc to convert from hex to
8866 decimal.
8867
41cbeecc
ST
88682010-07-29 Sriraman Tallam <tmsriram@google.com>
8869
8870 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8871 paramter to the call to gold::gc_process_relocs.
8872 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8873 paramter to the call to gold::gc_process_relocs.
8874 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8875 parameter to the call to gold::gc_process_relocs.
8876 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8877 template parameter to the call to gold::gc_process_relocs.
8878 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8879 paramter to the call to gold::gc_process_relocs.
8880 * gc.h (get_embedded_addend_size): New function.
8881 (gc_process_relocs): Save the size of the reloc for use by ICF.
8882 * icf.cc (get_section_contents): Get the addend from the text section
8883 for SHT_REL relocation sections.
8884 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8885 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8886 * int_encoding.h (read_from_pointer): New overloaded function.
8887 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8888 * testsuite/icf_sht_rel_addend_test.sh: New file.
8889 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8890 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8891
6ea55b82
RW
88922010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8893
8894 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8895 * Makefile.in: Regenerate.
8896 * testsuite/Makefile.in: Regenerate.
8897
9691462b
ILT
88982010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8899
8900 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8901 * gold/testsuite/debug_msg.cc: Likewise.
8902 * gold/testsuite/odr_violation1.cc
8903 * gold/testsuite/odr_violation2.cc
8904
76897331
CC
89052010-07-21 Cary Coutant <ccoutant@google.com>
8906
8907 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8908 string, and length fields.
8909 (Output_merge_string::Merged_strings_list): New type.
8910 (Output_merge_string::Merged_strings_lists): New typedef.
8911 (Output_merge_string): Replace merged_strings_ with
8912 merged_strings_lists_.
8913 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8914 Merged_strings_list per input object and section. Don't store pointer
8915 to the string. Don't store length with each merged string entry.
8916 (Output_merge_string::finalize_merged_data): Loop over list of merged
8917 strings lists. Recompute length of each merged string.
8918
78384e8f
CC
89192010-07-15 Cary Coutant <ccoutant@google.com>
8920
8921 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8922 here.
8923
783659f9
ILT
89242010-07-14 Ian Lance Taylor <iant@google.com>
8925
8926 * descriptors.cc (Descriptors::open): Report correct name in error
8927 message.
8928
131687b4
DK
89292010-07-13 Doug Kwan <dougkwan@google.com>
8930
8931 * arm.cc (Arm_input_section::Arm_input_section): For a
8932 SHT_ARM_EXIDX section, always keeps the input sections.
8933 (Arm_input_section::set_exidx_section_link): New method.
8934 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8935 has_errors_ to false.
8936 (Arm_exidx_input_section::has_errors,
8937 Arm_exidx_input_section::set_has_errors): New methods.
8938 (Arm_exidx_input_section::has_errors_): New data member.
8939 (Arm_relobj::get_exidx_shndx_list): New method.
8940 (Arm_output_section::append_text_sections_to_list): Do not skip
8941 section without SHF_EXECINSTR.
8942 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8943 errors.
2e702c99 8944 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8945 section header. Make error messages more verbose. Check for
8946 a non-executable section linked to an EXIDX section.
8947 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8948 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8949 check that there is no deferred EXIDX section if we exit early.
8950 Instead of not making an EXIDX section in case of an error, make one
8951 and set the has_errors flag of it.
8952 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8953 in a relocatable link.
8954 (Target_arm::do_relax): Look for the EXIDX output section instead of
8955 assuming that it is called .ARM.exidx.
2e702c99 8956 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8957 section list. Do not check for SHF_EXECINSTR section flags but
8958 skip any input section with errors.
8959 * output.cc (Output_section::Output_section): Initialize
8960 always_keeps_input_sections_ to false.
8961 (Output_section::add_input_section): Check for
8962 always_keeps_input_sections_.
8963 * output.h (Output_section::always_keeps_input_sections,
8964 Output_section::set_always_keeps_input_sections): New methods.
8965 (Output_section::always_keeps_input_sections): New data member.
8966
69517287
RÁE
89672010-07-13 Rafael Espindola <espindola@google.com>
8968
8969 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8970 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8971
82742395
ILT
89722010-07-13 Philip Herron <herron.philip@googlemail.com>
8973 Ian Lance Taylor <iant@google.com>
8974
8975 * output.h (Output_section_lookup_maps::add_merge_section):
8976 Correct check of whether value was inserted.
8977 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8978 (Output_section_lookup_maps::add_relaxed_input_section):
8979 Likewise.
8980 * arm.cc (Target_arm::got_section): Remove used local os.
8981 * i386.cc (Target_i386::got_section): Likewise.
8982 * x86_64.cc (Target_x86_64::got_section): Likewise.
8983 * sparc.cc (Target_sparc::got_section): Likewise.
8984 (Target_sparc::relocate): Remove unused local have_got_offset.
8985 * powerpc.cc (Target_powerpc::relocate): Likewise.
8986
f2d707b5
ILT
89872010-07-13 Ian Lance Taylor <iant@google.com>
8988
241531d6
ILT
8989 * compressed_output.cc (zlib_decompress): Fix signature in
8990 !HAVE_ZLIB_H case.
8991
f2d707b5
ILT
8992 * archive.cc (Archive::include_member): Unlock an external member
8993 of a thin archive. Don't bother to delete an object we know is
8994 NULL.
8995
a2e47362
CC
89962010-07-12 Cary Coutant <ccoutant@google.com>
8997
8998 * compressed_output.cc (zlib_decompress): New function.
8999 (get_uncompressed_size): New function.
9000 (decompress_input_section): New function.
9001 * compressed_output.h (get_uncompressed_size): New function.
9002 (decompress_input_section): New function.
9003 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9004 Handle compressed debug sections.
9005 * layout.cc (is_compressed_debug_section): New function.
9006 (Layout::output_section_name): Map compressed section names to
9007 canonical names.
9008 * layout.h (is_compressed_debug_section): New function.
9009 (is_debug_info_section): Recognize compressed debug sections.
9010 * merge.cc: Include compressed_output.h.
9011 (Output_merge_data::do_add_input_section): Handle compressed
9012 debug sections.
9013 (Output_merge_string::do_add_input_section): Handle compressed
9014 debug sections.
9015 * object.cc: Include compressed_output.h.
9016 (Sized_relobj::Sized_relobj): Initialize new data members.
9017 (build_compressed_section_map): New function.
9018 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9019 * object.h (Object::section_is_compressed): New method.
9020 (Object::do_section_is_compressed): New method.
9021 (Sized_relobj::Compressed_section_map): New type.
9022 (Sized_relobj::do_section_is_compressed): New method.
9023 (Sized_relobj::compressed_sections_): New data member.
9024 * output.cc (Output_section::add_input_section): Handle compressed
9025 debug sections.
9026 * reloc.cc: Include compressed_output.h.
9027 (Sized_relobj::write_sections): Handle compressed debug sections.
9028
ce279a62
CC
90292010-07-08 Cary Coutant <ccoutant@google.com>
9030
9031 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9032 weak when resolving to a dynamic def.
9033 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9034 for weak undef/dynamic def cases. Adjust callers.
9035 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9036 undef_binding_weak_.
9037 (Symbol_table::sized_write_globals): Adjust symbol binding.
9038 (Symbol_table::sized_write_symbol): Add binding parameter.
9039 * symtab.h (Symbol::set_undef_binding): New method.
9040 (Symbol::is_undef_binding_weak): New method.
9041 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9042 (Symbol_table::should_override): Add new parameter.
9043 (Symbol_table::sized_write_symbol): Add new parameter.
9044
9045 * testsuite/weak_undef_file1.cc: Add new test case.
9046 * testsuite/weak_undef_file2.cc: Fix header comment.
9047 * testsuite/weak_undef_test.cc: Add new test case.
9048
b2286c10
DK
90492010-06-29 Doug Kwan <dougkwan@google.com>
9050
9051 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9052 Initialize USE_SYMBOL_.
9053 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9054 definition.
9055 (Arm_reloc_property::uses_symbol_): New data member declaration.
9056 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9057 uses symbol value and symbol is undefined but not weakly undefined.
9058
4802450a
RÁE
90592010-06-28 Rafael Espindola <espindola@google.com>
9060
9061 * plugin.cc (Plugin::load): Use dlerror.
9062
e5ca47ba
ILT
90632010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9064
9065 * symtab.cc (detect_odr_violations): When reporting an ODR
9066 violation, report an object where the symbol is defined.
9067
8a75a161
DK
90682010-06-25 Doug Kwan <dougkwan@google.com>
9069
9070 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9071 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9072 definition.
9073 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9074 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9075 target hook to detect function points.
9076 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9077 * icf.h (Icf::check_section_for_function_pointers): Change type of
9078 parameter SECTION_NAME to const reference to std::string. Use
9079 target hook to determine if section may have unsafe pointers.
9080 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9081 method definition.
9082
42218b9f
RÁE
90832010-06-21 Rafael Espindola <espindola@google.com>
9084
9085 * fileread.cc (Input_file::find_fie): New
9086 (Input_file::open): Use Input_file::find_fie.
9087 * fileread.h (Input_file::find_fie): New
9088 * plugin.cc (set_extra_library_path): New.
9089 (Plugin::load): Add set_extra_library_path to the transfer vector.
9090 (Plugin_manager::set_extra_library_path): New.
9091 (Plugin_manager::add_input_file): Use the extra search path if set.
9092 (set_extra_library_path(): New.
9093 * plugin.h (Plugin_manager): Add set_extra_library_path and
9094 extra_search_path_.
9095
a0506cca
CC
90962010-06-19 Cary Coutant <ccoutant@google.com>
9097
9098 * layout.cc (gdb_sections): Add .debug_types.
9099 (lines_only_debug_sections): Likewise.
9100
6508b958
RÁE
91012010-06-18 Rafael Espindola <espindola@google.com>
9102
9103 * plugin.cc (add_input_file,add_input_library)
9104 (Plugin_manager::add_input_file): Make filename arguments const.
9105 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9106 const.
9107
3e235302
DK
91082010-06-16 Doug Kwan <dougkwan@google.com>
9109
9110 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9111 .ARM.attributes section if we have not merged any input
9112 attributes sections.
9113
106e8a6c
DK
91142010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9115
9116 * arm.cc: Allow combining objects with no EABI version
9117 information.
9118
91ff43fe
RÁE
91192010-06-15 Rafael Espindola <espindola@google.com>
9120
9121 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9122
68ed838c
ILT
91232010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9124
9125 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9126 (struct iovec): Correct !HAVE_READV definition.
9127
f3a2388f
CC
91282010-06-10 Cary Coutant <ccoutant@google.com>
9129
9130 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9131 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9132 reloc sections.
9133 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9134
9135 PR 11683
9136 * symtab.h (Symbol::is_placeholder): New member function.
9137 * target-reloc.h (relocate_section): Check for placeholder symbols.
9138
9139 * testsuite/Makefile.am (plugin_test_8): New test.
9140 (plugin_test_9): New test.
9141 * testsuite/Makefile.in: Regenerate.
9142
e1df38aa
NC
91432010-06-09 Nick Clifton <nickc@redhat.com>
9144
9145 * yyscript.y (input_list_element): Allow strings prefixed with
9146 the '-' character. Treat these as libraries.
9147 * script.cc (script_add_library): New function. Adds a library
9148 specified by "-l<name>" found in an input script.
9149 * script-c.h: Add prototype for script_add_library.
9150
25bbe950
DK
91512010-06-07 Doug Kwan <dougkwan@google.com>
9152
9153 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9154 Restrict stub-group size to be within long conditional branch
9155 range when working around cortex-A8 erratum.
9156
0f32ea4c
ILT
91572010-06-07 Damien Diederen <dd@crosstwine.com>
9158
9159 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9160 #ifdef typo.
9161
8fe2a369
ST
91622010-06-03 Sriraman Tallam <tmsriram@google.com>
9163
9164 PR gold/11658
9165 * output.cc
9166 (Output_section::Input_section_sort_entry::compare_section_ordering):
9167 Change to return non-zero correctly.
9168 (Output_section::Input_section_sort_section_order_index_compare
9169 ::operator()): Change to fix ambiguity in comparisons.
9170
6e9ba2ca
ST
91712010-06-01 Sriraman Tallam <tmsriram@google.com>
9172
9173 * gold.h (is_wildcard_string): New function.
9174 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9175 (Layout::layout_eh_frame): Ditto.
9176 (Layout::find_section_order_index): New method.
9177 (Layout::read_layout_from_file): New method.
9178 * layout.h (Layout::find_section_order_index): New method.
9179 (Layout::read_layout_from_file): New method.
9180 (Layout::input_section_position_): New private member.
9181 (Layout::input_section_glob_): New private member.
9182 * main.cc (main): Call read_layout_from_file here.
9183 * options.h (--section-ordering-file): New option.
9184 * output.cc (Output_section::input_section_order_specified_): New
9185 member.
9186 (Output_section::Output_section): Initialize new member.
9187 (Output_section::add_input_section): Add new parameter.
9188 Keep input sections when --section-ordering-file is used.
9189 (Output_section::set_final_data_size): Sort input sections when
9190 section ordering file is specified.
9191 (Output_section::Input_section_sort_entry): Add new parameter.
9192 Check sorting type.
9193 (Output_section::Input_section_sort_entry::compare_section_ordering):
9194 New method.
9195 (Output_section::Input_section_sort_compare::operator()): Change to
9196 consider section_order_index.
9197 (Output_section::Input_section_sort_init_fini_compare::operator()):
9198 Change to consider section_order_index.
9199 (Output_section::Input_section_sort_section_order_index_compare
9200 ::operator()): New method.
9201 (Output_section::sort_attached_input_sections): Change to sort
9202 according to section order when specified.
e1df38aa
NC
9203 (Output_section::add_input_section<32, true>): Add new parameter.
9204 (Output_section::add_input_section<64, true>): Add new parameter.
9205 (Output_section::add_input_section<32, false>): Add new parameter.
9206 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9207 * output.h (Output_section::add_input_section): Add new parameter.
9208 (Output_section::input_section_order_specified): New
9209 method.
9210 (Output_section::set_input_section_order_specified): New method.
9211 (Input_section::Input_section): Initialize section_order_index_.
9212 (Input_section::section_order_index): New method.
9213 (Input_section::set_section_order_index): New method.
9214 (Input_section::section_order_index_): New member.
9215 (Input_section::Input_section_sort_section_order_index_compare): New
9216 struct.
9217 (Output_section::input_section_order_specified_): New member.
9218 * script-sections.cc (is_wildcard_string): Delete and move modified
9219 method to gold.h.
9220 (Output_section_element_input::Output_section_element_input): Modify
9221 call to is_wildcard_string.
9222 (Output_section_element_input::Input_section_pattern
9223 ::Input_section_pattern): Ditto.
9224 (Output_section_element_input::Output_section_element_input): Ditto.
9225 * testsuite/Makefile.am (final_layout): New test case.
9226 * testsuite/Makefile.in: Regenerate.
9227 * testsuite/final_layout.cc: New file.
9228 * testsuite/final_layout.sh: New file.
9229
3537c84b
RÁE
92302010-06-01 Rafael Espindola <espindola@google.com>
9231
9232 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9233
105b6afd
RÁE
92342010-06-01 Rafael Espindola <espindola@google.com>
9235
9236 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9237 visibility of symbols.
9238
29e11421
DK
92392010-05-27 Doug Kwan <dougkwan@google.com>
9240
9241 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9242 from start of output section instead of address for a local symbol
9243 in a merged or relaxed section when doing a relocatable link.
9244
5e0f337e
RÁE
92452010-05-26 Rafael Espindola <espindola@google.com>
9246
703d02da 9247 PR 11604
5e0f337e
RÁE
9248 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9249 adding sections the garbage collector removed.
9250 * gold/testsuite/Makefile.am: Add test.
9251 * gold/testsuite/Makefile.in: Regenerate.
9252 * gold/testsuite/plugin_test_7.sh: New.
9253 * gold/testsuite/plugin_test_7_1.c: New.
9254 * gold/testsuite/plugin_test_7_2.c: New.
9255
f4187277
RÁE
92562010-05-26 Rafael Espindola <espindola@google.com>
9257
9258 * script-sections.cc (Output_section_definition::set_section_addresses):
9259 Check for --section-start.
9260
5c388529
DK
92612010-05-26 Doug Kwan <dougkwan@google.com>
9262
9263 * arm.cc (Arm_scan_relocatable_relocs): New class.
9264 (Target_arm::relocate_special_relocatable): New method.
9265 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9266 (Arm_relocate_functions::thumb_branch_common): Same.
9267 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9268 instead of Default_scan_relocatable_relocs.
9269 * target-reloc.h (relocate_for_relocatable): Let target handle
9270 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9271 * target.h (Sized_target::relocate_special_relocatable): New method.
9272
bca1c3ae
ILT
92732010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9274
9275 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9276
0439c796
DK
92772010-05-23 Doug Kwan <dougkwan@google.com>
9278
9279 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9280 instead of a cast.
9281 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9282 with a direct branch, not a conditional branch, to a stub.
9283 * merge.cc (Output_merge_base::record_input_section): New method
9284 defintion.
9285 (Output_merge_data::do_add_input_section): Record input section if
9286 keeps-input-sections flag is set.
9287 (Output_merge_string::do_add_input_section): Ditto.
9288 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9289 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9290 INPUT_SECTIONS_.
9291 (Output_merge_base::keeps_input_sections,
9292 Output_merge_base::set_keeps_input_sections,
9293 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9294 method definitions.
9295 (Output_merge_base::Input_sections): New type declaration.
9296 (Output_merge_base::input_sections_begin,
9297 Output_merge_base::input_sections_end,
9298 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9299 (Output_merge_base::bool keeps_input_sections_,
9300 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9301 Output_merge_base::input_sections_): New data members.
9302 (Output_merge_data::do_set_keeps_input_sections): New method
9303 defintion.
9304 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9305 * output.cc (Output_section::Input_section::relobj): Move method
9306 defintion from class declaration to here and handle merge sections.
9307 (Output_section::Input_section::shndx): Ditto.
9308 (Output_section::Output_section): Remove initializations of removed
9309 data members and initialize new data member LOOKUP_MAPS_.
9310 (Output_section::add_input_section): Set keeps-input-sections flag
9311 for a newly created merge output section as appropriate. Adjust code
9312 to use Output_section_lookup_maps class.
9313 (Output_section::add_relaxed_input_section): Adjst code for lookup
9314 maps code refactoring.
2e702c99 9315 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9316 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9317 class. If adding input section to a newly created merge output
9318 section fails, remove the new merge section.
9319 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9320 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9321 (Output_section::find_merge_section): Ditto.
0439c796 9322 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9323 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9324 Output_section_lookup_maps class.
9325 (Output_section::get_input_sections): Export merge sections. Adjust
9326 code to use Output_section_lookup_maps class.
9327 (Output_section:::add_script_input_section): Adjust code to use
9328 Output_section_lookup_maps class. Update lookup maps for merge
9329 sections also.
9330 (Output_section::discard_states): Use Output_section_lookup_maps.
9331 (Output_section::restore_states): Same.
9332 * output.h (Merge_section_properties): Move class defintion out of
9333 Output_section.
9334 (Output_section_lookup_maps): New class.
9335 (Output_section::Input_section::is_merge_section): New method
9336 defintion.
9337 (Output_section::Input_section::relobj): Move defintion out of class
9338 defintion. Declare method only.
9339 (Output_section::Input_section::shndx): Ditto.
9340 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9341 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9342 (Output_section::Merge_section_by_properties_map,
9343 Output_section::Output_section_data_by_input_section_map,
9344 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9345 Remove types.
2e702c99 9346 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9347 KEEPS_INPUT_SECTIONS.
9348 (Output_section::build_lookup_maps): New method declaration.
9349 (Output_section::merge_section_map_,
9350 Output_section::merge_section_by_properties_map_,
9351 Output_section::relaxed_input_section_map_,
9352 Output_section::is_relaxed_input_section_map_valid_): Remove data
9353 members.
9354 (Output_section::lookup_maps_): New data member.
9355
76295588
L
93562010-05-21 Doug Kwan <dougkwan@google.com>
9357
9358 PR gold/11619
9359 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9360 avoid a compilation error.
9361
d103a984
RÁE
93622010-05-19 Rafael Espindola <espindola@google.com>
9363
9364 * script-sections.cc (Output_section_definition::allocate_to_segment):
9365 Update the phdrs_list even when the output section is NULL.
9366 * testsuite/Makefile.am: Add test.
9367 * testsuite/Makefile.in: Regenerate.
9368 * testsuite/script_test_9.cc: New.
9369 * testsuite/script_test_9.sh: New.
9370 * testsuite/script_test_9.t: New.
9371
6625d24e
DK
93722010-05-19 Doug Kwan <dougkwan@google.com>
9373
9374 * arm.cc (Arm_input_section::original_size): New method.
9375 (Arm_input_section::do_addralign): Add a cast.
9376 (Arm_input_section::do_output_offset): Remove static cast.
9377 (Arm_input_section::original_addralign,
9378 Arm_input_section::original_size_): Change type to uint32_t.
9379 (Arm_input_section::init): Add safe casts for section alignment
9380 and size.
9381 (Arm_input_section::set_final_data_size): Do not set address and
9382 offset of stub table.
9383 (Arm_output_section::fix_exidx_coverage): Change use of of
9384 Output_section::Simple_input_section to that of
9385 Output_section::Input_section.
9386 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9387 except for the first pass.
9388 * output.cc (Output_section::get_input_sections): Change type of
9389 input_sections to std::list<Input_section>.
9390 (Output_section::add_script_input_section): Rename from
9391 Output_section::add_simple_input_section. Change type of SIS
9392 parameter from Simple_input_section to Input_section.
9393 * output.h (Output_section::Simple_input_section): Remove class.
9394 (Output_section::Input_section): Change class visibility to public.
9395 (Output_section::Input_section::addralign): Use stored alignments
9396 for special input sections if set.
9397 (Output_section::Input_section::set_addralign): New method.
9398 (Output_section::get_input_sections): Change parameter type from
9399 list of Simple_input_section to list of Input_section.
9400 (Output_section::add_script_input_section): Rename from
9401 Output_section::add_simple_input_section. Change first parameter's
9402 type from Simple_input_section to Input_section and remove the
9403 second and third parameters.
9404 * script-sections.cc (Input_section::Input_section_list): Change
9405 type to list of Output_section::Input_section/
9406 (Input_section_info::Input_section_info): Change parameter type of
9407 INPUT_SECTION to Output_section::Input_section.
9408 (Input_section_info::input_section): Change return type.
9409 (Input_section_info::input_section_): Change type to
9410 Output_section::Input_section.
9411 (Output_section_element_input::set_section_addresses): Adjust code
9412 to use Output_section::Input_section instead of
9413 Output_section::Simple_input_section. Adjust code for renaming
9414 of Output_section::add_simple_input_section.
9415 (Orphan_output_section::set_section_addresses): Ditto.
9416
e1e82ea4
RW
94172010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9418
9419 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9420 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9421
91e75c8a
RÁE
94222010-05-18 Rafael Espindola <espindola@google.com>
9423
9424 * options.cc (General_options::finalize): Handle -nostdlib.
9425 * options.h (nostdlib): New option.
9426 * script.cc (script_add_search_dir): Handle -nostdlib.
9427
da59ad79
DK
94282010-05-12 Doug Kwan <dougkwan@google.com>
9429
9430 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9431 attributes section only if there no attributes section after merging.
9432 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9433 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9434 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9435 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9436 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9437 and arm_attr_merge_7.stdout.
9438 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9439 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9440 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9441 arm_attr_merge_7b.o): New rules.
9442 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9443 arm_attr_merge_7
9444 * testsuite/Makefile.in: Regenerate.
9445 * testsuite/arm_attr_merge.sh: New file.
9446 * testsuite/arm_attr_merge_[67][ab].s: Same.
9447
3e01a7fd
NC
94482010-05-05 Nick Clifton <nickc@redhat.com>
9449
9450 * po/es.po: Updated Spanish translation.
9451
7ad2014a
L
94522010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9453
9454 * Makefile.am (install-exec-local): Properly install gold as
9455 default cross linker.
9456 * Makefile.in: Regenerated.
9457
4fda8867
NC
94582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9459 Nick Clifton <nickc@redhat.com>
9460
9461 * configure.ac (install_as_default): Define and set to false
9462 unless --enable-gold or --enable-gold=both/gold has been
9463 specified.
9464 * configure: Regenerate.
9465
9466 * Makefile.am (install-exec-local): Install the executable as
9467 'ld.gold'. If install_as_default is true then also install it as
9468 'ld'.
9469 * Makefile.in: Regenerated.
9470
bd288ea2
ILT
94712010-04-24 Ian Lance Taylor <iant@google.com>
9472
9473 * layout.cc (Layout::layout_reloc): In relocatable link don't
9474 combine reloc sections for grouped sections.
9475
ef38fd8a
ST
94762010-04-23 Sriraman Tallam <tmsriram@google.com>
9477
9478 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9479 sections that are not ordinary to icf.
9480 * icf.cc (get_section_contents): Handle relocation pointing to section
9481 with no object or shndx information.
9482 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9483 * testsuite/Makefile.in: Regenerate.
9484 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9485 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9486
f6973bdc
ILT
94872010-04-22 Ian Lance Taylor <iant@google.com>
9488
9489 * expression.cc (Expression::Expression_eval_info): Add
9490 result_alignment_pointer field.
9491 (Expression::eval_with_dot): Add result_alignment_pointer
9492 parameter. Change all callers.
9493 (Expression::eval_maybe_dot): Likewise.
9494 (class Binary_expression): Add alignment_pointer parameter to
9495 left_value and right_value. Change all callers.
9496 (BINARY_EXPRESSION): Set result alignment.
9497 (class Trinary_expression): Add alignment_pointer parameter to
9498 arg2_value and arg3_value. Change all callers.
9499 (Trinary_cond::value): Set result alignment.
9500 (Max_expression::value, Min_expression::value): Likewise.
9501 (Align_expression::value): Likewise.
9502 * script-sections.cc (class Sections_element): Add dot_alignment
9503 parameter to set_section_addresses virtual function. Update
9504 instantiations.
9505 (class Output_section_element): Likewise.
9506 (Script_sections::create_segments): Add dot_alignment parameter.
9507 Change all callers.
9508 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9509 (Script_sections::set_phdrs_clause_addresses): Likewise.
9510 * script-sections.h: Update declarations.
9511 * script.h: Update declarations.
9512 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9513 min_p_align.
9514 * testsuite/script_test_3.t: Set large alignment.
9515 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9516 segment has expected alignment.
9517
9c9c98a5
NC
95182010-04-22 Nick Clifton <nickc@redhat.com>
9519
9520 * po/gold.pot: Updated by the Translation project.
9521 * po/vi.po: Updated Vietnamese translation.
9522
2253bfba
L
95232010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9524
9525 * testsuite/Makefile.am (check_PROGRAMS): Add
9526 icf_virtual_function_folding_test.
9527 * testsuite/Makefile.in: Regenerated.
9528
85fdf906
AH
95292010-04-15 Andrew Haley <aph@redhat.com>
9530
9531 * options.h (merge_exidx_entries): New option.
9532 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9533 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9534 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9535 (Target_arm::merge_exidx_entries): New function.
9536 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9537 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9538 to Arm_exidx_fixup constructor.
9539 Add new arg, merge_exidx_entries.
9540 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9541 Arm_output_section::fix_exidx_coverage.
9542
ce97fa81
ST
95432010-04-18 Sriraman Tallam <tmsriram@google.com>
9544
9545 * icf.cc (get_section_contents): Check for preemptible functions.
9546 Ignore addend when appropriate.
9547 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9548 section folded.
9549 (add_from_relobj): Check for section folded.
9550 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9551 * symtab.h (should_add_dynsym_entry): Add new parameter.
9552 * target-reloc.h (scan_relocs): Check for section folded.
9553 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9554 Check reloc types for function pointers in shared objects.
9555 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9556 case.
9557 (icf_preemptible_functions_test): New test case.
9558 (icf_string_merge_test): New test case.
9559 * testsuite.Makefile.in: Regenerate.
9560 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9561 bar_glob. Refactor code.
9562 * testsuite/icf_preemptible_functions_test.cc: New file.
9563 * testsuite/icf_preemptible_functions_test.sh: New file.
9564 * testsuite/icf_string_merge_test.cc: New file.
9565 * testsuite/icf_string_merge_test.sh: New file.
9566 * testsuite/icf_virtual_function_folding_test.cc: New file.
9567 * testsuite/icf_virtual_function_folding_test.sh: New file.
9568
04ceb17c
DK
95692010-04-14 Doug Kwan <dougkwan@google.com>
9570
9571 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9572 for local symbol recounting if we remove a section due to ICF.
9573 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9574 there are no regular objects in input.
9575
153e7da4
DK
95762010-04-13 Doug Kwan <dougkwan@google.com>
9577
9578 * arm.cc (Arm_input_section::set_final_data_size): Compute
9579 accurate final data size instead of using current data size.
9580
4dbd9faf
DK
95812010-04-09 Doug Kwan <dougkwan@google.com>
9582
9583 * layout.cc (Layout::choose_output_section): Handle script section
9584 types.
9585 (Layout::make_output_section_for_script): Add section type parameter.
9586 Handle script section types.
9587 * layout.h (Layout::make_output_section_for_script): Add section
9588 type parameter.
9589 * output.cc (Output_section::Output_section): Initialize data member
9590 is_noload_.
9591 (Output_section::do_reset_address_and_file_offset): Do not set address
9592 to 0 if section is a NOLOAD section.
9593 * output.h (Output_section::is_noload): New method.
9594 (Output_section::set_is_noload): Ditto.
9595 (Output_section::is_noload_): New data member.
9596 * script-c.h (Script_section_type): New enum type.
9597 (struct Parser_output_section_header): Add new file section_type.
9598 * script-sections.cc (Sections_element::output_section_name): Add
9599 parameter for returning script section type.
9600 (Output_section_definition::output_section_name): Ditto.
9601 (Output_section_definition::section_type)P; New method.
9602 (Output_section_definiton::script_section_type_name): Ditto.
9603 (Output_section_definition::script_section_type_): New data member.
9604 (Output_section_definition::Output_section_definition): Initialize
9605 data member Output_section_definition::script_section_type_.
9606 (Output_section_definition::create_sections): Pass script section type
9607 to Layout::make_output_section_for_script.
9608 (Output_section_definition::output_section_name): Return script
9609 section type to caller.
9610 (Output_section_definition::set_section_address): Do not advance
9611 dot value and load address if section type is NOLOAD. Set address
9612 of NOLOAD sections regardless of section flags.
9613 (Output_section_definition::print): Print section type if it is
9614 not SCRIPT_SECTION_TYPE_NONE.
9615 (Output_section_definition::section_type): New method.
9616 (Output_section_definition::script_section_type_name): Ditto.
9617 (Script_sections::output_section_name): Add new parameter
9618 PSECTION_TYPE for returning script section type. Pass it to
9619 section elements. Handle discard sections.
9620 (Sort_output_sections::operator()): Handle NOLOAD sections.
9621 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9622 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9623 returning script section type.
9624 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9625 INFO and NOLOAD.
9626 * yyscript.y (union): Add new field SECTION_TYPE.
9627 (COPY, DSECT, INFO, NOLOAD): New tokens.
9628 (opt_address_and_section_type): Change type to output_section_header.
9629 (section_type): New non-terminal
9630 (section_header): Handle section type.
2253bfba 9631 (opt_address_and_section_type): Return section type value.
4dbd9faf 9632
721ea635
L
96332010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9634
9635 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9636 * testsuite/plugin_common_test_2.c (foo): Likewise.
9637
6bf924b0
DK
96382010-04-08 Doug Kwan <dougkwan@google.com>
9639
9640 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9641 Output_merge_data.
9642 * output.cc (Output_section::add_merge_input_section): Simplify
9643 code and return status of Output_merge_base::add_input_section.
e1df38aa 9644 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9645 returns true.
9646
24af6f92
DK
96472010-04-07 Doug Kwan <dougkwan@google.com>
9648
9649 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9650 if section is marked as containing instructions but has no mapping
9651 symbols.
9652 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9653 correct section index.
9654 (Arm_relobj::find_linked_text_section): Ditto.
9655
00698fc5
CC
96562010-04-07 Cary Coutant <ccoutant@google.com>
9657
9658 * archive.cc (include_member): Destroy Read_symbols_data object before
9659 releasing file.
9660 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9661 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9662 (Read_symbols_data::~Read_symbols_data) New destructor.
9663 (Section_relocs::Section_relocs) New constructor.
9664 (Section_relocs::~Section_relocs) New destructor.
9665 (Read_relocs_data::Read_relocs_data) New constructor.
9666 (Read_relocs_data::~Read_relocs_data) New destructor.
9667 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9668 pointers to NULL after deleting.
9669
7296d933
DK
96702010-04-07 Doug Kwan <dougkwan@google.com>
9671
9672 * arm.cc: Replace "endianity" with "endianness" in comments.
9673 (Arm_exidx_cantunwind): Ditto.
9674 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9675 (Arm_relobj::merge_flags_and_attributes): New method.
9676 (Arm_relobj::merge_flags_and_attributes_): New data member.
9677 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9678 (Arm_relobj::scan_sections_for_stubs): Ditto.
9679 (Arm_relobj::do_read_symbols): Check to see if we really want to
9680 merge processor-specific flags and attributes. Exit early if
9681 an object is empty except for section names and the undefined symbol.
9682 (Target_arm::do_finalize_sections): Move check for ELF format to
9683 Arm_relobj::do_read_symbols. Merge processor specific flags and
9684 attributes from a regular object only when we have determined that
9685 it is aapropriate. Do not create an .ARM.attributes section in
9686 output if there is no regular input object.
9687 (Target_arm::merge_processor_specific_flags): Check
9688 --warn-mismatch before printing any error.
9689 (Target_arm::merge_object_attributes): Ditto.
9690 * gold.cc (queue_middle_tasks): Handle the case in which there is
9691 no regular object in input.
9692 * options.cc (General_options::parse_EB): New method.
9693 (General_options::parse_EL): Same.
9694 (General_options::General_options): Initialize endianness_.
9695 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9696 New options.
9697 (General_options::Endianness): New enum.
9698 (General_options::endianness): New method.
9699 (General_options::endianness_): New data member.
9700 * parameters.cc (Parameters::set_options): Check target endianness.
9701 (Parameters::set_target_once): Ditto.
9702 (Parameters::check_target_endianness): New method.
9703 (parameters_force_valid_target): If either -EL or -EB is specified,
9704 use it to define endianness of default target.
9705 * parameters.h (Parameters::check_target_endianness): New method
9706 declaration.
9707 * target.h (class Target): Change "endianity" to "endianness"
9708 in comments.
9709
efc8d4f2
RW
97102010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9711
9712 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9713 * configure: Regenerate.
9714 * Makefile.in: Regenerate.
9715 * testsuite/Makefile.in: Regenerate.
9716
be234d88
CC
97172010-04-06 Cary Coutant <ccoutant@google.com>
9718
9719 gcc PR lto/42757
9720 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9721 prevailing definitions of common symbols.
9722 * testsuite/plugin_test_6.sh: New test case.
9723 * testsuite/plugin_common_test_1.c: New test case.
9724 * testsuite/plugin_common_test_2.c: New test case.
9725 * testsuite/Makefile.am (plugin_test_6): New test case.
9726 * testsuite/Makefile.in: Regenerate.
9727
bd32c6bd
NC
97282010-04-06 Nick Clifton <nickc@redhat.com>
9729
9730 * po/vi.po: New Vietnamese translation.
9731
323c532f
DK
97322010-03-30 Doug Kwan <dougkwan@google.com>
9733
9734 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9735
4fcd97eb
DK
97362010-03-25 Doug Kwan <dougkwan@google.com>
9737
9738 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9739 to avoid a conversion warning on a 32-bit host.
9740
4ebf39db
ILT
97412010-03-24 Ian Lance Taylor <iant@google.com>
9742
9743 * testsuite/script_test_3.t: Add a TLS segment.
9744 * testsuite/Makefile.am (check_PROGRAMS): Add
9745 tls_phdrs_script_test.
9746 (tls_phdrs_script_test_SOURCES): Define.
9747 (tls_phdrs_script_test_DEPENDENCIES): Define.
9748 (tls_phdrs_script_test_LDFLAGS): Define.
9749 (tls_phdrs_script_test_LDADD): Define.
9750 * testsuite/Makefile.in: Rebuild.
9751
4a599bdd
CC
97522010-03-23 Cary Coutant <ccoutant@google.com>
9753
9754 * fileread.cc (find_or_make_view): Fix comment.
9755
6c93b22c
ILT
97562010-03-23 Ian Lance Taylor <iant@google.com>
9757
9758 * script-sections.cc (class Orphan_section_placement): Define
9759 PLACE_TLS and PLACE_TLS_BSS.
9760 (Orphan_section_placement::Orphan_section_placement): Initialize
9761 new places.
9762 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9763 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9764 (tls_script_test_SOURCES): Define.
9765 (tls_script_test_DEPENDENCIES): Define.
9766 (tls_script_test_LDFLAGS): Define.
9767 (tls_script_test_LDADD): Define.
9768 * testsuite/Makefile.in: Rebuild.
9769
a2c7281b
DK
97702010-03-22 Doug Kwan <dougkwan@google.com>
9771
9772 * arm.cc (Arm_relocate_functions::abs8,
9773 Arm_relocate_functions::abs16): Use correct check for overflow
9774 specified in the ARM ELF specs.
9775 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9776 target of a BLX instruction specially.
9777 (Reloc_stub::stub_type_for_reloc): Ditto.
9778 (Relocate::relocate): Use symbolic names instead of numeric relocation
9779 codes to report error.
9780 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9781 workaround.
9782 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9783 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9784 thumb2_blx_out_of_range.stdout
9785 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9786 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9787 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9788 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9789 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9790 thumb2_blx_in_range, thumb2_blx_in_range.o,
9791 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9792 thumb2_blx_out_of_range.o): New rules.
2e702c99 9793 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9794 thumb2_blx_in_range and thumb2_blx_out_of_range.
9795 * testsuite/Makefile.in: Regenerate.
9796 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9797 * testsuite/thumb_blx_in_range.s: New file.
9798 * testsuite/thumb_blx_out_of_range.s: New file.
9799
b0193076
RÁE
98002010-03-22 Rafael Espindola <espindola@google.com>
9801
9802 * archive.cc (Should_include): Move to archive.h.
9803 (should_include_member): Make it a member of Archive.
9804 (Lib_group): New.
9805 (Add_lib_group_symbols): New.
9806 * archive.h: Include options.h.
9807 (Archive_member): Moved from Archive.
9808 (Should_include): Moved from archive.cc.
9809 (Lib_group): New.
9810 (Add_lib_group_symbols): New.
9811 * dynobj.cc (do_should_include_member): New.
9812 * dynobj.h (do_should_include_member): New.
9813 * gold.cc (queue_initial_tasks): Update call to queue.
9814 * main.cc (main): Print lib group stats.
9815 * object.cc (do_should_include_member): New.
9816 * object.h: Include archive.h.
9817 (Object::should_include_member): New.
9818 (Object::do_should_include_member): New.
9819 (Sized_relobj::do_should_include_member): New.
9820 * options.cc (General_options::parse_start_lib): New.
9821 (General_options::parse_end_lib): New.
9822 (Input_arguments::add_file): Handle lib groups.
9823 (Input_arguments::start_group): Check we are not in a lib.
9824 (Input_arguments::start_lib): New.
9825 (Input_arguments::end_lib): New.
9826 * options.h (General_options): Add start_lib and end_lib.
9827 (Input_argument::lib_): New.
9828 (Input_argument::lib): New.
9829 (Input_argument::is_lib): New.
9830 (Input_file_lib): New.
9831 (Input_arguments::in_lib_): New.
9832 (Input_arguments::in_lib): New.
9833 (Input_arguments::start_lib): New.
9834 (Input_arguments::end_lib_): New.
9835 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9836 in unused members as preempted.
9837 (Sized_pluginobj::do_should_include_member): New.
9838 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9839 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9840 return the blocker.
9841 (Read_symbols::do_whole_lib_group): New.
9842 (Read_symbols::do_lib_group): New.
9843 (Read_symbols::do_read_symbols): Handle lib groups.
9844 (Read_symbols::get_name): Handle lib groups.
9845 * readsyms.h (Read_symbols): Add an archive member pointer.
9846 (Read_symbols::do_whole_lib_group): New.
9847 (Read_symbols::do_lib_group): New.
9848 (Read_symbols::member_): New.
9849 * script.cc (read_input_script): Update call to queue_soon.
9850
d099120c
DK
98512010-03-19 Doug Kwan <dougkwan@google.com>
9852
9853 * arm.cc (Stub_table::Stub_table): Initialize new data members
9854 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9855 (Stub_table::add_reloc_stub): Assign stub offset and update
9856 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9857 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9858 New data members.
2e702c99 9859 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9860 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9861 instead of going over all reloc stubs.
2e702c99 9862 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9863 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9864 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9865 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9866 Stringpool_template::offset_.
9867 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9868 Stringpool_template::offset_ to zero.
9869
1aa37384
DK
98702010-03-15 Doug Kwan <dougkwan@google.com>
9871
9872 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9873 offset_.
9874 (Stringpool_template::new_key_offset): New method.
9875 (Stringpool_template::add_string): Assign offsets when adding new
9876 strings.
9877 (Stringpool_template::set_string_offsets): Do not set string offsets
9878 when not optimizing.
9879 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9880 member size_.
2e702c99
RM
9881 (Chunked_vector::clear): Clear size_.
9882 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9883 (Chunked_vector::size): Return size_.
9884 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9885 (Chunked_vector::size_): New data member.
1aa37384
DK
9886 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9887 (Stringpool_template::new_key_offset): New method declaration.
9888 (Stringpool_template::offset_): New data member.
9889
b672b057
RÁE
98902010-03-15 Rafael Espindola <espindola@google.com>
9891
9892 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9893 Add_symbols' constructor.
9894 * readsyms.h (Add_symbols): Remove the input_group member.
9895
b6848d3c
ILT
98962010-03-10 Ian Lance Taylor <iant@google.com>
9897
9898 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9899 target to ask whether a reference to a symbol requires a stack
9900 split.
9901 * target.h (Target::is_call_to_non_split): New function.
9902 (Target::do_is_call_to_non_split): Declare virtual function.
9903 * target.cc: Include "symtab.h".
9904 (Target::do_is_call_to_non_split): New function.
9905 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9906
a2a5469e
CC
99072010-03-10 Cary Coutant <ccoutant@google.com>
9908
9909 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9910 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9911 (File_read::open[2]): Add whole_file_view_ to list of views.
9912 (File_read::make_view): Remove test of whole_file_view_.
9913 (File_read::find_or_make_view): Create whole_file_view_ if
9914 necessary.
9915 (File_read::clear_views): Replace bool parameter with enum;
9916 adjust all callers. Don't delete views with permanent data;
9917 do delete cached views and views from archives if
9918 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9919 if clearing the corresponding view.
9920 * fileread.h (File_read::Clear_views_mode): New enum.
9921 (File_read::View::is_permanent_view): New method.
9922 (File_read::clear_views): Replace bool parameter
9923 with enum; adjust all callers.
9924 * options.h (General_options): Change keep_files_mapped option;
9925 add map_whole_files.
9926 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9927 releasing the file.
9928 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9929 the file.
9930
8861f32b
DM
99312010-03-10 David S. Miller <davem@davemloft.net>
9932
9933 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9934
d62d0f5f
ST
99352010-03-09 Sriraman Tallam <tmsriram@google.com>
9936
9937 * icf.cc (get_section_contents): Add '@' marker after processing the
9938 merge reloc.
9939
9177756d
DK
99402010-03-08 Doug Kwan <dougkwan@google.com>
9941
9942 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9943 due to a conversion warning.
9944 (Arm_relobj::update_output_local_symbol_count): Check for local
9945 symbol with unset output index.
9946
9e9e071b
ILT
99472010-03-05 Ian Lance Taylor <iant@google.com>
9948
9949 * options.h (class General_options): Add --spare-dynamic-tags.
9950 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9951 --spare-dynamic-tags.
9952
a81ee015
ILT
99532010-03-05 Ian Lance Taylor <iant@google.com>
9954
9955 * incremental.cc: Include "libiberty.h".
9956
44ec90b9
RO
99572010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9958
9959 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9960 function, is_info_ member.
9961 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9962 (Versions::Versions): Update caller.
9963 (Versions::define_base_version): Likewise.
9964 (Versions::add_def): Likewise.
9965
0897ed3b
ST
99662010-03-03 Sriraman Tallam <tmsriram@google.com>
9967
9968 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9969 (Scan::possible_function_pointer_reloc): New function.
9970 (Scan::local_reloc_may_be_function_pointer): Change to call
9971 possible_function_pointer_reloc.
9972 (Scan::global_reloc_may_be_function_pointer): Ditto.
9973 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9974 relocations in ".data.rel.ro._ZTV" section.
9975 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9976 * testsuite/icf_safe_so_test.cc: Ditto.
9977 * testsuite/icf_safe_test.cc: Ditto.
9978 * testsuite/icf_safe_test.sh: Ditto.
9979
d3bbad62
ILT
99802010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9981 Ian Lance Taylor <iant@google.com>
9982
9983 * target-reloc.h (relocate_section): Check the symbol table index
9984 for -1U before setting the local symbol index.
9985 (scan_relocatable_relocs): If copying the relocation, record that
9986 the local symbol is required.
9987 * object.h (Symbol_value::is_output_symtab_index_set): New
9988 function.
9989 (Symbol_value::may_be_discarded_from_output_symtab): New
9990 function.
9991 (Symbol_value::has_output_symtab_entry): New function.
9992 (Symbol_value::needs_output_symtab_entry): Remove.
9993 (Symbol_value::output_symtab_index): Make sure the symbol index is
9994 set.
9995 (Symbol_value::set_output_symtab_index): Make sure the symbol
9996 index is not set. Make sure the new index is valid.
9997 (Symbol_value::set_must_have_output_symtab_entry): New function.
9998 (Symbol_value::has_output_dynsym_entry): New function.
9999 (Symbol_value::set_output_dynsym_index): Make sure the new index
10000 is valid.
10001 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10002 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10003 local symbol if permitted.
10004 (Sized_relobj::do_finalize_local_symbols): Call
10005 is_output_symtab_index_set rather than needs_output_symtab_entry.
10006 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10007 rather than needs_output_symtab_entry. Call
10008 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10009 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10010 is_output_symtab_index_set rather than needs_output_symtab_entry.
10011 * testsuite/discard_locals_relocatable_test.c: New file.
10012 * testsuite/discard_locals_test.sh: Test -r.
10013 * testsuite/Makefile.am (check_DATA): Add
10014 discard_locals_relocatable_test1.syms,
10015 discard_local_relocatable_test2.syms.
10016 (MOSTLYCLEANFILES): Likewise. Also add
10017 discard_locals_relocatable_test1.lout and
10018 discard_locals_relocatable_test2.out.
10019 (discard_locals_relocatable_test1.syms): New target.
10020 (discard_locals_relocatable_test.o): New target.
10021 (discard_locals_relocatable_test1.out): New target.
10022 (discard_locals_relocatable_test2.syms): New target.
10023 (discard_locals_relocatable_test2.out): New target.
10024 (various): Add missing ../ld-new dependencies.
10025 * testsuite/Makefile.in: Rebuild.
10026
7e8ccf26
NC
100272010-03-03 Nick Clifton <nickc@redhat.com>
10028
10029 * po/fi.po: New Finnish translation.
10030
2a0ff005
DK
100312010-03-01 Doug Kwan <dougkwan@google.com>
10032
10033 * layout.cc (Layout::Layout): Force section types of .init_array*,
10034 .preinit_array* and .fini_array* sections.
10035 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10036 Fix check of return value of std::string::find.().
10037 (Output_section::Input_section_sort_compare::operator()): Remove
10038 comment about .init_array.
10039 (Output_section::Input_section_sort_init_fini_compare::operator()):
10040 New method.
10041 (Output_section::sort_attached_input_sections): Handle .init_array
10042 and .fini_array specially.
10043 * output.h (Output_section::Inut_section_sort_compare): Update
10044 comment.
10045 (Output_section::Input_section_sort_init_fini_compare): New struct.
10046
c3e4ae29
DK
100472010-02-26 Doug Kwan <dougkwan@google.com>
10048
10049 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10050 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10051 * testsuite/debug_msg.sh: Avoid matching source line number for
10052 use of global variable undef_int.
10053
2fd9ae7a
DK
100542010-02-26 Doug Kwan <dougkwan@google.com>
10055
10056 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10057 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10058 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10059 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10060 * options.cc (General_options::General_options): Initialize member
10061 fix_v4bx_.
10062 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10063 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10064 and rm_no_fix_v4bx.stdout
10065 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10066 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10067 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10068 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10069 and arm_no_fix_v4bx.
10070 * Makefile.in: Regenerate.
10071 * testsuite/arm_fix_v4bx.s: New file.
10072 * testsuite/arm_fix_v4bx.sh: Ditto.
10073
67ec7d0b
DK
100742010-02-24 Doug Kwan <dougkwan@google.com>
10075
10076 * arm.cc (Target_arm::got_section): Make the .got section the first
10077 non RELRO section in the data segment.
10078 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10079 suffixes of section names.
10080
10165461
DK
100812010-02-24 Doug Kwan <dougkwan@google.com>
10082
10083 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10084 flags and attributes merging if an input file is a binary file.
10085 * fileread.cc (Input_file::open): Record format of original file.
10086 * fileread.h (Input_file::Format): New enum type.
2e702c99 10087 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10088 (Input_file::format): New method definition.
10089 (Input_file::format_):: New data member.
10090
4a54abbb
DK
100912010-02-24 Doug Kwan <dougkwan@google.com>
10092
10093 * arm.cc (Arm_output_data_got): New class.
10094 (ARM_TCB_SIZE): New constant
10095 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10096 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10097 If user uses a script with a SECTIONS clause, issue only a warning
10098 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10099 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10100 garbage collection.
10101 (Target_arm::got_mode_index_entry): Handle static linking.
10102 (Target_arm::Scan::local): Ditto.
10103 (Target_arm::Scan::global): Ditto.
10104 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10105 all incorrectly implemented relocations.
e1df38aa 10106 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10107 Arm_output_section::fix_exidx_coverage.
10108 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10109 from ".ARM.exidx." and ".ARM.extab.".
10110
ca419a6f
ILT
101112010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10112
10113 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10114 section if it does not already exist.
10115 * attributes.cc (Attributes_section_data::Attributes_section_data):
10116 Don't crash if size is zero.
10117
135b9c78
ILT
101182010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10119 Ian Lance Taylor <iant@google.com>
10120
10121 * gold.cc (queue_middle_tasks): If no input files were opened,
10122 exit.
10123 * workqueue.h (Task_function::Task_function): Assert that there is
10124 a blocker.
10125
bb0bfe4f
DK
101262010-02-22 Doug Kwan <dougkwan@google.com>
10127
10128 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10129 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10130 types to avoid warnings due to different uint64_t implementations
10131 on different hosts.
10132
2a2b6d42
DK
101332010-02-21 Doug Kwan <dougkwan@google.com>
10134
10135 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10136 handling of the maximum backward branch offset.
2e702c99 10137 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10138 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10139 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10140 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10141 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10142 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10143 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10144 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10145 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10146 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10147 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10148 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10149 thumb2_bl_out_of_range.o): New rules.
10150 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10151 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10152 thumb2_bl_out_of_range
10153 * testsuite/Makefile.in: Regenerate.
10154 * testsuite/arm_bl_in_range.s: New file.
10155 * testsuite/arm_bl_out_of_range.s: Ditto.
10156 * testsuite/arm_branch_in_range.sh: Ditto.
10157 * testsuite/arm_branch_range.t: Ditto.
10158 * testsuite/thumb2_branch_range.t: Ditto.
10159 * testsuite/thumb_bl_in_range.s: Ditto.
10160 * testsuite/thumb_bl_out_of_range.s: Ditto.
10161 * testsuite/thumb_branch_range.t: Ditto.
10162
b487ad64
ST
101632010-02-20 Sriraman Tallam <tmsriram@google.com>
10164
10165 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10166 Add reloc offset information.
10167 * icf.cc (get_section_contents): Change iterators to point to the new
10168 vectors. Add reloc offset information to the contents.
10169 * icf.h (Icf::Sections_reachable_info): New typedef.
10170 (Icf::Sections_reachable_list): New typedef.
10171 (Icf::Offset_info): New typedef.
10172 (Icf::Reloc_info): New struct typedef.
10173 (Icf::Reloc_info_list): New typedef.
10174 (Icf::symbol_reloc_list): Delete method.
10175 (Icf::addend_reloc_list): Delete method.
10176 (Icf::section_reloc_list): Delete method.
10177 (Icf::reloc_info_list): New method.
10178 (Icf::reloc_info_list_): New member.
10179
f96accdf
DK
101802010-02-19 Doug Kwan <dougkwan@google.com>
10181
10182 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10183 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10184 * arm.cc (Arm_relocation_functions): New forward declaration.
10185 (Target_arm::Target_arm): Initialize new data members
10186 got_mod_index_offset_ and tls_base_symbol_defined_.
10187 (Target_arm::Relocate::relocate_tls): New method.
10188 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10189 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10190 New methods.
2e702c99 10191 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10192 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10193 (Target_arm::got_mod_index_offset_,
10194 Target_arm::tls_base_symbol_defined_): New data members.
10195 (Target_arm::Scan::local, Target::Scan::global,
10196 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10197 relocations.
10198
c8761b9a
DK
101992010-02-18 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10202 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10203 text section as a parameter becuase some broken tools may not set
10204 the link in section header.
10205 (Target_arm::has_got_section): New method.
10206 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10207 without any mapping symbol as data only. Remove warning.
10208 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10209 link in its section header, try to discover the link by inspecting the
10210 REL31 relocation at the beginning of the section.
10211 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10212 in error message.
10213 (Target_arm::Scan::global): Treat any reference to the symbol
10214 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10215
21bb3914
ST
102162010-02-12 Sriraman Tallam <tmsriram@google.com>
10217
10218 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10219 (Scan::global_reloc_may_be_function_pointer): New function.
10220 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10221 (Scan::global_reloc_may_be_function_pointer): New function.
10222 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10223 (Scan::global_reloc_may_be_function_pointer): New function.
10224 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10225 (Scan::global_reloc_may_be_function_pointer): New function.
10226 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10227 (Scan::global_reloc_may_be_function_pointer): New function.
10228 (Scan::possible_function_pointer_reloc): New function.
10229 (Target_x86_64::can_check_for_function_pointers): New function.
10230 * gc.h (gc_process_relocs): Scan relocation types to determine if
10231 function pointers were taken for targets that support it.
10232 * icf.cc (Icf::find_identical_sections): Include functions for
10233 folding in safe ICF whose pointer is not taken.
10234 * icf.h (Secn_fptr_taken_set): New typedef.
10235 (fptr_section_id_): New member.
10236 (section_has_function_pointers): New function.
10237 (set_section_has_function_pointers): New function.
10238 (check_section_for_function_pointers): New function.
10239 * options.h: Fix comment for safe ICF option.
10240 * target.h (can_check_for_function_pointers): New function.
10241 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10242 Modify icf_safe_test for X86-64.
10243 * testsuite/Makefile.in: Regenerate.
10244 * testsuite/icf_safe_so_test.cc: New file.
10245 * testsuite/icf_safe_so_test.sh: New file.
10246 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10247 (main): Change to take pointer to function kept_func_3.
10248 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10249 folding is done correctly for X86-64.
10250
0da6fa6c
DM
102512010-02-12 David S. Miller <davem@davemloft.net>
10252
10253 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10254 is_symbolless parameter.
10255 (Output_reloc<SHT_REL>::is_symbolless): New.
10256 (Output_reloc<SHT_REL>::is_symbolless_): New.
10257 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10258 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10259 (Output_reloc<SHT_RELA>::is_symbolless): New.
10260 (Output_data_reloc::add_global): Handle is_symbolless.
10261 (Output_data_reloc::add_global_relative): Likewise.
10262 (Output_data_reloc::add_local): Likewise.
10263 (Output_data_reloc::add_local_relative): Likewise.
10264 (Output_data_reloc::add_symbolless_global_addend): New.
10265 (Output_data_reloc::add_symbolless_local_addend): New.
10266 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10267 is_symbolless.
10268 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10269 instead of ->is_relative_
10270 (Output_reloc::write): Likewise.
10271 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10272 (Output_reloc::write_rel): Simplify.
10273
10274 * sparc.cc (Target_sparc::Scan::local): Use
10275 ->add_symbolless_local_addend as needed.
10276 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10277 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10278 based upon relocation offset.
10279
e4782e83
DK
102802010-02-11 Doug Kwan <dougkwan@google.com>
10281
10282 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10283 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10284 beginning of function.
10285 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10286 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10287 parameter is_32bit in calls to should_apply_static_reloc.
10288 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10289 (check_DATA): Add arm_abs_global.stdout.
10290 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10291 arm_abs_global.stdout): New rules.
10292 (MOSTLLYCLEANFILES): Add arm_abs_global
10293 * Makefile.in: Regenerate.
10294 * testsuite/arm_abs_global.s: New file.
10295 * testsuite/arm_abs_global.sh: Ditto.
10296 * testsuite/arm_abs_lib.s: Ditto.
10297
93ceb764
ILT
102982010-02-11 Ian Lance Taylor <iant@google.com>
10299
10300 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10301 Read_relocs task.
10302 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10303 Allocate_commons_task first.
10304 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10305 task, rather than symtab_lock_.
10306 (Gc_process_relocs::~Gc_process_relocs): New function.
10307 (Gc_process_relocs::is_runnable): Check this_blocker_.
10308 (Gc_process_relocs::locks): Use next_blocker_ rather than
10309 blocker_.
10310 (Scan_relocs::~Scan_relocs): New function.
10311 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10312 symtab_lock_.
10313 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10314 next_blocker_.
10315 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10316 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10317 constructor accordingly.
10318 (class Gc_process_relocs): Likewise.
10319 (class Scan_relocs): Likewise.
10320 * common.h (class Allocate_commons_task): Remove symtab_lock_
10321 field, and corresponding constructor parameter.
10322 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10323 symtab_lock_.
10324 (Allocate_commons_task::locks): Likewise.
10325
114dfbe1
ILT
103262010-02-11 Ian Lance Taylor <iant@google.com>
10327
10328 * gold-threads.h (class Once): Define.
10329 (class Initialize_lock): Rewrite as child of Once.
10330 * gold-threads.cc (class Once_initialize): Define.
10331 (once_pointer_control): New static variable.
10332 (once_pointer, once_arg): New static variables.
10333 (c_run_once): New static function.
10334 (Once::Once, Once::run_once, Once::internal_run): New functions.
10335 (class Initialize_lock_once): Remove.
10336 (initialize_lock_control): Remove.
10337 (initialize_lock_pointer): Remove.
10338 (initialize_lock_once): Remove.
10339 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10340 (Initialize_lock::initialize): Rewrite.
10341 (Initialize_lock::do_run_once): New function.
10342 * archive.cc (Archive::interpret_header): Only clear name if it is
10343 not already empty.
10344 * fileread.cc: Include "gold-threads.h"
10345 (file_counts_lock): New static variable.
10346 (file_counts_initialize_lock): Likewise.
10347 (File_read::release): Only increment counts when using --stats.
10348 Use a lock around the increment.
10349 * parameters.cc (class Set_parameters_target_once): Define.
10350 (set_parameters_target_once): New static variable.
10351 (Parameters::Parameters): Move here from parameters.h.
10352 (Parameters::set_target): Rewrite.
10353 (Parameters::set_target_once): New function.
10354 (Parameters::clear_target): Move here and rewrite.
10355 * parameters.h (class Parameters): Update declarations. Add
10356 set_parameters_target_once_ field.
10357 (Parameters::Parameters): Move to parameters.cc.
10358 (Parameters::clear_target): Likewise.
10359 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10360 task.
10361 (Start_group::~Start_group): New function.
10362 (Start_group::is_runnable): New function.
10363 (Start_group::locks, Start_group::run): New functions.
10364 (Finish_group::run): Change saw_undefined to size_t.
10365 * readsyms.h (class Start_group): Define.
10366 (class Finish_group): Change saw_undefined_ field to size_t.
10367 (Finish_group::Finish_group): Remove saw_undefined and
10368 this_blocker parameters. Change all callers.
10369 (Finish_group::set_saw_undefined): New function.
10370 (Finish_group::set_blocker): New function.
10371 * symtab.h (class Symbol_table): Change saw_undefined to return
10372 size_t. Change saw_undefined_ field to size_t.
10373 * target-select.cc (Set_target_once::do_run_once): New function.
10374 (Target_selector::Target_selector): Initialize set_target_once_
10375 field. Don't initialize lock_ and initialize_lock_ fields.
10376 (Target_selector::instantiate_target): Rewrite.
10377 (Target_selector::set_target): New function.
10378 * target-select.h (class Set_target_once): Define.
10379 (class Target_selector): Update declarations. Make
10380 Set_target_once a friend. Remove lock_ and initialize_lock_
10381 fields. Add set_target_once_ field.
10382
fa17a3f4
ILT
103832010-02-10 Ian Lance Taylor <iant@google.com>
10384
10385 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10386 queueing any tasks.
10387 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10388 (queue_middle_tasks): Add all blockers before queueing any tasks.
10389 (queue_final_tasks): Likewise.
10390 * token.h (Task_token::add_blockers): New function.
10391 * object.h (Input_objects::number_of_relobjs): New function.
10392
c7177d31
ILT
103932010-02-10 Ian Lance Taylor <iant@google.com>
10394
5de0e392
ILT
10395 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10396 shared, not if not position independent.
10397 * x86_64.cc (Relocate::relocate_tls): Likewise.
10398 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10399 (tls_pie_pic_test): New target.
10400 * testsuite/Makefile.in: Rebuild.
10401
c7177d31
ILT
10402 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10403 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10404 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10405 * testsuite/Makefile.in: Rebuild.
10406
684b268a
DM
104072010-02-09 David S. Miller <davem@davemloft.net>
10408
10409 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10410 R_SPARC_RELATIVE using ->add_local_relative().
10411 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10412
612a8d3d
DM
10413 * output.h (Output_data_dynamic::add_section_size): New method
10414 that takes two Output_data objects.
10415 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10416 entry param. Handle it in initializers.
10417 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10418 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10419 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10420 arg.
10421 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10422 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10423 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10424 for dynrel_includes_plt.
10425 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10426 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10427 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10428 before .rela.plt
10429 (Target_sparc::do_finalize_sections): Update to pass true for
10430 dynrel_includes_plt.
10431 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10432 output before .rela.plt
10433 (Target_powerpc::do_finalize_sections): Update to pass true for
10434 dynrel_includes_plt when 32-bit.
10435
cb1be87e
DK
104362010-02-08 Doug Kwan <dougkwan@google.com>
10437
10438 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10439 method.
10440 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10441 Arm_relobj::scan_section_for_cortex_a8_stubs,
10442 Arm_relobj::do_relocation_section): Instead of calling
10443 Output_section::output_address, use faster
10444 Arm_relobj::simple_input_section_output_address.
10445
705b5121
DM
104462010-02-08 David S. Miller <davem@davemloft.net>
10447
10448 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10449 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10450 relocation helper function.
10451
024c4466
DM
10452 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10453 just like R_SPARC_GOT{10,13,22}.
10454 (Target_sparc::Scan::local): Likewise.
10455 (Target_sparc::Relocate:relocate): Likewise.
10456
9109c078
ILT
104572010-02-06 Ian Lance Taylor <iant@google.com>
10458
10459 * configure.ac: Rewrite targetobjs duplicate removal code to use
10460 only shell constructs.
10461 * configure: Rebuild.
10462
cf846138
DK
104632010-02-05 Doug Kwan <dougkwan@google.com>
10464
10465 PR 11247
10466 * arm.cc (Arm_relobj::section_is_scannable): New method.
10467 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10468 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10469
6cfaf60b
DK
104702010-02-04 Doug Kwan <dougkwan@google.com>
10471
10472 PR 11247
10473 * arm-reloc-property.cc (cstdio): Include.
10474 * configure.ac (targetobjs): Remove duplicates.
10475 * configure: Regenerate.
10476 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10477 big and little endian version for a given address size.
10478
5c57f1be
DK
104792010-02-03 Doug Kwan <dougkwan@google.com>
10480
10481 * arm-reloc-property.cc
10482 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10483 definition.
10484 * arm-reloc-property.h
10485 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10486 New method definition.
10487 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10488 declaration.
10489 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10490 overflow to N.
10491 (GOT_PREL): Change implemented to Y.
10492 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10493 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10494 (Arm_relocate_functions::movw_abs_nc): Remove method.
10495 (Arm_relocate_functions::movt_abs): Ditto.
10496 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10497 (Arm_relocate_functions::thm_movt_abs): Ditto.
10498 (Arm_relocate_functions::movw_rel_nc): Ditto.
10499 (Arm_relocate_functions::movw_rel): Ditto.
10500 (Arm_relocate_functions::movt_rel): Ditto.
10501 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10502 (Arm_relocate_functions:thm_movw_rel): Ditto.
10503 (Arm_relocate_functions:thm_movt_rel): Ditto.
10504 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10505 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10506 New method definitions.
10507 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10508 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10509 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10510 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10511 (Target_arm::Relocate::relocate): Check for non-static or
10512 unimplemented relocation code and exit early. Change calls to
10513 Target_arm::reloc_uses_thumb_bit and
10514 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10515 instead. Refactor code to handle similar relocations to increase
10516 code sharing. Remove check for unsupported relocation code in switch
10517 statement.
10518 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10519 relocation property table to find out size. Change error message to
10520 print out the name of a relocation code instead of the numeric value.
10521 (Target_arm::scan_reloc_for_stub): Use relocation property table
10522 instead of calling Target_arm::reloc_uses_thumb_bit().
10523
218c5831
DK
105242010-02-02 Doug Kwan <dougkwan@google.com>
10525
10526 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10527 types of relaxed input section.
10528
0d31c79d
DK
105292010-02-02 Doug Kwan <dougkwan@google.com>
10530
10531 * Makefile.am (HFILES): Add arm-reloc-property.h.
10532 (DEFFILES): New.
2e702c99
RM
10533 (TARGETSOURCES): Add arm-reloc-property.cc
10534 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10535 (libgold_a_SOURCES): $(DEFFILES)
10536 * Makefile.in: Regenerate.
10537 * arm-reloc-property.cc: New file.
10538 * arm-reloc-property.h: New file.
10539 * arm-reloc.def: New file.
10540 * arm.cc: Update comments.
10541 (arm-reloc-property.h): New included header.
10542 (arm_reloc_property_table): New global variable.
10543 (Target_arm::do_select_as_default_target): New method definition.
10544 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10545 arm-reloc-property to targ_extra_obj.
10546 * parameters.cc (set_parameters_target): Call
10547 Target::select_as_default_target().
10548 * target.h (Target::select_as_default_target): New method definition.
10549 (Target::do_select_as_default_target): Same.
10550
546c7457
DK
105512010-02-01 Doug Kwan <dougkwan@google.com>
10552
10553 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10554 first_output_text_section_.
10555 (Arm_exidx_fixup::first_output_text_section): New method definition.
10556 (Arm_exidx_fixup::first_output_text_section_): New data member.
10557 (Arm_exidx_fixup::process_exidx_section): Record the first text
10558 output section seen.
10559 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10560 and entsize in output section header.
10561
11b861d5
DK
105622010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10563
10564 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10565 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10566 (Arm_relocate_functions::thm_alu11): New Method.
10567 (Arm_relocate_functions::thm_pc8): New Method.
10568 (Arm_relocate_functions::thm_pc12): New Method.
10569 (Target_arm::Scan::local): Handle the relocations.
10570 (Target_arm::Scan::global): Likewise.
10571 (Target_arm::Relocate::relocate): Likewise.
10572 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10573
c9a2c125
DK
105742010-01-29 Doug Kwan <dougkwan@google.com>
10575
10576 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10577 of relocation types as ld.
10578
1521477a
DK
105792010-01-29 Doug Kwan <dougkwan@google.com>
10580
10581 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10582 to public.
10583 (Arm_relocate_functions::thumb_branch_common): Ditto.
10584 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10585 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10586 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10587 Arm_relocate_functions::jump24): Remove.
10588 (Target_arm::Relocate::relocate): Adjust code to call
10589 Arm_relocation_functions::arm_branch_common and
10590 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10591 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10592
e7eca48c
DK
105932010-01-29 Doug Kwan <dougkwan@google.com>
10594
10595 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10596 output_local_symbol_count_needs_update_.
10597 (Arm_relobj::output_local_symbol_count_needs_update,
10598 Arm_relobj::set_output_local_symbol_count_needs_update,
10599 Arm_relobj::update_output_local_symbol_count): New methods.
10600 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10601 member.
10602 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10603 of pointed function as in a R_ARM_PREL31 relocation.
10604 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10605 for output local symbol count updating.
10606 (Target_arm::do_relax): Update output local symbol counts in objects
10607 if necessary.
10608 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10609
02961d7e
ILT
106102010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10611
10612 * arm.cc: Added support for the ARM relocations:
10613 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10614 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10615 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10616 movw_prel_nc).
10617 (Arm_relocate_functions::movw_rel): New method.
10618 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10619 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10620 thm_movw_prel_nc).
10621 (Arm_relocate_functions::thm_movw_rel): New method.
10622 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10623 thm_movt_prel).
10624 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10625 relocations.
10626 (Target_arm::Scan::global): Likewise.
10627 (Target_arm::Relocate::relocate): Likewise.
10628 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10629 Likewise.
10630
b10d2873
ILT
106312010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10632
10633 * arm.cc: Added support for ARM group relocations.
10634 (Target_arm::reloc_needs_sym_origin): New method.
10635 (Arm_relocate_functions::calc_grp_kn): New method.
10636 (Arm_relocate_functions::calc_grp_residual): New method.
10637 (Arm_relocate_functions::calc_grp_gn): New method.
10638 (Arm_relocate_functions::arm_grp_alu): New Method.
10639 (Arm_relocate_functions::arm_grp_ldr): New Method.
10640 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10641 (Arm_relocate_functions::arm_grp_ldc): New Method.
10642 (Target_arm::Scan::local): Handle the ARM group relocations.
10643 (Target_arm::Scan::global): Likewise.
10644 (Target_arm::Relocate::relocate): Likewise.
10645 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10646 Likewise.
10647
2b328d4e
DK
106482010-01-26 Doug Kwan <dougkwan@google.com>
10649
10650 * arm.cc (set): Include.
10651 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10652 pointer type.
2e702c99 10653 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10654 (Arm_output_section::append_text_sections_to_list): New method.
10655 (Arm_output_section::fix_exidx_coverage): Ditto.
10656 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10657 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10658 Relobj::set_section_offset() instead of
10659 Sized_relobj::invalidate_section_offset().
2e702c99 10660 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10661 parameter for section headers. Ignore relocation sections for
10662 unallocated sections and EXIDX sections.
10663 (Target_arm::fix_exidx_coverage): New method.
10664 (Target_arm::output_section_address_less_than): New type.
10665 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10666 linked text section instead of the EXIDX section.
10667 (Arm_output_section::create_stub_group): Add an assertion to check
10668 that this is not an EXIDX output section.
10669 (Arm_output_section::append_text_sections_to_list): New method.
10670 (Arm_output_section::fix_exidx_coverage): Ditto.
10671 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10672 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10673 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10674 first pass.
10675 (Target_arm::fix_exidx_coverage): New method.
10676 * object.h (Relobj::set_output_section): New method.
10677 (Sized_relobj::invalidate_section_offset): Remove method.
10678 (Sized_relobj::do_invalidate_section_offset): Remove method.
10679 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10680
c7f3c371
DK
106812010-01-25 Doug Kwan <dougkwan@google.com>
10682
10683 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10684 Fix warning due to signed and unsigned comparison on a 32-bit host.
10685
8923b24c
DK
106862010-01-22 Doug Kwan <dougkwan@google.com>
10687
10688 * arm.cc (Target_arm::do_relax): Record an output section for section
10689 offset adjustment it contains any stub table that has changed.
10690 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10691 offsets in an output section if necessary.
10692 * output.cc (Output_section::Output_section): Initialize
10693 section_offsets_need_adjustments_.
10694 (Output_section::add_input_section_for_script): Renamed to
10695 Output_section::add_simple_input_section.
10696 (Output_section::save_states): Add a comment.
10697 (Output_section::discard_states): New method defintion.
10698 (Output_section::adjust_section_offsets): Same.
10699 * output.h (Output_section::add_input_section_for_script): Renamed to
10700 Output_section::add_simple_input_section.
10701 (Output_section::discard_states): New method declaration.
10702 (Output_section::adjust_section_offsets): Same.
10703 (Output_section::section_offsets_need_adjustment,
10704 Output_section::set_section_offsets_need_adjustment): New method
10705 definitions.
10706 (Output_section::section_offsets_need_adjustment_): New data member.
10707 * script-sections.cc
10708 (Output_section_element_input::set_section_address): Adjust code for
10709 renaming of Output_section::add_input_section_for_script.
10710 (Orphan_output_section::set_section_address): Same.
10711
9b2fd367
DK
107122010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10713
10714 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10715 Fix_v4bx enum values .
10716 * gold/options.h (General_options): New option definitions.
10717 (General_options::fix_v4bx): New method.
10718 (General_options::Fix_v4bx): New enum.
10719 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10720 (General_options::parse_fix_v4bx_interworking): New method.
10721
80d0d023
DK
107222010-01-22 Doug Kwan <dougkwan@google.com>
10723
10724 * arm.cc (Arm_exidx_fixup): New class.
10725
af2cdeae
DK
107262010-01-21 Doug Kwan <dougkwan@google.com>
10727
10728 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10729 classes.
10730 (Arm_exidx_section_offset_map): New type.
10731
993d07c1
DK
107322010-01-21 Doug Kwan <dougkwan@google.com>
10733
10734 * arm.cc (Arm_exidx_input_section): New class.
10735 (Arm_relobj::exidx_input_section_by_link,
10736 Arm_relobj::exidx_input_section_by_shndx,
10737 Arm_relobj::make_exidx_input_section): New methods.
10738 (read_arm_attributes_section): Remove.
10739 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10740 information about them.
10741 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10742 to here.
10743
5ac169d4
DK
107442010-01-20 Doug Kwan <dougkwan@google.com>
10745
10746 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10747 Input_section_specifier to Section_id.
10748 (Target_arm::new_arm_input_section: Adjust code for change of key
10749 type.
10750 (Target_arm::find_arm_input_section): Ditto.
10751 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10752 (Section_id): Remove.
10753 (Garbage_collection::Section_id_hash): Remove.
10754 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10755 (Section_id): Remove.
10756 (Icf::Section_id_hash): Remove.
10757 * object.h (Section_id, Const_section_id, Section_id_hash,
10758 Const_section_id_hash): New type definitions.
10759 * output.cc (Output_section::add_relaxed_input_section): Change to
10760 use Const_section_id instead of Input_section_specifier as key type.
10761 (Output_section::add_merge_input_section): Ditto.
10762 (Output_section::build_relaxation_map): Change to use Section_id
10763 instead of Input_section_specifier as key type.
2e702c99 10764 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10765 Ditto.
10766 (Output_section::convert_input_sections_to_relaxed_sections): Change
10767 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10768 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10769 (Output_section::find_relaxed_input_section): Ditto.
10770 * output.h (Input_section_specifier): Remove class.
10771 (Output_section::Output_section_data_by_input_section_map): Change
10772 key type to Const_section_id.
10773 (Output_section::Output_relaxed_input_section_by_input_section_map):
10774 Ditto.
10775 (Output_section::Relaxation_map): Change key type to Section_id.
10776
a2162063
ILT
107772010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10778
10779 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10780 (class Arm_v4bx_stub): New class.
10781 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10782 (Stub_factory::make_arm_v4bx_stub): New method.
10783 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10784 (Stub_table::empty): Handle v4bx stubs.
10785 (Stub_table::add_arm_v4bx_stub): New method.
10786 (Stub_table::find_arm_v4bx_stub): New method.
10787 (Arm_relocate_functions::v4bx): New method.
10788 (Target_arm::fix_v4bx): New method.
10789 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10790 (Stub_table::relocate_stubs): Likewise.
10791 (Stub_table::do_write): Likewise.
10792 (Stub_table::update_data_size_and_addralign): Likewise.
10793 (Stub_table::finalize_stubs): Likewise.
10794 (Target_arm::Scan::local): Likewise.
10795 (Target_arm::Scan::global): Likewise.
10796 (Target_arm::do_finalize_sections): Likewise.
10797 (Target_arm::Relocate::relocate): Likewise.
10798 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10799 Likewise.
10800 (Target_arm::scan_reloc_for_stub): Likewise.
10801 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10802
5696ab0b
ILT
108032010-01-19 Ian Lance Taylor <iant@google.com>
10804
10805 * output.cc (Output_section_headers::do_sized_write): Write large
10806 segment count to sh_info field.
10807 (Output_file_header::do_sized_write): For large segment count,
10808 write PN_XNUM to e_phnum field.
10809
800d0f56
ILT
108102010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10811
10812 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10813 (Arm_relocate_functions::thm_jump8): New function.
10814 (Arm_relocate_functions::thm_jump11): New function.
10815 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10816 R_ARM_THM_JUMP11.
10817 (Target_arm::Scan::global): Likewise.
10818 (Target_arm::Relocate::relocate): Likewise.
10819 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10820 Likewise.
10821
41263c05
DK
108222010-01-14 Doug Kwan <dougkwan@google.com>
10823
10824 * arm.cc (map, utility): Include headers.
10825 (Target_arm::apply_cortex_a8_workaround): New method.
10826 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10827 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10828 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10829 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10830 the --[no-]fix-cortex-a8 command line options.
10831 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10832 (Target_arm::relocate_stub): Use addend in instruction template.
10833 * options.h (DEFINE_bool): Set the user-set flag.
10834 (General_options): Add --[no-]-fix-cortex options.
10835 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10836 : Update fast look-up map after conversion.
41263c05 10837
459e9b03
ST
108382010-01-14 Sriraman Tallam <tmsriram@google.com>
10839
10840 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10841 in the first pass of do_layout.
10842
b521dfe4
DK
108432010-01-13 Doug Kwan <dougkwan@google.com>
10844
10845 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10846 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10847 apparent compiler problem of not folding static constant integral
10848 data members of elfcpp::Elf_sizes<32>.
10849
44272192
DK
108502010-01-13 Doug Kwan <dougkwan@google.com>
10851
10852 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10853 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10854 Arm_relobj::scan_section_for_cortex_a8_erratum,
10855 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10856 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10857 sections to scan for relocation stubs into a new method
10858 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10859 relocation and Cortex-A8 stub scanning.
10860 (Target_arm::do_relax): Force stubs to be after stubbed sections
10861 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10862 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10863 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10864
44b71ece
ILT
108652010-01-12 Ian Lance Taylor <iant@google.com>
10866
10867 * target-reloc.h (visibility_error): New inline function.
10868 (relocate_section): Call visibility_error.
10869 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10870 (MOSTLYCLEANFILES): Likewise.
10871 (protected_4_pic.o, protected_3.err): New targets.
10872 * testsuite/protected_4.cc: New file.
10873
a120bc7f
DK
108742010-01-12 Doug Kwan <dougkwan@google.com>
10875
10876 * arm.cc (Cortex_a8_reloc): New class.
10877 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10878 and cortex_a8_relocs_info_.
10879 (Target_arm::fix_cortex_a8): New method definition.
10880 (Target_arm::Cortex_a8_relocs_info): New type.
10881 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10882 New data member declarations.
10883 (Target_arm::scan_reloc_for_stub): Record information about
10884 relocations for THUMB branches that might be exempted from the
10885 Cortex-A8 workaround.
10886 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10887 at the beginning of a relaxation pass.
10888
20138696
DK
108892010-01-12 Doug Kwan <dougkwan@google.com>
10890
10891 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10892 (Arm_relobj::Mapping_symbol_position,
10893 Arm_reloj::Mapping_symbol_position_less,
10894 Arm_relobj::Mapping_symbols_info): New types.
10895 (Target_arm::is_mapping_symbol_name): New method definition.
10896 (Arm_relobj::do_count_local_symbols): Save information about mapping
10897 symbols.
10898
089d69dc
DK
108992010-01-11 Doug Kwan <dougkwan@google.com>
10900
10901 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10902 Arm_relocate_functions::thumb32_branch_upper,
10903 Arm_relocate_functions::thumb32_branch_lower,
10904 Arm_relocate_functions::thumb32_cond_branch_offset,
10905 Arm_relocate_functions::thumb32_cond_branch_upper,
10906 Arm_relocate_functions::thumb32_cond_branch_lower,
10907 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10908 branch offset encoding.
10909 (Arm_relocate_functions::thumb_branch_common): Use new branch
10910 offset encoding methods to avoid code duplication.
10911 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10912 (Stub_addend_reader::operator()): Use new branch encoding method
10913 to avoid code duplication.
10914
99e5bff2
DK
109152010-01-11 Doug Kwan <dougkwan@google.com>
10916
10917 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10918 (Target_arm::do_finalize_sections): Define special EXIDX section
10919 symbols only if referenced.
10920 * gc.h (Garbage_collection::add_reference): New method.
10921 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10922 code duplication.
10923
98e090bd
ILT
109242010-01-11 Ian Lance Taylor <iant@google.com>
10925
d0a91bd8
ILT
10926 * script.cc (Version_script_info::build_expression_list_lookup):
10927 Change complaing about duplicate wildcard match from error to
10928 warning.
10929
98e090bd
ILT
10930 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10931 of 2009-12-30.
10932 (Version_script_info::Version_script_info): Initialize globs_,
10933 default_version_, default_is_global_, and exact_. Don't
10934 initialize globals_ or locals_.
10935 (Version_script_info::build_lookup_tables): Build local symbols
10936 first.
10937 (Version_script_info::unquote): New function.
10938 (Version_script_info::add_exact_match): New function.
10939 (Version_script_info::build_expression_list_lookup): Remove lookup
10940 parameter. Add is_global parameter. Change all callers. Handle
10941 wildcard pattern specially. Unquote pattern. Call
10942 add_exact_match.
10943 (Version_script_info::get_name_to_match): New function.
10944 (Version_script_info::get_symbol_version): New function.
10945 (Version_script_info::get_symbol_version_helper): Remove.
10946 (Version_script_info::check_unmatched_names): Call unquote.
10947 * script.h (class Version_script_info): Change get_symbol_version
10948 to be non-inline and add is_global parameter; change all callers.
10949 Rewrite symbol_is_local. Update declarations. Define struct
10950 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10951 Remove globals_ and locals_ members. Add exact_, globs_,
10952 default_version_, is_global_.
10953 (Version_script_info::Glob): Remove pattern, add expression and
10954 is_global. Update constructor. Change all callers.
10955 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10956 default version.
10957 (Versions::symbol_section_contents): If a symbol is undefined, or
10958 defined in a dynamic object, set the version index to
10959 VER_NDX_LOCAL.
10960 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10961 symbol_is_local.
10962 (Symbol_table::add_from_pluginobj): Likewise.
10963 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10964
d56962d3
DK
109652010-01-11 Doug Kwan <dougkwan@google.com>
10966
10967 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10968 (incremental_dump_LDADD): Add linking option for libintl.
10969 * Makefile.in: Regenerate.
10970
94e6ee91
L
109712010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10972
10973 PR gold/11144
10974 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10975 instead of -Ds.
10976 * testsuite/Makefile.in: Regenerated.
10977
e96c574b
DK
109782010-01-10 Doug Kwan <dougkwan@google.com>
10979
10980 * options.h (DEFINE_var): Use parentheses around argument varname__
10981 in macro body to avoid any unintended subsequent substitutions.
10982
7198066b
ILT
109832010-01-10 Ian Lance Taylor <iant@google.com>
10984
ba4d53bf
ILT
10985 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10986 candidates before doing symbol resolution.
10987
7198066b
ILT
10988 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10989 ODR candidates if only one is weak.
10990
a2beed37
ILT
109912010-01-08 Ian Lance Taylor <iant@google.com>
10992
10993 * script.cc (Version_script_info::build_expression_list_lookup):
10994 Don't warn about ambiguous version, just record the ambiguity.
10995 (Version_script_info::get_symbol_version_helper): Give error if
10996 version is ambiguous.
10997
2fb7225c
DK
109982010-01-08 Doug Kwan <dougkwan@google.com>
10999
11000 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11001 prev_data_size_ and prev_addralign_. Remove initializer for
11002 deleted data member has_been_changed_.
11003 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11004 to determine if the table is empty.
11005 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11006 Remove.
11007 (Stub_table::add_reloc_stub): Define method in class definition
11008 instead of just declaring it there.
11009 (Stub_table::add_cortex_a8_stub): New method definition.
11010 (Stub_table::update_data_size_and_addralign): Ditto.
11011 (Stub_table::finalize_stubs): Ditto.
11012 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11013 (Stub_table::do_addralign_): Return address alignment in the
11014 (Stub_table::do_reset_address_and_file_offset): Define method in
11015 class definition instead of declaring it there. Set current data
11016 size to be the data size of the previous pass.
11017 (Stub_table::set_final_data_size): Use current data size as the
11018 final data size.
11019 (Stub_table::relocate_stub): Change parameter type of stub from
11020 Reloc_stub pointer to Stub pointer.
11021 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11022 (Stub_table::Cortex_a8_stub_list): New typedef.
11023 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11024 Stub_table::prev_addralign_): New data member.
11025 (Arm_relobj::Arm_relobj): Initialize data member
11026 section_has_cortex_a8_workaround_.
11027 (Arm_relobj::section_has_cortex_a8_workaround,
11028 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11029 definitions.
11030 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11031 declarations.
11032 (Target_arm::relocate_stub): Change parameter type of stub from
11033 Reloc_stub pointer to Stub pointer.
11034 (Insn_template::size, Insn_template::alignment): Handle
11035 THUMB16_SPECIAL_TYPE.
11036 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11037 Stub_table::update_data_size_and_addralign,
11038 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11039 definitions.
11040 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11041 (Stub_table::do_write): Ditto.
11042 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11043
880cd20d
ILT
110442010-01-08 Ian Lance Taylor <iant@google.com>
11045
11046 PR 11108
11047 * symtab.h (class Symbol): Remove fields is_target_special_ and
11048 has_plt_offset_. Add field is_defined_in_discarded_section_.
11049 (Symbol::is_defined_in_discarded_section): New function.
11050 (Symbol::set_is_defined_in_discarded_section): New function.
11051 (Symbol::has_plt_offset): Rewrite.
11052 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11053 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11054 Don't initialize is_target_special_ or has_plt_offset_.
11055 Initialize is_defined_in_discarded_section_.
11056 (Symbol_table::add_from_relobj): If appropriate, set
11057 is_defined_in_discarded_section.
11058 * resolve.cc (Symbol::override_base_with_special): Don't test
11059 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11060 * target-reloc.h (relocate_section): Do special handling for
11061 symbols defined in discarded sections for global symbols as well
11062 as local symbols.
11063
2703e3eb
ILT
110642010-01-08 Ian Lance Taylor <iant@google.com>
11065
11066 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11067 the SHT_SYMTAB case.
11068
339d40a3
ILT
110692010-01-08 Ian Lance Taylor <iant@google.com>
11070
11071 * object.cc (Sized_relobj::do_layout): Don't get confused if
11072 layout_eh_frame returns NULL.
11073
abecea76
ILT
110742010-01-08 Ian Lance Taylor <iant@google.com>
11075
11076 PR 11084
11077 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11078 dynamic symbol table, use the normal symbol table.
11079 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11080 symbol table.
11081
6b7dd3f3
ILT
110822010-01-08 Ian Lance Taylor <iant@google.com>
11083
11084 PR 11072
11085 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11086 sections.
11087
36c50e63
L
110882010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11089
11090 * version.cc (print_version): Change to "Copyright 2010".
11091
e291e7b9
ILT
110922010-01-08 Ian Lance Taylor <iant@google.com>
11093
11094 PR 10287
11095 PR 11063
11096 * i386.cc (class Target_i386): Change return type of plt_section
11097 to be non-const.
11098 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11099 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11100 tls_desc_rel_ field.
11101 (Output_data_plt_i386::rel_tls_desc): New function.
11102 (Target_i386::rel_tls_desc_section): New function.
11103 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11104 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11105 R_386_TLS_DESC reloc in rel_tls_desc_section.
11106 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11107 Define struct Tlsdesc_info.
11108 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11109 (Target_x86_64::do_reloc_symbol_index): New function.
11110 (Target_x86_64::add_tlsdesc_info): New function.
11111 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11112 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11113 tlsdesc_rel_ field.
11114 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11115 all callers.
11116 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11117 (Target_x86_64::rela_tlsdesc_section): New function.
11118 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11119 handling.
11120 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11121 (Target_x86_64::do_reloc_addend): New function.
11122 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11123 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11124 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11125 (Output_reloc::type): New function.
11126 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11127 (Output_reloc::is_target_specific): New function.
11128 (Output_reloc::target_arg): New function.
11129 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11130 absolute relocs and target specific relocs.
11131 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11132 add_target_specific.
11133 (class Output_data_reloc) [SHT_RELA]: Likewise.
11134 * output.cc (Output_reloc::Output_reloc): Add four new versions
11135 for absolute relocs and target specific relocs.
11136 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11137 (Output_reloc::get_symbol_index): Likewise.
11138 (Output_reloc::local_section_offset): Check that local_sym_index_
11139 is not TARGET_CODE or 0.
11140 (Output_reloc::symbol_value): Likewise.
11141 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11142 reloc.
11143 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11144 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11145 functions.
11146 * layout.cc (add_target_dynamic_tags): Use output section for
11147 DT_PLTRELSZ and DT_JMPREL.
11148
3a44184e
ILT
111492010-01-07 Ian Lance Taylor <iant@google.com>
11150
11151 PR 11061
11152 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11153 function.
11154 (class Output_data_reloc_generic): Define.
11155 (class Output_data_reloc_base): Change base class to
11156 Output_data_reloc_generic. Change add() method to call
11157 bump_relative_reloc_count for a relative reloc. Remove
11158 sort_relocs_ field.
11159 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11160 to sort_relocs().
11161 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11162 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11163 appropriate.
11164 * layout.h (class Layout): Update declaration.
11165
ea715a34
ILT
111662010-01-07 Ian Lance Taylor <iant@google.com>
11167
11168 * output.h (class Output_data): Add const version of
11169 output_section and do_output_section.
11170 (class Output_section_data): Add const version of
11171 do_output_section.
11172 (class Output_section): Likewise.
11173 * layout.cc (Layout::add_target_dynamic_tags): New function.
11174 * layout.h (class Layout): Update declarations.
11175 * arm.cc (Target_arm::do_finalize_sections): Use
11176 add_target_dynamic_tags.
11177 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11178 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11179 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11180 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11181
659948a4
ILT
111822010-01-07 Ian Lance Taylor <iant@google.com>
11183
11184 PR 11042
11185 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11186 object as needed.
11187
9d3b86f6
ILT
111882010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11189 Ian Lance Taylor <iant@google.com>
11190
11191 PR 11019
11192 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11193 Xindex::read_symtab_xindex.
11194
bb0d3eb0
DK
111952010-01-07 Doug Kwan <dougkwan@google.com>
11196
11197 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11198 (Insn_template::thumb16_bcond_insn): New method declaration.
11199 (Insn_template): Fix spelling.
11200 (Stub::thumb16_special): New method declaration.
11201 (Stub::do_write): Define virtual method which was previously pure
11202 virtual.
11203 (Stub::do_thumb16_special): New method declaration.
11204 (Stub::do_fixed_endian_write): New template member.
11205 (Reloc_stub::do_write): Remove.
11206 (Reloc_stub::do_fixed_endian_write): Remove.
11207 (Cortex_a8_stub): New class definition.
11208 (Stub_factory::make_cortex_a8_stub): New method definition.
11209 (Stub_factory::Stub_factory): Add missing static storage class
11210 qualifier for elf32_arm_stub_a8_veneer_blx.
11211
ffeef7df
ILT
112122010-01-07 Ian Lance Taylor <iant@google.com>
11213
dc3f80fe
ILT
11214 PR 10980
11215 * options.h (class General_options): Add --warn-unresolved-symbols
11216 and --error-unresolved-symbols.
11217 * errors.cc (Errors::undefined_symbol): Implement
11218 --warn-unresolved-symbols.
11219
ffeef7df
ILT
11220 * options.h (class General_options): Add -z text and -z textoff.
11221 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11222
f1ec9ded
ST
112232010-01-06 Sriraman Tallam <tmsriram@google.com>
11224
11225 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11226 (Garbage_collection::cident_sections): New function.
11227 (Garbage_collection::add_cident_section): New function.
11228 (Garbage_collection::cident_sections_): New member.
11229 (gc_process_relocs): Add references to sections whose names are C
11230 identifiers.
11231 * gold.h (cident_section_start_prefix): New constant.
11232 (cident_section_stop_prefix): New constant.
11233 (is_cident): New function.
11234 * layout.cc (Layout::define_section_symbols): Replace string constants
11235 with the newly defined constants.
11236 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11237 C identifiers.
11238 * testsuite/Makefile.am: Add gc_orphan_section_test.
11239 * testsuite/Makefile.in: Regenerate.
11240 * testsuite/gc_orphan_section_test.cc: New file.
11241 * testsuite/gc_orphan_section_test.sh: New file.
11242
6eda8c29
ILT
112432010-01-06 Ian Lance Taylor <iant@google.com>
11244
b9674e17
ILT
11245 PR 10980
11246 * options.h (class General_options): Add --warn-shared-textrel.
11247 * layout.cc (Layout::finish_dynamic_section): Implement
11248 --warn-shared-textrel.
11249
6eda8c29
ILT
11250 PR 10980
11251 * options.h (class General_options): Add --warn-multiple-gp.
11252
32dcd44e
ILT
112532010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11254
11255 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11256 $(THREADSLIB) and $(LIBDL).
11257 * Makefile.in: Rebuild.
11258
a192ba05
ILT
112592010-01-06 Ian Lance Taylor <iant@google.com>
11260
11261 PR 10980
11262 * options.cc (General_options::parse_section_start): New function.
11263 (General_options::section_start): New function.
11264 (General_options::General_options): Initialize all members.
11265 * options.h: Include <map>
11266 (class General_options): Add --section-start. Add section_starts_
11267 member.
11268 * layout.cc (Layout::attach_allocated_section_to_segment): If
11269 --section-start was used, set the address of the segment. Remove
11270 local sort_sections.
11271 (Layout::relaxation_loop_body): If the address of the load segment
11272 has been set by --section-start, don't use it.
11273 * output.h (Output_segment::update_flags_for_output_section): New
11274 function.
11275 * output.cc (Output_segment::add_output_section): Call
11276 update_flags_for_output_section.
11277
dde3f402
ILT
112782010-01-05 Ian Lance Taylor <iant@google.com>
11279
62dfdd4d
ILT
11280 PR 10980
11281 * options.h (class General_options): Add --undefined-version.
11282 * script.cc (struct Version_expression): Add was_matched_by_symbol
11283 field.
11284 (Version_script_info::matched_symbol): New function.
11285 (Version_script_info::get_symbol_version_helper): Call
11286 matched_symbol.
11287 (Version_script_info::check_unmatched_names): New function.
11288 * script.h (class Version_script_info): Update declarations.
11289 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11290
9c4ae156
ILT
11291 * options.h (class General_options): Use DEFINE_bool_alias for
11292 allow_multiple_definition.
11293 * resolve.cc (Symbol_table::should_override): Don't test
11294 allow_multiple_definition.
11295
dde3f402
ILT
11296 PR 10980
11297 * options.h (class General_options): Add --cref.
11298 * main.cc (main): Print cref table if --cref. Don't close mapfile
11299 until after printing cref table.
11300 * cref.cc: Include "symtab.h".
11301 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11302 (Cref_table_compare::operator()): New function.
11303 (Cref_inputs::gather_cref): New function.
11304 (filecol): New static const.
11305 (Cref_inputs::print_cref): New function.
11306 (Cref::print_cref): New function.
11307 * cref.h: Include <cstdio>.
11308 (class Cref): Update declarations.
11309 * mapfile.h (Mapfile::file): New function.
11310 * object.h (class Object): Define Symbols. Declare virtual
11311 do_get_global_symbols.
11312 (Object::get_global_symbols): New function.
11313 * object.cc (Input_objects::add_object): Pass object to cref_ if
11314 --cref.
11315 (Input_objects::archive_start): Likewise.
11316 (Input_objects::archive_stop): Likewise.
11317 (Input_objects::print_cref): New function.
11318 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11319 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11320 --cref.
11321 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11322 function.
11323 * plugin.h (class Sized_pluginobj): Update declarations.
11324
8781f709
ILT
113252010-01-05 Ian Lance Taylor <iant@google.com>
11326
11327 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11328 to is_default_version. Rename insdef to insdefault.
11329 (Symbol_table::add_from_relobj): Rename def to is_default_version
11330 and local to is_forced_local.
11331 (Symbol_table::add_from_pluginobj): Likewise.
11332 (Symbol_table::add_from_dynobj): Likewise.
11333 (Symbol_table::define_special_symbol): Rename insdef to
11334 insdefault.
11335
fe35d28d
ILT
113362010-01-04 Ian Lance Taylor <iant@google.com>
11337
30bc8c46
ILT
11338 PR 10980
11339 * options.h (class General_options): Add
11340 --allow-multiple-definition and -z muldefs.
11341 * resolve.cc (Symbol_table::should_override): Don't warn about a
11342 multiple symbol definition if --allow-multiple-definition or -z
11343 muldefs.
11344
7eaea549
ILT
11345 PR 10980
11346 * options.h (class General_options): Add --add-needed and
11347 --copy-dt-needed-entries. Tweak --as-needed help entry.
11348 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11349 error if --copy-dt-needed-entries aka --add-needed is used and
11350 would cause a change in behaviour.
11351
fe35d28d
ILT
11352 PR 10980
11353 * options.h (class General_options): Add -G as a short version of
11354 --shared. Add no-op options -assert, -g, and -i.
11355
55a2bb35
ST
113562010-01-04 Sriraman Tallam <tmsriram@google.com>
11357
11358 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11359 check for .text or .gnu.linkonce.t sections.
11360 * icf.cc (Icf::find_identical_sections): Ditto.
11361 Change the detection for mangled function name within the section
11362 name.
11363 * icf.h (is_section_foldable_candidate): New function.
11364
719328e1
ILT
113652009-12-30 Ian Lance Taylor <iant@google.com>
11366
11367 PR 10980
11368 * options.h (class General_options): Permit two dashes with
11369 --retain-symbols-file.
11370
d7bb5745
ILT
113712009-12-30 Ian Lance Taylor <iant@google.com>
11372
403a15dd
ILT
11373 PR 10979
11374 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11375 don't put the file header and segment headers in the text
11376 segment.
11377
eda294df
ILT
11378 PR 10979
11379 * common.cc (Sort_commons::operator()): Stabilize sort when both
11380 entries are NULL.
11381 (Symbol_table::do_allocate_commons_list): When allocating common
11382 symbols, skip a symbol which is no longer common.
11383 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11384 an object before checking its type.
11385 * testsuite/common_test_2.c: New file.
11386 * testsuite/common_test_3.c: New file.
11387 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11388 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11389 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11390 (common_test_2_pic.o, common_test_2.so): New targets.
11391 (common_test_3_pic.o, common_test_3.so): New targets.
11392 * testsuite/Makefile.in: Rebuild.
11393
d7bb5745
ILT
11394 PR 10979
11395 * script.cc (read_input_script): If we see a new SECTIONS clause,
11396 and we have added an input section, give an error.
11397 * layout.h (class Layout): Add have_added_input_section function.
11398 Add have_added_input_section_ field.
11399 * layout.cc (Layout::Layout): Initialize
11400 have_added_input_section_.
11401 (Layout::layout): Set have_added_input_section_.
11402 (Layout::layout_eh_frame): Likewise.
11403
fc59c572
ILT
114042009-12-30 Ian Lance Taylor <iant@google.com>
11405
11406 PR 10931
11407 * options.h (class General_options): Add --sort-common option.
11408 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11409 * common.cc (Sort_common): Add sort_order parameter to
11410 constructor. Add sort_order_ field.
11411 (Sort_commons::operator): Check sort_order_.
11412 (Symbol_table::allocate_commons): Determine the sort order.
11413 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11414 Change all callers.
11415 (Symbol_table::do_allocate_commons_list): Likewise.
11416
1c74fab0
ILT
114172009-12-30 Ian Lance Taylor <iant@google.com>
11418
11419 PR 10916
11420 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11421 symbols from this object, don't change the visibility of an
11422 undefined symbol.
11423 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11424
6affe781
ILT
114252009-12-30 Ian Lance Taylor <iant@google.com>
11426
11427 PR 10861
11428 * script.h (class Version_script_info): Define Language enum.
11429 Update declarations. Define Glob, Exact, and Lookup types. Add
11430 new fields globals_, locals_, and is_finalized_.
11431 * script.cc: Various formatting fixes.
11432 (class Parser_closure): Change language_stack_ from a vector of
11433 std::string to one of Version_script_info::Language. Adjust all
11434 uses accordingly.
11435 (class Lazy_demangler): Remove.
11436 (struct Version_expression): Change language from std::string to
11437 Version_script_info::Language.
11438 (Version_script_info::Version_script_info): New function.
11439 (Version_script_info::~Version_script_info): Don't call clear.
11440 (Version_script_info::finalize): New function.
11441 (Version_script_info::build_lookup_tables): New function.
11442 (Version_script_info::build_expression_list_lookup): New
11443 function.
11444 (Version_script_info::get_symbol_version_helper): Rewrite to use
11445 lookup tables.
11446 (Version_script_info::print_expression_list): Adjust to use
11447 Version_script_info::Language.
11448 (script_push_lex_into_version_mode): Check that the version script
11449 has not been finalized.
11450 (version_script_push_lang): Change language string to
11451 Version_script_info::Language.
11452 * options.cc (Command_line::version_script): New function.
11453 * options.h (class General_options): Add finalize_dynamic_list
11454 function. Change version_script from declaration to definition.
11455 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11456 * testsuite/version_script.map: Remove duplicate def of foo.
11457 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11458 version_script.map.
11459 * testsuite/Makefile.in: Rebuild.
11460
818bf354
ILT
114612009-12-30 Ian Lance Taylor <iant@google.com>
11462
11463 PR 10843
11464 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11465 if the input symbol index is 0, make the output symbol index 0.
11466
ebcc8304
ILT
114672009-12-30 Ian Lance Taylor <iant@google.com>
11468
11469 PR 10670
11470 * options.h (class General_options): Add -x/--discard-all.
11471 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11472 --discard-all. If the local symbol needs a dynamic entry, check
11473 that before handling --discard-locals.
11474
176fe33f
ILT
114752009-12-30 Ian Lance Taylor <iant@google.com>
11476
bb321bb1
ILT
11477 PR 10450
11478 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11479 flags to PF_R.
11480 (Output_segment::add_output_section): Don't change the flags if
11481 the type is PT_TLS.
11482
176fe33f
ILT
11483 PR 10450
11484 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11485 GNU hash table if they need a dynamic value. Otherwise, don't add
11486 them if they are defined in a dynamic object or are forced local.
11487
e8cd95c7
ILT
114882009-12-29 Ian Lance Taylor <iant@google.com>
11489
1b81fb71
ILT
11490 PR 10450
11491 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11492 .gnu.hash table for a 32-bit target.
11493
8d6d383d
ILT
11494 PR 10450
11495 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11496 regular and a dynamic object only needs a dynamic symbol table
11497 entry if it is externally visible.
11498
e785ec03
ILT
11499 PR 10450
11500 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11501 constructor. Add global_offset_table_ field.
11502 (Target_i386::got_section): Set global_offset_table_.
11503 (Target_i386::do_finalize_sections): Set global_offset_table_
11504 size.
11505 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11506 in constructor. Add global_offset_table_ field.
11507 (Target_x86_64::got_section): Set global_offset_table_.
11508 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11509 size.
11510
1a2dff53
ILT
11511 * layout.cc (Layout::Layout): Initialize increase_relro_.
11512 (Layout::get_output_section): Add is_relro, is_last_relro, and
11513 is_first_non_relro parameters. Change all callers.
11514 (Layout::choose_output_section): Likewise.
11515 (Layout::add_output_section_data): Likewise.
11516 (Layout::make_output_section): Likewise.
11517 (Layout::set_segment_offsets): Clear increase_relro when using a
11518 linker script.
11519 * layout.h (class Layout): Add increase_relro method. Add
11520 increase_relro_ field. Update declarations.
11521 * output.cc (Output_section::Output_section): Initialize
11522 is_last_relro_ and is_first_non_relro_.
11523 (Output_segment::add_output_section): Group relro sections is
11524 do_sort is true. Handle is_last_relro and is_first_non_relro.
11525 (Output_segment::maximum_alignment): Remove relro handling.
11526 (Output_segment::set_section_addresses): Add increase_relro
11527 parameter. Change all callers. Add initial alignment to align
11528 relro sections on separate page. Remove old relro handling.
11529 (Output_segment::set_section_list_addresses): Remove in_relro
11530 parameter. Change all callers.
11531 (Output_segment::set_offset): Add increase parameter. Change all
11532 callers. Remove old relro handling.
11533 * output.h (class Output_section): Add new methods: is_last_relro,
11534 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11535 Add is_last_relro_ and is_first_non_relro_ fields.
11536 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11537 Create separate .got.plt section. Call increase_relro.
11538 * x86_64.cc (Target_x86_64::got_section): Likewise.
11539 * testsuite/relro_script_test.t: Add .got.plt.
11540
f0ba79e2
ILT
11541 PR 10450
11542 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11543 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11544 (Layout::finalize): Call set_dynamic_symbol_size.
11545 (Layout::set_dynamic_symbol_size): New function.
11546 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11547 set_dynamic_symbol_size.
11548
e8cd95c7
ILT
11549 PR 10450
11550 * output.h (class Output_section): Add is_entsize_zero_ field.
11551 * output.cc (Output_section::Output_section): Initialize
11552 is_entsize_zero_.
11553 (Output_section::set_entsize): If two different entsizes are
11554 requested, force it to zero.
11555 (Output_section::add_input_section): Set flags for .debug_str
11556 before updating section flags. Set entsize.
11557 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11558 and SHF_STRING if all input sections have those flags.
11559
3e1b9a8a
RÁE
115602009-12-29 Rafael Espindola <espindola@google.com>
11561
11562 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11563 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11564 reporting.
3e1b9a8a 11565
3dcad376
ST
115662009-12-29 Sriraman Tallam <tmsriram@google.com>
11567
11568 * options.cc (General_options::parse_version): Allow -v to exit
11569 without an error if there is nothing to link.
11570
084e2665
ILT
115712009-12-29 Ian Lance Taylor <iant@google.com>
11572
11573 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11574 using a version of gcc before 4.1.
11575 * configure: Rebuild.
11576
250acde3
CD
115772009-12-28 Chris Demetriou <cgd@google.com>
11578
11579 * attributes.cc (Output_attributes_section_data::do_write): Use
11580 std::vector::front rather than std::vector::data.
11581
99fff23b
ILT
115822009-12-28 Ian Lance Taylor <iant@google.com>
11583
11584 * symtab.h (class Symbol_table): Add enum Defined.
11585 * resolve.cc (Symbol_table::should_override): Add defined
11586 parameter. Change all callers. Test whether object is NULL
11587 before calling a method on it.
11588 (Symbol_table::report_resolve_problem): Add defined parameter.
11589 Change all callers.
11590 (Symbol_table::should_override_with_special): Likewise.
11591 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11592 parameter. Change all callers.
11593 (Symbol_table::do_define_in_output_data): Likewise.
11594 (Symbol_table::define_in_output_segment): Likewise.
11595 (Symbol_table::do_define_in_output_segment): Likewise.
11596 (Symbol_table::define_as_constant): Likewise.
11597 (Symbol_table::do_define_as_constant): Likewise.
11598 * script.h (class Symbol_assignment): Add is_defsym parameter to
11599 constructor; change all callers.
11600 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11601 parameter. Change all callers. Add is_defsym_ field.
11602 (class Parser_closure): Add parsing_defsym parameter to
11603 constructor; change all callers. Add parsing_defsym accessor
11604 function. Add parsing_defsym_ field.
11605
556bd683
ILT
116062009-12-28 Ian Lance Taylor <iant@google.com>
11607
11608 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11609 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11610
1782c879
ILT
116112009-12-23 Ian Lance Taylor <iant@google.com>
11612
11613 * i386.cc (Target_i386::do_calls_non_split): Recognize
11614 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11615 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11616 -fsplit-stack prologue when using %r11.
1782c879 11617
329ca2b1
ST
116182009-12-21 Sriraman Tallam <tmsriram@google.com>
11619
11620 * options.cc (General_options::parse_version): Make -v continue and do
11621 the link like GNU ld does.
11622
d675ff46
RÁE
116232009-12-17 Rafael Avila de Espindola <espindola@google.com>
11624
11625 * Makefile.am (CCFILES): Add timer.cc.
11626 (HFILES): Add timer.h.
11627 * configure.ac: Check for sysconf and times.
11628 * main.cc: include timer.h.
11629 (main): Use Timer instead of get_run_time.
11630 * timer.cc: New.
11631 * timer.h: New.
11632 * workqueue.cc: include timer.h.
11633 (Workqueue::find_and_run_task):
11634 Report user, sys and wall time.
11635 * Makefile.in: Regenerate.
11636 * config.in: Regenerate.
11637 * configure: Regenerate.
11638
d6344fb5
DK
116392009-12-16 Doug Kwan <dougkwan@google.com>
11640
11641 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11642 sections.
11643 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11644 relaxed input sections.
11645 * output.cc (Output_section::find_relaxed_input_section): Change
11646 return type to Output_relaxed_input_section pointer. Adjust code
11647 for new type of relaxed_input_section_map_.
11648 * output.h (Output_section::find_relaxed_input_section): Change
11649 return type to Output_relaxed_input_section pointer.
11650 (Output_section::Output_relaxed_input_section_by_input_section_map):
11651 New type.
11652 (Output_section::relaxed_input_section_map_): Change type to
11653 Output_section::Output_relaxed_input_section_by_input_section_map.
11654 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11655 input section.
11656
0e0d5469
ILT
116572009-12-15 Ian Lance Taylor <iant@google.com>
11658
11659 * layout.cc (Layout::create_shstrtab): Only write out after input
11660 sections if we are compressing debug sections.
11661
0649a889
ILT
116622009-12-15 Ian Lance Taylor <iant@google.com>
11663
11664 * archive.cc (Archive::add_symbols): Only look up a symbol without
11665 a version if there is, in fact, a version.
11666
2ea97941
ILT
116672009-12-14 Ian Lance Taylor <iant@google.com>
11668
11669 Revert -Wshadow changes, all changes from:
11670 2009-12-11 Doug Kwan <dougkwan@google.com>
11671 2009-12-11 Nick Clifton <nickc@redhat.com>
11672 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11673
b0eec2cc
DK
116742009-12-11 Doug Kwan <dougkwan@google.com>
11675
11676 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11677 due to -Wshadow.
11678 * attributes.cc (Object_attribute::size): Ditto.
11679 (Attributes_section_data::size): Ditto.
11680 (Attributes_section_data::Attributes_section_data): Ditto.
11681 (Output_attributes_section_data::do_write): Ditto.
11682 * attributes.h (Object_attribute::set_type): Ditto.
11683 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11684
91d6fa6a
NC
116852009-12-11 Nick Clifton <nickc@redhat.com>
11686
11687 * archive.cc: Fix shadowed variable warnings.
11688 * arm.cc: Likewise.
11689 * compressed_output.cc: Likewise.
11690 * compressed_output.h: Likewise.
11691 * configure: Likewise.
11692 * dwarf_reader.cc: Likewise.
11693 * dynobj.cc: Likewise.
11694 * dynobj.h: Likewise.
11695 * ehframe.cc: Likewise.
11696 * ehframe.h: Likewise.
11697 * errors.cc: Likewise.
11698 * expression.cc: Likewise.
11699 * fileread.cc: Likewise.
11700 * fileread.h: Likewise.
11701 * freebsd.h: Likewise.
11702 * i386.cc: Likewise.
11703 * icf.cc: Likewise.
11704 * incremental.h: Likewise.
11705 * layout.cc: Likewise.
11706 * layout.h: Likewise.
11707 * mapfile.cc: Likewise.
11708 * merge.cc: Likewise.
11709 * merge.h: Likewise.
11710 * object.cc: Likewise.
11711 * object.h: Likewise.
11712 * options.h: Likewise.
11713 * output.cc: Likewise.
11714 * output.h: Likewise.
11715 * parameters.cc: Likewise.
11716 * plugin.cc: Likewise.
11717 * powerpc.cc: Likewise.
11718 * reduced_debug_output.cc: Likewise.
11719 * reduced_debug_output.h: Likewise.
11720 * reloc.cc: Likewise.
11721 * reloc.h: Likewise.
11722 * resolve.cc: Likewise.
11723 * script-sections.cc: Likewise.
11724 * script.cc: Likewise.
11725 * script.h: Likewise.
11726 * sparc.cc: Likewise.
11727 * symtab.cc: Likewise.
11728 * symtab.h: Likewise.
11729 * target-select.cc: Likewise.
11730 * target-select.h: Likewise.
11731 * token.h: Likewise.
11732 * workqueue.cc: Likewise.
11733 * workqueue.h: Likewise.
11734 * x86_64.cc: Likewise.
11735
a0351a69
DK
117362009-12-10 Doug Kwan <dougkwan@google.com>
11737
11738 * arm.cc (attributes.h): New include.
11739 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11740 (Arm_relobj::~Arm_relobj): Delete object pointed by
11741 attributes_section_data_.
11742 (Arm_relobj::attributes_section_data): New method definition.
11743 (Arm_relobj::attributes_section_data_): New data member declaration.
11744 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11745 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11746 attributes_section_data_.
11747 (Arm_dynobj::attributes_section_data): New method definition.
11748 (Arm_dynobj::attributes_section_data_): New data member declaration.
11749 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11750 initialization value of may_use_blx_ to false.
2e702c99 11751 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11752 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11753 object attributes to compute results instead of hard-coding.
11754 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11755 Target_arm::get_secondary_compatible_arch,
11756 Target_arm::set_secondary_compatible_arch
11757 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11758 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11759 New method declarations.
11760 (Target_arm::get_aeabi_object_attribute): New method definition.
11761 (Target_arm::attributes_section_data_): New data member declaration.
11762 (read_arm_attributes_section): New template definition.
11763 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11764 (Arm_dynobj::do_read_symbols): Ditto.
11765 (Target_arm::do_finalize_sections): Merge attributes sections from
11766 input. Check for BLX use after attributes section merging.
11767 Fix __exidx_start and __exidx_end visibility. Create an
11768 .ARM.attributes section if necessary.
11769 (Target_arm::get_secondary_compatible_arch,
11770 Target_arm::set_secondary_compatible_arch,
11771 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11772 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11773 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11774 New method definitions.
11775
b59befec
ILT
117762009-12-09 Ian Lance Taylor <iant@google.com>
11777
11778 * plugin.cc (Plugin::load): Don't cast from void* to a function
11779 pointer.
11780
1276bc89
ILT
117812009-12-09 Ian Lance Taylor <iant@google.com>
11782
11783 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11784 information fields.
11785
2f2de248
L
117862009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11787
11788 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11789 Replace two_file_shared_1.so with two_file_shared_2.so.
11790 * testsuite/Makefile.in: Regenerated.
11791
4f787271
DK
117922009-12-08 Doug Kwan <dougkwan@google.com>
11793
11794 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11795 (HFILES): Add attributes.h and int_encoding.h.
11796 * Makefile.in: Regenerate.
11797 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11798 function definitions to int_encoding.cc
11799 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11800 prototypes to int_encoding.h
11801 * reduced_debug_output.cc (int_encoding.h): New include.
11802 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11803 function definitions to int_encoding.cc
11804 (insert_into_vector, read_from_pointer): Move template definitions to
11805 int_encoding.h
11806 * attributes.cc: New file.
11807 * attributes.h: New file.
11808 * int_encoding.cc: New file.
11809 * int_encoding.h: New file.
11810
20b52f1a
RÁE
118112009-12-07 Rafael Avila de Espindola <espindola@google.com>
11812
11813 PR gold/11055
11814 * incremental-dump.cc (dump_incremental_inputs): New.
11815 (main): Use dump_incremental_inputs.
11816
53d7974c
L
118172009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11818
11819 PR gold/10893
11820 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11821 checking elfcpp::STT_FUNC.
11822 (Target_i386::Relocate::relocate): Likewise.
11823 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11824
11825 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11826 symbols from shared libraries into normal FUNC symbols.
11827
11828 * symtab.h (Symbol): Add is_func and use it.
11829
05a352e6
DK
118302009-12-05 Doug Kwan <dougkwan@google.com>
11831
11832 * arm.cc (Target_arm::arm_info): Initialize new fields
11833 attributes_section and attributes_vendor.
11834 * i386.cc (Target_i386::i386_info): Same.
11835 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11836 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11837 fields attributes_section and attributes_vendor.
53d7974c 11838 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11839 * target.h (Target::attributes_section, Target::attributes_vendor,
11840 Target::is_attributes_section, Target::attribute_arg_type,
11841 Target::attributes_order): New method definitions.
11842 (Target::Target_info::attributes_section,
11843 Target::Target_info::attributes_vendor): New fields.
11844 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11845 virtual method definitions.
11846 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11847 attributes_section and attributes_vendor.
11848 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11849
f4e5969c
DK
118502009-12-05 Doug Kwan <dougkwan@google.com>
11851
11852 * arm.cc: Update comments about interworking and stub generation.
11853 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11854 considered as non-PIC.
11855 (Arm_relocate_functions::base_abs): Fix formatting.
11856 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11857 of function to use GOT entry address instead of offset.
11858 (Target_arm::Scan::global): Issue an error if a symbol would need a
11859 PLT does not get one because it is untyped. Remove code to create
11860 dynamic symbols for relative branches.
11861 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11862 takes unsigned integer instead of boolean.
11863
1abce4a6
L
118642009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11865
11866 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11867 (two_file_test_LDADD): Likewise.
11868 (common_test_1_LDADD): Likewise.
11869 (exception_test_LDADD) Likewise.
11870 (weak_test_LDADD): Likewise.
11871 (many_sections_test_LDADD): Likewise.
11872 (initpri1_LDADD): Likewise.
11873 (script_test_1_LDADD): Likewise.
11874 (script_test_2_LDADD): Likewise.
11875 (justsyms_LDADD): Likewise.
11876 (binary_test_LDADD): Likewise.
11877 (large_LDADD): Likewise.
11878 * testsuite/Makefile.in: Regenerated.
11879
adcf2816 118802009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11881
adcf2816
L
11882 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11883 (Symbol_table::override_with_special): Likewise.
11884 (Symbol_table::add_from_object): Likewise.
11885
28e67f5d
RÁE
118862009-12-04 Rafael Avila de Espindola <espindola@google.com>
11887
11888 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11889 Don't set the data_offset twice.
11890
ae10a101
RÁE
118912009-12-04 Rafael Avila de Espindola <espindola@google.com>
11892
11893 * testsuite/Makefile.in: Regenerate.
11894
f59f41f3
DK
118952009-12-03 Doug Kwan <dougkwan@google.com>
11896
11897 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11898 (Target_arm::do_finalize_sections): Add parameter for symbol table
11899 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11900 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11901 parameter for symbol table pointer.
11902 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11903 an additional parameter for a pointer to symbol table.
11904 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11905 parameter for a symbol table pointer.
11906 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11907 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11908 Ditto.
11909 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11910 parameter for a symbol table pointer.
11911
ca55d848
RÁE
119122009-12-03 Rafael Avila de Espindola <espindola@google.com>
11913
11914 * incremental.cc (Incremental_inputs_header)
11915 (Incremental_inputs_header_write, Incremental_inputs_entry)
11916 (Incremental_inputs_entry_write): Move ...
11917 * incremental.h (Incremental_inputs_header)
11918 (Incremental_inputs_header_write, Incremental_inputs_entry)
11919 (Incremental_inputs_entry_write): here.
11920
3aec4f9c
RÁE
119212009-12-02 Rafael Avila de Espindola <espindola@google.com>
11922
11923 * incremental.cc (make_sized_incremental_binary): Set the target.
11924 Error if it is incompatible.
11925 * output.h (Output_file): Add filename method.
11926
9c0ae74d
RÁE
119272009-12-02 Rafael Avila de Espindola <espindola@google.com>
11928
11929 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11930 from the get_* methods.
11931
a45500ae
RÁE
119322009-12-02 Rafael Avila de Espindola <espindola@google.com>
11933
11934 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11935 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11936 Write 0 for the data_offset of scripts.
11937
325e6408
RÁE
119382009-12-02 Rafael Avila de Espindola <espindola@google.com>
11939
11940 * testsuite/Makefile.am: Add the incremental_test.sh test.
11941 * testsuite/incremental_test.sh: New.
11942 * testsuite/incremental_test_1.c: New.
11943 * testsuite/incremental_test_2.c: New.
11944
954c3e2e
RÁE
119452009-12-01 Rafael Avila de Espindola <espindola@google.com>
11946
703d02da 11947 * incremental-dump.cc (main): Fix typos.
954c3e2e 11948
f8086623
RÁE
119492009-11-27 Rafael Avila de Espindola <espindola@google.com>
11950
11951 PR gold/11025
11952 * incremental-dump.cc (main): Use llu to print 64 bit values.
11953
3b0dd6ac
L
119542009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11955 H.J. Lu <hongjiu.lu@intel.com>
11956
11957 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11958 $(LIBDL).
11959 (incremental_dump_LDADD): Likewise.
11960 * Makefile.in: Regenerated.
11961
a6d1ef57 119622009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11963
a6d1ef57
DK
11964 Revert:
11965
11966 2009-11-25 Doug Kwan <dougkwan@google.com>
11967
11968 * arm.cc (Target_arm::Target_arm): Move method definition
11969 outside of class definition. Add code to handle
11970 --target1-rel, --target1-abs and --target2= options.
11971 (Target_arm::get_reloc_reloc_type): Change method to be
11972 non-static and const.
11973 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11974 New data member declaration.
11975 (Target_arm::Scan::local, Target_arm::Scan::global,
11976 Target_arm::Relocate::relocate,
11977 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11978 Adjust call to Target_arm::get_real_reloc_type.
11979 (Target_arm::get_real_reloc_type): Use command line options
11980 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11981 * options.h (--target1-rel, --target1-abs, --target2): New
11982 ARM-only options.
11983
50aeb7d4
DK
119842009-11-25 Doug Kwan <dougkwan@google.com>
11985
11986 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11987 class definition. Add code to handle --target1-rel, --target1-abs
11988 and --target2= options.
11989 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11990 and const.
11991 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11992 member declaration.
11993 (Target_arm::Scan::local, Target_arm::Scan::global,
11994 Target_arm::Relocate::relocate,
11995 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11996 call to Target_arm::get_real_reloc_type.
11997 (Target_arm::get_real_reloc_type): Use command line options to
11998 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11999 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12000 options.
12001
51938283
DK
120022009-11-25 Doug Kwan <dougkwan@google.com>
12003
12004 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12005 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12006 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12007 formatting.
12008 (Arm_relocate_functions::thm_call): Replace body with a call to
12009 Arm_relocate_functions::thumb_branch_common.
12010 (Arm_relocate_functions::thm_jump24,
12011 Arm_relocate_functions::thm_xpc22): New method definitions.
12012 (Arm_relocate_functions::thumb_branch_common): New method definition.
12013 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12014 operator.
12015 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12016 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12017
e2b8f3c4
RÁE
120182009-11-24 Rafael Avila de Espindola <espindola@google.com>
12019
12020 * Makefile.am: Build incremental-dump
12021 * Makefile.in: Regenerate.
12022 * incremental-dump.cc: New.
12023 * incremental.cc (Incremental_inputs_header_data,
12024 Incremental_inputs_entry_data): Move to incremental.h
12025 * incremental.h: (Incremental_inputs_header_data,
12026 Incremental_inputs_entry_data): Move from incremental.cc
12027
bcba9aec
RÁE
120282009-11-24 Rafael Avila de Espindola <espindola@google.com>
12029
12030 * incremental.cc (Incremental_inputs_header,
12031 Incremental_inputs_header_write, Incremental_inputs_entry,
12032 Incremental_inputs_entry_write): Add a typedef with the data type.
12033
7c3afe08
RÁE
120342009-11-24 Rafael Avila de Espindola <espindola@google.com>
12035
12036 * incremental.cc (Incremental_inputs_header,
12037 Incremental_inputs_header_write, Incremental_inputs_entry,
12038 Incremental_inputs_entry_write): Update comment about which
12039 type has the filed descriptions.
12040
d204b6e9
DK
120412009-11-15 Doug Kwan <dougkwan@google.com>
12042
12043 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12044 (Arm_relocate_functions::arm_branch_common): Change method defintion
12045 in class definition to a method declaration and update list of formal
12046 parameters.
12047 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12048 Arm_relocation_functions::jump24): Adjust call to
12049 Arm_relocate_functions::arm_branch_common. Update list of formal
12050 parameters.
12051 (Arm_relocate_functions::xpc25): New method definition.
12052 (Arm_relocate_functions::arm_branch_common): Move method defintion
12053 out from class definition. Use stubs for mode-switching and extending
12054 branch ranges.
12055 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12056 specially. Change code to enable use of stubs in ARM branches.
12057
43d12afe
DK
120582009-11-10 Doug Kwan <dougkwan@google.com>
12059
12060 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12061 in method declaration.
12062 (Target_arm::relocate_stub): New method declaration.
12063 (Target_arm::default_target): Change to return a pointer instead of
12064 a const reference.
12065 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12066 Target_arm::default_target.
12067 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12068 method definition.
12069 (Target_arm::relocate_section): Adjust view.
12070 (Target_arm::relocate_stub): New method definition.
12071
ac33a407
DK
120722009-11-10 Doug Kwan <dougkwan@google.com>
12073
12074 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12075 a format warning.
12076 * incremental.cc (open_incremental_binary): Initialized local
12077 variables to avoid warnings.
12078 * object.cc (make_elf_object): Ditto.
12079 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12080 a format warning.
e1df38aa 12081
88ee28e9
L
12082009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12083
12084 PR gold/10930
12085 * testsuite/plugin_test.c: Include "config.h".
12086
2daedcd6
DK
120872009-11-09 Doug Kwan <dougkwan@google.com>
12088
12089 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12090 (arm_symbol_value): Remove.
12091 (Arm_relocate_functions::arm_branch_common,
12092 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12093 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12094 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12095 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12096 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12097 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12098 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12099 Arm_relocate_functions::thm_mobw_abs_nc,
12100 Arm_relocate_functions::thm_mov_abs,
12101 Arm_relocate_functions::movw_prel_nc,
12102 Arm_relocate_functions::thm_movt_abs,
12103 Arm_relocate_functions::movt_prel,
12104 Arm_relocate_functions::thm_movw_prel_nc,
12105 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12106 (Target_arm::Relocate::relocate): Only decompose address into two
12107 parts if relocation type uses the thumb-bit and pass the actual
12108 bit instead of a flag indicating that the thumb-bit is used. Adjust
12109 calls to methods in Arm_relocate_functions for this change.
12110
1276bc89 121112009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12112
12113 PR 10925
12114 * reloc.cc: Instantiate
12115 Sized_relobj::initialize_input_to_output_maps and
12116 Sized_relobj:free_input_to_output_maps.
12117
e53ad1b5
ILT
121182009-11-06 Ian Lance Taylor <iant@google.com>
12119
12120 PR 10876
12121 * defstd.cc (in_segment): Set only_if_ref true for "end".
12122
eb44217c
DK
121232009-11-06 Doug Kwan <dougkwan@google.com>
12124
12125 * arm.cc (class Reloc_stub): Correct a comment.
12126 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12127 (Target_arm::scan_section_for_stubs): New method declaration.
12128 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12129 Change methods from private to protected.
12130 (Target_arm::do_may_relax): New method definition.
12131 (Target_arm::do_relax, Target_arm::group_sections,
12132 Target_arm::scan_reloc_for_stub,
12133 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12134 (Target_arm::arm_input_section_map_): New data member declaration.
12135 (Target_arm::scan_reloc_for_stub,
12136 Target_arm::scan_reloc_section_for_stubs,
12137 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12138 Target_arm::do_relax): New method definitions.
12139
5d329b7d
ILT
121402009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12141
12142 * configure.ac: Check for (struct stat)::st_mtim
12143 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12144 * config.in: Regenerate.
12145 * configure: Regenerate.
12146
96a0d71b
ILT
121472009-11-05 Ian Lance Taylor <iant@google.com>
12148
12149 PR 10910
12150 * output.cc (Output_segment::add_output_section): Add missing
12151 return statement.
12152
594c8e5e
ILT
121532009-11-04 Ian Lance Taylor <iant@google.com>
12154
12155 PR 10880
12156 * object.h (class Object): Add is_needed and set_is_needed
12157 methods. Add is_needed_ field. Make bool fields into bitfields.
12158 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12159 defined in a dynamic object and referenced by a regular object,
12160 set is_needed for the dynamic object.
12161 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12162 if the file is marked with as_needed and it is not needed.
12163
22b127cc
ILT
121642009-11-04 Ian Lance Taylor <iant@google.com>
12165
12166 PR 10887
12167 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12168 tags if data is discarded by linker script.
12169 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12170 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12171 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12172 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12173
f5c870d2
ILT
121742009-11-04 Ian Lance Taylor <iant@google.com>
12175
12176 * layout.cc (Layout::get_output_section): Add is_interp and
12177 is_dynamic_linker_section parameters. Change all callers.
12178 (Layout::choose_output_section): Likewise.
12179 (Layout::make_output_section): Likewise.
12180 (Layout::add_output_section_data): Add is_dynamic_linker_section
12181 parameter. Change all callers.
12182 * layout.h (class Layout): Update declarations.
12183 * output.h (class Output_section): Add is_interp, set_is_interp,
12184 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12185 Add is_interp_, is_dynamic_linker_section_ fields. Change
12186 generate_code_fills_at_write_ to a bitfield.
12187 * output.cc (Output_section::Output_sections): Initialize new
12188 fields.
12189 (Output_segment::add_output_section): Add do_sort parameter.
12190 Change all callers.
12191
1ae4d23b
ILT
121922009-11-03 Ian Lance Taylor <iant@google.com>
12193
12194 PR 10860
12195 * options.h (class General_options): Add --warn-common.
12196 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12197 merging two common symbols.
12198 (Symbol_table::should_override): Handle --warn-common when merging
12199 a common symbol with a defined symbol. Use report_resolve_problem
12200 for multiple definitions.
12201 (Symbol_table::report_resolve_problem): New function.
12202 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12203
55da9579
DK
122042009-11-03 Doug Kwan <dougkwan@google.com>
12205
12206 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12207 stub_factory_.
12208 (Target_arm::stub_factory): New method definition.
12209 (Target_arm::new_arm_input_section,
12210 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12211 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12212 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12213 New type definitions.
12214 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12215 member declarations.
12216 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12217 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12218 New method definitions.
12219
37a9ac43
ILT
122202009-11-03 Ian Lance Taylor <iant@google.com>
12221
12222 * options.h (class General_options): Add --warn_constructors.
12223
b3d6a3d4
ILT
122242009-11-03 Ian Lance Taylor <iant@google.com>
12225
12226 PR 10893
12227 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12228 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12229
934b01dd
ILT
122302009-11-03 Ian Lance Taylor <iant@google.com>
12231
12232 PR 10895
12233 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12234 --msgid-bugs-address.
12235 (install-pdf): New target.
12236 (install-data_yes): Look up one directory to find mkinstalldirs.
12237
03c1939b
L
122382009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12239
12240 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12241 tree.
12242
ebd95253
DK
122432009-10-30 Doug Kwan <dougkwan@google.com>
12244
12245 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12246
e9bbb538
DK
122472009-10-30 Doug Kwan <dougkwan@google.com>
12248
12249 * arm.cc (Stub_addend_reader): New struct template definition
12250 and partial specializations.
12251 (Stub_addend_reader::operator()): New method definition for a
12252 partially specialized template.
12253
d5b40221
DK
122542009-10-30 Doug Kwan <dougkwan@google.com>
12255
12256 * arm.cc (Arm_relobj::processor_specific_flags): New method
12257 definition.
12258 (Arm_relobj::do_read_symbols): New method declaration.
12259 (Arm_relobj::processor_specific_flags_): New data member declaration.
12260 (Arm_dynobj): New class definition.
12261 (Target_arm::do_finalize_sections): Add input_objects parameter.
12262 (Target_arm::do_adjust_elf_header): New method declaration.
12263 (Target_arm::are_eabi_versions_compatible,
12264 (Target_arm::merge_processor_specific_flags): New method declaration.
12265 (Target_arm::do_make_elf_object): New overloaded method definitions
12266 and declaration.
12267 (Arm_relobj::do_read_symbols): New method definition.
12268 (Arm_dynobj::do_read_symbols): Ditto.
12269 (Target_arm::do_finalize_sections): Add input_objects parameters.
12270 Merge processor-specific flags from all input objects.
12271 (Target_arm::are_eabi_versions_compatible,
12272 Target_arm::merge_processor_specific_flags,
12273 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12274 New method definitions.
12275 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12276 Input_objects pointer type parameter.
12277 * layout.cc (Layout::finalize): Pass input objects to target's.
12278 finalize_sections function.
12279 * output.cc (Output_file_header::do_sized_write): Set ELF file
12280 header's processor-specific flags.
12281 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12282 Input_objects pointer type parameter.
12283 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12284 * target.h (Input_objects): New forward class declaration.
12285 (Target::processor_specific_flags,
12286 Target::are_processor_specific_flags_sect): New method definitions.
12287 (Target::finalize_sections): Add input_objects parameter.
12288 (Target::Target): Initialize processor_specific_flags_ and
12289 are_processor_specific_flags_set_.
12290 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12291 parameter.
12292 (Target::set_processor_specific_flags): New method definition.
12293 (Target::processor_specific_flags_,
12294 Target::are_processor_specific_flags_set_): New data member
12295 declarations.
12296 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12297 Input_objects pointer type parameter.
12298
ebabffbd
DK
122992009-10-30 Doug Kwan <dougkwan@google.com>
12300
12301 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12302
ad0f2072
ILT
123032009-10-28 Ian Lance Taylor <iant@google.com>
12304
12305 * object.h (class Relobj): Drop options parameter from
12306 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12307 do_scan_relocs, do_relocate. Change all callers.
12308 (class Sized_relobj): Drop options parameters from
12309 do_gc_process_relocs, do_scan_relocs, do_relocate,
12310 do_relocate_sections, relocate_sections, emit_relocs_scan,
12311 emit_relocs_scan_reltype. Change all callers.
12312 (struct Relocate_info): Remove options field and all references to
12313 it.
12314 * reloc.h (class Read_relocs): Remove options constructor
12315 parameter and options_ field. Change all callers.
12316 (class Gc_process_relocs, class Scan_relocs): Likewise.
12317 (class Relocate_task): Likewise.
12318 * target-reloc.h (scan_relocs): Remove options parameter. Change
12319 all callers.
12320 (scan_relocatable_relocs): Likewise.
12321 * target.h (class Sized_target): Remove options parameter from
12322 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12323 all callers.
12324 * gc.h (gc_process_relocs): Remove options parameter. Change all
12325 callers.
12326 * arm.cc: Update functions to remove options parameters.
12327 * i386.cc: Likewise.
12328 * powerpc.cc: Likewise.
12329 * sparc.cc: Likewise.
12330 * x86_64.cc: Likewise.
12331 * testsuite/testfile.cc: Likewise.
12332
8ffa3667
DK
123332009-10-28 Doug Kwan <dougkwan@google.com>
12334
12335 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12336 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12337 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12338 New method definitions.
12339
40f36857
CC
123402009-10-28 Cary Coutant <ccoutant@google.com>
12341
12342 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12343 (Plugin::cleanup_done_): New member.
12344 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12345 (Plugin_manager::cleanup_done_): Remove.
12346 (Plugin_manager::add_input_file): Edit error message.
12347 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12348 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12349
2c849493
ILT
123502009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12351
12352 * fileread.cc: (File_read::View::~View): Use the new
12353 data_ownership_ filed.
12354 (File_read::~File_read): Dispose the new whole_file_view_.
12355 (File_read::open): Mmap the whole file if needed.
12356 (File_read::open): Use whole_file_view_ instead of contents_.
12357 (File_read::find_view): Use whole_file_view_ if applicable.
12358 (File_read::do_read): Use whole_file_view_ instead of contents_.
12359 (File_read::make_view): Use whole_file_view_ instead of contents_,
12360 update File_read::View::View call.
12361 (File_read::find_or_make_view): Update File_read::View::View
12362 call.
12363 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12364 remove contents_
12365 (File_read::View::Data_ownership): New enum.
12366 (File_read::View::View): Replace bool mapped_ with Data_ownership
12367 argument.
12368 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12369 (File_read::View::data_ownership_): New field.
12370 (File_read::contents_): Remove (replaced by whole_file_view_).
12371 (File_read::whole_file_view_): New field.
12372 * options.h (class General_options): Add --keep-files-mapped.
12373
24998053
CC
123742009-10-27 Cary Coutant <ccoutant@google.com>
12375
12376 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12377 * testsuite/Makefile.am (plugin_test_5): New test case.
12378 * testsuite/Makefile.in: Regenerate.
12379
72adc4fa
DK
123802009-10-25 Doug Kwan <dougkwan@google.com>
12381
12382 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12383 from private to protected to allow access by child class.
12384 (Sized_relobj::do_relocate_sections): New method declaration.
12385 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12386 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12387 Sized_relobj::relocate_sections. Instantiate template explicitly
12388 for different target sizes and endianity.
12389
07f508a2
DK
123902009-10-24 Doug Kwan <dougkwan@google.com>
12391
12392 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12393 (Arm_input_section::as_arm_input_section): New method.
12394 (Arm_output_section): New class definition.
12395 (Arm_output_section::create_stub_group,
12396 Arm_output_section::group_sections): New method definitions.
12397
10ad9fe5
DK
123982009-10-22 Doug Kwan <dougkwan@google.com>
12399
12400 * arm.cc (Arm_input_section): New class definition.
12401 (Arm_input_section::init, Arm_input_section:do_write,
12402 Arm_input_section::set_final_data_size,
12403 Arm_input_section::do_reset_address_and_file_offset): New method
12404 definitions.
12405
56ee5e00
DK
124062009-10-21 Doug Kwan <dougkwan@google.com>
12407
12408 * arm.cc (Stub_table, Arm_input_section): New forward class
12409 declarations.
12410 (Stub_table): New class defintion.
12411 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12412 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12413 New method definition.
12414
b569affa
DK
124152009-10-21 Doug Kwan <dougkwan@google.com>
12416
12417 * arm.cc: Update copyright comments.
12418 (Target_arm): New forward class template declaration.
12419 (Arm_address): New type.
12420 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12421 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12422 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12423 constants.
12424 (Insn_template): Same.
12425 (DEF_STUBS): New macro.
12426 (Stub_type): New enum type.
12427 (Stub_template): New class definition.
12428 (Stub): Same.
12429 (Reloc_stub): Same.
12430 (Stub_factory): Same.
12431 (Target_arm::Target_arm): Initialize may_use_blx_ and
12432 should_force_pic_veneer_.
12433 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12434 Target_arm::should_force_pic_veneer,
12435 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12436 Target_arm::using_thumb_only, Target_arm:;default_target): New
12437 method defintions.
12438 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12439 New data member declarations.
12440 (Insn_template::size, Insn_template::alignment): New method defintions.
12441 (Stub_template::Stub_template): New method definition.
12442 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12443 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12444 (Stub_factory::Stub_factory): New method definition.
12445 * gold.h (string_hash): New template.
12446 * output.h (Input_section_specifier::hash_value): Use
12447 gold::string_hash.
12448 (Input_section_specifier::string_hash): Remove.
12449 * stringpool.cc (Stringpool_template::string_hash): Use
12450 gold::string_hash.
12451
6c172549
DK
124522009-10-20 Doug Kwan <dougkwan@google.com>
12453
12454 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12455 symbols of relaxed input sections.
12456 * output.h (Output_section::find_relaxed_input_section): Make
12457 method public.
12458
c5617f2f
DK
124592009-10-16 Doug Kwan <dougkwan@google.com>
12460
12461 * dynobj.cc (Versions::Versions): Initialize version_script_.
12462 Only insert base version symbol definition for a shared object
12463 if version script defines any version versions.
12464 (Versions::define_base_version): New method definition.
12465 (Versions::add_def): Check that base version is not needed.
12466 (Versions::add_need): Define base version lazily.
12467 * dynobj.h (Versions::define_base_version): New method declaration.
12468 (Versions::needs_base_version_): New data member declaration.
12469 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12470 (check_DATA): Add no_version_test.stdout.
12471 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12472 New make rules.
12473 * testsuite/Makefile.in: Regenerate.
12474 * testsuite/no_version_test.c: New file.
12475 * testsuite/no_version_test.sh: Ditto.
12476
3c12dcdb
DK
124772009-10-16 Doug Kwan <dougkwan@google.com>
12478
12479 * expression.cc (class Segment_start_expression): New class definition.
12480 (Segment_start_expression::value): New method definition.
12481 (script_exp_function_segment_start): Return a new
12482 Segment_start_expression.
12483 * gold/script-c.h (script_saw_segment_start_expression): New function
12484 prototype.
12485 * script-sections.cc (Script_sections::Script_sections): Initialize
12486 SAW_SEGMENT_START_EXPRESSION_ to false.
12487 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12488 and -Tbbs options to specify section addresses if given in
12489 command line and no SEGMENT_START expression is seen in a script.
12490 * script-sections.h (Script_sections::saw_segment_start_expression,
12491 Script_sections::set_saw_segment_start_expression): New method
12492 definition.
12493 (Script_sections::saw_segment_start_expression_): New data member
12494 declaration.
12495 * script.cc (script_saw_segment_start_expression): New function.
12496 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12497 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12498 script_test_7.sh and script_test_8.sh.
12499 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12500 script_test_8.stdout.
12501 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12502 (script_test_6, script_test_6.stdout, script_test_7,
12503 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12504 * Makefile.in: Regenerate.
12505 * testsuite/script_test_6.sh: New file.
12506 * testsuite/script_test_6.t: Same.
12507 * testsuite/script_test_7.sh: Same.
12508 * testsuite/script_test_7.t: Same.
12509 * testsuite/script_test_8.sh: Same.
12510
64b1ae37
DK
125112009-10-16 Doug Kwan <dougkwan@google.com>
12512
12513 * output.cc (Output_segment::set_section_list_address): Cast
12514 expressions to unsigned long long type to avoid format warnings.
12515
661be1e2
ILT
125162009-10-15 Ian Lance Taylor <iant@google.com>
12517
12edd763 12518 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12519 dot assignment to script_sections_.
12edd763
ILT
12520 * script-sections.cc (Script_sections::add_dot_assignment):
12521 Initialize if necessary.
12522
68b6574b
ILT
12523 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12524 program headers with no load segment if there is a linker script.
12525
661be1e2
ILT
12526 * layout.cc (Layout::set_segment_offsets): Align the file offset
12527 to the segment aligment for -N or -n with no load segment.
12528 * output.cc (Output_segment::add_output_section): Don't crash if
12529 the first section is a TLS section.
12530 (Output_segment::set_section_list_addresses): Print an error
12531 message if the address moves backward in a linker script.
12532 * script-sections.cc
12533 (Output_section_element_input::set_section_addresses): Don't
12534 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12535 (Orphan_output_section::set_section_addresses): Likewise.
12536
f15f61a7
DK
125372009-10-15 Doug Kwan <dougkwan@google.com>
12538
12539 * layout.cc (Layout::finish_dynamic_section): Generate tags
12540 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12541 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12542 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12543
82bb573a
ILT
125442009-10-14 Ian Lance Taylor <iant@google.com>
12545
12546 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12547 fields.
12548 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12549 data_shdr fields of relinfo.
12550 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12551 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12552 R_386_TLS_LDO_32, adjust based on section flags.
12553 (Target_i386::Relocate::fix_up_ldo): Remove.
12554
374ad285
ILT
125552009-10-13 Ian Lance Taylor <iant@google.com>
12556
12557 Add support for -pie.
12558 * options.h (class General_options): Add -pie and
12559 --pic-executable.
12560 (General_options::output_is_position_independent): Test -pie.
12561 (General_options::output_is_executable): Return true if not shared
12562 and not relocatable.
12563 (General_options::output_is_pie): Remove.
12564 * options.cc (General_options::finalize): Reject incompatible uses
12565 of -pie.
12566 * gold.cc (queue_middle_tasks): A -pie link is not static.
12567 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12568 * symtab.cc (Symbol::final_value_is_known): Return false if
12569 output_is_position_independent.
12570 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12571 output_is_position_independent.
12572 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12573 output_is_position_independent.
12574 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12575 output_is_position_independent.
12576 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12577 two_file_pie_test.
12578 (basic_pie_test.o, basic_pie_test): New targets.
12579 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12580 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12581 (two_file_pie_test): New target.
12582 * testsuite/Makefile.in: Rebuild.
12583 * README: Remove note saying that -pie is not supported.
12584
c6585162
ILT
125852009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12586
12587 * options.h (class General_options): Add -init and -fini.
12588 * layout.cc (Layout::finish_dynamic_section): Emit
12589 given init and fini functions.
12590
032ce4e9
ST
125912009-10-13 Sriraman Tallam <tmsriram@google.com>
12592
12593 * gc.h (gc_process_relocs): Check if icf is enabled using new
12594 function.
12595 * gold.cc (queue_initial_tasks): Likewise.
12596 (queue_middle_tasks): Likewise.
12597 * object.cc (do_layout): Likewise.
12598 * symtab.cc (is_section_folded): Likewise.
12599 * main.cc (main): Likewise.
12600 * reloc.cc (Read_relocs::run): Likewise.
12601 (Sized_relobj::do_scan_relocs): Likewise.
12602 * icf.cc (is_function_ctor_or_dtor): New function.
12603 (Icf::find_identical_sections): Check if function is ctor or dtor when
12604 safe icf is chosen.
12605 * options.h (General_options::icf): Change option to be an enum.
12606 (Icf_status): New enum.
12607 (icf_enabled): New method.
12608 (icf_safe_folding): New method.
12609 (set_icf_status): New method.
12610 (icf_status_): New variable.
12611 * (options.cc) (General_options::finalize): Set icf_status_.
12612 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12613 icf_test and icf_keep_unique_test to use the --icf enum flag.
12614 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12615 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12616
f345227a
ST
126172009-10-12 Sriraman Tallam <tmsriram@google.com>
12618
12619 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12620 includes to gc.h and icf.h.
12621 * arm.cc: Include gc.h.
12622 * gold.cc: Likewise.
12623 * i386.cc: Likewise.
12624 * powerpc.cc: Likewise.
12625 * sparc.cc: Likewise.
12626 * x86_64.cc: Likewise.
12627 * gc.h: Include icf.h.
12628
1c7814ed
ILT
126292009-10-11 Ian Lance Taylor <iant@google.com>
12630
12631 * plugin.cc: Include "gold.h" before other header files.
12632
ae3b5189
CD
126332009-10-10 Chris Demetriou <cgd@google.com>
12634
12635 * options.h (Input_file_argument::Input_file_type): New enum.
12636 (Input_file_argument::is_lib_): Replace with...
12637 (Input_file_argument::type_): New member.
12638 (Input_file_argument::Input_file_argument): Take Input_file_type
12639 'type' rather than boolean 'is_lib' as second argument.
12640 (Input_file_argument::is_lib): Use type_.
12641 (Input_file_argument::is_searched_file): New function.
12642 (Input_file_argument::may_need_search): Handle is_searched_file.
12643 * options.cc (General_options::parse_library): Support -l:filename.
12644 (General_options::parse_just_symbols): Update for Input_file_argument
12645 changes.
12646 (Command_line::process): Likewise.
12647 * archive.cc (Archive::get_file_and_offset): Likewise.
12648 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12649 * script.cc (read_script_file, script_add_file): Likewise.
12650 * fileread.cc (Input_file::Input_file): Likewise.
12651 (Input_file::will_search_for): Handle is_searched_file.
12652 (Input_file::open): Likewise.
12653 * readsyms.cc (Read_symbols::get_name): Likewise.
12654 * testsuite/Makefile.am (searched_file_test): New test.
12655 * testsuite/Makefile.in: Regenerate.
12656 * testsuite/searched_file_test.cc: New file.
12657 * testsuite/searched_file_test_lib.cc: New file.
12658
f3048a1d
ILT
126592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12660 Ian Lance Taylor <iant@google.com>
12661
12662 * descriptor.cc: Include <cstdio> and "binary-io.h".
12663 (Descriptors::open): Open the files in binary mode always.
12664 * script.cc (Lex::get_token): Treat \r as whitespace.
12665
d4780e57
ILT
126662009-10-09 Ian Lance Taylor <iant@google.com>
12667
12668 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12669
d9a893b8
ILT
126702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12671 Ian Lance Taylor <iant@google.com>
12672
12673 * configure.ac: Check for readv function also.
12674 * fileread.cc (readv): Define if not HAVE_READV.
12675 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12676 does not exist.
12677 * config.in: Regenerate.
12678 * configure: Regenerate.
12679
c0a62865
DK
126802009-10-09 Doug Kwan <dougkwan@google.com>
12681
12682 * layout.cc (Layout::make_output_section): Call target hook to make
12683 ordinary output section.
12684 (Layout::finalize): Adjust parameter list of call the
12685 Target::may_relax().
12686 * layout.h (class Layout::section_list): New method.
12687 * merge.h (Output_merge_base::entsize): Change visibility to public.
12688 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12689 New methods.
12690 (Output_merge_string::do_is_string): New method.
12691 * object.cc (Sized_relobj::do_setup): renamed from
12692 Sized_relobj::set_up.
12693 * object.h (Sized_relobj::adjust_shndx,
12694 Sized_relobj::initializ_input_to_output_maps,
12695 Sized_relobj::free_input_to_output_maps): Change visibilities to
12696 protected.
12697 (Sized_relobj::setup): Virtualize.
12698 (Sized_relobj::do_setup): New method declaration.
12699 (Sized_relobj::invalidate_section_offset,
12700 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12701 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12702 * options.cc (parse_int): New function.
12703 * options.h (parse_int): New declaration.
12704 (DEFINE_int): New macro.
12705 (stub_group_size): New option.
12706 * output.cc (Output_section::Output_section): Initialize memebers
12707 merge_section_map_, merge_section_by_properties_map_,
12708 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12709 (Output_section::add_input_section): Handled deferred code-fill
12710 generation and remove an old comment.
12711 (Output_section::add_relaxed_input_section): New method definition.
12712 (Output_section::add_merge_input_section): Use merge section by
12713 properties map to speed to search. Update merge section maps
12714 as appropriate.
12715 (Output_section::build_relaxation_map): New method definition.
12716 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12717 Same.
12718 (Output_section::relax_input_section): Renamed to
12719 Output_section::convert_input_sections_to_relaxed_sections and change
12720 interface to take a vector of pointers to relaxed sections.
12721 (Output_section::find_merge_section,
12722 Output_section::find_relaxed_input_section): New method definitions.
12723 (Output_section::is_input_address_mapped,
12724 Output_section::output_offset, Output_section::output_address):
12725 Use output section data maps to speed up searching.
12726 (Output_section::find_starting_output_address): Add comments.
12727 (Output_section::do_write,
12728 Output_section::write_to_postprocessing_buffer): Do code-fill
12729 generation as appropriate.
12730 (Output_section::get_input_sections): Invalidate relaxed input section
12731 map.
12732 (Output_section::restore_states): Adjust type of checkpoint .
12733 Invalidate relaxed input section map.
12734 * output.h (Output_merge_base): New class declaration.
12735 (Input_section_specifier): New class defintion.
12736 (class Output_relaxed_input_section) Change base class to
12737 Output_section_data_build.
12738 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12739 base class initializer.
12740 (Output_section::add_relaxed_input_section): New method declaration.
12741 (Output_section::Input_section): Change visibility to protected.
2e702c99 12742 (Output_section::Input_section::relobj,
c0a62865
DK
12743 Output_section::Input_section::shndx): Handle relaxed input sections.
12744 Output_section::input_sections) Change visibility to protected. Also
12745 define overload to return a non-const pointer.
12746 (Output_section::Merge_section_properties): New class defintion.
12747 (Output_section::Merge_section_by_properties_map,
12748 Output_section::Output_section_data_by_input_section_map,
12749 Output_section::Relaxation_map): New types.
12750 (Output_section::relax_input_section): Rename method to
12751 Output_section::convert_input_sections_to_relaxed_sections and change
12752 interface to take a vector of relaxed section pointers.
12753 (Output_section::find_merge_section,
12754 Output_section::find_relaxed_input_section,
12755 Output_section::build_relaxation_map,
12756 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12757 New method declarations.
12758 (Output_section::merge_section_map_
12759 Output_section::merge_section_by_properties_map_,
12760 Output_section::relaxed_input_section_map_,
12761 Output_section::is_relaxed_input_section_map_valid_,
12762 Output_section::generate_code_fills_at_write_): New data members.
12763 * script-sections.cc
12764 (Output_section_element_input::set_section_addresses): Call
12765 current_data_size and addralign methods of relaxed input sections.
12766 (Orphan_output_section::set_section_addresses): Call current_data_size
12767 and addralign methods of relaxed input sections.
12768 * symtab.cc (Symbol_table::compute_final_value): Extract template
12769 from the body of Symbol_table::sized_finalize_symbol.
12770 (Symbol_table::sized_finalized_symbol): Call
12771 Symbol_table::compute_final_value.
12772 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12773 (Symbol_table::compute_final_value): New templated method declaration.
12774 * target.cc (Target::do_make_output_section): New method defintion.
12775 * target.h (Target::make_output_section): New method declaration.
12776 (Target::relax): Add more parameters for input objects, symbol table
12777 and layout. Adjust call to do_relax.
12778 (Target::do_make_output_section): New method declaration.
12779 (Target::do_relax): Add parameters for input objects, symbol table
12780 and layout.
12781
d446d6c4
ILT
127822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12783
12784 * pread.c: Include stdio.h.
12785
bc06c745
ILT
127862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12787
12788 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12789 defined.
12790
75aea3d0
ILT
127912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12792
12793 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12794 Change read_shndx type to unsigned int.
12795 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12796 int.
12797 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12798 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12799 Change read_shndx type to unsigned int.
12800 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12801 int.
12802 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12803 * layout.cc (Layout::create_symtab_sections): Cast the result of
12804 local_symcount * symsize to off_t in the gold_assert.
12805
be8fcb75
ILT
128062009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12807
12808 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12809 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12810 R_ARM_BASE_ABS.
12811 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12812 (Arm_relocate_functions::thm_abs5): New function.
12813 (Arm_relocate_functions::abs12): New function.
12814 (Arm_relocate_functions::abs16): New function.
12815 (Arm_relocate_functions::base_abs): New function.
12816 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12817 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12818 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12819 R_ARM_BASE_ABS.
12820 (Scan::global): Likewise.
12821 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12822 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12823 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12824 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12825 R_ARM_BASE_ABS.
12826
c2a122b6
ILT
128272009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12828
12829 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12830 (Arm_relocate_functions::movt_prel): New function.
12831 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12832 (Arm_relocate_functions::thm_movt_prel): New function.
12833 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12834 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12835 (Scan::global, Relocate::relocate): Likewise.
12836 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12837
c4aa1e2d
ILT
128382009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12839
12840 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12841 Incremental_checker.
12842 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12843 unsigned int.
12844 (class Incremental_inputs_header): New class.
12845 (Incremental_inputs_header_writer): Edit comment.
12846 (Incremental_inputs_entry): New class.
12847 (Incremental_inputs_entry_writer): Edit comment.
12848 (Sized_incremental_binary::do_find_incremental_inputs_section):
12849 Add *strtab_shndx parameter, fill it.
12850 (Sized_incremental_binary::do_check_inputs): New method.
12851 (Incremental_checker::can_incrementally_link_output_file): Use
12852 Sized_incremental_binary::check_inputs.
12853 (Incremental_inputs::report_command_line): Save command line in
12854 command_line_.
12855 * incremental.h:
12856 (Incremental_binary::find_incremental_inputs_section): New
12857 method.
12858 (Incremental_binary::do_find_incremental_inputs_section): Add
12859 strtab_shndx parameter.
12860 (Incremental_binary::do_check_inputs): New pure virtual method.
12861 (Sized_incremental_binary::do_check_inputs): Declare.
12862 (Incremental_checker::Incremental_checker): Add incremental_inputs
12863 parameter, use it to initialize incremental_inputs_.
12864 (Incremental_checker::incremental_inputs_): New field.
12865 (Incremental_checker::command_line): New method.
12866 (Incremental_checker::inputs): New method.
12867 (Incremental_checker::command_line_): New field.
12868
c549a694
ILT
128692009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12870
12871 * incremental.cc: Include <cstdarg> and "target-select.h".
12872 (vexplain_no_incremental): New function.
12873 (explain_no_incremental): New function.
12874 (Incremental_binary::error): New method.
12875 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12876 method.
12877 (make_sized_incremental_binary): New function.
12878 (open_incremental_binary): New function.
12879 (can_incrementally_link_file): Add checks if output is ELF and has
12880 inputs section.
12881 * incremental.h: Include "elfcpp_file.h" and "output.h".
12882 (Incremental_binary): New class.
12883 (Sized_incremental_binary): New class.
12884 (open_incremental_binary): Declare.
12885 * object.cc (is_elf_object): Use
12886 elfcpp::Elf_recognizer::is_elf_file.
12887 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12888 * output.h (Output_file::filesize): New method.
12889
fd3c5f0b
ILT
128902009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12891
12892 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12893 New function.
12894 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12895 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12896 function.
12897 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12898 function.
12899 (Arm_relocate_functions::movw_abs_nc): New function.
12900 (Arm_relocate_functions::movt_abs): New function.
12901 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12902 (Arm_relocate_functions::thm_movt_abs): New function.
12903 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12904 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12905 (Scan::global): Likewise.
12906 (Relocate::relocate): Likewise.
12907 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12908
7f5309a5
ILT
129092009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12910
12911 * arm.cc (Arm_relocate_functions::got_prel) New function.
12912 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12913 (Relocate::relocate): Likewise.
12914 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12915
364c7fa5
ILT
129162009-10-06 Ian Lance Taylor <iant@google.com>
12917
12918 * options.h (class General_options): Define
12919 split_stack_adjust_size parameter.
12920 * object.h (class Object): Add uses_split_stack_ and
12921 has_no_split_stack_ fields. Add uses_split_stack and
12922 has_no_split_stack accessor functions. Declare
12923 handle_split_stack_section.
12924 (class Reloc_symbol_changes): Define.
12925 (class Sized_relobj): Define Function_offsets. Declare
12926 split_stack_adjust, split_stack_adjust_reltype, and
12927 find_functions.
12928 * object.cc (Object::handle_split_stack_section): New function.
12929 (Sized_relobj::do_layout): Call handle_split_stack_section.
12930 * dynobj.cc (Sized_dynobj::do_layout): Call
12931 handle_split_stack_section.
12932 * reloc.cc (Sized_relobj::relocate_sections): Call
12933 split_stack_adjust for executable sections in split_stack
12934 objects. Pass reloc_map to relocate_section.
12935 (Sized_relobj::split_stack_adjust): New function.
12936 (Sized_relobj::split_stack_adjust_reltype): New function.
12937 (Sized_relobj::find_functions): New function.
12938 * target-reloc.h: Include "object.h".
12939 (relocate_section): Add reloc_symbol_changes parameter. Change
12940 all callers.
12941 * target.h (class Target): Add calls_non_split method. Declare
12942 do_calls_non_split virtual method. Declare match_view and
12943 set_view_to_nop.
12944 * target.cc: Include "elfcpp.h".
12945 (Target::do_calls_non_split): New function.
12946 (Target::match_view): New function.
12947 (Target::set_view_to_nop): New function.
12948 * gold.cc (queue_middle_tasks): Give an error if mixing
12949 split-stack and non-split-stack objects with -r.
12950 * i386.cc (Target_i386::relocate_section): Add
12951 reloc_symbol_changes parameter.
12952 (Target_i386::do_calls_non_split): New function.
12953 * x86_64.cc (Target_x86_64::relocate_section): Add
12954 reloc_symbol_changes parameter.
12955 (Target_x86_64::do_calls_non_split): New function.
12956 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12957 parameter.
12958 * powerpc.cc (Target_powerpc::relocate_section): Add
12959 reloc_symbol_changes parameter.
12960 * sparc.cc (Target_sparc::relocate_section): Add
12961 reloc_symbol_changes parameter.
12962 * configure.ac: Call AM_CONDITIONAL for the default target.
12963 * configure: Rebuild.
12964 * testsuite/Makefile.am (TEST_AS): New variable.
12965 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12966 (check_DATA): Add split_i386 and split_x86_64 files.
12967 (SPLIT_DEFSYMS): Define.
12968 (split_i386_[1234n].o): New targets.
12969 (split_i386_[124]): New targets.
12970 (split_i386_[1234r].stdout): New targets.
12971 (split_x86_64_[1234n].o): New targets.
12972 (split_x86_64_[124]): New targets.
12973 (split_x86_64_[1234r].stdout): New targets.
12974 (MOSTLYCLEANFILES): Add new executables.
12975 * testsuite/split_i386.sh: New file.
12976 * testsuite/split_x86_64.sh: New file.
12977 * testsuite/split_i386_1.s: New file.
12978 * testsuite/split_i386_2.s: New file.
12979 * testsuite/split_i386_3.s: New file.
12980 * testsuite/split_i386_4.s: New file.
12981 * testsuite/split_i386_n.s: New file.
12982 * testsuite/split_x86_64_1.s: New file.
12983 * testsuite/split_x86_64_2.s: New file.
12984 * testsuite/split_x86_64_3.s: New file.
12985 * testsuite/split_x86_64_4.s: New file.
12986 * testsuite/split_x86_64_n.s: New file.
12987 * testsuite/testfile.cc (Target_test): Update relocation_section
12988 function.
12989 * testsuite/Makefile.in: Rebuild.
12990
e8a9fcda
ILT
129912009-10-06 Ian Lance Taylor <iant@google.com>
12992
12993 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12994 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12995 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12996 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12997 the address on ldo_addrs_.
12998 (Target_i386::Relocate::fix_up_ldo): New function.
12999
e99daf92
ILT
130002009-10-06 Rafael Espindola <espindola@google.com>
13001
13002 * plugin.cc (add_input_library): New.
13003 (Plugin::load): Add add_input_library to tv.
13004 (Plugin_manager::add_input_file): Add the is_lib argument.
13005 (add_input_file): Update call to Plugin_manager::add_input_file.
13006 (add_input_library): New.
13007 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13008
966d4097
DK
130092009-09-30 Doug Kwan <dougkwan@google.com>
13010
13011 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13012 symbol and call Symbol::may_need_copy_reloc to determine if
13013 a copy reloc is needed.
13014 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13015 nocopyreloc is given in command line.
13016 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13017 given in command line.
13018 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13019 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13020 of the removed Target_i386::may_need_copy_reloc.
13021 * options.h (copyreloc): New option with default value false.
13022 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13023 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13024 instead of the removed Target_powerpc::may_need_copy_reloc.
13025 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13026 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13027 instead of the removed Target_sparc::may_need_copy_reloc.
13028 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13029 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13030 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13031 instead of the removed Target_x86_64::may_need_copy_reloc.
13032
029ba973
ILT
130332009-09-30 Ian Lance Taylor <iant@google.com>
13034
13035 * object.h (class Object): Remove target_ field, and target,
13036 sized_target, and set_target methods.
13037 (Object::sized_target): Remove.
13038 (class Sized_relobj): Update declarations. Remove sized_target.
13039 * object.cc (Sized_relobj::setup): Remove target parameter.
13040 Change all callers.
13041 (Input_objects::add_object): Don't do anything with the target.
13042 (make_elf_sized_object): Add punconfigured parameter. Change all
13043 callers. Set or test parameter target.
13044 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13045 Change all callers.
13046 * parameters.cc (Parameters::set_target): Change parameter type to
13047 be non-const.
13048 (Parameters::default_target): Remove.
13049 (set_parameters_target): Change parameter type to be non-const.
13050 (parameters_force_valid_target): New function.
13051 (parameters_clear_target): New function.
13052 * parameters.h (class Parameters): Update declarations. Remove
13053 default_target method. Add sized_target and clear_target
13054 methods. Change target_ to be non-const.
13055 (set_parameters_target): Update declaration.
13056 (parameters_force_valid_target): Declare.
13057 (parameters_clear_target): Declare.
13058 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13059 as NULL if we aren't searching.
13060 (Add_symbols::run): Don't check for compatible target.
13061 * fileread.cc (Input_file::open_binary): Call
13062 parameters_force_valid_target.
13063 * gold.cc (queue_middle_tasks): Likewise.
13064 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13065 set_target on object.
13066 * dynobj.h (class Sized_dynobj): Update declarations.
13067 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13068 make_elf_object returns NULL.
13069 (Archive::include_member): Don't check whether object target is
13070 compatible.
13071 * output.cc (Output_section::add_input_section): Get target from
13072 parameters.
13073 (Output_section::relax_input_section): Likewise.
13074 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13075 parameters.
13076 (Sized_relobj::do_scan_relocs): Likewise.
13077 (Sized_relobj::relocate_sections): Likewise.
13078 * resolve.cc (Symbol_table::resolve): Likewise.
13079 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13080 parameter. Change all callers.
13081 (Symbol_table::add_from_object): Get target from parameters.
13082 (Symbol_table::add_from_relobj): Don't check object target.
13083 (Symbol_table::add_from_dynobj): Likewise.
13084 (Symbol_table::define_special_symbol): Get target from
13085 parameters.
13086 * symtab.h (class Symbol_table): Update declaration.
13087 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13088 parameter. Change all callers. Clear parameter target.
13089 (Binary_test): Test target here.
13090 * testsuite/object_unittest.cc (gold_testsuite): Remove
13091 target_test_pointer parameter. Change all callers.
13092 (Object_test): Test target here.
13093
a6a22b83
ILT
130942009-09-26 Ian Lance Taylor <iant@google.com>
13095
13096 * testsuite/initpri1.c: Don't try to use constructor priorities if
13097 compiling with gcc before 4.3.
13098
6a8f49fe
ILT
130992009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13100
13101 * testsuite/retain_symbols_file_test.sh (check_present): Change
13102 output file name to retain_symbols_file_test.stdout.
13103 (check_absent): Likewise.
13104
8c604651
CS
131052009-09-18 Craig Silverstein <csilvers@google.com>
13106
13107 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13108 * options.cc: Include <cerrno> and <fstream>.
13109 (General_options::finalize): Parse -retain-symbols-file tag.
13110 * options.h: New flag.
13111 (General_options): New method should_retain_symbol, new
13112 variable symbols_to_retain.
13113 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13114 should_retain_symbol map.
13115 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13116 * testsuite/Makefile.in: Regenerate.
13117 * testsuite/retain_symbols_file_test.sh: New file.
13118
ca58b19f
NC
131192009-09-18 Nick Clifton <nickc@redhat.com>
13120
13121 * po/es.po: Updated Spanish translation.
13122
20e6d0d6
DK
131232009-09-17 Doug Kwan <dougkwan@google.com>
13124
13125 * debug.h (DEBUG_RELAXATION): New constant.
13126 (DEBUG_ALL): Add DEBUG_RELAXATION.
13127 (debug_string_to_enum): Add relaxation debug option.
13128 * layout.cc
13129 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13130 Layout::Relaxation_debug_check::read_sections,
13131 Layout::Relaxation_debug_check::read_sections): New method definitions.
13132 (Layout::Layout): Initialize data members
13133 record_output_section_data_from_scrips_,
13134 script_output_section_data_list_ and relaxation_debug_check_.
13135 (Layout::save_segments, Layout::restore_segments,
13136 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13137 Layout::relaxation_loop_body): New method definitions.
13138 (Layout::finalize): Support relaxation. Move section layout code to
13139 Layout::relaxation_loop_body.
13140 (Layout::set_asection_address_from_script): Move code for orphan
13141 section placement out.
13142 (Layout::place_orphan_sections_in_script): New method definition.
13143 * layout.h (Output_segment_headers, Output_file_header):
13144 New forward class declarations.
13145 (Layout::~Layout): Define.
13146 (Layout::new_output_section_data_from_script): New method definition.
13147 (Layout::place_orphan_sections_in_script): New method declaration.
13148 (Layout::Segment_states): New type declaration.
13149 (Layout::save_segments, Layout::restore_segments,
13150 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13151 Layout::relaxation_loop_body): New method declarations.
13152 (Layout::Output_section_data_list): New type declaration.
13153 (Layout::Relaxation_debug_check): New class definition.
13154 (Layout::record_output_section_data_from_script_,
13155 Layout::script_output_section_data_list_, Layout::segment_states_,
13156 Layout::relaxation_debug_check_): New data members.
13157 * output.cc: (Output_section_headers::do_size): New method definition.
13158 (Output_section_headers::Output_section_headers): Move size
13159 computation to Output_section_headers::do_size.
13160 (Output_segment_headers::do_size): New method definition.
e1df38aa 13161 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13162 Output_file_header::do_size and call it.
13163 (Output_file_header::do_size): New method definition.
13164 (Output_data_group::Output_data_group): Adjust call to
13165 Output_section_data.
13166 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13167 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13168 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13169 RELAXED_INPUT_SECTION_CODE.
13170 (Output_section::Output_section): Initialize data member checkpoint_.
13171 (Output_section::~Output_section): Delete checkpoint object pointed
13172 by checkpoint_.
13173 (Output_section::add_input_section): Always add an Input_section if
13174 relaxing.
13175 (Output_section::add_merge_input_section): Add assert.
13176 (Output_section::relax_input_section): New method definition.
13177 (Output_section::set_final_data_size): Set load address to zero for
13178 an unallocated section.
13179 (Output_section::do_address_and_file_offset_have_reset_values):
13180 New method definition.
13181 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13182 Handle relaxed input section.
13183 (Output_section::sort_attached_input_sections): Checkpoint input
13184 section list lazily.
13185 (Output_section::get_input_sections): Change type of input_sections to
13186 list of Simple_input_section pointers. Checkpoint input section list
13187 lazily. Also handle relaxed input sections.
13188 (Output_section::add_input_section_for_script): Take a reference to
13189 a Simple_input_section object instead of Relobj pointer and section
13190 index as parameter. Handle relaxed input sections.
13191 (Output_section::save_states, Output_section::restore_states): New
13192 method definitions.
13193 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13194 (Output_data::is_data_size_fixed): New method definition.
13195 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13196 if it is fixed.
13197 (Output_data::address_and_file_offset_have_reset_values): New method
13198 definition.
13199 (Output_data::do_address_and_file_offset_have_reset_values): New method
13200 definition.
13201 (Output_data::set_data_size): Check that data size is not fixed.
13202 (Output_data::fix_data_size): New method definition.
13203 (Output_data::is_data_size_fixed_): New data member.
13204 (Output_section_headers::set_final_data_size): New method definition.
13205 (Output_section_headers::do_size): New method declaration.
13206 (Output_segment_headers::set_final_data_size): New method definition.
13207 (Output_segment_headers::do_size): New method declaration.
13208 (Output_file_header::set_final_data_size)::New method definition.
13209 (Output_file_header::do_size)::New method declaration.
13210 (Output_section_data::Output_section_data): Add new parameter
13211 is_data_size_fixed and use it to fix data size.
13212 (Output_data_const::Output_data_const): Adjust call to base class
13213 constructor and fix data size.
13214 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13215 base class constructor and fix data size.
13216 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13217 base class constructor and fix data size.
13218 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13219 class constructor and fix data size.
13220 (Output_data_group::set_final_data_size): New method definition.
13221 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13222 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13223 class constructor and fix data size.
13224 (Output_relaxed_input_section): New class definition.
13225 (Output_section::Simple_input_section): New class definition.
13226 (Output_section::get_input_sections): Adjust parameter list.
13227 (Output_section::add_input_section_for_script): Same.
13228 (Output_section::save_states, Output_section::restore_states,
13229 Output_section::do_address_and_file_offset_have_reset_values,
13230 (Output_section::Input_section::Input_section): Handle
13231 RELAXED_INPUT_SECTION_CODE. Add new overload for
13232 Output_relaxed_input_section.
13233 (Output_section::Input_section::is_input_section,
13234 Output_section::Input_section::set_output_section): Handle relaxed
13235 input section.
13236 (Output_section::Input_section::is_relaxed_input_section,
13237 Output_section::Input_section::output_section_data,
13238 Output_section::Input_section::relaxed_input_section): New method
13239 definitions.
13240 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13241 value.
13242 (Output_section::Input_section::u1_): Update comments.
13243 (Output_section::Input_section::u2_): Add new union member poris.
13244 (Output_section::Checkpoint_output_section): New classs definition.
13245 (Output_section::relax_input_section): New method declaration.
13246 (Output_section::checkpoint_): New data member.
13247 (Output_segment): Update comments.
13248 (Output_segment::Output_segment): Un-privatize copy constructor.
13249 (Output_segment::operator=): Un-privatize.
13250 * script-sections.cc (Output_section_element::Input_section_list):
13251 Change element type to Output_section::Simple_input_section.
13252 (Output_section_element_dot_assignment::set_section_addresses):
13253 Register output section data for relaxation clean up.
13254 (Output_data_exression::Output_data_expression): Adjust call to base
13255 constructor to fix data size.
13256 (Output_section_element_data::set_section_addresses): Register
13257 Output_data_expression object for relaxation clean up.
13258 (struct Input_section_info): Replace Relobj pointer and section index
13259 pair with Output_section::Simple_input_section and Convert struct to a
13260 class.
13261 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13262 Input_section_info data member to use accessors.
20e6d0d6
DK
13263 (Output_section_element_input::set_section_addresses): Use layout
13264 parameter. Adjust code to use Output_section::Simple_input_section
13265 and Input_secction_info classes. Register filler for relaxation
13266 clean up.
13267 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13268 and section index pair with Output_section::Simple_input_section
13269 class. Adjust code accordingly.
13270 (Phdrs_element::release_segment): New method definition.
13271 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13272 segment list.
13273 (Script_sections::release_segments): New method definition.
13274 * gold/script-sections.h (Script_sections::release_segments): New
13275 method declaration.
13276 * gold/target.h (Target::may_relax, Target::relax,
13277 Target::do_may_relax, Target::do_relax): New method definitions.
13278
5e445df6
ILT
132792009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13280
13281 * arm.cc (has_signed_unsigned_overflow): New function.
13282 (Arm_relocate_functions::abs8): New function.
13283 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13284 (Target_arm::Scan::global): Likewise.
13285 (Target_arm::relocate::relocate): Likewise.
13286 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13287 Likewise.
13288
8c604651 132892009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13290
13291 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13292 * testsuite/Makefile.in: Regenerate.
13293
1e9cc1c2
NC
132942009-09-11 Nick Clifton <nickc@redhat.com>
13295
13296 * po/gold.pot: Updated by the Translation project.
13297
6a89f575
CC
132982009-09-08 Cary Coutant <ccoutant@google.com>
13299
13300 * output.cc (Output_file::open): Add execute permission to empty file.
13301 * testsuite/Makefile.am (permission_test): New test.
13302 * testsuite/Makefile.in: Regenerate.
13303
fdcac5af
ILT
133042009-09-02 Ian Lance Taylor <iant@google.com>
13305
13306 * output.cc (Output_file::resize): Call map_no_anonymous rather
13307 than map.
13308
44453f85
ILT
133092009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13310
13311 * gold.cc: Include "incremental.h".
13312 (queue_initial_tasks): Call Incremental_checker methods.
13313 * incremental.cc: Include "output.h".
13314 (Incremental_checker::can_incrementally_link_output_file): New
13315 method.
13316 * incremental.h (Incremental_checker): New class.
13317
13318 * output.cc (Output_file::open_for_modification): New method.
13319 (Output_file::map_anonymous): Changed return type to bool. Record
13320 map in base_ field.
13321 (Output_file::map_no_anonymous): New method, broken out of map.
13322 (Output_file::map): Use map_no_anonymous and map_anonymous.
13323 * output.h (class Output_file): Update declarations.
13324
293c1386
CC
133252009-08-24 Cary Coutant <ccoutant@google.com>
13326
13327 * options.h (Command_line::Pre_options): New class.
13328 (Command_line::pre_options): New member.
13329 * options.cc (gold::options::ready_to_register): New variable.
13330 (One_option::register_option): Do nothing if not registering options.
13331 Assert if same short option registered twice.
13332 (General_options::General_options): Turn off option registration when
13333 done constructing.
13334 (Command_line::Pre_options::Pre_options): New constructor.
13335
f773f3d2
CC
133362009-08-24 Cary Coutant <ccoutant@google.com>
13337
06a73cfe
CC
13338 * options.h (General_options::no_keep_memory): Remove incorrect
13339 short option.
f773f3d2 13340
a15af8e2
RW
133412009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13342
13343 * Makefile.am (am__skiplex, am__skipyacc): New.
13344 * Makefile.in: Regenerate.
13345
c462b41b
RW
133462009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13347
14ec8efd
RW
13348 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13349 (INCLUDES): ... this.
13350 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13351 (AM_CPPFLAGS): Renamed from ...
13352 (INCLUDE): ... this.
13353 * Makefile.in, testsuite/Makefile.in: Regenerate.
13354
81ecdfbb
RW
13355 * Makefile.in: Regenerate.
13356 * aclocal.m4: Likewise.
13357 * config.in: Likewise.
13358 * configure: Likewise.
13359 * testsuite/Makefile.in: Likewise.
13360
c462b41b
RW
13361 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13362 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13363 * Makefile.in: Regenerate.
13364 * testsuite/Makefile.in: Regenerate.
13365
2da73f13
CC
133662009-08-19 Cary Coutant <ccoutant@google.com>
13367
13368 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13369 symbols in shared libraries overridden by hidden or internal symbols
13370 in the main program.
13371
2db70501
CD
133722009-08-19 Chris Demetriou <cgd@google.com>
13373
13374 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13375 checking source file names in error messages.
13376
f733487b
DK
133772009-08-18 Doug Kwan <dougkwan@google.com>
13378
13379 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13380 an elcpp::Ehdr as parameter. Adjust call to set_target.
13381 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13382 an elfcpp::Ehdr as parameter.
13383 * object.cc (Object::set_target): Remove the version that looks up
13384 a target and sets it.
13385 (Sized_relobj::setup): Take a Target object instead of
13386 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13387 (make_elf_sized_object): Find target and ask target to
13388 make an ELF object.
13389 * object.h: (Object::set_target): Remove the version that looks up
13390 a target and sets it.
13391 (Sized_relobj::setup): Take a Target object instead of
13392 an elfcpp:Ehdr as parameter.
13393 * target.cc: Include dynobj.h.
13394 (Target::do_make_elf_object_implementation): New.
2e702c99 13395 (Target::do_make_elf_object): New.
f733487b
DK
13396 * target.h (Target::make_elf_object): New template declaration.
13397 (Target::do_make_elf_object): New method declarations.
13398 (Target::do_make_elf_object_implementation): New template declaration.
13399
cc70f101
ILT
134002009-08-14 Ian Lance Taylor <iant@google.com>
13401
13402 * gold.h (FUNCTION_NAME): Define.
13403 (gold_unreachable): Use FUNCTION_NAME.
13404
ef5e0cb1
ST
134052009-08-12 Sriraman Tallam <tmsriram@google.com>
13406
13407 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13408 symbol in the --keep-unique list is not found.
13409
48c187ce
ST
134102009-08-12 Sriraman Tallam <tmsriram@google.com>
13411
13412 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13413 been maked as --keep-unique.
13414 (Icf::unfold_section): New function.
13415 * icf.h (Icf::unfold_section): New function.
13416 * options.h (General_options::keep_unique): New option.
13417 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13418 * testsuite/Makefile.in: Regenerate.
13419 * testsuite/icf_keep_unique_test.sh: New file.
13420 * testsuite/icf_keep_unique_test.cc: New file.
13421
645afe0c
CC
134222009-08-12 Cary Coutant <ccoutant@google.com>
13423
13424 PR 10471
13425 * resolve.cc (Symbol_table::resolve): Check for references from
13426 dynamic objects to hidden and internal symbols.
13427 * testsuite/Makefile.am (hidden_test.sh): New test.
13428 * testsuite/Makefile.in: Regenerate.
13429 * testsuite/hidden_test.sh: New script.
13430 * testsuite/hidden_test_1.c: New test source.
13431 * testsuite/hidden_test_main.c: New test source.
13432
11af873f
DK
134332009-08-11 Doug Kwan <dougkwan@google.com>
13434
13435 * arm.cc: Update comments.
13436 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13437 segment to locate the .ARM.exidx section if present.
13438
b9f7d72d
DK
134392009-08-09 Doug Kwan <dougkwan@google.com>
13440
13441 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13442 patch.
13443
ddd3c53c
ST
134442009-08-07 Sriraman Tallam <tmsriram@google.com>
13445 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13446 compiler warnings.
13447
27721062
ST
134482009-08-06 Sriraman Tallam <tmsriram@google.com>
13449
13450 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13451 valid tls_segment only for non-debug-section relocations.
13452 * testsuite/Makefile.am: Add gc_tls_test.
13453 * testsuite/Makefile.in: Regenerate.
13454 * testsuite/gc_tls_test.cc: New file.
13455 * testsuite/gc_tls_test.sh: New file.
13456
ef15dade 134572009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13458
ef15dade
ST
13459 * icf.cc: New file.
13460 * icf.h: New file.
13461 * Makefile.am (CCFILES): Add icf.cc.
13462 (HFILES): Add icf.h
13463 * Makefile.in: Regenerate.
13464 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13465 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13466 section, symbol and addend information for the relocs.
13467 * gold.cc (queue_middle_tasks): Call identical code folding.
13468 * gold.h: Add defines for multimap.
13469 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13470 to the call of finalize_local_symbols.
13471 * main.cc (main): Create object of class Icf.
13472 * object.cc (Sized_relobj::do_layout): Allow this function to be
13473 called twice during icf.
13474 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13475 to sections marked as identical by icf.
13476 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13477 when available.
13478 (Sized_relobj::do_section_entsize): New function.
13479 * object.h (Object::section_entsize): New function.
13480 (Object::do_section_entsize): New pure virtual function.
13481 (Relobj::finalize_local_symbols): Add new parameter.
13482 (Relobj::do_section_entsize): New function.
13483 * options.h (General_options::icf): New option.
13484 (General_options::icf_iterations): New option.
13485 (General_options::print_icf_sections): New option.
13486 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13487 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13488 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13489 icf.
13490 * symtab.cc (Symbol_table::is_section_folded): New function.
13491 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13492 to sections marked as identical by icf.
13493 * symtab.h (Symbol_table::set_icf): New function.
13494 (Symbol_table::icf): New function.
13495 (Symbol_table::is_section_folded): New function.
13496 (Symbol_table::icf_): New data member.
13497 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13498 * testsuite/Makefile.am: Add commands to build icf_test.
13499 * testsuite/Makefile.in: Regenerate.
13500 * testsuite/icf_test.sh: New file.
13501 * testsuite/icf_test.cc: New file.
13502
c3b65ac4
CD
135032009-07-24 Chris Demetriou <cgd@google.com>
13504
13505 * layout.cc (is_compressible_debug_section): Fix incorrect
13506 comment about compressed section names.
13507
1caf2c51
ILT
135082009-07-20 Ian Lance Taylor <ian@airs.com>
13509
13510 PR 10419
13511 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13512
1ef4d87f
ILT
135132009-07-16 Ian Lance Taylor <iant@google.com>
13514
13515 PR 10400
13516 * layout.h: #include <map>.
13517 (class Kept_section): Change from struct to class. Add accessors
13518 and setters. Add section size to Comdat_group mapping. Change
13519 Comdat_group to std::map. Add is_comdat_ field. Add
13520 linkonce_size field in union.
13521 (class Layout): Update declaration of find_or_add_kept_section.
13522 Don't declare find_kept_object.
13523 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13524 parameter. Add object, shndx, is_comdat, and is_group_name
13525 parameters. Change all callers. Adjust for new Kept_section.
13526 (Layout::find_kept_object): Remove.
13527 * object.cc (Sized_relobj::include_section_group): Update use of
13528 Kept_section. Rename secnum to shndx. Only record
13529 Kept_comdat_section if sections are the same size.
13530 (Sized_relobj::include_linkonce_section): Update use of
13531 Kept_section. Only record Kept_comdat_section if sections are the
13532 same size. Set size of linkonce section.
13533 (Sized_relobj::map_to_kept_section): Update call to
13534 get_kept_comdat_section.
13535 * object.h (class Sized_relobj): Rename fields in
13536 Kept_comdat_section to drop trailing underscores; change object
13537 field to Relobj*. Change Kept_comdat_section_table to store
13538 struct rather than pointer.
13539 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13540 Add kept_object and kept_shndx parameters. Change all callers.
13541 (Sized_relobj::get_kept_comdat_section): Change return type to
13542 bool. Add kept_object and kept_shndx parameters. Change all
13543 callers.
13544 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13545 Layout::find_or_add_kept_section.
13546
37c3b7b0
ILT
135472009-07-09 Ian Lance Taylor <iant@google.com>
13548
13549 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13550 Reserve space in the hash table.
13551
98fa85cb
ILT
135522009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13553
13554 * fileread.cc (File_read::get_mtime): New method.
13555 * fileread.h (Timespec): New structure.
13556 (File_read::get_mtime): New method.
13557 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13558 Renamed from timestamp_nsec.
13559 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13560 Elf_Xword.
e1df38aa 13561 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13562 timestamp_nsec.
e1df38aa 13563 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13564 (Incremental_inputs::report_obejct): Save mtime; style fix.
13565 (Incremental_inputs::report_script): Save mtime; style fix.
13566 (Incremental_inputs::finalize_inputs): Style fix.
13567 (Incremental_inputs::finalize): Style fix.
13568 (Incremental_inputs::create_input_section_data): Store inputs
13569 mtime.
13570 * incremental.h (Incremental_inputs::report_script): Add mtime
13571 argument.
13572 (Incremental_inputs::Input_info::Input_info): Intialize only one
13573 union member.
13574 (Incremental_inputs::Input_info::archive): Move to nameless
13575 union.
13576 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13577 (Incremental_inputs::Input_info::script): Move to nameless union.
13578 (Incremental_inputs::mtime): New field.
13579 * script.cc (read_input_script): Pass file mtime to
13580 Incremental_input.
13581 * script.h (Script_info::inputs): Style fix.
13582
c9d70757
ILT
135832009-07-01 Ian Lance Taylor <ian@airs.com>
13584
13585 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13586 instead of 32.
13587
9c547ec3
ILT
135882009-06-24 Ian Lance Taylor <iant@google.com>
13589
13590 PR 10156
13591 * layout.cc (Layout::choose_output_section): If we find an
13592 existing section, update the flags.
13593 (Layout::create_notes): New function, broken out of
13594 Layout::finalize.
13595 (Layout::finalize): Don't create note sections.
13596 (Layout::create_note): Don't crash if linker script discards
13597 section.
13598 (Layout::create_gold_note): Likewise.
13599 (Layout::create_build_id): Likewise. Don't set
13600 after_input_sections on the section.
13601 (Layout::create_executable_stack_info): Remove target parameter.
13602 Change caller.
13603 * layout.h (class Layout): Declare create_notes. Update
13604 declaration of create_executable_stack_info.
13605 * gold.cc (queue_middle_tasks): Call create_notes.
13606 * output.cc (Output_section::update_flags_for_input_section): Move
13607 here from output.h. If SHF_ALLOC flag is newly set, mark address
13608 invalid.
13609 * output.h (Output_data::mark_address_invalid): New function.
13610 (class Output_section): Only declare, not define,
13611 update_flags_for_input_section. Remove set_flags.
13612
55458500
ILT
136132009-06-24 Ian Lance Taylor <iant@google.com>
13614
13615 * script-sections.cc (Output_section_definition::
13616 set_section_addresses): Rename shadowing local load_address to
13617 laddr.
13618
1307d6cd
ILT
136192009-06-24 Ian Lance Taylor <iant@google.com>
13620
13621 PR 10244
13622 * reloc.cc (relocate_sections): Skip empty relocation sections.
13623
ec3f783e
ILT
136242009-06-23 Ian Lance Taylor <iant@google.com>
13625
13626 PR 10156
13627 * layout.cc (Layout::create_note): Use choose_output_section
13628 rather than make_output_section.
13629
459c9f1c
ILT
136302009-06-23 Ian Lance Taylor <iant@google.com>
13631
13632 PR 10237
13633 * options.cc (General_options::parse_V): Set printed_version_.
13634 (General_options::General_options): Initialize printed_version_.
13635 * options.h (class General_options): Add printed_version_ field.
13636 * gold.cc (queue_initial_tasks): If there are no input files,
13637 don't give a fatal error if we printed the version information.
13638 (queue_middle_tasks): If using -r with a shared object, give a
13639 fatal error rather than an ordinary error.
13640
1518dc8f
ILT
136412009-06-23 Ian Lance Taylor <iant@google.com>
13642
13643 PR 10219
13644 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13645 (Layout::make_output_section): Set have_stabstr_section_ if we see
13646 a .stab*str section.
13647 (Layout::finalize): Call link_stabs_sections.
13648 (Layout::link_stabs_sections): New file.
13649 * layout.h (class Layout): Add have_stabstr_section_ field.
13650 Declare link_stabs_sections.
13651
3d857b98
DK
136522009-06-23 Doug Kwan <dougkwan@google.com>
13653
13654 * Makefile.am (libgold_a_LIBADD): New.
13655 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13656 * Makefile.in: Regenerate.
3d857b98
DK
13657 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13658 * configure: Regenerate.
13659 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13660 * fileread.cc: Include sys/state.h
13661 * gold.h: Declare memmem and strndup if found missing.
13662 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13663
0639a6f6
ILT
136642009-06-23 Ian Lance Taylor <iant@google.com>
13665
13666 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13667 * configure: Rebuild.
13668
8d63875c
ILT
136692009-06-23 Ian Lance Taylor <iant@google.com>
13670
13671 PR 10147
13672 * object.cc (Object::section_contents): Don't try to get a view if
13673 the section has length zero.
13674 (Object::handle_gnu_warning_section): If the section is empty, use
13675 the name of the section as the warning.
13676
f7c8a183
ILT
136772009-06-23 Ian Lance Taylor <iant@google.com>
13678
13679 PR 10133
13680 * stringpool.h (class Stringpool_template): Add optimize_ field.
13681 (Stringpool_template::set_optimize): New function.
13682 * stringpool.cc (Stringpool_template::Stringpool_template):
13683 Initialize optimize_ field.
13684 (Stringpool_template::set_string_offsets): Test local optimize
13685 fild rather than parameter.
13686 * layout.cc (Layout::Layout): Call set_optimize on the section
13687 name stringpool.
13688
e6a307ba
ILT
136892009-06-22 Ian Lance Taylor <iant@google.com>
13690
13691 PR 10030
13692 * yyscript.y: Parse TARGET.
13693 * script.cc (script_set_target): New function.
13694 * script-c.h (script_set_target): Declare.
13695 * options.cc (General_options::string_to_object_format): Rename
13696 from string_to_object_format in anonymous namespace. Change
13697 callers.
13698 * options.h (class General_options): Declare
13699 string_to_object_format.
13700
3ee173de
ILT
137012009-06-22 Ian Lance Taylor <iant@google.com>
13702
13703 * script-sections.cc (Script_sections::create_segments): Don't put
13704 program headers in a PT_LOAD segment if -n or -N.
13705
137062009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13707
13708 PR 10141
13709 * options.h (class General_options): Add -z lazy and -z now. Sort
13710 -z options into alphabetical order.
13711 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13712
cd6739a1 137132009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13714
13715 * layout.cc (Layout::make_output_section): Call
13716 Target::new_output_section.
13717 (Layout::attach_allocated_section_to_segment): Put large section
13718 sections in a separate load segment with the large segment flag
13719 set.
13720 (Layout::segment_precedes): Sort large data segments after other
13721 load segments.
13722 (align_file_offset): New static function.
13723 (Layout::set_segment_offsets): Use align_file_offset.
13724 * output.h (class Output_section): Add is_small_section_ and
13725 is_large_section_ fields.
13726 (Output_section::is_small_section): New function.
13727 (Output_section::set_is_small_section): New function.
13728 (Output_section::is_large_section): New function.
13729 (Output_section::set_is_large_section): New function.
13730 (Output_section::is_large_data_section): New function.
13731 (class Output_segment): Add is_large_data_segment_ field.
13732 (Output_segment::is_large_data_segment): New function.
13733 (Output_segment::set_is_large_data_segment): New function.
13734 * output.cc (Output_section::Output_section): Initialize new
13735 fields.
13736 (Output_segment::Output_segment): Likewise.
13737 (Output_segment::add_output_section): Add assertion that large
13738 data sections always go in large data segments. Force small data
13739 sections to the end of the list of data sections. Force small BSS
13740 sections to the start of the list of BSS sections. For large BSS
13741 sections to the end of the list of BSS sections.
13742 * symtab.h (class Symbol): Declare is_common_shndx.
13743 (Symbol::is_defined): Check Symbol::is_common_shndx.
13744 (Symbol::is_common): Likewise.
13745 (class Symbol_table): Define enum Commons_section_type. Update
13746 declarations. Add small_commons_ and large_commons_ fields.
13747 * symtab.cc (Symbol::is_common_shndx): New function.
13748 (Symbol_table::Symbol_table): Initialize new fields.
13749 (Symbol_table::add_from_object): Put small and large common
13750 symbols in the right list.
13751 (Symbol_table::sized_finalized_symbol): Check
13752 Symbol::is_common_shndx.
13753 (Symbol_table::sized_write_globals): Likewise.
13754 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13755 common symbol lists. Don't call do_allocate_commons_list if the
13756 list is empty.
13757 (Symbol_table::do_allocate_commons_list): Remove is_tls
13758 parameter. Add comons_section_type parameter. Change all
13759 callers. Handle small and large common symbols.
13760 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13761 Symbol::is_common_shndx.
13762 * resolve.cc (symbol_to_bits): Likewise.
13763 * target.h (Target::small_common_shndx): New function.
13764 (Target::small_common_section_flags): New function.
13765 (Target::large_common_shndx): New function.
13766 (Target::large_common_section_flags): New function.
13767 (Target::new_output_section): New function.
13768 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13769 small_common_section_flags, and large_common_section_flags
13770 fields.
13771 (Target::do_new_output_section): New virtual function.
13772 * arm.cc (Target_arm::arm_info): Initialize new fields.
13773 * i386.cc (Target_i386::i386_info): Likewise.
13774 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13775 Likewise.
13776 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13777 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13778 (Target_x86_64::do_new_output_section): New function.
13779 * configure.ac: Define conditional MCMODEL_MEDIUM.
13780 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13781 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13782 (large_LDFLAGS): Define.
13783 * testsuite/large.c: New file.
13784 * testsuite/testfile.cc (Target_test::test_target_info):
13785 Initialize new fields.
13786 * configure, testsuite/Makefile.in: Rebuild.
13787
bb04269c
DK
137882009-06-05 Doug Kwan <dougkwan@google.com>
13789
13790 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13791 * Makefile.in: Regenerate.
bb04269c
DK
13792 * i386.cc (class Target_i386): Define new virtual method to
13793 override do_is_local_label_name in parent.
13794 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13795 local symbols if --discard-locals or -X is given.
13796 * options.h (class General_options): Declare new options
13797 '--discard-locals' and '-X' for discarding locals.
13798 * target.h (class Target): Define new methods is_local_label_name.
13799 Declare new virtual method do_is_local_label_name.
13800 * target.cc: New file.
13801 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13802 (check_SCRIPTS): Add discard_locals_test.sh.
13803 (check_DATA): Add discard_local_tests.syms.
13804 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13805 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13806 * testsuite/Makefile.in: Regenerate.
13807 * testsuite/discard_locals_test.c: New file.
13808 * testsuite/discard_locals_test.sh: Same.
13809
805bb01c
DK
138102009-06-05 Doug Kwan <dougkwan@google.com>
13811
13812 * object.cc (Sized_relobj::Sized_relobj): Initialize
13813 discarded_eh_frame_shndx_ to -1U.
13814 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13815 section.
13816 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13817 a discarded .eh_frame section.
13818 (Sized_relobj::do_finalize_local_symbols): Ditto.
13819 * object.h (class Sized_relobj): Declare new member
13820 discarded_eh_frame_shndx_.
13821 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13822 (local_labels_test.o, local_labels_test): New rules.
13823 * testsuite/Makefile.in: Regenerate.
13824
1dcd334d
DK
138252009-06-04 Doug Kwan <dougkwan@google.com>
13826
13827 * layout.cc (Layout::section_name_mapping): Add mapping for
13828 special ARM sections.
13829
96d49306
DK
138302009-06-03 Doug Kwan <dougkwan@google.com>
13831
13832 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13833 (utils::has_overflow): Same.
13834
dff16297
ILT
138352009-06-03 Ian Lance Taylor <iant@google.com>
13836
13837 * layout.cc (Layout::section_name_mapping): New array, replacing
13838 Layout::linkonce_mapping.
13839 (Layout::section_name_mapping_count): New variable, replacing
13840 Layout::linkonce_mapping_count.
13841 (Layout::linkonce_output_name): Remove.
13842 (Layout::output_section_name): Rewrite.
13843 * layout.h (class Layout): Rename Linkonce_mapping to
13844 Section_name_mapping, linkonce_mapping to section_name_mapping,
13845 linkonce_mapping_count to section_name_mapping_count. Don't
13846 declare linkonce_output_name.
13847
c121c671
DK
138482009-06-03 Doug Kwan <dougkwan@google.com>
13849
13850 * gold/arm.cc (namespace utils): New.
13851 (Target_arm::reloc_is_non_pic): Define new method.
13852 (class Arm_relocate_functions): New.
13853 (Target_arm::Relocate::relocate): Handle relocation types used by
13854 Android.
13855
07800fab
ILT
138562009-06-03 Ian Lance Taylor <iant@google.com>
13857
13858 * arm.cc (Target_arm::scan::global): Use || instead of |.
13859
c121c671
DK
138602009-06-02 Doug Kwan <dougkwan@google.com>
13861
13862 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13863 issued_non_pic_error_.
13864 (class Target_arm::Scan): Declare new method check_non_pic.
13865 Define new method symbol_needs_plt_entry.
13866 Declare new data member issued_non_pic_error_.
13867 (class Target_arm::Relocate): Declare new method
13868 should_apply_static_reloc.
13869 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13870 (Target_arm::Scan::check_non_pic): Define new method.
13871 (Target_arm::Scan::local): Handle a small subset of reloc types used
13872 by Android.
13873 (Target_arm::Scan::local): Same.
13874 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13875
b19b0c6d
ILT
138762009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13877
13878 * incremental.cc (Incremental_inputs::report_command_line): Filter
13879 out --incremental-* options.
13880
94cdfcff
DK
138812009-05-29 Doug Kwan <dougkwan@google.com>
13882
13883 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13884 template class.
13885 (class Target_arm): Update comment.
13886 (Target_arm::Target_arm): Initialize new data members GOT_,
13887 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13888 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13889 and Target_arm::rel_dyn_section.
13890 Declare new_enum Target_arm::Got_type.
13891 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13892 and DYNBSS_.
13893 Update commments for member do_dynsym_value.
13894 (Target_arm::got_size, Target_arm::plt_section,
13895 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13896 new methods inside class defintion.
13897 (Target_arm::got_section): Define new method.
13898 (Target_arm::rel_dyn_section): Same.
13899 (Output_data_plt_arm): New template class.
13900 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13901 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13902 (Output_data_plt_arm::add_entry): Same.
13903 (Output_data_plt_arm::first_plt_entry): Define new
13904 static data member for PLT instruction template.
13905 (Output_data_plt_arm::plt_entry): Same.
13906 (Output_data_plt_arm::do_write): Define new method.
13907 (Target_arm::make_plt_entry): Same.
13908 (Target_arm::do_finalize_sections): Same.
13909 (Target_arm::do_dynsym_value): Same.
13910
4a657b0d
DK
139112009-05-28 Doug Kwan <dougkwan@google.com>
13912
13913 * Makefile.am (TARGETSOURCES): Add arm.cc.
13914 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13915 * Makefile.in: Regenerate.
13916 * arm.cc: New file.
13917 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13918
e7ae8c36
DK
139192009-05-26 Doug Kwan <dougkwan@google.com>
13920
13921 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13922 (General_options::check_excluded_libs): Strip off directories in
13923 archive name before matching like GNU ld does.
13924 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13925 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13926 (exclude_libs_test_LDFLAGS): Add linker option
13927 -Wl,--exclude-libs,libexclude_libs_test_3
13928 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13929 an explicit archive without using -l.
13930 (alt/libexclude_libs_test_3.a): New make rule.
13931 * testsuite/Makefile.in: Regenerate.
13932 * testsuite/exclude_libs_test.c : Declare lib3_default().
13933 (main): Call it.
13934 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13935 * exclude_libs_test_3.c: New file.
13936
f12e7348
NC
139372009-05-26 Nick Clifton <nickc@redhat.com>
13938
13939 * po/id.po: New Indonesian translation.
13940 * po/gold.pot: Updated template file.
13941
4daadc0d
ST
139422009-05-22 Sriraman Tallam <tmsriram@google.com>
13943
e1df38aa 13944 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13945 gc_comdat_test files. Add -Wl,--gc-sections to build
13946 gc_comdat_test.
13947 * testsuite/Makefile.in: Regenerate.
13948 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13949
531813ad
ST
139502009-05-21 Sriraman Tallam <tmsriram@google.com>
13951
13952 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13953 kept comdat section was garbage collected.
13954 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13955 * testsuite/Makefile.in: Regenerate.
13956 * testsuite/gc_comdat_test.sh: New file.
13957 * testsuite/gc_comdat_test_1.cc: New file.
13958 * testsuite/gc_comdat_test_2.cc: New file.
13959
65514900
CC
139602009-05-19 Doug Kwan <dougkwan@google.com>
13961
13962 * archive.cc (Archive::Archive): Move constructor from archive.h
13963 to here. Initialize no_export_.
13964 (Archive::get_elf_object_for_member): Set no_export flag of object.
13965 * archive.h (Archive::Archive): Move constructor body to
13966 archive.cc.
13967 (Archive::no_export): New method.
13968 (Archive::no_export_): New field.
13969 * object.h (Object::Object): Initialize no_export_ to false.
13970 (Object::no_export, Object::set_no_export): New methods.
13971 (Object::no_export_): New field.
13972 * options.cc (General_options::parse_exclude_libs): New method.
13973 (General_options::check_excluded_libs) Same.
13974 * options.h (exclude_libs): New option.
13975 (General_options::check_excluded_libs): New method declaration.
13976 (General_options::excluded_libs_): New field.
13977 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13978 default or protected visibility if an object has no-export flag set.
13979 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13980 (check_SCRIPTS): Add exclude_libs_test.sh.
13981 (check_DATA): Add exclude_libs_test.syms.
13982 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13983 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13984 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13985 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13986 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13987 libexclude_libs_test_2.a): New rules.
13988 * testsuite/Makefile.in: Regenerate.
13989 * testsuite/exclude_libs_test.c: New file.
13990 * testsuite/exclude_libs_test.sh: Ditto.
13991 * testsuite/exclude_libs_test_1.c: Ditto.
13992 * testsuite/exclude_libs_test_2.c: Ditto.
13993
1b77ea50
ILT
139942009-05-15 Ian Lance Taylor <iant@google.com>
13995
13996 * configure.ac: Check for declarations for cases where libiberty.h
13997 checks HAVE_DECL_xxx.
13998 * configure, config.in: Rebuild.
13999
072fe7ce
ILT
140002009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14001
14002 * gold.h (Incremental_argument_list): Remove (invalid) forward
14003 declaration.
14004 * incremental.cc (Incremental_inputs::report_achive): New method.
14005 (Incremental_inputs::report_object): New method.
14006 (Incremental_inputs::report_script): New method.
14007 (Incremental_inputs::finalize_inputs): New method.
14008 (Incremental_inputs::finalize): Call finalize_inputs().
14009 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14010 Create inputs entries.
14011 * incremental.h (Incremental_input_type): New enum.
14012 (Incremental_inputs::Incremental_input): Initialize new fields.
14013 (Incremental_inputs::report_inputs): New method.
14014 (Incremental_inputs::report_achive): New method.
14015 (Incremental_inputs::report_object): New method.
14016 (Incremental_inputs::report_script): New method.
14017 (Incremental_inputs::finalize_inputs): New method.
14018 (Incremental_inputs::Input_info): New struct.
14019 (Incremental_inputs::Input_info_map): New typedef.
14020 (Incremental_inputs::lock_): New field.
14021 (Incremental_inputs::Inputs_): New field.
14022 (Incremental_inputs::Inputs_map): New field.
14023 * main.cc (main): Call Incremental_input::report_inputs.
14024 * options.h (Input_argument_list): Typedef moved from
14025 Input_arguments.
14026 (Input_file_group::Files): Remove, use ::Input_argument_list.
14027 (Input_file_group::Input_argument_list): Remove, use
14028 ::Input_argument_list.
14029 * plugin.cc (Plugin_manager::add_input_file): Add error in
14030 incremental build.
14031 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14032 functions.
14033 * script.cc (read_input_script): Call
14034 Incremental_input::report_script.
14035 * script.h (Script_info): New class.
14036
b0481b0b
ILT
140372009-04-27 Ian Lance Taylor <iant@google.com>
14038
14039 * x86_64.cc (do_adjust_output_section): Set entsize to
14040 plt_entry_size.
14041
b22a5a41 140422009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14043
14044 * output.cc (Output_file::close): After short writes, continue
14045 writing from the correct offset in the buffer being written.
14046
40fde488
CD
140472009-04-23 Chris Demetriou <cgd@google.com>
14048
14049 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14050 * configure: Regenerate.
14051 * config.in: Regenerate.
14052 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14053 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14054
3ce2c28e
ILT
140552009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14056
14057 * incremental.cc (Incremental_inputs_header_data): Renamed from
14058 Incremental_input_header_data.
14059 (Incremental_inputs_header_data::data_size): New field.
14060 (Incremental_inputs_header_data::put_input_file_count): Renamed
14061 from input_file_count.
14062 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14063 from command_line_offset.
14064 (Incremental_inputs_header_data::put_reserved): Renamed from
14065 put_reserved.
14066 (Incremental_inputs_entry_data): Renamed from
14067 Incremental_input_entry_data.
14068 (Incremental_inputs_entry_data::data_size): New field.
14069 (Incremental_inputs::report_command_line): New method.
14070 (Incremental_inputs::finalize): New method.
14071 (Incremental_inputs::create_incremental_inputs_data): New method.
14072 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14073 * incremental.h: New file.
14074 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14075 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14076 incremental builds.
703d02da 14077 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14078 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14079 (Layout::create_incremental_info_sections): New method.
14080 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14081 * main.cc (main): Notify Incremental_input of the command line.
14082
e55bde5e
ILT
140832009-04-01 Ian Lance Taylor <iant@google.com>
14084 Mikolaj Zalewski <mikolajz@google.com>
14085
14086 * gold.h (reserve_unordered_map): Define, three versions, one for
14087 each version of Unordered_map.
14088 * layout.cc (Layout::Layout): Remove options parameter. Add
14089 number_of_input_files parameter. Don't initialize options_.
14090 Initialize number_of_input_files_ and resized_signatures_. Move
14091 sections_are_attached_.
14092 (Layout::layout_group): Reserve space for group_signatures_.
14093 (Layout::find_or_add_kept_section): Change name parameter to be a
14094 reference. Resize signatures_ map when it gets large enough.
14095 (Layout::layout_eh_frame): Use parameters->options() instead of
14096 this->options_.
14097 (Layout::make_output_section): Likewise.
14098 (Layout::attach_allocated_section_to_segment): Likewise.
14099 (Layout::finalize, Layout::create_executable_stack): Likewise.
14100 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14101 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14102 * layout.h (class Layout): Update declarations. Remove options_
14103 field. Add number_of_input_files_ and resized_signatures_
14104 fields. Move sections_are_attached_ field.
14105 * main.cc (main): Pass number of input files to Layout
14106 constructor. Don't pass options.
14107
154b857c
ILT
141082009-03-30 Ian Lance Taylor <iant@google.com>
14109
14110 * ffsll.c (ffsll): Correct implementation.
14111
2f35ab9b
ILT
141122009-03-27 Ian Lance Taylor <iant@google.com>
14113
fd03461a
ILT
14114 * ffsll.c: New file.
14115 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14116 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14117 * ftruncate.c (ftruncate): Declare before definition.
14118 * mremap.c (mremap): Likewise.
14119 * pread.c (pread): Likewise.
14120 * configure, Makefile.in, config.in: Rebuild.
14121
2f35ab9b
ILT
14122 * mremap.c: New file.
14123 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14124 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14125 (mremap): Declare if HAVE_MREMAP is not defined.
14126 * configure, Makefile.in, config.in: Rebuild.
14127
33aea2fd
CC
141282009-03-27 Cary Coutant <ccoutant@google.com>
14129
14130 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14131 position independent.
14132 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14133 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14134
6d479619
CC
141352009-03-24 Cary Coutant <ccoutant@google.com>
14136
14137 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14138 an executable.
14139 (needs_dynamic_reloc): Likewise.
14140
afc06bb8
ILT
141412009-03-24 Ian Lance Taylor <iant@google.com>
14142
14143 * yyscript.y (file_cmd): Recognize EXTERN.
14144 (extern_name_list, extern_name_list_body): New nonterminals.
14145 * script.cc (script_add_extern): Define.
14146 * script-c.h (script_add_extern): Declare.
14147
f6060a4d
ILT
141482009-03-24 Rafael Avila de Espindola <espindola@google.com>
14149
14150 * object.cc (is_elf_object): Define.
14151 * object.h (is_elf_object): Declare.
14152 * archive.cc (Archive::get_elf_object_for_member): Call
14153 is_elf_object.
33aea2fd 14154 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14155
26736d8e
ILT
141562009-03-24 Elliott Hughes <enh@google.com>
14157
14158 * output.cc (Output_file::map_anonymous): Define.
14159 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14160 try an anonymous one. Report the size if the mmap fails.
14161 * output.h (class Output_file): Declare map_anonymous.
14162
22fd9730
ILT
141632009-03-24 Ian Lance Taylor <iant@google.com>
14164
14165 * target-select.cc (instantiate_target): Don't acquire the lock if
14166 the instantiated_target_ field has already been set.
14167
cb010894
ILT
141682009-03-23 Ian Lance Taylor <iant@google.com>
14169
7f055c20
ILT
14170 * gold-threads.h (class Initialize_lock): Define.
14171 * gold-threads.cc (class Initialize_lock_once): Define.
14172 (initialize_lock_control): New static variable.
14173 (initialize_lock_pointer): New static variable.
14174 (initialize_lock_once): New static function.
14175 (Initialize_lock::Initialize_lock): Define.
14176 (Initialize_lock::initialize): Define.
14177 * target-select.h: Include "gold-threads.h".
14178 (class Target_selector): Add lock_ and initialize_lock_ fields.
14179 Don't define instantiate_target, just declare it.
14180 * target-select.cc (Target_selector::Target_selector): Initialize
14181 new fields.
14182 (Target_selector::instantiate_target): Define.
14183 * descriptors.h: Include "gold-threads.h".
14184 (class Descriptors): Add initialize_lock_ field.
14185 * descriptors.cc (Descriptors::Descriptors): Initialize new
14186 field.
14187 (Descriptors::open): Use initialize_lock_ field
14188 * errors.h (class Errors): Add initialize_lock_ field.
14189 * errors.cc (Errors::Errors): Initialize new field.
14190 (Errors::initialize_lock): Use initialize_lock_ field.
14191 * powerpc.cc (class Target_selector_powerpc): Remove
14192 instantiated_target_ field. In do_recognize call
14193 instantiate_target rather than do_instantiate_target. In
14194 do_instantiate_target just allocate a new target.
14195 * sparc.cc (class Target_selector_sparc): Likewise.
14196
36959681
ILT
14197 * freebsd.h: New file.
14198 * i386.cc: Include "freebsd.h".
14199 (Target_i386): Derive from Target_freebsd rather than
14200 Sized_target.
14201 (Target_selector_i386): Derive from Target_selector_freebsd rather
14202 than Target_selector.
14203 * x86_64.cc: Include "freebsd.h".
14204 (Target_x86_64): Derive from Target_freebsd rather than
14205 Sized_target.
14206 (Target_selector_x86_64): Derive from Target_selector_freebsd
14207 rather than Target_selector.
14208 * target.h (class Target): Add adjust_elf_header and
14209 do_adjust_elf_header.
14210 * output.cc (Output_file_header:: do_sized_write): Call target
14211 adjust_elf_header routine.
14212 * configure.tgt: Set targ_osabi.
14213 * configure.ac: Define GOLD_DEFAULT_OSABI.
14214 * parameters.cc (Parameters::default_target): Pass
14215 GOLD_DEFAULT_OSABI to select_target.
14216 * target-select.h (class Target_selector): Make instantiate_target
14217 protected rather than private.
14218 * Makefile.am (HFILES): Add freebsd.h.
14219 * configure, Makefile.in, config.in: Rebuild.
14220
cb010894
ILT
14221 * merge.cc (do_add_input_section): Correct pend value. Change
14222 message about last entry not being null terminated from error to
14223 warning.
14224
0e879927
ILT
142252009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14226
14227 * incremental.cc: New file.
14228 * Makefile.am (CCFILES): Add incremental.cc.
14229 * Makefile.in: Rebuild.
14230
41105937
PP
142312009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14232
14233 * layout.cc (Layout::output_section_name): Preserve names
14234 of '.note.' sections.
e1df38aa 14235
60439920
ILT
142362009-03-19 Ian Lance Taylor <iant@google.com>
14237
14238 * descriptors.cc (Descriptors::open): Check that the options are
14239 valid before using them.
14240
0d371ad3
ILT
142412009-03-18 Ian Lance Taylor <iant@google.com>
14242
14243 * script-sections.h: Include <list>.
14244 (class Script_sections): Change Sections_elements from std::vector
14245 to std::list. Typedef public Elements_iterator. Add
14246 orphan_section_placement_, data_segment_align_start_, and
14247 saw_data_segment_align_ fields. Remove data_segment_align_index_
14248 field.
14249 * script-sections.cc (class Orphan_section_placement): New class.
14250 (class Sections_element): Add virtual functions is_relro and
14251 orphan_section_init. Remove virtual function place_orphan_here.
14252 (class Output_section_definition): Add is_relro and
14253 orphan_section_init. Remove place_orphan_here.
14254 (class Orphan_output_section): Likewise.
14255 (Script_sections::Script_sections): Update for field changes.
14256 (Script_sections::data_segment_align): Set saw_data_segment_align_
14257 and data_segment_align_start_, not data_segment_align_index.
14258 (Script_sections::data_segment_relro_end): Check
14259 saw_data_segment_align_. Use data_segment_align_start_ rather
14260 than data_segment_align_index_.
14261 (Script_sections::place_orphan): Rewrite to use
14262 Orphan_section_placement.
14263
9201d894
ILT
142642009-03-17 Ian Lance Taylor <iant@google.com>
14265
9c5b8369
ILT
14266 * archive.cc (Archive::add_symbols): Check for a version attached
14267 to the symbol name in the archive map.
14268 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14269 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14270 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14271 (ver_test_11.a): New target.
14272 * testsuite/Makefile.in: Rebuild.
14273
9201d894
ILT
14274 * configure.ac: Check for chsize and posix_fallocate. Replace
14275 ftruncate.
14276 * ftruncate.c: New file, from gnulib.
14277 * output.cc (posix_fallocate): Define dummy version if not
14278 HAVE_POSIX_FALLOCATE.
14279 (Output_file::map): Call posix_fallocate rather than lseek and
14280 write.
14281 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14282 * configure, Makefile.in, config.in: Rebuild.
14283
ef4ab7a8 142842009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14285
ef4ab7a8
PP
14286 * layout.h (Layout::create_note): Add section_name parameter.
14287 * layout.cc (Layout::create_note): Likewise.
14288 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14289
8c500701
ILT
142902009-03-17 Ian Lance Taylor <iant@google.com>
14291
e85b18e1
ILT
14292 * descriptors.cc: Include "options.h".
14293 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14294 (Descriptors::open): Always use O_CLOEXEC when opening a new
14295 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14296 then set FD_CLOEXEC.
14297
9efe6174
ILT
14298 * sparc.cc (class Target_sparc): Add has_got_section.
14299 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14300 make sure we have a GOT section.
14301
14302 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14303 (Target_sparc::Scan::local): Likewise.
14304 (Target_sparc::Scan::global): Likewise.
14305 (Target_sparc::Relocate::relocate): Likewise.
14306 (Target_sparc::Relocate::relocate_tls): Likewise.
14307
8c500701
ILT
14308 * symtab.cc (Symbol_table::define_default_version): New function,
14309 broken out of add_from_object.
14310 (Symbol_table::add_from_object): Call define_default_version.
14311 (Symbol_table::define_special_symbol): Add resolve_oldsym
14312 parameter. Change all callers. If the version for a symbol comes
14313 from a version script, resolve it with the symbol with the same
14314 name with no version. Also add the symbol without a version if
14315 appropriate.
14316 (do_define_in_output_data): If resolving with oldsym, don't delete
14317 sym.
14318 (do_define_in_output_segment): Likewise.
14319 (do_define_as_constant): Likewise.
14320 * symtab.h (class Symbol_table): Update declarations.
14321
f1ed28fb
ILT
143222009-03-13 Ian Lance Taylor <iant@google.com>
14323
15f8229b
ILT
14324 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14325 (Read_symbols::requeue): New function.
14326 (Read_symbols::do_read_symbols): If make_elf_object fails because
14327 the target type is not configured, and the file was searched for,
14328 issue a warning and retry with the next directory.
14329 (Add_symbols::run): If the file has an incompatible format, and
14330 it was searched for, requeue the Read_symbols task. On error,
14331 release the object.
14332 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14333 dirindex parameter to constructor. Change all callers. Declare
14334 incompatible_warning and requeue.
14335 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14336 input_argument_ and input_group_ fields. Add them to
14337 constructor. Change all callers.
14338 (class Read_script): Add dirindex_ field. Add it to constructor.
14339 Change all callers.
14340 * archive.cc (Archive::setup): Remove input_objects parameter.
14341 Change all callers.
14342 (Archive::get_file_and_offset): Likewise.
14343 (Archive::read_all_symbols): Likewise.
14344 (Archive::read_symbols): Likewise.
14345 (Archive::get_elf_object_for_member): Remove input_objects
14346 parameter. Add punconfigured parameter. Change all callers.
14347 (Archive::add_symbols): Change return type to bool. Check return
14348 value of include_member.
14349 (Archive::include_all_members): Likewise.
14350 (Archive::include_member): Change return type to bool. Return
14351 false if first included object has incompatible target. Set
14352 included_member_ field.
14353 (Add_archive_symbols::run): If add_symbols returns false, requeue
14354 Read_symbols task.
14355 * archive.h (class Archive): Add included_member_ field.
14356 Initialize it in constructor. Add input_file and searched_for
14357 methods. Update declarations.
14358 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14359 input_argument_ fields. Add them to constructor. Change all
14360 callers.
14361 * script.cc: Include "target-select.h".
14362 (class Parser_closure): Add skip_on_incompatible_target_ and
14363 found_incompatible_target_ fields. Add
14364 skip_on_incompatible_target parameter to constructor. Change all
14365 callers. Add methods skip_on_incompatible_target,
14366 clear_skip_on_incompatible_target, found_incompatible_target, and
14367 set_found_incompatible_target.
14368 (read_input_script): Add dirindex parameter. Change all callers.
14369 If parser finds an incompatible target, requeue Read_symbols
14370 task.
14371 (script_set_symbol): Clear skip_on_incompatible_target in
14372 closure.
14373 (script_add_assertion, script_parse_option): Likewise.
14374 (script_start_sections, script_add_phdr): Likewise.
14375 (script_check_output_format): New function.
14376 * script.h (read_input_script): Update declaration.
14377 * script-c.h (script_check_output_format): Declare.
14378 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14379 (ignore_cmd): Remove OUTPUT_FORMAT.
14380 * fileread.cc (Input_file::Input_file): Add explicit this.
14381 (Input_file::will_search_for): New function.
14382 (Input_file::open): Add pindex parameter. Change all callers.
14383 * fileread.h (class Input_file): Add input_file_argument method.
14384 Declare will_search_for. Update declarations.
14385 * object.cc (make_elf_object): Add punconfigured parameter.
14386 Change all callers.
14387 * object.h (class Object): Make input_file public. Add
14388 searched_for method.
14389 (make_elf_object): Update declaration.
14390 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14391 restart search.
14392 * dirsearch.h (class Dirsearch): Update declaration.
14393 * options.h (class General_options): Add --warn-search-mismatch.
14394 * parameters.cc (Parameters::is_compatible_target): New function.
14395 * parameters.h (class Parameters): Declare is_compatible_target.
14396 * workqueue.cc (Workqueue::add_blocker): New function.
14397 * workqueue.h (class Workqueue): Declare add_blocker.
14398
f1ed28fb
ILT
14399 * fileread.cc (Input_file::open): Remove options parameter.
14400 Change all callers.
14401 (Input_file::open_binary): Likewise.
14402 * script.cc (read_input_script): Likewise.
14403 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14404 options parameter from constructor. Change all callers.
14405 (class Read_script): Likewise.
14406 * fileread.h (class Input_file): Update declarations.
14407 * script.h (read_input_script): Update declaration.
14408
34dd024a
NC
144092009-03-10 Nick Clifton <nickc@redhat.com>
14410
14411 * po/es.po: New Spanish translation.
14412
6d71b17c
CC
144132009-03-06 Cary Coutant <ccoutant@google.com>
14414
14415 * options.cc (parse_short_option): Keep dash_z from registering itself.
14416
031cdbed
ILT
144172009-03-03 Ian Lance Taylor <iant@google.com>
14418
14419 PR 9918
14420 * target-reloc.h (relocate_section): Pass output_section to
14421 relocate.
14422 * i386.cc (Target_i386::should_apply_static_reloc): Add
14423 output_section parameter. Change all callers.
14424 (Target_i386::Relocate::relocate): Add output_section parameter.
14425 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14426 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14427 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14428 * testsuite/two_file_shared.sh: New script.
14429 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14430 (check_DATA): Add two_file_shared.dbg.
14431 (two_file_shared.dbg): New target.
14432 * testsuite/Makefile.in: Rebuild.
14433
15d5fa16
ILT
144342009-03-01 Ian Lance Taylor <iant@google.com>
14435
14436 * configure.ac: Check for byteswap.h.
14437 * configure: Rebuild.
14438 * config.in: Rebuild.
14439
8a4c0b0d
ILT
144402009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14441
14442 * layout.cc (Layout::find_or_add_kept_section): New function.
14443 (Layout::add_comdat): Removed.
14444 * layout.h (struct Kept_section): Move out of class Layout.
14445 Remove trailing underscores from field names. Add group_sections
14446 field. Rename group_ field to is_group. Change all uses.
14447 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14448 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14449 comdat_groups_ field.
14450 (Sized_relobj::include_section_group): Use
14451 find_or_add_kept_section and Kept_section::group_sections.
14452 (Sized_relobj::include_linkonce_section): Likewise.
14453 * object.cc (class Sized_relobj): Don't define Comdat_group or
14454 Comdat_group_table. Remove find_comdat_group and
14455 add_comdat_group. Remove comdat_groups_ field.
14456 * plugin.cc (include_comdat_group): Use
14457 Layout::find_or_add_kept_section.
14458
b4ecf66b
ILT
144592009-02-28 Ian Lance Taylor <iant@google.com>
14460
14359ca0
ILT
14461 * README: --gc-sections and map files are now supported. Document
14462 some build requirements.
14463
b4ecf66b
ILT
14464 PR 6992
14465 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14466 relocatable link set the value of the section symbol to zero.
14467 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14468 relocatable link don't include the section address in the local
14469 symbol value.
14470
0602e05a
ILT
144712009-02-27 Ian Lance Taylor <iant@google.com>
14472
fd9d194f
ILT
14473 PR 6811
14474 * options.h (class Search_directory): Add is_system_directory.
14475 (class General_options): Declare is_in_system_directory.
14476 * options.cc (get_relative_sysroot): Make static.
14477 (get_default_sysroot): Make static.
14478 (General_optoins::is_in_system_directory): New function.
14479 * fileread.cc (Input_file::is_in_system_directory): New function.
14480 * fileread.h (class Input_file): Declare is_in_system_directory.
14481 * object.h (class Object): Add is_in_system_directory.
14482 (class Input_objects): Remove system_library_directory_ field.
14483 * object.cc (Input_objects::add_object): Don't set
14484 system_library_directory_.
14485 (input_objects::found_in_system_library_directory): Remove.
14486 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14487 parameter. Change all callers.
14488 (Symbol_table::sized_write_globals): Likewise.
14489 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14490 Call Object::is_in_system_directory.
14491 * symtab.h (class Symbol_table): Update declarations.
14492
61edd21f
ILT
14493 PR 5990
14494 * descriptors.h (Open_descriptor): Add is_on_stack field.
14495 * descriptors.cc (Descriptors::open): If the descriptor is on the
14496 top of the stack, remove it. Initialize is_on_stack field.
14497 (Descriptors::release): Only add pod to stack if it is not on the
14498 stack already.
14499 (Descriptors::close_some_descriptor): Clear stack_next and
14500 is_on_stack fields.
14501
e29e076a
ILT
14502 PR 7091
14503 * output.cc (Output_section::find_starting_output_address): Rename
14504 from starting_output_address; add PADDR parameter; change return
14505 type.
14506 * output.h (class Output_section): Declare
14507 find_starting_output_address instead of starting_output_address.
14508 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14509 section symbol for which we can't find a merge section.
14510
0602e05a
ILT
14511 PR 9836
14512 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14513 hidden or internal, force the symbol to be local.
14514 * resolve.cc (Symbol::override_visibility): Define.
14515 (Symbol::override_base): Use override_visibility.
14516 (Symbol_table::resolve): Likewise.
14517 (Symbol::override_base_with_special): Likewise.
14518 (Symbol_table::override_with_special): If the visibility is hidden
14519 or internal, force the symbol to be local.
14520 * symtab.h (class Symbol): Add set_visibility and
14521 override_visibility.
14522 * testsuite/ver_test_1.sh: New file.
14523 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14524 (check_DATA): Add ver_test_1.syms.
14525 (ver_test_1.syms): New target.
14526 * testsuite/Makefile.in: Rebuild.
14527
401a9a73
CC
145282009-02-25 Cary Coutant <ccoutant@google.com>
14529
14530 * layout.cc (Layout::choose_output_section): Don't rename sections
14531 when using a linker script that has a SECTIONS clause.
14532 * Makefile.in: Regenerate.
14533
14534 * testsuite/Makefile.am (script_test_5.sh): New test case.
14535 * testsuite/Makefile.in: Regenerate.
14536 * testsuite/script_test_5.cc: New file.
14537 * testsuite/script_test_5.sh: New file.
14538 * testsuite/script_test_5.t: New file.
14539
f488e4b0
CC
145402009-02-13 Rafael Avila de Espindola <espindola@google.com>
14541
14542 * archive.cc (Archive::include_member): Update calls to add_symbols.
14543 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14544 the Layout argument.
14545 * dynobj.h (do_add_symbols): Add the Layout argument.
14546 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14547 Layout argument.
14548 * object.h (Object::add_symbols): Add the Layout argument.
14549 (Object::do_add_symbols): Add the Layout argument.
14550 (Sized_relobj::do_add_symbols): Add the Layout argument.
14551 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14552 Unify the two versions.
14553 (Add_plugin_symbols): Remove.
14554 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14555 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14556 (Add_plugin_symbols): Remove.
14557 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14558 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14559 (Add_symbols::run): Make it work with Pulginobj.
14560
89dd1680
ILT
145612009-02-06 Ian Lance Taylor <iant@google.com>
14562
14563 * object.cc (Sized_relobj::do_layout): Make info message start
14564 with lower case letter.
14565
266d0a74
ILT
145662009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14567
602b464e
ILT
14568 * binary.cc: Fix file comment.
14569
266d0a74
ILT
14570 * options.h (enum Incremental_disposition): Define.
14571 (class General_options): Add new options: --incremental,
14572 --incremental_changed, --incremental_unchanged,
14573 --incremental_unknown. Add incremental_disposition_ and
14574 implicit_incremental_ fields.
14575 (General_options::incremental_disposition): New function.
14576 (class Position_dependent_options): Add incremental_disposition
14577 option.
14578 (Position_dependent_options::copy_from_options): Set incremental
14579 dispositions.
14580 * options.cc (General_options::parse_incremental_changed): New
14581 function.
2e702c99
RM
14582 (General_options::parse_incremental_unchanged): New function.
14583 (General_options::parse_incremental_unknown): New function.
14584 (General_options::General_options): Initialize new fields
266d0a74 14585 incremental_disposition_ and implicit_incremental_.
2e702c99 14586 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14587 without --incremental.
14588
f073bbf7
CD
145892009-02-06 Chris Demetriou <cgd@google.com>
14590
14591 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14592 pointer and to report location as the file name associated with
14593 the symbol.
14594 (gold_undefined_symbol_at_location): New function to replace the
14595 old gold_undefined_symbol functionality.
14596 * target-reloc.h (relocate_section): Update to use
14597 gold_undefined_symbol_at_location.
14598 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14599 Call gold_undefined_symbol function rather than gold_error.
14600 * errors.h (Errors::undefined_symbol): Take location as a
14601 string, rather than calculating it from a relocation.
14602 * errors.cc (Errors::fatal): Print "fatal error:" before the
14603 formatted message.
14604 (Errors::error, Errors::error_at_location): Print "error: "
14605 before the formatted message.
14606 (Errors::undefined_symbol): Take location as a string, rather
14607 than calculating it from a relocation.
14608 (gold_undefined_symbol_at_location): New function akin to
14609 old gold_undefined_symbol, calculates location from relocation.
14610 (gold_undefined_symbol): Change to take only a Symbol pointer
14611 and to report location as the file name associated with the symbol.
14612 * testsuite/debug_msg.sh: Update for changed error messages.
14613 * testsuite/undef_symbol.sh: Likewise.
14614
8e94a90c
ILT
146152009-02-04 Duncan Sands <baldrick@free.fr>
14616
14617 PR 9812
14618 * reduced_debug_output.h
14619 (Output_reduced_debug_abbrev_section::failed): Use format for
14620 gold_warning.
14621 (Output_reduced_debug_info_section::faild): Likewise.
14622
88a0e15b
ILT
146232009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14624
14625 * script.cc (Lazy_demangler): New class.
2e702c99 14626 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14627 symbol only once.
14628
5efc7cd2
CC
146292009-01-29 Cary Coutant <ccoutant@google.com>
14630
14631 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14632 to __tls_get_addr.
14633 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14634
e0ebcf42
ILT
146352009-01-28 Ian Lance Taylor <iant@google.com>
14636
5efc7cd2 14637 * version.cc (version_string): Bump to 1.9.
75fe7426 14638
e0ebcf42
ILT
14639 * gold.h: Include <cstring> and <stdint.h>.
14640 * version.cc: Include <cstdio>.
14641 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14642 warning.
14643 * reduced_debug_output.cc (insert_into_vector): Rename from
14644 Insert_into_vector; change all callers. Use Swap_unaligned to
14645 avoid aliasing issue; remove union since it is unnecessary.
14646
8e2813be 146472009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14648
14649 * Makefile.am (CCFILES): Add gc.cc.
14650 (HFILES): Add gc.h.
14651 * Makefile.in: Regenerate.
14652 * gold.cc (Gc_runner): New class.
14653 (queue_initial_tasks): Call garbage collection related tasks
14654 when corresponding options are invoked.
14655 (queue_middle_gc_tasks): New function.
14656 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14657 processed early before laying out sections during garbage collection.
14658 * gold.h (queue_middle_gc_tasks): New function.
14659 (is_prefix_of): Move from "layout.cc".
14660 * i386.cc (Target_i386::gc_process_relocs): New function.
14661 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14662 * main.cc (main): Create object of class "Garbage_collection".
14663 * object.cc (Relobj::copy_symbols_data): New function.
14664 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14665 (Sized_relobj::do_layout): Allow this function to be called twice
14666 during garbage collection and defer layout of section during the
6d03d481
ST
14667 first call.
14668 * object.h (Relobj::get_symbols_data): New function.
14669 (Relobj::is_section_name_included): New function.
14670 (Relobj::copy_symbols_data): New function.
14671 (Relobj::set_symbols_data): New function.
14672 (Relobj::get_relocs_data): New function.
14673 (Relobj::set_relocs_data): New function.
14674 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14675 (Relobj::gc_process_relocs): New function.
14676 (Relobj::do_gc_process_relocs): New pure virtual function.
14677 (Relobj::sd_): New data member.
14678 (Sized_relobj::is_output_section_offset_invalid): New function.
14679 (Sized_relobj::do_gc_process_relocs): New function.
14680 * options.h (General_options::gc_sections): Modify to not be a no-op.
14681 (General_options::print_gc_sections): New option.
14682 * plugin.cc (Plugin_finish::run): Remove function call to
14683 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14684 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14685 * reloc.cc (Read_relocs::run): Add task to process relocs and
14686 determine unreferenced sections when doing garbage collection.
14687 (Gc_process_relocs): New class.
14688 (Sized_relobj::do_gc_process_relocs): New function.
14689 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14690 sections that are garbage collected.
14691 * reloc.h (Gc_process_relocs): New class.
14692 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14693 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14694 symbols whose corresponding sections are garbage collected.
14695 (Symbol_table::Symbol_table): Add new parameter for the garbage
14696 collection object.
14697 (Symbol_table::gc_mark_undef_symbols): New function.
14698 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14699 (Symbol_table::gc_mark_dyn_syms): New function.
14700 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14701 as garbage.
14702 (Symbol_table::add_from_object): Likewise.
14703 (Symbol_table::add_from_relobj): When building shared objects, do not
14704 treat externally visible symbols as garbage.
14705 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14706 table information for static and relocatable links.
14707 * symtab.h (Symbol_table::set_gc): New function.
14708 (Symbol_table::gc): New function.
14709 (Symbol_table::gc_mark_undef_symbols): New function.
14710 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14711 (Symbol_table::gc_mark_dyn_syms): New function.
14712 (Symbol_table::gc_): New data member.
e1df38aa 14713 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14714 function.
14715 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14716 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14717
3b293544
CF
147182009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14719
14720 * options.h (General_options::gc_sections): Define as a no-op for now.
14721 (General_options::no_keep_memory): Ditto.
14722 (General_options::Bshareable): Define.
14723 * options.cc (General_options::finalize): Honor -Bshareable.
14724
83d22aa8
AS
147252009-01-20 Andreas Schwab <schwab@suse.de>
14726
14727 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14728 read the value in the contents, since we don't use it. Use the
14729 template endianness when writing.
14730 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14731
cd536b21
AS
147322009-01-19 Andreas Schwab <schwab@suse.de>
14733
14734 * configure.tgt (powerpc64-*): Fix targ_obj.
14735
99e9a495
ILT
147362009-01-15 Ian Lance Taylor <iant@google.com>
14737
14738 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14739 local symbols when stripping all symbols.
14740
bbbfea06
CC
147412009-01-14 Cary Coutant <ccoutant@google.com>
14742
99e9a495 14743 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14744
0f7c0701
CC
147452009-01-14 Cary Coutant <ccoutant@google.com>
14746
14747 * archive.cc (Archive::get_elf_object_for_member): Remove call
14748 to File_read::claim_for_plugin.
14749 * descriptors.cc (Descriptors::open): Remove reference to
14750 is_claimed.
14751 (Descriptors::claim_for_plugin): Remove.
14752 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14753 (Descriptors::is_claimed): Remove.
14754 (claim_descriptor_for_plugin): Remove.
14755 * fileread.cc (File_read::claim_for_plugin): Remove.
14756 * fileread.h (File_read::claim_for_plugin): Remove.
14757 (File_read::descriptor): Reopen descriptor if necessary.
14758 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14759 (Plugin_manager::all_symbols_read): Add task parameter. Change
14760 all callers.
14761 (Plugin_manager::get_input_file): New function.
14762 (Plugin_manager::release_input_file): New function.
14763 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14764 corresponding data member.
14765 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14766 and pass to base constructor. Change all callers.
14767 (get_input_file, release_input_file): New functions.
14768 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14769 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14770 (Plugin_manager::all_symbols_read): Add task parameter.
14771 (Plugin_manager::get_input_file): New function.
14772 (Plugin_manager::release_input_file): New function.
14773 (Plugin_manager::task_): New data member.
14774 (Pluginobj::Pluginobj): Add filesize parameter.
14775 (Pluginobj::filename): New function.
14776 (Pluginobj::descriptor): New function.
14777 (Pluginobj::filesize): New function.
14778 (Pluginobj::filesize_): New data member.
14779 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14780 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14781 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14782
14783 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14784 with archive libraries.
14785 * testsuite/Makefile.in: Regenerate.
14786 * testsuite/plugin_test.c (struct sym_info): New type.
14787 (get_input_file, release_input_file): New static variables.
14788 (onload): Capture new transfer vector entries.
14789 (claim_file_hook): Stop reading at end of file according to filesize.
14790 Factor out parsing of readelf output into separate function.
14791 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14792 APIs and get the source file name from the symbol table. Convert
14793 source file name to corresponding object file name. Print info
14794 message when adding new input files.
14795 (parse_readelf_line): New function.
14796 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14797 * testsuite/plugin_test_2.sh: Likewise.
14798 * testsuite/plugin_test_3.sh: Likewise.
14799 * testsuite/plugin_test_4.sh: New test case.
14800
62a6d109
ILT
148012009-01-07 Ian Lance Taylor <iant@google.com>
14802
14803 * version.cc (version_string): Bump to 1.8.
14804
483620e8
CC
148052008-12-23 Cary Coutant <ccoutant@google.com>
14806
14807 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14808 * plugin.cc (Plugin_manager::finish): Rename as
14809 layout_deferred_objects. Move cleanup to separate function.
14810 (Plugin_manager::cleanup): New function.
14811 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14812 separately.
14813 * plugin.h (Plugin_manager::finish): Rename as
14814 layout_deferred_objects.
14815 (Plugin_manager::cleanup): New function.
14816 (Plugin_manager::cleanup_done): New field.
14817
d66a9eb3
CC
148182008-12-23 Cary Coutant <ccoutant@google.com>
14819
14820 * plugin.cc (is_visible_from_outside): New function.
14821 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14822 so we don't return "IR only" status for exported symbols or -r links.
14823
14824 * testsuite/Makefile.am (plugin_test_3): New test case.
14825 * testsuite/Makefile.in: Regenerate.
14826 * testsuite/plugin_test_3.sh: New file.
14827
5995b570
CC
148282008-12-22 Cary Coutant <ccoutant@google.com>
14829
14830 * object.cc (Sized_relobj::layout_section): New function.
14831 (Sized_relobj::do_layout): Defer layout of input sections until after
14832 plugin has provided replacement files.
14833 (Sized_relobj::do_layout_deferred_sections): New function.
14834 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14835 (Relobj::layout_deferred_sections): New function.
14836 (Relobj::do_layout_deferred_sections): New function.
14837 (Sized_relobj::do_layout_deferred_sections): New function.
14838 (Sized_relobj::layout_section): New function.
14839 (Sized_relobj::Deferred_layout): New structure.
14840 (Sized_relobj::deferred_layout_): New field.
14841 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14842 Change all callers. Layout deferred sections.
14843 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14844 references.
14845 (Plugin_hook::run): Move code from do_plugin_hook inline.
14846 (Plugin_hook::do_plugin_hook): Remove.
14847 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14848 (Plugin_manager::finish): Renamed, was cleanup.
14849 (Plugin_manager::should_defer_layout): New function.
14850 (Plugin_manager::add_deferred_layout_object): New function.
14851 (Plugin_manager::Deferred_layout_list): New type.
14852 (Plugin_manager::deferred_layout_objects_): New field.
14853 (Plugin_hook::do_plugin_hook): Remove.
14854
ee769c88
ILT
148552008-12-17 Ian Lance Taylor <iant@google.com>
14856
14857 * options.h (class General_options): Add --no case for
14858 --export-dynamic.
14859
abc8dcba
CC
148602008-12-16 Cary Coutant <ccoutant@google.com>
14861
14862 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14863 vector.
14864 (Plugin_manager::claim_file): Create plugin object even if
14865 plugin did not call the add_symbols callback.
14866 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14867 asking for more symbols than were added.
14868 * testsuite/Makefile.am (plugin_test_1): Add test case with
14869 no global symbols.
14870 (empty.syms): New target.
14871 * testsuite/Makefile.in: Regenerate.
14872 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14873 message. Don't call add_symbols if no globals.
14874 (all_symbols_read_hook): Don't provide replacement for empty
14875 claimed file.
14876
b0074644
ILT
148772008-12-12 Ian Lance Taylor <iant@google.com>
14878
68943102
ILT
14879 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14880 r_type == 0 for a local symbol with r_sym == 0.
14881 (scan_relocatable_relocs): Pass r_sym to
14882 local_non_section_strategy.
14883 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14884 r_sym parameter.
14885
b0074644
ILT
14886 * configure.ac: Update test for TLS descriptors: they are
14887 supported as of glibc 2.9.
14888 * configure: Rebuild.
14889
c2508178
ILT
148902008-12-11 Ian Lance Taylor <iant@google.com>
14891
14892 PR 7091
14893 * target-reloc.h (Default_scan_relocatable_relocs): For each
14894 function, map r_type == 0 to RELOC_DISCARD.
14895
2756a258
CC
148962008-12-10 Cary Coutant <ccoutant@google.com>
14897
14898 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14899 object to override a kept COMDAT group from a plugin object.
14900
bb6f53d3
ILT
149012008-12-09 Ian Lance Taylor <iant@google.com>
14902
fbc558e1
ILT
14903 PR 7088
14904 * yyscript.y (file_cmd): Handle INPUT.
14905
bb6f53d3
ILT
14906 * testsuite/initpri1.c: Change all declarations to be full
14907 prototypes by adding void, to avoid compiler warnings.
14908
4674ecfc
CC
149092008-12-05 Rafael Avila de Espindola <espindola@google.com>
14910
14911 * options.cc (General_options::parse_plugin_opt): New.
14912 (General_options::add_plugin): The argument now is just the filename.
14913 (General_options::add_plugin_option): New.
14914 * options.h (plugin_opt): New.
14915 (add_plugin): Change argument name.
14916 (add_plugin_option): New.
14917 * plugin.cc (Plugin::load): Don't parse the plugin option.
14918 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14919 (Plugin::add_option): New.
14920 (Plugin::args_): Change type.
14921 (Plugin::filename_): New.
14922 (Plugin_manager::add_plugin_option): New.
14923 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14924 * testsuite/Makefile.in: Regenerate.
14925
fd06b4aa
CC
149262008-12-05 Cary Coutant <ccoutant@google.com>
14927
14928 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14929 Handle --strip-lto-sections option.
14930 * options.h (strip_lto_sections): New option.
14931
6c52134c
CC
149322008-12-01 Cary Coutant <ccoutant@google.com>
14933
14934 * plugin.cc (ld_plugin_message): Change format parameter to const.
14935 Fix mismatch between new[] and delete.
14936
a45248e0
CC
149372008-11-14 Cary Coutant <ccoutant@google.com>
14938
14939 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14940 instead of -1U.
14941
c82fbeee
CS
149422008-11-05 Craig Silverstein <csilvers@google.com>
14943
14944 * options.cc (General_options::parse_dynamic_list): New function.
14945 * options.h (General_options): New flags dynamic_list,
14946 dynamic_list_data, dynamic_list_cpp_new, and
14947 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14948 (General_options::in_dynamic_list): New function.
14949 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14950 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14951 (Lex::can_continue_name): Likewise.
14952 (yylex): Likewise.
14953 (read_script_file): New parameter script_options.
14954 (read_dynamic_list): New function.
14955 (Script_options::define_dynamic_list): New function.
14956 (dynamic_list_keyword_parsecodes): New variable.
14957 (dynamic_list_keywords): New variable.
14958 * script.h (Script_options::define_dynamic_list): New function
14959 prototype.
14960 (read_dynamic_list): New function prototype.
14961 * symtab.cc (strprefix): New macro.
14962 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14963 dynamic_list_data, dynamic_list_cpp_new, and
14964 dynamic_list_cpp_typeinfo.
14965 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14966 (dynamic_list_expr): New rule.
14967 (dynamic_list_nodes): Likewise.
14968 (dynamic_list_node): Likewise.
14969 * testsuite/Makefile.am (dynamic_list): New test.
14970 * testsuite/Makefile.in: Regenerated.
14971 * testsuite/dynamic_list.t: New file.
14972 * testsuite/dynamic_list.sh: New file.
14973
e0bb29a5
CS
149742008-11-05 Craig Silverstein <csilvers@google.com>
14975
14976 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14977 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14978 (t11_last): Likewise.
14979 * testsuite/ver_test_6.c (main): Likewise.
14980
4e1e25e0
CC
149812008-10-07 Cary Coutant <ccoutant@google.com>
14982
14983 * options.c (General_options::finalize): Add check for -static and
14984 -shared.
14985 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14986 is not empty.
14987
92f03fcb
CC
149882008-10-02 Cary Coutant <ccoutant@google.com>
14989
14990 * plugin.cc (make_sized_plugin_object): Fix conditional
14991 compilation to work when not all targets are enabled.
14992
fbd8a257
CC
149932008-09-29 Cary Coutant <ccoutant@google.com>
14994
14995 * archive.cc (Archive::get_file_and_offset): Use filename instead
14996 of name to get library path.
14997 (Archive::include_member): Unlock external member of a thin archive.
14998
14999 * testsuite/Makefile.am (TEST_AR): New variable.
15000 (thin_archive_test_1): New test.
15001 (thin_archive_test_2): New test.
81636b3f
CC
15002 * testsuite/Makefile.in: Regenerate.
15003 * testsuite/thin_archive_main.cc: New file.
15004 * testsuite/thin_archive_test_1.cc: New file.
15005 * testsuite/thin_archive_test_2.cc: New file.
15006 * testsuite/thin_archive_test_3.cc: New file.
15007 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15008
eff45813
CC
150092008-09-29 Cary Coutant <ccoutant@google.com>
15010
15011 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15012 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15013 instead of -1U.
15014 (Sized_relobj::do_finalize_local_symbols): Likewise.
15015 (Sized_relobj::map_to_kept_section): Likewise.
15016 * object.h (Sized_relobj::invalid_address): New constant.
15017 (Sized_relobj::do_output_section_offset): Check for invalid_address
15018 and return -1ULL.
15019 * output.cc (Output_reloc::local_section_offset): Use constant
15020 invalid_address instead of -1U.
15021 (Output_reloc::get_address): Likewise.
15022 (Output_section::output_address): Change -1U to -1ULL.
15023 * output.h (Output_reloc::invalid_address): New constant.
15024 * reloc.cc (Sized_relobj::write_sections): Use constant
15025 invalid_address instead of -1U.
15026 (Sized_relobj::relocate_sections): Likewise.
15027 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15028 values for merge sections.
15029 * target-reloc.h (relocate_for_relocatable): Use constant
15030 invalid_address instead of -1U.
15031
89fc3421
CC
150322008-09-19 Cary Coutant <ccoutant@google.com>
15033
15034 Add plugin functionality for link-time optimization (LTO).
15035 * configure.ac (plugins): Add --enable-plugins option.
15036 * configure: Regenerate.
15037 * config.in: Regenerate.
15038 * Makefile.am (LIBDL): New variable.
15039 (CCFILES): Add plugin.cc.
15040 (HFILES): Add plugin.h.
15041 (ldadd_var): Add LIBDL.
15042 * Makefile.in: Regenerate.
15043
15044 * archive.cc: Include "plugin.h".
15045 (Archive::setup): Don't preread archive symbols when using a plugin.
15046 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15047 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15048 files.
15049 (Archive::include_member): Add symbols from plugin objects.
15050 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15051 * descriptors.cc (Descriptors::open): Check for file descriptors
15052 abandoned by plugins.
15053 (Descriptors::claim_for_plugin): New function.
15054 * descriptors.h (Descriptors::claim_for_plugin): New function.
15055 (Open_descriptor::is_claimed): New field.
15056 (claim_descriptor_for_plugin): New function.
15057 * fileread.cc (File_read::claim_for_plugin): New function.
15058 * fileread.h (File_read::claim_for_plugin): New function.
15059 (File_read::descriptor): New function.
15060 * gold.cc: Include "plugin.h".
15061 (queue_initial_tasks): Add task to call plugin hooks for generating
15062 new object files.
15063 * main.cc: Include "plugin.h".
15064 (main): Load plugin libraries.
15065 * object.h (Pluginobj): Declare.
15066 (Object::pluginobj): New function.
15067 (Object::do_pluginobj): New function.
15068 (Object::set_target): New function.
15069 * options.cc: Include "plugin.h".
15070 (General_options::parse_plugin): New function.
15071 (General_options::General_options): Initialize plugins_ field.
15072 (General_options::add_plugin): New function.
15073 * options.h (Plugin_manager): Declare.
15074 (General_options): Add --plugin option.
15075 (General_options::has_plugins): New function.
15076 (General_options::plugins): New function.
15077 (General_options::add_plugin): New function.
15078 (General_options::plugins_): New field.
15079 * plugin.cc: New file.
15080 * plugin.h: New file.
15081 * readsyms.cc: Include "plugin.h".
15082 (Read_symbols::do_read_symbols): Check for archive before checking
15083 for ELF file. Call plugin hooks to claim files.
15084 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15085 from a real object file; force override when processing replacement
15086 files.
15087 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15088 (Symbol::init_base_object): Likewise.
15089 (Symbol::init_base_output_data): Likewise.
15090 (Symbol::init_base_output_segment): Likewise.
15091 (Symbol::init_base_constant): Likewise.
15092 (Symbol::init_base_undefined): Likewise.
15093 (Symbol::output_section): Assert that object is not a plugin.
15094 (Symbol_table::add_from_pluginobj): New function.
15095 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15096 undefined.
15097 (Symbol_table::sized_write_globals): Likewise.
15098 (Symbol_table::add_from_pluginobj): Instantiate template.
15099 * symtab.h (Sized_pluginobj): Declare.
15100 (Symbol::in_real_elf): New function.
15101 (Symbol::set_in_real_elf): New function.
15102 (Symbol::in_real_elf_): New field.
15103 (Symbol_table::add_from_pluginobj): New function.
15104
15105 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15106 (LIBDL): New variable.
15107 (LDADD): Add LIBDL.
15108 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15109 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15110 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15111 (MOSTLYCLEANFILES): Likewise.
15112 * testsuite/Makefile.in: Regenerate.
15113 * testsuite/plugin_test.c: New file.
15114 * testsuite/plugin_test_1.sh: New file.
15115 * testsuite/plugin_test_2.sh: New file.
15116
de31bda5
ILT
151172008-09-16 Ian Lance Taylor <iant@google.com>
15118
9c2d0ef9
ILT
15119 * target-reloc.h (relocate_section): Check whether a symbol is
15120 defined by the ABI before reporting an undefined symbol error.
15121 * target.h (Target::is_defined_by_abi): Make parameter const.
15122 (Target::do_is_defined_by_abi): Likewise.
15123 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15124 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15125 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15126 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15127 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15128 * testsuite/Makefile.in: Rebuild.
15129
de31bda5
ILT
15130 * fileread.cc (make_view): Add casts to avoid warning.
15131
9fa33bee
AO
151322008-09-16 Alexandre Oliva <aoliva@redhat.com>
15133
15134 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15135 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15136
183fd0e3
AO
151372008-09-16 Alexandre Oliva <aoliva@redhat.com>
15138
15139 * options.h (General_options::output_is_executable): New.
15140 (General_options::output_is_pie): New.
15141 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15142 for shared libraries.
15143 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15144
7be8330a
CD
151452008-09-11 Chris Demetriou <cgd@google.com>
15146
15147 * options.h (origin): New -z option.
15148 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15149 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15150 in DT_FLAGS_1.
15151
a9caad02
CC
151522008-09-05 Cary Coutant <ccoutant@google.com>
15153
15154 * fileread.cc (File_read::make_view): Add check for attempt to map
15155 beyond end of file.
15156
ae6dce4d
CC
151572008-09-05 Cary Coutant <ccoutant@google.com>
15158
15159 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15160 explicit instantiations.
15161
d7ab2a47
KVH
151622008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15163
15164 PR gold/6858
15165 * options.cc (General_options::finalize): Allow undefined symbols
15166 in shlibs if linking -shared.
15167
15168 PR gold/6859
15169 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15170 symbols as not needing a dynsym entry.
15171
1e52a9c1
CS
151722008-08-20 Craig Silverstein <csilvers@google.com>
15173
15174 * fileread.cc (File_read::open): Do not lock the file unless it
15175 was successfully opened.
15176
d85c80a3
CC
151772008-08-14 Cary Coutant <ccoutant@google.com>
15178
15179 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15180 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15181 * testsuite/tls_test.cc (struct int128): 128-bit struct
15182 for testing TLS relocs with non-zero addend.
15183 (v12): New TLS variable.
15184 (t12): New test.
15185 (t_last): Add check for v12.
15186 * testsuite/tls_test.h (t12): New function.
15187 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15188
2d924fd9
ILT
151892008-08-13 Ian Lance Taylor <iant@google.com>
15190
15191 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15192 set tls_segment_ or relro_segment_.
15193 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15194 when appropriate.
15195 * output.h (Output_section::clear_is_relro): New function.
15196 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15197 sections specially even when output_data_ is empty.
15198 (Output_segment::maximum_alignment): When first section is relro,
15199 only force alignment for PT_LOAD segments.
15200 * script.cc (script_data_segment_align): New function.
15201 (script_data_segment_relro_end): New function.
15202 * script-c.h (script_data_segment_align): Declare.
15203 (script_data_segment_relro_end): Declare.
15204 * script-sections.h (class Script_sections): Declare
15205 data_segment_align and data_segment_relro_end. Add fields
15206 segment_align_index_ and saw_relro_end_.
15207 * script-sections.cc (class Sections_element): Add set_is_relro
15208 virtual function. Add new bool* parameter to place_orphan_here.
15209 Add get_output_section virtual function.
15210 (class Output_section_definition): Add set_is_relro. Add new
15211 bool* parameter to place_orphan_here. Add get_output_section.
15212 Add is_relro_ field.
15213 (Output_section_definition::Output_section_definition): Initialize
15214 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15215 and is_relro_ fields.
15216 (Output_section_definition::place_orphan_here): Add is_relro
15217 parameter.
15218 (Output_section_definition::set_section_addresses): Set relro for
15219 output section.
15220 (Output_section_definition::alternate_constraint): Likewise.
15221 (class Orphan_output_section): Add new bool* parameter to
15222 place_orphan_here. Add get_output_section.
15223 (Orphan_output_section::place_orphan_here): Add is_relro
15224 parameter.
15225 (Script_sections::Script_sections): Initialize
15226 data_segment_align_index_ and saw_relro_end_.
15227 (Script_sections::data_segment_align): New function.
15228 (Script_sections::data_segment_relro_end): New function.
15229 (Script_sections::place_orphan): Set or clear is_relro.
15230 (Script_sections::set_section_addresses): Force alignment of first
15231 TLS section.
15232 * yyscript.y (exp): Call script_data_segment_align and
15233 script_data_segment_relro_end.
15234 * testsuite/relro_script_test.t: New file.
15235 * testsuite/relro_test.cc (using_script): Declare.
15236 (t1, t2): Test using_script.
15237 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15238 (relro_script_test_SOURCES): Define.
15239 (relro_script_test_DEPENDENCIES): Define.
15240 (relro_script_test_LDFLAGS): Define.
15241 (relro_script_test_LDADD): Define.
15242 (relro_script_test.so): New target.
15243 * testsuite/Makefile.in: Rebuild.
15244
f827c9a9
CC
152452008-08-06 Cary Coutant <ccoutant@google.com>
15246
15247 * archive.cc (Archive::total_archives, Archive::total_members)
15248 (Archive::total_members_loaded): New variables.
15249 (Archive::setup): Add parameter. Add option to preread
15250 archive symbols.
15251 (Archive::read_armap): Add counter.
15252 (Archive::get_file_and_offset): New function.
15253 (Archive::get_elf_object_for_member): New function.
15254 (Archive::read_all_symbols): New function.
15255 (Archive::read_symbols): New function.
15256 (Archive::add_symbols): Add counters.
15257 (Archive::include_all_members): Use armap to find members if it's
15258 already built.
15259 (Archive::include_member): Skip reading symbols if already read.
15260 Factored code into Archive::get_file_and_offset and
15261 Archive::get_elf_object_for_member. Changed call to
15262 Mapfile::report_include_archive_member.
15263 (Archive::print_stats): New function.
15264 * archive.h: Declare Object and Read_symbols_data classes.
15265 (Archive::Archive): Add initializers for new members.
15266 (Archive::setup): Add parameter.
15267 (Archive::print_stats): New function.
15268 (Archive::total_archives, Archive::total_members)
15269 (Archive::total_members_loaded): New variables.
15270 (Archive::get_file_and_offset): New function.
15271 (Archive::get_elf_object_for_member): New function.
15272 (Archive::read_all_symbols): New function.
15273 (Archive::read_symbols): New function.
15274 (Archive::Archive_member): New class.
15275 (Archive::members_): New member.
15276 (Archive::num_members_): New member.
15277 * main.cc: Include archive.h.
15278 (main): Call Archive::print_stats.
15279 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15280 archive parameter; member_name is now the fully-decorated name.
15281 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15282 * options.h: (General_options): Add --preread-archive-symbols option.
15283 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15284 Archive::setup.
15285
de4c45bd
ILT
152862008-08-04 Ian Lance Taylor <iant@google.com>
15287
15288 * symtab.h (Symbol::use_plt_offset): New function.
15289 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15290 * powerpc.cc (Relocate::relocate): Likewise.
15291 * sparc.cc (Relocate::relocate): Likewise.
15292 * x86_64.cc (Relocate::relocate): Likewise.
15293 * testsuite/weak_plt.sh: New test.
15294 * testsuite/weak_plt_main.cc: New test.
15295 * testsuite/weak_plt_shared.cc: New test.
15296 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15297 (check_PROGRAMS): Add weak_plt.
15298 (check_DATA): Add weak_plt_shared.so.
15299 (weak_plt_main_pic.o, weak_plt): New targets.
15300 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15301 * testsuite/Makefile.in: Rebuild.
15302
15303 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15304 gcctestdir/ld.
15305 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15306 * testsuite/Makefile.in: Rebuild.
15307
323ee3f4
AM
153082008-08-04 Alan Modra <amodra@bigpond.net.au>
15309
15310 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15311 * Makefile.in: Regenerate.
15312 * po/POTFILES.in: Regenerate.
15313
7c07ecec
ILT
153142008-07-29 Ian Lance Taylor <iant@google.com>
15315
15316 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15317 symbols before other symbols.
15318 * testsuite/script_test_2.cc (test_addr): Declare.
15319 (test_addr_alias): Declare.
15320 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15321 values.
7c07ecec
ILT
15322 * testsuite/script_test_2.t: Define test_addr_alias and
15323 test_addr.
15324
5778530e
ILT
153252008-07-24 Ian Lance Taylor <iant@google.com>
15326
2a00e4fb
ILT
15327 PR 5990
15328 * descriptors.cc: New file.
15329 * descriptors.h: New file.
15330 * gold-threads.h (class Hold_optional_lock): New class.
15331 * fileread.cc: Include "descriptors.h".
15332 (File_read::~File_read): Release descriptor rather than closing
15333 it.
15334 (File_read::open) [file]: Call open_descriptor rather than open.
15335 Set is_descriptor_opened_.
15336 (File_read::open) [memory]: Assert that descriptor is not open.
15337 (File_read::reopen_descriptor): New function.
15338 (File_read::release): Release descriptor.
15339 (File_read::do_read): Make non-const. Reopen descriptor.
15340 (File_read::read): Make non-const.
15341 (File_read::make_view): Reopen descriptor.
15342 (File_read::do_readv): Likewise.
15343 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15344 Update declarations.
15345 * layout.cc: Include "descriptors.h".
15346 (Layout::create_build_id): Use open_descriptor rather than open.
15347 * output.cc: Include "descriptors.h".
15348 (Output_file::open): Use open_descriptor rather than open.
15349 * archive.cc (Archive::const_iterator): Change Archive to be
15350 non-const.
15351 (Archive::begin, Archive::end): Make non-const.
15352 (Archive::count_members): Likewise.
15353 * archive.h (class Archive): Update declarations.
15354 * object.h (Object::read): Make non-const.
15355 * Makefile.am (CCFILES): Add descriptors.cc.
15356 (HFILES): Add descriptors.h.
15357 * Makefile.in: Rebuild.
15358
801647d1
ILT
15359 PR 6716
15360 * gold.h: Always include <clocale>. Add Solaris workarounds
15361 following code in binutils/sysdep.h.
15362
5edd166e
ILT
15363 PR 6048
15364 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15365 this->eh_frame_hdr_ is NULL before using it.
15366
c89ad728
ILT
15367 * dynobj.cc (Versions::Versions): Update comment.
15368
aa86f06b
ILT
15369 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15370 the base version name.
15371
5778530e
ILT
15372 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15373 array size plus one.
15374 (Stringpool_template::set_string_offsets): Subtract one from key
15375 before using it as an array index.
15376 (Stringpool_template::get_offset_with_length): Likewise.
15377 (Stringpool_template::write_to_buffer): Likewise.
15378 * stringpool.h (Stringpool_template::get_offset_from_key):
15379 Likewise.
15380
057ead22
ILT
153812008-07-23 Ian Lance Taylor <iant@google.com>
15382
7f649c59
ILT
15383 PR 6658
15384 * object.h (Merged_symbol_value::value): Do our best to handle a
15385 negative addend.
15386
057ead22
ILT
15387 PR 6647
15388 * script.cc (Version_script_info::get_versions): Don't add empty
15389 version tag to return value.
15390 (Version_script_info::get_symbol_version_helper): Change return
15391 type to bool. Add pversion parameter. Change all callers.
15392 (script_register_vers_node): Don't require a non-NULL tag.
15393 * script.h (class Version_script_info): Update declarations.
15394 (Version_script_info::get_symbol_version): Change return type to
15395 bool. Add version parameter. Change all callers.
15396 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15397 handling. Handle an empty version from a version script.
15398 (Symbol_table::define_special_symbol): Likewise.
15399 * testsuite/ver_test_10.script: New file.
15400 * testsuite/ver_test_10.sh: New file.
15401 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15402 (check_DATA): Add ver_test_10.syms.
15403 (ver_test_10.syms, ver_test_10.so): New target.
15404 * testsuite/Makefile.in: Rebuild.
15405
58e54ac2
CD
154062008-07-23 Simon Baldwin <simonb@google.com>
15407
15408 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15409 to zero for undefined symbols from dynamic libraries.
15410
95d14cd3
ILT
154112008-07-23 Ian Lance Taylor <iant@google.com>
15412
15413 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15414 Change all callers.
15415 * symtab.h (class Symbol_table): Update declaration.
15416 * testsuite/ver_test_9.cc: New file.
15417 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15418 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15419 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15420 (ver_test_9.so, ver_test_9.o): New targets.
15421 * testsuite/Makefile.in: Rebuild.
15422
92de84a6
ILT
154232008-07-22 Ian Lance Taylor <iant@google.com>
15424
34810851
ILT
15425 * options.h (class General_options): Define --check-sections.
15426 * layout.cc (Layout::set_segment_offsets): Handle
15427 --check-sections.
15428
af6156ef
ILT
15429 * options.h (class General_options): Define -n/--nmagic and
15430 -N/--omagic.
15431 * options.cc (General_options::finalize): For -n/--nmagic or
15432 -N/--omagic, set -static.
15433 * layout.cc (Layout::attach_allocated_section_to_segment): If
15434 -N/--omagic, don't put read-only and read-write sections in
15435 different segments.
15436 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15437 finding a read-only segment.
15438 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15439 don't set the minimum segment alignment to the common page size,
15440 and don't set the file offset to the address modulo the page size.
15441 * script-sections.cc (Script_sections::create_segments): If
15442 -n/--omagic, don't put read-only and read-write sections in
15443 different segments.
15444
92de84a6
ILT
15445 * cref.cc: New file.
15446 * cref.h: New file.
15447 * options.h (class General_options): Add --print-symbol-counts.
15448 * main.cc (main): Issue defined symbol report if requested.
15449 * archive.cc (Archive::interpret_header): Make into a const member
15450 function.
15451 (Archive::add_symbols): Call Input_objects::archive_start and
15452 archive_stop.
15453 (Archive::const_iterator): Define new class.
15454 (Archive::begin, Archive::end): New functions.
15455 (Archive::include_all_members): Rewrite to use iterator.
15456 (Archive::count_members): New function.
15457 * archive.h (class Archive): Update declarations.
15458 (Archive::filename): New function.
15459 * object.cc: Include "cref.h".
15460 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15461 (Sized_relobj::do_get_global_symbol_counts): New function.
15462 (Input_objects::add_object): Add object to cross-referencer.
15463 (Input_objects::archive_start): New function.
15464 (Input_objects::archive_stop): New function.
15465 (Input_objects::print_symbol_counts): New function.
15466 * object.h: Declare Cref and Archive.
15467 (Object::get_global_symbol_counts): New function.
15468 (Object::do_get_global_symbol_counts): New pure virtual function.
15469 (class Sized_relobj): Add defined_count_ field. Update
15470 declarations.
15471 (class Input_objects): Add cref_ field. Update constructor.
15472 Update declarations.
15473 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15474 defined_count_.
15475 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15476 symbol counts.
15477 (Sized_dynobj::do_get_global_symbol_counts): New function.
15478 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15479 defined_count_. Update declarations. Define Symbols typedef.
15480 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15481 parameter. Change all callers.
15482 (Symbol_table::add_from_dynobj): Add sympointers and defined
15483 parameters. Change all callers.
15484 * symtab.h (class Symbol_table): Update declarations.
15485 * Makefile.am (CCFILES): Add cref.cc.
15486 (HFILES): Add cref.h.
15487 * Makefile.in: Rebuild.
15488
3f7c5e1d
CD
154892008-07-22 Simon Baldwin <simonb@google.com>
15490
15491 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15492 to zero when writing undefined symbols.
15493
e0b64032
ILT
154942008-07-22 Ian Lance Taylor <iant@google.com>
15495
15496 * output.cc (Output_section::add_input_section): Don't try to
15497 merge empty merge sections.
15498
096b02cf
CS
154992008-07-21 Craig Silverstein <csilvers@google.com>
15500
15501 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15502 Include symbol version in error message.
cd536b21 15503
1d1f116d
CD
155042008-07-20 Chris Demetriou <cgd@google.com>
15505
cd536b21 15506 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15507 (RANDOM_SEED_CFLAGS): New substituted variable.
15508 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15509 * configure: Rebuild.
15510 * Makefile.in: Likewise.
15511 * testsuite/Makefile.in: Likewise.
15512
a18f591e
ILT
155132008-07-18 Ian Lance Taylor <iant@google.com>
15514
15515 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15516 where we see NAME/NULL and NAME/VERSION as separate symbols.
15517 * testsuite/ver_test_main.cc (main): Call t4.
15518 (t4, t4_2a): Define.
15519 * testsuite/ver_test_2.cc (t4_2): Define.
15520 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15521 * testsuite/ver_test_4.cc (t4_2a): Define.
15522 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15523 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15524
c6e3f6ed
ILT
155252008-07-17 Ian Lance Taylor <iant@google.com>
15526
15527 * dynobj.cc (Versions::add_def): If we give an error about a
15528 missing version, go ahead and create the version anyhow.
15529
ef9beddf
ILT
155302008-07-10 Ian Lance Taylor <iant@google.com>
15531
15532 Handle output sections with more than 0x7fffffff bytes.
15533 * object.h (class Relobj): Change map_to_output_ to
15534 output_sections_, and just keep a section pointer. Change all
15535 uses. Move comdat group support to Sized_relobj.
15536 (Relobj::is_section_specially_mapped): Remove.
15537 (Relobj::output_section): Remove poff parameter. Change all
15538 callers.
15539 (Relobj::output_section_offset): New function.
15540 (Relobj::set_section_offset): Rewrite.
15541 (Relobj::map_to_output): Remove.
15542 (Relobj::output_sections): New function.
15543 (Relobj::do_output_section_offset): New pure virtual function.
15544 (Relobj::do_set_section_offset): Likewise.
15545 (class Sized_relobj): Add section_offsets_ field. Add comdat
15546 group support from Relobj. Update declarations.
15547 (Sized_relobj::get_output_section_offset): New function.
15548 (Sized_relobj::do_output_section_offset): New function.
15549 (Sized_relobj::do_set_section_offset): New function.
15550 * object.cc (Relobj::output_section_address): Remove.
15551 (Sized_relobj::Sized_relobj): Initialize new fields.
15552 (Sized_relobj::include_section_group): Cast find_kept_object to
15553 Sized_relobj.
15554 (Sized_relobj::include_linkonce_section): Likewise.
15555 (Sized_relobj::do_layout): Use separate arrays for output section
15556 and output offset.
15557 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15558 output_sections.
15559 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15560 output_sections and section_offsets.
15561 (Sized_relobj::write_local_symbols): Likewise.
15562 (map_to_kept_section): Compute output address directly.
15563 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15564 output_sections and section_offsets.
15565 (Sized_relobj::write_sections): Likewise.
15566 (Sized_relobj::relocate_sections): Likewise.
15567 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15568 * output.h (class Output_reloc): Update declarations. Change
15569 u2_.relobj to Sized_relobj*.
15570 (class Output_data_reloc): Change add functions to use
15571 Sized_relobj*.
15572 * output.cc (Output_reloc::Output_reloc): Change relobj to
15573 Sized_relobj*.
15574 (Output_reloc::local_section_offset): Change return type to
15575 Elf_Addr. Use get_output_section_offset.
15576 (Output_reloc::get_address): Likewise.
15577 (Output_section::is_input_address_mapped): Don't call
15578 is_section_specially_mapped.
15579 (Output_section::output_offset): Likewise.
15580 (Output_section::output_address): Likewise.
15581 (Output_section::starting_output_address): Likewise.
15582 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15583 parameter to Sized_relobj*.
15584 (Copy_relocs::need_copy_reloc): Likewise.
15585 (Copy_relocs::save): Likewise.
15586 * copy-relocs.h (class Copy_relocs): Update declarations.
15587 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15588 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15589 * target-reloc.h (relocate_for_relocatable): Change
15590 offset_in_output_section type to Elf_Addr. Change code that uses
15591 it as well.
15592 * layout.cc (Layout::layout): Always set *off.
15593 * mapfile.cc (Mapfile::print_input_section): Use
15594 output_section_offset.
15595 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15596 Sized_relobj*.
15597 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15598 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15599 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15600
5cb66f97
ILT
156012008-07-03 Ian Lance Taylor <iant@google.com>
15602
15603 * layout.cc (Layout::include_section): Do not discard unrecognized
15604 SHT_STRTAB sections.
15605
afe47622
CS
156062008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15607
15608 * script.cc (Lex::can_continue_name): Make '?' allowable in
15609 version-script names.
15610 * testsuite/version_script.map: Change glob pattern to use '?'
15611
5adf9721
ILT
156122008-06-30 Manish Singh <yosh@gimp.org>
15613
15614 PR 6585
15615 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15616 Correct typo.
15617
e6fde208
ILT
156182008-06-30 Ian Lance Taylor <iant@google.com>
15619
15620 PR 6660
15621 PR 6682
15622 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15623 versions]: Don't try to read the value in the contents, since we
15624 don't use it. Use the template endianness when writing.
15625
3f2e6a2d
CC
156262008-06-25 Cary Coutant <ccoutant@google.com>
15627
15628 * fileread.cc (File_read::make_view): Assert on zero-length view.
15629 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15630 symbol table when there are no symbols to read.
15631
c43d3a48
CS
156322008-06-23 Craig Silverstein <csilvers@google.com>
15633
15634 * version.cc (version_string): Bump to 1.7
15635
5f494ea0
CS
156362008-06-18 Craig Silverstein <csilvers@google.com>
15637
15638 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15639 constant 0xFFFF to type Valtype.
15640 (Powerpc_relocate_functions::rel16_ha): Likewise.
15641
c42e122e
ILT
156422008-06-17 Ian Lance Taylor <iant@google.com>
15643
f34787f8
ILT
15644 * output.h (Output_section::Input_section): Initialize p2align_ to
15645 zero for Output_section_data constructors.
15646 (Output_section::Input_section::addralign): If not an input
15647 section, return the alignment of the Output_section_data.
15648 * testsuite/copy_test.cc: New file.
15649 * testsuite/copy_test_1.cc: New file.
15650 * testsuite/copy_test_2.cc: New file.
15651 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15652 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15653 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15654 (copy_test_1_pic.o, copy_test_1.so): New targets.
15655 (copy_test_2_pic.o, copy_test_2.so): New targets.
15656 * testsuite/Makefile.in: Rebuild.
15657
c42e122e
ILT
15658 * script-sections.cc (Script_sections::place_orphan): Initialize
15659 local variable exact.
15660
ce3ac18a
DE
156612008-06-13 David Edelsohn <edelsohn@gnu.org>
15662
15663 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15664
42cacb20
DE
156652008-06-12 David Edelsohn <edelsohn@gnu.org>
15666 David S. Miller <davem@davemloft.net>
15667
15668 * powerpc.cc: New file.
15669 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15670 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15671 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15672 * Makefile.in: Rebuild.
15673
7b308235
ILT
156742008-06-09 Ian Lance Taylor <iant@google.com>
15675
15676 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15677 <exception>.
15678 (throwing, orig_terminate): New static variables.
15679 (terminate_handler): New static function.
15680 (t2): Set terminate handler.
15681
f0b886e3
ILT
156822008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15683
15684 PR 6584
cd536b21 15685 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15686 alignment.
15687
3e90f135
CC
156882008-05-30 Cary Coutant <ccoutant@google.com>
15689
15690 * archive.cc (Archive::include_all_members) Correct to step
15691 over symbol table and extended name table in thin archives.
15692
e09ad04a
ILT
156932008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15694
15695 PR 6407
15696 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15697 calculation.
15698
62b01cb5
ILT
156992008-05-28 Caleb Howe <cshowe@google.com>
15700
15701 * reduced_debug_output.cc: New file.
15702 * reduced_debug_output.h: New file.
92de84a6 15703 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15704 * options.cc (General_options::finalize): Add strip_debug_non_line
15705 to the strip heirarchy.
15706 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15707 fields.
15708 * layout.cc: Include "reduced_debug_output.h".
15709 (Layout::Layout): Initialize new fields.
15710 (line_only_debug_sections): New static array.
15711 (is_lines_only_debug_sections): New static inline function.
15712 (Layout::include_section): Handle --strip-debug-non-line.
15713 (Layout::make_output_section): If --strip-debug-non-line, build
15714 new output sections for .debug_abbrev and .debug_info.
15715 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15716 gold. Warn about possible overflow.
15717 (read_signed_LEB_128): Likewise.
15718 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15719 (read_signed_LEB_128): Declare.
15720 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15721 (HFILES): Add reduced_debug_output.h.
15722 * Makefile.in: Rebuild.
15723
7d9e3d98
ILT
157242008-05-21 Ian Lance Taylor <iant@google.com>
15725
15726 * mapfile.cc: New file.
15727 * mapfile.h: New file.
15728 * options.h (class General_options): Add -M/--print-map and -Map.
15729 * options.cc (General_options::finalize): Make -M equivalent to
15730 -Map -.
15731 * main.cc: Include <cstdio> and "mapfile.h".
15732 (main): Open mapfile if requested.
15733 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15734 constructor. Change caller.
15735 (queue_initial_tasks): Add mapfile parameter. Change caller.
15736 (queue_middle_tasks): Likewise.
15737 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15738 declarations.
15739 * archive.cc: Include "mapfile.h".
15740 (Archive::add_symbols): Add mapfile parameter. Change all
15741 callers. Pass mapfile, symbol, and reason to include_member.
15742 (Archive::include_all_members): Add mapfile parameter. Change all
15743 callers.
15744 (Archive::include_member): Add mapfile, sym, and why parameters.
15745 Change all callers. Report inclusion to map file.
15746 * archive.h: Include "fileread.h".
15747 (class Archive): Update declarations.
15748 (Archive::file): New const method.
15749 (class Add_archive_symbols): Add mapfile_ field. Update
15750 constructor. Change all callers.
15751 * readsyms.h (class Read_symbols): Likewise.
15752 (class Finish_group): Likewise.
15753 (class Read_script): Likewise.
15754 * common.cc: Include "mapfile.h".
15755 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15756 all callers.
15757 (Symbol_table::do_allocate_commons): Likewise.
15758 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15759 symbol allocation to mapfile.
15760 * common.h (class Allocate_commons_task): Add mapfile_ field.
15761 Update constructor. Change all callers.
15762 * symtab.h (class Symbol_table): Update declarations.
15763 * layout.cc: Include "mapfile.h".
15764 (Layout_task_runner::run): Print information to mapfile.
15765 (Layout::create_gold_note): Change Output_data_fixed_space to
15766 Output_data_zero_fill.
15767 (Layout::create_build_id): Likewise.
15768 (Layout::print_to_mapfile): New function.
15769 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15770 constructor. Change caller.
15771 (class Layout): Declare print_to_mapfile.
15772 * output.cc (Output_section::Input_section::print_to_mapfile): New
15773 function.
15774 (Output_section::add_input_section): If producing a map, always
15775 add to input_sections_ list.
15776 (Output_section::do_print_to_mapfile): New function.
15777 (Output_segment::print_sections_to_mapfile): New function.
15778 (Output_segment::print_section_list_to_mapfile): New function.
15779 * output.h: Include "mapfile.h".
15780 (Output_data::print_to_mapfile): New function.
15781 (Output_data::do_print_to_mapfile): New virtual function.
15782 (Output_segment_headers::do_print_to_mapfile): New function.
15783 (Output_file_header::do_print_to_mapfile): New function.
15784 (Output_data_const::do_print_to_mapfile): New function.
15785 (class Output_data_const_buffer): Add map_name_ field. Update
15786 constructor. Change all callers. Add do_print_to_mapfile
15787 function.
15788 (class Output_data_fixed_space): Likewise.
15789 (class Output_data_space): Likewise.
15790 (class Output_data_zero_fill): New class.
15791 (Output_data_strtab::do_print_to_mapfile): New function.
15792 (Output_data_reloc_base::do_print_to_mapfile): New function.
15793 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15794 (Output_data_group::do_print_to_mapfile): New function.
15795 (Output_data_got::do_print_to_mapfile): New function.
15796 (Output_data_dynamic::do_print_to_mapfile): New function.
15797 (Output_symtab_xindex::do_print_to_mapfile): New function.
15798 (class Output_section): Declare do_print_to_mapflie. Declare
15799 print_to_mapfile in Input_section.
15800 (class Output_segment): Declare new functions.
15801 * object.h (Sized_relobj::symbol_count): New function.
15802 * script-sections.cc
15803 (Output_section_element_dot_assignment::set_section_addresses):
15804 Change Output_data_fixed_space to Output_data_zero_fill.
15805 (Output_data_expression::do_print_to_mapfile): New function.
15806 * script.cc (read_input_script): Add mapfile parameter. Change
15807 all callers.
15808 * script.h (read_input_script): Update declaration.
15809 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15810 (Eh_frame::do_print_to_mapfile): New function.
15811 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15812 (Output_merge_string::do_print_to_mapfile): New function.
15813 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15814 function.
15815 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15816 function.
15817 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15818 function.
15819 * Makefile.am (CCFILES): Add mapfile.cc.
15820 (HFILES): Add mapfile.h.
15821 * Makefile.in: Rebuild.
15822
9f1d377b
ILT
158232008-05-19 Ian Lance Taylor <iant@google.com>
15824
15825 * options.h (class General_options): Add -z relro.
15826 * layout.cc (Layout::Layout): Initialize relro_segment_.
15827 (Layout::add_output_section_data): Return the output section.
15828 (Layout::make_output_section): Rcognize relro sections and mark
15829 them appropriately.
15830 (Layout::attach_allocated_section_to_segment): Put relro sections
15831 in a PT_GNU_RELRO segment.
15832 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15833 section as relro.
15834 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15835 PT_TLS segments.
15836 (Layout::linkonce_mapping): Map d.rel.ro.local to
15837 .data.rel.ro.local.
15838 (Layout::output_section_name): Us .data.rel.ro.local for any
15839 section which begins with that.
15840 * layout.h (class Layout): Update add_output_section_data
15841 declaration. Add relro_segment_ field.
15842 * output.cc (Output_section::Output_section): Initialize is_relro_
15843 and is_relro_local_ fields.
15844 (Output_segment::add_output_section): Group relro sections.
15845 (Output_segment::is_first_section_relro): New function.
15846 (Output_segment::maximum_alignment): If there is a relro section,
15847 align the segment to the common page size.
15848 (Output_segment::set_section_addresses): Track whether we are
15849 looking at relro sections. If the last section is a relro
15850 section, align to the common page size.
15851 (Output_segment::set_section_list_addresses): Add in_relro
15852 parameter. Change all callers. Align to the page size when
15853 moving from relro to non-relro section.
15854 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15855 segment.
15856 * output.h (class Output_section): Add is_relro_ and
15857 is_relro_local_ fields.
15858 (Output_section::is_relro): New function.
15859 (Output_section::set_is_relro): New function.
15860 (Output_section::is_relro_local): New function.
15861 (Output_section::set_is_relro_local): New function.
15862 (class Output_segment): Update declarations.
15863 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15864 * sparc.cc (Target_sparc::got_section): Likewise.
15865 * x86_64.cc (Target_x86_64::got_section): Likewise.
15866 * testsuite/relro_test_main.cc: New file.
15867 * testsuite/relro_test.cc: New file.
15868 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15869 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15870 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15871 (relro_test.so, relro_test_pic.o): New targets.
15872 * testsuite/Makefile.in: Rebuild.
15873
a984ee1d
ILT
158742008-05-16 Ian Lance Taylor <iant@google.com>
15875
01676dcd
ILT
15876 * output.cc (Output_segment::add_output_section): Remove front
15877 parameter.
15878 * output.h (class Output_segment): Remove
15879 add_initial_output_section and overloaded add_output_section.
15880 Update declaration of remaining add_output_section.
15881 * layout.cc (Layout::create_interp): Call add_output_section
15882 rather than add_initial_output_section.
15883 (Layout::finish_dynamic_section): Likewise.
15884
497897f9
ILT
15885 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15886 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15887 know the dynamic type.
15888 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15889 field. Initialize it in constructor.
15890 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15891 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15892 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15893 reloc.
15894
a984ee1d
ILT
15895 * output.cc (Output_reloc::get_address): Change return type to
15896 Elf_Addr.
15897 * output.h (class Output_reloc): Update get_address declaration.
15898 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15899 for section addresses.
15900
55ba0940
ILT
159012008-05-09 Ian Lance Taylor <iant@google.com>
15902
15903 PR 6493
15904 * gold.cc (gold_nomem): Use return value of write.
15905
75517b77
ILT
159062008-05-08 Ian Lance Taylor <iant@google.com>
15907
15908 * symtab.c (Symbol::init_base_output_data): Add version
15909 parameter. Change all callers.
15910 (Symbol::init_base_output_segment): Likewise.
15911 (Symbol::init_base_constant): Likewise.
15912 (Symbol::init_base_undefined): Likewise.
15913 (Sized_symbol::init_output_data): Likewise.
15914 (Sized_symbol::init_output_segment): Likewise.
15915 (Sized_symbol::init_constant): Likewise.
15916 (Sized_symbol::init_undefined): Likewise.
15917 (Symbol_table::do_define_in_output_data): If the new symbol has a
15918 version, mark it as the default.
15919 (Symbol_table::do_define_in_output_segment): Likewise.
15920 (Symbol_table::do_define_as_constant): Likewise.
15921 * symtab.h (class Symbol): Update declarations.
15922 (class Sized_symbol): Likewise.
15923 * resolve.cc (Symbol::override_version): New function.
c42e122e 15924 (Symbol::override_base): Call override_version.
75517b77
ILT
15925 (Symbol::override_base_with_special): Likewise.
15926 * testsuite/ver_script_8.script: New file.
15927 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15928 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15929 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15930 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15931
f1f70eae
ILT
159322008-05-06 Ian Lance Taylor <iant@google.com>
15933
f3e9c5c5
ILT
15934 PR 6049
15935 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15936 functions.
15937 (class General_options): Remove existing --undefined, and add
15938 --no-undefined instead. Add new --undefined as synonym for -u.
15939 * archive.cc (Archive::add_symbols): Check whether symbol was
15940 named with -u.
15941 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15942 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15943 all uses. Add IS_UNDEFINED. Update declarations to split
15944 different versions of init_base. Declare init_base_undefined.
15945 (Symbol::is_defined): Handle IS_UNDEFINED.
15946 (Symbol::is_undefined): Likewise.
15947 (Symbol::is_weak_undefined): Call is_undefined.
15948 (Symbol::is_absolute): Handle IS_CONSTANT.
15949 (class Sized_symbol): Update declarations to split different
15950 versions of init. Declare init_undefined.
15951 (class Symbol_table): Declare new functions.
15952 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15953 Change all callers.
15954 (Symbol::init_base_output_data): Likewise.
15955 (Symbol::init_base_output_segment): Likewise.
15956 (Symbol::init_base_constant): Likewise.
15957 (Symbol::init_base_undefined): New function.
15958 (Sized_symbol::init_object): Rename from init. Change all
15959 callers.
15960 (Sized_symbol::init_output_data): Likewise.
15961 (Sized_symbol::init_output_segment): Likewise.
15962 (Sized_symbol::init_constant): Likewise.
15963 (Sized_symbol::init_undefined): New function.
15964 (Symbol_table::add_undefined_symbols_from_command_line): New
15965 function.
15966 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15967 function.
15968 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15969 (Symbol::output_section): Likewise.
15970 (Symbol::set_output_section): Likewise.
15971 (Symbol_table::sized_finalize_symbol): Likewise.
15972 (Symbol_table::sized_write_globals): Likewise.
15973 * resolve.cc (Symbol_table::should_override): Likewise.
15974 (Symbol::override_base_with_special): Likewise.
15975
8bdcdf2c
ILT
15976 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15977 symbol, change it to have default visibility.
15978 * testsuite/protected_1.cc: New file.
15979 * testsuite/protected_2.cc: New file.
15980 * testsuite/protected_3.cc: New file.
15981 * testsuite/protected_main_1.cc: New file.
15982 * testsuite/protected_main_2.cc: New file.
15983 * testsuite/protected_main_3.cc: New file.
15984 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15985 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15986 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15987 (protected_1.so): New target.
15988 (protected_1_pic.o, protected_2_pic.o): New targets.
15989 (protected_3_pic.o): New target.
15990 (check_PROGRAMS): Add protected_2.
15991 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15992 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15993 * testsuite/Makefile.in: Rebuild.
15994
2b706932
ILT
15995 * options.h (DEFINE_var): Add set_user_set_##varname__.
15996 (DEFINE_bool_alias): New macro.
15997 (class General_options): Define -Bstatic using DEFINE_bool_alias
15998 rather than DEFINE_special. Add --undefined as an alias for -z
15999 defs.
16000 * options.cc (General_options::parse_Bstatic): Remove.
16001
d82a5bcc
ILT
16002 * options.h (class General_options): Add --fatal-warnings.
16003 * main.cc (main): Implement --fatal-warnings.
16004 * errors.h (Errors::warning_count): New function.
16005
f1f70eae
ILT
16006 * options.h (class General_options): Add -Bsymbolic-functions.
16007 * symtab.h (Symbol::is_preemptible): Check for
16008 -Bsymbolic-functions.
16009
8825ac63
ILT
160102008-05-05 Ian Lance Taylor <iant@google.com>
16011
d98bc257
ILT
16012 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16013 as noVARNAME rather than no-VARNAME.
16014 (class General_options): Add option -z combreloc.
16015 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16016 get_address.
16017 (Output_reloc::sort_before) [SHT_REL]: New function.
16018 (Output_reloc::sort_before) [SHT_RELA]: New function.
16019 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16020 Sort_relocs_comparison.
16021 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16022 parameter. Change all callers.
16023 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16024 sort_relocs parameter. Change all callers.
16025 * output.cc (Output_reloc::get_address): New function, broken out
16026 of write_rel.
16027 (Output_reloc::write_rel): Call it.
16028 (Output_reloc::compare): New function.
16029 (Output_data_reloc_base::do_write): Optionally sort relocs.
16030
60b2b4e7
ILT
16031 * configure.ac: If targ_extra_obj is set, link it in.
16032 * configure.tgt: Initialize all variables.
16033 (x86_64*): Set targ_extra_obj and targ_extra_size.
16034 * configure: Rebuild.
16035
8825ac63
ILT
16036 * object.cc (Sized_relobj::include_section_group): Adjust section
16037 indexes read from group data. Build vector to pass to
16038 layout_group.
16039 * layout.cc (Layout::layout_group): Add flags and shndxes
16040 parameters. Remove contents parameter. Change caller. Update
16041 explicit instantiations.
16042 * layout.h (class Layout): Update layout_group declaration.
16043 * output.cc (Output_data_group::Output_data_group): Add flags and
16044 input_shndxes parameters. Remove contents parameter. Change
16045 caller.
16046 (Output_data_group::do_write): Change input_sections_ to
16047 input_shndxes_.
16048 * output.h (class Output_data_group): Update constructor
16049 declaration. Rename input_sections_ to input_shndxes_.
16050 * testsuite/many_sections_test.cc: Add template.
16051
e94cf127
CC
160522008-04-30 Cary Coutant <ccoutant@google.com>
16053
4418b2d5
CC
16054 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16055
e94cf127
CC
16056 * layout.cc (Layout::include_section): Refactored check for debug
16057 info section.
16058 (Layout::add_comdat): Add new parameters. Change type
16059 of signature parameter. Add object and shndx to signatures table.
16060 (Layout::find_kept_object): New function.
16061 * layout.h: Include <cstring>.
16062 (Layout::is_debug_info_section): New function.
16063 (Layout::add_comdat): Add new parameters.
16064 (Layout::find_kept_object): New function.
16065 (Layout::Kept_section): New struct.
16066 (Layout::Signatures): Change type of map range.
16067 * object.cc (Relobj::output_section_address): New function.
16068 (Sized_relobj::include_section_group): Add new parameters. Change
16069 calls to Layout::add_comdat. Change to build table of kept comdat
16070 groups and table mapping discarded sections to kept sections.
16071 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16072 (Sized_relobj::do_layout): Change calls to include_section_group and
16073 include_linkonce_section.
16074 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16075 value to zero when section is discarded.
16076 (Sized_relobj::map_to_kept_section): New function.
16077 * object.h (Relobj::output_section_address): New function.
16078 (Relobj::Comdat_group): New type.
16079 (Relobj::find_comdat_group): New function.
16080 (Relobj::Comdat_group_table): New type.
16081 (Relobj::Kept_comdat_section): New type.
16082 (Relobj::Kept_comdat_section_table): New type.
16083 (Relobj::add_comdat_group): New function.
16084 (Relobj::set_kept_comdat_section): New function.
16085 (Relobj::get_kept_comdat_section): New function.
16086 (Relobj::comdat_groups_): New field.
16087 (Relobj::kept_comdat_sections_): New field.
16088 (Symbol_value::input_value): Update comment.
16089 (Sized_relobj::map_to_kept_section) New function.
16090 (Sized_relobj::include_linkonce_section): Add new parameter.
16091 * target-reloc.h (Comdat_behavior): New type.
16092 (get_comdat_behavior): New function.
16093 (relocate_section): Add code to map a discarded section to the
16094 corresponding kept section when applying a relocation.
16095
e4e5049b
CS
160962008-04-30 Craig Silverstein <csilvers@google.com>
16097
16098 * dwarf_reader.cc (next_generation_count): New static var.
16099 (Addr2line_cache_entry): New struct.
16100 (addr2line_cache): New static var.
16101 (Dwarf_line_info::one_addr2line): Added caching.
16102 (Dwarf_line_info::clear_addr2line_cache): New function.
16103 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16104 cache-size parameter.
16105 (Dwarf_line_info::one_addr2line_cache): New function.
16106 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16107 new cache-size argument to one_addr2line(), and clear cache.
16108
d09e9154
CC
161092008-04-28 Cary Coutant <ccoutant@google.com>
16110
16111 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16112 R_386_PC8 relocations.
16113
7ef73768
ILT
161142008-04-23 Ian Lance Taylor <iant@google.com>
16115
55438702
ILT
16116 * object.cc (Sized_relobj::include_section_group): Check for
16117 invalid section group.
16118
c165fb93
ILT
16119 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16120 header size.
16121
7ef73768
ILT
16122 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16123 than read for file header.
16124 * archive.cc (Archive::include_member): Likewise.
16125
6194aaab
L
161262008-04-23 Paolo Bonzini <bonzini@gnu.org>
16127
16128 * aclocal.m4: Regenerate.
16129 * configure: Regenerate.
16130
d491d34e
ILT
161312008-04-19 Ian Lance Taylor <iant@google.com>
16132
5ea2bac6
ILT
16133 * version.cc (version_string): Bump to 1.6.
16134
7bc3e21a
ILT
16135 * testsuite/Makefile.am (many_sections_r_test): New target.
16136 (many_sections_r_test_SOURCES): Remove.
16137 (many_sections_r_test_DEPENDENCIES): Remove.
16138 (many_sections_r_test_LDFLAGS): Remove.
16139 (many_sections_r_test_LDADD): Remove.
16140
7fcd3aa9
ILT
16141 * object.cc (Sized_relobj::do_add_symbols): Always pass
16142 local_symbol_count_ to add_from_relobj.
16143
4c94d6ae
ILT
16144 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16145 every thousand variables.
16146 * testsuite/Makefile.in: Rebuild.
16147
d491d34e
ILT
16148 * object.cc (Xindex::initialize_symtab_xindex): New function.
16149 (Xindex::read_symtab_xindex): New function.
16150 (Xindex::sym_xindex_to_shndx): New function.
16151 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16152 available.
16153 (Sized_relobj::do_initialize_xindex): New function.
16154 (Sized_relobj::do_read_symbols): Adjust section links.
16155 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16156 parameter. Change all callers.
16157 (Sized_relobj::include_section_group): Adjust section links and
16158 symbol section indexes.
16159 (Sized_relobj::do_layout): Adjust section links.
16160 (Sized_relobj::do_count_local_symbols): Adjust section links and
16161 symbol section indexes.
16162 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16163 ordinary and special symbols.
16164 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16165 dynsym_xindex parameters. Change all callers. Adjust section
16166 links. Use SHN_XINDEX when needed.
16167 (Sized_relobj::get_symbol_location_info): Adjust section links.
16168 Don't get fooled by special symbols.
16169 * object.h (class Xindex): Define.
16170 (class Object): Add xindex_ parameter. Declare virtual functoin
16171 do_initialize_xindex.
16172 (Object::adjust_sym_shndx): New function.
16173 (Object::set_xindex): New protected function.
16174 (class Symbol_value): Add is_ordinary_shndx_ field.
16175 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16176 (Symbol_value::value): Assert ordinary section.
16177 (Symbol_value::initialize_input_to_output_map): Likewise.
16178 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16179 Change all callers.
16180 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16181 all callers.
16182 (class Sized_relobj): Update declarations.
16183 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16184 parameter. Change all callers.
16185 (Sized_relobj::adjust_shndx): New function.
16186 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16187 field.
16188 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16189 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16190 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16191 (Sized_dynobj::read_dynsym_section): Adjust section links.
16192 (Sized_dynobj::read_dynamic): Likewise.
16193 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16194 section links.
16195 (Sized_dynobj::do_initialize_xindex): New function.
16196 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16197 do_initialize_xindex.
16198 (Sized_dynobj::adjust_shndx): New function.
16199 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16200 dynsym_xindex_ fields.
16201 (Layout::finalize): Add a call to set_section_indexes before
16202 creating the symtab sections.
16203 (Layout::set_section_indexes): Don't do anything if the section
16204 already has a section index.
16205 (Layout::create_symtab_sections): Add shnum parameter. Change
16206 caller. Create .symtab_shndx section if needed.
16207 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16208 caller.
16209 (Layout::allocated_output_section_count): New function.
16210 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16211 needed.
16212 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16213 fields. Update declarations.
16214 (Layout::symtab_xindex): New function.
16215 (Layout::dynsym_xindex): New function.
16216 (class Write_symbols_task): Add layout_ field.
16217 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16218 Change caller.
16219 * output.cc (Output_section_headers::Output_section_headers): Add
16220 shstrtab_section parameter. Change all callers.
16221 (Output_section_headers::do_sized_write): Store overflow values
16222 for section count and section string table section index in
16223 section header zero.
16224 (Output_file_header::do_sized_write): Check for overflow of
16225 section count and section string table section index.
16226 (Output_symtab_xindex::do_write): New function.
16227 (Output_symtab_xindex::endian_do_write): New function.
16228 * output.h (class Output_section_headers): Add shstrtab_section_.
16229 Update declarations.
16230 (class Output_symtab_xindex): Define.
16231 (Output_section::has_out_shndx): New function.
16232 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16233 field.
16234 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16235 Change all callers.
16236 (Sized_symbol::init): Likewise.
16237 (Symbol::output_section): Check for ordinary symbol.
16238 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16239 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16240 callers.
16241 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16242 Change all callers. Simplify handling of symbols from sections
16243 not included in the link.
16244 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16245 distinction.
16246 (Weak_alias_sorter::operator()): Assert that symbols are
16247 ordinary.
16248 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16249 distinction.
16250 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16251 parameters. Change all callers.
16252 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16253 symbol distinction. Use SHN_XINDEX when needed.
16254 (Symbol_table::write_section_symbol): Add symtab_xindex
16255 parameter. Change all callers.
16256 (Symbol_table::sized_write_section_symbol): Likewise. Use
16257 SHN_XINDEX when needed.
16258 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16259 declarations.
16260 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16261 (Symbol::is_defined): Check is_ordinary.
16262 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16263 (Symbol::is_absolute, Symbol::is_common): Likewise.
16264 (class Sized_symbol): Update declarations.
16265 (class Symbol_table): Update declarations.
16266 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16267 parameters. Change all callers.
16268 (Sized_symbol::override): Likewise.
16269 (Symbol_table::override): Likewise.
16270 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16271 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16272 is_ordinary, and orig_st_shndx parameters. Change all callers.
16273 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16274 to be in an ordinary section.
16275 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16276 object and is_ordinary parameters. Change all callers.
16277 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16278 Change all callers. Don't add undefined or non-ordinary symbols
16279 to reloc_map_.
16280 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16281 Change all callers.
16282 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16283 declarations.
16284 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16285 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16286 (Sized_relobj::relocate_sections): Likewise.
16287 * target-reloc.h (scan_relocs): Adjust section symbol index.
16288 (scan_relocatable_relocs): Likewise.
16289 * i386.cc (Scan::local): Check for ordinary symbols.
16290 * sparc.cc (Scan::local): Likewise.
16291 * x86_64.cc (Scan::local): Likewise.
16292 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16293 to symbol_section_and_value.
16294 * testsuite/many_sections_test.cc: New file.
16295 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16296 (check_PROGRAMS): Add many_sections_test.
16297 (many_sections_test_SOURCES): Define.
16298 (many_sections_test_DEPENDENCIES): Define.
16299 (many_sections_test_LDFLAGS): Define.
16300 (BUILT_SOURCES): Add many_sections_define.h.
16301 (many_sections_define.h): New target.
16302 (BUILT_SOURCES): Add many_sections_check.h.
16303 (many_sections_check.h): New target.
16304 (check_PROGRAMS): Add many_sections_r_test.
16305 (many_sections_r_test_SOURCES): Define.
16306 (many_sections_r_test_DEPENDENCIES): Define.
16307 (many_sections_r_test_LDFLAGS): Define.
16308 (many_sections_r_test_LDADD): Define.
16309 (many_sections_r_test.o): New target.
16310 * testsuite/Makefile.in: Rebuild.
16311
c5818ff1
CC
163122008-04-17 Cary Coutant <ccoutant@google.com>
16313
16314 * errors.cc (Errors::info): New function.
16315 (gold_info): New function.
16316 * errors.h (Errors::info): New function.
16317 * gold.h (gold_info): New function.
16318 * object.cc (Input_objects::add_object): Print trace output.
16319 * options.cc (options::parse_set): New function.
16320 (General_options::parse_wrap): Deleted.
16321 (General_options::General_options): Deleted initializer.
16322 * options.h (options::String_set): New typedef.
16323 (options::parse_set): New function.
16324 (DEFINE_set): New macro.
16325 (General_options::wrap): Changed to use DEFINE_set. Changed
16326 callers of any_wrap_symbols and is_wrap_symbol.
16327 (General_options::trace, General_options::trace_symbol):
16328 New options.
16329 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16330 (General_options::wrap_symbols_): Deleted.
16331 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16332
b5be4a7c
DM
163332008-04-17 David S. Miller <davem@davemloft.net>
16334
16335 * options.cc (General_options::parse_V): New function.
16336 * options.h: Add entries for -V and -Qy.
16337
155a0dd7
ILT
163382008-04-17 Ian Lance Taylor <iant@google.com>
16339
16340 * common.cc (Symbol_table::allocate_commons): Remove options
16341 parameter. Change caller.
16342 (Symbol_table::do_allocate_commons): Remove options parameter.
16343 Change caller. Just call do_allocate_commons_list twice.
16344 (Symbol_table::do_allocate_commons_list): New function, broken out
16345 of do_allocate_commons.
16346 * common.h (class Allocate_commons_task): Remove options_ field.
16347 Update constructor.
16348 * symtab.cc (Symbol_table::Symbol_table): Initialize
16349 tls_commons_.
16350 (Symbol_table::add_from_object): Put TLS common symbols on
16351 tls_commons_ list.
16352 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16353 which are IN_OUTPUT_DATA.
16354 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16355 allocate_commons and do_allocate_commons declarations. Declare
16356 do_allocate_commons_list.
16357 * gold.cc (queue_middle_tasks): Update creation of
16358 Allocate_commons_task to not pass options.
16359 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16360 (TLS_TEST_C_FLAGS): New variable.
16361 (tls_test_c_pic.o): New target.
16362 (tls_test_shared.so): Link in tls_test_c_pic.o.
16363 (tls_test_c_pic_ie.o): New target.
16364 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16365 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16366 (tls_test_c.o): New target.
16367 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16368 (tls_pic_test_LDADD): Likewise.
16369 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16370 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16371 (tls_test_c_gnu2.o): New target.
16372 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16373 tls_test_c_gnu2.o.
16374 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16375 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16376 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16377 * testsuite/tls_test.cc: Include "config.h".
16378 (t_last): Call t11_last.
16379 * testsuite/tls_test.h (t11, t11_last): Declare.
16380 * testsuite/tls_test_c.c: New file.
16381 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16382 * configure.ac: Check for OpenMP support.
16383 * configure, config.in, Makefile.in: Rebuild.
16384 * testsuite/Makefile.in: Rebuild.
16385
edfbb029
CC
163862008-04-16 Cary Coutant <ccoutant@google.com>
16387
16388 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16389 (Target_i386::tls_base_symbol_defined_): New field.
16390 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16391 (Target_i386::Scan::global): Likewise.
16392 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16393 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16394 (Target_x86_64::tls_base_symbol_defined_): New field.
16395 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16396 (Target_x86_64::Scan::global): Likewise.
16397
f3c69fca
CC
163982008-04-16 Cary Coutant <ccoutant@google.com>
16399
16400 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16401 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16402 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16403 building shared libraries.
16404 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16405 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16406 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16407 * testsuite/Makefile.in: Rebuild.
16408 * testsuite/weak_undef.h: New file.
16409 * testsuite/weak_undef_file1.cc: Add extra test cases.
16410 * testsuite/weak_undef_file2.cc: Likewise.
16411 * testsuite/weak_undef_test.cc: Likewise.
16412
7c414435
DM
164132008-04-16 David S. Miller <davem@davemloft.net>
16414
32b769e1
DM
16415 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16416 Add issued_non_pic_error_ field. Declare check_non_pic.
16417 (Target_sparc::Scan::check_non_pic): New function.
16418 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16419 (Target_sparc::Scan::global): Likewise.
16420
11936fb1
DM
16421 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16422 * configure: Rebuild.
16423
7c414435
DM
16424 * options.h (DEFINE_enable): New macro.
16425 (new_dtags): New enable option.
16426 (initfirst, interpose, loadfltr, nodefaultlib,
16427 nodelete, nodlopen, nodump): New -z options.
16428 * layout.cc (Layout:finish_dynamic_section): If new
16429 dtags enabled, emit DT_RUNPATH. Also, emit a
16430 DT_FLAGS_1 containing any specified -z flags.
16431
85c7bf8b
ILT
164322008-04-16 Ian Lance Taylor <iant@google.com>
16433
12c0daef
ILT
16434 * copy-relocs.cc: New file.
16435 * copy-relocs.h: New file.
16436 * reloc.cc: Remove Copy_relocs code.
16437 * reloc.h: Likewise.
16438 * reloc-types.h (struct Reloc_types) [both versions]: Add
16439 get_reloc_addend_noerror.
16440 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16441 variants of add_global which take an addend which must be zero.
16442 * i386.cc: Include "copy-relocs.h".
16443 (class Target_i386): Change type of copy_relocs_ to variable,
16444 update initializer.
16445 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16446 Change all callers.
16447 (Target_i386::do_finalize_sections): Change handling of
16448 copy_relocs_.
16449 * sparc.cc: Include "copy-relocs.h".
16450 (class Target_sparc): Change type of copy_relocs_ to variable,
16451 update initializer.
16452 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16453 Change all callers.
16454 (Target_sparc::do_finalize_sections): Change handling of
16455 copy_relocs_.
16456 * x86_64.cc: Include "copy-relocs.h".
16457 (class Target_x86_64): Change type of copy_relocs_ to variable,
16458 update initializer.
16459 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16460 class. Change all callers.
16461 (Target_x86_64::do_finalize_sections): Change handling of
16462 copy_relocs_.
16463 * Makefile.am (CCFILES): Add copy-relocs.cc.
16464 (HFILES): Add copy-relocs.h.
16465
4f4995b6
ILT
16466 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16467
85c7bf8b
ILT
16468 * testsuite/script_test_4.sh: Permit leading zeroes.
16469
4f2a9edd
ILT
164702008-04-15 Ian Lance Taylor <iant@google.com>
16471
e6188289
ILT
16472 * script-sections.cc (Script_sections::create_segments): Use
16473 header_size_adjustment even when there is enough room for the
16474 headers.
16475 * testsuite/script_test_4.sh: New file.
16476 * testsuite/script_test_4.t: New file.
16477 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16478 (check_DATA): Add script_test_4.stdout.
16479 (MOSTLYCLEANFILES): Likewise.
16480 (script_test_4): New target.
16481 (script_test_4.stdout): New target.
16482 * testsuite/Makefile.in: Rebuild.
16483
4f2a9edd
ILT
16484 * sparc.cc: Add definitions for Output_data_plt_sparc class
16485 constants.
16486
f5314dd5
DM
164872008-04-14 David S. Miller <davem@davemloft.net>
16488
16489 * sparc.cc: New file.
16490 * Makefile.am (TARGETSOURCES): Add sparc.cc
16491 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16492 * configure.tgt: Document targ_extra_size and
16493 targ_extra_big_endian. Add entries for sparc-* and
16494 sparc64-*.
16495 * configure.ac: Handle targ_extra_size and
16496 targ_extra_big_endian.
16497 * Makefile.in: Rebuild.
16498 * configure: Likewise.
16499 * po/POTFILES.in: Likewise.
16500 * po/gold.pot: Likewise.
16501
154e0e9a
ILT
165022008-04-14 Ian Lance Taylor <iant@google.com>
16503
16504 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16505 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16506 in the name/type/flags to section mapping. Don't call
16507 allocate_output_section.
16508 (Layout::choose_output_section): Change parameter from adjust_name
16509 to is_input_section. Don't permit input sections after sections
16510 are attached to segments. Don't call allocate_output_section.
16511 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16512 not write_enable_output_section.
16513 (Layout::make_output_section): Don't push to
16514 unattached_section_list_ nor call attach_to_segment. Call
16515 attach_section_to_segment if sections are attached.
16516 (Layout::attach_sections_to_segments): New function.
16517 (Layout::attach_section_to_segment): New function.
16518 (Layout::attach_allocated_section_to_segment): Rename from
16519 attach_to_segment. Remove flags parameter.
16520 (Layout::allocate_output_section): Remove function.
16521 (Layout::write_enable_output_section): Remove function.
16522 * layout.h (class Layout): Update for above changes. Add new
16523 field sections_are_attached_.
16524 * output.h (Output_section::update_flags_for_input_section): New
16525 function.
16526 * output.cc (Output_section::add_input_section): Call
16527 update_flags_for_input_section.
16528 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16529
009a67a2
CC
165302008-04-11 Cary Coutant <ccoutant@google.com>
16531
16532 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16533 thought unnecessary.
16534 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16535
759b1a24
ILT
165362008-04-11 Ian Lance Taylor <iant@google.com>
16537
16538 * output.h (class Output_section_data): Remove inline definition
16539 of set_addralign.
16540 * output.cc (Output_section_data::set_addralign): New function.
16541
c2b45e22
CC
165422008-04-11 Cary Coutant <ccoutant@google.com>
16543
16544 Add support for TLS descriptors for i386 and x86_64.
16545 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16546 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16547 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16548 GOT_TYPE_TLS_DESC.
16549 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16550 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16551 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16552 relocations.
16553 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16554 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16555 Fix problem with initial-exec relocations.
16556 (Target_i386::Relocate::relocate_tls): Likewise.
16557 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16558 relaxation.
16559 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16560 support for section-plus-offset dynamic table entries.
16561 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16562 (Output_data_dynamic::Dynamic_entry): Add support for
16563 section-plus-offset dynamic table entries.
16564 (Output_data_dynamic::Classification): Likewise.
16565 (Output_data_dynamic::classification_): Renamed offset_.
16566 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16567 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16568 (Target_x86_64::make_plt_section): New function.
16569 (Target_x86_64::reserve_tlsdesc_entries): New function.
16570 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16571 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16572 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16573 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16574 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16575 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16576 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16577 add extra PLT entry for TLS descriptors.
16578 (Output_data_plt_x86_64::got_): New field.
16579 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16580 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16581 fields.
16582 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16583 descriptors.
16584 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16585 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16586 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16587 R_386_TLS_DESC_CALL relocations.
16588 (Target_x86_64::Scan::global): Likewise.
16589 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16590 for TLS descriptors.
16591 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16592 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16593 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16594 GD-to-IE relaxation.
16595 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16596 and TLS_DESCRIPTORS.
16597 * Makefile.in: Rebuild.
16598 * configure: Rebuild.
16599 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16600 (tls_test_shared2.so): New target.
16601 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16602 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16603 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16604 (tls_shared_gd_to_ie_test_LDADD): New variable.
16605 (tls_shared_gnu2_gd_to_ie_test): New target.
16606 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16607 New targets.
16608 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16609 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16610 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16611 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16612 (tls_shared_gnu2_test): New target.
16613 (tls_test_gnu2_shared.so): New target.
16614 (tls_shared_gnu2_test_SOURCES): New variable.
16615 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16616 (tls_shared_gnu2_test_LDFLAGS): New variable.
16617 (tls_shared_gnu2_test_LDADD): New variable.
16618 * testsuite/Makefile.in: Rebuild.
16619 * testsuite/Makefile.
16620
83bfb6b7
ILT
166212008-04-11 Ian Lance Taylor <iant@google.com>
16622
16623 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16624 justsyms.t.
16625 * testsuite/Makefile.in: Rebuild.
16626
16627 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16628 long.
16629 * testsuite/script_test_2.cc (main): Adjust test.
16630
706e1f5e
ILT
166312008-04-11 David S. Miller <davem@davemloft.net>
16632 Ian Lance Taylor <iant@google.com>
16633
16634 * options.h (General_options): Add entries for '-Y' and
16635 '-relax'.
16636 * options.cc (General_options:finalize): If -Y was used, add those
16637 entries to the library path instead of the default "/lib" and
16638 "/usr/lib".
16639
7c98e6bb
DM
166402008-04-11 David S. Miller <davem@davemloft.net>
16641
16642 * testsuite/justsyms.t: Start at 0x100.
16643 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16644 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16645 long.
16646 * testsuite/script_test_2.cc: Adjust string and section length
16647 checks.
7c98e6bb 16648
99a37bfd
ILT
166492008-04-09 Ian Lance Taylor <iant@google.com>
16650
2cefc357
ILT
16651 PR gold/5996
16652 * script-sections.cc (Sections_element::allocate_to_segment): Add
16653 orphan parameter.
16654 (Output_section_definition::allocate_to_segment): Likewise.
16655 (Orphan_output_section::allocate_to_segment): Likewise.
16656 (Script_sections::attach_sections_using_phdrs_clause): Don't
16657 propagate non-PT_LOAD segments to orphan sections.
16658 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16659 readelf rather than objdump.
16660 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16661 .interp section and PT_INTERP segment are the same size.
16662 * testsuite/Makefile.in: Rebuild.
16663
99a37bfd
ILT
16664 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16665 aliases for symbols defined in the same object.
16666 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16667 (weak_alias_test_SOURCES): New variable.
16668 (weak_alias_test_DEPENDENCIES): New variable.
16669 (weak_alias_test_LDFLAGS): New variable.
16670 (weak_alias_test_LDADD): New variable.
16671 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16672 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16673 (weak_alias_test_3.o): New target.
16674 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16675 * testsuite/weak_alias_test_main.cc: New file.
16676 * testsuite/weak_alias_test_1.cc: New file.
16677 * testsuite/weak_alias_test_2.cc: New file.
16678 * testsuite/weak_alias_test_3.cc: New file.
16679
780e49c5
ILT
166802008-04-08 Ian Lance Taylor <iant@google.com>
16681
cdb0b8f5
ILT
16682 * options.h (class General_options): Add --noinhibit-exec option.
16683 * main.cc (main): Check --noinhibit-exec.
16684
0864d551
ILT
16685 * options.h (class General_options): Define --wrap as a special
16686 option. Add wrap_symbols_ field.
16687 (General_options::any_wrap_symbols): New function.
16688 (General_options::is_wrap_symbol): New function.
16689 * options.cc (General_options::parse_wrap): New function.
16690 (General_options::General_options): Initialize wrap_symbols_.
16691 * symtab.cc (Symbol_table::wrap_symbol): New function.
16692 (Symbol_table::add_from_object): Handle --wrap.
16693 * symtab.h (class Symbol_table): Declare wrap_symbol.
16694 * target.h (Target::wrap_char): New function.
16695 (Target::Target_info): Add wrap_char field.
16696 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16697 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16698 * testsuite/testfile.cc (Target_test::test_target_info):
16699 Likewise.
16700
789aa6de
ILT
16701 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16702 there is one.
16703
2c38906f
ILT
16704 * layout.h (class Layout): Add added_eh_frame_data_ field.
16705 * layout.cc (Layout::Layout): Initialize new field.
16706 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16707 output section until we find a section we merged successfully.
16708 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16709 that the size be non-zero.
16710
780e49c5
ILT
16711 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16712 qualifier.
16713
7fcd0256
ILT
167142008-04-08 Craig Silverstein <csilvers@google.com>
16715
16716 * configure.ac: Export new conditional variable HAVE_ZLIB.
16717 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16718 on HAVE_ZLIB.
16719 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16720 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16721
6835af53
ILT
167222008-04-07 Ian Lance Taylor <iant@google.com>
16723
e24f324c
ILT
16724 * version.cc (version_string): Set to "1.5".
16725
a036edd8
ILT
16726 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16727 Add issued_non_pic_error_ field. Declare check_non_pic.
16728 (Target_x86_64::Scan::check_non_pic): New function.
16729 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16730 (Target_x86_64::Scan::global): Likewise.
16731
624f8810
ILT
16732 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16733 addend parameter. Change caller. Handle merge sections.
16734 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16735 Address to Addend. Don't add in the result of
16736 local_section_offset, pass down the addend and use the returned
16737 value.
16738 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16739 Update declarations of local_section_offset and symbol_value.
16740 * testsuite/two_file_test_1.cc (t18): New function.
16741 * testsuite/two_file_test_2.cc (f18): New function.
16742 * testsuite/two_file_test_main.cc (main): Call t18.
16743 * testsuite/two_file_test.h (t18, f18): Declare.
16744
6835af53
ILT
16745 * configure.ac: Don't test for objdump, c++filt, or readelf.
16746 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16747 conditionals.
16748 (TEST_READELF): New variable.
16749 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16750 (check_PROGRAMS): Add two_file_strip_test.
16751 (two_file_strip_test): New target.
16752 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16753 (two_file_same_shared_strip_test_SOURCES): New variable.
16754 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16755 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16756 (two_file_same_shared_strip_test_LDADD): New variable.
16757 (two_file_shared_strip.so): New target.
16758 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16759 (ver_test_5.syms, ver_test_7.syms): Likewise.
16760 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16761 (strip_test_3.stdout): Use TEST_OBJDUMP.
16762 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16763
86925eef
CC
167642008-04-04 Cary Coutant <ccoutant@google.com>
16765
16766 * symtab.h (Symbol::is_weak_undefined): New function.
16767 (Symbol::is_strong_undefined): New function.
16768 (Symbol::is_absolute): New function.
16769 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16770 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16771 absolute symbols.
16772 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16773 (weak_undef_test): New target.
16774 * testsuite/Makefile.in: Rebuild.
16775 * testsuite/weak_undef_file1.cc: New file.
16776 * testsuite/weak_undef_file2.cc: New file.
16777 * testsuite/weak_undef_test.cc: New file.
16778
126f3ece
ILT
167792008-04-03 Craig Silverstein <csilvers@google.com>
16780
16781 * compressed_output.h (class Output_compressed_section): Use
16782 unsigned buffer.
16783 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16784 add zlib header.
16785 (zlib_compressed_suffix): Removed.
16786 (Output_compressed_section::set_final_data_size): Use unsigned
16787 buffers.
16788 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16789 Fix linker invocation.
16790 (flagstest_o_specialfile_and_compress_debug_sections):
16791 Likewise.
16792 * testsuite/Makefile.in: Regenerated.
16793
deae2a14
DM
167942008-04-02 David S. Miller <davem@davemloft.net>
16795
16796 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16797 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16798
70752818
ILT
167992008-04-02 Craig Silverstein <csilvers@google.com>
16800
16801 * TODO: New file.
16802
39d0cb0e
ILT
168032008-04-02 Ian Lance Taylor <iant@google.com>
16804
16805 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16806 parameters. Update for new key type to views_. Change all
16807 callers.
16808 (File_read::read): Adjust for byteshift in returned view.
16809 (File_read::add_view): New function, broken out of
16810 find_and_make_view.
16811 (File_read::make_view): New function, broken out of
16812 find_and_make_view.
16813 (File_read::find_or_make_view): Add offset and aligned
16814 parameters. Rewrite accordingly. Change all callers.
16815 (File_read::get_view): Add offset and aligned parameters. Adjust
16816 for byteshift in return value.
16817 (File_read::get_lasting_view): Likewise.
16818 * fileread.h (class File_read): Update declarations.
16819 (class File_read::View): Add byteshift_ field. Add byteshift to
16820 constructor. Add byteshift method.
16821 * archive.h (Archive::clear_uncached_views): New function.
16822 (Archive::get_view): Add aligned parameter. Change all callers.
16823 * object.h (Object::get_view): Add aligned parameter. Change all
16824 callers.
16825 (Object::get_lasting_view): Likewise.
16826
16827 * fileread.cc (File_read::release): Don't call clear_views if
16828 there are multiple objects.
16829 * fileread.h (File_read::clear_uncached_views): New function.
16830 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16831 on the archive.
16832
a1207466
CC
168332008-03-31 Cary Coutant <ccoutant@google.com>
16834
16835 Add thin archive support.
16836 * archive.cc (Archive::armagt): New const.
16837 (Archive::setup): Remove task parameter and calls to unlock.
16838 (Archive::unlock_nested_archives): New function.
16839 (Archive::read_header): Add nested_off parameter. Change
16840 all callers.
16841 (Archive::interpret_header): Likewise.
16842 (Archive::include_all_members): Change to handle thin
16843 archives.
16844 (Archive::include_member): Likewise.
16845 * archive.h (Archive::Archive): Add new parameters and
16846 initializers.
16847 (Archive::armagt): New const.
16848 (Archive::setup): Remove task parameter.
16849 (Archive::unlock_nested_archives): New function.
16850 (Archive::read_header): Add nested_off parameter.
16851 (Archive::interpret_header): Likewise.
16852 (Archive::Nested_archive_table): New typedef.
16853 (Archive::is_thin_archive_): New field.
16854 (Archive::nested_archives_): New field.
16855 (Archive::options_): New field.
16856 (Archive::dirpath_): New field.
16857 (Archive::task_): New field.
16858 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16859 for thin archives. Pass additional parameters to
16860 Archive::Archive. Unlock the archive file after calling
16861 Archive::setup.
cd536b21 16862
479f6503
ILT
168632008-03-29 Ian Lance Taylor <iant@google.com>
16864
686c8caf
ILT
16865 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16866 version symbol to be local.
16867 * testsuite/ver_test_4.sh: New file.
16868 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16869 (check_DATA): Add ver_test_4.syms.
16870 (ver_test_4.syms): New target.
16871 * testsuite/Makefile.in: Rebuild.
16872
ab794b6b
ILT
16873 * output.cc
16874 (Output_section::Input_section_sort_entry::has_priority): New
16875 function.
16876 (Output_section::Input_section_sort_entry::match_file_name): New
16877 function.
16878 (Output_section::Input_section_sort_entry::match_section_name):
16879 Remove.
16880 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16881 Remove.
16882 (Output_section::Input_section_sort_entry::match_section_file):
16883 Remove.
16884 (Output_section::Input_section_sort_compare::operator()): Rewrite
16885 using new Input_section_sort_entry functions. Sort crtbegin and
16886 crtend first. Sort sections with no priority before sections with
16887 a priority.
16888 * testsuite/initpri1.c (d3): Check j != 4.
16889 (cd5): New constructor/destructor function.
16890 (main): Check j != 2.
16891
479f6503
ILT
16892 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16893 new symbol when resolving, don't call set_is_default.
16894 * testsuite/ver_test_7.cc: New file.
16895 * testsuite/ver_test_7.sh: New file.
16896 * testsuite/Makefile.am (ver_test_7.so): New target.
16897 (ver_test_7.o): New target.
16898 (check_SCRIPTS): Add ver_test_7.sh.
16899 (check_DATA): Add ver_test_7.syms.
16900 (ver_test_7.syms): New target.
16901
2fd32231
ILT
169022008-03-28 Ian Lance Taylor <iant@google.com>
16903
16904 * layout.cc (Layout::layout): If we see an input section with a
16905 name that needs sorting, set the must_sort flag for the output
16906 section.
16907 (Layout::make_output_section): If the name of the output section
16908 indicates that it might require sorting, set the may_sort flag.
16909 * output.h (Output_section::may_sort_attached_input_sections): New
16910 function.
16911 (Output_section::set_may_sort_attached_input_sections): New
16912 function.
16913 (Output_section::must_sort_attached_input_sections): New
16914 function.
16915 (Output_section::set_must_sort_attached_input_sections): New
16916 function.
16917 (class Output_section): Declare Input_section_sort_entry. Define
16918 Input_section_sort_compare. Declare
16919 sort_attached_input_sections. Add new fields:
16920 may_sort_attached_input_sections_,
16921 must_sort_attached_input_sections_,
16922 attached_input_sections_are_sorted_.
16923 * output.cc (Output_section::Output_section): Initialize new
16924 fields.
16925 (Output_section::add_input_section): Add an entry to
16926 input_sections_ if may_sort or must_sort are true.
16927 (Output_section::set_final_data_size): Call
16928 sort_attached_input_sections if necessary.
16929 (Output_section::Input_section_sort_entry): Define new class.
16930 (Output_section::Input_section_sort_compare::operator()): New
16931 function.
16932 (Output_section::sort_attached_input_sections): New function.
16933 * configure.ac: Check whether the compiler supports constructor
16934 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16935 * testsuite/initpri1.c: New file.
16936 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16937 CONSTRUCTOR_PRIORITY.
16938 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16939 (initpri1_LDFLAGS): New variable.
16940 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16941
18e6b24e
ILT
169422008-03-27 Ian Lance Taylor <iant@google.com>
16943
49bdd526
ILT
16944 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16945 * testsuite/common_test_1.c: New file.
16946 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16947 (common_test_1_SOURCES): New variable.
16948 (common_test_1_DEPENDENCIES): New variable.
16949 (common_test_1_LDFLAGS): New variable.
16950
18e6b24e
ILT
16951 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16952 and commons_ correctly when NAME/VERSION does not override
16953 NAME/NULL.
16954 * testsuite/ver_test_6.c: New file.
16955 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16956 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16957 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16958
04bf7072
ILT
169592008-03-26 Ian Lance Taylor <iant@google.com>
16960
5871526f
ILT
16961 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16962 of an undefined symbol from a version script.
16963 * testsuite/Makefile.am (ver_test_5.so): New target.
16964 (ver_test_5.o): New target.
16965 (check_SCRIPTS): Add ver_test_5.sh.
16966 (check_DATA): Add ver_test_5.syms.
16967 (ver_test_5.syms): New target.
16968 * testsuite/ver_test_5.cc: New file.
16969 * testsuite/ver_test_5.script: New file.
16970 * testsuite/ver_test_5.sh: New file.
16971 * Makefile.in, testsuite/Makefile.in: Rebuild.
16972
04bf7072
ILT
16973 PR gold/5986
16974 Fix problems building gold with gcc 4.3.0.
16975 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16976 (gold_error_at_location, gold_warning_at_location): Use it.
16977 * configure.ac: Check whether we can compile and use a template
16978 function with a printf attribute.
16979 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16980 when jumping over bytes.
16981 * object.cc: Instantiate Object::read_section_data.
16982 * debug.h: Include <cstring>
16983 * dwarf_reader.cc: Include <algorithm>
16984 * main.cc: Include <cstring>.
16985 * options.cc: Include <cstring>.
16986 * output.cc: Include <cstring>.
16987 * script.cc: Include <cstring>.
16988 * script.h: Include <string>.
16989 * symtab.cc: Include <cstring> and <algorithm>.
16990 * target-select.cc: Include <cstring>.
16991 * version.cc: Include <string>.
16992 * testsuite/testmain.cc: Include <cstdlib>.
16993 * configure, config.in: Rebuild.
16994
874c5b28
ILT
169952008-03-25 Ian Lance Taylor <iant@google.com>
16996
819d6c3a
ILT
16997 * options.cc: Include "../bfd/bfdver.h".
16998 (options::help): Print bug reporting address.
16999
f4b2c6f5
ILT
17000 * version.cc (print_version): Adjust output for current value of
17001 BFD_VERSION_STRING.
17002
17003 * NEWS: New file.
17004
e96caa79
ILT
17005 * options.cc (options::help): Print list of supported targets.
17006 * target-select.h: Include <vector>.
17007 (class Target_selector): Make machine_, size_, and is_big_endian_
17008 fields const. Add bfd_name_ and instantiated_target_ fields.
17009 (Target_selector::Target_selector): Add bfd_name parameter.
17010 (Target_selector::recognize): Make non-virtual, call
17011 do_recognize.
17012 (Target_selector::recognize_by_name): Make non-virtual, call
17013 do_recognize_by_name.
17014 (Target_selector::supported_names): New function.
17015 (Target_selector::bfd_name): New function.
17016 (Target_selector::do_instantiate_target): New pure virtual
17017 function.
17018 (Target_selector::do_recognize): New virtual function.
17019 (Target_selector::do_recognize_by_name): New virtual function.
17020 (Target_selector::instantiate_target): New private function.
17021 (supported_target_names): Declare.
17022 * target-select.cc (Target_selector::Target_selector): Update for
17023 new parameter and fields.
17024 (select_target_by_name): Check that the name matches before
17025 calling recognize_by_name.
17026 (supported_target_names): New function.
17027 * i386.cc (class Target_selector_i386): Update Target_selector
17028 constructor call. Remove recognize and recognize_by_name. Add
17029 do_instantiate_target.
17030 * x86_64.cc (class Target_selector_x86_64): Likewise.
17031 * testsuite/testfile.cc (class Target_selector_test): Update for
17032 changes to Target_selector.
17033
874c5b28
ILT
17034 * README: Rewrite, with some notes on unsupported features.
17035
0a65a3a7
CC
170362008-03-24 Cary Coutant <ccoutant@google.com>
17037
17038 * i386.cc (Target_i386::Got_type): New enum declaration.
17039 (Target_i386::Scan::local): Updated callers of Output_data_got
17040 member functions.
17041 (Target_i386::Scan::global): Likewise.
17042 (Target_i386::Relocate::relocate): Likewise.
17043 (Target_i386::Relocate::relocate_tls): Likewise.
17044 * object.h (Got_offset_list): New class.
17045 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17046 (Sized_relobj::local_got_offset): Likewise.
17047 (Sized_relobj::set_local_got_offset): Likewise.
17048 (Sized_relobj::local_has_tls_got_offset): Removed.
17049 (Sized_relobj::local_tls_got_offset): Removed.
17050 (Sized_relobj::set_local_tls_got_offset): Removed.
17051 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17052 * output.cc (Output_data_got::add_global): Added got_type parameter.
17053 (Output_data_got::add_global_with_rel): Likewise.
17054 (Output_data_got::add_global_with_rela): Likewise.
17055 (Output_data_got::add_global_pair_with_rel): New function.
17056 (Output_data_got::add_global_pair_with_rela): New function.
17057 (Output_data_got::add_local): Added got_type parameter.
17058 (Output_data_got::add_local_with_rel): Likewise.
17059 (Output_data_got::add_local_with_rela): Likewise.
17060 (Output_data_got::add_local_pair_with_rel): New function.
17061 (Output_data_got::add_local_pair_with_rela): New function.
17062 (Output_data_got::add_global_tls): Removed.
17063 (Output_data_got::add_global_tls_with_rel): Removed.
17064 (Output_data_got::add_global_tls_with_rela): Removed.
17065 (Output_data_got::add_local_tls): Removed.
17066 (Output_data_got::add_local_tls_with_rel): Removed.
17067 (Output_data_got::add_local_tls_with_rela): Removed.
17068 * output.h (Output_data_got::add_global): Added got_type parameter.
17069 (Output_data_got::add_global_with_rel): Likewise.
17070 (Output_data_got::add_global_with_rela): Likewise.
17071 (Output_data_got::add_global_pair_with_rel): New function.
17072 (Output_data_got::add_global_pair_with_rela): New function.
17073 (Output_data_got::add_local): Added got_type parameter.
17074 (Output_data_got::add_local_with_rel): Likewise.
17075 (Output_data_got::add_local_with_rela): Likewise.
17076 (Output_data_got::add_local_pair_with_rel): New function.
17077 (Output_data_got::add_local_pair_with_rela): New function.
17078 (Output_data_got::add_global_tls): Removed.
17079 (Output_data_got::add_global_tls_with_rel): Removed.
17080 (Output_data_got::add_global_tls_with_rela): Removed.
17081 (Output_data_got::add_local_tls): Removed.
17082 (Output_data_got::add_local_tls_with_rel): Removed.
17083 (Output_data_got::add_local_tls_with_rela): Removed.
17084 * resolve.cc (Symbol::override_base_with_special): Removed
17085 reference to has_got_offset_ field.
17086 * symtab.cc (Symbol::init_fields): Replaced initialization
17087 of got_offset_ with got_offsets_. Removed initialization
17088 of has_got_offset_
53fcba31 17089 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17090 (Symbol::got_offset): Likewise.
17091 (Symbol::set_got_offset): Likewise.
17092 (Symbol::has_tls_got_offset): Removed.
17093 (Symbol::tls_got_offset): Removed.
17094 (Symbol::set_tls_got_offset): Removed.
17095 (Symbol::got_offset_): Removed.
17096 (Symbol::tls_mod_got_offset_): Removed.
17097 (Symbol::tls_pair_got_offset_): Removed.
17098 (Symbol::got_offsets_): New field.
17099 (Symbol::has_got_offset): Removed.
17100 (Symbol::has_tls_mod_got_offset): Removed.
17101 (Symbol::has_tls_pair_got_offset): Removed.
17102 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17103 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17104 member functions.
17105 (Target_x86_64::Scan::global): Likewise.
17106 (Target_x86_64::Relocate::relocate): Likewise.
17107 (Target_x86_64::Relocate::relocate_tls): Likewise.
17108
bd52eafb
BE
171092008-03-25 Ben Elliston <bje@au.ibm.com>
17110
17111 * yyscript.y: Fix spelling error in comment.
17112
8b105e34
ILT
171132008-03-24 Ian Lance Taylor <iant@google.com>
17114
8ed814a9
ILT
17115 * options.h (class General_options): Define build_id option.
17116 * layout.h (class Layout): Declare write_build_id, create_note,
17117 create_build_id. Add build_id_note_ member.
17118 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17119 "libiberty.h", "md5.h", "sha1.h".
17120 (Layout::Layout): Initialize eh_frame_data_,
17121 eh_frame_hdr_section_, and build_id_note_.
17122 (Layout::finalize): Call create_build_id.
17123 (Layout::create_note): New function, broken out of
17124 Layout::create_gold_note.
17125 (Layout::create_gold_note): Call create_note.
17126 (Layout::create_build_id): New function.
17127 (Layout::write_build_id): New function.
17128 (Close_task_runner::run): Call write_build_id.
17129
8b105e34
ILT
17130 * x86_64.cc: Correct license to GPLv3.
17131
086a1841
ILT
171322008-03-23 Ian Lance Taylor <iant@google.com>
17133
17134 * options.cc: Include "demangle.h".
17135 (parse_optional_string): New function.
17136 (parse_long_option): Handle takes_optional_argument.
17137 (parse_short_option): Update dash_z initializer. Handle
17138 takes_optional_argument.
17139 (General_options::General_options): Initialize do_demangle_.
17140 (General_options::finalize): Set do_demangle_. Handle demangling
17141 style.
17142 * options.h (parse_optional_string): Declare.
17143 (struct One_option): Add optional_arg field. Update constructor.
17144 Update call constructor calls. Add takes_optional_argument
17145 function.
17146 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17147 (DEFINE_optional_string): Define.
17148 (General_options::demangle): Change from DEFINE_bool to
17149 DEFINE_optional_string.
17150 (General_options::no_demangle): New function.
17151 (General_options::do_demangle): New function.
17152 (General_options::set_do_demangle): New function.
17153 (General_options::execstack_status_): Move definition to end of
17154 class definition.
17155 (General_options::static_): Likewise.
17156 (General_options::do_demangle_): New field.
17157 * object.cc (big_endian>::get_symbol_location_info): Call
17158 Options::do_demangle, not Options::demangle.
17159 * symtab.cc (demangle): Likewise.
17160
cbb93e63
ILT
171612008-03-22 Ian Lance Taylor <iant@google.com>
17162
17163 * gold.h: Include <cstddef> and <sys/types.h>
17164 * options.h: Include <cstring>.
17165
ec531623
ILT
171662008-03-21 Ian Lance Taylor <iant@google.com>
17167
17168 * Added source code to GNU binutils.
752937aa 17169\f
b90efa5b 17170Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17171
17172Copying and distribution of this file, with or without modification,
17173are permitted in any medium without royalty provided the copyright
17174notice and this notice are preserved.
17175
17176Local Variables:
17177mode: change-log
17178left-margin: 8
17179fill-column: 74
17180version-control: never
17181End:
This page took 1.16668 seconds and 4 git commands to generate.