PowerPC gold assertion on missing global entry stub
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
6ec65f28
AM
12015-04-28 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
4 on missing global entry stub due to bogus debug info.
5
7a2a1c79
HS
62015-04-27 Han Shen <shenhan@google.com>
7
8 * options.h (--fix-cortex-a53-843419): Rename option.
9 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
10 option.
11 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
12
cfbf0e3c
RÁE
132015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
14
15 PR gold/18327
16 * output.cc (Output_section::is_input_address_mapped): Assume a missing
17 entry is mapped.
18 * testsuite/Makefile.am: Add the eh_test test.
19 * testsuite/Makefile.in: Regenerate.
20 * testsuite/eh_test_a.cc: New test.
21 * testsuite/eh_test_b.cc: New test.
22
6ec65f28
AM
232015-04-23 Sriraman Tallam <tmsriram@google.com>
24
a100d66f
ST
25 * options.h (--weak-unresolved-symbols): New option.
26 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
27 binding to weak with new option.
28 * symtab.h (is_weak_undefined): Check for new option.
29 (is_strong_undefined): Check for new option.
30 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
31 * testsuite/Makefile.in: Regenerate.
32 * testsuite/weak_unresolved_symbols_test.cc: New file.
33
4b889c30
IC
342015-04-20 Ian Coolidge <icoolidge@google.com>
35
36 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
37 GNU_UNIQUE.
38
4277535c
RÁE
392015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
40
41 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
42 push_back.
43 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
44 * object.cc (Sized_relobj_file::do_layout): Use push_back.
45 * powerpc.cc (process_gc_mark): Use push_back.
46 (Target_powerpc::do_gc_mark_symbol): Use push_back.
47 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
48
7a2a1c79 492015-04-16 Han Shen <shenhan@google.com>
5019d64a 50
6ec65f28
AM
51 * aarch64.cc (AArch64_insn_utilities): New utility class.
52 (AArch64_relobj::Mapping_symbol_position): New struct.
53 (AArch64_relobj::Mapping_symbol_info): New typedef.
54 (AArch64_relobj::do_count_local_symbols): New function overriding
55 parent's implementation.
56 (AArch64_relobj::mapping_symbol_info_): New member
57 (AArch64_relobj::scan_erratum_843419): New method.
58 (Target_aarch64::scan_erratum_843419_span): New method.
59 (Target_aarch64::is_erratum_843419_sequence): New method.
60 * options.h (fix_cortex_a53): New option.
5019d64a 61
a6a17750
CC
622015-04-09 Cary Coutant <ccoutant@google.com>
63
64 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
65 in a PIE link.
66 * testsuite/Makefile.am (tls_pie_test.sh): New test.
67 * testsuite/Makefile.in: Regenerate.
68 * testsuite/tls_pie_test.sh: New.
69
437ddf0c
CC
702015-04-09 Cary Coutant <ccoutant@google.com>
71
72 * debug.h (DEBUG_LOCATION): New.
73 (DEBUG_ALL): Include DEBUG_LOCATION.
74 (debug_string_to_enum): Add DEBUG_LOCATION.
75 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
76 output to print correct context.
77 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
78 up to 4 more locations at the beginning of the function.
79 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
80 result before sorting list of line numbers.
81 * testsuite/debug_msg.sh: Allow range of line numbers for
82 canonical results on optimized code.
83
24491327
HS
842015-04-07 HC Yen <hc.yen@mediatek.com>
85
86 Add AArch32 support for gold linker.
87 gold/
88 * arm.cc: Add V8 arch combine table.
89
7fa5525f
RÁE
902015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
91
92 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
93
5368dcf2
RÁE
942015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
95
96 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
97 to find by using the return value of insert.
98
9dbb4b02
RÁE
992015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
100
101 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
102 constructor call.
103
1fa29f10
IT
1042015-04-06 Ilya Tocar <ilya.tocar@intel.com>
105
106 PR gold/17641
107 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
108 (Target_x86_64::Scan::local): Don't create GOT entry, when we
109 can convert mov to lea.
110 (Target_x86_64::Scan::global): Ditto.
111 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
112 %reg to lea foo(%rip), %reg if possible.
113 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
114 * testsuite/x86_64_mov_to_lea1.s: New.
115 * testsuite/x86_64_mov_to_lea2.s: Ditto.
116 * testsuite/x86_64_mov_to_lea3.s: Ditto.
117 * testsuite/x86_64_mov_to_lea4.s: Ditto.
118 * testsuite/x86_64_mov_to_lea.sh: Ditto.
119
39f3de7c
L
1202015-04-02 H.J. Lu <hongjiu.lu@intel.com>
121
122 * configure: Regenerated.
123
c4fc4724
IT
1242015-04-01 Ilya Tocar <ilya.tocar@intel.com>
125
126 PR gold/17640
127 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
128 (Target_i386::Scan::local): Don't create GOT entry, when we
129 can convert GOT to GOTOFF.
130 (Target_i386::Scan::global): Ditto.
131 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
132 lea foo@GOTOFF(%reg), %reg if possible.
133 * testsuite/Makefile.am (i386_mov_to_lea): New test.
134 * testsuite/i386_mov_to_lea1.s: New.
135 * testsuite/i386_mov_to_lea2.s: Ditto.
136 * testsuite/i386_mov_to_lea3.s: Ditto.
137 * testsuite/i386_mov_to_lea4.s: Ditto.
138 * testsuite/i386_mov_to_lea5.s: Ditto.
139 * testsuite/i386_mov_to_lea.sh: Ditto.
140
918357b9
L
1412015-04-01 H.J. Lu <hongjiu.lu@intel.com>
142
143 * Makefile.am (ZLIB): New.
144 (ZLIBINC): Likewise.
145 (AM_CFLAGS): Add $(ZLIBINC).
146 (AM_CXXFLAGS): Likewise.
147 (ldadd_varldadd_var): Add $(ZLIB).
148 (incremental_dump_LDADD): Likewise.
149 (dwp_LDADD): Likewise.
150 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
151 <zlib.h>.
152 (zlib_compress): Don't check HAVE_ZLIB_H.
153 (zlib_decompress): Likewise.
154 * options.h (compress_debug_sections): Likewise.
155 * configure.ac (AM_CONDITIONAL): Removed.
156 * testsuite/Makefile.am (ZLIB): New.
157 (LDADD): Add $(ZLIB).
158 Don't check HAVE_ZLIB.
159 * Makefile.in: Regenerated.
160 * config.in: Likewise.
161 * configure: Likewise.
162 * testsuite/Makefile.in: Likewise.
163
6b0ad2eb
JY
1642015-03-30 Jing Yu <jingyu@google.com>
165
166 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
167 TLSLD_ADD_DTPREL_LO12_NC.
168 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
169 _TLS_MODULE_BASE_ point to the start of tls segment.
170 (Target_aarch64::optimize_tls_reloc): Add cases for
171 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
172 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
173 (Target_aarch64::Scan::local): Likewise.
174 (Target_aarch64::Scan::global): Likewise.
175 (Target_aarch64::Relocate::relocate): Likewise.
176 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
177 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
178 relocations.
179
0916f9e7
RÁE
1802015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
181
182 * merge.cc (Object_merge_map::add_mapping): call
183 Object_merge_map::Input_merge_map::add_mapping.
184 (Object_merge_map::Input_merge_map::add_mapping): New.
185 (Output_merge_data::do_add_input_section): Call
186 get_or_make_input_merge_map before a loop.
187 (Output_merge_string<Char_type>::finalize_merged_data): Call
188 get_or_make_input_merge_map before a loop.
189 * merge.h (Object_merge_map): Make Input_merge_map public.
190 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
191 (Relobj::get_or_create_merge_map): New.
192 * object.h (Relobj::get_or_create_merge_map): New.
193
282c9750
AM
1942015-03-24 Alan Modra <amodra@gmail.com>
195
196 PR 18147
197 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
198 relocation errors for branches to strong undefined symbols.
199
67f95b96
RÁE
2002015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
201
202 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
203 (Object_merge_map::is_merge_section_for): Remove.
204 (Object_merge_map::find_merge_section): New.
205 * merge.h (Object_merge_map::is_merge_section_for): Remove.
206 (Object_merge_map::find_merge_section): New.
207 (Object_merge_map::get_input_merge_map): Add a const version.
208 * object.cc (Relobj::is_merge_section_for): Remove.
209 (Relobj::find_merge_section): New.
210 * object.h (Relobj::is_merge_section_for): Remove.
211 (Relobj::find_merge_section): New.
212 * output.cc
213 (Output_section::Input_section::is_merge_section_for): Remove.
214 (Output_section::add_merge_input_section): Don't call
215 add_merge_input_section.
216 (Output_section::find_merge_section): Return const. Use
217 object->find_merge_section.
218 (Output_section::build_lookup_maps): Don't build a map for
219 merge sections.
220 (Output_section::is_input_address_mapped): Return false if
221 section is not found.
222 (Output_section::find_starting_output_address): Use
223 find_merge_section instead of is_merge_section_for.
224 (Output_section::add_script_input_section): Don't build a map for
225 merge sections.
226 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
227 (Output_section_lookup_maps::find_merge_section): Remove.
228 (Output_section_lookup_maps::add_merge_input_section) Remove.
229 (Output_section::find_merge_section): Return const.
230
152f7024
CC
2312015-03-22 Cary Coutant <cary@google.com>
232
233 PR gold/18106
234 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
235 non-SIB form of lea, with nop after the call.
236
bccffdfd
CC
2372015-03-21 Cary Coutant <cary@google.com>
238
239 PR gold/14217
240 * output.cc (Output_segment::is_first_section_relro): Don't ignore
241 .tdata section.
242 (Output_segment::set_section_addresses): Don't align size of relro
243 segment for .tbss.
244
1c582fe7
CC
2452015-03-21 Cary Coutant <cary@google.com>
246
247 PR gold/18010
248 * stringpool.cc (Stringpool_template): Don't optimize if section
249 alignment is greater than sizeof(char).
250
410da591
CC
2512015-03-21 Cary Coutant <cary@google.com>
252
253 PR gold/18048
254 * script-c.h (script_include_directive): Add first_token parameter.
255 * script.cc (script_include_directive): Add first_token parameter, and
256 pass it to read_script_file.
257 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
258 (PARSING_MEMORY_DEF): New tokens.
259 (top): Add new productions for INCLUDE files.
260 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
261 Pass PARSING_LINKER_SCRIPT to script_include_directive.
262 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
263 (section_cmd): Pass PARSING_SECTION_CMDS.
264 (file_or_sections_cmd): Remove.
265 (memory_def): Pass PARSING_MEMORY_DEF.
266 * testsuite/Makefile.am (memory_test_2): New test.
267 * testsuite/Makefile.in: Regenerate.
268 * testsuite/memory_test_inc.t: New script file.
269 * testsuite/memory_test_inc_1.t.src: New script file.
270 * testsuite/memory_test_inc_2.t.src: New script file.
271 * testsuite/memory_test_inc_3.t.src: New script file.
272
0d5bbdb0
CC
2732015-03-21 Cary Coutant <cary@google.com>
274
275 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
276 (Sized_relobj_dwo::setup): Build compressed section map.
277 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
278 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
279 section map.
280 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
281 compressed_sections_ field.
282 (build_compressed_section_map): Take Object instead of
283 Sized_relobj_file parameter; add decompress_if_needed parameter.
284 (Sized_relobj_file::do_find_special_sections): Store compressed
285 section map in parent Object.
286 (Sized_relobj_file::do_decompressed_section_contents): Move
287 implementation to Object::decompressed_section_contents.
288 (Sized_relobj_file::do_discard_decompressed_sections): Move
289 implementation to Object::discard_decompressed_sections.
290 * object.h (build_compressed_section_map): Declare.
291 (Object::Object): Add compressed_sections_ field.
292 (Object::section_is_compressed): Move implementation here.
293 (Object::decompressed_section_contents): De-virtualize.
294 (Object::discard_decompressed_sections): De-virtualize.
295 (Object::do_section_is_compressed): Delete.
296 (Object::do_decompressed_section_contents): Delete.
297 (Object::set_compressed_sections): New method.
298 (Object::compressed_sections): New method.
299 (Object::compressed_sections_): New data member.
300 (Compressed_section_info, Compressed_section_map): Move to top of file.
301 (Sized_relobj_file::do_section_is_compressed): Delete.
302 (Sized_relobj_file::do_decompressed_section_contents): Delete.
303 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
304 (Sized_relobj_file::compressed_sections_): Move to Object class.
305
bd9e0d46
CC
3062015-03-21 Cary Coutant <ccoutant@google.com>
307
308 PR gold/18152
309 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
310 deferred objects.
311
943c8b43
CC
3122015-03-11 Cary Coutant <ccoutant@google.com>
313
314 * options.cc (General_options::finalize): Don't allow -z relro
315 with incremental linking.
316 * testsuite/Makefile.am (incremental_test): Add -z norelro.
317 (incremental_test_2): Likewise.
318 (incremental_test_3): Likewise.
319 (incremental_test_4): Likewise.
320 (incremental_test_5): Likewise.
321 (incremental_test_6): Likewise.
322 (incremental_copy_test): Likewise.
323 (incremental_common_test_1): Likewise.
324 (incremental_comdat_test_1): Likewise.
325 * testsuite/Makefile.in: Regenerate.
326
e1663197
CC
3272015-03-09 Cary Coutant <ccoutant@google.com>
328
329 PR gold/14675
330 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
331 return enum indicating whether .eh_frame section is empty, optimizable,
332 unrecognized, or an end marker. Adjust explicit instantiations.
333 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
334 (Eh_frame::add_ehframe_input_section): Change return type.
335 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
336 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
337 to the .eh_frame output section until we see the end marker.
338 (Layout::finalize_eh_frame_section): New.
339 * layout.h: (Layout::finalize_eh_frame_section): New.
340
beb8418f
L
3412015-03-05 H.J. Lu <hongjiu.lu@intel.com>
342
343 * output.cc (Relobj::initialize_input_to_output_map<size>):
344 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
345
48c73428
CC
3462015-03-04 Cary Coutant <ccoutant@google.com>
347
348 * parameters.cc (Parameters::set_target_once): Call
349 Target::select_as_default_target just once from here...
350 (set_parameters_target): ...instead of from here.
351
3522015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
353
354 * ehframe.cc (Cie::set_output_offset): Pass in and use a
355 Output_section_data instead of a Merge_map.
356 (Eh_frame::Eh_frame): Don't initialize merge_map_.
357 (Eh_frame::read_cie): Use add_merge_mapping instead of
358 Merge_map::add_mapping.
359 (Eh_frame::read_fde): Ditto.
360 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
361 (Eh_frame::do_output_offset): Use merge_output_offset istead of
362 merge_map_->get_output_offset.
363 (Eh_frame::do_is_merge_section_for): Delete.
364 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
365 instead of a Merge_map.
366 (Cie::set_output_offset): Pass in a Output_section_data instead of a
367 Merge_map.
368 (Eh_frame::do_is_merge_section_for): Delete.
369 (Eh_frame::merge_map_): Delete.
370 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
371 and use a Output_section_data instead of a Merge_map.
372 (Object_merge_map::add_mapping): Ditto.
373 (Object_merge_map::get_output_offset): Remove the merge_map argument.
374 (Object_merge_map::is_merge_section_for): Pass in and use a
375 Output_section_data instead of a Merge_map.
376 (Merge_map): Delete.
377 (Output_merge_base::do_output_offset): Use merge_output_offset instead
378 of merge_map_.get_output_offset.
379 (Output_merge_base::do_is_merge_section_for): Delete.
380 (Output_merge_data::do_add_input_section): Use
381 object->add_merge_mapping instead of add_mapping.
382 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
383 * merge.h (Merge_map): Delete forward declaration.
384 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
385 instead of a Merge_map.
386 (Object_merge_map::get_output_offset): Remove the merge_map argument.
387 (Object_merge_map::is_merge_section_for): Pass in and use a
388 Output_section_data instead of a Merge_map.
389 (Input_merge_map::Object_merge_map::merge_map): Replace with
390 output_data.
391 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
392 Output_section_data instead of a Merge_map.
393 (Merge_map): Delete.
394 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
395 (Output_merge_base::do_is_merge_section_for): Delete.
396 (Output_merge_base::add_mapping): Delete.
397 (Output_merge_base::merge_map_): Delete.
398 * object.cc (Relobj::initialize_input_to_output_map): New.
399 (Relobj::initialize_input_to_output_map): New.
400 (Relobj::merge_output_offset): New.
401 (Relobj::is_merge_section_for): New.
402 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
403 bits.
404 * object.h (Relobj::merge_map): Delete.
405 (initialize_input_to_output_map): New.
406 (set_merge_map): Delete.
407 (add_merge_mapping): New.
408 (merge_output_offset): New.
409 (is_merge_section_for): New.
410 * output.cc (Output_section::Input_section::is_merge_section_for):
411 Use object->is_merge_section_for.
412 * output.h (Output_section_data::is_merge_section_for): Delete.
413 (Output_section_data::do_is_merge_section_for): Delete.
414 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
415 Use object->initialize_input_to_output_map.
416 (Merged_symbol_value<size>::value_from_output_section): Use
417 object->merge_output_offset.
418
48c73428 4192015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
420 Cary Coutant <ccoutant@google.com>
421
422 * output.cc (Output_section::add_merge_input_section): Do not
423 attempt to merge sections with an entsize of 0.
424
48c73428 4252015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
426
427 * attributes.h (class Output_attributes_section_data ): Add
428 do_print_to_mapfile function.
429
ec86f434
AM
4302015-02-24 Alan Modra <amodra@gmail.com>
431
432 PR 18010
433 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
434 complain if value is not a multiple of four.
435 (Target_powerpc::Relocate::relocate): Correct handling of
436 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
437
be66981e
L
4382015-02-21 H.J. Lu <hongjiu.lu@intel.com>
439
440 * configure.ac (default_size): Set to 32 for x32.
441 * configure: Regenerated.
442
e3ee8ed4
AM
4432015-02-18 Alan Modra <amodra@gmail.com>
444
445 PR 17954
446 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
447 visibility.
448
3a935c6c
RÁE
4492015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
450
451 * gc.h (Garbage_collection::add_reference): Don't use find.
452
e0a1e121
RÁE
4532015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
454
455 * object.cc (write_local_symbols): avoid std::vector copy.
456
45a4fb1a
RÁE
4572015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
458
459 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
460
2d9afefe
MW
4612015-02-09 Mark Wielaard <mjw@redhat.com>
462
463 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
464 DW_LANG_Fortran03 and DW_LANG_Fortran08.
465
e9c1bdad
CC
4662015-02-16 Cary Coutant <ccoutant@google.com>
467
468 PR gold/13577
469 PR gold/16992
470 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
471 DF_SYMBOLIC if --dynamic-list option is used.
472 * options.cc (General_options::finalize): --dynamic-list is not
473 mutually exclusive with -Bsymbolic.
474 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
475 listed in --dynamic-list.
476 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
477 -Bsymbolic-functions.
478 * testsuite/Makefile.in: Regenerate.
479
0ed4b0bf
CC
4802015-02-16 Cary Coutant <ccoutant@google.com>
481
482 PR gold/17971
483 * incremental.cc: Remove redundant include of "output.h".
484
1a920511
JY
4852015-02-12 Jing Yu <jingyu@google.com>
486
487 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
488 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
489 New relocation.
490 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
491 TLSLE_MOVW_* relocations.
492 (Target_aarch64::Scan::global): Likewise.
493 (Target_aarch64::Relocate::relocate): Likewise.
494 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
495 for new TLSLE_MOVW_* relocations.
496
07f107f3
WN
4972015-02-11 Will Newton <will.newton@linaro.org>
498
499 PR gold/13321
500 * arm.cc (Target_arm::make_plt_section): Create an ARM
501 state mapping symbol at the start of the PLT.
502
e051a5b5
L
5032015-02-09 H.J. Lu <hongjiu.lu@intel.com>
504
505 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
506 Replace two_file_shared_2.so with two_file_shared_1.so.
507 * testsuite/Makefile.in: Regenerated.
508
dddcc5b9
AM
5092015-02-09 Alan Modra <amodra@gmail.com>
510
511 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
512 plugin_test_thin.a and defsym_test.
513 * testsuite/Makefile.in: Regenerate.
514
b39b8b9d
RÁE
5152015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
516
517 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
518 body.
519
b66d1c52
CC
5202015-02-04 Peter Collingbourne <pcc@google.com>
521
522 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
523 forwarding symbols when computing symbol resolution info for plugins.
524 * plugin.h (Plugin_manager::symtab): New method.
525 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
526
23081de0
CC
5272015-02-03 Cary Coutant <ccoutant@google.com>
528 Peter Collingbourne <pcc@google.com>
529
530 PR gold/15660
531 * archive.cc (Thin_archive_object_unlocker): New class.
532 (Archive::include_member): Unlock external members of thin archives.
533 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
534 (plugin_test_2): Likewise.
535 (plugin_test_3): Likewise.
536 (plugin_test_4): Likewise.
537 (plugin_test_5): Likewise.
538 (plugin_test_6): Likewise.
539 (plugin_test_7): Likewise.
540 (plugin_test_8): Likewise.
541 (plugin_test_9): Likewise.
542 (plugin_test_10): Likewise.
543 (plugin_test_11): New test case.
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
546 file to decide whether to claim file.
547 (all_symbols_read_hook): Likewise.
548 * testsuite/plugin_test_1.sh: Adjust expected output.
549 * testsuite/plugin_test_2.sh: Likewise.
550 * testsuite/plugin_test_3.sh: Likewise.
551 * testsuite/plugin_test_6.sh: Likewise.
552 * testsuite/plugin_test_tls.sh: Likewise.
553 * testsuite/plugin_test_11.sh: New testcase.
554
5552015-02-03 Cary Coutant <ccoutant@google.com>
556
557 * descriptors.cc (Descriptors::open): Set artificially-low limit for
558 file descriptors when debugging enabled. Add debug output.
559 (Descriptors::release): Add debug output.
560 (Descriptors::close_some_descriptor): Likewise.
561 (Descriptors::close_all): Likewise.
562 * fileread.cc (File_read::lock): Likewise.
563 (File_read::unlock): Likewise.
564
24dd5808
CC
5652015-02-02 Cary Coutant <ccoutant@google.com>
566
567 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
568 executable output file.
569
fa89cc82
HS
5702015-01-22 Han Shen <shenhan@google.com>
571
572 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
573 (Target_arm::do_plt_address_for_global): New method.
574 (Target_arm::do_plt_address_for_local): New method.
575 (Target_arm::rel_irelative_section): New method.
576 (Target_arm::make_data_plt): Add more parameters for plt ctor.
577 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
578 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
579 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
580 (Target_arm::Scan::check_non_pic): Add ifunc support.
581 (Target_arm::Scan::local): Add ifunc support.
582 (Target_arm::Scan::global): Add ifunc support.
583 (Target_arm::make_plt_section): New method.
584 (Target_arm::make_plt_entry): Change to call to make_plt_section.
585 (Target_arm::make_local_ifunc_plt_entry): New method.
586 (Target_arm::got_irelative_): New member.
587 (Target_arm::rel_irelative_): New member.
588 (Target_arm::got_section): Add creation for got_irelative_.
589 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
590 (Target_arm::Relocate::relocate): Properly set local ifunc address.
591 (Target_arm::do_dynsym_value): Properly set global ifunc address.
592 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
593 (Output_data_plt_arm::IRelative_data): New type.
594 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
595 (Output_data_plt_arm::add_entry): Add more parameters.
596 (Output_data_plt_arm::add_relocation): New method.
597 (Output_data_plt_arm::add_local_ifunc_entry): New method.
598 (Output_data_plt_arm::rel_irelative): New method.
599 (Output_data_plt_arm::entry_count): Modified.
600 (Output_data_plt_arm::address_for_global): New method.
601 (Output_data_plt_arm::address_for_local): New method.
23081de0 602gold/
fa89cc82
HS
603 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
604 (Output_data_plt_arm::insert_irelative_data): New method.
605 (Output_data_plt_arm::irelative_rel_): New member.
606 (Output_data_plt_arm::got_): New member.
607 (Output_data_plt_arm::got_irelative_): New member.
608 (Output_data_plt_arm::irelative_count_): New member.
609 (Output_data_plt_arm::IRelative_data_vec): New typedef.
610 (Output_data_plt_arm::irelative_data_vec_): New member.
611 (Output_data_plt_arm::do_write): Write out irelative entries.
612 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
613 more parameters to ctor.
614 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
615 more parameters to ctor.
616 * output.h (Output_data_reloc::add_local_relative): New method.
617 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
618
0f81d3f0
AM
6192015-01-29 Alan Modra <amodra@gmail.com>
620
621 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
622 and GOT_TLSGD to LE optimization.
623
65d92137
CC
6242015-01-28 Cary Coutant <ccoutant@google.com>
625
626 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
627 for undef TLS symbols.
628 (Target_x86_64::Relocate::relocate_tls): Likewise.
629 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
630
5485698a
CC
6312015-01-25 Cary Coutant <ccoutant@google.com>
632
633 * output.cc (Output_segment::set_section_addresses): Fix calculation
634 of size of relro segment.
635
b01a4b04
AM
6362015-01-22 Alan Modra <amodra@gmail.com>
637
638 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
639 condition for need of ifunc plt entry.
640 (Target_powerpc::Scan::global <got relocs>): Likewise.
641
3d0064a9
CC
6422015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
643
644 * mips.cc (reloc_high): Add r_sym.
645 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
646 reloc_high constructor.
647 (Mips_relocate_functions::relgot16_local): Likewise.
648 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
649 r_type to decide whether LO16 matches HI16.
650 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
651 rello16 and relgot16_local.
652
a5cd8f05
CC
6532015-01-09 Cary Coutant <ccoutant@google.com>
654
655 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
656 unless alignment is larger than page size.
657
4fc1b9d4
L
6582015-01-06 H.J. Lu <hongjiu.lu@intel.com>
659 Cary Coutant <ccoutant@google.com>
660
661 PR gold/17729
662 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
663 (DEFAULT_TARGET_X32): Set for x32.
664 * x86_64.cc (cmp_insn_32): New.
665 (lea_r10_insn_32): Likewise.
666 (lea_r11_insn_32): Likewise.
667 (cmp_insn_64): Likewise.
668 (lea_r10_insn_64): Likewise.
669 (lea_r11_insn_64): Likewise.
670 (Target_x86_64<size>::do_calls_non_split): Handle x32.
671 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
672 (check_DATA): Add split_x32 files.
673 (split_x32_[1234n].o): New targets.
674 (split_x32_[124]): New targets.
675 (split_x32_[1234r].stdout): New targets.
676 * testsuite/split_x32.sh: New file.
677 * testsuite/split_x32_1.s: Likewise.
678 * testsuite/split_x32_2.s: Likewise.
679 * testsuite/split_x32_3.s: Likewise.
680 * testsuite/split_x32_4.s: Likewise.
681 * testsuite/split_x32_n.s: Likewise.
682 * configure: Regenerated.
683 * testsuite/Makefile.in: Likewise.
684
e749cab8
L
6852015-01-06 H.J. Lu <hongjiu.lu@intel.com>
686
687 PR gold/17809
688 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
689 x32.
690
af759df0
AM
6912015-01-02 Alan Modra <amodra@gmail.com>
692
693 * version.cc (print_version): Just print current year.
694 * dwp.cc (print_version): Likewise.
695
b90efa5b
AM
6962015-01-01 Alan Modra <amodra@gmail.com>
697
698 Update year range in copyright notice of all files.
699
f12d1e8a
AM
7002014-12-25 Alan Modra <amodra@gmail.com>
701
702 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
703 new enums.
704 (Target_arm::merge_object_attributes, ): Likewise.
705
5c294fee
TG
7062014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
707
708 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
709 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
710 AEABI_VFP_args_vfp to check that.
711 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
712 value and replace hardcoded values by enum values.
713
e30880c2
CC
7142014-12-22 Cary Coutant <ccoutant@google.com>
715
716 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
717
bd040da1
L
7182014-12-20 H.J. Lu <hongjiu.lu@intel.com>
719
720 PR gold/14608
721 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
722 to "return i * i * 3;".
723
e02a4046
CC
7242014-12-16 Cary Coutant <ccoutant@google.com>
725
726 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
727 (Mapfile::print_output_data): Use current_data_size() to avoid
728 assert for sections requiring postprocessing; if address is not valid,
729 print 0.
730 (Mapfile::print_output_section): Use current_data_size(); print note
731 that addresses and sizes are before compression.
732
add6016b
L
7332014-12-14 H.J. Lu <hongjiu.lu@intel.com>
734
735 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
736 Cast current_group_size to unsigned long when reporting error.
737
0bf32ea9
JY
7382014-12-10 Jing Yu <jingyu@google.com>
739
740 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
741 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
742 Update error message.
743 (Target_aarch64::do_relax): Use absolute value of option
744 stub_group_size. Replace local variable with class member
745 stub_group_size_.
746
cbcb23fa
AM
7472014-12-04 Alan Modra <amodra@gmail.com>
748
749 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
750 addend of PLTREL24 reloc when not generating a plt stub. Make
751 max_branch_offset an "Address".
fbad6518 752 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
753 (Target_powerpc::Relocate::relocate): Likewise.
754
1611bc4a
AM
7552014-12-04 Alan Modra <amodra@gmail.com>
756
757 PR 17670
758 * symtab.cc (Symbol::set_undefined): Remove assertion.
759 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
760 on symbols defined in discarded sections, instead return false.
761 Rearrange params, update all callers.
762 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
763 branches to syms in discarded sections.
764 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
765 undefined and flag as discarded.
766 (Target_powerpc::Relocate::relocate): Localize variable.
767
4759c34e
L
7682014-12-03 H.J. Lu <hongjiu.lu@intel.com>
769
770 PR gold/17675
771 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
772 * testsuite/Makefile.in: Regenerated.
773
1f98a074
AM
7742014-12-03 Alan Modra <amodra@gmail.com>
775
776 PR 17566
777 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
778 when adding dynamic relocations against section symbols.
779
fb257835
DI
7802014-12-01 Dimitry Ivanov <dimitry@google.com>
781
782 * layout.cc (Layout::finish_dynamic_section): When '-z global'
783 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
784 * options.h (General_options): New -z option (global).
785
d8e60314
CC
7862014-12-01 Cary Coutant <ccoutant@google.com>
787
788 PR gold/17578
789 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
790 is given.
791 (Layout::create_executable_stack_info): Warn when -z noexecstack is
792 given but some inputs require executable stack.
793
982bbd97
CC
7942014-11-26 Cary Coutant <ccoutant@google.com>
795
796 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
797 .debug_str_offsets; strip .debug_gnu_pubnames and
798 .debug_gnu_pubtypes.
799 (lines_only_debug_sections): Strip all four new sections.
800
bb779192
HS
8012014-11-26 Jing Yu <jingyu@google.com>
802
803 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
804 register to be x0 when to relax TLSDESC_LD64_LO12.
805
a3e60ddb
AM
8062014-11-26 Alan Modra <amodra@gmail.com>
807
808 * powerpc.cc (struct Stub_table_owner): New.
809 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
810 unsigned int vector. Update all references.
811 (powerpc_relobj::set_stub_table): Take an unsigned int param
812 rather than a Stub_table. Update callers.
813 (Powerpc_relobj::clear_stub_table): New function.
814 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
815 stub_group_size_ vars.
816 (Target_powerpc::new_stub_table): Delete.
817 (max_branch_delta): New function, extracted from..
818 (Target_powerpc::Relocate::relocate): ..here..
819 (Target_powerpc::Branch_info::make_stub): ..and here. Return
820 status on whether stub created successfully.
821 (Stub_control::Stub_control): Add "no_size_errors" param. Move
822 default sizing to..
823 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
824 reduce on relax failure.
825 (Target_powerpc::group_sections): Add "no_size_errors" param.
826 Use stub_group_size_. Set up group info in a temp vector,
827 before building Stub_table vector. Account for input sections
828 possibly already converted to relaxed sections.
829 (Stub_table::init): Delete. Merge into..
830 (Stub_table::Stub_table): ..here.
831 (Stub_table::can_reach_stub): New function.
832 (Stub_table::add_plt_call_entry): Add "from" parameter and
833 return true iff stub could be reached.
834 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
835 param too.
836 (Stub_table::clear_stubs): Add "all" param.
837
a20605cf
AM
8382014-11-26 Alan Modra <amodra@gmail.com>
839
840 * powerpc.cc (Stub_control::set_output_and_owner): New function.
841 (Target_powerpc::group_sections): Use it.
842
43b64deb
CC
8432014-11-25 Cary Coutant <ccoutant@google.com>
844
845 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
846 (Binary_to_elf::write_symbol): Add st_size parameter.
847 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
848
c924eb67
CC
8492014-11-25 Cary Coutant <ccoutant@google.com>
850
851 PR gold/17639
852 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
853 (Sized_relobj_file::do_layout): Handle deferred sections properly
854 during GC pass 1. Don't add reloc sections to deferred list twice.
855 * object.h (Sized_relobj_file::is_deferred_layout): New function.
856 (Sized_relobj_file::is_deferred_layout_): New data member.
857
9d585188
L
8582014-11-21 H.J. Lu <hongjiu.lu@intel.com>
859
860 PR gold/17619
861 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
862 Check PC-relative offset overflow in PLT entry.
863
3ffaac20
AM
8642014-11-21 Alan Modra <amodra@gmail.com>
865
866 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
867 for undefined weaks.
868
0cfb0717
AM
8692014-11-20 Alan Modra <amodra@gmail.com>
870
871 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
872 from --stub-group-size parameter divided by 1024.
873 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
874 template parameter. Update all uses.
875 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
876 has_stub_value. Set for long branches. Don't report overflow for
877 branch to undefined weak symbols. Print info message on
878 overflowing branch to stub.
879
f9dffbf0
AM
8802014-11-20 Alan Modra <amodra@gmail.com>
881
882 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
883
e88ba8d5
L
8842014-11-13 H.J. Lu <hongjiu.lu@intel.com>
885
886 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
887 entry for R_X86_64_GOTPLT64.
888 (Target_x86_64<size>::Relocate::relocate): Update comments for
889 R_X86_64_GOTPLT64.
890
d37ffe25
ED
8912014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
892
893 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
894 * plugin.h: add lock definition
895
9726c3c1
HS
8962014-10-29 Han Shen <shenhan@google.com>
897 Jing Yu <jingyu@google.com>
898
899 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
900 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
901 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
902 Symbol::TLS_REF.
903 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
904 method.
905 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
906 (Target_aarch64::tls_ld_to_le): New method.
907 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
908 for 64bit targets.
909 (Output_data_plt_aarch64::irelative_rel_): New data member.
910 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
911 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
912 (Output_data_plt_aarch64::add_relocation): New method.
913 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
914 offset. Add got_irelative size to got size.
915 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
916 type string with the new typename.
917 (AArch64_relocate_functions::update_adr): Replace parameter x with
918 immed.
919 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
920 (AArch64_relocate_functions::reloc_common): New method.
921 (AArch64_relocate_funcsions::rela_general): Extract common part out
922 into reloc_common method.
923 (AArch64_relocate_functions::rela_general): Likewise.
924 (AArch64_relocate_functions::pcrela_general): Likewise.
925 (AArch64_relocate_functions::adr): New method.
926 (AArch64_relocate_functions::adrp): Calculate immed before calling
927 update_adr.
928 (AArch64_relocate_functions::adrp): Likewise.
929 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
930 comparing x to 0. Calculate immed from ~x when x < 0.
931 (Target_aarch64::optimize_tls_reloc): Add new cases for
932 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
933 TLSLD_MOVW_DTPREL_G0_NC.
934 (Target_aarch64::possible_function_pointer_reloc): Implement this
935 method.
936 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
937 comment.
938 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
939 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
940 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
941 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
942 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
943 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
944 (Target_aarch64::make_plt_entry): Call add_entry with two more
945 parameters.
946 (Target_aarch64::make_local_ifunc_plt_entry): New method.
947 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
948 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
949 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
950 (Target_aarch64::Relocate::relocate_tls): Add cases for
951 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
952 TLSLD_MOVW_DTPREL_G0_NC.
953 * testsuite/icf_safe_so_test.cc: Correct test comment.
954 * testsuite/icf_safe_test.sh: Add AArch64 arch.
955
80272b8c
AM
9562014-10-22 Alan Modra <amodra@gmail.com>
957
958 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
959 thread_starter.
960
998a69f4
AS
9612014-10-18 Andreas Schwab <schwab@linux-m68k.org>
962
963 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
964
aed56ec5
CC
9652014-10-17 Cary Coutant <ccoutant@google.com>
966
967 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
968 Add "typename" keyword.
969
bb779192 9702014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
971 Jing Yu <jingyu@google.com>
972
973 Patch for gold aarch64 backend to support relaxation.
974 * aarch64-reloc.def: Change format.
975 * aarch64.cc (class Reloc_stub): New class.
976 (class Stub_table): New class.
977 (class AArch64_relobj): New class.
978 (class AArch64_input_section): New class.
979 (class AArch64_output_section): New class.
980 (Target_aarch64::new_stub_table): New method.
981 (Target_aarch64::new_aarch64_input_section): New method.
982 (Target_aarch64::find_aarch64_input_section): New method.
983 (Target_aarch64::scan_section_for_stubs): New method.
984 (Target_aarch64::scan_reloc_section_for_stubs): New method.
985 (Target_aarch64::relocate_stub): New method.
986 (Target_aarch64::current_target): New method.
987 (Target_aarch64::do_make_elf_object): New method.
988 (Target_aarch64::do_may_relax): New method.
989 (Target_aarch64::do_relax): New method.
990 (Target_aarch64::group_sections): New method.
991 (Target_aarch64::scan_reloc_for_stub): New method.
992 (Target_aarch64::do_make_output_section): New method.
993 (Target_aarch64::stub_tables_): New data member.
994 (Target_aarch64::aarch64_input_section_map_): New data member.
995 (AArch64_relocate_functions::maybe_apply_stub): New method.
996
db4c9594
CC
9972014-09-30 Cary Coutant <ccoutant@google.com>
998
999 PR gold/17432
1000 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1001
cd6da036
KC
10022014-09-30 Kito Cheng <kito@0xlab.org>
1003
1004 PR gold/13597
1005 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1006 hash table before sysv-style hash table.
1007
5f772412
ST
10082014-09-29 Sriraman Tallam <tmsriram@google.com>
1009
1010 * options.h (--pic-executable): Add negative to alias to -no-pie.
1011
5efeedf6
CC
10122014-09-26 Cary Coutant <ccoutant@google.com>
1013
1014 PR gold/16773
1015 * object.cc (Sized_relobj_file): Compute value of section symbols
1016 for TLS sections the same as TLS symbols.
1017
1707f183
CC
10182014-09-25 Cary Coutant <ccoutant@google.com>
1019
1020 PR gold/17432
1021 * resolve.cc (Symbol_table::resolve): Override common placeholder
1022 symbols, but adjust sizes.
1023 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1024 symbols to common lists.
1025
00cac886
AM
10262014-09-24 Alan Modra <amodra@gmail.com>
1027
1028 * po/POTFILES.in: Regenerate.
1029
635aa30e
CC
10302014-09-23 Taiju Tsuiki <tzik@google.com>
1031 Cary Coutant <ccoutant@google.com>
1032
71b9b91b 1033 PR gold/14860
635aa30e
CC
1034 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1035 on input_sections_blocker.
1036 * layout.cc (Write_sections_task::locks): Unblock
1037 input_sections_blocker_.
1038 * layout.h (Write_sections_task::Write_sections_task): Add
1039 input_sections_blocker.
1040 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1041 to DEPENDENCIES.
1042 * testsuite/Makefile.in: Regenerate.
1043
c0c71592
RÁE
10442014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1045
1046 * testsuite/Makefile.am (plugin_test_10): New test.
1047 * testsuite/Makefile.in: Regenerate
1048 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1049 * testsuite/plugin_test_10.sh: New file.
1050
6168c2a1
RÁE
10512014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1052
1053 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1054 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1055 during the replacement phase.
1056
3a531937
JY
10572014-09-17 Han Shen <shenhan@google.com>
1058 Jing Yu <jingyu@google.com>
1059
1060 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1061 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1062 * aarch64.cc (Target_aarch64): Add data members
1063 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1064 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1065 constructor.
1066 (Target_aarch64::do_reloc_symbol_index): New method.
1067 (Target_aarch64::do_reloc_addend): New method.
1068 (Target_aarch64::add_tlsdesc_info): New method.
1069 (Target_aarch64::do_dynsym_value): New method.
1070 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1071 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1072 (Target_aarch64::make_data_plt): Add new parameters: got,
1073 got_irelative. Pass them to do_make_data_plt.
1074 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1075 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1076 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1077 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1078 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1079 (Target_aarch64::got_tlsdesc_section): New method.
1080 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1081 (Target_aarch64::define_tls_base_symbol): New method.
1082 (Target_aarch64::reserve_tlsdesc_entries): New method.
1083 (Target_aarch64::got_mod_index_entry): New method.
1084 (Target_aarch64::rela_tlsdesc_section): New method.
1085 (Target_aarch64::rela_irelative_section): New method.
1086 (Target_aarch64::Tlsdesc_info): New struct.
1087 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1088 relocations and tlsdesc relocations.
1089 (Target_aarch64::optimize_tls_reloc): Implement method.
1090 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1091 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1092 in constructor.
1093 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1094 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1095 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1096 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1097 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1098 (Output_data_plt_aarch64::rela_irelative): New method.
1099 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1100 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1101 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1102 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1103 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1104 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1105 (Output_data_plt_aarch64_standard): New member variables:
1106 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1107 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1108 New parameter: got, got_irelative.
1109 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1110 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1111 (Output_data_plt_aarch64::do_write): Replace got_address with
1112 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1113 (AArch64_relocate_functions::update_movnz): New method.
1114 (AArch64_relocate_functions): Correct format.
1115 (AArch64_relocate_functions::movnz): New method.
1116 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1117 before the switch. Add new cases to switch.
00cac886 1118 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1119 tlsgd tlsdesc cases.
1120 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1121 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1122 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1123 Call reloc_name_in_error_message to print unsupported reloc.
1124 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1125 make_data_plt.
1126 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1127 relocs. Fill in some more dynamic tags.
1128 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1129 Skip call tls_get_addr when tlsgd is relaxed.
1130 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1131 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1132 tlsdesc->ie relaxation.
1133
62661c93
SS
11342014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1135
1136 * mips.cc (Target_mips_nacl): New class.
1137 (Target_selector_mips_nacl): New class.
1138 (target_selector_mips32): Rename from target_selector_mips32be and use
1139 Target_selector_mips_nacl instead of Target_selector_mips.
1140 (target_selector_mips32el): Rename from target_selector_mips32 and use
1141 Target_selector_mips_nacl instead of Target_selector_mips.
1142 (target_selector_mips64): Rename from target_selector_mips64be and use
1143 Target_selector_mips_nacl instead of Target_selector_mips.
1144 (target_selector_mips64el): Rename from target_selector_mips64 and use
1145 Target_selector_mips_nacl instead of Target_selector_mips.
1146 (Target_mips::mips_info): Add const attribute.
1147
54674d38
CC
11482014-09-02 Cary Coutant <ccoutant@google.com>
1149
1150 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1151 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1152 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1153 (Sized_incr_dynobj::do_section_name): Likewise.
1154 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1155 (Sized_incr_dynobj::do_section_name): Likewise.
1156 * object.h (Object::section_name): Likewise.
1157 (Object::do_section_name): Likewise.
1158 (Sized_relobj_file::do_section_name): Likewise.
1159 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1160 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1161
9860cbcf
CC
11622014-09-02 Cary Coutant <ccoutant@google.com>
1163
1164 PR gold/17005
1165 * ehframe.cc (Fde::write): Add output_offset parameter.
1166 (Cie::write): Likewise.
1167 (Eh_frame::set_final_data_size): Account for offset within output
1168 section.
1169 (Eh_frame::do_sized_write): Likewise.
1170 * ehframe.h (Fde::write): Add output_offset parameter.
1171 (Cie::write): Likewise.
1172 * output.cc (Output_section::Input_section_sort_entry): Remove
1173 section_has_name_; add output_section_name parameter. Use
1174 output section name for non-input sections.
1175 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1176 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1177 (Output_section::Input_section_sort_compare): Remove logic for
1178 sections without names.
1179 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1180 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1181 Likewise.
1182 (Output_section::Input_section_sort_section_name_compare): Likewise.
1183
8e33481e
HS
11842014-08-29 Han Shen <shenhan@google.com>
1185 Jing Yu <jingyu@google.com>
1186
1187 * aarch64-reloc-property.cc
1188 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1189 reference reloc property in the table.
1190 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1191 3 other entries.
1192 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1193 2 new overloaded methods.
1194 (Output_data_got_aarch64::do_write): Add code to write out
1195 static relocs.
1196 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1197 static relocs.
1198 (Output_data_got_aarch64::static_relocs): New vector to
1199 hold static relocs.
1200 (Target_aarch64::TCB_SIZE): New const static memeber.
1201 (Target_aarch64::tcb_size): New method.
1202 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1203 (Target_aarch64::Relocate::relocate_tls): New method.
1204 (Target_aarch64::Scan::local): Add code handling new reloc types.
1205 (Target_aarch64::Scan::global): Add code handling new reloc types.
1206
81233653
ST
12072014-08-13 Sriraman Tallam <tmsriram@google.com>
1208
1209 * options.h (-no-pie): Add option.
1210
9363c7c3
JY
12112014-08-08 Jing Yu <jingyu@google.com>
1212 Han Shen <shenhan@google.com>
1213
1214 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1215 (DEFFILES): add aarch64-reloc.def.
1216 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1217 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1218 * Makefile.in: Regenerate.
1219 * aarch64-reloc-property.cc: New file.
1220 * aarch64-reloc-property.h: New file.
1221 * aarch64-reloc.def: New file.
1222 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1223 with tab to make the format consistent.
1224 (Output_data_got_aarch64::symbol_table_): New method.
1225 (Target_aarch64::do_plt_address_for_global): New method.
1226 (Target_aarch64::do_plt_address_for_local): New method.
1227 (Target_aarch64::do_select_as_default_target): New method.
1228 (Target_aarch64::do_make_data_plt): New method.
1229 (Target_aarch64::make_data_plt): New method.
1230 (Output_data_plt_aarch64::has_irelative_section): New method.
1231 (Output_data_plt_aarch64::address_for_global): New method.
1232 (Output_data_plt_aarch64::address_for_local): New method.
1233 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1234 (Output_data_plt_aarch64::add_entry): Implement contents.
1235 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1236 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1237 the got_pov entry to plt0.
1238 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1239 Implement contents.
1240 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1241 (AArch64_howto): New struct.
1242 (aarch64_howto[]): New static const array.
1243 (AArch64_relocate_functions): New class.
1244 (Target_aarch64::Scan::get_reference_flags): Remove method.
1245 (Target_aarch64::Scan::local): Implement to support a few relocations.
1246 (Target_aarch64::Scan::global): Implement to support a few relocations.
1247 (Target_aarch64::make_plt_section): Implement contents.
1248 (Target_aarch64::make_plt_entry): Implement contents.
1249 (Target_aarch64::do_finalize_sections): Implement contents.
1250 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1251 (Target_aarch64::relocate_section): Implement contents.
1252
ad9fe6c1
AM
12532014-08-06 Alan Modra <amodra@gmail.com>
1254
1255 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1256
7cd4e5b7
AM
12572014-08-06 Alan Modra <amodra@gmail.com>
1258
1259 PR 13227
1260 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1261
5ad9b0a7
ST
12622014-07-21 Sriraman Tallam <tmsriram@google.com>
1263
1264 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1265 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1266
e051745c
CC
12672014-07-08 Cary Coutant <ccoutant@google.com>
1268
1269 * expression.cc (struct Expression::Expression_eval_info): Add
1270 new fields type_pointer, vis_pointer, and nonvis_pointer.
1271 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1272 nonvis_pointer parameters. Adjust all calls.
1273 (Symbol_expression::value): Update type, visibility, and nonvis bits
1274 in caller.
1275 * script.cc (Symbol_assignment::sized_finalize): Update type,
1276 visibility, and remaining st_other bits for new symbol.
1277 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1278 vis_pointer, and nonvis_pointer parameters.
1279 * symtab.h (Symbol::set_type): New method.
1280
1281 * testsuite/Makefile.am (defsym_test): New test.
1282 * testsuite/Makefile.in: Regenerate.
1283 * testsuite/defsym_test.c: New file.
1284 * testsuite/defsym_test.sh: New file.
1285
f35c4853
CC
12862014-07-08 Cary Coutant <ccoutant@google.com>
1287
1288 PR gold/15639
1289 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1290 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1291 (Sized_dynobj::base_read_symbols): ...new method.
1292 * object.h (Sized_relobj_file::base_read_symbols): New method.
1293 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1294 (Sized_relobj_file::base_read_symbols): ...new method.
1295 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1296 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1297 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1298
2900af2d
AM
12992014-07-04 Alan Modra <amodra@gmail.com>
1300
1301 * po/POTFILES.in: Regenerate.
1302
053a4d68
JY
13032014-07-02 Jing Yu <jingyu@google.com>
1304
1305 * aarch64.cc: New file
1306 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1307 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1308 * Makefile.in: Regenerate.
1309 * configure.tgt: Add entries for aarch64*.
1310 * configure.ac: Likewise.
1311 * configure: Likewise.
1312
7b549045
AM
13132014-06-27 Alan Modra <amodra@gmail.com>
1314
1315 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1316
cb818dbf
CC
13172014-06-24 Cary Coutant <ccoutant@google.com>
1318
1319 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1320 sections.
1321 (Dwo_file::sized_read_unit_index): Likewise.
1322
9810d34d
SS
13232014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1324
1325 * mips.cc: New file.
1326 * Makefile.am (TARGETSOURCES): Add mips.cc
1327 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1328 * configure.tgt: Add entries for mips*.
1329 * configure.ac: Likewise.
1330 * Makefile.in: Regenerate.
1331 * configure: Likewise.
1332
9baa787b
CC
13332014-06-09 Cary Coutant <ccoutant@google.com>
1334
1335 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1336 unit_length is within section bounds.
1337
8f89af0a
CC
13382014-06-09 Cary Coutant <ccoutant@google.com>
1339
1340 PR gold/16980
1341 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1342 map.
1343
a47622ac
AM
13442014-06-07 Alan Modra <amodra@gmail.com>
1345
1346 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1347
4320c691
CC
13482014-06-06 Cary Coutant <ccoutant@google.com>
1349
1350 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1351 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1352 (Dwarf_pubnames_table::read_header): Likewise.
1353 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1354 .debug_gnu_pubtypes.
1355
270c9937
JB
13562014-06-05 Joel Brobecker <brobecker@adacore.com>
1357
1358 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1359 * Makefile.in, configure: Regenerate.
1360
397998fc
AM
13612014-06-03 Alan Modra <amodra@gmail.com>
1362
1363 * powerpc.cc (addis_12_2): Define.
1364 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1365
61f5c66f
AM
13662014-06-03 Alan Modra <amodra@gmail.com>
1367
1368 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1369 st_other output.
1370
f6971787
AM
13712014-06-02 Alan Modra <amodra@gmail.com>
1372
1373 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1374 Only ignore relocs on ELFv1.
1375 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1376
f6fb8322
CC
13772014-05-30 Cary Coutant <ccoutant@google.com>
1378
1379 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1380 * testsuite/Makefile.in: Regenerate.
1381 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1382
c23dd342
L
13832014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1384
1385 PR gold/16945
1386 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1387 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1388
5fe7ffdc
AM
13892014-05-15 Alan Modra <amodra@gmail.com>
1390
1391 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1392 Compare FDE contents with DW_CFA_nop rather than 0.
1393
a82bef93
ST
13942014-05-13 Sriraman Tallam <tmsriram@google.com>
1395
1396 * symtab.h (may_need_copy_reloc): Remove check for position independent
1397 code.
1398 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1399 position independence before pc absolute may_need_copy_reloc call.
1400 Add check for executable output befor pc relative may_need_copy_reloc
1401 call.
1402 * i386.cc: Ditto.
1403 * arm.cc: Ditto.
1404 * sparc.cc: Ditto.
1405 * tilegx.cc: Ditto.
1406 * powerpc.cc: Add check for no position independence before
1407 may_need_copy_reloc calls.
1408 * testsuite/pie_copyrelocs_test.cc: New file.
1409 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1410 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1411 * Makefile.in: Regenerate.
a82bef93 1412
53c66605
ML
14132014-05-08 Martin Liška <mliska@suse.cz>
1414
1415 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1416
57b2284c
CC
14172014-05-06 Cary Coutant <ccoutant@google.com>
1418
1419 PR gold/16900
1420 * i386.cc (Output_data_got_plt_i386): New class.
1421 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1422 parameter. Change all callers.
1423 (Output_data_plt_i386::layout_): Remove.
1424 (Output_data_plt_i386::got_plt_): Change type.
1425 (Target_i386::got_plt_): Change type. Change all references.
1426 (Target_i386::got_section): Create instance of new class.
1427 (Output_data_got_plt_i386::do_write): New function.
1428 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1429 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1430 parameter. Change all callers.
1431 (Output_data_plt_x86_64::layout_): Remove.
1432 (Output_data_plt_x86_64::got_plt_): Change type.
1433 (Target_x86_64::got_plt_): Change type. Change all references.
1434 (Target_x86_64::got_section): Create instance of new class.
1435 (Output_data_got_plt_x86_64::do_write): New function.
1436 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1437 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1438 class.
1439
6b97515d 14402014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1441
6b97515d
CC
1442 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1443 if we have pubnames/pubtypes.
1444
d1bddd3c
CC
14452014-05-02 Cary Coutant <ccoutant@google.com>
1446
5fe7ffdc
AM
1447 * defstd.cc (in_segment): Define __ehdr_start here...
1448 * layout.cc (Layout::finalize): ...Instead of here. Set the
1449 output segment when known.
1450 * resolve.cc (Symbol::override_base_with_special): Remember
1451 the original binding.
1452 * symtab.cc (Symbol::set_output_segment): New function.
1453 (Symbol::set_undefined): New function.
1454 * symtab.h (Symbol::is_weak_undefined): Check original undef
1455 binding.
1456 (Symbol::is_strong_undefined): New function.
1457 (Symbol::set_output_segment): New function.
1458 (Symbol::set_undefined): New function.
1459 * target-reloc.h (is_strong_undefined): Remove.
1460 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1461 Check for hidden undefs.
1462 (relocate_section): Call Symbol::is_strong_undefined.
1463
1464 * testsuite/Makefile.am (ehdr_start_test_1)
1465 (ehdr_start_test_2, ehdr_start_test_3)
1466 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1467 * testsuite/Makefile.in: Regenerate.
1468 * testsuite/ehdr_start_def.cc: New source file.
1469 * testsuite/ehdr_start_test.cc: New source file.
1470 * testsuite/ehdr_start_test.t: New linker script.
1471 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1472
7849f6d8
CC
14732014-04-23 Cary Coutant <ccoutant@google.com>
1474
bf2cc635 1475 PR gold/16870
7849f6d8
CC
1476 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1477
99fd8cff
CC
14782014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1479
1480 * layout.cc (Layout::include_section): Allow a target to decide
1481 whether to include a section.
1482 * target.h (Target::should_include_section): New function.
1483 (Target::do_should_include_section): New function.
1484
91f43acd
CC
14852014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1486
1487 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1488 inline into ...
1489 (Copy_relocs::emit): ... here.
1490 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1491 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1492 (Copy_reloc_entry::entries_): Change from private to protected.
1493
c4eb27e1
ST
14942014-04-02 Sriraman Tallam <tmsriram@google.com>
1495
1496 * icf.cc (get_section_contents): Replace copies of reloc
1497 vectors with const references.
1498
ae447ddd
CC
14992014-04-02 Cary Coutant <ccoutant@google.com>
1500
1501 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1502 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1503 * configure: Regenerate.
1504 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1505 -fno-use-linker-plugin.
1506 (LINK1, CXXLINK1): Add it to the link command.
1507 * testsuite/Makefile.in: Regenerate.
1508
fa47fa92
AM
15092014-03-12 Alan Modra <amodra@gmail.com>
1510
1511 * Makefile.in: Regenerate.
1512
9b12c500
CC
15132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1514
1515 * symtab.h (Symbol::set_nonvis): New function.
1516
beacaa96
CC
15172014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1518
1519 * symtab.cc (Sized_symbol<32>::init_output_data):
1520 Instantiate the template.
1521 (Sized_symbol<64>::init_output_data): Likewise.
1522
800d9823
CC
15232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1524
1525 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1526 adjust dynamic symbol value.
1527 * target.h (Target::adjust_dyn_symbol): New function.
1528 (Target::do_adjust_dyn_symbol): New function.
1529
918fc1f8 15302014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1531
918fc1f8
CC
1532 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1533 Get the value of DYNAMIC_CUSTOM dynamic entry.
1534 * output.h (Output_data_dynamic::add_custom): New function.
1535 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1536 dynamic entry.
1537 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1538 * target.h (Target::dynamic_tag_custom_value): New function.
1539 (Target::do_dynamic_tag_custom_value): New function.
1540
98ff9231
CC
15412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1542
1543 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1544 dynsym indexes.
1545 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1546 (Target::do_has_custom_set_dynsym_indexes): New function.
1547 (Target::set_dynsym_indexes): New function.
1548 (Target::do_set_dynsym_indexes): New function.
1549
b80eed39
AM
15502014-03-07 Alan Modra <amodra@gmail.com>
1551
1552 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1553 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1554 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1555 (Powerpc_relocate_functions::has_overflow_bitfield,
1556 overflowed): Use the above.
1557 (Target_powerpc::Relocate::relocate): Correct overflow checking
1558 for a number of relocations. Modify overflow test for 16-bit
1559 fields in instructions to signed/unsigned according to whether
1560 the field takes a signed or unsigned value.
1561
4b95cf5c
AM
15622014-03-05 Alan Modra <amodra@gmail.com>
1563
1564 Update copyright years.
1565
45965137
AM
15662014-03-05 Alan Modra <amodra@gmail.com>
1567
1568 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1569 R_PPC64_ADDR64_LOCAL.
1570 (Target_powerpc::Relocate::relocate): Likewise.
1571
2c80b753
AM
15722014-03-03 Alan Modra <amodra@gmail.com>
1573
1574 * dwp.cc (print_version): Update copyright year to current.
1575
c1c69e83
AM
15762014-02-10 Alan Modra <amodra@gmail.com>
1577
1578 * po/gold.pot: Regenerate.
1579
dd0c4e70
CC
15802014-02-06 Cary Coutant <ccoutant@google.com>
1581
1582 Fix problem where -u is ignored when a weak undef is seen.
1583
1584 * archive.cc (Library_base::should_include_member): Reorder
1585 code to check for -u option if a weak undef has already been seen.
1586 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1587 * testsuite/Makefile.in: Regenerate.
1588 * testsuite/weak_undef_file3.cc: New file.
1589 * testsuite/weak_undef_file4.cc: New file.
1590 * testsuite/weak_undef_test_2.cc: New file.
1591
1a221d3d
CC
15922014-02-05 Cary Coutant <ccoutant@google.com>
1593
1594 Fix issues with gold undefined symbol diagnostics.
1595
1596 PR binutils/15435
1597 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1598 check to here.
1599 * target-reloc.h (is_strong_undefined): New function.
1600 (relocate_section): Move undef vtable symbol check from here.
1601 Check for is_strong_undefined.
1602
e889f0a4 16032014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1604
e889f0a4
CC
1605 Fix problems with the --dynamic-list option.
1606
1607 PR gold/13577
1608 * options.cc (General_options::parse_dynamic_list):
1609 Set have_dynamic_list_.
1610 (General_options::General_options): Initialize have_dynamic_list_.
1611 (General_options::finalize): Turn off -Bsymbolic and
1612 -Bsymbolic-functions if --dynamic-list provided.
1613 * options.h (General_options::have_dynamic_list): New function.
1614 (General_options::have_dynamic_list_): New data member.
1615 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1616 correctly.
5fe7ffdc 1617
e889f0a4
CC
1618 PR gold/16530
1619 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1620 in --dynamic-list, mark it.
5fe7ffdc 1621
e889f0a4
CC
1622 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1623 (dynamic_list_2): New test case.
1624 * testsuite/Makefile.in: Regenerate.
1625 * testsuite/dynamic_list_2.cc: New file.
1626 * testsuite/dynamic_list_2.t: New file.
1627 * testsuite/dynamic_list_lib1.cc: New file.
1628 * testsuite/dynamic_list_lib2.cc: New file.
1629 * testsuite/gc_dynamic_list_test.c: New file.
1630 * testsuite/gc_dynamic_list_test.sh: New file.
1631 * testsuite/gc_dynamic_list_test.t: New file.
1632
ec673e64
CC
16332014-01-28 Cary Coutant <ccoutant@google.com>
1634
1635 Add .gdb_index version 7 support.
1636
1637 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1638 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1639 debug sections.
1640 (Dwarf_ranges_table::read_ranges_table): Likewise.
1641 (Dwarf_pubnames_table::read_section): Check for GNU-style
1642 sections, and for compressed debug sections.
1643 (Dwarf_pubnames_table::read_header): Compute end address of table.
1644 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1645 for end of list by offset, not by offset == 0.
1646 (Dwarf_info_reader::do_read_string_table): Check for compressed
1647 debug sections.
1648 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1649 Initialize new data members.
1650 (Dwarf_pubnames_table::next_name): return flag_byte.
1651 (Dwarf_pubnames_table::end_of_table_): New data member.
1652 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1653 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1654 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1655 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1656 read skeleton type unit DIEs.
1657 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1658 (Gdb_index::do_write): Write flag_byte.
1659 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1660 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1661 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1662 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1663
221fd5d5
L
16642014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 * version.cc (print_version): Update copyright year to 2014.
1667
6c09fb0b
ILT
16682013-12-19 Dimitry Andric <dimitry@andric.com>
1669
1670 * stringpool.cc (Stringpool_template::reserve): Add
1671 HAVE_UNORDERED_MAP case.
1672 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1673
8356f2d0
CC
16742013-12-18 Cary Coutant <ccoutant@google.com>
1675
1676 * configure.ac: Check for <unordered_set> and <unordered_map>.
1677 * config.in: Regenerate.
1678 * configure: Regenerate.
1679 * system.h: Use <unordered_set> and <unordered_map> if available.
1680
f2c7d7ee
RM
16812013-12-10 Roland McGrath <mcgrathr@google.com>
1682
1683 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1684 with $(INSTALL_PROGRAM_ENV).
1685 * Makefile.in: Regenerate.
1686
6632e8cc
CC
16872013-11-22 Cary Coutant <ccoutant@google.com>
1688
1689 * configure.ac: Add check for which library is needed for
1690 dlopen.
1691 * configure: Regenerate.
1692
0c075858
CC
16932013-11-22 Cary Coutant <ccoutant@google.com>
1694
1695 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1696 assembler.
1697 * testsuite/Makefile.in: Regenerate.
1698
f49fe902
L
16992013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1700
1701 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1702 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1703 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1704 (Target_x86_64<size>::Scan::local): Likewise.
1705 (Target_x86_64<size>::Scan::global): Likewise.
1706 (Target_x86_64<size>::Relocate::relocate): Likewise.
1707 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1708 Likewise.
1709 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1710 R_X86_64_PC32_BND.
1711
1712 * testsuite/Makefile.am (check_PROGRAMS): Add
1713 exception_x86_64_bnd_test.
1714 (exception_x86_64_bnd_test_SOURCES): New macro.
1715 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1716 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1717 (exception_x86_64_bnd_test_LDADD): Likewise.
1718 (exception_x86_64_bnd_1.o): New rule.
1719 (exception_x86_64_bnd_2.o): Likewise.
1720 * testsuite/Makefile.in: Regenerated.
1721
9055360d
AM
17222013-11-15 Alan Modra <amodra@gmail.com>
1723
1724 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1725 accessor.
1726 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1727 Only call ppc64_local_entry_offset for 64-bit. Restrict
1728 symval_for_branch lookup to ELFv1.
1729 (Stub_table::add_plt_call_entry): Use unsigned int off.
1730 (Output_data_glink::Address, invalid_address): New.
1731 (Output_data_glink::add_eh_frame): Move out of line. Add
1732 support for ELFv2.
1733 (Output_data_glink::add_global_entry, find_global_entry,
1734 global_entry_address): New functions.
1735 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1736 ge_size): New variables.
1737 (Output_data_glink::set_final_data_size): Add global entry
1738 stub sizing.
1739 (Output_data_glink::do_write): Write global entry stubs.
1740 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1741 parameter. Return true for ELFv2. Adjust callers.
1742 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1743 ELFv1. Similarly for ifunc and dynamic relocation processing
1744 specific to ELFv1. Recognize that symbols are defined on
1745 their plt entries for ELFv2.
1746 (Target_powerpc::symval_for_branch): Assert if called for
1747 ELFv2 or ppc32.
1748 (Target_powerpc::Relocate::relocate): Use global entry plt
1749 stub for symbol value if such exists on ELFv2.
1750 (Target_powerpc::Relocate::relocate): Don't call
1751 symval_for_branch when ELFv2. Do adjust for local entry
1752 offset when ELFv2.
1753 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1754 plt stub for ELFv2.
1755 (Target_powerpc::do_plt_address_for_global): Similarly.
1756
cafdd569
CC
17572013-11-14 Cary Coutant <ccoutant@google.com>
1758
1759 Revert patch -- this did not fix the problem, and there is
1760 no race there.
1761
1762 2013-11-14 Cary Coutant <ccoutant@google.com>
1763
1764 PR gold/14860
1765 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1766 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1767 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1768 updating fde_offsets_.
1769 (Eh_frame_hdr::lock_): New data member.
1770
94e49e16
CC
17712013-11-14 Cary Coutant <ccoutant@google.com>
1772
1773 * dwp.cc (Dwo_file_entry): New type.
1774 (File_list): Use Dwo_file_entry.
1775 (Dwo_file::verify): New function.
1776 (Dwo_file::verify_dwo_list): New function.
1777 (Dwo_file::sized_verify_dwo_list): New function.
1778 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1779 list.
1780 (Dwp_options): New enum type.
1781 (dwp_options): Add --verify-only.
1782 (usage): Likewise.
1783 (main): Likewise.
1784 * dwp.h (gold_info): Add declaration.
1785
7cdd7d57
CC
17862013-11-14 Cary Coutant <ccoutant@google.com>
1787
1788 PR gold/14860
1789 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1790 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1791 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1792 updating fde_offsets_.
1793 (Eh_frame_hdr::lock_): New data member.
1794
1d946cb3
CC
17952013-11-06 Cary Coutant <ccoutant@google.com>
1796
1797 PR gold/15758
1798 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1799 before reloc sections.
1800
4f65b40e
AM
18012013-11-04 Alan Modra <amodra@gmail.com>
1802
1803 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1804 (Symbol::needs_dynamic_reloc): Test new flag.
1805 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1806 (Target_powerpc::Scan::get_reference_flags): Add target param.
1807 Return FUNC_DESC_ABI for 64-bit ELFv1.
1808 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1809 call.
1810 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1811 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1812
908794a9
CC
18132013-10-31 Cary Coutant <ccoutant@google.com>
1814
1815 Restore support for dwp v2 DWARF package file format.
1816
1817 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1818 tu_length parameter. Adjust all callers.
1819 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1820 * dwp.cc: Include dwarf.h.
1821 (Section_bounds): New struct type.
1822 (Unit_set): New struct type.
1823 (Dwo_file::Dwo_file): Initialize new data member.
1824 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1825 Combine and rename to...
1826 (Dwo_file::read_unit_index): ...this.
1827 (Dwo_file::sized_read_compunit_index)
1828 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1829 (Dwo_file::sized_read_unit_index): ...this.
1830 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1831 parameters; add section_id parameter.
1832 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1833 (Dwo_file::add_unit_set): ...this.
1834 (Dwo_file::shndx_map_): Remove.
1835 (Dwo_file::sect_offsets_): New data member.
1836 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1837 (Dwp_output_file::add_section): Rename to...
1838 (Dwp_output_file::add_contribution): ...this.
1839 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1840 (Dwp_output_file::add_tu_set): Likewise.
1841 (Dwp_output_file::Contribution): New type.
1842 (Dwp_output_file::Section::contributions): New data member.
1843 (Dwp_output_file::Cu_or_tu_set): Remove.
1844 (Dwp_output_file::Section::Section): New ctor.
1845 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1846 (Dwp_output_file::Dwp_index::Section_table): New type.
1847 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1848 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1849 parameter.
1850 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1851 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1852 (Dwp_output_file::Dwp_index::section_table): New member function.
1853 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1854 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1855 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1856 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1857 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1858 (Dwp_output_file::Dwp_index::section_table_): New data member.
1859 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1860 (Dwp_output_file::add_output_section): New member function.
1861 (Dwp_output_file::write_new_section): New member function.
1862 (Dwp_output_file::write_contributions): New member function.
1863 (Dwp_output_file::section_id_map_): New data member.
1864 (class Dwo_id_info_reader): Remove.
1865 (class Unit_reader): New class.
1866 (get_dwarf_section_name): New function.
1867 (Dwo_file::read_executable): Adjust initializations of class data.
1868 (Dwo_file::read): Add support for v2 package file format.
1869 (Dwo_file::read_unit_index): Likewise.
1870 (Dwo_file::sized_read_unit_index): Likewise.
1871 (Dwo_file::copy_section): Likewise.
1872 (Dwo_file::add_unit_set): Likewise.
1873 (Dwp_output_file::add_output_section): Likewise.
1874 (Dwp_output_file::add_contribution): Likewise.
1875 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1876 for empty slot.
1877 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1878 file format.
1879 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1880 slot.
1881 (Dwp_output_file::initialize): Remove unused function.
1882 (Dwp_output_file::finalize): Add support for v2 package file format.
1883 (Dwp_output_file::write_index): Likewise.
1884 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1885 function prototype.
1886
2500c017
CC
18872013-10-31 Cary Coutant <ccoutant@google.com>
1888
1889 * configure.ac: Fix check for -fmerge-constants.
1890 * configure.ac: Regenerate.
1891
dd0845d7
RM
18922013-10-30 Roland McGrath <mcgrathr@google.com>
1893
1894 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1895 Correct 9-byte nop sequence to match what the assembler generates.
1896
b4f7960d
AM
18972013-10-30 Alan Modra <amodra@gmail.com>
1898
1899 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1900 ppc64_local_entry_offset, ppc64_local_entry_offset,
1901 do_read_symbols): New functions.
1902 (Powerpc_relobj::e_flags_, st_other_): New vars.
1903 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1904 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1905 (Powerpc_relobj::e_flags_): New var.
1906 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1907 and adjust for ELFv2.
1908 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1909 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1910 (Powerpc_dynobj::do_find_special_sections): Likewise.
1911 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1912 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1913 to ELFv2 local entry.
1914 (Target_powerpc::do_relax): No thread safe barriers needed for
1915 ELFv2.
1916 (Output_data_plt_powerpc::initial_plt_entry_size_,
1917 plt_entry_size): Delete. Replace all uses with
1918 first_plt_entry_offset() and plt_entry_size().
1919 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1920 reserved_size parm. Update callers.
1921 (Output_data_plt_powerpc::entry_count): Update.
1922 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1923 and use Target_powerpc::first_plt_entry_offset().
1924 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1925 rename to plt_entry_size.
1926 (Output_data_plt_powerpc::add_ifunc_entry,
1927 add_local_ifunc_entry): Adjust reloc for ELFv2.
1928 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1929 (glink_eh_frame_fde_64v2): New.
1930 (Stub_table::plt_call_size): Support ELFv2 sizing.
1931 (Output_data_glink::add_eh_frame): Use the new FDE.
1932 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1933 (Stub_table::do_write): Write ELFv2 stubs and glink.
1934 (Target_powerpc::Relocate::relocate): Replaces nop after call
1935 with ld 2,24(1) and adjust local offset destination for ELFv2.
1936
f9c6b907
AM
19372013-10-30 Alan Modra <amodra@gmail.com>
1938
1939 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1940 (Target_powerpc::Scan::global, local): Likewise.
1941 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1942 on all ppc64 @h and @ha relocs.
1943
e84fe78f
AM
19442013-10-14 Alan Modra <amodra@gmail.com>
1945
1946 * output.h (Output_data_got::add_constant): Tidy.
1947 (Output_data_got::add_constant_pair): New function.
1948 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1949 methods used so as to first call reserve_ent().
1950
679e4abf
RM
19512013-10-11 Roland McGrath <mcgrathr@google.com>
1952
44dcb735
RM
1953 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1954 add_got_entry and add_got_entry_pair.
1955
13323c49
RM
1956 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1957 (HAVE_PUBNAMES): Likewise.
1958 * configure: Regenerate.
1959
1496b446
RM
1960 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1961 * testsuite/Makefile.in: Regenerate.
1962
cc84c10b
RM
1963 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1964 Remove const from declaration.
1965 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1966 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1967 * output.h (Output_file_header): Remove const from member target_
1968 and corresponding constructor argument.
1969 * output.cc (Output_file_header::Output_file_header): Update prototype.
1970 (Output_file_header::do_sized_write): Use this->target_ in place
1971 of parameters()->target().
1972
52f66a2c
RM
1973 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1974
2b64b551
RM
1975 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1976 * configure: Regenerate.
1977 * Makefile.in: Regenerate.
1978 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1979 * testsuite/merge_string_literals_2.c: Likewise.
1980 * testsuite/Makefile.am
1981 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1982 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1983 literal -fmerge-constants.
1984 * testsuite/Makefile.in: Regenerate.
1985
43819297
RM
1986 * i386.cc (Target_i386): Remove unused member dynbss_.
1987 * arm.cc (Target_arm): Likewise.
1988 * powerpc.cc (Target_powerpc): Likewise.
1989 * sparc.cc (Target_sparc): Likewise.
1990 * tilegx.cc (Target_tilegx): Likewise.
1991 * x86_64.cc (Target_x86_64): Likewise.
1992 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1993 type_signature_, type_offset_.
1994 * plugin.h (Plugin_hook): Remove unused member layout_.
1995 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1996 mapfile_.
1997 (Read_member): Remove unused members input_objects_, symtab_,
1998 mapfile_, layout_.
1999 (Check_library): Remove unused member symtab_.
2000 * archive.h (Lib_group): Remove unused member lib_.
2001 * archive.cc (Lib_group::Lib_group): Update initializer.
2002 * incremental.h (Incremental_binary): Remove unused member target_.
2003 (Incremental_script_entry): Removed unused member script_.
2004 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2005 * icf.h (Icf): Remove unused member num_tracked_relocs.
2006
39d9ead7
RM
2007 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2008 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2009 its only use.
2010 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2011
679e4abf
RM
2012 * archive.h: Use struct rather than class for forward declaration
2013 of Read_symbols_data.
2014
54de2ea6
CC
20152013-10-07 Cary Coutant <ccoutant@google.com>
2016
2017 PR gold/16010
2018 * testsuite/Makefile.am (icf_test): Fix dependencies.
2019 (icf_safe_test): Likewise.
2020 (icf_safe_so_test): Likewise.
2021 (large_symbol_alignment): Add empty _LDADD rule.
2022 * testsuite/Makefile.in: Regenerate.
2023
b14016f0
L
20242013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2025
2026 PR gold/15927
2027 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2028 relocation for R_X86_64_32 on x32.
2029
eb426534
RM
20302013-08-27 Roland McGrath <mcgrathr@google.com>
2031
2032 * output.cc (Output_segment::set_section_addresses): Take new
2033 Target* argument. If target->isolate_execinstr() and the segment
2034 is executable and starts at a target->abi_pagesize() boundary,
2035 pad its end out to a target->abi_pagesize() boundary with code fill.
2036 * output.h (Output_segment::set_section_addresses): Update decl.
2037 * layout.h (Layout::check_output_data_for_reset_values): Take new
2038 argument RELAX_OUTPUTS.
2039 (Layout): New member relax_output_list_.
2040 (Layout::add_relax_output): New method.
2041 * layout.cc (Layout::Layout): Update constructor.
2042 (Layout::reset_relax_output): New method.
2043 (Layout::clean_up_after_relaxation): Call it.
2044 (Layout::prepare_for_relaxation): Update caller.
2045 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2046 Call reset_relax_output before re-processing segments for
2047 isolate_execinstr case.
2048 (Layout::write_data): Handle relax_output_list_.
2049 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2050 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2051
9aff4b7a
NC
20522013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2053
2054 PR binutils/15834
2055 * object.h: Fix typos.
2056
93f8221c
RM
20572013-08-16 Roland McGrath <mcgrathr@google.com>
2058
2059 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2060 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2061
e44c3715
CC
20622013-08-07 Cary Coutant <ccoutant@google.com>
2063
2064 Revert support for v2 DWP files:
2065
2066 2013-03-01 Cary Coutant <ccoutant@google.com>
2067
2068 Add dwp support for v2 DWARF package file format.
2069 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2070 tu_length parameter. Adjust all callers.
2071 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2072 * dwp.cc: Include dwarf.h.
2073 (Section_bounds): New struct type.
2074 (Unit_set): New struct type.
2075 (Dwo_file::Dwo_file): Initialize new data member.
2076 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2077 Combine and rename to...
2078 (Dwo_file::read_unit_index): ...this.
2079 (Dwo_file::sized_read_compunit_index)
2080 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2081 (Dwo_file::sized_read_unit_index): ...this.
2082 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2083 parameters; add section_id parameter.
2084 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2085 (Dwo_file::add_unit_set): ...this.
2086 (Dwo_file::shndx_map_): Remove.
2087 (Dwo_file::sect_offsets_): New data member.
2088 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2089 (Dwp_output_file::add_section): Rename to...
2090 (Dwp_output_file::add_contribution): ...this.
2091 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2092 (Dwp_output_file::add_tu_set): Likewise.
2093 (Dwp_output_file::Contribution): New type.
2094 (Dwp_output_file::Section::contributions): New data member.
2095 (Dwp_output_file::Cu_or_tu_set): Remove.
2096 (Dwp_output_file::Section::Section): New ctor.
2097 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2098 (Dwp_output_file::Dwp_index::Section_table): New type.
2099 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2100 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2101 parameter.
2102 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2103 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2104 (Dwp_output_file::Dwp_index::section_table): New member function.
2105 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2106 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2107 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2108 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2109 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2110 (Dwp_output_file::Dwp_index::section_table_): New data member.
2111 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2112 (Dwp_output_file::add_output_section): New member function.
2113 (Dwp_output_file::write_new_section): New member function.
2114 (Dwp_output_file::write_contributions): New member function.
2115 (Dwp_output_file::section_id_map_): New data member.
2116 (class Dwo_id_info_reader): Remove.
2117 (class Unit_reader): New class.
2118 (get_dwarf_section_name): New function.
2119 (Dwo_file::read_executable): Adjust initializations of class data.
2120 (Dwo_file::read): Add support for v2 package file format.
2121 (Dwo_file::read_unit_index): Likewise.
2122 (Dwo_file::sized_read_unit_index): Likewise.
2123 (Dwo_file::copy_section): Likewise.
2124 (Dwo_file::add_unit_set): Likewise.
2125 (Dwp_output_file::add_output_section): Likewise.
2126 (Dwp_output_file::add_contribution): Likewise.
2127 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2128 for empty slot.
2129 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2130 file format.
2131 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2132 slot.
2133 (Dwp_output_file::initialize): Remove unused function.
2134 (Dwp_output_file::finalize): Add support for v2 package file format.
2135 (Dwp_output_file::write_index): Likewise.
2136 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2137 function prototype.
2138
c6905c28
CC
21392013-07-31 Cary Coutant <ccoutant@google.com>
2140
2141 * object.cc (Sized_relobj::do_output_section_address): New function.
2142 (Sized_relobj): Instantiate explicitly.
2143 * object.h (Object::output_section_address): New function.
2144 (Object::do_output_section_address): New function.
2145 (Sized_relobj::do_output_section_address): New function.
2146 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2147
21482013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2149 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2150
2151 * parameters.cc (Parameters::entry): Return target-specific entry
2152 symbol name.
2153 * target.h (Target::entry_symbol_name): New function.
2154 (Target_info::entry_symbol_name): New data member.
2155
2156 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2157 * i386.cc (Target_i386::i386_info): Likewise.
2158 (Target_i386_nacl::i386_nacl_info): Likewise.
2159 * sparc.cc (Target_sparc::sparc_info): Likewise.
2160 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2161 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2162 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2163 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2164
234d4ab8
SA
21652013-07-22 Sterling Augustine <saugustine@google.com>
2166
2167 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2168 Convert parameter shndx to local variable. Add parameters symtab
2169 and symtab_size. Scan over section names. Find relocation
2170 section corresponding to current section. Create and initialize
2171 reloc_mapper_ and reloc_type_.
2172 (Dwarf_pubnames_table::read_header): Add assertion. Change
2173 unit_length to off_t. Initialize member unit_length_. Fill in field
2174 cu_offset_.
2175 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2176 Initialize new fields unit_length_ and cu_offset_.
2177 (Dwarf_pubnames_table::read_section): Update prototype.
2178 (Dwarf_pubnames_table::cu_offset): New member function.
2179 (Dwarf_pubnames_table::subsection_size): Likewise.
2180 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2181 New fields.
2182 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2183 member functions public.
2184 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2185 Update comment. Rework logic. Move repeated parts to...
2186 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2187 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2188 pubtypes_table_, and stmt_list_offset.
2189 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2190 Gdb_index::find_pubtype_offset,
2191 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2192 (Gdb_index::pubnames_read): Update prototype and rework logic.
2193 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2194 Forward declare.
2195 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2196 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2197 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2198 Gdb_index::map_pubtable_to_dies):
2199 Declare functions.
2200 (Gdb_index::pubnames_read): Update declaration.
2201 (Gdb_index::Pubname_offset_map): New type.
2202 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2203 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2204 Gdb_index::stmt_list_offset): Declare.
2205 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2206 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2207 Gdb_index::pubtypes_offset_): Remove.
2208
a3ed37d8
RM
22092013-07-19 Roland McGrath <mcgrathr@google.com>
2210
2211 * options.h (General_options): Add -Trodata-segment option.
2212 * parameters.cc (Parameters::check_rodata_segment): New function.
2213 (Parameters::set_target_once): Call it.
2214 * parameters.h (Parameters): Declare it (private member function).
2215 * layout.cc (load_seg_unusable_for_headers): New function, broken
2216 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2217 then validate rodata segment rather than text segment.
2218 (relaxation_loop_body): Call that.
2219 (is_text_segment): New function. Don't admit a non-executable
2220 segment if TARGET->isolate_execinstr().
2221 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2222
eb5b4ded
CC
22232013-07-15 Shawn Landden <shawnlandden@gmail.com>
2224
2225 PR gold/15070
2226 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2227 * nacl.h (Sniff_file::View::View): Request aligned view.
2228
4d5effb9
CC
22292013-07-11 Cary Coutant <ccoutant@google.com>
2230
2231 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2232 correct BRLT entry size.
2233
ba8ca3e7
AM
22342013-07-03 Alan Modra <amodra@gmail.com>
2235
2236 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2237 comment.
2238
267257d2
CC
22392013-07-01 Cary Coutant <ccoutant@google.com>
2240
2241 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2242 reloc_type_.
2243 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2244 (Dwarf_ranges_table::lookup_reloc): New function.
2245 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2246 reloc_type_.
2247 (Dwarf_ranges_table::lookup_reloc): New function.
2248 (Dwarf_ranges_table::reloc_type_): New data member.
2249
06f30c9d
CC
22502013-06-27 Jing Yu <jingyu@google.com>
2251
2252 PR gold/15662
2253 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2254 function.
2255 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2256 (Target_powerpc::do_relax): Call the above.
2257
a2d7bf59
AM
22582013-06-27 Cary Coutant <ccoutant@google.com>
2259
2260 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2261 on garbage collected .opd section.
2262
22632013-06-27 Alan Modra <amodra@gmail.com>
2264
2265 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2266 is non-zero.
2267 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2268 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2269
32364e50
CC
22702013-06-14 Cary Coutant <ccoutant@google.com>
2271
2272 * resolve.cc (Symbol::override_base): Don't override st_type
2273 from plugin placeholder symbols.
2274 (Symbol_table::resolve): Likewise.
2275 (Symbol_table::should_override): Don't complain about TLS mismatch
2276 if the TO symbol is a plugin placeholder.
2277 * testsuite/Makefile.am (plugin_test_tls): New test.
2278 * testsuite/Makefile.in: Regenerate.
2279 * testsuite/plugin_test_tls.sh: New test script.
2280 * testsuite/two_file_test_2_tls.cc: New test source.
2281 * testsuite/two_file_test_tls.cc: New test source.
2282
7fb47cc9
CC
22832013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2284
2285 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2286 the maximum segment alignment is larger than the page size.
2287 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2288 correctly aligns the symbols with large alignemnt.
2289 * testsuite/Makefile.in: Regenerate.
2290 * testsuite/large_symbol_alignment.cc: New file.
2291
6934001a
CC
22922013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2293 Sriraman Tallam <tmsriram@google.com>
2294
2295 * options.h (sort_section): New option.
2296 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2297 Rename from Input_section_sort_section_name_special_ordering_compare.
2298 (Input_section_sort_section_name_compare): New struct.
2299 * output.cc (Output_section::Input_section_sort_section_name_compare::
2300 operator()): New function.
2301 (Output_section::sort_attached_input_sections): Use new sort function
2302 for .text if --sort-section=name is specified.
2303 * layout.cc (Layout::make_output_section):
2304 Add sorting by name when --sort-section=name is specified.
2305 * testsuite/Makefile.am (text_section_grouping): Test option
2306 --sort-section=name.
2307 * testsuite/Makefile.in: Regenerate.
2308 * testsuite/section_sorting_name.cc: New file.
2309 * testsuite/section_sorting_name.sh: New file.
2310
93acabad
CC
23112013-05-21 Cary Coutant <ccoutant@google.com>
2312
2313 * symtab.h (Symbol::is_cxx_vtable): New function.
2314 * target-reloc.h (relocate_section): Check for vtable symbol.
2315 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2316 * testsuite/Makefile.in: Regenerate.
2317 * testsuite/missing_key_func.cc: New test source.
2318 * testsuite/missing_key_func.sh: New test script.
2319
60e8b3fc
CC
23202013-05-21 Cary Coutant <ccoutant@google.com>
2321
2b64b551
RM
2322 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2323 type of enclosing symbol.
2324 (Relocate_info::location): Check symbol type when describing symbol.
2325 * object.h (Symbol_location_info): Remove unused line_number;
2326 add enclosing_symbol_type.
2327 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2328
9df9de2c
CC
23292013-05-13 Cary Coutant <ccoutant@google.com>
2330
2b64b551
RM
2331 * configure.ac: Export DEFAULT_TARGET.
2332 * configure: Regenerate.
2333 * Makefile.in: Regenerate.
2334 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2335 * testsuite/Makefile.in: Regenerate.
2336 * testsuite/debug_msg.sh: Delete duplicate tests.
2337 Don't check undef_int error message match for powerpc where the
2338 source file and line number aren't available.
9df9de2c 2339
bbc5ae17
RM
23402013-05-10 Roland McGrath <mcgrathr@google.com>
2341
2342 * options.h (General_options): Add --rosegment-gap option.
2343 * options.cc (finalize): --rosegment-gap implies --rosegment.
2344 * layout.cc (set_segment_offsets): Let user option override
2345 target->rosegment_gap().
2346
0c6e6c39
RM
23472013-05-10 Roland McGrath <mcgrathr@google.com>
2348
2349 * options.h (General_options): Remove leading space from help
2350 messages for -nostdlib and --rosegment.
2351
cde7cb01
MR
23522013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2353
2354 PR ld/15365
2355 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2356
f31ae5b8
AM
23572013-05-03 Alan Modra <amodra@gmail.com>
2358
2359 * merge.cc (Output_merge_string::do_add_input_section): Correct
2360 scan for number of strings. Rename vars to avoid shadowing.
2361 Include missing terminator in input_size_.
2362
d3a7cd45
L
23632013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2364
2365 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2366 Restore empty string handling.
2367
6ad3daba
CC
23682013-05-01 Cary Coutant <ccoutant@google.com>
2369
2370 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2371 uninitialized warning.
2372
e31908b6
CC
23732013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2374
2375 * output.cc (Output_section::add_merge_input_section): Allow
2376 to merge sections if the alignment is more than character size.
2377 * merge.h (Output_merge_string::Output_merge_string): Remove
2378 assert.
2379 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2380 only not-null strings. Check the alignment of strings.
2381 * stringpool.h
2382 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2383 alignment as the argument.
2384 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2385 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2386 Align non-zero length strings according to the addralign_.
2387 (Stringpool_template<Stringpool_char>::set_string_offsets):
2388 Updating offsets according to the given alignment.
2389 * testsuite/Makefile.am (text_section_grouping): Test if string
2390 literals are getting merged.
2391 * testsuite/Makefile.in: Regenerate.
2392 * testsuite/merge_string_literals_1.c: New file.
2393 * testsuite/merge_string_literals_2.c: Ditto.
2394 * testsuite/merge_string_literals.sh: Ditto.
2395
0e804863
ILT
23962013-04-26 Ian Lance Taylor <iant@google.com>
2397
2398 * target-reloc.h (relocate_section): If the reloc offset is out of
2399 range, pass VIEW as NULL to relocate.relocate.
2400 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2401 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2402 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2403 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2404 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2405 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2406
e7c5ea40
CC
24072013-04-26 Geoff Pike <gpike@chromium.org>
2408
2409 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2410 * layout.cc (Hash_task): New class.
2411 (Layout::queue_build_id_tasks): New function.
2412 (Layout::write_build_id): Handle single-thread portion of build ID
2413 computation. (In some cases, all of it is single-threaded.) Replace
2414 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2415 functionality in fewer lines of code.
2416 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2417 * options.h (General_options): make "--build-id" default to tree
2418 rather than sha1. Add two new options related to --build-id=tree:
2419 --build-id-chunk-size-for-treehash and
2420 --build-id-min-file-size-for-treehash.
2421 * Makefile.am: add testing of --build-id=tree and related new options
2422 (these tests will be invoked by "make check").
2423 * Makefile.in: Regenerate.
2424
49926cd0
AM
24252013-04-25 Alan Modra <amodra@gmail.com>
2426
2427 * configure.tgt: Add powerpcle and powerpc64le.
2428
a4034750
AM
24292013-04-22 Alan Modra <amodra@gmail.com>
2430
2431 PR gold/15355
2432 * layout.cc (Layout::segment_precedes): Allow more than one
2433 segment with the same type and flags.
2434
e79c84aa
CC
24352013-04-15 Cary Coutant <ccoutant@google.com>
2436
2437 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2438 allocate space in file for BSS sections.
2439
2199fbe7
CC
24402013-04-15 Cary Coutant <ccoutant@google.com>
2441
2442 * script-sections.cc (Orphan_output_section): Reset address
2443 to zero after each orphaned section for relocatable links.
2444
502e8a84
CC
24452013-04-15 Cary Coutant <ccoutant@google.com>
2446
a4034750
AM
2447 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2448 section starting address for relocatable link.
2449 * testsuite/Makefile.am (script_test_11): New test.
2450 * testsuite/Makefile.in: Regenerate.
2451 * testsuite/script_test_11.c: New source file.
2452 * testsuite/script_test_11.t: New linker script.
502e8a84 2453
0cfdc767
AM
24542013-04-13 Alan Modra <amodra@gmail.com>
2455
2456 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2457 owner when sections are not adjacent and exceed group size.
2458 (Target_powerpc::group_sections): Handle corner case.
2459 (Target_powerpc::Branch_info::make_stub): Handle case where
2460 stub table doesn't exist due to branches in non-exec sections.
2461 (Target_powerpc::Relocate::relocate): Likewise.
2462
6830ee24
AM
24632013-04-11 Alan Modra <amodra@gmail.com>
2464
2465 PR gold/15354
2466 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2467 .branch_lt to match bfd ld. Adjust comments throughout file.
2468
54a3d865
ILT
24692013-04-04 Ian Lance Taylor <iant@google.com>
2470
2471 GCC PR c++/56840
2472 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2473 sections before checking whether they are included in the link.
2474
9993ba11
ST
24752013-03-29 Sriraman Tallam <tmsriram@google.com>
2476
2477 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2478 object before calling the plugin claim_file handler. Pass the elf
2479 object of the archive to the plugin. Delete the elf object if the
2480 plugin claims the file.
2481
ebacd51e
AM
24822013-03-21 Alan Modra <amodra@gmail.com>
2483
2484 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2485 segment when omagic.
2486
117be58f
AM
24872013-03-21 Alan Modra <amodra@gmail.com>
2488
2489 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2490 comparison warning.
2491 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2492 uninitialized" warning.
2493
32e2b61d
AM
24942013-03-20 Alan Modra <amodra@gmail.com>
2495
2496 * symtab.h (Symbol::clear_version): New function.
2497 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2498 is_needed by weak references. Clear version for symbols defined
2499 in as-needed objects that are not needed.
2500
b3ccdeb5
AM
25012013-03-15 Alan Modra <amodra@gmail.com>
2502
2503 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2504 static and public. Add report_err param. Return false for data refs.
2505 (Target_powerpc::rela_dyn_section): New overloaded function.
2506 (Target_powerpc::plt_, iplt_): Elucidate.
2507 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2508 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2509 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2510 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2511 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2512 push_branch and make_plt_entry for ifunc syms when
2513 reloc_needs_plt_for_ifunc.
2514 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2515 for ifunc unless reloc_needs_plt_for_ifunc.
2516
ad3d8a2f
AM
25172013-03-15 Alan Modra <amodra@gmail.com>
2518
2519 * gc.h (gc_process_relocs): Don't look through function descriptors.
2520 * icf.cc (get_section_contents): Do so here instead.
2521
4d9aa155
AM
25222013-03-13 Alan Modra <amodra@gmail.com>
2523
2524 * powerpc.cc (is_branch_reloc): Forward declare.
2525 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2526 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2527 false for 64-bit, true for 32-bit non-branch relocs.
2528 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2529 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2530 nm output.
2531 (icf_safe_test): Generate linker map file as well as nm output.
2532 (icf_safe_so_test): Likewise.
2533 * testsuite/Makefile.in: Regenerate.
2534 * testsuite/icf_test.sh: Parse linker map file to determine
2535 section folding.
2536 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2537 * testsuite/icf_safe_so_test.sh: Likewise.
2538 (X86_32_or_ARM_specific_safe_fold): Merge into..
2539 (arch_specific_safe_fold): ..this.
2540 (X86_64_specific_safe_fold): Delete unused function.
2541
57420c20
AM
25422013-03-12 Alan Modra <amodra@gmail.com>
2543
2544 * gc.h (gc_process_relocs): Look through function descriptors
2545 to determine shndx, symvalue and addend used by ICF. Tidy
2546 variable duplication.
2547
dc3714f3
AM
25482013-03-11 Alan Modra <amodra@gmail.com>
2549
2550 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2551 * layout.cc (Layout_task_runner::run): ..to here.
2552 * symtab.h (struct Symbol_location): Extract from..
2553 (class Symbol_table): ..here.
2554 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2555 * target.h (class Target): Add function_location and
2556 do_function_location functions.
2557 (class Sized_target): Add do_function_location.
2558 * object.h (class Sized_relobj_file): Move find_shdr..
2559 (class Object): ..to here.
2560 * object.cc: Likewise. Update to suit. Instantiate.
2561 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2562 * powerpc.cc (class Powerpc_dynobj): New.
2563 (Target_powerpc::do_function_location): New function.
2564 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2565 (Powerpc_dynobj::do_read_symbols): New function.
2566 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2567
956b03bb
ILT
25682013-03-08 Ian Lance Taylor <iant@google.com>
2569
2570 * options.cc (General_options::string_to_object_format): Accept
2571 "default".
2572
4bead2d5
AM
25732013-03-08 Alan Modra <amodra@gmail.com>
2574
2575 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2576 pointer to Post_fde.
2577 (struct Post_fde): Move definition to here..
2578 * ehframe.cc (struct Post_fde): ..from here.
2579 (Cie::write): Don't alloc Post_fde.
2580 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2581
02e60bf7
AM
25822013-03-07 Alan Modra <amodra@gmail.com>
2583
2584 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2585 relocation referencing .LC0.
2586 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2587
8343f03a
AM
25882013-03-07 Alan Modra <amodra@gmail.com>
2589
2590 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2591 always_inline. Add assembly for powerpc to avoid GOT.
2592
3366d57c
AM
25932013-03-07 Alan Modra <amodra@gmail.com>
2594
2595 * testsuite/script_test_10.sh: Don't test .bss section
2596 header number.
2597
6c77229c
AM
25982013-03-06 Alan Modra <amodra@gmail.com>
2599
2600 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2601 (Target_powerpc::symval_for_branch): Add symtab param. Update
2602 all callers. Handle folded sections.
2603 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2604 to Powerpc_relobj.
2605 (Global_symbol_visitor_opd::operator()): Likewise.
2606
a39e4af6
AM
26072013-03-04 Alan Modra <amodra@gmail.com>
2608
2609 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2610 * testsuite/Makefile.in: Regenerate.
2611
d5834edb
CC
26122013-03-01 Cary Coutant <ccoutant@google.com>
2613
2614 Add dwp support for v2 DWARF package file format.
2615 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2616 tu_length parameter. Adjust all callers.
2617 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2618 * dwp.cc: Include dwarf.h.
2619 (Section_bounds): New struct type.
2620 (Unit_set): New struct type.
2621 (Dwo_file::Dwo_file): Initialize new data member.
2622 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2623 Combine and rename to...
2624 (Dwo_file::read_unit_index): ...this.
2625 (Dwo_file::sized_read_compunit_index)
2626 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2627 (Dwo_file::sized_read_unit_index): ...this.
2628 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2629 parameters; add section_id parameter.
2630 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2631 (Dwo_file::add_unit_set): ...this.
2632 (Dwo_file::shndx_map_): Remove.
2633 (Dwo_file::sect_offsets_): New data member.
2634 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2635 (Dwp_output_file::add_section): Rename to...
2636 (Dwp_output_file::add_contribution): ...this.
2637 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2638 (Dwp_output_file::add_tu_set): Likewise.
2639 (Dwp_output_file::Contribution): New type.
2640 (Dwp_output_file::Section::contributions): New data member.
2641 (Dwp_output_file::Cu_or_tu_set): Remove.
2642 (Dwp_output_file::Section::Section): New ctor.
2643 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2644 (Dwp_output_file::Dwp_index::Section_table): New type.
2645 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2646 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2647 parameter.
2648 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2649 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2650 (Dwp_output_file::Dwp_index::section_table): New member function.
2651 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2652 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2653 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2654 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2655 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2656 (Dwp_output_file::Dwp_index::section_table_): New data member.
2657 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2658 (Dwp_output_file::add_output_section): New member function.
2659 (Dwp_output_file::write_new_section): New member function.
2660 (Dwp_output_file::write_contributions): New member function.
2661 (Dwp_output_file::section_id_map_): New data member.
2662 (class Dwo_id_info_reader): Remove.
2663 (class Unit_reader): New class.
2664 (get_dwarf_section_name): New function.
2665 (Dwo_file::read_executable): Adjust initializations of class data.
2666 (Dwo_file::read): Add support for v2 package file format.
2667 (Dwo_file::read_unit_index): Likewise.
2668 (Dwo_file::sized_read_unit_index): Likewise.
2669 (Dwo_file::copy_section): Likewise.
2670 (Dwo_file::add_unit_set): Likewise.
2671 (Dwp_output_file::add_output_section): Likewise.
2672 (Dwp_output_file::add_contribution): Likewise.
2673 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2674 for empty slot.
2675 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2676 file format.
2677 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2678 slot.
2679 (Dwp_output_file::initialize): Remove unused function.
2680 (Dwp_output_file::finalize): Add support for v2 package file format.
2681 (Dwp_output_file::write_index): Likewise.
2682 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2683 function prototype.
2684
a68a081d
CC
26852013-03-01 Cary Coutant <ccoutant@google.com>
2686
2687 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2688 function into class definition in header file.
2689 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2690 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2691 New function.
2692 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2693
9d5781f8
AM
26942013-02-28 Alan Modra <amodra@gmail.com>
2695
2696 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2697 * target.cc (Target::do_plt_fde_location): New function.
2698 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2699 accessor function, and constructor param.
2700 (struct Post_fde, Post_fdes): Declare.
2701 (Cie::write): Add post_fdes param.
2702 * ehframe.cc (Fde::write): Use plt_fde_location.
2703 (struct Post_fde): Define.
2704 (Cie::write): Stash FDEs added post merge mapping.
2705 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2706 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2707 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2708 other FDEs.
2709 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2710 (Target_powerpc::has_glink): New function.
2711 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2712 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2713 glink_eh_frame_fde_32, default_fde): New data.
2714 (Stub_table::eh_frame_added_): New var.
2715 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2716 Make const.
2717 (Stub_table::add_eh_frame): New function.
2718 (Output_data_glink::add_eh_frame): New function.
2719 (Target_powerpc::make_glink_section): Call add_eh_frame.
2720
214383dd
ILT
27212013-02-15 Ian Lance Taylor <iant@google.com>
2722
2723 * options.h (DEFINE_uint64_alias): Define.
2724 (class General_options): Add -Ttext-segment as an alias for
2725 -Ttext.
2726
91c2b899
AM
27272013-02-15 Alan Modra <amodra@gmail.com>
2728
2729 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2730 (Stub_table::do_write): ..here, two places.
2731 (Stub_table::plt_call_size): Use it here too.
2732
20e2a8aa
ILT
27332013-02-11 Ian Lance Taylor <iant@google.com>
2734
2735 * descriptors.cc (Descriptors::close_all): New function.
2736 * descriptors.h (class Descriptors): Declare close_all.
2737 (close_all_descriptors): New inline function.
2738 * plugin.cc: Include "descriptors.h".
2739 (Plugin_manager::cleanup): Call close_all_descriptors.
2740
8952bc69
AM
27412013-02-06 Alan Modra <amodra@gmail.com>
2742
2743 * README: Update coding style link.
2744
29bd8b6b
CC
27452013-01-28 Cary Coutant <ccoutant@google.com>
2746
a4034750
AM
2747 * dwp.cc (File_list): New typedef.
2748 (Dwo_name_info_reader): New class.
2749 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2750 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2751 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2752 (Dwo_file::read_executable): New function.
2753 (Dwo_file::read): Move common setup code to ...
2754 (Dwo_file::make_object): ... here.
2755 (dwp_options): Add --exec/-e.
2756 (usage): Likewise.
2757 (main): Likewise.
29bd8b6b 2758
c6ac678d
ST
27592013-01-24 Sriraman Tallam <tmsriram@google.com>
2760
2761 * layout.cc (Layout::layout): Check for option text_reorder.
2762 (Layout::make_output_section): Ditto.
2763 * options.h (text_reorder): New option.
2764 * output.cc (Input_section_sort_compare): Remove special ordering
2765 of section names.
2766 (Output_section::
2767 Input_section_sort_section_name_special_ordering_compare::
2768 operator()): New function.
2769 (Output_section::sort_attached_input_sections): Use new sort function
2770 for .text.
2771 * output.h (Input_section_sort_section_name_special_ordering_compare):
2772 New struct.
2773 * testsuite/Makefile.am (text_section_grouping): Test option
2774 --no-text-reorder
2775 * testsuite/Makefile.in: Regenerate.
2776 * testsuite/text_section_grouping.sh: Check order of functions without
2777 default text reordering.
2778
50701cc1
MF
27792013-01-18 Mike Frysinger <vapier@gentoo.org>
2780
2781 * options.h (General_options): Change default to true for new_dtags.
2782
b1b00fcc
MF
27832013-01-18 Mike Frysinger <vapier@gentoo.org>
2784
2785 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2786 when enable_new_dtags is false. Only add DT_RUNPATH when
2787 enable_new_dtags is true.
2788
ec5b8187
AM
27892013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2790
2791 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2792 used in declaration and definition consistent.
2793 (Target_powerpc::symval_for_branch): Ditto.
2794
a880d4c4
ST
27952013-01-16 Sriraman Tallam <tmsriram@google.com>
2796
2797 * testsuite/plugin_final_layout.cc: Fix comment.
2798
7c381248
ST
27992013-01-16 Sriraman Tallam <tmsriram@google.com>
2800
2801 * layout.cc (Layout::layout): Do not do default sorting for
2802 text sections when section ordering is specified.
2803 (make_output_section): Ditto.
2804 * testsuite/plugin_final_layout.cc: Name the function sections
2805 to catch reordering issues.
2806
e2458743
AM
28072013-01-15 Alan Modra <amodra@gmail.com>
2808
2809 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2810 plt-thread-safe.
2811
431ed302
AM
28122013-01-15 Alan Modra <amodra@gmail.com>
2813
2814 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2815 * testsuite/Makefile.in: Regenerate.
2816
0ec6429b
AM
28172013-01-14 Alan Modra <amodra@gmail.com>
2818
2819 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2820 * testsuite/Makefile.in: Regenerate.
2821
0bf402d5
ILT
28222013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2823
36af3926 2824 PR bfd/14430
0bf402d5
ILT
2825 Fix mingw gold build with plugins enabled
2826 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2827 * configure.ac: Export DLOPEN_LIBS and add headers check.
2828 * plugin.cc: Handle non-dlfcn case.
2829 * Makefile.in: Regenerate.
2830 * config.in: Regenerate.
2831 * configure: Regenerate.
2832 * testsuite/Makefile.in: Regenerate.
2833
9e9143bc
ST
28342013-01-09 Sriraman Tallam <tmsriram@google.com>
2835
2836 * output.h (sort_attached_input_sections): Change to be public.
2837 * script-sections.cc
2838 (Output_section_definition::set_section_addresses): Sort
2839 attached input sections according to section order before linker
2840 script assigns section addresses.
2841 (Orphan_output_section::set_section_addresses): Sort
2842 attached input sections according to section order before linker
2843 script assigns section addresses.
2844 * Makefile.am (final_layout.sh): Use a simple linker script to
2845 check if section ordering still works.
2846 * Makefile.in: Regenerate.
2847
679af368
ILT
28482013-01-09 Ben Cheng <bccheng@google.com>
2849
2850 * arm.cc (Target_arm::attributes_accept_div): New function.
2851 (Target_arm::attributes_forbid_div): New function.
2852 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2853 attribute using the same new functions as what bfd/elf32_arm.c
2854 does.
2855
3136a00e
CC
28562013-01-07 Cary Coutant <ccoutant@google.com>
2857
2858 PR gold/14993
2859 * output.cc (Output_section::add_input_section): For incremental
2860 updates, don't track input sections that are allocated from patch
2861 space.
2862
f2a6224b
L
28632013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2864 Ian Lance Taylor <iant@google.com>
2865
2866 PR gold/14897
2867 * configure.ac (--enable-ld): Removed.
2868 (install_as_default): Set to yes only for --enable-gold=default
2869 or --disable-ld.
2870 * configure: Regenerated.
2871
4f46f626
L
28722013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2873
2874 * options.h (General_options): Add -fuse-ld= for GCC linker
2875 option compatibility.
2876
26e4ef59
CC
28772013-01-04 Cary Coutant <ccoutant@google.com>
2878
2879 * configure.ac: Fix typo restoring CXXFLAGS.
2880 * configure: Regenerate.
2881
3d587466
CC
28822013-01-04 Cary Coutant <ccoutant@google.com>
2883
4f46f626
L
2884 * testsuite/Makefile.am (CXXLINK_S): New macro.
2885 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2886 * testsuite/Makefile.in: Regenerate.
3d587466 2887
44db6695
L
28882013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2889
2890 * version.cc (print_version): Update copyright year to 2013.
2891
edcac0c1
ILT
28922012-12-20 Ian Lance Taylor <iant@google.com>
2893
2894 * layout.cc (Layout::special_ordering_of_input_section): New
2895 function.
2896 (Layout::layout): If input section requires special ordering, must
2897 sort input sections.
2898 (Layout::make_output_section): May sort .text input sections.
2899 (Layout::is_section_name_prefix_grouped): Remove.
2900 * layout.h (class Layout): Declare
2901 special_ordering_of_input_section. Don't declare
2902 is_section_name_prefix_grouped.
2903 * output.cc (Output_section::add_input_section): Revert last
2904 change.
2905 (Output_section::Input_section_sort::match_file_name): Don't crash
2906 if called on output section data.
2907 (Output_section::Input_section_sort_compare): Sort based on
2908 special ordering.
2909 (Output_section::Input_section_sort_section_order_index_compare):
2910 Revert last patch.
2911 (Output_section::sort_attached_input_sections): Likewise.
2912
28f2a4ac
ST
29132012-12-18 Sriraman Tallam <tmsriram@google.com>
2914
edcac0c1 2915 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2916 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2917 * output.cc (Output_section::add_input_section): Check if section
2918 name contains special prefix. Keep input sections to sort such
2919 sections.
2920 (Output_section::Input_section_sort_section_order_index_compare
2921 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2922 (Output_section::sort_attached_input_sections): Add condition to
2923 Input_section_entry constructor call.
28f2a4ac
ST
2924 * testsuite/Makefile.am (text_section_grouping): New test.
2925 * testsuite/Makefile.in: Regenerate.
2926 * testsuite/text_section_grouping.cc: New file.
2927 * testsuite/text_section_grouping.sh: New file.
2928
5bf135a7
NC
29292012-12-17 Nick Clifton <nickc@redhat.com>
2930
2931 * Makefile.am: Add copyright notice.
2932 * NEWS: Likewise.
2933 * README: Likewise.
2934 * configure.ac: Likewise.
2935 * ftruncate.c: Likewise.
2936 * Makefile.in: Regenerate.
2937
59965708
CC
29382012-12-14 Cary Coutant <ccoutant@google.com>
2939
a4034750
AM
2940 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2941 --no-as-needed flag.
2942 (exception_separate_shared_12_test): Likewise.
2943 (incremental_copy_test): Likewise.
2944 * testsuite/Makefile.in: Regenerate.
59965708 2945
2a77e2ab
CC
29462012-12-14 Cary Coutant <ccoutant@google.com>
2947
2948 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2949 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2950
e3deeb9c
AM
29512012-12-12 Alan Modra <amodra@gmail.com>
2952
2953 * powerpc.cc (class Track_tls): New.
2954 (class Relocate, class Scan): Inherit Track_tls.
2955 (Target_powerpc::Scan::local, global): Track tls optimization
2956 and avoid creating plt entry for __tls_get_addr if all uses
2957 are optimized away.
2958 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2959
d8f5a274
AM
29602012-12-12 Alan Modra <amodra@gmail.com>
2961
2962 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2963 Replace no_toc_optimize with toc_optimize.
2964 * output.h (Output_section::input_sections): Provide non-const variant.
2965 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2966 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2967 accessors.
2968 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2969 (class Sort_toc_sections): New.
2970 (Target_powerpc::do_finalize_sections): Sort toc sections.
2971 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2972
4c8a1de1
RM
29732012-12-10 Roland McGrath <mcgrathr@google.com>
2974
2975 * testsuite/binary_unittest.cc (read_all): New function.
2976 (Sized_binary_test): Use it instead of ::read.
2977 * fileread.cc (do_read): Don't assume pread always reads the whole
2978 amount in a single call.
2979
edc27beb
AM
29802012-12-10 Alan Modra <amodra@gmail.com>
2981
2982 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2983 Set EM_PPC64 or EM_PPC here.
2984 (Target_selector_powerpc::do_recognize): Delete.
2985
906b9150
AM
29862012-12-10 Alan Modra <amodra@gmail.com>
2987
2988 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2989 stub_table_.
2990 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2991
418c15ae
RM
29922012-12-07 Roland McGrath <mcgrathr@google.com>
2993
2994 * testsuite/binary_unittest.cc (Sized_binary_test):
2995 Use open_descriptor rather than ::open.
2996
decdd3bc
AM
29972012-12-07 Alan Modra <amodra@gmail.com>
2998
2999 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3000 typedef and invalid_address constant.
3001 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3002 instantiate constants.
3003
db399005
ILT
30042012-12-06 Roland McGrath <mcgrathr@google.com>
3005
3006 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3007 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3008 * aclocal.m4: Regenerate.
3009 * configure: Regenerate.
3010 * Makefile.in: Regenerate.
3011 * testsuite/Makefile.in: Regenerate.
3012
aba6bc71
AM
30132012-12-07 Alan Modra <amodra@gmail.com>
3014
3015 * options.h (General_options): Add no_toc_optimize.
3016 * powerpc.cc (ok_lo_toc_insn): New function.
3017 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3018
9e69ed50
AM
30192012-12-06 Alan Modra <amodra@gmail.com>
3020
3021 * options.h (General_options): Add plt_align, plt_static_chain,
3022 plt_thread_safe. Update stub_group_size help text.
3023 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3024 for new plt_thread_safe_ var.
3025 (use_plt_offset): Correct comments.
3026 (Target_powerpc::do_relax): Look for thread creation symbols to
3027 determine default plt_thread_safe value. Clear plt call stubs
3028 as well as branch stubs each iteration.
3029 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3030 insn constants.
3031 (l, hi, ha, write_insn): Move earlier.
3032 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3033 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3034 plt stubs too.
3035 (Stub_table::update_size): Adjust.
3036 (Stub_table::prev_size, set_prev_size): Delete.
3037 (Stub_table::stub_align): Let --plt-align affect result.
3038 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3039 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3040 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3041 (Stub_table::do_write): Support more stub variants.
3042
f43ba157
AM
30432012-12-04 Alan Modra <amodra@gmail.com>
3044
3045 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3046 (Target_powerpc::do_define_standard_symbols): New function.
3047
34171bc5
AM
30482012-12-03 Alan Modra <amodra@gmail.com>
3049
3050 * output.h: Formatting, whitespace.
3051
dc9589e9 30522012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3053
3054 * layout.h (Layout::get_executable_sections): Declare.
3055 * layout.cc (Layout::get_executable_sections): New function.
3056 * arm.cc (Target_arm::group_sections): Use it.
3057 (Arm_output_section::group_sections): Delete now redundant test.
3058 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3059 param to handle relative relocs.
3060 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3061 (Output_data_reloc::add_absolute): Adjust.
3062 (Output_data_reloc::add_relative): New function.
3063 (Output_data::reset_data_size): New function.
3064 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3065 (Output_section::set_addralign): New function.
3066 (Output_section::checkpoint_set_addralign): New function.
3067 (Output_section::clear_section_offsets_need_adjustment): New function.
3068 (Output_section::input_sections): Make public.
3069 * powerpc.cc (class Output_data_brlt_powerpc): New.
3070 (class Stub_table, class Stub_control): New.
3071 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3072 stub_table_, set_stub_table, stub_table): New vectors and accessor
3073 functions.
3074 (Target_powerpc::do_may_relax, do_relax, push_branch,
3075 new_stub_table, stub_tables, brlt_section, group_sections,
3076 add_branch_lookup_table, find_branch_lookup_table,
3077 write_branch_lookup_table, make_brlt_section): New functions.
3078 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3079 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3080 branch_info_): New vars.
3081 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3082 make call stubs here.
3083 (Output_data_glink): Remove all call stub handling from this class.
3084 (Target_powerpc::Scan::local, global): Save interesting branch
3085 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3086 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3087 functions on final link.
3088 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3089 Handle long branch destinations too.
3090 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3091 do_plt_address_for_local): Adjust lookup of plt call stubs.
3092
627b30b7
AM
30932012-11-30 Alan Modra <amodra@gmail.com>
3094
3095 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3096 relocs against protected symbols when building 32-bit shared libs.
3097
40b469d7
AM
30982012-11-30 Alan Modra <amodra@gmail.com>
3099
3100 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3101 param. Call got_section() to make .got. Update all callers
3102 and their callers and so on.
3103
bb66a627
AM
31042012-11-30 Alan Modra <amodra@gmail.com>
3105
3106 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3107 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3108 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3109 value if it already exists.
3110
d2cf1c6c
L
31112012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3112
3113 PR gold/14858
3114 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3115
edccdf7c
RM
31162012-11-14 Roland McGrath <mcgrathr@google.com>
3117
3118 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3119 than bfc instruction for data sandboxing.
3120
6febeb74
AM
31212012-11-08 Alan Modra <amodra@gmail.com>
3122
3123 * po/POTFILES.in: Regenerate.
3124
0a6f1bf2
AM
31252012-11-05 Alan Modra <amodra@gmail.com>
3126
3127 * configure.ac: Apply 2012-09-10 change to config.in here.
3128 * configure: Regenerate.
3129
26a4e9cb
AM
31302012-11-05 Alan Modra <amodra@gmail.com>
3131
3132 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3133 (struct Opd_ent): Use "Address" rather than "Offset".
3134 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3135 (Target_powerpc::got_section): Make public.
3136 (Target_powerpc::scan_relocs): Move code setting symbols..
3137 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3138 Create _SDA_BASE_ only when referenced.
3139
cc928013
RM
31402012-11-02 Roland McGrath <mcgrathr@google.com>
3141
3142 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3143 from last change.
3144
50ed5eb1
RM
31452012-11-01 Roland McGrath <mcgrathr@google.com>
3146
62fe925a
RM
3147 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3148 for offset_in_output_section parameter.
3149 (Sized_target::relocate_special_relocatable): Likewise.
3150 * arm.cc (Target_arm::relocate_relocs): Likewise.
3151 (Target_arm::relocate_special_relocatable): Likewise.
3152 * i386.cc (Target_i386::relocate_relocs): Likewise.
3153 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3154 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3155 * target-reloc.h (relocate_relocs): Likewise.
3156 * testsuite/testfile.cc (Target_test): Likewise.
3157 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3158 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3159
3160 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3161 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3162
3163 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3164 parameter, which is unused in the [!F_SETFD] case.
3165
50ed5eb1
RM
3166 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3167 SYMNDX to off_t before comparing it to this->data_size().
3168 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3169 * incremental.cc (Output_section_incremental_inputs::do_write):
3170 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3171
2cadc0bf
RM
3172 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3173
3bfcb652
NC
31742012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3175
3176 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3177 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3178 in EABI_VER5.
3179
c1a8d56e
CC
31802012-10-29 Cary Coutant <ccoutant@google.com>
3181
3182 * dwp.cc (usage): Add file and exit status parameters;
3183 add --help and --version options.
3184 (print_version): New function.
3185 (main): Add --help and --version options.
3186
b2490a7b
L
31872012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3188
3189 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3190 final_layout_sequence.txt.
3191 * testsuite/Makefile.in: Regenerated.
3192
aa543512
L
31932012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3194
3195 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3196 COMPILE generated by automake.
3197 (LINK1): Likewise.
3198 (CXXCOMPILE1): Likewise.
3199 (CXXLINK1): Likewise.
3200 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3201 (LINK): Likewise.
3202 (CXXCOMPILE): Likewise.
3203 (CXXLINK): Likewise.
3204 * testsuite/Makefile.in: Regenerated.
3205
d361fafb
L
32062012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3207
3208 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3209 on bad fwrite return.
3210
598c7410
L
32112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3212
3213 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3214 on val.
3215
35c813e2
CC
32162012-10-23 Cary Coutant <ccoutant@google.com>
3217
3218 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3219 * testsuite/Makefile.in: Regenerate.
3220 * testsuite/dwp_test.h: New source file.
3221 * testsuite/dwp_test_1.cc: New source file.
3222 * testsuite/dwp_test_1.s: New source file.
3223 * testsuite/dwp_test_1.sh: New source file.
3224 * testsuite/dwp_test_1b.cc: New source file.
3225 * testsuite/dwp_test_1b.s: New source file.
3226 * testsuite/dwp_test_2.cc: New source file.
3227 * testsuite/dwp_test_2.s: New source file.
3228 * testsuite/dwp_test_2.sh: New source file.
3229 * testsuite/dwp_test_main.cc: New source file.
3230 * testsuite/dwp_test_main.s: New source file.
3231
77429909
CC
32322012-10-23 Cary Coutant <ccoutant@google.com>
3233
3234 * dwp.h: New header file.
3235 * dwp.cc: New source file.
3236 * gold.h: Move shared declarations to system.h.
3237 * system.h: New header file.
3238 * Makefile.am: Add dwp.
3239 * Makefile.in: Regenerate.
3240
ed5d6712
CC
32412012-10-23 Cary Coutant <ccoutant@google.com>
3242
3243 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3244 Dwarf_info_reader::read_from_pointer.
3245 (Dwarf_pubnames_table::read_header): Likewise.
3246 (Dwarf_pubnames_table::next_name): Likewise.
3247 (Dwarf_die::read_attributes): Likewise.
3248 (Dwarf_die::skip_attributes): Likewise.
3249 (Dwarf_info_reader::read_from_pointer): New function template.
3250 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3251 (Dwarf_pubnames_table): Likewise.
3252 (Dwarf_info_reader::read_from_pointer): New function template.
3253 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3254 Dwarf_pubnames_table ctor.
3255
8787852d
CC
32562012-10-23 Cary Coutant <ccoutant@google.com>
3257
3258 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3259 abbrev_shndx.
3260 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3261 abbrev_shndx_.
3262 (Dwarf_info_reader::set_abbrev_shndx): New method.
3263 (Dwarf_info_reader::abbrev_shndx_): New data member.
3264
9fc236f3
CC
32652012-10-23 Cary Coutant <ccoutant@google.com>
3266
3267 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3268 from object, not parameters.
3269 (Dwarf_info_reader::parse): Likewise.
3270 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3271 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3272 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3273 methods.
3274
effe8365
CC
32752012-10-23 Cary Coutant <ccoutant@google.com>
3276
3277 * fileread.cc (Input_file::Input_file): New constructor.
3278 * fileread.h (class Input_file): Add new constructor.
3279
1698990d
AM
32802012-10-18 Alan Modra <amodra@gmail.com>
3281
3282 PR gold/14727
3283 * object.cc (Relobj::is_section_name_included): Also match
3284 .sdata personality section.
3285
168a4726
AM
32862012-10-18 Alan Modra <amodra@gmail.com>
3287
3288 * target-reloc.h (class Default_comdat_behavior): New, package up..
3289 (get_comdat_behaviour): ..this.
3290 (relocate_section): Add Relocate_comdat_behavior template arg,
3291 adjust code to suit.
3292 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3293 (Target_arm::scan_reloc_section): Likewise.
3294 * i386.cc (Target_i386::relocate_section): Likewise.
3295 * sparc.cc (Target_sparc::relocate_section): Likewise.
3296 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3297 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3298 * powerpc.cc (class Relocate_comdat_behavior): New.
3299 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3300 gold::relocate_section with new template arg.
3301
acc276d8
AM
33022012-10-18 Alan Modra <amodra@gmail.com>
3303
3304 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3305 dynamic relocs for GOT_TPREL got entries, without symbol if
3306 resolving locally.
3307 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3308 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3309 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3310
e10f9870
AM
33112012-10-17 Alan Modra <amodra@gmail.com>
3312
3313 PR gold/14726
3314 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3315
ae034989
ST
33162012-10-16 Sriraman Tallam <tmsriram@google.com>
3317
3318 * layout.cc (Layout::include_section): Keep sections marked
3319 SHF_EXCLUDE when doing relocatable links.
3320
f3a0ed29
AM
33212012-10-16 Alan Modra <amodra@gmail.com>
3322
3323 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3324 (Target_powerpc::do_finalize_sections): Call it.
3325 (Output_data_save_res): New class and supporting functions.
3326 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3327 normal symbols defined in object files.
3328
c6de8ed4
AM
33292012-10-12 Alan Modra <amodra@gmail.com>
3330
3331 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3332 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3333 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3334 section if scan_opd_relocs not yet called.
3335 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3336
03e25981
AM
33372012-10-12 Alan Modra <amodra@gmail.com>
3338
3339 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3340 add_local_ifunc_entry): Revert last change.
3341 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3342
c9824451
AM
33432012-10-05 Alan Modra <amodra@gmail.com>
3344
3345 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3346 do_plt_address_for_global): New functions.
3347 (Output_data_got_powerpc::do_write): Don't segfault when linking
3348 statically.
3349 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3350 add_local_ifunc_entry): Return true on adding entry..
3351 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3352 glink->add_entry call. Remove unused symtab param. Adjust calls.
3353 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3354 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3355 set up symbols here.
3356 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3357 syms here. Do so even when no .iplt. Don't segfault when linking
3358 statically.
3359 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3360 new variants without reloc param.
3361 (Glink_sym_ent::Glink_sym_ent): Likewise.
3362 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3363 reloc when refs will resolve to plt call stub.
3364 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3365 R_PPC_PLTREL24 to resolve locally.
3366 (Target_powerpc::Scan::global): Correct ifunc handling.
3367 (Target_powerpc::Relocate::relocate): Correct local sym glink
3368 lookup. Don't destroy "value" when we have a plt call stub,
3369 and when checking plt call validity.
3370 (Target_powerpc::do_dynsym_value): Simplify.
3371
19fec8c1
AM
33722012-10-05 Alan Modra <amodra@gmail.com>
3373
3374 * i386.cc (Output_data_plt_i386::address_for_global,
3375 address_for_local): Add plt offset to returned value. Adjust uses.
3376 * sparc.cc (Output_data_plt_sparc::address_for_global,
3377 address_for_local): Likewise.
3378 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3379 address_for_local): Likewise.
3380 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3381 address_for_local): Likewise.
3382 * target.h (Target::plt_address_for_global, plt_address_for_local):
3383 Update comment.
3384 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3385 (Output_data_got::Got_entry::write): Nor here.
3386 * output.h: Comment fix.
3387
e867b647
WL
33882012-10-02 Jiong Wang <jiwang@tilera.com>
3389
3390 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3391 global_offset_table_ value for larget got.
3392 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3393
e5d5f5ed
AM
33942012-09-29 Alan Modra <amodra@gmail.com>
3395
3396 * powerpc.cc (Target_powerpc::iplt_): New output section.
3397 (Target_powerpc::iplt_section, make_iplt_section,
3398 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3399 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3400 Target_powerpc::plt_entry_count): Count iplt entries too.
3401 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3402 reloc section in constructor. New params.
3403 (Target_powerpc::make_plt_section): Create reloc section here instead.
3404 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3405 functions.
3406 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3407 (Output_data_glink::add_entry, find_entry): New functions to
3408 deal with local syms.
3409 (Glink_sym_ent): Add support for local syms.
3410 (Output_data_glink::do_write): Handle ifunc plt entries.
3411 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3412 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3413 (Target_powerpc::Relocate::relocate): Likewise.
3414 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3415
ec4dbad3
AM
34162012-09-25 Alan Modra <amodra@gmail.com>
3417
3418 * object.h (Sized_relobj_file::adjust_local_symbol,
3419 do_adjust_local_symbol): New functions.
3420 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3421 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3422 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3423 and irregular opd entry spacing.
3424 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3425 (Global_symbol_visitor_opd): New functor.
3426 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3427 on deleted opd entries.
3428
5c0b3823
WL
34292012-09-15 Jiong Wang <jiwang@tilera.com>
3430
3431 * tilegx.cc: New file.
3432 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3433 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3434 * configure.tgt: Add entries for tilegx*.
3435 * configure.ac: Likewise.
3436 * Makefile.in: Rebuild.
3437 * configure: Likewise.
3438 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3439 tilegx.
3440
bfdfa4cd
AM
34412012-09-13 Alan Modra <amodra@gmail.com>
3442
3443 * target-reloc.h (scan_relocs): Call scan.local for relocs
3444 against symbols in discarded sections. Pass is_discarded
3445 param.
3446 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3447 Add is_discarded param.
3448 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3449 is_discarded to flag opd entry as discarded. Don't emit dyn
3450 relocs on such entries.
3451 (Target_powerpc::Scan::global): Similarly detect and handle
3452 such opd entries.
3453 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3454 opd_ent_. Update all uses.
3455 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3456 (Target_powerpc::relocate_section): Zero out discarded opd
3457 entry relocs.
3458
d77a0555
ILT
34592012-09-12 Ian Lance Taylor <iant@google.com>
3460
3461 PR gold/14570
3462 * output.cc: Rename Output_data_got template parameter from size
3463 to got_size for all functions. Compile all variants of
3464 Output_data_got.
3465 (Output_data_got::Got_entry::write): Correct use of size for
3466 symbol value. Use local_is_tls rather than casting to
3467 Sized_relobj_file.
3468 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3469 (class Sized_relobj_file): Add do_local_is_tls.
3470 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3471
815a1205
AM
34722012-09-11 Alan Modra <amodra@gmail.com>
3473
3474 PR gold/14566
3475 * layout.cc (Layout::set_segment_offsets): When using
3476 common-page-size alignment, ensure we are on a new max-page-size
3477 page.
3478 * output.cc (Output_segment::set_section_addresses): Use
3479 abi_pagesize, not common_pagesize for relro boundary.
3480 (Output_segment::set_offset): Likewise.
3481
bd73a62d
AM
34822012-09-11 Alan Modra <amodra@gmail.com>
3483
3484 * output.h (Output_data_got::add_global_tls, add_local_tls,
3485 add_local_tls_pair): New functions.
3486 (Output_data_got::add_local_pair_with_rel): Remove second
3487 reloc param. Expand comment.
3488 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3489 use_plt_or_tls_offset_, similarly for constructor param.
3490 (Output_data_got::Got_entry::write): Add got_index param.
3491 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3492 add_local_tls_pair): New functions.
3493 (Output_data_got::Got_entry::write): Handle tls symbols
3494 with use_plt_or_tls_offset_ set specially.
3495 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3496 (Output_data_got::do_write): Replace iterator with index, pass
3497 index to entry write function.
3498 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3499 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3500 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3501 call.
3502 * i386.cc (Target_i386::Scan::local): Likewise.
3503 * sparc.cc (Target_sparc::Scan::local): Likewise.
3504 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3505 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3506 do_tls_offset_for_global): New functions.
3507 (Target_powerpc::Scan::local): Correct TLS relocations and got
3508 entry values.
3509 (Target_powerpc::Scan::global): Don't emit unnecessary
3510 dynamic relocations on TLS GOT entries.
3511
00716ab1
AM
35122012-09-10 Matthias Klose <doko@ubuntu.com>
3513
3514 * config.in: Disable sanity check for kfreebsd.
3515
c891b3f9
SA
35162012-09-10 Sterling Augustine <saugustine@google.com>
3517
3518 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3519 (Gdb_index::pubtypes_read): New parameter.
3520 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3521 to calls.
3522 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3523 pubtypes_object_.
3524
e81fea4d
AM
35252012-09-09 Alan Modra <amodra@gmail.com>
3526
3527 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3528 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3529 * gc.h (gc_process_relocs): Call target gc_add_reference.
3530 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3531 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3532 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3533 unnecessary cast.
3534 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3535 to cater for when we don't need code offset. Update use.
3536 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3537 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3538 set_opd_valid): New functions.
3539 (Target_powerpc::do_gc_add_reference): New function.
3540 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3541 stashed refs.
3542 (Target_powerpc::do_gc_mark_symbol): New function.
3543
d2d60eef
CC
35442012-09-06 Cary Coutant <ccoutant@google.com>
3545
3546 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3547 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3548 (Dwarf_die::skip_attributes): Likewise.
3549 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3550 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3551 (main): Call it.
3552 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3553
32ed4573
L
35542012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3555
3556 * testsuite/script_test_3.t: Add .got.plt output section
3557 statement.
3558 * testsuite/script_test_4.t: Likewise.
3559
f4baf0d4
AM
35602012-09-05 Alan Modra <amodra@gmail.com>
3561
3562 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3563 update all uses and lose "enum" when using type.
3564
864a1b56
AM
35652012-09-05 Alan Modra <amodra@gmail.com>
3566
3567 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3568 * configure: Regenerate.
3569 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3570 (plugin_final_layout.stdout): Likewise.
3571 (memory_test): Set page sizes to 0x1000.
3572 * testsuite/Makefile.in: Regenerate.
3573 * testsuite/discard_locals_test.sh: Add FIXME comment.
3574 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3575 * testsuite/pr14265.t: Add .got output section statement.
3576 * testsuite/script_test_2.t: Likewise.
3577 * testsuite/script_test_3.t: Likewise.
3578 * testsuite/script_test_4.t: Likewise.
3579 * testsuite/script_test_5.t: Likewise.
3580 * testsuite/script_test_6.t: Likewise.
3581 * testsuite/script_test_7.t: Likewise.
3582 * testsuite/script_test_9.t: Likewise.
3583
3ea0a085
AM
35842012-09-05 Alan Modra <amodra@gmail.com>
3585
3586 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3587 (Powerpc_relocate_functions::Status): New typedef.
3588 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3589 (Target_powerpc::Scan::local): Handle REL64.
3590 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3591 for REL32 and REL64.
3592 (Target_powerpc::symval_for_branch): New function, extracted from..
3593 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3594 checks. Report overflow errors.
3595
7404fe1b
AM
35962012-09-05 Alan Modra <amodra@gmail.com>
3597
3598 * object.h (Sized_relobj_file::emit_relocs): Delete.
3599 (Sized_relobj_file::emit_relocs_reltype): Delete.
3600 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3601 relocate_relocs for --emit-relocs.
3602 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3603 * output.h: Update comment.
3604 (Output_segment::first_section): New function.
3605 (Output_segment::first_section_load_address): Use first_section.
3606 * output.cc (Output_segment::first_section): New function extracted..
3607 (Output_segment::first_section_load_address): ..from here. Delete.
3608 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3609 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3610 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3611 adjust call to target.h function.
3612 * i386.cc (Target_i386): Likewise.
3613 * sparc.cc (Target_sparc): Likewise.
3614 * x86_64.cc (Target_x86_64): Likewise.
3615 * powerpc.cc (Target_powerpc): Likewise.
3616 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3617 first tls section has section symbol for optimised local dynamic
3618 output relocs.
3619 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3620 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3621 optimised tls code.
3622 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3623 Rename to relocate_relocs. Update error message.
3624
957564c9
AS
36252012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3626
3627 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3628 --just-symbols.
3629
dd93cd0a
AM
36302012-08-31 Alan Modra <amodra@gmail.com>
3631
3632 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3633 (Powerpc_relobj::toc_base_offset): New stub function.
3634 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3635 got_mod_index_offset to tlsld_got_offset. Update all refs.
3636 (Target_powerpc::Relocate::enum skip_tls): New.
3637 (Target_powerpc::call_tls_get_addr_): New var.
3638 (Target_powerpc::is_branch_reloc): Move to file scope.
3639 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3640 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3641 New functions.
3642 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3643 (powerpc_info): Correct common_pagesize for ppc64.
3644 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3645 (Powerpc_relocate_functions): Add overflow check enums and functions.
3646 Add non-shift version of rela, rela_ua. Delete all rel public
3647 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3648 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3649 addr16_ha3, addr14 functions.
3650 (Output_data_got_powerpc::add_constant_pair): New function.
3651 (Output_data_got_powerpc::got_base_offset): Likewise.
3652 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3653 (instruction constants): Sort, add some more.
3654 (Output_data_glink::do_write): Add and use Address typedef. Use
3655 object->toc_base_offset() stub for 64-bit.
3656 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3657 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3658 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3659 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3660 Always treat .opd relocs as against locally defined symbol.
3661 Correct condition for RELATIVE relocs.
3662 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3663 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3664 for 32-bit syms with a plt entry. Correct ppc64 toc base
3665 calculations. Handle TLS relocs, and more. Add overflow
3666 checking and adjust for Powerpc_relocate_functions changes.
3667 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3668 Reinstate --emit-relocs code with FIXME.
3669
a1373b60
AM
36702012-08-30 Alan Modra <amodra@gmail.com>
3671
3672 * layout.cc (Layout::set_segment_offsets): Set p_align to
3673 abi_pagesize, not common_pagesize.
3674 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3675 to determine whether file header can go in segment.
3676
703d02da
AM
36772012-08-30 Alan Modra <amodra@gmail.com>
3678
3679 * output.h (Output_reloc::Output_reloc <output section>): Add
3680 is_relative param. Adjust calls.
3681 (Output_reloc::add_output_section_relative): New functions.
3682 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3683 is_relative.
3684 (Output_reloc::symbol_value): Handle SECTION_CODE.
3685
16164a6b
ST
36862012-08-24 Sriraman Tallam <tmsriram@google.com>
3687
3688 * gold.cc (queue_middle_tasks): Call layout again when unique
3689 segments for sections is desired.
3690 * layout.cc (Layout::Layout): Initialize new members.
3691 (Layout::get_output_section_flags): New function.
3692 (Layout::choose_output_section): Call get_output_section_flags.
3693 (Layout::layout): Make output section for mapping to a unique segment.
3694 (Layout::insert_section_segment_map): New function.
3695 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3696 output sections marked so.
16164a6b
ST
3697 (Layout::segment_precedes): Check for unique segments when sorting.
3698 * layout.h (Layout::Unique_segment_info): New struct.
3699 (Layout::Section_segment_map): New typedef.
3700 (Layout::insert_section_segment_map): New function.
3701 (Layout::get_output_section_flags): New function.
3702 (Layout::is_unique_segment_for_sections_specified): New function.
3703 (Layout::set_unique_segment_for_sections_specified): New function.
3704 (Layout::unique_segment_for_sections_specified_): New member.
3705 (Layout::section_segment_map_): New member.
3706 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3707 Rename is_gc_pass_one to is_pass_one.
3708 Rename is_gc_pass_two to is_pass_two.
3709 Rename is_gc_or_icf to is_two_pass.
3710 Check for which pass based on whether symbols data is present.
3711 Make it two pass when unique segments for sections is desired.
3712 * output.cc (Output_section::Output_section): Initialize new
3713 members.
3714 * output.h (Output_section::is_unique_segment): New function.
3715 (Output_section::set_is_unique_segment): New function.
3716 (Output_section::is_unique_segment_): New member.
3717 (Output_section::extra_segment_flags): New function.
3718 (Output_section::set_extra_segment_flags): New function.
3719 (Output_section::extra_segment_flags_): New member.
3720 (Output_section::segment_alignment): New function.
3721 (Output_section::set_segment_alignment): New function.
3722 (Output_section::segment_alignment_): New member.
3723 (Output_segment::Output_segment): Initialize is_unique_segment_.
3724 (Output_segment::is_unique_segment): New function.
3725 (Output_segment::set_is_unique_segment): New function.
3726 (Output_segment::is_unique_segment_): New member.
3727 * plugin.cc (allow_unique_segment_for_sections): New function.
3728 (unique_segment_for_sections): New function.
3729 (Plugin::load): Add new functions to transfer vector.
3730 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3731 * Makefile.in: Regenerate.
3732 * testsuite/plugin_final_layout.sh: Check if unique segment
3733 functionality works.
3734 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3735 are available.
3736 (allow_unique_segment_for_sections): New global.
3737 (unique_segment_for_sections): New global.
3738 (claim_file_hook): Call allow_unique_segment_for_sections.
3739 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3740
1e2bee4f
CC
37412012-08-22 Cary Coutant <ccoutant@google.com>
3742
3743 * layout.cc (Layout::include_section): Don't assert on GROUP
3744 sections with --emit-relocs.
3745
1d5dfe78
CC
37462012-08-21 Cary Coutant <ccoutant@google.com>
3747
3748 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3749 if --export-dynamic-symbol names an undef symbol.
3750
c9269dff
AM
37512012-08-18 Alan Modra <amodra@gmail.com>
3752
3753 * powerpc.cc: Formatting and white space.
3754 (Powerpc_relobj): Rename got2_section_ to special_.
3755 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3756 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3757 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3758 (Target_powerpc): Add Address typedef and invalid_address. Use
3759 throughout.
3760 (Target_powerpc::is_branch_reloc): New function.
3761 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3762 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3763 for dst_mask, value and addend.
3764 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3765 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3766 (Output_data_glink::do_write): Correct toc base. Don't try to use
3767 uint16_t for 24-bit offset. Use get_output_section_offset and
3768 check return.
3769 (Target_powerpc::Scan::local): Handle more relocs.
3770 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3771 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3772 Plug in toc restoring insn after plt calls. Translate branches
3773 to function descriptor symbols to corresponding entry point.
3774 (Target_powerpc::relocate_for_relocatable): Check return from
3775 get_output_section_offset.
3776 * symtab.h: Comment typo.
3777
b1759dce
ILT
37782012-08-14 Ian Lance Taylor <iant@google.com>
3779
3780 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3781 unsupported_relocal_local to call unsupported_reloc_global.
3782
b9b2ae8b
NC
37832012-08-14 Nick Clifton <nickc@redhat.com>
3784
3785 PR ld/14265
3786 * script-sections.cc (Sections_element::output_section_name): Add
3787 keep return parameter.
3788 (Output_section_element::match_name): Add keep return parameter.
3789 Return the value of the keep_ member.
3790 * script-sections.h (class Output_section): Update
3791 output_section_name prototype.
3792 * layout.cc (Layout::keep_input_section): New public member
3793 function.
3794 (Layout::choose_output_section): Pass keep parameter to
3795 output_section_name.
3796 * layout.h (class Layout): Add keep_input_section.
3797 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3798 sections.
3799 * testsuite/Makefile.am: Add a test.
3800 * testsuite/Makefile.in: Regenerate.
3801 * testsuite/pr14265.c: Source file for the test.
3802 * testsuite/pr14265.t: Linker script for the test.
3803 * testsuite/pr14265.sh: Shell script for the test.
3804
921b5322
AM
38052012-08-14 Alan Modra <amodra@gmail.com>
3806
3807 * target.h (Target::output_section_name): New function.
3808 (Target::do_output_section_name): New function.
3809 * layout.cc (Layout::choose_output_section): Call the above.
3810 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3811
6ce78956
AM
38122012-08-14 Alan Modra <amodra@gmail.com>
3813
3814 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3815 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3816 for replace_constant call.
3817 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3818 (Output_data_glink::do_print_to_mapfile): New function.
3819 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3820 (Target_powerpc::Relocate::relocate): Likewise.
3821
d1a8cabd
AM
38222012-08-14 Alan Modra <amodra@gmail.com>
3823
3824 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3825 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3826 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3827 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3828 all references to shndx_. Handle special case for R_PPC_PLTREL24
3829 here.
3830 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3831 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3832 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3833 here.
3834 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3835 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3836
d83ce4e3
AM
38372012-08-12 Alan Modra <amodra@gmail.com>
3838
3839 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3840 (glink insn constants): Use uint32_t.
3841 (Output_data_glink::add_entry): Use insert, not [] operator.
3842
cf43a2fe
AM
38432012-08-11 Alan Modra <amodra@gmail.com>
3844
3845 * object.h (Sized_relobj_file::find_shdr): New function.
3846 (Sized_relobj_file::find_special_sections): New function.
3847 * object.cc (Sized_relobj_file::find_shdr): New function.
3848 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3849 (Sized_relobj_file::find_special_sections): New function, split out..
3850 (Sized_relobj_file::do_read_symbols): ..from here.
3851 * output.h (Output_data_got::replace_constant): New function.
3852 (Output_data_got::num_entries): New function.
3853 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3854 (Output_data_got::got_offset): Protected rather than private.
3855 (Output_data_got::replace_got_entry): New function.
3856 * output.cc (Output_data_got::replace_got_entry): New function.
3857 * powerpc.cc (class Powerpc_relobj): New.
3858 (class Powerpc_relocate_functions): Delete all psymval variants or
3859 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3860 Implement _ha functions using corresponding _hi function.
3861 (Powerpc_relobj::find_special_sections): New function.
3862 (Target_powerpc::do_make_elf_object): New function.
3863 (class Output_data_got_powerpc): New.
3864 (class Output_data_glink): New.
3865 (class Powerpc_scan_relocatable_reloc): New.
3866 Many more changes througout file.
3867
3c892704
NC
38682012-08-09 Nick Clifton <nickc@redhat.com>
3869
3870 * po/vi.po: Updated Vietnamese translation.
3871
82435b3b
ILT
38722012-08-07 Ian Lance Taylor <iant@google.com>
3873
3874 * layout.cc (Layout::add_target_dynamic_tags): If
3875 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3876 plt_rel.
3877
a6dc81d2
NC
38782012-07-30 Nick Clifton <nickc@redhat.com>
3879
3880 * po/gold.pot: Updated template.
3881 * po/es.po: Updated Spanish translation.
3882
f1415016
CC
38832012-07-18 Cary Coutant <ccoutant@google.com>
3884
3885 PR gold/14344
3886 * configure.ac: Add check for -gpubnames support.
3887 * configure: Regenerate.
3888 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3889 support; force -gno-pubnames.
3890 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3891 support.
3892 (gdb_index_test_4): New test.
3893 * testsuite/Makefile.in: Regenerate.
3894 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3895 * testsuite/gdb_index_test_2.sh: Likewise.
3896 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3897 * testsuite/gdb_index_test_4.sh: New script.
3898 * testsuite/gdb_index_test_comm.sh: New script with common code;
3899 don't look for space after colon.
3900
b7fd7c37
ST
39012012-07-16 Sriraman Tallam <tmsriram@google.com>
3902
3903 * gold.cc (queue_middle_tasks): Update function order only after
3904 deferred objects due to plugins are processed.
3905
1f3212db
ILT
39062012-07-11 Ian Lance Taylor <iant@google.com>
3907
3908 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3909 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3910 (Target_arm::scan_reloc_for_stub): Likewise.
3911 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3912 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3913 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3914 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3915 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3916
81c82a68
ILT
39172012-07-10 Dodji Seketeli <dodji@redhat.com>
3918 Ian Lance Taylor <iant@google.com>
3919
3920 PR gold/14309
3921 * configure.ac: Test whether std::tr1::hash<off_t> works.
3922 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3923 needed.
3924 * output.h (class Output_fill): Add virtual destructor.
3925 * configure, config.in: Rebuild.
3926
eabc84f4
RM
39272012-06-22 Roland McGrath <mcgrathr@google.com>
3928
3929 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3930
370e30b6
RÁE
39312012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3932
3933 * plugin.cc (Plugin::load): Handle position independent executables.
3934
fb1b895d
CC
39352012-06-06 Cary Coutant <ccoutant@google.com>
3936
3937 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3938 add .debug_macro.
3939 (lines_only_debug_sections): Likewise.
3940 (gdb_fast_lookup_sections): New static array.
3941 (is_gdb_debug_section): Rename formal parameter.
3942 (is_lines_only_debug_section): Likewise.
3943 (is_gdb_fast_lookup_section): New function.
3944 (Layout::include_section): Check for ".zdebug_" prefix; pass
3945 section name suffix to is_gdb_debug_section, et al.; check for
3946 fast-lookup sections when building .gdb_index.
3947 * options.h (--strip-debug-gdb): Update GDB version number.
3948
7c0640fa
CC
39492012-06-06 Cary Coutant <ccoutant@google.com>
3950
3951 * configure.ac: Add check for fallocate.
3952 * configure: Regenerate.
3953 * config.in: Regenerate.
3954
3955 * options.h (class General_options): Add --mmap-output-file and
3956 --posix-fallocate options.
3957 * output.cc: (posix_fallocate): Remove; replace with...
3958 (gold_fallocate): New function.
3959 (Output_file::map_no_anonymous): Call gold_fallocate.
3960 (Output_file::map): Check --mmap-output-file option.
3961
2a49eb69
DK
39622012-06-05 Jing Yu <jingyu@google.com>
3963
3964 * gold.h (textdomain): Add do {} to empty while(0).
3965 (bindtextdomain): Likewise.
3966
fad072ac
CC
39672012-06-04 Cary Coutant <ccoutant@google.com>
3968
3969 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3970 has_dynsym_index.
3971
8cc69fb6
ST
39722012-05-25 Sriraman Tallam <tmsriram@google.com>
3973
3974 * symtab.cc (Symbol_table::define_special_symbol):
3975 Initialize *poldsym to prevent uninitialized variable errors.
3976
1be75daa
CC
39772012-05-23 Cary Coutant <ccoutant@google.com>
3978
3979 * layout.cc (Layout::section_name_mapping): Add rules to handle
3980 exact match on .data.rel.ro.local or .data.rel.ro.
3981 (Layout::output_section_name): Check for exact matches.
3982
9b689de0
CC
39832012-05-23 Cary Coutant <ccoutant@google.com>
3984
3985 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3986 more carefully.
3987
b24fdbf5
CC
39882012-05-22 Cary Coutant <ccoutant@google.com>
3989
3990 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3991 object before exporting symbol.
3992
e550e1a2
L
39932012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3994
3995 * testsuite/tls_test.cc: Include "config.h" first.
3996 * testsuite/tls_test_c.c: Likewise.
3997
df7b86aa
NC
39982012-05-17 Daniel Richard G. <skunk@iskunk.org>
3999 Nick Clifton <nickc@redhat.com>
4000
4001 PR 14072
4002 * configure.in: Add check that sysdep.h has been included before
4003 any system header files.
4004 * configure: Regenerate.
4005 * config.in: Regenerate.
4006
1007b503
CC
40072012-05-14 Cary Coutant <ccoutant@google.com>
4008
4009 * layout.cc (Layout::make_output_section): Mark .tdata section
4010 as RELRO.
4011 * testsuite/relro_test.cc: Add a TLS variable.
4012
fd885f3a
L
40132012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4014
4015 PR gold/14091
4016 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4017 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4018 R_X86_64_64.
4019
80f5885c
CC
40202012-05-08 Cary Coutant <ccoutant@google.com>
4021
4022 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4023 (lines_only_debug_sections): Likewise.
4024
2e702c99
RM
40252012-05-02 Roland McGrath <mcgrathr@google.com>
4026
4027 * nacl.cc: New file.
4028 * nacl.h: New file.
4029 * Makefile.am (CCFILES, HFILES): Add them.
4030 * Makefile.in: Regenerate.
4031 * i386.cc (Output_data_plt_i386_nacl): New class.
4032 (Output_data_plt_i386_nacl_exec): New class.
4033 (Output_data_plt_i386_nacl_dyn): New class.
4034 (Target_i386_nacl): New class.
4035 (Target_selector_i386_nacl): New class.
4036 (target_selector_i386): Use it instead of Target_selector_i386.
4037 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4038 (Target_x86_64_nacl): New class.
4039 (Target_selector_x86_64_nacl): New class.
4040 (target_selector_x86_64, target_selector_x32): Use it instead of
4041 Target_selector_x86_64.
4042 * arm.cc (Output_data_plt_arm_nacl): New class.
4043 (Target_arm_nacl): New class.
4044 (Target_selector_arm_nacl): New class.
4045 (target_selector_arm, target_selector_armbe): Use it instead of
4046 Target_selector_arm.
4047
4048 * target-select.cc (select_target): Take new Input_file* and off_t
4049 arguments, pass them on to recognize method of selector.
4050 * object.cc (make_elf_sized_object): Update caller.
4051 * parameters.cc (parameters_force_valid_target): Likewise.
4052 * incremental.cc (make_sized_incremental_binary): Likewise.
4053 * target-select.h: Update decl.
4054 (Target_selector::recognize): Take new Input_file* argument,
4055 pass it on to do_recognize.
4056 (Target_selector::do_recognize): Take new Input_file* argument.
4057 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4058 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4059 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4060 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4061
4062 * target.h (Target::Target_info): New members isolate_execinstr
4063 and rosegment_gap.
4064 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4065 * arm.cc (Target_arm::arm_info): Update initializer.
4066 * i386.cc (Target_i386::i386_info): Likewise.
4067 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4068 * sparc.cc (Target_sparc::sparc_info): Likewise.
4069 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4070 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4071 * layout.cc (Layout::attach_allocated_section_to_segment):
4072 Take new const Target* argument. If target->isolate_execinstr(), act
4073 like --rosegment.
4074 (Layout::find_first_load_seg): Take new const Target* argument;
4075 if target->isolate_execinstr(), reject PF_X segments.
4076 (Layout::relaxation_loop_body): Update caller.
4077 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4078 reset file offset to zero when we hit LOAD_SEG, and then do a second
4079 loop over the segments before LOAD_SEG to reassign offsets after
4080 addresses have been determined. Handle target->rosegment_gap().
4081 (Layout::attach_section_to_segment): Take new const Target* argument;
4082 pass it to attach_allocated_section_to_segment.
4083 (Layout::make_output_section): Update caller.
4084 (Layout::attach_sections_to_segments): Take new const Target* argument;
4085 pass it to attach_section_to_segment.
4086 * gold.cc (queue_middle_tasks): Update caller.
4087 * layout.h (Layout): Update method decls with new arguments.
4088
4089 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4090 Target_info pointer to use.
4091 (Target_arm::do_make_data_plt): New virtual method.
4092 (Target_arm::make_data_plt): New method that calls it.
4093 (Target_arm::make_plt_entry): Use it.
4094 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4095 for the section alignment.
4096 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4097 method.
4098 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4099 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4100 method.
4101 (Output_data_plt_arm::get_plt_entry_size): Call it.
4102 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4103 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4104 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4105 method.
4106 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4107 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4108 method instead of sizeof(plt_entry).
4109 (Output_data_plt_arm::add_entry): Likewise.
4110 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4111 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4112 than static method.
4113 (Target_arm::plt_entry_size): Likewise.
4114 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4115 Move to ...
4116 (Output_data_plt_arm_standard): ... here, new class.
4117 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4118 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4119 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4120
4121 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4122 Take additional argument for the PLT entry size.
4123 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4124 Use get_plt_entry_size method rather than plt_entry_size variable.
4125 (Output_data_plt_x86_64::reserve_slot): Likewise.
4126 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4127 (Output_data_plt_x86_64::add_entry): Likewise.
4128 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4129 (Output_data_plt_x86_64::address_for_global): Likewise.
4130 (Output_data_plt_x86_64::address_for_local): Likewise.
4131 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4132 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4133 Make method non-static.
4134 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4135 method.
4136 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4137 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4138 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4139 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4140 virtual method.
4141 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4142 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4143 virtual method.
4144 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4145 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4146 virtual method.
4147 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4148 (Output_data_plt_x86_64::plt_entry_size)
4149 (Output_data_plt_x86_64::first_plt_entry)
4150 (Output_data_plt_x86_64::plt_entry)
4151 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4152 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4153 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4154 (Output_data_plt_x86_64_standard): ... here, new class.
4155 (Target_x86_64::Target_x86_64): Take optional argument for the
4156 Target_info pointer to use.
4157 (Target_x86_64::do_make_data_plt): New virtual method.
4158 (Target_x86_64::make_data_plt): New method to call it.
4159 (Target_x86_64::init_got_plt_for_update): Use that.
4160 Call this->plt_->add_eh_frame method here.
4161 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4162 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4163 rather than static method.
4164 (Target_x86_64::plt_entry_size): Likewise.
4165 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4166 rather than plt_entry_size variable. Move guts of PLT filling to...
4167 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4168 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4169 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4170
4171 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4172 additional argument for the section alignment.
4173 Don't do add_eh_frame_for_plt here.
4174 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4175 non-static. Use get_plt_entry_size method rather than plt_entry_size
4176 variable.
4177 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4178 method.
4179 (Output_data_plt_i386::get_plt_entry_size): Call it.
4180 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4181 (Output_data_plt_i386::add_eh_frame): New method to call it.
4182 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4183 method.
4184 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4185 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4186 method.
4187 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4188 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4189 method instead of plt_entry_size.
4190 (Output_data_plt_i386::plt_entry_size)
4191 (Output_data_plt_i386::plt_eh_frame_fde_size)
4192 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4193 (Output_data_plt_i386_standard): ... here, new class.
4194 (Output_data_plt_i386_exec): New class.
4195 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4196 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4197 (Output_data_plt_i386::exec_plt_entry): Move to ...
4198 (Output_data_plt_i386_exec::plt_entry): ... here.
4199 (Output_data_plt_i386_dyn): New class.
4200 (Output_data_plt_i386::first_plt_entry): Move to ...
4201 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4202 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4203 (Output_data_plt_i386_dyn::plt_entry): ... here.
4204 (Target_i386::Target_i386): Take optional argument for the Target_info
4205 pointer to use.
4206 (Target_i386::do_make_data_plt): New virtual method.
4207 (Target_i386::make_data_plt): New method to call it.
4208 (Target_i386::make_plt_section): Use that.
4209 Call this->plt_->add_eh_frame method here.
4210 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4211 rather than plt_entry_size variable.
4212 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4213 (Output_data_plt_i386::address_for_local): Likewise.
4214 (Output_data_plt_i386::do_write): Likewise.
4215 Move guts of PLT filling to...
4216 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4217 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4218 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4219 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4220
b9b9f2ee
CC
42212012-05-01 Cary Coutant <ccoutant@google.com>
4222
4223 * dwarf_reader.cc (Dwarf_die::read_attributes)
4224 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4225 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4226 * reduced_debug_output.cc
4227 (Output_reduced_debug_info_section::get_die_end): Remove
4228 DW_FORM_GNU_ref_index. Add default case.
4229
57923f48
MW
42302012-04-26 Mark Wielaard <mjw@redhat.com>
4231
4232 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4233 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4234 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4235 DW_AT_high_pc as offset from DW_AT_low_pc.
4236
4237 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4238 * testsuite/Makefile.in: Regenerate.
4239 * testsuite/gdb_index_test_3.c: New test source file.
4240 * testsuite/gdb_index_test_3.sh: New test source file.
4241
2c54b4f4
ILT
42422012-04-25 Ian Lance Taylor <iant@google.com>
4243
4244 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4245 pointer.
4246 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4247 as a class, not a struct.
4248 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4249 (Target_arm::apply_cortex_a8_workaround): Likewise.
4250 * gc.h: Declare Reloc_types as a struct, not a class.
4251 * object.h: Declare Symbols_data as a struct.
4252 * reloc.h: Declare Read_relocs_data as a struct.
4253 * target.h: Declare Relocate_info as a struct.
4254
a5a5f7a3
DM
42552012-04-24 David S. Miller <davem@davemloft.net>
4256
4257 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4258 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4259 and R_SPARC_WPLT30.
4260
f038d496
CC
42612012-04-24 Cary Coutant <ccoutant@google.com>
4262
4263 * incremental-dump.cc (find_input_containing_global): Replace
4264 magic number with symbolic constant.
4265 (dump_incremental_inputs): Update version number.
4266 * incremental.cc (Output_section_incremental_inputs): Update version
4267 number; import symbolic constants from Incremental_inputs_reader.
4268 (Incremental_inputs::create_data_sections): Align relocations
4269 section correctly for 64-bit targets.
4270 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4271 constants; add padding.
4272 (Output_section_incremental_inputs::write_header): Add assert for
4273 header_size.
4274 (Output_section_incremental_inputs::write_input_files): Add assert
4275 for input_entry_size.
4276 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4277 add assert for object_info_size, input_section_entry_size,
4278 global_sym_entry_size.
4279 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4280 for data structure sizes; use them.
4281 (Incremental_input_entry_reader): Import symbolic constants from
4282 Incremental_inputs_reader; use them.
4283
a4d85145
DM
42842012-04-23 David S. Miller <davem@davemloft.net>
4285
4286 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4287 and elf_flags_set_.
4288 (Target_sparc::Target_sparc): Initialize new fields.
4289 (Target_sparc::do_make_elf_object): New function.
4290 (Target_sparc::do_adjust_elf_header): New function.
4291
1d509098
CC
42922012-04-23 Cary Coutant <ccoutant@google.com>
4293
4294 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4295 CU range table of gdb index.
4296
7ebeff7f
DM
42972012-04-20 David S. Miller <davem@davemloft.net>
4298
4299 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4300 instead of false.
4301
13cf9988
DM
43022012-04-16 David S. Miller <davem@davemloft.net>
4303
2a1079e8
DM
4304 * sparc.cc (Target_sparc::got_address): New function.
4305 (Sparc_relocate_functions::gdop_hix22): New function.
4306 (Sparc_relocate_functions::gdop_lox10): New function.
4307 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4308 relocs.
4309 (Target_sparc::Scan::local): Likewise if the global symbol is not
4310 preemptible and is not IFUNC.
4311 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4312 transformations for local and non-preemptible non-IFUNC global
4313 symbols.
4314
0bc964fc
DM
4315 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4316 writing out 64-bit part of ranges.
4317
661d7a80
DM
4318 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4319 -fpic and -fpie respectively.
4320 * Makefile.in: Regenerate.
4321
8c2bf391
DM
4322 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4323 (Target_sparc::Target_sparc): Initialize new field.
4324 (Target_sparc::do_plt_section_for_global): New function.
4325 (Target_sparc::do_plt_section_for_local): New function.
4326 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4327 (Target_sparc::make_plt_section): New function, broken out of
4328 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4329 (Target_sparc::make_plt_entry): Call make_plt_section.
4330 (Target_sparc::make_local_ifunc_plt_entry): New function.
4331 (Target_sparc::rela_ifunc_section): New function.
4332 (Target_sparc::plt_section): Remove const.
4333 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4334 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4335 and ifunc_count_ fields.
4336 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4337 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4338 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4339 (Output_data_plt_sparc::rela_ifunc): New function.
4340 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4341 (Output_data_plt_sparc::has_ifunc_section): New function.
4342 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4343 (Output_data_plt_sparc::address_for_global): New function.
4344 (Output_data_plt_sparc::address_for_local): New function.
4345 (Output_data_plt_sparc::plt_index_to_offset): New function.
4346 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4347 and entry_count.
4348 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4349 entry_count.
4350 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4351 R_SPARC_JMP_IREL to switch.
4352 (Target_sparc::Scan::check_non_pic): Likewise.
4353 (Target_sparc::Scan::local): Handle IFUNC symbols.
4354 (Target_sparc::Scan::local): Likewise.
4355 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4356 and plt_address_for_local.
4357 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4358 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4359
13cf9988
DM
4360 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4361 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4362 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4363 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4364 global relocs too.
4365 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4366 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4367 calls.
4368 * sparc.cc (Target_sparc::Scan::global): Likewise.
4369 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4370
31821be0
CC
43712012-04-16 Cary Coutant <ccoutant@google.com>
4372
4373 * archive.cc (Library_base::should_include_member): Check for
4374 --export-dynamic-symbol.
4375 * options.h (class General_options): Add --export-dynamic-symbol.
4376 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4377 --export-dynamic-symbol.
4378 (Symbol_table::gc_mark_undef_symbols): Likewise.
4379 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4380
2615994e
DM
43812012-04-12 David S. Miller <davem@davemloft.net>
4382
4383 * sparc.cc (Reloc::wdisp10): New relocation method.
4384 (Reloc::h34): Likewise.
4385 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4386 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4387 R_SPARC_WDISP10.
4388 (Target_sparc::Scan::local): Likewise.
4389 (Target_sparc::Scan::global): Likewise.
4390 (Target_sparc::Relocate::relocate): Likewise.
4391
6782735d
CC
43922012-04-09 Cary Coutant <ccoutant@google.com>
4393
4394 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4395 low_pc == 0.
4396
8c7a0b00
ILT
43972012-04-06 Ian Lance Taylor <iant@google.com>
4398
4399 * timer.cc: #include <unistd.h>.
4400
58797674
RM
44012012-04-06 Roland McGrath <mcgrathr@google.com>
4402
4403 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4404 * config.in: Regenerate.
4405 * configure: Regenerate.
4406
44350750
NC
44072012-04-05 Nick Clifton <nickc@redhat.com>
4408
4409 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4410 (AM_LC_MESSAGES): Add.
4411 * aclocal.m4: Regenerate.
4412 * config.in: Regenerate.
4413 * configure: Regenerate.
4414
c1027032
CC
44152012-03-21 Cary Coutant <ccoutant@google.com>
4416
4417 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4418 * Makefile.in: Regenerate.
4419 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4420 (Sized_elf_reloc_mapper::symbol_section): New function.
4421 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4422 (make_elf_reloc_mapper): New function.
4423 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4424 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4425 (Dwarf_abbrev_table::do_get_abbrev): New function.
4426 (Dwarf_ranges_table::read_ranges_table): New function.
4427 (Dwarf_ranges_table::read_range_list): New function.
4428 (Dwarf_pubnames_table::read_section): New function.
4429 (Dwarf_pubnames_table::read_header): New function.
4430 (Dwarf_pubnames_table::next_name): New function.
4431 (Dwarf_die::Dwarf_die): New function.
4432 (Dwarf_die::read_attributes): New function.
4433 (Dwarf_die::skip_attributes): New function.
4434 (Dwarf_die::set_name): New function.
4435 (Dwarf_die::set_linkage_name): New function.
4436 (Dwarf_die::attribute): New function.
4437 (Dwarf_die::string_attribute): New function.
4438 (Dwarf_die::int_attribute): New function.
4439 (Dwarf_die::uint_attribute): New function.
4440 (Dwarf_die::ref_attribute): New function.
4441 (Dwarf_die::child_offset): New function.
4442 (Dwarf_die::sibling_offset): New function.
4443 (Dwarf_info_reader::check_buffer): New function.
4444 (Dwarf_info_reader::parse): New function.
4445 (Dwarf_info_reader::do_parse): New function.
4446 (Dwarf_info_reader::do_read_string_table): New function.
4447 (Dwarf_info_reader::lookup_reloc): New function.
4448 (Dwarf_info_reader::get_string): New function.
4449 (Dwarf_info_reader::visit_compilation_unit): New function.
4450 (Dwarf_info_reader::visit_type_unit): New function.
4451 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4452 Sized_elf_reloc_mapper.
4453 (Sized_dwarf_line_info::symbol_section): Remove function.
4454 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4455 (Sized_dwarf_line_info::read_line_mappings): Remove object
4456 parameter, adjust callers.
4457 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4458 * dwarf_reader.h: Include <sys/types.h>.
4459 (class Track_relocs): Remove forward declaration.
4460 (class Elf_reloc_mapper): New class.
4461 (class Sized_elf_reloc_mapper): New class.
4462 (class Dwarf_abbrev_table): New class.
4463 (class Dwarf_range_list): New class.
4464 (class Dwarf_ranges_table): New class.
4465 (class Dwarf_pubnames_table): New class.
4466 (class Dwarf_die): New class.
4467 (class Dwarf_info_reader): New class.
4468 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4469 (Sized_dwarf_line_info::symbol_section): Remove member function.
4470 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4471 base class.
4472 * gdb-index.cc: New source file.
4473 * gdb-index.h: New source file.
4474 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4475 and .debug_types sections, call Layout::add_to_gdb_index.
4476 (Sized_relobj_incr::do_section_name): Implement.
4477 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4478 return type; Implement.
4479 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4480 return type.
4481 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4482 parameter list and return type.
4483 (Sized_incr_dynobj::do_section_contents): Likewise.
4484 * layout.cc: Include gdb-index.h.
4485 (Layout::Layout): Initialize gdb_index_data_.
4486 (Layout::init_fixed_output_section): Check for .gdb_index section.
4487 (Layout::add_to_gdb_index): New function. Instantiate.
4488 * layout.h: Add forward declaration for class Gdb_index.
4489 (Layout::add_to_gdb_index): New member function.
4490 (Layout::gdb_index_data_): New data member.
4491 * main.cc: Include gdb-index.h.
4492 (main): Print statistics for gdb index.
4493 * object.cc (Object::section_contents): Move code into
4494 do_section_contents.
4495 (need_decompressed_section): Check for sections needed when building
4496 gdb index.
4497 (build_compressed_section_map): Likewise.
4498 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4499 gdb index.
4500 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4501 sections; call Layout::add_to_gdb_index.
4502 (Sized_relobj_file::do_decompressed_section_contents): Call
4503 do_section_contents directly.
4504 * object.h (Object::do_section_contents): Adjust parameter list and
4505 return type.
4506 (Object::do_decompressed_section_contents): Call do_section_contents
4507 directly.
4508 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4509 return type.
4510 * options.h (class General_options): Add --gdb-index option.
4511 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4512 list and return type.
4513 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4514 * reloc.h (Track_relocs::checkpoint): New function.
4515 (Track_relocs::reset): New function.
4516
4517 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4518 New test cases.
4519 * testsuite/Makefile.in: Regenerate.
4520 * testsuite/gdb_index_test.cc: New test source file.
4521 * testsuite/gdb_index_test_1.sh: New test source file.
4522 * testsuite/gdb_index_test_2.sh: New test source file.
4523
647f1574
DK
45242012-03-19 Doug Kwan <dougkwan@google.com>
4525
4526 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4527 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4528 __exidx_start and __exidx_end. Make symbol table parameter
4529 anonymous as it is not used.
4530 * gold.cc (queue_middle_tasks): Call target hook to define any
4531 target-specific symbols.
4532 * target.h (Target::define_standard_symbols): New method.
4533 (Target::do_define_standard_symbols): Same.
4534 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4535 * testsuite/Makefile.in: Regenerate.
4536 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4537 and __exidx_end.
4538 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4539 relocations are generated for __exidx_start and __exidx_end.
4540
7c6109da
DK
45412012-03-16 Doug Kwan <dougkwan@google.com>
4542
4543 * testsuite/Makefile.am: Disable test initpri3b.
4544 * testsuite/Makefile.in: Regenerate.
4545
7b8957f8
DK
45462012-03-15 Doug Kwan <dougkwan@google.com>
4547
4548 * arm.cc (Target_arm::got_section): Make .got section read-only
4549 if -z now is given.
4550
14dc9ef7
ILT
45512012-03-15 Ian Lance Taylor <iant@google.com>
4552
4553 PR gold/13850
4554 * layout.cc (Layout::make_output_section): Correctly mark
4555 SHT_INIT_ARRAY, et. al., as relro.
4556
fa40b62a
DK
45572012-03-14 Doug Kwan <dougkwan@google.com>
4558
4559 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4560 dynamic relocations for protected symbols in shared objects.
4561
fd325007
ILT
45622012-03-13 Ian Lance Taylor <iant@google.com>
4563
4564 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4565 keep the larger alignment.
4566
e8dd54e1
CC
45672012-03-12 Cary Coutant <ccoutant@google.com>
4568
4569 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4570 handling of DW_LNE_define_file.
4571
feb5f3b0
CC
45722012-03-12 Cary Coutant <ccoutant@google.com>
4573
4574 * reduced_debug_output.cc
4575 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4576 codes to switch.
4577
a1fb4256
CC
45782012-02-29 Cary Coutant <ccoutant@google.com>
4579
4580 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4581
5dd8762a
CC
45822012-02-29 Cary Coutant <ccoutant@google.com>
4583
4584 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4585 Call Object::decompressed_section_contents.
4586 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4587 New dtor.
4588 (Sized_dwarf_line_info::buffer_start_): New data member.
4589 * merge.cc (Output_merge_data::do_add_input_section): Call
4590 Object::decompressed_section_contents.
4591 (Output_merge_string::do_add_input_section): Likewise.
4592 * object.cc (need_decompressed_section): New function.
4593 (build_compressed_section_map): Decompress sections needed later.
4594 (Sized_relobj_file::do_decompressed_section_contents): New function.
4595 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4596 * object.h (Object::decompressed_section_contents): New function.
4597 (Object::discard_decompressed_sections): New function.
4598 (Object::do_decompressed_section_contents): New function.
4599 (Object::do_discard_decompressed_sections): New function.
4600 (Compressed_section_info): New type.
4601 (Compressed_section_map): Include decompressed section contents.
4602 (Sized_relobj_file::do_decompressed_section_contents): New function.
4603 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4604
7b5de7ee
CC
46052012-02-16 Cary Coutant <ccoutant@google.com>
4606
4607 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4608 * testsuite/Makefile.in: Regenerate.
4609
f9fa4a63
CC
46102012-02-14 Cary Coutant <ccoutant@google.com>
4611
4612 * options.cc (General_options::finalize): Disallow -pie and -static.
4613
2c175ebc
DK
46142012-02-03 Doug Kwan <dougkwan@google.com>
4615
4616 * arm.cc (Arm_relocate_functions::abs8,
4617 Arm_relocate_functions::abs16): Use
4618 Bits::has_signed_unsigned_overflow32.
4619 (Arm_relocate_functions::thm_abs8): Correct range of
4620 overflow check.
4621 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4622 in assertions.
4623
90cff06f
DK
46242012-02-02 Doug Kwan <dougkwan@google.com>
4625
4626 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4627 position independent outputs, not just shared objects.
4628
63887f3d
L
46292012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4630
4631 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4632 * configure: Regenerated.
4633
bef2b434
ILT
46342012-01-27 Ian Lance Taylor <iant@google.com>
4635
4636 * reloc.h (Bits): New class with static functions, copied from
4637 namespace utils in arm.cc.
4638 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4639 instead.
4640
c335b55d
L
46412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4642
4643 * incremental.cc (write_info_blocks): Correct relocation offset.
4644
41194d9f
L
46452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4646
4647 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4648 (Relocate::tls_gd_to_le): Likewise.
4649
1bae613c
L
46502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4651
4652 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4653
24482ca0
L
46542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4655
4656 * configure.ac: Check if -mcmodel=medium works.
4657 * configure: Regenerated.
4658
c2c7840a
CC
46592012-01-24 Cary Coutant <ccoutant@google.com>
4660
4661 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4662 definition and ...
4663 (read_unsigned_LEB_128_x): ... this new function.
4664 (read_signed_LEB_128): Replaced with inline definition and ...
4665 (read_signed_LEB_128_x): ... this new function.
4666 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4667 (read_unsigned_LEB_128): Add inline definition.
4668 (read_signed_LEB_128_x): New function.
4669 (read_signed_LEB_128): Add inline definition.
4670 * testsuite/Makefile.am (leb128_unittest): New unit test.
4671 * testsuite/Makefile.in: Regenerate.
4672 * testsuite/leb128_unittest.cc: New unit test.
4673
833de760 46742012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4675
4676 PR gold/13617
4677 * i386.cc (Target_i386::do_code_fill): When using a jmp
4678 instruction, pad with nop instructions.
4679 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4680
618d6666
L
46812012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4682
4683 * x86_64.cc (gc_process_relocs): Add typename on types used in
4684 template.
4685 (scan_relocs): Likewise.
4686 (relocate_section): Likewise.
4687 (apply_relocation): Likewise.
4688
3660ff06
L
46892012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4690
4691 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4692 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4693 under x32.
4694
fc51264f
L
46952012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4696
4697 * x86_64.cc: Initial support for x32.
4698
dd74ae06
CC
46992012-01-03 Cary Coutant <ccoutant@google.com>
4700
4701 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4702 Use abstract base class for GOT.
4703 * gold/output.h (class Output_data_got_base): New abstract base class.
4704 (class Output_data_got): Derive from new base class, adjust ctors.
4705 (Output_data_got::reserve_slot): Make virtual; rename to
4706 do_reserve_slot; Adjust callers.
4707 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4708 pointer to abstract base class.
4709 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4710
83896202
ILT
47112011-12-18 Ian Lance Taylor <iant@google.com>
4712
4713 * object.h (Relobj::local_symbol_value): New function.
4714 (Relobj::local_plt_offset): New function.
4715 (Relobj::local_has_got_offset): New function.
4716 (Relobj::local_got_offset): New function.
4717 (Relobj::set_local_got_offset): New function.
4718 (Relobj::do_local_symbol_value): New pure virtual function.
4719 (Relobj::do_local_plt_offset): Likewise.
4720 (Relobj::do_local_has_got_offset): Likewise.
4721 (Relobj::do_local_got_offset): Likewise.
4722 (Relobj::do_set_local_got_offset): Likewise.
4723 (Sized_relobj::do_local_has_got_offset): Rename from
4724 local_has_got_offset.
4725 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4726 (Sized_relobj::do_set_local_got_offset): Rename from
4727 set_local_got_offset.
4728 (Sized_relobj_file::do_local_plt_offset): Rename from
4729 local_plt_offset.
4730 (Sized_relobj_file::do_local_symbol_value): New function.
4731 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4732 local_plt_offset.
4733 * output.cc (Output_data_got::Got_entry::write): Change object to
4734 Relobj. Use local_symbol_value.
4735 (Output_data_got::add_global_with_rel): Change rel_dyn to
4736 Output_data_reloc_generic*. Use add_global_generic.
4737 (Output_data_got::add_global_with_rela): Remove. Change all
4738 callers to use add_global_with_rel.
4739 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4740 Output_data_reloc_generic*. Use add_global_generic.
4741 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4742 callers to use add_global_pair_with_rel.
4743 (Output_data_got::add_local): Change object to Relobj*.
4744 (Output_data_got::add_local_plt): Likewise.
4745 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4746 change rel_dyn to Output_data_reloc_generic*. Use
4747 add_local_generic.
4748 (Output_data_got::add_local_with_rela): Remove. Change all
4749 callers to use all_local_with_rel.
4750 (Output_data_got::add_local_pair_with_rel): Change object to
4751 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4752 add_output_section_generic.
4753 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4754 callers to use add_local_pair_with_rel.
4755 (Output_data_got::reserve_local): Change object to Relobj*.
4756 * output.h: (class Output_data_reloc_generic): Add pure virtual
4757 declarations for add_global_generic, add_local_generic,
4758 add_output_section_generic.
4759 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4760 functions for Output_data_reloc_generic. Update declarations for
4761 changes listed in output.cc.
4762 (class Output_data_got): Change template parameter to got_size.
4763 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4764 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4765 function.
4766 (Sized_relobj_incr::do_local_plt_offset): New function.
4767 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4768 add_global_generic.
4769
76677ad0
CC
47702011-12-17 Cary Coutant <ccoutant@google.com>
4771
4772 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4773 * resolve.cc (Symbol_table::resolve): Likewise.
4774 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4775 arrays.
4776 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4777
8b8dd8d5
ILT
47782011-12-16 Ian Lance Taylor <iant@google.com>
4779
4780 * output.h (Output_data_reloc_generic::add): Only call
4781 add_dynamic_reloc if this is a dynamic reloc section.
4782
d55525b9
L
47832011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4784
4785 PR gold/13505
4786 * target-reloc.h (apply_relocation): Replace <64, false> with
4787 <size, big_endian>.
4788
ff81c7c1
NC
47892011-11-25 Nick Clifton <nickc@redhat.com>
4790
4791 * po/it.po: New Italian translation.
4792
628f39be
SA
47932011-11-17 Sterling Augustine <saugustine@google.com>
4794
4795 * script.cc (script_include_directive): Implement.
4796 (read_script_file): New local variables name and search_path. Update
4797 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4798 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4799 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4800
98ef3ea4
SA
48012011-11-11 Sterling Augustine <saugustine@google.com>
4802
4803 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4804 (file_or_sections_cmd): Likewise.
4805
f4a8b6d7
DK
48062011-11-11 Doug Kwan <dougkwan@google.com>
4807
4808 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4809 if --just-symbols is given.
4810
29ab395d
DK
48112011-11-10 Doug Kwan <dougkwan@google.com>
4812
4813 PR gold/13362
4814 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4815 when processing data relocs.
4816 * reloc.h (Relocate_functions::rel_unaligned): New method.
4817 (Relocate_functions::pcrel_unaligned): Ditto.
4818 (Relocate_functions::rel32_unaligned): Ditto.
4819 (Relocate_functions::pcrel32_unaligned): Ditto.
4820
2c339f71
DK
48212011-11-09 Doug Kwan <dougkwan@google.com>
4822
4823 PR gold/13362
4824 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4825 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4826 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4827 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4828 (Relocate_functions::rel_unaligned): New.
4829 (Relocate_functions::rel32_unaligned): New.
4830 * target-reloc.h (relocate_for_relocatable): Add code to handle
4831 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4832 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4833 arm_unaligned_reloc_r): New targets.
4834 * testsuite/Makefile.in: Regenerate.
4835 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4836 linking.
4837
3f3cddf1
ILT
48382011-11-02 Ian Lance Taylor <iant@google.com>
4839
4840 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4841 NATIVE_LINKER.
4842 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4843 * options.cc (General_options::finalize): Use library search path
4844 from configure script if specified. If not native and no sysroot,
4845 only search TOOLLIBDIR.
4846 * options.h (Search_directory::Search_directory): Change name to
4847 const std::string&.
4848 (General_options::add_to_library_path_with_sysroot): Change arg to
4849 const std::string&.
4850 * configure, Makefile.in, config.in: Rebuild.
4851
a8e2273b
ILT
48522011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4853
4854 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4855 we are working around the ARM1176 Erratum.
4856 * options.h (General_options::fix_arm1176): Add option.
4857 * testsuite/Makefile.am: Add testcases, and keep current ones
4858 working.
4859 * testsuite/Makefile.in: Regenerate.
4860 * testsuite/arm_fix_1176.s: New file.
4861 * testsuite/arm_fix_1176.sh: Likewise.
4862
cd6eab1c
ILT
48632011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4864
4865 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4866 may_use_blx_.
4867 (Target_arm::may_use_blx): Remove method.
4868 (Target_arm::set_may_use_blx): Likewise.
4869 (Target_arm::may_use_v4t_interworking): New method.
4870 (Target_arm::may_use_v5t_interworking): Likewise.
4871 (Target_arm::may_use_blx_): Remove member variable.
4872 (Arm_relocate_functions::arm_branch_common): Check for v5T
4873 interworking.
4874 (Arm_relocate_functions::thumb_branch_common): Likewise.
4875 (Reloc_stub::stub_type_for_reloc): Likewise.
4876 (Target_arm::do_finalize_sections): Correct interworking checks.
4877 * testsuite/Makefile.am: Add new tests.
4878 * testsuite/Makefile.in: Regenerate.
4879 * testsuite/arm_farcall_arm_arm.s: New test.
4880 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4881 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4882 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4883 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4884 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4885 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4886 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4887
286adcf4
CC
48882011-10-31 Cary Coutant <ccoutant@google.com>
4889
4890 PR gold/13023
4891 * expression.cc (Expression::eval_with_dot): Add
4892 is_section_dot_assignment parameter.
4893 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4894 absolute and assigning to dot within a section.
4895 * script-sections.cc
4896 (Output_section_element_assignment::set_section_addresses): Pass
4897 dot_section to set_if_absolute.
4898 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4899 as is_section_dot_assignment flag to eval_with_dot.
4900 (Output_section_element_dot_assignment::set_section_addresses):
4901 Likewise.
4902 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4903 parameter. Also set value if relative to dot_section; set the
4904 symbol's output_section.
4905 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4906 parameter. Adjust all callers.
4907 (Expression::eval_maybe_dot): Likewise.
4908 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4909 Adjust all callers.
4910 * testsuite/script_test_2.t: Test assignment of an absolute value
4911 to dot within an output section element.
4912
9634ed06
CC
49132011-10-31 Cary Coutant <ccoutant@google.com>
4914
4915 * options.h (class General_options): Add --[no-]gnu-unique options.
4916 * symtab.cc (Symbol_table::sized_write_globals): Convert
4917 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4918
de4101c7
CC
49192011-10-31 Cary Coutant <ccoutant@google.com>
4920
4921 PR gold/13359
4922 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4923 unnecessary assertion.
4924 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4925
7257cc92
ST
49262011-10-31 Sriraman Tallam <tmsriram@google.com>
4927
4928 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4929 gc_mark_symbol.
4930 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4931 gc_mark_symbol.
4932 Change to just keep the section associated with symbol.
4933 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4934 they are externally visible and --export-dynamic is turned on.
4935 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4936
bfc34b3f
ILT
49372011-10-19 Ian Lance Taylor <iant@google.com>
4938
4939 PR gold/13163
4940 * script-sections.cc
4941 (Output_section_element_dot_assignment::needs_output_section): New
4942 function.
4943
ea0d8c47
ILT
49442011-10-19 Ian Lance Taylor <iant@google.com>
4945
4946 PR gold/13204
4947 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4948 --section-start option was seen.
4949 * options.h (General_options::any_section_start): New function.
4950
abd242a9
DM
49512011-10-18 David S. Miller <davem@davemloft.net>
4952
4953 PR binutils/13301
4954 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4955 member to track relocation locations that have moved during TLS
4956 reloc optimizations.
4957 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4958 (Target_sparc::Relocate::relocate): Adjust view down by 4
4959 bytes if it matches reloc_adjust_addr_.
4960 (Target_sparc::Relocate::relocate_tls): Always move the
4961 __tls_get_addr call delay slot instruction forward 4 bytes when
4962 performing relaxation.
4963
bab9090f
CC
49642011-10-18 Cary Coutant <ccoutant@google.com>
4965
4966 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4967 (Output_file::map_no_anonymous): Check for non-zero
4968 return code from posix_fallocate.
4969
f7c5b166
CC
49702011-10-17 Cary Coutant <ccoutant@google.com>
4971
4972 PR gold/13245
4973 * plugin.cc (is_visible_from_outside): Check for symbols
4974 referenced from dynamic objects.
4975 * resolve.cc (Symbol_table::resolve): Don't count references
4976 from dynamic objects as references from real ELF files.
4977 * testsuite/plugin_test_2.sh: Adjust expected result.
4978
b490c0bb
CC
49792011-10-17 Cary Coutant <ccoutant@google.com>
4980
4981 * gold.cc: Include timer.h.
4982 (queue_middle_tasks): Stamp time.
4983 (queue_final_tasks): Likewise.
4984 * main.cc (main): Store timer in parameters. Print timers
4985 for each pass.
4986 * parameters.cc (Parameters::Parameters): Initialize timer_.
4987 (Parameters::set_timer): New function.
4988 (set_parameters_timer): New function.
4989 * parameters.h (Parameters::set_timer): New function.
4990 (Parameters::timer): New function.
4991 (Parameters::timer_): New data member.
4992 (set_parameters_timer): New function.
4993 * timer.cc (Timer::stamp): New function.
4994 (Timer::get_pass_time): New function.
4995 * timer.h (Timer::stamp): New function.
4996 (Timer::get_pass_time): New function.
4997 (Timer::pass_times_): New data member.
4998
f475cf7b
CC
49992011-10-17 Cary Coutant <ccoutant@google.com>
5000
5001 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5002 task for members of lib groups.
5003
cdd7e244
CC
50042011-10-17 Cary Coutant <ccoutant@google.com>
5005
5006 PR gold/13288
4f95c8b4 5007 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5008 (File_read::make_view): Move bounds check (replace with assert)...
5009 (File_read::find_or_make_view): ... to here.
5010
dfb45471
CC
50112011-10-12 Cary Coutant <ccoutant@google.com>
5012
4f95c8b4 5013 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5014 ::read returns less than requested size.
5015
53bbcc1b
CC
50162011-10-10 Cary Coutant <ccoutant@google.com>
5017
4f95c8b4 5018 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5019 Initialize defined_count_.
5020 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5021 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5022 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5023 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5024 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5025 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5026 member.
5027 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5028 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5029 Return zeroes instead of internal error.
5030
397b129b
CC
50312011-10-10 Cary Coutant <ccoutant@google.com>
5032
5033 PR gold/13249
4f95c8b4 5034 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5035 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5036 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5037 (Output_reloc::type_): Adjust size of bit field.
5038 (Output_reloc::use_plt_offset_): New bit field.
5039 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5040 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5041 flag. Adjust all callers.
4f95c8b4 5042 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5043 creating RELATIVE relocations.
5044
d5698657
NC
50452011-10-10 Nick Clifton <nickc@redhat.com>
5046
5047 * po/es.po: Updated Spanish translation.
5048 * po/fi.po: Updated Finnish translation.
5049
6a59a5c2
DN
50502011-10-03 Diego Novillo <dnovillo@google.com>
5051
5052 * options.cc (parse_uint): Fix dereference of RETVAL.
5053
f0558624
ST
50542011-09-29 Sriraman Tallam <tmsriram@google.com>
5055
5056 * layout.h (section_order_map_): New member.
5057 (get_section_order_map): New member function.
5058 * output.cc (Output_section::add_input_section): Check for patterns
5059 only when --section-ordering-file is specified.
5060 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5061 output_sections have been formed.
5062 * layout.cc (Layout_Layout): Initialize section_order_map_.
5063 * plugin.cc (update_section_order): Store order in order_map. Do not
5064 update the order.
5065 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5066 * testsuite/Makefile.in: Regenerate.
5067 * testsuite/plugin_section_order.c: New file.
5068 * testsuite/plugin_final_layout.cc: New file.
5069 * testsuite/plugin_final_layout.sh: New file.
5070
a7dac153
CC
50712011-09-29 Cary Coutant <ccoutant@google.com>
5072
4f95c8b4 5073 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5074 Check for NULL.
4f95c8b4 5075 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5076 symbols during incremental update.
5077 (Symbol_table::add_from_dynobj): Likewise.
5078
eebd87a5
ILT
50792011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5080 Ian Lance Taylor <iant@google.com>
5081
5082 * symtab.cc (Symbol_table::define_special_symbol): Always
5083 canonicalize version string.
5084
403a3331
CC
50852011-09-26 Cary Coutant <ccoutant@google.com>
5086
4f95c8b4
CC
5087 * gold.cc (queue_initial_tasks): Move option checks ...
5088 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5089 some options; make others fatal.
5090
235061c2
CC
50912011-09-26 Cary Coutant <ccoutant@google.com>
5092
5093 gcc PR lto/47247
5094 * plugin.cc (get_symbols_v2): New function.
5095 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5096 (is_referenced_from_outside): New function.
5097 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5098 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5099 (get_symbols): Pass version parameter.
5100 (get_symbols_v2): New function.
5101 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5102 parameter.
5103 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5104 (onload): Add LDPT_GET_SYMBOLS_V2.
5105 (all_symbols_read_hook): Use get_symbols_v2; check for
5106 LDPR_PREVAILING_DEF_IRONLY_EXP.
5107 * testsuite/plugin_test_3.sh: Update expected results.
5108
dc87f620
ILT
51092011-09-23 Simon Baldwin <simonb@google.com>
5110
5111 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5112 configuration options.
5113 * configure: Regenerate.
5114 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5115 * Makefile.in: Regenerate.
5116 * testsuite/Makefile.in: Regenerate.
5117
a8279f82
ST
51182011-09-19 Sriraman Tallam <tmsriram@google.com>
5119
5120 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5121
0c9350c8
CC
51222011-09-19 Cary Coutant <ccoutant@google.com>
5123
5124 * incremental.cc (can_incremental_update): Fix typo in comment.
5125 * incremental.h (can_incremental_update): Likewise.
5126
aa06ae28
CC
51272011-09-18 Cary Coutant <ccoutant@google.com>
5128
5129 * incremental.cc (can_incremental_update): New function.
5130 * incremental.h (can_incremental_update): New function.
5131 * layout.cc (Layout::init_fixed_output_section): Call it.
5132 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5133 * object.cc (Sized_relobj_file::do_layout): Call
5134 can_incremental_update.
5135
ebb300b2
CC
51362011-09-13 Cary Coutant <ccoutant@google.com>
5137
5138 * configure.ac: Check for glibc support for gnu_indirect_function
5139 support with static linking, setting automake conditional
5140 IFUNC_STATIC.
5141 * Makefile.in: Regenerate.
5142 * configure: Regenerate.
5143
5144 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5145 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5146 for IFUNC_STATIC.
5147 * testsuite/Makefile.in: Regenerate.
5148
1206d0d5
CC
51492011-09-13 Cary Coutant <ccoutant@google.com>
5150
5151 * incremental.cc (Sized_relobj_incr::do_layout): Call
5152 report_comdat_group for kept comdat sections.
5153 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5154 * testsuite/Makefile.in: Regenerate.
5155 * testsuite/incr_comdat_test_1.cc: New source file.
5156 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5157 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5158 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5159
40b29874
ILT
51602011-09-13 Ian Lance Taylor <iant@google.com>
5161
5162 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5163 variable external_symbols_offset.
5164
1b045aac
ILT
51652011-09-12 Ian Lance Taylor <iant@google.com>
5166
5167 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5168 triggered if object has no symbols.
5169
24c6c55a
DM
51702011-09-09 David S. Miller <davem@davemloft.net>
5171
5172 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5173 (Output_fill_debug_line::do_write): Likewise.
5174
66570254
CC
51752011-08-29 Cary Coutant <ccoutant@google.com>
5176
5177 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5178 casts to match formatting specs.
5179 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5180
8ea8cd50
CC
51812011-08-26 Cary Coutant <ccoutant@google.com>
5182
5183 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5184 remaining hole size when allocating.
5185 (Layout::make_output_section): Set fill methods for debug sections.
5186 * layout.h (Free_list::Free_list_node): Move from private to
5187 public.
5188 (Free_list::set_min_hole_size): New function.
5189 (Free_list::begin, Free_list::end): New functions.
5190 (Free_list::min_hole_): New data member.
5191 * output.cc: Include dwarf.h.
5192 (Output_fill_debug_info::do_minimum_hole_size): New function.
5193 (Output_fill_debug_info::do_write): New function.
5194 (Output_fill_debug_line::do_minimum_hole_size): New function.
5195 (Output_fill_debug_line::do_write): New function.
5196 (Output_section::Output_section): Initialize new data member.
5197 (Output_section::set_final_data_size): Ensure patch space is larger
5198 than minimum hole size.
5199 (Output_section::do_write): Fill holes in debug sections.
5200 * output.h (Output_fill): New class.
5201 (Output_fill_debug_info): New class.
5202 (Output_fill_debug_line): New class.
5203 (Output_section::set_free_space_fill): New function.
5204 (Output_section::free_space_fill_): New data member.
5205 * testsuite/Makefile.am (incremental_test_3): Add
5206 --incremental-patch option.
5207 (incremental_test_4): Likewise.
5208 (incremental_test_5): Likewise.
5209 (incremental_test_6): Likewise.
5210 (incremental_copy_test): Likewise.
5211 (incremental_common_test_1): Likewise.
5212 * testsuite/Makefile.in: Regenerate.
5213
7cf80422
NC
52142011-08-26 Nick Clifton <nickc@redhat.com>
5215
5216 * po/es.po: Updated Spanish translation.
5217
c3f7b0e5
CC
52182011-08-01 Cary Coutant <ccoutant@google.com>
5219
5220 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5221 * gold/testsuite/Makefile.in: Regenerate.
5222 * gold/testsuite/justsyms_exec.c: New source file.
5223 * gold/testsuite/justsyms_lib.c: New source file.
5224
9590bf25
CC
52252011-08-01 Cary Coutant <ccoutant@google.com>
5226
5227 * layout.cc (Layout::set_segment_offsets): Don't realign text
5228 segment if -Ttext was specified.
5229 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5230 file type.
5231 * object.h (Sized_relobj_file::e_type): New function.
5232 (Sized_relobj_file::e_type_): New data member.
5233 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5234 base address for ET_EXEC files.
5235 * target.cc (Target::do_make_elf_object_implementation): Allow
5236 ET_EXEC files with --just-symbols option.
5237
dcd8d12e
CC
52382011-07-28 Cary Coutant <ccoutant@google.com>
5239
5240 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5241 Add thread_number parameter.
5242 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5243 * workqueue-threads.cc
5244 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5245 current thread if its thread number is greater than desired thread
5246 count.
5247 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5248 Add thread_number parameter.
5249 (Workqueue::should_cancel_thread): Likewise.
5250 (Workqueue::find_runnable_or_wait): Pass thread_number to
5251 should_cancel_thread.
5252 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5253 parameter.
5254
804eb480
ST
52552011-07-22 Sriraman Tallam <tmsriram@google.com>
5256
5257 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5258 only after checking if it cannot be forced local.
5259 * symtab.h (is_externally_visible): Check if the symbol is not forced
5260 local.
5261
f1ddb600
ILT
52622011-07-15 Ian Lance Taylor <iant@google.com>
5263
5264 * options.h (class General_options): Add --print-output-format.
5265 Move -EL next to -EB, for better --help output.
5266 * target-select.cc: Include <cstdio>, "options.h", and
5267 "parameters.h".
5268 (Target_selector::do_target_bfd_name): New function.
5269 (print_output_format): New function.
5270 * target-select.h (class Target_selector): Update declarations.
5271 (Target_selector::target_bfd_name): New function.
5272 (print_output_format): Declare.
5273 * main.cc: Include "target-select.h".
5274 (main): Handle --print-output-format.
5275 * gold.cc: Include "target-select.h".
5276 (queue_initial_tasks): Handle --print-output-format when there are
5277 no input files.
5278 * parameters.cc (parameters_force_valid_target): Give a better
5279 error message if -EB/-EL does not match target.
5280 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5281 function.
5282
7d172687
ILT
52832011-07-15 Ian Lance Taylor <iant@google.com>
5284
5285 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5286 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5287 (Output_data_plt_i386::do_write): Write address of .dynamic
5288 section to first entry in .got.plt section.
5289 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5290 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5291 Initialize layout_.
5292 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5293 section to first entry in .got.plt section.
5294 * layout.h (Layout::dynamic_section): New function.
5295
e9552f7e
ST
52962011-07-13 Sriraman Tallam <tmsriram@google.com>
5297
5298 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5299 to claim_file call.
5300 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5301 input_section_position_, and input_section_glob_.
5302 (read_layout_from_file): Call function section_ordering_specified.
5303 * layout.h (is_section_ordering_specified): New function.
5304 (section_ordering_specified): New function.
5305 (section_ordering_specified_): New boolean member.
5306 * main.cc(main): Call load_plugins after layout object is defined.
5307 * output.cc (Output_section::add_input_section): Use
5308 function section_ordering_specified to check if section ordering is
5309 needed.
5310 * output.cc (Output_section::add_relaxed_input_section): Use
5311 function section_ordering_specified to check if section ordering is
5312 needed.
5313 (Output_section::update_section_layout): New function.
5314 (Output_section::sort_attached_input_sections): Check if input section
5315 must be reordered.
5316 * output.h (Output_section::update_section_layout): New function.
5317 * plugin.cc (get_section_count): New function.
5318 (get_section_type): New function.
5319 (get_section_name): New function.
5320 (get_section_contents): New function.
5321 (update_section_order): New function.
58797674 5322 (allow_section_ordering): New function.
e9552f7e
ST
5323 (Plugin::load): Add the new interfaces to the transfer vector.
5324 (Plugin_manager::load_plugins): New parameter.
5325 (Plugin_manager::all_symbols_read): New parameter.
5326 (Plugin_manager::claim_file): New parameter. Save the elf object for
5327 unclaimed objects.
5328 (Plugin_manager::get_elf_object): New function.
5329 (Plugin_manager::get_view): Change to directly use the bool to check
5330 if get_view is called from claim_file_hook.
5331 * plugin.h (input_objects): New function
5332 (Plugin__manager::load_plugins): New parameter.
5333 (Plugin_manager::claim_file): New parameter.
5334 (Plugin_manager::get_elf_object): New function.
5335 (Plugin_manager::in_claim_file_handler): New function.
5336 (Plugin_manager::in_claim_file_handler_): New member.
5337 (layout): New function.
5338 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5339 handler with an extra parameter. Make the elf object before calling
5340 claim_file handler.
5341 * testsuite/plugin_test.c (get_section_count): New function pointer.
5342 (get_section_type): New function pointer.
5343 (get_section_name): New function pointer.
5344 (get_section_contents): New function pointer.
5345 (update_section_order): New function pointer.
5346 (allow_section_ordering): New function pointer.
5347 (onload): Check if the new interfaces exist.
5348
9446efde
ILT
53492011-07-13 Ian Lance Taylor <iant@google.com>
5350
5351 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5352 relro section.
5353 * x86_64.cc (Target_x86_64::got_section): Likewise.
5354 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5355 (relro_now_test_SOURCES): New variable.
5356 (relro_now_test_DEPENDENCIES): New variable.
5357 (relro_now_test_LDFLAGS): New variable.
5358 (relro_now_test_LDADD): New variable.
5359 (relro_now_test.so): New target.
5360 * testsuite/Makefile.in: Rebuild.
5361
07aa62f2
ILT
53622011-07-12 Ian Lance Taylor <iant@google.com>
5363
5364 PR gold/12980
5365 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5366 GLOB_DAT relocation rather than a RELATIVE relocation for a
5367 protected symbol when creating a shared library.
5368 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5369 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5370 * testsuite/protected_main_1.cc (main): Test that protected
5371 function has same address.
5372
e2153196
ILT
53732011-07-11 Ian Lance Taylor <iant@google.com>
5374
5375 PR gold/12979
5376 * options.h (class General_options): Add -Bgroup.
5377 * options.cc (General_options::finalize): If -Bgroup is set,
5378 default to --unresolved-symbols=report-all.
5379 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5380 * target-reloc.h (issue_undefined_symbol_error): Handle
5381 --unresolved-symbols=report-all.
5382
6daf5215
ILT
53832011-07-08 Ian Lance Taylor <iant@google.com>
5384
5385 PR gold/11985
5386 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5387 if linker script discards key sections.
5388 (Layout::create_dynamic_symtab): Likewise.
5389 (Layout::assign_local_dynsym_offsets): Likewise.
5390 (Layout::sized_create_version_sections): Likewise.
5391 (Layout::create_interp): Likewise.
5392 (Layout::finish_dynamic_section): Likewise.
5393 (Layout::set_dynamic_symbol_size): Likewise.
5394
beabb2c6
ILT
53952011-07-08 Ian Lance Taylor <iant@google.com>
5396
5397 PR gold/12386
5398 * options.h (class General_options): Add --unresolved-symbols.
5399 * target-reloc.h (issue_undefined_symbol_error): Check
5400 --unresolved-symbols. Add comments.
5401
9c16daf1
ILT
54022011-07-08 Ian Lance Taylor <iant@google.com>
5403
5404 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5405 expression more complex.
5406
191f1a2d
ILT
54072011-07-08 Ian Lance Taylor <iant@google.com>
5408
5409 PR gold/11317
5410 * target-reloc.h (issue_undefined_symbol_error): New inline
5411 function, broken out of relocate_section.
5412 (relocate_section): Call issue_undefined_symbol_error.
5413 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5414 there is no TLS segment if we are about to issue an undefined
5415 symbol error.
5416 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5417
62855347
ILT
54182011-07-08 Ian Lance Taylor <iant@google.com>
5419
5420 PR gold/12279
5421 * resolve.cc (Symbol_table::should_override): Add fromtype
5422 parameter. Change all callers. Give error when linking together
5423 TLS and non-TLS symbol.
5424 (Symbol_table::should_override_with_special): Add fromtype
5425 parameter. Change all callers.
5426 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5427 there is no TLS segment if we have reported some errors.
5428 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5429
67181c72
ILT
54302011-07-08 Ian Lance Taylor <iant@google.com>
5431
5432 PR gold/12372
5433 * target.h (Target::plt_address_for_global): New function.
5434 (Target::plt_address_for_local): New function.
5435 (Target::plt_section_for_global): Remove.
5436 (Target::plt_section_for_local): Remove.
5437 (Target::do_plt_address_for_global): New virtual function.
5438 (Target::do_plt_address_for_local): New virtual function.
5439 (Target::do_plt_section_for_global): Remove.
5440 (Target::do_plt_section_for_local): Remove.
5441 (Target::register_global_plt_entry): Add Symbol_table and Layout
5442 parameters.
5443 * output.cc (Output_data_got::Got_entry::write): Use
5444 plt_address_for_global and plt_address_for_local.
5445 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5446 address of output section.
5447 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5448 got_irelative_, and irelative_count_ fields. Update
5449 declarations.
5450 (Output_data_plt_i386::has_irelative_section): New function.
5451 (Output_data_plt_i386::entry_count): Add irelative_count_.
5452 (Output_data_plt_i386::set_final_data_size): Likewise.
5453 (class Target_i386): Add got_irelative_ and rel_irelative_
5454 fields. Update declarations.
5455 (Target_i386::Target_i386): Initialize new fields.
5456 (Target_i386::do_plt_address_for_global): New function replacing
5457 do_plt_section_for_global.
5458 (Target_i386::do_plt_address_for_local): New function replacing
5459 do_plt_section_for_local.
5460 (Target_i386::got_section): Create got_irelative_.
5461 (Target_i386::rel_irelative_section): New function.
5462 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5463 fields. Don't define __rel_iplt_{start,end}.
5464 (Output_data_plt_i386::add_entry): Add symtab and layout
5465 parameters. Change all callers. Use different PLT and GOT for
5466 IFUNC symbols.
5467 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5468 layout parameters. Change all callers. Use different PLT and
5469 GOT.
5470 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5471 (Output_data_plt_i386::rel_irelative): New function.
5472 (Output_data_plt_i386::address_for_global): New function.
5473 (Output_data_plt_i386::address_for_local): New function.
5474 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5475 IRELATIVE GOT when changing IFUNC GOT entries.
5476 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5477 reloc.
5478 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5479 if we didn't create an IRELATIVE GOT.
5480 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5481 plt_address_for_local.
5482 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5483 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5484 got_irelative_, and irelative_count_ fields. Update
5485 declarations.
5486 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5487 Initialize new fields. Remove symtab parameter. Change all
5488 callers.
5489 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5490 irelative_count_.
5491 (Output_data_plt_x86_64::has_irelative_section): New function.
5492 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5493 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5494 fields. Update declarations.
5495 (Target_x86_64::Target_x86_64): Initialize new fields.
5496 (Target_x86_64::do_plt_address_for_global): New function replacing
5497 do_plt_section_for_global.
5498 (Target_x86_64::do_plt_address_for_local): New function replacing
5499 do_plt_section_for_local.
5500 (Target_x86_64::got_section): Create got_irelative_.
5501 (Target_x86_64::rela_irelative_section): New function.
5502 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5503 all callers. Don't create __rel_iplt_{start,end}.
5504 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5505 parameters. Change all callers. Use different PLT and GOT for
5506 IFUNC symbols.
5507 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5508 layout parameters. Change all callers. Use different PLT and
5509 GOT.
5510 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5511 parameters. Change all callers. Use different PLT and GOT for
5512 IFUNC symbols.
5513 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5514 (Output_data_plt_x86_64::rela_irelative): New function.
5515 (Output_data_plt_x86_64::address_for_global): New function.
5516 (Output_data_plt_x86_64::address_for_local): New function.
5517 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5518 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5519 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5520 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5521 parameters.
5522 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5523 reloc.
5524 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5525 symbols if we didn't create an IRELATIVE GOT.
5526 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5527 plt_address_for_local.
5528 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5529 * testsuite/ifuncvar1.c: New test file.
5530 * testsuite/ifuncvar2.c: New test file.
5531 * testsuite/ifuncvar3.c: New test file.
5532 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5533 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5534 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5535 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5536 * testsuite/Makefile.in: Rebuild.
5537
33c15b45
CC
55382011-07-07 Cary Coutant <ccoutant@google.com>
5539
5540 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5541 (two_file_test_1_ndebug.o): Likewise.
5542 (two_file_test_1b_ndebug.o): Likewise.
5543 (two_file_test_2_ndebug.o): Likewise.
5544 (two_file_test_main_ndebug.o): Likewise.
5545 (incremental_test_2): Link with no-debug versions.
5546
f48b5fb7
CC
55472011-07-06 Cary Coutant <ccoutant@google.com>
5548
5549 * gold/incremental.cc
5550 (Output_section_incremental_inputs::write_info_blocks): Check for
5551 hidden and internal symbols.
5552
221597a5
CC
55532011-07-06 Cary Coutant <ccoutant@google.com>
5554
5555 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5556 Check disposition for startup file.
5557 (Incremental_inputs::report_command_line): Ignore
5558 --incremental-startup-unchanged option.
5559 * options.cc (General_options::parse_incremental_startup_unchanged):
5560 New function.
5561 (General_options::General_options): Initialize new data member.
5562 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5563 (General_options): Add --incremental-startup-unchanged option.
5564 (General_options::incremental_startup_disposition): New function.
5565 (General_options::incremental_startup_disposition_): New data member.
5566
e24719f6
CC
55672011-07-06 Cary Coutant <ccoutant@google.com>
5568
5569 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5570 input file index to Script_info ctor.
5571 (Sized_incremental_binary::do_file_has_changed): Find the
5572 command-line argument for files named in scripts.
5573 * incremental.h (Script_info::Script_info): New ctor
5574 with input file index.
5575 (Script_info::input_file_index): New function.
5576 (Script_info::input_file_index_): New data member.
5577 (Incremental_binary::get_library): Add const.
5578 (Incremental_binary::get_script_info): Add const.
5579 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5580 * testsuite/Makefile.am (incremental_test_5): New test case.
5581 (incremental_test_6): New test case.
5582 * testsuite/Makefile.in: Regenerate.
5583
8f7c81e8
CC
55842011-07-06 Cary Coutant <ccoutant@google.com>
5585
5586 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5587 debug output when command lines differ.
5588
9fbd3822
CC
55892011-07-06 Cary Coutant <ccoutant@google.com>
5590
5591 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5592 --incremental-patch option.
5593 * layout.cc (Free_list::allocate): Extend allocation beyond original
5594 end if enabled.
5595 (Layout::make_output_section): Mark sections that should get
5596 patch space.
5597 * options.cc (parse_percent): New function.
5598 * options.h (parse_percent): New function.
5599 (DEFINE_percent): New macro.
5600 (General_options): Add --incremental-patch option.
5601 * output.cc (Output_section::Output_section): Initialize new data
5602 members.
5603 (Output_section::add_input_section): Print section name when out
5604 of patch space.
5605 (Output_section::add_output_section_data): Likewise.
5606 (Output_section::set_final_data_size): Add patch space when
5607 doing --incremental-full.
5608 (Output_section::do_reset_address_and_file_offset): Remove patch
5609 space.
5610 (Output_segment::set_section_list_addresses): Print debug output
5611 only if --incremental-update.
5612 * output.h (Output_section::set_is_patch_space_allowed): New function.
5613 (Output_section::is_patch_space_allowed_): New data member.
5614 (Output_section::patch_space_): New data member.
5615 * parameters.cc (Parameters::incremental_full): New function.
5616 * parameters.h (Parameters::incremental_full): New function
5617 * testsuite/Makefile.am (incremental_test_2): Add test for
5618 --incremental-patch option.
5619 * testsuite/Makefile.in: Regenerate.
5620 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5621 (t18): Remove function body.
5622
f6cccc2c
DK
56232011-07-05 Doug Kwan <dougkwan@google.com>
5624
5625 PR gold/12771
5626 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5627 Arm_Address type for relocation result.
5628 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5629 overflow check.
5630 (Arm_relocate_functions::abs32): Use unaligned access.
5631 (Arm_relocate_functions::rel32): Ditto.
5632 (Arm_relocate_functions::prel31): Ditto.
5633 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5634 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5635 static data relocations.
5636 * testsuite/Makefile.in: Regnerate.
5637 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5638
28a13fec
ILT
56392011-07-05 Ian Lance Taylor <iant@google.com>
5640
5641 PR gold/12392
5642 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5643 symbols if necessary.
5644 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5645
24d47b34
ILT
56462011-07-05 Ian Lance Taylor <iant@google.com>
5647
5648 PR gold/12952
5649 * resolve.cc (Symbol::override_base_with_special): Simply override
5650 version with special symbol version, ignoring previous version.
5651
41f9cbbe
ILT
56522011-07-05 Ian Lance Taylor <iant@google.com>
5653
5654 * object.cc (Sized_relobj_file::include_section_group): Add
5655 information to comment about signature location.
5656
886288f1
ILT
56572011-07-02 Ian Lance Taylor <iant@google.com>
5658
5659 PR gold/12957
5660 * options.h (class General_options): Add -f and -F.
5661 * options.cc (General_options::finalize): Fatal error if -f/-F
5662 are used without -shared.
5663 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5664
ae3a6d4f
ILT
56652011-07-02 Ian Lance Taylor <iant@google.com>
5666
5667 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5668
21131061
ILT
56692011-07-01 Ian Lance Taylor <iant@google.com>
5670
5671 PR gold/12525
5672 PR gold/12952
5673 * resolve.cc (Symbol::override_base_with_special): Don't override
5674 the version if the overriding symbol has a different name.
5675 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5676 all callers. If we give an error about an undefined version,
5677 define the base version if necessary.
5678 * dynobj.h (class Versions): Update declaration.
5679 * testsuite/weak_alias_test_5.cc: New file.
5680 * testsuite/weak_alias_test.script: New file.
5681 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5682 and versioned_alias have the right value, and call t2.
5683 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5684 weak_alias_test_5.so.
5685 (weak_alias_test_LDADD): Likewise.
5686 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5687 * testsuite/Makefile.in: Rebuild.
5688
611062c0
ILT
56892011-07-01 Ian Lance Taylor <iant@google.com>
5690
5691 PR gold/12525
5692 * options.h (class General_options): Support -z notext.
5693 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5694 -Wl,-z,notext.
5695 (two_file_shared_nonpic.so): Likewise.
5696 (two_file_shared_mixed.so): Likewise.
5697 (two_file_shared_mixed_1.so): Likewise.
5698 (weak_undef_lib_nonpic.so): Likewise.
5699 (alt/weak_undef_lib_nonpic.so): Likewise.
5700 (tls_test_shared_nonpic.so): Likewise.
5701 * testsuite/Makefile.in: Rebuild.
5702
328c7c2f
ILT
57032011-07-01 Ian Lance Taylor <iant@google.com>
5704
5705 PR gold/12525
5706 * configure.ac: Test whether static linking works, setting
5707 the automake conditional HAVE_STATIC.
5708 * testsuite/Makefile.am: Disable tests using -static if
5709 HAVE_STATIC is not true.
5710 * configure, testsuite/Makefile.in: Rebuild.
5711
02d7cd44
ILT
57122011-07-01 Ian Lance Taylor <iant@google.com>
5713
5714 PR gold/12525
5715 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5716 Assert if we see DW_EH_PE_indirect.
5717 * target.h (Target::ehframe_datarel_base): New function.
5718 (Target::do_ehframe_datarel_base): New target function.
5719 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5720 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5721 function.
5722
07a60597
ILT
57232011-07-01 Ian Lance Taylor <iant@google.com>
5724
5725 PR gold/12571
5726 * options.h (class General_options): Add
5727 --ld-generated-unwind-info.
5728 * ehframe.cc (Fde::write): Add address parameter. Change all
5729 callers. If associated with PLT, fill in address and size.
5730 (Cie::set_output_offset): Only add merge mapping if there is an
5731 object.
5732 (Cie::write): Add address parameter. Change all callers.
5733 (Eh_frame::add_ehframe_for_plt): New function.
5734 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5735 input_offset_ fields into union u_, with new plt field.
5736 (Fde::Fde): Adjust for new union field.
5737 (Fde::Fde) [Output_data version]: New constructor.
5738 (Fde::add_mapping): Only add merge mapping if there is an object.
5739 (class Cie): Update declarations.
5740 (class Eh_frame): Declare add_ehframe_for_plt.
5741 * layout.cc (Layout::layout_eh_frame): Break out code into
5742 make_eh_frame_section, and call it.
5743 (Layout::make_eh_frame_section): New function.
5744 (Layout::add_eh_frame_for_plt): New function.
5745 * layout.h (class Layout): Update declarations.
5746 * merge.cc (Merge_map::add_mapping): Add assertion.
5747 * i386.cc: Include "dwarf.h".
5748 (class Output_data_plt_i386): Make first_plt_entry,
5749 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5750 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5751 and plt_eh_frame_fde.
5752 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5753 boundary. Call add_eh_frame_for_plt if appropriate.
5754 * x86_64.cc: Include "dwarf.h".
5755 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5756 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5757 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5758 and plt_eh_frame_fde.
5759 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5760 appropriate.
5761
14788a3f
ILT
57622011-06-29 Ian Lance Taylor <iant@google.com>
5763
5764 PR gold/12629
5765 * object.cc (Sized_relobj_file::layout_section): Change shdr
5766 parameter to be const.
5767 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5768 out of do_layout.
5769 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5770 appropriate. Call layout_eh_frame_section.
5771 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5772 sections.
5773 * object.h (class Sized_relobj_file): Update declarations.
5774
6c21fce1
ILT
57752011-06-29 Ian Lance Taylor <iant@google.com>
5776
37e41b03 5777 PR gold/12652
6c21fce1
ILT
5778 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5779 modifier.
5780 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5781
4d5e4e62
ILT
57822011-06-29 Ian Lance Taylor <iant@google.com>
5783
5784 PR gold/12675
5785 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5786 SHT_X86_64_UNWIND.
5787 * layout.cc (Layout::layout_eh_frame): Likewise.
5788
886f533a
ILT
57892011-06-29 Ian Lance Taylor <iant@google.com>
5790
5791 PR gold/12695
5792 * layout.cc (Layout::symtab_section_shndx): New function.
5793 * layout.h (class Layout): Declare symtab_section_shndx.
5794 * output.cc (Output_section::write_header): Call it.
5795
f3ae1b28
ILT
57962011-06-29 Ian Lance Taylor <iant@google.com>
5797
5798 PR gold/12818
5799 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5800 symbols which are not used in a relocation.
5801
aecf301f
ILT
58022011-06-28 Ian Lance Taylor <iant@google.com>
5803
5804 PR gold/12898
5805 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5806 script create indistinguishable segments.
5807 (Layout::set_segment_offsets): Use stable_sort when sorting
5808 segments. Pass this to Compare_segments constructor.
5809 * layout.h (class Layout): Make segment_precedes non-static.
5810 (class Compare_segments): Change from struct to class. Add
5811 layout_ field. Add constructor.
5812 * script-sections.cc
5813 (Script_sections::attach_sections_using_phdrs_clause): Rename
5814 local orphan to is_orphan. Don't report failure to put empty
5815 section in segment. On attachment failure, report name of
5816 section, and attach to first PT_LOAD segment.
5817
03ef7571
ILT
58182011-06-28 Ian Lance Taylor <iant@google.com>
5819
5820 PR gold/12934
5821 * target-select.cc (Target_selector::Target_selector): Add
5822 emulation parameter. Change all callers.
5823 (select_target_by_bfd_name): Rename from select_target_by_name.
5824 Change all callers.
5825 (select_target_by_emulation): New function.
5826 (supported_emulation_names): New function.
5827 * target-select.h (class Target_selector): Add emulation_ field.
5828 Update declarations.
5829 (Target_selector::recognize_by_bfd_name): Rename from
5830 recognize_by_name. Change all callers.
5831 (Target_selector::supported_bfd_names): Rename from
5832 supported_names. Change all callers.
5833 (Target_selector::recognize_by_emulation): New function.
5834 (Target_selector::supported_emulations): New function.
5835 (Target_selector::emulation): New function.
5836 (Target_selector::do_recognize_by_bfd_name): Rename from
5837 do_recognize_by_name. Change all callers.
5838 (Target_selector::do_supported_bfd_names): Rename from
5839 do_supported_names. Change all callers.
5840 (Target_selector::do_recognize_by_emulation): New function.
5841 (Target_selector::do_supported_emulations): New function.
5842 (select_target_by_bfd_name): Change name in declaration.
5843 (select_target_by_emulation): Declare.
5844 (supported_emulation_names): Declare.
5845 * parameters.cc (parameters_force_valid_target): Try to find
5846 target based on emulation from -m option.
5847 * options.h (class General_options): Change doc string for -m.
5848 * options.cc (help): Print emulations.
5849 (General_options::parse_V): Likewise.
5850 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5851 Add emulation parameter. Change all callers.
5852
200b2bb9
ILT
58532011-06-28 Ian Lance Taylor <iant@google.com>
5854
5855 * target.h (class Target): Add osabi_ field.
5856 (Target::osabi): New function.
5857 (Target::set_osabi): New function.
5858 (Target::Target): Initialize osabi_.
5859 (Target::do_adjust_elf_header): Make pure virtual.
5860 (Sized_target::do_adjust_elf_header): Declare.
5861 * target.cc (Sized_target::do_adjust_elf_header): New function.
5862 (class Sized_target): Instantiate all versions.
5863 * freebsd.h (class Target_freebsd): Remove.
5864 (Target_selector_freebsd::do_recognize): Call set_osabi on
5865 Target.
5866 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5867 (Target_selector_freebsd::set_osabi): Remove.
5868 * i386.cc (class Target_i386): Inherit from Sized_target rather
5869 than Target_freebsd.
5870 * x86_64.cc (class Target_x86_64): Likewise.
5871
b3ce541e
ILT
58722011-06-28 Ian Lance Taylor <iant@google.com>
5873
5874 * target.h (Target::can_check_for_function_pointers): Rewrite.
5875 Make non-virtual.
5876 (Target::can_icf_inline_merge_sections): Likewise.
5877 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5878 (Target::Target_info): Add can_icf_inline_merge_sections field.
5879 (Target::do_can_check_for_function_pointers): New virtual
5880 function.
5881 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5882 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5883 from can_check_for_function_pointers, move in file.
5884 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5885 section_may_have_icf_unsafe_poineters, move in file.
5886 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5887 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5888 Rename from can_check_for_function_pointers, move in file.
5889 (Target_i386::can_icf_inline_merge_sections): Remove.
5890 (Target_i386::i386_info): Initialize
5891 can_icf_inline_merge_sections.
5892 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5893 Initialize can_icf_inline_merge_sections.
5894 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5895 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5896 Rename from can_check_for_function_pointers, move in file.
5897 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5898 (Target_x86_64::x86_64_info): Initialize
5899 can_icf_inline_merge_sections.
5900 * testsuite/testfile.cc (Target_test::test_target_info):
5901 Likewise.
5902 * icf.cc (get_section_contents): Correct formatting.
5903
6d1c4efb
ILT
59042011-06-27 Ian Lance Taylor <iant@google.com>
5905
5906 * symtab.cc (Symbol::versioned_name): New function.
5907 (Symbol_table::add_to_final_symtab): Use versioned_name when
5908 appropriate.
5909 (Symbol_table::sized_write_symbol): Likewise.
5910 * symtab.h (class Symbol): Declare versioned_name.
5911 * stringpool.h (class Stringpool_template): Add variant of add
5912 which takes a std::basic_string.
5913 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5914 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5915 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5916 (ver_test_12.o): New target.
5917 * testsuite/Makefile.in: Rebuild.
5918
57eb9b50
DK
59192011-06-27 Doug Kwan <dougkwan@google.com>
5920
5921 * arm.cc (Arm_relocate_functions::thm_jump8,
5922 Arm_relocate_functions::thm_jump11): Use a wider signed
5923 type to compute offset.
5924 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5925 arm_thm_jump8.
5926 * testsuite/Makefile.in: Regenerate.
5927 * testsuite/arm_branch_in_range.sh: Check test results of
5928 arm_thm_jump11 and arm_thm_jump8.
5929 * testsuite/arm_thm_jump11.s: New test source file.
5930 * testsuite/arm_thm_jump11.t: New linker script.
5931 * testsuite/arm_thm_jump8.s: New test source file.
5932 * testsuite/arm_thm_jump8.t: New linker script.
5933
487b39df
ILT
59342011-06-24 Ian Lance Taylor <iant@google.com>
5935
5936 * layout.cc: Include "object.h".
5937 (ctors_sections_in_init_array): New static variable.
5938 (Layout::is_ctors_in_init_array): New function.
5939 (Layout::layout): Add entry to ctors_sections_in_init_array if
5940 appropriate.
5941 * layout.h (class Layout): Declare is_ctors_in_init_array.
5942 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5943 is_ctors_reverse_view is set.
5944 (Sized_relobj_file::write_sections): Add layout parameter. Change
5945 all callers. Set is_ctors_reverse_view field of View_size.
5946 (Sized_relobj_file::reverse_words): New function.
5947 * object.h (Sized_relobj_file::View_size): Add
5948 is_ctors_reverse_view field.
5949 (class Sized_relobj_file): Update declarations.
5950 * testsuite/initpri3.c: New test.
5951 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5952 initpri3b.
5953 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5954 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5955 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5956 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5957 * testsuite/Makefile.in: Rebuild.
5958
472076e4
CC
59592011-06-24 Cary Coutant <ccoutant@google.com>
5960
5961 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5962 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5963 (debug_msg_cdebug.err): New targets.
5964 * testsuite/Makefile.in: Regenerate.
5965 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5966 Fix checks for link with shared library.
5967
a60af0db
DK
59682011-06-24 Doug Kwan <dougkwan@google.com>
5969
5970 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5971 skip empty text sections.
5972 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5973
5393d741
ILT
59742011-06-22 Ian Lance Taylor <iant@google.com>
5975
5976 PR gold/12910
5977 * options.h (class General_options): Add --ctors-in-init-array.
5978 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5979 friends as SHT_PROGBITS for merging sections.
5980 (Layout::layout): Remove special handling of .init_array and
5981 friends. Don't sort if doing relocatable link. Sort for .ctors
5982 and .dtors if ctors_in_init_array.
5983 (Layout::make_output_section): Force correct section types for
5984 .init_array and friends. Don't sort if doing relocatable link,
5985 Don't sort .ctors and .dtors if ctors_in_init_array.
5986 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5987 (Layout::output_section_name): Add relobj parameter. Change all
5988 callers. Handle .ctors. and .dtors. in code rather than table.
5989 Handle .ctors and .dtors if ctors_in_init_array.
5990 (Layout::match_file_name): New function, moved from output.cc.
5991 * layout.h (class Layout): Update declarations.
5992 * output.cc: Include "layout.h".
5993 (Input_section_sort_entry::get_priority): New function.
5994 (Input_section_sort_entry::match_file_name): Just call
5995 Layout::match_file_name.
5996 (Output_section::Input_section_sort_init_fini_compare::operator()):
5997 Handle .ctors and .dtors. Sort by explicit priority rather than
5998 by name.
5999 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6000 * testsuite/initpri2.c: New test.
6001 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6002 (check_PROGRAMS): Add initpri2.
6003 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6004 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6005 * configure, testsuite/Makefile.in: Rebuild.
6006
e1f74f98
ILT
60072011-06-19 Ian Lance Taylor <iant@google.com>
6008
6009 PR gold/12880
6010 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6011 .interp section to a PT_INTERP segment even if we have seen a
6012 --dynamic-linker option. Don't do it if we have seen a PHDRS
6013 clause in a linker script.
6014 (Layout::finalize): Don't create a .interp section if we've
6015 already create a PT_INTERP segment.
6016 (Layout::create_interp): Always call choose_output_section (revert
6017 patch of 2011-06-17). Don't create PT_INTERP segment.
6018 * script-sections.cc
6019 (Script_sections::create_note_and_tls_segments): Add a .interp
6020 section to a PT_INTERP segment even if we have seen a
6021 --dynamic-linker option.
6022
766f91bb
ILT
60232011-06-18 Ian Lance Taylor <iant@google.com>
6024
6025 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6026 merely because a non-PT_LOAD segment has a dynamic reloc.
6027
0d212c3a
ILT
60282011-06-18 Ian Lance Taylor <iant@google.com>
6029
6030 * layout.cc (Layout::finish_dynamic_section): Don't create
6031 DT_FLAGS entry if not needed.
6032
911a5072
ILT
60332011-06-18 Ian Lance Taylor <iant@google.com>
6034
6035 PR gold/12745
6036 * layout.cc (Layout::layout_eh_frame): Correct handling of
6037 writable .eh_frame section.
6038
534b4e5f
ILT
60392011-06-17 Ian Lance Taylor <iant@google.com>
6040
6041 PR gold/12893
6042 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6043 symbol is redefined with the exact same object and value.
6044
10b4f102
ILT
60452011-06-17 Ian Lance Taylor <iant@google.com>
6046
6047 PR gold/12880
6048 * layout.h (class Layout): Add interp_segment_ field.
6049 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6050 (Layout::attach_allocated_section_to_segment): If making shared
6051 library, put .interp section in PT_INTERP segment.
6052 (Layout::finalize): Also call create_interp if -dynamic-linker
6053 option was used.
6054 (Layout::create_interp): Assert that there is no PT_INTERP
6055 segment. If not using a SECTIONS clause, use make_output_section.
6056 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6057 * script-sections.cc
6058 (Script_sections::create_note_and_tls_segments): If making shared
6059 library, put .interp section in PT_INTERP segment.
6060
a29b0dad
ILT
60612011-06-17 Ian Lance Taylor <iant@google.com>
6062
e588ea8d
ILT
6063 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6064 when making a shared library.
6065
60662011-06-17 Ian Lance Taylor <iant@google.com>
6067
6068 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6069 parameter. Change all callers. Don't issue warning about PC32
6070 against locally defined symbol.
a29b0dad 6071
9d3b0698
ILT
60722011-06-16 Ian Lance Taylor <iant@google.com>
6073
6074 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6075 occurs in same object.
6076
85b0f90c
AM
60772011-06-14 Alan Modra <amodra@gmail.com>
6078
6079 * po/POTFILES.in: Regenerate.
6080
a94907d9
ILT
60812011-06-09 Ian Lance Taylor <iant@google.com>
6082
6083 * script-sections.cc
6084 (Orphan_output_section::set_section_addresses): For a relocatable
6085 link set address to 0.
6086
4fb3a1c3
CC
60872011-06-09 Cary Coutant <ccoutant@google.com>
6088
6089 PR gold/12804
6090 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6091 used with --compress-debug-sections.
6092 * gold/object.cc (Sized_relobj_file::do_layout): Report
6093 uncompressed size of compressed input sections.
6094
61220854
CC
60952011-06-08 Cary Coutant <ccoutant@google.com>
6096
6097 PR gold/12804
6098 * testsuite/two_file_test_2_v1.cc: Change initialization of
6099 v2 to keep it in .data.
6100
e6455dfb
CC
61012011-06-07 Cary Coutant <ccoutant@google.com>
6102
6103 * common.cc (Symbol_table::do_allocate_commons_list): Call
6104 gold_fallback.
6105 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6106 (Errors::fallback): New function.
6107 (gold_fallback): New function.
6108 * errors.h (Errors::fallback): New function.
6109 * gold.cc (gold_exit): Change status parameter to enum; adjust
6110 all callers.
6111 (queue_initial_tasks): Call gold_fallback.
6112 * gold.h: Include cstdlib.
6113 (Exit_status): New enum type.
6114 (gold_exit): Change status parameter to enum.
6115 (gold_fallback): New function.
6116 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6117 (Layout::create_symtab_sections): Likewise.
6118 (Layout::create_shdrs): Likewise.
6119 * main.cc (main): Adjust call to gold_exit.
6120 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6121 (Output_data_got::add_got_entry_pair): Likewise.
6122 (Output_section::add_input_section): Likewise.
6123 (Output_section::add_output_section_data): Likewise.
6124 (Output_segment::set_section_list_addresses): Likewise.
6125 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6126
fb0e076f
CC
61272011-06-07 Cary Coutant <ccoutant@google.com>
6128
6129 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6130 for incremental links.
6131 * output.cc (Output_segment::set_section_list_addresses): Remove
6132 FIXME and test for TLS or BSS.
6133
a5ee4d5d
CC
61342011-06-07 Cary Coutant <ccoutant@google.com>
6135
6136 * testsuite/Makefile.am: Add incremental_copy_test,
6137 incremental_common_test_1.
6138 * testsuite/Makefile.in: Regenerate.
6139 * testsuite/common_test_1_v1.c: New source file.
6140 * testsuite/common_test_1_v2.c: New source file.
6141 * testsuite/copy_test_v1.cc: New source file.
6142
5146f448
CC
61432011-06-07 Cary Coutant <ccoutant@google.com>
6144
6145 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6146 update, allocate common from bss section's free list.
6147 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6148 linker-defined symbols.
6149 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6150 Skip GOT and PLT entries that are no longer referenced.
6151 (Output_section_incremental_inputs::write_info_blocks): Mark
6152 linker-defined symbols.
6153 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6154 * output.cc (Output_section::allocate): New function.
6155 * output.h (Output_section::allocate): New function.
6156 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6157 linker-defined symbols.
6158 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6159 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6160 (Symbol::init_base_output_data): Likewise.
6161 (Symbol::init_base_output_segment): Likewise.
6162 (Symbol::init_base_constant): Likewise.
6163 (Sized_symbol::init_output_data): Likewise.
6164 (Sized_symbol::init_output_segment): Likewise.
6165 (Sized_symbol::init_constant): Likewise.
6166 (Symbol_table::do_define_in_output_data): Likewise.
6167 (Symbol_table::do_define_in_output_segment): Likewise.
6168 (Symbol_table::do_define_as_constant): Likewise.
6169 * symtab.h (Symbol::is_predefined): New function.
6170 (Symbol::init_base_output_data): Add is_predefined parameter.
6171 (Symbol::init_base_output_segment): Likewise.
6172 (Symbol::init_base_constant): Likewise.
6173 (Symbol::is_predefined_): New data member.
6174 (Sized_symbol::init_output_data): Add is_predefined parameter.
6175 (Sized_symbol::init_output_segment): Likewise.
6176 (Sized_symbol::init_constant): Likewise.
6177 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6178
26d3c67d
CC
61792011-06-07 Cary Coutant <ccoutant@google.com>
6180
6181 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6182 instead of emit_copy_reloc.
6183 (Copy_relocs::emit_copy_reloc): Refactor.
6184 (Copy_relocs::make_copy_reloc): New function.
6185 (Copy_relocs::add_copy_reloc): Remove.
6186 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6187 section.
6188 (Copy_relocs::make_copy_reloc): New function.
6189 (Copy_relocs::add_copy_reloc): Remove.
6190 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6191 unchanged input files.
6192 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6193 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6194 Reserve BSS space for COPY relocations.
6195 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6196 (Output_section_incremental_inputs::write_info_blocks): Record
6197 whether a symbol is copied from a shared object.
6198 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6199 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6200 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6201 (Incremental_input_entry_reader::get_output_symbol_index): Add
6202 is_copy parameter.
6203 (Incremental_binary::emit_copy_relocs): New function.
6204 (Incremental_binary::do_emit_copy_relocs): New function.
6205 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6206 new data member.
6207 (Sized_incremental_binary::add_copy_reloc): New function.
6208 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6209 (Sized_incremental_binary::Copy_reloc): New struct.
6210 (Sized_incremental_binary::Copy_relocs): New typedef.
6211 (Sized_incremental_binary::copy_relocs_): New data member.
6212 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6213 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6214 * target.h (Sized_target::emit_copy_reloc): New function.
6215 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6216
7cdb37d9
CC
62172011-06-02 Cary Coutant <ccoutant@google.com>
6218
6219 PR gold/12163
6220 * gold/archive.cc (Archive::Archive): Initialize new data member.
6221 (Archive::include_all_members): Return if archive has already been
6222 included.
6223 * gold/archive.h (Archive::include_all_members_): New data member.
6224
cc643b88
NC
62252011-06-02 Nick Clifton <nickc@redhat.com>
6226
6227 * dynobj.h: Fix spelling mistake in comment.
6228 * output.cc: Likewise.
6229
f62a3ca7 62302011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6231 Asier Llano
f62a3ca7
DK
6232
6233 PR gold/12826
cc643b88 6234 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6235 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6236 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6237 redundant arm_exidx_test.so.
6238 * testsuite/Makefile.in: Regenerate.
6239 (check_SCRIPTS): Add pr12826.sh
6240 (check_DATA): Add pr12826.stdout
6241 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6242 * testsuite/pr12826.sh: New file.
6243 * testsuite/pr12826_1.s: Ditto.
6244 * testsuite/pr12826_1.s: Ditto.
6245
8dbe1edc
ILT
62462011-05-30 Ian Lance Taylor <iant@google.com>
6247
6248 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6249 sections.
6250
c49875be
ILT
62512011-05-29 Ian Lance Taylor <iant@google.com>
6252
6253 PR gold/12804
6254 * testsuite/Makefile.am: Use different file name for two_file_test
6255 temporary file for each incremental test.
6256 * testsuite/Makefile.in: Rebuild.
6257
69d53f7a
ILT
62582011-05-29 Ian Lance Taylor <iant@google.com>
6259
6260 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6261 binary input file is empty.
6262
41d0ab5f
ILT
62632011-05-27 Ian Lance Taylor <iant@google.com>
6264
6265 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6266 (ver_test_9.so): Likewise.
6267 * testsuite/Makefile.in: Rebuild.
6268
89d8a36b
CC
62692011-05-26 Cary Coutant <ccoutant@google.com>
6270
6271 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6272 * incremental.cc (Incremental_inputs::report_input_section): Fix
6273 comment, indentation.
6274 (Incremental_inputs::report_comdat_group): New function.
6275 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6276 of data for incremental input file entry.
6277 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6278 group count, COMDAT group signatures.
6279 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6280 an unchanged input file.
6281 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6282 Initialize new data member.
6283 (Incremental_object_entry::add_comdat_group): New function.
6284 (Incremental_object_entry::get_comdat_group_count): New function.
6285 (Incremental_object_entry::get_comdat_signature_key): New function.
6286 (Incremental_object_entry::groups_): New data member.
6287 (Incremental_inputs::report_comdat_group): New function.
6288 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6289 data for incremental input file entry.
6290 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6291 (Incremental_input_entry_reader::get_input_section): Adjust size of
6292 data for incremental input file entry.
6293 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6294 (Incremental_input_entry_reader::get_comdat_group_signature): New
6295 function.
6296 * object.cc (Sized_relobj::include_section_group): Report kept
6297 COMDAT groups for incremental links.
6298
1706a06f
ILT
62992011-05-24 David Meyer <pdox@google.com>
6300
6301 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6302 with name parameter. Add found_name parameter.
6303 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6304 * dirsearch.h (class Dirsearch): Update declaration.
6305
a10ae760
ILT
63062011-05-24 Ian Lance Taylor <iant@google.com>
6307
6308 * archive.cc (Library_base::should_include_member): Pull in object
6309 from archive if it defines the entry symbol.
6310 * parameters.cc (Parameters::entry): New function.
6311 * parameters.h (class Parameters): Declare entry.
6312 * output.h (class Output_file_header): Remove entry_ field.
6313 * output.cc (Output_file_header::Output_file_header): Remove entry
6314 parameter. Change all callers.
6315 (Output_file_header::entry): Use parameters->entry.
6316 * gold.cc (queue_middle_tasks): Likewise.
6317 * plugin.cc (Plugin_hook::run): Likewise.
6318
aa92d6ed
CC
63192011-05-24 Cary Coutant <ccoutant@google.com>
6320
6321 * gold.cc (queue_initial_tasks): Pass incremental base filename
6322 to Output_file::open_base_file; don't print error message.
6323 * incremental-dump.cc (main): Adjust call to
6324 Output_file::open_for_modification.
6325 * incremental-dump.cc (main): Likewise.
6326 * incremental.cc (Incremental_inputs::report_command_line):
6327 Ignore --incremental-base option when comparing command lines.
6328 Ignore parameter when given as separate argument.
6329 * options.h (class General_options): Add --incremental-base.
6330 * output.cc (Output_file::Output_file):
6331 (Output_file::open_base_file): Add base_name and writable parameters;
6332 read base file into new file; print error message here.
6333 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6334 callers.
6335 * output.h (Output_file::open_for_modification): Rename to...
6336 (Output_file::open_base_file): ...this; add base_name and
6337 writable parameters; adjust all callers.
6338 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6339 callers.
6340 * testsuite/Makefile.am (incremental_test_4): Test
6341 --incremental-base.
6342 * testsuite/Makefile.in: Regenerate.
6343
2eedd706
CC
63442011-05-24 Cary Coutant <ccoutant@google.com>
6345
6346 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6347 incremental_test_4.
6348 * testsuite/Makefile.in: Regenerate.
6349 * testsuite/two_file_test_1_v1.cc: New test source file.
6350 * testsuite/two_file_test_1b_v1.cc: New test source file.
6351 * testsuite/two_file_test_2_v1.cc: New test source file.
6352
0f1c85a6
CC
63532011-05-24 Cary Coutant <ccoutant@google.com>
6354
6355 * dynobj.h (Dynobj::do_dynobj): New function.
6356 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6357 flag and soname for shared objects.
6358 * incremental.cc (Incremental_inputs::report_object): Make
6359 either Incremental_object_entry or Incremental_dynobj_entry; add
6360 soname to string table.
6361 (Incremental_inputs::report_input_section): Add assertion.
6362 (Output_section_incremental_inputs::set_final_data_size): Adjust
6363 type of input file entry for shared libraries; adjust size of
6364 shared library info entry.
6365 (Output_section_incremental_inputs::write_input_files): Write
6366 as_needed flag for shared libraries.
6367 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6368 of input file entry for shared libraries; write soname.
6369 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6370 soname from incremental info.
6371 * incremental.h (enum Incremental_input_flags): Add
6372 INCREMENTAL_INPUT_AS_NEEDED.
6373 (Incremental_input_entry::Incremental_input_entry): Initialize new
6374 data member.
6375 (Incremental_input_entry::set_as_needed): New function.
6376 (Incremental_input_entry::as_needed): New function.
6377 (Incremental_input_entry::do_dynobj_entry): New function.
6378 (Incremental_input_entry::as_needed_): New data member.
6379 (Incremental_object_entry::Incremental_object_entry): Don't check
6380 for shared library.
6381 (Incremental_object_entry::do_type): Likewise.
6382 (class Incremental_dynobj_entry): New class.
6383 (Incremental_input_entry_reader::as_needed): New function.
6384 (Incremental_input_entry_reader::get_soname): New function.
6385 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6386 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6387 size of shared library info entry.
58797674 6388 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6389 incremental link when adding DT_NEEDED entries.
6390 * object.h (Object::Object): Initialize new data member.
6391 (Object::dynobj): New function.
6392 (Object::set_as_needed): New function.
6393 (Object::as_needed): New function.
6394 (Object::do_dynobj): New function.
6395 (Object::as_needed_): New data member.
6396
6fa2a40b
CC
63972011-05-24 Cary Coutant <ccoutant@google.com>
6398
6399 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6400 info; adjust display of GOT entries.
6401 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6402 vector of input objects; remove file_status_.
6403 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6404 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6405 got_plt reader; call target hooks to reserve GOT entries.
6406 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6407 of input file info header and GOT info entry.
6408 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6409 relocation info.
6410 (Got_plt_view_info::got_descriptor): Remove.
6411 (Got_plt_view_info::sym_index): New data member.
6412 (Got_plt_view_info::input_index): New data member.
6413 (Local_got_offset_visitor::visit): Write input file index.
6414 (Global_got_offset_visitor::visit): Write 0 for input file index.
6415 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6416 with sym_index and input_index.
6417 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6418 incremental info GOT entry; replace got_descriptor with input_index.
6419 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6420 map from input file index to object.
6421 (Sized_relobj_incr::do_layout): Replace direct data member reference
6422 with accessor function.
6423 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6424 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6425 Adjust size of input file info header.
6426 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6427 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6428 (Incremental_input_entry_reader::get_input_section): Adjust size of
6429 input file info header.
6430 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6431 of incremental info GOT entry.
6432 (Incremental_got_plt_reader::get_got_desc): Remove.
6433 (Incremental_got_plt_reader::get_got_symndx): New function.
6434 (Incremental_got_plt_reader::get_got_input_index): New function.
6435 (Sized_incremental_binary::Sized_incremental_binary): Remove
6436 file_status_; add input_objects_.
6437 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6438 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6439 (Sized_incremental_binary::file_is_unchanged): Remove.
6440 (Sized_incremental_binary::set_input_object): New function.
6441 (Sized_incremental_binary::input_object): New function.
6442 (Sized_incremental_binary::file_status_): Remove.
6443 (Sized_incremental_binary::input_objects_): New data member.
6444 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6445 references.
6446 (Sized_relobj_incr::invalid_address): Move to base class.
6447 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6448 class.
6449 (Sized_relobj_incr::do_output_section_offset): Likewise.
6450 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6451 (Sized_relobj_incr::section_offsets_): Likewise.
6452 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6453 function.
6454 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6455 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6456 with accessor function.
6457 (Sized_relobj_file::do_layout): Likewise.
6458 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6459 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6460 (Sized_relobj_file::compute_final_local_value): Replace refs to
6461 section_offsets_ with accessor function.
6462 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6463 * object.h (Relobj::Relobj): Initialize new data members.
6464 (Relobj::add_dyn_reloc): New function.
6465 (Relobj::first_dyn_reloc): New function.
6466 (Relobj::dyn_reloc_count): New function.
6467 (Relobj::first_dyn_reloc_): New data member.
6468 (Relobj::dyn_reloc_count_): New data member.
6469 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6470 references.
6471 (Sized_relobj::Address): New typedef.
6472 (Sized_relobj::invalid_address): Move here from child class.
6473 (Sized_relobj::Sized_relobj): Initialize new data members.
6474 (Sized_relobj::sized_relobj): New function.
6475 (Sized_relobj::is_output_section_offset_invalid): Move here from
6476 child class.
6477 (Sized_relobj::get_output_section_offset): Likewise.
6478 (Sized_relobj::local_has_got_offset): Likewise.
6479 (Sized_relobj::local_got_offset): Likewise.
6480 (Sized_relobj::set_local_got_offset): Likewise.
6481 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6482 (Sized_relobj::clear_got_offsets): New function.
6483 (Sized_relobj::section_offsets): Move here from child class.
6484 (Sized_relobj::do_output_section_offset): Likewise.
6485 (Sized_relobj::do_set_section_offset): Likewise.
6486 (Sized_relobj::Local_got_offsets): Likewise.
6487 (Sized_relobj::local_got_offsets_): Likewise.
6488 (Sized_relobj::section_offsets_): Likewise.
6489 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6490 references.
6491 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6492 class.
6493 (Sized_relobj_file::sized_relobj): New function
6494 (Sized_relobj_file::local_has_got_offset): Move to base class.
6495 (Sized_relobj_file::local_got_offset): Likewise.
6496 (Sized_relobj_file::set_local_got_offset): Likewise.
6497 (Sized_relobj_file::get_output_section_offset): Likewise.
6498 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6499 (Sized_relobj_file::do_output_section_offset): Likewise.
6500 (Sized_relobj_file::do_set_section_offset): Likewise.
6501 (Sized_relobj_file::Local_got_offsets): Likewise.
6502 (Sized_relobj_file::local_got_offsets_): Likewise.
6503 (Sized_relobj_file::section_offsets_): Likewise.
6504 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6505 (all constructors).
6506 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6507 (Output_reloc::get_symbol_index): Likewise.
6508 (Output_reloc::local_section_offset): Likewise.
6509 (Output_reloc::get_address): Likewise.
6510 (Output_reloc::symbol_value): Likewise.
6511 (Output_data_got::reserve_slot): Move to class definition.
6512 (Output_data_got::reserve_local): New function.
6513 (Output_data_got::reserve_slot_for_global): Remove.
6514 (Output_data_got::reserve_global): New function.
6515 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6516 (all constructors, two instantiations).
6517 (Output_reloc::get_relobj): New function (two instantiations).
6518 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6519 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6520 (Output_data_reloc::add_global): Adjust type of relobj.
6521 (Output_data_reloc::add_global_relative): Likewise.
6522 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6523 (Output_data_reloc::add_local): Likewise.
6524 (Output_data_reloc::add_local_relative): Likewise.
6525 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6526 (Output_data_reloc::add_local_section): Likewise.
6527 (Output_data_reloc::add_output_section): Likewise.
6528 (Output_data_reloc::add_absolute): Likewise.
6529 (Output_data_reloc::add_target_specific): Likewise.
6530 (Output_data_got::reserve_slot): Move definition here.
6531 (Output_data_got::reserve_local): New function.
6532 (Output_data_got::reserve_global): New function.
6533 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6534 section_offsets_ with accessor function.
6535 (Sized_relobj_file::write_sections): Likewise.
6536 (Sized_relobj_file::do_relocate_sections): Likewise.
6537 * target.h (Sized_target::reserve_local_got_entry): New function.
6538 (Sized_target::reserve_global_got_entry): New function.
6539 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6540 (Target_x86_64::reserve_global_got_entry): New function.
6541 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6542
4829d394
CC
65432011-05-23 Cary Coutant <ccoutant@google.com>
6544
6545 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6546 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6547 bit when checking got_type.
6548 * incremental.cc (Sized_incremental_binary::setup_readers):
6549 Store symbol table and string table locations; initialize bit vector
6550 of file status flags.
6551 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6552 unchanged files.
6553 (Sized_incremental_binary::do_process_got_plt): New function.
6554 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6555 (Output_section_incremental_inputs::set_final_data_size): Record
6556 file index for each input file.
6557 (Output_section_incremental_inputs::write_got_plt): Store file index
6558 instead of input entry offset for each GOT entry.
6559 * incremental.h
6560 (Incremental_input_entry::Incremental_input_entry): Initialize new
6561 data member.
6562 (Incremental_input_entry::set_offset): Store file index.
6563 (Incremental_input_entry::get_file_index): New function.
6564 (Incremental_input_entry::file_index_): New data member.
6565 (Incremental_binary::process_got_plt): New function.
6566 (Incremental_binary::do_process_got_plt): New function.
6567 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6568 data members.
6569 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6570 (Sized_incremental_binary::set_file_is_unchanged): New function.
6571 (Sized_incremental_binary::file_is_unchanged): New function.
6572 (Sized_incremental_binary::do_process_got_plt): New function.
6573 (Sized_incremental_binary::file_status_): New data member.
6574 (Sized_incremental_binary::main_symtab_loc_): New data member.
6575 (Sized_incremental_binary::main_strtab_loc_): New data member.
6576 * output.cc (Output_data_got::Got_entry::write): Add case
6577 RESERVED_CODE.
6578 (Output_data_got::add_global): Call add_got_entry.
6579 (Output_data_got::add_global_plt): Likewise.
6580 (Output_data_got::add_global_with_rel): Likewise.
6581 (Output_data_got::add_global_with_rela): Likewise.
6582 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6583 (Output_data_got::add_global_pair_with_rela): Likewise.
6584 (Output_data_got::add_local): Call add_got_entry.
6585 (Output_data_got::add_local_plt): Likewise.
6586 (Output_data_got::add_local_with_rel): Likewise.
6587 (Output_data_got::add_local_with_rela): Likewise.
6588 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6589 (Output_data_got::add_local_pair_with_rela): Likewise.
6590 (Output_data_got::reserve_slot): New function.
6591 (Output_data_got::reserve_slot_for_global): New function.
6592 (Output_data_got::add_got_entry): New function.
6593 (Output_data_got::add_got_entry_pair): New function.
6594 (Output_section::add_output_section_data): Edit FIXME.
6595 * output.h
6596 (Output_section_data_build::Output_section_data_build): New
6597 constructor with size parameter.
6598 (Output_data_space::Output_data_space): Likewise.
6599 (Output_data_got::Output_data_got): Initialize new data member; new
6600 constructor with size parameter.
6601 (Output_data_got::add_constant): Call add_got_entry.
6602 (Output_data_got::reserve_slot): New function.
6603 (Output_data_got::reserve_slot_for_global): New function.
6604 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6605 (Output_data_got::add_got_entry): New function.
6606 (Output_data_got::add_got_entry_pair): New function.
6607 (Output_data_got::free_list_): New data member.
6608 * target.h (Sized_target::init_got_plt_for_update): New function.
6609 (Sized_target::register_global_plt_entry): New function.
6610 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6611 Initialize new data member; call init; add constructor with PLT count.
6612 (Output_data_plt_x86_64::init): New function.
6613 (Output_data_plt_x86_64::add_relocation): New function.
6614 (Output_data_plt_x86_64::reserve_slot): New function.
6615 (Output_data_plt_x86_64::free_list_): New data member.
6616 (Target_x86_64::init_got_plt_for_update): New function.
6617 (Target_x86_64::register_global_plt_entry): New function.
6618 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6619 incremental updates.
6620 (Output_data_plt_x86_64::add_relocation): New function.
6621 * testsuite/object_unittest.cc (Object_test): Set default options.
6622
ec69d6da
ILT
66232011-05-16 Ian Lance Taylor <iant@google.com>
6624
6625 * options.h (class General_options): Make -i a synonym for -r.
6626
732e31de
ILT
66272011-05-16 Ian Lance Taylor <iant@google.com>
6628
6629 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6630
403676b5
CC
66312011-05-10 Cary Coutant <ccoutant@google.com>
6632
6633 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6634 strip_all (-s).
6635
5b7b7d6e
ILT
66362011-05-06 Ian Lance Taylor <iant@google.com>
6637
6638 * layout.cc (Layout::layout): If the output section flags change,
6639 update the ordering.
6640
f0f9babf
CC
66412011-04-25 Cary Coutant <ccoutant@google.com>
6642
6643 * incremental-dump.cc (dump_incremental_inputs): Print local
6644 symbol info for each input file.
6645 * incremental.cc
6646 (Output_section_incremental_inputs::set_final_data_size): Add local
6647 symbol info to input file entries in incremental info.
6648 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6649 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6650 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6651 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6652 implementation.
6653 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6654 (Sized_incr_relobj::do_relocate): Write the local symbols.
6655 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6656 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6657 Adjust size of input file header.
6658 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6659 (Incremental_inputs_reader::get_local_symbol_count): New function.
6660 (Incremental_inputs_reader::get_input_section): Adjust size of input
6661 file header.
6662 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6663 (Sized_incr_relobj::This): New typedef.
6664 (Sized_incr_relobj::sym_size): New const data member.
6665 (Sized_incr_relobj::Local_symbol): New struct.
6666 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6667 (Sized_incr_relobj::do_local_symbol_offset): New function.
6668 (Sized_incr_relobj::local_symbol_count_): New data member.
6669 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6670 (Sized_incr_relobj::local_symbol_index_): New data member.
6671 (Sized_incr_relobj::local_symbol_offset_): New data member.
6672 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6673 (Sized_incr_relobj::local_symbols_): New data member.
6674 * object.h (Relobj::output_local_symbol_count): New function.
6675 (Relobj::local_symbol_offset): New function.
6676 (Relobj::do_output_local_symbol_count): New function.
6677 (Relobj::do_local_symbol_offset): New function.
6678 (Sized_relobj::do_output_local_symbol_count): New function.
6679 (Sized_relobj::do_local_symbol_offset): New function.
6680
d0a9ace3
ILT
66812011-04-22 Vladimir Simonov <sv@sw.ru>
6682
6683 * descriptors.cc (set_close_on_exec): New function.
6684 (Descriptors::open): Use set_close_on_exec.
6685 * output.cc (S_ISLNK): Define if not defined.
6686
94a3fc8b
CC
66872011-04-22 Cary Coutant <ccoutant@google.com>
6688
6689 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6690 global symbol map.
6691 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6692 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6693 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6694 relocations.
6695 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6696 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6697 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6698 * incremental.h
6699 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6700 function.
6701 (Incremental_binary::apply_incremental_relocs): New function.
6702 (Incremental_binary::do_apply_incremental_relocs): New function.
6703 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6704 data member.
6705 (Sized_incremental_binary::add_global_symbol): New function.
6706 (Sized_incremental_binary::global_symbol): New function.
6707 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6708 (Sized_incremental_binary::symbol_map_): New data member.
6709 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6710 * target.h (Sized_target::apply_relocation): New function.
6711 * target-reloc.h (apply_relocation): New function.
6712 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6713
c87e4302
DK
67142011-04-22 Doug Kwan <dougkwan@google.com>
6715
6716 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6717 flag of a SHT_ARM_EXIDX section.
2e702c99 6718 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6719 * testsuite/Makefile.in: Regenerate.
6720 * testsuite/arm_exidx_test.s: New file.
6721 * testsuite/arm_exidx_test.sh: Same.
6722
e7782cf6
CC
67232011-04-20 Cary Coutant <ccoutant@google.com>
6724
6725 PR gold/12689
6726 * archive.h (Incremental_archive_entry::Archive_member):
6727 Initialize arg_serial_ (second constructor).
6728
308ecdc7
ILT
67292011-04-17 Ian Lance Taylor <iant@google.com>
6730
6731 * object.cc (Relocate_info::location): Simplify location string.
6732 * errors.cc (Errors::error_at_location): Don't print program
6733 name.
6734 (Errors::warning_at_location): Likewise.
6735 (Errors::undefined_symbol): Likewise.
6736 * testsuite/debug_msg.sh: Update accordingly.
6737
bec5b579
CC
67382011-04-14 Cary Coutant <ccoutant@google.com>
6739
6740 * gold/layout.cc (Layout::symtab_section_offset): New function.
6741 * gold/layout.h (Layout::symtab_section_offset): New function.
6742 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6743
88597d34
ILT
67442011-04-12 Ian Lance Taylor <iant@google.com>
6745
6746 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6747 with MREMAP_MAYMOVE.
6748 * output.h (class Output_file): Add map_is_allocated_ field.
6749 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6750 not available, provide stubs. If mremap is not available, #define
6751 it to gold_mremap.
6752 (MREMAP_MAYMOVE): Define if not defined.
6753 (Output_file::Output_file): Initialize map_is_allocated_.
6754 (Output_file::resize): Check map_is_allocated_.
6755 (Output_file::map_anonymous): If mmap fails, use malloc.
6756 (Output_file::unmap): Don't do anything for an anonymous map.
6757 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6758 is not available, provide stubs.
6759 (File_read::View::~View): Use free rather than delete[].
6760 (File_read::make_view): Use malloc rather than new[]. If mmap
6761 fails, use malloc.
6762 (File_read::find_or_make_view): Use malloc rather than new[].
6763 * gold.h: Remove HAVE_REMAP code.
6764 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6765 exists. Rename mremap to gold_mremap. If mmap is not available
6766 don't do anything.
6767 * configure, config.in: Rebuild.
6768
11e361bc
ILT
67692011-04-11 Ian Lance Taylor <iant@google.com>
6770
6771 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6772 initialize local variable v.
6773
cdc29364
CC
67742011-04-11 Cary Coutant <ccoutant@google.com>
6775
6776 * archive.cc (Archive::include_member): Adjust call to
6777 report_object.
6778 (Add_archive_symbols::run): Track argument serial numbers.
6779 (Lib_group::include_member): Likewise.
6780 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6781 * archive.h (Incremental_archive_entry::Archive_member):
6782 Initialize arg_serial_.
6783 (Archive_member::arg_serial_): New data member.
6784 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6785 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6786 incremental link.
6787 (Sized_dynobj::do_for_all_local_got_entries): New function.
6788 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6789 function.
6790 * fileread.cc (get_mtime): New function.
6791 * fileread.h (get_mtime): New function.
6792 * gold.cc (queue_initial_tasks): Check for incremental update.
6793 (process_incremental_input): New function.
6794 (queue_middle_tasks): Don't force valid target for incremental
6795 update.
6796 * incremental-dump.cc (find_input_containing_global): Adjust
6797 size of symbol info entry.
6798 (dump_incremental_inputs): Dump argument serial number and
6799 in_system_directory flag; bias shndx by 1; print symbol names
6800 when dumping per-file symbol lists; use new symbol info readers.
6801 * incremental.cc
6802 (Output_section_incremental_inputs:update_data_size): New function.
6803 (Sized_incremental_binary::setup_readers): Setup input readers
6804 for each input file; build maps for files added from libraries
6805 and scripts.
6806 (Sized_incremental_binary::check_input_args): New function.
6807 (Sized_incremental_binary::do_check_inputs): Build map of argument
6808 serial numbers to input arguments.
6809 (Sized_incremental_binary::do_file_has_changed): Rename
6810 do_file_is_unchanged to this; compare file modification times.
6811 (Sized_incremental_binary::do_init_layout): New function.
6812 (Sized_incremental_binary::do_reserve_layout): New function.
6813 (Sized_incremental_binary::do_get_input_reader): Remove.
6814 (Sized_incremental_binary::get_symtab_view): New function.
6815 (Incremental_checker::can_incrementally_link_output_file): Remove.
6816 (Incremental_inputs::report_command_line): Exclude --debug options.
6817 (Incremental_inputs::report_archive_begin): Add parameter; track
6818 argument serial numbers; don't put input file entry for archive
6819 before archive members.
6820 (Incremental_inputs::report_archive_end): Put input file entry
6821 for archive after archive members.
6822 (Incremental_inputs::report_object): Add parameter; track argument
6823 serial numbers and in_system_directory flag.
6824 (Incremental_inputs::report_script): Add parameter; track argument
6825 serial numbers.
6826 (Output_section_incremental_inputs::set_final_data_size): Adjust
6827 size of symbol info entry; check for forwarding symbols.
6828 (Output_section_incremental_inputs::write_input_files): Write
6829 in_system_directory flag and argument serial number.
6830 (Output_section_incremental_inputs::write_info_blocks): Map section
6831 indices between incremental info and original input file; store
6832 input section index for each symbol.
6833 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6834 change operator() to visit().
6835 (class Global_got_offset_visitor): Likewise.
6836 (class Global_symbol_visitor_got_plt):
6837 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6838 classes.
6839 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6840 (Sized_incr_relobj::do_read_symbols): New function.
6841 (Sized_incr_relobj::do_layout): New function.
6842 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6843 (Sized_incr_relobj::do_add_symbols): New function.
6844 (Sized_incr_relobj::do_should_include_member): New function.
6845 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6846 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6847 (Sized_incr_relobj::do_section_size): New function.
6848 (Sized_incr_relobj::do_section_name): New function.
6849 (Sized_incr_relobj::do_section_contents): New function.
6850 (Sized_incr_relobj::do_section_flags): New function.
6851 (Sized_incr_relobj::do_section_entsize): New function.
6852 (Sized_incr_relobj::do_section_address): New function.
6853 (Sized_incr_relobj::do_section_type): New function.
6854 (Sized_incr_relobj::do_section_link): New function.
6855 (Sized_incr_relobj::do_section_info): New function.
6856 (Sized_incr_relobj::do_section_addralign): New function.
6857 (Sized_incr_relobj::do_initialize_xindex): New function.
6858 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6859 (Sized_incr_relobj::do_read_relocs): New function.
6860 (Sized_incr_relobj::do_gc_process_relocs): New function.
6861 (Sized_incr_relobj::do_scan_relocs): New function.
6862 (Sized_incr_relobj::do_count_local_symbols): New function.
6863 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6864 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6865 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6866 (Sized_incr_relobj::do_relocate): New function.
6867 (Sized_incr_relobj::do_set_section_offset): New function.
6868 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6869 (Sized_incr_dynobj::do_read_symbols): New function.
6870 (Sized_incr_dynobj::do_layout): New function.
6871 (Sized_incr_dynobj::do_add_symbols): New function.
6872 (Sized_incr_dynobj::do_should_include_member): New function.
6873 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6874 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6875 (Sized_incr_dynobj::do_section_size): New function.
6876 (Sized_incr_dynobj::do_section_name): New function.
6877 (Sized_incr_dynobj::do_section_contents): New function.
6878 (Sized_incr_dynobj::do_section_flags): New function.
6879 (Sized_incr_dynobj::do_section_entsize): New function.
6880 (Sized_incr_dynobj::do_section_address): New function.
6881 (Sized_incr_dynobj::do_section_type): New function.
6882 (Sized_incr_dynobj::do_section_link): New function.
6883 (Sized_incr_dynobj::do_section_info): New function.
6884 (Sized_incr_dynobj::do_section_addralign): New function.
6885 (Sized_incr_dynobj::do_initialize_xindex): New function.
6886 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6887 (make_sized_incremental_object): New function.
6888 (Incremental_library::copy_unused_symbols): New function.
6889 (Incremental_library::do_for_all_unused_symbols): New function.
6890 * incremental.h (enum Incremental_input_flags): New type.
6891 (class Incremental_checker): Remove.
6892 (Incremental_input_entry::Incremental_input_entry): Add argument
6893 serial number.
6894 (Incremental_input_entry::arg_serial): New function.
6895 (Incremental_input_entry::set_is_in_system_directory): New function.
6896 (Incremental_input_entry::is_in_system_directory): New function.
6897 (Incremental_input_entry::arg_serial_): New data member.
6898 (Incremental_input_entry::is_in_system_directory_): New data member.
6899 (class Script_info): Move here from script.h.
6900 (Script_info::Script_info): Add filename parameter.
6901 (Script_info::filename): New function.
6902 (Script_info::filename_): New data member.
6903 (Incremental_script_entry::Incremental_script_entry): Add argument
6904 serial number.
6905 (Incremental_object_entry::Incremental_object_entry): Likewise.
6906 (Incremental_object_entry::add_input_section): Build list of input
6907 sections with map to original shndx.
6908 (Incremental_object_entry::get_input_section_index): New function.
6909 (Incremental_object_entry::shndx_): New data member.
6910 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6911 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6912 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6913 serial number.
6914 (Incremental_inputs::report_archive_begin): Likewise.
6915 (Incremental_inputs::report_object): Likewise.
6916 (Incremental_inputs::report_script): Likewise.
6917 (class Incremental_global_symbol_reader): New class.
6918 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6919 and store flags and input file type.
6920 (Incremental_input_entry_reader::arg_serial): New function.
6921 (Incremental_input_entry_reader::type): Extract type from flags.
6922 (Incremental_input_entry_reader::is_in_system_directory): New function.
6923 (Incremental_input_entry_reader::get_input_section_count): Call
6924 accessor function for type.
6925 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6926 function for type; adjust size of global symbol entry.
6927 (Incremental_input_entry_reader::get_global_symbol_count): Call
6928 accessor function for type.
6929 (Incremental_input_entry_reader::get_object_count): Likewise.
6930 (Incremental_input_entry_reader::get_object_offset): Likewise.
6931 (Incremental_input_entry_reader::get_member_count): Likewise.
6932 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6933 (Incremental_input_entry_reader::get_member_offset): Likewise.
6934 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6935 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6936 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6937 (Incremental_input_entry_reader::get_global_symbol_reader): New
6938 function.
6939 (Incremental_input_entry_reader::get_output_symbol_index): New
6940 function.
6941 (Incremental_input_entry_reader::type_): Remove.
6942 (Incremental_input_entry_reader::flags_): New data member.
6943 (Incremental_inputs_reader::input_file_offset): New function.
6944 (Incremental_inputs_reader::input_file_index): New function.
6945 (Incremental_inputs_reader::input_file): Call input_file_offset.
6946 (Incremental_inputs_reader::input_file_at_offset): New function.
6947 (Incremental_relocs_reader::get_r_type): Reformat.
6948 (Incremental_relocs_reader::get_r_shndx): Reformat.
6949 (Incremental_relocs_reader::get_r_offset): Reformat.
6950 (Incremental_relocs_reader::data): New function.
6951 (Incremental_binary::Incremental_binary): Initialize new data members.
6952 (Incremental_binary::check_inputs): Add cmdline parameter.
6953 (Incremental_binary::file_is_unchanged): Remove.
6954 (Input_reader::arg_serial): New function.
6955 (Input_reader::get_unused_symbol_count): New function.
6956 (Input_reader::get_unused_symbol): New function.
6957 (Input_reader::do_arg_serial): New function.
6958 (Input_reader::do_get_unused_symbol_count): New function.
6959 (Input_reader::do_get_unused_symbol): New function.
6960 (Incremental_binary::input_file_count): New function.
6961 (Incremental_binary::get_input_reader): Change signature to use
6962 index instead of filename.
6963 (Incremental_binary::file_has_changed): New function.
6964 (Incremental_binary::get_input_argument): New function.
6965 (Incremental_binary::get_library): New function.
6966 (Incremental_binary::get_script_info): New function.
6967 (Incremental_binary::init_layout): New function.
6968 (Incremental_binary::reserve_layout): New function.
6969 (Incremental_binary::output_file): New function.
6970 (Incremental_binary::do_check_inputs): New function.
6971 (Incremental_binary::do_file_is_unchanged): Remove.
6972 (Incremental_binary::do_file_has_changed): New function.
6973 (Incremental_binary::do_init_layout): New function.
6974 (Incremental_binary::do_reserve_layout): New function.
6975 (Incremental_binary::do_input_file_count): New function.
6976 (Incremental_binary::do_get_input_reader): Change signature.
6977 (Incremental_binary::input_args_map_): New data member.
6978 (Incremental_binary::library_map_): New data member.
6979 (Incremental_binary::script_map_): New data member.
6980 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6981 new data members.
6982 (Sized_incremental_binary::output_section): New function.
6983 (Sized_incremental_binary::inputs_reader): Add const.
6984 (Sized_incremental_binary::symtab_reader): Add const.
6985 (Sized_incremental_binary::relocs_reader): Add const.
6986 (Sized_incremental_binary::got_plt_reader): Add const.
6987 (Sized_incremental_binary::get_symtab_view): New function.
6988 (Sized_incremental_binary::Inputs_reader): New typedef.
6989 (Sized_incremental_binary::Input_entry_reader): New typedef.
6990 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6991 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6992 (Sized_incremental_binary::do_file_has_changed): New function.
6993 (Sized_incremental_binary::do_init_layout): New function.
6994 (Sized_incremental_binary::do_reserve_layout): New function.
6995 (Sized_input_reader::Inputs_reader): Remove.
6996 (Sized_input_reader::Input_entry_reader): Remove.
6997 (Sized_input_reader::do_arg_serial): New function.
6998 (Sized_input_reader::do_get_unused_symbol_count): New function.
6999 (Sized_input_reader::do_get_unused_symbol): New function.
7000 (Sized_incremental_binary::do_input_file_count): New function.
7001 (Sized_incremental_binary::do_get_input_reader): Change signature;
7002 use index instead of filename.
7003 (Sized_incremental_binary::section_map_): New data member.
7004 (Sized_incremental_binary::input_entry_readers_): New data member.
7005 (class Sized_incr_relobj): New class.
7006 (class Sized_incr_dynobj): New class.
7007 (make_sized_incremental_object): New function.
7008 (class Incremental_library): New class.
7009 * layout.cc (Free_list::num_lists): New static data member.
7010 (Free_list::num_nodes): New static data member.
7011 (Free_list::num_removes): New static data member.
7012 (Free_list::num_remove_visits): New static data member.
7013 (Free_list::num_allocates): New static data member.
7014 (Free_list::num_allocate_visits): New static data member.
7015 (Free_list::init): New function.
7016 (Free_list::remove): New function.
7017 (Free_list::allocate): New function.
7018 (Free_list::dump): New function.
7019 (Free_list::print_stats): New function.
7020 (Layout_task_runner::run): Resize output file for incremental updates.
7021 (Layout::Layout): Initialize new data members.
7022 (Layout::set_incremental_base): New function.
7023 (Layout::init_fixed_output_section): New function.
7024 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7025 incremental updates.
7026 (Layout::create_gold_note): Do not create gold note section for
7027 incremental updates.
7028 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7029 for incremental updates.
7030 (Layout::set_section_offsets): For incremental updates, allocate space
7031 from free list.
7032 (Layout::create_symtab_sections): Layout with offsets relative to
7033 start of section; for incremental updates, allocate space from free
7034 list.
7035 (Layout::create_shdrs): For incremental updates, allocate space from
7036 free list.
7037 (Layout::finish_dynamic_section): For incremental updates, do not
7038 check --as-needed (fixed in subsequent patch).
7039 * layout.h (class Free_list): New class.
7040 (Layout::set_incremental_base): New function.
7041 (Layout::incremental_base): New function.
7042 (Layout::init_fixed_output_section): New function.
7043 (Layout::allocate): New function.
7044 (Layout::incremental_base_): New data member.
7045 (Layout::free_list_): New data member.
7046 * main.cc (main): Print Free_list statistics.
7047 * object.cc (Relobj::finalize_incremental_relocs): Add
7048 clear_counts parameter; clear counts only when clear_counts is set.
7049 (Sized_relobj::Sized_relobj): Initialize new base class.
7050 (Sized_relobj::do_layout): Don't report special sections.
7051 (Sized_relobj::do_for_all_local_got_entries): New function.
7052 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7053 symtab_off to all symbol table offsets.
7054 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7055 * object.h (class Got_offset_list): Move to top of file.
7056 (Object::Object): Allow case where input_file == NULL.
7057 (Object::~Object): Likewise.
7058 (Object::input_file): Assert that input_file != NULL.
7059 (Object::lock): Allow case where input_file == NULL.
7060 (Object::unlock): Likewise.
7061 (Object::is_locked): Likewise.
7062 (Object::token): Likewise.
7063 (Object::release): Likewise.
7064 (Object::is_incremental): New function.
7065 (Object::get_mtime): New function.
7066 (Object::for_all_local_got_entries): New function.
7067 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7068 (Object::set_is_in_system_directory): New function.
7069 (Object::is_in_system_directory): New function.
7070 (Object::do_is_incremental): New function.
7071 (Object::do_get_mtime): New function.
7072 (Object::do_for_all_local_got_entries): New function.
7073 (Object::is_in_system_directory_): New data member.
7074 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7075 (class Sized_relobj_base): New class.
7076 (class Sized_relobj): Derive from Sized_relobj_base.
7077 (class Sized_relobj::Symbols): Redeclare from base class.
7078 (class Sized_relobj::local_got_offset_list): Remove.
7079 (class Sized_relobj::Output_sections): Redeclare from base class.
7080 (class Sized_relobj::do_for_all_local_got_entries): New function.
7081 (class Sized_relobj::write_local_symbols): Add offset parameter.
7082 (class Sized_relobj::local_symbol_offset_): Update comment.
7083 (class Sized_relobj::local_dynsym_offset_): Update comment.
7084 * options.cc (Input_arguments::add_file): Remove const.
7085 * options.h (Input_file_argument::Input_file_argument):
7086 Initialize arg_serial_ (all constructors).
7087 (Input_file_argument::set_arg_serial): New function.
7088 (Input_file_argument::arg_serial): New function.
7089 (Input_file_argument::arg_serial_): New data member.
7090 (Input_arguments::Input_arguments): Initialize file_count_.
7091 (Input_arguments::add_file): Remove const.
7092 (Input_arguments::number_of_input_files): New function.
7093 (Input_arguments::file_count_): New data member.
7094 (Command_line::number_of_input_files): Call
7095 Input_arguments::number_of_input_files.
7096 * output.cc (Output_segment_headers::Output_segment_headers):
7097 Set current size.
7098 (Output_section::Input_section::current_data_size): New function.
7099 (Output_section::Output_section): Initialize new data members.
7100 (Output_section::add_input_section): Don't do merge sections for
7101 an incremental link; allocate space from free list for an
7102 incremental update.
7103 (Output_section::add_output_section_data): Allocate space from
7104 free list for an incremental update.
7105 (Output_section::update_data_size): New function.
7106 (Output_section::set_fixed_layout): New function.
7107 (Output_section::reserve): New function.
7108 (Output_segment::set_section_addresses): Remove const.
7109 (Output_segment::set_section_list_addresses): Remove const; allocate
7110 space from free list for an incremental update.
7111 (Output_segment::set_offset): Adjust size of RELRO segment for an
7112 incremental update.
7113 * output.h (Output_data::current_data_size): Move here from
7114 child classes.
7115 (Output_data::pre_finalize_data_size): New function.
7116 (Output_data::update_data_size): New function.
7117 (Output_section_headers::update_data_size): new function.
7118 (Output_section_data_build::current_data_size): Move to Output_data.
7119 (Output_data_strtab::update_data_size): New function.
7120 (Output_section::current_data_size): Move to Output_data.
7121 (Output_section::set_fixed_layout): New function.
7122 (Output_section::has_fixed_layout): New function.
7123 (Output_section::reserve): New function.
7124 (Output_section::update_data_size): New function.
7125 (Output_section::has_fixed_layout_): New data member.
7126 (Output_section::free_list_): New data member.
7127 (Output_segment::set_section_addresses): Remove const.
7128 (Output_segment::set_section_list_addresses): Remove const.
7129 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7130 New function.
7131 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7132 New function.
7133 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7134 parameter when calling Add_symbols constructor; store argument
7135 serial number for members of a lib group.
7136 (Add_symbols::locks): Allow case where token == NULL.
7137 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7138 (Read_member::~Read_member): New function.
7139 (Read_member::is_runnable): New function.
7140 (Read_member::locks): New function.
7141 (Read_member::run): New function.
7142 (Check_script::~Check_script): New function.
7143 (Check_script::is_runnable): New function.
7144 (Check_script::locks): New function.
7145 (Check_script::run): New function.
7146 (Check_library::~Check_library): New function.
7147 (Check_library::is_runnable): New function.
7148 (Check_library::locks): New function.
7149 (Check_library::run): New function.
7150 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7151 (Add_symbols::library_): New data member.
7152 (class Read_member): New class.
7153 (class Check_script): New class.
7154 (class Check_library): New class.
7155 * reloc.cc (Read_relocs::is_runnable): Allow case where
7156 token == NULL.
7157 (Read_relocs::locks): Likewise.
7158 (Scan_relocs::locks): Likewise.
7159 (Relocate_task::locks): Likewise.
7160 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7161 to clear counters.
7162 (Sized_relobj::incremental_relocs_scan): Fix comment.
7163 (Sized_relobj::do_relocate): Pass output file offset to
7164 write_local_symbols.
7165 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7166 from class declaration.
7167 * script.cc (read_input_script): Allocate Script_info; pass
7168 argument serial number to report_script.
7169 * script.h (class Script_info): Move to incremental.h.
7170 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7171 * symtab.h (Symbol_table::add_from_incrobj): New function.
7172 (Symbol_table::set_file_offset): New function.
7173
b961d0d7
CC
71742011-04-05 Cary Coutant <ccoutant@google.com>
7175
7176 * incremental-dump.cc (dump_incremental_inputs): Change signature
7177 to take a Sized_incremental_binary; change caller. Use readers
7178 in Sized_incremental_binary.
7179 * incremental.cc
7180 (Sized_incremental_binary::find_incremental_inputs_sections):
7181 Rename do_find_incremental_inputs_sections to this.
7182 (Sized_incremental_binary::setup_readers): New function.
7183 (Sized_incremental_binary::do_check_inputs): Check
7184 has_incremental_info_ flag; move setup code to setup_readers;
7185 use input readers.
7186 (Sized_incremental_binary::do_file_is_unchanged): New function.
7187 (Sized_incremental_binary::do_get_input_reader): New function.
7188 * incremental.h (class Incremental_binary): Move to end of file.
7189 (Incremental_binary::file_is_unchanged): New function.
7190 (Incremental_binary::do_file_is_unchanged): New function.
7191 (Incremental_binary::Input_reader): New class.
7192 (Incremental_binary::get_input_reader): New function.
7193 (class Sized_incremental_binary): Move to end of file.
7194 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7195 input section reader classes.
7196 (Sized_incremental_binary::has_incremental_info): New function.
7197 (Sized_incremental_binary::inputs_reader): New function.
7198 (Sized_incremental_binary::symtab_reader): New function.
7199 (Sized_incremental_binary::relocs_reader): New function.
7200 (Sized_incremental_binary::got_plt_reader): New function.
7201 (Sized_incremental_binary::do_file_is_unchanged): New function.
7202 (Sized_incremental_binary::Sized_input_reader): New class.
7203 (Sized_incremental_binary::get_input_reader): New function.
7204 (Sized_incremental_binary::find_incremental_inputs_sections):
7205 Rename do_find_incremental_inputs_sections to this.
7206 (Sized_incremental_binary::setup_readers): New function.
7207 (Sized_incremental_binary::has_incremental_info_): New data member.
7208 (Sized_incremental_binary::inputs_reader_): New data member.
7209 (Sized_incremental_binary::symtab_reader_): New data member.
7210 (Sized_incremental_binary::relocs_reader_): New data member.
7211 (Sized_incremental_binary::got_plt_reader_): New data member.
7212 (Sized_incremental_binary::current_input_file_): New data member.
7213
a869183f
PP
72142011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7215
7216 PR gold/12640
7217 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7218 violation.
7219
72202011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7221
7222 * archive.cc (Archive::include_member): Adjust call to report_object.
7223 (Add_archive_symbols::run): Add script_info to call to
7224 report_archive_begin.
7225 (Lib_group::include_member): Adjust call to report_object.
7226 (Add_lib_group_symbols::run): Adjust call to report_object.
7227 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7228 blocks. Add object count for script input files.
7229 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7230 script_info parameter; change all callers.
7231 (Incremental_inputs::report_object): Add script_info parameter;
7232 change all callers.
7233 (Incremental_inputs::report_script): Store backpointer to
7234 incremental info entry.
7235 (Output_section_incremental_inputs::set_final_data_size): Record
7236 additional information for scripts.
7237 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7238 * incremental.h (Incremental_script_entry::add_object): New function.
7239 (Incremental_script_entry::get_object_count): New function.
7240 (Incremental_script_entry::get_object): New function.
7241 (Incremental_script_entry::objects_): New data member; adjust
7242 constructor.
7243 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7244 (Incremental_inputs::report_object): Add script_info parameter.
7245 (Incremental_inputs_reader::get_object_count): New function.
7246 (Incremental_inputs_reader::get_object_offset): New function.
7247 * options.cc (Input_arguments::add_file): Return reference to
7248 new input argument.
7249 * options.h (Input_argument::set_script_info): New function.
7250 (Input_argument::script_info): New function.
7251 (Input_argument::script_info_): New data member; adjust all
7252 constructors.
7253 (Input_file_group::add_file): Return reference to new input argument.
7254 (Input_file_lib::add_file): Likewise.
7255 (Input_arguments::add_file): Likewise.
7256 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7257 * script.cc (Parser_closure::Parser_closure): Add script_info
7258 parameter; adjust all callers.
7259 (Parser_closure::script_info): New function.
7260 (Parser_closure::script_info_): New data member.
7261 (read_input_script): Report scripts earlier to incremental info.
7262 (script_add_file): Set script_info in Input_argument.
7263 (script_add_library): Likewise.
7264 * script.h (Script_options::Script_info): Rewrite class.
7265
a869183f 72662011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7267
7268 * archive.cc (Library_base::should_include_member): Move
7269 method here from class Archive.
7270 (Archive::Archive): Initialize base class.
7271 (Archive::should_include_member): Move to base class.
7272 (Archive::do_for_all_unused_symbols): New function.
7273 (Add_archive_symbols::run): Remove redundant access to
7274 incremental_inputs.
7275 (Lib_group::Lib_group): Initialize base class.
7276 (Lib_group::do_filename): New function.
7277 (Lib_group::include_member): Pass pointer to Lib_group to
7278 report_object.
7279 (Lib_group::do_for_all_unused_symbols): New function.
7280 (Add_lib_group_symbols::run): Report archive information for
7281 incremental links.
7282 * archive.h (class Library_base): New base class.
7283 (class Archive): Derive from Library_base.
7284 (Archive::filename): Move to base class.
7285 (Archive::set_incremental_info): Likewise.
7286 (Archive::incremental_info): Likewise.
7287 (Archive::Should_include): Likewise.
7288 (Archive::should_include_member): Likewise.
7289 (Archive::Armap_entry): Remove.
7290 (Archive::Unused_symbol_iterator): Remove.
7291 (Archive::unused_symbols_begin): Remove.
7292 (Archive::unused_symbols_end): Remove.
7293 (Archive::do_filename): New function.
7294 (Archive::do_get_mtime): New function.
7295 (Archive::do_for_all_unused_symbols): New function.
7296 (Archive::task_): Move to base class.
7297 (Archive::incremental_info_): Likewise.
7298 (class Lib_group): Derive from Library_base.
7299 (Lib_group::do_filename): New function.
7300 (Lib_group::do_get_mtime): New function.
7301 (Lib_group::do_for_all_unused_symbols): New function.
7302 (Lib_group::task_): Move to base class.
7303 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7304 function.
7305 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7306 function.
7307 * incremental.cc (Incremental_inputs::report_archive_begin):
7308 Use Library_base; call library's get_mtime; add incremental inputs
7309 entry before members.
7310 (class Unused_symbol_visitor): New class.
7311 (Incremental_inputs::report_archive_end): Use Library_base; use
7312 visitor class to record unused symbols; don't add incremental inputs
7313 entry after members.
7314 (Incremental_inputs::report_object): Use Library_base.
7315 * incremental.h
7316 (Incremental_archive_entry::Incremental_archive_entry): Remove
7317 unused Archive parameter.
7318 (Incremental_inputs::report_archive_begin): Use Library_base.
7319 (Incremental_inputs::report_archive_end): Likewise.
7320 (Incremental_inputs::report_object): Likewise.
7321 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7322 function.
7323 * object.h (Object::for_all_global_symbols): New function.
7324 (Object::do_for_all_global_symbols): New function.
7325 (Sized_relobj::do_for_all_global_symbols): New function.
7326 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7327 function.
7328 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7329 function.
7330
61ab3e40
ILT
73312011-03-27 Ian Lance Taylor <iant@google.com>
7332
7333 * archive.cc (Archive::interpret_header): Return -1 if something
7334 goes wrong. Change callers accordingly.
7335
30e1f9e6
CC
73362011-03-25 Cary Coutant <ccoutant@google.com>
7337
7338 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7339 * testsuite/Makefile.in: Regenerate.
7340
9370ce59 73412011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7342
7343 * plugin.cc (get_view): New.
7344 (Plugin::load): Pass get_view to the plugin.
7345 (Plugin_manager::get_view): New.
7346
9312bb0a
ILT
73472011-03-21 Ian Lance Taylor <iant@google.com>
7348
7349 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7350 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7351
7e12ba9e
ST
73522011-03-21 Sriraman Tallam <tmsriram@google.com>
7353
7354 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7355 Change == to -eq.
7356 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7357 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7358 Change == to -eq.
7359 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7360 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7361
fd7a005d
ILT
73622011-03-14 Ian Lance Taylor <iant@google.com>
7363
7364 * script-sections.cc (Sort_output_sections::script_compare):
7365 Rename from is_before, change return type.
7366 (Sort_output_sections::operator()): Adjust accordingly.
7367
ed16fd1b
ILT
73682011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7369
7370 PR gold/12572
7371 * testsuite/odr_violation2.cc: Add comment to make all error line
7372 numbers double digits.
7373 * testsuite/debug_msg.sh: Adjust expected errors.
7374
71ff8986
ILT
73752011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7376
7377 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7378 but mark earlier ones as non-canonical
7379 (offset_to_iterator): Update search target and example
7380 (do_addr2line): Return extra lines in a vector*
7381 (format_file_lineno): Extract from do_addr2line
7382 (one_addr2line): Add vector* out-param
7383 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7384 when a lineno entry appeared last for its instruction
7385 (Dwarf_line_info): Add vector* out-param
7386 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7387 * symtab.cc (Odr_violation_compare): Include the lineno in the
7388 comparison again.
7389 (linenos_from_loc): New. Combine the canonical line for an
7390 address with its other lines.
7391 (True_if_intersect): New. Helper functor to make
7392 std::set_intersection a query.
7393 (detect_odr_violations): Compare sets of lines instead of just
7394 one line for each function. This became less deterministic, but
7395 has fewer false positives.
7396 * symtab.h: Declarations.
7397 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7398 mix an optimized and non-optimized object in the same binary
7399 (odr_violation2.so): Same.
7400 * testsuite/Makefile.in: Regenerate from Makefile.am.
7401 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7402 * testsuite/debug_msg.sh: Update line numbers and add
7403 assertions.
7404 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7405 non-optimized context.
7406 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7407 isn't inlined, and use OdrDerived in an optimized context.
7408 * testsuite/odr_header1.h: Defines OdrDerived, where
7409 optimization will change the
7410 first-instruction-in-the-destructor's file and line number.
7411 * testsuite/odr_header2.h: Defines OdrBase.
7412
a19fefdc
ILT
74132011-03-09 Ian Lance Taylor <iant@google.com>
7414
7415 * fileread.cc (File_read::clear_views): Don't delete the whole
7416 file view.
7417
ecb351e9
ILT
74182011-03-08 Ian Lance Taylor <iant@google.com>
7419
7420 PR gold/12525
7421 * fileread.cc: #include <climits>.
7422 (GOLD_IOV_MAX): Define.
7423 (File_read::read_multiple): Limit number of entries by iov_max.
7424 * fileread.h (class File_read): Always set max_readv_entries to
7425 128.
7426
b821d13c
ILT
74272011-03-07 Ian Lance Taylor <iant@google.com>
7428
7429 PR gold/12525
7430 * options.h (class General_options): Add -dy and -dn.
7431
89243142
CC
74322011-03-02 Cary Coutant <ccoutant@google.com>
7433
7434 * testsuite/script_test_9.t: Add TLS segment.
7435
d0773f31
ILT
74362011-03-02 Simon Baldwin <simonb@google.com>
7437
7438 * configure.ac: Add check for gnu_indirect_function support in
7439 the toolchain building binutils.
7440 * configure: Rebuild.
7441
9370ce59 74422011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7443
7444 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7445 plugin only symbols.
7446 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7447 in plugin files as not needed in the symbol table.
7448
4cf7a849
ST
74492011-02-11 Sriraman Tallam <tmsriram@google.com>
7450
7451 * output.cc (Output_section::add_input_section): Delay fill
7452 generation for section ordering.
7453
b578bd7d
ILT
74542011-02-09 Ian Lance Taylor <iant@google.com>
7455
7456 PR gold/12316
7457 * object.h (class Sized_relobj): Remove clear_local_symbols.
7458 * reloc.cc (Sized_relobj::do_relocate): Don't call
7459 clear_local_symbols.
7460
9370ce59 74612011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7462
7463 * plugin.cc (is_visible_from_outside): Return true for symbols
7464 in the -u option.
7465
55382fb7
ILT
74662011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7467
7468 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7469 filename.
7470
4e271fff
ST
74712011-02-02 Sriraman Tallam <tmsriram@google.com>
7472
7473 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7474 to std::string.
4e271fff 7475 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7476 section_name to be std::string.
4e271fff
ST
7477 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7478
d433c3ac
ILT
74792011-01-25 Ian Lance Taylor <iant@google.com>
7480
7481 * script.cc (script_add_extern): Rewrite to use
7482 add_symbol_reference.
7483
880473a6
DK
74842011-01-25 Doug Kwan <dougkwan@google.com>
7485
d433c3ac 7486 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7487
f30f86fa
ILT
74882011-01-24 Ian Lance Taylor <iant@google.com>
7489
7490 * options.h (class General_options): Accept
7491 --no-detect-odr-violations.
7492
8e51a0b9
ILT
74932011-01-24 Ian Lance Taylor <iant@google.com>
7494
7495 * version.cc (version_string): Bump to 1.11.
7496
0f3b89d8
ILT
74972011-01-24 Ian Lance Taylor <iant@google.com>
7498
7499 * plugin.cc (class Plugin_rescan): Define new class.
7500 (Plugin_manager::claim_file): Set any_claimed_.
7501 (Plugin_manager::save_archive): New function.
7502 (Plugin_manager::save_input_group): New function.
7503 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7504 necessary.
7505 (Plugin_manager::new_undefined_symbol): New function.
7506 (Plugin_manager::rescan): New function.
7507 (Plugin_manager::rescannable_defines): New function.
7508 (Plugin_manager::add_input_file): Set any_added_.
7509 * plugin.h (class Plugin_manager): define new fields rescannable_,
7510 undefined_symbols_, any_claimed_, and any_added_. Declare
7511 Plugin_rescan as friend. Declare new functions.
7512 (Plugin_manager::Rescannable): Define type.
7513 (Plugin_manager::Rescannable_list): Define type.
7514 (Plugin_manager::Undefined_symbol_list): Define type.
7515 (Plugin_manager::Plugin_manager): Initialize new fields.
7516 * archive.cc (Archive::defines_symbol): New function.
7517 (Add_archive_symbols::run): Pass archive to plugins if any.
7518 * archive.h (class Archive): Declare defines_symbol.
7519 * readsyms.cc (Input_group::~Input_group): New function.
7520 (Finish_group::run): Pass input_group to plugins if any.
7521 * readsyms.h (class Input_group): Declare destructor.
7522 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7523 any.
7524
3bb951e5
ILT
75252011-01-10 Ian Lance Taylor <iant@google.com>
7526
7527 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7528 section as relro.
7529 (Layout::set_segment_offsets): Reset increase_relro before calling
7530 set_section_addresses a second time.
7531
0aa45fac
CC
75322011-01-04 Cary Coutant <ccoutant@google.com>
7533
7534 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7535 sections before NOBITS sections.
7536
0db46eb4
L
75372011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7538
7539 * version.cc (print_version): Update copyright to 2011.
7540
829c9745
CC
75412010-12-23 Cary Coutant <ccoutant@google.com>
7542
7543 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7544 of OS to this->add. Add OD parameter to second form of the function.
7545
7500420b
ILT
75462010-12-20 Ian Lance Taylor <iant@google.com>
7547
7548 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7549 second of two consecutive entries with same offset.
7550
f8e9a930
RW
75512010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7552
7553 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7554 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7555 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7556 to avoid unneeded links against $(LDADD).
7557 * testsuite/Makefile.in: Regenerate.
7558
2fbb4320
ILT
75592010-12-15 Ian Lance Taylor <iant@google.com>
7560
7561 PR gold/12324
7562 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7563 for R_X86_64_32 and R_X86_64_PC32.
7564 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7565 ver_matching_def_pic.o.
7566 (ver_matching_def_pic.o): New target.
7567
fedb228d
RW
75682010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7569
7570 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7571 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7572 Move definition before File_read::View member definitions.
7573 (File_read::View::~View): Initialize and hold lock before
7574 updating current_mapped_bytes.
7575
9b547ce6
RW
75762010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7577
7578 * dwarf_reader.cc: Remove outdated comment.
7579 * gold-threads.cc: Fix typo in error message.
7580 * archive.cc: Fix typos in comments.
7581 * archive.h: Likewise.
7582 * arm-reloc-property.cc: Likewise.
7583 * arm-reloc-property.h: Likewise.
7584 * arm-reloc.def: Likewise.
7585 * arm.cc: Likewise.
7586 * attributes.h: Likewise.
7587 * cref.cc: Likewise.
7588 * ehframe.cc: Likewise.
7589 * fileread.h: Likewise.
7590 * gold.h: Likewise.
7591 * i386.cc: Likewise.
7592 * icf.cc: Likewise.
7593 * incremental.h: Likewise.
7594 * int_encoding.cc: Likewise.
7595 * layout.h: Likewise.
7596 * main.cc: Likewise.
7597 * merge.h: Likewise.
7598 * object.cc: Likewise.
7599 * object.h: Likewise.
7600 * options.cc: Likewise.
7601 * readsyms.cc: Likewise.
7602 * reduced_debug_output.cc: Likewise.
7603 * reloc.cc: Likewise.
7604 * script-sections.cc: Likewise.
7605 * sparc.cc: Likewise.
7606 * symtab.h: Likewise.
7607 * target-reloc.h: Likewise.
7608 * target.cc: Likewise.
7609 * target.h: Likewise.
7610 * timer.cc: Likewise.
7611 * timer.h: Likewise.
7612 * x86_64.cc: Likewise.
7613
83e17bd5
CC
76142010-12-09 Cary Coutant <ccoutant@google.com>
7615
7616 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7617 stack.
7618 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7619 parameter; change all callers.
7620 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7621 * options.h (warn_execstack): New option.
7622
017257f8
DK
76232010-12-07 Doug Kwan <dougkwan@google.com>
7624
7625 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7626 like function call relocations.
7627
c20cbc06
ILT
76282010-12-07 Ian Lance Taylor <iant@google.com>
7629
7630 * archive.cc (Archive::get_elf_object_for_member): Permit
7631 punconfigured to be NULL.
7632 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7633 (Archive::include_member): Pass NULL to get_elf_object_for_member
7634 if we searched for the archive and this is the first included
7635 object.
7636
4dbfafcc
ILT
76372010-12-01 Ian Lance Taylor <iant@google.com>
7638
7639 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7640 track_relocs_type_ field.
7641 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7642 Set track_relocs_type_.
7643 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7644 contents when using RELA relocs.
7645 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7646 reloc_map_.
7647 * reloc.cc (Track_relocs::next_addend): New function.
7648 * reloc.h (class Track_relocs): Declare next_addend.
7649
e5e19edd
ILT
76502010-12-01 Ian Lance Taylor <iant@google.com>
7651
7652 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7653 virtual destructor.
7654
9a5ce24c
ILT
76552010-12-01 Ian Lance Taylor <iant@google.com>
7656
7657 * README: Update compilers known to work and fail.
7658
c7791212
NC
76592010-11-23 Matthias Klose <doko@ubuntu.com>
7660
7661 * configure.in: For --enable-gold, handle value `default' instead of
7662 `both*'. Always install ld as ld.bfd, install as ld if gold is
7663 not the default.
7664 * configure: Regenerate.
7665
0ad220c9
DK
76662010-11-18 Doug Kwan <dougkwan@google.com>
7667
7668 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7669 and right_alignment to be zero. Store result alignment only if it is
7670 greater than existing alignment.
7671
ab8056e0
CC
76722010-11-16 Cary Coutant <ccoutant@google.com>
7673
7674 PR gold/12220
7675 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7676 Check for ".zdebug_line".
7677
fd064a5b
CC
76782010-11-16 Doug Kwan <dougkwan@google.com>
7679 Cary Coutant <ccoutant@google.com>
7680
7681 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7682 by reference; adjust all callers.
7683 * output.cc (Output_segment::set_section_addresses): Adjust references
7684 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7685 list is empty.
7686 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7687 end at page boundary.
7688
6fc6ea19
CC
76892010-11-16 Cary Coutant <ccoutant@google.com>
7690
7691 PR gold/12220
7692 * layout.cc (Layout::choose_output_section): Transform names of
7693 compressed sections even when using a script with a SECTIONS clause.
7694 (Layout::output_section_name): Remove code to transform
7695 compressed debug section names.
7696 * output.cc (Output_section::add_input_section): Use uncompressed
7697 section size when tracking input sections.
7698
95a2c8d6
RS
76992010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7700
7701 * symtab.h (Symbol::NON_PIC_REF): Remove.
7702 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7703 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7704 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7705 (Symbol::use_plt_offset): Take a flags argument and pass it
7706 directly to needs_dynamic_reloc. Restrict check for undefined
7707 weak symbols to function calls.
7708 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7709 (Target_arm::Scan::global): Use it.
7710 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7711 (Target_arm::Relocate::relocate): Likewise.
7712 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7713 parameter with an r_type parameter. Use get_reference_flags
7714 to get the flags.
7715 (Target_arm::Relocate::relocate): Update accordingly.
7716 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7717 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7718 (Target_i386::Scan::global): Likewise.
7719 (Target_i386::Relocate::relocate): Likewise.
7720 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7721 parameter with an r_type parameter. Use get_reference_flags
7722 to get the flags.
7723 (Target_i386::Relocate::relocate): Update accordingly.
7724 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7725 (Target_powerpc::Scan::global): Use it.
7726 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7727 (Target_powerpc::Relocate::relocate): Likewise.
7728 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7729 (Target_sparc::Scan::global): Use it.
7730 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7731 (Target_sparc::Relocate::relocate): Likewise.
7732 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7733 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7734 (Target_x86_64::Scan::global): Likewise.
7735 (Target_x86_64::Relocate::relocate): Likewise.
7736
f625ae50
DK
77372010-11-08 Doug Kwan <dougkwan@google.com>
7738 Cary Coutant <ccoutant@google.com>
7739
7740 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7741 (Arm_exidx_merge_section::section_contents_): New data member.
7742 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7743 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7744 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7745 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7746 in parameters instead of calling Object::section_contents without
7747 locking.
7748 (Arm_output_section::group_section): New parameter TASK. Pass it
7749 to callees that need locking objects.
7750 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7751 to lock EXIDX input sections. Fix a formatting issue. Call
7752 Arm_exidx_merged_section::build_contents to create merged section
7753 contents.
7754 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7755 to lock object of stub table owner.
7756 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7757 TEXT_SIZE to initialize data member TEXT_SIZE_.
7758 (Arm_exidx_input_section::addralign): Fix typo in comment.
7759 (Arm_exidx_input_section::text_size): New method.
7760 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7761 that require locking objects. Lock objects before scanning for stubs
7762 and updating local symbols.
7763 (Arm_input_section<big_endian>::init): Copy contents of original
7764 input section.
2e702c99 7765 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7766 original input section instead of calling Object::section_contents
7767 without locking.
7768 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7769 size without calling Object::section_size().
7770 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7771 for size. Allocate a buffer for merged EXIDX entries.
7772 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7773 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7774 building code to Arm_exidx_merged_section::build_contetns. Write
7775 out contetns in buffer instead of building it on the fly.
7776 (Arm_relobj::make_exidx_input_section): Also pass text section size
7777 to Arm_exidx_input_section constructor.
7778 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7779 (Arm_dynobj::do_read_symbols): Fix memory leak.
7780 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7781 * target.h: (class Task): Add forward declaration.
7782 (Target::relax): Add new parameter TASK and pass it to
7783 Target::do_relax().
7784 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7785
5f9bcf58
CC
77862010-11-05 Cary Coutant <ccoutant@google.com>
7787
7788 PR gold/10708
7789 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7790 object when reading from the file.
7791 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7792 second layout pass.
7793 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7794 when reading section contents.
7795 (get_section_contents): Likewise.
7796 (icf::find_identical_sections): Likewise.
7797 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7798 object when reading from the file.
7799 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7800 the object when doing deferred section layout.
7801
e597fa08
NC
78022010-11-03 Nick Clifton <nickc@redhat.com>
7803
7804 PR gold/12001
7805 * script.h (class Symbol_assignment: name): New member. Returns
7806 the name of the symbol.
7807 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7808 Returns true if the given symbol name is on the list of
7809 assignments wating to be processed.
7810 * archive.cc (should_incldue_member): If the symbol is undefined,
7811 check to see if it is on the list of symbols pending assignment.
7812
3f9a3278
ILT
78132010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7814
7815 * script-sections.cc (Script_sections::find_memory_region): Check
7816 for a NULL output section pointer.
7817
d06fb4d1
DK
78182010-10-29 Doug Kwan <dougkwan@google.com>
7819
7820 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7821 Output_section::add_relaxed_input_section.
7822 * output.cc (Output_section::add_relaxed_input_section): Add new
7823 arguments LAYOUT and NAME. Set section order index.
7824 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7825 Copy section order index.
7826 * output.h (Output_section::add_relaxed_input_section): Add new
7827 arguments LAYOUT and NAME.
7828
90e24de5
ILT
78292010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7830
7831 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7832 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7833 * testsuite/Makefile.in: Regenerate.
7834
c9484ea5
DK
78352010-10-20 Doug Kwan <dougkwan@google.com>
7836
7837 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7838 without SHF_LINK_ORDER flags.
7839 * layout.cc (Layout::choose_output_section): Do not filter
7840 SHF_LINK_ORDER flag in a relocatable link.
7841
5bc2f5be
CC
78422010-10-17 Cary Coutant <ccoutant@google.com>
7843
7844 * output.h (Output_segment::set_section_addresses): Change function
7845 signature. Update all callers.
7846 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7847 sections.
7848 (Output_segment::set_section_addresses): Align after last TLS
7849 section. Add padding before last relro section instead of after.
7850
0c91cf04
DK
78512010-10-17 Doug Kwan <dougkwan@google.com>
7852
7853 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7854 GOT output section to be writable.
7855
8c21d9d3
CC
78562010-10-14 Cary Coutant <ccoutant@google.com>
7857
7858 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7859 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7860 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7861 mode.
7862 * incremental.cc (report_command_line): Ignore all forms of
7863 --incremental.
7864 * layout.cc (Layout::Layout): Check parameters for incremental link
7865 mode.
7866 * options.cc (General_options::parse_incremental): New function.
7867 (General_options::parse_no_incremental): New function.
7868 (General_options::parse_incremental_full): New function.
7869 (General_options::parse_incremental_update): New function.
7870 (General_options::incremental_mode_): New data member.
7871 (General_options::finalize): Check incremental_mode_.
7872 * options.h (General_options): Update help text for --incremental.
7873 Add --no-incremental, --incremental-full, --incremental-update.
7874 (General_options::Incremental_mode): New enum type.
7875 (General_options::incremental_mode): New function.
7876 (General_options::incremental_mode_): New data member.
7877 * parameters.cc (Parameters::incremental_mode_): New data member.
7878 (Parameters::set_options): Set incremental_mode_.
7879 (Parameters::set_incremental_full): New function.
7880 (Parameters::incremental): New function.
7881 (Parameters::incremental_update): New function.
7882 (set_parameters_incremental_full): New function.
7883 * parameters.h (Parameters::set_incremental_full): New function.
7884 (Parameters::incremental): New function.
7885 (Parameters::incremental_update): New function.
7886 (Parameters::incremental_mode_): New data member.
7887 (set_parameters_incremental_full): New function.
7888 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7889 incremental link mode.
7890 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7891 (Sized_relobj::do_relocate_sections): Likewise.
7892 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7893 option.
7894 * testsuite/Makefile.in: Regenerate.
7895 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7896
bb32aa18 78972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7898
7899 * script-sections.h (class Script_sections): Make
7900 Sections_elements typedef public.
7901 * script-sections.cc (class Sort_output_sections): Add elements_
7902 field. Add constructor which sets it; change all callers.
7903 (Sort_output_sections::is_before): New function.
7904 (Sort_output_sections::operator()): Call is_before.
7905 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7906 conditional.
7907 * testsuite/script_test_10.sh: New test. Test script section
7908 order.
7909 * testsuite/script_test_10.t: Likewise.
7910 * testsuite/script_test_10.s: Likewise.
7911 * testsuite/Makefile.am: Wrap the cross linker tests and the
7912 common tests into NATIVE_OR_CROSS_LINKER.
7913 (check_SCRIPTS): Add script_test_10.sh.
7914 (check_DATA): Add script_test_10.stdout.
7915 (script_test_10.o, script_test_10): New targets.
7916 (script_test_10.stdout): New target.
7917 * configure, testsuite/Makefile.in: Regenerate.
7918
3cef7179
ILT
79192010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7920
7921 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7922 error for the deprecated relocations.
7923 (Target_arm::Scan::global): Likewise.
7924 (Target_arm::Relocate::relocate): Likewise.
7925
7411e9a8
RS
79262010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7927
7928 * fileread.cc (Input_file::find_file): Initialize *found_name
7929 and *namep when using the fallback search for case 4.
7930
6a9da32a
CC
79312010-10-11 Cary Coutant <ccoutant@google.com>
7932
7933 * options.h (class General_options): Redefine -z lazy as an alias for
7934 the negation of -z now.
7935
ac897c20
ILT
79362010-10-11 Ian Lance Taylor <iant@google.com>
7937
7938 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7939 binding.
7940
ea5cae92
NC
79412010-10-06 Nick Clifton <nickc@redhat.com>
7942
7943 * script-sections.cc(class Memory_region): Remove
7944 current_lma_offset_ field. Rename current_vma_offset_ to
7945 current_offset_. Add last_section_ field.
7946 (Memory_region::get_current_vma_address): Rename to
7947 get_current_address.
7948 (Memory_region::get_current_lma_address): Delete.
7949 (Memory_region::increment_vma_offset): Rename to
7950 increment_offset.
7951 (Memory_region::increment_lma_offset): Delete.
7952 (Memory_region::attributes_compatible): New method. Returns
7953 true if the provided section is compatible with the region.
7954 (Memory_region::get_last_section): New method. Returns the last
7955 section to use the region.
7956 (Memory_region::set_last_section): New method. Stores the last
7957 section to use the region.
7958 (Script_sections::block_in_region): New method. Returns true if
7959 a block of memory is contained within a region.
7960 (Script_sections::find_memory_region): New method. Locates a
7961 memory region to be used to set a VMA or LMA address.
7962 (Output_section_definition::set_section_addresses): Add code to
7963 check for addresses set by memory regions.
7964 (Output_segment::set_section_addresses): Remove memory region
7965 walking code.
7966 (Script_sections::create_segment): Add a warning if a header
7967 segment is created outside of any region.
7968 * script-sections.h (class Script_sections): Add prototypes for
7969 find_memory_region and block_in_region methods.
7970 * testsuite/memory_test.s: Use .long instead of .word.
7971 * testsuite/memory_test.t: Add some more output sections.
7972 * testsuite/memory_test.sh: Update expected output.
7973
a9bfd952
DK
79742010-10-02 Doug Kwan <dougkwan@google.com>
7975
7976 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7977 defintion to symtab.h
7978 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7979 declaration to defintion.
7980
bacff3ab
NC
79812010-10-01 Nick Clifton <nickc@redhat.com>
7982
7983 * expression.cc (eval): Replace dummy argument with NULL.
7984 (eval_maybe_dot): Check for a NULL result section pointer.
7985 (Symbol_expression::value): Likewise.
7986 (Dot_expression::value): Likewise.
7987 (BINARY_EXPRESSION): Likewise.
7988 (Max_expression::value): Likewise.
7989 (Min_expression::value): Likewise.
7990 (Absolute_expression::value): Likewise.
7991 (Addr_expression::value_from_output_section): Likewise.
7992 (Loaddddr_expression::value_from_output_section): Likewise.
7993 (Segment_start_expression::value): Likewise.
7994 * script-sections.cc
7995 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7996 argument with NULL.
7997 (Sections_elememt_dot_assignment::set_section_addresses):
7998 Likewise.
7999 (Output_data_expression::do_write_to_buffer): Likewise.
8000 (Output_section_definition::finalize_symbols): Likewise.
8001 (Output_section_definition::set_section_addresses): Likewise.
8002
f81bc8b5
DK
80032010-09-30 Doug Kwan <dougkwan@google.com>
8004
8005 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8006
c95e9f27
ST
80072010-09-28 Sriraman Tallam <tmsriram@google.com>
8008
8009 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8010 function.
c95e9f27
ST
8011 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8012 virtual function.
8013 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8014 virtual function.
8015 * icf.cc (get_section_contents): Inline merge sections only when
8016 target allows it.
8017
3cac54d2
RW
80182010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8019
8020 * configure: Regenerate.
8021
2904037a
ILT
80222010-09-17 Ian Lance Taylor <iant@google.com>
8023
8024 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8025 * testsuite/Makefile.am (memory_test.o): New target.
8026 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8027 memory_test.t.
8028 * testsuite/Makefile.in: Rebuild.
2904037a 8029
bca7fb63
DK
80302010-09-17 Doug Kwan <dougkwan@google.com>
8031
8032 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8033 defintion if relocation uses GOT entries of the symbol.
8034 * testsuite/icf_safe_test.sh: Fix test.
8035 * testsuite/icf_safe_so_test.sh: Fix test.
8036
4ef28648
CC
80372010-09-16 Cary Coutant <ccoutant@google.com>
8038
8039 * script_sections.cc (class Memory_region): Remove "NULL" from
8040 vector initializations.
8041
793990de
CC
80422010-09-15 Cary Coutant <ccoutant@google.com>
8043
8044 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8045 Resolve forwarding symbols.
8046
81e015e2
DK
80472010-09-15 Doug Kwan <dougkwan@google.com>
8048
8049 * gold/testsuite/script_test_3.t: Add ARM special sections.
8050 * gold/testsuite/script_test_4.t: Same.
8051 * gold/testsuite/script_test_5.t: Same.
8052 * gold/testsuite/script_test_6.t: Same.
8053 * gold/testsuite/script_test_7.t: Same.
8054 * gold/testsuite/script_test_7.t: Same.
8055 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8056
36171d64
CC
80572010-09-14 Cary Coutant <ccoutant@google.com>
8058
8059 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8060 (Target_x86_64::Relocate::relocate_tls): Replace check for
8061 saw_tls_block_reloc_ with test for executable section.
8062
d89051bd
CC
80632010-09-12 Cary Coutant <ccoutant@google.com>
8064
8065 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8066 position-independent executables to shared libraries need dynamic
8067 relocations.
8068 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8069 position-independent executables.
8070 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8071 * testsuite/Makefile.in: Regenerate.
8072
fca41f0f
NC
80732010-09-10 Nick Clifton <nickc@redhat.com>
8074
8075 PR gold/11997
8076 * testsuite/memory_test.t: Discard any sections that are not
8077 needed.
8078
6695e4b3
L
80792010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8080
8081 PR gold/11996
8082 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8083 "This::" to work around a bug in gcc 4.2.
8084
8085 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8086
0f72bf6f
RÁE
80872010-09-09 Rafael Espindola <espindola@google.com>
8088
8089 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8090 sections with different PF_X flags in the same segment.
8091 (Layout::find_first_load_seg): Search all segments to find the first
8092 one.
8093 * options.h (rosegment): New.
8094
80952010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8096
05a79166 8097 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8098
aa98ff75
DK
80992010-09-08 Doug Kwan <dougkwan@google.com>
8100
8101 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8102 (Arm_relobj::do_relocate_sections): Add new parameter for output
8103 file to match the parent.
8104 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8105 of local symbols instead of input values. Update code to track
8106 changes in gold::relocate_section.
8107 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8108 (Sized_relobj::compute_final_local_value_internal): New methods.
8109 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8110 body into private version of Sized_relobj::compute_final_local_value.
8111 Call the inline method.
8112 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8113 merged symbol value if there is one.
8114 (Symbol_value::has_output_value): New method defintiion.
8115 (Sized_relobj::Compute_final_local_value_status): New enum type.
8116 (Sized_relobj::compute_final_local_value): New methods.
8117 (Sized_relobj::compute_final_local_value_internal): New methods.
8118 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8119 and arm_cortex_a8.sh.
8120 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8121 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8122 New tests.
8123 * Makefile.in: Regenerate.
8124 * testsuite/arm_bl_out_of_range.s: Update test.
8125 * testsuite/thumb_bl_out_of_range.s: Ditto.
8126 * testsuite/thumb_blx_out_of_range.s: Ditto.
8127 * testsuite/arm_branch_out_of_range.sh: New file.
8128 * testsuite/arm_cortex_a8.sh: Ditto.
8129 * testsuite/arm_cortex_a8_b.s: Ditto.
8130 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8131 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8132 * testsuite/arm_cortex_a8_bl.s: Ditto.
8133 * testsuite/arm_cortex_a8_blx.s: Ditto.
8134 * testsuite/arm_cortex_a8_local.s: Ditto.
8135 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8136 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8137
05a79166
L
81382010-09-08 Rafael Espindola <espindola@google.com>
8139
8140 * Makefile.am (memory_test.stdout): Run readelf with -W.
8141 * Makefile.in: Regenerate.
8142 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8143 64 bit output.
8144
33dbc701
RÁE
81452010-09-08 Rafael Espindola <espindola@google.com>
8146
8147 * script-sections.cc (Script_sections::add_memory_region): Convert
8148 field precision to int.
8149 * script.cc (script_set_section_region, script_set_section_region):
8150 Convert field precision to int.
8151
731ca54a
RÁE
81522010-09-08 Rafael Espindola <espindola@google.com>
8153
8154 * arm.cc (do_finalize_sections): Create the __exidx_start and
8155 __exdix_end symbols even when the section is missing.
8156
7f8cd844
NC
81572010-09-08 Nick Clifton <nickc@redhat.com>
8158
8159 * README: Remove claim that MEMORY is not supported.
8160 * expression.cc (script_exp_function_origin)
8161 (script_exp_function_length): Move from here to ...
8162 * script.cc: ... here.
8163 (script_set_section_region, script_add_memory)
8164 (script_parse_memory_attr, script_include_directive): New
8165 functions.
8166 * script-sections.cc
8167 (class Memory_region): New class.
8168 (class Output_section_definition): Add set_memory_region,
8169 set_section_vma, set_section_lma and get_section_name methods.
8170 (class Script_Sections): Add add_memory_region,
8171 find_memory_region, find_memory_region_origin,
8172 find_memory_region_length and set_memory_region methods.
8173 Have set_section_addresses method walk the list of set memory
8174 regions.
8175 Extend the print methos to display memory regions.
8176 * script-sections.h: Add prototypes for new methods.
8177 Add enum for MEMORY region attributes.
8178 * yyscript.y: Add support for parsing MEMORY regions.
8179 * script-c.h: Add prototypes for new functions.
8180 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8181 * testsuite/Makefile.in: Regenerate.
8182 * testsuite/memory_test.sh: New script.
8183 * testsuite/memory_test.s: New assembler source file.
8184 * testsuite/memory_test.t: New linker script.
8185
a4649286
DK
81862010-08-27 Doug Kwan <dougkwan@google.com>
8187
8188 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8189 reference override an existing dynamic weak reference.
8190 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8191 * testsuite/Makefile.in: Regenerate.
8192 * testsuite/dyn_weak_ref.sh: New file.
8193 * testsuite/dyn_weak_ref_1.c: Ditto.
8194 * testsuite/dyn_weak_ref_2.c: Ditto.
8195
b56648ad
ILT
81962010-08-27 Ian Lance Taylor <iant@google.com>
8197
8198 * incremental.h (class Incremental_input_entry): Add virtual
8199 destructor.
8200
809313cb
ILT
82012010-08-27 Ian Lance Taylor <iant@google.com>
8202
8203 * testsuite/start_lib_test_3.c: Mark t3 as used.
8204
11e32464
NC
82052010-08-27 Nick Clifton <nickc@redhat.com>
8206
8207 * options.cc (version_script): Fix small typo in previous
8208 whitespace tidyup.
8209
ca09d69a
NC
82102010-08-25 Nick Clifton <nickc@redhat.com>
8211
8212 * archive.cc: Formatting fixes: Remove whitespace between
8213 typename and following asterisk. Remove whitespace between
8214 function name and opening parenthesis.
8215 * archive.h: Likewise.
8216 * arm.cc: Likewise.
8217 * attributes.cc: Likewise.
8218 * attributes.h: Likewise.
8219 * common.cc: Likewise.
8220 * copy-relocs.cc: Likewise.
8221 * dirsearch.h: Likewise.
8222 * dynobj.cc: Likewise.
8223 * ehframe.cc: Likewise.
8224 * ehframe.h: Likewise.
8225 * expression.cc: Likewise.
8226 * fileread.cc: Likewise.
8227 * fileread.h: Likewise.
8228 * gc.h: Likewise.
8229 * gold-threads.cc: Likewise.
8230 * gold.cc: Likewise.
8231 * i386.cc: Likewise.
8232 * icf.h: Likewise.
8233 * incremental-dump.cc: Likewise.
8234 * incremental.cc: Likewise.
8235 * layout.cc: Likewise.
8236 * layout.h: Likewise.
8237 * main.cc: Likewise.
8238 * merge.cc: Likewise.
8239 * merge.h: Likewise.
8240 * object.cc: Likewise.
8241 * object.h: Likewise.
8242 * options.cc: Likewise.
8243 * options.h: Likewise.
8244 * output.cc: Likewise.
8245 * output.h: Likewise.
8246 * plugin.cc: Likewise.
8247 * plugin.h: Likewise.
8248 * powerpc.cc: Likewise.
8249 * reloc.cc: Likewise.
8250 * script-c.h: Likewise.
8251 * script-sections.cc: Likewise.
8252 * script.cc: Likewise.
8253 * stringpool.cc: Likewise.
8254 * symtab.cc: Likewise.
8255 * symtab.h: Likewise.
8256 * target.cc: Likewise.
8257 * timer.cc: Likewise.
8258 * timer.h: Likewise.
8259 * version.cc: Likewise.
8260 * x86_64.cc: Likewise.
8261
b8fa8750
NC
82622010-08-24 Nick Clifton <nickc@redhat.com>
8263
8264 PR 11899
8265 * layout.cc (segment_precedes): Sort segments by their physical
8266 addresses, if they have been set.
8267
9919d93b
CC
82682010-08-23 Cary Coutant <ccoutant@google.com>
8269
8270 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8271 symbols data.
8272 (Lib_group::include_member): Unlock object after deleting its
8273 symbols data.
8274 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8275 the bug fixed here.
8276
97b4be1c
CC
82772010-08-19 Neil Vachharajani <nvachhar@google.com>
8278 Cary Coutant <ccoutant@google.com>
8279
8280 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8281 constructor, and set_blocker.
8282 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8283 readsyms_blocker_.
8284 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8285 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8286 * testsuite/Makefile.am (start_lib_test): New test case.
8287 * testsuite/Makefile.in: Regenerate.
8288 * testsuite/start_lib_test_main.c: New file.
8289 * testsuite/start_lib_test_1.c: New file.
8290 * testsuite/start_lib_test_2.c: New file.
8291 * testsuite/start_lib_test_3.c: New file.
8292
dd0b1884
ILT
82932010-08-19 Ian Lance Taylor <iant@google.com>
8294
8295 * Makefile.in: Rebuild with automake 1.11.1.
8296 * aclocal.m4: Likewise.
8297 * testsuite/Makefile.in: Likewise.
8298
7223e9ca
ILT
82992010-08-19 Ian Lance Taylor <iant@google.com>
8300
8301 PR 10893
8302 * i386.cc (class Output_data_plt_i386): Update declarations.
8303 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8304 local_ifuncs_ fields.
8305 (Target_i386::do_plt_section_for_global): New function.
8306 (Target_i386::do_plt_section_for_local): New function.
8307 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8308 parameter; change all callers. Initialize global_ifuncs_ and
8309 local_ifuncs_. If doing a static link define __rel_iplt_start and
8310 __rel_iplt_end.
8311 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8312 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8313 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8314 symbols.
8315 (Target_i386::make_plt_section): New function, broken out of
8316 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8317 (Target_i386::make_plt_entry): Call make_plt_section.
8318 (Target_i386::make_local_ifunc_plt_entry): New function.
8319 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8320 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8321 R_386_IRELATIVE to switch.
8322 (Target_i386::Scan::global): Likewise.
8323 (Target_i386::Relocate::relocate): Likewise.
8324 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8325 switch.
8326 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8327 (Target_x86_64::do_plt_section_for_global): New function.
8328 (Target_x86_64::do_plt_section_for_local): New function.
8329 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8330 parameter; change all callers. If doing a static link define
8331 __rela_iplt_start and __rela_iplt_end.
8332 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8333 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8334 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8335 to point to .plt.
8336 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8337 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8338 switch.
8339 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8340 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8341 R_X86_64_IRELATIVE to switch.
8342 (Target_x86_64::Scan::global): Likewise.
8343 (Target_x86_64::Relocate::relocate): Likewise.
8344 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8345 switch.
8346 * target.h (class Target): Add plt_section_for_global and
8347 plt_section_for_local functions. Add do_plt_section_for_global
8348 and do_plt_section_for_local virtual functions.
8349 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8350 clarifying comments.
8351 (Symbol::use_plt_offset): Handle IFUNC symbol.
8352 * object.cc (Sized_relobj::Sized_relobj): Initialize
8353 local_plt_offsets_.
8354 (Sized_relobj::local_has_plt_offset): New function.
8355 (Sized_relobj::local_plt_offset): New function.
8356 (Sized_relobj::set_local_plt_offset): New function.
8357 (Sized_relobj::do_count): Handle IFUNC symbol.
8358 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8359 a bit away from input_shndx_ field. Add set_is_func_symbol and
8360 is_ifunc_symbol functions.
8361 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8362 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8363 local_plt_offsets_ field.
8364 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8365 * output.h (class Output_section_data): Add non-const
8366 output_section function.
8367 (class Output_data_got): Update declarations.
8368 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8369 Add use_plt_offset parameter to global and local constructors.
8370 Change all callers. Change local_sym_index_ field to 31 bits.
8371 Change GSYM_CODE and CONSTANT_CODE accordingly.
8372 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8373 doing a static link don't set sh_link field.
8374 (Output_data_got::Got_entry::write): Use PLT offset if
8375 appropriate.
8376 (Output_data_got::add_global_plt): New function.
8377 (Output_data_got::add_local_plt): New function.
8378 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8379 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8380 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8381 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8382 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8383 IFUNC conditional.
8384 * testsuite/ifunc-sel.h: New file.
8385 * testsuite/ifuncmain1.c: New file.
8386 * testsuite/ifuncmain1vis.c: New file.
8387 * testsuite/ifuncmod1.c: New file.
8388 * testsuite/ifuncdep2.c: New file.
8389 * testsuite/ifuncmain2.c: New file.
8390 * testsuite/ifuncmain3.c: New file.
8391 * testsuite/ifuncmod3.c: New file.
8392 * testsuite/ifuncmain4.c: New file.
8393 * testsuite/ifuncmain5.c: New file.
8394 * testsuite/ifuncmod5.c: New file.
8395 * testsuite/ifuncmain6pie.c: New file.
8396 * testsuite/ifuncmod6.c: New file.
8397 * testsuite/ifuncmain7.c: New file.
8398 * configure, testsuite/Makefile.in: Rebuild.
8399
56f75c03
ILT
84002010-08-18 Ian Lance Taylor <iant@google.com>
8401
8402 * incremental.cc
8403 (Output_section_incremental_inputs::write_input_files): Add cast
8404 to avoid signed/unsigned comparison warning.
8405 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8406
55455f89
CC
84072010-08-12 Cary Coutant <ccoutant@google.com>
8408
8409 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8410
e2054bcb
ILT
84112010-08-13 Ian Lance Taylor <iant@google.com>
8412
8413 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8414
74f67560
DK
84152010-08-12 Cary Coutant <ccoutant@google.com>
8416 Doug Kwan <dougkwan@google.com>
8417
8418 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8419 defintion overrides non-weak undef, remember that the original undef
8420 is not weak.
8421 * symtab.cc (Symbol_table::sized_write_global): For undef without
8422 an original weak binding, set binding to global in output.
8423 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8424 * testsuite/Makefile.in: Regenerate.
8425 * testsuite/strong_ref_weak_def.sh: New file.
8426 * testsuite/strong_ref_weak_def_1.c: Ditto.
8427 * testsuite/strong_ref_weak_def_2.c: Ditto.
8428
d1238d12
CC
84292010-08-12 Cary Coutant <ccoutant@google.com>
8430
8431 * testsuite/incremental_test.sh: Rewrite.
8432 * testsuite/incremental_test_1.c: Rewrite.
8433 * testsuite/incremental_test_2.c: Rewrite.
8434
0e70b911
CC
84352010-08-12 Cary Coutant <ccoutant@google.com>
8436
8437 * arm.cc (Target_arm::got_size): Add const.
8438 (Target_arm::got_entry_count): New function.
8439 (Target_arm::plt_entry_count): New function.
8440 (Target_arm::first_plt_entry_offset): New function.
8441 (Target_arm::plt_entry_size): New function.
8442 (Output_data_plt_arm::entry_count): New function.
8443 (Output_data_plt_arm::first_plt_entry_offset): New function.
8444 (Output_data_plt_arm::get_plt_entry_size): New function.
8445 * i386.cc (Target_i386::got_size): Add const.
8446 (Target_i386::got_entry_count): New function.
8447 (Target_i386::plt_entry_count): New function.
8448 (Target_i386::first_plt_entry_offset): New function.
8449 (Target_i386::plt_entry_size): New function.
8450 (Output_data_plt_i386::entry_count): New function.
8451 (Output_data_plt_i386::first_plt_entry_offset): New function.
8452 (Output_data_plt_i386::get_plt_entry_size): New function.
8453 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8454 find_incremental_inputs_sections. Dump incremental_got_plt section.
8455 * incremental.cc: Include target.h.
8456 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8457 parameter. Adjust all callers. Find incremental_got_plt section.
8458 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8459 section.
8460 (Output_section_incremental_inputs::set_final_data_size): Calculate
8461 size of incremental_got_plt section.
8462 (Output_section_incremental_inputs::do_write): Write the
8463 incremental_got_plt section.
8464 (Got_plt_view_info): New struct.
8465 (Local_got_offset_visitor): New class.
8466 (Global_got_offset_visitor): New class.
8467 (Global_symbol_visitor_got_plt): New class.
8468 (Output_section_incremental_inputs::write_got_plt): New function.
8469 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8470 Add parameter. Adjust all callers.
8471 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8472 (Incremental_inputs::got_plt_section): New function.
8473 (Incremental_inputs::got_plt_section_): New data member.
8474 (Incremental_got_plt_reader): New class.
8475 * layout.cc (Layout::create_incremental_info_sections): Add the
8476 incremental_got_plt section.
8477 * object.h (Got_offset_list::get_list): New function.
8478 (Got offset_list::for_all_got_offsets): New function.
8479 (Sized_relobj::local_got_offset_list): New function.
8480 * powerpc.cc (Target_powerpc::got_size): Add const.
8481 (Target_powerpc::got_entry_count): New function.
8482 (Target_powerpc::plt_entry_count): New function.
8483 (Target_powerpc::first_plt_entry_offset): New function.
8484 (Target_powerpc::plt_entry_size): New function.
8485 (Output_data_plt_powerpc::entry_count): New function.
8486 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8487 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8488 * sparc.cc (Target_sparc::got_size): Add const.
8489 (Target_sparc::got_entry_count): New function.
8490 (Target_sparc::plt_entry_count): New function.
8491 (Target_sparc::first_plt_entry_offset): New function.
8492 (Target_sparc::plt_entry_size): New function.
8493 (Output_data_plt_sparc::entry_count): New function.
8494 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8495 (Output_data_plt_sparc::get_plt_entry_size): New function.
8496 * symtab.h (Symbol::got_offset_list): New function.
8497 (Symbol_table::for_all_symbols): New function.
8498 * target.h (Sized_target::got_entry_count): New function.
8499 (Sized_target::plt_entry_count): New function.
8500 (Sized_target::plt_entry_size): New function.
8501 * x86_64.cc (Target_x86_64::got_size): Add const.
8502 (Target_x86_64::got_entry_count): New function.
8503 (Target_x86_64::plt_entry_count): New function.
8504 (Target_x86_64::first_plt_entry_offset): New function.
8505 (Target_x86_64::plt_entry_size): New function.
8506 (Output_data_plt_x86_64::entry_count): New function.
8507 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8508 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8509
09ec0418
CC
85102010-08-12 Cary Coutant <ccoutant@google.com>
8511
8512 * archive.cc: Include incremental.h.
8513 (Archive::Archive): Initialize incremental_info_.
8514 (Archive::include_member): Record archive members in incremental info.
8515 (Add_archive_symbols::run): Record begin and end of an archive in
8516 incremental info.
8517 (Lib_group::include_member): Record objects in incremental info.
8518 * archive.h (Incremental_archive_entry): Forward declaration.
8519 (Archive::set_incremental_info): New member function.
8520 (Archive::incremental_info): New member function.
8521 (Archive::Unused_symbol_iterator): New class.
8522 (Archive::unused_symbols_begin): New member function.
8523 (Archive::unused_symbols_end): New member function.
8524 (Archive::incremental_info_): New data member.
8525 * incremental-dump.cc (find_input_containing_global): New function.
8526 (dump_incremental_inputs): Dump new incremental info sections.
8527 * incremental.cc: Include symtab.h.
8528 (Output_section_incremental_inputs): New class.
8529 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8530 new incremental info sections.
8531 (Sized_incremental_binary::do_check_inputs): Likewise.
8532 (Incremental_inputs::report_archive): Remove.
8533 (Incremental_inputs::report_archive_begin): New function.
8534 (Incremental_inputs::report_archive_end): New function.
8535 (Incremental_inputs::report_object): New function.
8536 (Incremental_inputs::finalize_inputs): Remove.
8537 (Incremental_inputs::report_input_section): New function.
8538 (Incremental_inputs::report_script): Rewrite.
8539 (Incremental_inputs::finalize): Do nothing but finalize string table.
8540 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8541 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8542 (Incremental_inputs::create_data_sections): New function.
8543 (Incremental_inputs::relocs_entsize): New function.
8544 (Output_section_incremental_inputs::set_final_data_size): New function.
8545 (Output_section_incremental_inputs::do_write): New function.
8546 (Output_section_incremental_inputs::write_header): New function.
8547 (Output_section_incremental_inputs::write_input_files): New function.
8548 (Output_section_incremental_inputs::write_info_blocks): New function.
8549 (Output_section_incremental_inputs::write_symtab): New function.
8550 * incremental.h (Incremental_script_entry): Forward declaration.
8551 (Incremental_object_entry): Forward declaration.
8552 (Incremental_archive_entry): Forward declaration.
8553 (Incremental_inputs): Forward declaration.
8554 (Incremental_inputs_header_data): Remove.
8555 (Incremental_inputs_header): Remove.
8556 (Incremental_inputs_header_write): Remove.
8557 (Incremental_inputs_entry_data): Remove.
8558 (Incremental_inputs_entry): Remove.
8559 (Incremental_inputs_entry_write): Remove.
8560 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8561 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8562 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8563 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8564 Likewise.
8565 (Incremental_input_entry): New class.
8566 (Incremental_script_entry): New class.
8567 (Incremental_object_entry): New class.
8568 (Incremental_archive_entry): New class.
8569 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8570 (Incremental_inputs::report_inputs): Remove.
8571 (Incremental_inputs::report_archive): Remove.
8572 (Incremental_inputs::report_archive_begin): New function.
8573 (Incremental_inputs::report_archive_end): New function.
8574 (Incremental_inputs::report_object): Change prototype.
8575 (Incremental_inputs::report_input_section): New function.
8576 (Incremental_inputs::report_script): Change prototype.
8577 (Incremental_inputs::get_reloc_count): New function.
8578 (Incremental_inputs::set_reloc_count): New function.
8579 (Incremental_inputs::create_data_sections): New function.
8580 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8581 (Incremental_inputs::inputs_section): New function.
8582 (Incremental_inputs::symtab_section): New function.
8583 (Incremental_inputs::relocs_section): New function.
8584 (Incremental_inputs::get_stringpool): Add const.
8585 (Incremental_inputs::command_line): Add const.
8586 (Incremental_inputs::inputs): Remove.
8587 (Incremental_inputs::command_line_key): New function.
8588 (Incremental_inputs::input_file_count): New function.
8589 (Incremental_inputs::input_files): New function.
8590 (Incremental_inputs::relocs_entsize): New function.
8591 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8592 (Incremental_inputs::finalize_inputs): Remove.
8593 (Incremental_inputs::Input_info): Remove.
8594 (Incremental_inputs::lock_): Remove.
8595 (Incremental_inputs::inputs_): Change type.
8596 (Incremental_inputs::inputs_map_): Remove.
8597 (Incremental_inputs::current_object_entry_): New data member.
8598 (Incremental_inputs::inputs_section_): New data member.
8599 (Incremental_inputs::symtab_section_): New data member.
8600 (Incremental_inputs::relocs_section_): New data member.
8601 (Incremental_inputs::reloc_count_): New data member.
8602 (Incremental_inputs_reader): New class.
8603 (Incremental_symtab_reader): New class.
8604 (Incremental_relocs_reader): New class.
8605 * layout.cc (Layout::finalize): Move finalization of incremental info
8606 and creation of incremental info sections to follow finalization of
8607 symbol table. Set offsets for postprocessing sections.
8608 (Layout::create_incremental_info_sections): Call
8609 Incremental_inputs::create_data_sections. Add incremental symtab
8610 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8611 sections to layout after input sections.
8612 * layout.h (struct Timespec): Forward declaration.
8613 (Layout::incremental_inputs): Add const.
8614 (Layout::create_incremental_info_sections): Add parameter.
8615 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8616 * object.cc: Include incremental.h.
8617 (Relobj::finalize_incremental_relocs): New function.
8618 (Sized_relobj::do_layout): Record input sections in incremental info.
8619 * object.h (Object::output_section): New function.
8620 (Object::output_section_offset): Moved from Relobj.
8621 (Object::get_incremental_reloc_base): New function.
8622 (Object::get_incremental_reloc_count): New function.
8623 (Object::do_output_section): New function.
8624 (Object::do_output_section_offset): Moved from Relobj.
8625 (Object::do_get_incremental_reloc_base): New function.
8626 (Object::do_get_incremental_reloc_count): New function.
8627 (Object::Object): Initialize new data members.
8628 (Relobj::output_section): Renamed do_output_section and moved to
8629 protected.
8630 (Relobj::output_section_offset): Moved to Object.
8631 (Relobj::do_get_incremental_reloc_base): New function.
8632 (Relobj::do_get_incremental_reloc_count): New function.
8633 (Relobj::allocate_incremental_reloc_counts): New function.
8634 (Relobj::count_incremental_reloc): New function.
8635 (Relobj::finalize_incremental_relocs): New function.
8636 (Relobj::next_incremental_reloc_index): New function.
8637 (Relobj::reloc_counts_): New data member.
8638 (Relobj::reloc_bases_): New data member.
8639 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8640 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8641 (Sized_relobj::incremental_relocs_scan): New function.
8642 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8643 (Sized_relobj::incremental_relocs_write): New function.
8644 (Sized_relobj::incremental_relocs_write_reltype): New function.
8645 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8646 incremental link.
8647 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8648 archives and object files elsewhere.
8649 (Add_symbols::run): Report object files here.
8650 (Finish_group::run): Report end of archive at end of group.
8651 * reloc.cc: Include layout.h, incremental.h.
8652 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8653 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8654 (Sized_relobj::incremental_relocs_scan): New function.
8655 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8656 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8657 (Sized_relobj::incremental_relocs_write): New function.
8658 (Sized_relobj::incremental_relocs_write_reltype): New function.
8659 * script.cc (read_input_script): Rewrite test for incremental link.
8660 Change call to Incremental_inputs::report_script.
8661 * symtab.h (Symbol_table::first_global_index): New function.
8662 (Symbol_table::output_count): New function.
8663
ce0d1972
DK
86642010-08-12 Doug Kwan <dougkwan@google.com>
8665
8666 * arm.cc (Target_arm::merge_object_attributes): Check command line
8667 options --no-wchar-size-warning and --no-enum-size-warning.
8668 * options.h (General_options): Add ld-compatible options
8669 --no-enum-size-warning and --no-wchar-size-warning.
8670
6e5710ce
ILT
86712010-08-04 Ian Lance Taylor <iant@google.com>
8672
8673 * x86_64.cc (Target_x86_64::Scan::local): Use
8674 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8675 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8676 (Target_x86_64::Scan::global): Likewise.
8677 (Target_x86_64::Relocate::relocate): Likewise.
8678 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8679 Likewise.
8680
fef830db
CC
86812010-08-03 Cary Coutant <ccoutant@google.com>
8682
8683 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8684 to reserve space in merged_strings vector. Keep total input size
8685 for stats.
8686 (Output_merge_string::do_print_merge_stats): Print total input size.
8687 * merge.h (Output_merge_string): Add input_size_ field.
8688 * stringpool.cc (Stringpool_template::string_length): Move
8689 implementations out of Stringpool_template class and place in
8690 stringpool.h.
8691 * stringpool.h (string_length): Move out of Stringpool_template.
8692
1e3811b0
ILT
86932010-08-03 Ian Lance Taylor <iant@google.com>
8694
8695 PR 11712
8696 * layout.cc (relaxation_loop_body): If address of load segment is
8697 set, adjust address to include headers if possible.
8698
7af0c620
ILT
86992010-08-03 Ian Lance Taylor <iant@google.com>
8700
8701 * version.cc (version_string): Bump to 1.10.
8702
22f0da72
ILT
87032010-08-03 Ian Lance Taylor <iant@google.com>
8704
8705 PR 11805
8706 * layout.h (enum Output_section_order): Define.
8707 (class Layout): Update declarations.
8708 * layout.cc (Layout::get_output_section): Add order parameter.
8709 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8710 is_first_non_relro parameters. Change all callers.
8711 (Layout::choose_output_section): Likewise.
8712 (Layout::add_output_section_data): Likewise.
8713 (Layout::make_output_section): Likewise. Set order.
8714 (Layout::default_section_order): New function.
8715 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8716 * output.cc (Output_section::Output_section): Initialize order_.
8717 Don't initialize deleted fields.
8718 (Output_segment::Output_segment): Don't initialize deleted
8719 fields.
8720 (Output_segment::add_output_section_to_load): New function
8721 replacing add_output_section. Change all callers to call this or
8722 add_output_section_to_nonload.
8723 (Output_segment::add_output_section_to_nonload): New function.
8724 (Output_segment::remove_output_section): Rewrite.
8725 (Output_segment::add_initial_output_data): Likewise.
8726 (Output_segment::has_any_data_sections): Likewise.
8727 (Output_segment::is_first_section_relro): Likewise.
8728 (Output_segment::maximum_alignment): Likewise.
8729 (Output_segment::has_dynamic_reloc): New function replacing
8730 dynamic_reloc_count. Change all callers.
8731 (Output_segment::has_dynamic_reloc_list): New function replacing
8732 dynamic_reloc_count_list. Change all callers.
8733 (Output_segment::set_section_addresses): Rewrite.
8734 (Output_segment::set_offset): Rewrite.
8735 (Output_segment::find_first_and_last_list): Remove.
8736 (Output_segment::set_tls_offsets): Rewrite.
8737 (Output_segment::first_section_load_address): Likewise.
8738 (Output_segment::output_section_count): Likewise.
8739 (Output_segment::section_with_lowest_load_address): Likewise.
8740 (Output_segment::write_section_headers): Likewise.
8741 (Output_segment::print_sections_to_map): Likewise.
8742 * output.h (class Output_data): Remove dynamic_reloc_count_
8743 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8744 (Output_data::add_dynamic_reloc): Rewrite.
8745 (Output_data::has_dynamic_reloc): New function.
8746 (Output_data::dynamic_reloc_count): Remove.
8747 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8748 is_last_relro_, is_first_non_relro_, is_interp_,
8749 is_dynamic_linker_section_ fields. Add order and set_order
8750 functions. Remove is_relro_local, set_is_relro_local,
8751 is_last_relro, set_is_last_relro, is_first_non_relro,
8752 set_is_first_non_relro functions, is_interp, set_is_interp,
8753 is_dynamic_linker_section, and set_is_dynamic_linker_section
8754 functions.
8755 (class Output_segment): Change Output_data_list from std::list to
8756 std:;vector. Add output_lists_ field. Remove output_data_ and
8757 output_bss_ fields. Update declarations.
8758
3ff2ccb0
ILT
87592010-08-02 Ian Lance Taylor <iant@google.com>
8760
8761 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8762 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8763 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8764
88a4108b
ILT
87652010-08-02 Ian Lance Taylor <iant@google.com>
8766
8767 PR 11855
8768 * script.cc (Script_options::Script_options): Initialize
8769 symbol_definitions_ and symbol_references_.
8770 (Script_options::add_symbol_assignment): Update
8771 symbol_definitions_ and symbol_references_.
8772 (Script_options::add_symbol_reference): New function.
8773 (script_symbol): New function.
8774 * script.h (class Script_options): Add symbol_definitions_ and
8775 symbol_references_ fields.
8776 (Script_options::referenced_const_iterator): New type.
8777 (Script_options::referenced_begin): New function.
8778 (Script_options::referenced_end): New function.
8779 (Script_options::is_referenced): New function.
8780 (Script_options::any_unreferenced): New function.
8781 * script-c.h (script_symbol): Declare.
8782 * yyscript.y (exp): Call script_symbol.
8783 * symtab.cc: Include "script.h".
8784 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8785 Change all callers. Check symbols referenced by scripts.
8786 (Symbol_table::add_undefined_symbols_from_command_line): Add
8787 layout parameter. Change all callers.
8788 (Symbol_table::do_add_undefined_symbols_from_command_line):
8789 Likewise. Break out loop body. Check symbols referenced by
8790 scripts.
8791 (Symbol_table::add_undefined_symbol_from_command_line): New
8792 function broken out of
8793 do_add_undefined_symbols_from_command_line.
8794 * symtab.h (class Symbol_table): Update declarations.
8795 * archive.cc: Include "layout.h".
8796 (Archive::should_include_member): Add layout parameter. Change
8797 all callers. Check for symbol mentioned in expression.
8798 * archive.h (class Archive): Update declaration.
8799 * object.cc (Sized_relobj::do_should_include_member): Add layout
8800 parameter.
8801 * object.h (Object::should_include_member): Add layout parameter.
8802 Change all callers.
8803 (Object::do_should_include_member): Add layout parameter.
8804 (class Sized_relobj): Update declaration.
8805 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8806 parameter.
8807 * dynobj.h (class Sized_dynobj): Update declaration.
8808 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8809 layout parameter.
8810 * plugin.h (class Sized_pluginobj): Update declaration.
8811
5f1ab67a
ILT
88122010-08-02 Ian Lance Taylor <iant@google.com>
8813
8814 PR 11866
8815 * output.cc (Output_segment::set_offset): Search for the first and
8816 last sections rather than assuming that the list is in order.
8817 (Output_segment::find_first_and_last_list): New function.
8818 * output.h (class Output_segment): Update declarations.
8819 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8820 (relro_strip_test_SOURCES): New variable.
8821 (relro_strip_test_DEPENDENCIES): New variable.
8822 (relro_strip_test_LDFLAGS): New variable.
8823 (relro_strip_test_LDADD): New variable.
8824 (relro_strip_test.so): New target.
8825
a8df5856
ILT
88262010-08-02 Ian Lance Taylor <iant@google.com>
8827
8828 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8829 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8830 (Target_i386::got_tlsdesc_section): New function.
8831 (Target_i386::got_section): Create space for GOT entries for
8832 TLSDESC relocations.
8833 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8834 R_386_TLS_GOTDESC.
8835 (Target_i386::Scan::global): Likewise.
8836 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8837 using TLSDESC GOT.
8838 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8839 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8840 (Target_x86_64::got_tlsdesc_section): New function.
8841 (Target_x86_64::got_section): Create space for GOT entries for
8842 TLSDESC relocations.
8843 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8844 R_386_TLS_GOTDESC.
8845 (Target_x86_64::Scan::global): Likewise.
8846 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8847 using TLSDESC GOT.
8848
0c10a0a6
ILT
88492010-08-02 Ian Lance Taylor <iant@google.com>
8850
8851 * testsuite/final_layout.sh: Use dc to convert from hex to
8852 decimal.
8853
41cbeecc
ST
88542010-07-29 Sriraman Tallam <tmsriram@google.com>
8855
8856 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8857 paramter to the call to gold::gc_process_relocs.
8858 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8859 paramter to the call to gold::gc_process_relocs.
8860 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8861 parameter to the call to gold::gc_process_relocs.
8862 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8863 template parameter to the call to gold::gc_process_relocs.
8864 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8865 paramter to the call to gold::gc_process_relocs.
8866 * gc.h (get_embedded_addend_size): New function.
8867 (gc_process_relocs): Save the size of the reloc for use by ICF.
8868 * icf.cc (get_section_contents): Get the addend from the text section
8869 for SHT_REL relocation sections.
8870 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8871 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8872 * int_encoding.h (read_from_pointer): New overloaded function.
8873 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8874 * testsuite/icf_sht_rel_addend_test.sh: New file.
8875 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8876 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8877
6ea55b82
RW
88782010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8879
8880 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8881 * Makefile.in: Regenerate.
8882 * testsuite/Makefile.in: Regenerate.
8883
9691462b
ILT
88842010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8885
8886 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8887 * gold/testsuite/debug_msg.cc: Likewise.
8888 * gold/testsuite/odr_violation1.cc
8889 * gold/testsuite/odr_violation2.cc
8890
76897331
CC
88912010-07-21 Cary Coutant <ccoutant@google.com>
8892
8893 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8894 string, and length fields.
8895 (Output_merge_string::Merged_strings_list): New type.
8896 (Output_merge_string::Merged_strings_lists): New typedef.
8897 (Output_merge_string): Replace merged_strings_ with
8898 merged_strings_lists_.
8899 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8900 Merged_strings_list per input object and section. Don't store pointer
8901 to the string. Don't store length with each merged string entry.
8902 (Output_merge_string::finalize_merged_data): Loop over list of merged
8903 strings lists. Recompute length of each merged string.
8904
78384e8f
CC
89052010-07-15 Cary Coutant <ccoutant@google.com>
8906
8907 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8908 here.
8909
783659f9
ILT
89102010-07-14 Ian Lance Taylor <iant@google.com>
8911
8912 * descriptors.cc (Descriptors::open): Report correct name in error
8913 message.
8914
131687b4
DK
89152010-07-13 Doug Kwan <dougkwan@google.com>
8916
8917 * arm.cc (Arm_input_section::Arm_input_section): For a
8918 SHT_ARM_EXIDX section, always keeps the input sections.
8919 (Arm_input_section::set_exidx_section_link): New method.
8920 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8921 has_errors_ to false.
8922 (Arm_exidx_input_section::has_errors,
8923 Arm_exidx_input_section::set_has_errors): New methods.
8924 (Arm_exidx_input_section::has_errors_): New data member.
8925 (Arm_relobj::get_exidx_shndx_list): New method.
8926 (Arm_output_section::append_text_sections_to_list): Do not skip
8927 section without SHF_EXECINSTR.
8928 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8929 errors.
2e702c99 8930 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8931 section header. Make error messages more verbose. Check for
8932 a non-executable section linked to an EXIDX section.
8933 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8934 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8935 check that there is no deferred EXIDX section if we exit early.
8936 Instead of not making an EXIDX section in case of an error, make one
8937 and set the has_errors flag of it.
8938 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8939 in a relocatable link.
8940 (Target_arm::do_relax): Look for the EXIDX output section instead of
8941 assuming that it is called .ARM.exidx.
2e702c99 8942 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8943 section list. Do not check for SHF_EXECINSTR section flags but
8944 skip any input section with errors.
8945 * output.cc (Output_section::Output_section): Initialize
8946 always_keeps_input_sections_ to false.
8947 (Output_section::add_input_section): Check for
8948 always_keeps_input_sections_.
8949 * output.h (Output_section::always_keeps_input_sections,
8950 Output_section::set_always_keeps_input_sections): New methods.
8951 (Output_section::always_keeps_input_sections): New data member.
8952
69517287
RÁE
89532010-07-13 Rafael Espindola <espindola@google.com>
8954
8955 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8956 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8957
82742395
ILT
89582010-07-13 Philip Herron <herron.philip@googlemail.com>
8959 Ian Lance Taylor <iant@google.com>
8960
8961 * output.h (Output_section_lookup_maps::add_merge_section):
8962 Correct check of whether value was inserted.
8963 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8964 (Output_section_lookup_maps::add_relaxed_input_section):
8965 Likewise.
8966 * arm.cc (Target_arm::got_section): Remove used local os.
8967 * i386.cc (Target_i386::got_section): Likewise.
8968 * x86_64.cc (Target_x86_64::got_section): Likewise.
8969 * sparc.cc (Target_sparc::got_section): Likewise.
8970 (Target_sparc::relocate): Remove unused local have_got_offset.
8971 * powerpc.cc (Target_powerpc::relocate): Likewise.
8972
f2d707b5
ILT
89732010-07-13 Ian Lance Taylor <iant@google.com>
8974
241531d6
ILT
8975 * compressed_output.cc (zlib_decompress): Fix signature in
8976 !HAVE_ZLIB_H case.
8977
f2d707b5
ILT
8978 * archive.cc (Archive::include_member): Unlock an external member
8979 of a thin archive. Don't bother to delete an object we know is
8980 NULL.
8981
a2e47362
CC
89822010-07-12 Cary Coutant <ccoutant@google.com>
8983
8984 * compressed_output.cc (zlib_decompress): New function.
8985 (get_uncompressed_size): New function.
8986 (decompress_input_section): New function.
8987 * compressed_output.h (get_uncompressed_size): New function.
8988 (decompress_input_section): New function.
8989 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8990 Handle compressed debug sections.
8991 * layout.cc (is_compressed_debug_section): New function.
8992 (Layout::output_section_name): Map compressed section names to
8993 canonical names.
8994 * layout.h (is_compressed_debug_section): New function.
8995 (is_debug_info_section): Recognize compressed debug sections.
8996 * merge.cc: Include compressed_output.h.
8997 (Output_merge_data::do_add_input_section): Handle compressed
8998 debug sections.
8999 (Output_merge_string::do_add_input_section): Handle compressed
9000 debug sections.
9001 * object.cc: Include compressed_output.h.
9002 (Sized_relobj::Sized_relobj): Initialize new data members.
9003 (build_compressed_section_map): New function.
9004 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9005 * object.h (Object::section_is_compressed): New method.
9006 (Object::do_section_is_compressed): New method.
9007 (Sized_relobj::Compressed_section_map): New type.
9008 (Sized_relobj::do_section_is_compressed): New method.
9009 (Sized_relobj::compressed_sections_): New data member.
9010 * output.cc (Output_section::add_input_section): Handle compressed
9011 debug sections.
9012 * reloc.cc: Include compressed_output.h.
9013 (Sized_relobj::write_sections): Handle compressed debug sections.
9014
ce279a62
CC
90152010-07-08 Cary Coutant <ccoutant@google.com>
9016
9017 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9018 weak when resolving to a dynamic def.
9019 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9020 for weak undef/dynamic def cases. Adjust callers.
9021 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9022 undef_binding_weak_.
9023 (Symbol_table::sized_write_globals): Adjust symbol binding.
9024 (Symbol_table::sized_write_symbol): Add binding parameter.
9025 * symtab.h (Symbol::set_undef_binding): New method.
9026 (Symbol::is_undef_binding_weak): New method.
9027 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9028 (Symbol_table::should_override): Add new parameter.
9029 (Symbol_table::sized_write_symbol): Add new parameter.
9030
9031 * testsuite/weak_undef_file1.cc: Add new test case.
9032 * testsuite/weak_undef_file2.cc: Fix header comment.
9033 * testsuite/weak_undef_test.cc: Add new test case.
9034
b2286c10
DK
90352010-06-29 Doug Kwan <dougkwan@google.com>
9036
9037 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9038 Initialize USE_SYMBOL_.
9039 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9040 definition.
9041 (Arm_reloc_property::uses_symbol_): New data member declaration.
9042 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9043 uses symbol value and symbol is undefined but not weakly undefined.
9044
4802450a
RÁE
90452010-06-28 Rafael Espindola <espindola@google.com>
9046
9047 * plugin.cc (Plugin::load): Use dlerror.
9048
e5ca47ba
ILT
90492010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9050
9051 * symtab.cc (detect_odr_violations): When reporting an ODR
9052 violation, report an object where the symbol is defined.
9053
8a75a161
DK
90542010-06-25 Doug Kwan <dougkwan@google.com>
9055
9056 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9057 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9058 definition.
9059 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9060 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9061 target hook to detect function points.
9062 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9063 * icf.h (Icf::check_section_for_function_pointers): Change type of
9064 parameter SECTION_NAME to const reference to std::string. Use
9065 target hook to determine if section may have unsafe pointers.
9066 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9067 method definition.
9068
42218b9f
RÁE
90692010-06-21 Rafael Espindola <espindola@google.com>
9070
9071 * fileread.cc (Input_file::find_fie): New
9072 (Input_file::open): Use Input_file::find_fie.
9073 * fileread.h (Input_file::find_fie): New
9074 * plugin.cc (set_extra_library_path): New.
9075 (Plugin::load): Add set_extra_library_path to the transfer vector.
9076 (Plugin_manager::set_extra_library_path): New.
9077 (Plugin_manager::add_input_file): Use the extra search path if set.
9078 (set_extra_library_path(): New.
9079 * plugin.h (Plugin_manager): Add set_extra_library_path and
9080 extra_search_path_.
9081
a0506cca
CC
90822010-06-19 Cary Coutant <ccoutant@google.com>
9083
9084 * layout.cc (gdb_sections): Add .debug_types.
9085 (lines_only_debug_sections): Likewise.
9086
6508b958
RÁE
90872010-06-18 Rafael Espindola <espindola@google.com>
9088
9089 * plugin.cc (add_input_file,add_input_library)
9090 (Plugin_manager::add_input_file): Make filename arguments const.
9091 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9092 const.
9093
3e235302
DK
90942010-06-16 Doug Kwan <dougkwan@google.com>
9095
9096 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9097 .ARM.attributes section if we have not merged any input
9098 attributes sections.
9099
106e8a6c
DK
91002010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9101
9102 * arm.cc: Allow combining objects with no EABI version
9103 information.
9104
91ff43fe
RÁE
91052010-06-15 Rafael Espindola <espindola@google.com>
9106
9107 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9108
68ed838c
ILT
91092010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9110
9111 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9112 (struct iovec): Correct !HAVE_READV definition.
9113
f3a2388f
CC
91142010-06-10 Cary Coutant <ccoutant@google.com>
9115
9116 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9117 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9118 reloc sections.
9119 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9120
9121 PR 11683
9122 * symtab.h (Symbol::is_placeholder): New member function.
9123 * target-reloc.h (relocate_section): Check for placeholder symbols.
9124
9125 * testsuite/Makefile.am (plugin_test_8): New test.
9126 (plugin_test_9): New test.
9127 * testsuite/Makefile.in: Regenerate.
9128
e1df38aa
NC
91292010-06-09 Nick Clifton <nickc@redhat.com>
9130
9131 * yyscript.y (input_list_element): Allow strings prefixed with
9132 the '-' character. Treat these as libraries.
9133 * script.cc (script_add_library): New function. Adds a library
9134 specified by "-l<name>" found in an input script.
9135 * script-c.h: Add prototype for script_add_library.
9136
25bbe950
DK
91372010-06-07 Doug Kwan <dougkwan@google.com>
9138
9139 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9140 Restrict stub-group size to be within long conditional branch
9141 range when working around cortex-A8 erratum.
9142
0f32ea4c
ILT
91432010-06-07 Damien Diederen <dd@crosstwine.com>
9144
9145 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9146 #ifdef typo.
9147
8fe2a369
ST
91482010-06-03 Sriraman Tallam <tmsriram@google.com>
9149
9150 PR gold/11658
9151 * output.cc
9152 (Output_section::Input_section_sort_entry::compare_section_ordering):
9153 Change to return non-zero correctly.
9154 (Output_section::Input_section_sort_section_order_index_compare
9155 ::operator()): Change to fix ambiguity in comparisons.
9156
6e9ba2ca
ST
91572010-06-01 Sriraman Tallam <tmsriram@google.com>
9158
9159 * gold.h (is_wildcard_string): New function.
9160 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9161 (Layout::layout_eh_frame): Ditto.
9162 (Layout::find_section_order_index): New method.
9163 (Layout::read_layout_from_file): New method.
9164 * layout.h (Layout::find_section_order_index): New method.
9165 (Layout::read_layout_from_file): New method.
9166 (Layout::input_section_position_): New private member.
9167 (Layout::input_section_glob_): New private member.
9168 * main.cc (main): Call read_layout_from_file here.
9169 * options.h (--section-ordering-file): New option.
9170 * output.cc (Output_section::input_section_order_specified_): New
9171 member.
9172 (Output_section::Output_section): Initialize new member.
9173 (Output_section::add_input_section): Add new parameter.
9174 Keep input sections when --section-ordering-file is used.
9175 (Output_section::set_final_data_size): Sort input sections when
9176 section ordering file is specified.
9177 (Output_section::Input_section_sort_entry): Add new parameter.
9178 Check sorting type.
9179 (Output_section::Input_section_sort_entry::compare_section_ordering):
9180 New method.
9181 (Output_section::Input_section_sort_compare::operator()): Change to
9182 consider section_order_index.
9183 (Output_section::Input_section_sort_init_fini_compare::operator()):
9184 Change to consider section_order_index.
9185 (Output_section::Input_section_sort_section_order_index_compare
9186 ::operator()): New method.
9187 (Output_section::sort_attached_input_sections): Change to sort
9188 according to section order when specified.
e1df38aa
NC
9189 (Output_section::add_input_section<32, true>): Add new parameter.
9190 (Output_section::add_input_section<64, true>): Add new parameter.
9191 (Output_section::add_input_section<32, false>): Add new parameter.
9192 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9193 * output.h (Output_section::add_input_section): Add new parameter.
9194 (Output_section::input_section_order_specified): New
9195 method.
9196 (Output_section::set_input_section_order_specified): New method.
9197 (Input_section::Input_section): Initialize section_order_index_.
9198 (Input_section::section_order_index): New method.
9199 (Input_section::set_section_order_index): New method.
9200 (Input_section::section_order_index_): New member.
9201 (Input_section::Input_section_sort_section_order_index_compare): New
9202 struct.
9203 (Output_section::input_section_order_specified_): New member.
9204 * script-sections.cc (is_wildcard_string): Delete and move modified
9205 method to gold.h.
9206 (Output_section_element_input::Output_section_element_input): Modify
9207 call to is_wildcard_string.
9208 (Output_section_element_input::Input_section_pattern
9209 ::Input_section_pattern): Ditto.
9210 (Output_section_element_input::Output_section_element_input): Ditto.
9211 * testsuite/Makefile.am (final_layout): New test case.
9212 * testsuite/Makefile.in: Regenerate.
9213 * testsuite/final_layout.cc: New file.
9214 * testsuite/final_layout.sh: New file.
9215
3537c84b
RÁE
92162010-06-01 Rafael Espindola <espindola@google.com>
9217
9218 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9219
105b6afd
RÁE
92202010-06-01 Rafael Espindola <espindola@google.com>
9221
9222 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9223 visibility of symbols.
9224
29e11421
DK
92252010-05-27 Doug Kwan <dougkwan@google.com>
9226
9227 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9228 from start of output section instead of address for a local symbol
9229 in a merged or relaxed section when doing a relocatable link.
9230
5e0f337e
RÁE
92312010-05-26 Rafael Espindola <espindola@google.com>
9232
703d02da 9233 PR 11604
5e0f337e
RÁE
9234 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9235 adding sections the garbage collector removed.
9236 * gold/testsuite/Makefile.am: Add test.
9237 * gold/testsuite/Makefile.in: Regenerate.
9238 * gold/testsuite/plugin_test_7.sh: New.
9239 * gold/testsuite/plugin_test_7_1.c: New.
9240 * gold/testsuite/plugin_test_7_2.c: New.
9241
f4187277
RÁE
92422010-05-26 Rafael Espindola <espindola@google.com>
9243
9244 * script-sections.cc (Output_section_definition::set_section_addresses):
9245 Check for --section-start.
9246
5c388529
DK
92472010-05-26 Doug Kwan <dougkwan@google.com>
9248
9249 * arm.cc (Arm_scan_relocatable_relocs): New class.
9250 (Target_arm::relocate_special_relocatable): New method.
9251 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9252 (Arm_relocate_functions::thumb_branch_common): Same.
9253 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9254 instead of Default_scan_relocatable_relocs.
9255 * target-reloc.h (relocate_for_relocatable): Let target handle
9256 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9257 * target.h (Sized_target::relocate_special_relocatable): New method.
9258
bca1c3ae
ILT
92592010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9260
9261 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9262
0439c796
DK
92632010-05-23 Doug Kwan <dougkwan@google.com>
9264
9265 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9266 instead of a cast.
9267 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9268 with a direct branch, not a conditional branch, to a stub.
9269 * merge.cc (Output_merge_base::record_input_section): New method
9270 defintion.
9271 (Output_merge_data::do_add_input_section): Record input section if
9272 keeps-input-sections flag is set.
9273 (Output_merge_string::do_add_input_section): Ditto.
9274 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9275 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9276 INPUT_SECTIONS_.
9277 (Output_merge_base::keeps_input_sections,
9278 Output_merge_base::set_keeps_input_sections,
9279 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9280 method definitions.
9281 (Output_merge_base::Input_sections): New type declaration.
9282 (Output_merge_base::input_sections_begin,
9283 Output_merge_base::input_sections_end,
9284 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9285 (Output_merge_base::bool keeps_input_sections_,
9286 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9287 Output_merge_base::input_sections_): New data members.
9288 (Output_merge_data::do_set_keeps_input_sections): New method
9289 defintion.
9290 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9291 * output.cc (Output_section::Input_section::relobj): Move method
9292 defintion from class declaration to here and handle merge sections.
9293 (Output_section::Input_section::shndx): Ditto.
9294 (Output_section::Output_section): Remove initializations of removed
9295 data members and initialize new data member LOOKUP_MAPS_.
9296 (Output_section::add_input_section): Set keeps-input-sections flag
9297 for a newly created merge output section as appropriate. Adjust code
9298 to use Output_section_lookup_maps class.
9299 (Output_section::add_relaxed_input_section): Adjst code for lookup
9300 maps code refactoring.
2e702c99 9301 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9302 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9303 class. If adding input section to a newly created merge output
9304 section fails, remove the new merge section.
9305 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9306 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9307 (Output_section::find_merge_section): Ditto.
0439c796 9308 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9309 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9310 Output_section_lookup_maps class.
9311 (Output_section::get_input_sections): Export merge sections. Adjust
9312 code to use Output_section_lookup_maps class.
9313 (Output_section:::add_script_input_section): Adjust code to use
9314 Output_section_lookup_maps class. Update lookup maps for merge
9315 sections also.
9316 (Output_section::discard_states): Use Output_section_lookup_maps.
9317 (Output_section::restore_states): Same.
9318 * output.h (Merge_section_properties): Move class defintion out of
9319 Output_section.
9320 (Output_section_lookup_maps): New class.
9321 (Output_section::Input_section::is_merge_section): New method
9322 defintion.
9323 (Output_section::Input_section::relobj): Move defintion out of class
9324 defintion. Declare method only.
9325 (Output_section::Input_section::shndx): Ditto.
9326 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9327 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9328 (Output_section::Merge_section_by_properties_map,
9329 Output_section::Output_section_data_by_input_section_map,
9330 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9331 Remove types.
2e702c99 9332 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9333 KEEPS_INPUT_SECTIONS.
9334 (Output_section::build_lookup_maps): New method declaration.
9335 (Output_section::merge_section_map_,
9336 Output_section::merge_section_by_properties_map_,
9337 Output_section::relaxed_input_section_map_,
9338 Output_section::is_relaxed_input_section_map_valid_): Remove data
9339 members.
9340 (Output_section::lookup_maps_): New data member.
9341
76295588
L
93422010-05-21 Doug Kwan <dougkwan@google.com>
9343
9344 PR gold/11619
9345 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9346 avoid a compilation error.
9347
d103a984
RÁE
93482010-05-19 Rafael Espindola <espindola@google.com>
9349
9350 * script-sections.cc (Output_section_definition::allocate_to_segment):
9351 Update the phdrs_list even when the output section is NULL.
9352 * testsuite/Makefile.am: Add test.
9353 * testsuite/Makefile.in: Regenerate.
9354 * testsuite/script_test_9.cc: New.
9355 * testsuite/script_test_9.sh: New.
9356 * testsuite/script_test_9.t: New.
9357
6625d24e
DK
93582010-05-19 Doug Kwan <dougkwan@google.com>
9359
9360 * arm.cc (Arm_input_section::original_size): New method.
9361 (Arm_input_section::do_addralign): Add a cast.
9362 (Arm_input_section::do_output_offset): Remove static cast.
9363 (Arm_input_section::original_addralign,
9364 Arm_input_section::original_size_): Change type to uint32_t.
9365 (Arm_input_section::init): Add safe casts for section alignment
9366 and size.
9367 (Arm_input_section::set_final_data_size): Do not set address and
9368 offset of stub table.
9369 (Arm_output_section::fix_exidx_coverage): Change use of of
9370 Output_section::Simple_input_section to that of
9371 Output_section::Input_section.
9372 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9373 except for the first pass.
9374 * output.cc (Output_section::get_input_sections): Change type of
9375 input_sections to std::list<Input_section>.
9376 (Output_section::add_script_input_section): Rename from
9377 Output_section::add_simple_input_section. Change type of SIS
9378 parameter from Simple_input_section to Input_section.
9379 * output.h (Output_section::Simple_input_section): Remove class.
9380 (Output_section::Input_section): Change class visibility to public.
9381 (Output_section::Input_section::addralign): Use stored alignments
9382 for special input sections if set.
9383 (Output_section::Input_section::set_addralign): New method.
9384 (Output_section::get_input_sections): Change parameter type from
9385 list of Simple_input_section to list of Input_section.
9386 (Output_section::add_script_input_section): Rename from
9387 Output_section::add_simple_input_section. Change first parameter's
9388 type from Simple_input_section to Input_section and remove the
9389 second and third parameters.
9390 * script-sections.cc (Input_section::Input_section_list): Change
9391 type to list of Output_section::Input_section/
9392 (Input_section_info::Input_section_info): Change parameter type of
9393 INPUT_SECTION to Output_section::Input_section.
9394 (Input_section_info::input_section): Change return type.
9395 (Input_section_info::input_section_): Change type to
9396 Output_section::Input_section.
9397 (Output_section_element_input::set_section_addresses): Adjust code
9398 to use Output_section::Input_section instead of
9399 Output_section::Simple_input_section. Adjust code for renaming
9400 of Output_section::add_simple_input_section.
9401 (Orphan_output_section::set_section_addresses): Ditto.
9402
e1e82ea4
RW
94032010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9404
9405 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9406 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9407
91e75c8a
RÁE
94082010-05-18 Rafael Espindola <espindola@google.com>
9409
9410 * options.cc (General_options::finalize): Handle -nostdlib.
9411 * options.h (nostdlib): New option.
9412 * script.cc (script_add_search_dir): Handle -nostdlib.
9413
da59ad79
DK
94142010-05-12 Doug Kwan <dougkwan@google.com>
9415
9416 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9417 attributes section only if there no attributes section after merging.
9418 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9419 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9420 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9421 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9422 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9423 and arm_attr_merge_7.stdout.
9424 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9425 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9426 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9427 arm_attr_merge_7b.o): New rules.
9428 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9429 arm_attr_merge_7
9430 * testsuite/Makefile.in: Regenerate.
9431 * testsuite/arm_attr_merge.sh: New file.
9432 * testsuite/arm_attr_merge_[67][ab].s: Same.
9433
3e01a7fd
NC
94342010-05-05 Nick Clifton <nickc@redhat.com>
9435
9436 * po/es.po: Updated Spanish translation.
9437
7ad2014a
L
94382010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9439
9440 * Makefile.am (install-exec-local): Properly install gold as
9441 default cross linker.
9442 * Makefile.in: Regenerated.
9443
4fda8867
NC
94442010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9445 Nick Clifton <nickc@redhat.com>
9446
9447 * configure.ac (install_as_default): Define and set to false
9448 unless --enable-gold or --enable-gold=both/gold has been
9449 specified.
9450 * configure: Regenerate.
9451
9452 * Makefile.am (install-exec-local): Install the executable as
9453 'ld.gold'. If install_as_default is true then also install it as
9454 'ld'.
9455 * Makefile.in: Regenerated.
9456
bd288ea2
ILT
94572010-04-24 Ian Lance Taylor <iant@google.com>
9458
9459 * layout.cc (Layout::layout_reloc): In relocatable link don't
9460 combine reloc sections for grouped sections.
9461
ef38fd8a
ST
94622010-04-23 Sriraman Tallam <tmsriram@google.com>
9463
9464 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9465 sections that are not ordinary to icf.
9466 * icf.cc (get_section_contents): Handle relocation pointing to section
9467 with no object or shndx information.
9468 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9469 * testsuite/Makefile.in: Regenerate.
9470 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9471 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9472
f6973bdc
ILT
94732010-04-22 Ian Lance Taylor <iant@google.com>
9474
9475 * expression.cc (Expression::Expression_eval_info): Add
9476 result_alignment_pointer field.
9477 (Expression::eval_with_dot): Add result_alignment_pointer
9478 parameter. Change all callers.
9479 (Expression::eval_maybe_dot): Likewise.
9480 (class Binary_expression): Add alignment_pointer parameter to
9481 left_value and right_value. Change all callers.
9482 (BINARY_EXPRESSION): Set result alignment.
9483 (class Trinary_expression): Add alignment_pointer parameter to
9484 arg2_value and arg3_value. Change all callers.
9485 (Trinary_cond::value): Set result alignment.
9486 (Max_expression::value, Min_expression::value): Likewise.
9487 (Align_expression::value): Likewise.
9488 * script-sections.cc (class Sections_element): Add dot_alignment
9489 parameter to set_section_addresses virtual function. Update
9490 instantiations.
9491 (class Output_section_element): Likewise.
9492 (Script_sections::create_segments): Add dot_alignment parameter.
9493 Change all callers.
9494 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9495 (Script_sections::set_phdrs_clause_addresses): Likewise.
9496 * script-sections.h: Update declarations.
9497 * script.h: Update declarations.
9498 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9499 min_p_align.
9500 * testsuite/script_test_3.t: Set large alignment.
9501 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9502 segment has expected alignment.
9503
9c9c98a5
NC
95042010-04-22 Nick Clifton <nickc@redhat.com>
9505
9506 * po/gold.pot: Updated by the Translation project.
9507 * po/vi.po: Updated Vietnamese translation.
9508
2253bfba
L
95092010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9510
9511 * testsuite/Makefile.am (check_PROGRAMS): Add
9512 icf_virtual_function_folding_test.
9513 * testsuite/Makefile.in: Regenerated.
9514
85fdf906
AH
95152010-04-15 Andrew Haley <aph@redhat.com>
9516
9517 * options.h (merge_exidx_entries): New option.
9518 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9519 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9520 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9521 (Target_arm::merge_exidx_entries): New function.
9522 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9523 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9524 to Arm_exidx_fixup constructor.
9525 Add new arg, merge_exidx_entries.
9526 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9527 Arm_output_section::fix_exidx_coverage.
9528
ce97fa81
ST
95292010-04-18 Sriraman Tallam <tmsriram@google.com>
9530
9531 * icf.cc (get_section_contents): Check for preemptible functions.
9532 Ignore addend when appropriate.
9533 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9534 section folded.
9535 (add_from_relobj): Check for section folded.
9536 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9537 * symtab.h (should_add_dynsym_entry): Add new parameter.
9538 * target-reloc.h (scan_relocs): Check for section folded.
9539 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9540 Check reloc types for function pointers in shared objects.
9541 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9542 case.
9543 (icf_preemptible_functions_test): New test case.
9544 (icf_string_merge_test): New test case.
9545 * testsuite.Makefile.in: Regenerate.
9546 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9547 bar_glob. Refactor code.
9548 * testsuite/icf_preemptible_functions_test.cc: New file.
9549 * testsuite/icf_preemptible_functions_test.sh: New file.
9550 * testsuite/icf_string_merge_test.cc: New file.
9551 * testsuite/icf_string_merge_test.sh: New file.
9552 * testsuite/icf_virtual_function_folding_test.cc: New file.
9553 * testsuite/icf_virtual_function_folding_test.sh: New file.
9554
04ceb17c
DK
95552010-04-14 Doug Kwan <dougkwan@google.com>
9556
9557 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9558 for local symbol recounting if we remove a section due to ICF.
9559 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9560 there are no regular objects in input.
9561
153e7da4
DK
95622010-04-13 Doug Kwan <dougkwan@google.com>
9563
9564 * arm.cc (Arm_input_section::set_final_data_size): Compute
9565 accurate final data size instead of using current data size.
9566
4dbd9faf
DK
95672010-04-09 Doug Kwan <dougkwan@google.com>
9568
9569 * layout.cc (Layout::choose_output_section): Handle script section
9570 types.
9571 (Layout::make_output_section_for_script): Add section type parameter.
9572 Handle script section types.
9573 * layout.h (Layout::make_output_section_for_script): Add section
9574 type parameter.
9575 * output.cc (Output_section::Output_section): Initialize data member
9576 is_noload_.
9577 (Output_section::do_reset_address_and_file_offset): Do not set address
9578 to 0 if section is a NOLOAD section.
9579 * output.h (Output_section::is_noload): New method.
9580 (Output_section::set_is_noload): Ditto.
9581 (Output_section::is_noload_): New data member.
9582 * script-c.h (Script_section_type): New enum type.
9583 (struct Parser_output_section_header): Add new file section_type.
9584 * script-sections.cc (Sections_element::output_section_name): Add
9585 parameter for returning script section type.
9586 (Output_section_definition::output_section_name): Ditto.
9587 (Output_section_definition::section_type)P; New method.
9588 (Output_section_definiton::script_section_type_name): Ditto.
9589 (Output_section_definition::script_section_type_): New data member.
9590 (Output_section_definition::Output_section_definition): Initialize
9591 data member Output_section_definition::script_section_type_.
9592 (Output_section_definition::create_sections): Pass script section type
9593 to Layout::make_output_section_for_script.
9594 (Output_section_definition::output_section_name): Return script
9595 section type to caller.
9596 (Output_section_definition::set_section_address): Do not advance
9597 dot value and load address if section type is NOLOAD. Set address
9598 of NOLOAD sections regardless of section flags.
9599 (Output_section_definition::print): Print section type if it is
9600 not SCRIPT_SECTION_TYPE_NONE.
9601 (Output_section_definition::section_type): New method.
9602 (Output_section_definition::script_section_type_name): Ditto.
9603 (Script_sections::output_section_name): Add new parameter
9604 PSECTION_TYPE for returning script section type. Pass it to
9605 section elements. Handle discard sections.
9606 (Sort_output_sections::operator()): Handle NOLOAD sections.
9607 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9608 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9609 returning script section type.
9610 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9611 INFO and NOLOAD.
9612 * yyscript.y (union): Add new field SECTION_TYPE.
9613 (COPY, DSECT, INFO, NOLOAD): New tokens.
9614 (opt_address_and_section_type): Change type to output_section_header.
9615 (section_type): New non-terminal
9616 (section_header): Handle section type.
2253bfba 9617 (opt_address_and_section_type): Return section type value.
4dbd9faf 9618
721ea635
L
96192010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9620
9621 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9622 * testsuite/plugin_common_test_2.c (foo): Likewise.
9623
6bf924b0
DK
96242010-04-08 Doug Kwan <dougkwan@google.com>
9625
9626 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9627 Output_merge_data.
9628 * output.cc (Output_section::add_merge_input_section): Simplify
9629 code and return status of Output_merge_base::add_input_section.
e1df38aa 9630 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9631 returns true.
9632
24af6f92
DK
96332010-04-07 Doug Kwan <dougkwan@google.com>
9634
9635 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9636 if section is marked as containing instructions but has no mapping
9637 symbols.
9638 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9639 correct section index.
9640 (Arm_relobj::find_linked_text_section): Ditto.
9641
00698fc5
CC
96422010-04-07 Cary Coutant <ccoutant@google.com>
9643
9644 * archive.cc (include_member): Destroy Read_symbols_data object before
9645 releasing file.
9646 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9647 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9648 (Read_symbols_data::~Read_symbols_data) New destructor.
9649 (Section_relocs::Section_relocs) New constructor.
9650 (Section_relocs::~Section_relocs) New destructor.
9651 (Read_relocs_data::Read_relocs_data) New constructor.
9652 (Read_relocs_data::~Read_relocs_data) New destructor.
9653 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9654 pointers to NULL after deleting.
9655
7296d933
DK
96562010-04-07 Doug Kwan <dougkwan@google.com>
9657
9658 * arm.cc: Replace "endianity" with "endianness" in comments.
9659 (Arm_exidx_cantunwind): Ditto.
9660 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9661 (Arm_relobj::merge_flags_and_attributes): New method.
9662 (Arm_relobj::merge_flags_and_attributes_): New data member.
9663 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9664 (Arm_relobj::scan_sections_for_stubs): Ditto.
9665 (Arm_relobj::do_read_symbols): Check to see if we really want to
9666 merge processor-specific flags and attributes. Exit early if
9667 an object is empty except for section names and the undefined symbol.
9668 (Target_arm::do_finalize_sections): Move check for ELF format to
9669 Arm_relobj::do_read_symbols. Merge processor specific flags and
9670 attributes from a regular object only when we have determined that
9671 it is aapropriate. Do not create an .ARM.attributes section in
9672 output if there is no regular input object.
9673 (Target_arm::merge_processor_specific_flags): Check
9674 --warn-mismatch before printing any error.
9675 (Target_arm::merge_object_attributes): Ditto.
9676 * gold.cc (queue_middle_tasks): Handle the case in which there is
9677 no regular object in input.
9678 * options.cc (General_options::parse_EB): New method.
9679 (General_options::parse_EL): Same.
9680 (General_options::General_options): Initialize endianness_.
9681 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9682 New options.
9683 (General_options::Endianness): New enum.
9684 (General_options::endianness): New method.
9685 (General_options::endianness_): New data member.
9686 * parameters.cc (Parameters::set_options): Check target endianness.
9687 (Parameters::set_target_once): Ditto.
9688 (Parameters::check_target_endianness): New method.
9689 (parameters_force_valid_target): If either -EL or -EB is specified,
9690 use it to define endianness of default target.
9691 * parameters.h (Parameters::check_target_endianness): New method
9692 declaration.
9693 * target.h (class Target): Change "endianity" to "endianness"
9694 in comments.
9695
efc8d4f2
RW
96962010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9697
9698 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9699 * configure: Regenerate.
9700 * Makefile.in: Regenerate.
9701 * testsuite/Makefile.in: Regenerate.
9702
be234d88
CC
97032010-04-06 Cary Coutant <ccoutant@google.com>
9704
9705 gcc PR lto/42757
9706 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9707 prevailing definitions of common symbols.
9708 * testsuite/plugin_test_6.sh: New test case.
9709 * testsuite/plugin_common_test_1.c: New test case.
9710 * testsuite/plugin_common_test_2.c: New test case.
9711 * testsuite/Makefile.am (plugin_test_6): New test case.
9712 * testsuite/Makefile.in: Regenerate.
9713
bd32c6bd
NC
97142010-04-06 Nick Clifton <nickc@redhat.com>
9715
9716 * po/vi.po: New Vietnamese translation.
9717
323c532f
DK
97182010-03-30 Doug Kwan <dougkwan@google.com>
9719
9720 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9721
4fcd97eb
DK
97222010-03-25 Doug Kwan <dougkwan@google.com>
9723
9724 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9725 to avoid a conversion warning on a 32-bit host.
9726
4ebf39db
ILT
97272010-03-24 Ian Lance Taylor <iant@google.com>
9728
9729 * testsuite/script_test_3.t: Add a TLS segment.
9730 * testsuite/Makefile.am (check_PROGRAMS): Add
9731 tls_phdrs_script_test.
9732 (tls_phdrs_script_test_SOURCES): Define.
9733 (tls_phdrs_script_test_DEPENDENCIES): Define.
9734 (tls_phdrs_script_test_LDFLAGS): Define.
9735 (tls_phdrs_script_test_LDADD): Define.
9736 * testsuite/Makefile.in: Rebuild.
9737
4a599bdd
CC
97382010-03-23 Cary Coutant <ccoutant@google.com>
9739
9740 * fileread.cc (find_or_make_view): Fix comment.
9741
6c93b22c
ILT
97422010-03-23 Ian Lance Taylor <iant@google.com>
9743
9744 * script-sections.cc (class Orphan_section_placement): Define
9745 PLACE_TLS and PLACE_TLS_BSS.
9746 (Orphan_section_placement::Orphan_section_placement): Initialize
9747 new places.
9748 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9749 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9750 (tls_script_test_SOURCES): Define.
9751 (tls_script_test_DEPENDENCIES): Define.
9752 (tls_script_test_LDFLAGS): Define.
9753 (tls_script_test_LDADD): Define.
9754 * testsuite/Makefile.in: Rebuild.
9755
a2c7281b
DK
97562010-03-22 Doug Kwan <dougkwan@google.com>
9757
9758 * arm.cc (Arm_relocate_functions::abs8,
9759 Arm_relocate_functions::abs16): Use correct check for overflow
9760 specified in the ARM ELF specs.
9761 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9762 target of a BLX instruction specially.
9763 (Reloc_stub::stub_type_for_reloc): Ditto.
9764 (Relocate::relocate): Use symbolic names instead of numeric relocation
9765 codes to report error.
9766 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9767 workaround.
9768 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9769 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9770 thumb2_blx_out_of_range.stdout
9771 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9772 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9773 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9774 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9775 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9776 thumb2_blx_in_range, thumb2_blx_in_range.o,
9777 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9778 thumb2_blx_out_of_range.o): New rules.
2e702c99 9779 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9780 thumb2_blx_in_range and thumb2_blx_out_of_range.
9781 * testsuite/Makefile.in: Regenerate.
9782 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9783 * testsuite/thumb_blx_in_range.s: New file.
9784 * testsuite/thumb_blx_out_of_range.s: New file.
9785
b0193076
RÁE
97862010-03-22 Rafael Espindola <espindola@google.com>
9787
9788 * archive.cc (Should_include): Move to archive.h.
9789 (should_include_member): Make it a member of Archive.
9790 (Lib_group): New.
9791 (Add_lib_group_symbols): New.
9792 * archive.h: Include options.h.
9793 (Archive_member): Moved from Archive.
9794 (Should_include): Moved from archive.cc.
9795 (Lib_group): New.
9796 (Add_lib_group_symbols): New.
9797 * dynobj.cc (do_should_include_member): New.
9798 * dynobj.h (do_should_include_member): New.
9799 * gold.cc (queue_initial_tasks): Update call to queue.
9800 * main.cc (main): Print lib group stats.
9801 * object.cc (do_should_include_member): New.
9802 * object.h: Include archive.h.
9803 (Object::should_include_member): New.
9804 (Object::do_should_include_member): New.
9805 (Sized_relobj::do_should_include_member): New.
9806 * options.cc (General_options::parse_start_lib): New.
9807 (General_options::parse_end_lib): New.
9808 (Input_arguments::add_file): Handle lib groups.
9809 (Input_arguments::start_group): Check we are not in a lib.
9810 (Input_arguments::start_lib): New.
9811 (Input_arguments::end_lib): New.
9812 * options.h (General_options): Add start_lib and end_lib.
9813 (Input_argument::lib_): New.
9814 (Input_argument::lib): New.
9815 (Input_argument::is_lib): New.
9816 (Input_file_lib): New.
9817 (Input_arguments::in_lib_): New.
9818 (Input_arguments::in_lib): New.
9819 (Input_arguments::start_lib): New.
9820 (Input_arguments::end_lib_): New.
9821 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9822 in unused members as preempted.
9823 (Sized_pluginobj::do_should_include_member): New.
9824 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9825 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9826 return the blocker.
9827 (Read_symbols::do_whole_lib_group): New.
9828 (Read_symbols::do_lib_group): New.
9829 (Read_symbols::do_read_symbols): Handle lib groups.
9830 (Read_symbols::get_name): Handle lib groups.
9831 * readsyms.h (Read_symbols): Add an archive member pointer.
9832 (Read_symbols::do_whole_lib_group): New.
9833 (Read_symbols::do_lib_group): New.
9834 (Read_symbols::member_): New.
9835 * script.cc (read_input_script): Update call to queue_soon.
9836
d099120c
DK
98372010-03-19 Doug Kwan <dougkwan@google.com>
9838
9839 * arm.cc (Stub_table::Stub_table): Initialize new data members
9840 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9841 (Stub_table::add_reloc_stub): Assign stub offset and update
9842 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9843 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9844 New data members.
2e702c99 9845 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9846 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9847 instead of going over all reloc stubs.
2e702c99 9848 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9849 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9850 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9851 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9852 Stringpool_template::offset_.
9853 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9854 Stringpool_template::offset_ to zero.
9855
1aa37384
DK
98562010-03-15 Doug Kwan <dougkwan@google.com>
9857
9858 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9859 offset_.
9860 (Stringpool_template::new_key_offset): New method.
9861 (Stringpool_template::add_string): Assign offsets when adding new
9862 strings.
9863 (Stringpool_template::set_string_offsets): Do not set string offsets
9864 when not optimizing.
9865 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9866 member size_.
2e702c99
RM
9867 (Chunked_vector::clear): Clear size_.
9868 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9869 (Chunked_vector::size): Return size_.
9870 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9871 (Chunked_vector::size_): New data member.
1aa37384
DK
9872 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9873 (Stringpool_template::new_key_offset): New method declaration.
9874 (Stringpool_template::offset_): New data member.
9875
b672b057
RÁE
98762010-03-15 Rafael Espindola <espindola@google.com>
9877
9878 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9879 Add_symbols' constructor.
9880 * readsyms.h (Add_symbols): Remove the input_group member.
9881
b6848d3c
ILT
98822010-03-10 Ian Lance Taylor <iant@google.com>
9883
9884 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9885 target to ask whether a reference to a symbol requires a stack
9886 split.
9887 * target.h (Target::is_call_to_non_split): New function.
9888 (Target::do_is_call_to_non_split): Declare virtual function.
9889 * target.cc: Include "symtab.h".
9890 (Target::do_is_call_to_non_split): New function.
9891 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9892
a2a5469e
CC
98932010-03-10 Cary Coutant <ccoutant@google.com>
9894
9895 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9896 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9897 (File_read::open[2]): Add whole_file_view_ to list of views.
9898 (File_read::make_view): Remove test of whole_file_view_.
9899 (File_read::find_or_make_view): Create whole_file_view_ if
9900 necessary.
9901 (File_read::clear_views): Replace bool parameter with enum;
9902 adjust all callers. Don't delete views with permanent data;
9903 do delete cached views and views from archives if
9904 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9905 if clearing the corresponding view.
9906 * fileread.h (File_read::Clear_views_mode): New enum.
9907 (File_read::View::is_permanent_view): New method.
9908 (File_read::clear_views): Replace bool parameter
9909 with enum; adjust all callers.
9910 * options.h (General_options): Change keep_files_mapped option;
9911 add map_whole_files.
9912 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9913 releasing the file.
9914 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9915 the file.
9916
8861f32b
DM
99172010-03-10 David S. Miller <davem@davemloft.net>
9918
9919 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9920
d62d0f5f
ST
99212010-03-09 Sriraman Tallam <tmsriram@google.com>
9922
9923 * icf.cc (get_section_contents): Add '@' marker after processing the
9924 merge reloc.
9925
9177756d
DK
99262010-03-08 Doug Kwan <dougkwan@google.com>
9927
9928 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9929 due to a conversion warning.
9930 (Arm_relobj::update_output_local_symbol_count): Check for local
9931 symbol with unset output index.
9932
9e9e071b
ILT
99332010-03-05 Ian Lance Taylor <iant@google.com>
9934
9935 * options.h (class General_options): Add --spare-dynamic-tags.
9936 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9937 --spare-dynamic-tags.
9938
a81ee015
ILT
99392010-03-05 Ian Lance Taylor <iant@google.com>
9940
9941 * incremental.cc: Include "libiberty.h".
9942
44ec90b9
RO
99432010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9944
9945 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9946 function, is_info_ member.
9947 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9948 (Versions::Versions): Update caller.
9949 (Versions::define_base_version): Likewise.
9950 (Versions::add_def): Likewise.
9951
0897ed3b
ST
99522010-03-03 Sriraman Tallam <tmsriram@google.com>
9953
9954 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9955 (Scan::possible_function_pointer_reloc): New function.
9956 (Scan::local_reloc_may_be_function_pointer): Change to call
9957 possible_function_pointer_reloc.
9958 (Scan::global_reloc_may_be_function_pointer): Ditto.
9959 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9960 relocations in ".data.rel.ro._ZTV" section.
9961 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9962 * testsuite/icf_safe_so_test.cc: Ditto.
9963 * testsuite/icf_safe_test.cc: Ditto.
9964 * testsuite/icf_safe_test.sh: Ditto.
9965
d3bbad62
ILT
99662010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9967 Ian Lance Taylor <iant@google.com>
9968
9969 * target-reloc.h (relocate_section): Check the symbol table index
9970 for -1U before setting the local symbol index.
9971 (scan_relocatable_relocs): If copying the relocation, record that
9972 the local symbol is required.
9973 * object.h (Symbol_value::is_output_symtab_index_set): New
9974 function.
9975 (Symbol_value::may_be_discarded_from_output_symtab): New
9976 function.
9977 (Symbol_value::has_output_symtab_entry): New function.
9978 (Symbol_value::needs_output_symtab_entry): Remove.
9979 (Symbol_value::output_symtab_index): Make sure the symbol index is
9980 set.
9981 (Symbol_value::set_output_symtab_index): Make sure the symbol
9982 index is not set. Make sure the new index is valid.
9983 (Symbol_value::set_must_have_output_symtab_entry): New function.
9984 (Symbol_value::has_output_dynsym_entry): New function.
9985 (Symbol_value::set_output_dynsym_index): Make sure the new index
9986 is valid.
9987 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9988 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9989 local symbol if permitted.
9990 (Sized_relobj::do_finalize_local_symbols): Call
9991 is_output_symtab_index_set rather than needs_output_symtab_entry.
9992 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9993 rather than needs_output_symtab_entry. Call
9994 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9995 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9996 is_output_symtab_index_set rather than needs_output_symtab_entry.
9997 * testsuite/discard_locals_relocatable_test.c: New file.
9998 * testsuite/discard_locals_test.sh: Test -r.
9999 * testsuite/Makefile.am (check_DATA): Add
10000 discard_locals_relocatable_test1.syms,
10001 discard_local_relocatable_test2.syms.
10002 (MOSTLYCLEANFILES): Likewise. Also add
10003 discard_locals_relocatable_test1.lout and
10004 discard_locals_relocatable_test2.out.
10005 (discard_locals_relocatable_test1.syms): New target.
10006 (discard_locals_relocatable_test.o): New target.
10007 (discard_locals_relocatable_test1.out): New target.
10008 (discard_locals_relocatable_test2.syms): New target.
10009 (discard_locals_relocatable_test2.out): New target.
10010 (various): Add missing ../ld-new dependencies.
10011 * testsuite/Makefile.in: Rebuild.
10012
7e8ccf26
NC
100132010-03-03 Nick Clifton <nickc@redhat.com>
10014
10015 * po/fi.po: New Finnish translation.
10016
2a0ff005
DK
100172010-03-01 Doug Kwan <dougkwan@google.com>
10018
10019 * layout.cc (Layout::Layout): Force section types of .init_array*,
10020 .preinit_array* and .fini_array* sections.
10021 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10022 Fix check of return value of std::string::find.().
10023 (Output_section::Input_section_sort_compare::operator()): Remove
10024 comment about .init_array.
10025 (Output_section::Input_section_sort_init_fini_compare::operator()):
10026 New method.
10027 (Output_section::sort_attached_input_sections): Handle .init_array
10028 and .fini_array specially.
10029 * output.h (Output_section::Inut_section_sort_compare): Update
10030 comment.
10031 (Output_section::Input_section_sort_init_fini_compare): New struct.
10032
c3e4ae29
DK
100332010-02-26 Doug Kwan <dougkwan@google.com>
10034
10035 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10036 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10037 * testsuite/debug_msg.sh: Avoid matching source line number for
10038 use of global variable undef_int.
10039
2fd9ae7a
DK
100402010-02-26 Doug Kwan <dougkwan@google.com>
10041
10042 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10043 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10044 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10045 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10046 * options.cc (General_options::General_options): Initialize member
10047 fix_v4bx_.
10048 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10049 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10050 and rm_no_fix_v4bx.stdout
10051 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10052 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10053 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10054 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10055 and arm_no_fix_v4bx.
10056 * Makefile.in: Regenerate.
10057 * testsuite/arm_fix_v4bx.s: New file.
10058 * testsuite/arm_fix_v4bx.sh: Ditto.
10059
67ec7d0b
DK
100602010-02-24 Doug Kwan <dougkwan@google.com>
10061
10062 * arm.cc (Target_arm::got_section): Make the .got section the first
10063 non RELRO section in the data segment.
10064 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10065 suffixes of section names.
10066
10165461
DK
100672010-02-24 Doug Kwan <dougkwan@google.com>
10068
10069 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10070 flags and attributes merging if an input file is a binary file.
10071 * fileread.cc (Input_file::open): Record format of original file.
10072 * fileread.h (Input_file::Format): New enum type.
2e702c99 10073 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10074 (Input_file::format): New method definition.
10075 (Input_file::format_):: New data member.
10076
4a54abbb
DK
100772010-02-24 Doug Kwan <dougkwan@google.com>
10078
10079 * arm.cc (Arm_output_data_got): New class.
10080 (ARM_TCB_SIZE): New constant
10081 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10082 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10083 If user uses a script with a SECTIONS clause, issue only a warning
10084 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10085 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10086 garbage collection.
10087 (Target_arm::got_mode_index_entry): Handle static linking.
10088 (Target_arm::Scan::local): Ditto.
10089 (Target_arm::Scan::global): Ditto.
10090 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10091 all incorrectly implemented relocations.
e1df38aa 10092 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10093 Arm_output_section::fix_exidx_coverage.
10094 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10095 from ".ARM.exidx." and ".ARM.extab.".
10096
ca419a6f
ILT
100972010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10098
10099 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10100 section if it does not already exist.
10101 * attributes.cc (Attributes_section_data::Attributes_section_data):
10102 Don't crash if size is zero.
10103
135b9c78
ILT
101042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10105 Ian Lance Taylor <iant@google.com>
10106
10107 * gold.cc (queue_middle_tasks): If no input files were opened,
10108 exit.
10109 * workqueue.h (Task_function::Task_function): Assert that there is
10110 a blocker.
10111
bb0bfe4f
DK
101122010-02-22 Doug Kwan <dougkwan@google.com>
10113
10114 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10115 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10116 types to avoid warnings due to different uint64_t implementations
10117 on different hosts.
10118
2a2b6d42
DK
101192010-02-21 Doug Kwan <dougkwan@google.com>
10120
10121 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10122 handling of the maximum backward branch offset.
2e702c99 10123 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10124 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10125 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10126 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10127 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10128 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10129 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10130 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10131 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10132 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10133 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10134 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10135 thumb2_bl_out_of_range.o): New rules.
10136 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10137 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10138 thumb2_bl_out_of_range
10139 * testsuite/Makefile.in: Regenerate.
10140 * testsuite/arm_bl_in_range.s: New file.
10141 * testsuite/arm_bl_out_of_range.s: Ditto.
10142 * testsuite/arm_branch_in_range.sh: Ditto.
10143 * testsuite/arm_branch_range.t: Ditto.
10144 * testsuite/thumb2_branch_range.t: Ditto.
10145 * testsuite/thumb_bl_in_range.s: Ditto.
10146 * testsuite/thumb_bl_out_of_range.s: Ditto.
10147 * testsuite/thumb_branch_range.t: Ditto.
10148
b487ad64
ST
101492010-02-20 Sriraman Tallam <tmsriram@google.com>
10150
10151 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10152 Add reloc offset information.
10153 * icf.cc (get_section_contents): Change iterators to point to the new
10154 vectors. Add reloc offset information to the contents.
10155 * icf.h (Icf::Sections_reachable_info): New typedef.
10156 (Icf::Sections_reachable_list): New typedef.
10157 (Icf::Offset_info): New typedef.
10158 (Icf::Reloc_info): New struct typedef.
10159 (Icf::Reloc_info_list): New typedef.
10160 (Icf::symbol_reloc_list): Delete method.
10161 (Icf::addend_reloc_list): Delete method.
10162 (Icf::section_reloc_list): Delete method.
10163 (Icf::reloc_info_list): New method.
10164 (Icf::reloc_info_list_): New member.
10165
f96accdf
DK
101662010-02-19 Doug Kwan <dougkwan@google.com>
10167
10168 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10169 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10170 * arm.cc (Arm_relocation_functions): New forward declaration.
10171 (Target_arm::Target_arm): Initialize new data members
10172 got_mod_index_offset_ and tls_base_symbol_defined_.
10173 (Target_arm::Relocate::relocate_tls): New method.
10174 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10175 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10176 New methods.
2e702c99 10177 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10178 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10179 (Target_arm::got_mod_index_offset_,
10180 Target_arm::tls_base_symbol_defined_): New data members.
10181 (Target_arm::Scan::local, Target::Scan::global,
10182 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10183 relocations.
10184
c8761b9a
DK
101852010-02-18 Doug Kwan <dougkwan@google.com>
10186
10187 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10188 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10189 text section as a parameter becuase some broken tools may not set
10190 the link in section header.
10191 (Target_arm::has_got_section): New method.
10192 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10193 without any mapping symbol as data only. Remove warning.
10194 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10195 link in its section header, try to discover the link by inspecting the
10196 REL31 relocation at the beginning of the section.
10197 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10198 in error message.
10199 (Target_arm::Scan::global): Treat any reference to the symbol
10200 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10201
21bb3914
ST
102022010-02-12 Sriraman Tallam <tmsriram@google.com>
10203
10204 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10205 (Scan::global_reloc_may_be_function_pointer): New function.
10206 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10207 (Scan::global_reloc_may_be_function_pointer): New function.
10208 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10209 (Scan::global_reloc_may_be_function_pointer): New function.
10210 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10211 (Scan::global_reloc_may_be_function_pointer): New function.
10212 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10213 (Scan::global_reloc_may_be_function_pointer): New function.
10214 (Scan::possible_function_pointer_reloc): New function.
10215 (Target_x86_64::can_check_for_function_pointers): New function.
10216 * gc.h (gc_process_relocs): Scan relocation types to determine if
10217 function pointers were taken for targets that support it.
10218 * icf.cc (Icf::find_identical_sections): Include functions for
10219 folding in safe ICF whose pointer is not taken.
10220 * icf.h (Secn_fptr_taken_set): New typedef.
10221 (fptr_section_id_): New member.
10222 (section_has_function_pointers): New function.
10223 (set_section_has_function_pointers): New function.
10224 (check_section_for_function_pointers): New function.
10225 * options.h: Fix comment for safe ICF option.
10226 * target.h (can_check_for_function_pointers): New function.
10227 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10228 Modify icf_safe_test for X86-64.
10229 * testsuite/Makefile.in: Regenerate.
10230 * testsuite/icf_safe_so_test.cc: New file.
10231 * testsuite/icf_safe_so_test.sh: New file.
10232 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10233 (main): Change to take pointer to function kept_func_3.
10234 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10235 folding is done correctly for X86-64.
10236
0da6fa6c
DM
102372010-02-12 David S. Miller <davem@davemloft.net>
10238
10239 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10240 is_symbolless parameter.
10241 (Output_reloc<SHT_REL>::is_symbolless): New.
10242 (Output_reloc<SHT_REL>::is_symbolless_): New.
10243 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10244 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10245 (Output_reloc<SHT_RELA>::is_symbolless): New.
10246 (Output_data_reloc::add_global): Handle is_symbolless.
10247 (Output_data_reloc::add_global_relative): Likewise.
10248 (Output_data_reloc::add_local): Likewise.
10249 (Output_data_reloc::add_local_relative): Likewise.
10250 (Output_data_reloc::add_symbolless_global_addend): New.
10251 (Output_data_reloc::add_symbolless_local_addend): New.
10252 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10253 is_symbolless.
10254 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10255 instead of ->is_relative_
10256 (Output_reloc::write): Likewise.
10257 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10258 (Output_reloc::write_rel): Simplify.
10259
10260 * sparc.cc (Target_sparc::Scan::local): Use
10261 ->add_symbolless_local_addend as needed.
10262 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10263 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10264 based upon relocation offset.
10265
e4782e83
DK
102662010-02-11 Doug Kwan <dougkwan@google.com>
10267
10268 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10269 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10270 beginning of function.
10271 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10272 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10273 parameter is_32bit in calls to should_apply_static_reloc.
10274 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10275 (check_DATA): Add arm_abs_global.stdout.
10276 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10277 arm_abs_global.stdout): New rules.
10278 (MOSTLLYCLEANFILES): Add arm_abs_global
10279 * Makefile.in: Regenerate.
10280 * testsuite/arm_abs_global.s: New file.
10281 * testsuite/arm_abs_global.sh: Ditto.
10282 * testsuite/arm_abs_lib.s: Ditto.
10283
93ceb764
ILT
102842010-02-11 Ian Lance Taylor <iant@google.com>
10285
10286 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10287 Read_relocs task.
10288 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10289 Allocate_commons_task first.
10290 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10291 task, rather than symtab_lock_.
10292 (Gc_process_relocs::~Gc_process_relocs): New function.
10293 (Gc_process_relocs::is_runnable): Check this_blocker_.
10294 (Gc_process_relocs::locks): Use next_blocker_ rather than
10295 blocker_.
10296 (Scan_relocs::~Scan_relocs): New function.
10297 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10298 symtab_lock_.
10299 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10300 next_blocker_.
10301 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10302 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10303 constructor accordingly.
10304 (class Gc_process_relocs): Likewise.
10305 (class Scan_relocs): Likewise.
10306 * common.h (class Allocate_commons_task): Remove symtab_lock_
10307 field, and corresponding constructor parameter.
10308 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10309 symtab_lock_.
10310 (Allocate_commons_task::locks): Likewise.
10311
114dfbe1
ILT
103122010-02-11 Ian Lance Taylor <iant@google.com>
10313
10314 * gold-threads.h (class Once): Define.
10315 (class Initialize_lock): Rewrite as child of Once.
10316 * gold-threads.cc (class Once_initialize): Define.
10317 (once_pointer_control): New static variable.
10318 (once_pointer, once_arg): New static variables.
10319 (c_run_once): New static function.
10320 (Once::Once, Once::run_once, Once::internal_run): New functions.
10321 (class Initialize_lock_once): Remove.
10322 (initialize_lock_control): Remove.
10323 (initialize_lock_pointer): Remove.
10324 (initialize_lock_once): Remove.
10325 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10326 (Initialize_lock::initialize): Rewrite.
10327 (Initialize_lock::do_run_once): New function.
10328 * archive.cc (Archive::interpret_header): Only clear name if it is
10329 not already empty.
10330 * fileread.cc: Include "gold-threads.h"
10331 (file_counts_lock): New static variable.
10332 (file_counts_initialize_lock): Likewise.
10333 (File_read::release): Only increment counts when using --stats.
10334 Use a lock around the increment.
10335 * parameters.cc (class Set_parameters_target_once): Define.
10336 (set_parameters_target_once): New static variable.
10337 (Parameters::Parameters): Move here from parameters.h.
10338 (Parameters::set_target): Rewrite.
10339 (Parameters::set_target_once): New function.
10340 (Parameters::clear_target): Move here and rewrite.
10341 * parameters.h (class Parameters): Update declarations. Add
10342 set_parameters_target_once_ field.
10343 (Parameters::Parameters): Move to parameters.cc.
10344 (Parameters::clear_target): Likewise.
10345 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10346 task.
10347 (Start_group::~Start_group): New function.
10348 (Start_group::is_runnable): New function.
10349 (Start_group::locks, Start_group::run): New functions.
10350 (Finish_group::run): Change saw_undefined to size_t.
10351 * readsyms.h (class Start_group): Define.
10352 (class Finish_group): Change saw_undefined_ field to size_t.
10353 (Finish_group::Finish_group): Remove saw_undefined and
10354 this_blocker parameters. Change all callers.
10355 (Finish_group::set_saw_undefined): New function.
10356 (Finish_group::set_blocker): New function.
10357 * symtab.h (class Symbol_table): Change saw_undefined to return
10358 size_t. Change saw_undefined_ field to size_t.
10359 * target-select.cc (Set_target_once::do_run_once): New function.
10360 (Target_selector::Target_selector): Initialize set_target_once_
10361 field. Don't initialize lock_ and initialize_lock_ fields.
10362 (Target_selector::instantiate_target): Rewrite.
10363 (Target_selector::set_target): New function.
10364 * target-select.h (class Set_target_once): Define.
10365 (class Target_selector): Update declarations. Make
10366 Set_target_once a friend. Remove lock_ and initialize_lock_
10367 fields. Add set_target_once_ field.
10368
fa17a3f4
ILT
103692010-02-10 Ian Lance Taylor <iant@google.com>
10370
10371 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10372 queueing any tasks.
10373 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10374 (queue_middle_tasks): Add all blockers before queueing any tasks.
10375 (queue_final_tasks): Likewise.
10376 * token.h (Task_token::add_blockers): New function.
10377 * object.h (Input_objects::number_of_relobjs): New function.
10378
c7177d31
ILT
103792010-02-10 Ian Lance Taylor <iant@google.com>
10380
5de0e392
ILT
10381 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10382 shared, not if not position independent.
10383 * x86_64.cc (Relocate::relocate_tls): Likewise.
10384 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10385 (tls_pie_pic_test): New target.
10386 * testsuite/Makefile.in: Rebuild.
10387
c7177d31
ILT
10388 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10389 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10390 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10391 * testsuite/Makefile.in: Rebuild.
10392
684b268a
DM
103932010-02-09 David S. Miller <davem@davemloft.net>
10394
10395 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10396 R_SPARC_RELATIVE using ->add_local_relative().
10397 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10398
612a8d3d
DM
10399 * output.h (Output_data_dynamic::add_section_size): New method
10400 that takes two Output_data objects.
10401 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10402 entry param. Handle it in initializers.
10403 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10404 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10405 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10406 arg.
10407 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10408 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10409 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10410 for dynrel_includes_plt.
10411 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10412 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10413 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10414 before .rela.plt
10415 (Target_sparc::do_finalize_sections): Update to pass true for
10416 dynrel_includes_plt.
10417 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10418 output before .rela.plt
10419 (Target_powerpc::do_finalize_sections): Update to pass true for
10420 dynrel_includes_plt when 32-bit.
10421
cb1be87e
DK
104222010-02-08 Doug Kwan <dougkwan@google.com>
10423
10424 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10425 method.
10426 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10427 Arm_relobj::scan_section_for_cortex_a8_stubs,
10428 Arm_relobj::do_relocation_section): Instead of calling
10429 Output_section::output_address, use faster
10430 Arm_relobj::simple_input_section_output_address.
10431
705b5121
DM
104322010-02-08 David S. Miller <davem@davemloft.net>
10433
10434 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10435 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10436 relocation helper function.
10437
024c4466
DM
10438 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10439 just like R_SPARC_GOT{10,13,22}.
10440 (Target_sparc::Scan::local): Likewise.
10441 (Target_sparc::Relocate:relocate): Likewise.
10442
9109c078
ILT
104432010-02-06 Ian Lance Taylor <iant@google.com>
10444
10445 * configure.ac: Rewrite targetobjs duplicate removal code to use
10446 only shell constructs.
10447 * configure: Rebuild.
10448
cf846138
DK
104492010-02-05 Doug Kwan <dougkwan@google.com>
10450
10451 PR 11247
10452 * arm.cc (Arm_relobj::section_is_scannable): New method.
10453 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10454 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10455
6cfaf60b
DK
104562010-02-04 Doug Kwan <dougkwan@google.com>
10457
10458 PR 11247
10459 * arm-reloc-property.cc (cstdio): Include.
10460 * configure.ac (targetobjs): Remove duplicates.
10461 * configure: Regenerate.
10462 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10463 big and little endian version for a given address size.
10464
5c57f1be
DK
104652010-02-03 Doug Kwan <dougkwan@google.com>
10466
10467 * arm-reloc-property.cc
10468 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10469 definition.
10470 * arm-reloc-property.h
10471 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10472 New method definition.
10473 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10474 declaration.
10475 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10476 overflow to N.
10477 (GOT_PREL): Change implemented to Y.
10478 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10479 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10480 (Arm_relocate_functions::movw_abs_nc): Remove method.
10481 (Arm_relocate_functions::movt_abs): Ditto.
10482 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10483 (Arm_relocate_functions::thm_movt_abs): Ditto.
10484 (Arm_relocate_functions::movw_rel_nc): Ditto.
10485 (Arm_relocate_functions::movw_rel): Ditto.
10486 (Arm_relocate_functions::movt_rel): Ditto.
10487 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10488 (Arm_relocate_functions:thm_movw_rel): Ditto.
10489 (Arm_relocate_functions:thm_movt_rel): Ditto.
10490 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10491 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10492 New method definitions.
10493 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10494 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10495 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10496 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10497 (Target_arm::Relocate::relocate): Check for non-static or
10498 unimplemented relocation code and exit early. Change calls to
10499 Target_arm::reloc_uses_thumb_bit and
10500 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10501 instead. Refactor code to handle similar relocations to increase
10502 code sharing. Remove check for unsupported relocation code in switch
10503 statement.
10504 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10505 relocation property table to find out size. Change error message to
10506 print out the name of a relocation code instead of the numeric value.
10507 (Target_arm::scan_reloc_for_stub): Use relocation property table
10508 instead of calling Target_arm::reloc_uses_thumb_bit().
10509
218c5831
DK
105102010-02-02 Doug Kwan <dougkwan@google.com>
10511
10512 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10513 types of relaxed input section.
10514
0d31c79d
DK
105152010-02-02 Doug Kwan <dougkwan@google.com>
10516
10517 * Makefile.am (HFILES): Add arm-reloc-property.h.
10518 (DEFFILES): New.
2e702c99
RM
10519 (TARGETSOURCES): Add arm-reloc-property.cc
10520 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10521 (libgold_a_SOURCES): $(DEFFILES)
10522 * Makefile.in: Regenerate.
10523 * arm-reloc-property.cc: New file.
10524 * arm-reloc-property.h: New file.
10525 * arm-reloc.def: New file.
10526 * arm.cc: Update comments.
10527 (arm-reloc-property.h): New included header.
10528 (arm_reloc_property_table): New global variable.
10529 (Target_arm::do_select_as_default_target): New method definition.
10530 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10531 arm-reloc-property to targ_extra_obj.
10532 * parameters.cc (set_parameters_target): Call
10533 Target::select_as_default_target().
10534 * target.h (Target::select_as_default_target): New method definition.
10535 (Target::do_select_as_default_target): Same.
10536
546c7457
DK
105372010-02-01 Doug Kwan <dougkwan@google.com>
10538
10539 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10540 first_output_text_section_.
10541 (Arm_exidx_fixup::first_output_text_section): New method definition.
10542 (Arm_exidx_fixup::first_output_text_section_): New data member.
10543 (Arm_exidx_fixup::process_exidx_section): Record the first text
10544 output section seen.
10545 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10546 and entsize in output section header.
10547
11b861d5
DK
105482010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10549
10550 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10551 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10552 (Arm_relocate_functions::thm_alu11): New Method.
10553 (Arm_relocate_functions::thm_pc8): New Method.
10554 (Arm_relocate_functions::thm_pc12): New Method.
10555 (Target_arm::Scan::local): Handle the relocations.
10556 (Target_arm::Scan::global): Likewise.
10557 (Target_arm::Relocate::relocate): Likewise.
10558 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10559
c9a2c125
DK
105602010-01-29 Doug Kwan <dougkwan@google.com>
10561
10562 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10563 of relocation types as ld.
10564
1521477a
DK
105652010-01-29 Doug Kwan <dougkwan@google.com>
10566
10567 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10568 to public.
10569 (Arm_relocate_functions::thumb_branch_common): Ditto.
10570 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10571 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10572 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10573 Arm_relocate_functions::jump24): Remove.
10574 (Target_arm::Relocate::relocate): Adjust code to call
10575 Arm_relocation_functions::arm_branch_common and
10576 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10577 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10578
e7eca48c
DK
105792010-01-29 Doug Kwan <dougkwan@google.com>
10580
10581 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10582 output_local_symbol_count_needs_update_.
10583 (Arm_relobj::output_local_symbol_count_needs_update,
10584 Arm_relobj::set_output_local_symbol_count_needs_update,
10585 Arm_relobj::update_output_local_symbol_count): New methods.
10586 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10587 member.
10588 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10589 of pointed function as in a R_ARM_PREL31 relocation.
10590 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10591 for output local symbol count updating.
10592 (Target_arm::do_relax): Update output local symbol counts in objects
10593 if necessary.
10594 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10595
02961d7e
ILT
105962010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10597
10598 * arm.cc: Added support for the ARM relocations:
10599 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10600 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10601 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10602 movw_prel_nc).
10603 (Arm_relocate_functions::movw_rel): New method.
10604 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10605 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10606 thm_movw_prel_nc).
10607 (Arm_relocate_functions::thm_movw_rel): New method.
10608 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10609 thm_movt_prel).
10610 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10611 relocations.
10612 (Target_arm::Scan::global): Likewise.
10613 (Target_arm::Relocate::relocate): Likewise.
10614 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10615 Likewise.
10616
b10d2873
ILT
106172010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10618
10619 * arm.cc: Added support for ARM group relocations.
10620 (Target_arm::reloc_needs_sym_origin): New method.
10621 (Arm_relocate_functions::calc_grp_kn): New method.
10622 (Arm_relocate_functions::calc_grp_residual): New method.
10623 (Arm_relocate_functions::calc_grp_gn): New method.
10624 (Arm_relocate_functions::arm_grp_alu): New Method.
10625 (Arm_relocate_functions::arm_grp_ldr): New Method.
10626 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10627 (Arm_relocate_functions::arm_grp_ldc): New Method.
10628 (Target_arm::Scan::local): Handle the ARM group relocations.
10629 (Target_arm::Scan::global): Likewise.
10630 (Target_arm::Relocate::relocate): Likewise.
10631 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10632 Likewise.
10633
2b328d4e
DK
106342010-01-26 Doug Kwan <dougkwan@google.com>
10635
10636 * arm.cc (set): Include.
10637 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10638 pointer type.
2e702c99 10639 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10640 (Arm_output_section::append_text_sections_to_list): New method.
10641 (Arm_output_section::fix_exidx_coverage): Ditto.
10642 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10643 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10644 Relobj::set_section_offset() instead of
10645 Sized_relobj::invalidate_section_offset().
2e702c99 10646 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10647 parameter for section headers. Ignore relocation sections for
10648 unallocated sections and EXIDX sections.
10649 (Target_arm::fix_exidx_coverage): New method.
10650 (Target_arm::output_section_address_less_than): New type.
10651 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10652 linked text section instead of the EXIDX section.
10653 (Arm_output_section::create_stub_group): Add an assertion to check
10654 that this is not an EXIDX output section.
10655 (Arm_output_section::append_text_sections_to_list): New method.
10656 (Arm_output_section::fix_exidx_coverage): Ditto.
10657 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10658 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10659 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10660 first pass.
10661 (Target_arm::fix_exidx_coverage): New method.
10662 * object.h (Relobj::set_output_section): New method.
10663 (Sized_relobj::invalidate_section_offset): Remove method.
10664 (Sized_relobj::do_invalidate_section_offset): Remove method.
10665 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10666
c7f3c371
DK
106672010-01-25 Doug Kwan <dougkwan@google.com>
10668
10669 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10670 Fix warning due to signed and unsigned comparison on a 32-bit host.
10671
8923b24c
DK
106722010-01-22 Doug Kwan <dougkwan@google.com>
10673
10674 * arm.cc (Target_arm::do_relax): Record an output section for section
10675 offset adjustment it contains any stub table that has changed.
10676 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10677 offsets in an output section if necessary.
10678 * output.cc (Output_section::Output_section): Initialize
10679 section_offsets_need_adjustments_.
10680 (Output_section::add_input_section_for_script): Renamed to
10681 Output_section::add_simple_input_section.
10682 (Output_section::save_states): Add a comment.
10683 (Output_section::discard_states): New method defintion.
10684 (Output_section::adjust_section_offsets): Same.
10685 * output.h (Output_section::add_input_section_for_script): Renamed to
10686 Output_section::add_simple_input_section.
10687 (Output_section::discard_states): New method declaration.
10688 (Output_section::adjust_section_offsets): Same.
10689 (Output_section::section_offsets_need_adjustment,
10690 Output_section::set_section_offsets_need_adjustment): New method
10691 definitions.
10692 (Output_section::section_offsets_need_adjustment_): New data member.
10693 * script-sections.cc
10694 (Output_section_element_input::set_section_address): Adjust code for
10695 renaming of Output_section::add_input_section_for_script.
10696 (Orphan_output_section::set_section_address): Same.
10697
9b2fd367
DK
106982010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10699
10700 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10701 Fix_v4bx enum values .
10702 * gold/options.h (General_options): New option definitions.
10703 (General_options::fix_v4bx): New method.
10704 (General_options::Fix_v4bx): New enum.
10705 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10706 (General_options::parse_fix_v4bx_interworking): New method.
10707
80d0d023
DK
107082010-01-22 Doug Kwan <dougkwan@google.com>
10709
10710 * arm.cc (Arm_exidx_fixup): New class.
10711
af2cdeae
DK
107122010-01-21 Doug Kwan <dougkwan@google.com>
10713
10714 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10715 classes.
10716 (Arm_exidx_section_offset_map): New type.
10717
993d07c1
DK
107182010-01-21 Doug Kwan <dougkwan@google.com>
10719
10720 * arm.cc (Arm_exidx_input_section): New class.
10721 (Arm_relobj::exidx_input_section_by_link,
10722 Arm_relobj::exidx_input_section_by_shndx,
10723 Arm_relobj::make_exidx_input_section): New methods.
10724 (read_arm_attributes_section): Remove.
10725 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10726 information about them.
10727 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10728 to here.
10729
5ac169d4
DK
107302010-01-20 Doug Kwan <dougkwan@google.com>
10731
10732 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10733 Input_section_specifier to Section_id.
10734 (Target_arm::new_arm_input_section: Adjust code for change of key
10735 type.
10736 (Target_arm::find_arm_input_section): Ditto.
10737 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10738 (Section_id): Remove.
10739 (Garbage_collection::Section_id_hash): Remove.
10740 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10741 (Section_id): Remove.
10742 (Icf::Section_id_hash): Remove.
10743 * object.h (Section_id, Const_section_id, Section_id_hash,
10744 Const_section_id_hash): New type definitions.
10745 * output.cc (Output_section::add_relaxed_input_section): Change to
10746 use Const_section_id instead of Input_section_specifier as key type.
10747 (Output_section::add_merge_input_section): Ditto.
10748 (Output_section::build_relaxation_map): Change to use Section_id
10749 instead of Input_section_specifier as key type.
2e702c99 10750 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10751 Ditto.
10752 (Output_section::convert_input_sections_to_relaxed_sections): Change
10753 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10754 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10755 (Output_section::find_relaxed_input_section): Ditto.
10756 * output.h (Input_section_specifier): Remove class.
10757 (Output_section::Output_section_data_by_input_section_map): Change
10758 key type to Const_section_id.
10759 (Output_section::Output_relaxed_input_section_by_input_section_map):
10760 Ditto.
10761 (Output_section::Relaxation_map): Change key type to Section_id.
10762
a2162063
ILT
107632010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10764
10765 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10766 (class Arm_v4bx_stub): New class.
10767 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10768 (Stub_factory::make_arm_v4bx_stub): New method.
10769 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10770 (Stub_table::empty): Handle v4bx stubs.
10771 (Stub_table::add_arm_v4bx_stub): New method.
10772 (Stub_table::find_arm_v4bx_stub): New method.
10773 (Arm_relocate_functions::v4bx): New method.
10774 (Target_arm::fix_v4bx): New method.
10775 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10776 (Stub_table::relocate_stubs): Likewise.
10777 (Stub_table::do_write): Likewise.
10778 (Stub_table::update_data_size_and_addralign): Likewise.
10779 (Stub_table::finalize_stubs): Likewise.
10780 (Target_arm::Scan::local): Likewise.
10781 (Target_arm::Scan::global): Likewise.
10782 (Target_arm::do_finalize_sections): Likewise.
10783 (Target_arm::Relocate::relocate): Likewise.
10784 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10785 Likewise.
10786 (Target_arm::scan_reloc_for_stub): Likewise.
10787 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10788
5696ab0b
ILT
107892010-01-19 Ian Lance Taylor <iant@google.com>
10790
10791 * output.cc (Output_section_headers::do_sized_write): Write large
10792 segment count to sh_info field.
10793 (Output_file_header::do_sized_write): For large segment count,
10794 write PN_XNUM to e_phnum field.
10795
800d0f56
ILT
107962010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10797
10798 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10799 (Arm_relocate_functions::thm_jump8): New function.
10800 (Arm_relocate_functions::thm_jump11): New function.
10801 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10802 R_ARM_THM_JUMP11.
10803 (Target_arm::Scan::global): Likewise.
10804 (Target_arm::Relocate::relocate): Likewise.
10805 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10806 Likewise.
10807
41263c05
DK
108082010-01-14 Doug Kwan <dougkwan@google.com>
10809
10810 * arm.cc (map, utility): Include headers.
10811 (Target_arm::apply_cortex_a8_workaround): New method.
10812 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10813 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10814 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10815 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10816 the --[no-]fix-cortex-a8 command line options.
10817 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10818 (Target_arm::relocate_stub): Use addend in instruction template.
10819 * options.h (DEFINE_bool): Set the user-set flag.
10820 (General_options): Add --[no-]-fix-cortex options.
10821 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10822 : Update fast look-up map after conversion.
41263c05 10823
459e9b03
ST
108242010-01-14 Sriraman Tallam <tmsriram@google.com>
10825
10826 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10827 in the first pass of do_layout.
10828
b521dfe4
DK
108292010-01-13 Doug Kwan <dougkwan@google.com>
10830
10831 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10832 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10833 apparent compiler problem of not folding static constant integral
10834 data members of elfcpp::Elf_sizes<32>.
10835
44272192
DK
108362010-01-13 Doug Kwan <dougkwan@google.com>
10837
10838 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10839 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10840 Arm_relobj::scan_section_for_cortex_a8_erratum,
10841 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10842 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10843 sections to scan for relocation stubs into a new method
10844 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10845 relocation and Cortex-A8 stub scanning.
10846 (Target_arm::do_relax): Force stubs to be after stubbed sections
10847 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10848 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10849 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10850
44b71ece
ILT
108512010-01-12 Ian Lance Taylor <iant@google.com>
10852
10853 * target-reloc.h (visibility_error): New inline function.
10854 (relocate_section): Call visibility_error.
10855 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10856 (MOSTLYCLEANFILES): Likewise.
10857 (protected_4_pic.o, protected_3.err): New targets.
10858 * testsuite/protected_4.cc: New file.
10859
a120bc7f
DK
108602010-01-12 Doug Kwan <dougkwan@google.com>
10861
10862 * arm.cc (Cortex_a8_reloc): New class.
10863 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10864 and cortex_a8_relocs_info_.
10865 (Target_arm::fix_cortex_a8): New method definition.
10866 (Target_arm::Cortex_a8_relocs_info): New type.
10867 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10868 New data member declarations.
10869 (Target_arm::scan_reloc_for_stub): Record information about
10870 relocations for THUMB branches that might be exempted from the
10871 Cortex-A8 workaround.
10872 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10873 at the beginning of a relaxation pass.
10874
20138696
DK
108752010-01-12 Doug Kwan <dougkwan@google.com>
10876
10877 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10878 (Arm_relobj::Mapping_symbol_position,
10879 Arm_reloj::Mapping_symbol_position_less,
10880 Arm_relobj::Mapping_symbols_info): New types.
10881 (Target_arm::is_mapping_symbol_name): New method definition.
10882 (Arm_relobj::do_count_local_symbols): Save information about mapping
10883 symbols.
10884
089d69dc
DK
108852010-01-11 Doug Kwan <dougkwan@google.com>
10886
10887 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10888 Arm_relocate_functions::thumb32_branch_upper,
10889 Arm_relocate_functions::thumb32_branch_lower,
10890 Arm_relocate_functions::thumb32_cond_branch_offset,
10891 Arm_relocate_functions::thumb32_cond_branch_upper,
10892 Arm_relocate_functions::thumb32_cond_branch_lower,
10893 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10894 branch offset encoding.
10895 (Arm_relocate_functions::thumb_branch_common): Use new branch
10896 offset encoding methods to avoid code duplication.
10897 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10898 (Stub_addend_reader::operator()): Use new branch encoding method
10899 to avoid code duplication.
10900
99e5bff2
DK
109012010-01-11 Doug Kwan <dougkwan@google.com>
10902
10903 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10904 (Target_arm::do_finalize_sections): Define special EXIDX section
10905 symbols only if referenced.
10906 * gc.h (Garbage_collection::add_reference): New method.
10907 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10908 code duplication.
10909
98e090bd
ILT
109102010-01-11 Ian Lance Taylor <iant@google.com>
10911
d0a91bd8
ILT
10912 * script.cc (Version_script_info::build_expression_list_lookup):
10913 Change complaing about duplicate wildcard match from error to
10914 warning.
10915
98e090bd
ILT
10916 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10917 of 2009-12-30.
10918 (Version_script_info::Version_script_info): Initialize globs_,
10919 default_version_, default_is_global_, and exact_. Don't
10920 initialize globals_ or locals_.
10921 (Version_script_info::build_lookup_tables): Build local symbols
10922 first.
10923 (Version_script_info::unquote): New function.
10924 (Version_script_info::add_exact_match): New function.
10925 (Version_script_info::build_expression_list_lookup): Remove lookup
10926 parameter. Add is_global parameter. Change all callers. Handle
10927 wildcard pattern specially. Unquote pattern. Call
10928 add_exact_match.
10929 (Version_script_info::get_name_to_match): New function.
10930 (Version_script_info::get_symbol_version): New function.
10931 (Version_script_info::get_symbol_version_helper): Remove.
10932 (Version_script_info::check_unmatched_names): Call unquote.
10933 * script.h (class Version_script_info): Change get_symbol_version
10934 to be non-inline and add is_global parameter; change all callers.
10935 Rewrite symbol_is_local. Update declarations. Define struct
10936 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10937 Remove globals_ and locals_ members. Add exact_, globs_,
10938 default_version_, is_global_.
10939 (Version_script_info::Glob): Remove pattern, add expression and
10940 is_global. Update constructor. Change all callers.
10941 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10942 default version.
10943 (Versions::symbol_section_contents): If a symbol is undefined, or
10944 defined in a dynamic object, set the version index to
10945 VER_NDX_LOCAL.
10946 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10947 symbol_is_local.
10948 (Symbol_table::add_from_pluginobj): Likewise.
10949 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10950
d56962d3
DK
109512010-01-11 Doug Kwan <dougkwan@google.com>
10952
10953 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10954 (incremental_dump_LDADD): Add linking option for libintl.
10955 * Makefile.in: Regenerate.
10956
94e6ee91
L
109572010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10958
10959 PR gold/11144
10960 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10961 instead of -Ds.
10962 * testsuite/Makefile.in: Regenerated.
10963
e96c574b
DK
109642010-01-10 Doug Kwan <dougkwan@google.com>
10965
10966 * options.h (DEFINE_var): Use parentheses around argument varname__
10967 in macro body to avoid any unintended subsequent substitutions.
10968
7198066b
ILT
109692010-01-10 Ian Lance Taylor <iant@google.com>
10970
ba4d53bf
ILT
10971 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10972 candidates before doing symbol resolution.
10973
7198066b
ILT
10974 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10975 ODR candidates if only one is weak.
10976
a2beed37
ILT
109772010-01-08 Ian Lance Taylor <iant@google.com>
10978
10979 * script.cc (Version_script_info::build_expression_list_lookup):
10980 Don't warn about ambiguous version, just record the ambiguity.
10981 (Version_script_info::get_symbol_version_helper): Give error if
10982 version is ambiguous.
10983
2fb7225c
DK
109842010-01-08 Doug Kwan <dougkwan@google.com>
10985
10986 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10987 prev_data_size_ and prev_addralign_. Remove initializer for
10988 deleted data member has_been_changed_.
10989 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10990 to determine if the table is empty.
10991 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10992 Remove.
10993 (Stub_table::add_reloc_stub): Define method in class definition
10994 instead of just declaring it there.
10995 (Stub_table::add_cortex_a8_stub): New method definition.
10996 (Stub_table::update_data_size_and_addralign): Ditto.
10997 (Stub_table::finalize_stubs): Ditto.
10998 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10999 (Stub_table::do_addralign_): Return address alignment in the
11000 (Stub_table::do_reset_address_and_file_offset): Define method in
11001 class definition instead of declaring it there. Set current data
11002 size to be the data size of the previous pass.
11003 (Stub_table::set_final_data_size): Use current data size as the
11004 final data size.
11005 (Stub_table::relocate_stub): Change parameter type of stub from
11006 Reloc_stub pointer to Stub pointer.
11007 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11008 (Stub_table::Cortex_a8_stub_list): New typedef.
11009 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11010 Stub_table::prev_addralign_): New data member.
11011 (Arm_relobj::Arm_relobj): Initialize data member
11012 section_has_cortex_a8_workaround_.
11013 (Arm_relobj::section_has_cortex_a8_workaround,
11014 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11015 definitions.
11016 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11017 declarations.
11018 (Target_arm::relocate_stub): Change parameter type of stub from
11019 Reloc_stub pointer to Stub pointer.
11020 (Insn_template::size, Insn_template::alignment): Handle
11021 THUMB16_SPECIAL_TYPE.
11022 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11023 Stub_table::update_data_size_and_addralign,
11024 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11025 definitions.
11026 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11027 (Stub_table::do_write): Ditto.
11028 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11029
880cd20d
ILT
110302010-01-08 Ian Lance Taylor <iant@google.com>
11031
11032 PR 11108
11033 * symtab.h (class Symbol): Remove fields is_target_special_ and
11034 has_plt_offset_. Add field is_defined_in_discarded_section_.
11035 (Symbol::is_defined_in_discarded_section): New function.
11036 (Symbol::set_is_defined_in_discarded_section): New function.
11037 (Symbol::has_plt_offset): Rewrite.
11038 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11039 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11040 Don't initialize is_target_special_ or has_plt_offset_.
11041 Initialize is_defined_in_discarded_section_.
11042 (Symbol_table::add_from_relobj): If appropriate, set
11043 is_defined_in_discarded_section.
11044 * resolve.cc (Symbol::override_base_with_special): Don't test
11045 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11046 * target-reloc.h (relocate_section): Do special handling for
11047 symbols defined in discarded sections for global symbols as well
11048 as local symbols.
11049
2703e3eb
ILT
110502010-01-08 Ian Lance Taylor <iant@google.com>
11051
11052 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11053 the SHT_SYMTAB case.
11054
339d40a3
ILT
110552010-01-08 Ian Lance Taylor <iant@google.com>
11056
11057 * object.cc (Sized_relobj::do_layout): Don't get confused if
11058 layout_eh_frame returns NULL.
11059
abecea76
ILT
110602010-01-08 Ian Lance Taylor <iant@google.com>
11061
11062 PR 11084
11063 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11064 dynamic symbol table, use the normal symbol table.
11065 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11066 symbol table.
11067
6b7dd3f3
ILT
110682010-01-08 Ian Lance Taylor <iant@google.com>
11069
11070 PR 11072
11071 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11072 sections.
11073
36c50e63
L
110742010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11075
11076 * version.cc (print_version): Change to "Copyright 2010".
11077
e291e7b9
ILT
110782010-01-08 Ian Lance Taylor <iant@google.com>
11079
11080 PR 10287
11081 PR 11063
11082 * i386.cc (class Target_i386): Change return type of plt_section
11083 to be non-const.
11084 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11085 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11086 tls_desc_rel_ field.
11087 (Output_data_plt_i386::rel_tls_desc): New function.
11088 (Target_i386::rel_tls_desc_section): New function.
11089 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11090 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11091 R_386_TLS_DESC reloc in rel_tls_desc_section.
11092 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11093 Define struct Tlsdesc_info.
11094 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11095 (Target_x86_64::do_reloc_symbol_index): New function.
11096 (Target_x86_64::add_tlsdesc_info): New function.
11097 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11098 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11099 tlsdesc_rel_ field.
11100 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11101 all callers.
11102 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11103 (Target_x86_64::rela_tlsdesc_section): New function.
11104 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11105 handling.
11106 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11107 (Target_x86_64::do_reloc_addend): New function.
11108 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11109 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11110 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11111 (Output_reloc::type): New function.
11112 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11113 (Output_reloc::is_target_specific): New function.
11114 (Output_reloc::target_arg): New function.
11115 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11116 absolute relocs and target specific relocs.
11117 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11118 add_target_specific.
11119 (class Output_data_reloc) [SHT_RELA]: Likewise.
11120 * output.cc (Output_reloc::Output_reloc): Add four new versions
11121 for absolute relocs and target specific relocs.
11122 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11123 (Output_reloc::get_symbol_index): Likewise.
11124 (Output_reloc::local_section_offset): Check that local_sym_index_
11125 is not TARGET_CODE or 0.
11126 (Output_reloc::symbol_value): Likewise.
11127 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11128 reloc.
11129 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11130 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11131 functions.
11132 * layout.cc (add_target_dynamic_tags): Use output section for
11133 DT_PLTRELSZ and DT_JMPREL.
11134
3a44184e
ILT
111352010-01-07 Ian Lance Taylor <iant@google.com>
11136
11137 PR 11061
11138 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11139 function.
11140 (class Output_data_reloc_generic): Define.
11141 (class Output_data_reloc_base): Change base class to
11142 Output_data_reloc_generic. Change add() method to call
11143 bump_relative_reloc_count for a relative reloc. Remove
11144 sort_relocs_ field.
11145 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11146 to sort_relocs().
11147 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11148 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11149 appropriate.
11150 * layout.h (class Layout): Update declaration.
11151
ea715a34
ILT
111522010-01-07 Ian Lance Taylor <iant@google.com>
11153
11154 * output.h (class Output_data): Add const version of
11155 output_section and do_output_section.
11156 (class Output_section_data): Add const version of
11157 do_output_section.
11158 (class Output_section): Likewise.
11159 * layout.cc (Layout::add_target_dynamic_tags): New function.
11160 * layout.h (class Layout): Update declarations.
11161 * arm.cc (Target_arm::do_finalize_sections): Use
11162 add_target_dynamic_tags.
11163 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11164 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11165 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11166 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11167
659948a4
ILT
111682010-01-07 Ian Lance Taylor <iant@google.com>
11169
11170 PR 11042
11171 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11172 object as needed.
11173
9d3b86f6
ILT
111742010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11175 Ian Lance Taylor <iant@google.com>
11176
11177 PR 11019
11178 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11179 Xindex::read_symtab_xindex.
11180
bb0d3eb0
DK
111812010-01-07 Doug Kwan <dougkwan@google.com>
11182
11183 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11184 (Insn_template::thumb16_bcond_insn): New method declaration.
11185 (Insn_template): Fix spelling.
11186 (Stub::thumb16_special): New method declaration.
11187 (Stub::do_write): Define virtual method which was previously pure
11188 virtual.
11189 (Stub::do_thumb16_special): New method declaration.
11190 (Stub::do_fixed_endian_write): New template member.
11191 (Reloc_stub::do_write): Remove.
11192 (Reloc_stub::do_fixed_endian_write): Remove.
11193 (Cortex_a8_stub): New class definition.
11194 (Stub_factory::make_cortex_a8_stub): New method definition.
11195 (Stub_factory::Stub_factory): Add missing static storage class
11196 qualifier for elf32_arm_stub_a8_veneer_blx.
11197
ffeef7df
ILT
111982010-01-07 Ian Lance Taylor <iant@google.com>
11199
dc3f80fe
ILT
11200 PR 10980
11201 * options.h (class General_options): Add --warn-unresolved-symbols
11202 and --error-unresolved-symbols.
11203 * errors.cc (Errors::undefined_symbol): Implement
11204 --warn-unresolved-symbols.
11205
ffeef7df
ILT
11206 * options.h (class General_options): Add -z text and -z textoff.
11207 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11208
f1ec9ded
ST
112092010-01-06 Sriraman Tallam <tmsriram@google.com>
11210
11211 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11212 (Garbage_collection::cident_sections): New function.
11213 (Garbage_collection::add_cident_section): New function.
11214 (Garbage_collection::cident_sections_): New member.
11215 (gc_process_relocs): Add references to sections whose names are C
11216 identifiers.
11217 * gold.h (cident_section_start_prefix): New constant.
11218 (cident_section_stop_prefix): New constant.
11219 (is_cident): New function.
11220 * layout.cc (Layout::define_section_symbols): Replace string constants
11221 with the newly defined constants.
11222 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11223 C identifiers.
11224 * testsuite/Makefile.am: Add gc_orphan_section_test.
11225 * testsuite/Makefile.in: Regenerate.
11226 * testsuite/gc_orphan_section_test.cc: New file.
11227 * testsuite/gc_orphan_section_test.sh: New file.
11228
6eda8c29
ILT
112292010-01-06 Ian Lance Taylor <iant@google.com>
11230
b9674e17
ILT
11231 PR 10980
11232 * options.h (class General_options): Add --warn-shared-textrel.
11233 * layout.cc (Layout::finish_dynamic_section): Implement
11234 --warn-shared-textrel.
11235
6eda8c29
ILT
11236 PR 10980
11237 * options.h (class General_options): Add --warn-multiple-gp.
11238
32dcd44e
ILT
112392010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11240
11241 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11242 $(THREADSLIB) and $(LIBDL).
11243 * Makefile.in: Rebuild.
11244
a192ba05
ILT
112452010-01-06 Ian Lance Taylor <iant@google.com>
11246
11247 PR 10980
11248 * options.cc (General_options::parse_section_start): New function.
11249 (General_options::section_start): New function.
11250 (General_options::General_options): Initialize all members.
11251 * options.h: Include <map>
11252 (class General_options): Add --section-start. Add section_starts_
11253 member.
11254 * layout.cc (Layout::attach_allocated_section_to_segment): If
11255 --section-start was used, set the address of the segment. Remove
11256 local sort_sections.
11257 (Layout::relaxation_loop_body): If the address of the load segment
11258 has been set by --section-start, don't use it.
11259 * output.h (Output_segment::update_flags_for_output_section): New
11260 function.
11261 * output.cc (Output_segment::add_output_section): Call
11262 update_flags_for_output_section.
11263
dde3f402
ILT
112642010-01-05 Ian Lance Taylor <iant@google.com>
11265
62dfdd4d
ILT
11266 PR 10980
11267 * options.h (class General_options): Add --undefined-version.
11268 * script.cc (struct Version_expression): Add was_matched_by_symbol
11269 field.
11270 (Version_script_info::matched_symbol): New function.
11271 (Version_script_info::get_symbol_version_helper): Call
11272 matched_symbol.
11273 (Version_script_info::check_unmatched_names): New function.
11274 * script.h (class Version_script_info): Update declarations.
11275 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11276
9c4ae156
ILT
11277 * options.h (class General_options): Use DEFINE_bool_alias for
11278 allow_multiple_definition.
11279 * resolve.cc (Symbol_table::should_override): Don't test
11280 allow_multiple_definition.
11281
dde3f402
ILT
11282 PR 10980
11283 * options.h (class General_options): Add --cref.
11284 * main.cc (main): Print cref table if --cref. Don't close mapfile
11285 until after printing cref table.
11286 * cref.cc: Include "symtab.h".
11287 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11288 (Cref_table_compare::operator()): New function.
11289 (Cref_inputs::gather_cref): New function.
11290 (filecol): New static const.
11291 (Cref_inputs::print_cref): New function.
11292 (Cref::print_cref): New function.
11293 * cref.h: Include <cstdio>.
11294 (class Cref): Update declarations.
11295 * mapfile.h (Mapfile::file): New function.
11296 * object.h (class Object): Define Symbols. Declare virtual
11297 do_get_global_symbols.
11298 (Object::get_global_symbols): New function.
11299 * object.cc (Input_objects::add_object): Pass object to cref_ if
11300 --cref.
11301 (Input_objects::archive_start): Likewise.
11302 (Input_objects::archive_stop): Likewise.
11303 (Input_objects::print_cref): New function.
11304 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11305 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11306 --cref.
11307 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11308 function.
11309 * plugin.h (class Sized_pluginobj): Update declarations.
11310
8781f709
ILT
113112010-01-05 Ian Lance Taylor <iant@google.com>
11312
11313 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11314 to is_default_version. Rename insdef to insdefault.
11315 (Symbol_table::add_from_relobj): Rename def to is_default_version
11316 and local to is_forced_local.
11317 (Symbol_table::add_from_pluginobj): Likewise.
11318 (Symbol_table::add_from_dynobj): Likewise.
11319 (Symbol_table::define_special_symbol): Rename insdef to
11320 insdefault.
11321
fe35d28d
ILT
113222010-01-04 Ian Lance Taylor <iant@google.com>
11323
30bc8c46
ILT
11324 PR 10980
11325 * options.h (class General_options): Add
11326 --allow-multiple-definition and -z muldefs.
11327 * resolve.cc (Symbol_table::should_override): Don't warn about a
11328 multiple symbol definition if --allow-multiple-definition or -z
11329 muldefs.
11330
7eaea549
ILT
11331 PR 10980
11332 * options.h (class General_options): Add --add-needed and
11333 --copy-dt-needed-entries. Tweak --as-needed help entry.
11334 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11335 error if --copy-dt-needed-entries aka --add-needed is used and
11336 would cause a change in behaviour.
11337
fe35d28d
ILT
11338 PR 10980
11339 * options.h (class General_options): Add -G as a short version of
11340 --shared. Add no-op options -assert, -g, and -i.
11341
55a2bb35
ST
113422010-01-04 Sriraman Tallam <tmsriram@google.com>
11343
11344 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11345 check for .text or .gnu.linkonce.t sections.
11346 * icf.cc (Icf::find_identical_sections): Ditto.
11347 Change the detection for mangled function name within the section
11348 name.
11349 * icf.h (is_section_foldable_candidate): New function.
11350
719328e1
ILT
113512009-12-30 Ian Lance Taylor <iant@google.com>
11352
11353 PR 10980
11354 * options.h (class General_options): Permit two dashes with
11355 --retain-symbols-file.
11356
d7bb5745
ILT
113572009-12-30 Ian Lance Taylor <iant@google.com>
11358
403a15dd
ILT
11359 PR 10979
11360 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11361 don't put the file header and segment headers in the text
11362 segment.
11363
eda294df
ILT
11364 PR 10979
11365 * common.cc (Sort_commons::operator()): Stabilize sort when both
11366 entries are NULL.
11367 (Symbol_table::do_allocate_commons_list): When allocating common
11368 symbols, skip a symbol which is no longer common.
11369 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11370 an object before checking its type.
11371 * testsuite/common_test_2.c: New file.
11372 * testsuite/common_test_3.c: New file.
11373 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11374 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11375 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11376 (common_test_2_pic.o, common_test_2.so): New targets.
11377 (common_test_3_pic.o, common_test_3.so): New targets.
11378 * testsuite/Makefile.in: Rebuild.
11379
d7bb5745
ILT
11380 PR 10979
11381 * script.cc (read_input_script): If we see a new SECTIONS clause,
11382 and we have added an input section, give an error.
11383 * layout.h (class Layout): Add have_added_input_section function.
11384 Add have_added_input_section_ field.
11385 * layout.cc (Layout::Layout): Initialize
11386 have_added_input_section_.
11387 (Layout::layout): Set have_added_input_section_.
11388 (Layout::layout_eh_frame): Likewise.
11389
fc59c572
ILT
113902009-12-30 Ian Lance Taylor <iant@google.com>
11391
11392 PR 10931
11393 * options.h (class General_options): Add --sort-common option.
11394 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11395 * common.cc (Sort_common): Add sort_order parameter to
11396 constructor. Add sort_order_ field.
11397 (Sort_commons::operator): Check sort_order_.
11398 (Symbol_table::allocate_commons): Determine the sort order.
11399 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11400 Change all callers.
11401 (Symbol_table::do_allocate_commons_list): Likewise.
11402
1c74fab0
ILT
114032009-12-30 Ian Lance Taylor <iant@google.com>
11404
11405 PR 10916
11406 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11407 symbols from this object, don't change the visibility of an
11408 undefined symbol.
11409 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11410
6affe781
ILT
114112009-12-30 Ian Lance Taylor <iant@google.com>
11412
11413 PR 10861
11414 * script.h (class Version_script_info): Define Language enum.
11415 Update declarations. Define Glob, Exact, and Lookup types. Add
11416 new fields globals_, locals_, and is_finalized_.
11417 * script.cc: Various formatting fixes.
11418 (class Parser_closure): Change language_stack_ from a vector of
11419 std::string to one of Version_script_info::Language. Adjust all
11420 uses accordingly.
11421 (class Lazy_demangler): Remove.
11422 (struct Version_expression): Change language from std::string to
11423 Version_script_info::Language.
11424 (Version_script_info::Version_script_info): New function.
11425 (Version_script_info::~Version_script_info): Don't call clear.
11426 (Version_script_info::finalize): New function.
11427 (Version_script_info::build_lookup_tables): New function.
11428 (Version_script_info::build_expression_list_lookup): New
11429 function.
11430 (Version_script_info::get_symbol_version_helper): Rewrite to use
11431 lookup tables.
11432 (Version_script_info::print_expression_list): Adjust to use
11433 Version_script_info::Language.
11434 (script_push_lex_into_version_mode): Check that the version script
11435 has not been finalized.
11436 (version_script_push_lang): Change language string to
11437 Version_script_info::Language.
11438 * options.cc (Command_line::version_script): New function.
11439 * options.h (class General_options): Add finalize_dynamic_list
11440 function. Change version_script from declaration to definition.
11441 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11442 * testsuite/version_script.map: Remove duplicate def of foo.
11443 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11444 version_script.map.
11445 * testsuite/Makefile.in: Rebuild.
11446
818bf354
ILT
114472009-12-30 Ian Lance Taylor <iant@google.com>
11448
11449 PR 10843
11450 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11451 if the input symbol index is 0, make the output symbol index 0.
11452
ebcc8304
ILT
114532009-12-30 Ian Lance Taylor <iant@google.com>
11454
11455 PR 10670
11456 * options.h (class General_options): Add -x/--discard-all.
11457 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11458 --discard-all. If the local symbol needs a dynamic entry, check
11459 that before handling --discard-locals.
11460
176fe33f
ILT
114612009-12-30 Ian Lance Taylor <iant@google.com>
11462
bb321bb1
ILT
11463 PR 10450
11464 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11465 flags to PF_R.
11466 (Output_segment::add_output_section): Don't change the flags if
11467 the type is PT_TLS.
11468
176fe33f
ILT
11469 PR 10450
11470 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11471 GNU hash table if they need a dynamic value. Otherwise, don't add
11472 them if they are defined in a dynamic object or are forced local.
11473
e8cd95c7
ILT
114742009-12-29 Ian Lance Taylor <iant@google.com>
11475
1b81fb71
ILT
11476 PR 10450
11477 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11478 .gnu.hash table for a 32-bit target.
11479
8d6d383d
ILT
11480 PR 10450
11481 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11482 regular and a dynamic object only needs a dynamic symbol table
11483 entry if it is externally visible.
11484
e785ec03
ILT
11485 PR 10450
11486 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11487 constructor. Add global_offset_table_ field.
11488 (Target_i386::got_section): Set global_offset_table_.
11489 (Target_i386::do_finalize_sections): Set global_offset_table_
11490 size.
11491 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11492 in constructor. Add global_offset_table_ field.
11493 (Target_x86_64::got_section): Set global_offset_table_.
11494 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11495 size.
11496
1a2dff53
ILT
11497 * layout.cc (Layout::Layout): Initialize increase_relro_.
11498 (Layout::get_output_section): Add is_relro, is_last_relro, and
11499 is_first_non_relro parameters. Change all callers.
11500 (Layout::choose_output_section): Likewise.
11501 (Layout::add_output_section_data): Likewise.
11502 (Layout::make_output_section): Likewise.
11503 (Layout::set_segment_offsets): Clear increase_relro when using a
11504 linker script.
11505 * layout.h (class Layout): Add increase_relro method. Add
11506 increase_relro_ field. Update declarations.
11507 * output.cc (Output_section::Output_section): Initialize
11508 is_last_relro_ and is_first_non_relro_.
11509 (Output_segment::add_output_section): Group relro sections is
11510 do_sort is true. Handle is_last_relro and is_first_non_relro.
11511 (Output_segment::maximum_alignment): Remove relro handling.
11512 (Output_segment::set_section_addresses): Add increase_relro
11513 parameter. Change all callers. Add initial alignment to align
11514 relro sections on separate page. Remove old relro handling.
11515 (Output_segment::set_section_list_addresses): Remove in_relro
11516 parameter. Change all callers.
11517 (Output_segment::set_offset): Add increase parameter. Change all
11518 callers. Remove old relro handling.
11519 * output.h (class Output_section): Add new methods: is_last_relro,
11520 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11521 Add is_last_relro_ and is_first_non_relro_ fields.
11522 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11523 Create separate .got.plt section. Call increase_relro.
11524 * x86_64.cc (Target_x86_64::got_section): Likewise.
11525 * testsuite/relro_script_test.t: Add .got.plt.
11526
f0ba79e2
ILT
11527 PR 10450
11528 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11529 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11530 (Layout::finalize): Call set_dynamic_symbol_size.
11531 (Layout::set_dynamic_symbol_size): New function.
11532 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11533 set_dynamic_symbol_size.
11534
e8cd95c7
ILT
11535 PR 10450
11536 * output.h (class Output_section): Add is_entsize_zero_ field.
11537 * output.cc (Output_section::Output_section): Initialize
11538 is_entsize_zero_.
11539 (Output_section::set_entsize): If two different entsizes are
11540 requested, force it to zero.
11541 (Output_section::add_input_section): Set flags for .debug_str
11542 before updating section flags. Set entsize.
11543 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11544 and SHF_STRING if all input sections have those flags.
11545
3e1b9a8a
RÁE
115462009-12-29 Rafael Espindola <espindola@google.com>
11547
11548 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11549 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11550 reporting.
3e1b9a8a 11551
3dcad376
ST
115522009-12-29 Sriraman Tallam <tmsriram@google.com>
11553
11554 * options.cc (General_options::parse_version): Allow -v to exit
11555 without an error if there is nothing to link.
11556
084e2665
ILT
115572009-12-29 Ian Lance Taylor <iant@google.com>
11558
11559 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11560 using a version of gcc before 4.1.
11561 * configure: Rebuild.
11562
250acde3
CD
115632009-12-28 Chris Demetriou <cgd@google.com>
11564
11565 * attributes.cc (Output_attributes_section_data::do_write): Use
11566 std::vector::front rather than std::vector::data.
11567
99fff23b
ILT
115682009-12-28 Ian Lance Taylor <iant@google.com>
11569
11570 * symtab.h (class Symbol_table): Add enum Defined.
11571 * resolve.cc (Symbol_table::should_override): Add defined
11572 parameter. Change all callers. Test whether object is NULL
11573 before calling a method on it.
11574 (Symbol_table::report_resolve_problem): Add defined parameter.
11575 Change all callers.
11576 (Symbol_table::should_override_with_special): Likewise.
11577 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11578 parameter. Change all callers.
11579 (Symbol_table::do_define_in_output_data): Likewise.
11580 (Symbol_table::define_in_output_segment): Likewise.
11581 (Symbol_table::do_define_in_output_segment): Likewise.
11582 (Symbol_table::define_as_constant): Likewise.
11583 (Symbol_table::do_define_as_constant): Likewise.
11584 * script.h (class Symbol_assignment): Add is_defsym parameter to
11585 constructor; change all callers.
11586 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11587 parameter. Change all callers. Add is_defsym_ field.
11588 (class Parser_closure): Add parsing_defsym parameter to
11589 constructor; change all callers. Add parsing_defsym accessor
11590 function. Add parsing_defsym_ field.
11591
556bd683
ILT
115922009-12-28 Ian Lance Taylor <iant@google.com>
11593
11594 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11595 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11596
1782c879
ILT
115972009-12-23 Ian Lance Taylor <iant@google.com>
11598
11599 * i386.cc (Target_i386::do_calls_non_split): Recognize
11600 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11601 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11602 -fsplit-stack prologue when using %r11.
1782c879 11603
329ca2b1
ST
116042009-12-21 Sriraman Tallam <tmsriram@google.com>
11605
11606 * options.cc (General_options::parse_version): Make -v continue and do
11607 the link like GNU ld does.
11608
d675ff46
RÁE
116092009-12-17 Rafael Avila de Espindola <espindola@google.com>
11610
11611 * Makefile.am (CCFILES): Add timer.cc.
11612 (HFILES): Add timer.h.
11613 * configure.ac: Check for sysconf and times.
11614 * main.cc: include timer.h.
11615 (main): Use Timer instead of get_run_time.
11616 * timer.cc: New.
11617 * timer.h: New.
11618 * workqueue.cc: include timer.h.
11619 (Workqueue::find_and_run_task):
11620 Report user, sys and wall time.
11621 * Makefile.in: Regenerate.
11622 * config.in: Regenerate.
11623 * configure: Regenerate.
11624
d6344fb5
DK
116252009-12-16 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11628 sections.
11629 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11630 relaxed input sections.
11631 * output.cc (Output_section::find_relaxed_input_section): Change
11632 return type to Output_relaxed_input_section pointer. Adjust code
11633 for new type of relaxed_input_section_map_.
11634 * output.h (Output_section::find_relaxed_input_section): Change
11635 return type to Output_relaxed_input_section pointer.
11636 (Output_section::Output_relaxed_input_section_by_input_section_map):
11637 New type.
11638 (Output_section::relaxed_input_section_map_): Change type to
11639 Output_section::Output_relaxed_input_section_by_input_section_map.
11640 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11641 input section.
11642
0e0d5469
ILT
116432009-12-15 Ian Lance Taylor <iant@google.com>
11644
11645 * layout.cc (Layout::create_shstrtab): Only write out after input
11646 sections if we are compressing debug sections.
11647
0649a889
ILT
116482009-12-15 Ian Lance Taylor <iant@google.com>
11649
11650 * archive.cc (Archive::add_symbols): Only look up a symbol without
11651 a version if there is, in fact, a version.
11652
2ea97941
ILT
116532009-12-14 Ian Lance Taylor <iant@google.com>
11654
11655 Revert -Wshadow changes, all changes from:
11656 2009-12-11 Doug Kwan <dougkwan@google.com>
11657 2009-12-11 Nick Clifton <nickc@redhat.com>
11658 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11659
b0eec2cc
DK
116602009-12-11 Doug Kwan <dougkwan@google.com>
11661
11662 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11663 due to -Wshadow.
11664 * attributes.cc (Object_attribute::size): Ditto.
11665 (Attributes_section_data::size): Ditto.
11666 (Attributes_section_data::Attributes_section_data): Ditto.
11667 (Output_attributes_section_data::do_write): Ditto.
11668 * attributes.h (Object_attribute::set_type): Ditto.
11669 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11670
91d6fa6a
NC
116712009-12-11 Nick Clifton <nickc@redhat.com>
11672
11673 * archive.cc: Fix shadowed variable warnings.
11674 * arm.cc: Likewise.
11675 * compressed_output.cc: Likewise.
11676 * compressed_output.h: Likewise.
11677 * configure: Likewise.
11678 * dwarf_reader.cc: Likewise.
11679 * dynobj.cc: Likewise.
11680 * dynobj.h: Likewise.
11681 * ehframe.cc: Likewise.
11682 * ehframe.h: Likewise.
11683 * errors.cc: Likewise.
11684 * expression.cc: Likewise.
11685 * fileread.cc: Likewise.
11686 * fileread.h: Likewise.
11687 * freebsd.h: Likewise.
11688 * i386.cc: Likewise.
11689 * icf.cc: Likewise.
11690 * incremental.h: Likewise.
11691 * layout.cc: Likewise.
11692 * layout.h: Likewise.
11693 * mapfile.cc: Likewise.
11694 * merge.cc: Likewise.
11695 * merge.h: Likewise.
11696 * object.cc: Likewise.
11697 * object.h: Likewise.
11698 * options.h: Likewise.
11699 * output.cc: Likewise.
11700 * output.h: Likewise.
11701 * parameters.cc: Likewise.
11702 * plugin.cc: Likewise.
11703 * powerpc.cc: Likewise.
11704 * reduced_debug_output.cc: Likewise.
11705 * reduced_debug_output.h: Likewise.
11706 * reloc.cc: Likewise.
11707 * reloc.h: Likewise.
11708 * resolve.cc: Likewise.
11709 * script-sections.cc: Likewise.
11710 * script.cc: Likewise.
11711 * script.h: Likewise.
11712 * sparc.cc: Likewise.
11713 * symtab.cc: Likewise.
11714 * symtab.h: Likewise.
11715 * target-select.cc: Likewise.
11716 * target-select.h: Likewise.
11717 * token.h: Likewise.
11718 * workqueue.cc: Likewise.
11719 * workqueue.h: Likewise.
11720 * x86_64.cc: Likewise.
11721
a0351a69
DK
117222009-12-10 Doug Kwan <dougkwan@google.com>
11723
11724 * arm.cc (attributes.h): New include.
11725 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11726 (Arm_relobj::~Arm_relobj): Delete object pointed by
11727 attributes_section_data_.
11728 (Arm_relobj::attributes_section_data): New method definition.
11729 (Arm_relobj::attributes_section_data_): New data member declaration.
11730 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11731 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11732 attributes_section_data_.
11733 (Arm_dynobj::attributes_section_data): New method definition.
11734 (Arm_dynobj::attributes_section_data_): New data member declaration.
11735 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11736 initialization value of may_use_blx_ to false.
2e702c99 11737 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11738 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11739 object attributes to compute results instead of hard-coding.
11740 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11741 Target_arm::get_secondary_compatible_arch,
11742 Target_arm::set_secondary_compatible_arch
11743 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11744 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11745 New method declarations.
11746 (Target_arm::get_aeabi_object_attribute): New method definition.
11747 (Target_arm::attributes_section_data_): New data member declaration.
11748 (read_arm_attributes_section): New template definition.
11749 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11750 (Arm_dynobj::do_read_symbols): Ditto.
11751 (Target_arm::do_finalize_sections): Merge attributes sections from
11752 input. Check for BLX use after attributes section merging.
11753 Fix __exidx_start and __exidx_end visibility. Create an
11754 .ARM.attributes section if necessary.
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,
e1df38aa 11759 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11760 New method definitions.
11761
b59befec
ILT
117622009-12-09 Ian Lance Taylor <iant@google.com>
11763
11764 * plugin.cc (Plugin::load): Don't cast from void* to a function
11765 pointer.
11766
1276bc89
ILT
117672009-12-09 Ian Lance Taylor <iant@google.com>
11768
11769 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11770 information fields.
11771
2f2de248
L
117722009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11773
11774 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11775 Replace two_file_shared_1.so with two_file_shared_2.so.
11776 * testsuite/Makefile.in: Regenerated.
11777
4f787271
DK
117782009-12-08 Doug Kwan <dougkwan@google.com>
11779
11780 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11781 (HFILES): Add attributes.h and int_encoding.h.
11782 * Makefile.in: Regenerate.
11783 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11784 function definitions to int_encoding.cc
11785 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11786 prototypes to int_encoding.h
11787 * reduced_debug_output.cc (int_encoding.h): New include.
11788 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11789 function definitions to int_encoding.cc
11790 (insert_into_vector, read_from_pointer): Move template definitions to
11791 int_encoding.h
11792 * attributes.cc: New file.
11793 * attributes.h: New file.
11794 * int_encoding.cc: New file.
11795 * int_encoding.h: New file.
11796
20b52f1a
RÁE
117972009-12-07 Rafael Avila de Espindola <espindola@google.com>
11798
11799 PR gold/11055
11800 * incremental-dump.cc (dump_incremental_inputs): New.
11801 (main): Use dump_incremental_inputs.
11802
53d7974c
L
118032009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11804
11805 PR gold/10893
11806 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11807 checking elfcpp::STT_FUNC.
11808 (Target_i386::Relocate::relocate): Likewise.
11809 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11810
11811 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11812 symbols from shared libraries into normal FUNC symbols.
11813
11814 * symtab.h (Symbol): Add is_func and use it.
11815
05a352e6
DK
118162009-12-05 Doug Kwan <dougkwan@google.com>
11817
11818 * arm.cc (Target_arm::arm_info): Initialize new fields
11819 attributes_section and attributes_vendor.
11820 * i386.cc (Target_i386::i386_info): Same.
11821 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11822 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11823 fields attributes_section and attributes_vendor.
53d7974c 11824 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11825 * target.h (Target::attributes_section, Target::attributes_vendor,
11826 Target::is_attributes_section, Target::attribute_arg_type,
11827 Target::attributes_order): New method definitions.
11828 (Target::Target_info::attributes_section,
11829 Target::Target_info::attributes_vendor): New fields.
11830 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11831 virtual method definitions.
11832 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11833 attributes_section and attributes_vendor.
11834 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11835
f4e5969c
DK
118362009-12-05 Doug Kwan <dougkwan@google.com>
11837
11838 * arm.cc: Update comments about interworking and stub generation.
11839 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11840 considered as non-PIC.
11841 (Arm_relocate_functions::base_abs): Fix formatting.
11842 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11843 of function to use GOT entry address instead of offset.
11844 (Target_arm::Scan::global): Issue an error if a symbol would need a
11845 PLT does not get one because it is untyped. Remove code to create
11846 dynamic symbols for relative branches.
11847 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11848 takes unsigned integer instead of boolean.
11849
1abce4a6
L
118502009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11851
11852 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11853 (two_file_test_LDADD): Likewise.
11854 (common_test_1_LDADD): Likewise.
11855 (exception_test_LDADD) Likewise.
11856 (weak_test_LDADD): Likewise.
11857 (many_sections_test_LDADD): Likewise.
11858 (initpri1_LDADD): Likewise.
11859 (script_test_1_LDADD): Likewise.
11860 (script_test_2_LDADD): Likewise.
11861 (justsyms_LDADD): Likewise.
11862 (binary_test_LDADD): Likewise.
11863 (large_LDADD): Likewise.
11864 * testsuite/Makefile.in: Regenerated.
11865
adcf2816 118662009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11867
adcf2816
L
11868 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11869 (Symbol_table::override_with_special): Likewise.
11870 (Symbol_table::add_from_object): Likewise.
11871
28e67f5d
RÁE
118722009-12-04 Rafael Avila de Espindola <espindola@google.com>
11873
11874 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11875 Don't set the data_offset twice.
11876
ae10a101
RÁE
118772009-12-04 Rafael Avila de Espindola <espindola@google.com>
11878
11879 * testsuite/Makefile.in: Regenerate.
11880
f59f41f3
DK
118812009-12-03 Doug Kwan <dougkwan@google.com>
11882
11883 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11884 (Target_arm::do_finalize_sections): Add parameter for symbol table
11885 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11886 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11887 parameter for symbol table pointer.
11888 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11889 an additional parameter for a pointer to symbol table.
11890 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11891 parameter for a symbol table pointer.
11892 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11893 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11894 Ditto.
11895 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11896 parameter for a symbol table pointer.
11897
ca55d848
RÁE
118982009-12-03 Rafael Avila de Espindola <espindola@google.com>
11899
11900 * incremental.cc (Incremental_inputs_header)
11901 (Incremental_inputs_header_write, Incremental_inputs_entry)
11902 (Incremental_inputs_entry_write): Move ...
11903 * incremental.h (Incremental_inputs_header)
11904 (Incremental_inputs_header_write, Incremental_inputs_entry)
11905 (Incremental_inputs_entry_write): here.
11906
3aec4f9c
RÁE
119072009-12-02 Rafael Avila de Espindola <espindola@google.com>
11908
11909 * incremental.cc (make_sized_incremental_binary): Set the target.
11910 Error if it is incompatible.
11911 * output.h (Output_file): Add filename method.
11912
9c0ae74d
RÁE
119132009-12-02 Rafael Avila de Espindola <espindola@google.com>
11914
11915 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11916 from the get_* methods.
11917
a45500ae
RÁE
119182009-12-02 Rafael Avila de Espindola <espindola@google.com>
11919
11920 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11921 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11922 Write 0 for the data_offset of scripts.
11923
325e6408
RÁE
119242009-12-02 Rafael Avila de Espindola <espindola@google.com>
11925
11926 * testsuite/Makefile.am: Add the incremental_test.sh test.
11927 * testsuite/incremental_test.sh: New.
11928 * testsuite/incremental_test_1.c: New.
11929 * testsuite/incremental_test_2.c: New.
11930
954c3e2e
RÁE
119312009-12-01 Rafael Avila de Espindola <espindola@google.com>
11932
703d02da 11933 * incremental-dump.cc (main): Fix typos.
954c3e2e 11934
f8086623
RÁE
119352009-11-27 Rafael Avila de Espindola <espindola@google.com>
11936
11937 PR gold/11025
11938 * incremental-dump.cc (main): Use llu to print 64 bit values.
11939
3b0dd6ac
L
119402009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11941 H.J. Lu <hongjiu.lu@intel.com>
11942
11943 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11944 $(LIBDL).
11945 (incremental_dump_LDADD): Likewise.
11946 * Makefile.in: Regenerated.
11947
a6d1ef57 119482009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11949
a6d1ef57
DK
11950 Revert:
11951
11952 2009-11-25 Doug Kwan <dougkwan@google.com>
11953
11954 * arm.cc (Target_arm::Target_arm): Move method definition
11955 outside of class definition. Add code to handle
11956 --target1-rel, --target1-abs and --target2= options.
11957 (Target_arm::get_reloc_reloc_type): Change method to be
11958 non-static and const.
11959 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11960 New data member declaration.
11961 (Target_arm::Scan::local, Target_arm::Scan::global,
11962 Target_arm::Relocate::relocate,
11963 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11964 Adjust call to Target_arm::get_real_reloc_type.
11965 (Target_arm::get_real_reloc_type): Use command line options
11966 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11967 * options.h (--target1-rel, --target1-abs, --target2): New
11968 ARM-only options.
11969
50aeb7d4
DK
119702009-11-25 Doug Kwan <dougkwan@google.com>
11971
11972 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11973 class definition. Add code to handle --target1-rel, --target1-abs
11974 and --target2= options.
11975 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11976 and const.
11977 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11978 member declaration.
11979 (Target_arm::Scan::local, Target_arm::Scan::global,
11980 Target_arm::Relocate::relocate,
11981 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11982 call to Target_arm::get_real_reloc_type.
11983 (Target_arm::get_real_reloc_type): Use command line options to
11984 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11985 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11986 options.
11987
51938283
DK
119882009-11-25 Doug Kwan <dougkwan@google.com>
11989
11990 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11991 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11992 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11993 formatting.
11994 (Arm_relocate_functions::thm_call): Replace body with a call to
11995 Arm_relocate_functions::thumb_branch_common.
11996 (Arm_relocate_functions::thm_jump24,
11997 Arm_relocate_functions::thm_xpc22): New method definitions.
11998 (Arm_relocate_functions::thumb_branch_common): New method definition.
11999 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12000 operator.
12001 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12002 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12003
e2b8f3c4
RÁE
120042009-11-24 Rafael Avila de Espindola <espindola@google.com>
12005
12006 * Makefile.am: Build incremental-dump
12007 * Makefile.in: Regenerate.
12008 * incremental-dump.cc: New.
12009 * incremental.cc (Incremental_inputs_header_data,
12010 Incremental_inputs_entry_data): Move to incremental.h
12011 * incremental.h: (Incremental_inputs_header_data,
12012 Incremental_inputs_entry_data): Move from incremental.cc
12013
bcba9aec
RÁE
120142009-11-24 Rafael Avila de Espindola <espindola@google.com>
12015
12016 * incremental.cc (Incremental_inputs_header,
12017 Incremental_inputs_header_write, Incremental_inputs_entry,
12018 Incremental_inputs_entry_write): Add a typedef with the data type.
12019
7c3afe08
RÁE
120202009-11-24 Rafael Avila de Espindola <espindola@google.com>
12021
12022 * incremental.cc (Incremental_inputs_header,
12023 Incremental_inputs_header_write, Incremental_inputs_entry,
12024 Incremental_inputs_entry_write): Update comment about which
12025 type has the filed descriptions.
12026
d204b6e9
DK
120272009-11-15 Doug Kwan <dougkwan@google.com>
12028
12029 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12030 (Arm_relocate_functions::arm_branch_common): Change method defintion
12031 in class definition to a method declaration and update list of formal
12032 parameters.
12033 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12034 Arm_relocation_functions::jump24): Adjust call to
12035 Arm_relocate_functions::arm_branch_common. Update list of formal
12036 parameters.
12037 (Arm_relocate_functions::xpc25): New method definition.
12038 (Arm_relocate_functions::arm_branch_common): Move method defintion
12039 out from class definition. Use stubs for mode-switching and extending
12040 branch ranges.
12041 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12042 specially. Change code to enable use of stubs in ARM branches.
12043
43d12afe
DK
120442009-11-10 Doug Kwan <dougkwan@google.com>
12045
12046 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12047 in method declaration.
12048 (Target_arm::relocate_stub): New method declaration.
12049 (Target_arm::default_target): Change to return a pointer instead of
12050 a const reference.
12051 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12052 Target_arm::default_target.
12053 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12054 method definition.
12055 (Target_arm::relocate_section): Adjust view.
12056 (Target_arm::relocate_stub): New method definition.
12057
ac33a407
DK
120582009-11-10 Doug Kwan <dougkwan@google.com>
12059
12060 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12061 a format warning.
12062 * incremental.cc (open_incremental_binary): Initialized local
12063 variables to avoid warnings.
12064 * object.cc (make_elf_object): Ditto.
12065 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12066 a format warning.
e1df38aa 12067
88ee28e9
L
12068009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12069
12070 PR gold/10930
12071 * testsuite/plugin_test.c: Include "config.h".
12072
2daedcd6
DK
120732009-11-09 Doug Kwan <dougkwan@google.com>
12074
12075 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12076 (arm_symbol_value): Remove.
12077 (Arm_relocate_functions::arm_branch_common,
12078 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12079 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12080 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12081 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12082 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12083 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12084 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12085 Arm_relocate_functions::thm_mobw_abs_nc,
12086 Arm_relocate_functions::thm_mov_abs,
12087 Arm_relocate_functions::movw_prel_nc,
12088 Arm_relocate_functions::thm_movt_abs,
12089 Arm_relocate_functions::movt_prel,
12090 Arm_relocate_functions::thm_movw_prel_nc,
12091 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12092 (Target_arm::Relocate::relocate): Only decompose address into two
12093 parts if relocation type uses the thumb-bit and pass the actual
12094 bit instead of a flag indicating that the thumb-bit is used. Adjust
12095 calls to methods in Arm_relocate_functions for this change.
12096
1276bc89 120972009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12098
12099 PR 10925
12100 * reloc.cc: Instantiate
12101 Sized_relobj::initialize_input_to_output_maps and
12102 Sized_relobj:free_input_to_output_maps.
12103
e53ad1b5
ILT
121042009-11-06 Ian Lance Taylor <iant@google.com>
12105
12106 PR 10876
12107 * defstd.cc (in_segment): Set only_if_ref true for "end".
12108
eb44217c
DK
121092009-11-06 Doug Kwan <dougkwan@google.com>
12110
12111 * arm.cc (class Reloc_stub): Correct a comment.
12112 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12113 (Target_arm::scan_section_for_stubs): New method declaration.
12114 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12115 Change methods from private to protected.
12116 (Target_arm::do_may_relax): New method definition.
12117 (Target_arm::do_relax, Target_arm::group_sections,
12118 Target_arm::scan_reloc_for_stub,
12119 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12120 (Target_arm::arm_input_section_map_): New data member declaration.
12121 (Target_arm::scan_reloc_for_stub,
12122 Target_arm::scan_reloc_section_for_stubs,
12123 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12124 Target_arm::do_relax): New method definitions.
12125
5d329b7d
ILT
121262009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12127
12128 * configure.ac: Check for (struct stat)::st_mtim
12129 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12130 * config.in: Regenerate.
12131 * configure: Regenerate.
12132
96a0d71b
ILT
121332009-11-05 Ian Lance Taylor <iant@google.com>
12134
12135 PR 10910
12136 * output.cc (Output_segment::add_output_section): Add missing
12137 return statement.
12138
594c8e5e
ILT
121392009-11-04 Ian Lance Taylor <iant@google.com>
12140
12141 PR 10880
12142 * object.h (class Object): Add is_needed and set_is_needed
12143 methods. Add is_needed_ field. Make bool fields into bitfields.
12144 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12145 defined in a dynamic object and referenced by a regular object,
12146 set is_needed for the dynamic object.
12147 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12148 if the file is marked with as_needed and it is not needed.
12149
22b127cc
ILT
121502009-11-04 Ian Lance Taylor <iant@google.com>
12151
12152 PR 10887
12153 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12154 tags if data is discarded by linker script.
12155 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12156 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12157 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12158 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12159
f5c870d2
ILT
121602009-11-04 Ian Lance Taylor <iant@google.com>
12161
12162 * layout.cc (Layout::get_output_section): Add is_interp and
12163 is_dynamic_linker_section parameters. Change all callers.
12164 (Layout::choose_output_section): Likewise.
12165 (Layout::make_output_section): Likewise.
12166 (Layout::add_output_section_data): Add is_dynamic_linker_section
12167 parameter. Change all callers.
12168 * layout.h (class Layout): Update declarations.
12169 * output.h (class Output_section): Add is_interp, set_is_interp,
12170 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12171 Add is_interp_, is_dynamic_linker_section_ fields. Change
12172 generate_code_fills_at_write_ to a bitfield.
12173 * output.cc (Output_section::Output_sections): Initialize new
12174 fields.
12175 (Output_segment::add_output_section): Add do_sort parameter.
12176 Change all callers.
12177
1ae4d23b
ILT
121782009-11-03 Ian Lance Taylor <iant@google.com>
12179
12180 PR 10860
12181 * options.h (class General_options): Add --warn-common.
12182 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12183 merging two common symbols.
12184 (Symbol_table::should_override): Handle --warn-common when merging
12185 a common symbol with a defined symbol. Use report_resolve_problem
12186 for multiple definitions.
12187 (Symbol_table::report_resolve_problem): New function.
12188 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12189
55da9579
DK
121902009-11-03 Doug Kwan <dougkwan@google.com>
12191
12192 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12193 stub_factory_.
12194 (Target_arm::stub_factory): New method definition.
12195 (Target_arm::new_arm_input_section,
12196 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12197 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12198 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12199 New type definitions.
12200 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12201 member declarations.
12202 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12203 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12204 New method definitions.
12205
37a9ac43
ILT
122062009-11-03 Ian Lance Taylor <iant@google.com>
12207
12208 * options.h (class General_options): Add --warn_constructors.
12209
b3d6a3d4
ILT
122102009-11-03 Ian Lance Taylor <iant@google.com>
12211
12212 PR 10893
12213 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12214 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12215
934b01dd
ILT
122162009-11-03 Ian Lance Taylor <iant@google.com>
12217
12218 PR 10895
12219 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12220 --msgid-bugs-address.
12221 (install-pdf): New target.
12222 (install-data_yes): Look up one directory to find mkinstalldirs.
12223
03c1939b
L
122242009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12225
12226 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12227 tree.
12228
ebd95253
DK
122292009-10-30 Doug Kwan <dougkwan@google.com>
12230
12231 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12232
e9bbb538
DK
122332009-10-30 Doug Kwan <dougkwan@google.com>
12234
12235 * arm.cc (Stub_addend_reader): New struct template definition
12236 and partial specializations.
12237 (Stub_addend_reader::operator()): New method definition for a
12238 partially specialized template.
12239
d5b40221
DK
122402009-10-30 Doug Kwan <dougkwan@google.com>
12241
12242 * arm.cc (Arm_relobj::processor_specific_flags): New method
12243 definition.
12244 (Arm_relobj::do_read_symbols): New method declaration.
12245 (Arm_relobj::processor_specific_flags_): New data member declaration.
12246 (Arm_dynobj): New class definition.
12247 (Target_arm::do_finalize_sections): Add input_objects parameter.
12248 (Target_arm::do_adjust_elf_header): New method declaration.
12249 (Target_arm::are_eabi_versions_compatible,
12250 (Target_arm::merge_processor_specific_flags): New method declaration.
12251 (Target_arm::do_make_elf_object): New overloaded method definitions
12252 and declaration.
12253 (Arm_relobj::do_read_symbols): New method definition.
12254 (Arm_dynobj::do_read_symbols): Ditto.
12255 (Target_arm::do_finalize_sections): Add input_objects parameters.
12256 Merge processor-specific flags from all input objects.
12257 (Target_arm::are_eabi_versions_compatible,
12258 Target_arm::merge_processor_specific_flags,
12259 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12260 New method definitions.
12261 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12262 Input_objects pointer type parameter.
12263 * layout.cc (Layout::finalize): Pass input objects to target's.
12264 finalize_sections function.
12265 * output.cc (Output_file_header::do_sized_write): Set ELF file
12266 header's processor-specific flags.
12267 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12268 Input_objects pointer type parameter.
12269 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12270 * target.h (Input_objects): New forward class declaration.
12271 (Target::processor_specific_flags,
12272 Target::are_processor_specific_flags_sect): New method definitions.
12273 (Target::finalize_sections): Add input_objects parameter.
12274 (Target::Target): Initialize processor_specific_flags_ and
12275 are_processor_specific_flags_set_.
12276 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12277 parameter.
12278 (Target::set_processor_specific_flags): New method definition.
12279 (Target::processor_specific_flags_,
12280 Target::are_processor_specific_flags_set_): New data member
12281 declarations.
12282 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12283 Input_objects pointer type parameter.
12284
ebabffbd
DK
122852009-10-30 Doug Kwan <dougkwan@google.com>
12286
12287 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12288
ad0f2072
ILT
122892009-10-28 Ian Lance Taylor <iant@google.com>
12290
12291 * object.h (class Relobj): Drop options parameter from
12292 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12293 do_scan_relocs, do_relocate. Change all callers.
12294 (class Sized_relobj): Drop options parameters from
12295 do_gc_process_relocs, do_scan_relocs, do_relocate,
12296 do_relocate_sections, relocate_sections, emit_relocs_scan,
12297 emit_relocs_scan_reltype. Change all callers.
12298 (struct Relocate_info): Remove options field and all references to
12299 it.
12300 * reloc.h (class Read_relocs): Remove options constructor
12301 parameter and options_ field. Change all callers.
12302 (class Gc_process_relocs, class Scan_relocs): Likewise.
12303 (class Relocate_task): Likewise.
12304 * target-reloc.h (scan_relocs): Remove options parameter. Change
12305 all callers.
12306 (scan_relocatable_relocs): Likewise.
12307 * target.h (class Sized_target): Remove options parameter from
12308 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12309 all callers.
12310 * gc.h (gc_process_relocs): Remove options parameter. Change all
12311 callers.
12312 * arm.cc: Update functions to remove options parameters.
12313 * i386.cc: Likewise.
12314 * powerpc.cc: Likewise.
12315 * sparc.cc: Likewise.
12316 * x86_64.cc: Likewise.
12317 * testsuite/testfile.cc: Likewise.
12318
8ffa3667
DK
123192009-10-28 Doug Kwan <dougkwan@google.com>
12320
12321 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12322 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12323 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12324 New method definitions.
12325
40f36857
CC
123262009-10-28 Cary Coutant <ccoutant@google.com>
12327
12328 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12329 (Plugin::cleanup_done_): New member.
12330 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12331 (Plugin_manager::cleanup_done_): Remove.
12332 (Plugin_manager::add_input_file): Edit error message.
12333 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12334 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12335
2c849493
ILT
123362009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12337
12338 * fileread.cc: (File_read::View::~View): Use the new
12339 data_ownership_ filed.
12340 (File_read::~File_read): Dispose the new whole_file_view_.
12341 (File_read::open): Mmap the whole file if needed.
12342 (File_read::open): Use whole_file_view_ instead of contents_.
12343 (File_read::find_view): Use whole_file_view_ if applicable.
12344 (File_read::do_read): Use whole_file_view_ instead of contents_.
12345 (File_read::make_view): Use whole_file_view_ instead of contents_,
12346 update File_read::View::View call.
12347 (File_read::find_or_make_view): Update File_read::View::View
12348 call.
12349 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12350 remove contents_
12351 (File_read::View::Data_ownership): New enum.
12352 (File_read::View::View): Replace bool mapped_ with Data_ownership
12353 argument.
12354 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12355 (File_read::View::data_ownership_): New field.
12356 (File_read::contents_): Remove (replaced by whole_file_view_).
12357 (File_read::whole_file_view_): New field.
12358 * options.h (class General_options): Add --keep-files-mapped.
12359
24998053
CC
123602009-10-27 Cary Coutant <ccoutant@google.com>
12361
12362 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12363 * testsuite/Makefile.am (plugin_test_5): New test case.
12364 * testsuite/Makefile.in: Regenerate.
12365
72adc4fa
DK
123662009-10-25 Doug Kwan <dougkwan@google.com>
12367
12368 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12369 from private to protected to allow access by child class.
12370 (Sized_relobj::do_relocate_sections): New method declaration.
12371 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12372 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12373 Sized_relobj::relocate_sections. Instantiate template explicitly
12374 for different target sizes and endianity.
12375
07f508a2
DK
123762009-10-24 Doug Kwan <dougkwan@google.com>
12377
12378 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12379 (Arm_input_section::as_arm_input_section): New method.
12380 (Arm_output_section): New class definition.
12381 (Arm_output_section::create_stub_group,
12382 Arm_output_section::group_sections): New method definitions.
12383
10ad9fe5
DK
123842009-10-22 Doug Kwan <dougkwan@google.com>
12385
12386 * arm.cc (Arm_input_section): New class definition.
12387 (Arm_input_section::init, Arm_input_section:do_write,
12388 Arm_input_section::set_final_data_size,
12389 Arm_input_section::do_reset_address_and_file_offset): New method
12390 definitions.
12391
56ee5e00
DK
123922009-10-21 Doug Kwan <dougkwan@google.com>
12393
12394 * arm.cc (Stub_table, Arm_input_section): New forward class
12395 declarations.
12396 (Stub_table): New class defintion.
12397 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12398 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12399 New method definition.
12400
b569affa
DK
124012009-10-21 Doug Kwan <dougkwan@google.com>
12402
12403 * arm.cc: Update copyright comments.
12404 (Target_arm): New forward class template declaration.
12405 (Arm_address): New type.
12406 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12407 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12408 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12409 constants.
12410 (Insn_template): Same.
12411 (DEF_STUBS): New macro.
12412 (Stub_type): New enum type.
12413 (Stub_template): New class definition.
12414 (Stub): Same.
12415 (Reloc_stub): Same.
12416 (Stub_factory): Same.
12417 (Target_arm::Target_arm): Initialize may_use_blx_ and
12418 should_force_pic_veneer_.
12419 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12420 Target_arm::should_force_pic_veneer,
12421 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12422 Target_arm::using_thumb_only, Target_arm:;default_target): New
12423 method defintions.
12424 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12425 New data member declarations.
12426 (Insn_template::size, Insn_template::alignment): New method defintions.
12427 (Stub_template::Stub_template): New method definition.
12428 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12429 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12430 (Stub_factory::Stub_factory): New method definition.
12431 * gold.h (string_hash): New template.
12432 * output.h (Input_section_specifier::hash_value): Use
12433 gold::string_hash.
12434 (Input_section_specifier::string_hash): Remove.
12435 * stringpool.cc (Stringpool_template::string_hash): Use
12436 gold::string_hash.
12437
6c172549
DK
124382009-10-20 Doug Kwan <dougkwan@google.com>
12439
12440 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12441 symbols of relaxed input sections.
12442 * output.h (Output_section::find_relaxed_input_section): Make
12443 method public.
12444
c5617f2f
DK
124452009-10-16 Doug Kwan <dougkwan@google.com>
12446
12447 * dynobj.cc (Versions::Versions): Initialize version_script_.
12448 Only insert base version symbol definition for a shared object
12449 if version script defines any version versions.
12450 (Versions::define_base_version): New method definition.
12451 (Versions::add_def): Check that base version is not needed.
12452 (Versions::add_need): Define base version lazily.
12453 * dynobj.h (Versions::define_base_version): New method declaration.
12454 (Versions::needs_base_version_): New data member declaration.
12455 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12456 (check_DATA): Add no_version_test.stdout.
12457 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12458 New make rules.
12459 * testsuite/Makefile.in: Regenerate.
12460 * testsuite/no_version_test.c: New file.
12461 * testsuite/no_version_test.sh: Ditto.
12462
3c12dcdb
DK
124632009-10-16 Doug Kwan <dougkwan@google.com>
12464
12465 * expression.cc (class Segment_start_expression): New class definition.
12466 (Segment_start_expression::value): New method definition.
12467 (script_exp_function_segment_start): Return a new
12468 Segment_start_expression.
12469 * gold/script-c.h (script_saw_segment_start_expression): New function
12470 prototype.
12471 * script-sections.cc (Script_sections::Script_sections): Initialize
12472 SAW_SEGMENT_START_EXPRESSION_ to false.
12473 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12474 and -Tbbs options to specify section addresses if given in
12475 command line and no SEGMENT_START expression is seen in a script.
12476 * script-sections.h (Script_sections::saw_segment_start_expression,
12477 Script_sections::set_saw_segment_start_expression): New method
12478 definition.
12479 (Script_sections::saw_segment_start_expression_): New data member
12480 declaration.
12481 * script.cc (script_saw_segment_start_expression): New function.
12482 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12483 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12484 script_test_7.sh and script_test_8.sh.
12485 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12486 script_test_8.stdout.
12487 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12488 (script_test_6, script_test_6.stdout, script_test_7,
12489 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12490 * Makefile.in: Regenerate.
12491 * testsuite/script_test_6.sh: New file.
12492 * testsuite/script_test_6.t: Same.
12493 * testsuite/script_test_7.sh: Same.
12494 * testsuite/script_test_7.t: Same.
12495 * testsuite/script_test_8.sh: Same.
12496
64b1ae37
DK
124972009-10-16 Doug Kwan <dougkwan@google.com>
12498
12499 * output.cc (Output_segment::set_section_list_address): Cast
12500 expressions to unsigned long long type to avoid format warnings.
12501
661be1e2
ILT
125022009-10-15 Ian Lance Taylor <iant@google.com>
12503
12edd763 12504 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12505 dot assignment to script_sections_.
12edd763
ILT
12506 * script-sections.cc (Script_sections::add_dot_assignment):
12507 Initialize if necessary.
12508
68b6574b
ILT
12509 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12510 program headers with no load segment if there is a linker script.
12511
661be1e2
ILT
12512 * layout.cc (Layout::set_segment_offsets): Align the file offset
12513 to the segment aligment for -N or -n with no load segment.
12514 * output.cc (Output_segment::add_output_section): Don't crash if
12515 the first section is a TLS section.
12516 (Output_segment::set_section_list_addresses): Print an error
12517 message if the address moves backward in a linker script.
12518 * script-sections.cc
12519 (Output_section_element_input::set_section_addresses): Don't
12520 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12521 (Orphan_output_section::set_section_addresses): Likewise.
12522
f15f61a7
DK
125232009-10-15 Doug Kwan <dougkwan@google.com>
12524
12525 * layout.cc (Layout::finish_dynamic_section): Generate tags
12526 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12527 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12528 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12529
82bb573a
ILT
125302009-10-14 Ian Lance Taylor <iant@google.com>
12531
12532 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12533 fields.
12534 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12535 data_shdr fields of relinfo.
12536 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12537 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12538 R_386_TLS_LDO_32, adjust based on section flags.
12539 (Target_i386::Relocate::fix_up_ldo): Remove.
12540
374ad285
ILT
125412009-10-13 Ian Lance Taylor <iant@google.com>
12542
12543 Add support for -pie.
12544 * options.h (class General_options): Add -pie and
12545 --pic-executable.
12546 (General_options::output_is_position_independent): Test -pie.
12547 (General_options::output_is_executable): Return true if not shared
12548 and not relocatable.
12549 (General_options::output_is_pie): Remove.
12550 * options.cc (General_options::finalize): Reject incompatible uses
12551 of -pie.
12552 * gold.cc (queue_middle_tasks): A -pie link is not static.
12553 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12554 * symtab.cc (Symbol::final_value_is_known): Return false if
12555 output_is_position_independent.
12556 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12557 output_is_position_independent.
12558 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12559 output_is_position_independent.
12560 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12561 output_is_position_independent.
12562 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12563 two_file_pie_test.
12564 (basic_pie_test.o, basic_pie_test): New targets.
12565 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12566 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12567 (two_file_pie_test): New target.
12568 * testsuite/Makefile.in: Rebuild.
12569 * README: Remove note saying that -pie is not supported.
12570
c6585162
ILT
125712009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12572
12573 * options.h (class General_options): Add -init and -fini.
12574 * layout.cc (Layout::finish_dynamic_section): Emit
12575 given init and fini functions.
12576
032ce4e9
ST
125772009-10-13 Sriraman Tallam <tmsriram@google.com>
12578
12579 * gc.h (gc_process_relocs): Check if icf is enabled using new
12580 function.
12581 * gold.cc (queue_initial_tasks): Likewise.
12582 (queue_middle_tasks): Likewise.
12583 * object.cc (do_layout): Likewise.
12584 * symtab.cc (is_section_folded): Likewise.
12585 * main.cc (main): Likewise.
12586 * reloc.cc (Read_relocs::run): Likewise.
12587 (Sized_relobj::do_scan_relocs): Likewise.
12588 * icf.cc (is_function_ctor_or_dtor): New function.
12589 (Icf::find_identical_sections): Check if function is ctor or dtor when
12590 safe icf is chosen.
12591 * options.h (General_options::icf): Change option to be an enum.
12592 (Icf_status): New enum.
12593 (icf_enabled): New method.
12594 (icf_safe_folding): New method.
12595 (set_icf_status): New method.
12596 (icf_status_): New variable.
12597 * (options.cc) (General_options::finalize): Set icf_status_.
12598 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12599 icf_test and icf_keep_unique_test to use the --icf enum flag.
12600 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12601 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12602
f345227a
ST
126032009-10-12 Sriraman Tallam <tmsriram@google.com>
12604
12605 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12606 includes to gc.h and icf.h.
12607 * arm.cc: Include gc.h.
12608 * gold.cc: Likewise.
12609 * i386.cc: Likewise.
12610 * powerpc.cc: Likewise.
12611 * sparc.cc: Likewise.
12612 * x86_64.cc: Likewise.
12613 * gc.h: Include icf.h.
12614
1c7814ed
ILT
126152009-10-11 Ian Lance Taylor <iant@google.com>
12616
12617 * plugin.cc: Include "gold.h" before other header files.
12618
ae3b5189
CD
126192009-10-10 Chris Demetriou <cgd@google.com>
12620
12621 * options.h (Input_file_argument::Input_file_type): New enum.
12622 (Input_file_argument::is_lib_): Replace with...
12623 (Input_file_argument::type_): New member.
12624 (Input_file_argument::Input_file_argument): Take Input_file_type
12625 'type' rather than boolean 'is_lib' as second argument.
12626 (Input_file_argument::is_lib): Use type_.
12627 (Input_file_argument::is_searched_file): New function.
12628 (Input_file_argument::may_need_search): Handle is_searched_file.
12629 * options.cc (General_options::parse_library): Support -l:filename.
12630 (General_options::parse_just_symbols): Update for Input_file_argument
12631 changes.
12632 (Command_line::process): Likewise.
12633 * archive.cc (Archive::get_file_and_offset): Likewise.
12634 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12635 * script.cc (read_script_file, script_add_file): Likewise.
12636 * fileread.cc (Input_file::Input_file): Likewise.
12637 (Input_file::will_search_for): Handle is_searched_file.
12638 (Input_file::open): Likewise.
12639 * readsyms.cc (Read_symbols::get_name): Likewise.
12640 * testsuite/Makefile.am (searched_file_test): New test.
12641 * testsuite/Makefile.in: Regenerate.
12642 * testsuite/searched_file_test.cc: New file.
12643 * testsuite/searched_file_test_lib.cc: New file.
12644
f3048a1d
ILT
126452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12646 Ian Lance Taylor <iant@google.com>
12647
12648 * descriptor.cc: Include <cstdio> and "binary-io.h".
12649 (Descriptors::open): Open the files in binary mode always.
12650 * script.cc (Lex::get_token): Treat \r as whitespace.
12651
d4780e57
ILT
126522009-10-09 Ian Lance Taylor <iant@google.com>
12653
12654 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12655
d9a893b8
ILT
126562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12657 Ian Lance Taylor <iant@google.com>
12658
12659 * configure.ac: Check for readv function also.
12660 * fileread.cc (readv): Define if not HAVE_READV.
12661 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12662 does not exist.
12663 * config.in: Regenerate.
12664 * configure: Regenerate.
12665
c0a62865
DK
126662009-10-09 Doug Kwan <dougkwan@google.com>
12667
12668 * layout.cc (Layout::make_output_section): Call target hook to make
12669 ordinary output section.
12670 (Layout::finalize): Adjust parameter list of call the
12671 Target::may_relax().
12672 * layout.h (class Layout::section_list): New method.
12673 * merge.h (Output_merge_base::entsize): Change visibility to public.
12674 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12675 New methods.
12676 (Output_merge_string::do_is_string): New method.
12677 * object.cc (Sized_relobj::do_setup): renamed from
12678 Sized_relobj::set_up.
12679 * object.h (Sized_relobj::adjust_shndx,
12680 Sized_relobj::initializ_input_to_output_maps,
12681 Sized_relobj::free_input_to_output_maps): Change visibilities to
12682 protected.
12683 (Sized_relobj::setup): Virtualize.
12684 (Sized_relobj::do_setup): New method declaration.
12685 (Sized_relobj::invalidate_section_offset,
12686 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12687 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12688 * options.cc (parse_int): New function.
12689 * options.h (parse_int): New declaration.
12690 (DEFINE_int): New macro.
12691 (stub_group_size): New option.
12692 * output.cc (Output_section::Output_section): Initialize memebers
12693 merge_section_map_, merge_section_by_properties_map_,
12694 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12695 (Output_section::add_input_section): Handled deferred code-fill
12696 generation and remove an old comment.
12697 (Output_section::add_relaxed_input_section): New method definition.
12698 (Output_section::add_merge_input_section): Use merge section by
12699 properties map to speed to search. Update merge section maps
12700 as appropriate.
12701 (Output_section::build_relaxation_map): New method definition.
12702 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12703 Same.
12704 (Output_section::relax_input_section): Renamed to
12705 Output_section::convert_input_sections_to_relaxed_sections and change
12706 interface to take a vector of pointers to relaxed sections.
12707 (Output_section::find_merge_section,
12708 Output_section::find_relaxed_input_section): New method definitions.
12709 (Output_section::is_input_address_mapped,
12710 Output_section::output_offset, Output_section::output_address):
12711 Use output section data maps to speed up searching.
12712 (Output_section::find_starting_output_address): Add comments.
12713 (Output_section::do_write,
12714 Output_section::write_to_postprocessing_buffer): Do code-fill
12715 generation as appropriate.
12716 (Output_section::get_input_sections): Invalidate relaxed input section
12717 map.
12718 (Output_section::restore_states): Adjust type of checkpoint .
12719 Invalidate relaxed input section map.
12720 * output.h (Output_merge_base): New class declaration.
12721 (Input_section_specifier): New class defintion.
12722 (class Output_relaxed_input_section) Change base class to
12723 Output_section_data_build.
12724 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12725 base class initializer.
12726 (Output_section::add_relaxed_input_section): New method declaration.
12727 (Output_section::Input_section): Change visibility to protected.
2e702c99 12728 (Output_section::Input_section::relobj,
c0a62865
DK
12729 Output_section::Input_section::shndx): Handle relaxed input sections.
12730 Output_section::input_sections) Change visibility to protected. Also
12731 define overload to return a non-const pointer.
12732 (Output_section::Merge_section_properties): New class defintion.
12733 (Output_section::Merge_section_by_properties_map,
12734 Output_section::Output_section_data_by_input_section_map,
12735 Output_section::Relaxation_map): New types.
12736 (Output_section::relax_input_section): Rename method to
12737 Output_section::convert_input_sections_to_relaxed_sections and change
12738 interface to take a vector of relaxed section pointers.
12739 (Output_section::find_merge_section,
12740 Output_section::find_relaxed_input_section,
12741 Output_section::build_relaxation_map,
12742 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12743 New method declarations.
12744 (Output_section::merge_section_map_
12745 Output_section::merge_section_by_properties_map_,
12746 Output_section::relaxed_input_section_map_,
12747 Output_section::is_relaxed_input_section_map_valid_,
12748 Output_section::generate_code_fills_at_write_): New data members.
12749 * script-sections.cc
12750 (Output_section_element_input::set_section_addresses): Call
12751 current_data_size and addralign methods of relaxed input sections.
12752 (Orphan_output_section::set_section_addresses): Call current_data_size
12753 and addralign methods of relaxed input sections.
12754 * symtab.cc (Symbol_table::compute_final_value): Extract template
12755 from the body of Symbol_table::sized_finalize_symbol.
12756 (Symbol_table::sized_finalized_symbol): Call
12757 Symbol_table::compute_final_value.
12758 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12759 (Symbol_table::compute_final_value): New templated method declaration.
12760 * target.cc (Target::do_make_output_section): New method defintion.
12761 * target.h (Target::make_output_section): New method declaration.
12762 (Target::relax): Add more parameters for input objects, symbol table
12763 and layout. Adjust call to do_relax.
12764 (Target::do_make_output_section): New method declaration.
12765 (Target::do_relax): Add parameters for input objects, symbol table
12766 and layout.
12767
d446d6c4
ILT
127682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12769
12770 * pread.c: Include stdio.h.
12771
bc06c745
ILT
127722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12773
12774 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12775 defined.
12776
75aea3d0
ILT
127772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12778
12779 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12780 Change read_shndx type to unsigned int.
12781 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12782 int.
12783 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12784 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12785 Change read_shndx type to unsigned int.
12786 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12787 int.
12788 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12789 * layout.cc (Layout::create_symtab_sections): Cast the result of
12790 local_symcount * symsize to off_t in the gold_assert.
12791
be8fcb75
ILT
127922009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12793
12794 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12795 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12796 R_ARM_BASE_ABS.
12797 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12798 (Arm_relocate_functions::thm_abs5): New function.
12799 (Arm_relocate_functions::abs12): New function.
12800 (Arm_relocate_functions::abs16): New function.
12801 (Arm_relocate_functions::base_abs): New function.
12802 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12803 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12804 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12805 R_ARM_BASE_ABS.
12806 (Scan::global): Likewise.
12807 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12808 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12809 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12810 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12811 R_ARM_BASE_ABS.
12812
c2a122b6
ILT
128132009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12814
12815 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12816 (Arm_relocate_functions::movt_prel): New function.
12817 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12818 (Arm_relocate_functions::thm_movt_prel): New function.
12819 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12820 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12821 (Scan::global, Relocate::relocate): Likewise.
12822 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12823
c4aa1e2d
ILT
128242009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12825
12826 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12827 Incremental_checker.
12828 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12829 unsigned int.
12830 (class Incremental_inputs_header): New class.
12831 (Incremental_inputs_header_writer): Edit comment.
12832 (Incremental_inputs_entry): New class.
12833 (Incremental_inputs_entry_writer): Edit comment.
12834 (Sized_incremental_binary::do_find_incremental_inputs_section):
12835 Add *strtab_shndx parameter, fill it.
12836 (Sized_incremental_binary::do_check_inputs): New method.
12837 (Incremental_checker::can_incrementally_link_output_file): Use
12838 Sized_incremental_binary::check_inputs.
12839 (Incremental_inputs::report_command_line): Save command line in
12840 command_line_.
12841 * incremental.h:
12842 (Incremental_binary::find_incremental_inputs_section): New
12843 method.
12844 (Incremental_binary::do_find_incremental_inputs_section): Add
12845 strtab_shndx parameter.
12846 (Incremental_binary::do_check_inputs): New pure virtual method.
12847 (Sized_incremental_binary::do_check_inputs): Declare.
12848 (Incremental_checker::Incremental_checker): Add incremental_inputs
12849 parameter, use it to initialize incremental_inputs_.
12850 (Incremental_checker::incremental_inputs_): New field.
12851 (Incremental_checker::command_line): New method.
12852 (Incremental_checker::inputs): New method.
12853 (Incremental_checker::command_line_): New field.
12854
c549a694
ILT
128552009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12856
12857 * incremental.cc: Include <cstdarg> and "target-select.h".
12858 (vexplain_no_incremental): New function.
12859 (explain_no_incremental): New function.
12860 (Incremental_binary::error): New method.
12861 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12862 method.
12863 (make_sized_incremental_binary): New function.
12864 (open_incremental_binary): New function.
12865 (can_incrementally_link_file): Add checks if output is ELF and has
12866 inputs section.
12867 * incremental.h: Include "elfcpp_file.h" and "output.h".
12868 (Incremental_binary): New class.
12869 (Sized_incremental_binary): New class.
12870 (open_incremental_binary): Declare.
12871 * object.cc (is_elf_object): Use
12872 elfcpp::Elf_recognizer::is_elf_file.
12873 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12874 * output.h (Output_file::filesize): New method.
12875
fd3c5f0b
ILT
128762009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12877
12878 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12879 New function.
12880 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12881 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12882 function.
12883 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12884 function.
12885 (Arm_relocate_functions::movw_abs_nc): New function.
12886 (Arm_relocate_functions::movt_abs): New function.
12887 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12888 (Arm_relocate_functions::thm_movt_abs): New function.
12889 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12890 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12891 (Scan::global): Likewise.
12892 (Relocate::relocate): Likewise.
12893 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12894
7f5309a5
ILT
128952009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12896
12897 * arm.cc (Arm_relocate_functions::got_prel) New function.
12898 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12899 (Relocate::relocate): Likewise.
12900 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12901
364c7fa5
ILT
129022009-10-06 Ian Lance Taylor <iant@google.com>
12903
12904 * options.h (class General_options): Define
12905 split_stack_adjust_size parameter.
12906 * object.h (class Object): Add uses_split_stack_ and
12907 has_no_split_stack_ fields. Add uses_split_stack and
12908 has_no_split_stack accessor functions. Declare
12909 handle_split_stack_section.
12910 (class Reloc_symbol_changes): Define.
12911 (class Sized_relobj): Define Function_offsets. Declare
12912 split_stack_adjust, split_stack_adjust_reltype, and
12913 find_functions.
12914 * object.cc (Object::handle_split_stack_section): New function.
12915 (Sized_relobj::do_layout): Call handle_split_stack_section.
12916 * dynobj.cc (Sized_dynobj::do_layout): Call
12917 handle_split_stack_section.
12918 * reloc.cc (Sized_relobj::relocate_sections): Call
12919 split_stack_adjust for executable sections in split_stack
12920 objects. Pass reloc_map to relocate_section.
12921 (Sized_relobj::split_stack_adjust): New function.
12922 (Sized_relobj::split_stack_adjust_reltype): New function.
12923 (Sized_relobj::find_functions): New function.
12924 * target-reloc.h: Include "object.h".
12925 (relocate_section): Add reloc_symbol_changes parameter. Change
12926 all callers.
12927 * target.h (class Target): Add calls_non_split method. Declare
12928 do_calls_non_split virtual method. Declare match_view and
12929 set_view_to_nop.
12930 * target.cc: Include "elfcpp.h".
12931 (Target::do_calls_non_split): New function.
12932 (Target::match_view): New function.
12933 (Target::set_view_to_nop): New function.
12934 * gold.cc (queue_middle_tasks): Give an error if mixing
12935 split-stack and non-split-stack objects with -r.
12936 * i386.cc (Target_i386::relocate_section): Add
12937 reloc_symbol_changes parameter.
12938 (Target_i386::do_calls_non_split): New function.
12939 * x86_64.cc (Target_x86_64::relocate_section): Add
12940 reloc_symbol_changes parameter.
12941 (Target_x86_64::do_calls_non_split): New function.
12942 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12943 parameter.
12944 * powerpc.cc (Target_powerpc::relocate_section): Add
12945 reloc_symbol_changes parameter.
12946 * sparc.cc (Target_sparc::relocate_section): Add
12947 reloc_symbol_changes parameter.
12948 * configure.ac: Call AM_CONDITIONAL for the default target.
12949 * configure: Rebuild.
12950 * testsuite/Makefile.am (TEST_AS): New variable.
12951 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12952 (check_DATA): Add split_i386 and split_x86_64 files.
12953 (SPLIT_DEFSYMS): Define.
12954 (split_i386_[1234n].o): New targets.
12955 (split_i386_[124]): New targets.
12956 (split_i386_[1234r].stdout): New targets.
12957 (split_x86_64_[1234n].o): New targets.
12958 (split_x86_64_[124]): New targets.
12959 (split_x86_64_[1234r].stdout): New targets.
12960 (MOSTLYCLEANFILES): Add new executables.
12961 * testsuite/split_i386.sh: New file.
12962 * testsuite/split_x86_64.sh: New file.
12963 * testsuite/split_i386_1.s: New file.
12964 * testsuite/split_i386_2.s: New file.
12965 * testsuite/split_i386_3.s: New file.
12966 * testsuite/split_i386_4.s: New file.
12967 * testsuite/split_i386_n.s: New file.
12968 * testsuite/split_x86_64_1.s: New file.
12969 * testsuite/split_x86_64_2.s: New file.
12970 * testsuite/split_x86_64_3.s: New file.
12971 * testsuite/split_x86_64_4.s: New file.
12972 * testsuite/split_x86_64_n.s: New file.
12973 * testsuite/testfile.cc (Target_test): Update relocation_section
12974 function.
12975 * testsuite/Makefile.in: Rebuild.
12976
e8a9fcda
ILT
129772009-10-06 Ian Lance Taylor <iant@google.com>
12978
12979 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12980 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12981 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12982 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12983 the address on ldo_addrs_.
12984 (Target_i386::Relocate::fix_up_ldo): New function.
12985
e99daf92
ILT
129862009-10-06 Rafael Espindola <espindola@google.com>
12987
12988 * plugin.cc (add_input_library): New.
12989 (Plugin::load): Add add_input_library to tv.
12990 (Plugin_manager::add_input_file): Add the is_lib argument.
12991 (add_input_file): Update call to Plugin_manager::add_input_file.
12992 (add_input_library): New.
12993 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12994
966d4097
DK
129952009-09-30 Doug Kwan <dougkwan@google.com>
12996
12997 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12998 symbol and call Symbol::may_need_copy_reloc to determine if
12999 a copy reloc is needed.
13000 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13001 nocopyreloc is given in command line.
13002 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13003 given in command line.
13004 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13005 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13006 of the removed Target_i386::may_need_copy_reloc.
13007 * options.h (copyreloc): New option with default value false.
13008 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13009 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13010 instead of the removed Target_powerpc::may_need_copy_reloc.
13011 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13012 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13013 instead of the removed Target_sparc::may_need_copy_reloc.
13014 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13015 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13016 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13017 instead of the removed Target_x86_64::may_need_copy_reloc.
13018
029ba973
ILT
130192009-09-30 Ian Lance Taylor <iant@google.com>
13020
13021 * object.h (class Object): Remove target_ field, and target,
13022 sized_target, and set_target methods.
13023 (Object::sized_target): Remove.
13024 (class Sized_relobj): Update declarations. Remove sized_target.
13025 * object.cc (Sized_relobj::setup): Remove target parameter.
13026 Change all callers.
13027 (Input_objects::add_object): Don't do anything with the target.
13028 (make_elf_sized_object): Add punconfigured parameter. Change all
13029 callers. Set or test parameter target.
13030 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13031 Change all callers.
13032 * parameters.cc (Parameters::set_target): Change parameter type to
13033 be non-const.
13034 (Parameters::default_target): Remove.
13035 (set_parameters_target): Change parameter type to be non-const.
13036 (parameters_force_valid_target): New function.
13037 (parameters_clear_target): New function.
13038 * parameters.h (class Parameters): Update declarations. Remove
13039 default_target method. Add sized_target and clear_target
13040 methods. Change target_ to be non-const.
13041 (set_parameters_target): Update declaration.
13042 (parameters_force_valid_target): Declare.
13043 (parameters_clear_target): Declare.
13044 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13045 as NULL if we aren't searching.
13046 (Add_symbols::run): Don't check for compatible target.
13047 * fileread.cc (Input_file::open_binary): Call
13048 parameters_force_valid_target.
13049 * gold.cc (queue_middle_tasks): Likewise.
13050 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13051 set_target on object.
13052 * dynobj.h (class Sized_dynobj): Update declarations.
13053 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13054 make_elf_object returns NULL.
13055 (Archive::include_member): Don't check whether object target is
13056 compatible.
13057 * output.cc (Output_section::add_input_section): Get target from
13058 parameters.
13059 (Output_section::relax_input_section): Likewise.
13060 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13061 parameters.
13062 (Sized_relobj::do_scan_relocs): Likewise.
13063 (Sized_relobj::relocate_sections): Likewise.
13064 * resolve.cc (Symbol_table::resolve): Likewise.
13065 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13066 parameter. Change all callers.
13067 (Symbol_table::add_from_object): Get target from parameters.
13068 (Symbol_table::add_from_relobj): Don't check object target.
13069 (Symbol_table::add_from_dynobj): Likewise.
13070 (Symbol_table::define_special_symbol): Get target from
13071 parameters.
13072 * symtab.h (class Symbol_table): Update declaration.
13073 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13074 parameter. Change all callers. Clear parameter target.
13075 (Binary_test): Test target here.
13076 * testsuite/object_unittest.cc (gold_testsuite): Remove
13077 target_test_pointer parameter. Change all callers.
13078 (Object_test): Test target here.
13079
a6a22b83
ILT
130802009-09-26 Ian Lance Taylor <iant@google.com>
13081
13082 * testsuite/initpri1.c: Don't try to use constructor priorities if
13083 compiling with gcc before 4.3.
13084
6a8f49fe
ILT
130852009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13086
13087 * testsuite/retain_symbols_file_test.sh (check_present): Change
13088 output file name to retain_symbols_file_test.stdout.
13089 (check_absent): Likewise.
13090
8c604651
CS
130912009-09-18 Craig Silverstein <csilvers@google.com>
13092
13093 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13094 * options.cc: Include <cerrno> and <fstream>.
13095 (General_options::finalize): Parse -retain-symbols-file tag.
13096 * options.h: New flag.
13097 (General_options): New method should_retain_symbol, new
13098 variable symbols_to_retain.
13099 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13100 should_retain_symbol map.
13101 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13102 * testsuite/Makefile.in: Regenerate.
13103 * testsuite/retain_symbols_file_test.sh: New file.
13104
ca58b19f
NC
131052009-09-18 Nick Clifton <nickc@redhat.com>
13106
13107 * po/es.po: Updated Spanish translation.
13108
20e6d0d6
DK
131092009-09-17 Doug Kwan <dougkwan@google.com>
13110
13111 * debug.h (DEBUG_RELAXATION): New constant.
13112 (DEBUG_ALL): Add DEBUG_RELAXATION.
13113 (debug_string_to_enum): Add relaxation debug option.
13114 * layout.cc
13115 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13116 Layout::Relaxation_debug_check::read_sections,
13117 Layout::Relaxation_debug_check::read_sections): New method definitions.
13118 (Layout::Layout): Initialize data members
13119 record_output_section_data_from_scrips_,
13120 script_output_section_data_list_ and relaxation_debug_check_.
13121 (Layout::save_segments, Layout::restore_segments,
13122 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13123 Layout::relaxation_loop_body): New method definitions.
13124 (Layout::finalize): Support relaxation. Move section layout code to
13125 Layout::relaxation_loop_body.
13126 (Layout::set_asection_address_from_script): Move code for orphan
13127 section placement out.
13128 (Layout::place_orphan_sections_in_script): New method definition.
13129 * layout.h (Output_segment_headers, Output_file_header):
13130 New forward class declarations.
13131 (Layout::~Layout): Define.
13132 (Layout::new_output_section_data_from_script): New method definition.
13133 (Layout::place_orphan_sections_in_script): New method declaration.
13134 (Layout::Segment_states): New type declaration.
13135 (Layout::save_segments, Layout::restore_segments,
13136 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13137 Layout::relaxation_loop_body): New method declarations.
13138 (Layout::Output_section_data_list): New type declaration.
13139 (Layout::Relaxation_debug_check): New class definition.
13140 (Layout::record_output_section_data_from_script_,
13141 Layout::script_output_section_data_list_, Layout::segment_states_,
13142 Layout::relaxation_debug_check_): New data members.
13143 * output.cc: (Output_section_headers::do_size): New method definition.
13144 (Output_section_headers::Output_section_headers): Move size
13145 computation to Output_section_headers::do_size.
13146 (Output_segment_headers::do_size): New method definition.
e1df38aa 13147 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13148 Output_file_header::do_size and call it.
13149 (Output_file_header::do_size): New method definition.
13150 (Output_data_group::Output_data_group): Adjust call to
13151 Output_section_data.
13152 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13153 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13154 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13155 RELAXED_INPUT_SECTION_CODE.
13156 (Output_section::Output_section): Initialize data member checkpoint_.
13157 (Output_section::~Output_section): Delete checkpoint object pointed
13158 by checkpoint_.
13159 (Output_section::add_input_section): Always add an Input_section if
13160 relaxing.
13161 (Output_section::add_merge_input_section): Add assert.
13162 (Output_section::relax_input_section): New method definition.
13163 (Output_section::set_final_data_size): Set load address to zero for
13164 an unallocated section.
13165 (Output_section::do_address_and_file_offset_have_reset_values):
13166 New method definition.
13167 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13168 Handle relaxed input section.
13169 (Output_section::sort_attached_input_sections): Checkpoint input
13170 section list lazily.
13171 (Output_section::get_input_sections): Change type of input_sections to
13172 list of Simple_input_section pointers. Checkpoint input section list
13173 lazily. Also handle relaxed input sections.
13174 (Output_section::add_input_section_for_script): Take a reference to
13175 a Simple_input_section object instead of Relobj pointer and section
13176 index as parameter. Handle relaxed input sections.
13177 (Output_section::save_states, Output_section::restore_states): New
13178 method definitions.
13179 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13180 (Output_data::is_data_size_fixed): New method definition.
13181 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13182 if it is fixed.
13183 (Output_data::address_and_file_offset_have_reset_values): New method
13184 definition.
13185 (Output_data::do_address_and_file_offset_have_reset_values): New method
13186 definition.
13187 (Output_data::set_data_size): Check that data size is not fixed.
13188 (Output_data::fix_data_size): New method definition.
13189 (Output_data::is_data_size_fixed_): New data member.
13190 (Output_section_headers::set_final_data_size): New method definition.
13191 (Output_section_headers::do_size): New method declaration.
13192 (Output_segment_headers::set_final_data_size): New method definition.
13193 (Output_segment_headers::do_size): New method declaration.
13194 (Output_file_header::set_final_data_size)::New method definition.
13195 (Output_file_header::do_size)::New method declaration.
13196 (Output_section_data::Output_section_data): Add new parameter
13197 is_data_size_fixed and use it to fix data size.
13198 (Output_data_const::Output_data_const): Adjust call to base class
13199 constructor and fix data size.
13200 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13201 base class constructor and fix data size.
13202 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13203 base class constructor and fix data size.
13204 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13205 class constructor and fix data size.
13206 (Output_data_group::set_final_data_size): New method definition.
13207 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13208 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13209 class constructor and fix data size.
13210 (Output_relaxed_input_section): New class definition.
13211 (Output_section::Simple_input_section): New class definition.
13212 (Output_section::get_input_sections): Adjust parameter list.
13213 (Output_section::add_input_section_for_script): Same.
13214 (Output_section::save_states, Output_section::restore_states,
13215 Output_section::do_address_and_file_offset_have_reset_values,
13216 (Output_section::Input_section::Input_section): Handle
13217 RELAXED_INPUT_SECTION_CODE. Add new overload for
13218 Output_relaxed_input_section.
13219 (Output_section::Input_section::is_input_section,
13220 Output_section::Input_section::set_output_section): Handle relaxed
13221 input section.
13222 (Output_section::Input_section::is_relaxed_input_section,
13223 Output_section::Input_section::output_section_data,
13224 Output_section::Input_section::relaxed_input_section): New method
13225 definitions.
13226 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13227 value.
13228 (Output_section::Input_section::u1_): Update comments.
13229 (Output_section::Input_section::u2_): Add new union member poris.
13230 (Output_section::Checkpoint_output_section): New classs definition.
13231 (Output_section::relax_input_section): New method declaration.
13232 (Output_section::checkpoint_): New data member.
13233 (Output_segment): Update comments.
13234 (Output_segment::Output_segment): Un-privatize copy constructor.
13235 (Output_segment::operator=): Un-privatize.
13236 * script-sections.cc (Output_section_element::Input_section_list):
13237 Change element type to Output_section::Simple_input_section.
13238 (Output_section_element_dot_assignment::set_section_addresses):
13239 Register output section data for relaxation clean up.
13240 (Output_data_exression::Output_data_expression): Adjust call to base
13241 constructor to fix data size.
13242 (Output_section_element_data::set_section_addresses): Register
13243 Output_data_expression object for relaxation clean up.
13244 (struct Input_section_info): Replace Relobj pointer and section index
13245 pair with Output_section::Simple_input_section and Convert struct to a
13246 class.
13247 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13248 Input_section_info data member to use accessors.
20e6d0d6
DK
13249 (Output_section_element_input::set_section_addresses): Use layout
13250 parameter. Adjust code to use Output_section::Simple_input_section
13251 and Input_secction_info classes. Register filler for relaxation
13252 clean up.
13253 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13254 and section index pair with Output_section::Simple_input_section
13255 class. Adjust code accordingly.
13256 (Phdrs_element::release_segment): New method definition.
13257 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13258 segment list.
13259 (Script_sections::release_segments): New method definition.
13260 * gold/script-sections.h (Script_sections::release_segments): New
13261 method declaration.
13262 * gold/target.h (Target::may_relax, Target::relax,
13263 Target::do_may_relax, Target::do_relax): New method definitions.
13264
5e445df6
ILT
132652009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13266
13267 * arm.cc (has_signed_unsigned_overflow): New function.
13268 (Arm_relocate_functions::abs8): New function.
13269 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13270 (Target_arm::Scan::global): Likewise.
13271 (Target_arm::relocate::relocate): Likewise.
13272 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13273 Likewise.
13274
8c604651 132752009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13276
13277 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13278 * testsuite/Makefile.in: Regenerate.
13279
1e9cc1c2
NC
132802009-09-11 Nick Clifton <nickc@redhat.com>
13281
13282 * po/gold.pot: Updated by the Translation project.
13283
6a89f575
CC
132842009-09-08 Cary Coutant <ccoutant@google.com>
13285
13286 * output.cc (Output_file::open): Add execute permission to empty file.
13287 * testsuite/Makefile.am (permission_test): New test.
13288 * testsuite/Makefile.in: Regenerate.
13289
fdcac5af
ILT
132902009-09-02 Ian Lance Taylor <iant@google.com>
13291
13292 * output.cc (Output_file::resize): Call map_no_anonymous rather
13293 than map.
13294
44453f85
ILT
132952009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13296
13297 * gold.cc: Include "incremental.h".
13298 (queue_initial_tasks): Call Incremental_checker methods.
13299 * incremental.cc: Include "output.h".
13300 (Incremental_checker::can_incrementally_link_output_file): New
13301 method.
13302 * incremental.h (Incremental_checker): New class.
13303
13304 * output.cc (Output_file::open_for_modification): New method.
13305 (Output_file::map_anonymous): Changed return type to bool. Record
13306 map in base_ field.
13307 (Output_file::map_no_anonymous): New method, broken out of map.
13308 (Output_file::map): Use map_no_anonymous and map_anonymous.
13309 * output.h (class Output_file): Update declarations.
13310
293c1386
CC
133112009-08-24 Cary Coutant <ccoutant@google.com>
13312
13313 * options.h (Command_line::Pre_options): New class.
13314 (Command_line::pre_options): New member.
13315 * options.cc (gold::options::ready_to_register): New variable.
13316 (One_option::register_option): Do nothing if not registering options.
13317 Assert if same short option registered twice.
13318 (General_options::General_options): Turn off option registration when
13319 done constructing.
13320 (Command_line::Pre_options::Pre_options): New constructor.
13321
f773f3d2
CC
133222009-08-24 Cary Coutant <ccoutant@google.com>
13323
06a73cfe
CC
13324 * options.h (General_options::no_keep_memory): Remove incorrect
13325 short option.
f773f3d2 13326
a15af8e2
RW
133272009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13328
13329 * Makefile.am (am__skiplex, am__skipyacc): New.
13330 * Makefile.in: Regenerate.
13331
c462b41b
RW
133322009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13333
14ec8efd
RW
13334 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13335 (INCLUDES): ... this.
13336 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13337 (AM_CPPFLAGS): Renamed from ...
13338 (INCLUDE): ... this.
13339 * Makefile.in, testsuite/Makefile.in: Regenerate.
13340
81ecdfbb
RW
13341 * Makefile.in: Regenerate.
13342 * aclocal.m4: Likewise.
13343 * config.in: Likewise.
13344 * configure: Likewise.
13345 * testsuite/Makefile.in: Likewise.
13346
c462b41b
RW
13347 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13348 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13349 * Makefile.in: Regenerate.
13350 * testsuite/Makefile.in: Regenerate.
13351
2da73f13
CC
133522009-08-19 Cary Coutant <ccoutant@google.com>
13353
13354 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13355 symbols in shared libraries overridden by hidden or internal symbols
13356 in the main program.
13357
2db70501
CD
133582009-08-19 Chris Demetriou <cgd@google.com>
13359
13360 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13361 checking source file names in error messages.
13362
f733487b
DK
133632009-08-18 Doug Kwan <dougkwan@google.com>
13364
13365 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13366 an elcpp::Ehdr as parameter. Adjust call to set_target.
13367 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13368 an elfcpp::Ehdr as parameter.
13369 * object.cc (Object::set_target): Remove the version that looks up
13370 a target and sets it.
13371 (Sized_relobj::setup): Take a Target object instead of
13372 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13373 (make_elf_sized_object): Find target and ask target to
13374 make an ELF object.
13375 * object.h: (Object::set_target): Remove the version that looks up
13376 a target and sets it.
13377 (Sized_relobj::setup): Take a Target object instead of
13378 an elfcpp:Ehdr as parameter.
13379 * target.cc: Include dynobj.h.
13380 (Target::do_make_elf_object_implementation): New.
2e702c99 13381 (Target::do_make_elf_object): New.
f733487b
DK
13382 * target.h (Target::make_elf_object): New template declaration.
13383 (Target::do_make_elf_object): New method declarations.
13384 (Target::do_make_elf_object_implementation): New template declaration.
13385
cc70f101
ILT
133862009-08-14 Ian Lance Taylor <iant@google.com>
13387
13388 * gold.h (FUNCTION_NAME): Define.
13389 (gold_unreachable): Use FUNCTION_NAME.
13390
ef5e0cb1
ST
133912009-08-12 Sriraman Tallam <tmsriram@google.com>
13392
13393 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13394 symbol in the --keep-unique list is not found.
13395
48c187ce
ST
133962009-08-12 Sriraman Tallam <tmsriram@google.com>
13397
13398 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13399 been maked as --keep-unique.
13400 (Icf::unfold_section): New function.
13401 * icf.h (Icf::unfold_section): New function.
13402 * options.h (General_options::keep_unique): New option.
13403 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13404 * testsuite/Makefile.in: Regenerate.
13405 * testsuite/icf_keep_unique_test.sh: New file.
13406 * testsuite/icf_keep_unique_test.cc: New file.
13407
645afe0c
CC
134082009-08-12 Cary Coutant <ccoutant@google.com>
13409
13410 PR 10471
13411 * resolve.cc (Symbol_table::resolve): Check for references from
13412 dynamic objects to hidden and internal symbols.
13413 * testsuite/Makefile.am (hidden_test.sh): New test.
13414 * testsuite/Makefile.in: Regenerate.
13415 * testsuite/hidden_test.sh: New script.
13416 * testsuite/hidden_test_1.c: New test source.
13417 * testsuite/hidden_test_main.c: New test source.
13418
11af873f
DK
134192009-08-11 Doug Kwan <dougkwan@google.com>
13420
13421 * arm.cc: Update comments.
13422 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13423 segment to locate the .ARM.exidx section if present.
13424
b9f7d72d
DK
134252009-08-09 Doug Kwan <dougkwan@google.com>
13426
13427 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13428 patch.
13429
ddd3c53c
ST
134302009-08-07 Sriraman Tallam <tmsriram@google.com>
13431 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13432 compiler warnings.
13433
27721062
ST
134342009-08-06 Sriraman Tallam <tmsriram@google.com>
13435
13436 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13437 valid tls_segment only for non-debug-section relocations.
13438 * testsuite/Makefile.am: Add gc_tls_test.
13439 * testsuite/Makefile.in: Regenerate.
13440 * testsuite/gc_tls_test.cc: New file.
13441 * testsuite/gc_tls_test.sh: New file.
13442
ef15dade 134432009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13444
ef15dade
ST
13445 * icf.cc: New file.
13446 * icf.h: New file.
13447 * Makefile.am (CCFILES): Add icf.cc.
13448 (HFILES): Add icf.h
13449 * Makefile.in: Regenerate.
13450 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13451 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13452 section, symbol and addend information for the relocs.
13453 * gold.cc (queue_middle_tasks): Call identical code folding.
13454 * gold.h: Add defines for multimap.
13455 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13456 to the call of finalize_local_symbols.
13457 * main.cc (main): Create object of class Icf.
13458 * object.cc (Sized_relobj::do_layout): Allow this function to be
13459 called twice during icf.
13460 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13461 to sections marked as identical by icf.
13462 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13463 when available.
13464 (Sized_relobj::do_section_entsize): New function.
13465 * object.h (Object::section_entsize): New function.
13466 (Object::do_section_entsize): New pure virtual function.
13467 (Relobj::finalize_local_symbols): Add new parameter.
13468 (Relobj::do_section_entsize): New function.
13469 * options.h (General_options::icf): New option.
13470 (General_options::icf_iterations): New option.
13471 (General_options::print_icf_sections): New option.
13472 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13473 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13474 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13475 icf.
13476 * symtab.cc (Symbol_table::is_section_folded): New function.
13477 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13478 to sections marked as identical by icf.
13479 * symtab.h (Symbol_table::set_icf): New function.
13480 (Symbol_table::icf): New function.
13481 (Symbol_table::is_section_folded): New function.
13482 (Symbol_table::icf_): New data member.
13483 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13484 * testsuite/Makefile.am: Add commands to build icf_test.
13485 * testsuite/Makefile.in: Regenerate.
13486 * testsuite/icf_test.sh: New file.
13487 * testsuite/icf_test.cc: New file.
13488
c3b65ac4
CD
134892009-07-24 Chris Demetriou <cgd@google.com>
13490
13491 * layout.cc (is_compressible_debug_section): Fix incorrect
13492 comment about compressed section names.
13493
1caf2c51
ILT
134942009-07-20 Ian Lance Taylor <ian@airs.com>
13495
13496 PR 10419
13497 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13498
1ef4d87f
ILT
134992009-07-16 Ian Lance Taylor <iant@google.com>
13500
13501 PR 10400
13502 * layout.h: #include <map>.
13503 (class Kept_section): Change from struct to class. Add accessors
13504 and setters. Add section size to Comdat_group mapping. Change
13505 Comdat_group to std::map. Add is_comdat_ field. Add
13506 linkonce_size field in union.
13507 (class Layout): Update declaration of find_or_add_kept_section.
13508 Don't declare find_kept_object.
13509 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13510 parameter. Add object, shndx, is_comdat, and is_group_name
13511 parameters. Change all callers. Adjust for new Kept_section.
13512 (Layout::find_kept_object): Remove.
13513 * object.cc (Sized_relobj::include_section_group): Update use of
13514 Kept_section. Rename secnum to shndx. Only record
13515 Kept_comdat_section if sections are the same size.
13516 (Sized_relobj::include_linkonce_section): Update use of
13517 Kept_section. Only record Kept_comdat_section if sections are the
13518 same size. Set size of linkonce section.
13519 (Sized_relobj::map_to_kept_section): Update call to
13520 get_kept_comdat_section.
13521 * object.h (class Sized_relobj): Rename fields in
13522 Kept_comdat_section to drop trailing underscores; change object
13523 field to Relobj*. Change Kept_comdat_section_table to store
13524 struct rather than pointer.
13525 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13526 Add kept_object and kept_shndx parameters. Change all callers.
13527 (Sized_relobj::get_kept_comdat_section): Change return type to
13528 bool. Add kept_object and kept_shndx parameters. Change all
13529 callers.
13530 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13531 Layout::find_or_add_kept_section.
13532
37c3b7b0
ILT
135332009-07-09 Ian Lance Taylor <iant@google.com>
13534
13535 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13536 Reserve space in the hash table.
13537
98fa85cb
ILT
135382009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13539
13540 * fileread.cc (File_read::get_mtime): New method.
13541 * fileread.h (Timespec): New structure.
13542 (File_read::get_mtime): New method.
13543 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13544 Renamed from timestamp_nsec.
13545 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13546 Elf_Xword.
e1df38aa 13547 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13548 timestamp_nsec.
e1df38aa 13549 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13550 (Incremental_inputs::report_obejct): Save mtime; style fix.
13551 (Incremental_inputs::report_script): Save mtime; style fix.
13552 (Incremental_inputs::finalize_inputs): Style fix.
13553 (Incremental_inputs::finalize): Style fix.
13554 (Incremental_inputs::create_input_section_data): Store inputs
13555 mtime.
13556 * incremental.h (Incremental_inputs::report_script): Add mtime
13557 argument.
13558 (Incremental_inputs::Input_info::Input_info): Intialize only one
13559 union member.
13560 (Incremental_inputs::Input_info::archive): Move to nameless
13561 union.
13562 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13563 (Incremental_inputs::Input_info::script): Move to nameless union.
13564 (Incremental_inputs::mtime): New field.
13565 * script.cc (read_input_script): Pass file mtime to
13566 Incremental_input.
13567 * script.h (Script_info::inputs): Style fix.
13568
c9d70757
ILT
135692009-07-01 Ian Lance Taylor <ian@airs.com>
13570
13571 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13572 instead of 32.
13573
9c547ec3
ILT
135742009-06-24 Ian Lance Taylor <iant@google.com>
13575
13576 PR 10156
13577 * layout.cc (Layout::choose_output_section): If we find an
13578 existing section, update the flags.
13579 (Layout::create_notes): New function, broken out of
13580 Layout::finalize.
13581 (Layout::finalize): Don't create note sections.
13582 (Layout::create_note): Don't crash if linker script discards
13583 section.
13584 (Layout::create_gold_note): Likewise.
13585 (Layout::create_build_id): Likewise. Don't set
13586 after_input_sections on the section.
13587 (Layout::create_executable_stack_info): Remove target parameter.
13588 Change caller.
13589 * layout.h (class Layout): Declare create_notes. Update
13590 declaration of create_executable_stack_info.
13591 * gold.cc (queue_middle_tasks): Call create_notes.
13592 * output.cc (Output_section::update_flags_for_input_section): Move
13593 here from output.h. If SHF_ALLOC flag is newly set, mark address
13594 invalid.
13595 * output.h (Output_data::mark_address_invalid): New function.
13596 (class Output_section): Only declare, not define,
13597 update_flags_for_input_section. Remove set_flags.
13598
55458500
ILT
135992009-06-24 Ian Lance Taylor <iant@google.com>
13600
13601 * script-sections.cc (Output_section_definition::
13602 set_section_addresses): Rename shadowing local load_address to
13603 laddr.
13604
1307d6cd
ILT
136052009-06-24 Ian Lance Taylor <iant@google.com>
13606
13607 PR 10244
13608 * reloc.cc (relocate_sections): Skip empty relocation sections.
13609
ec3f783e
ILT
136102009-06-23 Ian Lance Taylor <iant@google.com>
13611
13612 PR 10156
13613 * layout.cc (Layout::create_note): Use choose_output_section
13614 rather than make_output_section.
13615
459c9f1c
ILT
136162009-06-23 Ian Lance Taylor <iant@google.com>
13617
13618 PR 10237
13619 * options.cc (General_options::parse_V): Set printed_version_.
13620 (General_options::General_options): Initialize printed_version_.
13621 * options.h (class General_options): Add printed_version_ field.
13622 * gold.cc (queue_initial_tasks): If there are no input files,
13623 don't give a fatal error if we printed the version information.
13624 (queue_middle_tasks): If using -r with a shared object, give a
13625 fatal error rather than an ordinary error.
13626
1518dc8f
ILT
136272009-06-23 Ian Lance Taylor <iant@google.com>
13628
13629 PR 10219
13630 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13631 (Layout::make_output_section): Set have_stabstr_section_ if we see
13632 a .stab*str section.
13633 (Layout::finalize): Call link_stabs_sections.
13634 (Layout::link_stabs_sections): New file.
13635 * layout.h (class Layout): Add have_stabstr_section_ field.
13636 Declare link_stabs_sections.
13637
3d857b98
DK
136382009-06-23 Doug Kwan <dougkwan@google.com>
13639
13640 * Makefile.am (libgold_a_LIBADD): New.
13641 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13642 * Makefile.in: Regenerate.
3d857b98
DK
13643 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13644 * configure: Regenerate.
13645 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13646 * fileread.cc: Include sys/state.h
13647 * gold.h: Declare memmem and strndup if found missing.
13648 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13649
0639a6f6
ILT
136502009-06-23 Ian Lance Taylor <iant@google.com>
13651
13652 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13653 * configure: Rebuild.
13654
8d63875c
ILT
136552009-06-23 Ian Lance Taylor <iant@google.com>
13656
13657 PR 10147
13658 * object.cc (Object::section_contents): Don't try to get a view if
13659 the section has length zero.
13660 (Object::handle_gnu_warning_section): If the section is empty, use
13661 the name of the section as the warning.
13662
f7c8a183
ILT
136632009-06-23 Ian Lance Taylor <iant@google.com>
13664
13665 PR 10133
13666 * stringpool.h (class Stringpool_template): Add optimize_ field.
13667 (Stringpool_template::set_optimize): New function.
13668 * stringpool.cc (Stringpool_template::Stringpool_template):
13669 Initialize optimize_ field.
13670 (Stringpool_template::set_string_offsets): Test local optimize
13671 fild rather than parameter.
13672 * layout.cc (Layout::Layout): Call set_optimize on the section
13673 name stringpool.
13674
e6a307ba
ILT
136752009-06-22 Ian Lance Taylor <iant@google.com>
13676
13677 PR 10030
13678 * yyscript.y: Parse TARGET.
13679 * script.cc (script_set_target): New function.
13680 * script-c.h (script_set_target): Declare.
13681 * options.cc (General_options::string_to_object_format): Rename
13682 from string_to_object_format in anonymous namespace. Change
13683 callers.
13684 * options.h (class General_options): Declare
13685 string_to_object_format.
13686
3ee173de
ILT
136872009-06-22 Ian Lance Taylor <iant@google.com>
13688
13689 * script-sections.cc (Script_sections::create_segments): Don't put
13690 program headers in a PT_LOAD segment if -n or -N.
13691
136922009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13693
13694 PR 10141
13695 * options.h (class General_options): Add -z lazy and -z now. Sort
13696 -z options into alphabetical order.
13697 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13698
cd6739a1 136992009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13700
13701 * layout.cc (Layout::make_output_section): Call
13702 Target::new_output_section.
13703 (Layout::attach_allocated_section_to_segment): Put large section
13704 sections in a separate load segment with the large segment flag
13705 set.
13706 (Layout::segment_precedes): Sort large data segments after other
13707 load segments.
13708 (align_file_offset): New static function.
13709 (Layout::set_segment_offsets): Use align_file_offset.
13710 * output.h (class Output_section): Add is_small_section_ and
13711 is_large_section_ fields.
13712 (Output_section::is_small_section): New function.
13713 (Output_section::set_is_small_section): New function.
13714 (Output_section::is_large_section): New function.
13715 (Output_section::set_is_large_section): New function.
13716 (Output_section::is_large_data_section): New function.
13717 (class Output_segment): Add is_large_data_segment_ field.
13718 (Output_segment::is_large_data_segment): New function.
13719 (Output_segment::set_is_large_data_segment): New function.
13720 * output.cc (Output_section::Output_section): Initialize new
13721 fields.
13722 (Output_segment::Output_segment): Likewise.
13723 (Output_segment::add_output_section): Add assertion that large
13724 data sections always go in large data segments. Force small data
13725 sections to the end of the list of data sections. Force small BSS
13726 sections to the start of the list of BSS sections. For large BSS
13727 sections to the end of the list of BSS sections.
13728 * symtab.h (class Symbol): Declare is_common_shndx.
13729 (Symbol::is_defined): Check Symbol::is_common_shndx.
13730 (Symbol::is_common): Likewise.
13731 (class Symbol_table): Define enum Commons_section_type. Update
13732 declarations. Add small_commons_ and large_commons_ fields.
13733 * symtab.cc (Symbol::is_common_shndx): New function.
13734 (Symbol_table::Symbol_table): Initialize new fields.
13735 (Symbol_table::add_from_object): Put small and large common
13736 symbols in the right list.
13737 (Symbol_table::sized_finalized_symbol): Check
13738 Symbol::is_common_shndx.
13739 (Symbol_table::sized_write_globals): Likewise.
13740 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13741 common symbol lists. Don't call do_allocate_commons_list if the
13742 list is empty.
13743 (Symbol_table::do_allocate_commons_list): Remove is_tls
13744 parameter. Add comons_section_type parameter. Change all
13745 callers. Handle small and large common symbols.
13746 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13747 Symbol::is_common_shndx.
13748 * resolve.cc (symbol_to_bits): Likewise.
13749 * target.h (Target::small_common_shndx): New function.
13750 (Target::small_common_section_flags): New function.
13751 (Target::large_common_shndx): New function.
13752 (Target::large_common_section_flags): New function.
13753 (Target::new_output_section): New function.
13754 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13755 small_common_section_flags, and large_common_section_flags
13756 fields.
13757 (Target::do_new_output_section): New virtual function.
13758 * arm.cc (Target_arm::arm_info): Initialize new fields.
13759 * i386.cc (Target_i386::i386_info): Likewise.
13760 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13761 Likewise.
13762 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13763 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13764 (Target_x86_64::do_new_output_section): New function.
13765 * configure.ac: Define conditional MCMODEL_MEDIUM.
13766 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13767 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13768 (large_LDFLAGS): Define.
13769 * testsuite/large.c: New file.
13770 * testsuite/testfile.cc (Target_test::test_target_info):
13771 Initialize new fields.
13772 * configure, testsuite/Makefile.in: Rebuild.
13773
bb04269c
DK
137742009-06-05 Doug Kwan <dougkwan@google.com>
13775
13776 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13777 * Makefile.in: Regenerate.
bb04269c
DK
13778 * i386.cc (class Target_i386): Define new virtual method to
13779 override do_is_local_label_name in parent.
13780 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13781 local symbols if --discard-locals or -X is given.
13782 * options.h (class General_options): Declare new options
13783 '--discard-locals' and '-X' for discarding locals.
13784 * target.h (class Target): Define new methods is_local_label_name.
13785 Declare new virtual method do_is_local_label_name.
13786 * target.cc: New file.
13787 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13788 (check_SCRIPTS): Add discard_locals_test.sh.
13789 (check_DATA): Add discard_local_tests.syms.
13790 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13791 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13792 * testsuite/Makefile.in: Regenerate.
13793 * testsuite/discard_locals_test.c: New file.
13794 * testsuite/discard_locals_test.sh: Same.
13795
805bb01c
DK
137962009-06-05 Doug Kwan <dougkwan@google.com>
13797
13798 * object.cc (Sized_relobj::Sized_relobj): Initialize
13799 discarded_eh_frame_shndx_ to -1U.
13800 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13801 section.
13802 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13803 a discarded .eh_frame section.
13804 (Sized_relobj::do_finalize_local_symbols): Ditto.
13805 * object.h (class Sized_relobj): Declare new member
13806 discarded_eh_frame_shndx_.
13807 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13808 (local_labels_test.o, local_labels_test): New rules.
13809 * testsuite/Makefile.in: Regenerate.
13810
1dcd334d
DK
138112009-06-04 Doug Kwan <dougkwan@google.com>
13812
13813 * layout.cc (Layout::section_name_mapping): Add mapping for
13814 special ARM sections.
13815
96d49306
DK
138162009-06-03 Doug Kwan <dougkwan@google.com>
13817
13818 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13819 (utils::has_overflow): Same.
13820
dff16297
ILT
138212009-06-03 Ian Lance Taylor <iant@google.com>
13822
13823 * layout.cc (Layout::section_name_mapping): New array, replacing
13824 Layout::linkonce_mapping.
13825 (Layout::section_name_mapping_count): New variable, replacing
13826 Layout::linkonce_mapping_count.
13827 (Layout::linkonce_output_name): Remove.
13828 (Layout::output_section_name): Rewrite.
13829 * layout.h (class Layout): Rename Linkonce_mapping to
13830 Section_name_mapping, linkonce_mapping to section_name_mapping,
13831 linkonce_mapping_count to section_name_mapping_count. Don't
13832 declare linkonce_output_name.
13833
c121c671
DK
138342009-06-03 Doug Kwan <dougkwan@google.com>
13835
13836 * gold/arm.cc (namespace utils): New.
13837 (Target_arm::reloc_is_non_pic): Define new method.
13838 (class Arm_relocate_functions): New.
13839 (Target_arm::Relocate::relocate): Handle relocation types used by
13840 Android.
13841
07800fab
ILT
138422009-06-03 Ian Lance Taylor <iant@google.com>
13843
13844 * arm.cc (Target_arm::scan::global): Use || instead of |.
13845
c121c671
DK
138462009-06-02 Doug Kwan <dougkwan@google.com>
13847
13848 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13849 issued_non_pic_error_.
13850 (class Target_arm::Scan): Declare new method check_non_pic.
13851 Define new method symbol_needs_plt_entry.
13852 Declare new data member issued_non_pic_error_.
13853 (class Target_arm::Relocate): Declare new method
13854 should_apply_static_reloc.
13855 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13856 (Target_arm::Scan::check_non_pic): Define new method.
13857 (Target_arm::Scan::local): Handle a small subset of reloc types used
13858 by Android.
13859 (Target_arm::Scan::local): Same.
13860 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13861
b19b0c6d
ILT
138622009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13863
13864 * incremental.cc (Incremental_inputs::report_command_line): Filter
13865 out --incremental-* options.
13866
94cdfcff
DK
138672009-05-29 Doug Kwan <dougkwan@google.com>
13868
13869 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13870 template class.
13871 (class Target_arm): Update comment.
13872 (Target_arm::Target_arm): Initialize new data members GOT_,
13873 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13874 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13875 and Target_arm::rel_dyn_section.
13876 Declare new_enum Target_arm::Got_type.
13877 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13878 and DYNBSS_.
13879 Update commments for member do_dynsym_value.
13880 (Target_arm::got_size, Target_arm::plt_section,
13881 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13882 new methods inside class defintion.
13883 (Target_arm::got_section): Define new method.
13884 (Target_arm::rel_dyn_section): Same.
13885 (Output_data_plt_arm): New template class.
13886 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13887 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13888 (Output_data_plt_arm::add_entry): Same.
13889 (Output_data_plt_arm::first_plt_entry): Define new
13890 static data member for PLT instruction template.
13891 (Output_data_plt_arm::plt_entry): Same.
13892 (Output_data_plt_arm::do_write): Define new method.
13893 (Target_arm::make_plt_entry): Same.
13894 (Target_arm::do_finalize_sections): Same.
13895 (Target_arm::do_dynsym_value): Same.
13896
4a657b0d
DK
138972009-05-28 Doug Kwan <dougkwan@google.com>
13898
13899 * Makefile.am (TARGETSOURCES): Add arm.cc.
13900 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13901 * Makefile.in: Regenerate.
13902 * arm.cc: New file.
13903 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13904
e7ae8c36
DK
139052009-05-26 Doug Kwan <dougkwan@google.com>
13906
13907 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13908 (General_options::check_excluded_libs): Strip off directories in
13909 archive name before matching like GNU ld does.
13910 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13911 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13912 (exclude_libs_test_LDFLAGS): Add linker option
13913 -Wl,--exclude-libs,libexclude_libs_test_3
13914 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13915 an explicit archive without using -l.
13916 (alt/libexclude_libs_test_3.a): New make rule.
13917 * testsuite/Makefile.in: Regenerate.
13918 * testsuite/exclude_libs_test.c : Declare lib3_default().
13919 (main): Call it.
13920 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13921 * exclude_libs_test_3.c: New file.
13922
f12e7348
NC
139232009-05-26 Nick Clifton <nickc@redhat.com>
13924
13925 * po/id.po: New Indonesian translation.
13926 * po/gold.pot: Updated template file.
13927
4daadc0d
ST
139282009-05-22 Sriraman Tallam <tmsriram@google.com>
13929
e1df38aa 13930 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13931 gc_comdat_test files. Add -Wl,--gc-sections to build
13932 gc_comdat_test.
13933 * testsuite/Makefile.in: Regenerate.
13934 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13935
531813ad
ST
139362009-05-21 Sriraman Tallam <tmsriram@google.com>
13937
13938 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13939 kept comdat section was garbage collected.
13940 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13941 * testsuite/Makefile.in: Regenerate.
13942 * testsuite/gc_comdat_test.sh: New file.
13943 * testsuite/gc_comdat_test_1.cc: New file.
13944 * testsuite/gc_comdat_test_2.cc: New file.
13945
65514900
CC
139462009-05-19 Doug Kwan <dougkwan@google.com>
13947
13948 * archive.cc (Archive::Archive): Move constructor from archive.h
13949 to here. Initialize no_export_.
13950 (Archive::get_elf_object_for_member): Set no_export flag of object.
13951 * archive.h (Archive::Archive): Move constructor body to
13952 archive.cc.
13953 (Archive::no_export): New method.
13954 (Archive::no_export_): New field.
13955 * object.h (Object::Object): Initialize no_export_ to false.
13956 (Object::no_export, Object::set_no_export): New methods.
13957 (Object::no_export_): New field.
13958 * options.cc (General_options::parse_exclude_libs): New method.
13959 (General_options::check_excluded_libs) Same.
13960 * options.h (exclude_libs): New option.
13961 (General_options::check_excluded_libs): New method declaration.
13962 (General_options::excluded_libs_): New field.
13963 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13964 default or protected visibility if an object has no-export flag set.
13965 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13966 (check_SCRIPTS): Add exclude_libs_test.sh.
13967 (check_DATA): Add exclude_libs_test.syms.
13968 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13969 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13970 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13971 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13972 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13973 libexclude_libs_test_2.a): New rules.
13974 * testsuite/Makefile.in: Regenerate.
13975 * testsuite/exclude_libs_test.c: New file.
13976 * testsuite/exclude_libs_test.sh: Ditto.
13977 * testsuite/exclude_libs_test_1.c: Ditto.
13978 * testsuite/exclude_libs_test_2.c: Ditto.
13979
1b77ea50
ILT
139802009-05-15 Ian Lance Taylor <iant@google.com>
13981
13982 * configure.ac: Check for declarations for cases where libiberty.h
13983 checks HAVE_DECL_xxx.
13984 * configure, config.in: Rebuild.
13985
072fe7ce
ILT
139862009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13987
13988 * gold.h (Incremental_argument_list): Remove (invalid) forward
13989 declaration.
13990 * incremental.cc (Incremental_inputs::report_achive): New method.
13991 (Incremental_inputs::report_object): New method.
13992 (Incremental_inputs::report_script): New method.
13993 (Incremental_inputs::finalize_inputs): New method.
13994 (Incremental_inputs::finalize): Call finalize_inputs().
13995 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13996 Create inputs entries.
13997 * incremental.h (Incremental_input_type): New enum.
13998 (Incremental_inputs::Incremental_input): Initialize new fields.
13999 (Incremental_inputs::report_inputs): New method.
14000 (Incremental_inputs::report_achive): New method.
14001 (Incremental_inputs::report_object): New method.
14002 (Incremental_inputs::report_script): New method.
14003 (Incremental_inputs::finalize_inputs): New method.
14004 (Incremental_inputs::Input_info): New struct.
14005 (Incremental_inputs::Input_info_map): New typedef.
14006 (Incremental_inputs::lock_): New field.
14007 (Incremental_inputs::Inputs_): New field.
14008 (Incremental_inputs::Inputs_map): New field.
14009 * main.cc (main): Call Incremental_input::report_inputs.
14010 * options.h (Input_argument_list): Typedef moved from
14011 Input_arguments.
14012 (Input_file_group::Files): Remove, use ::Input_argument_list.
14013 (Input_file_group::Input_argument_list): Remove, use
14014 ::Input_argument_list.
14015 * plugin.cc (Plugin_manager::add_input_file): Add error in
14016 incremental build.
14017 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14018 functions.
14019 * script.cc (read_input_script): Call
14020 Incremental_input::report_script.
14021 * script.h (Script_info): New class.
14022
b0481b0b
ILT
140232009-04-27 Ian Lance Taylor <iant@google.com>
14024
14025 * x86_64.cc (do_adjust_output_section): Set entsize to
14026 plt_entry_size.
14027
b22a5a41 140282009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14029
14030 * output.cc (Output_file::close): After short writes, continue
14031 writing from the correct offset in the buffer being written.
14032
40fde488
CD
140332009-04-23 Chris Demetriou <cgd@google.com>
14034
14035 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14036 * configure: Regenerate.
14037 * config.in: Regenerate.
14038 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14039 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14040
3ce2c28e
ILT
140412009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14042
14043 * incremental.cc (Incremental_inputs_header_data): Renamed from
14044 Incremental_input_header_data.
14045 (Incremental_inputs_header_data::data_size): New field.
14046 (Incremental_inputs_header_data::put_input_file_count): Renamed
14047 from input_file_count.
14048 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14049 from command_line_offset.
14050 (Incremental_inputs_header_data::put_reserved): Renamed from
14051 put_reserved.
14052 (Incremental_inputs_entry_data): Renamed from
14053 Incremental_input_entry_data.
14054 (Incremental_inputs_entry_data::data_size): New field.
14055 (Incremental_inputs::report_command_line): New method.
14056 (Incremental_inputs::finalize): New method.
14057 (Incremental_inputs::create_incremental_inputs_data): New method.
14058 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14059 * incremental.h: New file.
14060 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14061 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14062 incremental builds.
703d02da 14063 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14064 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14065 (Layout::create_incremental_info_sections): New method.
14066 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14067 * main.cc (main): Notify Incremental_input of the command line.
14068
e55bde5e
ILT
140692009-04-01 Ian Lance Taylor <iant@google.com>
14070 Mikolaj Zalewski <mikolajz@google.com>
14071
14072 * gold.h (reserve_unordered_map): Define, three versions, one for
14073 each version of Unordered_map.
14074 * layout.cc (Layout::Layout): Remove options parameter. Add
14075 number_of_input_files parameter. Don't initialize options_.
14076 Initialize number_of_input_files_ and resized_signatures_. Move
14077 sections_are_attached_.
14078 (Layout::layout_group): Reserve space for group_signatures_.
14079 (Layout::find_or_add_kept_section): Change name parameter to be a
14080 reference. Resize signatures_ map when it gets large enough.
14081 (Layout::layout_eh_frame): Use parameters->options() instead of
14082 this->options_.
14083 (Layout::make_output_section): Likewise.
14084 (Layout::attach_allocated_section_to_segment): Likewise.
14085 (Layout::finalize, Layout::create_executable_stack): Likewise.
14086 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14087 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14088 * layout.h (class Layout): Update declarations. Remove options_
14089 field. Add number_of_input_files_ and resized_signatures_
14090 fields. Move sections_are_attached_ field.
14091 * main.cc (main): Pass number of input files to Layout
14092 constructor. Don't pass options.
14093
154b857c
ILT
140942009-03-30 Ian Lance Taylor <iant@google.com>
14095
14096 * ffsll.c (ffsll): Correct implementation.
14097
2f35ab9b
ILT
140982009-03-27 Ian Lance Taylor <iant@google.com>
14099
fd03461a
ILT
14100 * ffsll.c: New file.
14101 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14102 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14103 * ftruncate.c (ftruncate): Declare before definition.
14104 * mremap.c (mremap): Likewise.
14105 * pread.c (pread): Likewise.
14106 * configure, Makefile.in, config.in: Rebuild.
14107
2f35ab9b
ILT
14108 * mremap.c: New file.
14109 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14110 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14111 (mremap): Declare if HAVE_MREMAP is not defined.
14112 * configure, Makefile.in, config.in: Rebuild.
14113
33aea2fd
CC
141142009-03-27 Cary Coutant <ccoutant@google.com>
14115
14116 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14117 position independent.
14118 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14119 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14120
6d479619
CC
141212009-03-24 Cary Coutant <ccoutant@google.com>
14122
14123 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14124 an executable.
14125 (needs_dynamic_reloc): Likewise.
14126
afc06bb8
ILT
141272009-03-24 Ian Lance Taylor <iant@google.com>
14128
14129 * yyscript.y (file_cmd): Recognize EXTERN.
14130 (extern_name_list, extern_name_list_body): New nonterminals.
14131 * script.cc (script_add_extern): Define.
14132 * script-c.h (script_add_extern): Declare.
14133
f6060a4d
ILT
141342009-03-24 Rafael Avila de Espindola <espindola@google.com>
14135
14136 * object.cc (is_elf_object): Define.
14137 * object.h (is_elf_object): Declare.
14138 * archive.cc (Archive::get_elf_object_for_member): Call
14139 is_elf_object.
33aea2fd 14140 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14141
26736d8e
ILT
141422009-03-24 Elliott Hughes <enh@google.com>
14143
14144 * output.cc (Output_file::map_anonymous): Define.
14145 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14146 try an anonymous one. Report the size if the mmap fails.
14147 * output.h (class Output_file): Declare map_anonymous.
14148
22fd9730
ILT
141492009-03-24 Ian Lance Taylor <iant@google.com>
14150
14151 * target-select.cc (instantiate_target): Don't acquire the lock if
14152 the instantiated_target_ field has already been set.
14153
cb010894
ILT
141542009-03-23 Ian Lance Taylor <iant@google.com>
14155
7f055c20
ILT
14156 * gold-threads.h (class Initialize_lock): Define.
14157 * gold-threads.cc (class Initialize_lock_once): Define.
14158 (initialize_lock_control): New static variable.
14159 (initialize_lock_pointer): New static variable.
14160 (initialize_lock_once): New static function.
14161 (Initialize_lock::Initialize_lock): Define.
14162 (Initialize_lock::initialize): Define.
14163 * target-select.h: Include "gold-threads.h".
14164 (class Target_selector): Add lock_ and initialize_lock_ fields.
14165 Don't define instantiate_target, just declare it.
14166 * target-select.cc (Target_selector::Target_selector): Initialize
14167 new fields.
14168 (Target_selector::instantiate_target): Define.
14169 * descriptors.h: Include "gold-threads.h".
14170 (class Descriptors): Add initialize_lock_ field.
14171 * descriptors.cc (Descriptors::Descriptors): Initialize new
14172 field.
14173 (Descriptors::open): Use initialize_lock_ field
14174 * errors.h (class Errors): Add initialize_lock_ field.
14175 * errors.cc (Errors::Errors): Initialize new field.
14176 (Errors::initialize_lock): Use initialize_lock_ field.
14177 * powerpc.cc (class Target_selector_powerpc): Remove
14178 instantiated_target_ field. In do_recognize call
14179 instantiate_target rather than do_instantiate_target. In
14180 do_instantiate_target just allocate a new target.
14181 * sparc.cc (class Target_selector_sparc): Likewise.
14182
36959681
ILT
14183 * freebsd.h: New file.
14184 * i386.cc: Include "freebsd.h".
14185 (Target_i386): Derive from Target_freebsd rather than
14186 Sized_target.
14187 (Target_selector_i386): Derive from Target_selector_freebsd rather
14188 than Target_selector.
14189 * x86_64.cc: Include "freebsd.h".
14190 (Target_x86_64): Derive from Target_freebsd rather than
14191 Sized_target.
14192 (Target_selector_x86_64): Derive from Target_selector_freebsd
14193 rather than Target_selector.
14194 * target.h (class Target): Add adjust_elf_header and
14195 do_adjust_elf_header.
14196 * output.cc (Output_file_header:: do_sized_write): Call target
14197 adjust_elf_header routine.
14198 * configure.tgt: Set targ_osabi.
14199 * configure.ac: Define GOLD_DEFAULT_OSABI.
14200 * parameters.cc (Parameters::default_target): Pass
14201 GOLD_DEFAULT_OSABI to select_target.
14202 * target-select.h (class Target_selector): Make instantiate_target
14203 protected rather than private.
14204 * Makefile.am (HFILES): Add freebsd.h.
14205 * configure, Makefile.in, config.in: Rebuild.
14206
cb010894
ILT
14207 * merge.cc (do_add_input_section): Correct pend value. Change
14208 message about last entry not being null terminated from error to
14209 warning.
14210
0e879927
ILT
142112009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14212
14213 * incremental.cc: New file.
14214 * Makefile.am (CCFILES): Add incremental.cc.
14215 * Makefile.in: Rebuild.
14216
41105937
PP
142172009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14218
14219 * layout.cc (Layout::output_section_name): Preserve names
14220 of '.note.' sections.
e1df38aa 14221
60439920
ILT
142222009-03-19 Ian Lance Taylor <iant@google.com>
14223
14224 * descriptors.cc (Descriptors::open): Check that the options are
14225 valid before using them.
14226
0d371ad3
ILT
142272009-03-18 Ian Lance Taylor <iant@google.com>
14228
14229 * script-sections.h: Include <list>.
14230 (class Script_sections): Change Sections_elements from std::vector
14231 to std::list. Typedef public Elements_iterator. Add
14232 orphan_section_placement_, data_segment_align_start_, and
14233 saw_data_segment_align_ fields. Remove data_segment_align_index_
14234 field.
14235 * script-sections.cc (class Orphan_section_placement): New class.
14236 (class Sections_element): Add virtual functions is_relro and
14237 orphan_section_init. Remove virtual function place_orphan_here.
14238 (class Output_section_definition): Add is_relro and
14239 orphan_section_init. Remove place_orphan_here.
14240 (class Orphan_output_section): Likewise.
14241 (Script_sections::Script_sections): Update for field changes.
14242 (Script_sections::data_segment_align): Set saw_data_segment_align_
14243 and data_segment_align_start_, not data_segment_align_index.
14244 (Script_sections::data_segment_relro_end): Check
14245 saw_data_segment_align_. Use data_segment_align_start_ rather
14246 than data_segment_align_index_.
14247 (Script_sections::place_orphan): Rewrite to use
14248 Orphan_section_placement.
14249
9201d894
ILT
142502009-03-17 Ian Lance Taylor <iant@google.com>
14251
9c5b8369
ILT
14252 * archive.cc (Archive::add_symbols): Check for a version attached
14253 to the symbol name in the archive map.
14254 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14255 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14256 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14257 (ver_test_11.a): New target.
14258 * testsuite/Makefile.in: Rebuild.
14259
9201d894
ILT
14260 * configure.ac: Check for chsize and posix_fallocate. Replace
14261 ftruncate.
14262 * ftruncate.c: New file, from gnulib.
14263 * output.cc (posix_fallocate): Define dummy version if not
14264 HAVE_POSIX_FALLOCATE.
14265 (Output_file::map): Call posix_fallocate rather than lseek and
14266 write.
14267 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14268 * configure, Makefile.in, config.in: Rebuild.
14269
ef4ab7a8 142702009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14271
ef4ab7a8
PP
14272 * layout.h (Layout::create_note): Add section_name parameter.
14273 * layout.cc (Layout::create_note): Likewise.
14274 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14275
8c500701
ILT
142762009-03-17 Ian Lance Taylor <iant@google.com>
14277
e85b18e1
ILT
14278 * descriptors.cc: Include "options.h".
14279 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14280 (Descriptors::open): Always use O_CLOEXEC when opening a new
14281 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14282 then set FD_CLOEXEC.
14283
9efe6174
ILT
14284 * sparc.cc (class Target_sparc): Add has_got_section.
14285 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14286 make sure we have a GOT section.
14287
14288 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14289 (Target_sparc::Scan::local): Likewise.
14290 (Target_sparc::Scan::global): Likewise.
14291 (Target_sparc::Relocate::relocate): Likewise.
14292 (Target_sparc::Relocate::relocate_tls): Likewise.
14293
8c500701
ILT
14294 * symtab.cc (Symbol_table::define_default_version): New function,
14295 broken out of add_from_object.
14296 (Symbol_table::add_from_object): Call define_default_version.
14297 (Symbol_table::define_special_symbol): Add resolve_oldsym
14298 parameter. Change all callers. If the version for a symbol comes
14299 from a version script, resolve it with the symbol with the same
14300 name with no version. Also add the symbol without a version if
14301 appropriate.
14302 (do_define_in_output_data): If resolving with oldsym, don't delete
14303 sym.
14304 (do_define_in_output_segment): Likewise.
14305 (do_define_as_constant): Likewise.
14306 * symtab.h (class Symbol_table): Update declarations.
14307
f1ed28fb
ILT
143082009-03-13 Ian Lance Taylor <iant@google.com>
14309
15f8229b
ILT
14310 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14311 (Read_symbols::requeue): New function.
14312 (Read_symbols::do_read_symbols): If make_elf_object fails because
14313 the target type is not configured, and the file was searched for,
14314 issue a warning and retry with the next directory.
14315 (Add_symbols::run): If the file has an incompatible format, and
14316 it was searched for, requeue the Read_symbols task. On error,
14317 release the object.
14318 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14319 dirindex parameter to constructor. Change all callers. Declare
14320 incompatible_warning and requeue.
14321 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14322 input_argument_ and input_group_ fields. Add them to
14323 constructor. Change all callers.
14324 (class Read_script): Add dirindex_ field. Add it to constructor.
14325 Change all callers.
14326 * archive.cc (Archive::setup): Remove input_objects parameter.
14327 Change all callers.
14328 (Archive::get_file_and_offset): Likewise.
14329 (Archive::read_all_symbols): Likewise.
14330 (Archive::read_symbols): Likewise.
14331 (Archive::get_elf_object_for_member): Remove input_objects
14332 parameter. Add punconfigured parameter. Change all callers.
14333 (Archive::add_symbols): Change return type to bool. Check return
14334 value of include_member.
14335 (Archive::include_all_members): Likewise.
14336 (Archive::include_member): Change return type to bool. Return
14337 false if first included object has incompatible target. Set
14338 included_member_ field.
14339 (Add_archive_symbols::run): If add_symbols returns false, requeue
14340 Read_symbols task.
14341 * archive.h (class Archive): Add included_member_ field.
14342 Initialize it in constructor. Add input_file and searched_for
14343 methods. Update declarations.
14344 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14345 input_argument_ fields. Add them to constructor. Change all
14346 callers.
14347 * script.cc: Include "target-select.h".
14348 (class Parser_closure): Add skip_on_incompatible_target_ and
14349 found_incompatible_target_ fields. Add
14350 skip_on_incompatible_target parameter to constructor. Change all
14351 callers. Add methods skip_on_incompatible_target,
14352 clear_skip_on_incompatible_target, found_incompatible_target, and
14353 set_found_incompatible_target.
14354 (read_input_script): Add dirindex parameter. Change all callers.
14355 If parser finds an incompatible target, requeue Read_symbols
14356 task.
14357 (script_set_symbol): Clear skip_on_incompatible_target in
14358 closure.
14359 (script_add_assertion, script_parse_option): Likewise.
14360 (script_start_sections, script_add_phdr): Likewise.
14361 (script_check_output_format): New function.
14362 * script.h (read_input_script): Update declaration.
14363 * script-c.h (script_check_output_format): Declare.
14364 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14365 (ignore_cmd): Remove OUTPUT_FORMAT.
14366 * fileread.cc (Input_file::Input_file): Add explicit this.
14367 (Input_file::will_search_for): New function.
14368 (Input_file::open): Add pindex parameter. Change all callers.
14369 * fileread.h (class Input_file): Add input_file_argument method.
14370 Declare will_search_for. Update declarations.
14371 * object.cc (make_elf_object): Add punconfigured parameter.
14372 Change all callers.
14373 * object.h (class Object): Make input_file public. Add
14374 searched_for method.
14375 (make_elf_object): Update declaration.
14376 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14377 restart search.
14378 * dirsearch.h (class Dirsearch): Update declaration.
14379 * options.h (class General_options): Add --warn-search-mismatch.
14380 * parameters.cc (Parameters::is_compatible_target): New function.
14381 * parameters.h (class Parameters): Declare is_compatible_target.
14382 * workqueue.cc (Workqueue::add_blocker): New function.
14383 * workqueue.h (class Workqueue): Declare add_blocker.
14384
f1ed28fb
ILT
14385 * fileread.cc (Input_file::open): Remove options parameter.
14386 Change all callers.
14387 (Input_file::open_binary): Likewise.
14388 * script.cc (read_input_script): Likewise.
14389 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14390 options parameter from constructor. Change all callers.
14391 (class Read_script): Likewise.
14392 * fileread.h (class Input_file): Update declarations.
14393 * script.h (read_input_script): Update declaration.
14394
34dd024a
NC
143952009-03-10 Nick Clifton <nickc@redhat.com>
14396
14397 * po/es.po: New Spanish translation.
14398
6d71b17c
CC
143992009-03-06 Cary Coutant <ccoutant@google.com>
14400
14401 * options.cc (parse_short_option): Keep dash_z from registering itself.
14402
031cdbed
ILT
144032009-03-03 Ian Lance Taylor <iant@google.com>
14404
14405 PR 9918
14406 * target-reloc.h (relocate_section): Pass output_section to
14407 relocate.
14408 * i386.cc (Target_i386::should_apply_static_reloc): Add
14409 output_section parameter. Change all callers.
14410 (Target_i386::Relocate::relocate): Add output_section parameter.
14411 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14412 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14413 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14414 * testsuite/two_file_shared.sh: New script.
14415 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14416 (check_DATA): Add two_file_shared.dbg.
14417 (two_file_shared.dbg): New target.
14418 * testsuite/Makefile.in: Rebuild.
14419
15d5fa16
ILT
144202009-03-01 Ian Lance Taylor <iant@google.com>
14421
14422 * configure.ac: Check for byteswap.h.
14423 * configure: Rebuild.
14424 * config.in: Rebuild.
14425
8a4c0b0d
ILT
144262009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14427
14428 * layout.cc (Layout::find_or_add_kept_section): New function.
14429 (Layout::add_comdat): Removed.
14430 * layout.h (struct Kept_section): Move out of class Layout.
14431 Remove trailing underscores from field names. Add group_sections
14432 field. Rename group_ field to is_group. Change all uses.
14433 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14434 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14435 comdat_groups_ field.
14436 (Sized_relobj::include_section_group): Use
14437 find_or_add_kept_section and Kept_section::group_sections.
14438 (Sized_relobj::include_linkonce_section): Likewise.
14439 * object.cc (class Sized_relobj): Don't define Comdat_group or
14440 Comdat_group_table. Remove find_comdat_group and
14441 add_comdat_group. Remove comdat_groups_ field.
14442 * plugin.cc (include_comdat_group): Use
14443 Layout::find_or_add_kept_section.
14444
b4ecf66b
ILT
144452009-02-28 Ian Lance Taylor <iant@google.com>
14446
14359ca0
ILT
14447 * README: --gc-sections and map files are now supported. Document
14448 some build requirements.
14449
b4ecf66b
ILT
14450 PR 6992
14451 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14452 relocatable link set the value of the section symbol to zero.
14453 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14454 relocatable link don't include the section address in the local
14455 symbol value.
14456
0602e05a
ILT
144572009-02-27 Ian Lance Taylor <iant@google.com>
14458
fd9d194f
ILT
14459 PR 6811
14460 * options.h (class Search_directory): Add is_system_directory.
14461 (class General_options): Declare is_in_system_directory.
14462 * options.cc (get_relative_sysroot): Make static.
14463 (get_default_sysroot): Make static.
14464 (General_optoins::is_in_system_directory): New function.
14465 * fileread.cc (Input_file::is_in_system_directory): New function.
14466 * fileread.h (class Input_file): Declare is_in_system_directory.
14467 * object.h (class Object): Add is_in_system_directory.
14468 (class Input_objects): Remove system_library_directory_ field.
14469 * object.cc (Input_objects::add_object): Don't set
14470 system_library_directory_.
14471 (input_objects::found_in_system_library_directory): Remove.
14472 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14473 parameter. Change all callers.
14474 (Symbol_table::sized_write_globals): Likewise.
14475 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14476 Call Object::is_in_system_directory.
14477 * symtab.h (class Symbol_table): Update declarations.
14478
61edd21f
ILT
14479 PR 5990
14480 * descriptors.h (Open_descriptor): Add is_on_stack field.
14481 * descriptors.cc (Descriptors::open): If the descriptor is on the
14482 top of the stack, remove it. Initialize is_on_stack field.
14483 (Descriptors::release): Only add pod to stack if it is not on the
14484 stack already.
14485 (Descriptors::close_some_descriptor): Clear stack_next and
14486 is_on_stack fields.
14487
e29e076a
ILT
14488 PR 7091
14489 * output.cc (Output_section::find_starting_output_address): Rename
14490 from starting_output_address; add PADDR parameter; change return
14491 type.
14492 * output.h (class Output_section): Declare
14493 find_starting_output_address instead of starting_output_address.
14494 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14495 section symbol for which we can't find a merge section.
14496
0602e05a
ILT
14497 PR 9836
14498 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14499 hidden or internal, force the symbol to be local.
14500 * resolve.cc (Symbol::override_visibility): Define.
14501 (Symbol::override_base): Use override_visibility.
14502 (Symbol_table::resolve): Likewise.
14503 (Symbol::override_base_with_special): Likewise.
14504 (Symbol_table::override_with_special): If the visibility is hidden
14505 or internal, force the symbol to be local.
14506 * symtab.h (class Symbol): Add set_visibility and
14507 override_visibility.
14508 * testsuite/ver_test_1.sh: New file.
14509 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14510 (check_DATA): Add ver_test_1.syms.
14511 (ver_test_1.syms): New target.
14512 * testsuite/Makefile.in: Rebuild.
14513
401a9a73
CC
145142009-02-25 Cary Coutant <ccoutant@google.com>
14515
14516 * layout.cc (Layout::choose_output_section): Don't rename sections
14517 when using a linker script that has a SECTIONS clause.
14518 * Makefile.in: Regenerate.
14519
14520 * testsuite/Makefile.am (script_test_5.sh): New test case.
14521 * testsuite/Makefile.in: Regenerate.
14522 * testsuite/script_test_5.cc: New file.
14523 * testsuite/script_test_5.sh: New file.
14524 * testsuite/script_test_5.t: New file.
14525
f488e4b0
CC
145262009-02-13 Rafael Avila de Espindola <espindola@google.com>
14527
14528 * archive.cc (Archive::include_member): Update calls to add_symbols.
14529 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14530 the Layout argument.
14531 * dynobj.h (do_add_symbols): Add the Layout argument.
14532 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14533 Layout argument.
14534 * object.h (Object::add_symbols): Add the Layout argument.
14535 (Object::do_add_symbols): Add the Layout argument.
14536 (Sized_relobj::do_add_symbols): Add the Layout argument.
14537 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14538 Unify the two versions.
14539 (Add_plugin_symbols): Remove.
14540 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14541 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14542 (Add_plugin_symbols): Remove.
14543 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14544 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14545 (Add_symbols::run): Make it work with Pulginobj.
14546
89dd1680
ILT
145472009-02-06 Ian Lance Taylor <iant@google.com>
14548
14549 * object.cc (Sized_relobj::do_layout): Make info message start
14550 with lower case letter.
14551
266d0a74
ILT
145522009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14553
602b464e
ILT
14554 * binary.cc: Fix file comment.
14555
266d0a74
ILT
14556 * options.h (enum Incremental_disposition): Define.
14557 (class General_options): Add new options: --incremental,
14558 --incremental_changed, --incremental_unchanged,
14559 --incremental_unknown. Add incremental_disposition_ and
14560 implicit_incremental_ fields.
14561 (General_options::incremental_disposition): New function.
14562 (class Position_dependent_options): Add incremental_disposition
14563 option.
14564 (Position_dependent_options::copy_from_options): Set incremental
14565 dispositions.
14566 * options.cc (General_options::parse_incremental_changed): New
14567 function.
2e702c99
RM
14568 (General_options::parse_incremental_unchanged): New function.
14569 (General_options::parse_incremental_unknown): New function.
14570 (General_options::General_options): Initialize new fields
266d0a74 14571 incremental_disposition_ and implicit_incremental_.
2e702c99 14572 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14573 without --incremental.
14574
f073bbf7
CD
145752009-02-06 Chris Demetriou <cgd@google.com>
14576
14577 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14578 pointer and to report location as the file name associated with
14579 the symbol.
14580 (gold_undefined_symbol_at_location): New function to replace the
14581 old gold_undefined_symbol functionality.
14582 * target-reloc.h (relocate_section): Update to use
14583 gold_undefined_symbol_at_location.
14584 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14585 Call gold_undefined_symbol function rather than gold_error.
14586 * errors.h (Errors::undefined_symbol): Take location as a
14587 string, rather than calculating it from a relocation.
14588 * errors.cc (Errors::fatal): Print "fatal error:" before the
14589 formatted message.
14590 (Errors::error, Errors::error_at_location): Print "error: "
14591 before the formatted message.
14592 (Errors::undefined_symbol): Take location as a string, rather
14593 than calculating it from a relocation.
14594 (gold_undefined_symbol_at_location): New function akin to
14595 old gold_undefined_symbol, calculates location from relocation.
14596 (gold_undefined_symbol): Change to take only a Symbol pointer
14597 and to report location as the file name associated with the symbol.
14598 * testsuite/debug_msg.sh: Update for changed error messages.
14599 * testsuite/undef_symbol.sh: Likewise.
14600
8e94a90c
ILT
146012009-02-04 Duncan Sands <baldrick@free.fr>
14602
14603 PR 9812
14604 * reduced_debug_output.h
14605 (Output_reduced_debug_abbrev_section::failed): Use format for
14606 gold_warning.
14607 (Output_reduced_debug_info_section::faild): Likewise.
14608
88a0e15b
ILT
146092009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14610
14611 * script.cc (Lazy_demangler): New class.
2e702c99 14612 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14613 symbol only once.
14614
5efc7cd2
CC
146152009-01-29 Cary Coutant <ccoutant@google.com>
14616
14617 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14618 to __tls_get_addr.
14619 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14620
e0ebcf42
ILT
146212009-01-28 Ian Lance Taylor <iant@google.com>
14622
5efc7cd2 14623 * version.cc (version_string): Bump to 1.9.
75fe7426 14624
e0ebcf42
ILT
14625 * gold.h: Include <cstring> and <stdint.h>.
14626 * version.cc: Include <cstdio>.
14627 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14628 warning.
14629 * reduced_debug_output.cc (insert_into_vector): Rename from
14630 Insert_into_vector; change all callers. Use Swap_unaligned to
14631 avoid aliasing issue; remove union since it is unnecessary.
14632
8e2813be 146332009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14634
14635 * Makefile.am (CCFILES): Add gc.cc.
14636 (HFILES): Add gc.h.
14637 * Makefile.in: Regenerate.
14638 * gold.cc (Gc_runner): New class.
14639 (queue_initial_tasks): Call garbage collection related tasks
14640 when corresponding options are invoked.
14641 (queue_middle_gc_tasks): New function.
14642 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14643 processed early before laying out sections during garbage collection.
14644 * gold.h (queue_middle_gc_tasks): New function.
14645 (is_prefix_of): Move from "layout.cc".
14646 * i386.cc (Target_i386::gc_process_relocs): New function.
14647 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14648 * main.cc (main): Create object of class "Garbage_collection".
14649 * object.cc (Relobj::copy_symbols_data): New function.
14650 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14651 (Sized_relobj::do_layout): Allow this function to be called twice
14652 during garbage collection and defer layout of section during the
6d03d481
ST
14653 first call.
14654 * object.h (Relobj::get_symbols_data): New function.
14655 (Relobj::is_section_name_included): New function.
14656 (Relobj::copy_symbols_data): New function.
14657 (Relobj::set_symbols_data): New function.
14658 (Relobj::get_relocs_data): New function.
14659 (Relobj::set_relocs_data): New function.
14660 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14661 (Relobj::gc_process_relocs): New function.
14662 (Relobj::do_gc_process_relocs): New pure virtual function.
14663 (Relobj::sd_): New data member.
14664 (Sized_relobj::is_output_section_offset_invalid): New function.
14665 (Sized_relobj::do_gc_process_relocs): New function.
14666 * options.h (General_options::gc_sections): Modify to not be a no-op.
14667 (General_options::print_gc_sections): New option.
14668 * plugin.cc (Plugin_finish::run): Remove function call to
14669 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14670 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14671 * reloc.cc (Read_relocs::run): Add task to process relocs and
14672 determine unreferenced sections when doing garbage collection.
14673 (Gc_process_relocs): New class.
14674 (Sized_relobj::do_gc_process_relocs): New function.
14675 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14676 sections that are garbage collected.
14677 * reloc.h (Gc_process_relocs): New class.
14678 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14679 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14680 symbols whose corresponding sections are garbage collected.
14681 (Symbol_table::Symbol_table): Add new parameter for the garbage
14682 collection object.
14683 (Symbol_table::gc_mark_undef_symbols): New function.
14684 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14685 (Symbol_table::gc_mark_dyn_syms): New function.
14686 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14687 as garbage.
14688 (Symbol_table::add_from_object): Likewise.
14689 (Symbol_table::add_from_relobj): When building shared objects, do not
14690 treat externally visible symbols as garbage.
14691 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14692 table information for static and relocatable links.
14693 * symtab.h (Symbol_table::set_gc): New function.
14694 (Symbol_table::gc): New function.
14695 (Symbol_table::gc_mark_undef_symbols): New function.
14696 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14697 (Symbol_table::gc_mark_dyn_syms): New function.
14698 (Symbol_table::gc_): New data member.
e1df38aa 14699 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14700 function.
14701 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14702 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14703
3b293544
CF
147042009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14705
14706 * options.h (General_options::gc_sections): Define as a no-op for now.
14707 (General_options::no_keep_memory): Ditto.
14708 (General_options::Bshareable): Define.
14709 * options.cc (General_options::finalize): Honor -Bshareable.
14710
83d22aa8
AS
147112009-01-20 Andreas Schwab <schwab@suse.de>
14712
14713 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14714 read the value in the contents, since we don't use it. Use the
14715 template endianness when writing.
14716 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14717
cd536b21
AS
147182009-01-19 Andreas Schwab <schwab@suse.de>
14719
14720 * configure.tgt (powerpc64-*): Fix targ_obj.
14721
99e9a495
ILT
147222009-01-15 Ian Lance Taylor <iant@google.com>
14723
14724 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14725 local symbols when stripping all symbols.
14726
bbbfea06
CC
147272009-01-14 Cary Coutant <ccoutant@google.com>
14728
99e9a495 14729 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14730
0f7c0701
CC
147312009-01-14 Cary Coutant <ccoutant@google.com>
14732
14733 * archive.cc (Archive::get_elf_object_for_member): Remove call
14734 to File_read::claim_for_plugin.
14735 * descriptors.cc (Descriptors::open): Remove reference to
14736 is_claimed.
14737 (Descriptors::claim_for_plugin): Remove.
14738 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14739 (Descriptors::is_claimed): Remove.
14740 (claim_descriptor_for_plugin): Remove.
14741 * fileread.cc (File_read::claim_for_plugin): Remove.
14742 * fileread.h (File_read::claim_for_plugin): Remove.
14743 (File_read::descriptor): Reopen descriptor if necessary.
14744 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14745 (Plugin_manager::all_symbols_read): Add task parameter. Change
14746 all callers.
14747 (Plugin_manager::get_input_file): New function.
14748 (Plugin_manager::release_input_file): New function.
14749 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14750 corresponding data member.
14751 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14752 and pass to base constructor. Change all callers.
14753 (get_input_file, release_input_file): New functions.
14754 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14755 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14756 (Plugin_manager::all_symbols_read): Add task parameter.
14757 (Plugin_manager::get_input_file): New function.
14758 (Plugin_manager::release_input_file): New function.
14759 (Plugin_manager::task_): New data member.
14760 (Pluginobj::Pluginobj): Add filesize parameter.
14761 (Pluginobj::filename): New function.
14762 (Pluginobj::descriptor): New function.
14763 (Pluginobj::filesize): New function.
14764 (Pluginobj::filesize_): New data member.
14765 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14766 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14767 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14768
14769 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14770 with archive libraries.
14771 * testsuite/Makefile.in: Regenerate.
14772 * testsuite/plugin_test.c (struct sym_info): New type.
14773 (get_input_file, release_input_file): New static variables.
14774 (onload): Capture new transfer vector entries.
14775 (claim_file_hook): Stop reading at end of file according to filesize.
14776 Factor out parsing of readelf output into separate function.
14777 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14778 APIs and get the source file name from the symbol table. Convert
14779 source file name to corresponding object file name. Print info
14780 message when adding new input files.
14781 (parse_readelf_line): New function.
14782 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14783 * testsuite/plugin_test_2.sh: Likewise.
14784 * testsuite/plugin_test_3.sh: Likewise.
14785 * testsuite/plugin_test_4.sh: New test case.
14786
62a6d109
ILT
147872009-01-07 Ian Lance Taylor <iant@google.com>
14788
14789 * version.cc (version_string): Bump to 1.8.
14790
483620e8
CC
147912008-12-23 Cary Coutant <ccoutant@google.com>
14792
14793 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14794 * plugin.cc (Plugin_manager::finish): Rename as
14795 layout_deferred_objects. Move cleanup to separate function.
14796 (Plugin_manager::cleanup): New function.
14797 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14798 separately.
14799 * plugin.h (Plugin_manager::finish): Rename as
14800 layout_deferred_objects.
14801 (Plugin_manager::cleanup): New function.
14802 (Plugin_manager::cleanup_done): New field.
14803
d66a9eb3
CC
148042008-12-23 Cary Coutant <ccoutant@google.com>
14805
14806 * plugin.cc (is_visible_from_outside): New function.
14807 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14808 so we don't return "IR only" status for exported symbols or -r links.
14809
14810 * testsuite/Makefile.am (plugin_test_3): New test case.
14811 * testsuite/Makefile.in: Regenerate.
14812 * testsuite/plugin_test_3.sh: New file.
14813
5995b570
CC
148142008-12-22 Cary Coutant <ccoutant@google.com>
14815
14816 * object.cc (Sized_relobj::layout_section): New function.
14817 (Sized_relobj::do_layout): Defer layout of input sections until after
14818 plugin has provided replacement files.
14819 (Sized_relobj::do_layout_deferred_sections): New function.
14820 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14821 (Relobj::layout_deferred_sections): New function.
14822 (Relobj::do_layout_deferred_sections): New function.
14823 (Sized_relobj::do_layout_deferred_sections): New function.
14824 (Sized_relobj::layout_section): New function.
14825 (Sized_relobj::Deferred_layout): New structure.
14826 (Sized_relobj::deferred_layout_): New field.
14827 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14828 Change all callers. Layout deferred sections.
14829 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14830 references.
14831 (Plugin_hook::run): Move code from do_plugin_hook inline.
14832 (Plugin_hook::do_plugin_hook): Remove.
14833 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14834 (Plugin_manager::finish): Renamed, was cleanup.
14835 (Plugin_manager::should_defer_layout): New function.
14836 (Plugin_manager::add_deferred_layout_object): New function.
14837 (Plugin_manager::Deferred_layout_list): New type.
14838 (Plugin_manager::deferred_layout_objects_): New field.
14839 (Plugin_hook::do_plugin_hook): Remove.
14840
ee769c88
ILT
148412008-12-17 Ian Lance Taylor <iant@google.com>
14842
14843 * options.h (class General_options): Add --no case for
14844 --export-dynamic.
14845
abc8dcba
CC
148462008-12-16 Cary Coutant <ccoutant@google.com>
14847
14848 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14849 vector.
14850 (Plugin_manager::claim_file): Create plugin object even if
14851 plugin did not call the add_symbols callback.
14852 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14853 asking for more symbols than were added.
14854 * testsuite/Makefile.am (plugin_test_1): Add test case with
14855 no global symbols.
14856 (empty.syms): New target.
14857 * testsuite/Makefile.in: Regenerate.
14858 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14859 message. Don't call add_symbols if no globals.
14860 (all_symbols_read_hook): Don't provide replacement for empty
14861 claimed file.
14862
b0074644
ILT
148632008-12-12 Ian Lance Taylor <iant@google.com>
14864
68943102
ILT
14865 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14866 r_type == 0 for a local symbol with r_sym == 0.
14867 (scan_relocatable_relocs): Pass r_sym to
14868 local_non_section_strategy.
14869 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14870 r_sym parameter.
14871
b0074644
ILT
14872 * configure.ac: Update test for TLS descriptors: they are
14873 supported as of glibc 2.9.
14874 * configure: Rebuild.
14875
c2508178
ILT
148762008-12-11 Ian Lance Taylor <iant@google.com>
14877
14878 PR 7091
14879 * target-reloc.h (Default_scan_relocatable_relocs): For each
14880 function, map r_type == 0 to RELOC_DISCARD.
14881
2756a258
CC
148822008-12-10 Cary Coutant <ccoutant@google.com>
14883
14884 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14885 object to override a kept COMDAT group from a plugin object.
14886
bb6f53d3
ILT
148872008-12-09 Ian Lance Taylor <iant@google.com>
14888
fbc558e1
ILT
14889 PR 7088
14890 * yyscript.y (file_cmd): Handle INPUT.
14891
bb6f53d3
ILT
14892 * testsuite/initpri1.c: Change all declarations to be full
14893 prototypes by adding void, to avoid compiler warnings.
14894
4674ecfc
CC
148952008-12-05 Rafael Avila de Espindola <espindola@google.com>
14896
14897 * options.cc (General_options::parse_plugin_opt): New.
14898 (General_options::add_plugin): The argument now is just the filename.
14899 (General_options::add_plugin_option): New.
14900 * options.h (plugin_opt): New.
14901 (add_plugin): Change argument name.
14902 (add_plugin_option): New.
14903 * plugin.cc (Plugin::load): Don't parse the plugin option.
14904 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14905 (Plugin::add_option): New.
14906 (Plugin::args_): Change type.
14907 (Plugin::filename_): New.
14908 (Plugin_manager::add_plugin_option): New.
14909 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14910 * testsuite/Makefile.in: Regenerate.
14911
fd06b4aa
CC
149122008-12-05 Cary Coutant <ccoutant@google.com>
14913
14914 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14915 Handle --strip-lto-sections option.
14916 * options.h (strip_lto_sections): New option.
14917
6c52134c
CC
149182008-12-01 Cary Coutant <ccoutant@google.com>
14919
14920 * plugin.cc (ld_plugin_message): Change format parameter to const.
14921 Fix mismatch between new[] and delete.
14922
a45248e0
CC
149232008-11-14 Cary Coutant <ccoutant@google.com>
14924
14925 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14926 instead of -1U.
14927
c82fbeee
CS
149282008-11-05 Craig Silverstein <csilvers@google.com>
14929
14930 * options.cc (General_options::parse_dynamic_list): New function.
14931 * options.h (General_options): New flags dynamic_list,
14932 dynamic_list_data, dynamic_list_cpp_new, and
14933 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14934 (General_options::in_dynamic_list): New function.
14935 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14936 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14937 (Lex::can_continue_name): Likewise.
14938 (yylex): Likewise.
14939 (read_script_file): New parameter script_options.
14940 (read_dynamic_list): New function.
14941 (Script_options::define_dynamic_list): New function.
14942 (dynamic_list_keyword_parsecodes): New variable.
14943 (dynamic_list_keywords): New variable.
14944 * script.h (Script_options::define_dynamic_list): New function
14945 prototype.
14946 (read_dynamic_list): New function prototype.
14947 * symtab.cc (strprefix): New macro.
14948 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14949 dynamic_list_data, dynamic_list_cpp_new, and
14950 dynamic_list_cpp_typeinfo.
14951 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14952 (dynamic_list_expr): New rule.
14953 (dynamic_list_nodes): Likewise.
14954 (dynamic_list_node): Likewise.
14955 * testsuite/Makefile.am (dynamic_list): New test.
14956 * testsuite/Makefile.in: Regenerated.
14957 * testsuite/dynamic_list.t: New file.
14958 * testsuite/dynamic_list.sh: New file.
14959
e0bb29a5
CS
149602008-11-05 Craig Silverstein <csilvers@google.com>
14961
14962 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14963 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14964 (t11_last): Likewise.
14965 * testsuite/ver_test_6.c (main): Likewise.
14966
4e1e25e0
CC
149672008-10-07 Cary Coutant <ccoutant@google.com>
14968
14969 * options.c (General_options::finalize): Add check for -static and
14970 -shared.
14971 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14972 is not empty.
14973
92f03fcb
CC
149742008-10-02 Cary Coutant <ccoutant@google.com>
14975
14976 * plugin.cc (make_sized_plugin_object): Fix conditional
14977 compilation to work when not all targets are enabled.
14978
fbd8a257
CC
149792008-09-29 Cary Coutant <ccoutant@google.com>
14980
14981 * archive.cc (Archive::get_file_and_offset): Use filename instead
14982 of name to get library path.
14983 (Archive::include_member): Unlock external member of a thin archive.
14984
14985 * testsuite/Makefile.am (TEST_AR): New variable.
14986 (thin_archive_test_1): New test.
14987 (thin_archive_test_2): New test.
81636b3f
CC
14988 * testsuite/Makefile.in: Regenerate.
14989 * testsuite/thin_archive_main.cc: New file.
14990 * testsuite/thin_archive_test_1.cc: New file.
14991 * testsuite/thin_archive_test_2.cc: New file.
14992 * testsuite/thin_archive_test_3.cc: New file.
14993 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14994
eff45813
CC
149952008-09-29 Cary Coutant <ccoutant@google.com>
14996
14997 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14998 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14999 instead of -1U.
15000 (Sized_relobj::do_finalize_local_symbols): Likewise.
15001 (Sized_relobj::map_to_kept_section): Likewise.
15002 * object.h (Sized_relobj::invalid_address): New constant.
15003 (Sized_relobj::do_output_section_offset): Check for invalid_address
15004 and return -1ULL.
15005 * output.cc (Output_reloc::local_section_offset): Use constant
15006 invalid_address instead of -1U.
15007 (Output_reloc::get_address): Likewise.
15008 (Output_section::output_address): Change -1U to -1ULL.
15009 * output.h (Output_reloc::invalid_address): New constant.
15010 * reloc.cc (Sized_relobj::write_sections): Use constant
15011 invalid_address instead of -1U.
15012 (Sized_relobj::relocate_sections): Likewise.
15013 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15014 values for merge sections.
15015 * target-reloc.h (relocate_for_relocatable): Use constant
15016 invalid_address instead of -1U.
15017
89fc3421
CC
150182008-09-19 Cary Coutant <ccoutant@google.com>
15019
15020 Add plugin functionality for link-time optimization (LTO).
15021 * configure.ac (plugins): Add --enable-plugins option.
15022 * configure: Regenerate.
15023 * config.in: Regenerate.
15024 * Makefile.am (LIBDL): New variable.
15025 (CCFILES): Add plugin.cc.
15026 (HFILES): Add plugin.h.
15027 (ldadd_var): Add LIBDL.
15028 * Makefile.in: Regenerate.
15029
15030 * archive.cc: Include "plugin.h".
15031 (Archive::setup): Don't preread archive symbols when using a plugin.
15032 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15033 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15034 files.
15035 (Archive::include_member): Add symbols from plugin objects.
15036 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15037 * descriptors.cc (Descriptors::open): Check for file descriptors
15038 abandoned by plugins.
15039 (Descriptors::claim_for_plugin): New function.
15040 * descriptors.h (Descriptors::claim_for_plugin): New function.
15041 (Open_descriptor::is_claimed): New field.
15042 (claim_descriptor_for_plugin): New function.
15043 * fileread.cc (File_read::claim_for_plugin): New function.
15044 * fileread.h (File_read::claim_for_plugin): New function.
15045 (File_read::descriptor): New function.
15046 * gold.cc: Include "plugin.h".
15047 (queue_initial_tasks): Add task to call plugin hooks for generating
15048 new object files.
15049 * main.cc: Include "plugin.h".
15050 (main): Load plugin libraries.
15051 * object.h (Pluginobj): Declare.
15052 (Object::pluginobj): New function.
15053 (Object::do_pluginobj): New function.
15054 (Object::set_target): New function.
15055 * options.cc: Include "plugin.h".
15056 (General_options::parse_plugin): New function.
15057 (General_options::General_options): Initialize plugins_ field.
15058 (General_options::add_plugin): New function.
15059 * options.h (Plugin_manager): Declare.
15060 (General_options): Add --plugin option.
15061 (General_options::has_plugins): New function.
15062 (General_options::plugins): New function.
15063 (General_options::add_plugin): New function.
15064 (General_options::plugins_): New field.
15065 * plugin.cc: New file.
15066 * plugin.h: New file.
15067 * readsyms.cc: Include "plugin.h".
15068 (Read_symbols::do_read_symbols): Check for archive before checking
15069 for ELF file. Call plugin hooks to claim files.
15070 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15071 from a real object file; force override when processing replacement
15072 files.
15073 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15074 (Symbol::init_base_object): Likewise.
15075 (Symbol::init_base_output_data): Likewise.
15076 (Symbol::init_base_output_segment): Likewise.
15077 (Symbol::init_base_constant): Likewise.
15078 (Symbol::init_base_undefined): Likewise.
15079 (Symbol::output_section): Assert that object is not a plugin.
15080 (Symbol_table::add_from_pluginobj): New function.
15081 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15082 undefined.
15083 (Symbol_table::sized_write_globals): Likewise.
15084 (Symbol_table::add_from_pluginobj): Instantiate template.
15085 * symtab.h (Sized_pluginobj): Declare.
15086 (Symbol::in_real_elf): New function.
15087 (Symbol::set_in_real_elf): New function.
15088 (Symbol::in_real_elf_): New field.
15089 (Symbol_table::add_from_pluginobj): New function.
15090
15091 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15092 (LIBDL): New variable.
15093 (LDADD): Add LIBDL.
15094 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15095 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15096 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15097 (MOSTLYCLEANFILES): Likewise.
15098 * testsuite/Makefile.in: Regenerate.
15099 * testsuite/plugin_test.c: New file.
15100 * testsuite/plugin_test_1.sh: New file.
15101 * testsuite/plugin_test_2.sh: New file.
15102
de31bda5
ILT
151032008-09-16 Ian Lance Taylor <iant@google.com>
15104
9c2d0ef9
ILT
15105 * target-reloc.h (relocate_section): Check whether a symbol is
15106 defined by the ABI before reporting an undefined symbol error.
15107 * target.h (Target::is_defined_by_abi): Make parameter const.
15108 (Target::do_is_defined_by_abi): Likewise.
15109 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15110 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15111 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15112 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15113 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15114 * testsuite/Makefile.in: Rebuild.
15115
de31bda5
ILT
15116 * fileread.cc (make_view): Add casts to avoid warning.
15117
9fa33bee
AO
151182008-09-16 Alexandre Oliva <aoliva@redhat.com>
15119
15120 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15121 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15122
183fd0e3
AO
151232008-09-16 Alexandre Oliva <aoliva@redhat.com>
15124
15125 * options.h (General_options::output_is_executable): New.
15126 (General_options::output_is_pie): New.
15127 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15128 for shared libraries.
15129 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15130
7be8330a
CD
151312008-09-11 Chris Demetriou <cgd@google.com>
15132
15133 * options.h (origin): New -z option.
15134 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15135 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15136 in DT_FLAGS_1.
15137
a9caad02
CC
151382008-09-05 Cary Coutant <ccoutant@google.com>
15139
15140 * fileread.cc (File_read::make_view): Add check for attempt to map
15141 beyond end of file.
15142
ae6dce4d
CC
151432008-09-05 Cary Coutant <ccoutant@google.com>
15144
15145 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15146 explicit instantiations.
15147
d7ab2a47
KVH
151482008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15149
15150 PR gold/6858
15151 * options.cc (General_options::finalize): Allow undefined symbols
15152 in shlibs if linking -shared.
15153
15154 PR gold/6859
15155 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15156 symbols as not needing a dynsym entry.
15157
1e52a9c1
CS
151582008-08-20 Craig Silverstein <csilvers@google.com>
15159
15160 * fileread.cc (File_read::open): Do not lock the file unless it
15161 was successfully opened.
15162
d85c80a3
CC
151632008-08-14 Cary Coutant <ccoutant@google.com>
15164
15165 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15166 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15167 * testsuite/tls_test.cc (struct int128): 128-bit struct
15168 for testing TLS relocs with non-zero addend.
15169 (v12): New TLS variable.
15170 (t12): New test.
15171 (t_last): Add check for v12.
15172 * testsuite/tls_test.h (t12): New function.
15173 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15174
2d924fd9
ILT
151752008-08-13 Ian Lance Taylor <iant@google.com>
15176
15177 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15178 set tls_segment_ or relro_segment_.
15179 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15180 when appropriate.
15181 * output.h (Output_section::clear_is_relro): New function.
15182 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15183 sections specially even when output_data_ is empty.
15184 (Output_segment::maximum_alignment): When first section is relro,
15185 only force alignment for PT_LOAD segments.
15186 * script.cc (script_data_segment_align): New function.
15187 (script_data_segment_relro_end): New function.
15188 * script-c.h (script_data_segment_align): Declare.
15189 (script_data_segment_relro_end): Declare.
15190 * script-sections.h (class Script_sections): Declare
15191 data_segment_align and data_segment_relro_end. Add fields
15192 segment_align_index_ and saw_relro_end_.
15193 * script-sections.cc (class Sections_element): Add set_is_relro
15194 virtual function. Add new bool* parameter to place_orphan_here.
15195 Add get_output_section virtual function.
15196 (class Output_section_definition): Add set_is_relro. Add new
15197 bool* parameter to place_orphan_here. Add get_output_section.
15198 Add is_relro_ field.
15199 (Output_section_definition::Output_section_definition): Initialize
15200 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15201 and is_relro_ fields.
15202 (Output_section_definition::place_orphan_here): Add is_relro
15203 parameter.
15204 (Output_section_definition::set_section_addresses): Set relro for
15205 output section.
15206 (Output_section_definition::alternate_constraint): Likewise.
15207 (class Orphan_output_section): Add new bool* parameter to
15208 place_orphan_here. Add get_output_section.
15209 (Orphan_output_section::place_orphan_here): Add is_relro
15210 parameter.
15211 (Script_sections::Script_sections): Initialize
15212 data_segment_align_index_ and saw_relro_end_.
15213 (Script_sections::data_segment_align): New function.
15214 (Script_sections::data_segment_relro_end): New function.
15215 (Script_sections::place_orphan): Set or clear is_relro.
15216 (Script_sections::set_section_addresses): Force alignment of first
15217 TLS section.
15218 * yyscript.y (exp): Call script_data_segment_align and
15219 script_data_segment_relro_end.
15220 * testsuite/relro_script_test.t: New file.
15221 * testsuite/relro_test.cc (using_script): Declare.
15222 (t1, t2): Test using_script.
15223 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15224 (relro_script_test_SOURCES): Define.
15225 (relro_script_test_DEPENDENCIES): Define.
15226 (relro_script_test_LDFLAGS): Define.
15227 (relro_script_test_LDADD): Define.
15228 (relro_script_test.so): New target.
15229 * testsuite/Makefile.in: Rebuild.
15230
f827c9a9
CC
152312008-08-06 Cary Coutant <ccoutant@google.com>
15232
15233 * archive.cc (Archive::total_archives, Archive::total_members)
15234 (Archive::total_members_loaded): New variables.
15235 (Archive::setup): Add parameter. Add option to preread
15236 archive symbols.
15237 (Archive::read_armap): Add counter.
15238 (Archive::get_file_and_offset): New function.
15239 (Archive::get_elf_object_for_member): New function.
15240 (Archive::read_all_symbols): New function.
15241 (Archive::read_symbols): New function.
15242 (Archive::add_symbols): Add counters.
15243 (Archive::include_all_members): Use armap to find members if it's
15244 already built.
15245 (Archive::include_member): Skip reading symbols if already read.
15246 Factored code into Archive::get_file_and_offset and
15247 Archive::get_elf_object_for_member. Changed call to
15248 Mapfile::report_include_archive_member.
15249 (Archive::print_stats): New function.
15250 * archive.h: Declare Object and Read_symbols_data classes.
15251 (Archive::Archive): Add initializers for new members.
15252 (Archive::setup): Add parameter.
15253 (Archive::print_stats): New function.
15254 (Archive::total_archives, Archive::total_members)
15255 (Archive::total_members_loaded): New variables.
15256 (Archive::get_file_and_offset): New function.
15257 (Archive::get_elf_object_for_member): New function.
15258 (Archive::read_all_symbols): New function.
15259 (Archive::read_symbols): New function.
15260 (Archive::Archive_member): New class.
15261 (Archive::members_): New member.
15262 (Archive::num_members_): New member.
15263 * main.cc: Include archive.h.
15264 (main): Call Archive::print_stats.
15265 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15266 archive parameter; member_name is now the fully-decorated name.
15267 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15268 * options.h: (General_options): Add --preread-archive-symbols option.
15269 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15270 Archive::setup.
15271
de4c45bd
ILT
152722008-08-04 Ian Lance Taylor <iant@google.com>
15273
15274 * symtab.h (Symbol::use_plt_offset): New function.
15275 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15276 * powerpc.cc (Relocate::relocate): Likewise.
15277 * sparc.cc (Relocate::relocate): Likewise.
15278 * x86_64.cc (Relocate::relocate): Likewise.
15279 * testsuite/weak_plt.sh: New test.
15280 * testsuite/weak_plt_main.cc: New test.
15281 * testsuite/weak_plt_shared.cc: New test.
15282 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15283 (check_PROGRAMS): Add weak_plt.
15284 (check_DATA): Add weak_plt_shared.so.
15285 (weak_plt_main_pic.o, weak_plt): New targets.
15286 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15287 * testsuite/Makefile.in: Rebuild.
15288
15289 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15290 gcctestdir/ld.
15291 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15292 * testsuite/Makefile.in: Rebuild.
15293
323ee3f4
AM
152942008-08-04 Alan Modra <amodra@bigpond.net.au>
15295
15296 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15297 * Makefile.in: Regenerate.
15298 * po/POTFILES.in: Regenerate.
15299
7c07ecec
ILT
153002008-07-29 Ian Lance Taylor <iant@google.com>
15301
15302 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15303 symbols before other symbols.
15304 * testsuite/script_test_2.cc (test_addr): Declare.
15305 (test_addr_alias): Declare.
15306 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15307 values.
7c07ecec
ILT
15308 * testsuite/script_test_2.t: Define test_addr_alias and
15309 test_addr.
15310
5778530e
ILT
153112008-07-24 Ian Lance Taylor <iant@google.com>
15312
2a00e4fb
ILT
15313 PR 5990
15314 * descriptors.cc: New file.
15315 * descriptors.h: New file.
15316 * gold-threads.h (class Hold_optional_lock): New class.
15317 * fileread.cc: Include "descriptors.h".
15318 (File_read::~File_read): Release descriptor rather than closing
15319 it.
15320 (File_read::open) [file]: Call open_descriptor rather than open.
15321 Set is_descriptor_opened_.
15322 (File_read::open) [memory]: Assert that descriptor is not open.
15323 (File_read::reopen_descriptor): New function.
15324 (File_read::release): Release descriptor.
15325 (File_read::do_read): Make non-const. Reopen descriptor.
15326 (File_read::read): Make non-const.
15327 (File_read::make_view): Reopen descriptor.
15328 (File_read::do_readv): Likewise.
15329 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15330 Update declarations.
15331 * layout.cc: Include "descriptors.h".
15332 (Layout::create_build_id): Use open_descriptor rather than open.
15333 * output.cc: Include "descriptors.h".
15334 (Output_file::open): Use open_descriptor rather than open.
15335 * archive.cc (Archive::const_iterator): Change Archive to be
15336 non-const.
15337 (Archive::begin, Archive::end): Make non-const.
15338 (Archive::count_members): Likewise.
15339 * archive.h (class Archive): Update declarations.
15340 * object.h (Object::read): Make non-const.
15341 * Makefile.am (CCFILES): Add descriptors.cc.
15342 (HFILES): Add descriptors.h.
15343 * Makefile.in: Rebuild.
15344
801647d1
ILT
15345 PR 6716
15346 * gold.h: Always include <clocale>. Add Solaris workarounds
15347 following code in binutils/sysdep.h.
15348
5edd166e
ILT
15349 PR 6048
15350 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15351 this->eh_frame_hdr_ is NULL before using it.
15352
c89ad728
ILT
15353 * dynobj.cc (Versions::Versions): Update comment.
15354
aa86f06b
ILT
15355 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15356 the base version name.
15357
5778530e
ILT
15358 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15359 array size plus one.
15360 (Stringpool_template::set_string_offsets): Subtract one from key
15361 before using it as an array index.
15362 (Stringpool_template::get_offset_with_length): Likewise.
15363 (Stringpool_template::write_to_buffer): Likewise.
15364 * stringpool.h (Stringpool_template::get_offset_from_key):
15365 Likewise.
15366
057ead22
ILT
153672008-07-23 Ian Lance Taylor <iant@google.com>
15368
7f649c59
ILT
15369 PR 6658
15370 * object.h (Merged_symbol_value::value): Do our best to handle a
15371 negative addend.
15372
057ead22
ILT
15373 PR 6647
15374 * script.cc (Version_script_info::get_versions): Don't add empty
15375 version tag to return value.
15376 (Version_script_info::get_symbol_version_helper): Change return
15377 type to bool. Add pversion parameter. Change all callers.
15378 (script_register_vers_node): Don't require a non-NULL tag.
15379 * script.h (class Version_script_info): Update declarations.
15380 (Version_script_info::get_symbol_version): Change return type to
15381 bool. Add version parameter. Change all callers.
15382 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15383 handling. Handle an empty version from a version script.
15384 (Symbol_table::define_special_symbol): Likewise.
15385 * testsuite/ver_test_10.script: New file.
15386 * testsuite/ver_test_10.sh: New file.
15387 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15388 (check_DATA): Add ver_test_10.syms.
15389 (ver_test_10.syms, ver_test_10.so): New target.
15390 * testsuite/Makefile.in: Rebuild.
15391
58e54ac2
CD
153922008-07-23 Simon Baldwin <simonb@google.com>
15393
15394 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15395 to zero for undefined symbols from dynamic libraries.
15396
95d14cd3
ILT
153972008-07-23 Ian Lance Taylor <iant@google.com>
15398
15399 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15400 Change all callers.
15401 * symtab.h (class Symbol_table): Update declaration.
15402 * testsuite/ver_test_9.cc: New file.
15403 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15404 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15405 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15406 (ver_test_9.so, ver_test_9.o): New targets.
15407 * testsuite/Makefile.in: Rebuild.
15408
92de84a6
ILT
154092008-07-22 Ian Lance Taylor <iant@google.com>
15410
34810851
ILT
15411 * options.h (class General_options): Define --check-sections.
15412 * layout.cc (Layout::set_segment_offsets): Handle
15413 --check-sections.
15414
af6156ef
ILT
15415 * options.h (class General_options): Define -n/--nmagic and
15416 -N/--omagic.
15417 * options.cc (General_options::finalize): For -n/--nmagic or
15418 -N/--omagic, set -static.
15419 * layout.cc (Layout::attach_allocated_section_to_segment): If
15420 -N/--omagic, don't put read-only and read-write sections in
15421 different segments.
15422 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15423 finding a read-only segment.
15424 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15425 don't set the minimum segment alignment to the common page size,
15426 and don't set the file offset to the address modulo the page size.
15427 * script-sections.cc (Script_sections::create_segments): If
15428 -n/--omagic, don't put read-only and read-write sections in
15429 different segments.
15430
92de84a6
ILT
15431 * cref.cc: New file.
15432 * cref.h: New file.
15433 * options.h (class General_options): Add --print-symbol-counts.
15434 * main.cc (main): Issue defined symbol report if requested.
15435 * archive.cc (Archive::interpret_header): Make into a const member
15436 function.
15437 (Archive::add_symbols): Call Input_objects::archive_start and
15438 archive_stop.
15439 (Archive::const_iterator): Define new class.
15440 (Archive::begin, Archive::end): New functions.
15441 (Archive::include_all_members): Rewrite to use iterator.
15442 (Archive::count_members): New function.
15443 * archive.h (class Archive): Update declarations.
15444 (Archive::filename): New function.
15445 * object.cc: Include "cref.h".
15446 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15447 (Sized_relobj::do_get_global_symbol_counts): New function.
15448 (Input_objects::add_object): Add object to cross-referencer.
15449 (Input_objects::archive_start): New function.
15450 (Input_objects::archive_stop): New function.
15451 (Input_objects::print_symbol_counts): New function.
15452 * object.h: Declare Cref and Archive.
15453 (Object::get_global_symbol_counts): New function.
15454 (Object::do_get_global_symbol_counts): New pure virtual function.
15455 (class Sized_relobj): Add defined_count_ field. Update
15456 declarations.
15457 (class Input_objects): Add cref_ field. Update constructor.
15458 Update declarations.
15459 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15460 defined_count_.
15461 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15462 symbol counts.
15463 (Sized_dynobj::do_get_global_symbol_counts): New function.
15464 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15465 defined_count_. Update declarations. Define Symbols typedef.
15466 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15467 parameter. Change all callers.
15468 (Symbol_table::add_from_dynobj): Add sympointers and defined
15469 parameters. Change all callers.
15470 * symtab.h (class Symbol_table): Update declarations.
15471 * Makefile.am (CCFILES): Add cref.cc.
15472 (HFILES): Add cref.h.
15473 * Makefile.in: Rebuild.
15474
3f7c5e1d
CD
154752008-07-22 Simon Baldwin <simonb@google.com>
15476
15477 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15478 to zero when writing undefined symbols.
15479
e0b64032
ILT
154802008-07-22 Ian Lance Taylor <iant@google.com>
15481
15482 * output.cc (Output_section::add_input_section): Don't try to
15483 merge empty merge sections.
15484
096b02cf
CS
154852008-07-21 Craig Silverstein <csilvers@google.com>
15486
15487 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15488 Include symbol version in error message.
cd536b21 15489
1d1f116d
CD
154902008-07-20 Chris Demetriou <cgd@google.com>
15491
cd536b21 15492 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15493 (RANDOM_SEED_CFLAGS): New substituted variable.
15494 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15495 * configure: Rebuild.
15496 * Makefile.in: Likewise.
15497 * testsuite/Makefile.in: Likewise.
15498
a18f591e
ILT
154992008-07-18 Ian Lance Taylor <iant@google.com>
15500
15501 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15502 where we see NAME/NULL and NAME/VERSION as separate symbols.
15503 * testsuite/ver_test_main.cc (main): Call t4.
15504 (t4, t4_2a): Define.
15505 * testsuite/ver_test_2.cc (t4_2): Define.
15506 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15507 * testsuite/ver_test_4.cc (t4_2a): Define.
15508 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15509 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15510
c6e3f6ed
ILT
155112008-07-17 Ian Lance Taylor <iant@google.com>
15512
15513 * dynobj.cc (Versions::add_def): If we give an error about a
15514 missing version, go ahead and create the version anyhow.
15515
ef9beddf
ILT
155162008-07-10 Ian Lance Taylor <iant@google.com>
15517
15518 Handle output sections with more than 0x7fffffff bytes.
15519 * object.h (class Relobj): Change map_to_output_ to
15520 output_sections_, and just keep a section pointer. Change all
15521 uses. Move comdat group support to Sized_relobj.
15522 (Relobj::is_section_specially_mapped): Remove.
15523 (Relobj::output_section): Remove poff parameter. Change all
15524 callers.
15525 (Relobj::output_section_offset): New function.
15526 (Relobj::set_section_offset): Rewrite.
15527 (Relobj::map_to_output): Remove.
15528 (Relobj::output_sections): New function.
15529 (Relobj::do_output_section_offset): New pure virtual function.
15530 (Relobj::do_set_section_offset): Likewise.
15531 (class Sized_relobj): Add section_offsets_ field. Add comdat
15532 group support from Relobj. Update declarations.
15533 (Sized_relobj::get_output_section_offset): New function.
15534 (Sized_relobj::do_output_section_offset): New function.
15535 (Sized_relobj::do_set_section_offset): New function.
15536 * object.cc (Relobj::output_section_address): Remove.
15537 (Sized_relobj::Sized_relobj): Initialize new fields.
15538 (Sized_relobj::include_section_group): Cast find_kept_object to
15539 Sized_relobj.
15540 (Sized_relobj::include_linkonce_section): Likewise.
15541 (Sized_relobj::do_layout): Use separate arrays for output section
15542 and output offset.
15543 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15544 output_sections.
15545 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15546 output_sections and section_offsets.
15547 (Sized_relobj::write_local_symbols): Likewise.
15548 (map_to_kept_section): Compute output address directly.
15549 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15550 output_sections and section_offsets.
15551 (Sized_relobj::write_sections): Likewise.
15552 (Sized_relobj::relocate_sections): Likewise.
15553 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15554 * output.h (class Output_reloc): Update declarations. Change
15555 u2_.relobj to Sized_relobj*.
15556 (class Output_data_reloc): Change add functions to use
15557 Sized_relobj*.
15558 * output.cc (Output_reloc::Output_reloc): Change relobj to
15559 Sized_relobj*.
15560 (Output_reloc::local_section_offset): Change return type to
15561 Elf_Addr. Use get_output_section_offset.
15562 (Output_reloc::get_address): Likewise.
15563 (Output_section::is_input_address_mapped): Don't call
15564 is_section_specially_mapped.
15565 (Output_section::output_offset): Likewise.
15566 (Output_section::output_address): Likewise.
15567 (Output_section::starting_output_address): Likewise.
15568 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15569 parameter to Sized_relobj*.
15570 (Copy_relocs::need_copy_reloc): Likewise.
15571 (Copy_relocs::save): Likewise.
15572 * copy-relocs.h (class Copy_relocs): Update declarations.
15573 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15574 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15575 * target-reloc.h (relocate_for_relocatable): Change
15576 offset_in_output_section type to Elf_Addr. Change code that uses
15577 it as well.
15578 * layout.cc (Layout::layout): Always set *off.
15579 * mapfile.cc (Mapfile::print_input_section): Use
15580 output_section_offset.
15581 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15582 Sized_relobj*.
15583 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15584 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15585 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15586
5cb66f97
ILT
155872008-07-03 Ian Lance Taylor <iant@google.com>
15588
15589 * layout.cc (Layout::include_section): Do not discard unrecognized
15590 SHT_STRTAB sections.
15591
afe47622
CS
155922008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15593
15594 * script.cc (Lex::can_continue_name): Make '?' allowable in
15595 version-script names.
15596 * testsuite/version_script.map: Change glob pattern to use '?'
15597
5adf9721
ILT
155982008-06-30 Manish Singh <yosh@gimp.org>
15599
15600 PR 6585
15601 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15602 Correct typo.
15603
e6fde208
ILT
156042008-06-30 Ian Lance Taylor <iant@google.com>
15605
15606 PR 6660
15607 PR 6682
15608 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15609 versions]: Don't try to read the value in the contents, since we
15610 don't use it. Use the template endianness when writing.
15611
3f2e6a2d
CC
156122008-06-25 Cary Coutant <ccoutant@google.com>
15613
15614 * fileread.cc (File_read::make_view): Assert on zero-length view.
15615 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15616 symbol table when there are no symbols to read.
15617
c43d3a48
CS
156182008-06-23 Craig Silverstein <csilvers@google.com>
15619
15620 * version.cc (version_string): Bump to 1.7
15621
5f494ea0
CS
156222008-06-18 Craig Silverstein <csilvers@google.com>
15623
15624 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15625 constant 0xFFFF to type Valtype.
15626 (Powerpc_relocate_functions::rel16_ha): Likewise.
15627
c42e122e
ILT
156282008-06-17 Ian Lance Taylor <iant@google.com>
15629
f34787f8
ILT
15630 * output.h (Output_section::Input_section): Initialize p2align_ to
15631 zero for Output_section_data constructors.
15632 (Output_section::Input_section::addralign): If not an input
15633 section, return the alignment of the Output_section_data.
15634 * testsuite/copy_test.cc: New file.
15635 * testsuite/copy_test_1.cc: New file.
15636 * testsuite/copy_test_2.cc: New file.
15637 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15638 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15639 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15640 (copy_test_1_pic.o, copy_test_1.so): New targets.
15641 (copy_test_2_pic.o, copy_test_2.so): New targets.
15642 * testsuite/Makefile.in: Rebuild.
15643
c42e122e
ILT
15644 * script-sections.cc (Script_sections::place_orphan): Initialize
15645 local variable exact.
15646
ce3ac18a
DE
156472008-06-13 David Edelsohn <edelsohn@gnu.org>
15648
15649 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15650
42cacb20
DE
156512008-06-12 David Edelsohn <edelsohn@gnu.org>
15652 David S. Miller <davem@davemloft.net>
15653
15654 * powerpc.cc: New file.
15655 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15656 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15657 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15658 * Makefile.in: Rebuild.
15659
7b308235
ILT
156602008-06-09 Ian Lance Taylor <iant@google.com>
15661
15662 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15663 <exception>.
15664 (throwing, orig_terminate): New static variables.
15665 (terminate_handler): New static function.
15666 (t2): Set terminate handler.
15667
f0b886e3
ILT
156682008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15669
15670 PR 6584
cd536b21 15671 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15672 alignment.
15673
3e90f135
CC
156742008-05-30 Cary Coutant <ccoutant@google.com>
15675
15676 * archive.cc (Archive::include_all_members) Correct to step
15677 over symbol table and extended name table in thin archives.
15678
e09ad04a
ILT
156792008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15680
15681 PR 6407
15682 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15683 calculation.
15684
62b01cb5
ILT
156852008-05-28 Caleb Howe <cshowe@google.com>
15686
15687 * reduced_debug_output.cc: New file.
15688 * reduced_debug_output.h: New file.
92de84a6 15689 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15690 * options.cc (General_options::finalize): Add strip_debug_non_line
15691 to the strip heirarchy.
15692 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15693 fields.
15694 * layout.cc: Include "reduced_debug_output.h".
15695 (Layout::Layout): Initialize new fields.
15696 (line_only_debug_sections): New static array.
15697 (is_lines_only_debug_sections): New static inline function.
15698 (Layout::include_section): Handle --strip-debug-non-line.
15699 (Layout::make_output_section): If --strip-debug-non-line, build
15700 new output sections for .debug_abbrev and .debug_info.
15701 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15702 gold. Warn about possible overflow.
15703 (read_signed_LEB_128): Likewise.
15704 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15705 (read_signed_LEB_128): Declare.
15706 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15707 (HFILES): Add reduced_debug_output.h.
15708 * Makefile.in: Rebuild.
15709
7d9e3d98
ILT
157102008-05-21 Ian Lance Taylor <iant@google.com>
15711
15712 * mapfile.cc: New file.
15713 * mapfile.h: New file.
15714 * options.h (class General_options): Add -M/--print-map and -Map.
15715 * options.cc (General_options::finalize): Make -M equivalent to
15716 -Map -.
15717 * main.cc: Include <cstdio> and "mapfile.h".
15718 (main): Open mapfile if requested.
15719 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15720 constructor. Change caller.
15721 (queue_initial_tasks): Add mapfile parameter. Change caller.
15722 (queue_middle_tasks): Likewise.
15723 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15724 declarations.
15725 * archive.cc: Include "mapfile.h".
15726 (Archive::add_symbols): Add mapfile parameter. Change all
15727 callers. Pass mapfile, symbol, and reason to include_member.
15728 (Archive::include_all_members): Add mapfile parameter. Change all
15729 callers.
15730 (Archive::include_member): Add mapfile, sym, and why parameters.
15731 Change all callers. Report inclusion to map file.
15732 * archive.h: Include "fileread.h".
15733 (class Archive): Update declarations.
15734 (Archive::file): New const method.
15735 (class Add_archive_symbols): Add mapfile_ field. Update
15736 constructor. Change all callers.
15737 * readsyms.h (class Read_symbols): Likewise.
15738 (class Finish_group): Likewise.
15739 (class Read_script): Likewise.
15740 * common.cc: Include "mapfile.h".
15741 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15742 all callers.
15743 (Symbol_table::do_allocate_commons): Likewise.
15744 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15745 symbol allocation to mapfile.
15746 * common.h (class Allocate_commons_task): Add mapfile_ field.
15747 Update constructor. Change all callers.
15748 * symtab.h (class Symbol_table): Update declarations.
15749 * layout.cc: Include "mapfile.h".
15750 (Layout_task_runner::run): Print information to mapfile.
15751 (Layout::create_gold_note): Change Output_data_fixed_space to
15752 Output_data_zero_fill.
15753 (Layout::create_build_id): Likewise.
15754 (Layout::print_to_mapfile): New function.
15755 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15756 constructor. Change caller.
15757 (class Layout): Declare print_to_mapfile.
15758 * output.cc (Output_section::Input_section::print_to_mapfile): New
15759 function.
15760 (Output_section::add_input_section): If producing a map, always
15761 add to input_sections_ list.
15762 (Output_section::do_print_to_mapfile): New function.
15763 (Output_segment::print_sections_to_mapfile): New function.
15764 (Output_segment::print_section_list_to_mapfile): New function.
15765 * output.h: Include "mapfile.h".
15766 (Output_data::print_to_mapfile): New function.
15767 (Output_data::do_print_to_mapfile): New virtual function.
15768 (Output_segment_headers::do_print_to_mapfile): New function.
15769 (Output_file_header::do_print_to_mapfile): New function.
15770 (Output_data_const::do_print_to_mapfile): New function.
15771 (class Output_data_const_buffer): Add map_name_ field. Update
15772 constructor. Change all callers. Add do_print_to_mapfile
15773 function.
15774 (class Output_data_fixed_space): Likewise.
15775 (class Output_data_space): Likewise.
15776 (class Output_data_zero_fill): New class.
15777 (Output_data_strtab::do_print_to_mapfile): New function.
15778 (Output_data_reloc_base::do_print_to_mapfile): New function.
15779 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15780 (Output_data_group::do_print_to_mapfile): New function.
15781 (Output_data_got::do_print_to_mapfile): New function.
15782 (Output_data_dynamic::do_print_to_mapfile): New function.
15783 (Output_symtab_xindex::do_print_to_mapfile): New function.
15784 (class Output_section): Declare do_print_to_mapflie. Declare
15785 print_to_mapfile in Input_section.
15786 (class Output_segment): Declare new functions.
15787 * object.h (Sized_relobj::symbol_count): New function.
15788 * script-sections.cc
15789 (Output_section_element_dot_assignment::set_section_addresses):
15790 Change Output_data_fixed_space to Output_data_zero_fill.
15791 (Output_data_expression::do_print_to_mapfile): New function.
15792 * script.cc (read_input_script): Add mapfile parameter. Change
15793 all callers.
15794 * script.h (read_input_script): Update declaration.
15795 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15796 (Eh_frame::do_print_to_mapfile): New function.
15797 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15798 (Output_merge_string::do_print_to_mapfile): New function.
15799 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15800 function.
15801 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15802 function.
15803 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15804 function.
15805 * Makefile.am (CCFILES): Add mapfile.cc.
15806 (HFILES): Add mapfile.h.
15807 * Makefile.in: Rebuild.
15808
9f1d377b
ILT
158092008-05-19 Ian Lance Taylor <iant@google.com>
15810
15811 * options.h (class General_options): Add -z relro.
15812 * layout.cc (Layout::Layout): Initialize relro_segment_.
15813 (Layout::add_output_section_data): Return the output section.
15814 (Layout::make_output_section): Rcognize relro sections and mark
15815 them appropriately.
15816 (Layout::attach_allocated_section_to_segment): Put relro sections
15817 in a PT_GNU_RELRO segment.
15818 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15819 section as relro.
15820 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15821 PT_TLS segments.
15822 (Layout::linkonce_mapping): Map d.rel.ro.local to
15823 .data.rel.ro.local.
15824 (Layout::output_section_name): Us .data.rel.ro.local for any
15825 section which begins with that.
15826 * layout.h (class Layout): Update add_output_section_data
15827 declaration. Add relro_segment_ field.
15828 * output.cc (Output_section::Output_section): Initialize is_relro_
15829 and is_relro_local_ fields.
15830 (Output_segment::add_output_section): Group relro sections.
15831 (Output_segment::is_first_section_relro): New function.
15832 (Output_segment::maximum_alignment): If there is a relro section,
15833 align the segment to the common page size.
15834 (Output_segment::set_section_addresses): Track whether we are
15835 looking at relro sections. If the last section is a relro
15836 section, align to the common page size.
15837 (Output_segment::set_section_list_addresses): Add in_relro
15838 parameter. Change all callers. Align to the page size when
15839 moving from relro to non-relro section.
15840 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15841 segment.
15842 * output.h (class Output_section): Add is_relro_ and
15843 is_relro_local_ fields.
15844 (Output_section::is_relro): New function.
15845 (Output_section::set_is_relro): New function.
15846 (Output_section::is_relro_local): New function.
15847 (Output_section::set_is_relro_local): New function.
15848 (class Output_segment): Update declarations.
15849 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15850 * sparc.cc (Target_sparc::got_section): Likewise.
15851 * x86_64.cc (Target_x86_64::got_section): Likewise.
15852 * testsuite/relro_test_main.cc: New file.
15853 * testsuite/relro_test.cc: New file.
15854 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15855 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15856 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15857 (relro_test.so, relro_test_pic.o): New targets.
15858 * testsuite/Makefile.in: Rebuild.
15859
a984ee1d
ILT
158602008-05-16 Ian Lance Taylor <iant@google.com>
15861
01676dcd
ILT
15862 * output.cc (Output_segment::add_output_section): Remove front
15863 parameter.
15864 * output.h (class Output_segment): Remove
15865 add_initial_output_section and overloaded add_output_section.
15866 Update declaration of remaining add_output_section.
15867 * layout.cc (Layout::create_interp): Call add_output_section
15868 rather than add_initial_output_section.
15869 (Layout::finish_dynamic_section): Likewise.
15870
497897f9
ILT
15871 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15872 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15873 know the dynamic type.
15874 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15875 field. Initialize it in constructor.
15876 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15877 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15878 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15879 reloc.
15880
a984ee1d
ILT
15881 * output.cc (Output_reloc::get_address): Change return type to
15882 Elf_Addr.
15883 * output.h (class Output_reloc): Update get_address declaration.
15884 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15885 for section addresses.
15886
55ba0940
ILT
158872008-05-09 Ian Lance Taylor <iant@google.com>
15888
15889 PR 6493
15890 * gold.cc (gold_nomem): Use return value of write.
15891
75517b77
ILT
158922008-05-08 Ian Lance Taylor <iant@google.com>
15893
15894 * symtab.c (Symbol::init_base_output_data): Add version
15895 parameter. Change all callers.
15896 (Symbol::init_base_output_segment): Likewise.
15897 (Symbol::init_base_constant): Likewise.
15898 (Symbol::init_base_undefined): Likewise.
15899 (Sized_symbol::init_output_data): Likewise.
15900 (Sized_symbol::init_output_segment): Likewise.
15901 (Sized_symbol::init_constant): Likewise.
15902 (Sized_symbol::init_undefined): Likewise.
15903 (Symbol_table::do_define_in_output_data): If the new symbol has a
15904 version, mark it as the default.
15905 (Symbol_table::do_define_in_output_segment): Likewise.
15906 (Symbol_table::do_define_as_constant): Likewise.
15907 * symtab.h (class Symbol): Update declarations.
15908 (class Sized_symbol): Likewise.
15909 * resolve.cc (Symbol::override_version): New function.
c42e122e 15910 (Symbol::override_base): Call override_version.
75517b77
ILT
15911 (Symbol::override_base_with_special): Likewise.
15912 * testsuite/ver_script_8.script: New file.
15913 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15914 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15915 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15916 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15917
f1f70eae
ILT
159182008-05-06 Ian Lance Taylor <iant@google.com>
15919
f3e9c5c5
ILT
15920 PR 6049
15921 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15922 functions.
15923 (class General_options): Remove existing --undefined, and add
15924 --no-undefined instead. Add new --undefined as synonym for -u.
15925 * archive.cc (Archive::add_symbols): Check whether symbol was
15926 named with -u.
15927 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15928 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15929 all uses. Add IS_UNDEFINED. Update declarations to split
15930 different versions of init_base. Declare init_base_undefined.
15931 (Symbol::is_defined): Handle IS_UNDEFINED.
15932 (Symbol::is_undefined): Likewise.
15933 (Symbol::is_weak_undefined): Call is_undefined.
15934 (Symbol::is_absolute): Handle IS_CONSTANT.
15935 (class Sized_symbol): Update declarations to split different
15936 versions of init. Declare init_undefined.
15937 (class Symbol_table): Declare new functions.
15938 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15939 Change all callers.
15940 (Symbol::init_base_output_data): Likewise.
15941 (Symbol::init_base_output_segment): Likewise.
15942 (Symbol::init_base_constant): Likewise.
15943 (Symbol::init_base_undefined): New function.
15944 (Sized_symbol::init_object): Rename from init. Change all
15945 callers.
15946 (Sized_symbol::init_output_data): Likewise.
15947 (Sized_symbol::init_output_segment): Likewise.
15948 (Sized_symbol::init_constant): Likewise.
15949 (Sized_symbol::init_undefined): New function.
15950 (Symbol_table::add_undefined_symbols_from_command_line): New
15951 function.
15952 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15953 function.
15954 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15955 (Symbol::output_section): Likewise.
15956 (Symbol::set_output_section): Likewise.
15957 (Symbol_table::sized_finalize_symbol): Likewise.
15958 (Symbol_table::sized_write_globals): Likewise.
15959 * resolve.cc (Symbol_table::should_override): Likewise.
15960 (Symbol::override_base_with_special): Likewise.
15961
8bdcdf2c
ILT
15962 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15963 symbol, change it to have default visibility.
15964 * testsuite/protected_1.cc: New file.
15965 * testsuite/protected_2.cc: New file.
15966 * testsuite/protected_3.cc: New file.
15967 * testsuite/protected_main_1.cc: New file.
15968 * testsuite/protected_main_2.cc: New file.
15969 * testsuite/protected_main_3.cc: New file.
15970 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15971 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15972 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15973 (protected_1.so): New target.
15974 (protected_1_pic.o, protected_2_pic.o): New targets.
15975 (protected_3_pic.o): New target.
15976 (check_PROGRAMS): Add protected_2.
15977 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15978 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15979 * testsuite/Makefile.in: Rebuild.
15980
2b706932
ILT
15981 * options.h (DEFINE_var): Add set_user_set_##varname__.
15982 (DEFINE_bool_alias): New macro.
15983 (class General_options): Define -Bstatic using DEFINE_bool_alias
15984 rather than DEFINE_special. Add --undefined as an alias for -z
15985 defs.
15986 * options.cc (General_options::parse_Bstatic): Remove.
15987
d82a5bcc
ILT
15988 * options.h (class General_options): Add --fatal-warnings.
15989 * main.cc (main): Implement --fatal-warnings.
15990 * errors.h (Errors::warning_count): New function.
15991
f1f70eae
ILT
15992 * options.h (class General_options): Add -Bsymbolic-functions.
15993 * symtab.h (Symbol::is_preemptible): Check for
15994 -Bsymbolic-functions.
15995
8825ac63
ILT
159962008-05-05 Ian Lance Taylor <iant@google.com>
15997
d98bc257
ILT
15998 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15999 as noVARNAME rather than no-VARNAME.
16000 (class General_options): Add option -z combreloc.
16001 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16002 get_address.
16003 (Output_reloc::sort_before) [SHT_REL]: New function.
16004 (Output_reloc::sort_before) [SHT_RELA]: New function.
16005 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16006 Sort_relocs_comparison.
16007 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16008 parameter. Change all callers.
16009 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16010 sort_relocs parameter. Change all callers.
16011 * output.cc (Output_reloc::get_address): New function, broken out
16012 of write_rel.
16013 (Output_reloc::write_rel): Call it.
16014 (Output_reloc::compare): New function.
16015 (Output_data_reloc_base::do_write): Optionally sort relocs.
16016
60b2b4e7
ILT
16017 * configure.ac: If targ_extra_obj is set, link it in.
16018 * configure.tgt: Initialize all variables.
16019 (x86_64*): Set targ_extra_obj and targ_extra_size.
16020 * configure: Rebuild.
16021
8825ac63
ILT
16022 * object.cc (Sized_relobj::include_section_group): Adjust section
16023 indexes read from group data. Build vector to pass to
16024 layout_group.
16025 * layout.cc (Layout::layout_group): Add flags and shndxes
16026 parameters. Remove contents parameter. Change caller. Update
16027 explicit instantiations.
16028 * layout.h (class Layout): Update layout_group declaration.
16029 * output.cc (Output_data_group::Output_data_group): Add flags and
16030 input_shndxes parameters. Remove contents parameter. Change
16031 caller.
16032 (Output_data_group::do_write): Change input_sections_ to
16033 input_shndxes_.
16034 * output.h (class Output_data_group): Update constructor
16035 declaration. Rename input_sections_ to input_shndxes_.
16036 * testsuite/many_sections_test.cc: Add template.
16037
e94cf127
CC
160382008-04-30 Cary Coutant <ccoutant@google.com>
16039
4418b2d5
CC
16040 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16041
e94cf127
CC
16042 * layout.cc (Layout::include_section): Refactored check for debug
16043 info section.
16044 (Layout::add_comdat): Add new parameters. Change type
16045 of signature parameter. Add object and shndx to signatures table.
16046 (Layout::find_kept_object): New function.
16047 * layout.h: Include <cstring>.
16048 (Layout::is_debug_info_section): New function.
16049 (Layout::add_comdat): Add new parameters.
16050 (Layout::find_kept_object): New function.
16051 (Layout::Kept_section): New struct.
16052 (Layout::Signatures): Change type of map range.
16053 * object.cc (Relobj::output_section_address): New function.
16054 (Sized_relobj::include_section_group): Add new parameters. Change
16055 calls to Layout::add_comdat. Change to build table of kept comdat
16056 groups and table mapping discarded sections to kept sections.
16057 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16058 (Sized_relobj::do_layout): Change calls to include_section_group and
16059 include_linkonce_section.
16060 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16061 value to zero when section is discarded.
16062 (Sized_relobj::map_to_kept_section): New function.
16063 * object.h (Relobj::output_section_address): New function.
16064 (Relobj::Comdat_group): New type.
16065 (Relobj::find_comdat_group): New function.
16066 (Relobj::Comdat_group_table): New type.
16067 (Relobj::Kept_comdat_section): New type.
16068 (Relobj::Kept_comdat_section_table): New type.
16069 (Relobj::add_comdat_group): New function.
16070 (Relobj::set_kept_comdat_section): New function.
16071 (Relobj::get_kept_comdat_section): New function.
16072 (Relobj::comdat_groups_): New field.
16073 (Relobj::kept_comdat_sections_): New field.
16074 (Symbol_value::input_value): Update comment.
16075 (Sized_relobj::map_to_kept_section) New function.
16076 (Sized_relobj::include_linkonce_section): Add new parameter.
16077 * target-reloc.h (Comdat_behavior): New type.
16078 (get_comdat_behavior): New function.
16079 (relocate_section): Add code to map a discarded section to the
16080 corresponding kept section when applying a relocation.
16081
e4e5049b
CS
160822008-04-30 Craig Silverstein <csilvers@google.com>
16083
16084 * dwarf_reader.cc (next_generation_count): New static var.
16085 (Addr2line_cache_entry): New struct.
16086 (addr2line_cache): New static var.
16087 (Dwarf_line_info::one_addr2line): Added caching.
16088 (Dwarf_line_info::clear_addr2line_cache): New function.
16089 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16090 cache-size parameter.
16091 (Dwarf_line_info::one_addr2line_cache): New function.
16092 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16093 new cache-size argument to one_addr2line(), and clear cache.
16094
d09e9154
CC
160952008-04-28 Cary Coutant <ccoutant@google.com>
16096
16097 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16098 R_386_PC8 relocations.
16099
7ef73768
ILT
161002008-04-23 Ian Lance Taylor <iant@google.com>
16101
55438702
ILT
16102 * object.cc (Sized_relobj::include_section_group): Check for
16103 invalid section group.
16104
c165fb93
ILT
16105 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16106 header size.
16107
7ef73768
ILT
16108 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16109 than read for file header.
16110 * archive.cc (Archive::include_member): Likewise.
16111
6194aaab
L
161122008-04-23 Paolo Bonzini <bonzini@gnu.org>
16113
16114 * aclocal.m4: Regenerate.
16115 * configure: Regenerate.
16116
d491d34e
ILT
161172008-04-19 Ian Lance Taylor <iant@google.com>
16118
5ea2bac6
ILT
16119 * version.cc (version_string): Bump to 1.6.
16120
7bc3e21a
ILT
16121 * testsuite/Makefile.am (many_sections_r_test): New target.
16122 (many_sections_r_test_SOURCES): Remove.
16123 (many_sections_r_test_DEPENDENCIES): Remove.
16124 (many_sections_r_test_LDFLAGS): Remove.
16125 (many_sections_r_test_LDADD): Remove.
16126
7fcd3aa9
ILT
16127 * object.cc (Sized_relobj::do_add_symbols): Always pass
16128 local_symbol_count_ to add_from_relobj.
16129
4c94d6ae
ILT
16130 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16131 every thousand variables.
16132 * testsuite/Makefile.in: Rebuild.
16133
d491d34e
ILT
16134 * object.cc (Xindex::initialize_symtab_xindex): New function.
16135 (Xindex::read_symtab_xindex): New function.
16136 (Xindex::sym_xindex_to_shndx): New function.
16137 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16138 available.
16139 (Sized_relobj::do_initialize_xindex): New function.
16140 (Sized_relobj::do_read_symbols): Adjust section links.
16141 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16142 parameter. Change all callers.
16143 (Sized_relobj::include_section_group): Adjust section links and
16144 symbol section indexes.
16145 (Sized_relobj::do_layout): Adjust section links.
16146 (Sized_relobj::do_count_local_symbols): Adjust section links and
16147 symbol section indexes.
16148 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16149 ordinary and special symbols.
16150 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16151 dynsym_xindex parameters. Change all callers. Adjust section
16152 links. Use SHN_XINDEX when needed.
16153 (Sized_relobj::get_symbol_location_info): Adjust section links.
16154 Don't get fooled by special symbols.
16155 * object.h (class Xindex): Define.
16156 (class Object): Add xindex_ parameter. Declare virtual functoin
16157 do_initialize_xindex.
16158 (Object::adjust_sym_shndx): New function.
16159 (Object::set_xindex): New protected function.
16160 (class Symbol_value): Add is_ordinary_shndx_ field.
16161 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16162 (Symbol_value::value): Assert ordinary section.
16163 (Symbol_value::initialize_input_to_output_map): Likewise.
16164 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16165 Change all callers.
16166 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16167 all callers.
16168 (class Sized_relobj): Update declarations.
16169 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16170 parameter. Change all callers.
16171 (Sized_relobj::adjust_shndx): New function.
16172 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16173 field.
16174 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16175 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16176 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16177 (Sized_dynobj::read_dynsym_section): Adjust section links.
16178 (Sized_dynobj::read_dynamic): Likewise.
16179 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16180 section links.
16181 (Sized_dynobj::do_initialize_xindex): New function.
16182 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16183 do_initialize_xindex.
16184 (Sized_dynobj::adjust_shndx): New function.
16185 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16186 dynsym_xindex_ fields.
16187 (Layout::finalize): Add a call to set_section_indexes before
16188 creating the symtab sections.
16189 (Layout::set_section_indexes): Don't do anything if the section
16190 already has a section index.
16191 (Layout::create_symtab_sections): Add shnum parameter. Change
16192 caller. Create .symtab_shndx section if needed.
16193 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16194 caller.
16195 (Layout::allocated_output_section_count): New function.
16196 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16197 needed.
16198 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16199 fields. Update declarations.
16200 (Layout::symtab_xindex): New function.
16201 (Layout::dynsym_xindex): New function.
16202 (class Write_symbols_task): Add layout_ field.
16203 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16204 Change caller.
16205 * output.cc (Output_section_headers::Output_section_headers): Add
16206 shstrtab_section parameter. Change all callers.
16207 (Output_section_headers::do_sized_write): Store overflow values
16208 for section count and section string table section index in
16209 section header zero.
16210 (Output_file_header::do_sized_write): Check for overflow of
16211 section count and section string table section index.
16212 (Output_symtab_xindex::do_write): New function.
16213 (Output_symtab_xindex::endian_do_write): New function.
16214 * output.h (class Output_section_headers): Add shstrtab_section_.
16215 Update declarations.
16216 (class Output_symtab_xindex): Define.
16217 (Output_section::has_out_shndx): New function.
16218 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16219 field.
16220 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16221 Change all callers.
16222 (Sized_symbol::init): Likewise.
16223 (Symbol::output_section): Check for ordinary symbol.
16224 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16225 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16226 callers.
16227 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16228 Change all callers. Simplify handling of symbols from sections
16229 not included in the link.
16230 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16231 distinction.
16232 (Weak_alias_sorter::operator()): Assert that symbols are
16233 ordinary.
16234 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16235 distinction.
16236 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16237 parameters. Change all callers.
16238 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16239 symbol distinction. Use SHN_XINDEX when needed.
16240 (Symbol_table::write_section_symbol): Add symtab_xindex
16241 parameter. Change all callers.
16242 (Symbol_table::sized_write_section_symbol): Likewise. Use
16243 SHN_XINDEX when needed.
16244 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16245 declarations.
16246 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16247 (Symbol::is_defined): Check is_ordinary.
16248 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16249 (Symbol::is_absolute, Symbol::is_common): Likewise.
16250 (class Sized_symbol): Update declarations.
16251 (class Symbol_table): Update declarations.
16252 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16253 parameters. Change all callers.
16254 (Sized_symbol::override): Likewise.
16255 (Symbol_table::override): Likewise.
16256 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16257 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16258 is_ordinary, and orig_st_shndx parameters. Change all callers.
16259 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16260 to be in an ordinary section.
16261 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16262 object and is_ordinary parameters. Change all callers.
16263 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16264 Change all callers. Don't add undefined or non-ordinary symbols
16265 to reloc_map_.
16266 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16267 Change all callers.
16268 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16269 declarations.
16270 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16271 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16272 (Sized_relobj::relocate_sections): Likewise.
16273 * target-reloc.h (scan_relocs): Adjust section symbol index.
16274 (scan_relocatable_relocs): Likewise.
16275 * i386.cc (Scan::local): Check for ordinary symbols.
16276 * sparc.cc (Scan::local): Likewise.
16277 * x86_64.cc (Scan::local): Likewise.
16278 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16279 to symbol_section_and_value.
16280 * testsuite/many_sections_test.cc: New file.
16281 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16282 (check_PROGRAMS): Add many_sections_test.
16283 (many_sections_test_SOURCES): Define.
16284 (many_sections_test_DEPENDENCIES): Define.
16285 (many_sections_test_LDFLAGS): Define.
16286 (BUILT_SOURCES): Add many_sections_define.h.
16287 (many_sections_define.h): New target.
16288 (BUILT_SOURCES): Add many_sections_check.h.
16289 (many_sections_check.h): New target.
16290 (check_PROGRAMS): Add many_sections_r_test.
16291 (many_sections_r_test_SOURCES): Define.
16292 (many_sections_r_test_DEPENDENCIES): Define.
16293 (many_sections_r_test_LDFLAGS): Define.
16294 (many_sections_r_test_LDADD): Define.
16295 (many_sections_r_test.o): New target.
16296 * testsuite/Makefile.in: Rebuild.
16297
c5818ff1
CC
162982008-04-17 Cary Coutant <ccoutant@google.com>
16299
16300 * errors.cc (Errors::info): New function.
16301 (gold_info): New function.
16302 * errors.h (Errors::info): New function.
16303 * gold.h (gold_info): New function.
16304 * object.cc (Input_objects::add_object): Print trace output.
16305 * options.cc (options::parse_set): New function.
16306 (General_options::parse_wrap): Deleted.
16307 (General_options::General_options): Deleted initializer.
16308 * options.h (options::String_set): New typedef.
16309 (options::parse_set): New function.
16310 (DEFINE_set): New macro.
16311 (General_options::wrap): Changed to use DEFINE_set. Changed
16312 callers of any_wrap_symbols and is_wrap_symbol.
16313 (General_options::trace, General_options::trace_symbol):
16314 New options.
16315 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16316 (General_options::wrap_symbols_): Deleted.
16317 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16318
b5be4a7c
DM
163192008-04-17 David S. Miller <davem@davemloft.net>
16320
16321 * options.cc (General_options::parse_V): New function.
16322 * options.h: Add entries for -V and -Qy.
16323
155a0dd7
ILT
163242008-04-17 Ian Lance Taylor <iant@google.com>
16325
16326 * common.cc (Symbol_table::allocate_commons): Remove options
16327 parameter. Change caller.
16328 (Symbol_table::do_allocate_commons): Remove options parameter.
16329 Change caller. Just call do_allocate_commons_list twice.
16330 (Symbol_table::do_allocate_commons_list): New function, broken out
16331 of do_allocate_commons.
16332 * common.h (class Allocate_commons_task): Remove options_ field.
16333 Update constructor.
16334 * symtab.cc (Symbol_table::Symbol_table): Initialize
16335 tls_commons_.
16336 (Symbol_table::add_from_object): Put TLS common symbols on
16337 tls_commons_ list.
16338 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16339 which are IN_OUTPUT_DATA.
16340 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16341 allocate_commons and do_allocate_commons declarations. Declare
16342 do_allocate_commons_list.
16343 * gold.cc (queue_middle_tasks): Update creation of
16344 Allocate_commons_task to not pass options.
16345 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16346 (TLS_TEST_C_FLAGS): New variable.
16347 (tls_test_c_pic.o): New target.
16348 (tls_test_shared.so): Link in tls_test_c_pic.o.
16349 (tls_test_c_pic_ie.o): New target.
16350 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16351 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16352 (tls_test_c.o): New target.
16353 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16354 (tls_pic_test_LDADD): Likewise.
16355 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16356 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16357 (tls_test_c_gnu2.o): New target.
16358 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16359 tls_test_c_gnu2.o.
16360 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16361 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16362 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16363 * testsuite/tls_test.cc: Include "config.h".
16364 (t_last): Call t11_last.
16365 * testsuite/tls_test.h (t11, t11_last): Declare.
16366 * testsuite/tls_test_c.c: New file.
16367 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16368 * configure.ac: Check for OpenMP support.
16369 * configure, config.in, Makefile.in: Rebuild.
16370 * testsuite/Makefile.in: Rebuild.
16371
edfbb029
CC
163722008-04-16 Cary Coutant <ccoutant@google.com>
16373
16374 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16375 (Target_i386::tls_base_symbol_defined_): New field.
16376 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16377 (Target_i386::Scan::global): Likewise.
16378 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16379 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16380 (Target_x86_64::tls_base_symbol_defined_): New field.
16381 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16382 (Target_x86_64::Scan::global): Likewise.
16383
f3c69fca
CC
163842008-04-16 Cary Coutant <ccoutant@google.com>
16385
16386 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16387 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16388 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16389 building shared libraries.
16390 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16391 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16392 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16393 * testsuite/Makefile.in: Rebuild.
16394 * testsuite/weak_undef.h: New file.
16395 * testsuite/weak_undef_file1.cc: Add extra test cases.
16396 * testsuite/weak_undef_file2.cc: Likewise.
16397 * testsuite/weak_undef_test.cc: Likewise.
16398
7c414435
DM
163992008-04-16 David S. Miller <davem@davemloft.net>
16400
32b769e1
DM
16401 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16402 Add issued_non_pic_error_ field. Declare check_non_pic.
16403 (Target_sparc::Scan::check_non_pic): New function.
16404 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16405 (Target_sparc::Scan::global): Likewise.
16406
11936fb1
DM
16407 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16408 * configure: Rebuild.
16409
7c414435
DM
16410 * options.h (DEFINE_enable): New macro.
16411 (new_dtags): New enable option.
16412 (initfirst, interpose, loadfltr, nodefaultlib,
16413 nodelete, nodlopen, nodump): New -z options.
16414 * layout.cc (Layout:finish_dynamic_section): If new
16415 dtags enabled, emit DT_RUNPATH. Also, emit a
16416 DT_FLAGS_1 containing any specified -z flags.
16417
85c7bf8b
ILT
164182008-04-16 Ian Lance Taylor <iant@google.com>
16419
12c0daef
ILT
16420 * copy-relocs.cc: New file.
16421 * copy-relocs.h: New file.
16422 * reloc.cc: Remove Copy_relocs code.
16423 * reloc.h: Likewise.
16424 * reloc-types.h (struct Reloc_types) [both versions]: Add
16425 get_reloc_addend_noerror.
16426 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16427 variants of add_global which take an addend which must be zero.
16428 * i386.cc: Include "copy-relocs.h".
16429 (class Target_i386): Change type of copy_relocs_ to variable,
16430 update initializer.
16431 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16432 Change all callers.
16433 (Target_i386::do_finalize_sections): Change handling of
16434 copy_relocs_.
16435 * sparc.cc: Include "copy-relocs.h".
16436 (class Target_sparc): Change type of copy_relocs_ to variable,
16437 update initializer.
16438 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16439 Change all callers.
16440 (Target_sparc::do_finalize_sections): Change handling of
16441 copy_relocs_.
16442 * x86_64.cc: Include "copy-relocs.h".
16443 (class Target_x86_64): Change type of copy_relocs_ to variable,
16444 update initializer.
16445 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16446 class. Change all callers.
16447 (Target_x86_64::do_finalize_sections): Change handling of
16448 copy_relocs_.
16449 * Makefile.am (CCFILES): Add copy-relocs.cc.
16450 (HFILES): Add copy-relocs.h.
16451
4f4995b6
ILT
16452 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16453
85c7bf8b
ILT
16454 * testsuite/script_test_4.sh: Permit leading zeroes.
16455
4f2a9edd
ILT
164562008-04-15 Ian Lance Taylor <iant@google.com>
16457
e6188289
ILT
16458 * script-sections.cc (Script_sections::create_segments): Use
16459 header_size_adjustment even when there is enough room for the
16460 headers.
16461 * testsuite/script_test_4.sh: New file.
16462 * testsuite/script_test_4.t: New file.
16463 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16464 (check_DATA): Add script_test_4.stdout.
16465 (MOSTLYCLEANFILES): Likewise.
16466 (script_test_4): New target.
16467 (script_test_4.stdout): New target.
16468 * testsuite/Makefile.in: Rebuild.
16469
4f2a9edd
ILT
16470 * sparc.cc: Add definitions for Output_data_plt_sparc class
16471 constants.
16472
f5314dd5
DM
164732008-04-14 David S. Miller <davem@davemloft.net>
16474
16475 * sparc.cc: New file.
16476 * Makefile.am (TARGETSOURCES): Add sparc.cc
16477 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16478 * configure.tgt: Document targ_extra_size and
16479 targ_extra_big_endian. Add entries for sparc-* and
16480 sparc64-*.
16481 * configure.ac: Handle targ_extra_size and
16482 targ_extra_big_endian.
16483 * Makefile.in: Rebuild.
16484 * configure: Likewise.
16485 * po/POTFILES.in: Likewise.
16486 * po/gold.pot: Likewise.
16487
154e0e9a
ILT
164882008-04-14 Ian Lance Taylor <iant@google.com>
16489
16490 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16491 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16492 in the name/type/flags to section mapping. Don't call
16493 allocate_output_section.
16494 (Layout::choose_output_section): Change parameter from adjust_name
16495 to is_input_section. Don't permit input sections after sections
16496 are attached to segments. Don't call allocate_output_section.
16497 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16498 not write_enable_output_section.
16499 (Layout::make_output_section): Don't push to
16500 unattached_section_list_ nor call attach_to_segment. Call
16501 attach_section_to_segment if sections are attached.
16502 (Layout::attach_sections_to_segments): New function.
16503 (Layout::attach_section_to_segment): New function.
16504 (Layout::attach_allocated_section_to_segment): Rename from
16505 attach_to_segment. Remove flags parameter.
16506 (Layout::allocate_output_section): Remove function.
16507 (Layout::write_enable_output_section): Remove function.
16508 * layout.h (class Layout): Update for above changes. Add new
16509 field sections_are_attached_.
16510 * output.h (Output_section::update_flags_for_input_section): New
16511 function.
16512 * output.cc (Output_section::add_input_section): Call
16513 update_flags_for_input_section.
16514 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16515
009a67a2
CC
165162008-04-11 Cary Coutant <ccoutant@google.com>
16517
16518 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16519 thought unnecessary.
16520 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16521
759b1a24
ILT
165222008-04-11 Ian Lance Taylor <iant@google.com>
16523
16524 * output.h (class Output_section_data): Remove inline definition
16525 of set_addralign.
16526 * output.cc (Output_section_data::set_addralign): New function.
16527
c2b45e22
CC
165282008-04-11 Cary Coutant <ccoutant@google.com>
16529
16530 Add support for TLS descriptors for i386 and x86_64.
16531 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16532 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16533 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16534 GOT_TYPE_TLS_DESC.
16535 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16536 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16537 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16538 relocations.
16539 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16540 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16541 Fix problem with initial-exec relocations.
16542 (Target_i386::Relocate::relocate_tls): Likewise.
16543 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16544 relaxation.
16545 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16546 support for section-plus-offset dynamic table entries.
16547 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16548 (Output_data_dynamic::Dynamic_entry): Add support for
16549 section-plus-offset dynamic table entries.
16550 (Output_data_dynamic::Classification): Likewise.
16551 (Output_data_dynamic::classification_): Renamed offset_.
16552 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16553 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16554 (Target_x86_64::make_plt_section): New function.
16555 (Target_x86_64::reserve_tlsdesc_entries): New function.
16556 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16557 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16558 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16559 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16560 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16561 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16562 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16563 add extra PLT entry for TLS descriptors.
16564 (Output_data_plt_x86_64::got_): New field.
16565 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16566 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16567 fields.
16568 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16569 descriptors.
16570 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16571 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16572 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16573 R_386_TLS_DESC_CALL relocations.
16574 (Target_x86_64::Scan::global): Likewise.
16575 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16576 for TLS descriptors.
16577 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16578 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16579 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16580 GD-to-IE relaxation.
16581 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16582 and TLS_DESCRIPTORS.
16583 * Makefile.in: Rebuild.
16584 * configure: Rebuild.
16585 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16586 (tls_test_shared2.so): New target.
16587 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16588 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16589 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16590 (tls_shared_gd_to_ie_test_LDADD): New variable.
16591 (tls_shared_gnu2_gd_to_ie_test): New target.
16592 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16593 New targets.
16594 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16595 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16596 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16597 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16598 (tls_shared_gnu2_test): New target.
16599 (tls_test_gnu2_shared.so): New target.
16600 (tls_shared_gnu2_test_SOURCES): New variable.
16601 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16602 (tls_shared_gnu2_test_LDFLAGS): New variable.
16603 (tls_shared_gnu2_test_LDADD): New variable.
16604 * testsuite/Makefile.in: Rebuild.
16605 * testsuite/Makefile.
16606
83bfb6b7
ILT
166072008-04-11 Ian Lance Taylor <iant@google.com>
16608
16609 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16610 justsyms.t.
16611 * testsuite/Makefile.in: Rebuild.
16612
16613 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16614 long.
16615 * testsuite/script_test_2.cc (main): Adjust test.
16616
706e1f5e
ILT
166172008-04-11 David S. Miller <davem@davemloft.net>
16618 Ian Lance Taylor <iant@google.com>
16619
16620 * options.h (General_options): Add entries for '-Y' and
16621 '-relax'.
16622 * options.cc (General_options:finalize): If -Y was used, add those
16623 entries to the library path instead of the default "/lib" and
16624 "/usr/lib".
16625
7c98e6bb
DM
166262008-04-11 David S. Miller <davem@davemloft.net>
16627
16628 * testsuite/justsyms.t: Start at 0x100.
16629 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16630 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16631 long.
16632 * testsuite/script_test_2.cc: Adjust string and section length
16633 checks.
7c98e6bb 16634
99a37bfd
ILT
166352008-04-09 Ian Lance Taylor <iant@google.com>
16636
2cefc357
ILT
16637 PR gold/5996
16638 * script-sections.cc (Sections_element::allocate_to_segment): Add
16639 orphan parameter.
16640 (Output_section_definition::allocate_to_segment): Likewise.
16641 (Orphan_output_section::allocate_to_segment): Likewise.
16642 (Script_sections::attach_sections_using_phdrs_clause): Don't
16643 propagate non-PT_LOAD segments to orphan sections.
16644 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16645 readelf rather than objdump.
16646 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16647 .interp section and PT_INTERP segment are the same size.
16648 * testsuite/Makefile.in: Rebuild.
16649
99a37bfd
ILT
16650 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16651 aliases for symbols defined in the same object.
16652 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16653 (weak_alias_test_SOURCES): New variable.
16654 (weak_alias_test_DEPENDENCIES): New variable.
16655 (weak_alias_test_LDFLAGS): New variable.
16656 (weak_alias_test_LDADD): New variable.
16657 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16658 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16659 (weak_alias_test_3.o): New target.
16660 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16661 * testsuite/weak_alias_test_main.cc: New file.
16662 * testsuite/weak_alias_test_1.cc: New file.
16663 * testsuite/weak_alias_test_2.cc: New file.
16664 * testsuite/weak_alias_test_3.cc: New file.
16665
780e49c5
ILT
166662008-04-08 Ian Lance Taylor <iant@google.com>
16667
cdb0b8f5
ILT
16668 * options.h (class General_options): Add --noinhibit-exec option.
16669 * main.cc (main): Check --noinhibit-exec.
16670
0864d551
ILT
16671 * options.h (class General_options): Define --wrap as a special
16672 option. Add wrap_symbols_ field.
16673 (General_options::any_wrap_symbols): New function.
16674 (General_options::is_wrap_symbol): New function.
16675 * options.cc (General_options::parse_wrap): New function.
16676 (General_options::General_options): Initialize wrap_symbols_.
16677 * symtab.cc (Symbol_table::wrap_symbol): New function.
16678 (Symbol_table::add_from_object): Handle --wrap.
16679 * symtab.h (class Symbol_table): Declare wrap_symbol.
16680 * target.h (Target::wrap_char): New function.
16681 (Target::Target_info): Add wrap_char field.
16682 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16683 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16684 * testsuite/testfile.cc (Target_test::test_target_info):
16685 Likewise.
16686
789aa6de
ILT
16687 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16688 there is one.
16689
2c38906f
ILT
16690 * layout.h (class Layout): Add added_eh_frame_data_ field.
16691 * layout.cc (Layout::Layout): Initialize new field.
16692 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16693 output section until we find a section we merged successfully.
16694 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16695 that the size be non-zero.
16696
780e49c5
ILT
16697 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16698 qualifier.
16699
7fcd0256
ILT
167002008-04-08 Craig Silverstein <csilvers@google.com>
16701
16702 * configure.ac: Export new conditional variable HAVE_ZLIB.
16703 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16704 on HAVE_ZLIB.
16705 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16706 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16707
6835af53
ILT
167082008-04-07 Ian Lance Taylor <iant@google.com>
16709
e24f324c
ILT
16710 * version.cc (version_string): Set to "1.5".
16711
a036edd8
ILT
16712 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16713 Add issued_non_pic_error_ field. Declare check_non_pic.
16714 (Target_x86_64::Scan::check_non_pic): New function.
16715 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16716 (Target_x86_64::Scan::global): Likewise.
16717
624f8810
ILT
16718 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16719 addend parameter. Change caller. Handle merge sections.
16720 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16721 Address to Addend. Don't add in the result of
16722 local_section_offset, pass down the addend and use the returned
16723 value.
16724 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16725 Update declarations of local_section_offset and symbol_value.
16726 * testsuite/two_file_test_1.cc (t18): New function.
16727 * testsuite/two_file_test_2.cc (f18): New function.
16728 * testsuite/two_file_test_main.cc (main): Call t18.
16729 * testsuite/two_file_test.h (t18, f18): Declare.
16730
6835af53
ILT
16731 * configure.ac: Don't test for objdump, c++filt, or readelf.
16732 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16733 conditionals.
16734 (TEST_READELF): New variable.
16735 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16736 (check_PROGRAMS): Add two_file_strip_test.
16737 (two_file_strip_test): New target.
16738 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16739 (two_file_same_shared_strip_test_SOURCES): New variable.
16740 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16741 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16742 (two_file_same_shared_strip_test_LDADD): New variable.
16743 (two_file_shared_strip.so): New target.
16744 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16745 (ver_test_5.syms, ver_test_7.syms): Likewise.
16746 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16747 (strip_test_3.stdout): Use TEST_OBJDUMP.
16748 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16749
86925eef
CC
167502008-04-04 Cary Coutant <ccoutant@google.com>
16751
16752 * symtab.h (Symbol::is_weak_undefined): New function.
16753 (Symbol::is_strong_undefined): New function.
16754 (Symbol::is_absolute): New function.
16755 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16756 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16757 absolute symbols.
16758 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16759 (weak_undef_test): New target.
16760 * testsuite/Makefile.in: Rebuild.
16761 * testsuite/weak_undef_file1.cc: New file.
16762 * testsuite/weak_undef_file2.cc: New file.
16763 * testsuite/weak_undef_test.cc: New file.
16764
126f3ece
ILT
167652008-04-03 Craig Silverstein <csilvers@google.com>
16766
16767 * compressed_output.h (class Output_compressed_section): Use
16768 unsigned buffer.
16769 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16770 add zlib header.
16771 (zlib_compressed_suffix): Removed.
16772 (Output_compressed_section::set_final_data_size): Use unsigned
16773 buffers.
16774 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16775 Fix linker invocation.
16776 (flagstest_o_specialfile_and_compress_debug_sections):
16777 Likewise.
16778 * testsuite/Makefile.in: Regenerated.
16779
deae2a14
DM
167802008-04-02 David S. Miller <davem@davemloft.net>
16781
16782 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16783 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16784
70752818
ILT
167852008-04-02 Craig Silverstein <csilvers@google.com>
16786
16787 * TODO: New file.
16788
39d0cb0e
ILT
167892008-04-02 Ian Lance Taylor <iant@google.com>
16790
16791 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16792 parameters. Update for new key type to views_. Change all
16793 callers.
16794 (File_read::read): Adjust for byteshift in returned view.
16795 (File_read::add_view): New function, broken out of
16796 find_and_make_view.
16797 (File_read::make_view): New function, broken out of
16798 find_and_make_view.
16799 (File_read::find_or_make_view): Add offset and aligned
16800 parameters. Rewrite accordingly. Change all callers.
16801 (File_read::get_view): Add offset and aligned parameters. Adjust
16802 for byteshift in return value.
16803 (File_read::get_lasting_view): Likewise.
16804 * fileread.h (class File_read): Update declarations.
16805 (class File_read::View): Add byteshift_ field. Add byteshift to
16806 constructor. Add byteshift method.
16807 * archive.h (Archive::clear_uncached_views): New function.
16808 (Archive::get_view): Add aligned parameter. Change all callers.
16809 * object.h (Object::get_view): Add aligned parameter. Change all
16810 callers.
16811 (Object::get_lasting_view): Likewise.
16812
16813 * fileread.cc (File_read::release): Don't call clear_views if
16814 there are multiple objects.
16815 * fileread.h (File_read::clear_uncached_views): New function.
16816 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16817 on the archive.
16818
a1207466
CC
168192008-03-31 Cary Coutant <ccoutant@google.com>
16820
16821 Add thin archive support.
16822 * archive.cc (Archive::armagt): New const.
16823 (Archive::setup): Remove task parameter and calls to unlock.
16824 (Archive::unlock_nested_archives): New function.
16825 (Archive::read_header): Add nested_off parameter. Change
16826 all callers.
16827 (Archive::interpret_header): Likewise.
16828 (Archive::include_all_members): Change to handle thin
16829 archives.
16830 (Archive::include_member): Likewise.
16831 * archive.h (Archive::Archive): Add new parameters and
16832 initializers.
16833 (Archive::armagt): New const.
16834 (Archive::setup): Remove task parameter.
16835 (Archive::unlock_nested_archives): New function.
16836 (Archive::read_header): Add nested_off parameter.
16837 (Archive::interpret_header): Likewise.
16838 (Archive::Nested_archive_table): New typedef.
16839 (Archive::is_thin_archive_): New field.
16840 (Archive::nested_archives_): New field.
16841 (Archive::options_): New field.
16842 (Archive::dirpath_): New field.
16843 (Archive::task_): New field.
16844 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16845 for thin archives. Pass additional parameters to
16846 Archive::Archive. Unlock the archive file after calling
16847 Archive::setup.
cd536b21 16848
479f6503
ILT
168492008-03-29 Ian Lance Taylor <iant@google.com>
16850
686c8caf
ILT
16851 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16852 version symbol to be local.
16853 * testsuite/ver_test_4.sh: New file.
16854 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16855 (check_DATA): Add ver_test_4.syms.
16856 (ver_test_4.syms): New target.
16857 * testsuite/Makefile.in: Rebuild.
16858
ab794b6b
ILT
16859 * output.cc
16860 (Output_section::Input_section_sort_entry::has_priority): New
16861 function.
16862 (Output_section::Input_section_sort_entry::match_file_name): New
16863 function.
16864 (Output_section::Input_section_sort_entry::match_section_name):
16865 Remove.
16866 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16867 Remove.
16868 (Output_section::Input_section_sort_entry::match_section_file):
16869 Remove.
16870 (Output_section::Input_section_sort_compare::operator()): Rewrite
16871 using new Input_section_sort_entry functions. Sort crtbegin and
16872 crtend first. Sort sections with no priority before sections with
16873 a priority.
16874 * testsuite/initpri1.c (d3): Check j != 4.
16875 (cd5): New constructor/destructor function.
16876 (main): Check j != 2.
16877
479f6503
ILT
16878 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16879 new symbol when resolving, don't call set_is_default.
16880 * testsuite/ver_test_7.cc: New file.
16881 * testsuite/ver_test_7.sh: New file.
16882 * testsuite/Makefile.am (ver_test_7.so): New target.
16883 (ver_test_7.o): New target.
16884 (check_SCRIPTS): Add ver_test_7.sh.
16885 (check_DATA): Add ver_test_7.syms.
16886 (ver_test_7.syms): New target.
16887
2fd32231
ILT
168882008-03-28 Ian Lance Taylor <iant@google.com>
16889
16890 * layout.cc (Layout::layout): If we see an input section with a
16891 name that needs sorting, set the must_sort flag for the output
16892 section.
16893 (Layout::make_output_section): If the name of the output section
16894 indicates that it might require sorting, set the may_sort flag.
16895 * output.h (Output_section::may_sort_attached_input_sections): New
16896 function.
16897 (Output_section::set_may_sort_attached_input_sections): New
16898 function.
16899 (Output_section::must_sort_attached_input_sections): New
16900 function.
16901 (Output_section::set_must_sort_attached_input_sections): New
16902 function.
16903 (class Output_section): Declare Input_section_sort_entry. Define
16904 Input_section_sort_compare. Declare
16905 sort_attached_input_sections. Add new fields:
16906 may_sort_attached_input_sections_,
16907 must_sort_attached_input_sections_,
16908 attached_input_sections_are_sorted_.
16909 * output.cc (Output_section::Output_section): Initialize new
16910 fields.
16911 (Output_section::add_input_section): Add an entry to
16912 input_sections_ if may_sort or must_sort are true.
16913 (Output_section::set_final_data_size): Call
16914 sort_attached_input_sections if necessary.
16915 (Output_section::Input_section_sort_entry): Define new class.
16916 (Output_section::Input_section_sort_compare::operator()): New
16917 function.
16918 (Output_section::sort_attached_input_sections): New function.
16919 * configure.ac: Check whether the compiler supports constructor
16920 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16921 * testsuite/initpri1.c: New file.
16922 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16923 CONSTRUCTOR_PRIORITY.
16924 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16925 (initpri1_LDFLAGS): New variable.
16926 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16927
18e6b24e
ILT
169282008-03-27 Ian Lance Taylor <iant@google.com>
16929
49bdd526
ILT
16930 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16931 * testsuite/common_test_1.c: New file.
16932 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16933 (common_test_1_SOURCES): New variable.
16934 (common_test_1_DEPENDENCIES): New variable.
16935 (common_test_1_LDFLAGS): New variable.
16936
18e6b24e
ILT
16937 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16938 and commons_ correctly when NAME/VERSION does not override
16939 NAME/NULL.
16940 * testsuite/ver_test_6.c: New file.
16941 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16942 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16943 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16944
04bf7072
ILT
169452008-03-26 Ian Lance Taylor <iant@google.com>
16946
5871526f
ILT
16947 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16948 of an undefined symbol from a version script.
16949 * testsuite/Makefile.am (ver_test_5.so): New target.
16950 (ver_test_5.o): New target.
16951 (check_SCRIPTS): Add ver_test_5.sh.
16952 (check_DATA): Add ver_test_5.syms.
16953 (ver_test_5.syms): New target.
16954 * testsuite/ver_test_5.cc: New file.
16955 * testsuite/ver_test_5.script: New file.
16956 * testsuite/ver_test_5.sh: New file.
16957 * Makefile.in, testsuite/Makefile.in: Rebuild.
16958
04bf7072
ILT
16959 PR gold/5986
16960 Fix problems building gold with gcc 4.3.0.
16961 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16962 (gold_error_at_location, gold_warning_at_location): Use it.
16963 * configure.ac: Check whether we can compile and use a template
16964 function with a printf attribute.
16965 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16966 when jumping over bytes.
16967 * object.cc: Instantiate Object::read_section_data.
16968 * debug.h: Include <cstring>
16969 * dwarf_reader.cc: Include <algorithm>
16970 * main.cc: Include <cstring>.
16971 * options.cc: Include <cstring>.
16972 * output.cc: Include <cstring>.
16973 * script.cc: Include <cstring>.
16974 * script.h: Include <string>.
16975 * symtab.cc: Include <cstring> and <algorithm>.
16976 * target-select.cc: Include <cstring>.
16977 * version.cc: Include <string>.
16978 * testsuite/testmain.cc: Include <cstdlib>.
16979 * configure, config.in: Rebuild.
16980
874c5b28
ILT
169812008-03-25 Ian Lance Taylor <iant@google.com>
16982
819d6c3a
ILT
16983 * options.cc: Include "../bfd/bfdver.h".
16984 (options::help): Print bug reporting address.
16985
f4b2c6f5
ILT
16986 * version.cc (print_version): Adjust output for current value of
16987 BFD_VERSION_STRING.
16988
16989 * NEWS: New file.
16990
e96caa79
ILT
16991 * options.cc (options::help): Print list of supported targets.
16992 * target-select.h: Include <vector>.
16993 (class Target_selector): Make machine_, size_, and is_big_endian_
16994 fields const. Add bfd_name_ and instantiated_target_ fields.
16995 (Target_selector::Target_selector): Add bfd_name parameter.
16996 (Target_selector::recognize): Make non-virtual, call
16997 do_recognize.
16998 (Target_selector::recognize_by_name): Make non-virtual, call
16999 do_recognize_by_name.
17000 (Target_selector::supported_names): New function.
17001 (Target_selector::bfd_name): New function.
17002 (Target_selector::do_instantiate_target): New pure virtual
17003 function.
17004 (Target_selector::do_recognize): New virtual function.
17005 (Target_selector::do_recognize_by_name): New virtual function.
17006 (Target_selector::instantiate_target): New private function.
17007 (supported_target_names): Declare.
17008 * target-select.cc (Target_selector::Target_selector): Update for
17009 new parameter and fields.
17010 (select_target_by_name): Check that the name matches before
17011 calling recognize_by_name.
17012 (supported_target_names): New function.
17013 * i386.cc (class Target_selector_i386): Update Target_selector
17014 constructor call. Remove recognize and recognize_by_name. Add
17015 do_instantiate_target.
17016 * x86_64.cc (class Target_selector_x86_64): Likewise.
17017 * testsuite/testfile.cc (class Target_selector_test): Update for
17018 changes to Target_selector.
17019
874c5b28
ILT
17020 * README: Rewrite, with some notes on unsupported features.
17021
0a65a3a7
CC
170222008-03-24 Cary Coutant <ccoutant@google.com>
17023
17024 * i386.cc (Target_i386::Got_type): New enum declaration.
17025 (Target_i386::Scan::local): Updated callers of Output_data_got
17026 member functions.
17027 (Target_i386::Scan::global): Likewise.
17028 (Target_i386::Relocate::relocate): Likewise.
17029 (Target_i386::Relocate::relocate_tls): Likewise.
17030 * object.h (Got_offset_list): New class.
17031 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17032 (Sized_relobj::local_got_offset): Likewise.
17033 (Sized_relobj::set_local_got_offset): Likewise.
17034 (Sized_relobj::local_has_tls_got_offset): Removed.
17035 (Sized_relobj::local_tls_got_offset): Removed.
17036 (Sized_relobj::set_local_tls_got_offset): Removed.
17037 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17038 * output.cc (Output_data_got::add_global): Added got_type parameter.
17039 (Output_data_got::add_global_with_rel): Likewise.
17040 (Output_data_got::add_global_with_rela): Likewise.
17041 (Output_data_got::add_global_pair_with_rel): New function.
17042 (Output_data_got::add_global_pair_with_rela): New function.
17043 (Output_data_got::add_local): Added got_type parameter.
17044 (Output_data_got::add_local_with_rel): Likewise.
17045 (Output_data_got::add_local_with_rela): Likewise.
17046 (Output_data_got::add_local_pair_with_rel): New function.
17047 (Output_data_got::add_local_pair_with_rela): New function.
17048 (Output_data_got::add_global_tls): Removed.
17049 (Output_data_got::add_global_tls_with_rel): Removed.
17050 (Output_data_got::add_global_tls_with_rela): Removed.
17051 (Output_data_got::add_local_tls): Removed.
17052 (Output_data_got::add_local_tls_with_rel): Removed.
17053 (Output_data_got::add_local_tls_with_rela): Removed.
17054 * output.h (Output_data_got::add_global): Added got_type parameter.
17055 (Output_data_got::add_global_with_rel): Likewise.
17056 (Output_data_got::add_global_with_rela): Likewise.
17057 (Output_data_got::add_global_pair_with_rel): New function.
17058 (Output_data_got::add_global_pair_with_rela): New function.
17059 (Output_data_got::add_local): Added got_type parameter.
17060 (Output_data_got::add_local_with_rel): Likewise.
17061 (Output_data_got::add_local_with_rela): Likewise.
17062 (Output_data_got::add_local_pair_with_rel): New function.
17063 (Output_data_got::add_local_pair_with_rela): New function.
17064 (Output_data_got::add_global_tls): Removed.
17065 (Output_data_got::add_global_tls_with_rel): Removed.
17066 (Output_data_got::add_global_tls_with_rela): Removed.
17067 (Output_data_got::add_local_tls): Removed.
17068 (Output_data_got::add_local_tls_with_rel): Removed.
17069 (Output_data_got::add_local_tls_with_rela): Removed.
17070 * resolve.cc (Symbol::override_base_with_special): Removed
17071 reference to has_got_offset_ field.
17072 * symtab.cc (Symbol::init_fields): Replaced initialization
17073 of got_offset_ with got_offsets_. Removed initialization
17074 of has_got_offset_
53fcba31 17075 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17076 (Symbol::got_offset): Likewise.
17077 (Symbol::set_got_offset): Likewise.
17078 (Symbol::has_tls_got_offset): Removed.
17079 (Symbol::tls_got_offset): Removed.
17080 (Symbol::set_tls_got_offset): Removed.
17081 (Symbol::got_offset_): Removed.
17082 (Symbol::tls_mod_got_offset_): Removed.
17083 (Symbol::tls_pair_got_offset_): Removed.
17084 (Symbol::got_offsets_): New field.
17085 (Symbol::has_got_offset): Removed.
17086 (Symbol::has_tls_mod_got_offset): Removed.
17087 (Symbol::has_tls_pair_got_offset): Removed.
17088 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17089 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17090 member functions.
17091 (Target_x86_64::Scan::global): Likewise.
17092 (Target_x86_64::Relocate::relocate): Likewise.
17093 (Target_x86_64::Relocate::relocate_tls): Likewise.
17094
bd52eafb
BE
170952008-03-25 Ben Elliston <bje@au.ibm.com>
17096
17097 * yyscript.y: Fix spelling error in comment.
17098
8b105e34
ILT
170992008-03-24 Ian Lance Taylor <iant@google.com>
17100
8ed814a9
ILT
17101 * options.h (class General_options): Define build_id option.
17102 * layout.h (class Layout): Declare write_build_id, create_note,
17103 create_build_id. Add build_id_note_ member.
17104 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17105 "libiberty.h", "md5.h", "sha1.h".
17106 (Layout::Layout): Initialize eh_frame_data_,
17107 eh_frame_hdr_section_, and build_id_note_.
17108 (Layout::finalize): Call create_build_id.
17109 (Layout::create_note): New function, broken out of
17110 Layout::create_gold_note.
17111 (Layout::create_gold_note): Call create_note.
17112 (Layout::create_build_id): New function.
17113 (Layout::write_build_id): New function.
17114 (Close_task_runner::run): Call write_build_id.
17115
8b105e34
ILT
17116 * x86_64.cc: Correct license to GPLv3.
17117
086a1841
ILT
171182008-03-23 Ian Lance Taylor <iant@google.com>
17119
17120 * options.cc: Include "demangle.h".
17121 (parse_optional_string): New function.
17122 (parse_long_option): Handle takes_optional_argument.
17123 (parse_short_option): Update dash_z initializer. Handle
17124 takes_optional_argument.
17125 (General_options::General_options): Initialize do_demangle_.
17126 (General_options::finalize): Set do_demangle_. Handle demangling
17127 style.
17128 * options.h (parse_optional_string): Declare.
17129 (struct One_option): Add optional_arg field. Update constructor.
17130 Update call constructor calls. Add takes_optional_argument
17131 function.
17132 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17133 (DEFINE_optional_string): Define.
17134 (General_options::demangle): Change from DEFINE_bool to
17135 DEFINE_optional_string.
17136 (General_options::no_demangle): New function.
17137 (General_options::do_demangle): New function.
17138 (General_options::set_do_demangle): New function.
17139 (General_options::execstack_status_): Move definition to end of
17140 class definition.
17141 (General_options::static_): Likewise.
17142 (General_options::do_demangle_): New field.
17143 * object.cc (big_endian>::get_symbol_location_info): Call
17144 Options::do_demangle, not Options::demangle.
17145 * symtab.cc (demangle): Likewise.
17146
cbb93e63
ILT
171472008-03-22 Ian Lance Taylor <iant@google.com>
17148
17149 * gold.h: Include <cstddef> and <sys/types.h>
17150 * options.h: Include <cstring>.
17151
ec531623
ILT
171522008-03-21 Ian Lance Taylor <iant@google.com>
17153
17154 * Added source code to GNU binutils.
752937aa 17155\f
b90efa5b 17156Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17157
17158Copying and distribution of this file, with or without modification,
17159are permitted in any medium without royalty provided the copyright
17160notice and this notice are preserved.
17161
17162Local Variables:
17163mode: change-log
17164left-margin: 8
17165fill-column: 74
17166version-control: never
17167End:
This page took 1.122802 seconds and 4 git commands to generate.