]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gold/ChangeLog
Use software watchpoints if hardware watchpoints are not available when testing gdb...
[thirdparty/binutils-gdb.git] / gold / ChangeLog
CommitLineData
faa2211d
AM
12015-04-28 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
4 than unsigned int for find_global_entry result temp. Compare
5 against invalid_address.
6 (Target_powerpc::do_plt_address_for_global): Likewise.
7 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
8 on plt call stub existence for debug info. Do assert for plt
9 and global entry stub existence if an alloc section.
10
6ec65f28
AM
112015-04-28 Alan Modra <amodra@gmail.com>
12
13 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
14 on missing global entry stub due to bogus debug info.
15
7a2a1c79
HS
162015-04-27 Han Shen <shenhan@google.com>
17
18 * options.h (--fix-cortex-a53-843419): Rename option.
19 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
20 option.
21 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
22
cfbf0e3c
RÁE
232015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
24
25 PR gold/18327
26 * output.cc (Output_section::is_input_address_mapped): Assume a missing
27 entry is mapped.
28 * testsuite/Makefile.am: Add the eh_test test.
29 * testsuite/Makefile.in: Regenerate.
30 * testsuite/eh_test_a.cc: New test.
31 * testsuite/eh_test_b.cc: New test.
32
6ec65f28
AM
332015-04-23 Sriraman Tallam <tmsriram@google.com>
34
a100d66f
ST
35 * options.h (--weak-unresolved-symbols): New option.
36 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
37 binding to weak with new option.
38 * symtab.h (is_weak_undefined): Check for new option.
39 (is_strong_undefined): Check for new option.
40 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
41 * testsuite/Makefile.in: Regenerate.
42 * testsuite/weak_unresolved_symbols_test.cc: New file.
43
4b889c30
IC
442015-04-20 Ian Coolidge <icoolidge@google.com>
45
46 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
47 GNU_UNIQUE.
48
4277535c
RÁE
492015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
50
51 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
52 push_back.
53 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
54 * object.cc (Sized_relobj_file::do_layout): Use push_back.
55 * powerpc.cc (process_gc_mark): Use push_back.
56 (Target_powerpc::do_gc_mark_symbol): Use push_back.
57 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
58
7a2a1c79 592015-04-16 Han Shen <shenhan@google.com>
5019d64a 60
6ec65f28
AM
61 * aarch64.cc (AArch64_insn_utilities): New utility class.
62 (AArch64_relobj::Mapping_symbol_position): New struct.
63 (AArch64_relobj::Mapping_symbol_info): New typedef.
64 (AArch64_relobj::do_count_local_symbols): New function overriding
65 parent's implementation.
66 (AArch64_relobj::mapping_symbol_info_): New member
67 (AArch64_relobj::scan_erratum_843419): New method.
68 (Target_aarch64::scan_erratum_843419_span): New method.
69 (Target_aarch64::is_erratum_843419_sequence): New method.
70 * options.h (fix_cortex_a53): New option.
5019d64a 71
a6a17750
CC
722015-04-09 Cary Coutant <ccoutant@google.com>
73
74 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
75 in a PIE link.
76 * testsuite/Makefile.am (tls_pie_test.sh): New test.
77 * testsuite/Makefile.in: Regenerate.
78 * testsuite/tls_pie_test.sh: New.
79
437ddf0c
CC
802015-04-09 Cary Coutant <ccoutant@google.com>
81
82 * debug.h (DEBUG_LOCATION): New.
83 (DEBUG_ALL): Include DEBUG_LOCATION.
84 (debug_string_to_enum): Add DEBUG_LOCATION.
85 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
86 output to print correct context.
87 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
88 up to 4 more locations at the beginning of the function.
89 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
90 result before sorting list of line numbers.
91 * testsuite/debug_msg.sh: Allow range of line numbers for
92 canonical results on optimized code.
93
24491327
HS
942015-04-07 HC Yen <hc.yen@mediatek.com>
95
96 Add AArch32 support for gold linker.
97 gold/
98 * arm.cc: Add V8 arch combine table.
99
7fa5525f
RÁE
1002015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
101
102 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
103
5368dcf2
RÁE
1042015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
105
106 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
107 to find by using the return value of insert.
108
9dbb4b02
RÁE
1092015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
110
111 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
112 constructor call.
113
1fa29f10
IT
1142015-04-06 Ilya Tocar <ilya.tocar@intel.com>
115
116 PR gold/17641
117 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
118 (Target_x86_64::Scan::local): Don't create GOT entry, when we
119 can convert mov to lea.
120 (Target_x86_64::Scan::global): Ditto.
121 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
122 %reg to lea foo(%rip), %reg if possible.
123 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
124 * testsuite/x86_64_mov_to_lea1.s: New.
125 * testsuite/x86_64_mov_to_lea2.s: Ditto.
126 * testsuite/x86_64_mov_to_lea3.s: Ditto.
127 * testsuite/x86_64_mov_to_lea4.s: Ditto.
128 * testsuite/x86_64_mov_to_lea.sh: Ditto.
129
39f3de7c
L
1302015-04-02 H.J. Lu <hongjiu.lu@intel.com>
131
132 * configure: Regenerated.
133
c4fc4724
IT
1342015-04-01 Ilya Tocar <ilya.tocar@intel.com>
135
136 PR gold/17640
137 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
138 (Target_i386::Scan::local): Don't create GOT entry, when we
139 can convert GOT to GOTOFF.
140 (Target_i386::Scan::global): Ditto.
141 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
142 lea foo@GOTOFF(%reg), %reg if possible.
143 * testsuite/Makefile.am (i386_mov_to_lea): New test.
144 * testsuite/i386_mov_to_lea1.s: New.
145 * testsuite/i386_mov_to_lea2.s: Ditto.
146 * testsuite/i386_mov_to_lea3.s: Ditto.
147 * testsuite/i386_mov_to_lea4.s: Ditto.
148 * testsuite/i386_mov_to_lea5.s: Ditto.
149 * testsuite/i386_mov_to_lea.sh: Ditto.
150
918357b9
L
1512015-04-01 H.J. Lu <hongjiu.lu@intel.com>
152
153 * Makefile.am (ZLIB): New.
154 (ZLIBINC): Likewise.
155 (AM_CFLAGS): Add $(ZLIBINC).
156 (AM_CXXFLAGS): Likewise.
157 (ldadd_varldadd_var): Add $(ZLIB).
158 (incremental_dump_LDADD): Likewise.
159 (dwp_LDADD): Likewise.
160 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
161 <zlib.h>.
162 (zlib_compress): Don't check HAVE_ZLIB_H.
163 (zlib_decompress): Likewise.
164 * options.h (compress_debug_sections): Likewise.
165 * configure.ac (AM_CONDITIONAL): Removed.
166 * testsuite/Makefile.am (ZLIB): New.
167 (LDADD): Add $(ZLIB).
168 Don't check HAVE_ZLIB.
169 * Makefile.in: Regenerated.
170 * config.in: Likewise.
171 * configure: Likewise.
172 * testsuite/Makefile.in: Likewise.
173
6b0ad2eb
JY
1742015-03-30 Jing Yu <jingyu@google.com>
175
176 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
177 TLSLD_ADD_DTPREL_LO12_NC.
178 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
179 _TLS_MODULE_BASE_ point to the start of tls segment.
180 (Target_aarch64::optimize_tls_reloc): Add cases for
181 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
182 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
183 (Target_aarch64::Scan::local): Likewise.
184 (Target_aarch64::Scan::global): Likewise.
185 (Target_aarch64::Relocate::relocate): Likewise.
186 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
187 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
188 relocations.
189
0916f9e7
RÁE
1902015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
191
192 * merge.cc (Object_merge_map::add_mapping): call
193 Object_merge_map::Input_merge_map::add_mapping.
194 (Object_merge_map::Input_merge_map::add_mapping): New.
195 (Output_merge_data::do_add_input_section): Call
196 get_or_make_input_merge_map before a loop.
197 (Output_merge_string<Char_type>::finalize_merged_data): Call
198 get_or_make_input_merge_map before a loop.
199 * merge.h (Object_merge_map): Make Input_merge_map public.
200 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
201 (Relobj::get_or_create_merge_map): New.
202 * object.h (Relobj::get_or_create_merge_map): New.
203
282c9750
AM
2042015-03-24 Alan Modra <amodra@gmail.com>
205
206 PR 18147
207 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
208 relocation errors for branches to strong undefined symbols.
209
67f95b96
RÁE
2102015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
211
212 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
213 (Object_merge_map::is_merge_section_for): Remove.
214 (Object_merge_map::find_merge_section): New.
215 * merge.h (Object_merge_map::is_merge_section_for): Remove.
216 (Object_merge_map::find_merge_section): New.
217 (Object_merge_map::get_input_merge_map): Add a const version.
218 * object.cc (Relobj::is_merge_section_for): Remove.
219 (Relobj::find_merge_section): New.
220 * object.h (Relobj::is_merge_section_for): Remove.
221 (Relobj::find_merge_section): New.
222 * output.cc
223 (Output_section::Input_section::is_merge_section_for): Remove.
224 (Output_section::add_merge_input_section): Don't call
225 add_merge_input_section.
226 (Output_section::find_merge_section): Return const. Use
227 object->find_merge_section.
228 (Output_section::build_lookup_maps): Don't build a map for
229 merge sections.
230 (Output_section::is_input_address_mapped): Return false if
231 section is not found.
232 (Output_section::find_starting_output_address): Use
233 find_merge_section instead of is_merge_section_for.
234 (Output_section::add_script_input_section): Don't build a map for
235 merge sections.
236 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
237 (Output_section_lookup_maps::find_merge_section): Remove.
238 (Output_section_lookup_maps::add_merge_input_section) Remove.
239 (Output_section::find_merge_section): Return const.
240
152f7024
CC
2412015-03-22 Cary Coutant <cary@google.com>
242
243 PR gold/18106
244 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
245 non-SIB form of lea, with nop after the call.
246
bccffdfd
CC
2472015-03-21 Cary Coutant <cary@google.com>
248
249 PR gold/14217
250 * output.cc (Output_segment::is_first_section_relro): Don't ignore
251 .tdata section.
252 (Output_segment::set_section_addresses): Don't align size of relro
253 segment for .tbss.
254
1c582fe7
CC
2552015-03-21 Cary Coutant <cary@google.com>
256
257 PR gold/18010
258 * stringpool.cc (Stringpool_template): Don't optimize if section
259 alignment is greater than sizeof(char).
260
410da591
CC
2612015-03-21 Cary Coutant <cary@google.com>
262
263 PR gold/18048
264 * script-c.h (script_include_directive): Add first_token parameter.
265 * script.cc (script_include_directive): Add first_token parameter, and
266 pass it to read_script_file.
267 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
268 (PARSING_MEMORY_DEF): New tokens.
269 (top): Add new productions for INCLUDE files.
270 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
271 Pass PARSING_LINKER_SCRIPT to script_include_directive.
272 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
273 (section_cmd): Pass PARSING_SECTION_CMDS.
274 (file_or_sections_cmd): Remove.
275 (memory_def): Pass PARSING_MEMORY_DEF.
276 * testsuite/Makefile.am (memory_test_2): New test.
277 * testsuite/Makefile.in: Regenerate.
278 * testsuite/memory_test_inc.t: New script file.
279 * testsuite/memory_test_inc_1.t.src: New script file.
280 * testsuite/memory_test_inc_2.t.src: New script file.
281 * testsuite/memory_test_inc_3.t.src: New script file.
282
0d5bbdb0
CC
2832015-03-21 Cary Coutant <cary@google.com>
284
285 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
286 (Sized_relobj_dwo::setup): Build compressed section map.
287 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
288 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
289 section map.
290 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
291 compressed_sections_ field.
292 (build_compressed_section_map): Take Object instead of
293 Sized_relobj_file parameter; add decompress_if_needed parameter.
294 (Sized_relobj_file::do_find_special_sections): Store compressed
295 section map in parent Object.
296 (Sized_relobj_file::do_decompressed_section_contents): Move
297 implementation to Object::decompressed_section_contents.
298 (Sized_relobj_file::do_discard_decompressed_sections): Move
299 implementation to Object::discard_decompressed_sections.
300 * object.h (build_compressed_section_map): Declare.
301 (Object::Object): Add compressed_sections_ field.
302 (Object::section_is_compressed): Move implementation here.
303 (Object::decompressed_section_contents): De-virtualize.
304 (Object::discard_decompressed_sections): De-virtualize.
305 (Object::do_section_is_compressed): Delete.
306 (Object::do_decompressed_section_contents): Delete.
307 (Object::set_compressed_sections): New method.
308 (Object::compressed_sections): New method.
309 (Object::compressed_sections_): New data member.
310 (Compressed_section_info, Compressed_section_map): Move to top of file.
311 (Sized_relobj_file::do_section_is_compressed): Delete.
312 (Sized_relobj_file::do_decompressed_section_contents): Delete.
313 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
314 (Sized_relobj_file::compressed_sections_): Move to Object class.
315
bd9e0d46
CC
3162015-03-21 Cary Coutant <ccoutant@google.com>
317
318 PR gold/18152
319 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
320 deferred objects.
321
943c8b43
CC
3222015-03-11 Cary Coutant <ccoutant@google.com>
323
324 * options.cc (General_options::finalize): Don't allow -z relro
325 with incremental linking.
326 * testsuite/Makefile.am (incremental_test): Add -z norelro.
327 (incremental_test_2): Likewise.
328 (incremental_test_3): Likewise.
329 (incremental_test_4): Likewise.
330 (incremental_test_5): Likewise.
331 (incremental_test_6): Likewise.
332 (incremental_copy_test): Likewise.
333 (incremental_common_test_1): Likewise.
334 (incremental_comdat_test_1): Likewise.
335 * testsuite/Makefile.in: Regenerate.
336
e1663197
CC
3372015-03-09 Cary Coutant <ccoutant@google.com>
338
339 PR gold/14675
340 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
341 return enum indicating whether .eh_frame section is empty, optimizable,
342 unrecognized, or an end marker. Adjust explicit instantiations.
343 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
344 (Eh_frame::add_ehframe_input_section): Change return type.
345 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
346 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
347 to the .eh_frame output section until we see the end marker.
348 (Layout::finalize_eh_frame_section): New.
349 * layout.h: (Layout::finalize_eh_frame_section): New.
350
beb8418f
L
3512015-03-05 H.J. Lu <hongjiu.lu@intel.com>
352
353 * output.cc (Relobj::initialize_input_to_output_map<size>):
354 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
355
48c73428
CC
3562015-03-04 Cary Coutant <ccoutant@google.com>
357
358 * parameters.cc (Parameters::set_target_once): Call
359 Target::select_as_default_target just once from here...
360 (set_parameters_target): ...instead of from here.
361
3622015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
363
364 * ehframe.cc (Cie::set_output_offset): Pass in and use a
365 Output_section_data instead of a Merge_map.
366 (Eh_frame::Eh_frame): Don't initialize merge_map_.
367 (Eh_frame::read_cie): Use add_merge_mapping instead of
368 Merge_map::add_mapping.
369 (Eh_frame::read_fde): Ditto.
370 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
371 (Eh_frame::do_output_offset): Use merge_output_offset istead of
372 merge_map_->get_output_offset.
373 (Eh_frame::do_is_merge_section_for): Delete.
374 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
375 instead of a Merge_map.
376 (Cie::set_output_offset): Pass in a Output_section_data instead of a
377 Merge_map.
378 (Eh_frame::do_is_merge_section_for): Delete.
379 (Eh_frame::merge_map_): Delete.
380 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
381 and use a Output_section_data instead of a Merge_map.
382 (Object_merge_map::add_mapping): Ditto.
383 (Object_merge_map::get_output_offset): Remove the merge_map argument.
384 (Object_merge_map::is_merge_section_for): Pass in and use a
385 Output_section_data instead of a Merge_map.
386 (Merge_map): Delete.
387 (Output_merge_base::do_output_offset): Use merge_output_offset instead
388 of merge_map_.get_output_offset.
389 (Output_merge_base::do_is_merge_section_for): Delete.
390 (Output_merge_data::do_add_input_section): Use
391 object->add_merge_mapping instead of add_mapping.
392 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
393 * merge.h (Merge_map): Delete forward declaration.
394 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
395 instead of a Merge_map.
396 (Object_merge_map::get_output_offset): Remove the merge_map argument.
397 (Object_merge_map::is_merge_section_for): Pass in and use a
398 Output_section_data instead of a Merge_map.
399 (Input_merge_map::Object_merge_map::merge_map): Replace with
400 output_data.
401 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
402 Output_section_data instead of a Merge_map.
403 (Merge_map): Delete.
404 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
405 (Output_merge_base::do_is_merge_section_for): Delete.
406 (Output_merge_base::add_mapping): Delete.
407 (Output_merge_base::merge_map_): Delete.
408 * object.cc (Relobj::initialize_input_to_output_map): New.
409 (Relobj::initialize_input_to_output_map): New.
410 (Relobj::merge_output_offset): New.
411 (Relobj::is_merge_section_for): New.
412 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
413 bits.
414 * object.h (Relobj::merge_map): Delete.
415 (initialize_input_to_output_map): New.
416 (set_merge_map): Delete.
417 (add_merge_mapping): New.
418 (merge_output_offset): New.
419 (is_merge_section_for): New.
420 * output.cc (Output_section::Input_section::is_merge_section_for):
421 Use object->is_merge_section_for.
422 * output.h (Output_section_data::is_merge_section_for): Delete.
423 (Output_section_data::do_is_merge_section_for): Delete.
424 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
425 Use object->initialize_input_to_output_map.
426 (Merged_symbol_value<size>::value_from_output_section): Use
427 object->merge_output_offset.
428
48c73428 4292015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
430 Cary Coutant <ccoutant@google.com>
431
432 * output.cc (Output_section::add_merge_input_section): Do not
433 attempt to merge sections with an entsize of 0.
434
48c73428 4352015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
436
437 * attributes.h (class Output_attributes_section_data ): Add
438 do_print_to_mapfile function.
439
ec86f434
AM
4402015-02-24 Alan Modra <amodra@gmail.com>
441
442 PR 18010
443 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
444 complain if value is not a multiple of four.
445 (Target_powerpc::Relocate::relocate): Correct handling of
446 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
447
be66981e
L
4482015-02-21 H.J. Lu <hongjiu.lu@intel.com>
449
450 * configure.ac (default_size): Set to 32 for x32.
451 * configure: Regenerated.
452
e3ee8ed4
AM
4532015-02-18 Alan Modra <amodra@gmail.com>
454
455 PR 17954
456 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
457 visibility.
458
3a935c6c
RÁE
4592015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
460
461 * gc.h (Garbage_collection::add_reference): Don't use find.
462
e0a1e121
RÁE
4632015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
464
465 * object.cc (write_local_symbols): avoid std::vector copy.
466
45a4fb1a
RÁE
4672015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
468
469 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
470
2d9afefe
MW
4712015-02-09 Mark Wielaard <mjw@redhat.com>
472
473 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
474 DW_LANG_Fortran03 and DW_LANG_Fortran08.
475
e9c1bdad
CC
4762015-02-16 Cary Coutant <ccoutant@google.com>
477
478 PR gold/13577
479 PR gold/16992
480 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
481 DF_SYMBOLIC if --dynamic-list option is used.
482 * options.cc (General_options::finalize): --dynamic-list is not
483 mutually exclusive with -Bsymbolic.
484 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
485 listed in --dynamic-list.
486 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
487 -Bsymbolic-functions.
488 * testsuite/Makefile.in: Regenerate.
489
0ed4b0bf
CC
4902015-02-16 Cary Coutant <ccoutant@google.com>
491
492 PR gold/17971
493 * incremental.cc: Remove redundant include of "output.h".
494
1a920511
JY
4952015-02-12 Jing Yu <jingyu@google.com>
496
497 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
498 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
499 New relocation.
500 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
501 TLSLE_MOVW_* relocations.
502 (Target_aarch64::Scan::global): Likewise.
503 (Target_aarch64::Relocate::relocate): Likewise.
504 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
505 for new TLSLE_MOVW_* relocations.
506
07f107f3
WN
5072015-02-11 Will Newton <will.newton@linaro.org>
508
509 PR gold/13321
510 * arm.cc (Target_arm::make_plt_section): Create an ARM
511 state mapping symbol at the start of the PLT.
512
e051a5b5
L
5132015-02-09 H.J. Lu <hongjiu.lu@intel.com>
514
515 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
516 Replace two_file_shared_2.so with two_file_shared_1.so.
517 * testsuite/Makefile.in: Regenerated.
518
dddcc5b9
AM
5192015-02-09 Alan Modra <amodra@gmail.com>
520
521 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
522 plugin_test_thin.a and defsym_test.
523 * testsuite/Makefile.in: Regenerate.
524
b39b8b9d
RÁE
5252015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
526
527 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
528 body.
529
b66d1c52
CC
5302015-02-04 Peter Collingbourne <pcc@google.com>
531
532 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
533 forwarding symbols when computing symbol resolution info for plugins.
534 * plugin.h (Plugin_manager::symtab): New method.
535 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
536
23081de0
CC
5372015-02-03 Cary Coutant <ccoutant@google.com>
538 Peter Collingbourne <pcc@google.com>
539
540 PR gold/15660
541 * archive.cc (Thin_archive_object_unlocker): New class.
542 (Archive::include_member): Unlock external members of thin archives.
543 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
544 (plugin_test_2): Likewise.
545 (plugin_test_3): Likewise.
546 (plugin_test_4): Likewise.
547 (plugin_test_5): Likewise.
548 (plugin_test_6): Likewise.
549 (plugin_test_7): Likewise.
550 (plugin_test_8): Likewise.
551 (plugin_test_9): Likewise.
552 (plugin_test_10): Likewise.
553 (plugin_test_11): New test case.
554 * testsuite/Makefile.in: Regenerate.
555 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
556 file to decide whether to claim file.
557 (all_symbols_read_hook): Likewise.
558 * testsuite/plugin_test_1.sh: Adjust expected output.
559 * testsuite/plugin_test_2.sh: Likewise.
560 * testsuite/plugin_test_3.sh: Likewise.
561 * testsuite/plugin_test_6.sh: Likewise.
562 * testsuite/plugin_test_tls.sh: Likewise.
563 * testsuite/plugin_test_11.sh: New testcase.
564
5652015-02-03 Cary Coutant <ccoutant@google.com>
566
567 * descriptors.cc (Descriptors::open): Set artificially-low limit for
568 file descriptors when debugging enabled. Add debug output.
569 (Descriptors::release): Add debug output.
570 (Descriptors::close_some_descriptor): Likewise.
571 (Descriptors::close_all): Likewise.
572 * fileread.cc (File_read::lock): Likewise.
573 (File_read::unlock): Likewise.
574
24dd5808
CC
5752015-02-02 Cary Coutant <ccoutant@google.com>
576
577 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
578 executable output file.
579
fa89cc82
HS
5802015-01-22 Han Shen <shenhan@google.com>
581
582 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
583 (Target_arm::do_plt_address_for_global): New method.
584 (Target_arm::do_plt_address_for_local): New method.
585 (Target_arm::rel_irelative_section): New method.
586 (Target_arm::make_data_plt): Add more parameters for plt ctor.
587 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
588 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
589 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
590 (Target_arm::Scan::check_non_pic): Add ifunc support.
591 (Target_arm::Scan::local): Add ifunc support.
592 (Target_arm::Scan::global): Add ifunc support.
593 (Target_arm::make_plt_section): New method.
594 (Target_arm::make_plt_entry): Change to call to make_plt_section.
595 (Target_arm::make_local_ifunc_plt_entry): New method.
596 (Target_arm::got_irelative_): New member.
597 (Target_arm::rel_irelative_): New member.
598 (Target_arm::got_section): Add creation for got_irelative_.
599 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
600 (Target_arm::Relocate::relocate): Properly set local ifunc address.
601 (Target_arm::do_dynsym_value): Properly set global ifunc address.
602 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
603 (Output_data_plt_arm::IRelative_data): New type.
604 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
605 (Output_data_plt_arm::add_entry): Add more parameters.
606 (Output_data_plt_arm::add_relocation): New method.
607 (Output_data_plt_arm::add_local_ifunc_entry): New method.
608 (Output_data_plt_arm::rel_irelative): New method.
609 (Output_data_plt_arm::entry_count): Modified.
610 (Output_data_plt_arm::address_for_global): New method.
611 (Output_data_plt_arm::address_for_local): New method.
23081de0 612gold/
fa89cc82
HS
613 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
614 (Output_data_plt_arm::insert_irelative_data): New method.
615 (Output_data_plt_arm::irelative_rel_): New member.
616 (Output_data_plt_arm::got_): New member.
617 (Output_data_plt_arm::got_irelative_): New member.
618 (Output_data_plt_arm::irelative_count_): New member.
619 (Output_data_plt_arm::IRelative_data_vec): New typedef.
620 (Output_data_plt_arm::irelative_data_vec_): New member.
621 (Output_data_plt_arm::do_write): Write out irelative entries.
622 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
623 more parameters to ctor.
624 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
625 more parameters to ctor.
626 * output.h (Output_data_reloc::add_local_relative): New method.
627 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
628
0f81d3f0
AM
6292015-01-29 Alan Modra <amodra@gmail.com>
630
631 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
632 and GOT_TLSGD to LE optimization.
633
65d92137
CC
6342015-01-28 Cary Coutant <ccoutant@google.com>
635
636 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
637 for undef TLS symbols.
638 (Target_x86_64::Relocate::relocate_tls): Likewise.
639 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
640
5485698a
CC
6412015-01-25 Cary Coutant <ccoutant@google.com>
642
643 * output.cc (Output_segment::set_section_addresses): Fix calculation
644 of size of relro segment.
645
b01a4b04
AM
6462015-01-22 Alan Modra <amodra@gmail.com>
647
648 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
649 condition for need of ifunc plt entry.
650 (Target_powerpc::Scan::global <got relocs>): Likewise.
651
3d0064a9
CC
6522015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
653
654 * mips.cc (reloc_high): Add r_sym.
655 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
656 reloc_high constructor.
657 (Mips_relocate_functions::relgot16_local): Likewise.
658 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
659 r_type to decide whether LO16 matches HI16.
660 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
661 rello16 and relgot16_local.
662
a5cd8f05
CC
6632015-01-09 Cary Coutant <ccoutant@google.com>
664
665 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
666 unless alignment is larger than page size.
667
4fc1b9d4
L
6682015-01-06 H.J. Lu <hongjiu.lu@intel.com>
669 Cary Coutant <ccoutant@google.com>
670
671 PR gold/17729
672 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
673 (DEFAULT_TARGET_X32): Set for x32.
674 * x86_64.cc (cmp_insn_32): New.
675 (lea_r10_insn_32): Likewise.
676 (lea_r11_insn_32): Likewise.
677 (cmp_insn_64): Likewise.
678 (lea_r10_insn_64): Likewise.
679 (lea_r11_insn_64): Likewise.
680 (Target_x86_64<size>::do_calls_non_split): Handle x32.
681 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
682 (check_DATA): Add split_x32 files.
683 (split_x32_[1234n].o): New targets.
684 (split_x32_[124]): New targets.
685 (split_x32_[1234r].stdout): New targets.
686 * testsuite/split_x32.sh: New file.
687 * testsuite/split_x32_1.s: Likewise.
688 * testsuite/split_x32_2.s: Likewise.
689 * testsuite/split_x32_3.s: Likewise.
690 * testsuite/split_x32_4.s: Likewise.
691 * testsuite/split_x32_n.s: Likewise.
692 * configure: Regenerated.
693 * testsuite/Makefile.in: Likewise.
694
e749cab8
L
6952015-01-06 H.J. Lu <hongjiu.lu@intel.com>
696
697 PR gold/17809
698 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
699 x32.
700
af759df0
AM
7012015-01-02 Alan Modra <amodra@gmail.com>
702
703 * version.cc (print_version): Just print current year.
704 * dwp.cc (print_version): Likewise.
705
b90efa5b
AM
7062015-01-01 Alan Modra <amodra@gmail.com>
707
708 Update year range in copyright notice of all files.
709
f12d1e8a
AM
7102014-12-25 Alan Modra <amodra@gmail.com>
711
712 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
713 new enums.
714 (Target_arm::merge_object_attributes, ): Likewise.
715
5c294fee
TG
7162014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
717
718 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
719 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
720 AEABI_VFP_args_vfp to check that.
721 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
722 value and replace hardcoded values by enum values.
723
e30880c2
CC
7242014-12-22 Cary Coutant <ccoutant@google.com>
725
726 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
727
bd040da1
L
7282014-12-20 H.J. Lu <hongjiu.lu@intel.com>
729
730 PR gold/14608
731 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
732 to "return i * i * 3;".
733
e02a4046
CC
7342014-12-16 Cary Coutant <ccoutant@google.com>
735
736 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
737 (Mapfile::print_output_data): Use current_data_size() to avoid
738 assert for sections requiring postprocessing; if address is not valid,
739 print 0.
740 (Mapfile::print_output_section): Use current_data_size(); print note
741 that addresses and sizes are before compression.
742
add6016b
L
7432014-12-14 H.J. Lu <hongjiu.lu@intel.com>
744
745 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
746 Cast current_group_size to unsigned long when reporting error.
747
0bf32ea9
JY
7482014-12-10 Jing Yu <jingyu@google.com>
749
750 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
751 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
752 Update error message.
753 (Target_aarch64::do_relax): Use absolute value of option
754 stub_group_size. Replace local variable with class member
755 stub_group_size_.
756
cbcb23fa
AM
7572014-12-04 Alan Modra <amodra@gmail.com>
758
759 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
760 addend of PLTREL24 reloc when not generating a plt stub. Make
761 max_branch_offset an "Address".
fbad6518 762 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
763 (Target_powerpc::Relocate::relocate): Likewise.
764
1611bc4a
AM
7652014-12-04 Alan Modra <amodra@gmail.com>
766
767 PR 17670
768 * symtab.cc (Symbol::set_undefined): Remove assertion.
769 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
770 on symbols defined in discarded sections, instead return false.
771 Rearrange params, update all callers.
772 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
773 branches to syms in discarded sections.
774 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
775 undefined and flag as discarded.
776 (Target_powerpc::Relocate::relocate): Localize variable.
777
4759c34e
L
7782014-12-03 H.J. Lu <hongjiu.lu@intel.com>
779
780 PR gold/17675
781 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
782 * testsuite/Makefile.in: Regenerated.
783
1f98a074
AM
7842014-12-03 Alan Modra <amodra@gmail.com>
785
786 PR 17566
787 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
788 when adding dynamic relocations against section symbols.
789
fb257835
DI
7902014-12-01 Dimitry Ivanov <dimitry@google.com>
791
792 * layout.cc (Layout::finish_dynamic_section): When '-z global'
793 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
794 * options.h (General_options): New -z option (global).
795
d8e60314
CC
7962014-12-01 Cary Coutant <ccoutant@google.com>
797
798 PR gold/17578
799 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
800 is given.
801 (Layout::create_executable_stack_info): Warn when -z noexecstack is
802 given but some inputs require executable stack.
803
982bbd97
CC
8042014-11-26 Cary Coutant <ccoutant@google.com>
805
806 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
807 .debug_str_offsets; strip .debug_gnu_pubnames and
808 .debug_gnu_pubtypes.
809 (lines_only_debug_sections): Strip all four new sections.
810
bb779192
HS
8112014-11-26 Jing Yu <jingyu@google.com>
812
813 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
814 register to be x0 when to relax TLSDESC_LD64_LO12.
815
a3e60ddb
AM
8162014-11-26 Alan Modra <amodra@gmail.com>
817
818 * powerpc.cc (struct Stub_table_owner): New.
819 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
820 unsigned int vector. Update all references.
821 (powerpc_relobj::set_stub_table): Take an unsigned int param
822 rather than a Stub_table. Update callers.
823 (Powerpc_relobj::clear_stub_table): New function.
824 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
825 stub_group_size_ vars.
826 (Target_powerpc::new_stub_table): Delete.
827 (max_branch_delta): New function, extracted from..
828 (Target_powerpc::Relocate::relocate): ..here..
829 (Target_powerpc::Branch_info::make_stub): ..and here. Return
830 status on whether stub created successfully.
831 (Stub_control::Stub_control): Add "no_size_errors" param. Move
832 default sizing to..
833 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
834 reduce on relax failure.
835 (Target_powerpc::group_sections): Add "no_size_errors" param.
836 Use stub_group_size_. Set up group info in a temp vector,
837 before building Stub_table vector. Account for input sections
838 possibly already converted to relaxed sections.
839 (Stub_table::init): Delete. Merge into..
840 (Stub_table::Stub_table): ..here.
841 (Stub_table::can_reach_stub): New function.
842 (Stub_table::add_plt_call_entry): Add "from" parameter and
843 return true iff stub could be reached.
844 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
845 param too.
846 (Stub_table::clear_stubs): Add "all" param.
847
a20605cf
AM
8482014-11-26 Alan Modra <amodra@gmail.com>
849
850 * powerpc.cc (Stub_control::set_output_and_owner): New function.
851 (Target_powerpc::group_sections): Use it.
852
43b64deb
CC
8532014-11-25 Cary Coutant <ccoutant@google.com>
854
855 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
856 (Binary_to_elf::write_symbol): Add st_size parameter.
857 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
858
c924eb67
CC
8592014-11-25 Cary Coutant <ccoutant@google.com>
860
861 PR gold/17639
862 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
863 (Sized_relobj_file::do_layout): Handle deferred sections properly
864 during GC pass 1. Don't add reloc sections to deferred list twice.
865 * object.h (Sized_relobj_file::is_deferred_layout): New function.
866 (Sized_relobj_file::is_deferred_layout_): New data member.
867
9d585188
L
8682014-11-21 H.J. Lu <hongjiu.lu@intel.com>
869
870 PR gold/17619
871 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
872 Check PC-relative offset overflow in PLT entry.
873
3ffaac20
AM
8742014-11-21 Alan Modra <amodra@gmail.com>
875
876 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
877 for undefined weaks.
878
0cfb0717
AM
8792014-11-20 Alan Modra <amodra@gmail.com>
880
881 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
882 from --stub-group-size parameter divided by 1024.
883 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
884 template parameter. Update all uses.
885 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
886 has_stub_value. Set for long branches. Don't report overflow for
887 branch to undefined weak symbols. Print info message on
888 overflowing branch to stub.
889
f9dffbf0
AM
8902014-11-20 Alan Modra <amodra@gmail.com>
891
892 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
893
e88ba8d5
L
8942014-11-13 H.J. Lu <hongjiu.lu@intel.com>
895
896 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
897 entry for R_X86_64_GOTPLT64.
898 (Target_x86_64<size>::Relocate::relocate): Update comments for
899 R_X86_64_GOTPLT64.
900
d37ffe25
ED
9012014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
902
903 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
904 * plugin.h: add lock definition
905
9726c3c1
HS
9062014-10-29 Han Shen <shenhan@google.com>
907 Jing Yu <jingyu@google.com>
908
909 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
910 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
911 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
912 Symbol::TLS_REF.
913 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
914 method.
915 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
916 (Target_aarch64::tls_ld_to_le): New method.
917 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
918 for 64bit targets.
919 (Output_data_plt_aarch64::irelative_rel_): New data member.
920 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
921 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
922 (Output_data_plt_aarch64::add_relocation): New method.
923 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
924 offset. Add got_irelative size to got size.
925 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
926 type string with the new typename.
927 (AArch64_relocate_functions::update_adr): Replace parameter x with
928 immed.
929 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
930 (AArch64_relocate_functions::reloc_common): New method.
931 (AArch64_relocate_funcsions::rela_general): Extract common part out
932 into reloc_common method.
933 (AArch64_relocate_functions::rela_general): Likewise.
934 (AArch64_relocate_functions::pcrela_general): Likewise.
935 (AArch64_relocate_functions::adr): New method.
936 (AArch64_relocate_functions::adrp): Calculate immed before calling
937 update_adr.
938 (AArch64_relocate_functions::adrp): Likewise.
939 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
940 comparing x to 0. Calculate immed from ~x when x < 0.
941 (Target_aarch64::optimize_tls_reloc): Add new cases for
942 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
943 TLSLD_MOVW_DTPREL_G0_NC.
944 (Target_aarch64::possible_function_pointer_reloc): Implement this
945 method.
946 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
947 comment.
948 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
949 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
950 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
951 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
952 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
953 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
954 (Target_aarch64::make_plt_entry): Call add_entry with two more
955 parameters.
956 (Target_aarch64::make_local_ifunc_plt_entry): New method.
957 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
958 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
959 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
960 (Target_aarch64::Relocate::relocate_tls): Add cases for
961 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
962 TLSLD_MOVW_DTPREL_G0_NC.
963 * testsuite/icf_safe_so_test.cc: Correct test comment.
964 * testsuite/icf_safe_test.sh: Add AArch64 arch.
965
80272b8c
AM
9662014-10-22 Alan Modra <amodra@gmail.com>
967
968 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
969 thread_starter.
970
998a69f4
AS
9712014-10-18 Andreas Schwab <schwab@linux-m68k.org>
972
973 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
974
aed56ec5
CC
9752014-10-17 Cary Coutant <ccoutant@google.com>
976
977 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
978 Add "typename" keyword.
979
bb779192 9802014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
981 Jing Yu <jingyu@google.com>
982
983 Patch for gold aarch64 backend to support relaxation.
984 * aarch64-reloc.def: Change format.
985 * aarch64.cc (class Reloc_stub): New class.
986 (class Stub_table): New class.
987 (class AArch64_relobj): New class.
988 (class AArch64_input_section): New class.
989 (class AArch64_output_section): New class.
990 (Target_aarch64::new_stub_table): New method.
991 (Target_aarch64::new_aarch64_input_section): New method.
992 (Target_aarch64::find_aarch64_input_section): New method.
993 (Target_aarch64::scan_section_for_stubs): New method.
994 (Target_aarch64::scan_reloc_section_for_stubs): New method.
995 (Target_aarch64::relocate_stub): New method.
996 (Target_aarch64::current_target): New method.
997 (Target_aarch64::do_make_elf_object): New method.
998 (Target_aarch64::do_may_relax): New method.
999 (Target_aarch64::do_relax): New method.
1000 (Target_aarch64::group_sections): New method.
1001 (Target_aarch64::scan_reloc_for_stub): New method.
1002 (Target_aarch64::do_make_output_section): New method.
1003 (Target_aarch64::stub_tables_): New data member.
1004 (Target_aarch64::aarch64_input_section_map_): New data member.
1005 (AArch64_relocate_functions::maybe_apply_stub): New method.
1006
db4c9594
CC
10072014-09-30 Cary Coutant <ccoutant@google.com>
1008
1009 PR gold/17432
1010 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1011
cd6da036
KC
10122014-09-30 Kito Cheng <kito@0xlab.org>
1013
1014 PR gold/13597
1015 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1016 hash table before sysv-style hash table.
1017
5f772412
ST
10182014-09-29 Sriraman Tallam <tmsriram@google.com>
1019
1020 * options.h (--pic-executable): Add negative to alias to -no-pie.
1021
5efeedf6
CC
10222014-09-26 Cary Coutant <ccoutant@google.com>
1023
1024 PR gold/16773
1025 * object.cc (Sized_relobj_file): Compute value of section symbols
1026 for TLS sections the same as TLS symbols.
1027
1707f183
CC
10282014-09-25 Cary Coutant <ccoutant@google.com>
1029
1030 PR gold/17432
1031 * resolve.cc (Symbol_table::resolve): Override common placeholder
1032 symbols, but adjust sizes.
1033 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1034 symbols to common lists.
1035
00cac886
AM
10362014-09-24 Alan Modra <amodra@gmail.com>
1037
1038 * po/POTFILES.in: Regenerate.
1039
635aa30e
CC
10402014-09-23 Taiju Tsuiki <tzik@google.com>
1041 Cary Coutant <ccoutant@google.com>
1042
71b9b91b 1043 PR gold/14860
635aa30e
CC
1044 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1045 on input_sections_blocker.
1046 * layout.cc (Write_sections_task::locks): Unblock
1047 input_sections_blocker_.
1048 * layout.h (Write_sections_task::Write_sections_task): Add
1049 input_sections_blocker.
1050 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1051 to DEPENDENCIES.
1052 * testsuite/Makefile.in: Regenerate.
1053
c0c71592
RÁE
10542014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1055
1056 * testsuite/Makefile.am (plugin_test_10): New test.
1057 * testsuite/Makefile.in: Regenerate
1058 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1059 * testsuite/plugin_test_10.sh: New file.
1060
6168c2a1
RÁE
10612014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1062
1063 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1064 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1065 during the replacement phase.
1066
3a531937
JY
10672014-09-17 Han Shen <shenhan@google.com>
1068 Jing Yu <jingyu@google.com>
1069
1070 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1071 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1072 * aarch64.cc (Target_aarch64): Add data members
1073 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1074 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1075 constructor.
1076 (Target_aarch64::do_reloc_symbol_index): New method.
1077 (Target_aarch64::do_reloc_addend): New method.
1078 (Target_aarch64::add_tlsdesc_info): New method.
1079 (Target_aarch64::do_dynsym_value): New method.
1080 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1081 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1082 (Target_aarch64::make_data_plt): Add new parameters: got,
1083 got_irelative. Pass them to do_make_data_plt.
1084 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1085 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1086 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1087 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1088 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1089 (Target_aarch64::got_tlsdesc_section): New method.
1090 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1091 (Target_aarch64::define_tls_base_symbol): New method.
1092 (Target_aarch64::reserve_tlsdesc_entries): New method.
1093 (Target_aarch64::got_mod_index_entry): New method.
1094 (Target_aarch64::rela_tlsdesc_section): New method.
1095 (Target_aarch64::rela_irelative_section): New method.
1096 (Target_aarch64::Tlsdesc_info): New struct.
1097 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1098 relocations and tlsdesc relocations.
1099 (Target_aarch64::optimize_tls_reloc): Implement method.
1100 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1101 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1102 in constructor.
1103 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1104 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1105 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1106 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1107 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1108 (Output_data_plt_aarch64::rela_irelative): New method.
1109 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1110 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1111 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1112 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1113 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1114 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1115 (Output_data_plt_aarch64_standard): New member variables:
1116 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1117 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1118 New parameter: got, got_irelative.
1119 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1120 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1121 (Output_data_plt_aarch64::do_write): Replace got_address with
1122 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1123 (AArch64_relocate_functions::update_movnz): New method.
1124 (AArch64_relocate_functions): Correct format.
1125 (AArch64_relocate_functions::movnz): New method.
1126 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1127 before the switch. Add new cases to switch.
00cac886 1128 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1129 tlsgd tlsdesc cases.
1130 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1131 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1132 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1133 Call reloc_name_in_error_message to print unsupported reloc.
1134 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1135 make_data_plt.
1136 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1137 relocs. Fill in some more dynamic tags.
1138 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1139 Skip call tls_get_addr when tlsgd is relaxed.
1140 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1141 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1142 tlsdesc->ie relaxation.
1143
62661c93
SS
11442014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1145
1146 * mips.cc (Target_mips_nacl): New class.
1147 (Target_selector_mips_nacl): New class.
1148 (target_selector_mips32): Rename from target_selector_mips32be and use
1149 Target_selector_mips_nacl instead of Target_selector_mips.
1150 (target_selector_mips32el): Rename from target_selector_mips32 and use
1151 Target_selector_mips_nacl instead of Target_selector_mips.
1152 (target_selector_mips64): Rename from target_selector_mips64be and use
1153 Target_selector_mips_nacl instead of Target_selector_mips.
1154 (target_selector_mips64el): Rename from target_selector_mips64 and use
1155 Target_selector_mips_nacl instead of Target_selector_mips.
1156 (Target_mips::mips_info): Add const attribute.
1157
54674d38
CC
11582014-09-02 Cary Coutant <ccoutant@google.com>
1159
1160 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1161 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1162 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1163 (Sized_incr_dynobj::do_section_name): Likewise.
1164 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1165 (Sized_incr_dynobj::do_section_name): Likewise.
1166 * object.h (Object::section_name): Likewise.
1167 (Object::do_section_name): Likewise.
1168 (Sized_relobj_file::do_section_name): Likewise.
1169 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1170 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1171
9860cbcf
CC
11722014-09-02 Cary Coutant <ccoutant@google.com>
1173
1174 PR gold/17005
1175 * ehframe.cc (Fde::write): Add output_offset parameter.
1176 (Cie::write): Likewise.
1177 (Eh_frame::set_final_data_size): Account for offset within output
1178 section.
1179 (Eh_frame::do_sized_write): Likewise.
1180 * ehframe.h (Fde::write): Add output_offset parameter.
1181 (Cie::write): Likewise.
1182 * output.cc (Output_section::Input_section_sort_entry): Remove
1183 section_has_name_; add output_section_name parameter. Use
1184 output section name for non-input sections.
1185 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1186 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1187 (Output_section::Input_section_sort_compare): Remove logic for
1188 sections without names.
1189 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1190 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1191 Likewise.
1192 (Output_section::Input_section_sort_section_name_compare): Likewise.
1193
8e33481e
HS
11942014-08-29 Han Shen <shenhan@google.com>
1195 Jing Yu <jingyu@google.com>
1196
1197 * aarch64-reloc-property.cc
1198 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1199 reference reloc property in the table.
1200 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1201 3 other entries.
1202 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1203 2 new overloaded methods.
1204 (Output_data_got_aarch64::do_write): Add code to write out
1205 static relocs.
1206 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1207 static relocs.
1208 (Output_data_got_aarch64::static_relocs): New vector to
1209 hold static relocs.
1210 (Target_aarch64::TCB_SIZE): New const static memeber.
1211 (Target_aarch64::tcb_size): New method.
1212 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1213 (Target_aarch64::Relocate::relocate_tls): New method.
1214 (Target_aarch64::Scan::local): Add code handling new reloc types.
1215 (Target_aarch64::Scan::global): Add code handling new reloc types.
1216
81233653
ST
12172014-08-13 Sriraman Tallam <tmsriram@google.com>
1218
1219 * options.h (-no-pie): Add option.
1220
9363c7c3
JY
12212014-08-08 Jing Yu <jingyu@google.com>
1222 Han Shen <shenhan@google.com>
1223
1224 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1225 (DEFFILES): add aarch64-reloc.def.
1226 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1227 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1228 * Makefile.in: Regenerate.
1229 * aarch64-reloc-property.cc: New file.
1230 * aarch64-reloc-property.h: New file.
1231 * aarch64-reloc.def: New file.
1232 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1233 with tab to make the format consistent.
1234 (Output_data_got_aarch64::symbol_table_): New method.
1235 (Target_aarch64::do_plt_address_for_global): New method.
1236 (Target_aarch64::do_plt_address_for_local): New method.
1237 (Target_aarch64::do_select_as_default_target): New method.
1238 (Target_aarch64::do_make_data_plt): New method.
1239 (Target_aarch64::make_data_plt): New method.
1240 (Output_data_plt_aarch64::has_irelative_section): New method.
1241 (Output_data_plt_aarch64::address_for_global): New method.
1242 (Output_data_plt_aarch64::address_for_local): New method.
1243 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1244 (Output_data_plt_aarch64::add_entry): Implement contents.
1245 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1246 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1247 the got_pov entry to plt0.
1248 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1249 Implement contents.
1250 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1251 (AArch64_howto): New struct.
1252 (aarch64_howto[]): New static const array.
1253 (AArch64_relocate_functions): New class.
1254 (Target_aarch64::Scan::get_reference_flags): Remove method.
1255 (Target_aarch64::Scan::local): Implement to support a few relocations.
1256 (Target_aarch64::Scan::global): Implement to support a few relocations.
1257 (Target_aarch64::make_plt_section): Implement contents.
1258 (Target_aarch64::make_plt_entry): Implement contents.
1259 (Target_aarch64::do_finalize_sections): Implement contents.
1260 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1261 (Target_aarch64::relocate_section): Implement contents.
1262
ad9fe6c1
AM
12632014-08-06 Alan Modra <amodra@gmail.com>
1264
1265 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1266
7cd4e5b7
AM
12672014-08-06 Alan Modra <amodra@gmail.com>
1268
1269 PR 13227
1270 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1271
5ad9b0a7
ST
12722014-07-21 Sriraman Tallam <tmsriram@google.com>
1273
1274 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1275 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1276
e051745c
CC
12772014-07-08 Cary Coutant <ccoutant@google.com>
1278
1279 * expression.cc (struct Expression::Expression_eval_info): Add
1280 new fields type_pointer, vis_pointer, and nonvis_pointer.
1281 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1282 nonvis_pointer parameters. Adjust all calls.
1283 (Symbol_expression::value): Update type, visibility, and nonvis bits
1284 in caller.
1285 * script.cc (Symbol_assignment::sized_finalize): Update type,
1286 visibility, and remaining st_other bits for new symbol.
1287 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1288 vis_pointer, and nonvis_pointer parameters.
1289 * symtab.h (Symbol::set_type): New method.
1290
1291 * testsuite/Makefile.am (defsym_test): New test.
1292 * testsuite/Makefile.in: Regenerate.
1293 * testsuite/defsym_test.c: New file.
1294 * testsuite/defsym_test.sh: New file.
1295
f35c4853
CC
12962014-07-08 Cary Coutant <ccoutant@google.com>
1297
1298 PR gold/15639
1299 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1300 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1301 (Sized_dynobj::base_read_symbols): ...new method.
1302 * object.h (Sized_relobj_file::base_read_symbols): New method.
1303 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1304 (Sized_relobj_file::base_read_symbols): ...new method.
1305 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1306 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1307 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1308
2900af2d
AM
13092014-07-04 Alan Modra <amodra@gmail.com>
1310
1311 * po/POTFILES.in: Regenerate.
1312
053a4d68
JY
13132014-07-02 Jing Yu <jingyu@google.com>
1314
1315 * aarch64.cc: New file
1316 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1317 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1318 * Makefile.in: Regenerate.
1319 * configure.tgt: Add entries for aarch64*.
1320 * configure.ac: Likewise.
1321 * configure: Likewise.
1322
7b549045
AM
13232014-06-27 Alan Modra <amodra@gmail.com>
1324
1325 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1326
cb818dbf
CC
13272014-06-24 Cary Coutant <ccoutant@google.com>
1328
1329 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1330 sections.
1331 (Dwo_file::sized_read_unit_index): Likewise.
1332
9810d34d
SS
13332014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1334
1335 * mips.cc: New file.
1336 * Makefile.am (TARGETSOURCES): Add mips.cc
1337 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1338 * configure.tgt: Add entries for mips*.
1339 * configure.ac: Likewise.
1340 * Makefile.in: Regenerate.
1341 * configure: Likewise.
1342
9baa787b
CC
13432014-06-09 Cary Coutant <ccoutant@google.com>
1344
1345 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1346 unit_length is within section bounds.
1347
8f89af0a
CC
13482014-06-09 Cary Coutant <ccoutant@google.com>
1349
1350 PR gold/16980
1351 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1352 map.
1353
a47622ac
AM
13542014-06-07 Alan Modra <amodra@gmail.com>
1355
1356 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1357
4320c691
CC
13582014-06-06 Cary Coutant <ccoutant@google.com>
1359
1360 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1361 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1362 (Dwarf_pubnames_table::read_header): Likewise.
1363 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1364 .debug_gnu_pubtypes.
1365
270c9937
JB
13662014-06-05 Joel Brobecker <brobecker@adacore.com>
1367
1368 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1369 * Makefile.in, configure: Regenerate.
1370
397998fc
AM
13712014-06-03 Alan Modra <amodra@gmail.com>
1372
1373 * powerpc.cc (addis_12_2): Define.
1374 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1375
61f5c66f
AM
13762014-06-03 Alan Modra <amodra@gmail.com>
1377
1378 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1379 st_other output.
1380
f6971787
AM
13812014-06-02 Alan Modra <amodra@gmail.com>
1382
1383 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1384 Only ignore relocs on ELFv1.
1385 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1386
f6fb8322
CC
13872014-05-30 Cary Coutant <ccoutant@google.com>
1388
1389 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1390 * testsuite/Makefile.in: Regenerate.
1391 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1392
c23dd342
L
13932014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1394
1395 PR gold/16945
1396 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1397 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1398
5fe7ffdc
AM
13992014-05-15 Alan Modra <amodra@gmail.com>
1400
1401 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1402 Compare FDE contents with DW_CFA_nop rather than 0.
1403
a82bef93
ST
14042014-05-13 Sriraman Tallam <tmsriram@google.com>
1405
1406 * symtab.h (may_need_copy_reloc): Remove check for position independent
1407 code.
1408 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1409 position independence before pc absolute may_need_copy_reloc call.
1410 Add check for executable output befor pc relative may_need_copy_reloc
1411 call.
1412 * i386.cc: Ditto.
1413 * arm.cc: Ditto.
1414 * sparc.cc: Ditto.
1415 * tilegx.cc: Ditto.
1416 * powerpc.cc: Add check for no position independence before
1417 may_need_copy_reloc calls.
1418 * testsuite/pie_copyrelocs_test.cc: New file.
1419 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1420 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1421 * Makefile.in: Regenerate.
a82bef93 1422
53c66605
ML
14232014-05-08 Martin Liška <mliska@suse.cz>
1424
1425 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1426
57b2284c
CC
14272014-05-06 Cary Coutant <ccoutant@google.com>
1428
1429 PR gold/16900
1430 * i386.cc (Output_data_got_plt_i386): New class.
1431 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1432 parameter. Change all callers.
1433 (Output_data_plt_i386::layout_): Remove.
1434 (Output_data_plt_i386::got_plt_): Change type.
1435 (Target_i386::got_plt_): Change type. Change all references.
1436 (Target_i386::got_section): Create instance of new class.
1437 (Output_data_got_plt_i386::do_write): New function.
1438 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1439 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1440 parameter. Change all callers.
1441 (Output_data_plt_x86_64::layout_): Remove.
1442 (Output_data_plt_x86_64::got_plt_): Change type.
1443 (Target_x86_64::got_plt_): Change type. Change all references.
1444 (Target_x86_64::got_section): Create instance of new class.
1445 (Output_data_got_plt_x86_64::do_write): New function.
1446 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1447 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1448 class.
1449
6b97515d 14502014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1451
6b97515d
CC
1452 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1453 if we have pubnames/pubtypes.
1454
d1bddd3c
CC
14552014-05-02 Cary Coutant <ccoutant@google.com>
1456
5fe7ffdc
AM
1457 * defstd.cc (in_segment): Define __ehdr_start here...
1458 * layout.cc (Layout::finalize): ...Instead of here. Set the
1459 output segment when known.
1460 * resolve.cc (Symbol::override_base_with_special): Remember
1461 the original binding.
1462 * symtab.cc (Symbol::set_output_segment): New function.
1463 (Symbol::set_undefined): New function.
1464 * symtab.h (Symbol::is_weak_undefined): Check original undef
1465 binding.
1466 (Symbol::is_strong_undefined): New function.
1467 (Symbol::set_output_segment): New function.
1468 (Symbol::set_undefined): New function.
1469 * target-reloc.h (is_strong_undefined): Remove.
1470 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1471 Check for hidden undefs.
1472 (relocate_section): Call Symbol::is_strong_undefined.
1473
1474 * testsuite/Makefile.am (ehdr_start_test_1)
1475 (ehdr_start_test_2, ehdr_start_test_3)
1476 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1477 * testsuite/Makefile.in: Regenerate.
1478 * testsuite/ehdr_start_def.cc: New source file.
1479 * testsuite/ehdr_start_test.cc: New source file.
1480 * testsuite/ehdr_start_test.t: New linker script.
1481 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1482
7849f6d8
CC
14832014-04-23 Cary Coutant <ccoutant@google.com>
1484
bf2cc635 1485 PR gold/16870
7849f6d8
CC
1486 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1487
99fd8cff
CC
14882014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1489
1490 * layout.cc (Layout::include_section): Allow a target to decide
1491 whether to include a section.
1492 * target.h (Target::should_include_section): New function.
1493 (Target::do_should_include_section): New function.
1494
91f43acd
CC
14952014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1496
1497 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1498 inline into ...
1499 (Copy_relocs::emit): ... here.
1500 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1501 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1502 (Copy_reloc_entry::entries_): Change from private to protected.
1503
c4eb27e1
ST
15042014-04-02 Sriraman Tallam <tmsriram@google.com>
1505
1506 * icf.cc (get_section_contents): Replace copies of reloc
1507 vectors with const references.
1508
ae447ddd
CC
15092014-04-02 Cary Coutant <ccoutant@google.com>
1510
1511 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1512 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1513 * configure: Regenerate.
1514 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1515 -fno-use-linker-plugin.
1516 (LINK1, CXXLINK1): Add it to the link command.
1517 * testsuite/Makefile.in: Regenerate.
1518
fa47fa92
AM
15192014-03-12 Alan Modra <amodra@gmail.com>
1520
1521 * Makefile.in: Regenerate.
1522
9b12c500
CC
15232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1524
1525 * symtab.h (Symbol::set_nonvis): New function.
1526
beacaa96
CC
15272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1528
1529 * symtab.cc (Sized_symbol<32>::init_output_data):
1530 Instantiate the template.
1531 (Sized_symbol<64>::init_output_data): Likewise.
1532
800d9823
CC
15332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1534
1535 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1536 adjust dynamic symbol value.
1537 * target.h (Target::adjust_dyn_symbol): New function.
1538 (Target::do_adjust_dyn_symbol): New function.
1539
918fc1f8 15402014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1541
918fc1f8
CC
1542 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1543 Get the value of DYNAMIC_CUSTOM dynamic entry.
1544 * output.h (Output_data_dynamic::add_custom): New function.
1545 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1546 dynamic entry.
1547 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1548 * target.h (Target::dynamic_tag_custom_value): New function.
1549 (Target::do_dynamic_tag_custom_value): New function.
1550
98ff9231
CC
15512014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1552
1553 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1554 dynsym indexes.
1555 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1556 (Target::do_has_custom_set_dynsym_indexes): New function.
1557 (Target::set_dynsym_indexes): New function.
1558 (Target::do_set_dynsym_indexes): New function.
1559
b80eed39
AM
15602014-03-07 Alan Modra <amodra@gmail.com>
1561
1562 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1563 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1564 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1565 (Powerpc_relocate_functions::has_overflow_bitfield,
1566 overflowed): Use the above.
1567 (Target_powerpc::Relocate::relocate): Correct overflow checking
1568 for a number of relocations. Modify overflow test for 16-bit
1569 fields in instructions to signed/unsigned according to whether
1570 the field takes a signed or unsigned value.
1571
4b95cf5c
AM
15722014-03-05 Alan Modra <amodra@gmail.com>
1573
1574 Update copyright years.
1575
45965137
AM
15762014-03-05 Alan Modra <amodra@gmail.com>
1577
1578 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1579 R_PPC64_ADDR64_LOCAL.
1580 (Target_powerpc::Relocate::relocate): Likewise.
1581
2c80b753
AM
15822014-03-03 Alan Modra <amodra@gmail.com>
1583
1584 * dwp.cc (print_version): Update copyright year to current.
1585
c1c69e83
AM
15862014-02-10 Alan Modra <amodra@gmail.com>
1587
1588 * po/gold.pot: Regenerate.
1589
dd0c4e70
CC
15902014-02-06 Cary Coutant <ccoutant@google.com>
1591
1592 Fix problem where -u is ignored when a weak undef is seen.
1593
1594 * archive.cc (Library_base::should_include_member): Reorder
1595 code to check for -u option if a weak undef has already been seen.
1596 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1597 * testsuite/Makefile.in: Regenerate.
1598 * testsuite/weak_undef_file3.cc: New file.
1599 * testsuite/weak_undef_file4.cc: New file.
1600 * testsuite/weak_undef_test_2.cc: New file.
1601
1a221d3d
CC
16022014-02-05 Cary Coutant <ccoutant@google.com>
1603
1604 Fix issues with gold undefined symbol diagnostics.
1605
1606 PR binutils/15435
1607 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1608 check to here.
1609 * target-reloc.h (is_strong_undefined): New function.
1610 (relocate_section): Move undef vtable symbol check from here.
1611 Check for is_strong_undefined.
1612
e889f0a4 16132014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1614
e889f0a4
CC
1615 Fix problems with the --dynamic-list option.
1616
1617 PR gold/13577
1618 * options.cc (General_options::parse_dynamic_list):
1619 Set have_dynamic_list_.
1620 (General_options::General_options): Initialize have_dynamic_list_.
1621 (General_options::finalize): Turn off -Bsymbolic and
1622 -Bsymbolic-functions if --dynamic-list provided.
1623 * options.h (General_options::have_dynamic_list): New function.
1624 (General_options::have_dynamic_list_): New data member.
1625 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1626 correctly.
5fe7ffdc 1627
e889f0a4
CC
1628 PR gold/16530
1629 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1630 in --dynamic-list, mark it.
5fe7ffdc 1631
e889f0a4
CC
1632 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1633 (dynamic_list_2): New test case.
1634 * testsuite/Makefile.in: Regenerate.
1635 * testsuite/dynamic_list_2.cc: New file.
1636 * testsuite/dynamic_list_2.t: New file.
1637 * testsuite/dynamic_list_lib1.cc: New file.
1638 * testsuite/dynamic_list_lib2.cc: New file.
1639 * testsuite/gc_dynamic_list_test.c: New file.
1640 * testsuite/gc_dynamic_list_test.sh: New file.
1641 * testsuite/gc_dynamic_list_test.t: New file.
1642
ec673e64
CC
16432014-01-28 Cary Coutant <ccoutant@google.com>
1644
1645 Add .gdb_index version 7 support.
1646
1647 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1648 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1649 debug sections.
1650 (Dwarf_ranges_table::read_ranges_table): Likewise.
1651 (Dwarf_pubnames_table::read_section): Check for GNU-style
1652 sections, and for compressed debug sections.
1653 (Dwarf_pubnames_table::read_header): Compute end address of table.
1654 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1655 for end of list by offset, not by offset == 0.
1656 (Dwarf_info_reader::do_read_string_table): Check for compressed
1657 debug sections.
1658 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1659 Initialize new data members.
1660 (Dwarf_pubnames_table::next_name): return flag_byte.
1661 (Dwarf_pubnames_table::end_of_table_): New data member.
1662 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1663 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1664 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1665 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1666 read skeleton type unit DIEs.
1667 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1668 (Gdb_index::do_write): Write flag_byte.
1669 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1670 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1671 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1672 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1673
221fd5d5
L
16742014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1675
1676 * version.cc (print_version): Update copyright year to 2014.
1677
6c09fb0b
ILT
16782013-12-19 Dimitry Andric <dimitry@andric.com>
1679
1680 * stringpool.cc (Stringpool_template::reserve): Add
1681 HAVE_UNORDERED_MAP case.
1682 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1683
8356f2d0
CC
16842013-12-18 Cary Coutant <ccoutant@google.com>
1685
1686 * configure.ac: Check for <unordered_set> and <unordered_map>.
1687 * config.in: Regenerate.
1688 * configure: Regenerate.
1689 * system.h: Use <unordered_set> and <unordered_map> if available.
1690
f2c7d7ee
RM
16912013-12-10 Roland McGrath <mcgrathr@google.com>
1692
1693 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1694 with $(INSTALL_PROGRAM_ENV).
1695 * Makefile.in: Regenerate.
1696
6632e8cc
CC
16972013-11-22 Cary Coutant <ccoutant@google.com>
1698
1699 * configure.ac: Add check for which library is needed for
1700 dlopen.
1701 * configure: Regenerate.
1702
0c075858
CC
17032013-11-22 Cary Coutant <ccoutant@google.com>
1704
1705 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1706 assembler.
1707 * testsuite/Makefile.in: Regenerate.
1708
f49fe902
L
17092013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1710
1711 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1712 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1713 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1714 (Target_x86_64<size>::Scan::local): Likewise.
1715 (Target_x86_64<size>::Scan::global): Likewise.
1716 (Target_x86_64<size>::Relocate::relocate): Likewise.
1717 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1718 Likewise.
1719 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1720 R_X86_64_PC32_BND.
1721
1722 * testsuite/Makefile.am (check_PROGRAMS): Add
1723 exception_x86_64_bnd_test.
1724 (exception_x86_64_bnd_test_SOURCES): New macro.
1725 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1726 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1727 (exception_x86_64_bnd_test_LDADD): Likewise.
1728 (exception_x86_64_bnd_1.o): New rule.
1729 (exception_x86_64_bnd_2.o): Likewise.
1730 * testsuite/Makefile.in: Regenerated.
1731
9055360d
AM
17322013-11-15 Alan Modra <amodra@gmail.com>
1733
1734 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1735 accessor.
1736 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1737 Only call ppc64_local_entry_offset for 64-bit. Restrict
1738 symval_for_branch lookup to ELFv1.
1739 (Stub_table::add_plt_call_entry): Use unsigned int off.
1740 (Output_data_glink::Address, invalid_address): New.
1741 (Output_data_glink::add_eh_frame): Move out of line. Add
1742 support for ELFv2.
1743 (Output_data_glink::add_global_entry, find_global_entry,
1744 global_entry_address): New functions.
1745 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1746 ge_size): New variables.
1747 (Output_data_glink::set_final_data_size): Add global entry
1748 stub sizing.
1749 (Output_data_glink::do_write): Write global entry stubs.
1750 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1751 parameter. Return true for ELFv2. Adjust callers.
1752 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1753 ELFv1. Similarly for ifunc and dynamic relocation processing
1754 specific to ELFv1. Recognize that symbols are defined on
1755 their plt entries for ELFv2.
1756 (Target_powerpc::symval_for_branch): Assert if called for
1757 ELFv2 or ppc32.
1758 (Target_powerpc::Relocate::relocate): Use global entry plt
1759 stub for symbol value if such exists on ELFv2.
1760 (Target_powerpc::Relocate::relocate): Don't call
1761 symval_for_branch when ELFv2. Do adjust for local entry
1762 offset when ELFv2.
1763 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1764 plt stub for ELFv2.
1765 (Target_powerpc::do_plt_address_for_global): Similarly.
1766
cafdd569
CC
17672013-11-14 Cary Coutant <ccoutant@google.com>
1768
1769 Revert patch -- this did not fix the problem, and there is
1770 no race there.
1771
1772 2013-11-14 Cary Coutant <ccoutant@google.com>
1773
1774 PR gold/14860
1775 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1776 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1777 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1778 updating fde_offsets_.
1779 (Eh_frame_hdr::lock_): New data member.
1780
94e49e16
CC
17812013-11-14 Cary Coutant <ccoutant@google.com>
1782
1783 * dwp.cc (Dwo_file_entry): New type.
1784 (File_list): Use Dwo_file_entry.
1785 (Dwo_file::verify): New function.
1786 (Dwo_file::verify_dwo_list): New function.
1787 (Dwo_file::sized_verify_dwo_list): New function.
1788 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1789 list.
1790 (Dwp_options): New enum type.
1791 (dwp_options): Add --verify-only.
1792 (usage): Likewise.
1793 (main): Likewise.
1794 * dwp.h (gold_info): Add declaration.
1795
7cdd7d57
CC
17962013-11-14 Cary Coutant <ccoutant@google.com>
1797
1798 PR gold/14860
1799 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1800 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1801 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1802 updating fde_offsets_.
1803 (Eh_frame_hdr::lock_): New data member.
1804
1d946cb3
CC
18052013-11-06 Cary Coutant <ccoutant@google.com>
1806
1807 PR gold/15758
1808 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1809 before reloc sections.
1810
4f65b40e
AM
18112013-11-04 Alan Modra <amodra@gmail.com>
1812
1813 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1814 (Symbol::needs_dynamic_reloc): Test new flag.
1815 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1816 (Target_powerpc::Scan::get_reference_flags): Add target param.
1817 Return FUNC_DESC_ABI for 64-bit ELFv1.
1818 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1819 call.
1820 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1821 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1822
908794a9
CC
18232013-10-31 Cary Coutant <ccoutant@google.com>
1824
1825 Restore support for dwp v2 DWARF package file format.
1826
1827 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1828 tu_length parameter. Adjust all callers.
1829 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1830 * dwp.cc: Include dwarf.h.
1831 (Section_bounds): New struct type.
1832 (Unit_set): New struct type.
1833 (Dwo_file::Dwo_file): Initialize new data member.
1834 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1835 Combine and rename to...
1836 (Dwo_file::read_unit_index): ...this.
1837 (Dwo_file::sized_read_compunit_index)
1838 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1839 (Dwo_file::sized_read_unit_index): ...this.
1840 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1841 parameters; add section_id parameter.
1842 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1843 (Dwo_file::add_unit_set): ...this.
1844 (Dwo_file::shndx_map_): Remove.
1845 (Dwo_file::sect_offsets_): New data member.
1846 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1847 (Dwp_output_file::add_section): Rename to...
1848 (Dwp_output_file::add_contribution): ...this.
1849 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1850 (Dwp_output_file::add_tu_set): Likewise.
1851 (Dwp_output_file::Contribution): New type.
1852 (Dwp_output_file::Section::contributions): New data member.
1853 (Dwp_output_file::Cu_or_tu_set): Remove.
1854 (Dwp_output_file::Section::Section): New ctor.
1855 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1856 (Dwp_output_file::Dwp_index::Section_table): New type.
1857 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1858 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1859 parameter.
1860 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1861 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1862 (Dwp_output_file::Dwp_index::section_table): New member function.
1863 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1864 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1865 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1866 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1867 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1868 (Dwp_output_file::Dwp_index::section_table_): New data member.
1869 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1870 (Dwp_output_file::add_output_section): New member function.
1871 (Dwp_output_file::write_new_section): New member function.
1872 (Dwp_output_file::write_contributions): New member function.
1873 (Dwp_output_file::section_id_map_): New data member.
1874 (class Dwo_id_info_reader): Remove.
1875 (class Unit_reader): New class.
1876 (get_dwarf_section_name): New function.
1877 (Dwo_file::read_executable): Adjust initializations of class data.
1878 (Dwo_file::read): Add support for v2 package file format.
1879 (Dwo_file::read_unit_index): Likewise.
1880 (Dwo_file::sized_read_unit_index): Likewise.
1881 (Dwo_file::copy_section): Likewise.
1882 (Dwo_file::add_unit_set): Likewise.
1883 (Dwp_output_file::add_output_section): Likewise.
1884 (Dwp_output_file::add_contribution): Likewise.
1885 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1886 for empty slot.
1887 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1888 file format.
1889 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1890 slot.
1891 (Dwp_output_file::initialize): Remove unused function.
1892 (Dwp_output_file::finalize): Add support for v2 package file format.
1893 (Dwp_output_file::write_index): Likewise.
1894 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1895 function prototype.
1896
2500c017
CC
18972013-10-31 Cary Coutant <ccoutant@google.com>
1898
1899 * configure.ac: Fix check for -fmerge-constants.
1900 * configure.ac: Regenerate.
1901
dd0845d7
RM
19022013-10-30 Roland McGrath <mcgrathr@google.com>
1903
1904 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1905 Correct 9-byte nop sequence to match what the assembler generates.
1906
b4f7960d
AM
19072013-10-30 Alan Modra <amodra@gmail.com>
1908
1909 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1910 ppc64_local_entry_offset, ppc64_local_entry_offset,
1911 do_read_symbols): New functions.
1912 (Powerpc_relobj::e_flags_, st_other_): New vars.
1913 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1914 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1915 (Powerpc_relobj::e_flags_): New var.
1916 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1917 and adjust for ELFv2.
1918 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1919 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1920 (Powerpc_dynobj::do_find_special_sections): Likewise.
1921 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1922 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1923 to ELFv2 local entry.
1924 (Target_powerpc::do_relax): No thread safe barriers needed for
1925 ELFv2.
1926 (Output_data_plt_powerpc::initial_plt_entry_size_,
1927 plt_entry_size): Delete. Replace all uses with
1928 first_plt_entry_offset() and plt_entry_size().
1929 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1930 reserved_size parm. Update callers.
1931 (Output_data_plt_powerpc::entry_count): Update.
1932 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1933 and use Target_powerpc::first_plt_entry_offset().
1934 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1935 rename to plt_entry_size.
1936 (Output_data_plt_powerpc::add_ifunc_entry,
1937 add_local_ifunc_entry): Adjust reloc for ELFv2.
1938 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1939 (glink_eh_frame_fde_64v2): New.
1940 (Stub_table::plt_call_size): Support ELFv2 sizing.
1941 (Output_data_glink::add_eh_frame): Use the new FDE.
1942 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1943 (Stub_table::do_write): Write ELFv2 stubs and glink.
1944 (Target_powerpc::Relocate::relocate): Replaces nop after call
1945 with ld 2,24(1) and adjust local offset destination for ELFv2.
1946
f9c6b907
AM
19472013-10-30 Alan Modra <amodra@gmail.com>
1948
1949 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1950 (Target_powerpc::Scan::global, local): Likewise.
1951 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1952 on all ppc64 @h and @ha relocs.
1953
e84fe78f
AM
19542013-10-14 Alan Modra <amodra@gmail.com>
1955
1956 * output.h (Output_data_got::add_constant): Tidy.
1957 (Output_data_got::add_constant_pair): New function.
1958 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1959 methods used so as to first call reserve_ent().
1960
679e4abf
RM
19612013-10-11 Roland McGrath <mcgrathr@google.com>
1962
44dcb735
RM
1963 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1964 add_got_entry and add_got_entry_pair.
1965
13323c49
RM
1966 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1967 (HAVE_PUBNAMES): Likewise.
1968 * configure: Regenerate.
1969
1496b446
RM
1970 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1971 * testsuite/Makefile.in: Regenerate.
1972
cc84c10b
RM
1973 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1974 Remove const from declaration.
1975 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1976 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1977 * output.h (Output_file_header): Remove const from member target_
1978 and corresponding constructor argument.
1979 * output.cc (Output_file_header::Output_file_header): Update prototype.
1980 (Output_file_header::do_sized_write): Use this->target_ in place
1981 of parameters()->target().
1982
52f66a2c
RM
1983 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1984
2b64b551
RM
1985 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1986 * configure: Regenerate.
1987 * Makefile.in: Regenerate.
1988 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1989 * testsuite/merge_string_literals_2.c: Likewise.
1990 * testsuite/Makefile.am
1991 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1992 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1993 literal -fmerge-constants.
1994 * testsuite/Makefile.in: Regenerate.
1995
43819297
RM
1996 * i386.cc (Target_i386): Remove unused member dynbss_.
1997 * arm.cc (Target_arm): Likewise.
1998 * powerpc.cc (Target_powerpc): Likewise.
1999 * sparc.cc (Target_sparc): Likewise.
2000 * tilegx.cc (Target_tilegx): Likewise.
2001 * x86_64.cc (Target_x86_64): Likewise.
2002 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2003 type_signature_, type_offset_.
2004 * plugin.h (Plugin_hook): Remove unused member layout_.
2005 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2006 mapfile_.
2007 (Read_member): Remove unused members input_objects_, symtab_,
2008 mapfile_, layout_.
2009 (Check_library): Remove unused member symtab_.
2010 * archive.h (Lib_group): Remove unused member lib_.
2011 * archive.cc (Lib_group::Lib_group): Update initializer.
2012 * incremental.h (Incremental_binary): Remove unused member target_.
2013 (Incremental_script_entry): Removed unused member script_.
2014 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2015 * icf.h (Icf): Remove unused member num_tracked_relocs.
2016
39d9ead7
RM
2017 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2018 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2019 its only use.
2020 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2021
679e4abf
RM
2022 * archive.h: Use struct rather than class for forward declaration
2023 of Read_symbols_data.
2024
54de2ea6
CC
20252013-10-07 Cary Coutant <ccoutant@google.com>
2026
2027 PR gold/16010
2028 * testsuite/Makefile.am (icf_test): Fix dependencies.
2029 (icf_safe_test): Likewise.
2030 (icf_safe_so_test): Likewise.
2031 (large_symbol_alignment): Add empty _LDADD rule.
2032 * testsuite/Makefile.in: Regenerate.
2033
b14016f0
L
20342013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2035
2036 PR gold/15927
2037 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2038 relocation for R_X86_64_32 on x32.
2039
eb426534
RM
20402013-08-27 Roland McGrath <mcgrathr@google.com>
2041
2042 * output.cc (Output_segment::set_section_addresses): Take new
2043 Target* argument. If target->isolate_execinstr() and the segment
2044 is executable and starts at a target->abi_pagesize() boundary,
2045 pad its end out to a target->abi_pagesize() boundary with code fill.
2046 * output.h (Output_segment::set_section_addresses): Update decl.
2047 * layout.h (Layout::check_output_data_for_reset_values): Take new
2048 argument RELAX_OUTPUTS.
2049 (Layout): New member relax_output_list_.
2050 (Layout::add_relax_output): New method.
2051 * layout.cc (Layout::Layout): Update constructor.
2052 (Layout::reset_relax_output): New method.
2053 (Layout::clean_up_after_relaxation): Call it.
2054 (Layout::prepare_for_relaxation): Update caller.
2055 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2056 Call reset_relax_output before re-processing segments for
2057 isolate_execinstr case.
2058 (Layout::write_data): Handle relax_output_list_.
2059 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2060 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2061
9aff4b7a
NC
20622013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2063
2064 PR binutils/15834
2065 * object.h: Fix typos.
2066
93f8221c
RM
20672013-08-16 Roland McGrath <mcgrathr@google.com>
2068
2069 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2070 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2071
e44c3715
CC
20722013-08-07 Cary Coutant <ccoutant@google.com>
2073
2074 Revert support for v2 DWP files:
2075
2076 2013-03-01 Cary Coutant <ccoutant@google.com>
2077
2078 Add dwp support for v2 DWARF package file format.
2079 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2080 tu_length parameter. Adjust all callers.
2081 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2082 * dwp.cc: Include dwarf.h.
2083 (Section_bounds): New struct type.
2084 (Unit_set): New struct type.
2085 (Dwo_file::Dwo_file): Initialize new data member.
2086 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2087 Combine and rename to...
2088 (Dwo_file::read_unit_index): ...this.
2089 (Dwo_file::sized_read_compunit_index)
2090 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2091 (Dwo_file::sized_read_unit_index): ...this.
2092 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2093 parameters; add section_id parameter.
2094 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2095 (Dwo_file::add_unit_set): ...this.
2096 (Dwo_file::shndx_map_): Remove.
2097 (Dwo_file::sect_offsets_): New data member.
2098 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2099 (Dwp_output_file::add_section): Rename to...
2100 (Dwp_output_file::add_contribution): ...this.
2101 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2102 (Dwp_output_file::add_tu_set): Likewise.
2103 (Dwp_output_file::Contribution): New type.
2104 (Dwp_output_file::Section::contributions): New data member.
2105 (Dwp_output_file::Cu_or_tu_set): Remove.
2106 (Dwp_output_file::Section::Section): New ctor.
2107 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2108 (Dwp_output_file::Dwp_index::Section_table): New type.
2109 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2110 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2111 parameter.
2112 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2113 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2114 (Dwp_output_file::Dwp_index::section_table): New member function.
2115 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2116 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2117 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2118 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2119 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2120 (Dwp_output_file::Dwp_index::section_table_): New data member.
2121 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2122 (Dwp_output_file::add_output_section): New member function.
2123 (Dwp_output_file::write_new_section): New member function.
2124 (Dwp_output_file::write_contributions): New member function.
2125 (Dwp_output_file::section_id_map_): New data member.
2126 (class Dwo_id_info_reader): Remove.
2127 (class Unit_reader): New class.
2128 (get_dwarf_section_name): New function.
2129 (Dwo_file::read_executable): Adjust initializations of class data.
2130 (Dwo_file::read): Add support for v2 package file format.
2131 (Dwo_file::read_unit_index): Likewise.
2132 (Dwo_file::sized_read_unit_index): Likewise.
2133 (Dwo_file::copy_section): Likewise.
2134 (Dwo_file::add_unit_set): Likewise.
2135 (Dwp_output_file::add_output_section): Likewise.
2136 (Dwp_output_file::add_contribution): Likewise.
2137 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2138 for empty slot.
2139 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2140 file format.
2141 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2142 slot.
2143 (Dwp_output_file::initialize): Remove unused function.
2144 (Dwp_output_file::finalize): Add support for v2 package file format.
2145 (Dwp_output_file::write_index): Likewise.
2146 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2147 function prototype.
2148
c6905c28
CC
21492013-07-31 Cary Coutant <ccoutant@google.com>
2150
2151 * object.cc (Sized_relobj::do_output_section_address): New function.
2152 (Sized_relobj): Instantiate explicitly.
2153 * object.h (Object::output_section_address): New function.
2154 (Object::do_output_section_address): New function.
2155 (Sized_relobj::do_output_section_address): New function.
2156 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2157
21582013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2159 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2160
2161 * parameters.cc (Parameters::entry): Return target-specific entry
2162 symbol name.
2163 * target.h (Target::entry_symbol_name): New function.
2164 (Target_info::entry_symbol_name): New data member.
2165
2166 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2167 * i386.cc (Target_i386::i386_info): Likewise.
2168 (Target_i386_nacl::i386_nacl_info): Likewise.
2169 * sparc.cc (Target_sparc::sparc_info): Likewise.
2170 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2171 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2172 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2173 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2174
234d4ab8
SA
21752013-07-22 Sterling Augustine <saugustine@google.com>
2176
2177 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2178 Convert parameter shndx to local variable. Add parameters symtab
2179 and symtab_size. Scan over section names. Find relocation
2180 section corresponding to current section. Create and initialize
2181 reloc_mapper_ and reloc_type_.
2182 (Dwarf_pubnames_table::read_header): Add assertion. Change
2183 unit_length to off_t. Initialize member unit_length_. Fill in field
2184 cu_offset_.
2185 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2186 Initialize new fields unit_length_ and cu_offset_.
2187 (Dwarf_pubnames_table::read_section): Update prototype.
2188 (Dwarf_pubnames_table::cu_offset): New member function.
2189 (Dwarf_pubnames_table::subsection_size): Likewise.
2190 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2191 New fields.
2192 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2193 member functions public.
2194 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2195 Update comment. Rework logic. Move repeated parts to...
2196 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2197 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2198 pubtypes_table_, and stmt_list_offset.
2199 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2200 Gdb_index::find_pubtype_offset,
2201 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2202 (Gdb_index::pubnames_read): Update prototype and rework logic.
2203 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2204 Forward declare.
2205 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2206 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2207 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2208 Gdb_index::map_pubtable_to_dies):
2209 Declare functions.
2210 (Gdb_index::pubnames_read): Update declaration.
2211 (Gdb_index::Pubname_offset_map): New type.
2212 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2213 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2214 Gdb_index::stmt_list_offset): Declare.
2215 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2216 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2217 Gdb_index::pubtypes_offset_): Remove.
2218
a3ed37d8
RM
22192013-07-19 Roland McGrath <mcgrathr@google.com>
2220
2221 * options.h (General_options): Add -Trodata-segment option.
2222 * parameters.cc (Parameters::check_rodata_segment): New function.
2223 (Parameters::set_target_once): Call it.
2224 * parameters.h (Parameters): Declare it (private member function).
2225 * layout.cc (load_seg_unusable_for_headers): New function, broken
2226 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2227 then validate rodata segment rather than text segment.
2228 (relaxation_loop_body): Call that.
2229 (is_text_segment): New function. Don't admit a non-executable
2230 segment if TARGET->isolate_execinstr().
2231 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2232
eb5b4ded
CC
22332013-07-15 Shawn Landden <shawnlandden@gmail.com>
2234
2235 PR gold/15070
2236 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2237 * nacl.h (Sniff_file::View::View): Request aligned view.
2238
4d5effb9
CC
22392013-07-11 Cary Coutant <ccoutant@google.com>
2240
2241 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2242 correct BRLT entry size.
2243
ba8ca3e7
AM
22442013-07-03 Alan Modra <amodra@gmail.com>
2245
2246 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2247 comment.
2248
267257d2
CC
22492013-07-01 Cary Coutant <ccoutant@google.com>
2250
2251 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2252 reloc_type_.
2253 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2254 (Dwarf_ranges_table::lookup_reloc): New function.
2255 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2256 reloc_type_.
2257 (Dwarf_ranges_table::lookup_reloc): New function.
2258 (Dwarf_ranges_table::reloc_type_): New data member.
2259
06f30c9d
CC
22602013-06-27 Jing Yu <jingyu@google.com>
2261
2262 PR gold/15662
2263 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2264 function.
2265 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2266 (Target_powerpc::do_relax): Call the above.
2267
a2d7bf59
AM
22682013-06-27 Cary Coutant <ccoutant@google.com>
2269
2270 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2271 on garbage collected .opd section.
2272
22732013-06-27 Alan Modra <amodra@gmail.com>
2274
2275 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2276 is non-zero.
2277 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2278 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2279
32364e50
CC
22802013-06-14 Cary Coutant <ccoutant@google.com>
2281
2282 * resolve.cc (Symbol::override_base): Don't override st_type
2283 from plugin placeholder symbols.
2284 (Symbol_table::resolve): Likewise.
2285 (Symbol_table::should_override): Don't complain about TLS mismatch
2286 if the TO symbol is a plugin placeholder.
2287 * testsuite/Makefile.am (plugin_test_tls): New test.
2288 * testsuite/Makefile.in: Regenerate.
2289 * testsuite/plugin_test_tls.sh: New test script.
2290 * testsuite/two_file_test_2_tls.cc: New test source.
2291 * testsuite/two_file_test_tls.cc: New test source.
2292
7fb47cc9
CC
22932013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2294
2295 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2296 the maximum segment alignment is larger than the page size.
2297 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2298 correctly aligns the symbols with large alignemnt.
2299 * testsuite/Makefile.in: Regenerate.
2300 * testsuite/large_symbol_alignment.cc: New file.
2301
6934001a
CC
23022013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2303 Sriraman Tallam <tmsriram@google.com>
2304
2305 * options.h (sort_section): New option.
2306 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2307 Rename from Input_section_sort_section_name_special_ordering_compare.
2308 (Input_section_sort_section_name_compare): New struct.
2309 * output.cc (Output_section::Input_section_sort_section_name_compare::
2310 operator()): New function.
2311 (Output_section::sort_attached_input_sections): Use new sort function
2312 for .text if --sort-section=name is specified.
2313 * layout.cc (Layout::make_output_section):
2314 Add sorting by name when --sort-section=name is specified.
2315 * testsuite/Makefile.am (text_section_grouping): Test option
2316 --sort-section=name.
2317 * testsuite/Makefile.in: Regenerate.
2318 * testsuite/section_sorting_name.cc: New file.
2319 * testsuite/section_sorting_name.sh: New file.
2320
93acabad
CC
23212013-05-21 Cary Coutant <ccoutant@google.com>
2322
2323 * symtab.h (Symbol::is_cxx_vtable): New function.
2324 * target-reloc.h (relocate_section): Check for vtable symbol.
2325 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2326 * testsuite/Makefile.in: Regenerate.
2327 * testsuite/missing_key_func.cc: New test source.
2328 * testsuite/missing_key_func.sh: New test script.
2329
60e8b3fc
CC
23302013-05-21 Cary Coutant <ccoutant@google.com>
2331
2b64b551
RM
2332 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2333 type of enclosing symbol.
2334 (Relocate_info::location): Check symbol type when describing symbol.
2335 * object.h (Symbol_location_info): Remove unused line_number;
2336 add enclosing_symbol_type.
2337 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2338
9df9de2c
CC
23392013-05-13 Cary Coutant <ccoutant@google.com>
2340
2b64b551
RM
2341 * configure.ac: Export DEFAULT_TARGET.
2342 * configure: Regenerate.
2343 * Makefile.in: Regenerate.
2344 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2345 * testsuite/Makefile.in: Regenerate.
2346 * testsuite/debug_msg.sh: Delete duplicate tests.
2347 Don't check undef_int error message match for powerpc where the
2348 source file and line number aren't available.
9df9de2c 2349
bbc5ae17
RM
23502013-05-10 Roland McGrath <mcgrathr@google.com>
2351
2352 * options.h (General_options): Add --rosegment-gap option.
2353 * options.cc (finalize): --rosegment-gap implies --rosegment.
2354 * layout.cc (set_segment_offsets): Let user option override
2355 target->rosegment_gap().
2356
0c6e6c39
RM
23572013-05-10 Roland McGrath <mcgrathr@google.com>
2358
2359 * options.h (General_options): Remove leading space from help
2360 messages for -nostdlib and --rosegment.
2361
cde7cb01
MR
23622013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2363
2364 PR ld/15365
2365 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2366
f31ae5b8
AM
23672013-05-03 Alan Modra <amodra@gmail.com>
2368
2369 * merge.cc (Output_merge_string::do_add_input_section): Correct
2370 scan for number of strings. Rename vars to avoid shadowing.
2371 Include missing terminator in input_size_.
2372
d3a7cd45
L
23732013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2374
2375 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2376 Restore empty string handling.
2377
6ad3daba
CC
23782013-05-01 Cary Coutant <ccoutant@google.com>
2379
2380 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2381 uninitialized warning.
2382
e31908b6
CC
23832013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2384
2385 * output.cc (Output_section::add_merge_input_section): Allow
2386 to merge sections if the alignment is more than character size.
2387 * merge.h (Output_merge_string::Output_merge_string): Remove
2388 assert.
2389 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2390 only not-null strings. Check the alignment of strings.
2391 * stringpool.h
2392 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2393 alignment as the argument.
2394 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2395 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2396 Align non-zero length strings according to the addralign_.
2397 (Stringpool_template<Stringpool_char>::set_string_offsets):
2398 Updating offsets according to the given alignment.
2399 * testsuite/Makefile.am (text_section_grouping): Test if string
2400 literals are getting merged.
2401 * testsuite/Makefile.in: Regenerate.
2402 * testsuite/merge_string_literals_1.c: New file.
2403 * testsuite/merge_string_literals_2.c: Ditto.
2404 * testsuite/merge_string_literals.sh: Ditto.
2405
0e804863
ILT
24062013-04-26 Ian Lance Taylor <iant@google.com>
2407
2408 * target-reloc.h (relocate_section): If the reloc offset is out of
2409 range, pass VIEW as NULL to relocate.relocate.
2410 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2411 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2412 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2413 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2414 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2415 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2416
e7c5ea40
CC
24172013-04-26 Geoff Pike <gpike@chromium.org>
2418
2419 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2420 * layout.cc (Hash_task): New class.
2421 (Layout::queue_build_id_tasks): New function.
2422 (Layout::write_build_id): Handle single-thread portion of build ID
2423 computation. (In some cases, all of it is single-threaded.) Replace
2424 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2425 functionality in fewer lines of code.
2426 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2427 * options.h (General_options): make "--build-id" default to tree
2428 rather than sha1. Add two new options related to --build-id=tree:
2429 --build-id-chunk-size-for-treehash and
2430 --build-id-min-file-size-for-treehash.
2431 * Makefile.am: add testing of --build-id=tree and related new options
2432 (these tests will be invoked by "make check").
2433 * Makefile.in: Regenerate.
2434
49926cd0
AM
24352013-04-25 Alan Modra <amodra@gmail.com>
2436
2437 * configure.tgt: Add powerpcle and powerpc64le.
2438
a4034750
AM
24392013-04-22 Alan Modra <amodra@gmail.com>
2440
2441 PR gold/15355
2442 * layout.cc (Layout::segment_precedes): Allow more than one
2443 segment with the same type and flags.
2444
e79c84aa
CC
24452013-04-15 Cary Coutant <ccoutant@google.com>
2446
2447 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2448 allocate space in file for BSS sections.
2449
2199fbe7
CC
24502013-04-15 Cary Coutant <ccoutant@google.com>
2451
2452 * script-sections.cc (Orphan_output_section): Reset address
2453 to zero after each orphaned section for relocatable links.
2454
502e8a84
CC
24552013-04-15 Cary Coutant <ccoutant@google.com>
2456
a4034750
AM
2457 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2458 section starting address for relocatable link.
2459 * testsuite/Makefile.am (script_test_11): New test.
2460 * testsuite/Makefile.in: Regenerate.
2461 * testsuite/script_test_11.c: New source file.
2462 * testsuite/script_test_11.t: New linker script.
502e8a84 2463
0cfdc767
AM
24642013-04-13 Alan Modra <amodra@gmail.com>
2465
2466 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2467 owner when sections are not adjacent and exceed group size.
2468 (Target_powerpc::group_sections): Handle corner case.
2469 (Target_powerpc::Branch_info::make_stub): Handle case where
2470 stub table doesn't exist due to branches in non-exec sections.
2471 (Target_powerpc::Relocate::relocate): Likewise.
2472
6830ee24
AM
24732013-04-11 Alan Modra <amodra@gmail.com>
2474
2475 PR gold/15354
2476 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2477 .branch_lt to match bfd ld. Adjust comments throughout file.
2478
54a3d865
ILT
24792013-04-04 Ian Lance Taylor <iant@google.com>
2480
2481 GCC PR c++/56840
2482 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2483 sections before checking whether they are included in the link.
2484
9993ba11
ST
24852013-03-29 Sriraman Tallam <tmsriram@google.com>
2486
2487 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2488 object before calling the plugin claim_file handler. Pass the elf
2489 object of the archive to the plugin. Delete the elf object if the
2490 plugin claims the file.
2491
ebacd51e
AM
24922013-03-21 Alan Modra <amodra@gmail.com>
2493
2494 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2495 segment when omagic.
2496
117be58f
AM
24972013-03-21 Alan Modra <amodra@gmail.com>
2498
2499 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2500 comparison warning.
2501 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2502 uninitialized" warning.
2503
32e2b61d
AM
25042013-03-20 Alan Modra <amodra@gmail.com>
2505
2506 * symtab.h (Symbol::clear_version): New function.
2507 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2508 is_needed by weak references. Clear version for symbols defined
2509 in as-needed objects that are not needed.
2510
b3ccdeb5
AM
25112013-03-15 Alan Modra <amodra@gmail.com>
2512
2513 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2514 static and public. Add report_err param. Return false for data refs.
2515 (Target_powerpc::rela_dyn_section): New overloaded function.
2516 (Target_powerpc::plt_, iplt_): Elucidate.
2517 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2518 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2519 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2520 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2521 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2522 push_branch and make_plt_entry for ifunc syms when
2523 reloc_needs_plt_for_ifunc.
2524 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2525 for ifunc unless reloc_needs_plt_for_ifunc.
2526
ad3d8a2f
AM
25272013-03-15 Alan Modra <amodra@gmail.com>
2528
2529 * gc.h (gc_process_relocs): Don't look through function descriptors.
2530 * icf.cc (get_section_contents): Do so here instead.
2531
4d9aa155
AM
25322013-03-13 Alan Modra <amodra@gmail.com>
2533
2534 * powerpc.cc (is_branch_reloc): Forward declare.
2535 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2536 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2537 false for 64-bit, true for 32-bit non-branch relocs.
2538 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2539 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2540 nm output.
2541 (icf_safe_test): Generate linker map file as well as nm output.
2542 (icf_safe_so_test): Likewise.
2543 * testsuite/Makefile.in: Regenerate.
2544 * testsuite/icf_test.sh: Parse linker map file to determine
2545 section folding.
2546 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2547 * testsuite/icf_safe_so_test.sh: Likewise.
2548 (X86_32_or_ARM_specific_safe_fold): Merge into..
2549 (arch_specific_safe_fold): ..this.
2550 (X86_64_specific_safe_fold): Delete unused function.
2551
57420c20
AM
25522013-03-12 Alan Modra <amodra@gmail.com>
2553
2554 * gc.h (gc_process_relocs): Look through function descriptors
2555 to determine shndx, symvalue and addend used by ICF. Tidy
2556 variable duplication.
2557
dc3714f3
AM
25582013-03-11 Alan Modra <amodra@gmail.com>
2559
2560 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2561 * layout.cc (Layout_task_runner::run): ..to here.
2562 * symtab.h (struct Symbol_location): Extract from..
2563 (class Symbol_table): ..here.
2564 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2565 * target.h (class Target): Add function_location and
2566 do_function_location functions.
2567 (class Sized_target): Add do_function_location.
2568 * object.h (class Sized_relobj_file): Move find_shdr..
2569 (class Object): ..to here.
2570 * object.cc: Likewise. Update to suit. Instantiate.
2571 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2572 * powerpc.cc (class Powerpc_dynobj): New.
2573 (Target_powerpc::do_function_location): New function.
2574 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2575 (Powerpc_dynobj::do_read_symbols): New function.
2576 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2577
956b03bb
ILT
25782013-03-08 Ian Lance Taylor <iant@google.com>
2579
2580 * options.cc (General_options::string_to_object_format): Accept
2581 "default".
2582
4bead2d5
AM
25832013-03-08 Alan Modra <amodra@gmail.com>
2584
2585 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2586 pointer to Post_fde.
2587 (struct Post_fde): Move definition to here..
2588 * ehframe.cc (struct Post_fde): ..from here.
2589 (Cie::write): Don't alloc Post_fde.
2590 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2591
02e60bf7
AM
25922013-03-07 Alan Modra <amodra@gmail.com>
2593
2594 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2595 relocation referencing .LC0.
2596 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2597
8343f03a
AM
25982013-03-07 Alan Modra <amodra@gmail.com>
2599
2600 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2601 always_inline. Add assembly for powerpc to avoid GOT.
2602
3366d57c
AM
26032013-03-07 Alan Modra <amodra@gmail.com>
2604
2605 * testsuite/script_test_10.sh: Don't test .bss section
2606 header number.
2607
6c77229c
AM
26082013-03-06 Alan Modra <amodra@gmail.com>
2609
2610 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2611 (Target_powerpc::symval_for_branch): Add symtab param. Update
2612 all callers. Handle folded sections.
2613 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2614 to Powerpc_relobj.
2615 (Global_symbol_visitor_opd::operator()): Likewise.
2616
a39e4af6
AM
26172013-03-04 Alan Modra <amodra@gmail.com>
2618
2619 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2620 * testsuite/Makefile.in: Regenerate.
2621
d5834edb
CC
26222013-03-01 Cary Coutant <ccoutant@google.com>
2623
2624 Add dwp support for v2 DWARF package file format.
2625 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2626 tu_length parameter. Adjust all callers.
2627 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2628 * dwp.cc: Include dwarf.h.
2629 (Section_bounds): New struct type.
2630 (Unit_set): New struct type.
2631 (Dwo_file::Dwo_file): Initialize new data member.
2632 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2633 Combine and rename to...
2634 (Dwo_file::read_unit_index): ...this.
2635 (Dwo_file::sized_read_compunit_index)
2636 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2637 (Dwo_file::sized_read_unit_index): ...this.
2638 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2639 parameters; add section_id parameter.
2640 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2641 (Dwo_file::add_unit_set): ...this.
2642 (Dwo_file::shndx_map_): Remove.
2643 (Dwo_file::sect_offsets_): New data member.
2644 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2645 (Dwp_output_file::add_section): Rename to...
2646 (Dwp_output_file::add_contribution): ...this.
2647 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2648 (Dwp_output_file::add_tu_set): Likewise.
2649 (Dwp_output_file::Contribution): New type.
2650 (Dwp_output_file::Section::contributions): New data member.
2651 (Dwp_output_file::Cu_or_tu_set): Remove.
2652 (Dwp_output_file::Section::Section): New ctor.
2653 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2654 (Dwp_output_file::Dwp_index::Section_table): New type.
2655 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2656 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2657 parameter.
2658 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2659 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2660 (Dwp_output_file::Dwp_index::section_table): New member function.
2661 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2662 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2663 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2664 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2665 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2666 (Dwp_output_file::Dwp_index::section_table_): New data member.
2667 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2668 (Dwp_output_file::add_output_section): New member function.
2669 (Dwp_output_file::write_new_section): New member function.
2670 (Dwp_output_file::write_contributions): New member function.
2671 (Dwp_output_file::section_id_map_): New data member.
2672 (class Dwo_id_info_reader): Remove.
2673 (class Unit_reader): New class.
2674 (get_dwarf_section_name): New function.
2675 (Dwo_file::read_executable): Adjust initializations of class data.
2676 (Dwo_file::read): Add support for v2 package file format.
2677 (Dwo_file::read_unit_index): Likewise.
2678 (Dwo_file::sized_read_unit_index): Likewise.
2679 (Dwo_file::copy_section): Likewise.
2680 (Dwo_file::add_unit_set): Likewise.
2681 (Dwp_output_file::add_output_section): Likewise.
2682 (Dwp_output_file::add_contribution): Likewise.
2683 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2684 for empty slot.
2685 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2686 file format.
2687 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2688 slot.
2689 (Dwp_output_file::initialize): Remove unused function.
2690 (Dwp_output_file::finalize): Add support for v2 package file format.
2691 (Dwp_output_file::write_index): Likewise.
2692 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2693 function prototype.
2694
a68a081d
CC
26952013-03-01 Cary Coutant <ccoutant@google.com>
2696
2697 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2698 function into class definition in header file.
2699 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2700 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2701 New function.
2702 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2703
9d5781f8
AM
27042013-02-28 Alan Modra <amodra@gmail.com>
2705
2706 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2707 * target.cc (Target::do_plt_fde_location): New function.
2708 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2709 accessor function, and constructor param.
2710 (struct Post_fde, Post_fdes): Declare.
2711 (Cie::write): Add post_fdes param.
2712 * ehframe.cc (Fde::write): Use plt_fde_location.
2713 (struct Post_fde): Define.
2714 (Cie::write): Stash FDEs added post merge mapping.
2715 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2716 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2717 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2718 other FDEs.
2719 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2720 (Target_powerpc::has_glink): New function.
2721 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2722 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2723 glink_eh_frame_fde_32, default_fde): New data.
2724 (Stub_table::eh_frame_added_): New var.
2725 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2726 Make const.
2727 (Stub_table::add_eh_frame): New function.
2728 (Output_data_glink::add_eh_frame): New function.
2729 (Target_powerpc::make_glink_section): Call add_eh_frame.
2730
214383dd
ILT
27312013-02-15 Ian Lance Taylor <iant@google.com>
2732
2733 * options.h (DEFINE_uint64_alias): Define.
2734 (class General_options): Add -Ttext-segment as an alias for
2735 -Ttext.
2736
91c2b899
AM
27372013-02-15 Alan Modra <amodra@gmail.com>
2738
2739 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2740 (Stub_table::do_write): ..here, two places.
2741 (Stub_table::plt_call_size): Use it here too.
2742
20e2a8aa
ILT
27432013-02-11 Ian Lance Taylor <iant@google.com>
2744
2745 * descriptors.cc (Descriptors::close_all): New function.
2746 * descriptors.h (class Descriptors): Declare close_all.
2747 (close_all_descriptors): New inline function.
2748 * plugin.cc: Include "descriptors.h".
2749 (Plugin_manager::cleanup): Call close_all_descriptors.
2750
8952bc69
AM
27512013-02-06 Alan Modra <amodra@gmail.com>
2752
2753 * README: Update coding style link.
2754
29bd8b6b
CC
27552013-01-28 Cary Coutant <ccoutant@google.com>
2756
a4034750
AM
2757 * dwp.cc (File_list): New typedef.
2758 (Dwo_name_info_reader): New class.
2759 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2760 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2761 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2762 (Dwo_file::read_executable): New function.
2763 (Dwo_file::read): Move common setup code to ...
2764 (Dwo_file::make_object): ... here.
2765 (dwp_options): Add --exec/-e.
2766 (usage): Likewise.
2767 (main): Likewise.
29bd8b6b 2768
c6ac678d
ST
27692013-01-24 Sriraman Tallam <tmsriram@google.com>
2770
2771 * layout.cc (Layout::layout): Check for option text_reorder.
2772 (Layout::make_output_section): Ditto.
2773 * options.h (text_reorder): New option.
2774 * output.cc (Input_section_sort_compare): Remove special ordering
2775 of section names.
2776 (Output_section::
2777 Input_section_sort_section_name_special_ordering_compare::
2778 operator()): New function.
2779 (Output_section::sort_attached_input_sections): Use new sort function
2780 for .text.
2781 * output.h (Input_section_sort_section_name_special_ordering_compare):
2782 New struct.
2783 * testsuite/Makefile.am (text_section_grouping): Test option
2784 --no-text-reorder
2785 * testsuite/Makefile.in: Regenerate.
2786 * testsuite/text_section_grouping.sh: Check order of functions without
2787 default text reordering.
2788
50701cc1
MF
27892013-01-18 Mike Frysinger <vapier@gentoo.org>
2790
2791 * options.h (General_options): Change default to true for new_dtags.
2792
b1b00fcc
MF
27932013-01-18 Mike Frysinger <vapier@gentoo.org>
2794
2795 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2796 when enable_new_dtags is false. Only add DT_RUNPATH when
2797 enable_new_dtags is true.
2798
ec5b8187
AM
27992013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2800
2801 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2802 used in declaration and definition consistent.
2803 (Target_powerpc::symval_for_branch): Ditto.
2804
a880d4c4
ST
28052013-01-16 Sriraman Tallam <tmsriram@google.com>
2806
2807 * testsuite/plugin_final_layout.cc: Fix comment.
2808
7c381248
ST
28092013-01-16 Sriraman Tallam <tmsriram@google.com>
2810
2811 * layout.cc (Layout::layout): Do not do default sorting for
2812 text sections when section ordering is specified.
2813 (make_output_section): Ditto.
2814 * testsuite/plugin_final_layout.cc: Name the function sections
2815 to catch reordering issues.
2816
e2458743
AM
28172013-01-15 Alan Modra <amodra@gmail.com>
2818
2819 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2820 plt-thread-safe.
2821
431ed302
AM
28222013-01-15 Alan Modra <amodra@gmail.com>
2823
2824 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2825 * testsuite/Makefile.in: Regenerate.
2826
0ec6429b
AM
28272013-01-14 Alan Modra <amodra@gmail.com>
2828
2829 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2830 * testsuite/Makefile.in: Regenerate.
2831
0bf402d5
ILT
28322013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2833
36af3926 2834 PR bfd/14430
0bf402d5
ILT
2835 Fix mingw gold build with plugins enabled
2836 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2837 * configure.ac: Export DLOPEN_LIBS and add headers check.
2838 * plugin.cc: Handle non-dlfcn case.
2839 * Makefile.in: Regenerate.
2840 * config.in: Regenerate.
2841 * configure: Regenerate.
2842 * testsuite/Makefile.in: Regenerate.
2843
9e9143bc
ST
28442013-01-09 Sriraman Tallam <tmsriram@google.com>
2845
2846 * output.h (sort_attached_input_sections): Change to be public.
2847 * script-sections.cc
2848 (Output_section_definition::set_section_addresses): Sort
2849 attached input sections according to section order before linker
2850 script assigns section addresses.
2851 (Orphan_output_section::set_section_addresses): Sort
2852 attached input sections according to section order before linker
2853 script assigns section addresses.
2854 * Makefile.am (final_layout.sh): Use a simple linker script to
2855 check if section ordering still works.
2856 * Makefile.in: Regenerate.
2857
679af368
ILT
28582013-01-09 Ben Cheng <bccheng@google.com>
2859
2860 * arm.cc (Target_arm::attributes_accept_div): New function.
2861 (Target_arm::attributes_forbid_div): New function.
2862 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2863 attribute using the same new functions as what bfd/elf32_arm.c
2864 does.
2865
3136a00e
CC
28662013-01-07 Cary Coutant <ccoutant@google.com>
2867
2868 PR gold/14993
2869 * output.cc (Output_section::add_input_section): For incremental
2870 updates, don't track input sections that are allocated from patch
2871 space.
2872
f2a6224b
L
28732013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2874 Ian Lance Taylor <iant@google.com>
2875
2876 PR gold/14897
2877 * configure.ac (--enable-ld): Removed.
2878 (install_as_default): Set to yes only for --enable-gold=default
2879 or --disable-ld.
2880 * configure: Regenerated.
2881
4f46f626
L
28822013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2883
2884 * options.h (General_options): Add -fuse-ld= for GCC linker
2885 option compatibility.
2886
26e4ef59
CC
28872013-01-04 Cary Coutant <ccoutant@google.com>
2888
2889 * configure.ac: Fix typo restoring CXXFLAGS.
2890 * configure: Regenerate.
2891
3d587466
CC
28922013-01-04 Cary Coutant <ccoutant@google.com>
2893
4f46f626
L
2894 * testsuite/Makefile.am (CXXLINK_S): New macro.
2895 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2896 * testsuite/Makefile.in: Regenerate.
3d587466 2897
44db6695
L
28982013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2899
2900 * version.cc (print_version): Update copyright year to 2013.
2901
edcac0c1
ILT
29022012-12-20 Ian Lance Taylor <iant@google.com>
2903
2904 * layout.cc (Layout::special_ordering_of_input_section): New
2905 function.
2906 (Layout::layout): If input section requires special ordering, must
2907 sort input sections.
2908 (Layout::make_output_section): May sort .text input sections.
2909 (Layout::is_section_name_prefix_grouped): Remove.
2910 * layout.h (class Layout): Declare
2911 special_ordering_of_input_section. Don't declare
2912 is_section_name_prefix_grouped.
2913 * output.cc (Output_section::add_input_section): Revert last
2914 change.
2915 (Output_section::Input_section_sort::match_file_name): Don't crash
2916 if called on output section data.
2917 (Output_section::Input_section_sort_compare): Sort based on
2918 special ordering.
2919 (Output_section::Input_section_sort_section_order_index_compare):
2920 Revert last patch.
2921 (Output_section::sort_attached_input_sections): Likewise.
2922
28f2a4ac
ST
29232012-12-18 Sriraman Tallam <tmsriram@google.com>
2924
edcac0c1 2925 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2926 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2927 * output.cc (Output_section::add_input_section): Check if section
2928 name contains special prefix. Keep input sections to sort such
2929 sections.
2930 (Output_section::Input_section_sort_section_order_index_compare
2931 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2932 (Output_section::sort_attached_input_sections): Add condition to
2933 Input_section_entry constructor call.
28f2a4ac
ST
2934 * testsuite/Makefile.am (text_section_grouping): New test.
2935 * testsuite/Makefile.in: Regenerate.
2936 * testsuite/text_section_grouping.cc: New file.
2937 * testsuite/text_section_grouping.sh: New file.
2938
5bf135a7
NC
29392012-12-17 Nick Clifton <nickc@redhat.com>
2940
2941 * Makefile.am: Add copyright notice.
2942 * NEWS: Likewise.
2943 * README: Likewise.
2944 * configure.ac: Likewise.
2945 * ftruncate.c: Likewise.
2946 * Makefile.in: Regenerate.
2947
59965708
CC
29482012-12-14 Cary Coutant <ccoutant@google.com>
2949
a4034750
AM
2950 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2951 --no-as-needed flag.
2952 (exception_separate_shared_12_test): Likewise.
2953 (incremental_copy_test): Likewise.
2954 * testsuite/Makefile.in: Regenerate.
59965708 2955
2a77e2ab
CC
29562012-12-14 Cary Coutant <ccoutant@google.com>
2957
2958 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2959 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2960
e3deeb9c
AM
29612012-12-12 Alan Modra <amodra@gmail.com>
2962
2963 * powerpc.cc (class Track_tls): New.
2964 (class Relocate, class Scan): Inherit Track_tls.
2965 (Target_powerpc::Scan::local, global): Track tls optimization
2966 and avoid creating plt entry for __tls_get_addr if all uses
2967 are optimized away.
2968 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2969
d8f5a274
AM
29702012-12-12 Alan Modra <amodra@gmail.com>
2971
2972 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2973 Replace no_toc_optimize with toc_optimize.
2974 * output.h (Output_section::input_sections): Provide non-const variant.
2975 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2976 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2977 accessors.
2978 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2979 (class Sort_toc_sections): New.
2980 (Target_powerpc::do_finalize_sections): Sort toc sections.
2981 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2982
4c8a1de1
RM
29832012-12-10 Roland McGrath <mcgrathr@google.com>
2984
2985 * testsuite/binary_unittest.cc (read_all): New function.
2986 (Sized_binary_test): Use it instead of ::read.
2987 * fileread.cc (do_read): Don't assume pread always reads the whole
2988 amount in a single call.
2989
edc27beb
AM
29902012-12-10 Alan Modra <amodra@gmail.com>
2991
2992 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2993 Set EM_PPC64 or EM_PPC here.
2994 (Target_selector_powerpc::do_recognize): Delete.
2995
906b9150
AM
29962012-12-10 Alan Modra <amodra@gmail.com>
2997
2998 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2999 stub_table_.
3000 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3001
418c15ae
RM
30022012-12-07 Roland McGrath <mcgrathr@google.com>
3003
3004 * testsuite/binary_unittest.cc (Sized_binary_test):
3005 Use open_descriptor rather than ::open.
3006
decdd3bc
AM
30072012-12-07 Alan Modra <amodra@gmail.com>
3008
3009 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3010 typedef and invalid_address constant.
3011 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3012 instantiate constants.
3013
db399005
ILT
30142012-12-06 Roland McGrath <mcgrathr@google.com>
3015
3016 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3017 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3018 * aclocal.m4: Regenerate.
3019 * configure: Regenerate.
3020 * Makefile.in: Regenerate.
3021 * testsuite/Makefile.in: Regenerate.
3022
aba6bc71
AM
30232012-12-07 Alan Modra <amodra@gmail.com>
3024
3025 * options.h (General_options): Add no_toc_optimize.
3026 * powerpc.cc (ok_lo_toc_insn): New function.
3027 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3028
9e69ed50
AM
30292012-12-06 Alan Modra <amodra@gmail.com>
3030
3031 * options.h (General_options): Add plt_align, plt_static_chain,
3032 plt_thread_safe. Update stub_group_size help text.
3033 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3034 for new plt_thread_safe_ var.
3035 (use_plt_offset): Correct comments.
3036 (Target_powerpc::do_relax): Look for thread creation symbols to
3037 determine default plt_thread_safe value. Clear plt call stubs
3038 as well as branch stubs each iteration.
3039 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3040 insn constants.
3041 (l, hi, ha, write_insn): Move earlier.
3042 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3043 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3044 plt stubs too.
3045 (Stub_table::update_size): Adjust.
3046 (Stub_table::prev_size, set_prev_size): Delete.
3047 (Stub_table::stub_align): Let --plt-align affect result.
3048 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3049 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3050 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3051 (Stub_table::do_write): Support more stub variants.
3052
f43ba157
AM
30532012-12-04 Alan Modra <amodra@gmail.com>
3054
3055 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3056 (Target_powerpc::do_define_standard_symbols): New function.
3057
34171bc5
AM
30582012-12-03 Alan Modra <amodra@gmail.com>
3059
3060 * output.h: Formatting, whitespace.
3061
dc9589e9 30622012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3063
3064 * layout.h (Layout::get_executable_sections): Declare.
3065 * layout.cc (Layout::get_executable_sections): New function.
3066 * arm.cc (Target_arm::group_sections): Use it.
3067 (Arm_output_section::group_sections): Delete now redundant test.
3068 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3069 param to handle relative relocs.
3070 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3071 (Output_data_reloc::add_absolute): Adjust.
3072 (Output_data_reloc::add_relative): New function.
3073 (Output_data::reset_data_size): New function.
3074 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3075 (Output_section::set_addralign): New function.
3076 (Output_section::checkpoint_set_addralign): New function.
3077 (Output_section::clear_section_offsets_need_adjustment): New function.
3078 (Output_section::input_sections): Make public.
3079 * powerpc.cc (class Output_data_brlt_powerpc): New.
3080 (class Stub_table, class Stub_control): New.
3081 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3082 stub_table_, set_stub_table, stub_table): New vectors and accessor
3083 functions.
3084 (Target_powerpc::do_may_relax, do_relax, push_branch,
3085 new_stub_table, stub_tables, brlt_section, group_sections,
3086 add_branch_lookup_table, find_branch_lookup_table,
3087 write_branch_lookup_table, make_brlt_section): New functions.
3088 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3089 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3090 branch_info_): New vars.
3091 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3092 make call stubs here.
3093 (Output_data_glink): Remove all call stub handling from this class.
3094 (Target_powerpc::Scan::local, global): Save interesting branch
3095 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3096 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3097 functions on final link.
3098 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3099 Handle long branch destinations too.
3100 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3101 do_plt_address_for_local): Adjust lookup of plt call stubs.
3102
627b30b7
AM
31032012-11-30 Alan Modra <amodra@gmail.com>
3104
3105 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3106 relocs against protected symbols when building 32-bit shared libs.
3107
40b469d7
AM
31082012-11-30 Alan Modra <amodra@gmail.com>
3109
3110 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3111 param. Call got_section() to make .got. Update all callers
3112 and their callers and so on.
3113
bb66a627
AM
31142012-11-30 Alan Modra <amodra@gmail.com>
3115
3116 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3117 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3118 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3119 value if it already exists.
3120
d2cf1c6c
L
31212012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3122
3123 PR gold/14858
3124 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3125
edccdf7c
RM
31262012-11-14 Roland McGrath <mcgrathr@google.com>
3127
3128 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3129 than bfc instruction for data sandboxing.
3130
6febeb74
AM
31312012-11-08 Alan Modra <amodra@gmail.com>
3132
3133 * po/POTFILES.in: Regenerate.
3134
0a6f1bf2
AM
31352012-11-05 Alan Modra <amodra@gmail.com>
3136
3137 * configure.ac: Apply 2012-09-10 change to config.in here.
3138 * configure: Regenerate.
3139
26a4e9cb
AM
31402012-11-05 Alan Modra <amodra@gmail.com>
3141
3142 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3143 (struct Opd_ent): Use "Address" rather than "Offset".
3144 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3145 (Target_powerpc::got_section): Make public.
3146 (Target_powerpc::scan_relocs): Move code setting symbols..
3147 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3148 Create _SDA_BASE_ only when referenced.
3149
cc928013
RM
31502012-11-02 Roland McGrath <mcgrathr@google.com>
3151
3152 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3153 from last change.
3154
50ed5eb1
RM
31552012-11-01 Roland McGrath <mcgrathr@google.com>
3156
62fe925a
RM
3157 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3158 for offset_in_output_section parameter.
3159 (Sized_target::relocate_special_relocatable): Likewise.
3160 * arm.cc (Target_arm::relocate_relocs): Likewise.
3161 (Target_arm::relocate_special_relocatable): Likewise.
3162 * i386.cc (Target_i386::relocate_relocs): Likewise.
3163 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3164 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3165 * target-reloc.h (relocate_relocs): Likewise.
3166 * testsuite/testfile.cc (Target_test): Likewise.
3167 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3168 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3169
3170 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3171 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3172
3173 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3174 parameter, which is unused in the [!F_SETFD] case.
3175
50ed5eb1
RM
3176 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3177 SYMNDX to off_t before comparing it to this->data_size().
3178 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3179 * incremental.cc (Output_section_incremental_inputs::do_write):
3180 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3181
2cadc0bf
RM
3182 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3183
3bfcb652
NC
31842012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3185
3186 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3187 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3188 in EABI_VER5.
3189
c1a8d56e
CC
31902012-10-29 Cary Coutant <ccoutant@google.com>
3191
3192 * dwp.cc (usage): Add file and exit status parameters;
3193 add --help and --version options.
3194 (print_version): New function.
3195 (main): Add --help and --version options.
3196
b2490a7b
L
31972012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3198
3199 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3200 final_layout_sequence.txt.
3201 * testsuite/Makefile.in: Regenerated.
3202
aa543512
L
32032012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3204
3205 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3206 COMPILE generated by automake.
3207 (LINK1): Likewise.
3208 (CXXCOMPILE1): Likewise.
3209 (CXXLINK1): Likewise.
3210 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3211 (LINK): Likewise.
3212 (CXXCOMPILE): Likewise.
3213 (CXXLINK): Likewise.
3214 * testsuite/Makefile.in: Regenerated.
3215
d361fafb
L
32162012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3217
3218 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3219 on bad fwrite return.
3220
598c7410
L
32212012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3222
3223 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3224 on val.
3225
35c813e2
CC
32262012-10-23 Cary Coutant <ccoutant@google.com>
3227
3228 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3229 * testsuite/Makefile.in: Regenerate.
3230 * testsuite/dwp_test.h: New source file.
3231 * testsuite/dwp_test_1.cc: New source file.
3232 * testsuite/dwp_test_1.s: New source file.
3233 * testsuite/dwp_test_1.sh: New source file.
3234 * testsuite/dwp_test_1b.cc: New source file.
3235 * testsuite/dwp_test_1b.s: New source file.
3236 * testsuite/dwp_test_2.cc: New source file.
3237 * testsuite/dwp_test_2.s: New source file.
3238 * testsuite/dwp_test_2.sh: New source file.
3239 * testsuite/dwp_test_main.cc: New source file.
3240 * testsuite/dwp_test_main.s: New source file.
3241
77429909
CC
32422012-10-23 Cary Coutant <ccoutant@google.com>
3243
3244 * dwp.h: New header file.
3245 * dwp.cc: New source file.
3246 * gold.h: Move shared declarations to system.h.
3247 * system.h: New header file.
3248 * Makefile.am: Add dwp.
3249 * Makefile.in: Regenerate.
3250
ed5d6712
CC
32512012-10-23 Cary Coutant <ccoutant@google.com>
3252
3253 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3254 Dwarf_info_reader::read_from_pointer.
3255 (Dwarf_pubnames_table::read_header): Likewise.
3256 (Dwarf_pubnames_table::next_name): Likewise.
3257 (Dwarf_die::read_attributes): Likewise.
3258 (Dwarf_die::skip_attributes): Likewise.
3259 (Dwarf_info_reader::read_from_pointer): New function template.
3260 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3261 (Dwarf_pubnames_table): Likewise.
3262 (Dwarf_info_reader::read_from_pointer): New function template.
3263 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3264 Dwarf_pubnames_table ctor.
3265
8787852d
CC
32662012-10-23 Cary Coutant <ccoutant@google.com>
3267
3268 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3269 abbrev_shndx.
3270 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3271 abbrev_shndx_.
3272 (Dwarf_info_reader::set_abbrev_shndx): New method.
3273 (Dwarf_info_reader::abbrev_shndx_): New data member.
3274
9fc236f3
CC
32752012-10-23 Cary Coutant <ccoutant@google.com>
3276
3277 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3278 from object, not parameters.
3279 (Dwarf_info_reader::parse): Likewise.
3280 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3281 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3282 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3283 methods.
3284
effe8365
CC
32852012-10-23 Cary Coutant <ccoutant@google.com>
3286
3287 * fileread.cc (Input_file::Input_file): New constructor.
3288 * fileread.h (class Input_file): Add new constructor.
3289
1698990d
AM
32902012-10-18 Alan Modra <amodra@gmail.com>
3291
3292 PR gold/14727
3293 * object.cc (Relobj::is_section_name_included): Also match
3294 .sdata personality section.
3295
168a4726
AM
32962012-10-18 Alan Modra <amodra@gmail.com>
3297
3298 * target-reloc.h (class Default_comdat_behavior): New, package up..
3299 (get_comdat_behaviour): ..this.
3300 (relocate_section): Add Relocate_comdat_behavior template arg,
3301 adjust code to suit.
3302 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3303 (Target_arm::scan_reloc_section): Likewise.
3304 * i386.cc (Target_i386::relocate_section): Likewise.
3305 * sparc.cc (Target_sparc::relocate_section): Likewise.
3306 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3307 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3308 * powerpc.cc (class Relocate_comdat_behavior): New.
3309 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3310 gold::relocate_section with new template arg.
3311
acc276d8
AM
33122012-10-18 Alan Modra <amodra@gmail.com>
3313
3314 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3315 dynamic relocs for GOT_TPREL got entries, without symbol if
3316 resolving locally.
3317 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3318 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3319 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3320
e10f9870
AM
33212012-10-17 Alan Modra <amodra@gmail.com>
3322
3323 PR gold/14726
3324 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3325
ae034989
ST
33262012-10-16 Sriraman Tallam <tmsriram@google.com>
3327
3328 * layout.cc (Layout::include_section): Keep sections marked
3329 SHF_EXCLUDE when doing relocatable links.
3330
f3a0ed29
AM
33312012-10-16 Alan Modra <amodra@gmail.com>
3332
3333 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3334 (Target_powerpc::do_finalize_sections): Call it.
3335 (Output_data_save_res): New class and supporting functions.
3336 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3337 normal symbols defined in object files.
3338
c6de8ed4
AM
33392012-10-12 Alan Modra <amodra@gmail.com>
3340
3341 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3342 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3343 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3344 section if scan_opd_relocs not yet called.
3345 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3346
03e25981
AM
33472012-10-12 Alan Modra <amodra@gmail.com>
3348
3349 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3350 add_local_ifunc_entry): Revert last change.
3351 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3352
c9824451
AM
33532012-10-05 Alan Modra <amodra@gmail.com>
3354
3355 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3356 do_plt_address_for_global): New functions.
3357 (Output_data_got_powerpc::do_write): Don't segfault when linking
3358 statically.
3359 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3360 add_local_ifunc_entry): Return true on adding entry..
3361 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3362 glink->add_entry call. Remove unused symtab param. Adjust calls.
3363 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3364 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3365 set up symbols here.
3366 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3367 syms here. Do so even when no .iplt. Don't segfault when linking
3368 statically.
3369 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3370 new variants without reloc param.
3371 (Glink_sym_ent::Glink_sym_ent): Likewise.
3372 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3373 reloc when refs will resolve to plt call stub.
3374 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3375 R_PPC_PLTREL24 to resolve locally.
3376 (Target_powerpc::Scan::global): Correct ifunc handling.
3377 (Target_powerpc::Relocate::relocate): Correct local sym glink
3378 lookup. Don't destroy "value" when we have a plt call stub,
3379 and when checking plt call validity.
3380 (Target_powerpc::do_dynsym_value): Simplify.
3381
19fec8c1
AM
33822012-10-05 Alan Modra <amodra@gmail.com>
3383
3384 * i386.cc (Output_data_plt_i386::address_for_global,
3385 address_for_local): Add plt offset to returned value. Adjust uses.
3386 * sparc.cc (Output_data_plt_sparc::address_for_global,
3387 address_for_local): Likewise.
3388 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3389 address_for_local): Likewise.
3390 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3391 address_for_local): Likewise.
3392 * target.h (Target::plt_address_for_global, plt_address_for_local):
3393 Update comment.
3394 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3395 (Output_data_got::Got_entry::write): Nor here.
3396 * output.h: Comment fix.
3397
e867b647
WL
33982012-10-02 Jiong Wang <jiwang@tilera.com>
3399
3400 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3401 global_offset_table_ value for larget got.
3402 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3403
e5d5f5ed
AM
34042012-09-29 Alan Modra <amodra@gmail.com>
3405
3406 * powerpc.cc (Target_powerpc::iplt_): New output section.
3407 (Target_powerpc::iplt_section, make_iplt_section,
3408 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3409 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3410 Target_powerpc::plt_entry_count): Count iplt entries too.
3411 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3412 reloc section in constructor. New params.
3413 (Target_powerpc::make_plt_section): Create reloc section here instead.
3414 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3415 functions.
3416 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3417 (Output_data_glink::add_entry, find_entry): New functions to
3418 deal with local syms.
3419 (Glink_sym_ent): Add support for local syms.
3420 (Output_data_glink::do_write): Handle ifunc plt entries.
3421 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3422 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3423 (Target_powerpc::Relocate::relocate): Likewise.
3424 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3425
ec4dbad3
AM
34262012-09-25 Alan Modra <amodra@gmail.com>
3427
3428 * object.h (Sized_relobj_file::adjust_local_symbol,
3429 do_adjust_local_symbol): New functions.
3430 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3431 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3432 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3433 and irregular opd entry spacing.
3434 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3435 (Global_symbol_visitor_opd): New functor.
3436 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3437 on deleted opd entries.
3438
5c0b3823
WL
34392012-09-15 Jiong Wang <jiwang@tilera.com>
3440
3441 * tilegx.cc: New file.
3442 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3443 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3444 * configure.tgt: Add entries for tilegx*.
3445 * configure.ac: Likewise.
3446 * Makefile.in: Rebuild.
3447 * configure: Likewise.
3448 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3449 tilegx.
3450
bfdfa4cd
AM
34512012-09-13 Alan Modra <amodra@gmail.com>
3452
3453 * target-reloc.h (scan_relocs): Call scan.local for relocs
3454 against symbols in discarded sections. Pass is_discarded
3455 param.
3456 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3457 Add is_discarded param.
3458 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3459 is_discarded to flag opd entry as discarded. Don't emit dyn
3460 relocs on such entries.
3461 (Target_powerpc::Scan::global): Similarly detect and handle
3462 such opd entries.
3463 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3464 opd_ent_. Update all uses.
3465 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3466 (Target_powerpc::relocate_section): Zero out discarded opd
3467 entry relocs.
3468
d77a0555
ILT
34692012-09-12 Ian Lance Taylor <iant@google.com>
3470
3471 PR gold/14570
3472 * output.cc: Rename Output_data_got template parameter from size
3473 to got_size for all functions. Compile all variants of
3474 Output_data_got.
3475 (Output_data_got::Got_entry::write): Correct use of size for
3476 symbol value. Use local_is_tls rather than casting to
3477 Sized_relobj_file.
3478 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3479 (class Sized_relobj_file): Add do_local_is_tls.
3480 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3481
815a1205
AM
34822012-09-11 Alan Modra <amodra@gmail.com>
3483
3484 PR gold/14566
3485 * layout.cc (Layout::set_segment_offsets): When using
3486 common-page-size alignment, ensure we are on a new max-page-size
3487 page.
3488 * output.cc (Output_segment::set_section_addresses): Use
3489 abi_pagesize, not common_pagesize for relro boundary.
3490 (Output_segment::set_offset): Likewise.
3491
bd73a62d
AM
34922012-09-11 Alan Modra <amodra@gmail.com>
3493
3494 * output.h (Output_data_got::add_global_tls, add_local_tls,
3495 add_local_tls_pair): New functions.
3496 (Output_data_got::add_local_pair_with_rel): Remove second
3497 reloc param. Expand comment.
3498 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3499 use_plt_or_tls_offset_, similarly for constructor param.
3500 (Output_data_got::Got_entry::write): Add got_index param.
3501 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3502 add_local_tls_pair): New functions.
3503 (Output_data_got::Got_entry::write): Handle tls symbols
3504 with use_plt_or_tls_offset_ set specially.
3505 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3506 (Output_data_got::do_write): Replace iterator with index, pass
3507 index to entry write function.
3508 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3509 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3510 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3511 call.
3512 * i386.cc (Target_i386::Scan::local): Likewise.
3513 * sparc.cc (Target_sparc::Scan::local): Likewise.
3514 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3515 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3516 do_tls_offset_for_global): New functions.
3517 (Target_powerpc::Scan::local): Correct TLS relocations and got
3518 entry values.
3519 (Target_powerpc::Scan::global): Don't emit unnecessary
3520 dynamic relocations on TLS GOT entries.
3521
00716ab1
AM
35222012-09-10 Matthias Klose <doko@ubuntu.com>
3523
3524 * config.in: Disable sanity check for kfreebsd.
3525
c891b3f9
SA
35262012-09-10 Sterling Augustine <saugustine@google.com>
3527
3528 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3529 (Gdb_index::pubtypes_read): New parameter.
3530 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3531 to calls.
3532 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3533 pubtypes_object_.
3534
e81fea4d
AM
35352012-09-09 Alan Modra <amodra@gmail.com>
3536
3537 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3538 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3539 * gc.h (gc_process_relocs): Call target gc_add_reference.
3540 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3541 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3542 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3543 unnecessary cast.
3544 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3545 to cater for when we don't need code offset. Update use.
3546 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3547 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3548 set_opd_valid): New functions.
3549 (Target_powerpc::do_gc_add_reference): New function.
3550 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3551 stashed refs.
3552 (Target_powerpc::do_gc_mark_symbol): New function.
3553
d2d60eef
CC
35542012-09-06 Cary Coutant <ccoutant@google.com>
3555
3556 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3557 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3558 (Dwarf_die::skip_attributes): Likewise.
3559 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3560 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3561 (main): Call it.
3562 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3563
32ed4573
L
35642012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3565
3566 * testsuite/script_test_3.t: Add .got.plt output section
3567 statement.
3568 * testsuite/script_test_4.t: Likewise.
3569
f4baf0d4
AM
35702012-09-05 Alan Modra <amodra@gmail.com>
3571
3572 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3573 update all uses and lose "enum" when using type.
3574
864a1b56
AM
35752012-09-05 Alan Modra <amodra@gmail.com>
3576
3577 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3578 * configure: Regenerate.
3579 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3580 (plugin_final_layout.stdout): Likewise.
3581 (memory_test): Set page sizes to 0x1000.
3582 * testsuite/Makefile.in: Regenerate.
3583 * testsuite/discard_locals_test.sh: Add FIXME comment.
3584 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3585 * testsuite/pr14265.t: Add .got output section statement.
3586 * testsuite/script_test_2.t: Likewise.
3587 * testsuite/script_test_3.t: Likewise.
3588 * testsuite/script_test_4.t: Likewise.
3589 * testsuite/script_test_5.t: Likewise.
3590 * testsuite/script_test_6.t: Likewise.
3591 * testsuite/script_test_7.t: Likewise.
3592 * testsuite/script_test_9.t: Likewise.
3593
3ea0a085
AM
35942012-09-05 Alan Modra <amodra@gmail.com>
3595
3596 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3597 (Powerpc_relocate_functions::Status): New typedef.
3598 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3599 (Target_powerpc::Scan::local): Handle REL64.
3600 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3601 for REL32 and REL64.
3602 (Target_powerpc::symval_for_branch): New function, extracted from..
3603 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3604 checks. Report overflow errors.
3605
7404fe1b
AM
36062012-09-05 Alan Modra <amodra@gmail.com>
3607
3608 * object.h (Sized_relobj_file::emit_relocs): Delete.
3609 (Sized_relobj_file::emit_relocs_reltype): Delete.
3610 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3611 relocate_relocs for --emit-relocs.
3612 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3613 * output.h: Update comment.
3614 (Output_segment::first_section): New function.
3615 (Output_segment::first_section_load_address): Use first_section.
3616 * output.cc (Output_segment::first_section): New function extracted..
3617 (Output_segment::first_section_load_address): ..from here. Delete.
3618 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3619 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3620 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3621 adjust call to target.h function.
3622 * i386.cc (Target_i386): Likewise.
3623 * sparc.cc (Target_sparc): Likewise.
3624 * x86_64.cc (Target_x86_64): Likewise.
3625 * powerpc.cc (Target_powerpc): Likewise.
3626 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3627 first tls section has section symbol for optimised local dynamic
3628 output relocs.
3629 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3630 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3631 optimised tls code.
3632 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3633 Rename to relocate_relocs. Update error message.
3634
957564c9
AS
36352012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3636
3637 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3638 --just-symbols.
3639
dd93cd0a
AM
36402012-08-31 Alan Modra <amodra@gmail.com>
3641
3642 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3643 (Powerpc_relobj::toc_base_offset): New stub function.
3644 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3645 got_mod_index_offset to tlsld_got_offset. Update all refs.
3646 (Target_powerpc::Relocate::enum skip_tls): New.
3647 (Target_powerpc::call_tls_get_addr_): New var.
3648 (Target_powerpc::is_branch_reloc): Move to file scope.
3649 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3650 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3651 New functions.
3652 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3653 (powerpc_info): Correct common_pagesize for ppc64.
3654 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3655 (Powerpc_relocate_functions): Add overflow check enums and functions.
3656 Add non-shift version of rela, rela_ua. Delete all rel public
3657 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3658 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3659 addr16_ha3, addr14 functions.
3660 (Output_data_got_powerpc::add_constant_pair): New function.
3661 (Output_data_got_powerpc::got_base_offset): Likewise.
3662 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3663 (instruction constants): Sort, add some more.
3664 (Output_data_glink::do_write): Add and use Address typedef. Use
3665 object->toc_base_offset() stub for 64-bit.
3666 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3667 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3668 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3669 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3670 Always treat .opd relocs as against locally defined symbol.
3671 Correct condition for RELATIVE relocs.
3672 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3673 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3674 for 32-bit syms with a plt entry. Correct ppc64 toc base
3675 calculations. Handle TLS relocs, and more. Add overflow
3676 checking and adjust for Powerpc_relocate_functions changes.
3677 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3678 Reinstate --emit-relocs code with FIXME.
3679
a1373b60
AM
36802012-08-30 Alan Modra <amodra@gmail.com>
3681
3682 * layout.cc (Layout::set_segment_offsets): Set p_align to
3683 abi_pagesize, not common_pagesize.
3684 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3685 to determine whether file header can go in segment.
3686
703d02da
AM
36872012-08-30 Alan Modra <amodra@gmail.com>
3688
3689 * output.h (Output_reloc::Output_reloc <output section>): Add
3690 is_relative param. Adjust calls.
3691 (Output_reloc::add_output_section_relative): New functions.
3692 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3693 is_relative.
3694 (Output_reloc::symbol_value): Handle SECTION_CODE.
3695
16164a6b
ST
36962012-08-24 Sriraman Tallam <tmsriram@google.com>
3697
3698 * gold.cc (queue_middle_tasks): Call layout again when unique
3699 segments for sections is desired.
3700 * layout.cc (Layout::Layout): Initialize new members.
3701 (Layout::get_output_section_flags): New function.
3702 (Layout::choose_output_section): Call get_output_section_flags.
3703 (Layout::layout): Make output section for mapping to a unique segment.
3704 (Layout::insert_section_segment_map): New function.
3705 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3706 output sections marked so.
16164a6b
ST
3707 (Layout::segment_precedes): Check for unique segments when sorting.
3708 * layout.h (Layout::Unique_segment_info): New struct.
3709 (Layout::Section_segment_map): New typedef.
3710 (Layout::insert_section_segment_map): New function.
3711 (Layout::get_output_section_flags): New function.
3712 (Layout::is_unique_segment_for_sections_specified): New function.
3713 (Layout::set_unique_segment_for_sections_specified): New function.
3714 (Layout::unique_segment_for_sections_specified_): New member.
3715 (Layout::section_segment_map_): New member.
3716 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3717 Rename is_gc_pass_one to is_pass_one.
3718 Rename is_gc_pass_two to is_pass_two.
3719 Rename is_gc_or_icf to is_two_pass.
3720 Check for which pass based on whether symbols data is present.
3721 Make it two pass when unique segments for sections is desired.
3722 * output.cc (Output_section::Output_section): Initialize new
3723 members.
3724 * output.h (Output_section::is_unique_segment): New function.
3725 (Output_section::set_is_unique_segment): New function.
3726 (Output_section::is_unique_segment_): New member.
3727 (Output_section::extra_segment_flags): New function.
3728 (Output_section::set_extra_segment_flags): New function.
3729 (Output_section::extra_segment_flags_): New member.
3730 (Output_section::segment_alignment): New function.
3731 (Output_section::set_segment_alignment): New function.
3732 (Output_section::segment_alignment_): New member.
3733 (Output_segment::Output_segment): Initialize is_unique_segment_.
3734 (Output_segment::is_unique_segment): New function.
3735 (Output_segment::set_is_unique_segment): New function.
3736 (Output_segment::is_unique_segment_): New member.
3737 * plugin.cc (allow_unique_segment_for_sections): New function.
3738 (unique_segment_for_sections): New function.
3739 (Plugin::load): Add new functions to transfer vector.
3740 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3741 * Makefile.in: Regenerate.
3742 * testsuite/plugin_final_layout.sh: Check if unique segment
3743 functionality works.
3744 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3745 are available.
3746 (allow_unique_segment_for_sections): New global.
3747 (unique_segment_for_sections): New global.
3748 (claim_file_hook): Call allow_unique_segment_for_sections.
3749 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3750
1e2bee4f
CC
37512012-08-22 Cary Coutant <ccoutant@google.com>
3752
3753 * layout.cc (Layout::include_section): Don't assert on GROUP
3754 sections with --emit-relocs.
3755
1d5dfe78
CC
37562012-08-21 Cary Coutant <ccoutant@google.com>
3757
3758 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3759 if --export-dynamic-symbol names an undef symbol.
3760
c9269dff
AM
37612012-08-18 Alan Modra <amodra@gmail.com>
3762
3763 * powerpc.cc: Formatting and white space.
3764 (Powerpc_relobj): Rename got2_section_ to special_.
3765 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3766 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3767 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3768 (Target_powerpc): Add Address typedef and invalid_address. Use
3769 throughout.
3770 (Target_powerpc::is_branch_reloc): New function.
3771 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3772 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3773 for dst_mask, value and addend.
3774 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3775 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3776 (Output_data_glink::do_write): Correct toc base. Don't try to use
3777 uint16_t for 24-bit offset. Use get_output_section_offset and
3778 check return.
3779 (Target_powerpc::Scan::local): Handle more relocs.
3780 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3781 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3782 Plug in toc restoring insn after plt calls. Translate branches
3783 to function descriptor symbols to corresponding entry point.
3784 (Target_powerpc::relocate_for_relocatable): Check return from
3785 get_output_section_offset.
3786 * symtab.h: Comment typo.
3787
b1759dce
ILT
37882012-08-14 Ian Lance Taylor <iant@google.com>
3789
3790 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3791 unsupported_relocal_local to call unsupported_reloc_global.
3792
b9b2ae8b
NC
37932012-08-14 Nick Clifton <nickc@redhat.com>
3794
3795 PR ld/14265
3796 * script-sections.cc (Sections_element::output_section_name): Add
3797 keep return parameter.
3798 (Output_section_element::match_name): Add keep return parameter.
3799 Return the value of the keep_ member.
3800 * script-sections.h (class Output_section): Update
3801 output_section_name prototype.
3802 * layout.cc (Layout::keep_input_section): New public member
3803 function.
3804 (Layout::choose_output_section): Pass keep parameter to
3805 output_section_name.
3806 * layout.h (class Layout): Add keep_input_section.
3807 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3808 sections.
3809 * testsuite/Makefile.am: Add a test.
3810 * testsuite/Makefile.in: Regenerate.
3811 * testsuite/pr14265.c: Source file for the test.
3812 * testsuite/pr14265.t: Linker script for the test.
3813 * testsuite/pr14265.sh: Shell script for the test.
3814
921b5322
AM
38152012-08-14 Alan Modra <amodra@gmail.com>
3816
3817 * target.h (Target::output_section_name): New function.
3818 (Target::do_output_section_name): New function.
3819 * layout.cc (Layout::choose_output_section): Call the above.
3820 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3821
6ce78956
AM
38222012-08-14 Alan Modra <amodra@gmail.com>
3823
3824 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3825 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3826 for replace_constant call.
3827 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3828 (Output_data_glink::do_print_to_mapfile): New function.
3829 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3830 (Target_powerpc::Relocate::relocate): Likewise.
3831
d1a8cabd
AM
38322012-08-14 Alan Modra <amodra@gmail.com>
3833
3834 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3835 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3836 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3837 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3838 all references to shndx_. Handle special case for R_PPC_PLTREL24
3839 here.
3840 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3841 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3842 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3843 here.
3844 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3845 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3846
d83ce4e3
AM
38472012-08-12 Alan Modra <amodra@gmail.com>
3848
3849 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3850 (glink insn constants): Use uint32_t.
3851 (Output_data_glink::add_entry): Use insert, not [] operator.
3852
cf43a2fe
AM
38532012-08-11 Alan Modra <amodra@gmail.com>
3854
3855 * object.h (Sized_relobj_file::find_shdr): New function.
3856 (Sized_relobj_file::find_special_sections): New function.
3857 * object.cc (Sized_relobj_file::find_shdr): New function.
3858 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3859 (Sized_relobj_file::find_special_sections): New function, split out..
3860 (Sized_relobj_file::do_read_symbols): ..from here.
3861 * output.h (Output_data_got::replace_constant): New function.
3862 (Output_data_got::num_entries): New function.
3863 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3864 (Output_data_got::got_offset): Protected rather than private.
3865 (Output_data_got::replace_got_entry): New function.
3866 * output.cc (Output_data_got::replace_got_entry): New function.
3867 * powerpc.cc (class Powerpc_relobj): New.
3868 (class Powerpc_relocate_functions): Delete all psymval variants or
3869 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3870 Implement _ha functions using corresponding _hi function.
3871 (Powerpc_relobj::find_special_sections): New function.
3872 (Target_powerpc::do_make_elf_object): New function.
3873 (class Output_data_got_powerpc): New.
3874 (class Output_data_glink): New.
3875 (class Powerpc_scan_relocatable_reloc): New.
3876 Many more changes througout file.
3877
3c892704
NC
38782012-08-09 Nick Clifton <nickc@redhat.com>
3879
3880 * po/vi.po: Updated Vietnamese translation.
3881
82435b3b
ILT
38822012-08-07 Ian Lance Taylor <iant@google.com>
3883
3884 * layout.cc (Layout::add_target_dynamic_tags): If
3885 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3886 plt_rel.
3887
a6dc81d2
NC
38882012-07-30 Nick Clifton <nickc@redhat.com>
3889
3890 * po/gold.pot: Updated template.
3891 * po/es.po: Updated Spanish translation.
3892
f1415016
CC
38932012-07-18 Cary Coutant <ccoutant@google.com>
3894
3895 PR gold/14344
3896 * configure.ac: Add check for -gpubnames support.
3897 * configure: Regenerate.
3898 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3899 support; force -gno-pubnames.
3900 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3901 support.
3902 (gdb_index_test_4): New test.
3903 * testsuite/Makefile.in: Regenerate.
3904 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3905 * testsuite/gdb_index_test_2.sh: Likewise.
3906 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3907 * testsuite/gdb_index_test_4.sh: New script.
3908 * testsuite/gdb_index_test_comm.sh: New script with common code;
3909 don't look for space after colon.
3910
b7fd7c37
ST
39112012-07-16 Sriraman Tallam <tmsriram@google.com>
3912
3913 * gold.cc (queue_middle_tasks): Update function order only after
3914 deferred objects due to plugins are processed.
3915
1f3212db
ILT
39162012-07-11 Ian Lance Taylor <iant@google.com>
3917
3918 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3919 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3920 (Target_arm::scan_reloc_for_stub): Likewise.
3921 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3922 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3923 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3924 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3925 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3926
81c82a68
ILT
39272012-07-10 Dodji Seketeli <dodji@redhat.com>
3928 Ian Lance Taylor <iant@google.com>
3929
3930 PR gold/14309
3931 * configure.ac: Test whether std::tr1::hash<off_t> works.
3932 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3933 needed.
3934 * output.h (class Output_fill): Add virtual destructor.
3935 * configure, config.in: Rebuild.
3936
eabc84f4
RM
39372012-06-22 Roland McGrath <mcgrathr@google.com>
3938
3939 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3940
370e30b6
RÁE
39412012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3942
3943 * plugin.cc (Plugin::load): Handle position independent executables.
3944
fb1b895d
CC
39452012-06-06 Cary Coutant <ccoutant@google.com>
3946
3947 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3948 add .debug_macro.
3949 (lines_only_debug_sections): Likewise.
3950 (gdb_fast_lookup_sections): New static array.
3951 (is_gdb_debug_section): Rename formal parameter.
3952 (is_lines_only_debug_section): Likewise.
3953 (is_gdb_fast_lookup_section): New function.
3954 (Layout::include_section): Check for ".zdebug_" prefix; pass
3955 section name suffix to is_gdb_debug_section, et al.; check for
3956 fast-lookup sections when building .gdb_index.
3957 * options.h (--strip-debug-gdb): Update GDB version number.
3958
7c0640fa
CC
39592012-06-06 Cary Coutant <ccoutant@google.com>
3960
3961 * configure.ac: Add check for fallocate.
3962 * configure: Regenerate.
3963 * config.in: Regenerate.
3964
3965 * options.h (class General_options): Add --mmap-output-file and
3966 --posix-fallocate options.
3967 * output.cc: (posix_fallocate): Remove; replace with...
3968 (gold_fallocate): New function.
3969 (Output_file::map_no_anonymous): Call gold_fallocate.
3970 (Output_file::map): Check --mmap-output-file option.
3971
2a49eb69
DK
39722012-06-05 Jing Yu <jingyu@google.com>
3973
3974 * gold.h (textdomain): Add do {} to empty while(0).
3975 (bindtextdomain): Likewise.
3976
fad072ac
CC
39772012-06-04 Cary Coutant <ccoutant@google.com>
3978
3979 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3980 has_dynsym_index.
3981
8cc69fb6
ST
39822012-05-25 Sriraman Tallam <tmsriram@google.com>
3983
3984 * symtab.cc (Symbol_table::define_special_symbol):
3985 Initialize *poldsym to prevent uninitialized variable errors.
3986
1be75daa
CC
39872012-05-23 Cary Coutant <ccoutant@google.com>
3988
3989 * layout.cc (Layout::section_name_mapping): Add rules to handle
3990 exact match on .data.rel.ro.local or .data.rel.ro.
3991 (Layout::output_section_name): Check for exact matches.
3992
9b689de0
CC
39932012-05-23 Cary Coutant <ccoutant@google.com>
3994
3995 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3996 more carefully.
3997
b24fdbf5
CC
39982012-05-22 Cary Coutant <ccoutant@google.com>
3999
4000 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4001 object before exporting symbol.
4002
e550e1a2
L
40032012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4004
4005 * testsuite/tls_test.cc: Include "config.h" first.
4006 * testsuite/tls_test_c.c: Likewise.
4007
df7b86aa
NC
40082012-05-17 Daniel Richard G. <skunk@iskunk.org>
4009 Nick Clifton <nickc@redhat.com>
4010
4011 PR 14072
4012 * configure.in: Add check that sysdep.h has been included before
4013 any system header files.
4014 * configure: Regenerate.
4015 * config.in: Regenerate.
4016
1007b503
CC
40172012-05-14 Cary Coutant <ccoutant@google.com>
4018
4019 * layout.cc (Layout::make_output_section): Mark .tdata section
4020 as RELRO.
4021 * testsuite/relro_test.cc: Add a TLS variable.
4022
fd885f3a
L
40232012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4024
4025 PR gold/14091
4026 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4027 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4028 R_X86_64_64.
4029
80f5885c
CC
40302012-05-08 Cary Coutant <ccoutant@google.com>
4031
4032 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4033 (lines_only_debug_sections): Likewise.
4034
2e702c99
RM
40352012-05-02 Roland McGrath <mcgrathr@google.com>
4036
4037 * nacl.cc: New file.
4038 * nacl.h: New file.
4039 * Makefile.am (CCFILES, HFILES): Add them.
4040 * Makefile.in: Regenerate.
4041 * i386.cc (Output_data_plt_i386_nacl): New class.
4042 (Output_data_plt_i386_nacl_exec): New class.
4043 (Output_data_plt_i386_nacl_dyn): New class.
4044 (Target_i386_nacl): New class.
4045 (Target_selector_i386_nacl): New class.
4046 (target_selector_i386): Use it instead of Target_selector_i386.
4047 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4048 (Target_x86_64_nacl): New class.
4049 (Target_selector_x86_64_nacl): New class.
4050 (target_selector_x86_64, target_selector_x32): Use it instead of
4051 Target_selector_x86_64.
4052 * arm.cc (Output_data_plt_arm_nacl): New class.
4053 (Target_arm_nacl): New class.
4054 (Target_selector_arm_nacl): New class.
4055 (target_selector_arm, target_selector_armbe): Use it instead of
4056 Target_selector_arm.
4057
4058 * target-select.cc (select_target): Take new Input_file* and off_t
4059 arguments, pass them on to recognize method of selector.
4060 * object.cc (make_elf_sized_object): Update caller.
4061 * parameters.cc (parameters_force_valid_target): Likewise.
4062 * incremental.cc (make_sized_incremental_binary): Likewise.
4063 * target-select.h: Update decl.
4064 (Target_selector::recognize): Take new Input_file* argument,
4065 pass it on to do_recognize.
4066 (Target_selector::do_recognize): Take new Input_file* argument.
4067 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4068 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4069 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4070 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4071
4072 * target.h (Target::Target_info): New members isolate_execinstr
4073 and rosegment_gap.
4074 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4075 * arm.cc (Target_arm::arm_info): Update initializer.
4076 * i386.cc (Target_i386::i386_info): Likewise.
4077 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4078 * sparc.cc (Target_sparc::sparc_info): Likewise.
4079 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4080 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4081 * layout.cc (Layout::attach_allocated_section_to_segment):
4082 Take new const Target* argument. If target->isolate_execinstr(), act
4083 like --rosegment.
4084 (Layout::find_first_load_seg): Take new const Target* argument;
4085 if target->isolate_execinstr(), reject PF_X segments.
4086 (Layout::relaxation_loop_body): Update caller.
4087 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4088 reset file offset to zero when we hit LOAD_SEG, and then do a second
4089 loop over the segments before LOAD_SEG to reassign offsets after
4090 addresses have been determined. Handle target->rosegment_gap().
4091 (Layout::attach_section_to_segment): Take new const Target* argument;
4092 pass it to attach_allocated_section_to_segment.
4093 (Layout::make_output_section): Update caller.
4094 (Layout::attach_sections_to_segments): Take new const Target* argument;
4095 pass it to attach_section_to_segment.
4096 * gold.cc (queue_middle_tasks): Update caller.
4097 * layout.h (Layout): Update method decls with new arguments.
4098
4099 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4100 Target_info pointer to use.
4101 (Target_arm::do_make_data_plt): New virtual method.
4102 (Target_arm::make_data_plt): New method that calls it.
4103 (Target_arm::make_plt_entry): Use it.
4104 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4105 for the section alignment.
4106 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4107 method.
4108 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4109 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4110 method.
4111 (Output_data_plt_arm::get_plt_entry_size): Call it.
4112 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4113 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4114 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4115 method.
4116 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4117 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4118 method instead of sizeof(plt_entry).
4119 (Output_data_plt_arm::add_entry): Likewise.
4120 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4121 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4122 than static method.
4123 (Target_arm::plt_entry_size): Likewise.
4124 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4125 Move to ...
4126 (Output_data_plt_arm_standard): ... here, new class.
4127 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4128 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4129 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4130
4131 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4132 Take additional argument for the PLT entry size.
4133 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4134 Use get_plt_entry_size method rather than plt_entry_size variable.
4135 (Output_data_plt_x86_64::reserve_slot): Likewise.
4136 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4137 (Output_data_plt_x86_64::add_entry): Likewise.
4138 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4139 (Output_data_plt_x86_64::address_for_global): Likewise.
4140 (Output_data_plt_x86_64::address_for_local): Likewise.
4141 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4142 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4143 Make method non-static.
4144 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4145 method.
4146 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4147 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4148 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4149 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4150 virtual method.
4151 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4152 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4153 virtual method.
4154 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4155 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4156 virtual method.
4157 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4158 (Output_data_plt_x86_64::plt_entry_size)
4159 (Output_data_plt_x86_64::first_plt_entry)
4160 (Output_data_plt_x86_64::plt_entry)
4161 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4162 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4163 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4164 (Output_data_plt_x86_64_standard): ... here, new class.
4165 (Target_x86_64::Target_x86_64): Take optional argument for the
4166 Target_info pointer to use.
4167 (Target_x86_64::do_make_data_plt): New virtual method.
4168 (Target_x86_64::make_data_plt): New method to call it.
4169 (Target_x86_64::init_got_plt_for_update): Use that.
4170 Call this->plt_->add_eh_frame method here.
4171 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4172 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4173 rather than static method.
4174 (Target_x86_64::plt_entry_size): Likewise.
4175 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4176 rather than plt_entry_size variable. Move guts of PLT filling to...
4177 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4178 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4179 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4180
4181 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4182 additional argument for the section alignment.
4183 Don't do add_eh_frame_for_plt here.
4184 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4185 non-static. Use get_plt_entry_size method rather than plt_entry_size
4186 variable.
4187 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4188 method.
4189 (Output_data_plt_i386::get_plt_entry_size): Call it.
4190 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4191 (Output_data_plt_i386::add_eh_frame): New method to call it.
4192 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4193 method.
4194 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4195 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4196 method.
4197 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4198 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4199 method instead of plt_entry_size.
4200 (Output_data_plt_i386::plt_entry_size)
4201 (Output_data_plt_i386::plt_eh_frame_fde_size)
4202 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4203 (Output_data_plt_i386_standard): ... here, new class.
4204 (Output_data_plt_i386_exec): New class.
4205 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4206 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4207 (Output_data_plt_i386::exec_plt_entry): Move to ...
4208 (Output_data_plt_i386_exec::plt_entry): ... here.
4209 (Output_data_plt_i386_dyn): New class.
4210 (Output_data_plt_i386::first_plt_entry): Move to ...
4211 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4212 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4213 (Output_data_plt_i386_dyn::plt_entry): ... here.
4214 (Target_i386::Target_i386): Take optional argument for the Target_info
4215 pointer to use.
4216 (Target_i386::do_make_data_plt): New virtual method.
4217 (Target_i386::make_data_plt): New method to call it.
4218 (Target_i386::make_plt_section): Use that.
4219 Call this->plt_->add_eh_frame method here.
4220 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4221 rather than plt_entry_size variable.
4222 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4223 (Output_data_plt_i386::address_for_local): Likewise.
4224 (Output_data_plt_i386::do_write): Likewise.
4225 Move guts of PLT filling to...
4226 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4227 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4228 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4229 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4230
b9b9f2ee
CC
42312012-05-01 Cary Coutant <ccoutant@google.com>
4232
4233 * dwarf_reader.cc (Dwarf_die::read_attributes)
4234 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4235 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4236 * reduced_debug_output.cc
4237 (Output_reduced_debug_info_section::get_die_end): Remove
4238 DW_FORM_GNU_ref_index. Add default case.
4239
57923f48
MW
42402012-04-26 Mark Wielaard <mjw@redhat.com>
4241
4242 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4243 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4244 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4245 DW_AT_high_pc as offset from DW_AT_low_pc.
4246
4247 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4248 * testsuite/Makefile.in: Regenerate.
4249 * testsuite/gdb_index_test_3.c: New test source file.
4250 * testsuite/gdb_index_test_3.sh: New test source file.
4251
2c54b4f4
ILT
42522012-04-25 Ian Lance Taylor <iant@google.com>
4253
4254 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4255 pointer.
4256 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4257 as a class, not a struct.
4258 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4259 (Target_arm::apply_cortex_a8_workaround): Likewise.
4260 * gc.h: Declare Reloc_types as a struct, not a class.
4261 * object.h: Declare Symbols_data as a struct.
4262 * reloc.h: Declare Read_relocs_data as a struct.
4263 * target.h: Declare Relocate_info as a struct.
4264
a5a5f7a3
DM
42652012-04-24 David S. Miller <davem@davemloft.net>
4266
4267 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4268 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4269 and R_SPARC_WPLT30.
4270
f038d496
CC
42712012-04-24 Cary Coutant <ccoutant@google.com>
4272
4273 * incremental-dump.cc (find_input_containing_global): Replace
4274 magic number with symbolic constant.
4275 (dump_incremental_inputs): Update version number.
4276 * incremental.cc (Output_section_incremental_inputs): Update version
4277 number; import symbolic constants from Incremental_inputs_reader.
4278 (Incremental_inputs::create_data_sections): Align relocations
4279 section correctly for 64-bit targets.
4280 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4281 constants; add padding.
4282 (Output_section_incremental_inputs::write_header): Add assert for
4283 header_size.
4284 (Output_section_incremental_inputs::write_input_files): Add assert
4285 for input_entry_size.
4286 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4287 add assert for object_info_size, input_section_entry_size,
4288 global_sym_entry_size.
4289 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4290 for data structure sizes; use them.
4291 (Incremental_input_entry_reader): Import symbolic constants from
4292 Incremental_inputs_reader; use them.
4293
a4d85145
DM
42942012-04-23 David S. Miller <davem@davemloft.net>
4295
4296 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4297 and elf_flags_set_.
4298 (Target_sparc::Target_sparc): Initialize new fields.
4299 (Target_sparc::do_make_elf_object): New function.
4300 (Target_sparc::do_adjust_elf_header): New function.
4301
1d509098
CC
43022012-04-23 Cary Coutant <ccoutant@google.com>
4303
4304 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4305 CU range table of gdb index.
4306
7ebeff7f
DM
43072012-04-20 David S. Miller <davem@davemloft.net>
4308
4309 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4310 instead of false.
4311
13cf9988
DM
43122012-04-16 David S. Miller <davem@davemloft.net>
4313
2a1079e8
DM
4314 * sparc.cc (Target_sparc::got_address): New function.
4315 (Sparc_relocate_functions::gdop_hix22): New function.
4316 (Sparc_relocate_functions::gdop_lox10): New function.
4317 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4318 relocs.
4319 (Target_sparc::Scan::local): Likewise if the global symbol is not
4320 preemptible and is not IFUNC.
4321 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4322 transformations for local and non-preemptible non-IFUNC global
4323 symbols.
4324
0bc964fc
DM
4325 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4326 writing out 64-bit part of ranges.
4327
661d7a80
DM
4328 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4329 -fpic and -fpie respectively.
4330 * Makefile.in: Regenerate.
4331
8c2bf391
DM
4332 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4333 (Target_sparc::Target_sparc): Initialize new field.
4334 (Target_sparc::do_plt_section_for_global): New function.
4335 (Target_sparc::do_plt_section_for_local): New function.
4336 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4337 (Target_sparc::make_plt_section): New function, broken out of
4338 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4339 (Target_sparc::make_plt_entry): Call make_plt_section.
4340 (Target_sparc::make_local_ifunc_plt_entry): New function.
4341 (Target_sparc::rela_ifunc_section): New function.
4342 (Target_sparc::plt_section): Remove const.
4343 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4344 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4345 and ifunc_count_ fields.
4346 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4347 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4348 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4349 (Output_data_plt_sparc::rela_ifunc): New function.
4350 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4351 (Output_data_plt_sparc::has_ifunc_section): New function.
4352 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4353 (Output_data_plt_sparc::address_for_global): New function.
4354 (Output_data_plt_sparc::address_for_local): New function.
4355 (Output_data_plt_sparc::plt_index_to_offset): New function.
4356 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4357 and entry_count.
4358 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4359 entry_count.
4360 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4361 R_SPARC_JMP_IREL to switch.
4362 (Target_sparc::Scan::check_non_pic): Likewise.
4363 (Target_sparc::Scan::local): Handle IFUNC symbols.
4364 (Target_sparc::Scan::local): Likewise.
4365 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4366 and plt_address_for_local.
4367 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4368 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4369
13cf9988
DM
4370 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4371 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4372 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4373 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4374 global relocs too.
4375 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4376 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4377 calls.
4378 * sparc.cc (Target_sparc::Scan::global): Likewise.
4379 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4380
31821be0
CC
43812012-04-16 Cary Coutant <ccoutant@google.com>
4382
4383 * archive.cc (Library_base::should_include_member): Check for
4384 --export-dynamic-symbol.
4385 * options.h (class General_options): Add --export-dynamic-symbol.
4386 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4387 --export-dynamic-symbol.
4388 (Symbol_table::gc_mark_undef_symbols): Likewise.
4389 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4390
2615994e
DM
43912012-04-12 David S. Miller <davem@davemloft.net>
4392
4393 * sparc.cc (Reloc::wdisp10): New relocation method.
4394 (Reloc::h34): Likewise.
4395 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4396 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4397 R_SPARC_WDISP10.
4398 (Target_sparc::Scan::local): Likewise.
4399 (Target_sparc::Scan::global): Likewise.
4400 (Target_sparc::Relocate::relocate): Likewise.
4401
6782735d
CC
44022012-04-09 Cary Coutant <ccoutant@google.com>
4403
4404 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4405 low_pc == 0.
4406
8c7a0b00
ILT
44072012-04-06 Ian Lance Taylor <iant@google.com>
4408
4409 * timer.cc: #include <unistd.h>.
4410
58797674
RM
44112012-04-06 Roland McGrath <mcgrathr@google.com>
4412
4413 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4414 * config.in: Regenerate.
4415 * configure: Regenerate.
4416
44350750
NC
44172012-04-05 Nick Clifton <nickc@redhat.com>
4418
4419 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4420 (AM_LC_MESSAGES): Add.
4421 * aclocal.m4: Regenerate.
4422 * config.in: Regenerate.
4423 * configure: Regenerate.
4424
c1027032
CC
44252012-03-21 Cary Coutant <ccoutant@google.com>
4426
4427 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4428 * Makefile.in: Regenerate.
4429 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4430 (Sized_elf_reloc_mapper::symbol_section): New function.
4431 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4432 (make_elf_reloc_mapper): New function.
4433 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4434 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4435 (Dwarf_abbrev_table::do_get_abbrev): New function.
4436 (Dwarf_ranges_table::read_ranges_table): New function.
4437 (Dwarf_ranges_table::read_range_list): New function.
4438 (Dwarf_pubnames_table::read_section): New function.
4439 (Dwarf_pubnames_table::read_header): New function.
4440 (Dwarf_pubnames_table::next_name): New function.
4441 (Dwarf_die::Dwarf_die): New function.
4442 (Dwarf_die::read_attributes): New function.
4443 (Dwarf_die::skip_attributes): New function.
4444 (Dwarf_die::set_name): New function.
4445 (Dwarf_die::set_linkage_name): New function.
4446 (Dwarf_die::attribute): New function.
4447 (Dwarf_die::string_attribute): New function.
4448 (Dwarf_die::int_attribute): New function.
4449 (Dwarf_die::uint_attribute): New function.
4450 (Dwarf_die::ref_attribute): New function.
4451 (Dwarf_die::child_offset): New function.
4452 (Dwarf_die::sibling_offset): New function.
4453 (Dwarf_info_reader::check_buffer): New function.
4454 (Dwarf_info_reader::parse): New function.
4455 (Dwarf_info_reader::do_parse): New function.
4456 (Dwarf_info_reader::do_read_string_table): New function.
4457 (Dwarf_info_reader::lookup_reloc): New function.
4458 (Dwarf_info_reader::get_string): New function.
4459 (Dwarf_info_reader::visit_compilation_unit): New function.
4460 (Dwarf_info_reader::visit_type_unit): New function.
4461 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4462 Sized_elf_reloc_mapper.
4463 (Sized_dwarf_line_info::symbol_section): Remove function.
4464 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4465 (Sized_dwarf_line_info::read_line_mappings): Remove object
4466 parameter, adjust callers.
4467 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4468 * dwarf_reader.h: Include <sys/types.h>.
4469 (class Track_relocs): Remove forward declaration.
4470 (class Elf_reloc_mapper): New class.
4471 (class Sized_elf_reloc_mapper): New class.
4472 (class Dwarf_abbrev_table): New class.
4473 (class Dwarf_range_list): New class.
4474 (class Dwarf_ranges_table): New class.
4475 (class Dwarf_pubnames_table): New class.
4476 (class Dwarf_die): New class.
4477 (class Dwarf_info_reader): New class.
4478 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4479 (Sized_dwarf_line_info::symbol_section): Remove member function.
4480 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4481 base class.
4482 * gdb-index.cc: New source file.
4483 * gdb-index.h: New source file.
4484 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4485 and .debug_types sections, call Layout::add_to_gdb_index.
4486 (Sized_relobj_incr::do_section_name): Implement.
4487 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4488 return type; Implement.
4489 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4490 return type.
4491 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4492 parameter list and return type.
4493 (Sized_incr_dynobj::do_section_contents): Likewise.
4494 * layout.cc: Include gdb-index.h.
4495 (Layout::Layout): Initialize gdb_index_data_.
4496 (Layout::init_fixed_output_section): Check for .gdb_index section.
4497 (Layout::add_to_gdb_index): New function. Instantiate.
4498 * layout.h: Add forward declaration for class Gdb_index.
4499 (Layout::add_to_gdb_index): New member function.
4500 (Layout::gdb_index_data_): New data member.
4501 * main.cc: Include gdb-index.h.
4502 (main): Print statistics for gdb index.
4503 * object.cc (Object::section_contents): Move code into
4504 do_section_contents.
4505 (need_decompressed_section): Check for sections needed when building
4506 gdb index.
4507 (build_compressed_section_map): Likewise.
4508 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4509 gdb index.
4510 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4511 sections; call Layout::add_to_gdb_index.
4512 (Sized_relobj_file::do_decompressed_section_contents): Call
4513 do_section_contents directly.
4514 * object.h (Object::do_section_contents): Adjust parameter list and
4515 return type.
4516 (Object::do_decompressed_section_contents): Call do_section_contents
4517 directly.
4518 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4519 return type.
4520 * options.h (class General_options): Add --gdb-index option.
4521 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4522 list and return type.
4523 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4524 * reloc.h (Track_relocs::checkpoint): New function.
4525 (Track_relocs::reset): New function.
4526
4527 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4528 New test cases.
4529 * testsuite/Makefile.in: Regenerate.
4530 * testsuite/gdb_index_test.cc: New test source file.
4531 * testsuite/gdb_index_test_1.sh: New test source file.
4532 * testsuite/gdb_index_test_2.sh: New test source file.
4533
647f1574
DK
45342012-03-19 Doug Kwan <dougkwan@google.com>
4535
4536 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4537 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4538 __exidx_start and __exidx_end. Make symbol table parameter
4539 anonymous as it is not used.
4540 * gold.cc (queue_middle_tasks): Call target hook to define any
4541 target-specific symbols.
4542 * target.h (Target::define_standard_symbols): New method.
4543 (Target::do_define_standard_symbols): Same.
4544 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4545 * testsuite/Makefile.in: Regenerate.
4546 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4547 and __exidx_end.
4548 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4549 relocations are generated for __exidx_start and __exidx_end.
4550
7c6109da
DK
45512012-03-16 Doug Kwan <dougkwan@google.com>
4552
4553 * testsuite/Makefile.am: Disable test initpri3b.
4554 * testsuite/Makefile.in: Regenerate.
4555
7b8957f8
DK
45562012-03-15 Doug Kwan <dougkwan@google.com>
4557
4558 * arm.cc (Target_arm::got_section): Make .got section read-only
4559 if -z now is given.
4560
14dc9ef7
ILT
45612012-03-15 Ian Lance Taylor <iant@google.com>
4562
4563 PR gold/13850
4564 * layout.cc (Layout::make_output_section): Correctly mark
4565 SHT_INIT_ARRAY, et. al., as relro.
4566
fa40b62a
DK
45672012-03-14 Doug Kwan <dougkwan@google.com>
4568
4569 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4570 dynamic relocations for protected symbols in shared objects.
4571
fd325007
ILT
45722012-03-13 Ian Lance Taylor <iant@google.com>
4573
4574 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4575 keep the larger alignment.
4576
e8dd54e1
CC
45772012-03-12 Cary Coutant <ccoutant@google.com>
4578
4579 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4580 handling of DW_LNE_define_file.
4581
feb5f3b0
CC
45822012-03-12 Cary Coutant <ccoutant@google.com>
4583
4584 * reduced_debug_output.cc
4585 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4586 codes to switch.
4587
a1fb4256
CC
45882012-02-29 Cary Coutant <ccoutant@google.com>
4589
4590 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4591
5dd8762a
CC
45922012-02-29 Cary Coutant <ccoutant@google.com>
4593
4594 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4595 Call Object::decompressed_section_contents.
4596 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4597 New dtor.
4598 (Sized_dwarf_line_info::buffer_start_): New data member.
4599 * merge.cc (Output_merge_data::do_add_input_section): Call
4600 Object::decompressed_section_contents.
4601 (Output_merge_string::do_add_input_section): Likewise.
4602 * object.cc (need_decompressed_section): New function.
4603 (build_compressed_section_map): Decompress sections needed later.
4604 (Sized_relobj_file::do_decompressed_section_contents): New function.
4605 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4606 * object.h (Object::decompressed_section_contents): New function.
4607 (Object::discard_decompressed_sections): New function.
4608 (Object::do_decompressed_section_contents): New function.
4609 (Object::do_discard_decompressed_sections): New function.
4610 (Compressed_section_info): New type.
4611 (Compressed_section_map): Include decompressed section contents.
4612 (Sized_relobj_file::do_decompressed_section_contents): New function.
4613 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4614
7b5de7ee
CC
46152012-02-16 Cary Coutant <ccoutant@google.com>
4616
4617 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4618 * testsuite/Makefile.in: Regenerate.
4619
f9fa4a63
CC
46202012-02-14 Cary Coutant <ccoutant@google.com>
4621
4622 * options.cc (General_options::finalize): Disallow -pie and -static.
4623
2c175ebc
DK
46242012-02-03 Doug Kwan <dougkwan@google.com>
4625
4626 * arm.cc (Arm_relocate_functions::abs8,
4627 Arm_relocate_functions::abs16): Use
4628 Bits::has_signed_unsigned_overflow32.
4629 (Arm_relocate_functions::thm_abs8): Correct range of
4630 overflow check.
4631 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4632 in assertions.
4633
90cff06f
DK
46342012-02-02 Doug Kwan <dougkwan@google.com>
4635
4636 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4637 position independent outputs, not just shared objects.
4638
63887f3d
L
46392012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4640
4641 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4642 * configure: Regenerated.
4643
bef2b434
ILT
46442012-01-27 Ian Lance Taylor <iant@google.com>
4645
4646 * reloc.h (Bits): New class with static functions, copied from
4647 namespace utils in arm.cc.
4648 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4649 instead.
4650
c335b55d
L
46512012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4652
4653 * incremental.cc (write_info_blocks): Correct relocation offset.
4654
41194d9f
L
46552012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4656
4657 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4658 (Relocate::tls_gd_to_le): Likewise.
4659
1bae613c
L
46602012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4661
4662 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4663
24482ca0
L
46642012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4665
4666 * configure.ac: Check if -mcmodel=medium works.
4667 * configure: Regenerated.
4668
c2c7840a
CC
46692012-01-24 Cary Coutant <ccoutant@google.com>
4670
4671 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4672 definition and ...
4673 (read_unsigned_LEB_128_x): ... this new function.
4674 (read_signed_LEB_128): Replaced with inline definition and ...
4675 (read_signed_LEB_128_x): ... this new function.
4676 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4677 (read_unsigned_LEB_128): Add inline definition.
4678 (read_signed_LEB_128_x): New function.
4679 (read_signed_LEB_128): Add inline definition.
4680 * testsuite/Makefile.am (leb128_unittest): New unit test.
4681 * testsuite/Makefile.in: Regenerate.
4682 * testsuite/leb128_unittest.cc: New unit test.
4683
833de760 46842012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4685
4686 PR gold/13617
4687 * i386.cc (Target_i386::do_code_fill): When using a jmp
4688 instruction, pad with nop instructions.
4689 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4690
618d6666
L
46912012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4692
4693 * x86_64.cc (gc_process_relocs): Add typename on types used in
4694 template.
4695 (scan_relocs): Likewise.
4696 (relocate_section): Likewise.
4697 (apply_relocation): Likewise.
4698
3660ff06
L
46992012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4700
4701 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4702 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4703 under x32.
4704
fc51264f
L
47052012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4706
4707 * x86_64.cc: Initial support for x32.
4708
dd74ae06
CC
47092012-01-03 Cary Coutant <ccoutant@google.com>
4710
4711 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4712 Use abstract base class for GOT.
4713 * gold/output.h (class Output_data_got_base): New abstract base class.
4714 (class Output_data_got): Derive from new base class, adjust ctors.
4715 (Output_data_got::reserve_slot): Make virtual; rename to
4716 do_reserve_slot; Adjust callers.
4717 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4718 pointer to abstract base class.
4719 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4720
83896202
ILT
47212011-12-18 Ian Lance Taylor <iant@google.com>
4722
4723 * object.h (Relobj::local_symbol_value): New function.
4724 (Relobj::local_plt_offset): New function.
4725 (Relobj::local_has_got_offset): New function.
4726 (Relobj::local_got_offset): New function.
4727 (Relobj::set_local_got_offset): New function.
4728 (Relobj::do_local_symbol_value): New pure virtual function.
4729 (Relobj::do_local_plt_offset): Likewise.
4730 (Relobj::do_local_has_got_offset): Likewise.
4731 (Relobj::do_local_got_offset): Likewise.
4732 (Relobj::do_set_local_got_offset): Likewise.
4733 (Sized_relobj::do_local_has_got_offset): Rename from
4734 local_has_got_offset.
4735 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4736 (Sized_relobj::do_set_local_got_offset): Rename from
4737 set_local_got_offset.
4738 (Sized_relobj_file::do_local_plt_offset): Rename from
4739 local_plt_offset.
4740 (Sized_relobj_file::do_local_symbol_value): New function.
4741 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4742 local_plt_offset.
4743 * output.cc (Output_data_got::Got_entry::write): Change object to
4744 Relobj. Use local_symbol_value.
4745 (Output_data_got::add_global_with_rel): Change rel_dyn to
4746 Output_data_reloc_generic*. Use add_global_generic.
4747 (Output_data_got::add_global_with_rela): Remove. Change all
4748 callers to use add_global_with_rel.
4749 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4750 Output_data_reloc_generic*. Use add_global_generic.
4751 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4752 callers to use add_global_pair_with_rel.
4753 (Output_data_got::add_local): Change object to Relobj*.
4754 (Output_data_got::add_local_plt): Likewise.
4755 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4756 change rel_dyn to Output_data_reloc_generic*. Use
4757 add_local_generic.
4758 (Output_data_got::add_local_with_rela): Remove. Change all
4759 callers to use all_local_with_rel.
4760 (Output_data_got::add_local_pair_with_rel): Change object to
4761 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4762 add_output_section_generic.
4763 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4764 callers to use add_local_pair_with_rel.
4765 (Output_data_got::reserve_local): Change object to Relobj*.
4766 * output.h: (class Output_data_reloc_generic): Add pure virtual
4767 declarations for add_global_generic, add_local_generic,
4768 add_output_section_generic.
4769 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4770 functions for Output_data_reloc_generic. Update declarations for
4771 changes listed in output.cc.
4772 (class Output_data_got): Change template parameter to got_size.
4773 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4774 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4775 function.
4776 (Sized_relobj_incr::do_local_plt_offset): New function.
4777 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4778 add_global_generic.
4779
76677ad0
CC
47802011-12-17 Cary Coutant <ccoutant@google.com>
4781
4782 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4783 * resolve.cc (Symbol_table::resolve): Likewise.
4784 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4785 arrays.
4786 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4787
8b8dd8d5
ILT
47882011-12-16 Ian Lance Taylor <iant@google.com>
4789
4790 * output.h (Output_data_reloc_generic::add): Only call
4791 add_dynamic_reloc if this is a dynamic reloc section.
4792
d55525b9
L
47932011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4794
4795 PR gold/13505
4796 * target-reloc.h (apply_relocation): Replace <64, false> with
4797 <size, big_endian>.
4798
ff81c7c1
NC
47992011-11-25 Nick Clifton <nickc@redhat.com>
4800
4801 * po/it.po: New Italian translation.
4802
628f39be
SA
48032011-11-17 Sterling Augustine <saugustine@google.com>
4804
4805 * script.cc (script_include_directive): Implement.
4806 (read_script_file): New local variables name and search_path. Update
4807 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4808 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4809 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4810
98ef3ea4
SA
48112011-11-11 Sterling Augustine <saugustine@google.com>
4812
4813 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4814 (file_or_sections_cmd): Likewise.
4815
f4a8b6d7
DK
48162011-11-11 Doug Kwan <dougkwan@google.com>
4817
4818 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4819 if --just-symbols is given.
4820
29ab395d
DK
48212011-11-10 Doug Kwan <dougkwan@google.com>
4822
4823 PR gold/13362
4824 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4825 when processing data relocs.
4826 * reloc.h (Relocate_functions::rel_unaligned): New method.
4827 (Relocate_functions::pcrel_unaligned): Ditto.
4828 (Relocate_functions::rel32_unaligned): Ditto.
4829 (Relocate_functions::pcrel32_unaligned): Ditto.
4830
2c339f71
DK
48312011-11-09 Doug Kwan <dougkwan@google.com>
4832
4833 PR gold/13362
4834 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4835 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4836 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4837 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4838 (Relocate_functions::rel_unaligned): New.
4839 (Relocate_functions::rel32_unaligned): New.
4840 * target-reloc.h (relocate_for_relocatable): Add code to handle
4841 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4842 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4843 arm_unaligned_reloc_r): New targets.
4844 * testsuite/Makefile.in: Regenerate.
4845 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4846 linking.
4847
3f3cddf1
ILT
48482011-11-02 Ian Lance Taylor <iant@google.com>
4849
4850 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4851 NATIVE_LINKER.
4852 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4853 * options.cc (General_options::finalize): Use library search path
4854 from configure script if specified. If not native and no sysroot,
4855 only search TOOLLIBDIR.
4856 * options.h (Search_directory::Search_directory): Change name to
4857 const std::string&.
4858 (General_options::add_to_library_path_with_sysroot): Change arg to
4859 const std::string&.
4860 * configure, Makefile.in, config.in: Rebuild.
4861
a8e2273b
ILT
48622011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4863
4864 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4865 we are working around the ARM1176 Erratum.
4866 * options.h (General_options::fix_arm1176): Add option.
4867 * testsuite/Makefile.am: Add testcases, and keep current ones
4868 working.
4869 * testsuite/Makefile.in: Regenerate.
4870 * testsuite/arm_fix_1176.s: New file.
4871 * testsuite/arm_fix_1176.sh: Likewise.
4872
cd6eab1c
ILT
48732011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4874
4875 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4876 may_use_blx_.
4877 (Target_arm::may_use_blx): Remove method.
4878 (Target_arm::set_may_use_blx): Likewise.
4879 (Target_arm::may_use_v4t_interworking): New method.
4880 (Target_arm::may_use_v5t_interworking): Likewise.
4881 (Target_arm::may_use_blx_): Remove member variable.
4882 (Arm_relocate_functions::arm_branch_common): Check for v5T
4883 interworking.
4884 (Arm_relocate_functions::thumb_branch_common): Likewise.
4885 (Reloc_stub::stub_type_for_reloc): Likewise.
4886 (Target_arm::do_finalize_sections): Correct interworking checks.
4887 * testsuite/Makefile.am: Add new tests.
4888 * testsuite/Makefile.in: Regenerate.
4889 * testsuite/arm_farcall_arm_arm.s: New test.
4890 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4891 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4892 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4893 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4894 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4895 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4896 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4897
286adcf4
CC
48982011-10-31 Cary Coutant <ccoutant@google.com>
4899
4900 PR gold/13023
4901 * expression.cc (Expression::eval_with_dot): Add
4902 is_section_dot_assignment parameter.
4903 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4904 absolute and assigning to dot within a section.
4905 * script-sections.cc
4906 (Output_section_element_assignment::set_section_addresses): Pass
4907 dot_section to set_if_absolute.
4908 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4909 as is_section_dot_assignment flag to eval_with_dot.
4910 (Output_section_element_dot_assignment::set_section_addresses):
4911 Likewise.
4912 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4913 parameter. Also set value if relative to dot_section; set the
4914 symbol's output_section.
4915 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4916 parameter. Adjust all callers.
4917 (Expression::eval_maybe_dot): Likewise.
4918 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4919 Adjust all callers.
4920 * testsuite/script_test_2.t: Test assignment of an absolute value
4921 to dot within an output section element.
4922
9634ed06
CC
49232011-10-31 Cary Coutant <ccoutant@google.com>
4924
4925 * options.h (class General_options): Add --[no-]gnu-unique options.
4926 * symtab.cc (Symbol_table::sized_write_globals): Convert
4927 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4928
de4101c7
CC
49292011-10-31 Cary Coutant <ccoutant@google.com>
4930
4931 PR gold/13359
4932 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4933 unnecessary assertion.
4934 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4935
7257cc92
ST
49362011-10-31 Sriraman Tallam <tmsriram@google.com>
4937
4938 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4939 gc_mark_symbol.
4940 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4941 gc_mark_symbol.
4942 Change to just keep the section associated with symbol.
4943 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4944 they are externally visible and --export-dynamic is turned on.
4945 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4946
bfc34b3f
ILT
49472011-10-19 Ian Lance Taylor <iant@google.com>
4948
4949 PR gold/13163
4950 * script-sections.cc
4951 (Output_section_element_dot_assignment::needs_output_section): New
4952 function.
4953
ea0d8c47
ILT
49542011-10-19 Ian Lance Taylor <iant@google.com>
4955
4956 PR gold/13204
4957 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4958 --section-start option was seen.
4959 * options.h (General_options::any_section_start): New function.
4960
abd242a9
DM
49612011-10-18 David S. Miller <davem@davemloft.net>
4962
4963 PR binutils/13301
4964 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4965 member to track relocation locations that have moved during TLS
4966 reloc optimizations.
4967 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4968 (Target_sparc::Relocate::relocate): Adjust view down by 4
4969 bytes if it matches reloc_adjust_addr_.
4970 (Target_sparc::Relocate::relocate_tls): Always move the
4971 __tls_get_addr call delay slot instruction forward 4 bytes when
4972 performing relaxation.
4973
bab9090f
CC
49742011-10-18 Cary Coutant <ccoutant@google.com>
4975
4976 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4977 (Output_file::map_no_anonymous): Check for non-zero
4978 return code from posix_fallocate.
4979
f7c5b166
CC
49802011-10-17 Cary Coutant <ccoutant@google.com>
4981
4982 PR gold/13245
4983 * plugin.cc (is_visible_from_outside): Check for symbols
4984 referenced from dynamic objects.
4985 * resolve.cc (Symbol_table::resolve): Don't count references
4986 from dynamic objects as references from real ELF files.
4987 * testsuite/plugin_test_2.sh: Adjust expected result.
4988
b490c0bb
CC
49892011-10-17 Cary Coutant <ccoutant@google.com>
4990
4991 * gold.cc: Include timer.h.
4992 (queue_middle_tasks): Stamp time.
4993 (queue_final_tasks): Likewise.
4994 * main.cc (main): Store timer in parameters. Print timers
4995 for each pass.
4996 * parameters.cc (Parameters::Parameters): Initialize timer_.
4997 (Parameters::set_timer): New function.
4998 (set_parameters_timer): New function.
4999 * parameters.h (Parameters::set_timer): New function.
5000 (Parameters::timer): New function.
5001 (Parameters::timer_): New data member.
5002 (set_parameters_timer): New function.
5003 * timer.cc (Timer::stamp): New function.
5004 (Timer::get_pass_time): New function.
5005 * timer.h (Timer::stamp): New function.
5006 (Timer::get_pass_time): New function.
5007 (Timer::pass_times_): New data member.
5008
f475cf7b
CC
50092011-10-17 Cary Coutant <ccoutant@google.com>
5010
5011 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5012 task for members of lib groups.
5013
cdd7e244
CC
50142011-10-17 Cary Coutant <ccoutant@google.com>
5015
5016 PR gold/13288
4f95c8b4 5017 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5018 (File_read::make_view): Move bounds check (replace with assert)...
5019 (File_read::find_or_make_view): ... to here.
5020
dfb45471
CC
50212011-10-12 Cary Coutant <ccoutant@google.com>
5022
4f95c8b4 5023 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5024 ::read returns less than requested size.
5025
53bbcc1b
CC
50262011-10-10 Cary Coutant <ccoutant@google.com>
5027
4f95c8b4 5028 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5029 Initialize defined_count_.
5030 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5031 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5032 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5033 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5034 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5035 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5036 member.
5037 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5038 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5039 Return zeroes instead of internal error.
5040
397b129b
CC
50412011-10-10 Cary Coutant <ccoutant@google.com>
5042
5043 PR gold/13249
4f95c8b4 5044 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5045 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5046 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5047 (Output_reloc::type_): Adjust size of bit field.
5048 (Output_reloc::use_plt_offset_): New bit field.
5049 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5050 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5051 flag. Adjust all callers.
4f95c8b4 5052 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5053 creating RELATIVE relocations.
5054
d5698657
NC
50552011-10-10 Nick Clifton <nickc@redhat.com>
5056
5057 * po/es.po: Updated Spanish translation.
5058 * po/fi.po: Updated Finnish translation.
5059
6a59a5c2
DN
50602011-10-03 Diego Novillo <dnovillo@google.com>
5061
5062 * options.cc (parse_uint): Fix dereference of RETVAL.
5063
f0558624
ST
50642011-09-29 Sriraman Tallam <tmsriram@google.com>
5065
5066 * layout.h (section_order_map_): New member.
5067 (get_section_order_map): New member function.
5068 * output.cc (Output_section::add_input_section): Check for patterns
5069 only when --section-ordering-file is specified.
5070 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5071 output_sections have been formed.
5072 * layout.cc (Layout_Layout): Initialize section_order_map_.
5073 * plugin.cc (update_section_order): Store order in order_map. Do not
5074 update the order.
5075 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5076 * testsuite/Makefile.in: Regenerate.
5077 * testsuite/plugin_section_order.c: New file.
5078 * testsuite/plugin_final_layout.cc: New file.
5079 * testsuite/plugin_final_layout.sh: New file.
5080
a7dac153
CC
50812011-09-29 Cary Coutant <ccoutant@google.com>
5082
4f95c8b4 5083 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5084 Check for NULL.
4f95c8b4 5085 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5086 symbols during incremental update.
5087 (Symbol_table::add_from_dynobj): Likewise.
5088
eebd87a5
ILT
50892011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5090 Ian Lance Taylor <iant@google.com>
5091
5092 * symtab.cc (Symbol_table::define_special_symbol): Always
5093 canonicalize version string.
5094
403a3331
CC
50952011-09-26 Cary Coutant <ccoutant@google.com>
5096
4f95c8b4
CC
5097 * gold.cc (queue_initial_tasks): Move option checks ...
5098 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5099 some options; make others fatal.
5100
235061c2
CC
51012011-09-26 Cary Coutant <ccoutant@google.com>
5102
5103 gcc PR lto/47247
5104 * plugin.cc (get_symbols_v2): New function.
5105 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5106 (is_referenced_from_outside): New function.
5107 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5108 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5109 (get_symbols): Pass version parameter.
5110 (get_symbols_v2): New function.
5111 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5112 parameter.
5113 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5114 (onload): Add LDPT_GET_SYMBOLS_V2.
5115 (all_symbols_read_hook): Use get_symbols_v2; check for
5116 LDPR_PREVAILING_DEF_IRONLY_EXP.
5117 * testsuite/plugin_test_3.sh: Update expected results.
5118
dc87f620
ILT
51192011-09-23 Simon Baldwin <simonb@google.com>
5120
5121 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5122 configuration options.
5123 * configure: Regenerate.
5124 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5125 * Makefile.in: Regenerate.
5126 * testsuite/Makefile.in: Regenerate.
5127
a8279f82
ST
51282011-09-19 Sriraman Tallam <tmsriram@google.com>
5129
5130 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5131
0c9350c8
CC
51322011-09-19 Cary Coutant <ccoutant@google.com>
5133
5134 * incremental.cc (can_incremental_update): Fix typo in comment.
5135 * incremental.h (can_incremental_update): Likewise.
5136
aa06ae28
CC
51372011-09-18 Cary Coutant <ccoutant@google.com>
5138
5139 * incremental.cc (can_incremental_update): New function.
5140 * incremental.h (can_incremental_update): New function.
5141 * layout.cc (Layout::init_fixed_output_section): Call it.
5142 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5143 * object.cc (Sized_relobj_file::do_layout): Call
5144 can_incremental_update.
5145
ebb300b2
CC
51462011-09-13 Cary Coutant <ccoutant@google.com>
5147
5148 * configure.ac: Check for glibc support for gnu_indirect_function
5149 support with static linking, setting automake conditional
5150 IFUNC_STATIC.
5151 * Makefile.in: Regenerate.
5152 * configure: Regenerate.
5153
5154 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5155 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5156 for IFUNC_STATIC.
5157 * testsuite/Makefile.in: Regenerate.
5158
1206d0d5
CC
51592011-09-13 Cary Coutant <ccoutant@google.com>
5160
5161 * incremental.cc (Sized_relobj_incr::do_layout): Call
5162 report_comdat_group for kept comdat sections.
5163 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5164 * testsuite/Makefile.in: Regenerate.
5165 * testsuite/incr_comdat_test_1.cc: New source file.
5166 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5167 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5168 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5169
40b29874
ILT
51702011-09-13 Ian Lance Taylor <iant@google.com>
5171
5172 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5173 variable external_symbols_offset.
5174
1b045aac
ILT
51752011-09-12 Ian Lance Taylor <iant@google.com>
5176
5177 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5178 triggered if object has no symbols.
5179
24c6c55a
DM
51802011-09-09 David S. Miller <davem@davemloft.net>
5181
5182 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5183 (Output_fill_debug_line::do_write): Likewise.
5184
66570254
CC
51852011-08-29 Cary Coutant <ccoutant@google.com>
5186
5187 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5188 casts to match formatting specs.
5189 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5190
8ea8cd50
CC
51912011-08-26 Cary Coutant <ccoutant@google.com>
5192
5193 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5194 remaining hole size when allocating.
5195 (Layout::make_output_section): Set fill methods for debug sections.
5196 * layout.h (Free_list::Free_list_node): Move from private to
5197 public.
5198 (Free_list::set_min_hole_size): New function.
5199 (Free_list::begin, Free_list::end): New functions.
5200 (Free_list::min_hole_): New data member.
5201 * output.cc: Include dwarf.h.
5202 (Output_fill_debug_info::do_minimum_hole_size): New function.
5203 (Output_fill_debug_info::do_write): New function.
5204 (Output_fill_debug_line::do_minimum_hole_size): New function.
5205 (Output_fill_debug_line::do_write): New function.
5206 (Output_section::Output_section): Initialize new data member.
5207 (Output_section::set_final_data_size): Ensure patch space is larger
5208 than minimum hole size.
5209 (Output_section::do_write): Fill holes in debug sections.
5210 * output.h (Output_fill): New class.
5211 (Output_fill_debug_info): New class.
5212 (Output_fill_debug_line): New class.
5213 (Output_section::set_free_space_fill): New function.
5214 (Output_section::free_space_fill_): New data member.
5215 * testsuite/Makefile.am (incremental_test_3): Add
5216 --incremental-patch option.
5217 (incremental_test_4): Likewise.
5218 (incremental_test_5): Likewise.
5219 (incremental_test_6): Likewise.
5220 (incremental_copy_test): Likewise.
5221 (incremental_common_test_1): Likewise.
5222 * testsuite/Makefile.in: Regenerate.
5223
7cf80422
NC
52242011-08-26 Nick Clifton <nickc@redhat.com>
5225
5226 * po/es.po: Updated Spanish translation.
5227
c3f7b0e5
CC
52282011-08-01 Cary Coutant <ccoutant@google.com>
5229
5230 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5231 * gold/testsuite/Makefile.in: Regenerate.
5232 * gold/testsuite/justsyms_exec.c: New source file.
5233 * gold/testsuite/justsyms_lib.c: New source file.
5234
9590bf25
CC
52352011-08-01 Cary Coutant <ccoutant@google.com>
5236
5237 * layout.cc (Layout::set_segment_offsets): Don't realign text
5238 segment if -Ttext was specified.
5239 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5240 file type.
5241 * object.h (Sized_relobj_file::e_type): New function.
5242 (Sized_relobj_file::e_type_): New data member.
5243 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5244 base address for ET_EXEC files.
5245 * target.cc (Target::do_make_elf_object_implementation): Allow
5246 ET_EXEC files with --just-symbols option.
5247
dcd8d12e
CC
52482011-07-28 Cary Coutant <ccoutant@google.com>
5249
5250 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5251 Add thread_number parameter.
5252 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5253 * workqueue-threads.cc
5254 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5255 current thread if its thread number is greater than desired thread
5256 count.
5257 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5258 Add thread_number parameter.
5259 (Workqueue::should_cancel_thread): Likewise.
5260 (Workqueue::find_runnable_or_wait): Pass thread_number to
5261 should_cancel_thread.
5262 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5263 parameter.
5264
804eb480
ST
52652011-07-22 Sriraman Tallam <tmsriram@google.com>
5266
5267 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5268 only after checking if it cannot be forced local.
5269 * symtab.h (is_externally_visible): Check if the symbol is not forced
5270 local.
5271
f1ddb600
ILT
52722011-07-15 Ian Lance Taylor <iant@google.com>
5273
5274 * options.h (class General_options): Add --print-output-format.
5275 Move -EL next to -EB, for better --help output.
5276 * target-select.cc: Include <cstdio>, "options.h", and
5277 "parameters.h".
5278 (Target_selector::do_target_bfd_name): New function.
5279 (print_output_format): New function.
5280 * target-select.h (class Target_selector): Update declarations.
5281 (Target_selector::target_bfd_name): New function.
5282 (print_output_format): Declare.
5283 * main.cc: Include "target-select.h".
5284 (main): Handle --print-output-format.
5285 * gold.cc: Include "target-select.h".
5286 (queue_initial_tasks): Handle --print-output-format when there are
5287 no input files.
5288 * parameters.cc (parameters_force_valid_target): Give a better
5289 error message if -EB/-EL does not match target.
5290 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5291 function.
5292
7d172687
ILT
52932011-07-15 Ian Lance Taylor <iant@google.com>
5294
5295 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5296 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5297 (Output_data_plt_i386::do_write): Write address of .dynamic
5298 section to first entry in .got.plt section.
5299 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5300 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5301 Initialize layout_.
5302 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5303 section to first entry in .got.plt section.
5304 * layout.h (Layout::dynamic_section): New function.
5305
e9552f7e
ST
53062011-07-13 Sriraman Tallam <tmsriram@google.com>
5307
5308 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5309 to claim_file call.
5310 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5311 input_section_position_, and input_section_glob_.
5312 (read_layout_from_file): Call function section_ordering_specified.
5313 * layout.h (is_section_ordering_specified): New function.
5314 (section_ordering_specified): New function.
5315 (section_ordering_specified_): New boolean member.
5316 * main.cc(main): Call load_plugins after layout object is defined.
5317 * output.cc (Output_section::add_input_section): Use
5318 function section_ordering_specified to check if section ordering is
5319 needed.
5320 * output.cc (Output_section::add_relaxed_input_section): Use
5321 function section_ordering_specified to check if section ordering is
5322 needed.
5323 (Output_section::update_section_layout): New function.
5324 (Output_section::sort_attached_input_sections): Check if input section
5325 must be reordered.
5326 * output.h (Output_section::update_section_layout): New function.
5327 * plugin.cc (get_section_count): New function.
5328 (get_section_type): New function.
5329 (get_section_name): New function.
5330 (get_section_contents): New function.
5331 (update_section_order): New function.
58797674 5332 (allow_section_ordering): New function.
e9552f7e
ST
5333 (Plugin::load): Add the new interfaces to the transfer vector.
5334 (Plugin_manager::load_plugins): New parameter.
5335 (Plugin_manager::all_symbols_read): New parameter.
5336 (Plugin_manager::claim_file): New parameter. Save the elf object for
5337 unclaimed objects.
5338 (Plugin_manager::get_elf_object): New function.
5339 (Plugin_manager::get_view): Change to directly use the bool to check
5340 if get_view is called from claim_file_hook.
5341 * plugin.h (input_objects): New function
5342 (Plugin__manager::load_plugins): New parameter.
5343 (Plugin_manager::claim_file): New parameter.
5344 (Plugin_manager::get_elf_object): New function.
5345 (Plugin_manager::in_claim_file_handler): New function.
5346 (Plugin_manager::in_claim_file_handler_): New member.
5347 (layout): New function.
5348 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5349 handler with an extra parameter. Make the elf object before calling
5350 claim_file handler.
5351 * testsuite/plugin_test.c (get_section_count): New function pointer.
5352 (get_section_type): New function pointer.
5353 (get_section_name): New function pointer.
5354 (get_section_contents): New function pointer.
5355 (update_section_order): New function pointer.
5356 (allow_section_ordering): New function pointer.
5357 (onload): Check if the new interfaces exist.
5358
9446efde
ILT
53592011-07-13 Ian Lance Taylor <iant@google.com>
5360
5361 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5362 relro section.
5363 * x86_64.cc (Target_x86_64::got_section): Likewise.
5364 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5365 (relro_now_test_SOURCES): New variable.
5366 (relro_now_test_DEPENDENCIES): New variable.
5367 (relro_now_test_LDFLAGS): New variable.
5368 (relro_now_test_LDADD): New variable.
5369 (relro_now_test.so): New target.
5370 * testsuite/Makefile.in: Rebuild.
5371
07aa62f2
ILT
53722011-07-12 Ian Lance Taylor <iant@google.com>
5373
5374 PR gold/12980
5375 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5376 GLOB_DAT relocation rather than a RELATIVE relocation for a
5377 protected symbol when creating a shared library.
5378 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5379 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5380 * testsuite/protected_main_1.cc (main): Test that protected
5381 function has same address.
5382
e2153196
ILT
53832011-07-11 Ian Lance Taylor <iant@google.com>
5384
5385 PR gold/12979
5386 * options.h (class General_options): Add -Bgroup.
5387 * options.cc (General_options::finalize): If -Bgroup is set,
5388 default to --unresolved-symbols=report-all.
5389 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5390 * target-reloc.h (issue_undefined_symbol_error): Handle
5391 --unresolved-symbols=report-all.
5392
6daf5215
ILT
53932011-07-08 Ian Lance Taylor <iant@google.com>
5394
5395 PR gold/11985
5396 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5397 if linker script discards key sections.
5398 (Layout::create_dynamic_symtab): Likewise.
5399 (Layout::assign_local_dynsym_offsets): Likewise.
5400 (Layout::sized_create_version_sections): Likewise.
5401 (Layout::create_interp): Likewise.
5402 (Layout::finish_dynamic_section): Likewise.
5403 (Layout::set_dynamic_symbol_size): Likewise.
5404
beabb2c6
ILT
54052011-07-08 Ian Lance Taylor <iant@google.com>
5406
5407 PR gold/12386
5408 * options.h (class General_options): Add --unresolved-symbols.
5409 * target-reloc.h (issue_undefined_symbol_error): Check
5410 --unresolved-symbols. Add comments.
5411
9c16daf1
ILT
54122011-07-08 Ian Lance Taylor <iant@google.com>
5413
5414 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5415 expression more complex.
5416
191f1a2d
ILT
54172011-07-08 Ian Lance Taylor <iant@google.com>
5418
5419 PR gold/11317
5420 * target-reloc.h (issue_undefined_symbol_error): New inline
5421 function, broken out of relocate_section.
5422 (relocate_section): Call issue_undefined_symbol_error.
5423 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5424 there is no TLS segment if we are about to issue an undefined
5425 symbol error.
5426 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5427
62855347
ILT
54282011-07-08 Ian Lance Taylor <iant@google.com>
5429
5430 PR gold/12279
5431 * resolve.cc (Symbol_table::should_override): Add fromtype
5432 parameter. Change all callers. Give error when linking together
5433 TLS and non-TLS symbol.
5434 (Symbol_table::should_override_with_special): Add fromtype
5435 parameter. Change all callers.
5436 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5437 there is no TLS segment if we have reported some errors.
5438 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5439
67181c72
ILT
54402011-07-08 Ian Lance Taylor <iant@google.com>
5441
5442 PR gold/12372
5443 * target.h (Target::plt_address_for_global): New function.
5444 (Target::plt_address_for_local): New function.
5445 (Target::plt_section_for_global): Remove.
5446 (Target::plt_section_for_local): Remove.
5447 (Target::do_plt_address_for_global): New virtual function.
5448 (Target::do_plt_address_for_local): New virtual function.
5449 (Target::do_plt_section_for_global): Remove.
5450 (Target::do_plt_section_for_local): Remove.
5451 (Target::register_global_plt_entry): Add Symbol_table and Layout
5452 parameters.
5453 * output.cc (Output_data_got::Got_entry::write): Use
5454 plt_address_for_global and plt_address_for_local.
5455 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5456 address of output section.
5457 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5458 got_irelative_, and irelative_count_ fields. Update
5459 declarations.
5460 (Output_data_plt_i386::has_irelative_section): New function.
5461 (Output_data_plt_i386::entry_count): Add irelative_count_.
5462 (Output_data_plt_i386::set_final_data_size): Likewise.
5463 (class Target_i386): Add got_irelative_ and rel_irelative_
5464 fields. Update declarations.
5465 (Target_i386::Target_i386): Initialize new fields.
5466 (Target_i386::do_plt_address_for_global): New function replacing
5467 do_plt_section_for_global.
5468 (Target_i386::do_plt_address_for_local): New function replacing
5469 do_plt_section_for_local.
5470 (Target_i386::got_section): Create got_irelative_.
5471 (Target_i386::rel_irelative_section): New function.
5472 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5473 fields. Don't define __rel_iplt_{start,end}.
5474 (Output_data_plt_i386::add_entry): Add symtab and layout
5475 parameters. Change all callers. Use different PLT and GOT for
5476 IFUNC symbols.
5477 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5478 layout parameters. Change all callers. Use different PLT and
5479 GOT.
5480 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5481 (Output_data_plt_i386::rel_irelative): New function.
5482 (Output_data_plt_i386::address_for_global): New function.
5483 (Output_data_plt_i386::address_for_local): New function.
5484 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5485 IRELATIVE GOT when changing IFUNC GOT entries.
5486 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5487 reloc.
5488 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5489 if we didn't create an IRELATIVE GOT.
5490 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5491 plt_address_for_local.
5492 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5493 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5494 got_irelative_, and irelative_count_ fields. Update
5495 declarations.
5496 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5497 Initialize new fields. Remove symtab parameter. Change all
5498 callers.
5499 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5500 irelative_count_.
5501 (Output_data_plt_x86_64::has_irelative_section): New function.
5502 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5503 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5504 fields. Update declarations.
5505 (Target_x86_64::Target_x86_64): Initialize new fields.
5506 (Target_x86_64::do_plt_address_for_global): New function replacing
5507 do_plt_section_for_global.
5508 (Target_x86_64::do_plt_address_for_local): New function replacing
5509 do_plt_section_for_local.
5510 (Target_x86_64::got_section): Create got_irelative_.
5511 (Target_x86_64::rela_irelative_section): New function.
5512 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5513 all callers. Don't create __rel_iplt_{start,end}.
5514 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5515 parameters. Change all callers. Use different PLT and GOT for
5516 IFUNC symbols.
5517 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5518 layout parameters. Change all callers. Use different PLT and
5519 GOT.
5520 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5521 parameters. Change all callers. Use different PLT and GOT for
5522 IFUNC symbols.
5523 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5524 (Output_data_plt_x86_64::rela_irelative): New function.
5525 (Output_data_plt_x86_64::address_for_global): New function.
5526 (Output_data_plt_x86_64::address_for_local): New function.
5527 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5528 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5529 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5530 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5531 parameters.
5532 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5533 reloc.
5534 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5535 symbols if we didn't create an IRELATIVE GOT.
5536 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5537 plt_address_for_local.
5538 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5539 * testsuite/ifuncvar1.c: New test file.
5540 * testsuite/ifuncvar2.c: New test file.
5541 * testsuite/ifuncvar3.c: New test file.
5542 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5543 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5544 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5545 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5546 * testsuite/Makefile.in: Rebuild.
5547
33c15b45
CC
55482011-07-07 Cary Coutant <ccoutant@google.com>
5549
5550 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5551 (two_file_test_1_ndebug.o): Likewise.
5552 (two_file_test_1b_ndebug.o): Likewise.
5553 (two_file_test_2_ndebug.o): Likewise.
5554 (two_file_test_main_ndebug.o): Likewise.
5555 (incremental_test_2): Link with no-debug versions.
5556
f48b5fb7
CC
55572011-07-06 Cary Coutant <ccoutant@google.com>
5558
5559 * gold/incremental.cc
5560 (Output_section_incremental_inputs::write_info_blocks): Check for
5561 hidden and internal symbols.
5562
221597a5
CC
55632011-07-06 Cary Coutant <ccoutant@google.com>
5564
5565 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5566 Check disposition for startup file.
5567 (Incremental_inputs::report_command_line): Ignore
5568 --incremental-startup-unchanged option.
5569 * options.cc (General_options::parse_incremental_startup_unchanged):
5570 New function.
5571 (General_options::General_options): Initialize new data member.
5572 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5573 (General_options): Add --incremental-startup-unchanged option.
5574 (General_options::incremental_startup_disposition): New function.
5575 (General_options::incremental_startup_disposition_): New data member.
5576
e24719f6
CC
55772011-07-06 Cary Coutant <ccoutant@google.com>
5578
5579 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5580 input file index to Script_info ctor.
5581 (Sized_incremental_binary::do_file_has_changed): Find the
5582 command-line argument for files named in scripts.
5583 * incremental.h (Script_info::Script_info): New ctor
5584 with input file index.
5585 (Script_info::input_file_index): New function.
5586 (Script_info::input_file_index_): New data member.
5587 (Incremental_binary::get_library): Add const.
5588 (Incremental_binary::get_script_info): Add const.
5589 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5590 * testsuite/Makefile.am (incremental_test_5): New test case.
5591 (incremental_test_6): New test case.
5592 * testsuite/Makefile.in: Regenerate.
5593
8f7c81e8
CC
55942011-07-06 Cary Coutant <ccoutant@google.com>
5595
5596 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5597 debug output when command lines differ.
5598
9fbd3822
CC
55992011-07-06 Cary Coutant <ccoutant@google.com>
5600
5601 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5602 --incremental-patch option.
5603 * layout.cc (Free_list::allocate): Extend allocation beyond original
5604 end if enabled.
5605 (Layout::make_output_section): Mark sections that should get
5606 patch space.
5607 * options.cc (parse_percent): New function.
5608 * options.h (parse_percent): New function.
5609 (DEFINE_percent): New macro.
5610 (General_options): Add --incremental-patch option.
5611 * output.cc (Output_section::Output_section): Initialize new data
5612 members.
5613 (Output_section::add_input_section): Print section name when out
5614 of patch space.
5615 (Output_section::add_output_section_data): Likewise.
5616 (Output_section::set_final_data_size): Add patch space when
5617 doing --incremental-full.
5618 (Output_section::do_reset_address_and_file_offset): Remove patch
5619 space.
5620 (Output_segment::set_section_list_addresses): Print debug output
5621 only if --incremental-update.
5622 * output.h (Output_section::set_is_patch_space_allowed): New function.
5623 (Output_section::is_patch_space_allowed_): New data member.
5624 (Output_section::patch_space_): New data member.
5625 * parameters.cc (Parameters::incremental_full): New function.
5626 * parameters.h (Parameters::incremental_full): New function
5627 * testsuite/Makefile.am (incremental_test_2): Add test for
5628 --incremental-patch option.
5629 * testsuite/Makefile.in: Regenerate.
5630 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5631 (t18): Remove function body.
5632
f6cccc2c
DK
56332011-07-05 Doug Kwan <dougkwan@google.com>
5634
5635 PR gold/12771
5636 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5637 Arm_Address type for relocation result.
5638 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5639 overflow check.
5640 (Arm_relocate_functions::abs32): Use unaligned access.
5641 (Arm_relocate_functions::rel32): Ditto.
5642 (Arm_relocate_functions::prel31): Ditto.
5643 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5644 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5645 static data relocations.
5646 * testsuite/Makefile.in: Regnerate.
5647 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5648
28a13fec
ILT
56492011-07-05 Ian Lance Taylor <iant@google.com>
5650
5651 PR gold/12392
5652 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5653 symbols if necessary.
5654 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5655
24d47b34
ILT
56562011-07-05 Ian Lance Taylor <iant@google.com>
5657
5658 PR gold/12952
5659 * resolve.cc (Symbol::override_base_with_special): Simply override
5660 version with special symbol version, ignoring previous version.
5661
41f9cbbe
ILT
56622011-07-05 Ian Lance Taylor <iant@google.com>
5663
5664 * object.cc (Sized_relobj_file::include_section_group): Add
5665 information to comment about signature location.
5666
886288f1
ILT
56672011-07-02 Ian Lance Taylor <iant@google.com>
5668
5669 PR gold/12957
5670 * options.h (class General_options): Add -f and -F.
5671 * options.cc (General_options::finalize): Fatal error if -f/-F
5672 are used without -shared.
5673 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5674
ae3a6d4f
ILT
56752011-07-02 Ian Lance Taylor <iant@google.com>
5676
5677 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5678
21131061
ILT
56792011-07-01 Ian Lance Taylor <iant@google.com>
5680
5681 PR gold/12525
5682 PR gold/12952
5683 * resolve.cc (Symbol::override_base_with_special): Don't override
5684 the version if the overriding symbol has a different name.
5685 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5686 all callers. If we give an error about an undefined version,
5687 define the base version if necessary.
5688 * dynobj.h (class Versions): Update declaration.
5689 * testsuite/weak_alias_test_5.cc: New file.
5690 * testsuite/weak_alias_test.script: New file.
5691 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5692 and versioned_alias have the right value, and call t2.
5693 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5694 weak_alias_test_5.so.
5695 (weak_alias_test_LDADD): Likewise.
5696 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5697 * testsuite/Makefile.in: Rebuild.
5698
611062c0
ILT
56992011-07-01 Ian Lance Taylor <iant@google.com>
5700
5701 PR gold/12525
5702 * options.h (class General_options): Support -z notext.
5703 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5704 -Wl,-z,notext.
5705 (two_file_shared_nonpic.so): Likewise.
5706 (two_file_shared_mixed.so): Likewise.
5707 (two_file_shared_mixed_1.so): Likewise.
5708 (weak_undef_lib_nonpic.so): Likewise.
5709 (alt/weak_undef_lib_nonpic.so): Likewise.
5710 (tls_test_shared_nonpic.so): Likewise.
5711 * testsuite/Makefile.in: Rebuild.
5712
328c7c2f
ILT
57132011-07-01 Ian Lance Taylor <iant@google.com>
5714
5715 PR gold/12525
5716 * configure.ac: Test whether static linking works, setting
5717 the automake conditional HAVE_STATIC.
5718 * testsuite/Makefile.am: Disable tests using -static if
5719 HAVE_STATIC is not true.
5720 * configure, testsuite/Makefile.in: Rebuild.
5721
02d7cd44
ILT
57222011-07-01 Ian Lance Taylor <iant@google.com>
5723
5724 PR gold/12525
5725 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5726 Assert if we see DW_EH_PE_indirect.
5727 * target.h (Target::ehframe_datarel_base): New function.
5728 (Target::do_ehframe_datarel_base): New target function.
5729 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5730 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5731 function.
5732
07a60597
ILT
57332011-07-01 Ian Lance Taylor <iant@google.com>
5734
5735 PR gold/12571
5736 * options.h (class General_options): Add
5737 --ld-generated-unwind-info.
5738 * ehframe.cc (Fde::write): Add address parameter. Change all
5739 callers. If associated with PLT, fill in address and size.
5740 (Cie::set_output_offset): Only add merge mapping if there is an
5741 object.
5742 (Cie::write): Add address parameter. Change all callers.
5743 (Eh_frame::add_ehframe_for_plt): New function.
5744 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5745 input_offset_ fields into union u_, with new plt field.
5746 (Fde::Fde): Adjust for new union field.
5747 (Fde::Fde) [Output_data version]: New constructor.
5748 (Fde::add_mapping): Only add merge mapping if there is an object.
5749 (class Cie): Update declarations.
5750 (class Eh_frame): Declare add_ehframe_for_plt.
5751 * layout.cc (Layout::layout_eh_frame): Break out code into
5752 make_eh_frame_section, and call it.
5753 (Layout::make_eh_frame_section): New function.
5754 (Layout::add_eh_frame_for_plt): New function.
5755 * layout.h (class Layout): Update declarations.
5756 * merge.cc (Merge_map::add_mapping): Add assertion.
5757 * i386.cc: Include "dwarf.h".
5758 (class Output_data_plt_i386): Make first_plt_entry,
5759 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5760 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5761 and plt_eh_frame_fde.
5762 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5763 boundary. Call add_eh_frame_for_plt if appropriate.
5764 * x86_64.cc: Include "dwarf.h".
5765 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5766 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5767 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5768 and plt_eh_frame_fde.
5769 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5770 appropriate.
5771
14788a3f
ILT
57722011-06-29 Ian Lance Taylor <iant@google.com>
5773
5774 PR gold/12629
5775 * object.cc (Sized_relobj_file::layout_section): Change shdr
5776 parameter to be const.
5777 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5778 out of do_layout.
5779 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5780 appropriate. Call layout_eh_frame_section.
5781 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5782 sections.
5783 * object.h (class Sized_relobj_file): Update declarations.
5784
6c21fce1
ILT
57852011-06-29 Ian Lance Taylor <iant@google.com>
5786
37e41b03 5787 PR gold/12652
6c21fce1
ILT
5788 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5789 modifier.
5790 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5791
4d5e4e62
ILT
57922011-06-29 Ian Lance Taylor <iant@google.com>
5793
5794 PR gold/12675
5795 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5796 SHT_X86_64_UNWIND.
5797 * layout.cc (Layout::layout_eh_frame): Likewise.
5798
886f533a
ILT
57992011-06-29 Ian Lance Taylor <iant@google.com>
5800
5801 PR gold/12695
5802 * layout.cc (Layout::symtab_section_shndx): New function.
5803 * layout.h (class Layout): Declare symtab_section_shndx.
5804 * output.cc (Output_section::write_header): Call it.
5805
f3ae1b28
ILT
58062011-06-29 Ian Lance Taylor <iant@google.com>
5807
5808 PR gold/12818
5809 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5810 symbols which are not used in a relocation.
5811
aecf301f
ILT
58122011-06-28 Ian Lance Taylor <iant@google.com>
5813
5814 PR gold/12898
5815 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5816 script create indistinguishable segments.
5817 (Layout::set_segment_offsets): Use stable_sort when sorting
5818 segments. Pass this to Compare_segments constructor.
5819 * layout.h (class Layout): Make segment_precedes non-static.
5820 (class Compare_segments): Change from struct to class. Add
5821 layout_ field. Add constructor.
5822 * script-sections.cc
5823 (Script_sections::attach_sections_using_phdrs_clause): Rename
5824 local orphan to is_orphan. Don't report failure to put empty
5825 section in segment. On attachment failure, report name of
5826 section, and attach to first PT_LOAD segment.
5827
03ef7571
ILT
58282011-06-28 Ian Lance Taylor <iant@google.com>
5829
5830 PR gold/12934
5831 * target-select.cc (Target_selector::Target_selector): Add
5832 emulation parameter. Change all callers.
5833 (select_target_by_bfd_name): Rename from select_target_by_name.
5834 Change all callers.
5835 (select_target_by_emulation): New function.
5836 (supported_emulation_names): New function.
5837 * target-select.h (class Target_selector): Add emulation_ field.
5838 Update declarations.
5839 (Target_selector::recognize_by_bfd_name): Rename from
5840 recognize_by_name. Change all callers.
5841 (Target_selector::supported_bfd_names): Rename from
5842 supported_names. Change all callers.
5843 (Target_selector::recognize_by_emulation): New function.
5844 (Target_selector::supported_emulations): New function.
5845 (Target_selector::emulation): New function.
5846 (Target_selector::do_recognize_by_bfd_name): Rename from
5847 do_recognize_by_name. Change all callers.
5848 (Target_selector::do_supported_bfd_names): Rename from
5849 do_supported_names. Change all callers.
5850 (Target_selector::do_recognize_by_emulation): New function.
5851 (Target_selector::do_supported_emulations): New function.
5852 (select_target_by_bfd_name): Change name in declaration.
5853 (select_target_by_emulation): Declare.
5854 (supported_emulation_names): Declare.
5855 * parameters.cc (parameters_force_valid_target): Try to find
5856 target based on emulation from -m option.
5857 * options.h (class General_options): Change doc string for -m.
5858 * options.cc (help): Print emulations.
5859 (General_options::parse_V): Likewise.
5860 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5861 Add emulation parameter. Change all callers.
5862
200b2bb9
ILT
58632011-06-28 Ian Lance Taylor <iant@google.com>
5864
5865 * target.h (class Target): Add osabi_ field.
5866 (Target::osabi): New function.
5867 (Target::set_osabi): New function.
5868 (Target::Target): Initialize osabi_.
5869 (Target::do_adjust_elf_header): Make pure virtual.
5870 (Sized_target::do_adjust_elf_header): Declare.
5871 * target.cc (Sized_target::do_adjust_elf_header): New function.
5872 (class Sized_target): Instantiate all versions.
5873 * freebsd.h (class Target_freebsd): Remove.
5874 (Target_selector_freebsd::do_recognize): Call set_osabi on
5875 Target.
5876 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5877 (Target_selector_freebsd::set_osabi): Remove.
5878 * i386.cc (class Target_i386): Inherit from Sized_target rather
5879 than Target_freebsd.
5880 * x86_64.cc (class Target_x86_64): Likewise.
5881
b3ce541e
ILT
58822011-06-28 Ian Lance Taylor <iant@google.com>
5883
5884 * target.h (Target::can_check_for_function_pointers): Rewrite.
5885 Make non-virtual.
5886 (Target::can_icf_inline_merge_sections): Likewise.
5887 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5888 (Target::Target_info): Add can_icf_inline_merge_sections field.
5889 (Target::do_can_check_for_function_pointers): New virtual
5890 function.
5891 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5892 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5893 from can_check_for_function_pointers, move in file.
5894 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5895 section_may_have_icf_unsafe_poineters, move in file.
5896 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5897 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5898 Rename from can_check_for_function_pointers, move in file.
5899 (Target_i386::can_icf_inline_merge_sections): Remove.
5900 (Target_i386::i386_info): Initialize
5901 can_icf_inline_merge_sections.
5902 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5903 Initialize can_icf_inline_merge_sections.
5904 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5905 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5906 Rename from can_check_for_function_pointers, move in file.
5907 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5908 (Target_x86_64::x86_64_info): Initialize
5909 can_icf_inline_merge_sections.
5910 * testsuite/testfile.cc (Target_test::test_target_info):
5911 Likewise.
5912 * icf.cc (get_section_contents): Correct formatting.
5913
6d1c4efb
ILT
59142011-06-27 Ian Lance Taylor <iant@google.com>
5915
5916 * symtab.cc (Symbol::versioned_name): New function.
5917 (Symbol_table::add_to_final_symtab): Use versioned_name when
5918 appropriate.
5919 (Symbol_table::sized_write_symbol): Likewise.
5920 * symtab.h (class Symbol): Declare versioned_name.
5921 * stringpool.h (class Stringpool_template): Add variant of add
5922 which takes a std::basic_string.
5923 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5924 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5925 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5926 (ver_test_12.o): New target.
5927 * testsuite/Makefile.in: Rebuild.
5928
57eb9b50
DK
59292011-06-27 Doug Kwan <dougkwan@google.com>
5930
5931 * arm.cc (Arm_relocate_functions::thm_jump8,
5932 Arm_relocate_functions::thm_jump11): Use a wider signed
5933 type to compute offset.
5934 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5935 arm_thm_jump8.
5936 * testsuite/Makefile.in: Regenerate.
5937 * testsuite/arm_branch_in_range.sh: Check test results of
5938 arm_thm_jump11 and arm_thm_jump8.
5939 * testsuite/arm_thm_jump11.s: New test source file.
5940 * testsuite/arm_thm_jump11.t: New linker script.
5941 * testsuite/arm_thm_jump8.s: New test source file.
5942 * testsuite/arm_thm_jump8.t: New linker script.
5943
487b39df
ILT
59442011-06-24 Ian Lance Taylor <iant@google.com>
5945
5946 * layout.cc: Include "object.h".
5947 (ctors_sections_in_init_array): New static variable.
5948 (Layout::is_ctors_in_init_array): New function.
5949 (Layout::layout): Add entry to ctors_sections_in_init_array if
5950 appropriate.
5951 * layout.h (class Layout): Declare is_ctors_in_init_array.
5952 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5953 is_ctors_reverse_view is set.
5954 (Sized_relobj_file::write_sections): Add layout parameter. Change
5955 all callers. Set is_ctors_reverse_view field of View_size.
5956 (Sized_relobj_file::reverse_words): New function.
5957 * object.h (Sized_relobj_file::View_size): Add
5958 is_ctors_reverse_view field.
5959 (class Sized_relobj_file): Update declarations.
5960 * testsuite/initpri3.c: New test.
5961 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5962 initpri3b.
5963 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5964 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5965 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5966 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5967 * testsuite/Makefile.in: Rebuild.
5968
472076e4
CC
59692011-06-24 Cary Coutant <ccoutant@google.com>
5970
5971 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5972 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5973 (debug_msg_cdebug.err): New targets.
5974 * testsuite/Makefile.in: Regenerate.
5975 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5976 Fix checks for link with shared library.
5977
a60af0db
DK
59782011-06-24 Doug Kwan <dougkwan@google.com>
5979
5980 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5981 skip empty text sections.
5982 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5983
5393d741
ILT
59842011-06-22 Ian Lance Taylor <iant@google.com>
5985
5986 PR gold/12910
5987 * options.h (class General_options): Add --ctors-in-init-array.
5988 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5989 friends as SHT_PROGBITS for merging sections.
5990 (Layout::layout): Remove special handling of .init_array and
5991 friends. Don't sort if doing relocatable link. Sort for .ctors
5992 and .dtors if ctors_in_init_array.
5993 (Layout::make_output_section): Force correct section types for
5994 .init_array and friends. Don't sort if doing relocatable link,
5995 Don't sort .ctors and .dtors if ctors_in_init_array.
5996 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5997 (Layout::output_section_name): Add relobj parameter. Change all
5998 callers. Handle .ctors. and .dtors. in code rather than table.
5999 Handle .ctors and .dtors if ctors_in_init_array.
6000 (Layout::match_file_name): New function, moved from output.cc.
6001 * layout.h (class Layout): Update declarations.
6002 * output.cc: Include "layout.h".
6003 (Input_section_sort_entry::get_priority): New function.
6004 (Input_section_sort_entry::match_file_name): Just call
6005 Layout::match_file_name.
6006 (Output_section::Input_section_sort_init_fini_compare::operator()):
6007 Handle .ctors and .dtors. Sort by explicit priority rather than
6008 by name.
6009 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6010 * testsuite/initpri2.c: New test.
6011 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6012 (check_PROGRAMS): Add initpri2.
6013 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6014 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6015 * configure, testsuite/Makefile.in: Rebuild.
6016
e1f74f98
ILT
60172011-06-19 Ian Lance Taylor <iant@google.com>
6018
6019 PR gold/12880
6020 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6021 .interp section to a PT_INTERP segment even if we have seen a
6022 --dynamic-linker option. Don't do it if we have seen a PHDRS
6023 clause in a linker script.
6024 (Layout::finalize): Don't create a .interp section if we've
6025 already create a PT_INTERP segment.
6026 (Layout::create_interp): Always call choose_output_section (revert
6027 patch of 2011-06-17). Don't create PT_INTERP segment.
6028 * script-sections.cc
6029 (Script_sections::create_note_and_tls_segments): Add a .interp
6030 section to a PT_INTERP segment even if we have seen a
6031 --dynamic-linker option.
6032
766f91bb
ILT
60332011-06-18 Ian Lance Taylor <iant@google.com>
6034
6035 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6036 merely because a non-PT_LOAD segment has a dynamic reloc.
6037
0d212c3a
ILT
60382011-06-18 Ian Lance Taylor <iant@google.com>
6039
6040 * layout.cc (Layout::finish_dynamic_section): Don't create
6041 DT_FLAGS entry if not needed.
6042
911a5072
ILT
60432011-06-18 Ian Lance Taylor <iant@google.com>
6044
6045 PR gold/12745
6046 * layout.cc (Layout::layout_eh_frame): Correct handling of
6047 writable .eh_frame section.
6048
534b4e5f
ILT
60492011-06-17 Ian Lance Taylor <iant@google.com>
6050
6051 PR gold/12893
6052 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6053 symbol is redefined with the exact same object and value.
6054
10b4f102
ILT
60552011-06-17 Ian Lance Taylor <iant@google.com>
6056
6057 PR gold/12880
6058 * layout.h (class Layout): Add interp_segment_ field.
6059 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6060 (Layout::attach_allocated_section_to_segment): If making shared
6061 library, put .interp section in PT_INTERP segment.
6062 (Layout::finalize): Also call create_interp if -dynamic-linker
6063 option was used.
6064 (Layout::create_interp): Assert that there is no PT_INTERP
6065 segment. If not using a SECTIONS clause, use make_output_section.
6066 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6067 * script-sections.cc
6068 (Script_sections::create_note_and_tls_segments): If making shared
6069 library, put .interp section in PT_INTERP segment.
6070
a29b0dad
ILT
60712011-06-17 Ian Lance Taylor <iant@google.com>
6072
e588ea8d
ILT
6073 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6074 when making a shared library.
6075
60762011-06-17 Ian Lance Taylor <iant@google.com>
6077
6078 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6079 parameter. Change all callers. Don't issue warning about PC32
6080 against locally defined symbol.
a29b0dad 6081
9d3b0698
ILT
60822011-06-16 Ian Lance Taylor <iant@google.com>
6083
6084 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6085 occurs in same object.
6086
85b0f90c
AM
60872011-06-14 Alan Modra <amodra@gmail.com>
6088
6089 * po/POTFILES.in: Regenerate.
6090
a94907d9
ILT
60912011-06-09 Ian Lance Taylor <iant@google.com>
6092
6093 * script-sections.cc
6094 (Orphan_output_section::set_section_addresses): For a relocatable
6095 link set address to 0.
6096
4fb3a1c3
CC
60972011-06-09 Cary Coutant <ccoutant@google.com>
6098
6099 PR gold/12804
6100 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6101 used with --compress-debug-sections.
6102 * gold/object.cc (Sized_relobj_file::do_layout): Report
6103 uncompressed size of compressed input sections.
6104
61220854
CC
61052011-06-08 Cary Coutant <ccoutant@google.com>
6106
6107 PR gold/12804
6108 * testsuite/two_file_test_2_v1.cc: Change initialization of
6109 v2 to keep it in .data.
6110
e6455dfb
CC
61112011-06-07 Cary Coutant <ccoutant@google.com>
6112
6113 * common.cc (Symbol_table::do_allocate_commons_list): Call
6114 gold_fallback.
6115 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6116 (Errors::fallback): New function.
6117 (gold_fallback): New function.
6118 * errors.h (Errors::fallback): New function.
6119 * gold.cc (gold_exit): Change status parameter to enum; adjust
6120 all callers.
6121 (queue_initial_tasks): Call gold_fallback.
6122 * gold.h: Include cstdlib.
6123 (Exit_status): New enum type.
6124 (gold_exit): Change status parameter to enum.
6125 (gold_fallback): New function.
6126 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6127 (Layout::create_symtab_sections): Likewise.
6128 (Layout::create_shdrs): Likewise.
6129 * main.cc (main): Adjust call to gold_exit.
6130 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6131 (Output_data_got::add_got_entry_pair): Likewise.
6132 (Output_section::add_input_section): Likewise.
6133 (Output_section::add_output_section_data): Likewise.
6134 (Output_segment::set_section_list_addresses): Likewise.
6135 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6136
fb0e076f
CC
61372011-06-07 Cary Coutant <ccoutant@google.com>
6138
6139 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6140 for incremental links.
6141 * output.cc (Output_segment::set_section_list_addresses): Remove
6142 FIXME and test for TLS or BSS.
6143
a5ee4d5d
CC
61442011-06-07 Cary Coutant <ccoutant@google.com>
6145
6146 * testsuite/Makefile.am: Add incremental_copy_test,
6147 incremental_common_test_1.
6148 * testsuite/Makefile.in: Regenerate.
6149 * testsuite/common_test_1_v1.c: New source file.
6150 * testsuite/common_test_1_v2.c: New source file.
6151 * testsuite/copy_test_v1.cc: New source file.
6152
5146f448
CC
61532011-06-07 Cary Coutant <ccoutant@google.com>
6154
6155 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6156 update, allocate common from bss section's free list.
6157 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6158 linker-defined symbols.
6159 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6160 Skip GOT and PLT entries that are no longer referenced.
6161 (Output_section_incremental_inputs::write_info_blocks): Mark
6162 linker-defined symbols.
6163 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6164 * output.cc (Output_section::allocate): New function.
6165 * output.h (Output_section::allocate): New function.
6166 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6167 linker-defined symbols.
6168 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6169 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6170 (Symbol::init_base_output_data): Likewise.
6171 (Symbol::init_base_output_segment): Likewise.
6172 (Symbol::init_base_constant): Likewise.
6173 (Sized_symbol::init_output_data): Likewise.
6174 (Sized_symbol::init_output_segment): Likewise.
6175 (Sized_symbol::init_constant): Likewise.
6176 (Symbol_table::do_define_in_output_data): Likewise.
6177 (Symbol_table::do_define_in_output_segment): Likewise.
6178 (Symbol_table::do_define_as_constant): Likewise.
6179 * symtab.h (Symbol::is_predefined): New function.
6180 (Symbol::init_base_output_data): Add is_predefined parameter.
6181 (Symbol::init_base_output_segment): Likewise.
6182 (Symbol::init_base_constant): Likewise.
6183 (Symbol::is_predefined_): New data member.
6184 (Sized_symbol::init_output_data): Add is_predefined parameter.
6185 (Sized_symbol::init_output_segment): Likewise.
6186 (Sized_symbol::init_constant): Likewise.
6187 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6188
26d3c67d
CC
61892011-06-07 Cary Coutant <ccoutant@google.com>
6190
6191 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6192 instead of emit_copy_reloc.
6193 (Copy_relocs::emit_copy_reloc): Refactor.
6194 (Copy_relocs::make_copy_reloc): New function.
6195 (Copy_relocs::add_copy_reloc): Remove.
6196 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6197 section.
6198 (Copy_relocs::make_copy_reloc): New function.
6199 (Copy_relocs::add_copy_reloc): Remove.
6200 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6201 unchanged input files.
6202 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6203 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6204 Reserve BSS space for COPY relocations.
6205 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6206 (Output_section_incremental_inputs::write_info_blocks): Record
6207 whether a symbol is copied from a shared object.
6208 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6209 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6210 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6211 (Incremental_input_entry_reader::get_output_symbol_index): Add
6212 is_copy parameter.
6213 (Incremental_binary::emit_copy_relocs): New function.
6214 (Incremental_binary::do_emit_copy_relocs): New function.
6215 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6216 new data member.
6217 (Sized_incremental_binary::add_copy_reloc): New function.
6218 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6219 (Sized_incremental_binary::Copy_reloc): New struct.
6220 (Sized_incremental_binary::Copy_relocs): New typedef.
6221 (Sized_incremental_binary::copy_relocs_): New data member.
6222 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6223 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6224 * target.h (Sized_target::emit_copy_reloc): New function.
6225 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6226
7cdb37d9
CC
62272011-06-02 Cary Coutant <ccoutant@google.com>
6228
6229 PR gold/12163
6230 * gold/archive.cc (Archive::Archive): Initialize new data member.
6231 (Archive::include_all_members): Return if archive has already been
6232 included.
6233 * gold/archive.h (Archive::include_all_members_): New data member.
6234
cc643b88
NC
62352011-06-02 Nick Clifton <nickc@redhat.com>
6236
6237 * dynobj.h: Fix spelling mistake in comment.
6238 * output.cc: Likewise.
6239
f62a3ca7 62402011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6241 Asier Llano
f62a3ca7
DK
6242
6243 PR gold/12826
cc643b88 6244 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6245 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6246 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6247 redundant arm_exidx_test.so.
6248 * testsuite/Makefile.in: Regenerate.
6249 (check_SCRIPTS): Add pr12826.sh
6250 (check_DATA): Add pr12826.stdout
6251 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6252 * testsuite/pr12826.sh: New file.
6253 * testsuite/pr12826_1.s: Ditto.
6254 * testsuite/pr12826_1.s: Ditto.
6255
8dbe1edc
ILT
62562011-05-30 Ian Lance Taylor <iant@google.com>
6257
6258 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6259 sections.
6260
c49875be
ILT
62612011-05-29 Ian Lance Taylor <iant@google.com>
6262
6263 PR gold/12804
6264 * testsuite/Makefile.am: Use different file name for two_file_test
6265 temporary file for each incremental test.
6266 * testsuite/Makefile.in: Rebuild.
6267
69d53f7a
ILT
62682011-05-29 Ian Lance Taylor <iant@google.com>
6269
6270 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6271 binary input file is empty.
6272
41d0ab5f
ILT
62732011-05-27 Ian Lance Taylor <iant@google.com>
6274
6275 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6276 (ver_test_9.so): Likewise.
6277 * testsuite/Makefile.in: Rebuild.
6278
89d8a36b
CC
62792011-05-26 Cary Coutant <ccoutant@google.com>
6280
6281 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6282 * incremental.cc (Incremental_inputs::report_input_section): Fix
6283 comment, indentation.
6284 (Incremental_inputs::report_comdat_group): New function.
6285 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6286 of data for incremental input file entry.
6287 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6288 group count, COMDAT group signatures.
6289 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6290 an unchanged input file.
6291 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6292 Initialize new data member.
6293 (Incremental_object_entry::add_comdat_group): New function.
6294 (Incremental_object_entry::get_comdat_group_count): New function.
6295 (Incremental_object_entry::get_comdat_signature_key): New function.
6296 (Incremental_object_entry::groups_): New data member.
6297 (Incremental_inputs::report_comdat_group): New function.
6298 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6299 data for incremental input file entry.
6300 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6301 (Incremental_input_entry_reader::get_input_section): Adjust size of
6302 data for incremental input file entry.
6303 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6304 (Incremental_input_entry_reader::get_comdat_group_signature): New
6305 function.
6306 * object.cc (Sized_relobj::include_section_group): Report kept
6307 COMDAT groups for incremental links.
6308
1706a06f
ILT
63092011-05-24 David Meyer <pdox@google.com>
6310
6311 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6312 with name parameter. Add found_name parameter.
6313 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6314 * dirsearch.h (class Dirsearch): Update declaration.
6315
a10ae760
ILT
63162011-05-24 Ian Lance Taylor <iant@google.com>
6317
6318 * archive.cc (Library_base::should_include_member): Pull in object
6319 from archive if it defines the entry symbol.
6320 * parameters.cc (Parameters::entry): New function.
6321 * parameters.h (class Parameters): Declare entry.
6322 * output.h (class Output_file_header): Remove entry_ field.
6323 * output.cc (Output_file_header::Output_file_header): Remove entry
6324 parameter. Change all callers.
6325 (Output_file_header::entry): Use parameters->entry.
6326 * gold.cc (queue_middle_tasks): Likewise.
6327 * plugin.cc (Plugin_hook::run): Likewise.
6328
aa92d6ed
CC
63292011-05-24 Cary Coutant <ccoutant@google.com>
6330
6331 * gold.cc (queue_initial_tasks): Pass incremental base filename
6332 to Output_file::open_base_file; don't print error message.
6333 * incremental-dump.cc (main): Adjust call to
6334 Output_file::open_for_modification.
6335 * incremental-dump.cc (main): Likewise.
6336 * incremental.cc (Incremental_inputs::report_command_line):
6337 Ignore --incremental-base option when comparing command lines.
6338 Ignore parameter when given as separate argument.
6339 * options.h (class General_options): Add --incremental-base.
6340 * output.cc (Output_file::Output_file):
6341 (Output_file::open_base_file): Add base_name and writable parameters;
6342 read base file into new file; print error message here.
6343 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6344 callers.
6345 * output.h (Output_file::open_for_modification): Rename to...
6346 (Output_file::open_base_file): ...this; add base_name and
6347 writable parameters; adjust all callers.
6348 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6349 callers.
6350 * testsuite/Makefile.am (incremental_test_4): Test
6351 --incremental-base.
6352 * testsuite/Makefile.in: Regenerate.
6353
2eedd706
CC
63542011-05-24 Cary Coutant <ccoutant@google.com>
6355
6356 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6357 incremental_test_4.
6358 * testsuite/Makefile.in: Regenerate.
6359 * testsuite/two_file_test_1_v1.cc: New test source file.
6360 * testsuite/two_file_test_1b_v1.cc: New test source file.
6361 * testsuite/two_file_test_2_v1.cc: New test source file.
6362
0f1c85a6
CC
63632011-05-24 Cary Coutant <ccoutant@google.com>
6364
6365 * dynobj.h (Dynobj::do_dynobj): New function.
6366 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6367 flag and soname for shared objects.
6368 * incremental.cc (Incremental_inputs::report_object): Make
6369 either Incremental_object_entry or Incremental_dynobj_entry; add
6370 soname to string table.
6371 (Incremental_inputs::report_input_section): Add assertion.
6372 (Output_section_incremental_inputs::set_final_data_size): Adjust
6373 type of input file entry for shared libraries; adjust size of
6374 shared library info entry.
6375 (Output_section_incremental_inputs::write_input_files): Write
6376 as_needed flag for shared libraries.
6377 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6378 of input file entry for shared libraries; write soname.
6379 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6380 soname from incremental info.
6381 * incremental.h (enum Incremental_input_flags): Add
6382 INCREMENTAL_INPUT_AS_NEEDED.
6383 (Incremental_input_entry::Incremental_input_entry): Initialize new
6384 data member.
6385 (Incremental_input_entry::set_as_needed): New function.
6386 (Incremental_input_entry::as_needed): New function.
6387 (Incremental_input_entry::do_dynobj_entry): New function.
6388 (Incremental_input_entry::as_needed_): New data member.
6389 (Incremental_object_entry::Incremental_object_entry): Don't check
6390 for shared library.
6391 (Incremental_object_entry::do_type): Likewise.
6392 (class Incremental_dynobj_entry): New class.
6393 (Incremental_input_entry_reader::as_needed): New function.
6394 (Incremental_input_entry_reader::get_soname): New function.
6395 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6396 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6397 size of shared library info entry.
58797674 6398 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6399 incremental link when adding DT_NEEDED entries.
6400 * object.h (Object::Object): Initialize new data member.
6401 (Object::dynobj): New function.
6402 (Object::set_as_needed): New function.
6403 (Object::as_needed): New function.
6404 (Object::do_dynobj): New function.
6405 (Object::as_needed_): New data member.
6406
6fa2a40b
CC
64072011-05-24 Cary Coutant <ccoutant@google.com>
6408
6409 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6410 info; adjust display of GOT entries.
6411 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6412 vector of input objects; remove file_status_.
6413 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6414 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6415 got_plt reader; call target hooks to reserve GOT entries.
6416 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6417 of input file info header and GOT info entry.
6418 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6419 relocation info.
6420 (Got_plt_view_info::got_descriptor): Remove.
6421 (Got_plt_view_info::sym_index): New data member.
6422 (Got_plt_view_info::input_index): New data member.
6423 (Local_got_offset_visitor::visit): Write input file index.
6424 (Global_got_offset_visitor::visit): Write 0 for input file index.
6425 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6426 with sym_index and input_index.
6427 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6428 incremental info GOT entry; replace got_descriptor with input_index.
6429 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6430 map from input file index to object.
6431 (Sized_relobj_incr::do_layout): Replace direct data member reference
6432 with accessor function.
6433 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6434 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6435 Adjust size of input file info header.
6436 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6437 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6438 (Incremental_input_entry_reader::get_input_section): Adjust size of
6439 input file info header.
6440 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6441 of incremental info GOT entry.
6442 (Incremental_got_plt_reader::get_got_desc): Remove.
6443 (Incremental_got_plt_reader::get_got_symndx): New function.
6444 (Incremental_got_plt_reader::get_got_input_index): New function.
6445 (Sized_incremental_binary::Sized_incremental_binary): Remove
6446 file_status_; add input_objects_.
6447 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6448 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6449 (Sized_incremental_binary::file_is_unchanged): Remove.
6450 (Sized_incremental_binary::set_input_object): New function.
6451 (Sized_incremental_binary::input_object): New function.
6452 (Sized_incremental_binary::file_status_): Remove.
6453 (Sized_incremental_binary::input_objects_): New data member.
6454 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6455 references.
6456 (Sized_relobj_incr::invalid_address): Move to base class.
6457 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6458 class.
6459 (Sized_relobj_incr::do_output_section_offset): Likewise.
6460 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6461 (Sized_relobj_incr::section_offsets_): Likewise.
6462 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6463 function.
6464 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6465 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6466 with accessor function.
6467 (Sized_relobj_file::do_layout): Likewise.
6468 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6469 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6470 (Sized_relobj_file::compute_final_local_value): Replace refs to
6471 section_offsets_ with accessor function.
6472 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6473 * object.h (Relobj::Relobj): Initialize new data members.
6474 (Relobj::add_dyn_reloc): New function.
6475 (Relobj::first_dyn_reloc): New function.
6476 (Relobj::dyn_reloc_count): New function.
6477 (Relobj::first_dyn_reloc_): New data member.
6478 (Relobj::dyn_reloc_count_): New data member.
6479 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6480 references.
6481 (Sized_relobj::Address): New typedef.
6482 (Sized_relobj::invalid_address): Move here from child class.
6483 (Sized_relobj::Sized_relobj): Initialize new data members.
6484 (Sized_relobj::sized_relobj): New function.
6485 (Sized_relobj::is_output_section_offset_invalid): Move here from
6486 child class.
6487 (Sized_relobj::get_output_section_offset): Likewise.
6488 (Sized_relobj::local_has_got_offset): Likewise.
6489 (Sized_relobj::local_got_offset): Likewise.
6490 (Sized_relobj::set_local_got_offset): Likewise.
6491 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6492 (Sized_relobj::clear_got_offsets): New function.
6493 (Sized_relobj::section_offsets): Move here from child class.
6494 (Sized_relobj::do_output_section_offset): Likewise.
6495 (Sized_relobj::do_set_section_offset): Likewise.
6496 (Sized_relobj::Local_got_offsets): Likewise.
6497 (Sized_relobj::local_got_offsets_): Likewise.
6498 (Sized_relobj::section_offsets_): Likewise.
6499 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6500 references.
6501 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6502 class.
6503 (Sized_relobj_file::sized_relobj): New function
6504 (Sized_relobj_file::local_has_got_offset): Move to base class.
6505 (Sized_relobj_file::local_got_offset): Likewise.
6506 (Sized_relobj_file::set_local_got_offset): Likewise.
6507 (Sized_relobj_file::get_output_section_offset): Likewise.
6508 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6509 (Sized_relobj_file::do_output_section_offset): Likewise.
6510 (Sized_relobj_file::do_set_section_offset): Likewise.
6511 (Sized_relobj_file::Local_got_offsets): Likewise.
6512 (Sized_relobj_file::local_got_offsets_): Likewise.
6513 (Sized_relobj_file::section_offsets_): Likewise.
6514 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6515 (all constructors).
6516 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6517 (Output_reloc::get_symbol_index): Likewise.
6518 (Output_reloc::local_section_offset): Likewise.
6519 (Output_reloc::get_address): Likewise.
6520 (Output_reloc::symbol_value): Likewise.
6521 (Output_data_got::reserve_slot): Move to class definition.
6522 (Output_data_got::reserve_local): New function.
6523 (Output_data_got::reserve_slot_for_global): Remove.
6524 (Output_data_got::reserve_global): New function.
6525 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6526 (all constructors, two instantiations).
6527 (Output_reloc::get_relobj): New function (two instantiations).
6528 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6529 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6530 (Output_data_reloc::add_global): Adjust type of relobj.
6531 (Output_data_reloc::add_global_relative): Likewise.
6532 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6533 (Output_data_reloc::add_local): Likewise.
6534 (Output_data_reloc::add_local_relative): Likewise.
6535 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6536 (Output_data_reloc::add_local_section): Likewise.
6537 (Output_data_reloc::add_output_section): Likewise.
6538 (Output_data_reloc::add_absolute): Likewise.
6539 (Output_data_reloc::add_target_specific): Likewise.
6540 (Output_data_got::reserve_slot): Move definition here.
6541 (Output_data_got::reserve_local): New function.
6542 (Output_data_got::reserve_global): New function.
6543 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6544 section_offsets_ with accessor function.
6545 (Sized_relobj_file::write_sections): Likewise.
6546 (Sized_relobj_file::do_relocate_sections): Likewise.
6547 * target.h (Sized_target::reserve_local_got_entry): New function.
6548 (Sized_target::reserve_global_got_entry): New function.
6549 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6550 (Target_x86_64::reserve_global_got_entry): New function.
6551 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6552
4829d394
CC
65532011-05-23 Cary Coutant <ccoutant@google.com>
6554
6555 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6556 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6557 bit when checking got_type.
6558 * incremental.cc (Sized_incremental_binary::setup_readers):
6559 Store symbol table and string table locations; initialize bit vector
6560 of file status flags.
6561 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6562 unchanged files.
6563 (Sized_incremental_binary::do_process_got_plt): New function.
6564 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6565 (Output_section_incremental_inputs::set_final_data_size): Record
6566 file index for each input file.
6567 (Output_section_incremental_inputs::write_got_plt): Store file index
6568 instead of input entry offset for each GOT entry.
6569 * incremental.h
6570 (Incremental_input_entry::Incremental_input_entry): Initialize new
6571 data member.
6572 (Incremental_input_entry::set_offset): Store file index.
6573 (Incremental_input_entry::get_file_index): New function.
6574 (Incremental_input_entry::file_index_): New data member.
6575 (Incremental_binary::process_got_plt): New function.
6576 (Incremental_binary::do_process_got_plt): New function.
6577 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6578 data members.
6579 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6580 (Sized_incremental_binary::set_file_is_unchanged): New function.
6581 (Sized_incremental_binary::file_is_unchanged): New function.
6582 (Sized_incremental_binary::do_process_got_plt): New function.
6583 (Sized_incremental_binary::file_status_): New data member.
6584 (Sized_incremental_binary::main_symtab_loc_): New data member.
6585 (Sized_incremental_binary::main_strtab_loc_): New data member.
6586 * output.cc (Output_data_got::Got_entry::write): Add case
6587 RESERVED_CODE.
6588 (Output_data_got::add_global): Call add_got_entry.
6589 (Output_data_got::add_global_plt): Likewise.
6590 (Output_data_got::add_global_with_rel): Likewise.
6591 (Output_data_got::add_global_with_rela): Likewise.
6592 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6593 (Output_data_got::add_global_pair_with_rela): Likewise.
6594 (Output_data_got::add_local): Call add_got_entry.
6595 (Output_data_got::add_local_plt): Likewise.
6596 (Output_data_got::add_local_with_rel): Likewise.
6597 (Output_data_got::add_local_with_rela): Likewise.
6598 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6599 (Output_data_got::add_local_pair_with_rela): Likewise.
6600 (Output_data_got::reserve_slot): New function.
6601 (Output_data_got::reserve_slot_for_global): New function.
6602 (Output_data_got::add_got_entry): New function.
6603 (Output_data_got::add_got_entry_pair): New function.
6604 (Output_section::add_output_section_data): Edit FIXME.
6605 * output.h
6606 (Output_section_data_build::Output_section_data_build): New
6607 constructor with size parameter.
6608 (Output_data_space::Output_data_space): Likewise.
6609 (Output_data_got::Output_data_got): Initialize new data member; new
6610 constructor with size parameter.
6611 (Output_data_got::add_constant): Call add_got_entry.
6612 (Output_data_got::reserve_slot): New function.
6613 (Output_data_got::reserve_slot_for_global): New function.
6614 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6615 (Output_data_got::add_got_entry): New function.
6616 (Output_data_got::add_got_entry_pair): New function.
6617 (Output_data_got::free_list_): New data member.
6618 * target.h (Sized_target::init_got_plt_for_update): New function.
6619 (Sized_target::register_global_plt_entry): New function.
6620 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6621 Initialize new data member; call init; add constructor with PLT count.
6622 (Output_data_plt_x86_64::init): New function.
6623 (Output_data_plt_x86_64::add_relocation): New function.
6624 (Output_data_plt_x86_64::reserve_slot): New function.
6625 (Output_data_plt_x86_64::free_list_): New data member.
6626 (Target_x86_64::init_got_plt_for_update): New function.
6627 (Target_x86_64::register_global_plt_entry): New function.
6628 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6629 incremental updates.
6630 (Output_data_plt_x86_64::add_relocation): New function.
6631 * testsuite/object_unittest.cc (Object_test): Set default options.
6632
ec69d6da
ILT
66332011-05-16 Ian Lance Taylor <iant@google.com>
6634
6635 * options.h (class General_options): Make -i a synonym for -r.
6636
732e31de
ILT
66372011-05-16 Ian Lance Taylor <iant@google.com>
6638
6639 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6640
403676b5
CC
66412011-05-10 Cary Coutant <ccoutant@google.com>
6642
6643 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6644 strip_all (-s).
6645
5b7b7d6e
ILT
66462011-05-06 Ian Lance Taylor <iant@google.com>
6647
6648 * layout.cc (Layout::layout): If the output section flags change,
6649 update the ordering.
6650
f0f9babf
CC
66512011-04-25 Cary Coutant <ccoutant@google.com>
6652
6653 * incremental-dump.cc (dump_incremental_inputs): Print local
6654 symbol info for each input file.
6655 * incremental.cc
6656 (Output_section_incremental_inputs::set_final_data_size): Add local
6657 symbol info to input file entries in incremental info.
6658 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6659 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6660 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6661 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6662 implementation.
6663 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6664 (Sized_incr_relobj::do_relocate): Write the local symbols.
6665 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6666 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6667 Adjust size of input file header.
6668 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6669 (Incremental_inputs_reader::get_local_symbol_count): New function.
6670 (Incremental_inputs_reader::get_input_section): Adjust size of input
6671 file header.
6672 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6673 (Sized_incr_relobj::This): New typedef.
6674 (Sized_incr_relobj::sym_size): New const data member.
6675 (Sized_incr_relobj::Local_symbol): New struct.
6676 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6677 (Sized_incr_relobj::do_local_symbol_offset): New function.
6678 (Sized_incr_relobj::local_symbol_count_): New data member.
6679 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6680 (Sized_incr_relobj::local_symbol_index_): New data member.
6681 (Sized_incr_relobj::local_symbol_offset_): New data member.
6682 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6683 (Sized_incr_relobj::local_symbols_): New data member.
6684 * object.h (Relobj::output_local_symbol_count): New function.
6685 (Relobj::local_symbol_offset): New function.
6686 (Relobj::do_output_local_symbol_count): New function.
6687 (Relobj::do_local_symbol_offset): New function.
6688 (Sized_relobj::do_output_local_symbol_count): New function.
6689 (Sized_relobj::do_local_symbol_offset): New function.
6690
d0a9ace3
ILT
66912011-04-22 Vladimir Simonov <sv@sw.ru>
6692
6693 * descriptors.cc (set_close_on_exec): New function.
6694 (Descriptors::open): Use set_close_on_exec.
6695 * output.cc (S_ISLNK): Define if not defined.
6696
94a3fc8b
CC
66972011-04-22 Cary Coutant <ccoutant@google.com>
6698
6699 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6700 global symbol map.
6701 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6702 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6703 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6704 relocations.
6705 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6706 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6707 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6708 * incremental.h
6709 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6710 function.
6711 (Incremental_binary::apply_incremental_relocs): New function.
6712 (Incremental_binary::do_apply_incremental_relocs): New function.
6713 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6714 data member.
6715 (Sized_incremental_binary::add_global_symbol): New function.
6716 (Sized_incremental_binary::global_symbol): New function.
6717 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6718 (Sized_incremental_binary::symbol_map_): New data member.
6719 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6720 * target.h (Sized_target::apply_relocation): New function.
6721 * target-reloc.h (apply_relocation): New function.
6722 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6723
c87e4302
DK
67242011-04-22 Doug Kwan <dougkwan@google.com>
6725
6726 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6727 flag of a SHT_ARM_EXIDX section.
2e702c99 6728 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6729 * testsuite/Makefile.in: Regenerate.
6730 * testsuite/arm_exidx_test.s: New file.
6731 * testsuite/arm_exidx_test.sh: Same.
6732
e7782cf6
CC
67332011-04-20 Cary Coutant <ccoutant@google.com>
6734
6735 PR gold/12689
6736 * archive.h (Incremental_archive_entry::Archive_member):
6737 Initialize arg_serial_ (second constructor).
6738
308ecdc7
ILT
67392011-04-17 Ian Lance Taylor <iant@google.com>
6740
6741 * object.cc (Relocate_info::location): Simplify location string.
6742 * errors.cc (Errors::error_at_location): Don't print program
6743 name.
6744 (Errors::warning_at_location): Likewise.
6745 (Errors::undefined_symbol): Likewise.
6746 * testsuite/debug_msg.sh: Update accordingly.
6747
bec5b579
CC
67482011-04-14 Cary Coutant <ccoutant@google.com>
6749
6750 * gold/layout.cc (Layout::symtab_section_offset): New function.
6751 * gold/layout.h (Layout::symtab_section_offset): New function.
6752 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6753
88597d34
ILT
67542011-04-12 Ian Lance Taylor <iant@google.com>
6755
6756 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6757 with MREMAP_MAYMOVE.
6758 * output.h (class Output_file): Add map_is_allocated_ field.
6759 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6760 not available, provide stubs. If mremap is not available, #define
6761 it to gold_mremap.
6762 (MREMAP_MAYMOVE): Define if not defined.
6763 (Output_file::Output_file): Initialize map_is_allocated_.
6764 (Output_file::resize): Check map_is_allocated_.
6765 (Output_file::map_anonymous): If mmap fails, use malloc.
6766 (Output_file::unmap): Don't do anything for an anonymous map.
6767 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6768 is not available, provide stubs.
6769 (File_read::View::~View): Use free rather than delete[].
6770 (File_read::make_view): Use malloc rather than new[]. If mmap
6771 fails, use malloc.
6772 (File_read::find_or_make_view): Use malloc rather than new[].
6773 * gold.h: Remove HAVE_REMAP code.
6774 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6775 exists. Rename mremap to gold_mremap. If mmap is not available
6776 don't do anything.
6777 * configure, config.in: Rebuild.
6778
11e361bc
ILT
67792011-04-11 Ian Lance Taylor <iant@google.com>
6780
6781 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6782 initialize local variable v.
6783
cdc29364
CC
67842011-04-11 Cary Coutant <ccoutant@google.com>
6785
6786 * archive.cc (Archive::include_member): Adjust call to
6787 report_object.
6788 (Add_archive_symbols::run): Track argument serial numbers.
6789 (Lib_group::include_member): Likewise.
6790 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6791 * archive.h (Incremental_archive_entry::Archive_member):
6792 Initialize arg_serial_.
6793 (Archive_member::arg_serial_): New data member.
6794 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6795 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6796 incremental link.
6797 (Sized_dynobj::do_for_all_local_got_entries): New function.
6798 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6799 function.
6800 * fileread.cc (get_mtime): New function.
6801 * fileread.h (get_mtime): New function.
6802 * gold.cc (queue_initial_tasks): Check for incremental update.
6803 (process_incremental_input): New function.
6804 (queue_middle_tasks): Don't force valid target for incremental
6805 update.
6806 * incremental-dump.cc (find_input_containing_global): Adjust
6807 size of symbol info entry.
6808 (dump_incremental_inputs): Dump argument serial number and
6809 in_system_directory flag; bias shndx by 1; print symbol names
6810 when dumping per-file symbol lists; use new symbol info readers.
6811 * incremental.cc
6812 (Output_section_incremental_inputs:update_data_size): New function.
6813 (Sized_incremental_binary::setup_readers): Setup input readers
6814 for each input file; build maps for files added from libraries
6815 and scripts.
6816 (Sized_incremental_binary::check_input_args): New function.
6817 (Sized_incremental_binary::do_check_inputs): Build map of argument
6818 serial numbers to input arguments.
6819 (Sized_incremental_binary::do_file_has_changed): Rename
6820 do_file_is_unchanged to this; compare file modification times.
6821 (Sized_incremental_binary::do_init_layout): New function.
6822 (Sized_incremental_binary::do_reserve_layout): New function.
6823 (Sized_incremental_binary::do_get_input_reader): Remove.
6824 (Sized_incremental_binary::get_symtab_view): New function.
6825 (Incremental_checker::can_incrementally_link_output_file): Remove.
6826 (Incremental_inputs::report_command_line): Exclude --debug options.
6827 (Incremental_inputs::report_archive_begin): Add parameter; track
6828 argument serial numbers; don't put input file entry for archive
6829 before archive members.
6830 (Incremental_inputs::report_archive_end): Put input file entry
6831 for archive after archive members.
6832 (Incremental_inputs::report_object): Add parameter; track argument
6833 serial numbers and in_system_directory flag.
6834 (Incremental_inputs::report_script): Add parameter; track argument
6835 serial numbers.
6836 (Output_section_incremental_inputs::set_final_data_size): Adjust
6837 size of symbol info entry; check for forwarding symbols.
6838 (Output_section_incremental_inputs::write_input_files): Write
6839 in_system_directory flag and argument serial number.
6840 (Output_section_incremental_inputs::write_info_blocks): Map section
6841 indices between incremental info and original input file; store
6842 input section index for each symbol.
6843 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6844 change operator() to visit().
6845 (class Global_got_offset_visitor): Likewise.
6846 (class Global_symbol_visitor_got_plt):
6847 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6848 classes.
6849 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6850 (Sized_incr_relobj::do_read_symbols): New function.
6851 (Sized_incr_relobj::do_layout): New function.
6852 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6853 (Sized_incr_relobj::do_add_symbols): New function.
6854 (Sized_incr_relobj::do_should_include_member): New function.
6855 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6856 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6857 (Sized_incr_relobj::do_section_size): New function.
6858 (Sized_incr_relobj::do_section_name): New function.
6859 (Sized_incr_relobj::do_section_contents): New function.
6860 (Sized_incr_relobj::do_section_flags): New function.
6861 (Sized_incr_relobj::do_section_entsize): New function.
6862 (Sized_incr_relobj::do_section_address): New function.
6863 (Sized_incr_relobj::do_section_type): New function.
6864 (Sized_incr_relobj::do_section_link): New function.
6865 (Sized_incr_relobj::do_section_info): New function.
6866 (Sized_incr_relobj::do_section_addralign): New function.
6867 (Sized_incr_relobj::do_initialize_xindex): New function.
6868 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6869 (Sized_incr_relobj::do_read_relocs): New function.
6870 (Sized_incr_relobj::do_gc_process_relocs): New function.
6871 (Sized_incr_relobj::do_scan_relocs): New function.
6872 (Sized_incr_relobj::do_count_local_symbols): New function.
6873 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6874 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6875 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6876 (Sized_incr_relobj::do_relocate): New function.
6877 (Sized_incr_relobj::do_set_section_offset): New function.
6878 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6879 (Sized_incr_dynobj::do_read_symbols): New function.
6880 (Sized_incr_dynobj::do_layout): New function.
6881 (Sized_incr_dynobj::do_add_symbols): New function.
6882 (Sized_incr_dynobj::do_should_include_member): New function.
6883 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6884 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6885 (Sized_incr_dynobj::do_section_size): New function.
6886 (Sized_incr_dynobj::do_section_name): New function.
6887 (Sized_incr_dynobj::do_section_contents): New function.
6888 (Sized_incr_dynobj::do_section_flags): New function.
6889 (Sized_incr_dynobj::do_section_entsize): New function.
6890 (Sized_incr_dynobj::do_section_address): New function.
6891 (Sized_incr_dynobj::do_section_type): New function.
6892 (Sized_incr_dynobj::do_section_link): New function.
6893 (Sized_incr_dynobj::do_section_info): New function.
6894 (Sized_incr_dynobj::do_section_addralign): New function.
6895 (Sized_incr_dynobj::do_initialize_xindex): New function.
6896 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6897 (make_sized_incremental_object): New function.
6898 (Incremental_library::copy_unused_symbols): New function.
6899 (Incremental_library::do_for_all_unused_symbols): New function.
6900 * incremental.h (enum Incremental_input_flags): New type.
6901 (class Incremental_checker): Remove.
6902 (Incremental_input_entry::Incremental_input_entry): Add argument
6903 serial number.
6904 (Incremental_input_entry::arg_serial): New function.
6905 (Incremental_input_entry::set_is_in_system_directory): New function.
6906 (Incremental_input_entry::is_in_system_directory): New function.
6907 (Incremental_input_entry::arg_serial_): New data member.
6908 (Incremental_input_entry::is_in_system_directory_): New data member.
6909 (class Script_info): Move here from script.h.
6910 (Script_info::Script_info): Add filename parameter.
6911 (Script_info::filename): New function.
6912 (Script_info::filename_): New data member.
6913 (Incremental_script_entry::Incremental_script_entry): Add argument
6914 serial number.
6915 (Incremental_object_entry::Incremental_object_entry): Likewise.
6916 (Incremental_object_entry::add_input_section): Build list of input
6917 sections with map to original shndx.
6918 (Incremental_object_entry::get_input_section_index): New function.
6919 (Incremental_object_entry::shndx_): New data member.
6920 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6921 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6922 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6923 serial number.
6924 (Incremental_inputs::report_archive_begin): Likewise.
6925 (Incremental_inputs::report_object): Likewise.
6926 (Incremental_inputs::report_script): Likewise.
6927 (class Incremental_global_symbol_reader): New class.
6928 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6929 and store flags and input file type.
6930 (Incremental_input_entry_reader::arg_serial): New function.
6931 (Incremental_input_entry_reader::type): Extract type from flags.
6932 (Incremental_input_entry_reader::is_in_system_directory): New function.
6933 (Incremental_input_entry_reader::get_input_section_count): Call
6934 accessor function for type.
6935 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6936 function for type; adjust size of global symbol entry.
6937 (Incremental_input_entry_reader::get_global_symbol_count): Call
6938 accessor function for type.
6939 (Incremental_input_entry_reader::get_object_count): Likewise.
6940 (Incremental_input_entry_reader::get_object_offset): Likewise.
6941 (Incremental_input_entry_reader::get_member_count): Likewise.
6942 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6943 (Incremental_input_entry_reader::get_member_offset): Likewise.
6944 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6945 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6946 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6947 (Incremental_input_entry_reader::get_global_symbol_reader): New
6948 function.
6949 (Incremental_input_entry_reader::get_output_symbol_index): New
6950 function.
6951 (Incremental_input_entry_reader::type_): Remove.
6952 (Incremental_input_entry_reader::flags_): New data member.
6953 (Incremental_inputs_reader::input_file_offset): New function.
6954 (Incremental_inputs_reader::input_file_index): New function.
6955 (Incremental_inputs_reader::input_file): Call input_file_offset.
6956 (Incremental_inputs_reader::input_file_at_offset): New function.
6957 (Incremental_relocs_reader::get_r_type): Reformat.
6958 (Incremental_relocs_reader::get_r_shndx): Reformat.
6959 (Incremental_relocs_reader::get_r_offset): Reformat.
6960 (Incremental_relocs_reader::data): New function.
6961 (Incremental_binary::Incremental_binary): Initialize new data members.
6962 (Incremental_binary::check_inputs): Add cmdline parameter.
6963 (Incremental_binary::file_is_unchanged): Remove.
6964 (Input_reader::arg_serial): New function.
6965 (Input_reader::get_unused_symbol_count): New function.
6966 (Input_reader::get_unused_symbol): New function.
6967 (Input_reader::do_arg_serial): New function.
6968 (Input_reader::do_get_unused_symbol_count): New function.
6969 (Input_reader::do_get_unused_symbol): New function.
6970 (Incremental_binary::input_file_count): New function.
6971 (Incremental_binary::get_input_reader): Change signature to use
6972 index instead of filename.
6973 (Incremental_binary::file_has_changed): New function.
6974 (Incremental_binary::get_input_argument): New function.
6975 (Incremental_binary::get_library): New function.
6976 (Incremental_binary::get_script_info): New function.
6977 (Incremental_binary::init_layout): New function.
6978 (Incremental_binary::reserve_layout): New function.
6979 (Incremental_binary::output_file): New function.
6980 (Incremental_binary::do_check_inputs): New function.
6981 (Incremental_binary::do_file_is_unchanged): Remove.
6982 (Incremental_binary::do_file_has_changed): New function.
6983 (Incremental_binary::do_init_layout): New function.
6984 (Incremental_binary::do_reserve_layout): New function.
6985 (Incremental_binary::do_input_file_count): New function.
6986 (Incremental_binary::do_get_input_reader): Change signature.
6987 (Incremental_binary::input_args_map_): New data member.
6988 (Incremental_binary::library_map_): New data member.
6989 (Incremental_binary::script_map_): New data member.
6990 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6991 new data members.
6992 (Sized_incremental_binary::output_section): New function.
6993 (Sized_incremental_binary::inputs_reader): Add const.
6994 (Sized_incremental_binary::symtab_reader): Add const.
6995 (Sized_incremental_binary::relocs_reader): Add const.
6996 (Sized_incremental_binary::got_plt_reader): Add const.
6997 (Sized_incremental_binary::get_symtab_view): New function.
6998 (Sized_incremental_binary::Inputs_reader): New typedef.
6999 (Sized_incremental_binary::Input_entry_reader): New typedef.
7000 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7001 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7002 (Sized_incremental_binary::do_file_has_changed): New function.
7003 (Sized_incremental_binary::do_init_layout): New function.
7004 (Sized_incremental_binary::do_reserve_layout): New function.
7005 (Sized_input_reader::Inputs_reader): Remove.
7006 (Sized_input_reader::Input_entry_reader): Remove.
7007 (Sized_input_reader::do_arg_serial): New function.
7008 (Sized_input_reader::do_get_unused_symbol_count): New function.
7009 (Sized_input_reader::do_get_unused_symbol): New function.
7010 (Sized_incremental_binary::do_input_file_count): New function.
7011 (Sized_incremental_binary::do_get_input_reader): Change signature;
7012 use index instead of filename.
7013 (Sized_incremental_binary::section_map_): New data member.
7014 (Sized_incremental_binary::input_entry_readers_): New data member.
7015 (class Sized_incr_relobj): New class.
7016 (class Sized_incr_dynobj): New class.
7017 (make_sized_incremental_object): New function.
7018 (class Incremental_library): New class.
7019 * layout.cc (Free_list::num_lists): New static data member.
7020 (Free_list::num_nodes): New static data member.
7021 (Free_list::num_removes): New static data member.
7022 (Free_list::num_remove_visits): New static data member.
7023 (Free_list::num_allocates): New static data member.
7024 (Free_list::num_allocate_visits): New static data member.
7025 (Free_list::init): New function.
7026 (Free_list::remove): New function.
7027 (Free_list::allocate): New function.
7028 (Free_list::dump): New function.
7029 (Free_list::print_stats): New function.
7030 (Layout_task_runner::run): Resize output file for incremental updates.
7031 (Layout::Layout): Initialize new data members.
7032 (Layout::set_incremental_base): New function.
7033 (Layout::init_fixed_output_section): New function.
7034 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7035 incremental updates.
7036 (Layout::create_gold_note): Do not create gold note section for
7037 incremental updates.
7038 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7039 for incremental updates.
7040 (Layout::set_section_offsets): For incremental updates, allocate space
7041 from free list.
7042 (Layout::create_symtab_sections): Layout with offsets relative to
7043 start of section; for incremental updates, allocate space from free
7044 list.
7045 (Layout::create_shdrs): For incremental updates, allocate space from
7046 free list.
7047 (Layout::finish_dynamic_section): For incremental updates, do not
7048 check --as-needed (fixed in subsequent patch).
7049 * layout.h (class Free_list): New class.
7050 (Layout::set_incremental_base): New function.
7051 (Layout::incremental_base): New function.
7052 (Layout::init_fixed_output_section): New function.
7053 (Layout::allocate): New function.
7054 (Layout::incremental_base_): New data member.
7055 (Layout::free_list_): New data member.
7056 * main.cc (main): Print Free_list statistics.
7057 * object.cc (Relobj::finalize_incremental_relocs): Add
7058 clear_counts parameter; clear counts only when clear_counts is set.
7059 (Sized_relobj::Sized_relobj): Initialize new base class.
7060 (Sized_relobj::do_layout): Don't report special sections.
7061 (Sized_relobj::do_for_all_local_got_entries): New function.
7062 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7063 symtab_off to all symbol table offsets.
7064 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7065 * object.h (class Got_offset_list): Move to top of file.
7066 (Object::Object): Allow case where input_file == NULL.
7067 (Object::~Object): Likewise.
7068 (Object::input_file): Assert that input_file != NULL.
7069 (Object::lock): Allow case where input_file == NULL.
7070 (Object::unlock): Likewise.
7071 (Object::is_locked): Likewise.
7072 (Object::token): Likewise.
7073 (Object::release): Likewise.
7074 (Object::is_incremental): New function.
7075 (Object::get_mtime): New function.
7076 (Object::for_all_local_got_entries): New function.
7077 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7078 (Object::set_is_in_system_directory): New function.
7079 (Object::is_in_system_directory): New function.
7080 (Object::do_is_incremental): New function.
7081 (Object::do_get_mtime): New function.
7082 (Object::do_for_all_local_got_entries): New function.
7083 (Object::is_in_system_directory_): New data member.
7084 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7085 (class Sized_relobj_base): New class.
7086 (class Sized_relobj): Derive from Sized_relobj_base.
7087 (class Sized_relobj::Symbols): Redeclare from base class.
7088 (class Sized_relobj::local_got_offset_list): Remove.
7089 (class Sized_relobj::Output_sections): Redeclare from base class.
7090 (class Sized_relobj::do_for_all_local_got_entries): New function.
7091 (class Sized_relobj::write_local_symbols): Add offset parameter.
7092 (class Sized_relobj::local_symbol_offset_): Update comment.
7093 (class Sized_relobj::local_dynsym_offset_): Update comment.
7094 * options.cc (Input_arguments::add_file): Remove const.
7095 * options.h (Input_file_argument::Input_file_argument):
7096 Initialize arg_serial_ (all constructors).
7097 (Input_file_argument::set_arg_serial): New function.
7098 (Input_file_argument::arg_serial): New function.
7099 (Input_file_argument::arg_serial_): New data member.
7100 (Input_arguments::Input_arguments): Initialize file_count_.
7101 (Input_arguments::add_file): Remove const.
7102 (Input_arguments::number_of_input_files): New function.
7103 (Input_arguments::file_count_): New data member.
7104 (Command_line::number_of_input_files): Call
7105 Input_arguments::number_of_input_files.
7106 * output.cc (Output_segment_headers::Output_segment_headers):
7107 Set current size.
7108 (Output_section::Input_section::current_data_size): New function.
7109 (Output_section::Output_section): Initialize new data members.
7110 (Output_section::add_input_section): Don't do merge sections for
7111 an incremental link; allocate space from free list for an
7112 incremental update.
7113 (Output_section::add_output_section_data): Allocate space from
7114 free list for an incremental update.
7115 (Output_section::update_data_size): New function.
7116 (Output_section::set_fixed_layout): New function.
7117 (Output_section::reserve): New function.
7118 (Output_segment::set_section_addresses): Remove const.
7119 (Output_segment::set_section_list_addresses): Remove const; allocate
7120 space from free list for an incremental update.
7121 (Output_segment::set_offset): Adjust size of RELRO segment for an
7122 incremental update.
7123 * output.h (Output_data::current_data_size): Move here from
7124 child classes.
7125 (Output_data::pre_finalize_data_size): New function.
7126 (Output_data::update_data_size): New function.
7127 (Output_section_headers::update_data_size): new function.
7128 (Output_section_data_build::current_data_size): Move to Output_data.
7129 (Output_data_strtab::update_data_size): New function.
7130 (Output_section::current_data_size): Move to Output_data.
7131 (Output_section::set_fixed_layout): New function.
7132 (Output_section::has_fixed_layout): New function.
7133 (Output_section::reserve): New function.
7134 (Output_section::update_data_size): New function.
7135 (Output_section::has_fixed_layout_): New data member.
7136 (Output_section::free_list_): New data member.
7137 (Output_segment::set_section_addresses): Remove const.
7138 (Output_segment::set_section_list_addresses): Remove const.
7139 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7140 New function.
7141 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7142 New function.
7143 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7144 parameter when calling Add_symbols constructor; store argument
7145 serial number for members of a lib group.
7146 (Add_symbols::locks): Allow case where token == NULL.
7147 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7148 (Read_member::~Read_member): New function.
7149 (Read_member::is_runnable): New function.
7150 (Read_member::locks): New function.
7151 (Read_member::run): New function.
7152 (Check_script::~Check_script): New function.
7153 (Check_script::is_runnable): New function.
7154 (Check_script::locks): New function.
7155 (Check_script::run): New function.
7156 (Check_library::~Check_library): New function.
7157 (Check_library::is_runnable): New function.
7158 (Check_library::locks): New function.
7159 (Check_library::run): New function.
7160 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7161 (Add_symbols::library_): New data member.
7162 (class Read_member): New class.
7163 (class Check_script): New class.
7164 (class Check_library): New class.
7165 * reloc.cc (Read_relocs::is_runnable): Allow case where
7166 token == NULL.
7167 (Read_relocs::locks): Likewise.
7168 (Scan_relocs::locks): Likewise.
7169 (Relocate_task::locks): Likewise.
7170 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7171 to clear counters.
7172 (Sized_relobj::incremental_relocs_scan): Fix comment.
7173 (Sized_relobj::do_relocate): Pass output file offset to
7174 write_local_symbols.
7175 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7176 from class declaration.
7177 * script.cc (read_input_script): Allocate Script_info; pass
7178 argument serial number to report_script.
7179 * script.h (class Script_info): Move to incremental.h.
7180 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7181 * symtab.h (Symbol_table::add_from_incrobj): New function.
7182 (Symbol_table::set_file_offset): New function.
7183
b961d0d7
CC
71842011-04-05 Cary Coutant <ccoutant@google.com>
7185
7186 * incremental-dump.cc (dump_incremental_inputs): Change signature
7187 to take a Sized_incremental_binary; change caller. Use readers
7188 in Sized_incremental_binary.
7189 * incremental.cc
7190 (Sized_incremental_binary::find_incremental_inputs_sections):
7191 Rename do_find_incremental_inputs_sections to this.
7192 (Sized_incremental_binary::setup_readers): New function.
7193 (Sized_incremental_binary::do_check_inputs): Check
7194 has_incremental_info_ flag; move setup code to setup_readers;
7195 use input readers.
7196 (Sized_incremental_binary::do_file_is_unchanged): New function.
7197 (Sized_incremental_binary::do_get_input_reader): New function.
7198 * incremental.h (class Incremental_binary): Move to end of file.
7199 (Incremental_binary::file_is_unchanged): New function.
7200 (Incremental_binary::do_file_is_unchanged): New function.
7201 (Incremental_binary::Input_reader): New class.
7202 (Incremental_binary::get_input_reader): New function.
7203 (class Sized_incremental_binary): Move to end of file.
7204 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7205 input section reader classes.
7206 (Sized_incremental_binary::has_incremental_info): New function.
7207 (Sized_incremental_binary::inputs_reader): New function.
7208 (Sized_incremental_binary::symtab_reader): New function.
7209 (Sized_incremental_binary::relocs_reader): New function.
7210 (Sized_incremental_binary::got_plt_reader): New function.
7211 (Sized_incremental_binary::do_file_is_unchanged): New function.
7212 (Sized_incremental_binary::Sized_input_reader): New class.
7213 (Sized_incremental_binary::get_input_reader): New function.
7214 (Sized_incremental_binary::find_incremental_inputs_sections):
7215 Rename do_find_incremental_inputs_sections to this.
7216 (Sized_incremental_binary::setup_readers): New function.
7217 (Sized_incremental_binary::has_incremental_info_): New data member.
7218 (Sized_incremental_binary::inputs_reader_): New data member.
7219 (Sized_incremental_binary::symtab_reader_): New data member.
7220 (Sized_incremental_binary::relocs_reader_): New data member.
7221 (Sized_incremental_binary::got_plt_reader_): New data member.
7222 (Sized_incremental_binary::current_input_file_): New data member.
7223
a869183f
PP
72242011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7225
7226 PR gold/12640
7227 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7228 violation.
7229
72302011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7231
7232 * archive.cc (Archive::include_member): Adjust call to report_object.
7233 (Add_archive_symbols::run): Add script_info to call to
7234 report_archive_begin.
7235 (Lib_group::include_member): Adjust call to report_object.
7236 (Add_lib_group_symbols::run): Adjust call to report_object.
7237 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7238 blocks. Add object count for script input files.
7239 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7240 script_info parameter; change all callers.
7241 (Incremental_inputs::report_object): Add script_info parameter;
7242 change all callers.
7243 (Incremental_inputs::report_script): Store backpointer to
7244 incremental info entry.
7245 (Output_section_incremental_inputs::set_final_data_size): Record
7246 additional information for scripts.
7247 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7248 * incremental.h (Incremental_script_entry::add_object): New function.
7249 (Incremental_script_entry::get_object_count): New function.
7250 (Incremental_script_entry::get_object): New function.
7251 (Incremental_script_entry::objects_): New data member; adjust
7252 constructor.
7253 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7254 (Incremental_inputs::report_object): Add script_info parameter.
7255 (Incremental_inputs_reader::get_object_count): New function.
7256 (Incremental_inputs_reader::get_object_offset): New function.
7257 * options.cc (Input_arguments::add_file): Return reference to
7258 new input argument.
7259 * options.h (Input_argument::set_script_info): New function.
7260 (Input_argument::script_info): New function.
7261 (Input_argument::script_info_): New data member; adjust all
7262 constructors.
7263 (Input_file_group::add_file): Return reference to new input argument.
7264 (Input_file_lib::add_file): Likewise.
7265 (Input_arguments::add_file): Likewise.
7266 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7267 * script.cc (Parser_closure::Parser_closure): Add script_info
7268 parameter; adjust all callers.
7269 (Parser_closure::script_info): New function.
7270 (Parser_closure::script_info_): New data member.
7271 (read_input_script): Report scripts earlier to incremental info.
7272 (script_add_file): Set script_info in Input_argument.
7273 (script_add_library): Likewise.
7274 * script.h (Script_options::Script_info): Rewrite class.
7275
a869183f 72762011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7277
7278 * archive.cc (Library_base::should_include_member): Move
7279 method here from class Archive.
7280 (Archive::Archive): Initialize base class.
7281 (Archive::should_include_member): Move to base class.
7282 (Archive::do_for_all_unused_symbols): New function.
7283 (Add_archive_symbols::run): Remove redundant access to
7284 incremental_inputs.
7285 (Lib_group::Lib_group): Initialize base class.
7286 (Lib_group::do_filename): New function.
7287 (Lib_group::include_member): Pass pointer to Lib_group to
7288 report_object.
7289 (Lib_group::do_for_all_unused_symbols): New function.
7290 (Add_lib_group_symbols::run): Report archive information for
7291 incremental links.
7292 * archive.h (class Library_base): New base class.
7293 (class Archive): Derive from Library_base.
7294 (Archive::filename): Move to base class.
7295 (Archive::set_incremental_info): Likewise.
7296 (Archive::incremental_info): Likewise.
7297 (Archive::Should_include): Likewise.
7298 (Archive::should_include_member): Likewise.
7299 (Archive::Armap_entry): Remove.
7300 (Archive::Unused_symbol_iterator): Remove.
7301 (Archive::unused_symbols_begin): Remove.
7302 (Archive::unused_symbols_end): Remove.
7303 (Archive::do_filename): New function.
7304 (Archive::do_get_mtime): New function.
7305 (Archive::do_for_all_unused_symbols): New function.
7306 (Archive::task_): Move to base class.
7307 (Archive::incremental_info_): Likewise.
7308 (class Lib_group): Derive from Library_base.
7309 (Lib_group::do_filename): New function.
7310 (Lib_group::do_get_mtime): New function.
7311 (Lib_group::do_for_all_unused_symbols): New function.
7312 (Lib_group::task_): Move to base class.
7313 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7314 function.
7315 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7316 function.
7317 * incremental.cc (Incremental_inputs::report_archive_begin):
7318 Use Library_base; call library's get_mtime; add incremental inputs
7319 entry before members.
7320 (class Unused_symbol_visitor): New class.
7321 (Incremental_inputs::report_archive_end): Use Library_base; use
7322 visitor class to record unused symbols; don't add incremental inputs
7323 entry after members.
7324 (Incremental_inputs::report_object): Use Library_base.
7325 * incremental.h
7326 (Incremental_archive_entry::Incremental_archive_entry): Remove
7327 unused Archive parameter.
7328 (Incremental_inputs::report_archive_begin): Use Library_base.
7329 (Incremental_inputs::report_archive_end): Likewise.
7330 (Incremental_inputs::report_object): Likewise.
7331 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7332 function.
7333 * object.h (Object::for_all_global_symbols): New function.
7334 (Object::do_for_all_global_symbols): New function.
7335 (Sized_relobj::do_for_all_global_symbols): New function.
7336 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7337 function.
7338 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7339 function.
7340
61ab3e40
ILT
73412011-03-27 Ian Lance Taylor <iant@google.com>
7342
7343 * archive.cc (Archive::interpret_header): Return -1 if something
7344 goes wrong. Change callers accordingly.
7345
30e1f9e6
CC
73462011-03-25 Cary Coutant <ccoutant@google.com>
7347
7348 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7349 * testsuite/Makefile.in: Regenerate.
7350
9370ce59 73512011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7352
7353 * plugin.cc (get_view): New.
7354 (Plugin::load): Pass get_view to the plugin.
7355 (Plugin_manager::get_view): New.
7356
9312bb0a
ILT
73572011-03-21 Ian Lance Taylor <iant@google.com>
7358
7359 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7360 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7361
7e12ba9e
ST
73622011-03-21 Sriraman Tallam <tmsriram@google.com>
7363
7364 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7365 Change == to -eq.
7366 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7367 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7368 Change == to -eq.
7369 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7370 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7371
fd7a005d
ILT
73722011-03-14 Ian Lance Taylor <iant@google.com>
7373
7374 * script-sections.cc (Sort_output_sections::script_compare):
7375 Rename from is_before, change return type.
7376 (Sort_output_sections::operator()): Adjust accordingly.
7377
ed16fd1b
ILT
73782011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7379
7380 PR gold/12572
7381 * testsuite/odr_violation2.cc: Add comment to make all error line
7382 numbers double digits.
7383 * testsuite/debug_msg.sh: Adjust expected errors.
7384
71ff8986
ILT
73852011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7386
7387 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7388 but mark earlier ones as non-canonical
7389 (offset_to_iterator): Update search target and example
7390 (do_addr2line): Return extra lines in a vector*
7391 (format_file_lineno): Extract from do_addr2line
7392 (one_addr2line): Add vector* out-param
7393 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7394 when a lineno entry appeared last for its instruction
7395 (Dwarf_line_info): Add vector* out-param
7396 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7397 * symtab.cc (Odr_violation_compare): Include the lineno in the
7398 comparison again.
7399 (linenos_from_loc): New. Combine the canonical line for an
7400 address with its other lines.
7401 (True_if_intersect): New. Helper functor to make
7402 std::set_intersection a query.
7403 (detect_odr_violations): Compare sets of lines instead of just
7404 one line for each function. This became less deterministic, but
7405 has fewer false positives.
7406 * symtab.h: Declarations.
7407 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7408 mix an optimized and non-optimized object in the same binary
7409 (odr_violation2.so): Same.
7410 * testsuite/Makefile.in: Regenerate from Makefile.am.
7411 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7412 * testsuite/debug_msg.sh: Update line numbers and add
7413 assertions.
7414 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7415 non-optimized context.
7416 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7417 isn't inlined, and use OdrDerived in an optimized context.
7418 * testsuite/odr_header1.h: Defines OdrDerived, where
7419 optimization will change the
7420 first-instruction-in-the-destructor's file and line number.
7421 * testsuite/odr_header2.h: Defines OdrBase.
7422
a19fefdc
ILT
74232011-03-09 Ian Lance Taylor <iant@google.com>
7424
7425 * fileread.cc (File_read::clear_views): Don't delete the whole
7426 file view.
7427
ecb351e9
ILT
74282011-03-08 Ian Lance Taylor <iant@google.com>
7429
7430 PR gold/12525
7431 * fileread.cc: #include <climits>.
7432 (GOLD_IOV_MAX): Define.
7433 (File_read::read_multiple): Limit number of entries by iov_max.
7434 * fileread.h (class File_read): Always set max_readv_entries to
7435 128.
7436
b821d13c
ILT
74372011-03-07 Ian Lance Taylor <iant@google.com>
7438
7439 PR gold/12525
7440 * options.h (class General_options): Add -dy and -dn.
7441
89243142
CC
74422011-03-02 Cary Coutant <ccoutant@google.com>
7443
7444 * testsuite/script_test_9.t: Add TLS segment.
7445
d0773f31
ILT
74462011-03-02 Simon Baldwin <simonb@google.com>
7447
7448 * configure.ac: Add check for gnu_indirect_function support in
7449 the toolchain building binutils.
7450 * configure: Rebuild.
7451
9370ce59 74522011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7453
7454 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7455 plugin only symbols.
7456 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7457 in plugin files as not needed in the symbol table.
7458
4cf7a849
ST
74592011-02-11 Sriraman Tallam <tmsriram@google.com>
7460
7461 * output.cc (Output_section::add_input_section): Delay fill
7462 generation for section ordering.
7463
b578bd7d
ILT
74642011-02-09 Ian Lance Taylor <iant@google.com>
7465
7466 PR gold/12316
7467 * object.h (class Sized_relobj): Remove clear_local_symbols.
7468 * reloc.cc (Sized_relobj::do_relocate): Don't call
7469 clear_local_symbols.
7470
9370ce59 74712011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7472
7473 * plugin.cc (is_visible_from_outside): Return true for symbols
7474 in the -u option.
7475
55382fb7
ILT
74762011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7477
7478 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7479 filename.
7480
4e271fff
ST
74812011-02-02 Sriraman Tallam <tmsriram@google.com>
7482
7483 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7484 to std::string.
4e271fff 7485 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7486 section_name to be std::string.
4e271fff
ST
7487 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7488
d433c3ac
ILT
74892011-01-25 Ian Lance Taylor <iant@google.com>
7490
7491 * script.cc (script_add_extern): Rewrite to use
7492 add_symbol_reference.
7493
880473a6
DK
74942011-01-25 Doug Kwan <dougkwan@google.com>
7495
d433c3ac 7496 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7497
f30f86fa
ILT
74982011-01-24 Ian Lance Taylor <iant@google.com>
7499
7500 * options.h (class General_options): Accept
7501 --no-detect-odr-violations.
7502
8e51a0b9
ILT
75032011-01-24 Ian Lance Taylor <iant@google.com>
7504
7505 * version.cc (version_string): Bump to 1.11.
7506
0f3b89d8
ILT
75072011-01-24 Ian Lance Taylor <iant@google.com>
7508
7509 * plugin.cc (class Plugin_rescan): Define new class.
7510 (Plugin_manager::claim_file): Set any_claimed_.
7511 (Plugin_manager::save_archive): New function.
7512 (Plugin_manager::save_input_group): New function.
7513 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7514 necessary.
7515 (Plugin_manager::new_undefined_symbol): New function.
7516 (Plugin_manager::rescan): New function.
7517 (Plugin_manager::rescannable_defines): New function.
7518 (Plugin_manager::add_input_file): Set any_added_.
7519 * plugin.h (class Plugin_manager): define new fields rescannable_,
7520 undefined_symbols_, any_claimed_, and any_added_. Declare
7521 Plugin_rescan as friend. Declare new functions.
7522 (Plugin_manager::Rescannable): Define type.
7523 (Plugin_manager::Rescannable_list): Define type.
7524 (Plugin_manager::Undefined_symbol_list): Define type.
7525 (Plugin_manager::Plugin_manager): Initialize new fields.
7526 * archive.cc (Archive::defines_symbol): New function.
7527 (Add_archive_symbols::run): Pass archive to plugins if any.
7528 * archive.h (class Archive): Declare defines_symbol.
7529 * readsyms.cc (Input_group::~Input_group): New function.
7530 (Finish_group::run): Pass input_group to plugins if any.
7531 * readsyms.h (class Input_group): Declare destructor.
7532 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7533 any.
7534
3bb951e5
ILT
75352011-01-10 Ian Lance Taylor <iant@google.com>
7536
7537 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7538 section as relro.
7539 (Layout::set_segment_offsets): Reset increase_relro before calling
7540 set_section_addresses a second time.
7541
0aa45fac
CC
75422011-01-04 Cary Coutant <ccoutant@google.com>
7543
7544 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7545 sections before NOBITS sections.
7546
0db46eb4
L
75472011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7548
7549 * version.cc (print_version): Update copyright to 2011.
7550
829c9745
CC
75512010-12-23 Cary Coutant <ccoutant@google.com>
7552
7553 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7554 of OS to this->add. Add OD parameter to second form of the function.
7555
7500420b
ILT
75562010-12-20 Ian Lance Taylor <iant@google.com>
7557
7558 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7559 second of two consecutive entries with same offset.
7560
f8e9a930
RW
75612010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7562
7563 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7564 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7565 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7566 to avoid unneeded links against $(LDADD).
7567 * testsuite/Makefile.in: Regenerate.
7568
2fbb4320
ILT
75692010-12-15 Ian Lance Taylor <iant@google.com>
7570
7571 PR gold/12324
7572 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7573 for R_X86_64_32 and R_X86_64_PC32.
7574 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7575 ver_matching_def_pic.o.
7576 (ver_matching_def_pic.o): New target.
7577
fedb228d
RW
75782010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7579
7580 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7581 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7582 Move definition before File_read::View member definitions.
7583 (File_read::View::~View): Initialize and hold lock before
7584 updating current_mapped_bytes.
7585
9b547ce6
RW
75862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7587
7588 * dwarf_reader.cc: Remove outdated comment.
7589 * gold-threads.cc: Fix typo in error message.
7590 * archive.cc: Fix typos in comments.
7591 * archive.h: Likewise.
7592 * arm-reloc-property.cc: Likewise.
7593 * arm-reloc-property.h: Likewise.
7594 * arm-reloc.def: Likewise.
7595 * arm.cc: Likewise.
7596 * attributes.h: Likewise.
7597 * cref.cc: Likewise.
7598 * ehframe.cc: Likewise.
7599 * fileread.h: Likewise.
7600 * gold.h: Likewise.
7601 * i386.cc: Likewise.
7602 * icf.cc: Likewise.
7603 * incremental.h: Likewise.
7604 * int_encoding.cc: Likewise.
7605 * layout.h: Likewise.
7606 * main.cc: Likewise.
7607 * merge.h: Likewise.
7608 * object.cc: Likewise.
7609 * object.h: Likewise.
7610 * options.cc: Likewise.
7611 * readsyms.cc: Likewise.
7612 * reduced_debug_output.cc: Likewise.
7613 * reloc.cc: Likewise.
7614 * script-sections.cc: Likewise.
7615 * sparc.cc: Likewise.
7616 * symtab.h: Likewise.
7617 * target-reloc.h: Likewise.
7618 * target.cc: Likewise.
7619 * target.h: Likewise.
7620 * timer.cc: Likewise.
7621 * timer.h: Likewise.
7622 * x86_64.cc: Likewise.
7623
83e17bd5
CC
76242010-12-09 Cary Coutant <ccoutant@google.com>
7625
7626 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7627 stack.
7628 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7629 parameter; change all callers.
7630 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7631 * options.h (warn_execstack): New option.
7632
017257f8
DK
76332010-12-07 Doug Kwan <dougkwan@google.com>
7634
7635 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7636 like function call relocations.
7637
c20cbc06
ILT
76382010-12-07 Ian Lance Taylor <iant@google.com>
7639
7640 * archive.cc (Archive::get_elf_object_for_member): Permit
7641 punconfigured to be NULL.
7642 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7643 (Archive::include_member): Pass NULL to get_elf_object_for_member
7644 if we searched for the archive and this is the first included
7645 object.
7646
4dbfafcc
ILT
76472010-12-01 Ian Lance Taylor <iant@google.com>
7648
7649 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7650 track_relocs_type_ field.
7651 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7652 Set track_relocs_type_.
7653 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7654 contents when using RELA relocs.
7655 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7656 reloc_map_.
7657 * reloc.cc (Track_relocs::next_addend): New function.
7658 * reloc.h (class Track_relocs): Declare next_addend.
7659
e5e19edd
ILT
76602010-12-01 Ian Lance Taylor <iant@google.com>
7661
7662 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7663 virtual destructor.
7664
9a5ce24c
ILT
76652010-12-01 Ian Lance Taylor <iant@google.com>
7666
7667 * README: Update compilers known to work and fail.
7668
c7791212
NC
76692010-11-23 Matthias Klose <doko@ubuntu.com>
7670
7671 * configure.in: For --enable-gold, handle value `default' instead of
7672 `both*'. Always install ld as ld.bfd, install as ld if gold is
7673 not the default.
7674 * configure: Regenerate.
7675
0ad220c9
DK
76762010-11-18 Doug Kwan <dougkwan@google.com>
7677
7678 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7679 and right_alignment to be zero. Store result alignment only if it is
7680 greater than existing alignment.
7681
ab8056e0
CC
76822010-11-16 Cary Coutant <ccoutant@google.com>
7683
7684 PR gold/12220
7685 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7686 Check for ".zdebug_line".
7687
fd064a5b
CC
76882010-11-16 Doug Kwan <dougkwan@google.com>
7689 Cary Coutant <ccoutant@google.com>
7690
7691 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7692 by reference; adjust all callers.
7693 * output.cc (Output_segment::set_section_addresses): Adjust references
7694 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7695 list is empty.
7696 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7697 end at page boundary.
7698
6fc6ea19
CC
76992010-11-16 Cary Coutant <ccoutant@google.com>
7700
7701 PR gold/12220
7702 * layout.cc (Layout::choose_output_section): Transform names of
7703 compressed sections even when using a script with a SECTIONS clause.
7704 (Layout::output_section_name): Remove code to transform
7705 compressed debug section names.
7706 * output.cc (Output_section::add_input_section): Use uncompressed
7707 section size when tracking input sections.
7708
95a2c8d6
RS
77092010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7710
7711 * symtab.h (Symbol::NON_PIC_REF): Remove.
7712 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7713 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7714 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7715 (Symbol::use_plt_offset): Take a flags argument and pass it
7716 directly to needs_dynamic_reloc. Restrict check for undefined
7717 weak symbols to function calls.
7718 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7719 (Target_arm::Scan::global): Use it.
7720 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7721 (Target_arm::Relocate::relocate): Likewise.
7722 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7723 parameter with an r_type parameter. Use get_reference_flags
7724 to get the flags.
7725 (Target_arm::Relocate::relocate): Update accordingly.
7726 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7727 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7728 (Target_i386::Scan::global): Likewise.
7729 (Target_i386::Relocate::relocate): Likewise.
7730 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7731 parameter with an r_type parameter. Use get_reference_flags
7732 to get the flags.
7733 (Target_i386::Relocate::relocate): Update accordingly.
7734 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7735 (Target_powerpc::Scan::global): Use it.
7736 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7737 (Target_powerpc::Relocate::relocate): Likewise.
7738 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7739 (Target_sparc::Scan::global): Use it.
7740 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7741 (Target_sparc::Relocate::relocate): Likewise.
7742 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7743 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7744 (Target_x86_64::Scan::global): Likewise.
7745 (Target_x86_64::Relocate::relocate): Likewise.
7746
f625ae50
DK
77472010-11-08 Doug Kwan <dougkwan@google.com>
7748 Cary Coutant <ccoutant@google.com>
7749
7750 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7751 (Arm_exidx_merge_section::section_contents_): New data member.
7752 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7753 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7754 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7755 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7756 in parameters instead of calling Object::section_contents without
7757 locking.
7758 (Arm_output_section::group_section): New parameter TASK. Pass it
7759 to callees that need locking objects.
7760 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7761 to lock EXIDX input sections. Fix a formatting issue. Call
7762 Arm_exidx_merged_section::build_contents to create merged section
7763 contents.
7764 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7765 to lock object of stub table owner.
7766 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7767 TEXT_SIZE to initialize data member TEXT_SIZE_.
7768 (Arm_exidx_input_section::addralign): Fix typo in comment.
7769 (Arm_exidx_input_section::text_size): New method.
7770 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7771 that require locking objects. Lock objects before scanning for stubs
7772 and updating local symbols.
7773 (Arm_input_section<big_endian>::init): Copy contents of original
7774 input section.
2e702c99 7775 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7776 original input section instead of calling Object::section_contents
7777 without locking.
7778 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7779 size without calling Object::section_size().
7780 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7781 for size. Allocate a buffer for merged EXIDX entries.
7782 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7783 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7784 building code to Arm_exidx_merged_section::build_contetns. Write
7785 out contetns in buffer instead of building it on the fly.
7786 (Arm_relobj::make_exidx_input_section): Also pass text section size
7787 to Arm_exidx_input_section constructor.
7788 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7789 (Arm_dynobj::do_read_symbols): Fix memory leak.
7790 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7791 * target.h: (class Task): Add forward declaration.
7792 (Target::relax): Add new parameter TASK and pass it to
7793 Target::do_relax().
7794 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7795
5f9bcf58
CC
77962010-11-05 Cary Coutant <ccoutant@google.com>
7797
7798 PR gold/10708
7799 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7800 object when reading from the file.
7801 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7802 second layout pass.
7803 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7804 when reading section contents.
7805 (get_section_contents): Likewise.
7806 (icf::find_identical_sections): Likewise.
7807 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7808 object when reading from the file.
7809 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7810 the object when doing deferred section layout.
7811
e597fa08
NC
78122010-11-03 Nick Clifton <nickc@redhat.com>
7813
7814 PR gold/12001
7815 * script.h (class Symbol_assignment: name): New member. Returns
7816 the name of the symbol.
7817 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7818 Returns true if the given symbol name is on the list of
7819 assignments wating to be processed.
7820 * archive.cc (should_incldue_member): If the symbol is undefined,
7821 check to see if it is on the list of symbols pending assignment.
7822
3f9a3278
ILT
78232010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7824
7825 * script-sections.cc (Script_sections::find_memory_region): Check
7826 for a NULL output section pointer.
7827
d06fb4d1
DK
78282010-10-29 Doug Kwan <dougkwan@google.com>
7829
7830 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7831 Output_section::add_relaxed_input_section.
7832 * output.cc (Output_section::add_relaxed_input_section): Add new
7833 arguments LAYOUT and NAME. Set section order index.
7834 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7835 Copy section order index.
7836 * output.h (Output_section::add_relaxed_input_section): Add new
7837 arguments LAYOUT and NAME.
7838
90e24de5
ILT
78392010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7840
7841 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7842 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7843 * testsuite/Makefile.in: Regenerate.
7844
c9484ea5
DK
78452010-10-20 Doug Kwan <dougkwan@google.com>
7846
7847 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7848 without SHF_LINK_ORDER flags.
7849 * layout.cc (Layout::choose_output_section): Do not filter
7850 SHF_LINK_ORDER flag in a relocatable link.
7851
5bc2f5be
CC
78522010-10-17 Cary Coutant <ccoutant@google.com>
7853
7854 * output.h (Output_segment::set_section_addresses): Change function
7855 signature. Update all callers.
7856 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7857 sections.
7858 (Output_segment::set_section_addresses): Align after last TLS
7859 section. Add padding before last relro section instead of after.
7860
0c91cf04
DK
78612010-10-17 Doug Kwan <dougkwan@google.com>
7862
7863 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7864 GOT output section to be writable.
7865
8c21d9d3
CC
78662010-10-14 Cary Coutant <ccoutant@google.com>
7867
7868 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7869 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7870 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7871 mode.
7872 * incremental.cc (report_command_line): Ignore all forms of
7873 --incremental.
7874 * layout.cc (Layout::Layout): Check parameters for incremental link
7875 mode.
7876 * options.cc (General_options::parse_incremental): New function.
7877 (General_options::parse_no_incremental): New function.
7878 (General_options::parse_incremental_full): New function.
7879 (General_options::parse_incremental_update): New function.
7880 (General_options::incremental_mode_): New data member.
7881 (General_options::finalize): Check incremental_mode_.
7882 * options.h (General_options): Update help text for --incremental.
7883 Add --no-incremental, --incremental-full, --incremental-update.
7884 (General_options::Incremental_mode): New enum type.
7885 (General_options::incremental_mode): New function.
7886 (General_options::incremental_mode_): New data member.
7887 * parameters.cc (Parameters::incremental_mode_): New data member.
7888 (Parameters::set_options): Set incremental_mode_.
7889 (Parameters::set_incremental_full): New function.
7890 (Parameters::incremental): New function.
7891 (Parameters::incremental_update): New function.
7892 (set_parameters_incremental_full): New function.
7893 * parameters.h (Parameters::set_incremental_full): New function.
7894 (Parameters::incremental): New function.
7895 (Parameters::incremental_update): New function.
7896 (Parameters::incremental_mode_): New data member.
7897 (set_parameters_incremental_full): New function.
7898 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7899 incremental link mode.
7900 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7901 (Sized_relobj::do_relocate_sections): Likewise.
7902 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7903 option.
7904 * testsuite/Makefile.in: Regenerate.
7905 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7906
bb32aa18 79072010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7908
7909 * script-sections.h (class Script_sections): Make
7910 Sections_elements typedef public.
7911 * script-sections.cc (class Sort_output_sections): Add elements_
7912 field. Add constructor which sets it; change all callers.
7913 (Sort_output_sections::is_before): New function.
7914 (Sort_output_sections::operator()): Call is_before.
7915 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7916 conditional.
7917 * testsuite/script_test_10.sh: New test. Test script section
7918 order.
7919 * testsuite/script_test_10.t: Likewise.
7920 * testsuite/script_test_10.s: Likewise.
7921 * testsuite/Makefile.am: Wrap the cross linker tests and the
7922 common tests into NATIVE_OR_CROSS_LINKER.
7923 (check_SCRIPTS): Add script_test_10.sh.
7924 (check_DATA): Add script_test_10.stdout.
7925 (script_test_10.o, script_test_10): New targets.
7926 (script_test_10.stdout): New target.
7927 * configure, testsuite/Makefile.in: Regenerate.
7928
3cef7179
ILT
79292010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7930
7931 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7932 error for the deprecated relocations.
7933 (Target_arm::Scan::global): Likewise.
7934 (Target_arm::Relocate::relocate): Likewise.
7935
7411e9a8
RS
79362010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7937
7938 * fileread.cc (Input_file::find_file): Initialize *found_name
7939 and *namep when using the fallback search for case 4.
7940
6a9da32a
CC
79412010-10-11 Cary Coutant <ccoutant@google.com>
7942
7943 * options.h (class General_options): Redefine -z lazy as an alias for
7944 the negation of -z now.
7945
ac897c20
ILT
79462010-10-11 Ian Lance Taylor <iant@google.com>
7947
7948 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7949 binding.
7950
ea5cae92
NC
79512010-10-06 Nick Clifton <nickc@redhat.com>
7952
7953 * script-sections.cc(class Memory_region): Remove
7954 current_lma_offset_ field. Rename current_vma_offset_ to
7955 current_offset_. Add last_section_ field.
7956 (Memory_region::get_current_vma_address): Rename to
7957 get_current_address.
7958 (Memory_region::get_current_lma_address): Delete.
7959 (Memory_region::increment_vma_offset): Rename to
7960 increment_offset.
7961 (Memory_region::increment_lma_offset): Delete.
7962 (Memory_region::attributes_compatible): New method. Returns
7963 true if the provided section is compatible with the region.
7964 (Memory_region::get_last_section): New method. Returns the last
7965 section to use the region.
7966 (Memory_region::set_last_section): New method. Stores the last
7967 section to use the region.
7968 (Script_sections::block_in_region): New method. Returns true if
7969 a block of memory is contained within a region.
7970 (Script_sections::find_memory_region): New method. Locates a
7971 memory region to be used to set a VMA or LMA address.
7972 (Output_section_definition::set_section_addresses): Add code to
7973 check for addresses set by memory regions.
7974 (Output_segment::set_section_addresses): Remove memory region
7975 walking code.
7976 (Script_sections::create_segment): Add a warning if a header
7977 segment is created outside of any region.
7978 * script-sections.h (class Script_sections): Add prototypes for
7979 find_memory_region and block_in_region methods.
7980 * testsuite/memory_test.s: Use .long instead of .word.
7981 * testsuite/memory_test.t: Add some more output sections.
7982 * testsuite/memory_test.sh: Update expected output.
7983
a9bfd952
DK
79842010-10-02 Doug Kwan <dougkwan@google.com>
7985
7986 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7987 defintion to symtab.h
7988 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7989 declaration to defintion.
7990
bacff3ab
NC
79912010-10-01 Nick Clifton <nickc@redhat.com>
7992
7993 * expression.cc (eval): Replace dummy argument with NULL.
7994 (eval_maybe_dot): Check for a NULL result section pointer.
7995 (Symbol_expression::value): Likewise.
7996 (Dot_expression::value): Likewise.
7997 (BINARY_EXPRESSION): Likewise.
7998 (Max_expression::value): Likewise.
7999 (Min_expression::value): Likewise.
8000 (Absolute_expression::value): Likewise.
8001 (Addr_expression::value_from_output_section): Likewise.
8002 (Loaddddr_expression::value_from_output_section): Likewise.
8003 (Segment_start_expression::value): Likewise.
8004 * script-sections.cc
8005 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8006 argument with NULL.
8007 (Sections_elememt_dot_assignment::set_section_addresses):
8008 Likewise.
8009 (Output_data_expression::do_write_to_buffer): Likewise.
8010 (Output_section_definition::finalize_symbols): Likewise.
8011 (Output_section_definition::set_section_addresses): Likewise.
8012
f81bc8b5
DK
80132010-09-30 Doug Kwan <dougkwan@google.com>
8014
8015 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8016
c95e9f27
ST
80172010-09-28 Sriraman Tallam <tmsriram@google.com>
8018
8019 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8020 function.
c95e9f27
ST
8021 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8022 virtual function.
8023 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8024 virtual function.
8025 * icf.cc (get_section_contents): Inline merge sections only when
8026 target allows it.
8027
3cac54d2
RW
80282010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8029
8030 * configure: Regenerate.
8031
2904037a
ILT
80322010-09-17 Ian Lance Taylor <iant@google.com>
8033
8034 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8035 * testsuite/Makefile.am (memory_test.o): New target.
8036 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8037 memory_test.t.
8038 * testsuite/Makefile.in: Rebuild.
2904037a 8039
bca7fb63
DK
80402010-09-17 Doug Kwan <dougkwan@google.com>
8041
8042 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8043 defintion if relocation uses GOT entries of the symbol.
8044 * testsuite/icf_safe_test.sh: Fix test.
8045 * testsuite/icf_safe_so_test.sh: Fix test.
8046
4ef28648
CC
80472010-09-16 Cary Coutant <ccoutant@google.com>
8048
8049 * script_sections.cc (class Memory_region): Remove "NULL" from
8050 vector initializations.
8051
793990de
CC
80522010-09-15 Cary Coutant <ccoutant@google.com>
8053
8054 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8055 Resolve forwarding symbols.
8056
81e015e2
DK
80572010-09-15 Doug Kwan <dougkwan@google.com>
8058
8059 * gold/testsuite/script_test_3.t: Add ARM special sections.
8060 * gold/testsuite/script_test_4.t: Same.
8061 * gold/testsuite/script_test_5.t: Same.
8062 * gold/testsuite/script_test_6.t: Same.
8063 * gold/testsuite/script_test_7.t: Same.
8064 * gold/testsuite/script_test_7.t: Same.
8065 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8066
36171d64
CC
80672010-09-14 Cary Coutant <ccoutant@google.com>
8068
8069 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8070 (Target_x86_64::Relocate::relocate_tls): Replace check for
8071 saw_tls_block_reloc_ with test for executable section.
8072
d89051bd
CC
80732010-09-12 Cary Coutant <ccoutant@google.com>
8074
8075 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8076 position-independent executables to shared libraries need dynamic
8077 relocations.
8078 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8079 position-independent executables.
8080 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8081 * testsuite/Makefile.in: Regenerate.
8082
fca41f0f
NC
80832010-09-10 Nick Clifton <nickc@redhat.com>
8084
8085 PR gold/11997
8086 * testsuite/memory_test.t: Discard any sections that are not
8087 needed.
8088
6695e4b3
L
80892010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8090
8091 PR gold/11996
8092 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8093 "This::" to work around a bug in gcc 4.2.
8094
8095 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8096
0f72bf6f
RÁE
80972010-09-09 Rafael Espindola <espindola@google.com>
8098
8099 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8100 sections with different PF_X flags in the same segment.
8101 (Layout::find_first_load_seg): Search all segments to find the first
8102 one.
8103 * options.h (rosegment): New.
8104
81052010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8106
05a79166 8107 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8108
aa98ff75
DK
81092010-09-08 Doug Kwan <dougkwan@google.com>
8110
8111 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8112 (Arm_relobj::do_relocate_sections): Add new parameter for output
8113 file to match the parent.
8114 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8115 of local symbols instead of input values. Update code to track
8116 changes in gold::relocate_section.
8117 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8118 (Sized_relobj::compute_final_local_value_internal): New methods.
8119 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8120 body into private version of Sized_relobj::compute_final_local_value.
8121 Call the inline method.
8122 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8123 merged symbol value if there is one.
8124 (Symbol_value::has_output_value): New method defintiion.
8125 (Sized_relobj::Compute_final_local_value_status): New enum type.
8126 (Sized_relobj::compute_final_local_value): New methods.
8127 (Sized_relobj::compute_final_local_value_internal): New methods.
8128 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8129 and arm_cortex_a8.sh.
8130 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8131 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8132 New tests.
8133 * Makefile.in: Regenerate.
8134 * testsuite/arm_bl_out_of_range.s: Update test.
8135 * testsuite/thumb_bl_out_of_range.s: Ditto.
8136 * testsuite/thumb_blx_out_of_range.s: Ditto.
8137 * testsuite/arm_branch_out_of_range.sh: New file.
8138 * testsuite/arm_cortex_a8.sh: Ditto.
8139 * testsuite/arm_cortex_a8_b.s: Ditto.
8140 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8141 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8142 * testsuite/arm_cortex_a8_bl.s: Ditto.
8143 * testsuite/arm_cortex_a8_blx.s: Ditto.
8144 * testsuite/arm_cortex_a8_local.s: Ditto.
8145 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8146 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8147
05a79166
L
81482010-09-08 Rafael Espindola <espindola@google.com>
8149
8150 * Makefile.am (memory_test.stdout): Run readelf with -W.
8151 * Makefile.in: Regenerate.
8152 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8153 64 bit output.
8154
33dbc701
RÁE
81552010-09-08 Rafael Espindola <espindola@google.com>
8156
8157 * script-sections.cc (Script_sections::add_memory_region): Convert
8158 field precision to int.
8159 * script.cc (script_set_section_region, script_set_section_region):
8160 Convert field precision to int.
8161
731ca54a
RÁE
81622010-09-08 Rafael Espindola <espindola@google.com>
8163
8164 * arm.cc (do_finalize_sections): Create the __exidx_start and
8165 __exdix_end symbols even when the section is missing.
8166
7f8cd844
NC
81672010-09-08 Nick Clifton <nickc@redhat.com>
8168
8169 * README: Remove claim that MEMORY is not supported.
8170 * expression.cc (script_exp_function_origin)
8171 (script_exp_function_length): Move from here to ...
8172 * script.cc: ... here.
8173 (script_set_section_region, script_add_memory)
8174 (script_parse_memory_attr, script_include_directive): New
8175 functions.
8176 * script-sections.cc
8177 (class Memory_region): New class.
8178 (class Output_section_definition): Add set_memory_region,
8179 set_section_vma, set_section_lma and get_section_name methods.
8180 (class Script_Sections): Add add_memory_region,
8181 find_memory_region, find_memory_region_origin,
8182 find_memory_region_length and set_memory_region methods.
8183 Have set_section_addresses method walk the list of set memory
8184 regions.
8185 Extend the print methos to display memory regions.
8186 * script-sections.h: Add prototypes for new methods.
8187 Add enum for MEMORY region attributes.
8188 * yyscript.y: Add support for parsing MEMORY regions.
8189 * script-c.h: Add prototypes for new functions.
8190 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8191 * testsuite/Makefile.in: Regenerate.
8192 * testsuite/memory_test.sh: New script.
8193 * testsuite/memory_test.s: New assembler source file.
8194 * testsuite/memory_test.t: New linker script.
8195
a4649286
DK
81962010-08-27 Doug Kwan <dougkwan@google.com>
8197
8198 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8199 reference override an existing dynamic weak reference.
8200 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8201 * testsuite/Makefile.in: Regenerate.
8202 * testsuite/dyn_weak_ref.sh: New file.
8203 * testsuite/dyn_weak_ref_1.c: Ditto.
8204 * testsuite/dyn_weak_ref_2.c: Ditto.
8205
b56648ad
ILT
82062010-08-27 Ian Lance Taylor <iant@google.com>
8207
8208 * incremental.h (class Incremental_input_entry): Add virtual
8209 destructor.
8210
809313cb
ILT
82112010-08-27 Ian Lance Taylor <iant@google.com>
8212
8213 * testsuite/start_lib_test_3.c: Mark t3 as used.
8214
11e32464
NC
82152010-08-27 Nick Clifton <nickc@redhat.com>
8216
8217 * options.cc (version_script): Fix small typo in previous
8218 whitespace tidyup.
8219
ca09d69a
NC
82202010-08-25 Nick Clifton <nickc@redhat.com>
8221
8222 * archive.cc: Formatting fixes: Remove whitespace between
8223 typename and following asterisk. Remove whitespace between
8224 function name and opening parenthesis.
8225 * archive.h: Likewise.
8226 * arm.cc: Likewise.
8227 * attributes.cc: Likewise.
8228 * attributes.h: Likewise.
8229 * common.cc: Likewise.
8230 * copy-relocs.cc: Likewise.
8231 * dirsearch.h: Likewise.
8232 * dynobj.cc: Likewise.
8233 * ehframe.cc: Likewise.
8234 * ehframe.h: Likewise.
8235 * expression.cc: Likewise.
8236 * fileread.cc: Likewise.
8237 * fileread.h: Likewise.
8238 * gc.h: Likewise.
8239 * gold-threads.cc: Likewise.
8240 * gold.cc: Likewise.
8241 * i386.cc: Likewise.
8242 * icf.h: Likewise.
8243 * incremental-dump.cc: Likewise.
8244 * incremental.cc: Likewise.
8245 * layout.cc: Likewise.
8246 * layout.h: Likewise.
8247 * main.cc: Likewise.
8248 * merge.cc: Likewise.
8249 * merge.h: Likewise.
8250 * object.cc: Likewise.
8251 * object.h: Likewise.
8252 * options.cc: Likewise.
8253 * options.h: Likewise.
8254 * output.cc: Likewise.
8255 * output.h: Likewise.
8256 * plugin.cc: Likewise.
8257 * plugin.h: Likewise.
8258 * powerpc.cc: Likewise.
8259 * reloc.cc: Likewise.
8260 * script-c.h: Likewise.
8261 * script-sections.cc: Likewise.
8262 * script.cc: Likewise.
8263 * stringpool.cc: Likewise.
8264 * symtab.cc: Likewise.
8265 * symtab.h: Likewise.
8266 * target.cc: Likewise.
8267 * timer.cc: Likewise.
8268 * timer.h: Likewise.
8269 * version.cc: Likewise.
8270 * x86_64.cc: Likewise.
8271
b8fa8750
NC
82722010-08-24 Nick Clifton <nickc@redhat.com>
8273
8274 PR 11899
8275 * layout.cc (segment_precedes): Sort segments by their physical
8276 addresses, if they have been set.
8277
9919d93b
CC
82782010-08-23 Cary Coutant <ccoutant@google.com>
8279
8280 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8281 symbols data.
8282 (Lib_group::include_member): Unlock object after deleting its
8283 symbols data.
8284 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8285 the bug fixed here.
8286
97b4be1c
CC
82872010-08-19 Neil Vachharajani <nvachhar@google.com>
8288 Cary Coutant <ccoutant@google.com>
8289
8290 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8291 constructor, and set_blocker.
8292 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8293 readsyms_blocker_.
8294 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8295 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8296 * testsuite/Makefile.am (start_lib_test): New test case.
8297 * testsuite/Makefile.in: Regenerate.
8298 * testsuite/start_lib_test_main.c: New file.
8299 * testsuite/start_lib_test_1.c: New file.
8300 * testsuite/start_lib_test_2.c: New file.
8301 * testsuite/start_lib_test_3.c: New file.
8302
dd0b1884
ILT
83032010-08-19 Ian Lance Taylor <iant@google.com>
8304
8305 * Makefile.in: Rebuild with automake 1.11.1.
8306 * aclocal.m4: Likewise.
8307 * testsuite/Makefile.in: Likewise.
8308
7223e9ca
ILT
83092010-08-19 Ian Lance Taylor <iant@google.com>
8310
8311 PR 10893
8312 * i386.cc (class Output_data_plt_i386): Update declarations.
8313 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8314 local_ifuncs_ fields.
8315 (Target_i386::do_plt_section_for_global): New function.
8316 (Target_i386::do_plt_section_for_local): New function.
8317 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8318 parameter; change all callers. Initialize global_ifuncs_ and
8319 local_ifuncs_. If doing a static link define __rel_iplt_start and
8320 __rel_iplt_end.
8321 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8322 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8323 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8324 symbols.
8325 (Target_i386::make_plt_section): New function, broken out of
8326 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8327 (Target_i386::make_plt_entry): Call make_plt_section.
8328 (Target_i386::make_local_ifunc_plt_entry): New function.
8329 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8330 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8331 R_386_IRELATIVE to switch.
8332 (Target_i386::Scan::global): Likewise.
8333 (Target_i386::Relocate::relocate): Likewise.
8334 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8335 switch.
8336 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8337 (Target_x86_64::do_plt_section_for_global): New function.
8338 (Target_x86_64::do_plt_section_for_local): New function.
8339 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8340 parameter; change all callers. If doing a static link define
8341 __rela_iplt_start and __rela_iplt_end.
8342 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8343 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8344 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8345 to point to .plt.
8346 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8347 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8348 switch.
8349 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8350 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8351 R_X86_64_IRELATIVE to switch.
8352 (Target_x86_64::Scan::global): Likewise.
8353 (Target_x86_64::Relocate::relocate): Likewise.
8354 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8355 switch.
8356 * target.h (class Target): Add plt_section_for_global and
8357 plt_section_for_local functions. Add do_plt_section_for_global
8358 and do_plt_section_for_local virtual functions.
8359 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8360 clarifying comments.
8361 (Symbol::use_plt_offset): Handle IFUNC symbol.
8362 * object.cc (Sized_relobj::Sized_relobj): Initialize
8363 local_plt_offsets_.
8364 (Sized_relobj::local_has_plt_offset): New function.
8365 (Sized_relobj::local_plt_offset): New function.
8366 (Sized_relobj::set_local_plt_offset): New function.
8367 (Sized_relobj::do_count): Handle IFUNC symbol.
8368 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8369 a bit away from input_shndx_ field. Add set_is_func_symbol and
8370 is_ifunc_symbol functions.
8371 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8372 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8373 local_plt_offsets_ field.
8374 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8375 * output.h (class Output_section_data): Add non-const
8376 output_section function.
8377 (class Output_data_got): Update declarations.
8378 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8379 Add use_plt_offset parameter to global and local constructors.
8380 Change all callers. Change local_sym_index_ field to 31 bits.
8381 Change GSYM_CODE and CONSTANT_CODE accordingly.
8382 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8383 doing a static link don't set sh_link field.
8384 (Output_data_got::Got_entry::write): Use PLT offset if
8385 appropriate.
8386 (Output_data_got::add_global_plt): New function.
8387 (Output_data_got::add_local_plt): New function.
8388 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8389 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8390 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8391 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8392 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8393 IFUNC conditional.
8394 * testsuite/ifunc-sel.h: New file.
8395 * testsuite/ifuncmain1.c: New file.
8396 * testsuite/ifuncmain1vis.c: New file.
8397 * testsuite/ifuncmod1.c: New file.
8398 * testsuite/ifuncdep2.c: New file.
8399 * testsuite/ifuncmain2.c: New file.
8400 * testsuite/ifuncmain3.c: New file.
8401 * testsuite/ifuncmod3.c: New file.
8402 * testsuite/ifuncmain4.c: New file.
8403 * testsuite/ifuncmain5.c: New file.
8404 * testsuite/ifuncmod5.c: New file.
8405 * testsuite/ifuncmain6pie.c: New file.
8406 * testsuite/ifuncmod6.c: New file.
8407 * testsuite/ifuncmain7.c: New file.
8408 * configure, testsuite/Makefile.in: Rebuild.
8409
56f75c03
ILT
84102010-08-18 Ian Lance Taylor <iant@google.com>
8411
8412 * incremental.cc
8413 (Output_section_incremental_inputs::write_input_files): Add cast
8414 to avoid signed/unsigned comparison warning.
8415 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8416
55455f89
CC
84172010-08-12 Cary Coutant <ccoutant@google.com>
8418
8419 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8420
e2054bcb
ILT
84212010-08-13 Ian Lance Taylor <iant@google.com>
8422
8423 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8424
74f67560
DK
84252010-08-12 Cary Coutant <ccoutant@google.com>
8426 Doug Kwan <dougkwan@google.com>
8427
8428 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8429 defintion overrides non-weak undef, remember that the original undef
8430 is not weak.
8431 * symtab.cc (Symbol_table::sized_write_global): For undef without
8432 an original weak binding, set binding to global in output.
8433 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8434 * testsuite/Makefile.in: Regenerate.
8435 * testsuite/strong_ref_weak_def.sh: New file.
8436 * testsuite/strong_ref_weak_def_1.c: Ditto.
8437 * testsuite/strong_ref_weak_def_2.c: Ditto.
8438
d1238d12
CC
84392010-08-12 Cary Coutant <ccoutant@google.com>
8440
8441 * testsuite/incremental_test.sh: Rewrite.
8442 * testsuite/incremental_test_1.c: Rewrite.
8443 * testsuite/incremental_test_2.c: Rewrite.
8444
0e70b911
CC
84452010-08-12 Cary Coutant <ccoutant@google.com>
8446
8447 * arm.cc (Target_arm::got_size): Add const.
8448 (Target_arm::got_entry_count): New function.
8449 (Target_arm::plt_entry_count): New function.
8450 (Target_arm::first_plt_entry_offset): New function.
8451 (Target_arm::plt_entry_size): New function.
8452 (Output_data_plt_arm::entry_count): New function.
8453 (Output_data_plt_arm::first_plt_entry_offset): New function.
8454 (Output_data_plt_arm::get_plt_entry_size): New function.
8455 * i386.cc (Target_i386::got_size): Add const.
8456 (Target_i386::got_entry_count): New function.
8457 (Target_i386::plt_entry_count): New function.
8458 (Target_i386::first_plt_entry_offset): New function.
8459 (Target_i386::plt_entry_size): New function.
8460 (Output_data_plt_i386::entry_count): New function.
8461 (Output_data_plt_i386::first_plt_entry_offset): New function.
8462 (Output_data_plt_i386::get_plt_entry_size): New function.
8463 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8464 find_incremental_inputs_sections. Dump incremental_got_plt section.
8465 * incremental.cc: Include target.h.
8466 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8467 parameter. Adjust all callers. Find incremental_got_plt section.
8468 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8469 section.
8470 (Output_section_incremental_inputs::set_final_data_size): Calculate
8471 size of incremental_got_plt section.
8472 (Output_section_incremental_inputs::do_write): Write the
8473 incremental_got_plt section.
8474 (Got_plt_view_info): New struct.
8475 (Local_got_offset_visitor): New class.
8476 (Global_got_offset_visitor): New class.
8477 (Global_symbol_visitor_got_plt): New class.
8478 (Output_section_incremental_inputs::write_got_plt): New function.
8479 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8480 Add parameter. Adjust all callers.
8481 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8482 (Incremental_inputs::got_plt_section): New function.
8483 (Incremental_inputs::got_plt_section_): New data member.
8484 (Incremental_got_plt_reader): New class.
8485 * layout.cc (Layout::create_incremental_info_sections): Add the
8486 incremental_got_plt section.
8487 * object.h (Got_offset_list::get_list): New function.
8488 (Got offset_list::for_all_got_offsets): New function.
8489 (Sized_relobj::local_got_offset_list): New function.
8490 * powerpc.cc (Target_powerpc::got_size): Add const.
8491 (Target_powerpc::got_entry_count): New function.
8492 (Target_powerpc::plt_entry_count): New function.
8493 (Target_powerpc::first_plt_entry_offset): New function.
8494 (Target_powerpc::plt_entry_size): New function.
8495 (Output_data_plt_powerpc::entry_count): New function.
8496 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8497 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8498 * sparc.cc (Target_sparc::got_size): Add const.
8499 (Target_sparc::got_entry_count): New function.
8500 (Target_sparc::plt_entry_count): New function.
8501 (Target_sparc::first_plt_entry_offset): New function.
8502 (Target_sparc::plt_entry_size): New function.
8503 (Output_data_plt_sparc::entry_count): New function.
8504 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8505 (Output_data_plt_sparc::get_plt_entry_size): New function.
8506 * symtab.h (Symbol::got_offset_list): New function.
8507 (Symbol_table::for_all_symbols): New function.
8508 * target.h (Sized_target::got_entry_count): New function.
8509 (Sized_target::plt_entry_count): New function.
8510 (Sized_target::plt_entry_size): New function.
8511 * x86_64.cc (Target_x86_64::got_size): Add const.
8512 (Target_x86_64::got_entry_count): New function.
8513 (Target_x86_64::plt_entry_count): New function.
8514 (Target_x86_64::first_plt_entry_offset): New function.
8515 (Target_x86_64::plt_entry_size): New function.
8516 (Output_data_plt_x86_64::entry_count): New function.
8517 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8518 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8519
09ec0418
CC
85202010-08-12 Cary Coutant <ccoutant@google.com>
8521
8522 * archive.cc: Include incremental.h.
8523 (Archive::Archive): Initialize incremental_info_.
8524 (Archive::include_member): Record archive members in incremental info.
8525 (Add_archive_symbols::run): Record begin and end of an archive in
8526 incremental info.
8527 (Lib_group::include_member): Record objects in incremental info.
8528 * archive.h (Incremental_archive_entry): Forward declaration.
8529 (Archive::set_incremental_info): New member function.
8530 (Archive::incremental_info): New member function.
8531 (Archive::Unused_symbol_iterator): New class.
8532 (Archive::unused_symbols_begin): New member function.
8533 (Archive::unused_symbols_end): New member function.
8534 (Archive::incremental_info_): New data member.
8535 * incremental-dump.cc (find_input_containing_global): New function.
8536 (dump_incremental_inputs): Dump new incremental info sections.
8537 * incremental.cc: Include symtab.h.
8538 (Output_section_incremental_inputs): New class.
8539 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8540 new incremental info sections.
8541 (Sized_incremental_binary::do_check_inputs): Likewise.
8542 (Incremental_inputs::report_archive): Remove.
8543 (Incremental_inputs::report_archive_begin): New function.
8544 (Incremental_inputs::report_archive_end): New function.
8545 (Incremental_inputs::report_object): New function.
8546 (Incremental_inputs::finalize_inputs): Remove.
8547 (Incremental_inputs::report_input_section): New function.
8548 (Incremental_inputs::report_script): Rewrite.
8549 (Incremental_inputs::finalize): Do nothing but finalize string table.
8550 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8551 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8552 (Incremental_inputs::create_data_sections): New function.
8553 (Incremental_inputs::relocs_entsize): New function.
8554 (Output_section_incremental_inputs::set_final_data_size): New function.
8555 (Output_section_incremental_inputs::do_write): New function.
8556 (Output_section_incremental_inputs::write_header): New function.
8557 (Output_section_incremental_inputs::write_input_files): New function.
8558 (Output_section_incremental_inputs::write_info_blocks): New function.
8559 (Output_section_incremental_inputs::write_symtab): New function.
8560 * incremental.h (Incremental_script_entry): Forward declaration.
8561 (Incremental_object_entry): Forward declaration.
8562 (Incremental_archive_entry): Forward declaration.
8563 (Incremental_inputs): Forward declaration.
8564 (Incremental_inputs_header_data): Remove.
8565 (Incremental_inputs_header): Remove.
8566 (Incremental_inputs_header_write): Remove.
8567 (Incremental_inputs_entry_data): Remove.
8568 (Incremental_inputs_entry): Remove.
8569 (Incremental_inputs_entry_write): Remove.
8570 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8571 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8572 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8573 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8574 Likewise.
8575 (Incremental_input_entry): New class.
8576 (Incremental_script_entry): New class.
8577 (Incremental_object_entry): New class.
8578 (Incremental_archive_entry): New class.
8579 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8580 (Incremental_inputs::report_inputs): Remove.
8581 (Incremental_inputs::report_archive): Remove.
8582 (Incremental_inputs::report_archive_begin): New function.
8583 (Incremental_inputs::report_archive_end): New function.
8584 (Incremental_inputs::report_object): Change prototype.
8585 (Incremental_inputs::report_input_section): New function.
8586 (Incremental_inputs::report_script): Change prototype.
8587 (Incremental_inputs::get_reloc_count): New function.
8588 (Incremental_inputs::set_reloc_count): New function.
8589 (Incremental_inputs::create_data_sections): New function.
8590 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8591 (Incremental_inputs::inputs_section): New function.
8592 (Incremental_inputs::symtab_section): New function.
8593 (Incremental_inputs::relocs_section): New function.
8594 (Incremental_inputs::get_stringpool): Add const.
8595 (Incremental_inputs::command_line): Add const.
8596 (Incremental_inputs::inputs): Remove.
8597 (Incremental_inputs::command_line_key): New function.
8598 (Incremental_inputs::input_file_count): New function.
8599 (Incremental_inputs::input_files): New function.
8600 (Incremental_inputs::relocs_entsize): New function.
8601 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8602 (Incremental_inputs::finalize_inputs): Remove.
8603 (Incremental_inputs::Input_info): Remove.
8604 (Incremental_inputs::lock_): Remove.
8605 (Incremental_inputs::inputs_): Change type.
8606 (Incremental_inputs::inputs_map_): Remove.
8607 (Incremental_inputs::current_object_entry_): New data member.
8608 (Incremental_inputs::inputs_section_): New data member.
8609 (Incremental_inputs::symtab_section_): New data member.
8610 (Incremental_inputs::relocs_section_): New data member.
8611 (Incremental_inputs::reloc_count_): New data member.
8612 (Incremental_inputs_reader): New class.
8613 (Incremental_symtab_reader): New class.
8614 (Incremental_relocs_reader): New class.
8615 * layout.cc (Layout::finalize): Move finalization of incremental info
8616 and creation of incremental info sections to follow finalization of
8617 symbol table. Set offsets for postprocessing sections.
8618 (Layout::create_incremental_info_sections): Call
8619 Incremental_inputs::create_data_sections. Add incremental symtab
8620 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8621 sections to layout after input sections.
8622 * layout.h (struct Timespec): Forward declaration.
8623 (Layout::incremental_inputs): Add const.
8624 (Layout::create_incremental_info_sections): Add parameter.
8625 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8626 * object.cc: Include incremental.h.
8627 (Relobj::finalize_incremental_relocs): New function.
8628 (Sized_relobj::do_layout): Record input sections in incremental info.
8629 * object.h (Object::output_section): New function.
8630 (Object::output_section_offset): Moved from Relobj.
8631 (Object::get_incremental_reloc_base): New function.
8632 (Object::get_incremental_reloc_count): New function.
8633 (Object::do_output_section): New function.
8634 (Object::do_output_section_offset): Moved from Relobj.
8635 (Object::do_get_incremental_reloc_base): New function.
8636 (Object::do_get_incremental_reloc_count): New function.
8637 (Object::Object): Initialize new data members.
8638 (Relobj::output_section): Renamed do_output_section and moved to
8639 protected.
8640 (Relobj::output_section_offset): Moved to Object.
8641 (Relobj::do_get_incremental_reloc_base): New function.
8642 (Relobj::do_get_incremental_reloc_count): New function.
8643 (Relobj::allocate_incremental_reloc_counts): New function.
8644 (Relobj::count_incremental_reloc): New function.
8645 (Relobj::finalize_incremental_relocs): New function.
8646 (Relobj::next_incremental_reloc_index): New function.
8647 (Relobj::reloc_counts_): New data member.
8648 (Relobj::reloc_bases_): New data member.
8649 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8650 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8651 (Sized_relobj::incremental_relocs_scan): New function.
8652 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8653 (Sized_relobj::incremental_relocs_write): New function.
8654 (Sized_relobj::incremental_relocs_write_reltype): New function.
8655 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8656 incremental link.
8657 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8658 archives and object files elsewhere.
8659 (Add_symbols::run): Report object files here.
8660 (Finish_group::run): Report end of archive at end of group.
8661 * reloc.cc: Include layout.h, incremental.h.
8662 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8663 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8664 (Sized_relobj::incremental_relocs_scan): New function.
8665 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8666 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8667 (Sized_relobj::incremental_relocs_write): New function.
8668 (Sized_relobj::incremental_relocs_write_reltype): New function.
8669 * script.cc (read_input_script): Rewrite test for incremental link.
8670 Change call to Incremental_inputs::report_script.
8671 * symtab.h (Symbol_table::first_global_index): New function.
8672 (Symbol_table::output_count): New function.
8673
ce0d1972
DK
86742010-08-12 Doug Kwan <dougkwan@google.com>
8675
8676 * arm.cc (Target_arm::merge_object_attributes): Check command line
8677 options --no-wchar-size-warning and --no-enum-size-warning.
8678 * options.h (General_options): Add ld-compatible options
8679 --no-enum-size-warning and --no-wchar-size-warning.
8680
6e5710ce
ILT
86812010-08-04 Ian Lance Taylor <iant@google.com>
8682
8683 * x86_64.cc (Target_x86_64::Scan::local): Use
8684 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8685 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8686 (Target_x86_64::Scan::global): Likewise.
8687 (Target_x86_64::Relocate::relocate): Likewise.
8688 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8689 Likewise.
8690
fef830db
CC
86912010-08-03 Cary Coutant <ccoutant@google.com>
8692
8693 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8694 to reserve space in merged_strings vector. Keep total input size
8695 for stats.
8696 (Output_merge_string::do_print_merge_stats): Print total input size.
8697 * merge.h (Output_merge_string): Add input_size_ field.
8698 * stringpool.cc (Stringpool_template::string_length): Move
8699 implementations out of Stringpool_template class and place in
8700 stringpool.h.
8701 * stringpool.h (string_length): Move out of Stringpool_template.
8702
1e3811b0
ILT
87032010-08-03 Ian Lance Taylor <iant@google.com>
8704
8705 PR 11712
8706 * layout.cc (relaxation_loop_body): If address of load segment is
8707 set, adjust address to include headers if possible.
8708
7af0c620
ILT
87092010-08-03 Ian Lance Taylor <iant@google.com>
8710
8711 * version.cc (version_string): Bump to 1.10.
8712
22f0da72
ILT
87132010-08-03 Ian Lance Taylor <iant@google.com>
8714
8715 PR 11805
8716 * layout.h (enum Output_section_order): Define.
8717 (class Layout): Update declarations.
8718 * layout.cc (Layout::get_output_section): Add order parameter.
8719 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8720 is_first_non_relro parameters. Change all callers.
8721 (Layout::choose_output_section): Likewise.
8722 (Layout::add_output_section_data): Likewise.
8723 (Layout::make_output_section): Likewise. Set order.
8724 (Layout::default_section_order): New function.
8725 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8726 * output.cc (Output_section::Output_section): Initialize order_.
8727 Don't initialize deleted fields.
8728 (Output_segment::Output_segment): Don't initialize deleted
8729 fields.
8730 (Output_segment::add_output_section_to_load): New function
8731 replacing add_output_section. Change all callers to call this or
8732 add_output_section_to_nonload.
8733 (Output_segment::add_output_section_to_nonload): New function.
8734 (Output_segment::remove_output_section): Rewrite.
8735 (Output_segment::add_initial_output_data): Likewise.
8736 (Output_segment::has_any_data_sections): Likewise.
8737 (Output_segment::is_first_section_relro): Likewise.
8738 (Output_segment::maximum_alignment): Likewise.
8739 (Output_segment::has_dynamic_reloc): New function replacing
8740 dynamic_reloc_count. Change all callers.
8741 (Output_segment::has_dynamic_reloc_list): New function replacing
8742 dynamic_reloc_count_list. Change all callers.
8743 (Output_segment::set_section_addresses): Rewrite.
8744 (Output_segment::set_offset): Rewrite.
8745 (Output_segment::find_first_and_last_list): Remove.
8746 (Output_segment::set_tls_offsets): Rewrite.
8747 (Output_segment::first_section_load_address): Likewise.
8748 (Output_segment::output_section_count): Likewise.
8749 (Output_segment::section_with_lowest_load_address): Likewise.
8750 (Output_segment::write_section_headers): Likewise.
8751 (Output_segment::print_sections_to_map): Likewise.
8752 * output.h (class Output_data): Remove dynamic_reloc_count_
8753 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8754 (Output_data::add_dynamic_reloc): Rewrite.
8755 (Output_data::has_dynamic_reloc): New function.
8756 (Output_data::dynamic_reloc_count): Remove.
8757 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8758 is_last_relro_, is_first_non_relro_, is_interp_,
8759 is_dynamic_linker_section_ fields. Add order and set_order
8760 functions. Remove is_relro_local, set_is_relro_local,
8761 is_last_relro, set_is_last_relro, is_first_non_relro,
8762 set_is_first_non_relro functions, is_interp, set_is_interp,
8763 is_dynamic_linker_section, and set_is_dynamic_linker_section
8764 functions.
8765 (class Output_segment): Change Output_data_list from std::list to
8766 std:;vector. Add output_lists_ field. Remove output_data_ and
8767 output_bss_ fields. Update declarations.
8768
3ff2ccb0
ILT
87692010-08-02 Ian Lance Taylor <iant@google.com>
8770
8771 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8772 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8773 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8774
88a4108b
ILT
87752010-08-02 Ian Lance Taylor <iant@google.com>
8776
8777 PR 11855
8778 * script.cc (Script_options::Script_options): Initialize
8779 symbol_definitions_ and symbol_references_.
8780 (Script_options::add_symbol_assignment): Update
8781 symbol_definitions_ and symbol_references_.
8782 (Script_options::add_symbol_reference): New function.
8783 (script_symbol): New function.
8784 * script.h (class Script_options): Add symbol_definitions_ and
8785 symbol_references_ fields.
8786 (Script_options::referenced_const_iterator): New type.
8787 (Script_options::referenced_begin): New function.
8788 (Script_options::referenced_end): New function.
8789 (Script_options::is_referenced): New function.
8790 (Script_options::any_unreferenced): New function.
8791 * script-c.h (script_symbol): Declare.
8792 * yyscript.y (exp): Call script_symbol.
8793 * symtab.cc: Include "script.h".
8794 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8795 Change all callers. Check symbols referenced by scripts.
8796 (Symbol_table::add_undefined_symbols_from_command_line): Add
8797 layout parameter. Change all callers.
8798 (Symbol_table::do_add_undefined_symbols_from_command_line):
8799 Likewise. Break out loop body. Check symbols referenced by
8800 scripts.
8801 (Symbol_table::add_undefined_symbol_from_command_line): New
8802 function broken out of
8803 do_add_undefined_symbols_from_command_line.
8804 * symtab.h (class Symbol_table): Update declarations.
8805 * archive.cc: Include "layout.h".
8806 (Archive::should_include_member): Add layout parameter. Change
8807 all callers. Check for symbol mentioned in expression.
8808 * archive.h (class Archive): Update declaration.
8809 * object.cc (Sized_relobj::do_should_include_member): Add layout
8810 parameter.
8811 * object.h (Object::should_include_member): Add layout parameter.
8812 Change all callers.
8813 (Object::do_should_include_member): Add layout parameter.
8814 (class Sized_relobj): Update declaration.
8815 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8816 parameter.
8817 * dynobj.h (class Sized_dynobj): Update declaration.
8818 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8819 layout parameter.
8820 * plugin.h (class Sized_pluginobj): Update declaration.
8821
5f1ab67a
ILT
88222010-08-02 Ian Lance Taylor <iant@google.com>
8823
8824 PR 11866
8825 * output.cc (Output_segment::set_offset): Search for the first and
8826 last sections rather than assuming that the list is in order.
8827 (Output_segment::find_first_and_last_list): New function.
8828 * output.h (class Output_segment): Update declarations.
8829 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8830 (relro_strip_test_SOURCES): New variable.
8831 (relro_strip_test_DEPENDENCIES): New variable.
8832 (relro_strip_test_LDFLAGS): New variable.
8833 (relro_strip_test_LDADD): New variable.
8834 (relro_strip_test.so): New target.
8835
a8df5856
ILT
88362010-08-02 Ian Lance Taylor <iant@google.com>
8837
8838 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8839 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8840 (Target_i386::got_tlsdesc_section): New function.
8841 (Target_i386::got_section): Create space for GOT entries for
8842 TLSDESC relocations.
8843 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8844 R_386_TLS_GOTDESC.
8845 (Target_i386::Scan::global): Likewise.
8846 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8847 using TLSDESC GOT.
8848 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8849 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8850 (Target_x86_64::got_tlsdesc_section): New function.
8851 (Target_x86_64::got_section): Create space for GOT entries for
8852 TLSDESC relocations.
8853 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8854 R_386_TLS_GOTDESC.
8855 (Target_x86_64::Scan::global): Likewise.
8856 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8857 using TLSDESC GOT.
8858
0c10a0a6
ILT
88592010-08-02 Ian Lance Taylor <iant@google.com>
8860
8861 * testsuite/final_layout.sh: Use dc to convert from hex to
8862 decimal.
8863
41cbeecc
ST
88642010-07-29 Sriraman Tallam <tmsriram@google.com>
8865
8866 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8867 paramter to the call to gold::gc_process_relocs.
8868 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8869 paramter to the call to gold::gc_process_relocs.
8870 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8871 parameter to the call to gold::gc_process_relocs.
8872 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8873 template parameter to the call to gold::gc_process_relocs.
8874 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8875 paramter to the call to gold::gc_process_relocs.
8876 * gc.h (get_embedded_addend_size): New function.
8877 (gc_process_relocs): Save the size of the reloc for use by ICF.
8878 * icf.cc (get_section_contents): Get the addend from the text section
8879 for SHT_REL relocation sections.
8880 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8881 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8882 * int_encoding.h (read_from_pointer): New overloaded function.
8883 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8884 * testsuite/icf_sht_rel_addend_test.sh: New file.
8885 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8886 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8887
6ea55b82
RW
88882010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8889
8890 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8891 * Makefile.in: Regenerate.
8892 * testsuite/Makefile.in: Regenerate.
8893
9691462b
ILT
88942010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8895
8896 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8897 * gold/testsuite/debug_msg.cc: Likewise.
8898 * gold/testsuite/odr_violation1.cc
8899 * gold/testsuite/odr_violation2.cc
8900
76897331
CC
89012010-07-21 Cary Coutant <ccoutant@google.com>
8902
8903 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8904 string, and length fields.
8905 (Output_merge_string::Merged_strings_list): New type.
8906 (Output_merge_string::Merged_strings_lists): New typedef.
8907 (Output_merge_string): Replace merged_strings_ with
8908 merged_strings_lists_.
8909 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8910 Merged_strings_list per input object and section. Don't store pointer
8911 to the string. Don't store length with each merged string entry.
8912 (Output_merge_string::finalize_merged_data): Loop over list of merged
8913 strings lists. Recompute length of each merged string.
8914
78384e8f
CC
89152010-07-15 Cary Coutant <ccoutant@google.com>
8916
8917 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8918 here.
8919
783659f9
ILT
89202010-07-14 Ian Lance Taylor <iant@google.com>
8921
8922 * descriptors.cc (Descriptors::open): Report correct name in error
8923 message.
8924
131687b4
DK
89252010-07-13 Doug Kwan <dougkwan@google.com>
8926
8927 * arm.cc (Arm_input_section::Arm_input_section): For a
8928 SHT_ARM_EXIDX section, always keeps the input sections.
8929 (Arm_input_section::set_exidx_section_link): New method.
8930 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8931 has_errors_ to false.
8932 (Arm_exidx_input_section::has_errors,
8933 Arm_exidx_input_section::set_has_errors): New methods.
8934 (Arm_exidx_input_section::has_errors_): New data member.
8935 (Arm_relobj::get_exidx_shndx_list): New method.
8936 (Arm_output_section::append_text_sections_to_list): Do not skip
8937 section without SHF_EXECINSTR.
8938 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8939 errors.
2e702c99 8940 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8941 section header. Make error messages more verbose. Check for
8942 a non-executable section linked to an EXIDX section.
8943 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8944 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8945 check that there is no deferred EXIDX section if we exit early.
8946 Instead of not making an EXIDX section in case of an error, make one
8947 and set the has_errors flag of it.
8948 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8949 in a relocatable link.
8950 (Target_arm::do_relax): Look for the EXIDX output section instead of
8951 assuming that it is called .ARM.exidx.
2e702c99 8952 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8953 section list. Do not check for SHF_EXECINSTR section flags but
8954 skip any input section with errors.
8955 * output.cc (Output_section::Output_section): Initialize
8956 always_keeps_input_sections_ to false.
8957 (Output_section::add_input_section): Check for
8958 always_keeps_input_sections_.
8959 * output.h (Output_section::always_keeps_input_sections,
8960 Output_section::set_always_keeps_input_sections): New methods.
8961 (Output_section::always_keeps_input_sections): New data member.
8962
69517287
RÁE
89632010-07-13 Rafael Espindola <espindola@google.com>
8964
8965 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8966 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8967
82742395
ILT
89682010-07-13 Philip Herron <herron.philip@googlemail.com>
8969 Ian Lance Taylor <iant@google.com>
8970
8971 * output.h (Output_section_lookup_maps::add_merge_section):
8972 Correct check of whether value was inserted.
8973 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8974 (Output_section_lookup_maps::add_relaxed_input_section):
8975 Likewise.
8976 * arm.cc (Target_arm::got_section): Remove used local os.
8977 * i386.cc (Target_i386::got_section): Likewise.
8978 * x86_64.cc (Target_x86_64::got_section): Likewise.
8979 * sparc.cc (Target_sparc::got_section): Likewise.
8980 (Target_sparc::relocate): Remove unused local have_got_offset.
8981 * powerpc.cc (Target_powerpc::relocate): Likewise.
8982
f2d707b5
ILT
89832010-07-13 Ian Lance Taylor <iant@google.com>
8984
241531d6
ILT
8985 * compressed_output.cc (zlib_decompress): Fix signature in
8986 !HAVE_ZLIB_H case.
8987
f2d707b5
ILT
8988 * archive.cc (Archive::include_member): Unlock an external member
8989 of a thin archive. Don't bother to delete an object we know is
8990 NULL.
8991
a2e47362
CC
89922010-07-12 Cary Coutant <ccoutant@google.com>
8993
8994 * compressed_output.cc (zlib_decompress): New function.
8995 (get_uncompressed_size): New function.
8996 (decompress_input_section): New function.
8997 * compressed_output.h (get_uncompressed_size): New function.
8998 (decompress_input_section): New function.
8999 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9000 Handle compressed debug sections.
9001 * layout.cc (is_compressed_debug_section): New function.
9002 (Layout::output_section_name): Map compressed section names to
9003 canonical names.
9004 * layout.h (is_compressed_debug_section): New function.
9005 (is_debug_info_section): Recognize compressed debug sections.
9006 * merge.cc: Include compressed_output.h.
9007 (Output_merge_data::do_add_input_section): Handle compressed
9008 debug sections.
9009 (Output_merge_string::do_add_input_section): Handle compressed
9010 debug sections.
9011 * object.cc: Include compressed_output.h.
9012 (Sized_relobj::Sized_relobj): Initialize new data members.
9013 (build_compressed_section_map): New function.
9014 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9015 * object.h (Object::section_is_compressed): New method.
9016 (Object::do_section_is_compressed): New method.
9017 (Sized_relobj::Compressed_section_map): New type.
9018 (Sized_relobj::do_section_is_compressed): New method.
9019 (Sized_relobj::compressed_sections_): New data member.
9020 * output.cc (Output_section::add_input_section): Handle compressed
9021 debug sections.
9022 * reloc.cc: Include compressed_output.h.
9023 (Sized_relobj::write_sections): Handle compressed debug sections.
9024
ce279a62
CC
90252010-07-08 Cary Coutant <ccoutant@google.com>
9026
9027 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9028 weak when resolving to a dynamic def.
9029 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9030 for weak undef/dynamic def cases. Adjust callers.
9031 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9032 undef_binding_weak_.
9033 (Symbol_table::sized_write_globals): Adjust symbol binding.
9034 (Symbol_table::sized_write_symbol): Add binding parameter.
9035 * symtab.h (Symbol::set_undef_binding): New method.
9036 (Symbol::is_undef_binding_weak): New method.
9037 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9038 (Symbol_table::should_override): Add new parameter.
9039 (Symbol_table::sized_write_symbol): Add new parameter.
9040
9041 * testsuite/weak_undef_file1.cc: Add new test case.
9042 * testsuite/weak_undef_file2.cc: Fix header comment.
9043 * testsuite/weak_undef_test.cc: Add new test case.
9044
b2286c10
DK
90452010-06-29 Doug Kwan <dougkwan@google.com>
9046
9047 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9048 Initialize USE_SYMBOL_.
9049 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9050 definition.
9051 (Arm_reloc_property::uses_symbol_): New data member declaration.
9052 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9053 uses symbol value and symbol is undefined but not weakly undefined.
9054
4802450a
RÁE
90552010-06-28 Rafael Espindola <espindola@google.com>
9056
9057 * plugin.cc (Plugin::load): Use dlerror.
9058
e5ca47ba
ILT
90592010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9060
9061 * symtab.cc (detect_odr_violations): When reporting an ODR
9062 violation, report an object where the symbol is defined.
9063
8a75a161
DK
90642010-06-25 Doug Kwan <dougkwan@google.com>
9065
9066 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9067 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9068 definition.
9069 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9070 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9071 target hook to detect function points.
9072 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9073 * icf.h (Icf::check_section_for_function_pointers): Change type of
9074 parameter SECTION_NAME to const reference to std::string. Use
9075 target hook to determine if section may have unsafe pointers.
9076 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9077 method definition.
9078
42218b9f
RÁE
90792010-06-21 Rafael Espindola <espindola@google.com>
9080
9081 * fileread.cc (Input_file::find_fie): New
9082 (Input_file::open): Use Input_file::find_fie.
9083 * fileread.h (Input_file::find_fie): New
9084 * plugin.cc (set_extra_library_path): New.
9085 (Plugin::load): Add set_extra_library_path to the transfer vector.
9086 (Plugin_manager::set_extra_library_path): New.
9087 (Plugin_manager::add_input_file): Use the extra search path if set.
9088 (set_extra_library_path(): New.
9089 * plugin.h (Plugin_manager): Add set_extra_library_path and
9090 extra_search_path_.
9091
a0506cca
CC
90922010-06-19 Cary Coutant <ccoutant@google.com>
9093
9094 * layout.cc (gdb_sections): Add .debug_types.
9095 (lines_only_debug_sections): Likewise.
9096
6508b958
RÁE
90972010-06-18 Rafael Espindola <espindola@google.com>
9098
9099 * plugin.cc (add_input_file,add_input_library)
9100 (Plugin_manager::add_input_file): Make filename arguments const.
9101 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9102 const.
9103
3e235302
DK
91042010-06-16 Doug Kwan <dougkwan@google.com>
9105
9106 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9107 .ARM.attributes section if we have not merged any input
9108 attributes sections.
9109
106e8a6c
DK
91102010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9111
9112 * arm.cc: Allow combining objects with no EABI version
9113 information.
9114
91ff43fe
RÁE
91152010-06-15 Rafael Espindola <espindola@google.com>
9116
9117 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9118
68ed838c
ILT
91192010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9120
9121 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9122 (struct iovec): Correct !HAVE_READV definition.
9123
f3a2388f
CC
91242010-06-10 Cary Coutant <ccoutant@google.com>
9125
9126 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9127 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9128 reloc sections.
9129 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9130
9131 PR 11683
9132 * symtab.h (Symbol::is_placeholder): New member function.
9133 * target-reloc.h (relocate_section): Check for placeholder symbols.
9134
9135 * testsuite/Makefile.am (plugin_test_8): New test.
9136 (plugin_test_9): New test.
9137 * testsuite/Makefile.in: Regenerate.
9138
e1df38aa
NC
91392010-06-09 Nick Clifton <nickc@redhat.com>
9140
9141 * yyscript.y (input_list_element): Allow strings prefixed with
9142 the '-' character. Treat these as libraries.
9143 * script.cc (script_add_library): New function. Adds a library
9144 specified by "-l<name>" found in an input script.
9145 * script-c.h: Add prototype for script_add_library.
9146
25bbe950
DK
91472010-06-07 Doug Kwan <dougkwan@google.com>
9148
9149 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9150 Restrict stub-group size to be within long conditional branch
9151 range when working around cortex-A8 erratum.
9152
0f32ea4c
ILT
91532010-06-07 Damien Diederen <dd@crosstwine.com>
9154
9155 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9156 #ifdef typo.
9157
8fe2a369
ST
91582010-06-03 Sriraman Tallam <tmsriram@google.com>
9159
9160 PR gold/11658
9161 * output.cc
9162 (Output_section::Input_section_sort_entry::compare_section_ordering):
9163 Change to return non-zero correctly.
9164 (Output_section::Input_section_sort_section_order_index_compare
9165 ::operator()): Change to fix ambiguity in comparisons.
9166
6e9ba2ca
ST
91672010-06-01 Sriraman Tallam <tmsriram@google.com>
9168
9169 * gold.h (is_wildcard_string): New function.
9170 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9171 (Layout::layout_eh_frame): Ditto.
9172 (Layout::find_section_order_index): New method.
9173 (Layout::read_layout_from_file): New method.
9174 * layout.h (Layout::find_section_order_index): New method.
9175 (Layout::read_layout_from_file): New method.
9176 (Layout::input_section_position_): New private member.
9177 (Layout::input_section_glob_): New private member.
9178 * main.cc (main): Call read_layout_from_file here.
9179 * options.h (--section-ordering-file): New option.
9180 * output.cc (Output_section::input_section_order_specified_): New
9181 member.
9182 (Output_section::Output_section): Initialize new member.
9183 (Output_section::add_input_section): Add new parameter.
9184 Keep input sections when --section-ordering-file is used.
9185 (Output_section::set_final_data_size): Sort input sections when
9186 section ordering file is specified.
9187 (Output_section::Input_section_sort_entry): Add new parameter.
9188 Check sorting type.
9189 (Output_section::Input_section_sort_entry::compare_section_ordering):
9190 New method.
9191 (Output_section::Input_section_sort_compare::operator()): Change to
9192 consider section_order_index.
9193 (Output_section::Input_section_sort_init_fini_compare::operator()):
9194 Change to consider section_order_index.
9195 (Output_section::Input_section_sort_section_order_index_compare
9196 ::operator()): New method.
9197 (Output_section::sort_attached_input_sections): Change to sort
9198 according to section order when specified.
e1df38aa
NC
9199 (Output_section::add_input_section<32, true>): Add new parameter.
9200 (Output_section::add_input_section<64, true>): Add new parameter.
9201 (Output_section::add_input_section<32, false>): Add new parameter.
9202 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9203 * output.h (Output_section::add_input_section): Add new parameter.
9204 (Output_section::input_section_order_specified): New
9205 method.
9206 (Output_section::set_input_section_order_specified): New method.
9207 (Input_section::Input_section): Initialize section_order_index_.
9208 (Input_section::section_order_index): New method.
9209 (Input_section::set_section_order_index): New method.
9210 (Input_section::section_order_index_): New member.
9211 (Input_section::Input_section_sort_section_order_index_compare): New
9212 struct.
9213 (Output_section::input_section_order_specified_): New member.
9214 * script-sections.cc (is_wildcard_string): Delete and move modified
9215 method to gold.h.
9216 (Output_section_element_input::Output_section_element_input): Modify
9217 call to is_wildcard_string.
9218 (Output_section_element_input::Input_section_pattern
9219 ::Input_section_pattern): Ditto.
9220 (Output_section_element_input::Output_section_element_input): Ditto.
9221 * testsuite/Makefile.am (final_layout): New test case.
9222 * testsuite/Makefile.in: Regenerate.
9223 * testsuite/final_layout.cc: New file.
9224 * testsuite/final_layout.sh: New file.
9225
3537c84b
RÁE
92262010-06-01 Rafael Espindola <espindola@google.com>
9227
9228 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9229
105b6afd
RÁE
92302010-06-01 Rafael Espindola <espindola@google.com>
9231
9232 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9233 visibility of symbols.
9234
29e11421
DK
92352010-05-27 Doug Kwan <dougkwan@google.com>
9236
9237 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9238 from start of output section instead of address for a local symbol
9239 in a merged or relaxed section when doing a relocatable link.
9240
5e0f337e
RÁE
92412010-05-26 Rafael Espindola <espindola@google.com>
9242
703d02da 9243 PR 11604
5e0f337e
RÁE
9244 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9245 adding sections the garbage collector removed.
9246 * gold/testsuite/Makefile.am: Add test.
9247 * gold/testsuite/Makefile.in: Regenerate.
9248 * gold/testsuite/plugin_test_7.sh: New.
9249 * gold/testsuite/plugin_test_7_1.c: New.
9250 * gold/testsuite/plugin_test_7_2.c: New.
9251
f4187277
RÁE
92522010-05-26 Rafael Espindola <espindola@google.com>
9253
9254 * script-sections.cc (Output_section_definition::set_section_addresses):
9255 Check for --section-start.
9256
5c388529
DK
92572010-05-26 Doug Kwan <dougkwan@google.com>
9258
9259 * arm.cc (Arm_scan_relocatable_relocs): New class.
9260 (Target_arm::relocate_special_relocatable): New method.
9261 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9262 (Arm_relocate_functions::thumb_branch_common): Same.
9263 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9264 instead of Default_scan_relocatable_relocs.
9265 * target-reloc.h (relocate_for_relocatable): Let target handle
9266 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9267 * target.h (Sized_target::relocate_special_relocatable): New method.
9268
bca1c3ae
ILT
92692010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9270
9271 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9272
0439c796
DK
92732010-05-23 Doug Kwan <dougkwan@google.com>
9274
9275 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9276 instead of a cast.
9277 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9278 with a direct branch, not a conditional branch, to a stub.
9279 * merge.cc (Output_merge_base::record_input_section): New method
9280 defintion.
9281 (Output_merge_data::do_add_input_section): Record input section if
9282 keeps-input-sections flag is set.
9283 (Output_merge_string::do_add_input_section): Ditto.
9284 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9285 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9286 INPUT_SECTIONS_.
9287 (Output_merge_base::keeps_input_sections,
9288 Output_merge_base::set_keeps_input_sections,
9289 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9290 method definitions.
9291 (Output_merge_base::Input_sections): New type declaration.
9292 (Output_merge_base::input_sections_begin,
9293 Output_merge_base::input_sections_end,
9294 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9295 (Output_merge_base::bool keeps_input_sections_,
9296 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9297 Output_merge_base::input_sections_): New data members.
9298 (Output_merge_data::do_set_keeps_input_sections): New method
9299 defintion.
9300 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9301 * output.cc (Output_section::Input_section::relobj): Move method
9302 defintion from class declaration to here and handle merge sections.
9303 (Output_section::Input_section::shndx): Ditto.
9304 (Output_section::Output_section): Remove initializations of removed
9305 data members and initialize new data member LOOKUP_MAPS_.
9306 (Output_section::add_input_section): Set keeps-input-sections flag
9307 for a newly created merge output section as appropriate. Adjust code
9308 to use Output_section_lookup_maps class.
9309 (Output_section::add_relaxed_input_section): Adjst code for lookup
9310 maps code refactoring.
2e702c99 9311 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9312 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9313 class. If adding input section to a newly created merge output
9314 section fails, remove the new merge section.
9315 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9316 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9317 (Output_section::find_merge_section): Ditto.
0439c796 9318 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9319 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9320 Output_section_lookup_maps class.
9321 (Output_section::get_input_sections): Export merge sections. Adjust
9322 code to use Output_section_lookup_maps class.
9323 (Output_section:::add_script_input_section): Adjust code to use
9324 Output_section_lookup_maps class. Update lookup maps for merge
9325 sections also.
9326 (Output_section::discard_states): Use Output_section_lookup_maps.
9327 (Output_section::restore_states): Same.
9328 * output.h (Merge_section_properties): Move class defintion out of
9329 Output_section.
9330 (Output_section_lookup_maps): New class.
9331 (Output_section::Input_section::is_merge_section): New method
9332 defintion.
9333 (Output_section::Input_section::relobj): Move defintion out of class
9334 defintion. Declare method only.
9335 (Output_section::Input_section::shndx): Ditto.
9336 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9337 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9338 (Output_section::Merge_section_by_properties_map,
9339 Output_section::Output_section_data_by_input_section_map,
9340 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9341 Remove types.
2e702c99 9342 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9343 KEEPS_INPUT_SECTIONS.
9344 (Output_section::build_lookup_maps): New method declaration.
9345 (Output_section::merge_section_map_,
9346 Output_section::merge_section_by_properties_map_,
9347 Output_section::relaxed_input_section_map_,
9348 Output_section::is_relaxed_input_section_map_valid_): Remove data
9349 members.
9350 (Output_section::lookup_maps_): New data member.
9351
76295588
L
93522010-05-21 Doug Kwan <dougkwan@google.com>
9353
9354 PR gold/11619
9355 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9356 avoid a compilation error.
9357
d103a984
RÁE
93582010-05-19 Rafael Espindola <espindola@google.com>
9359
9360 * script-sections.cc (Output_section_definition::allocate_to_segment):
9361 Update the phdrs_list even when the output section is NULL.
9362 * testsuite/Makefile.am: Add test.
9363 * testsuite/Makefile.in: Regenerate.
9364 * testsuite/script_test_9.cc: New.
9365 * testsuite/script_test_9.sh: New.
9366 * testsuite/script_test_9.t: New.
9367
6625d24e
DK
93682010-05-19 Doug Kwan <dougkwan@google.com>
9369
9370 * arm.cc (Arm_input_section::original_size): New method.
9371 (Arm_input_section::do_addralign): Add a cast.
9372 (Arm_input_section::do_output_offset): Remove static cast.
9373 (Arm_input_section::original_addralign,
9374 Arm_input_section::original_size_): Change type to uint32_t.
9375 (Arm_input_section::init): Add safe casts for section alignment
9376 and size.
9377 (Arm_input_section::set_final_data_size): Do not set address and
9378 offset of stub table.
9379 (Arm_output_section::fix_exidx_coverage): Change use of of
9380 Output_section::Simple_input_section to that of
9381 Output_section::Input_section.
9382 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9383 except for the first pass.
9384 * output.cc (Output_section::get_input_sections): Change type of
9385 input_sections to std::list<Input_section>.
9386 (Output_section::add_script_input_section): Rename from
9387 Output_section::add_simple_input_section. Change type of SIS
9388 parameter from Simple_input_section to Input_section.
9389 * output.h (Output_section::Simple_input_section): Remove class.
9390 (Output_section::Input_section): Change class visibility to public.
9391 (Output_section::Input_section::addralign): Use stored alignments
9392 for special input sections if set.
9393 (Output_section::Input_section::set_addralign): New method.
9394 (Output_section::get_input_sections): Change parameter type from
9395 list of Simple_input_section to list of Input_section.
9396 (Output_section::add_script_input_section): Rename from
9397 Output_section::add_simple_input_section. Change first parameter's
9398 type from Simple_input_section to Input_section and remove the
9399 second and third parameters.
9400 * script-sections.cc (Input_section::Input_section_list): Change
9401 type to list of Output_section::Input_section/
9402 (Input_section_info::Input_section_info): Change parameter type of
9403 INPUT_SECTION to Output_section::Input_section.
9404 (Input_section_info::input_section): Change return type.
9405 (Input_section_info::input_section_): Change type to
9406 Output_section::Input_section.
9407 (Output_section_element_input::set_section_addresses): Adjust code
9408 to use Output_section::Input_section instead of
9409 Output_section::Simple_input_section. Adjust code for renaming
9410 of Output_section::add_simple_input_section.
9411 (Orphan_output_section::set_section_addresses): Ditto.
9412
e1e82ea4
RW
94132010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9414
9415 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9416 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9417
91e75c8a
RÁE
94182010-05-18 Rafael Espindola <espindola@google.com>
9419
9420 * options.cc (General_options::finalize): Handle -nostdlib.
9421 * options.h (nostdlib): New option.
9422 * script.cc (script_add_search_dir): Handle -nostdlib.
9423
da59ad79
DK
94242010-05-12 Doug Kwan <dougkwan@google.com>
9425
9426 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9427 attributes section only if there no attributes section after merging.
9428 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9429 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9430 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9431 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9432 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9433 and arm_attr_merge_7.stdout.
9434 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9435 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9436 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9437 arm_attr_merge_7b.o): New rules.
9438 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9439 arm_attr_merge_7
9440 * testsuite/Makefile.in: Regenerate.
9441 * testsuite/arm_attr_merge.sh: New file.
9442 * testsuite/arm_attr_merge_[67][ab].s: Same.
9443
3e01a7fd
NC
94442010-05-05 Nick Clifton <nickc@redhat.com>
9445
9446 * po/es.po: Updated Spanish translation.
9447
7ad2014a
L
94482010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9449
9450 * Makefile.am (install-exec-local): Properly install gold as
9451 default cross linker.
9452 * Makefile.in: Regenerated.
9453
4fda8867
NC
94542010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9455 Nick Clifton <nickc@redhat.com>
9456
9457 * configure.ac (install_as_default): Define and set to false
9458 unless --enable-gold or --enable-gold=both/gold has been
9459 specified.
9460 * configure: Regenerate.
9461
9462 * Makefile.am (install-exec-local): Install the executable as
9463 'ld.gold'. If install_as_default is true then also install it as
9464 'ld'.
9465 * Makefile.in: Regenerated.
9466
bd288ea2
ILT
94672010-04-24 Ian Lance Taylor <iant@google.com>
9468
9469 * layout.cc (Layout::layout_reloc): In relocatable link don't
9470 combine reloc sections for grouped sections.
9471
ef38fd8a
ST
94722010-04-23 Sriraman Tallam <tmsriram@google.com>
9473
9474 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9475 sections that are not ordinary to icf.
9476 * icf.cc (get_section_contents): Handle relocation pointing to section
9477 with no object or shndx information.
9478 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9479 * testsuite/Makefile.in: Regenerate.
9480 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9481 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9482
f6973bdc
ILT
94832010-04-22 Ian Lance Taylor <iant@google.com>
9484
9485 * expression.cc (Expression::Expression_eval_info): Add
9486 result_alignment_pointer field.
9487 (Expression::eval_with_dot): Add result_alignment_pointer
9488 parameter. Change all callers.
9489 (Expression::eval_maybe_dot): Likewise.
9490 (class Binary_expression): Add alignment_pointer parameter to
9491 left_value and right_value. Change all callers.
9492 (BINARY_EXPRESSION): Set result alignment.
9493 (class Trinary_expression): Add alignment_pointer parameter to
9494 arg2_value and arg3_value. Change all callers.
9495 (Trinary_cond::value): Set result alignment.
9496 (Max_expression::value, Min_expression::value): Likewise.
9497 (Align_expression::value): Likewise.
9498 * script-sections.cc (class Sections_element): Add dot_alignment
9499 parameter to set_section_addresses virtual function. Update
9500 instantiations.
9501 (class Output_section_element): Likewise.
9502 (Script_sections::create_segments): Add dot_alignment parameter.
9503 Change all callers.
9504 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9505 (Script_sections::set_phdrs_clause_addresses): Likewise.
9506 * script-sections.h: Update declarations.
9507 * script.h: Update declarations.
9508 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9509 min_p_align.
9510 * testsuite/script_test_3.t: Set large alignment.
9511 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9512 segment has expected alignment.
9513
9c9c98a5
NC
95142010-04-22 Nick Clifton <nickc@redhat.com>
9515
9516 * po/gold.pot: Updated by the Translation project.
9517 * po/vi.po: Updated Vietnamese translation.
9518
2253bfba
L
95192010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9520
9521 * testsuite/Makefile.am (check_PROGRAMS): Add
9522 icf_virtual_function_folding_test.
9523 * testsuite/Makefile.in: Regenerated.
9524
85fdf906
AH
95252010-04-15 Andrew Haley <aph@redhat.com>
9526
9527 * options.h (merge_exidx_entries): New option.
9528 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9529 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9530 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9531 (Target_arm::merge_exidx_entries): New function.
9532 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9533 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9534 to Arm_exidx_fixup constructor.
9535 Add new arg, merge_exidx_entries.
9536 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9537 Arm_output_section::fix_exidx_coverage.
9538
ce97fa81
ST
95392010-04-18 Sriraman Tallam <tmsriram@google.com>
9540
9541 * icf.cc (get_section_contents): Check for preemptible functions.
9542 Ignore addend when appropriate.
9543 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9544 section folded.
9545 (add_from_relobj): Check for section folded.
9546 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9547 * symtab.h (should_add_dynsym_entry): Add new parameter.
9548 * target-reloc.h (scan_relocs): Check for section folded.
9549 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9550 Check reloc types for function pointers in shared objects.
9551 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9552 case.
9553 (icf_preemptible_functions_test): New test case.
9554 (icf_string_merge_test): New test case.
9555 * testsuite.Makefile.in: Regenerate.
9556 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9557 bar_glob. Refactor code.
9558 * testsuite/icf_preemptible_functions_test.cc: New file.
9559 * testsuite/icf_preemptible_functions_test.sh: New file.
9560 * testsuite/icf_string_merge_test.cc: New file.
9561 * testsuite/icf_string_merge_test.sh: New file.
9562 * testsuite/icf_virtual_function_folding_test.cc: New file.
9563 * testsuite/icf_virtual_function_folding_test.sh: New file.
9564
04ceb17c
DK
95652010-04-14 Doug Kwan <dougkwan@google.com>
9566
9567 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9568 for local symbol recounting if we remove a section due to ICF.
9569 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9570 there are no regular objects in input.
9571
153e7da4
DK
95722010-04-13 Doug Kwan <dougkwan@google.com>
9573
9574 * arm.cc (Arm_input_section::set_final_data_size): Compute
9575 accurate final data size instead of using current data size.
9576
4dbd9faf
DK
95772010-04-09 Doug Kwan <dougkwan@google.com>
9578
9579 * layout.cc (Layout::choose_output_section): Handle script section
9580 types.
9581 (Layout::make_output_section_for_script): Add section type parameter.
9582 Handle script section types.
9583 * layout.h (Layout::make_output_section_for_script): Add section
9584 type parameter.
9585 * output.cc (Output_section::Output_section): Initialize data member
9586 is_noload_.
9587 (Output_section::do_reset_address_and_file_offset): Do not set address
9588 to 0 if section is a NOLOAD section.
9589 * output.h (Output_section::is_noload): New method.
9590 (Output_section::set_is_noload): Ditto.
9591 (Output_section::is_noload_): New data member.
9592 * script-c.h (Script_section_type): New enum type.
9593 (struct Parser_output_section_header): Add new file section_type.
9594 * script-sections.cc (Sections_element::output_section_name): Add
9595 parameter for returning script section type.
9596 (Output_section_definition::output_section_name): Ditto.
9597 (Output_section_definition::section_type)P; New method.
9598 (Output_section_definiton::script_section_type_name): Ditto.
9599 (Output_section_definition::script_section_type_): New data member.
9600 (Output_section_definition::Output_section_definition): Initialize
9601 data member Output_section_definition::script_section_type_.
9602 (Output_section_definition::create_sections): Pass script section type
9603 to Layout::make_output_section_for_script.
9604 (Output_section_definition::output_section_name): Return script
9605 section type to caller.
9606 (Output_section_definition::set_section_address): Do not advance
9607 dot value and load address if section type is NOLOAD. Set address
9608 of NOLOAD sections regardless of section flags.
9609 (Output_section_definition::print): Print section type if it is
9610 not SCRIPT_SECTION_TYPE_NONE.
9611 (Output_section_definition::section_type): New method.
9612 (Output_section_definition::script_section_type_name): Ditto.
9613 (Script_sections::output_section_name): Add new parameter
9614 PSECTION_TYPE for returning script section type. Pass it to
9615 section elements. Handle discard sections.
9616 (Sort_output_sections::operator()): Handle NOLOAD sections.
9617 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9618 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9619 returning script section type.
9620 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9621 INFO and NOLOAD.
9622 * yyscript.y (union): Add new field SECTION_TYPE.
9623 (COPY, DSECT, INFO, NOLOAD): New tokens.
9624 (opt_address_and_section_type): Change type to output_section_header.
9625 (section_type): New non-terminal
9626 (section_header): Handle section type.
2253bfba 9627 (opt_address_and_section_type): Return section type value.
4dbd9faf 9628
721ea635
L
96292010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9630
9631 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9632 * testsuite/plugin_common_test_2.c (foo): Likewise.
9633
6bf924b0
DK
96342010-04-08 Doug Kwan <dougkwan@google.com>
9635
9636 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9637 Output_merge_data.
9638 * output.cc (Output_section::add_merge_input_section): Simplify
9639 code and return status of Output_merge_base::add_input_section.
e1df38aa 9640 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9641 returns true.
9642
24af6f92
DK
96432010-04-07 Doug Kwan <dougkwan@google.com>
9644
9645 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9646 if section is marked as containing instructions but has no mapping
9647 symbols.
9648 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9649 correct section index.
9650 (Arm_relobj::find_linked_text_section): Ditto.
9651
00698fc5
CC
96522010-04-07 Cary Coutant <ccoutant@google.com>
9653
9654 * archive.cc (include_member): Destroy Read_symbols_data object before
9655 releasing file.
9656 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9657 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9658 (Read_symbols_data::~Read_symbols_data) New destructor.
9659 (Section_relocs::Section_relocs) New constructor.
9660 (Section_relocs::~Section_relocs) New destructor.
9661 (Read_relocs_data::Read_relocs_data) New constructor.
9662 (Read_relocs_data::~Read_relocs_data) New destructor.
9663 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9664 pointers to NULL after deleting.
9665
7296d933
DK
96662010-04-07 Doug Kwan <dougkwan@google.com>
9667
9668 * arm.cc: Replace "endianity" with "endianness" in comments.
9669 (Arm_exidx_cantunwind): Ditto.
9670 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9671 (Arm_relobj::merge_flags_and_attributes): New method.
9672 (Arm_relobj::merge_flags_and_attributes_): New data member.
9673 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9674 (Arm_relobj::scan_sections_for_stubs): Ditto.
9675 (Arm_relobj::do_read_symbols): Check to see if we really want to
9676 merge processor-specific flags and attributes. Exit early if
9677 an object is empty except for section names and the undefined symbol.
9678 (Target_arm::do_finalize_sections): Move check for ELF format to
9679 Arm_relobj::do_read_symbols. Merge processor specific flags and
9680 attributes from a regular object only when we have determined that
9681 it is aapropriate. Do not create an .ARM.attributes section in
9682 output if there is no regular input object.
9683 (Target_arm::merge_processor_specific_flags): Check
9684 --warn-mismatch before printing any error.
9685 (Target_arm::merge_object_attributes): Ditto.
9686 * gold.cc (queue_middle_tasks): Handle the case in which there is
9687 no regular object in input.
9688 * options.cc (General_options::parse_EB): New method.
9689 (General_options::parse_EL): Same.
9690 (General_options::General_options): Initialize endianness_.
9691 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9692 New options.
9693 (General_options::Endianness): New enum.
9694 (General_options::endianness): New method.
9695 (General_options::endianness_): New data member.
9696 * parameters.cc (Parameters::set_options): Check target endianness.
9697 (Parameters::set_target_once): Ditto.
9698 (Parameters::check_target_endianness): New method.
9699 (parameters_force_valid_target): If either -EL or -EB is specified,
9700 use it to define endianness of default target.
9701 * parameters.h (Parameters::check_target_endianness): New method
9702 declaration.
9703 * target.h (class Target): Change "endianity" to "endianness"
9704 in comments.
9705
efc8d4f2
RW
97062010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9707
9708 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9709 * configure: Regenerate.
9710 * Makefile.in: Regenerate.
9711 * testsuite/Makefile.in: Regenerate.
9712
be234d88
CC
97132010-04-06 Cary Coutant <ccoutant@google.com>
9714
9715 gcc PR lto/42757
9716 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9717 prevailing definitions of common symbols.
9718 * testsuite/plugin_test_6.sh: New test case.
9719 * testsuite/plugin_common_test_1.c: New test case.
9720 * testsuite/plugin_common_test_2.c: New test case.
9721 * testsuite/Makefile.am (plugin_test_6): New test case.
9722 * testsuite/Makefile.in: Regenerate.
9723
bd32c6bd
NC
97242010-04-06 Nick Clifton <nickc@redhat.com>
9725
9726 * po/vi.po: New Vietnamese translation.
9727
323c532f
DK
97282010-03-30 Doug Kwan <dougkwan@google.com>
9729
9730 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9731
4fcd97eb
DK
97322010-03-25 Doug Kwan <dougkwan@google.com>
9733
9734 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9735 to avoid a conversion warning on a 32-bit host.
9736
4ebf39db
ILT
97372010-03-24 Ian Lance Taylor <iant@google.com>
9738
9739 * testsuite/script_test_3.t: Add a TLS segment.
9740 * testsuite/Makefile.am (check_PROGRAMS): Add
9741 tls_phdrs_script_test.
9742 (tls_phdrs_script_test_SOURCES): Define.
9743 (tls_phdrs_script_test_DEPENDENCIES): Define.
9744 (tls_phdrs_script_test_LDFLAGS): Define.
9745 (tls_phdrs_script_test_LDADD): Define.
9746 * testsuite/Makefile.in: Rebuild.
9747
4a599bdd
CC
97482010-03-23 Cary Coutant <ccoutant@google.com>
9749
9750 * fileread.cc (find_or_make_view): Fix comment.
9751
6c93b22c
ILT
97522010-03-23 Ian Lance Taylor <iant@google.com>
9753
9754 * script-sections.cc (class Orphan_section_placement): Define
9755 PLACE_TLS and PLACE_TLS_BSS.
9756 (Orphan_section_placement::Orphan_section_placement): Initialize
9757 new places.
9758 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9759 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9760 (tls_script_test_SOURCES): Define.
9761 (tls_script_test_DEPENDENCIES): Define.
9762 (tls_script_test_LDFLAGS): Define.
9763 (tls_script_test_LDADD): Define.
9764 * testsuite/Makefile.in: Rebuild.
9765
a2c7281b
DK
97662010-03-22 Doug Kwan <dougkwan@google.com>
9767
9768 * arm.cc (Arm_relocate_functions::abs8,
9769 Arm_relocate_functions::abs16): Use correct check for overflow
9770 specified in the ARM ELF specs.
9771 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9772 target of a BLX instruction specially.
9773 (Reloc_stub::stub_type_for_reloc): Ditto.
9774 (Relocate::relocate): Use symbolic names instead of numeric relocation
9775 codes to report error.
9776 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9777 workaround.
9778 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9779 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9780 thumb2_blx_out_of_range.stdout
9781 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9782 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9783 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9784 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9785 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9786 thumb2_blx_in_range, thumb2_blx_in_range.o,
9787 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9788 thumb2_blx_out_of_range.o): New rules.
2e702c99 9789 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9790 thumb2_blx_in_range and thumb2_blx_out_of_range.
9791 * testsuite/Makefile.in: Regenerate.
9792 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9793 * testsuite/thumb_blx_in_range.s: New file.
9794 * testsuite/thumb_blx_out_of_range.s: New file.
9795
b0193076
RÁE
97962010-03-22 Rafael Espindola <espindola@google.com>
9797
9798 * archive.cc (Should_include): Move to archive.h.
9799 (should_include_member): Make it a member of Archive.
9800 (Lib_group): New.
9801 (Add_lib_group_symbols): New.
9802 * archive.h: Include options.h.
9803 (Archive_member): Moved from Archive.
9804 (Should_include): Moved from archive.cc.
9805 (Lib_group): New.
9806 (Add_lib_group_symbols): New.
9807 * dynobj.cc (do_should_include_member): New.
9808 * dynobj.h (do_should_include_member): New.
9809 * gold.cc (queue_initial_tasks): Update call to queue.
9810 * main.cc (main): Print lib group stats.
9811 * object.cc (do_should_include_member): New.
9812 * object.h: Include archive.h.
9813 (Object::should_include_member): New.
9814 (Object::do_should_include_member): New.
9815 (Sized_relobj::do_should_include_member): New.
9816 * options.cc (General_options::parse_start_lib): New.
9817 (General_options::parse_end_lib): New.
9818 (Input_arguments::add_file): Handle lib groups.
9819 (Input_arguments::start_group): Check we are not in a lib.
9820 (Input_arguments::start_lib): New.
9821 (Input_arguments::end_lib): New.
9822 * options.h (General_options): Add start_lib and end_lib.
9823 (Input_argument::lib_): New.
9824 (Input_argument::lib): New.
9825 (Input_argument::is_lib): New.
9826 (Input_file_lib): New.
9827 (Input_arguments::in_lib_): New.
9828 (Input_arguments::in_lib): New.
9829 (Input_arguments::start_lib): New.
9830 (Input_arguments::end_lib_): New.
9831 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9832 in unused members as preempted.
9833 (Sized_pluginobj::do_should_include_member): New.
9834 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9835 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9836 return the blocker.
9837 (Read_symbols::do_whole_lib_group): New.
9838 (Read_symbols::do_lib_group): New.
9839 (Read_symbols::do_read_symbols): Handle lib groups.
9840 (Read_symbols::get_name): Handle lib groups.
9841 * readsyms.h (Read_symbols): Add an archive member pointer.
9842 (Read_symbols::do_whole_lib_group): New.
9843 (Read_symbols::do_lib_group): New.
9844 (Read_symbols::member_): New.
9845 * script.cc (read_input_script): Update call to queue_soon.
9846
d099120c
DK
98472010-03-19 Doug Kwan <dougkwan@google.com>
9848
9849 * arm.cc (Stub_table::Stub_table): Initialize new data members
9850 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9851 (Stub_table::add_reloc_stub): Assign stub offset and update
9852 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9853 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9854 New data members.
2e702c99 9855 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9856 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9857 instead of going over all reloc stubs.
2e702c99 9858 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9859 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9860 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9861 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9862 Stringpool_template::offset_.
9863 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9864 Stringpool_template::offset_ to zero.
9865
1aa37384
DK
98662010-03-15 Doug Kwan <dougkwan@google.com>
9867
9868 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9869 offset_.
9870 (Stringpool_template::new_key_offset): New method.
9871 (Stringpool_template::add_string): Assign offsets when adding new
9872 strings.
9873 (Stringpool_template::set_string_offsets): Do not set string offsets
9874 when not optimizing.
9875 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9876 member size_.
2e702c99
RM
9877 (Chunked_vector::clear): Clear size_.
9878 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9879 (Chunked_vector::size): Return size_.
9880 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9881 (Chunked_vector::size_): New data member.
1aa37384
DK
9882 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9883 (Stringpool_template::new_key_offset): New method declaration.
9884 (Stringpool_template::offset_): New data member.
9885
b672b057
RÁE
98862010-03-15 Rafael Espindola <espindola@google.com>
9887
9888 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9889 Add_symbols' constructor.
9890 * readsyms.h (Add_symbols): Remove the input_group member.
9891
b6848d3c
ILT
98922010-03-10 Ian Lance Taylor <iant@google.com>
9893
9894 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9895 target to ask whether a reference to a symbol requires a stack
9896 split.
9897 * target.h (Target::is_call_to_non_split): New function.
9898 (Target::do_is_call_to_non_split): Declare virtual function.
9899 * target.cc: Include "symtab.h".
9900 (Target::do_is_call_to_non_split): New function.
9901 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9902
a2a5469e
CC
99032010-03-10 Cary Coutant <ccoutant@google.com>
9904
9905 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9906 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9907 (File_read::open[2]): Add whole_file_view_ to list of views.
9908 (File_read::make_view): Remove test of whole_file_view_.
9909 (File_read::find_or_make_view): Create whole_file_view_ if
9910 necessary.
9911 (File_read::clear_views): Replace bool parameter with enum;
9912 adjust all callers. Don't delete views with permanent data;
9913 do delete cached views and views from archives if
9914 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9915 if clearing the corresponding view.
9916 * fileread.h (File_read::Clear_views_mode): New enum.
9917 (File_read::View::is_permanent_view): New method.
9918 (File_read::clear_views): Replace bool parameter
9919 with enum; adjust all callers.
9920 * options.h (General_options): Change keep_files_mapped option;
9921 add map_whole_files.
9922 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9923 releasing the file.
9924 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9925 the file.
9926
8861f32b
DM
99272010-03-10 David S. Miller <davem@davemloft.net>
9928
9929 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9930
d62d0f5f
ST
99312010-03-09 Sriraman Tallam <tmsriram@google.com>
9932
9933 * icf.cc (get_section_contents): Add '@' marker after processing the
9934 merge reloc.
9935
9177756d
DK
99362010-03-08 Doug Kwan <dougkwan@google.com>
9937
9938 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9939 due to a conversion warning.
9940 (Arm_relobj::update_output_local_symbol_count): Check for local
9941 symbol with unset output index.
9942
9e9e071b
ILT
99432010-03-05 Ian Lance Taylor <iant@google.com>
9944
9945 * options.h (class General_options): Add --spare-dynamic-tags.
9946 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9947 --spare-dynamic-tags.
9948
a81ee015
ILT
99492010-03-05 Ian Lance Taylor <iant@google.com>
9950
9951 * incremental.cc: Include "libiberty.h".
9952
44ec90b9
RO
99532010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9954
9955 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9956 function, is_info_ member.
9957 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9958 (Versions::Versions): Update caller.
9959 (Versions::define_base_version): Likewise.
9960 (Versions::add_def): Likewise.
9961
0897ed3b
ST
99622010-03-03 Sriraman Tallam <tmsriram@google.com>
9963
9964 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9965 (Scan::possible_function_pointer_reloc): New function.
9966 (Scan::local_reloc_may_be_function_pointer): Change to call
9967 possible_function_pointer_reloc.
9968 (Scan::global_reloc_may_be_function_pointer): Ditto.
9969 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9970 relocations in ".data.rel.ro._ZTV" section.
9971 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9972 * testsuite/icf_safe_so_test.cc: Ditto.
9973 * testsuite/icf_safe_test.cc: Ditto.
9974 * testsuite/icf_safe_test.sh: Ditto.
9975
d3bbad62
ILT
99762010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9977 Ian Lance Taylor <iant@google.com>
9978
9979 * target-reloc.h (relocate_section): Check the symbol table index
9980 for -1U before setting the local symbol index.
9981 (scan_relocatable_relocs): If copying the relocation, record that
9982 the local symbol is required.
9983 * object.h (Symbol_value::is_output_symtab_index_set): New
9984 function.
9985 (Symbol_value::may_be_discarded_from_output_symtab): New
9986 function.
9987 (Symbol_value::has_output_symtab_entry): New function.
9988 (Symbol_value::needs_output_symtab_entry): Remove.
9989 (Symbol_value::output_symtab_index): Make sure the symbol index is
9990 set.
9991 (Symbol_value::set_output_symtab_index): Make sure the symbol
9992 index is not set. Make sure the new index is valid.
9993 (Symbol_value::set_must_have_output_symtab_entry): New function.
9994 (Symbol_value::has_output_dynsym_entry): New function.
9995 (Symbol_value::set_output_dynsym_index): Make sure the new index
9996 is valid.
9997 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9998 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9999 local symbol if permitted.
10000 (Sized_relobj::do_finalize_local_symbols): Call
10001 is_output_symtab_index_set rather than needs_output_symtab_entry.
10002 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10003 rather than needs_output_symtab_entry. Call
10004 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10005 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10006 is_output_symtab_index_set rather than needs_output_symtab_entry.
10007 * testsuite/discard_locals_relocatable_test.c: New file.
10008 * testsuite/discard_locals_test.sh: Test -r.
10009 * testsuite/Makefile.am (check_DATA): Add
10010 discard_locals_relocatable_test1.syms,
10011 discard_local_relocatable_test2.syms.
10012 (MOSTLYCLEANFILES): Likewise. Also add
10013 discard_locals_relocatable_test1.lout and
10014 discard_locals_relocatable_test2.out.
10015 (discard_locals_relocatable_test1.syms): New target.
10016 (discard_locals_relocatable_test.o): New target.
10017 (discard_locals_relocatable_test1.out): New target.
10018 (discard_locals_relocatable_test2.syms): New target.
10019 (discard_locals_relocatable_test2.out): New target.
10020 (various): Add missing ../ld-new dependencies.
10021 * testsuite/Makefile.in: Rebuild.
10022
7e8ccf26
NC
100232010-03-03 Nick Clifton <nickc@redhat.com>
10024
10025 * po/fi.po: New Finnish translation.
10026
2a0ff005
DK
100272010-03-01 Doug Kwan <dougkwan@google.com>
10028
10029 * layout.cc (Layout::Layout): Force section types of .init_array*,
10030 .preinit_array* and .fini_array* sections.
10031 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10032 Fix check of return value of std::string::find.().
10033 (Output_section::Input_section_sort_compare::operator()): Remove
10034 comment about .init_array.
10035 (Output_section::Input_section_sort_init_fini_compare::operator()):
10036 New method.
10037 (Output_section::sort_attached_input_sections): Handle .init_array
10038 and .fini_array specially.
10039 * output.h (Output_section::Inut_section_sort_compare): Update
10040 comment.
10041 (Output_section::Input_section_sort_init_fini_compare): New struct.
10042
c3e4ae29
DK
100432010-02-26 Doug Kwan <dougkwan@google.com>
10044
10045 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10046 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10047 * testsuite/debug_msg.sh: Avoid matching source line number for
10048 use of global variable undef_int.
10049
2fd9ae7a
DK
100502010-02-26 Doug Kwan <dougkwan@google.com>
10051
10052 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10053 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10054 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10055 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10056 * options.cc (General_options::General_options): Initialize member
10057 fix_v4bx_.
10058 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10059 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10060 and rm_no_fix_v4bx.stdout
10061 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10062 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10063 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10064 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10065 and arm_no_fix_v4bx.
10066 * Makefile.in: Regenerate.
10067 * testsuite/arm_fix_v4bx.s: New file.
10068 * testsuite/arm_fix_v4bx.sh: Ditto.
10069
67ec7d0b
DK
100702010-02-24 Doug Kwan <dougkwan@google.com>
10071
10072 * arm.cc (Target_arm::got_section): Make the .got section the first
10073 non RELRO section in the data segment.
10074 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10075 suffixes of section names.
10076
10165461
DK
100772010-02-24 Doug Kwan <dougkwan@google.com>
10078
10079 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10080 flags and attributes merging if an input file is a binary file.
10081 * fileread.cc (Input_file::open): Record format of original file.
10082 * fileread.h (Input_file::Format): New enum type.
2e702c99 10083 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10084 (Input_file::format): New method definition.
10085 (Input_file::format_):: New data member.
10086
4a54abbb
DK
100872010-02-24 Doug Kwan <dougkwan@google.com>
10088
10089 * arm.cc (Arm_output_data_got): New class.
10090 (ARM_TCB_SIZE): New constant
10091 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10092 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10093 If user uses a script with a SECTIONS clause, issue only a warning
10094 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10095 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10096 garbage collection.
10097 (Target_arm::got_mode_index_entry): Handle static linking.
10098 (Target_arm::Scan::local): Ditto.
10099 (Target_arm::Scan::global): Ditto.
10100 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10101 all incorrectly implemented relocations.
e1df38aa 10102 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10103 Arm_output_section::fix_exidx_coverage.
10104 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10105 from ".ARM.exidx." and ".ARM.extab.".
10106
ca419a6f
ILT
101072010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10108
10109 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10110 section if it does not already exist.
10111 * attributes.cc (Attributes_section_data::Attributes_section_data):
10112 Don't crash if size is zero.
10113
135b9c78
ILT
101142010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10115 Ian Lance Taylor <iant@google.com>
10116
10117 * gold.cc (queue_middle_tasks): If no input files were opened,
10118 exit.
10119 * workqueue.h (Task_function::Task_function): Assert that there is
10120 a blocker.
10121
bb0bfe4f
DK
101222010-02-22 Doug Kwan <dougkwan@google.com>
10123
10124 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10125 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10126 types to avoid warnings due to different uint64_t implementations
10127 on different hosts.
10128
2a2b6d42
DK
101292010-02-21 Doug Kwan <dougkwan@google.com>
10130
10131 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10132 handling of the maximum backward branch offset.
2e702c99 10133 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10134 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10135 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10136 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10137 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10138 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10139 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10140 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10141 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10142 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10143 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10144 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10145 thumb2_bl_out_of_range.o): New rules.
10146 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10147 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10148 thumb2_bl_out_of_range
10149 * testsuite/Makefile.in: Regenerate.
10150 * testsuite/arm_bl_in_range.s: New file.
10151 * testsuite/arm_bl_out_of_range.s: Ditto.
10152 * testsuite/arm_branch_in_range.sh: Ditto.
10153 * testsuite/arm_branch_range.t: Ditto.
10154 * testsuite/thumb2_branch_range.t: Ditto.
10155 * testsuite/thumb_bl_in_range.s: Ditto.
10156 * testsuite/thumb_bl_out_of_range.s: Ditto.
10157 * testsuite/thumb_branch_range.t: Ditto.
10158
b487ad64
ST
101592010-02-20 Sriraman Tallam <tmsriram@google.com>
10160
10161 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10162 Add reloc offset information.
10163 * icf.cc (get_section_contents): Change iterators to point to the new
10164 vectors. Add reloc offset information to the contents.
10165 * icf.h (Icf::Sections_reachable_info): New typedef.
10166 (Icf::Sections_reachable_list): New typedef.
10167 (Icf::Offset_info): New typedef.
10168 (Icf::Reloc_info): New struct typedef.
10169 (Icf::Reloc_info_list): New typedef.
10170 (Icf::symbol_reloc_list): Delete method.
10171 (Icf::addend_reloc_list): Delete method.
10172 (Icf::section_reloc_list): Delete method.
10173 (Icf::reloc_info_list): New method.
10174 (Icf::reloc_info_list_): New member.
10175
f96accdf
DK
101762010-02-19 Doug Kwan <dougkwan@google.com>
10177
10178 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10179 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10180 * arm.cc (Arm_relocation_functions): New forward declaration.
10181 (Target_arm::Target_arm): Initialize new data members
10182 got_mod_index_offset_ and tls_base_symbol_defined_.
10183 (Target_arm::Relocate::relocate_tls): New method.
10184 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10185 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10186 New methods.
2e702c99 10187 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10188 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10189 (Target_arm::got_mod_index_offset_,
10190 Target_arm::tls_base_symbol_defined_): New data members.
10191 (Target_arm::Scan::local, Target::Scan::global,
10192 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10193 relocations.
10194
c8761b9a
DK
101952010-02-18 Doug Kwan <dougkwan@google.com>
10196
10197 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10198 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10199 text section as a parameter becuase some broken tools may not set
10200 the link in section header.
10201 (Target_arm::has_got_section): New method.
10202 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10203 without any mapping symbol as data only. Remove warning.
10204 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10205 link in its section header, try to discover the link by inspecting the
10206 REL31 relocation at the beginning of the section.
10207 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10208 in error message.
10209 (Target_arm::Scan::global): Treat any reference to the symbol
10210 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10211
21bb3914
ST
102122010-02-12 Sriraman Tallam <tmsriram@google.com>
10213
10214 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10215 (Scan::global_reloc_may_be_function_pointer): New function.
10216 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10217 (Scan::global_reloc_may_be_function_pointer): New function.
10218 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10219 (Scan::global_reloc_may_be_function_pointer): New function.
10220 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10221 (Scan::global_reloc_may_be_function_pointer): New function.
10222 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10223 (Scan::global_reloc_may_be_function_pointer): New function.
10224 (Scan::possible_function_pointer_reloc): New function.
10225 (Target_x86_64::can_check_for_function_pointers): New function.
10226 * gc.h (gc_process_relocs): Scan relocation types to determine if
10227 function pointers were taken for targets that support it.
10228 * icf.cc (Icf::find_identical_sections): Include functions for
10229 folding in safe ICF whose pointer is not taken.
10230 * icf.h (Secn_fptr_taken_set): New typedef.
10231 (fptr_section_id_): New member.
10232 (section_has_function_pointers): New function.
10233 (set_section_has_function_pointers): New function.
10234 (check_section_for_function_pointers): New function.
10235 * options.h: Fix comment for safe ICF option.
10236 * target.h (can_check_for_function_pointers): New function.
10237 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10238 Modify icf_safe_test for X86-64.
10239 * testsuite/Makefile.in: Regenerate.
10240 * testsuite/icf_safe_so_test.cc: New file.
10241 * testsuite/icf_safe_so_test.sh: New file.
10242 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10243 (main): Change to take pointer to function kept_func_3.
10244 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10245 folding is done correctly for X86-64.
10246
0da6fa6c
DM
102472010-02-12 David S. Miller <davem@davemloft.net>
10248
10249 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10250 is_symbolless parameter.
10251 (Output_reloc<SHT_REL>::is_symbolless): New.
10252 (Output_reloc<SHT_REL>::is_symbolless_): New.
10253 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10254 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10255 (Output_reloc<SHT_RELA>::is_symbolless): New.
10256 (Output_data_reloc::add_global): Handle is_symbolless.
10257 (Output_data_reloc::add_global_relative): Likewise.
10258 (Output_data_reloc::add_local): Likewise.
10259 (Output_data_reloc::add_local_relative): Likewise.
10260 (Output_data_reloc::add_symbolless_global_addend): New.
10261 (Output_data_reloc::add_symbolless_local_addend): New.
10262 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10263 is_symbolless.
10264 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10265 instead of ->is_relative_
10266 (Output_reloc::write): Likewise.
10267 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10268 (Output_reloc::write_rel): Simplify.
10269
10270 * sparc.cc (Target_sparc::Scan::local): Use
10271 ->add_symbolless_local_addend as needed.
10272 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10273 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10274 based upon relocation offset.
10275
e4782e83
DK
102762010-02-11 Doug Kwan <dougkwan@google.com>
10277
10278 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10279 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10280 beginning of function.
10281 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10282 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10283 parameter is_32bit in calls to should_apply_static_reloc.
10284 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10285 (check_DATA): Add arm_abs_global.stdout.
10286 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10287 arm_abs_global.stdout): New rules.
10288 (MOSTLLYCLEANFILES): Add arm_abs_global
10289 * Makefile.in: Regenerate.
10290 * testsuite/arm_abs_global.s: New file.
10291 * testsuite/arm_abs_global.sh: Ditto.
10292 * testsuite/arm_abs_lib.s: Ditto.
10293
93ceb764
ILT
102942010-02-11 Ian Lance Taylor <iant@google.com>
10295
10296 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10297 Read_relocs task.
10298 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10299 Allocate_commons_task first.
10300 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10301 task, rather than symtab_lock_.
10302 (Gc_process_relocs::~Gc_process_relocs): New function.
10303 (Gc_process_relocs::is_runnable): Check this_blocker_.
10304 (Gc_process_relocs::locks): Use next_blocker_ rather than
10305 blocker_.
10306 (Scan_relocs::~Scan_relocs): New function.
10307 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10308 symtab_lock_.
10309 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10310 next_blocker_.
10311 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10312 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10313 constructor accordingly.
10314 (class Gc_process_relocs): Likewise.
10315 (class Scan_relocs): Likewise.
10316 * common.h (class Allocate_commons_task): Remove symtab_lock_
10317 field, and corresponding constructor parameter.
10318 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10319 symtab_lock_.
10320 (Allocate_commons_task::locks): Likewise.
10321
114dfbe1
ILT
103222010-02-11 Ian Lance Taylor <iant@google.com>
10323
10324 * gold-threads.h (class Once): Define.
10325 (class Initialize_lock): Rewrite as child of Once.
10326 * gold-threads.cc (class Once_initialize): Define.
10327 (once_pointer_control): New static variable.
10328 (once_pointer, once_arg): New static variables.
10329 (c_run_once): New static function.
10330 (Once::Once, Once::run_once, Once::internal_run): New functions.
10331 (class Initialize_lock_once): Remove.
10332 (initialize_lock_control): Remove.
10333 (initialize_lock_pointer): Remove.
10334 (initialize_lock_once): Remove.
10335 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10336 (Initialize_lock::initialize): Rewrite.
10337 (Initialize_lock::do_run_once): New function.
10338 * archive.cc (Archive::interpret_header): Only clear name if it is
10339 not already empty.
10340 * fileread.cc: Include "gold-threads.h"
10341 (file_counts_lock): New static variable.
10342 (file_counts_initialize_lock): Likewise.
10343 (File_read::release): Only increment counts when using --stats.
10344 Use a lock around the increment.
10345 * parameters.cc (class Set_parameters_target_once): Define.
10346 (set_parameters_target_once): New static variable.
10347 (Parameters::Parameters): Move here from parameters.h.
10348 (Parameters::set_target): Rewrite.
10349 (Parameters::set_target_once): New function.
10350 (Parameters::clear_target): Move here and rewrite.
10351 * parameters.h (class Parameters): Update declarations. Add
10352 set_parameters_target_once_ field.
10353 (Parameters::Parameters): Move to parameters.cc.
10354 (Parameters::clear_target): Likewise.
10355 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10356 task.
10357 (Start_group::~Start_group): New function.
10358 (Start_group::is_runnable): New function.
10359 (Start_group::locks, Start_group::run): New functions.
10360 (Finish_group::run): Change saw_undefined to size_t.
10361 * readsyms.h (class Start_group): Define.
10362 (class Finish_group): Change saw_undefined_ field to size_t.
10363 (Finish_group::Finish_group): Remove saw_undefined and
10364 this_blocker parameters. Change all callers.
10365 (Finish_group::set_saw_undefined): New function.
10366 (Finish_group::set_blocker): New function.
10367 * symtab.h (class Symbol_table): Change saw_undefined to return
10368 size_t. Change saw_undefined_ field to size_t.
10369 * target-select.cc (Set_target_once::do_run_once): New function.
10370 (Target_selector::Target_selector): Initialize set_target_once_
10371 field. Don't initialize lock_ and initialize_lock_ fields.
10372 (Target_selector::instantiate_target): Rewrite.
10373 (Target_selector::set_target): New function.
10374 * target-select.h (class Set_target_once): Define.
10375 (class Target_selector): Update declarations. Make
10376 Set_target_once a friend. Remove lock_ and initialize_lock_
10377 fields. Add set_target_once_ field.
10378
fa17a3f4
ILT
103792010-02-10 Ian Lance Taylor <iant@google.com>
10380
10381 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10382 queueing any tasks.
10383 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10384 (queue_middle_tasks): Add all blockers before queueing any tasks.
10385 (queue_final_tasks): Likewise.
10386 * token.h (Task_token::add_blockers): New function.
10387 * object.h (Input_objects::number_of_relobjs): New function.
10388
c7177d31
ILT
103892010-02-10 Ian Lance Taylor <iant@google.com>
10390
5de0e392
ILT
10391 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10392 shared, not if not position independent.
10393 * x86_64.cc (Relocate::relocate_tls): Likewise.
10394 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10395 (tls_pie_pic_test): New target.
10396 * testsuite/Makefile.in: Rebuild.
10397
c7177d31
ILT
10398 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10399 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10400 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10401 * testsuite/Makefile.in: Rebuild.
10402
684b268a
DM
104032010-02-09 David S. Miller <davem@davemloft.net>
10404
10405 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10406 R_SPARC_RELATIVE using ->add_local_relative().
10407 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10408
612a8d3d
DM
10409 * output.h (Output_data_dynamic::add_section_size): New method
10410 that takes two Output_data objects.
10411 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10412 entry param. Handle it in initializers.
10413 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10414 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10415 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10416 arg.
10417 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10418 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10419 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10420 for dynrel_includes_plt.
10421 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10422 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10423 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10424 before .rela.plt
10425 (Target_sparc::do_finalize_sections): Update to pass true for
10426 dynrel_includes_plt.
10427 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10428 output before .rela.plt
10429 (Target_powerpc::do_finalize_sections): Update to pass true for
10430 dynrel_includes_plt when 32-bit.
10431
cb1be87e
DK
104322010-02-08 Doug Kwan <dougkwan@google.com>
10433
10434 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10435 method.
10436 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10437 Arm_relobj::scan_section_for_cortex_a8_stubs,
10438 Arm_relobj::do_relocation_section): Instead of calling
10439 Output_section::output_address, use faster
10440 Arm_relobj::simple_input_section_output_address.
10441
705b5121
DM
104422010-02-08 David S. Miller <davem@davemloft.net>
10443
10444 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10445 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10446 relocation helper function.
10447
024c4466
DM
10448 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10449 just like R_SPARC_GOT{10,13,22}.
10450 (Target_sparc::Scan::local): Likewise.
10451 (Target_sparc::Relocate:relocate): Likewise.
10452
9109c078
ILT
104532010-02-06 Ian Lance Taylor <iant@google.com>
10454
10455 * configure.ac: Rewrite targetobjs duplicate removal code to use
10456 only shell constructs.
10457 * configure: Rebuild.
10458
cf846138
DK
104592010-02-05 Doug Kwan <dougkwan@google.com>
10460
10461 PR 11247
10462 * arm.cc (Arm_relobj::section_is_scannable): New method.
10463 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10464 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10465
6cfaf60b
DK
104662010-02-04 Doug Kwan <dougkwan@google.com>
10467
10468 PR 11247
10469 * arm-reloc-property.cc (cstdio): Include.
10470 * configure.ac (targetobjs): Remove duplicates.
10471 * configure: Regenerate.
10472 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10473 big and little endian version for a given address size.
10474
5c57f1be
DK
104752010-02-03 Doug Kwan <dougkwan@google.com>
10476
10477 * arm-reloc-property.cc
10478 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10479 definition.
10480 * arm-reloc-property.h
10481 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10482 New method definition.
10483 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10484 declaration.
10485 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10486 overflow to N.
10487 (GOT_PREL): Change implemented to Y.
10488 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10489 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10490 (Arm_relocate_functions::movw_abs_nc): Remove method.
10491 (Arm_relocate_functions::movt_abs): Ditto.
10492 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10493 (Arm_relocate_functions::thm_movt_abs): Ditto.
10494 (Arm_relocate_functions::movw_rel_nc): Ditto.
10495 (Arm_relocate_functions::movw_rel): Ditto.
10496 (Arm_relocate_functions::movt_rel): Ditto.
10497 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10498 (Arm_relocate_functions:thm_movw_rel): Ditto.
10499 (Arm_relocate_functions:thm_movt_rel): Ditto.
10500 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10501 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10502 New method definitions.
10503 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10504 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10505 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10506 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10507 (Target_arm::Relocate::relocate): Check for non-static or
10508 unimplemented relocation code and exit early. Change calls to
10509 Target_arm::reloc_uses_thumb_bit and
10510 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10511 instead. Refactor code to handle similar relocations to increase
10512 code sharing. Remove check for unsupported relocation code in switch
10513 statement.
10514 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10515 relocation property table to find out size. Change error message to
10516 print out the name of a relocation code instead of the numeric value.
10517 (Target_arm::scan_reloc_for_stub): Use relocation property table
10518 instead of calling Target_arm::reloc_uses_thumb_bit().
10519
218c5831
DK
105202010-02-02 Doug Kwan <dougkwan@google.com>
10521
10522 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10523 types of relaxed input section.
10524
0d31c79d
DK
105252010-02-02 Doug Kwan <dougkwan@google.com>
10526
10527 * Makefile.am (HFILES): Add arm-reloc-property.h.
10528 (DEFFILES): New.
2e702c99
RM
10529 (TARGETSOURCES): Add arm-reloc-property.cc
10530 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10531 (libgold_a_SOURCES): $(DEFFILES)
10532 * Makefile.in: Regenerate.
10533 * arm-reloc-property.cc: New file.
10534 * arm-reloc-property.h: New file.
10535 * arm-reloc.def: New file.
10536 * arm.cc: Update comments.
10537 (arm-reloc-property.h): New included header.
10538 (arm_reloc_property_table): New global variable.
10539 (Target_arm::do_select_as_default_target): New method definition.
10540 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10541 arm-reloc-property to targ_extra_obj.
10542 * parameters.cc (set_parameters_target): Call
10543 Target::select_as_default_target().
10544 * target.h (Target::select_as_default_target): New method definition.
10545 (Target::do_select_as_default_target): Same.
10546
546c7457
DK
105472010-02-01 Doug Kwan <dougkwan@google.com>
10548
10549 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10550 first_output_text_section_.
10551 (Arm_exidx_fixup::first_output_text_section): New method definition.
10552 (Arm_exidx_fixup::first_output_text_section_): New data member.
10553 (Arm_exidx_fixup::process_exidx_section): Record the first text
10554 output section seen.
10555 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10556 and entsize in output section header.
10557
11b861d5
DK
105582010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10559
10560 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10561 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10562 (Arm_relocate_functions::thm_alu11): New Method.
10563 (Arm_relocate_functions::thm_pc8): New Method.
10564 (Arm_relocate_functions::thm_pc12): New Method.
10565 (Target_arm::Scan::local): Handle the relocations.
10566 (Target_arm::Scan::global): Likewise.
10567 (Target_arm::Relocate::relocate): Likewise.
10568 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10569
c9a2c125
DK
105702010-01-29 Doug Kwan <dougkwan@google.com>
10571
10572 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10573 of relocation types as ld.
10574
1521477a
DK
105752010-01-29 Doug Kwan <dougkwan@google.com>
10576
10577 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10578 to public.
10579 (Arm_relocate_functions::thumb_branch_common): Ditto.
10580 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10581 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10582 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10583 Arm_relocate_functions::jump24): Remove.
10584 (Target_arm::Relocate::relocate): Adjust code to call
10585 Arm_relocation_functions::arm_branch_common and
10586 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10587 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10588
e7eca48c
DK
105892010-01-29 Doug Kwan <dougkwan@google.com>
10590
10591 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10592 output_local_symbol_count_needs_update_.
10593 (Arm_relobj::output_local_symbol_count_needs_update,
10594 Arm_relobj::set_output_local_symbol_count_needs_update,
10595 Arm_relobj::update_output_local_symbol_count): New methods.
10596 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10597 member.
10598 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10599 of pointed function as in a R_ARM_PREL31 relocation.
10600 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10601 for output local symbol count updating.
10602 (Target_arm::do_relax): Update output local symbol counts in objects
10603 if necessary.
10604 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10605
02961d7e
ILT
106062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10607
10608 * arm.cc: Added support for the ARM relocations:
10609 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10610 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10611 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10612 movw_prel_nc).
10613 (Arm_relocate_functions::movw_rel): New method.
10614 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10615 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10616 thm_movw_prel_nc).
10617 (Arm_relocate_functions::thm_movw_rel): New method.
10618 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10619 thm_movt_prel).
10620 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10621 relocations.
10622 (Target_arm::Scan::global): Likewise.
10623 (Target_arm::Relocate::relocate): Likewise.
10624 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10625 Likewise.
10626
b10d2873
ILT
106272010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10628
10629 * arm.cc: Added support for ARM group relocations.
10630 (Target_arm::reloc_needs_sym_origin): New method.
10631 (Arm_relocate_functions::calc_grp_kn): New method.
10632 (Arm_relocate_functions::calc_grp_residual): New method.
10633 (Arm_relocate_functions::calc_grp_gn): New method.
10634 (Arm_relocate_functions::arm_grp_alu): New Method.
10635 (Arm_relocate_functions::arm_grp_ldr): New Method.
10636 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10637 (Arm_relocate_functions::arm_grp_ldc): New Method.
10638 (Target_arm::Scan::local): Handle the ARM group relocations.
10639 (Target_arm::Scan::global): Likewise.
10640 (Target_arm::Relocate::relocate): Likewise.
10641 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10642 Likewise.
10643
2b328d4e
DK
106442010-01-26 Doug Kwan <dougkwan@google.com>
10645
10646 * arm.cc (set): Include.
10647 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10648 pointer type.
2e702c99 10649 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10650 (Arm_output_section::append_text_sections_to_list): New method.
10651 (Arm_output_section::fix_exidx_coverage): Ditto.
10652 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10653 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10654 Relobj::set_section_offset() instead of
10655 Sized_relobj::invalidate_section_offset().
2e702c99 10656 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10657 parameter for section headers. Ignore relocation sections for
10658 unallocated sections and EXIDX sections.
10659 (Target_arm::fix_exidx_coverage): New method.
10660 (Target_arm::output_section_address_less_than): New type.
10661 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10662 linked text section instead of the EXIDX section.
10663 (Arm_output_section::create_stub_group): Add an assertion to check
10664 that this is not an EXIDX output section.
10665 (Arm_output_section::append_text_sections_to_list): New method.
10666 (Arm_output_section::fix_exidx_coverage): Ditto.
10667 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10668 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10669 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10670 first pass.
10671 (Target_arm::fix_exidx_coverage): New method.
10672 * object.h (Relobj::set_output_section): New method.
10673 (Sized_relobj::invalidate_section_offset): Remove method.
10674 (Sized_relobj::do_invalidate_section_offset): Remove method.
10675 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10676
c7f3c371
DK
106772010-01-25 Doug Kwan <dougkwan@google.com>
10678
10679 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10680 Fix warning due to signed and unsigned comparison on a 32-bit host.
10681
8923b24c
DK
106822010-01-22 Doug Kwan <dougkwan@google.com>
10683
10684 * arm.cc (Target_arm::do_relax): Record an output section for section
10685 offset adjustment it contains any stub table that has changed.
10686 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10687 offsets in an output section if necessary.
10688 * output.cc (Output_section::Output_section): Initialize
10689 section_offsets_need_adjustments_.
10690 (Output_section::add_input_section_for_script): Renamed to
10691 Output_section::add_simple_input_section.
10692 (Output_section::save_states): Add a comment.
10693 (Output_section::discard_states): New method defintion.
10694 (Output_section::adjust_section_offsets): Same.
10695 * output.h (Output_section::add_input_section_for_script): Renamed to
10696 Output_section::add_simple_input_section.
10697 (Output_section::discard_states): New method declaration.
10698 (Output_section::adjust_section_offsets): Same.
10699 (Output_section::section_offsets_need_adjustment,
10700 Output_section::set_section_offsets_need_adjustment): New method
10701 definitions.
10702 (Output_section::section_offsets_need_adjustment_): New data member.
10703 * script-sections.cc
10704 (Output_section_element_input::set_section_address): Adjust code for
10705 renaming of Output_section::add_input_section_for_script.
10706 (Orphan_output_section::set_section_address): Same.
10707
9b2fd367
DK
107082010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10709
10710 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10711 Fix_v4bx enum values .
10712 * gold/options.h (General_options): New option definitions.
10713 (General_options::fix_v4bx): New method.
10714 (General_options::Fix_v4bx): New enum.
10715 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10716 (General_options::parse_fix_v4bx_interworking): New method.
10717
80d0d023
DK
107182010-01-22 Doug Kwan <dougkwan@google.com>
10719
10720 * arm.cc (Arm_exidx_fixup): New class.
10721
af2cdeae
DK
107222010-01-21 Doug Kwan <dougkwan@google.com>
10723
10724 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10725 classes.
10726 (Arm_exidx_section_offset_map): New type.
10727
993d07c1
DK
107282010-01-21 Doug Kwan <dougkwan@google.com>
10729
10730 * arm.cc (Arm_exidx_input_section): New class.
10731 (Arm_relobj::exidx_input_section_by_link,
10732 Arm_relobj::exidx_input_section_by_shndx,
10733 Arm_relobj::make_exidx_input_section): New methods.
10734 (read_arm_attributes_section): Remove.
10735 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10736 information about them.
10737 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10738 to here.
10739
5ac169d4
DK
107402010-01-20 Doug Kwan <dougkwan@google.com>
10741
10742 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10743 Input_section_specifier to Section_id.
10744 (Target_arm::new_arm_input_section: Adjust code for change of key
10745 type.
10746 (Target_arm::find_arm_input_section): Ditto.
10747 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10748 (Section_id): Remove.
10749 (Garbage_collection::Section_id_hash): Remove.
10750 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10751 (Section_id): Remove.
10752 (Icf::Section_id_hash): Remove.
10753 * object.h (Section_id, Const_section_id, Section_id_hash,
10754 Const_section_id_hash): New type definitions.
10755 * output.cc (Output_section::add_relaxed_input_section): Change to
10756 use Const_section_id instead of Input_section_specifier as key type.
10757 (Output_section::add_merge_input_section): Ditto.
10758 (Output_section::build_relaxation_map): Change to use Section_id
10759 instead of Input_section_specifier as key type.
2e702c99 10760 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10761 Ditto.
10762 (Output_section::convert_input_sections_to_relaxed_sections): Change
10763 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10764 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10765 (Output_section::find_relaxed_input_section): Ditto.
10766 * output.h (Input_section_specifier): Remove class.
10767 (Output_section::Output_section_data_by_input_section_map): Change
10768 key type to Const_section_id.
10769 (Output_section::Output_relaxed_input_section_by_input_section_map):
10770 Ditto.
10771 (Output_section::Relaxation_map): Change key type to Section_id.
10772
a2162063
ILT
107732010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10774
10775 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10776 (class Arm_v4bx_stub): New class.
10777 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10778 (Stub_factory::make_arm_v4bx_stub): New method.
10779 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10780 (Stub_table::empty): Handle v4bx stubs.
10781 (Stub_table::add_arm_v4bx_stub): New method.
10782 (Stub_table::find_arm_v4bx_stub): New method.
10783 (Arm_relocate_functions::v4bx): New method.
10784 (Target_arm::fix_v4bx): New method.
10785 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10786 (Stub_table::relocate_stubs): Likewise.
10787 (Stub_table::do_write): Likewise.
10788 (Stub_table::update_data_size_and_addralign): Likewise.
10789 (Stub_table::finalize_stubs): Likewise.
10790 (Target_arm::Scan::local): Likewise.
10791 (Target_arm::Scan::global): Likewise.
10792 (Target_arm::do_finalize_sections): Likewise.
10793 (Target_arm::Relocate::relocate): Likewise.
10794 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10795 Likewise.
10796 (Target_arm::scan_reloc_for_stub): Likewise.
10797 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10798
5696ab0b
ILT
107992010-01-19 Ian Lance Taylor <iant@google.com>
10800
10801 * output.cc (Output_section_headers::do_sized_write): Write large
10802 segment count to sh_info field.
10803 (Output_file_header::do_sized_write): For large segment count,
10804 write PN_XNUM to e_phnum field.
10805
800d0f56
ILT
108062010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10807
10808 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10809 (Arm_relocate_functions::thm_jump8): New function.
10810 (Arm_relocate_functions::thm_jump11): New function.
10811 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10812 R_ARM_THM_JUMP11.
10813 (Target_arm::Scan::global): Likewise.
10814 (Target_arm::Relocate::relocate): Likewise.
10815 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10816 Likewise.
10817
41263c05
DK
108182010-01-14 Doug Kwan <dougkwan@google.com>
10819
10820 * arm.cc (map, utility): Include headers.
10821 (Target_arm::apply_cortex_a8_workaround): New method.
10822 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10823 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10824 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10825 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10826 the --[no-]fix-cortex-a8 command line options.
10827 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10828 (Target_arm::relocate_stub): Use addend in instruction template.
10829 * options.h (DEFINE_bool): Set the user-set flag.
10830 (General_options): Add --[no-]-fix-cortex options.
10831 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10832 : Update fast look-up map after conversion.
41263c05 10833
459e9b03
ST
108342010-01-14 Sriraman Tallam <tmsriram@google.com>
10835
10836 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10837 in the first pass of do_layout.
10838
b521dfe4
DK
108392010-01-13 Doug Kwan <dougkwan@google.com>
10840
10841 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10842 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10843 apparent compiler problem of not folding static constant integral
10844 data members of elfcpp::Elf_sizes<32>.
10845
44272192
DK
108462010-01-13 Doug Kwan <dougkwan@google.com>
10847
10848 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10849 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10850 Arm_relobj::scan_section_for_cortex_a8_erratum,
10851 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10852 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10853 sections to scan for relocation stubs into a new method
10854 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10855 relocation and Cortex-A8 stub scanning.
10856 (Target_arm::do_relax): Force stubs to be after stubbed sections
10857 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10858 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10859 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10860
44b71ece
ILT
108612010-01-12 Ian Lance Taylor <iant@google.com>
10862
10863 * target-reloc.h (visibility_error): New inline function.
10864 (relocate_section): Call visibility_error.
10865 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10866 (MOSTLYCLEANFILES): Likewise.
10867 (protected_4_pic.o, protected_3.err): New targets.
10868 * testsuite/protected_4.cc: New file.
10869
a120bc7f
DK
108702010-01-12 Doug Kwan <dougkwan@google.com>
10871
10872 * arm.cc (Cortex_a8_reloc): New class.
10873 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10874 and cortex_a8_relocs_info_.
10875 (Target_arm::fix_cortex_a8): New method definition.
10876 (Target_arm::Cortex_a8_relocs_info): New type.
10877 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10878 New data member declarations.
10879 (Target_arm::scan_reloc_for_stub): Record information about
10880 relocations for THUMB branches that might be exempted from the
10881 Cortex-A8 workaround.
10882 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10883 at the beginning of a relaxation pass.
10884
20138696
DK
108852010-01-12 Doug Kwan <dougkwan@google.com>
10886
10887 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10888 (Arm_relobj::Mapping_symbol_position,
10889 Arm_reloj::Mapping_symbol_position_less,
10890 Arm_relobj::Mapping_symbols_info): New types.
10891 (Target_arm::is_mapping_symbol_name): New method definition.
10892 (Arm_relobj::do_count_local_symbols): Save information about mapping
10893 symbols.
10894
089d69dc
DK
108952010-01-11 Doug Kwan <dougkwan@google.com>
10896
10897 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10898 Arm_relocate_functions::thumb32_branch_upper,
10899 Arm_relocate_functions::thumb32_branch_lower,
10900 Arm_relocate_functions::thumb32_cond_branch_offset,
10901 Arm_relocate_functions::thumb32_cond_branch_upper,
10902 Arm_relocate_functions::thumb32_cond_branch_lower,
10903 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10904 branch offset encoding.
10905 (Arm_relocate_functions::thumb_branch_common): Use new branch
10906 offset encoding methods to avoid code duplication.
10907 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10908 (Stub_addend_reader::operator()): Use new branch encoding method
10909 to avoid code duplication.
10910
99e5bff2
DK
109112010-01-11 Doug Kwan <dougkwan@google.com>
10912
10913 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10914 (Target_arm::do_finalize_sections): Define special EXIDX section
10915 symbols only if referenced.
10916 * gc.h (Garbage_collection::add_reference): New method.
10917 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10918 code duplication.
10919
98e090bd
ILT
109202010-01-11 Ian Lance Taylor <iant@google.com>
10921
d0a91bd8
ILT
10922 * script.cc (Version_script_info::build_expression_list_lookup):
10923 Change complaing about duplicate wildcard match from error to
10924 warning.
10925
98e090bd
ILT
10926 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10927 of 2009-12-30.
10928 (Version_script_info::Version_script_info): Initialize globs_,
10929 default_version_, default_is_global_, and exact_. Don't
10930 initialize globals_ or locals_.
10931 (Version_script_info::build_lookup_tables): Build local symbols
10932 first.
10933 (Version_script_info::unquote): New function.
10934 (Version_script_info::add_exact_match): New function.
10935 (Version_script_info::build_expression_list_lookup): Remove lookup
10936 parameter. Add is_global parameter. Change all callers. Handle
10937 wildcard pattern specially. Unquote pattern. Call
10938 add_exact_match.
10939 (Version_script_info::get_name_to_match): New function.
10940 (Version_script_info::get_symbol_version): New function.
10941 (Version_script_info::get_symbol_version_helper): Remove.
10942 (Version_script_info::check_unmatched_names): Call unquote.
10943 * script.h (class Version_script_info): Change get_symbol_version
10944 to be non-inline and add is_global parameter; change all callers.
10945 Rewrite symbol_is_local. Update declarations. Define struct
10946 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10947 Remove globals_ and locals_ members. Add exact_, globs_,
10948 default_version_, is_global_.
10949 (Version_script_info::Glob): Remove pattern, add expression and
10950 is_global. Update constructor. Change all callers.
10951 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10952 default version.
10953 (Versions::symbol_section_contents): If a symbol is undefined, or
10954 defined in a dynamic object, set the version index to
10955 VER_NDX_LOCAL.
10956 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10957 symbol_is_local.
10958 (Symbol_table::add_from_pluginobj): Likewise.
10959 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10960
d56962d3
DK
109612010-01-11 Doug Kwan <dougkwan@google.com>
10962
10963 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10964 (incremental_dump_LDADD): Add linking option for libintl.
10965 * Makefile.in: Regenerate.
10966
94e6ee91
L
109672010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10968
10969 PR gold/11144
10970 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10971 instead of -Ds.
10972 * testsuite/Makefile.in: Regenerated.
10973
e96c574b
DK
109742010-01-10 Doug Kwan <dougkwan@google.com>
10975
10976 * options.h (DEFINE_var): Use parentheses around argument varname__
10977 in macro body to avoid any unintended subsequent substitutions.
10978
7198066b
ILT
109792010-01-10 Ian Lance Taylor <iant@google.com>
10980
ba4d53bf
ILT
10981 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10982 candidates before doing symbol resolution.
10983
7198066b
ILT
10984 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10985 ODR candidates if only one is weak.
10986
a2beed37
ILT
109872010-01-08 Ian Lance Taylor <iant@google.com>
10988
10989 * script.cc (Version_script_info::build_expression_list_lookup):
10990 Don't warn about ambiguous version, just record the ambiguity.
10991 (Version_script_info::get_symbol_version_helper): Give error if
10992 version is ambiguous.
10993
2fb7225c
DK
109942010-01-08 Doug Kwan <dougkwan@google.com>
10995
10996 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10997 prev_data_size_ and prev_addralign_. Remove initializer for
10998 deleted data member has_been_changed_.
10999 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11000 to determine if the table is empty.
11001 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11002 Remove.
11003 (Stub_table::add_reloc_stub): Define method in class definition
11004 instead of just declaring it there.
11005 (Stub_table::add_cortex_a8_stub): New method definition.
11006 (Stub_table::update_data_size_and_addralign): Ditto.
11007 (Stub_table::finalize_stubs): Ditto.
11008 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11009 (Stub_table::do_addralign_): Return address alignment in the
11010 (Stub_table::do_reset_address_and_file_offset): Define method in
11011 class definition instead of declaring it there. Set current data
11012 size to be the data size of the previous pass.
11013 (Stub_table::set_final_data_size): Use current data size as the
11014 final data size.
11015 (Stub_table::relocate_stub): Change parameter type of stub from
11016 Reloc_stub pointer to Stub pointer.
11017 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11018 (Stub_table::Cortex_a8_stub_list): New typedef.
11019 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11020 Stub_table::prev_addralign_): New data member.
11021 (Arm_relobj::Arm_relobj): Initialize data member
11022 section_has_cortex_a8_workaround_.
11023 (Arm_relobj::section_has_cortex_a8_workaround,
11024 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11025 definitions.
11026 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11027 declarations.
11028 (Target_arm::relocate_stub): Change parameter type of stub from
11029 Reloc_stub pointer to Stub pointer.
11030 (Insn_template::size, Insn_template::alignment): Handle
11031 THUMB16_SPECIAL_TYPE.
11032 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11033 Stub_table::update_data_size_and_addralign,
11034 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11035 definitions.
11036 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11037 (Stub_table::do_write): Ditto.
11038 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11039
880cd20d
ILT
110402010-01-08 Ian Lance Taylor <iant@google.com>
11041
11042 PR 11108
11043 * symtab.h (class Symbol): Remove fields is_target_special_ and
11044 has_plt_offset_. Add field is_defined_in_discarded_section_.
11045 (Symbol::is_defined_in_discarded_section): New function.
11046 (Symbol::set_is_defined_in_discarded_section): New function.
11047 (Symbol::has_plt_offset): Rewrite.
11048 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11049 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11050 Don't initialize is_target_special_ or has_plt_offset_.
11051 Initialize is_defined_in_discarded_section_.
11052 (Symbol_table::add_from_relobj): If appropriate, set
11053 is_defined_in_discarded_section.
11054 * resolve.cc (Symbol::override_base_with_special): Don't test
11055 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11056 * target-reloc.h (relocate_section): Do special handling for
11057 symbols defined in discarded sections for global symbols as well
11058 as local symbols.
11059
2703e3eb
ILT
110602010-01-08 Ian Lance Taylor <iant@google.com>
11061
11062 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11063 the SHT_SYMTAB case.
11064
339d40a3
ILT
110652010-01-08 Ian Lance Taylor <iant@google.com>
11066
11067 * object.cc (Sized_relobj::do_layout): Don't get confused if
11068 layout_eh_frame returns NULL.
11069
abecea76
ILT
110702010-01-08 Ian Lance Taylor <iant@google.com>
11071
11072 PR 11084
11073 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11074 dynamic symbol table, use the normal symbol table.
11075 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11076 symbol table.
11077
6b7dd3f3
ILT
110782010-01-08 Ian Lance Taylor <iant@google.com>
11079
11080 PR 11072
11081 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11082 sections.
11083
36c50e63
L
110842010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11085
11086 * version.cc (print_version): Change to "Copyright 2010".
11087
e291e7b9
ILT
110882010-01-08 Ian Lance Taylor <iant@google.com>
11089
11090 PR 10287
11091 PR 11063
11092 * i386.cc (class Target_i386): Change return type of plt_section
11093 to be non-const.
11094 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11095 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11096 tls_desc_rel_ field.
11097 (Output_data_plt_i386::rel_tls_desc): New function.
11098 (Target_i386::rel_tls_desc_section): New function.
11099 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11100 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11101 R_386_TLS_DESC reloc in rel_tls_desc_section.
11102 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11103 Define struct Tlsdesc_info.
11104 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11105 (Target_x86_64::do_reloc_symbol_index): New function.
11106 (Target_x86_64::add_tlsdesc_info): New function.
11107 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11108 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11109 tlsdesc_rel_ field.
11110 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11111 all callers.
11112 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11113 (Target_x86_64::rela_tlsdesc_section): New function.
11114 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11115 handling.
11116 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11117 (Target_x86_64::do_reloc_addend): New function.
11118 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11119 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11120 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11121 (Output_reloc::type): New function.
11122 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11123 (Output_reloc::is_target_specific): New function.
11124 (Output_reloc::target_arg): New function.
11125 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11126 absolute relocs and target specific relocs.
11127 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11128 add_target_specific.
11129 (class Output_data_reloc) [SHT_RELA]: Likewise.
11130 * output.cc (Output_reloc::Output_reloc): Add four new versions
11131 for absolute relocs and target specific relocs.
11132 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11133 (Output_reloc::get_symbol_index): Likewise.
11134 (Output_reloc::local_section_offset): Check that local_sym_index_
11135 is not TARGET_CODE or 0.
11136 (Output_reloc::symbol_value): Likewise.
11137 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11138 reloc.
11139 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11140 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11141 functions.
11142 * layout.cc (add_target_dynamic_tags): Use output section for
11143 DT_PLTRELSZ and DT_JMPREL.
11144
3a44184e
ILT
111452010-01-07 Ian Lance Taylor <iant@google.com>
11146
11147 PR 11061
11148 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11149 function.
11150 (class Output_data_reloc_generic): Define.
11151 (class Output_data_reloc_base): Change base class to
11152 Output_data_reloc_generic. Change add() method to call
11153 bump_relative_reloc_count for a relative reloc. Remove
11154 sort_relocs_ field.
11155 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11156 to sort_relocs().
11157 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11158 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11159 appropriate.
11160 * layout.h (class Layout): Update declaration.
11161
ea715a34
ILT
111622010-01-07 Ian Lance Taylor <iant@google.com>
11163
11164 * output.h (class Output_data): Add const version of
11165 output_section and do_output_section.
11166 (class Output_section_data): Add const version of
11167 do_output_section.
11168 (class Output_section): Likewise.
11169 * layout.cc (Layout::add_target_dynamic_tags): New function.
11170 * layout.h (class Layout): Update declarations.
11171 * arm.cc (Target_arm::do_finalize_sections): Use
11172 add_target_dynamic_tags.
11173 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11174 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11175 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11176 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11177
659948a4
ILT
111782010-01-07 Ian Lance Taylor <iant@google.com>
11179
11180 PR 11042
11181 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11182 object as needed.
11183
9d3b86f6
ILT
111842010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11185 Ian Lance Taylor <iant@google.com>
11186
11187 PR 11019
11188 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11189 Xindex::read_symtab_xindex.
11190
bb0d3eb0
DK
111912010-01-07 Doug Kwan <dougkwan@google.com>
11192
11193 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11194 (Insn_template::thumb16_bcond_insn): New method declaration.
11195 (Insn_template): Fix spelling.
11196 (Stub::thumb16_special): New method declaration.
11197 (Stub::do_write): Define virtual method which was previously pure
11198 virtual.
11199 (Stub::do_thumb16_special): New method declaration.
11200 (Stub::do_fixed_endian_write): New template member.
11201 (Reloc_stub::do_write): Remove.
11202 (Reloc_stub::do_fixed_endian_write): Remove.
11203 (Cortex_a8_stub): New class definition.
11204 (Stub_factory::make_cortex_a8_stub): New method definition.
11205 (Stub_factory::Stub_factory): Add missing static storage class
11206 qualifier for elf32_arm_stub_a8_veneer_blx.
11207
ffeef7df
ILT
112082010-01-07 Ian Lance Taylor <iant@google.com>
11209
dc3f80fe
ILT
11210 PR 10980
11211 * options.h (class General_options): Add --warn-unresolved-symbols
11212 and --error-unresolved-symbols.
11213 * errors.cc (Errors::undefined_symbol): Implement
11214 --warn-unresolved-symbols.
11215
ffeef7df
ILT
11216 * options.h (class General_options): Add -z text and -z textoff.
11217 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11218
f1ec9ded
ST
112192010-01-06 Sriraman Tallam <tmsriram@google.com>
11220
11221 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11222 (Garbage_collection::cident_sections): New function.
11223 (Garbage_collection::add_cident_section): New function.
11224 (Garbage_collection::cident_sections_): New member.
11225 (gc_process_relocs): Add references to sections whose names are C
11226 identifiers.
11227 * gold.h (cident_section_start_prefix): New constant.
11228 (cident_section_stop_prefix): New constant.
11229 (is_cident): New function.
11230 * layout.cc (Layout::define_section_symbols): Replace string constants
11231 with the newly defined constants.
11232 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11233 C identifiers.
11234 * testsuite/Makefile.am: Add gc_orphan_section_test.
11235 * testsuite/Makefile.in: Regenerate.
11236 * testsuite/gc_orphan_section_test.cc: New file.
11237 * testsuite/gc_orphan_section_test.sh: New file.
11238
6eda8c29
ILT
112392010-01-06 Ian Lance Taylor <iant@google.com>
11240
b9674e17
ILT
11241 PR 10980
11242 * options.h (class General_options): Add --warn-shared-textrel.
11243 * layout.cc (Layout::finish_dynamic_section): Implement
11244 --warn-shared-textrel.
11245
6eda8c29
ILT
11246 PR 10980
11247 * options.h (class General_options): Add --warn-multiple-gp.
11248
32dcd44e
ILT
112492010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11250
11251 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11252 $(THREADSLIB) and $(LIBDL).
11253 * Makefile.in: Rebuild.
11254
a192ba05
ILT
112552010-01-06 Ian Lance Taylor <iant@google.com>
11256
11257 PR 10980
11258 * options.cc (General_options::parse_section_start): New function.
11259 (General_options::section_start): New function.
11260 (General_options::General_options): Initialize all members.
11261 * options.h: Include <map>
11262 (class General_options): Add --section-start. Add section_starts_
11263 member.
11264 * layout.cc (Layout::attach_allocated_section_to_segment): If
11265 --section-start was used, set the address of the segment. Remove
11266 local sort_sections.
11267 (Layout::relaxation_loop_body): If the address of the load segment
11268 has been set by --section-start, don't use it.
11269 * output.h (Output_segment::update_flags_for_output_section): New
11270 function.
11271 * output.cc (Output_segment::add_output_section): Call
11272 update_flags_for_output_section.
11273
dde3f402
ILT
112742010-01-05 Ian Lance Taylor <iant@google.com>
11275
62dfdd4d
ILT
11276 PR 10980
11277 * options.h (class General_options): Add --undefined-version.
11278 * script.cc (struct Version_expression): Add was_matched_by_symbol
11279 field.
11280 (Version_script_info::matched_symbol): New function.
11281 (Version_script_info::get_symbol_version_helper): Call
11282 matched_symbol.
11283 (Version_script_info::check_unmatched_names): New function.
11284 * script.h (class Version_script_info): Update declarations.
11285 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11286
9c4ae156
ILT
11287 * options.h (class General_options): Use DEFINE_bool_alias for
11288 allow_multiple_definition.
11289 * resolve.cc (Symbol_table::should_override): Don't test
11290 allow_multiple_definition.
11291
dde3f402
ILT
11292 PR 10980
11293 * options.h (class General_options): Add --cref.
11294 * main.cc (main): Print cref table if --cref. Don't close mapfile
11295 until after printing cref table.
11296 * cref.cc: Include "symtab.h".
11297 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11298 (Cref_table_compare::operator()): New function.
11299 (Cref_inputs::gather_cref): New function.
11300 (filecol): New static const.
11301 (Cref_inputs::print_cref): New function.
11302 (Cref::print_cref): New function.
11303 * cref.h: Include <cstdio>.
11304 (class Cref): Update declarations.
11305 * mapfile.h (Mapfile::file): New function.
11306 * object.h (class Object): Define Symbols. Declare virtual
11307 do_get_global_symbols.
11308 (Object::get_global_symbols): New function.
11309 * object.cc (Input_objects::add_object): Pass object to cref_ if
11310 --cref.
11311 (Input_objects::archive_start): Likewise.
11312 (Input_objects::archive_stop): Likewise.
11313 (Input_objects::print_cref): New function.
11314 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11315 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11316 --cref.
11317 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11318 function.
11319 * plugin.h (class Sized_pluginobj): Update declarations.
11320
8781f709
ILT
113212010-01-05 Ian Lance Taylor <iant@google.com>
11322
11323 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11324 to is_default_version. Rename insdef to insdefault.
11325 (Symbol_table::add_from_relobj): Rename def to is_default_version
11326 and local to is_forced_local.
11327 (Symbol_table::add_from_pluginobj): Likewise.
11328 (Symbol_table::add_from_dynobj): Likewise.
11329 (Symbol_table::define_special_symbol): Rename insdef to
11330 insdefault.
11331
fe35d28d
ILT
113322010-01-04 Ian Lance Taylor <iant@google.com>
11333
30bc8c46
ILT
11334 PR 10980
11335 * options.h (class General_options): Add
11336 --allow-multiple-definition and -z muldefs.
11337 * resolve.cc (Symbol_table::should_override): Don't warn about a
11338 multiple symbol definition if --allow-multiple-definition or -z
11339 muldefs.
11340
7eaea549
ILT
11341 PR 10980
11342 * options.h (class General_options): Add --add-needed and
11343 --copy-dt-needed-entries. Tweak --as-needed help entry.
11344 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11345 error if --copy-dt-needed-entries aka --add-needed is used and
11346 would cause a change in behaviour.
11347
fe35d28d
ILT
11348 PR 10980
11349 * options.h (class General_options): Add -G as a short version of
11350 --shared. Add no-op options -assert, -g, and -i.
11351
55a2bb35
ST
113522010-01-04 Sriraman Tallam <tmsriram@google.com>
11353
11354 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11355 check for .text or .gnu.linkonce.t sections.
11356 * icf.cc (Icf::find_identical_sections): Ditto.
11357 Change the detection for mangled function name within the section
11358 name.
11359 * icf.h (is_section_foldable_candidate): New function.
11360
719328e1
ILT
113612009-12-30 Ian Lance Taylor <iant@google.com>
11362
11363 PR 10980
11364 * options.h (class General_options): Permit two dashes with
11365 --retain-symbols-file.
11366
d7bb5745
ILT
113672009-12-30 Ian Lance Taylor <iant@google.com>
11368
403a15dd
ILT
11369 PR 10979
11370 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11371 don't put the file header and segment headers in the text
11372 segment.
11373
eda294df
ILT
11374 PR 10979
11375 * common.cc (Sort_commons::operator()): Stabilize sort when both
11376 entries are NULL.
11377 (Symbol_table::do_allocate_commons_list): When allocating common
11378 symbols, skip a symbol which is no longer common.
11379 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11380 an object before checking its type.
11381 * testsuite/common_test_2.c: New file.
11382 * testsuite/common_test_3.c: New file.
11383 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11384 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11385 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11386 (common_test_2_pic.o, common_test_2.so): New targets.
11387 (common_test_3_pic.o, common_test_3.so): New targets.
11388 * testsuite/Makefile.in: Rebuild.
11389
d7bb5745
ILT
11390 PR 10979
11391 * script.cc (read_input_script): If we see a new SECTIONS clause,
11392 and we have added an input section, give an error.
11393 * layout.h (class Layout): Add have_added_input_section function.
11394 Add have_added_input_section_ field.
11395 * layout.cc (Layout::Layout): Initialize
11396 have_added_input_section_.
11397 (Layout::layout): Set have_added_input_section_.
11398 (Layout::layout_eh_frame): Likewise.
11399
fc59c572
ILT
114002009-12-30 Ian Lance Taylor <iant@google.com>
11401
11402 PR 10931
11403 * options.h (class General_options): Add --sort-common option.
11404 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11405 * common.cc (Sort_common): Add sort_order parameter to
11406 constructor. Add sort_order_ field.
11407 (Sort_commons::operator): Check sort_order_.
11408 (Symbol_table::allocate_commons): Determine the sort order.
11409 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11410 Change all callers.
11411 (Symbol_table::do_allocate_commons_list): Likewise.
11412
1c74fab0
ILT
114132009-12-30 Ian Lance Taylor <iant@google.com>
11414
11415 PR 10916
11416 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11417 symbols from this object, don't change the visibility of an
11418 undefined symbol.
11419 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11420
6affe781
ILT
114212009-12-30 Ian Lance Taylor <iant@google.com>
11422
11423 PR 10861
11424 * script.h (class Version_script_info): Define Language enum.
11425 Update declarations. Define Glob, Exact, and Lookup types. Add
11426 new fields globals_, locals_, and is_finalized_.
11427 * script.cc: Various formatting fixes.
11428 (class Parser_closure): Change language_stack_ from a vector of
11429 std::string to one of Version_script_info::Language. Adjust all
11430 uses accordingly.
11431 (class Lazy_demangler): Remove.
11432 (struct Version_expression): Change language from std::string to
11433 Version_script_info::Language.
11434 (Version_script_info::Version_script_info): New function.
11435 (Version_script_info::~Version_script_info): Don't call clear.
11436 (Version_script_info::finalize): New function.
11437 (Version_script_info::build_lookup_tables): New function.
11438 (Version_script_info::build_expression_list_lookup): New
11439 function.
11440 (Version_script_info::get_symbol_version_helper): Rewrite to use
11441 lookup tables.
11442 (Version_script_info::print_expression_list): Adjust to use
11443 Version_script_info::Language.
11444 (script_push_lex_into_version_mode): Check that the version script
11445 has not been finalized.
11446 (version_script_push_lang): Change language string to
11447 Version_script_info::Language.
11448 * options.cc (Command_line::version_script): New function.
11449 * options.h (class General_options): Add finalize_dynamic_list
11450 function. Change version_script from declaration to definition.
11451 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11452 * testsuite/version_script.map: Remove duplicate def of foo.
11453 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11454 version_script.map.
11455 * testsuite/Makefile.in: Rebuild.
11456
818bf354
ILT
114572009-12-30 Ian Lance Taylor <iant@google.com>
11458
11459 PR 10843
11460 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11461 if the input symbol index is 0, make the output symbol index 0.
11462
ebcc8304
ILT
114632009-12-30 Ian Lance Taylor <iant@google.com>
11464
11465 PR 10670
11466 * options.h (class General_options): Add -x/--discard-all.
11467 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11468 --discard-all. If the local symbol needs a dynamic entry, check
11469 that before handling --discard-locals.
11470
176fe33f
ILT
114712009-12-30 Ian Lance Taylor <iant@google.com>
11472
bb321bb1
ILT
11473 PR 10450
11474 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11475 flags to PF_R.
11476 (Output_segment::add_output_section): Don't change the flags if
11477 the type is PT_TLS.
11478
176fe33f
ILT
11479 PR 10450
11480 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11481 GNU hash table if they need a dynamic value. Otherwise, don't add
11482 them if they are defined in a dynamic object or are forced local.
11483
e8cd95c7
ILT
114842009-12-29 Ian Lance Taylor <iant@google.com>
11485
1b81fb71
ILT
11486 PR 10450
11487 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11488 .gnu.hash table for a 32-bit target.
11489
8d6d383d
ILT
11490 PR 10450
11491 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11492 regular and a dynamic object only needs a dynamic symbol table
11493 entry if it is externally visible.
11494
e785ec03
ILT
11495 PR 10450
11496 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11497 constructor. Add global_offset_table_ field.
11498 (Target_i386::got_section): Set global_offset_table_.
11499 (Target_i386::do_finalize_sections): Set global_offset_table_
11500 size.
11501 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11502 in constructor. Add global_offset_table_ field.
11503 (Target_x86_64::got_section): Set global_offset_table_.
11504 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11505 size.
11506
1a2dff53
ILT
11507 * layout.cc (Layout::Layout): Initialize increase_relro_.
11508 (Layout::get_output_section): Add is_relro, is_last_relro, and
11509 is_first_non_relro parameters. Change all callers.
11510 (Layout::choose_output_section): Likewise.
11511 (Layout::add_output_section_data): Likewise.
11512 (Layout::make_output_section): Likewise.
11513 (Layout::set_segment_offsets): Clear increase_relro when using a
11514 linker script.
11515 * layout.h (class Layout): Add increase_relro method. Add
11516 increase_relro_ field. Update declarations.
11517 * output.cc (Output_section::Output_section): Initialize
11518 is_last_relro_ and is_first_non_relro_.
11519 (Output_segment::add_output_section): Group relro sections is
11520 do_sort is true. Handle is_last_relro and is_first_non_relro.
11521 (Output_segment::maximum_alignment): Remove relro handling.
11522 (Output_segment::set_section_addresses): Add increase_relro
11523 parameter. Change all callers. Add initial alignment to align
11524 relro sections on separate page. Remove old relro handling.
11525 (Output_segment::set_section_list_addresses): Remove in_relro
11526 parameter. Change all callers.
11527 (Output_segment::set_offset): Add increase parameter. Change all
11528 callers. Remove old relro handling.
11529 * output.h (class Output_section): Add new methods: is_last_relro,
11530 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11531 Add is_last_relro_ and is_first_non_relro_ fields.
11532 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11533 Create separate .got.plt section. Call increase_relro.
11534 * x86_64.cc (Target_x86_64::got_section): Likewise.
11535 * testsuite/relro_script_test.t: Add .got.plt.
11536
f0ba79e2
ILT
11537 PR 10450
11538 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11539 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11540 (Layout::finalize): Call set_dynamic_symbol_size.
11541 (Layout::set_dynamic_symbol_size): New function.
11542 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11543 set_dynamic_symbol_size.
11544
e8cd95c7
ILT
11545 PR 10450
11546 * output.h (class Output_section): Add is_entsize_zero_ field.
11547 * output.cc (Output_section::Output_section): Initialize
11548 is_entsize_zero_.
11549 (Output_section::set_entsize): If two different entsizes are
11550 requested, force it to zero.
11551 (Output_section::add_input_section): Set flags for .debug_str
11552 before updating section flags. Set entsize.
11553 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11554 and SHF_STRING if all input sections have those flags.
11555
3e1b9a8a
RÁE
115562009-12-29 Rafael Espindola <espindola@google.com>
11557
11558 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11559 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11560 reporting.
3e1b9a8a 11561
3dcad376
ST
115622009-12-29 Sriraman Tallam <tmsriram@google.com>
11563
11564 * options.cc (General_options::parse_version): Allow -v to exit
11565 without an error if there is nothing to link.
11566
084e2665
ILT
115672009-12-29 Ian Lance Taylor <iant@google.com>
11568
11569 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11570 using a version of gcc before 4.1.
11571 * configure: Rebuild.
11572
250acde3
CD
115732009-12-28 Chris Demetriou <cgd@google.com>
11574
11575 * attributes.cc (Output_attributes_section_data::do_write): Use
11576 std::vector::front rather than std::vector::data.
11577
99fff23b
ILT
115782009-12-28 Ian Lance Taylor <iant@google.com>
11579
11580 * symtab.h (class Symbol_table): Add enum Defined.
11581 * resolve.cc (Symbol_table::should_override): Add defined
11582 parameter. Change all callers. Test whether object is NULL
11583 before calling a method on it.
11584 (Symbol_table::report_resolve_problem): Add defined parameter.
11585 Change all callers.
11586 (Symbol_table::should_override_with_special): Likewise.
11587 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11588 parameter. Change all callers.
11589 (Symbol_table::do_define_in_output_data): Likewise.
11590 (Symbol_table::define_in_output_segment): Likewise.
11591 (Symbol_table::do_define_in_output_segment): Likewise.
11592 (Symbol_table::define_as_constant): Likewise.
11593 (Symbol_table::do_define_as_constant): Likewise.
11594 * script.h (class Symbol_assignment): Add is_defsym parameter to
11595 constructor; change all callers.
11596 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11597 parameter. Change all callers. Add is_defsym_ field.
11598 (class Parser_closure): Add parsing_defsym parameter to
11599 constructor; change all callers. Add parsing_defsym accessor
11600 function. Add parsing_defsym_ field.
11601
556bd683
ILT
116022009-12-28 Ian Lance Taylor <iant@google.com>
11603
11604 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11605 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11606
1782c879
ILT
116072009-12-23 Ian Lance Taylor <iant@google.com>
11608
11609 * i386.cc (Target_i386::do_calls_non_split): Recognize
11610 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11611 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11612 -fsplit-stack prologue when using %r11.
1782c879 11613
329ca2b1
ST
116142009-12-21 Sriraman Tallam <tmsriram@google.com>
11615
11616 * options.cc (General_options::parse_version): Make -v continue and do
11617 the link like GNU ld does.
11618
d675ff46
RÁE
116192009-12-17 Rafael Avila de Espindola <espindola@google.com>
11620
11621 * Makefile.am (CCFILES): Add timer.cc.
11622 (HFILES): Add timer.h.
11623 * configure.ac: Check for sysconf and times.
11624 * main.cc: include timer.h.
11625 (main): Use Timer instead of get_run_time.
11626 * timer.cc: New.
11627 * timer.h: New.
11628 * workqueue.cc: include timer.h.
11629 (Workqueue::find_and_run_task):
11630 Report user, sys and wall time.
11631 * Makefile.in: Regenerate.
11632 * config.in: Regenerate.
11633 * configure: Regenerate.
11634
d6344fb5
DK
116352009-12-16 Doug Kwan <dougkwan@google.com>
11636
11637 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11638 sections.
11639 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11640 relaxed input sections.
11641 * output.cc (Output_section::find_relaxed_input_section): Change
11642 return type to Output_relaxed_input_section pointer. Adjust code
11643 for new type of relaxed_input_section_map_.
11644 * output.h (Output_section::find_relaxed_input_section): Change
11645 return type to Output_relaxed_input_section pointer.
11646 (Output_section::Output_relaxed_input_section_by_input_section_map):
11647 New type.
11648 (Output_section::relaxed_input_section_map_): Change type to
11649 Output_section::Output_relaxed_input_section_by_input_section_map.
11650 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11651 input section.
11652
0e0d5469
ILT
116532009-12-15 Ian Lance Taylor <iant@google.com>
11654
11655 * layout.cc (Layout::create_shstrtab): Only write out after input
11656 sections if we are compressing debug sections.
11657
0649a889
ILT
116582009-12-15 Ian Lance Taylor <iant@google.com>
11659
11660 * archive.cc (Archive::add_symbols): Only look up a symbol without
11661 a version if there is, in fact, a version.
11662
2ea97941
ILT
116632009-12-14 Ian Lance Taylor <iant@google.com>
11664
11665 Revert -Wshadow changes, all changes from:
11666 2009-12-11 Doug Kwan <dougkwan@google.com>
11667 2009-12-11 Nick Clifton <nickc@redhat.com>
11668 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11669
b0eec2cc
DK
116702009-12-11 Doug Kwan <dougkwan@google.com>
11671
11672 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11673 due to -Wshadow.
11674 * attributes.cc (Object_attribute::size): Ditto.
11675 (Attributes_section_data::size): Ditto.
11676 (Attributes_section_data::Attributes_section_data): Ditto.
11677 (Output_attributes_section_data::do_write): Ditto.
11678 * attributes.h (Object_attribute::set_type): Ditto.
11679 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11680
91d6fa6a
NC
116812009-12-11 Nick Clifton <nickc@redhat.com>
11682
11683 * archive.cc: Fix shadowed variable warnings.
11684 * arm.cc: Likewise.
11685 * compressed_output.cc: Likewise.
11686 * compressed_output.h: Likewise.
11687 * configure: Likewise.
11688 * dwarf_reader.cc: Likewise.
11689 * dynobj.cc: Likewise.
11690 * dynobj.h: Likewise.
11691 * ehframe.cc: Likewise.
11692 * ehframe.h: Likewise.
11693 * errors.cc: Likewise.
11694 * expression.cc: Likewise.
11695 * fileread.cc: Likewise.
11696 * fileread.h: Likewise.
11697 * freebsd.h: Likewise.
11698 * i386.cc: Likewise.
11699 * icf.cc: Likewise.
11700 * incremental.h: Likewise.
11701 * layout.cc: Likewise.
11702 * layout.h: Likewise.
11703 * mapfile.cc: Likewise.
11704 * merge.cc: Likewise.
11705 * merge.h: Likewise.
11706 * object.cc: Likewise.
11707 * object.h: Likewise.
11708 * options.h: Likewise.
11709 * output.cc: Likewise.
11710 * output.h: Likewise.
11711 * parameters.cc: Likewise.
11712 * plugin.cc: Likewise.
11713 * powerpc.cc: Likewise.
11714 * reduced_debug_output.cc: Likewise.
11715 * reduced_debug_output.h: Likewise.
11716 * reloc.cc: Likewise.
11717 * reloc.h: Likewise.
11718 * resolve.cc: Likewise.
11719 * script-sections.cc: Likewise.
11720 * script.cc: Likewise.
11721 * script.h: Likewise.
11722 * sparc.cc: Likewise.
11723 * symtab.cc: Likewise.
11724 * symtab.h: Likewise.
11725 * target-select.cc: Likewise.
11726 * target-select.h: Likewise.
11727 * token.h: Likewise.
11728 * workqueue.cc: Likewise.
11729 * workqueue.h: Likewise.
11730 * x86_64.cc: Likewise.
11731
a0351a69
DK
117322009-12-10 Doug Kwan <dougkwan@google.com>
11733
11734 * arm.cc (attributes.h): New include.
11735 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11736 (Arm_relobj::~Arm_relobj): Delete object pointed by
11737 attributes_section_data_.
11738 (Arm_relobj::attributes_section_data): New method definition.
11739 (Arm_relobj::attributes_section_data_): New data member declaration.
11740 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11741 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11742 attributes_section_data_.
11743 (Arm_dynobj::attributes_section_data): New method definition.
11744 (Arm_dynobj::attributes_section_data_): New data member declaration.
11745 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11746 initialization value of may_use_blx_ to false.
2e702c99 11747 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11748 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11749 object attributes to compute results instead of hard-coding.
11750 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11751 Target_arm::get_secondary_compatible_arch,
11752 Target_arm::set_secondary_compatible_arch
11753 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11754 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11755 New method declarations.
11756 (Target_arm::get_aeabi_object_attribute): New method definition.
11757 (Target_arm::attributes_section_data_): New data member declaration.
11758 (read_arm_attributes_section): New template definition.
11759 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11760 (Arm_dynobj::do_read_symbols): Ditto.
11761 (Target_arm::do_finalize_sections): Merge attributes sections from
11762 input. Check for BLX use after attributes section merging.
11763 Fix __exidx_start and __exidx_end visibility. Create an
11764 .ARM.attributes section if necessary.
11765 (Target_arm::get_secondary_compatible_arch,
11766 Target_arm::set_secondary_compatible_arch,
11767 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11768 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11769 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11770 New method definitions.
11771
b59befec
ILT
117722009-12-09 Ian Lance Taylor <iant@google.com>
11773
11774 * plugin.cc (Plugin::load): Don't cast from void* to a function
11775 pointer.
11776
1276bc89
ILT
117772009-12-09 Ian Lance Taylor <iant@google.com>
11778
11779 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11780 information fields.
11781
2f2de248
L
117822009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11783
11784 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11785 Replace two_file_shared_1.so with two_file_shared_2.so.
11786 * testsuite/Makefile.in: Regenerated.
11787
4f787271
DK
117882009-12-08 Doug Kwan <dougkwan@google.com>
11789
11790 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11791 (HFILES): Add attributes.h and int_encoding.h.
11792 * Makefile.in: Regenerate.
11793 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11794 function definitions to int_encoding.cc
11795 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11796 prototypes to int_encoding.h
11797 * reduced_debug_output.cc (int_encoding.h): New include.
11798 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11799 function definitions to int_encoding.cc
11800 (insert_into_vector, read_from_pointer): Move template definitions to
11801 int_encoding.h
11802 * attributes.cc: New file.
11803 * attributes.h: New file.
11804 * int_encoding.cc: New file.
11805 * int_encoding.h: New file.
11806
20b52f1a
RÁE
118072009-12-07 Rafael Avila de Espindola <espindola@google.com>
11808
11809 PR gold/11055
11810 * incremental-dump.cc (dump_incremental_inputs): New.
11811 (main): Use dump_incremental_inputs.
11812
53d7974c
L
118132009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11814
11815 PR gold/10893
11816 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11817 checking elfcpp::STT_FUNC.
11818 (Target_i386::Relocate::relocate): Likewise.
11819 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11820
11821 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11822 symbols from shared libraries into normal FUNC symbols.
11823
11824 * symtab.h (Symbol): Add is_func and use it.
11825
05a352e6
DK
118262009-12-05 Doug Kwan <dougkwan@google.com>
11827
11828 * arm.cc (Target_arm::arm_info): Initialize new fields
11829 attributes_section and attributes_vendor.
11830 * i386.cc (Target_i386::i386_info): Same.
11831 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11832 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11833 fields attributes_section and attributes_vendor.
53d7974c 11834 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11835 * target.h (Target::attributes_section, Target::attributes_vendor,
11836 Target::is_attributes_section, Target::attribute_arg_type,
11837 Target::attributes_order): New method definitions.
11838 (Target::Target_info::attributes_section,
11839 Target::Target_info::attributes_vendor): New fields.
11840 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11841 virtual method definitions.
11842 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11843 attributes_section and attributes_vendor.
11844 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11845
f4e5969c
DK
118462009-12-05 Doug Kwan <dougkwan@google.com>
11847
11848 * arm.cc: Update comments about interworking and stub generation.
11849 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11850 considered as non-PIC.
11851 (Arm_relocate_functions::base_abs): Fix formatting.
11852 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11853 of function to use GOT entry address instead of offset.
11854 (Target_arm::Scan::global): Issue an error if a symbol would need a
11855 PLT does not get one because it is untyped. Remove code to create
11856 dynamic symbols for relative branches.
11857 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11858 takes unsigned integer instead of boolean.
11859
1abce4a6
L
118602009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11861
11862 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11863 (two_file_test_LDADD): Likewise.
11864 (common_test_1_LDADD): Likewise.
11865 (exception_test_LDADD) Likewise.
11866 (weak_test_LDADD): Likewise.
11867 (many_sections_test_LDADD): Likewise.
11868 (initpri1_LDADD): Likewise.
11869 (script_test_1_LDADD): Likewise.
11870 (script_test_2_LDADD): Likewise.
11871 (justsyms_LDADD): Likewise.
11872 (binary_test_LDADD): Likewise.
11873 (large_LDADD): Likewise.
11874 * testsuite/Makefile.in: Regenerated.
11875
adcf2816 118762009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11877
adcf2816
L
11878 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11879 (Symbol_table::override_with_special): Likewise.
11880 (Symbol_table::add_from_object): Likewise.
11881
28e67f5d
RÁE
118822009-12-04 Rafael Avila de Espindola <espindola@google.com>
11883
11884 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11885 Don't set the data_offset twice.
11886
ae10a101
RÁE
118872009-12-04 Rafael Avila de Espindola <espindola@google.com>
11888
11889 * testsuite/Makefile.in: Regenerate.
11890
f59f41f3
DK
118912009-12-03 Doug Kwan <dougkwan@google.com>
11892
11893 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11894 (Target_arm::do_finalize_sections): Add parameter for symbol table
11895 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11896 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11897 parameter for symbol table pointer.
11898 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11899 an additional parameter for a pointer to symbol table.
11900 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11901 parameter for a symbol table pointer.
11902 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11903 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11904 Ditto.
11905 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11906 parameter for a symbol table pointer.
11907
ca55d848
RÁE
119082009-12-03 Rafael Avila de Espindola <espindola@google.com>
11909
11910 * incremental.cc (Incremental_inputs_header)
11911 (Incremental_inputs_header_write, Incremental_inputs_entry)
11912 (Incremental_inputs_entry_write): Move ...
11913 * incremental.h (Incremental_inputs_header)
11914 (Incremental_inputs_header_write, Incremental_inputs_entry)
11915 (Incremental_inputs_entry_write): here.
11916
3aec4f9c
RÁE
119172009-12-02 Rafael Avila de Espindola <espindola@google.com>
11918
11919 * incremental.cc (make_sized_incremental_binary): Set the target.
11920 Error if it is incompatible.
11921 * output.h (Output_file): Add filename method.
11922
9c0ae74d
RÁE
119232009-12-02 Rafael Avila de Espindola <espindola@google.com>
11924
11925 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11926 from the get_* methods.
11927
a45500ae
RÁE
119282009-12-02 Rafael Avila de Espindola <espindola@google.com>
11929
11930 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11931 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11932 Write 0 for the data_offset of scripts.
11933
325e6408
RÁE
119342009-12-02 Rafael Avila de Espindola <espindola@google.com>
11935
11936 * testsuite/Makefile.am: Add the incremental_test.sh test.
11937 * testsuite/incremental_test.sh: New.
11938 * testsuite/incremental_test_1.c: New.
11939 * testsuite/incremental_test_2.c: New.
11940
954c3e2e
RÁE
119412009-12-01 Rafael Avila de Espindola <espindola@google.com>
11942
703d02da 11943 * incremental-dump.cc (main): Fix typos.
954c3e2e 11944
f8086623
RÁE
119452009-11-27 Rafael Avila de Espindola <espindola@google.com>
11946
11947 PR gold/11025
11948 * incremental-dump.cc (main): Use llu to print 64 bit values.
11949
3b0dd6ac
L
119502009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11951 H.J. Lu <hongjiu.lu@intel.com>
11952
11953 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11954 $(LIBDL).
11955 (incremental_dump_LDADD): Likewise.
11956 * Makefile.in: Regenerated.
11957
a6d1ef57 119582009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11959
a6d1ef57
DK
11960 Revert:
11961
11962 2009-11-25 Doug Kwan <dougkwan@google.com>
11963
11964 * arm.cc (Target_arm::Target_arm): Move method definition
11965 outside of class definition. Add code to handle
11966 --target1-rel, --target1-abs and --target2= options.
11967 (Target_arm::get_reloc_reloc_type): Change method to be
11968 non-static and const.
11969 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11970 New data member declaration.
11971 (Target_arm::Scan::local, Target_arm::Scan::global,
11972 Target_arm::Relocate::relocate,
11973 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11974 Adjust call to Target_arm::get_real_reloc_type.
11975 (Target_arm::get_real_reloc_type): Use command line options
11976 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11977 * options.h (--target1-rel, --target1-abs, --target2): New
11978 ARM-only options.
11979
50aeb7d4
DK
119802009-11-25 Doug Kwan <dougkwan@google.com>
11981
11982 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11983 class definition. Add code to handle --target1-rel, --target1-abs
11984 and --target2= options.
11985 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11986 and const.
11987 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11988 member declaration.
11989 (Target_arm::Scan::local, Target_arm::Scan::global,
11990 Target_arm::Relocate::relocate,
11991 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11992 call to Target_arm::get_real_reloc_type.
11993 (Target_arm::get_real_reloc_type): Use command line options to
11994 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11995 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11996 options.
11997
51938283
DK
119982009-11-25 Doug Kwan <dougkwan@google.com>
11999
12000 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12001 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12002 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12003 formatting.
12004 (Arm_relocate_functions::thm_call): Replace body with a call to
12005 Arm_relocate_functions::thumb_branch_common.
12006 (Arm_relocate_functions::thm_jump24,
12007 Arm_relocate_functions::thm_xpc22): New method definitions.
12008 (Arm_relocate_functions::thumb_branch_common): New method definition.
12009 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12010 operator.
12011 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12012 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12013
e2b8f3c4
RÁE
120142009-11-24 Rafael Avila de Espindola <espindola@google.com>
12015
12016 * Makefile.am: Build incremental-dump
12017 * Makefile.in: Regenerate.
12018 * incremental-dump.cc: New.
12019 * incremental.cc (Incremental_inputs_header_data,
12020 Incremental_inputs_entry_data): Move to incremental.h
12021 * incremental.h: (Incremental_inputs_header_data,
12022 Incremental_inputs_entry_data): Move from incremental.cc
12023
bcba9aec
RÁE
120242009-11-24 Rafael Avila de Espindola <espindola@google.com>
12025
12026 * incremental.cc (Incremental_inputs_header,
12027 Incremental_inputs_header_write, Incremental_inputs_entry,
12028 Incremental_inputs_entry_write): Add a typedef with the data type.
12029
7c3afe08
RÁE
120302009-11-24 Rafael Avila de Espindola <espindola@google.com>
12031
12032 * incremental.cc (Incremental_inputs_header,
12033 Incremental_inputs_header_write, Incremental_inputs_entry,
12034 Incremental_inputs_entry_write): Update comment about which
12035 type has the filed descriptions.
12036
d204b6e9
DK
120372009-11-15 Doug Kwan <dougkwan@google.com>
12038
12039 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12040 (Arm_relocate_functions::arm_branch_common): Change method defintion
12041 in class definition to a method declaration and update list of formal
12042 parameters.
12043 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12044 Arm_relocation_functions::jump24): Adjust call to
12045 Arm_relocate_functions::arm_branch_common. Update list of formal
12046 parameters.
12047 (Arm_relocate_functions::xpc25): New method definition.
12048 (Arm_relocate_functions::arm_branch_common): Move method defintion
12049 out from class definition. Use stubs for mode-switching and extending
12050 branch ranges.
12051 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12052 specially. Change code to enable use of stubs in ARM branches.
12053
43d12afe
DK
120542009-11-10 Doug Kwan <dougkwan@google.com>
12055
12056 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12057 in method declaration.
12058 (Target_arm::relocate_stub): New method declaration.
12059 (Target_arm::default_target): Change to return a pointer instead of
12060 a const reference.
12061 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12062 Target_arm::default_target.
12063 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12064 method definition.
12065 (Target_arm::relocate_section): Adjust view.
12066 (Target_arm::relocate_stub): New method definition.
12067
ac33a407
DK
120682009-11-10 Doug Kwan <dougkwan@google.com>
12069
12070 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12071 a format warning.
12072 * incremental.cc (open_incremental_binary): Initialized local
12073 variables to avoid warnings.
12074 * object.cc (make_elf_object): Ditto.
12075 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12076 a format warning.
e1df38aa 12077
88ee28e9
L
12078009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12079
12080 PR gold/10930
12081 * testsuite/plugin_test.c: Include "config.h".
12082
2daedcd6
DK
120832009-11-09 Doug Kwan <dougkwan@google.com>
12084
12085 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12086 (arm_symbol_value): Remove.
12087 (Arm_relocate_functions::arm_branch_common,
12088 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12089 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12090 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12091 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12092 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12093 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12094 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12095 Arm_relocate_functions::thm_mobw_abs_nc,
12096 Arm_relocate_functions::thm_mov_abs,
12097 Arm_relocate_functions::movw_prel_nc,
12098 Arm_relocate_functions::thm_movt_abs,
12099 Arm_relocate_functions::movt_prel,
12100 Arm_relocate_functions::thm_movw_prel_nc,
12101 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12102 (Target_arm::Relocate::relocate): Only decompose address into two
12103 parts if relocation type uses the thumb-bit and pass the actual
12104 bit instead of a flag indicating that the thumb-bit is used. Adjust
12105 calls to methods in Arm_relocate_functions for this change.
12106
1276bc89 121072009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12108
12109 PR 10925
12110 * reloc.cc: Instantiate
12111 Sized_relobj::initialize_input_to_output_maps and
12112 Sized_relobj:free_input_to_output_maps.
12113
e53ad1b5
ILT
121142009-11-06 Ian Lance Taylor <iant@google.com>
12115
12116 PR 10876
12117 * defstd.cc (in_segment): Set only_if_ref true for "end".
12118
eb44217c
DK
121192009-11-06 Doug Kwan <dougkwan@google.com>
12120
12121 * arm.cc (class Reloc_stub): Correct a comment.
12122 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12123 (Target_arm::scan_section_for_stubs): New method declaration.
12124 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12125 Change methods from private to protected.
12126 (Target_arm::do_may_relax): New method definition.
12127 (Target_arm::do_relax, Target_arm::group_sections,
12128 Target_arm::scan_reloc_for_stub,
12129 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12130 (Target_arm::arm_input_section_map_): New data member declaration.
12131 (Target_arm::scan_reloc_for_stub,
12132 Target_arm::scan_reloc_section_for_stubs,
12133 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12134 Target_arm::do_relax): New method definitions.
12135
5d329b7d
ILT
121362009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12137
12138 * configure.ac: Check for (struct stat)::st_mtim
12139 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12140 * config.in: Regenerate.
12141 * configure: Regenerate.
12142
96a0d71b
ILT
121432009-11-05 Ian Lance Taylor <iant@google.com>
12144
12145 PR 10910
12146 * output.cc (Output_segment::add_output_section): Add missing
12147 return statement.
12148
594c8e5e
ILT
121492009-11-04 Ian Lance Taylor <iant@google.com>
12150
12151 PR 10880
12152 * object.h (class Object): Add is_needed and set_is_needed
12153 methods. Add is_needed_ field. Make bool fields into bitfields.
12154 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12155 defined in a dynamic object and referenced by a regular object,
12156 set is_needed for the dynamic object.
12157 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12158 if the file is marked with as_needed and it is not needed.
12159
22b127cc
ILT
121602009-11-04 Ian Lance Taylor <iant@google.com>
12161
12162 PR 10887
12163 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12164 tags if data is discarded by linker script.
12165 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12166 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12167 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12168 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12169
f5c870d2
ILT
121702009-11-04 Ian Lance Taylor <iant@google.com>
12171
12172 * layout.cc (Layout::get_output_section): Add is_interp and
12173 is_dynamic_linker_section parameters. Change all callers.
12174 (Layout::choose_output_section): Likewise.
12175 (Layout::make_output_section): Likewise.
12176 (Layout::add_output_section_data): Add is_dynamic_linker_section
12177 parameter. Change all callers.
12178 * layout.h (class Layout): Update declarations.
12179 * output.h (class Output_section): Add is_interp, set_is_interp,
12180 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12181 Add is_interp_, is_dynamic_linker_section_ fields. Change
12182 generate_code_fills_at_write_ to a bitfield.
12183 * output.cc (Output_section::Output_sections): Initialize new
12184 fields.
12185 (Output_segment::add_output_section): Add do_sort parameter.
12186 Change all callers.
12187
1ae4d23b
ILT
121882009-11-03 Ian Lance Taylor <iant@google.com>
12189
12190 PR 10860
12191 * options.h (class General_options): Add --warn-common.
12192 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12193 merging two common symbols.
12194 (Symbol_table::should_override): Handle --warn-common when merging
12195 a common symbol with a defined symbol. Use report_resolve_problem
12196 for multiple definitions.
12197 (Symbol_table::report_resolve_problem): New function.
12198 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12199
55da9579
DK
122002009-11-03 Doug Kwan <dougkwan@google.com>
12201
12202 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12203 stub_factory_.
12204 (Target_arm::stub_factory): New method definition.
12205 (Target_arm::new_arm_input_section,
12206 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12207 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12208 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12209 New type definitions.
12210 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12211 member declarations.
12212 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12213 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12214 New method definitions.
12215
37a9ac43
ILT
122162009-11-03 Ian Lance Taylor <iant@google.com>
12217
12218 * options.h (class General_options): Add --warn_constructors.
12219
b3d6a3d4
ILT
122202009-11-03 Ian Lance Taylor <iant@google.com>
12221
12222 PR 10893
12223 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12224 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12225
934b01dd
ILT
122262009-11-03 Ian Lance Taylor <iant@google.com>
12227
12228 PR 10895
12229 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12230 --msgid-bugs-address.
12231 (install-pdf): New target.
12232 (install-data_yes): Look up one directory to find mkinstalldirs.
12233
03c1939b
L
122342009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12235
12236 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12237 tree.
12238
ebd95253
DK
122392009-10-30 Doug Kwan <dougkwan@google.com>
12240
12241 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12242
e9bbb538
DK
122432009-10-30 Doug Kwan <dougkwan@google.com>
12244
12245 * arm.cc (Stub_addend_reader): New struct template definition
12246 and partial specializations.
12247 (Stub_addend_reader::operator()): New method definition for a
12248 partially specialized template.
12249
d5b40221
DK
122502009-10-30 Doug Kwan <dougkwan@google.com>
12251
12252 * arm.cc (Arm_relobj::processor_specific_flags): New method
12253 definition.
12254 (Arm_relobj::do_read_symbols): New method declaration.
12255 (Arm_relobj::processor_specific_flags_): New data member declaration.
12256 (Arm_dynobj): New class definition.
12257 (Target_arm::do_finalize_sections): Add input_objects parameter.
12258 (Target_arm::do_adjust_elf_header): New method declaration.
12259 (Target_arm::are_eabi_versions_compatible,
12260 (Target_arm::merge_processor_specific_flags): New method declaration.
12261 (Target_arm::do_make_elf_object): New overloaded method definitions
12262 and declaration.
12263 (Arm_relobj::do_read_symbols): New method definition.
12264 (Arm_dynobj::do_read_symbols): Ditto.
12265 (Target_arm::do_finalize_sections): Add input_objects parameters.
12266 Merge processor-specific flags from all input objects.
12267 (Target_arm::are_eabi_versions_compatible,
12268 Target_arm::merge_processor_specific_flags,
12269 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12270 New method definitions.
12271 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12272 Input_objects pointer type parameter.
12273 * layout.cc (Layout::finalize): Pass input objects to target's.
12274 finalize_sections function.
12275 * output.cc (Output_file_header::do_sized_write): Set ELF file
12276 header's processor-specific flags.
12277 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12278 Input_objects pointer type parameter.
12279 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12280 * target.h (Input_objects): New forward class declaration.
12281 (Target::processor_specific_flags,
12282 Target::are_processor_specific_flags_sect): New method definitions.
12283 (Target::finalize_sections): Add input_objects parameter.
12284 (Target::Target): Initialize processor_specific_flags_ and
12285 are_processor_specific_flags_set_.
12286 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12287 parameter.
12288 (Target::set_processor_specific_flags): New method definition.
12289 (Target::processor_specific_flags_,
12290 Target::are_processor_specific_flags_set_): New data member
12291 declarations.
12292 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12293 Input_objects pointer type parameter.
12294
ebabffbd
DK
122952009-10-30 Doug Kwan <dougkwan@google.com>
12296
12297 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12298
ad0f2072
ILT
122992009-10-28 Ian Lance Taylor <iant@google.com>
12300
12301 * object.h (class Relobj): Drop options parameter from
12302 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12303 do_scan_relocs, do_relocate. Change all callers.
12304 (class Sized_relobj): Drop options parameters from
12305 do_gc_process_relocs, do_scan_relocs, do_relocate,
12306 do_relocate_sections, relocate_sections, emit_relocs_scan,
12307 emit_relocs_scan_reltype. Change all callers.
12308 (struct Relocate_info): Remove options field and all references to
12309 it.
12310 * reloc.h (class Read_relocs): Remove options constructor
12311 parameter and options_ field. Change all callers.
12312 (class Gc_process_relocs, class Scan_relocs): Likewise.
12313 (class Relocate_task): Likewise.
12314 * target-reloc.h (scan_relocs): Remove options parameter. Change
12315 all callers.
12316 (scan_relocatable_relocs): Likewise.
12317 * target.h (class Sized_target): Remove options parameter from
12318 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12319 all callers.
12320 * gc.h (gc_process_relocs): Remove options parameter. Change all
12321 callers.
12322 * arm.cc: Update functions to remove options parameters.
12323 * i386.cc: Likewise.
12324 * powerpc.cc: Likewise.
12325 * sparc.cc: Likewise.
12326 * x86_64.cc: Likewise.
12327 * testsuite/testfile.cc: Likewise.
12328
8ffa3667
DK
123292009-10-28 Doug Kwan <dougkwan@google.com>
12330
12331 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12332 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12333 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12334 New method definitions.
12335
40f36857
CC
123362009-10-28 Cary Coutant <ccoutant@google.com>
12337
12338 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12339 (Plugin::cleanup_done_): New member.
12340 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12341 (Plugin_manager::cleanup_done_): Remove.
12342 (Plugin_manager::add_input_file): Edit error message.
12343 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12344 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12345
2c849493
ILT
123462009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12347
12348 * fileread.cc: (File_read::View::~View): Use the new
12349 data_ownership_ filed.
12350 (File_read::~File_read): Dispose the new whole_file_view_.
12351 (File_read::open): Mmap the whole file if needed.
12352 (File_read::open): Use whole_file_view_ instead of contents_.
12353 (File_read::find_view): Use whole_file_view_ if applicable.
12354 (File_read::do_read): Use whole_file_view_ instead of contents_.
12355 (File_read::make_view): Use whole_file_view_ instead of contents_,
12356 update File_read::View::View call.
12357 (File_read::find_or_make_view): Update File_read::View::View
12358 call.
12359 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12360 remove contents_
12361 (File_read::View::Data_ownership): New enum.
12362 (File_read::View::View): Replace bool mapped_ with Data_ownership
12363 argument.
12364 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12365 (File_read::View::data_ownership_): New field.
12366 (File_read::contents_): Remove (replaced by whole_file_view_).
12367 (File_read::whole_file_view_): New field.
12368 * options.h (class General_options): Add --keep-files-mapped.
12369
24998053
CC
123702009-10-27 Cary Coutant <ccoutant@google.com>
12371
12372 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12373 * testsuite/Makefile.am (plugin_test_5): New test case.
12374 * testsuite/Makefile.in: Regenerate.
12375
72adc4fa
DK
123762009-10-25 Doug Kwan <dougkwan@google.com>
12377
12378 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12379 from private to protected to allow access by child class.
12380 (Sized_relobj::do_relocate_sections): New method declaration.
12381 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12382 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12383 Sized_relobj::relocate_sections. Instantiate template explicitly
12384 for different target sizes and endianity.
12385
07f508a2
DK
123862009-10-24 Doug Kwan <dougkwan@google.com>
12387
12388 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12389 (Arm_input_section::as_arm_input_section): New method.
12390 (Arm_output_section): New class definition.
12391 (Arm_output_section::create_stub_group,
12392 Arm_output_section::group_sections): New method definitions.
12393
10ad9fe5
DK
123942009-10-22 Doug Kwan <dougkwan@google.com>
12395
12396 * arm.cc (Arm_input_section): New class definition.
12397 (Arm_input_section::init, Arm_input_section:do_write,
12398 Arm_input_section::set_final_data_size,
12399 Arm_input_section::do_reset_address_and_file_offset): New method
12400 definitions.
12401
56ee5e00
DK
124022009-10-21 Doug Kwan <dougkwan@google.com>
12403
12404 * arm.cc (Stub_table, Arm_input_section): New forward class
12405 declarations.
12406 (Stub_table): New class defintion.
12407 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12408 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12409 New method definition.
12410
b569affa
DK
124112009-10-21 Doug Kwan <dougkwan@google.com>
12412
12413 * arm.cc: Update copyright comments.
12414 (Target_arm): New forward class template declaration.
12415 (Arm_address): New type.
12416 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12417 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12418 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12419 constants.
12420 (Insn_template): Same.
12421 (DEF_STUBS): New macro.
12422 (Stub_type): New enum type.
12423 (Stub_template): New class definition.
12424 (Stub): Same.
12425 (Reloc_stub): Same.
12426 (Stub_factory): Same.
12427 (Target_arm::Target_arm): Initialize may_use_blx_ and
12428 should_force_pic_veneer_.
12429 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12430 Target_arm::should_force_pic_veneer,
12431 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12432 Target_arm::using_thumb_only, Target_arm:;default_target): New
12433 method defintions.
12434 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12435 New data member declarations.
12436 (Insn_template::size, Insn_template::alignment): New method defintions.
12437 (Stub_template::Stub_template): New method definition.
12438 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12439 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12440 (Stub_factory::Stub_factory): New method definition.
12441 * gold.h (string_hash): New template.
12442 * output.h (Input_section_specifier::hash_value): Use
12443 gold::string_hash.
12444 (Input_section_specifier::string_hash): Remove.
12445 * stringpool.cc (Stringpool_template::string_hash): Use
12446 gold::string_hash.
12447
6c172549
DK
124482009-10-20 Doug Kwan <dougkwan@google.com>
12449
12450 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12451 symbols of relaxed input sections.
12452 * output.h (Output_section::find_relaxed_input_section): Make
12453 method public.
12454
c5617f2f
DK
124552009-10-16 Doug Kwan <dougkwan@google.com>
12456
12457 * dynobj.cc (Versions::Versions): Initialize version_script_.
12458 Only insert base version symbol definition for a shared object
12459 if version script defines any version versions.
12460 (Versions::define_base_version): New method definition.
12461 (Versions::add_def): Check that base version is not needed.
12462 (Versions::add_need): Define base version lazily.
12463 * dynobj.h (Versions::define_base_version): New method declaration.
12464 (Versions::needs_base_version_): New data member declaration.
12465 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12466 (check_DATA): Add no_version_test.stdout.
12467 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12468 New make rules.
12469 * testsuite/Makefile.in: Regenerate.
12470 * testsuite/no_version_test.c: New file.
12471 * testsuite/no_version_test.sh: Ditto.
12472
3c12dcdb
DK
124732009-10-16 Doug Kwan <dougkwan@google.com>
12474
12475 * expression.cc (class Segment_start_expression): New class definition.
12476 (Segment_start_expression::value): New method definition.
12477 (script_exp_function_segment_start): Return a new
12478 Segment_start_expression.
12479 * gold/script-c.h (script_saw_segment_start_expression): New function
12480 prototype.
12481 * script-sections.cc (Script_sections::Script_sections): Initialize
12482 SAW_SEGMENT_START_EXPRESSION_ to false.
12483 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12484 and -Tbbs options to specify section addresses if given in
12485 command line and no SEGMENT_START expression is seen in a script.
12486 * script-sections.h (Script_sections::saw_segment_start_expression,
12487 Script_sections::set_saw_segment_start_expression): New method
12488 definition.
12489 (Script_sections::saw_segment_start_expression_): New data member
12490 declaration.
12491 * script.cc (script_saw_segment_start_expression): New function.
12492 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12493 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12494 script_test_7.sh and script_test_8.sh.
12495 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12496 script_test_8.stdout.
12497 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12498 (script_test_6, script_test_6.stdout, script_test_7,
12499 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12500 * Makefile.in: Regenerate.
12501 * testsuite/script_test_6.sh: New file.
12502 * testsuite/script_test_6.t: Same.
12503 * testsuite/script_test_7.sh: Same.
12504 * testsuite/script_test_7.t: Same.
12505 * testsuite/script_test_8.sh: Same.
12506
64b1ae37
DK
125072009-10-16 Doug Kwan <dougkwan@google.com>
12508
12509 * output.cc (Output_segment::set_section_list_address): Cast
12510 expressions to unsigned long long type to avoid format warnings.
12511
661be1e2
ILT
125122009-10-15 Ian Lance Taylor <iant@google.com>
12513
12edd763 12514 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12515 dot assignment to script_sections_.
12edd763
ILT
12516 * script-sections.cc (Script_sections::add_dot_assignment):
12517 Initialize if necessary.
12518
68b6574b
ILT
12519 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12520 program headers with no load segment if there is a linker script.
12521
661be1e2
ILT
12522 * layout.cc (Layout::set_segment_offsets): Align the file offset
12523 to the segment aligment for -N or -n with no load segment.
12524 * output.cc (Output_segment::add_output_section): Don't crash if
12525 the first section is a TLS section.
12526 (Output_segment::set_section_list_addresses): Print an error
12527 message if the address moves backward in a linker script.
12528 * script-sections.cc
12529 (Output_section_element_input::set_section_addresses): Don't
12530 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12531 (Orphan_output_section::set_section_addresses): Likewise.
12532
f15f61a7
DK
125332009-10-15 Doug Kwan <dougkwan@google.com>
12534
12535 * layout.cc (Layout::finish_dynamic_section): Generate tags
12536 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12537 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12538 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12539
82bb573a
ILT
125402009-10-14 Ian Lance Taylor <iant@google.com>
12541
12542 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12543 fields.
12544 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12545 data_shdr fields of relinfo.
12546 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12547 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12548 R_386_TLS_LDO_32, adjust based on section flags.
12549 (Target_i386::Relocate::fix_up_ldo): Remove.
12550
374ad285
ILT
125512009-10-13 Ian Lance Taylor <iant@google.com>
12552
12553 Add support for -pie.
12554 * options.h (class General_options): Add -pie and
12555 --pic-executable.
12556 (General_options::output_is_position_independent): Test -pie.
12557 (General_options::output_is_executable): Return true if not shared
12558 and not relocatable.
12559 (General_options::output_is_pie): Remove.
12560 * options.cc (General_options::finalize): Reject incompatible uses
12561 of -pie.
12562 * gold.cc (queue_middle_tasks): A -pie link is not static.
12563 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12564 * symtab.cc (Symbol::final_value_is_known): Return false if
12565 output_is_position_independent.
12566 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12567 output_is_position_independent.
12568 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12569 output_is_position_independent.
12570 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12571 output_is_position_independent.
12572 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12573 two_file_pie_test.
12574 (basic_pie_test.o, basic_pie_test): New targets.
12575 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12576 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12577 (two_file_pie_test): New target.
12578 * testsuite/Makefile.in: Rebuild.
12579 * README: Remove note saying that -pie is not supported.
12580
c6585162
ILT
125812009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12582
12583 * options.h (class General_options): Add -init and -fini.
12584 * layout.cc (Layout::finish_dynamic_section): Emit
12585 given init and fini functions.
12586
032ce4e9
ST
125872009-10-13 Sriraman Tallam <tmsriram@google.com>
12588
12589 * gc.h (gc_process_relocs): Check if icf is enabled using new
12590 function.
12591 * gold.cc (queue_initial_tasks): Likewise.
12592 (queue_middle_tasks): Likewise.
12593 * object.cc (do_layout): Likewise.
12594 * symtab.cc (is_section_folded): Likewise.
12595 * main.cc (main): Likewise.
12596 * reloc.cc (Read_relocs::run): Likewise.
12597 (Sized_relobj::do_scan_relocs): Likewise.
12598 * icf.cc (is_function_ctor_or_dtor): New function.
12599 (Icf::find_identical_sections): Check if function is ctor or dtor when
12600 safe icf is chosen.
12601 * options.h (General_options::icf): Change option to be an enum.
12602 (Icf_status): New enum.
12603 (icf_enabled): New method.
12604 (icf_safe_folding): New method.
12605 (set_icf_status): New method.
12606 (icf_status_): New variable.
12607 * (options.cc) (General_options::finalize): Set icf_status_.
12608 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12609 icf_test and icf_keep_unique_test to use the --icf enum flag.
12610 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12611 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12612
f345227a
ST
126132009-10-12 Sriraman Tallam <tmsriram@google.com>
12614
12615 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12616 includes to gc.h and icf.h.
12617 * arm.cc: Include gc.h.
12618 * gold.cc: Likewise.
12619 * i386.cc: Likewise.
12620 * powerpc.cc: Likewise.
12621 * sparc.cc: Likewise.
12622 * x86_64.cc: Likewise.
12623 * gc.h: Include icf.h.
12624
1c7814ed
ILT
126252009-10-11 Ian Lance Taylor <iant@google.com>
12626
12627 * plugin.cc: Include "gold.h" before other header files.
12628
ae3b5189
CD
126292009-10-10 Chris Demetriou <cgd@google.com>
12630
12631 * options.h (Input_file_argument::Input_file_type): New enum.
12632 (Input_file_argument::is_lib_): Replace with...
12633 (Input_file_argument::type_): New member.
12634 (Input_file_argument::Input_file_argument): Take Input_file_type
12635 'type' rather than boolean 'is_lib' as second argument.
12636 (Input_file_argument::is_lib): Use type_.
12637 (Input_file_argument::is_searched_file): New function.
12638 (Input_file_argument::may_need_search): Handle is_searched_file.
12639 * options.cc (General_options::parse_library): Support -l:filename.
12640 (General_options::parse_just_symbols): Update for Input_file_argument
12641 changes.
12642 (Command_line::process): Likewise.
12643 * archive.cc (Archive::get_file_and_offset): Likewise.
12644 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12645 * script.cc (read_script_file, script_add_file): Likewise.
12646 * fileread.cc (Input_file::Input_file): Likewise.
12647 (Input_file::will_search_for): Handle is_searched_file.
12648 (Input_file::open): Likewise.
12649 * readsyms.cc (Read_symbols::get_name): Likewise.
12650 * testsuite/Makefile.am (searched_file_test): New test.
12651 * testsuite/Makefile.in: Regenerate.
12652 * testsuite/searched_file_test.cc: New file.
12653 * testsuite/searched_file_test_lib.cc: New file.
12654
f3048a1d
ILT
126552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12656 Ian Lance Taylor <iant@google.com>
12657
12658 * descriptor.cc: Include <cstdio> and "binary-io.h".
12659 (Descriptors::open): Open the files in binary mode always.
12660 * script.cc (Lex::get_token): Treat \r as whitespace.
12661
d4780e57
ILT
126622009-10-09 Ian Lance Taylor <iant@google.com>
12663
12664 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12665
d9a893b8
ILT
126662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12667 Ian Lance Taylor <iant@google.com>
12668
12669 * configure.ac: Check for readv function also.
12670 * fileread.cc (readv): Define if not HAVE_READV.
12671 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12672 does not exist.
12673 * config.in: Regenerate.
12674 * configure: Regenerate.
12675
c0a62865
DK
126762009-10-09 Doug Kwan <dougkwan@google.com>
12677
12678 * layout.cc (Layout::make_output_section): Call target hook to make
12679 ordinary output section.
12680 (Layout::finalize): Adjust parameter list of call the
12681 Target::may_relax().
12682 * layout.h (class Layout::section_list): New method.
12683 * merge.h (Output_merge_base::entsize): Change visibility to public.
12684 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12685 New methods.
12686 (Output_merge_string::do_is_string): New method.
12687 * object.cc (Sized_relobj::do_setup): renamed from
12688 Sized_relobj::set_up.
12689 * object.h (Sized_relobj::adjust_shndx,
12690 Sized_relobj::initializ_input_to_output_maps,
12691 Sized_relobj::free_input_to_output_maps): Change visibilities to
12692 protected.
12693 (Sized_relobj::setup): Virtualize.
12694 (Sized_relobj::do_setup): New method declaration.
12695 (Sized_relobj::invalidate_section_offset,
12696 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12697 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12698 * options.cc (parse_int): New function.
12699 * options.h (parse_int): New declaration.
12700 (DEFINE_int): New macro.
12701 (stub_group_size): New option.
12702 * output.cc (Output_section::Output_section): Initialize memebers
12703 merge_section_map_, merge_section_by_properties_map_,
12704 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12705 (Output_section::add_input_section): Handled deferred code-fill
12706 generation and remove an old comment.
12707 (Output_section::add_relaxed_input_section): New method definition.
12708 (Output_section::add_merge_input_section): Use merge section by
12709 properties map to speed to search. Update merge section maps
12710 as appropriate.
12711 (Output_section::build_relaxation_map): New method definition.
12712 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12713 Same.
12714 (Output_section::relax_input_section): Renamed to
12715 Output_section::convert_input_sections_to_relaxed_sections and change
12716 interface to take a vector of pointers to relaxed sections.
12717 (Output_section::find_merge_section,
12718 Output_section::find_relaxed_input_section): New method definitions.
12719 (Output_section::is_input_address_mapped,
12720 Output_section::output_offset, Output_section::output_address):
12721 Use output section data maps to speed up searching.
12722 (Output_section::find_starting_output_address): Add comments.
12723 (Output_section::do_write,
12724 Output_section::write_to_postprocessing_buffer): Do code-fill
12725 generation as appropriate.
12726 (Output_section::get_input_sections): Invalidate relaxed input section
12727 map.
12728 (Output_section::restore_states): Adjust type of checkpoint .
12729 Invalidate relaxed input section map.
12730 * output.h (Output_merge_base): New class declaration.
12731 (Input_section_specifier): New class defintion.
12732 (class Output_relaxed_input_section) Change base class to
12733 Output_section_data_build.
12734 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12735 base class initializer.
12736 (Output_section::add_relaxed_input_section): New method declaration.
12737 (Output_section::Input_section): Change visibility to protected.
2e702c99 12738 (Output_section::Input_section::relobj,
c0a62865
DK
12739 Output_section::Input_section::shndx): Handle relaxed input sections.
12740 Output_section::input_sections) Change visibility to protected. Also
12741 define overload to return a non-const pointer.
12742 (Output_section::Merge_section_properties): New class defintion.
12743 (Output_section::Merge_section_by_properties_map,
12744 Output_section::Output_section_data_by_input_section_map,
12745 Output_section::Relaxation_map): New types.
12746 (Output_section::relax_input_section): Rename method to
12747 Output_section::convert_input_sections_to_relaxed_sections and change
12748 interface to take a vector of relaxed section pointers.
12749 (Output_section::find_merge_section,
12750 Output_section::find_relaxed_input_section,
12751 Output_section::build_relaxation_map,
12752 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12753 New method declarations.
12754 (Output_section::merge_section_map_
12755 Output_section::merge_section_by_properties_map_,
12756 Output_section::relaxed_input_section_map_,
12757 Output_section::is_relaxed_input_section_map_valid_,
12758 Output_section::generate_code_fills_at_write_): New data members.
12759 * script-sections.cc
12760 (Output_section_element_input::set_section_addresses): Call
12761 current_data_size and addralign methods of relaxed input sections.
12762 (Orphan_output_section::set_section_addresses): Call current_data_size
12763 and addralign methods of relaxed input sections.
12764 * symtab.cc (Symbol_table::compute_final_value): Extract template
12765 from the body of Symbol_table::sized_finalize_symbol.
12766 (Symbol_table::sized_finalized_symbol): Call
12767 Symbol_table::compute_final_value.
12768 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12769 (Symbol_table::compute_final_value): New templated method declaration.
12770 * target.cc (Target::do_make_output_section): New method defintion.
12771 * target.h (Target::make_output_section): New method declaration.
12772 (Target::relax): Add more parameters for input objects, symbol table
12773 and layout. Adjust call to do_relax.
12774 (Target::do_make_output_section): New method declaration.
12775 (Target::do_relax): Add parameters for input objects, symbol table
12776 and layout.
12777
d446d6c4
ILT
127782009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12779
12780 * pread.c: Include stdio.h.
12781
bc06c745
ILT
127822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12783
12784 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12785 defined.
12786
75aea3d0
ILT
127872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12788
12789 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12790 Change read_shndx type to unsigned int.
12791 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12792 int.
12793 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12794 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12795 Change read_shndx type to unsigned int.
12796 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12797 int.
12798 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12799 * layout.cc (Layout::create_symtab_sections): Cast the result of
12800 local_symcount * symsize to off_t in the gold_assert.
12801
be8fcb75
ILT
128022009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12803
12804 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12805 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12806 R_ARM_BASE_ABS.
12807 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12808 (Arm_relocate_functions::thm_abs5): New function.
12809 (Arm_relocate_functions::abs12): New function.
12810 (Arm_relocate_functions::abs16): New function.
12811 (Arm_relocate_functions::base_abs): New function.
12812 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12813 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12814 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12815 R_ARM_BASE_ABS.
12816 (Scan::global): Likewise.
12817 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12818 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12819 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12820 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12821 R_ARM_BASE_ABS.
12822
c2a122b6
ILT
128232009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12824
12825 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12826 (Arm_relocate_functions::movt_prel): New function.
12827 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12828 (Arm_relocate_functions::thm_movt_prel): New function.
12829 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12830 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12831 (Scan::global, Relocate::relocate): Likewise.
12832 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12833
c4aa1e2d
ILT
128342009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12835
12836 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12837 Incremental_checker.
12838 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12839 unsigned int.
12840 (class Incremental_inputs_header): New class.
12841 (Incremental_inputs_header_writer): Edit comment.
12842 (Incremental_inputs_entry): New class.
12843 (Incremental_inputs_entry_writer): Edit comment.
12844 (Sized_incremental_binary::do_find_incremental_inputs_section):
12845 Add *strtab_shndx parameter, fill it.
12846 (Sized_incremental_binary::do_check_inputs): New method.
12847 (Incremental_checker::can_incrementally_link_output_file): Use
12848 Sized_incremental_binary::check_inputs.
12849 (Incremental_inputs::report_command_line): Save command line in
12850 command_line_.
12851 * incremental.h:
12852 (Incremental_binary::find_incremental_inputs_section): New
12853 method.
12854 (Incremental_binary::do_find_incremental_inputs_section): Add
12855 strtab_shndx parameter.
12856 (Incremental_binary::do_check_inputs): New pure virtual method.
12857 (Sized_incremental_binary::do_check_inputs): Declare.
12858 (Incremental_checker::Incremental_checker): Add incremental_inputs
12859 parameter, use it to initialize incremental_inputs_.
12860 (Incremental_checker::incremental_inputs_): New field.
12861 (Incremental_checker::command_line): New method.
12862 (Incremental_checker::inputs): New method.
12863 (Incremental_checker::command_line_): New field.
12864
c549a694
ILT
128652009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12866
12867 * incremental.cc: Include <cstdarg> and "target-select.h".
12868 (vexplain_no_incremental): New function.
12869 (explain_no_incremental): New function.
12870 (Incremental_binary::error): New method.
12871 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12872 method.
12873 (make_sized_incremental_binary): New function.
12874 (open_incremental_binary): New function.
12875 (can_incrementally_link_file): Add checks if output is ELF and has
12876 inputs section.
12877 * incremental.h: Include "elfcpp_file.h" and "output.h".
12878 (Incremental_binary): New class.
12879 (Sized_incremental_binary): New class.
12880 (open_incremental_binary): Declare.
12881 * object.cc (is_elf_object): Use
12882 elfcpp::Elf_recognizer::is_elf_file.
12883 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12884 * output.h (Output_file::filesize): New method.
12885
fd3c5f0b
ILT
128862009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12887
12888 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12889 New function.
12890 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12891 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12892 function.
12893 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12894 function.
12895 (Arm_relocate_functions::movw_abs_nc): New function.
12896 (Arm_relocate_functions::movt_abs): New function.
12897 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12898 (Arm_relocate_functions::thm_movt_abs): New function.
12899 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12900 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12901 (Scan::global): Likewise.
12902 (Relocate::relocate): Likewise.
12903 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12904
7f5309a5
ILT
129052009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12906
12907 * arm.cc (Arm_relocate_functions::got_prel) New function.
12908 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12909 (Relocate::relocate): Likewise.
12910 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12911
364c7fa5
ILT
129122009-10-06 Ian Lance Taylor <iant@google.com>
12913
12914 * options.h (class General_options): Define
12915 split_stack_adjust_size parameter.
12916 * object.h (class Object): Add uses_split_stack_ and
12917 has_no_split_stack_ fields. Add uses_split_stack and
12918 has_no_split_stack accessor functions. Declare
12919 handle_split_stack_section.
12920 (class Reloc_symbol_changes): Define.
12921 (class Sized_relobj): Define Function_offsets. Declare
12922 split_stack_adjust, split_stack_adjust_reltype, and
12923 find_functions.
12924 * object.cc (Object::handle_split_stack_section): New function.
12925 (Sized_relobj::do_layout): Call handle_split_stack_section.
12926 * dynobj.cc (Sized_dynobj::do_layout): Call
12927 handle_split_stack_section.
12928 * reloc.cc (Sized_relobj::relocate_sections): Call
12929 split_stack_adjust for executable sections in split_stack
12930 objects. Pass reloc_map to relocate_section.
12931 (Sized_relobj::split_stack_adjust): New function.
12932 (Sized_relobj::split_stack_adjust_reltype): New function.
12933 (Sized_relobj::find_functions): New function.
12934 * target-reloc.h: Include "object.h".
12935 (relocate_section): Add reloc_symbol_changes parameter. Change
12936 all callers.
12937 * target.h (class Target): Add calls_non_split method. Declare
12938 do_calls_non_split virtual method. Declare match_view and
12939 set_view_to_nop.
12940 * target.cc: Include "elfcpp.h".
12941 (Target::do_calls_non_split): New function.
12942 (Target::match_view): New function.
12943 (Target::set_view_to_nop): New function.
12944 * gold.cc (queue_middle_tasks): Give an error if mixing
12945 split-stack and non-split-stack objects with -r.
12946 * i386.cc (Target_i386::relocate_section): Add
12947 reloc_symbol_changes parameter.
12948 (Target_i386::do_calls_non_split): New function.
12949 * x86_64.cc (Target_x86_64::relocate_section): Add
12950 reloc_symbol_changes parameter.
12951 (Target_x86_64::do_calls_non_split): New function.
12952 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12953 parameter.
12954 * powerpc.cc (Target_powerpc::relocate_section): Add
12955 reloc_symbol_changes parameter.
12956 * sparc.cc (Target_sparc::relocate_section): Add
12957 reloc_symbol_changes parameter.
12958 * configure.ac: Call AM_CONDITIONAL for the default target.
12959 * configure: Rebuild.
12960 * testsuite/Makefile.am (TEST_AS): New variable.
12961 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12962 (check_DATA): Add split_i386 and split_x86_64 files.
12963 (SPLIT_DEFSYMS): Define.
12964 (split_i386_[1234n].o): New targets.
12965 (split_i386_[124]): New targets.
12966 (split_i386_[1234r].stdout): New targets.
12967 (split_x86_64_[1234n].o): New targets.
12968 (split_x86_64_[124]): New targets.
12969 (split_x86_64_[1234r].stdout): New targets.
12970 (MOSTLYCLEANFILES): Add new executables.
12971 * testsuite/split_i386.sh: New file.
12972 * testsuite/split_x86_64.sh: New file.
12973 * testsuite/split_i386_1.s: New file.
12974 * testsuite/split_i386_2.s: New file.
12975 * testsuite/split_i386_3.s: New file.
12976 * testsuite/split_i386_4.s: New file.
12977 * testsuite/split_i386_n.s: New file.
12978 * testsuite/split_x86_64_1.s: New file.
12979 * testsuite/split_x86_64_2.s: New file.
12980 * testsuite/split_x86_64_3.s: New file.
12981 * testsuite/split_x86_64_4.s: New file.
12982 * testsuite/split_x86_64_n.s: New file.
12983 * testsuite/testfile.cc (Target_test): Update relocation_section
12984 function.
12985 * testsuite/Makefile.in: Rebuild.
12986
e8a9fcda
ILT
129872009-10-06 Ian Lance Taylor <iant@google.com>
12988
12989 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12990 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12991 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12992 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12993 the address on ldo_addrs_.
12994 (Target_i386::Relocate::fix_up_ldo): New function.
12995
e99daf92
ILT
129962009-10-06 Rafael Espindola <espindola@google.com>
12997
12998 * plugin.cc (add_input_library): New.
12999 (Plugin::load): Add add_input_library to tv.
13000 (Plugin_manager::add_input_file): Add the is_lib argument.
13001 (add_input_file): Update call to Plugin_manager::add_input_file.
13002 (add_input_library): New.
13003 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13004
966d4097
DK
130052009-09-30 Doug Kwan <dougkwan@google.com>
13006
13007 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13008 symbol and call Symbol::may_need_copy_reloc to determine if
13009 a copy reloc is needed.
13010 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13011 nocopyreloc is given in command line.
13012 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13013 given in command line.
13014 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13015 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13016 of the removed Target_i386::may_need_copy_reloc.
13017 * options.h (copyreloc): New option with default value false.
13018 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13019 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13020 instead of the removed Target_powerpc::may_need_copy_reloc.
13021 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13022 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13023 instead of the removed Target_sparc::may_need_copy_reloc.
13024 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13025 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13026 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13027 instead of the removed Target_x86_64::may_need_copy_reloc.
13028
029ba973
ILT
130292009-09-30 Ian Lance Taylor <iant@google.com>
13030
13031 * object.h (class Object): Remove target_ field, and target,
13032 sized_target, and set_target methods.
13033 (Object::sized_target): Remove.
13034 (class Sized_relobj): Update declarations. Remove sized_target.
13035 * object.cc (Sized_relobj::setup): Remove target parameter.
13036 Change all callers.
13037 (Input_objects::add_object): Don't do anything with the target.
13038 (make_elf_sized_object): Add punconfigured parameter. Change all
13039 callers. Set or test parameter target.
13040 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13041 Change all callers.
13042 * parameters.cc (Parameters::set_target): Change parameter type to
13043 be non-const.
13044 (Parameters::default_target): Remove.
13045 (set_parameters_target): Change parameter type to be non-const.
13046 (parameters_force_valid_target): New function.
13047 (parameters_clear_target): New function.
13048 * parameters.h (class Parameters): Update declarations. Remove
13049 default_target method. Add sized_target and clear_target
13050 methods. Change target_ to be non-const.
13051 (set_parameters_target): Update declaration.
13052 (parameters_force_valid_target): Declare.
13053 (parameters_clear_target): Declare.
13054 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13055 as NULL if we aren't searching.
13056 (Add_symbols::run): Don't check for compatible target.
13057 * fileread.cc (Input_file::open_binary): Call
13058 parameters_force_valid_target.
13059 * gold.cc (queue_middle_tasks): Likewise.
13060 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13061 set_target on object.
13062 * dynobj.h (class Sized_dynobj): Update declarations.
13063 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13064 make_elf_object returns NULL.
13065 (Archive::include_member): Don't check whether object target is
13066 compatible.
13067 * output.cc (Output_section::add_input_section): Get target from
13068 parameters.
13069 (Output_section::relax_input_section): Likewise.
13070 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13071 parameters.
13072 (Sized_relobj::do_scan_relocs): Likewise.
13073 (Sized_relobj::relocate_sections): Likewise.
13074 * resolve.cc (Symbol_table::resolve): Likewise.
13075 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13076 parameter. Change all callers.
13077 (Symbol_table::add_from_object): Get target from parameters.
13078 (Symbol_table::add_from_relobj): Don't check object target.
13079 (Symbol_table::add_from_dynobj): Likewise.
13080 (Symbol_table::define_special_symbol): Get target from
13081 parameters.
13082 * symtab.h (class Symbol_table): Update declaration.
13083 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13084 parameter. Change all callers. Clear parameter target.
13085 (Binary_test): Test target here.
13086 * testsuite/object_unittest.cc (gold_testsuite): Remove
13087 target_test_pointer parameter. Change all callers.
13088 (Object_test): Test target here.
13089
a6a22b83
ILT
130902009-09-26 Ian Lance Taylor <iant@google.com>
13091
13092 * testsuite/initpri1.c: Don't try to use constructor priorities if
13093 compiling with gcc before 4.3.
13094
6a8f49fe
ILT
130952009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13096
13097 * testsuite/retain_symbols_file_test.sh (check_present): Change
13098 output file name to retain_symbols_file_test.stdout.
13099 (check_absent): Likewise.
13100
8c604651
CS
131012009-09-18 Craig Silverstein <csilvers@google.com>
13102
13103 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13104 * options.cc: Include <cerrno> and <fstream>.
13105 (General_options::finalize): Parse -retain-symbols-file tag.
13106 * options.h: New flag.
13107 (General_options): New method should_retain_symbol, new
13108 variable symbols_to_retain.
13109 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13110 should_retain_symbol map.
13111 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13112 * testsuite/Makefile.in: Regenerate.
13113 * testsuite/retain_symbols_file_test.sh: New file.
13114
ca58b19f
NC
131152009-09-18 Nick Clifton <nickc@redhat.com>
13116
13117 * po/es.po: Updated Spanish translation.
13118
20e6d0d6
DK
131192009-09-17 Doug Kwan <dougkwan@google.com>
13120
13121 * debug.h (DEBUG_RELAXATION): New constant.
13122 (DEBUG_ALL): Add DEBUG_RELAXATION.
13123 (debug_string_to_enum): Add relaxation debug option.
13124 * layout.cc
13125 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13126 Layout::Relaxation_debug_check::read_sections,
13127 Layout::Relaxation_debug_check::read_sections): New method definitions.
13128 (Layout::Layout): Initialize data members
13129 record_output_section_data_from_scrips_,
13130 script_output_section_data_list_ and relaxation_debug_check_.
13131 (Layout::save_segments, Layout::restore_segments,
13132 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13133 Layout::relaxation_loop_body): New method definitions.
13134 (Layout::finalize): Support relaxation. Move section layout code to
13135 Layout::relaxation_loop_body.
13136 (Layout::set_asection_address_from_script): Move code for orphan
13137 section placement out.
13138 (Layout::place_orphan_sections_in_script): New method definition.
13139 * layout.h (Output_segment_headers, Output_file_header):
13140 New forward class declarations.
13141 (Layout::~Layout): Define.
13142 (Layout::new_output_section_data_from_script): New method definition.
13143 (Layout::place_orphan_sections_in_script): New method declaration.
13144 (Layout::Segment_states): New type declaration.
13145 (Layout::save_segments, Layout::restore_segments,
13146 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13147 Layout::relaxation_loop_body): New method declarations.
13148 (Layout::Output_section_data_list): New type declaration.
13149 (Layout::Relaxation_debug_check): New class definition.
13150 (Layout::record_output_section_data_from_script_,
13151 Layout::script_output_section_data_list_, Layout::segment_states_,
13152 Layout::relaxation_debug_check_): New data members.
13153 * output.cc: (Output_section_headers::do_size): New method definition.
13154 (Output_section_headers::Output_section_headers): Move size
13155 computation to Output_section_headers::do_size.
13156 (Output_segment_headers::do_size): New method definition.
e1df38aa 13157 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13158 Output_file_header::do_size and call it.
13159 (Output_file_header::do_size): New method definition.
13160 (Output_data_group::Output_data_group): Adjust call to
13161 Output_section_data.
13162 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13163 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13164 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13165 RELAXED_INPUT_SECTION_CODE.
13166 (Output_section::Output_section): Initialize data member checkpoint_.
13167 (Output_section::~Output_section): Delete checkpoint object pointed
13168 by checkpoint_.
13169 (Output_section::add_input_section): Always add an Input_section if
13170 relaxing.
13171 (Output_section::add_merge_input_section): Add assert.
13172 (Output_section::relax_input_section): New method definition.
13173 (Output_section::set_final_data_size): Set load address to zero for
13174 an unallocated section.
13175 (Output_section::do_address_and_file_offset_have_reset_values):
13176 New method definition.
13177 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13178 Handle relaxed input section.
13179 (Output_section::sort_attached_input_sections): Checkpoint input
13180 section list lazily.
13181 (Output_section::get_input_sections): Change type of input_sections to
13182 list of Simple_input_section pointers. Checkpoint input section list
13183 lazily. Also handle relaxed input sections.
13184 (Output_section::add_input_section_for_script): Take a reference to
13185 a Simple_input_section object instead of Relobj pointer and section
13186 index as parameter. Handle relaxed input sections.
13187 (Output_section::save_states, Output_section::restore_states): New
13188 method definitions.
13189 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13190 (Output_data::is_data_size_fixed): New method definition.
13191 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13192 if it is fixed.
13193 (Output_data::address_and_file_offset_have_reset_values): New method
13194 definition.
13195 (Output_data::do_address_and_file_offset_have_reset_values): New method
13196 definition.
13197 (Output_data::set_data_size): Check that data size is not fixed.
13198 (Output_data::fix_data_size): New method definition.
13199 (Output_data::is_data_size_fixed_): New data member.
13200 (Output_section_headers::set_final_data_size): New method definition.
13201 (Output_section_headers::do_size): New method declaration.
13202 (Output_segment_headers::set_final_data_size): New method definition.
13203 (Output_segment_headers::do_size): New method declaration.
13204 (Output_file_header::set_final_data_size)::New method definition.
13205 (Output_file_header::do_size)::New method declaration.
13206 (Output_section_data::Output_section_data): Add new parameter
13207 is_data_size_fixed and use it to fix data size.
13208 (Output_data_const::Output_data_const): Adjust call to base class
13209 constructor and fix data size.
13210 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13211 base class constructor and fix data size.
13212 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13213 base class constructor and fix data size.
13214 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13215 class constructor and fix data size.
13216 (Output_data_group::set_final_data_size): New method definition.
13217 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13218 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13219 class constructor and fix data size.
13220 (Output_relaxed_input_section): New class definition.
13221 (Output_section::Simple_input_section): New class definition.
13222 (Output_section::get_input_sections): Adjust parameter list.
13223 (Output_section::add_input_section_for_script): Same.
13224 (Output_section::save_states, Output_section::restore_states,
13225 Output_section::do_address_and_file_offset_have_reset_values,
13226 (Output_section::Input_section::Input_section): Handle
13227 RELAXED_INPUT_SECTION_CODE. Add new overload for
13228 Output_relaxed_input_section.
13229 (Output_section::Input_section::is_input_section,
13230 Output_section::Input_section::set_output_section): Handle relaxed
13231 input section.
13232 (Output_section::Input_section::is_relaxed_input_section,
13233 Output_section::Input_section::output_section_data,
13234 Output_section::Input_section::relaxed_input_section): New method
13235 definitions.
13236 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13237 value.
13238 (Output_section::Input_section::u1_): Update comments.
13239 (Output_section::Input_section::u2_): Add new union member poris.
13240 (Output_section::Checkpoint_output_section): New classs definition.
13241 (Output_section::relax_input_section): New method declaration.
13242 (Output_section::checkpoint_): New data member.
13243 (Output_segment): Update comments.
13244 (Output_segment::Output_segment): Un-privatize copy constructor.
13245 (Output_segment::operator=): Un-privatize.
13246 * script-sections.cc (Output_section_element::Input_section_list):
13247 Change element type to Output_section::Simple_input_section.
13248 (Output_section_element_dot_assignment::set_section_addresses):
13249 Register output section data for relaxation clean up.
13250 (Output_data_exression::Output_data_expression): Adjust call to base
13251 constructor to fix data size.
13252 (Output_section_element_data::set_section_addresses): Register
13253 Output_data_expression object for relaxation clean up.
13254 (struct Input_section_info): Replace Relobj pointer and section index
13255 pair with Output_section::Simple_input_section and Convert struct to a
13256 class.
13257 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13258 Input_section_info data member to use accessors.
20e6d0d6
DK
13259 (Output_section_element_input::set_section_addresses): Use layout
13260 parameter. Adjust code to use Output_section::Simple_input_section
13261 and Input_secction_info classes. Register filler for relaxation
13262 clean up.
13263 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13264 and section index pair with Output_section::Simple_input_section
13265 class. Adjust code accordingly.
13266 (Phdrs_element::release_segment): New method definition.
13267 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13268 segment list.
13269 (Script_sections::release_segments): New method definition.
13270 * gold/script-sections.h (Script_sections::release_segments): New
13271 method declaration.
13272 * gold/target.h (Target::may_relax, Target::relax,
13273 Target::do_may_relax, Target::do_relax): New method definitions.
13274
5e445df6
ILT
132752009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13276
13277 * arm.cc (has_signed_unsigned_overflow): New function.
13278 (Arm_relocate_functions::abs8): New function.
13279 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13280 (Target_arm::Scan::global): Likewise.
13281 (Target_arm::relocate::relocate): Likewise.
13282 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13283 Likewise.
13284
8c604651 132852009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13286
13287 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13288 * testsuite/Makefile.in: Regenerate.
13289
1e9cc1c2
NC
132902009-09-11 Nick Clifton <nickc@redhat.com>
13291
13292 * po/gold.pot: Updated by the Translation project.
13293
6a89f575
CC
132942009-09-08 Cary Coutant <ccoutant@google.com>
13295
13296 * output.cc (Output_file::open): Add execute permission to empty file.
13297 * testsuite/Makefile.am (permission_test): New test.
13298 * testsuite/Makefile.in: Regenerate.
13299
fdcac5af
ILT
133002009-09-02 Ian Lance Taylor <iant@google.com>
13301
13302 * output.cc (Output_file::resize): Call map_no_anonymous rather
13303 than map.
13304
44453f85
ILT
133052009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13306
13307 * gold.cc: Include "incremental.h".
13308 (queue_initial_tasks): Call Incremental_checker methods.
13309 * incremental.cc: Include "output.h".
13310 (Incremental_checker::can_incrementally_link_output_file): New
13311 method.
13312 * incremental.h (Incremental_checker): New class.
13313
13314 * output.cc (Output_file::open_for_modification): New method.
13315 (Output_file::map_anonymous): Changed return type to bool. Record
13316 map in base_ field.
13317 (Output_file::map_no_anonymous): New method, broken out of map.
13318 (Output_file::map): Use map_no_anonymous and map_anonymous.
13319 * output.h (class Output_file): Update declarations.
13320
293c1386
CC
133212009-08-24 Cary Coutant <ccoutant@google.com>
13322
13323 * options.h (Command_line::Pre_options): New class.
13324 (Command_line::pre_options): New member.
13325 * options.cc (gold::options::ready_to_register): New variable.
13326 (One_option::register_option): Do nothing if not registering options.
13327 Assert if same short option registered twice.
13328 (General_options::General_options): Turn off option registration when
13329 done constructing.
13330 (Command_line::Pre_options::Pre_options): New constructor.
13331
f773f3d2
CC
133322009-08-24 Cary Coutant <ccoutant@google.com>
13333
06a73cfe
CC
13334 * options.h (General_options::no_keep_memory): Remove incorrect
13335 short option.
f773f3d2 13336
a15af8e2
RW
133372009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13338
13339 * Makefile.am (am__skiplex, am__skipyacc): New.
13340 * Makefile.in: Regenerate.
13341
c462b41b
RW
133422009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13343
14ec8efd
RW
13344 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13345 (INCLUDES): ... this.
13346 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13347 (AM_CPPFLAGS): Renamed from ...
13348 (INCLUDE): ... this.
13349 * Makefile.in, testsuite/Makefile.in: Regenerate.
13350
81ecdfbb
RW
13351 * Makefile.in: Regenerate.
13352 * aclocal.m4: Likewise.
13353 * config.in: Likewise.
13354 * configure: Likewise.
13355 * testsuite/Makefile.in: Likewise.
13356
c462b41b
RW
13357 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13358 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13359 * Makefile.in: Regenerate.
13360 * testsuite/Makefile.in: Regenerate.
13361
2da73f13
CC
133622009-08-19 Cary Coutant <ccoutant@google.com>
13363
13364 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13365 symbols in shared libraries overridden by hidden or internal symbols
13366 in the main program.
13367
2db70501
CD
133682009-08-19 Chris Demetriou <cgd@google.com>
13369
13370 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13371 checking source file names in error messages.
13372
f733487b
DK
133732009-08-18 Doug Kwan <dougkwan@google.com>
13374
13375 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13376 an elcpp::Ehdr as parameter. Adjust call to set_target.
13377 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13378 an elfcpp::Ehdr as parameter.
13379 * object.cc (Object::set_target): Remove the version that looks up
13380 a target and sets it.
13381 (Sized_relobj::setup): Take a Target object instead of
13382 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13383 (make_elf_sized_object): Find target and ask target to
13384 make an ELF object.
13385 * object.h: (Object::set_target): Remove the version that looks up
13386 a target and sets it.
13387 (Sized_relobj::setup): Take a Target object instead of
13388 an elfcpp:Ehdr as parameter.
13389 * target.cc: Include dynobj.h.
13390 (Target::do_make_elf_object_implementation): New.
2e702c99 13391 (Target::do_make_elf_object): New.
f733487b
DK
13392 * target.h (Target::make_elf_object): New template declaration.
13393 (Target::do_make_elf_object): New method declarations.
13394 (Target::do_make_elf_object_implementation): New template declaration.
13395
cc70f101
ILT
133962009-08-14 Ian Lance Taylor <iant@google.com>
13397
13398 * gold.h (FUNCTION_NAME): Define.
13399 (gold_unreachable): Use FUNCTION_NAME.
13400
ef5e0cb1
ST
134012009-08-12 Sriraman Tallam <tmsriram@google.com>
13402
13403 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13404 symbol in the --keep-unique list is not found.
13405
48c187ce
ST
134062009-08-12 Sriraman Tallam <tmsriram@google.com>
13407
13408 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13409 been maked as --keep-unique.
13410 (Icf::unfold_section): New function.
13411 * icf.h (Icf::unfold_section): New function.
13412 * options.h (General_options::keep_unique): New option.
13413 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13414 * testsuite/Makefile.in: Regenerate.
13415 * testsuite/icf_keep_unique_test.sh: New file.
13416 * testsuite/icf_keep_unique_test.cc: New file.
13417
645afe0c
CC
134182009-08-12 Cary Coutant <ccoutant@google.com>
13419
13420 PR 10471
13421 * resolve.cc (Symbol_table::resolve): Check for references from
13422 dynamic objects to hidden and internal symbols.
13423 * testsuite/Makefile.am (hidden_test.sh): New test.
13424 * testsuite/Makefile.in: Regenerate.
13425 * testsuite/hidden_test.sh: New script.
13426 * testsuite/hidden_test_1.c: New test source.
13427 * testsuite/hidden_test_main.c: New test source.
13428
11af873f
DK
134292009-08-11 Doug Kwan <dougkwan@google.com>
13430
13431 * arm.cc: Update comments.
13432 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13433 segment to locate the .ARM.exidx section if present.
13434
b9f7d72d
DK
134352009-08-09 Doug Kwan <dougkwan@google.com>
13436
13437 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13438 patch.
13439
ddd3c53c
ST
134402009-08-07 Sriraman Tallam <tmsriram@google.com>
13441 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13442 compiler warnings.
13443
27721062
ST
134442009-08-06 Sriraman Tallam <tmsriram@google.com>
13445
13446 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13447 valid tls_segment only for non-debug-section relocations.
13448 * testsuite/Makefile.am: Add gc_tls_test.
13449 * testsuite/Makefile.in: Regenerate.
13450 * testsuite/gc_tls_test.cc: New file.
13451 * testsuite/gc_tls_test.sh: New file.
13452
ef15dade 134532009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13454
ef15dade
ST
13455 * icf.cc: New file.
13456 * icf.h: New file.
13457 * Makefile.am (CCFILES): Add icf.cc.
13458 (HFILES): Add icf.h
13459 * Makefile.in: Regenerate.
13460 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13461 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13462 section, symbol and addend information for the relocs.
13463 * gold.cc (queue_middle_tasks): Call identical code folding.
13464 * gold.h: Add defines for multimap.
13465 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13466 to the call of finalize_local_symbols.
13467 * main.cc (main): Create object of class Icf.
13468 * object.cc (Sized_relobj::do_layout): Allow this function to be
13469 called twice during icf.
13470 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13471 to sections marked as identical by icf.
13472 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13473 when available.
13474 (Sized_relobj::do_section_entsize): New function.
13475 * object.h (Object::section_entsize): New function.
13476 (Object::do_section_entsize): New pure virtual function.
13477 (Relobj::finalize_local_symbols): Add new parameter.
13478 (Relobj::do_section_entsize): New function.
13479 * options.h (General_options::icf): New option.
13480 (General_options::icf_iterations): New option.
13481 (General_options::print_icf_sections): New option.
13482 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13483 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13484 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13485 icf.
13486 * symtab.cc (Symbol_table::is_section_folded): New function.
13487 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13488 to sections marked as identical by icf.
13489 * symtab.h (Symbol_table::set_icf): New function.
13490 (Symbol_table::icf): New function.
13491 (Symbol_table::is_section_folded): New function.
13492 (Symbol_table::icf_): New data member.
13493 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13494 * testsuite/Makefile.am: Add commands to build icf_test.
13495 * testsuite/Makefile.in: Regenerate.
13496 * testsuite/icf_test.sh: New file.
13497 * testsuite/icf_test.cc: New file.
13498
c3b65ac4
CD
134992009-07-24 Chris Demetriou <cgd@google.com>
13500
13501 * layout.cc (is_compressible_debug_section): Fix incorrect
13502 comment about compressed section names.
13503
1caf2c51
ILT
135042009-07-20 Ian Lance Taylor <ian@airs.com>
13505
13506 PR 10419
13507 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13508
1ef4d87f
ILT
135092009-07-16 Ian Lance Taylor <iant@google.com>
13510
13511 PR 10400
13512 * layout.h: #include <map>.
13513 (class Kept_section): Change from struct to class. Add accessors
13514 and setters. Add section size to Comdat_group mapping. Change
13515 Comdat_group to std::map. Add is_comdat_ field. Add
13516 linkonce_size field in union.
13517 (class Layout): Update declaration of find_or_add_kept_section.
13518 Don't declare find_kept_object.
13519 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13520 parameter. Add object, shndx, is_comdat, and is_group_name
13521 parameters. Change all callers. Adjust for new Kept_section.
13522 (Layout::find_kept_object): Remove.
13523 * object.cc (Sized_relobj::include_section_group): Update use of
13524 Kept_section. Rename secnum to shndx. Only record
13525 Kept_comdat_section if sections are the same size.
13526 (Sized_relobj::include_linkonce_section): Update use of
13527 Kept_section. Only record Kept_comdat_section if sections are the
13528 same size. Set size of linkonce section.
13529 (Sized_relobj::map_to_kept_section): Update call to
13530 get_kept_comdat_section.
13531 * object.h (class Sized_relobj): Rename fields in
13532 Kept_comdat_section to drop trailing underscores; change object
13533 field to Relobj*. Change Kept_comdat_section_table to store
13534 struct rather than pointer.
13535 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13536 Add kept_object and kept_shndx parameters. Change all callers.
13537 (Sized_relobj::get_kept_comdat_section): Change return type to
13538 bool. Add kept_object and kept_shndx parameters. Change all
13539 callers.
13540 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13541 Layout::find_or_add_kept_section.
13542
37c3b7b0
ILT
135432009-07-09 Ian Lance Taylor <iant@google.com>
13544
13545 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13546 Reserve space in the hash table.
13547
98fa85cb
ILT
135482009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13549
13550 * fileread.cc (File_read::get_mtime): New method.
13551 * fileread.h (Timespec): New structure.
13552 (File_read::get_mtime): New method.
13553 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13554 Renamed from timestamp_nsec.
13555 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13556 Elf_Xword.
e1df38aa 13557 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13558 timestamp_nsec.
e1df38aa 13559 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13560 (Incremental_inputs::report_obejct): Save mtime; style fix.
13561 (Incremental_inputs::report_script): Save mtime; style fix.
13562 (Incremental_inputs::finalize_inputs): Style fix.
13563 (Incremental_inputs::finalize): Style fix.
13564 (Incremental_inputs::create_input_section_data): Store inputs
13565 mtime.
13566 * incremental.h (Incremental_inputs::report_script): Add mtime
13567 argument.
13568 (Incremental_inputs::Input_info::Input_info): Intialize only one
13569 union member.
13570 (Incremental_inputs::Input_info::archive): Move to nameless
13571 union.
13572 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13573 (Incremental_inputs::Input_info::script): Move to nameless union.
13574 (Incremental_inputs::mtime): New field.
13575 * script.cc (read_input_script): Pass file mtime to
13576 Incremental_input.
13577 * script.h (Script_info::inputs): Style fix.
13578
c9d70757
ILT
135792009-07-01 Ian Lance Taylor <ian@airs.com>
13580
13581 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13582 instead of 32.
13583
9c547ec3
ILT
135842009-06-24 Ian Lance Taylor <iant@google.com>
13585
13586 PR 10156
13587 * layout.cc (Layout::choose_output_section): If we find an
13588 existing section, update the flags.
13589 (Layout::create_notes): New function, broken out of
13590 Layout::finalize.
13591 (Layout::finalize): Don't create note sections.
13592 (Layout::create_note): Don't crash if linker script discards
13593 section.
13594 (Layout::create_gold_note): Likewise.
13595 (Layout::create_build_id): Likewise. Don't set
13596 after_input_sections on the section.
13597 (Layout::create_executable_stack_info): Remove target parameter.
13598 Change caller.
13599 * layout.h (class Layout): Declare create_notes. Update
13600 declaration of create_executable_stack_info.
13601 * gold.cc (queue_middle_tasks): Call create_notes.
13602 * output.cc (Output_section::update_flags_for_input_section): Move
13603 here from output.h. If SHF_ALLOC flag is newly set, mark address
13604 invalid.
13605 * output.h (Output_data::mark_address_invalid): New function.
13606 (class Output_section): Only declare, not define,
13607 update_flags_for_input_section. Remove set_flags.
13608
55458500
ILT
136092009-06-24 Ian Lance Taylor <iant@google.com>
13610
13611 * script-sections.cc (Output_section_definition::
13612 set_section_addresses): Rename shadowing local load_address to
13613 laddr.
13614
1307d6cd
ILT
136152009-06-24 Ian Lance Taylor <iant@google.com>
13616
13617 PR 10244
13618 * reloc.cc (relocate_sections): Skip empty relocation sections.
13619
ec3f783e
ILT
136202009-06-23 Ian Lance Taylor <iant@google.com>
13621
13622 PR 10156
13623 * layout.cc (Layout::create_note): Use choose_output_section
13624 rather than make_output_section.
13625
459c9f1c
ILT
136262009-06-23 Ian Lance Taylor <iant@google.com>
13627
13628 PR 10237
13629 * options.cc (General_options::parse_V): Set printed_version_.
13630 (General_options::General_options): Initialize printed_version_.
13631 * options.h (class General_options): Add printed_version_ field.
13632 * gold.cc (queue_initial_tasks): If there are no input files,
13633 don't give a fatal error if we printed the version information.
13634 (queue_middle_tasks): If using -r with a shared object, give a
13635 fatal error rather than an ordinary error.
13636
1518dc8f
ILT
136372009-06-23 Ian Lance Taylor <iant@google.com>
13638
13639 PR 10219
13640 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13641 (Layout::make_output_section): Set have_stabstr_section_ if we see
13642 a .stab*str section.
13643 (Layout::finalize): Call link_stabs_sections.
13644 (Layout::link_stabs_sections): New file.
13645 * layout.h (class Layout): Add have_stabstr_section_ field.
13646 Declare link_stabs_sections.
13647
3d857b98
DK
136482009-06-23 Doug Kwan <dougkwan@google.com>
13649
13650 * Makefile.am (libgold_a_LIBADD): New.
13651 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13652 * Makefile.in: Regenerate.
3d857b98
DK
13653 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13654 * configure: Regenerate.
13655 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13656 * fileread.cc: Include sys/state.h
13657 * gold.h: Declare memmem and strndup if found missing.
13658 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13659
0639a6f6
ILT
136602009-06-23 Ian Lance Taylor <iant@google.com>
13661
13662 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13663 * configure: Rebuild.
13664
8d63875c
ILT
136652009-06-23 Ian Lance Taylor <iant@google.com>
13666
13667 PR 10147
13668 * object.cc (Object::section_contents): Don't try to get a view if
13669 the section has length zero.
13670 (Object::handle_gnu_warning_section): If the section is empty, use
13671 the name of the section as the warning.
13672
f7c8a183
ILT
136732009-06-23 Ian Lance Taylor <iant@google.com>
13674
13675 PR 10133
13676 * stringpool.h (class Stringpool_template): Add optimize_ field.
13677 (Stringpool_template::set_optimize): New function.
13678 * stringpool.cc (Stringpool_template::Stringpool_template):
13679 Initialize optimize_ field.
13680 (Stringpool_template::set_string_offsets): Test local optimize
13681 fild rather than parameter.
13682 * layout.cc (Layout::Layout): Call set_optimize on the section
13683 name stringpool.
13684
e6a307ba
ILT
136852009-06-22 Ian Lance Taylor <iant@google.com>
13686
13687 PR 10030
13688 * yyscript.y: Parse TARGET.
13689 * script.cc (script_set_target): New function.
13690 * script-c.h (script_set_target): Declare.
13691 * options.cc (General_options::string_to_object_format): Rename
13692 from string_to_object_format in anonymous namespace. Change
13693 callers.
13694 * options.h (class General_options): Declare
13695 string_to_object_format.
13696
3ee173de
ILT
136972009-06-22 Ian Lance Taylor <iant@google.com>
13698
13699 * script-sections.cc (Script_sections::create_segments): Don't put
13700 program headers in a PT_LOAD segment if -n or -N.
13701
137022009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13703
13704 PR 10141
13705 * options.h (class General_options): Add -z lazy and -z now. Sort
13706 -z options into alphabetical order.
13707 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13708
cd6739a1 137092009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13710
13711 * layout.cc (Layout::make_output_section): Call
13712 Target::new_output_section.
13713 (Layout::attach_allocated_section_to_segment): Put large section
13714 sections in a separate load segment with the large segment flag
13715 set.
13716 (Layout::segment_precedes): Sort large data segments after other
13717 load segments.
13718 (align_file_offset): New static function.
13719 (Layout::set_segment_offsets): Use align_file_offset.
13720 * output.h (class Output_section): Add is_small_section_ and
13721 is_large_section_ fields.
13722 (Output_section::is_small_section): New function.
13723 (Output_section::set_is_small_section): New function.
13724 (Output_section::is_large_section): New function.
13725 (Output_section::set_is_large_section): New function.
13726 (Output_section::is_large_data_section): New function.
13727 (class Output_segment): Add is_large_data_segment_ field.
13728 (Output_segment::is_large_data_segment): New function.
13729 (Output_segment::set_is_large_data_segment): New function.
13730 * output.cc (Output_section::Output_section): Initialize new
13731 fields.
13732 (Output_segment::Output_segment): Likewise.
13733 (Output_segment::add_output_section): Add assertion that large
13734 data sections always go in large data segments. Force small data
13735 sections to the end of the list of data sections. Force small BSS
13736 sections to the start of the list of BSS sections. For large BSS
13737 sections to the end of the list of BSS sections.
13738 * symtab.h (class Symbol): Declare is_common_shndx.
13739 (Symbol::is_defined): Check Symbol::is_common_shndx.
13740 (Symbol::is_common): Likewise.
13741 (class Symbol_table): Define enum Commons_section_type. Update
13742 declarations. Add small_commons_ and large_commons_ fields.
13743 * symtab.cc (Symbol::is_common_shndx): New function.
13744 (Symbol_table::Symbol_table): Initialize new fields.
13745 (Symbol_table::add_from_object): Put small and large common
13746 symbols in the right list.
13747 (Symbol_table::sized_finalized_symbol): Check
13748 Symbol::is_common_shndx.
13749 (Symbol_table::sized_write_globals): Likewise.
13750 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13751 common symbol lists. Don't call do_allocate_commons_list if the
13752 list is empty.
13753 (Symbol_table::do_allocate_commons_list): Remove is_tls
13754 parameter. Add comons_section_type parameter. Change all
13755 callers. Handle small and large common symbols.
13756 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13757 Symbol::is_common_shndx.
13758 * resolve.cc (symbol_to_bits): Likewise.
13759 * target.h (Target::small_common_shndx): New function.
13760 (Target::small_common_section_flags): New function.
13761 (Target::large_common_shndx): New function.
13762 (Target::large_common_section_flags): New function.
13763 (Target::new_output_section): New function.
13764 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13765 small_common_section_flags, and large_common_section_flags
13766 fields.
13767 (Target::do_new_output_section): New virtual function.
13768 * arm.cc (Target_arm::arm_info): Initialize new fields.
13769 * i386.cc (Target_i386::i386_info): Likewise.
13770 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13771 Likewise.
13772 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13773 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13774 (Target_x86_64::do_new_output_section): New function.
13775 * configure.ac: Define conditional MCMODEL_MEDIUM.
13776 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13777 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13778 (large_LDFLAGS): Define.
13779 * testsuite/large.c: New file.
13780 * testsuite/testfile.cc (Target_test::test_target_info):
13781 Initialize new fields.
13782 * configure, testsuite/Makefile.in: Rebuild.
13783
bb04269c
DK
137842009-06-05 Doug Kwan <dougkwan@google.com>
13785
13786 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13787 * Makefile.in: Regenerate.
bb04269c
DK
13788 * i386.cc (class Target_i386): Define new virtual method to
13789 override do_is_local_label_name in parent.
13790 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13791 local symbols if --discard-locals or -X is given.
13792 * options.h (class General_options): Declare new options
13793 '--discard-locals' and '-X' for discarding locals.
13794 * target.h (class Target): Define new methods is_local_label_name.
13795 Declare new virtual method do_is_local_label_name.
13796 * target.cc: New file.
13797 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13798 (check_SCRIPTS): Add discard_locals_test.sh.
13799 (check_DATA): Add discard_local_tests.syms.
13800 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13801 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13802 * testsuite/Makefile.in: Regenerate.
13803 * testsuite/discard_locals_test.c: New file.
13804 * testsuite/discard_locals_test.sh: Same.
13805
805bb01c
DK
138062009-06-05 Doug Kwan <dougkwan@google.com>
13807
13808 * object.cc (Sized_relobj::Sized_relobj): Initialize
13809 discarded_eh_frame_shndx_ to -1U.
13810 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13811 section.
13812 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13813 a discarded .eh_frame section.
13814 (Sized_relobj::do_finalize_local_symbols): Ditto.
13815 * object.h (class Sized_relobj): Declare new member
13816 discarded_eh_frame_shndx_.
13817 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13818 (local_labels_test.o, local_labels_test): New rules.
13819 * testsuite/Makefile.in: Regenerate.
13820
1dcd334d
DK
138212009-06-04 Doug Kwan <dougkwan@google.com>
13822
13823 * layout.cc (Layout::section_name_mapping): Add mapping for
13824 special ARM sections.
13825
96d49306
DK
138262009-06-03 Doug Kwan <dougkwan@google.com>
13827
13828 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13829 (utils::has_overflow): Same.
13830
dff16297
ILT
138312009-06-03 Ian Lance Taylor <iant@google.com>
13832
13833 * layout.cc (Layout::section_name_mapping): New array, replacing
13834 Layout::linkonce_mapping.
13835 (Layout::section_name_mapping_count): New variable, replacing
13836 Layout::linkonce_mapping_count.
13837 (Layout::linkonce_output_name): Remove.
13838 (Layout::output_section_name): Rewrite.
13839 * layout.h (class Layout): Rename Linkonce_mapping to
13840 Section_name_mapping, linkonce_mapping to section_name_mapping,
13841 linkonce_mapping_count to section_name_mapping_count. Don't
13842 declare linkonce_output_name.
13843
c121c671
DK
138442009-06-03 Doug Kwan <dougkwan@google.com>
13845
13846 * gold/arm.cc (namespace utils): New.
13847 (Target_arm::reloc_is_non_pic): Define new method.
13848 (class Arm_relocate_functions): New.
13849 (Target_arm::Relocate::relocate): Handle relocation types used by
13850 Android.
13851
07800fab
ILT
138522009-06-03 Ian Lance Taylor <iant@google.com>
13853
13854 * arm.cc (Target_arm::scan::global): Use || instead of |.
13855
c121c671
DK
138562009-06-02 Doug Kwan <dougkwan@google.com>
13857
13858 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13859 issued_non_pic_error_.
13860 (class Target_arm::Scan): Declare new method check_non_pic.
13861 Define new method symbol_needs_plt_entry.
13862 Declare new data member issued_non_pic_error_.
13863 (class Target_arm::Relocate): Declare new method
13864 should_apply_static_reloc.
13865 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13866 (Target_arm::Scan::check_non_pic): Define new method.
13867 (Target_arm::Scan::local): Handle a small subset of reloc types used
13868 by Android.
13869 (Target_arm::Scan::local): Same.
13870 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13871
b19b0c6d
ILT
138722009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13873
13874 * incremental.cc (Incremental_inputs::report_command_line): Filter
13875 out --incremental-* options.
13876
94cdfcff
DK
138772009-05-29 Doug Kwan <dougkwan@google.com>
13878
13879 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13880 template class.
13881 (class Target_arm): Update comment.
13882 (Target_arm::Target_arm): Initialize new data members GOT_,
13883 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13884 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13885 and Target_arm::rel_dyn_section.
13886 Declare new_enum Target_arm::Got_type.
13887 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13888 and DYNBSS_.
13889 Update commments for member do_dynsym_value.
13890 (Target_arm::got_size, Target_arm::plt_section,
13891 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13892 new methods inside class defintion.
13893 (Target_arm::got_section): Define new method.
13894 (Target_arm::rel_dyn_section): Same.
13895 (Output_data_plt_arm): New template class.
13896 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13897 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13898 (Output_data_plt_arm::add_entry): Same.
13899 (Output_data_plt_arm::first_plt_entry): Define new
13900 static data member for PLT instruction template.
13901 (Output_data_plt_arm::plt_entry): Same.
13902 (Output_data_plt_arm::do_write): Define new method.
13903 (Target_arm::make_plt_entry): Same.
13904 (Target_arm::do_finalize_sections): Same.
13905 (Target_arm::do_dynsym_value): Same.
13906
4a657b0d
DK
139072009-05-28 Doug Kwan <dougkwan@google.com>
13908
13909 * Makefile.am (TARGETSOURCES): Add arm.cc.
13910 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13911 * Makefile.in: Regenerate.
13912 * arm.cc: New file.
13913 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13914
e7ae8c36
DK
139152009-05-26 Doug Kwan <dougkwan@google.com>
13916
13917 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13918 (General_options::check_excluded_libs): Strip off directories in
13919 archive name before matching like GNU ld does.
13920 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13921 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13922 (exclude_libs_test_LDFLAGS): Add linker option
13923 -Wl,--exclude-libs,libexclude_libs_test_3
13924 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13925 an explicit archive without using -l.
13926 (alt/libexclude_libs_test_3.a): New make rule.
13927 * testsuite/Makefile.in: Regenerate.
13928 * testsuite/exclude_libs_test.c : Declare lib3_default().
13929 (main): Call it.
13930 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13931 * exclude_libs_test_3.c: New file.
13932
f12e7348
NC
139332009-05-26 Nick Clifton <nickc@redhat.com>
13934
13935 * po/id.po: New Indonesian translation.
13936 * po/gold.pot: Updated template file.
13937
4daadc0d
ST
139382009-05-22 Sriraman Tallam <tmsriram@google.com>
13939
e1df38aa 13940 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13941 gc_comdat_test files. Add -Wl,--gc-sections to build
13942 gc_comdat_test.
13943 * testsuite/Makefile.in: Regenerate.
13944 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13945
531813ad
ST
139462009-05-21 Sriraman Tallam <tmsriram@google.com>
13947
13948 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13949 kept comdat section was garbage collected.
13950 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13951 * testsuite/Makefile.in: Regenerate.
13952 * testsuite/gc_comdat_test.sh: New file.
13953 * testsuite/gc_comdat_test_1.cc: New file.
13954 * testsuite/gc_comdat_test_2.cc: New file.
13955
65514900
CC
139562009-05-19 Doug Kwan <dougkwan@google.com>
13957
13958 * archive.cc (Archive::Archive): Move constructor from archive.h
13959 to here. Initialize no_export_.
13960 (Archive::get_elf_object_for_member): Set no_export flag of object.
13961 * archive.h (Archive::Archive): Move constructor body to
13962 archive.cc.
13963 (Archive::no_export): New method.
13964 (Archive::no_export_): New field.
13965 * object.h (Object::Object): Initialize no_export_ to false.
13966 (Object::no_export, Object::set_no_export): New methods.
13967 (Object::no_export_): New field.
13968 * options.cc (General_options::parse_exclude_libs): New method.
13969 (General_options::check_excluded_libs) Same.
13970 * options.h (exclude_libs): New option.
13971 (General_options::check_excluded_libs): New method declaration.
13972 (General_options::excluded_libs_): New field.
13973 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13974 default or protected visibility if an object has no-export flag set.
13975 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13976 (check_SCRIPTS): Add exclude_libs_test.sh.
13977 (check_DATA): Add exclude_libs_test.syms.
13978 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13979 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13980 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13981 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13982 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13983 libexclude_libs_test_2.a): New rules.
13984 * testsuite/Makefile.in: Regenerate.
13985 * testsuite/exclude_libs_test.c: New file.
13986 * testsuite/exclude_libs_test.sh: Ditto.
13987 * testsuite/exclude_libs_test_1.c: Ditto.
13988 * testsuite/exclude_libs_test_2.c: Ditto.
13989
1b77ea50
ILT
139902009-05-15 Ian Lance Taylor <iant@google.com>
13991
13992 * configure.ac: Check for declarations for cases where libiberty.h
13993 checks HAVE_DECL_xxx.
13994 * configure, config.in: Rebuild.
13995
072fe7ce
ILT
139962009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13997
13998 * gold.h (Incremental_argument_list): Remove (invalid) forward
13999 declaration.
14000 * incremental.cc (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::finalize): Call finalize_inputs().
14005 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14006 Create inputs entries.
14007 * incremental.h (Incremental_input_type): New enum.
14008 (Incremental_inputs::Incremental_input): Initialize new fields.
14009 (Incremental_inputs::report_inputs): New method.
14010 (Incremental_inputs::report_achive): New method.
14011 (Incremental_inputs::report_object): New method.
14012 (Incremental_inputs::report_script): New method.
14013 (Incremental_inputs::finalize_inputs): New method.
14014 (Incremental_inputs::Input_info): New struct.
14015 (Incremental_inputs::Input_info_map): New typedef.
14016 (Incremental_inputs::lock_): New field.
14017 (Incremental_inputs::Inputs_): New field.
14018 (Incremental_inputs::Inputs_map): New field.
14019 * main.cc (main): Call Incremental_input::report_inputs.
14020 * options.h (Input_argument_list): Typedef moved from
14021 Input_arguments.
14022 (Input_file_group::Files): Remove, use ::Input_argument_list.
14023 (Input_file_group::Input_argument_list): Remove, use
14024 ::Input_argument_list.
14025 * plugin.cc (Plugin_manager::add_input_file): Add error in
14026 incremental build.
14027 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14028 functions.
14029 * script.cc (read_input_script): Call
14030 Incremental_input::report_script.
14031 * script.h (Script_info): New class.
14032
b0481b0b
ILT
140332009-04-27 Ian Lance Taylor <iant@google.com>
14034
14035 * x86_64.cc (do_adjust_output_section): Set entsize to
14036 plt_entry_size.
14037
b22a5a41 140382009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14039
14040 * output.cc (Output_file::close): After short writes, continue
14041 writing from the correct offset in the buffer being written.
14042
40fde488
CD
140432009-04-23 Chris Demetriou <cgd@google.com>
14044
14045 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14046 * configure: Regenerate.
14047 * config.in: Regenerate.
14048 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14049 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14050
3ce2c28e
ILT
140512009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14052
14053 * incremental.cc (Incremental_inputs_header_data): Renamed from
14054 Incremental_input_header_data.
14055 (Incremental_inputs_header_data::data_size): New field.
14056 (Incremental_inputs_header_data::put_input_file_count): Renamed
14057 from input_file_count.
14058 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14059 from command_line_offset.
14060 (Incremental_inputs_header_data::put_reserved): Renamed from
14061 put_reserved.
14062 (Incremental_inputs_entry_data): Renamed from
14063 Incremental_input_entry_data.
14064 (Incremental_inputs_entry_data::data_size): New field.
14065 (Incremental_inputs::report_command_line): New method.
14066 (Incremental_inputs::finalize): New method.
14067 (Incremental_inputs::create_incremental_inputs_data): New method.
14068 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14069 * incremental.h: New file.
14070 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14071 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14072 incremental builds.
703d02da 14073 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14074 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14075 (Layout::create_incremental_info_sections): New method.
14076 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14077 * main.cc (main): Notify Incremental_input of the command line.
14078
e55bde5e
ILT
140792009-04-01 Ian Lance Taylor <iant@google.com>
14080 Mikolaj Zalewski <mikolajz@google.com>
14081
14082 * gold.h (reserve_unordered_map): Define, three versions, one for
14083 each version of Unordered_map.
14084 * layout.cc (Layout::Layout): Remove options parameter. Add
14085 number_of_input_files parameter. Don't initialize options_.
14086 Initialize number_of_input_files_ and resized_signatures_. Move
14087 sections_are_attached_.
14088 (Layout::layout_group): Reserve space for group_signatures_.
14089 (Layout::find_or_add_kept_section): Change name parameter to be a
14090 reference. Resize signatures_ map when it gets large enough.
14091 (Layout::layout_eh_frame): Use parameters->options() instead of
14092 this->options_.
14093 (Layout::make_output_section): Likewise.
14094 (Layout::attach_allocated_section_to_segment): Likewise.
14095 (Layout::finalize, Layout::create_executable_stack): Likewise.
14096 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14097 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14098 * layout.h (class Layout): Update declarations. Remove options_
14099 field. Add number_of_input_files_ and resized_signatures_
14100 fields. Move sections_are_attached_ field.
14101 * main.cc (main): Pass number of input files to Layout
14102 constructor. Don't pass options.
14103
154b857c
ILT
141042009-03-30 Ian Lance Taylor <iant@google.com>
14105
14106 * ffsll.c (ffsll): Correct implementation.
14107
2f35ab9b
ILT
141082009-03-27 Ian Lance Taylor <iant@google.com>
14109
fd03461a
ILT
14110 * ffsll.c: New file.
14111 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14112 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14113 * ftruncate.c (ftruncate): Declare before definition.
14114 * mremap.c (mremap): Likewise.
14115 * pread.c (pread): Likewise.
14116 * configure, Makefile.in, config.in: Rebuild.
14117
2f35ab9b
ILT
14118 * mremap.c: New file.
14119 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14120 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14121 (mremap): Declare if HAVE_MREMAP is not defined.
14122 * configure, Makefile.in, config.in: Rebuild.
14123
33aea2fd
CC
141242009-03-27 Cary Coutant <ccoutant@google.com>
14125
14126 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14127 position independent.
14128 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14129 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14130
6d479619
CC
141312009-03-24 Cary Coutant <ccoutant@google.com>
14132
14133 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14134 an executable.
14135 (needs_dynamic_reloc): Likewise.
14136
afc06bb8
ILT
141372009-03-24 Ian Lance Taylor <iant@google.com>
14138
14139 * yyscript.y (file_cmd): Recognize EXTERN.
14140 (extern_name_list, extern_name_list_body): New nonterminals.
14141 * script.cc (script_add_extern): Define.
14142 * script-c.h (script_add_extern): Declare.
14143
f6060a4d
ILT
141442009-03-24 Rafael Avila de Espindola <espindola@google.com>
14145
14146 * object.cc (is_elf_object): Define.
14147 * object.h (is_elf_object): Declare.
14148 * archive.cc (Archive::get_elf_object_for_member): Call
14149 is_elf_object.
33aea2fd 14150 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14151
26736d8e
ILT
141522009-03-24 Elliott Hughes <enh@google.com>
14153
14154 * output.cc (Output_file::map_anonymous): Define.
14155 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14156 try an anonymous one. Report the size if the mmap fails.
14157 * output.h (class Output_file): Declare map_anonymous.
14158
22fd9730
ILT
141592009-03-24 Ian Lance Taylor <iant@google.com>
14160
14161 * target-select.cc (instantiate_target): Don't acquire the lock if
14162 the instantiated_target_ field has already been set.
14163
cb010894
ILT
141642009-03-23 Ian Lance Taylor <iant@google.com>
14165
7f055c20
ILT
14166 * gold-threads.h (class Initialize_lock): Define.
14167 * gold-threads.cc (class Initialize_lock_once): Define.
14168 (initialize_lock_control): New static variable.
14169 (initialize_lock_pointer): New static variable.
14170 (initialize_lock_once): New static function.
14171 (Initialize_lock::Initialize_lock): Define.
14172 (Initialize_lock::initialize): Define.
14173 * target-select.h: Include "gold-threads.h".
14174 (class Target_selector): Add lock_ and initialize_lock_ fields.
14175 Don't define instantiate_target, just declare it.
14176 * target-select.cc (Target_selector::Target_selector): Initialize
14177 new fields.
14178 (Target_selector::instantiate_target): Define.
14179 * descriptors.h: Include "gold-threads.h".
14180 (class Descriptors): Add initialize_lock_ field.
14181 * descriptors.cc (Descriptors::Descriptors): Initialize new
14182 field.
14183 (Descriptors::open): Use initialize_lock_ field
14184 * errors.h (class Errors): Add initialize_lock_ field.
14185 * errors.cc (Errors::Errors): Initialize new field.
14186 (Errors::initialize_lock): Use initialize_lock_ field.
14187 * powerpc.cc (class Target_selector_powerpc): Remove
14188 instantiated_target_ field. In do_recognize call
14189 instantiate_target rather than do_instantiate_target. In
14190 do_instantiate_target just allocate a new target.
14191 * sparc.cc (class Target_selector_sparc): Likewise.
14192
36959681
ILT
14193 * freebsd.h: New file.
14194 * i386.cc: Include "freebsd.h".
14195 (Target_i386): Derive from Target_freebsd rather than
14196 Sized_target.
14197 (Target_selector_i386): Derive from Target_selector_freebsd rather
14198 than Target_selector.
14199 * x86_64.cc: Include "freebsd.h".
14200 (Target_x86_64): Derive from Target_freebsd rather than
14201 Sized_target.
14202 (Target_selector_x86_64): Derive from Target_selector_freebsd
14203 rather than Target_selector.
14204 * target.h (class Target): Add adjust_elf_header and
14205 do_adjust_elf_header.
14206 * output.cc (Output_file_header:: do_sized_write): Call target
14207 adjust_elf_header routine.
14208 * configure.tgt: Set targ_osabi.
14209 * configure.ac: Define GOLD_DEFAULT_OSABI.
14210 * parameters.cc (Parameters::default_target): Pass
14211 GOLD_DEFAULT_OSABI to select_target.
14212 * target-select.h (class Target_selector): Make instantiate_target
14213 protected rather than private.
14214 * Makefile.am (HFILES): Add freebsd.h.
14215 * configure, Makefile.in, config.in: Rebuild.
14216
cb010894
ILT
14217 * merge.cc (do_add_input_section): Correct pend value. Change
14218 message about last entry not being null terminated from error to
14219 warning.
14220
0e879927
ILT
142212009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14222
14223 * incremental.cc: New file.
14224 * Makefile.am (CCFILES): Add incremental.cc.
14225 * Makefile.in: Rebuild.
14226
41105937
PP
142272009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14228
14229 * layout.cc (Layout::output_section_name): Preserve names
14230 of '.note.' sections.
e1df38aa 14231
60439920
ILT
142322009-03-19 Ian Lance Taylor <iant@google.com>
14233
14234 * descriptors.cc (Descriptors::open): Check that the options are
14235 valid before using them.
14236
0d371ad3
ILT
142372009-03-18 Ian Lance Taylor <iant@google.com>
14238
14239 * script-sections.h: Include <list>.
14240 (class Script_sections): Change Sections_elements from std::vector
14241 to std::list. Typedef public Elements_iterator. Add
14242 orphan_section_placement_, data_segment_align_start_, and
14243 saw_data_segment_align_ fields. Remove data_segment_align_index_
14244 field.
14245 * script-sections.cc (class Orphan_section_placement): New class.
14246 (class Sections_element): Add virtual functions is_relro and
14247 orphan_section_init. Remove virtual function place_orphan_here.
14248 (class Output_section_definition): Add is_relro and
14249 orphan_section_init. Remove place_orphan_here.
14250 (class Orphan_output_section): Likewise.
14251 (Script_sections::Script_sections): Update for field changes.
14252 (Script_sections::data_segment_align): Set saw_data_segment_align_
14253 and data_segment_align_start_, not data_segment_align_index.
14254 (Script_sections::data_segment_relro_end): Check
14255 saw_data_segment_align_. Use data_segment_align_start_ rather
14256 than data_segment_align_index_.
14257 (Script_sections::place_orphan): Rewrite to use
14258 Orphan_section_placement.
14259
9201d894
ILT
142602009-03-17 Ian Lance Taylor <iant@google.com>
14261
9c5b8369
ILT
14262 * archive.cc (Archive::add_symbols): Check for a version attached
14263 to the symbol name in the archive map.
14264 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14265 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14266 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14267 (ver_test_11.a): New target.
14268 * testsuite/Makefile.in: Rebuild.
14269
9201d894
ILT
14270 * configure.ac: Check for chsize and posix_fallocate. Replace
14271 ftruncate.
14272 * ftruncate.c: New file, from gnulib.
14273 * output.cc (posix_fallocate): Define dummy version if not
14274 HAVE_POSIX_FALLOCATE.
14275 (Output_file::map): Call posix_fallocate rather than lseek and
14276 write.
14277 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14278 * configure, Makefile.in, config.in: Rebuild.
14279
ef4ab7a8 142802009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14281
ef4ab7a8
PP
14282 * layout.h (Layout::create_note): Add section_name parameter.
14283 * layout.cc (Layout::create_note): Likewise.
14284 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14285
8c500701
ILT
142862009-03-17 Ian Lance Taylor <iant@google.com>
14287
e85b18e1
ILT
14288 * descriptors.cc: Include "options.h".
14289 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14290 (Descriptors::open): Always use O_CLOEXEC when opening a new
14291 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14292 then set FD_CLOEXEC.
14293
9efe6174
ILT
14294 * sparc.cc (class Target_sparc): Add has_got_section.
14295 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14296 make sure we have a GOT section.
14297
14298 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14299 (Target_sparc::Scan::local): Likewise.
14300 (Target_sparc::Scan::global): Likewise.
14301 (Target_sparc::Relocate::relocate): Likewise.
14302 (Target_sparc::Relocate::relocate_tls): Likewise.
14303
8c500701
ILT
14304 * symtab.cc (Symbol_table::define_default_version): New function,
14305 broken out of add_from_object.
14306 (Symbol_table::add_from_object): Call define_default_version.
14307 (Symbol_table::define_special_symbol): Add resolve_oldsym
14308 parameter. Change all callers. If the version for a symbol comes
14309 from a version script, resolve it with the symbol with the same
14310 name with no version. Also add the symbol without a version if
14311 appropriate.
14312 (do_define_in_output_data): If resolving with oldsym, don't delete
14313 sym.
14314 (do_define_in_output_segment): Likewise.
14315 (do_define_as_constant): Likewise.
14316 * symtab.h (class Symbol_table): Update declarations.
14317
f1ed28fb
ILT
143182009-03-13 Ian Lance Taylor <iant@google.com>
14319
15f8229b
ILT
14320 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14321 (Read_symbols::requeue): New function.
14322 (Read_symbols::do_read_symbols): If make_elf_object fails because
14323 the target type is not configured, and the file was searched for,
14324 issue a warning and retry with the next directory.
14325 (Add_symbols::run): If the file has an incompatible format, and
14326 it was searched for, requeue the Read_symbols task. On error,
14327 release the object.
14328 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14329 dirindex parameter to constructor. Change all callers. Declare
14330 incompatible_warning and requeue.
14331 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14332 input_argument_ and input_group_ fields. Add them to
14333 constructor. Change all callers.
14334 (class Read_script): Add dirindex_ field. Add it to constructor.
14335 Change all callers.
14336 * archive.cc (Archive::setup): Remove input_objects parameter.
14337 Change all callers.
14338 (Archive::get_file_and_offset): Likewise.
14339 (Archive::read_all_symbols): Likewise.
14340 (Archive::read_symbols): Likewise.
14341 (Archive::get_elf_object_for_member): Remove input_objects
14342 parameter. Add punconfigured parameter. Change all callers.
14343 (Archive::add_symbols): Change return type to bool. Check return
14344 value of include_member.
14345 (Archive::include_all_members): Likewise.
14346 (Archive::include_member): Change return type to bool. Return
14347 false if first included object has incompatible target. Set
14348 included_member_ field.
14349 (Add_archive_symbols::run): If add_symbols returns false, requeue
14350 Read_symbols task.
14351 * archive.h (class Archive): Add included_member_ field.
14352 Initialize it in constructor. Add input_file and searched_for
14353 methods. Update declarations.
14354 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14355 input_argument_ fields. Add them to constructor. Change all
14356 callers.
14357 * script.cc: Include "target-select.h".
14358 (class Parser_closure): Add skip_on_incompatible_target_ and
14359 found_incompatible_target_ fields. Add
14360 skip_on_incompatible_target parameter to constructor. Change all
14361 callers. Add methods skip_on_incompatible_target,
14362 clear_skip_on_incompatible_target, found_incompatible_target, and
14363 set_found_incompatible_target.
14364 (read_input_script): Add dirindex parameter. Change all callers.
14365 If parser finds an incompatible target, requeue Read_symbols
14366 task.
14367 (script_set_symbol): Clear skip_on_incompatible_target in
14368 closure.
14369 (script_add_assertion, script_parse_option): Likewise.
14370 (script_start_sections, script_add_phdr): Likewise.
14371 (script_check_output_format): New function.
14372 * script.h (read_input_script): Update declaration.
14373 * script-c.h (script_check_output_format): Declare.
14374 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14375 (ignore_cmd): Remove OUTPUT_FORMAT.
14376 * fileread.cc (Input_file::Input_file): Add explicit this.
14377 (Input_file::will_search_for): New function.
14378 (Input_file::open): Add pindex parameter. Change all callers.
14379 * fileread.h (class Input_file): Add input_file_argument method.
14380 Declare will_search_for. Update declarations.
14381 * object.cc (make_elf_object): Add punconfigured parameter.
14382 Change all callers.
14383 * object.h (class Object): Make input_file public. Add
14384 searched_for method.
14385 (make_elf_object): Update declaration.
14386 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14387 restart search.
14388 * dirsearch.h (class Dirsearch): Update declaration.
14389 * options.h (class General_options): Add --warn-search-mismatch.
14390 * parameters.cc (Parameters::is_compatible_target): New function.
14391 * parameters.h (class Parameters): Declare is_compatible_target.
14392 * workqueue.cc (Workqueue::add_blocker): New function.
14393 * workqueue.h (class Workqueue): Declare add_blocker.
14394
f1ed28fb
ILT
14395 * fileread.cc (Input_file::open): Remove options parameter.
14396 Change all callers.
14397 (Input_file::open_binary): Likewise.
14398 * script.cc (read_input_script): Likewise.
14399 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14400 options parameter from constructor. Change all callers.
14401 (class Read_script): Likewise.
14402 * fileread.h (class Input_file): Update declarations.
14403 * script.h (read_input_script): Update declaration.
14404
34dd024a
NC
144052009-03-10 Nick Clifton <nickc@redhat.com>
14406
14407 * po/es.po: New Spanish translation.
14408
6d71b17c
CC
144092009-03-06 Cary Coutant <ccoutant@google.com>
14410
14411 * options.cc (parse_short_option): Keep dash_z from registering itself.
14412
031cdbed
ILT
144132009-03-03 Ian Lance Taylor <iant@google.com>
14414
14415 PR 9918
14416 * target-reloc.h (relocate_section): Pass output_section to
14417 relocate.
14418 * i386.cc (Target_i386::should_apply_static_reloc): Add
14419 output_section parameter. Change all callers.
14420 (Target_i386::Relocate::relocate): Add output_section parameter.
14421 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14422 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14423 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14424 * testsuite/two_file_shared.sh: New script.
14425 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14426 (check_DATA): Add two_file_shared.dbg.
14427 (two_file_shared.dbg): New target.
14428 * testsuite/Makefile.in: Rebuild.
14429
15d5fa16
ILT
144302009-03-01 Ian Lance Taylor <iant@google.com>
14431
14432 * configure.ac: Check for byteswap.h.
14433 * configure: Rebuild.
14434 * config.in: Rebuild.
14435
8a4c0b0d
ILT
144362009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14437
14438 * layout.cc (Layout::find_or_add_kept_section): New function.
14439 (Layout::add_comdat): Removed.
14440 * layout.h (struct Kept_section): Move out of class Layout.
14441 Remove trailing underscores from field names. Add group_sections
14442 field. Rename group_ field to is_group. Change all uses.
14443 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14444 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14445 comdat_groups_ field.
14446 (Sized_relobj::include_section_group): Use
14447 find_or_add_kept_section and Kept_section::group_sections.
14448 (Sized_relobj::include_linkonce_section): Likewise.
14449 * object.cc (class Sized_relobj): Don't define Comdat_group or
14450 Comdat_group_table. Remove find_comdat_group and
14451 add_comdat_group. Remove comdat_groups_ field.
14452 * plugin.cc (include_comdat_group): Use
14453 Layout::find_or_add_kept_section.
14454
b4ecf66b
ILT
144552009-02-28 Ian Lance Taylor <iant@google.com>
14456
14359ca0
ILT
14457 * README: --gc-sections and map files are now supported. Document
14458 some build requirements.
14459
b4ecf66b
ILT
14460 PR 6992
14461 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14462 relocatable link set the value of the section symbol to zero.
14463 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14464 relocatable link don't include the section address in the local
14465 symbol value.
14466
0602e05a
ILT
144672009-02-27 Ian Lance Taylor <iant@google.com>
14468
fd9d194f
ILT
14469 PR 6811
14470 * options.h (class Search_directory): Add is_system_directory.
14471 (class General_options): Declare is_in_system_directory.
14472 * options.cc (get_relative_sysroot): Make static.
14473 (get_default_sysroot): Make static.
14474 (General_optoins::is_in_system_directory): New function.
14475 * fileread.cc (Input_file::is_in_system_directory): New function.
14476 * fileread.h (class Input_file): Declare is_in_system_directory.
14477 * object.h (class Object): Add is_in_system_directory.
14478 (class Input_objects): Remove system_library_directory_ field.
14479 * object.cc (Input_objects::add_object): Don't set
14480 system_library_directory_.
14481 (input_objects::found_in_system_library_directory): Remove.
14482 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14483 parameter. Change all callers.
14484 (Symbol_table::sized_write_globals): Likewise.
14485 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14486 Call Object::is_in_system_directory.
14487 * symtab.h (class Symbol_table): Update declarations.
14488
61edd21f
ILT
14489 PR 5990
14490 * descriptors.h (Open_descriptor): Add is_on_stack field.
14491 * descriptors.cc (Descriptors::open): If the descriptor is on the
14492 top of the stack, remove it. Initialize is_on_stack field.
14493 (Descriptors::release): Only add pod to stack if it is not on the
14494 stack already.
14495 (Descriptors::close_some_descriptor): Clear stack_next and
14496 is_on_stack fields.
14497
e29e076a
ILT
14498 PR 7091
14499 * output.cc (Output_section::find_starting_output_address): Rename
14500 from starting_output_address; add PADDR parameter; change return
14501 type.
14502 * output.h (class Output_section): Declare
14503 find_starting_output_address instead of starting_output_address.
14504 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14505 section symbol for which we can't find a merge section.
14506
0602e05a
ILT
14507 PR 9836
14508 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14509 hidden or internal, force the symbol to be local.
14510 * resolve.cc (Symbol::override_visibility): Define.
14511 (Symbol::override_base): Use override_visibility.
14512 (Symbol_table::resolve): Likewise.
14513 (Symbol::override_base_with_special): Likewise.
14514 (Symbol_table::override_with_special): If the visibility is hidden
14515 or internal, force the symbol to be local.
14516 * symtab.h (class Symbol): Add set_visibility and
14517 override_visibility.
14518 * testsuite/ver_test_1.sh: New file.
14519 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14520 (check_DATA): Add ver_test_1.syms.
14521 (ver_test_1.syms): New target.
14522 * testsuite/Makefile.in: Rebuild.
14523
401a9a73
CC
145242009-02-25 Cary Coutant <ccoutant@google.com>
14525
14526 * layout.cc (Layout::choose_output_section): Don't rename sections
14527 when using a linker script that has a SECTIONS clause.
14528 * Makefile.in: Regenerate.
14529
14530 * testsuite/Makefile.am (script_test_5.sh): New test case.
14531 * testsuite/Makefile.in: Regenerate.
14532 * testsuite/script_test_5.cc: New file.
14533 * testsuite/script_test_5.sh: New file.
14534 * testsuite/script_test_5.t: New file.
14535
f488e4b0
CC
145362009-02-13 Rafael Avila de Espindola <espindola@google.com>
14537
14538 * archive.cc (Archive::include_member): Update calls to add_symbols.
14539 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14540 the Layout argument.
14541 * dynobj.h (do_add_symbols): Add the Layout argument.
14542 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14543 Layout argument.
14544 * object.h (Object::add_symbols): Add the Layout argument.
14545 (Object::do_add_symbols): Add the Layout argument.
14546 (Sized_relobj::do_add_symbols): Add the Layout argument.
14547 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14548 Unify the two versions.
14549 (Add_plugin_symbols): Remove.
14550 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14551 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14552 (Add_plugin_symbols): Remove.
14553 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14554 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14555 (Add_symbols::run): Make it work with Pulginobj.
14556
89dd1680
ILT
145572009-02-06 Ian Lance Taylor <iant@google.com>
14558
14559 * object.cc (Sized_relobj::do_layout): Make info message start
14560 with lower case letter.
14561
266d0a74
ILT
145622009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14563
602b464e
ILT
14564 * binary.cc: Fix file comment.
14565
266d0a74
ILT
14566 * options.h (enum Incremental_disposition): Define.
14567 (class General_options): Add new options: --incremental,
14568 --incremental_changed, --incremental_unchanged,
14569 --incremental_unknown. Add incremental_disposition_ and
14570 implicit_incremental_ fields.
14571 (General_options::incremental_disposition): New function.
14572 (class Position_dependent_options): Add incremental_disposition
14573 option.
14574 (Position_dependent_options::copy_from_options): Set incremental
14575 dispositions.
14576 * options.cc (General_options::parse_incremental_changed): New
14577 function.
2e702c99
RM
14578 (General_options::parse_incremental_unchanged): New function.
14579 (General_options::parse_incremental_unknown): New function.
14580 (General_options::General_options): Initialize new fields
266d0a74 14581 incremental_disposition_ and implicit_incremental_.
2e702c99 14582 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14583 without --incremental.
14584
f073bbf7
CD
145852009-02-06 Chris Demetriou <cgd@google.com>
14586
14587 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14588 pointer and to report location as the file name associated with
14589 the symbol.
14590 (gold_undefined_symbol_at_location): New function to replace the
14591 old gold_undefined_symbol functionality.
14592 * target-reloc.h (relocate_section): Update to use
14593 gold_undefined_symbol_at_location.
14594 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14595 Call gold_undefined_symbol function rather than gold_error.
14596 * errors.h (Errors::undefined_symbol): Take location as a
14597 string, rather than calculating it from a relocation.
14598 * errors.cc (Errors::fatal): Print "fatal error:" before the
14599 formatted message.
14600 (Errors::error, Errors::error_at_location): Print "error: "
14601 before the formatted message.
14602 (Errors::undefined_symbol): Take location as a string, rather
14603 than calculating it from a relocation.
14604 (gold_undefined_symbol_at_location): New function akin to
14605 old gold_undefined_symbol, calculates location from relocation.
14606 (gold_undefined_symbol): Change to take only a Symbol pointer
14607 and to report location as the file name associated with the symbol.
14608 * testsuite/debug_msg.sh: Update for changed error messages.
14609 * testsuite/undef_symbol.sh: Likewise.
14610
8e94a90c
ILT
146112009-02-04 Duncan Sands <baldrick@free.fr>
14612
14613 PR 9812
14614 * reduced_debug_output.h
14615 (Output_reduced_debug_abbrev_section::failed): Use format for
14616 gold_warning.
14617 (Output_reduced_debug_info_section::faild): Likewise.
14618
88a0e15b
ILT
146192009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14620
14621 * script.cc (Lazy_demangler): New class.
2e702c99 14622 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14623 symbol only once.
14624
5efc7cd2
CC
146252009-01-29 Cary Coutant <ccoutant@google.com>
14626
14627 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14628 to __tls_get_addr.
14629 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14630
e0ebcf42
ILT
146312009-01-28 Ian Lance Taylor <iant@google.com>
14632
5efc7cd2 14633 * version.cc (version_string): Bump to 1.9.
75fe7426 14634
e0ebcf42
ILT
14635 * gold.h: Include <cstring> and <stdint.h>.
14636 * version.cc: Include <cstdio>.
14637 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14638 warning.
14639 * reduced_debug_output.cc (insert_into_vector): Rename from
14640 Insert_into_vector; change all callers. Use Swap_unaligned to
14641 avoid aliasing issue; remove union since it is unnecessary.
14642
8e2813be 146432009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14644
14645 * Makefile.am (CCFILES): Add gc.cc.
14646 (HFILES): Add gc.h.
14647 * Makefile.in: Regenerate.
14648 * gold.cc (Gc_runner): New class.
14649 (queue_initial_tasks): Call garbage collection related tasks
14650 when corresponding options are invoked.
14651 (queue_middle_gc_tasks): New function.
14652 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14653 processed early before laying out sections during garbage collection.
14654 * gold.h (queue_middle_gc_tasks): New function.
14655 (is_prefix_of): Move from "layout.cc".
14656 * i386.cc (Target_i386::gc_process_relocs): New function.
14657 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14658 * main.cc (main): Create object of class "Garbage_collection".
14659 * object.cc (Relobj::copy_symbols_data): New function.
14660 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14661 (Sized_relobj::do_layout): Allow this function to be called twice
14662 during garbage collection and defer layout of section during the
6d03d481
ST
14663 first call.
14664 * object.h (Relobj::get_symbols_data): New function.
14665 (Relobj::is_section_name_included): New function.
14666 (Relobj::copy_symbols_data): New function.
14667 (Relobj::set_symbols_data): New function.
14668 (Relobj::get_relocs_data): New function.
14669 (Relobj::set_relocs_data): New function.
14670 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14671 (Relobj::gc_process_relocs): New function.
14672 (Relobj::do_gc_process_relocs): New pure virtual function.
14673 (Relobj::sd_): New data member.
14674 (Sized_relobj::is_output_section_offset_invalid): New function.
14675 (Sized_relobj::do_gc_process_relocs): New function.
14676 * options.h (General_options::gc_sections): Modify to not be a no-op.
14677 (General_options::print_gc_sections): New option.
14678 * plugin.cc (Plugin_finish::run): Remove function call to
14679 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14680 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14681 * reloc.cc (Read_relocs::run): Add task to process relocs and
14682 determine unreferenced sections when doing garbage collection.
14683 (Gc_process_relocs): New class.
14684 (Sized_relobj::do_gc_process_relocs): New function.
14685 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14686 sections that are garbage collected.
14687 * reloc.h (Gc_process_relocs): New class.
14688 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14689 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14690 symbols whose corresponding sections are garbage collected.
14691 (Symbol_table::Symbol_table): Add new parameter for the garbage
14692 collection object.
14693 (Symbol_table::gc_mark_undef_symbols): New function.
14694 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14695 (Symbol_table::gc_mark_dyn_syms): New function.
14696 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14697 as garbage.
14698 (Symbol_table::add_from_object): Likewise.
14699 (Symbol_table::add_from_relobj): When building shared objects, do not
14700 treat externally visible symbols as garbage.
14701 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14702 table information for static and relocatable links.
14703 * symtab.h (Symbol_table::set_gc): New function.
14704 (Symbol_table::gc): New function.
14705 (Symbol_table::gc_mark_undef_symbols): New function.
14706 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14707 (Symbol_table::gc_mark_dyn_syms): New function.
14708 (Symbol_table::gc_): New data member.
e1df38aa 14709 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14710 function.
14711 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14712 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14713
3b293544
CF
147142009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14715
14716 * options.h (General_options::gc_sections): Define as a no-op for now.
14717 (General_options::no_keep_memory): Ditto.
14718 (General_options::Bshareable): Define.
14719 * options.cc (General_options::finalize): Honor -Bshareable.
14720
83d22aa8
AS
147212009-01-20 Andreas Schwab <schwab@suse.de>
14722
14723 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14724 read the value in the contents, since we don't use it. Use the
14725 template endianness when writing.
14726 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14727
cd536b21
AS
147282009-01-19 Andreas Schwab <schwab@suse.de>
14729
14730 * configure.tgt (powerpc64-*): Fix targ_obj.
14731
99e9a495
ILT
147322009-01-15 Ian Lance Taylor <iant@google.com>
14733
14734 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14735 local symbols when stripping all symbols.
14736
bbbfea06
CC
147372009-01-14 Cary Coutant <ccoutant@google.com>
14738
99e9a495 14739 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14740
0f7c0701
CC
147412009-01-14 Cary Coutant <ccoutant@google.com>
14742
14743 * archive.cc (Archive::get_elf_object_for_member): Remove call
14744 to File_read::claim_for_plugin.
14745 * descriptors.cc (Descriptors::open): Remove reference to
14746 is_claimed.
14747 (Descriptors::claim_for_plugin): Remove.
14748 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14749 (Descriptors::is_claimed): Remove.
14750 (claim_descriptor_for_plugin): Remove.
14751 * fileread.cc (File_read::claim_for_plugin): Remove.
14752 * fileread.h (File_read::claim_for_plugin): Remove.
14753 (File_read::descriptor): Reopen descriptor if necessary.
14754 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14755 (Plugin_manager::all_symbols_read): Add task parameter. Change
14756 all callers.
14757 (Plugin_manager::get_input_file): New function.
14758 (Plugin_manager::release_input_file): New function.
14759 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14760 corresponding data member.
14761 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14762 and pass to base constructor. Change all callers.
14763 (get_input_file, release_input_file): New functions.
14764 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14765 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14766 (Plugin_manager::all_symbols_read): Add task parameter.
14767 (Plugin_manager::get_input_file): New function.
14768 (Plugin_manager::release_input_file): New function.
14769 (Plugin_manager::task_): New data member.
14770 (Pluginobj::Pluginobj): Add filesize parameter.
14771 (Pluginobj::filename): New function.
14772 (Pluginobj::descriptor): New function.
14773 (Pluginobj::filesize): New function.
14774 (Pluginobj::filesize_): New data member.
14775 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14776 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14777 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14778
14779 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14780 with archive libraries.
14781 * testsuite/Makefile.in: Regenerate.
14782 * testsuite/plugin_test.c (struct sym_info): New type.
14783 (get_input_file, release_input_file): New static variables.
14784 (onload): Capture new transfer vector entries.
14785 (claim_file_hook): Stop reading at end of file according to filesize.
14786 Factor out parsing of readelf output into separate function.
14787 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14788 APIs and get the source file name from the symbol table. Convert
14789 source file name to corresponding object file name. Print info
14790 message when adding new input files.
14791 (parse_readelf_line): New function.
14792 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14793 * testsuite/plugin_test_2.sh: Likewise.
14794 * testsuite/plugin_test_3.sh: Likewise.
14795 * testsuite/plugin_test_4.sh: New test case.
14796
62a6d109
ILT
147972009-01-07 Ian Lance Taylor <iant@google.com>
14798
14799 * version.cc (version_string): Bump to 1.8.
14800
483620e8
CC
148012008-12-23 Cary Coutant <ccoutant@google.com>
14802
14803 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14804 * plugin.cc (Plugin_manager::finish): Rename as
14805 layout_deferred_objects. Move cleanup to separate function.
14806 (Plugin_manager::cleanup): New function.
14807 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14808 separately.
14809 * plugin.h (Plugin_manager::finish): Rename as
14810 layout_deferred_objects.
14811 (Plugin_manager::cleanup): New function.
14812 (Plugin_manager::cleanup_done): New field.
14813
d66a9eb3
CC
148142008-12-23 Cary Coutant <ccoutant@google.com>
14815
14816 * plugin.cc (is_visible_from_outside): New function.
14817 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14818 so we don't return "IR only" status for exported symbols or -r links.
14819
14820 * testsuite/Makefile.am (plugin_test_3): New test case.
14821 * testsuite/Makefile.in: Regenerate.
14822 * testsuite/plugin_test_3.sh: New file.
14823
5995b570
CC
148242008-12-22 Cary Coutant <ccoutant@google.com>
14825
14826 * object.cc (Sized_relobj::layout_section): New function.
14827 (Sized_relobj::do_layout): Defer layout of input sections until after
14828 plugin has provided replacement files.
14829 (Sized_relobj::do_layout_deferred_sections): New function.
14830 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14831 (Relobj::layout_deferred_sections): New function.
14832 (Relobj::do_layout_deferred_sections): New function.
14833 (Sized_relobj::do_layout_deferred_sections): New function.
14834 (Sized_relobj::layout_section): New function.
14835 (Sized_relobj::Deferred_layout): New structure.
14836 (Sized_relobj::deferred_layout_): New field.
14837 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14838 Change all callers. Layout deferred sections.
14839 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14840 references.
14841 (Plugin_hook::run): Move code from do_plugin_hook inline.
14842 (Plugin_hook::do_plugin_hook): Remove.
14843 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14844 (Plugin_manager::finish): Renamed, was cleanup.
14845 (Plugin_manager::should_defer_layout): New function.
14846 (Plugin_manager::add_deferred_layout_object): New function.
14847 (Plugin_manager::Deferred_layout_list): New type.
14848 (Plugin_manager::deferred_layout_objects_): New field.
14849 (Plugin_hook::do_plugin_hook): Remove.
14850
ee769c88
ILT
148512008-12-17 Ian Lance Taylor <iant@google.com>
14852
14853 * options.h (class General_options): Add --no case for
14854 --export-dynamic.
14855
abc8dcba
CC
148562008-12-16 Cary Coutant <ccoutant@google.com>
14857
14858 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14859 vector.
14860 (Plugin_manager::claim_file): Create plugin object even if
14861 plugin did not call the add_symbols callback.
14862 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14863 asking for more symbols than were added.
14864 * testsuite/Makefile.am (plugin_test_1): Add test case with
14865 no global symbols.
14866 (empty.syms): New target.
14867 * testsuite/Makefile.in: Regenerate.
14868 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14869 message. Don't call add_symbols if no globals.
14870 (all_symbols_read_hook): Don't provide replacement for empty
14871 claimed file.
14872
b0074644
ILT
148732008-12-12 Ian Lance Taylor <iant@google.com>
14874
68943102
ILT
14875 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14876 r_type == 0 for a local symbol with r_sym == 0.
14877 (scan_relocatable_relocs): Pass r_sym to
14878 local_non_section_strategy.
14879 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14880 r_sym parameter.
14881
b0074644
ILT
14882 * configure.ac: Update test for TLS descriptors: they are
14883 supported as of glibc 2.9.
14884 * configure: Rebuild.
14885
c2508178
ILT
148862008-12-11 Ian Lance Taylor <iant@google.com>
14887
14888 PR 7091
14889 * target-reloc.h (Default_scan_relocatable_relocs): For each
14890 function, map r_type == 0 to RELOC_DISCARD.
14891
2756a258
CC
148922008-12-10 Cary Coutant <ccoutant@google.com>
14893
14894 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14895 object to override a kept COMDAT group from a plugin object.
14896
bb6f53d3
ILT
148972008-12-09 Ian Lance Taylor <iant@google.com>
14898
fbc558e1
ILT
14899 PR 7088
14900 * yyscript.y (file_cmd): Handle INPUT.
14901
bb6f53d3
ILT
14902 * testsuite/initpri1.c: Change all declarations to be full
14903 prototypes by adding void, to avoid compiler warnings.
14904
4674ecfc
CC
149052008-12-05 Rafael Avila de Espindola <espindola@google.com>
14906
14907 * options.cc (General_options::parse_plugin_opt): New.
14908 (General_options::add_plugin): The argument now is just the filename.
14909 (General_options::add_plugin_option): New.
14910 * options.h (plugin_opt): New.
14911 (add_plugin): Change argument name.
14912 (add_plugin_option): New.
14913 * plugin.cc (Plugin::load): Don't parse the plugin option.
14914 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14915 (Plugin::add_option): New.
14916 (Plugin::args_): Change type.
14917 (Plugin::filename_): New.
14918 (Plugin_manager::add_plugin_option): New.
14919 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14920 * testsuite/Makefile.in: Regenerate.
14921
fd06b4aa
CC
149222008-12-05 Cary Coutant <ccoutant@google.com>
14923
14924 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14925 Handle --strip-lto-sections option.
14926 * options.h (strip_lto_sections): New option.
14927
6c52134c
CC
149282008-12-01 Cary Coutant <ccoutant@google.com>
14929
14930 * plugin.cc (ld_plugin_message): Change format parameter to const.
14931 Fix mismatch between new[] and delete.
14932
a45248e0
CC
149332008-11-14 Cary Coutant <ccoutant@google.com>
14934
14935 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14936 instead of -1U.
14937
c82fbeee
CS
149382008-11-05 Craig Silverstein <csilvers@google.com>
14939
14940 * options.cc (General_options::parse_dynamic_list): New function.
14941 * options.h (General_options): New flags dynamic_list,
14942 dynamic_list_data, dynamic_list_cpp_new, and
14943 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14944 (General_options::in_dynamic_list): New function.
14945 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14946 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14947 (Lex::can_continue_name): Likewise.
14948 (yylex): Likewise.
14949 (read_script_file): New parameter script_options.
14950 (read_dynamic_list): New function.
14951 (Script_options::define_dynamic_list): New function.
14952 (dynamic_list_keyword_parsecodes): New variable.
14953 (dynamic_list_keywords): New variable.
14954 * script.h (Script_options::define_dynamic_list): New function
14955 prototype.
14956 (read_dynamic_list): New function prototype.
14957 * symtab.cc (strprefix): New macro.
14958 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14959 dynamic_list_data, dynamic_list_cpp_new, and
14960 dynamic_list_cpp_typeinfo.
14961 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14962 (dynamic_list_expr): New rule.
14963 (dynamic_list_nodes): Likewise.
14964 (dynamic_list_node): Likewise.
14965 * testsuite/Makefile.am (dynamic_list): New test.
14966 * testsuite/Makefile.in: Regenerated.
14967 * testsuite/dynamic_list.t: New file.
14968 * testsuite/dynamic_list.sh: New file.
14969
e0bb29a5
CS
149702008-11-05 Craig Silverstein <csilvers@google.com>
14971
14972 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14973 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14974 (t11_last): Likewise.
14975 * testsuite/ver_test_6.c (main): Likewise.
14976
4e1e25e0
CC
149772008-10-07 Cary Coutant <ccoutant@google.com>
14978
14979 * options.c (General_options::finalize): Add check for -static and
14980 -shared.
14981 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14982 is not empty.
14983
92f03fcb
CC
149842008-10-02 Cary Coutant <ccoutant@google.com>
14985
14986 * plugin.cc (make_sized_plugin_object): Fix conditional
14987 compilation to work when not all targets are enabled.
14988
fbd8a257
CC
149892008-09-29 Cary Coutant <ccoutant@google.com>
14990
14991 * archive.cc (Archive::get_file_and_offset): Use filename instead
14992 of name to get library path.
14993 (Archive::include_member): Unlock external member of a thin archive.
14994
14995 * testsuite/Makefile.am (TEST_AR): New variable.
14996 (thin_archive_test_1): New test.
14997 (thin_archive_test_2): New test.
81636b3f
CC
14998 * testsuite/Makefile.in: Regenerate.
14999 * testsuite/thin_archive_main.cc: New file.
15000 * testsuite/thin_archive_test_1.cc: New file.
15001 * testsuite/thin_archive_test_2.cc: New file.
15002 * testsuite/thin_archive_test_3.cc: New file.
15003 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15004
eff45813
CC
150052008-09-29 Cary Coutant <ccoutant@google.com>
15006
15007 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15008 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15009 instead of -1U.
15010 (Sized_relobj::do_finalize_local_symbols): Likewise.
15011 (Sized_relobj::map_to_kept_section): Likewise.
15012 * object.h (Sized_relobj::invalid_address): New constant.
15013 (Sized_relobj::do_output_section_offset): Check for invalid_address
15014 and return -1ULL.
15015 * output.cc (Output_reloc::local_section_offset): Use constant
15016 invalid_address instead of -1U.
15017 (Output_reloc::get_address): Likewise.
15018 (Output_section::output_address): Change -1U to -1ULL.
15019 * output.h (Output_reloc::invalid_address): New constant.
15020 * reloc.cc (Sized_relobj::write_sections): Use constant
15021 invalid_address instead of -1U.
15022 (Sized_relobj::relocate_sections): Likewise.
15023 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15024 values for merge sections.
15025 * target-reloc.h (relocate_for_relocatable): Use constant
15026 invalid_address instead of -1U.
15027
89fc3421
CC
150282008-09-19 Cary Coutant <ccoutant@google.com>
15029
15030 Add plugin functionality for link-time optimization (LTO).
15031 * configure.ac (plugins): Add --enable-plugins option.
15032 * configure: Regenerate.
15033 * config.in: Regenerate.
15034 * Makefile.am (LIBDL): New variable.
15035 (CCFILES): Add plugin.cc.
15036 (HFILES): Add plugin.h.
15037 (ldadd_var): Add LIBDL.
15038 * Makefile.in: Regenerate.
15039
15040 * archive.cc: Include "plugin.h".
15041 (Archive::setup): Don't preread archive symbols when using a plugin.
15042 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15043 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15044 files.
15045 (Archive::include_member): Add symbols from plugin objects.
15046 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15047 * descriptors.cc (Descriptors::open): Check for file descriptors
15048 abandoned by plugins.
15049 (Descriptors::claim_for_plugin): New function.
15050 * descriptors.h (Descriptors::claim_for_plugin): New function.
15051 (Open_descriptor::is_claimed): New field.
15052 (claim_descriptor_for_plugin): New function.
15053 * fileread.cc (File_read::claim_for_plugin): New function.
15054 * fileread.h (File_read::claim_for_plugin): New function.
15055 (File_read::descriptor): New function.
15056 * gold.cc: Include "plugin.h".
15057 (queue_initial_tasks): Add task to call plugin hooks for generating
15058 new object files.
15059 * main.cc: Include "plugin.h".
15060 (main): Load plugin libraries.
15061 * object.h (Pluginobj): Declare.
15062 (Object::pluginobj): New function.
15063 (Object::do_pluginobj): New function.
15064 (Object::set_target): New function.
15065 * options.cc: Include "plugin.h".
15066 (General_options::parse_plugin): New function.
15067 (General_options::General_options): Initialize plugins_ field.
15068 (General_options::add_plugin): New function.
15069 * options.h (Plugin_manager): Declare.
15070 (General_options): Add --plugin option.
15071 (General_options::has_plugins): New function.
15072 (General_options::plugins): New function.
15073 (General_options::add_plugin): New function.
15074 (General_options::plugins_): New field.
15075 * plugin.cc: New file.
15076 * plugin.h: New file.
15077 * readsyms.cc: Include "plugin.h".
15078 (Read_symbols::do_read_symbols): Check for archive before checking
15079 for ELF file. Call plugin hooks to claim files.
15080 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15081 from a real object file; force override when processing replacement
15082 files.
15083 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15084 (Symbol::init_base_object): Likewise.
15085 (Symbol::init_base_output_data): Likewise.
15086 (Symbol::init_base_output_segment): Likewise.
15087 (Symbol::init_base_constant): Likewise.
15088 (Symbol::init_base_undefined): Likewise.
15089 (Symbol::output_section): Assert that object is not a plugin.
15090 (Symbol_table::add_from_pluginobj): New function.
15091 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15092 undefined.
15093 (Symbol_table::sized_write_globals): Likewise.
15094 (Symbol_table::add_from_pluginobj): Instantiate template.
15095 * symtab.h (Sized_pluginobj): Declare.
15096 (Symbol::in_real_elf): New function.
15097 (Symbol::set_in_real_elf): New function.
15098 (Symbol::in_real_elf_): New field.
15099 (Symbol_table::add_from_pluginobj): New function.
15100
15101 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15102 (LIBDL): New variable.
15103 (LDADD): Add LIBDL.
15104 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15105 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15106 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15107 (MOSTLYCLEANFILES): Likewise.
15108 * testsuite/Makefile.in: Regenerate.
15109 * testsuite/plugin_test.c: New file.
15110 * testsuite/plugin_test_1.sh: New file.
15111 * testsuite/plugin_test_2.sh: New file.
15112
de31bda5
ILT
151132008-09-16 Ian Lance Taylor <iant@google.com>
15114
9c2d0ef9
ILT
15115 * target-reloc.h (relocate_section): Check whether a symbol is
15116 defined by the ABI before reporting an undefined symbol error.
15117 * target.h (Target::is_defined_by_abi): Make parameter const.
15118 (Target::do_is_defined_by_abi): Likewise.
15119 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15120 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15121 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15122 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15123 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15124 * testsuite/Makefile.in: Rebuild.
15125
de31bda5
ILT
15126 * fileread.cc (make_view): Add casts to avoid warning.
15127
9fa33bee
AO
151282008-09-16 Alexandre Oliva <aoliva@redhat.com>
15129
15130 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15131 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15132
183fd0e3
AO
151332008-09-16 Alexandre Oliva <aoliva@redhat.com>
15134
15135 * options.h (General_options::output_is_executable): New.
15136 (General_options::output_is_pie): New.
15137 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15138 for shared libraries.
15139 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15140
7be8330a
CD
151412008-09-11 Chris Demetriou <cgd@google.com>
15142
15143 * options.h (origin): New -z option.
15144 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15145 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15146 in DT_FLAGS_1.
15147
a9caad02
CC
151482008-09-05 Cary Coutant <ccoutant@google.com>
15149
15150 * fileread.cc (File_read::make_view): Add check for attempt to map
15151 beyond end of file.
15152
ae6dce4d
CC
151532008-09-05 Cary Coutant <ccoutant@google.com>
15154
15155 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15156 explicit instantiations.
15157
d7ab2a47
KVH
151582008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15159
15160 PR gold/6858
15161 * options.cc (General_options::finalize): Allow undefined symbols
15162 in shlibs if linking -shared.
15163
15164 PR gold/6859
15165 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15166 symbols as not needing a dynsym entry.
15167
1e52a9c1
CS
151682008-08-20 Craig Silverstein <csilvers@google.com>
15169
15170 * fileread.cc (File_read::open): Do not lock the file unless it
15171 was successfully opened.
15172
d85c80a3
CC
151732008-08-14 Cary Coutant <ccoutant@google.com>
15174
15175 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15176 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15177 * testsuite/tls_test.cc (struct int128): 128-bit struct
15178 for testing TLS relocs with non-zero addend.
15179 (v12): New TLS variable.
15180 (t12): New test.
15181 (t_last): Add check for v12.
15182 * testsuite/tls_test.h (t12): New function.
15183 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15184
2d924fd9
ILT
151852008-08-13 Ian Lance Taylor <iant@google.com>
15186
15187 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15188 set tls_segment_ or relro_segment_.
15189 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15190 when appropriate.
15191 * output.h (Output_section::clear_is_relro): New function.
15192 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15193 sections specially even when output_data_ is empty.
15194 (Output_segment::maximum_alignment): When first section is relro,
15195 only force alignment for PT_LOAD segments.
15196 * script.cc (script_data_segment_align): New function.
15197 (script_data_segment_relro_end): New function.
15198 * script-c.h (script_data_segment_align): Declare.
15199 (script_data_segment_relro_end): Declare.
15200 * script-sections.h (class Script_sections): Declare
15201 data_segment_align and data_segment_relro_end. Add fields
15202 segment_align_index_ and saw_relro_end_.
15203 * script-sections.cc (class Sections_element): Add set_is_relro
15204 virtual function. Add new bool* parameter to place_orphan_here.
15205 Add get_output_section virtual function.
15206 (class Output_section_definition): Add set_is_relro. Add new
15207 bool* parameter to place_orphan_here. Add get_output_section.
15208 Add is_relro_ field.
15209 (Output_section_definition::Output_section_definition): Initialize
15210 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15211 and is_relro_ fields.
15212 (Output_section_definition::place_orphan_here): Add is_relro
15213 parameter.
15214 (Output_section_definition::set_section_addresses): Set relro for
15215 output section.
15216 (Output_section_definition::alternate_constraint): Likewise.
15217 (class Orphan_output_section): Add new bool* parameter to
15218 place_orphan_here. Add get_output_section.
15219 (Orphan_output_section::place_orphan_here): Add is_relro
15220 parameter.
15221 (Script_sections::Script_sections): Initialize
15222 data_segment_align_index_ and saw_relro_end_.
15223 (Script_sections::data_segment_align): New function.
15224 (Script_sections::data_segment_relro_end): New function.
15225 (Script_sections::place_orphan): Set or clear is_relro.
15226 (Script_sections::set_section_addresses): Force alignment of first
15227 TLS section.
15228 * yyscript.y (exp): Call script_data_segment_align and
15229 script_data_segment_relro_end.
15230 * testsuite/relro_script_test.t: New file.
15231 * testsuite/relro_test.cc (using_script): Declare.
15232 (t1, t2): Test using_script.
15233 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15234 (relro_script_test_SOURCES): Define.
15235 (relro_script_test_DEPENDENCIES): Define.
15236 (relro_script_test_LDFLAGS): Define.
15237 (relro_script_test_LDADD): Define.
15238 (relro_script_test.so): New target.
15239 * testsuite/Makefile.in: Rebuild.
15240
f827c9a9
CC
152412008-08-06 Cary Coutant <ccoutant@google.com>
15242
15243 * archive.cc (Archive::total_archives, Archive::total_members)
15244 (Archive::total_members_loaded): New variables.
15245 (Archive::setup): Add parameter. Add option to preread
15246 archive symbols.
15247 (Archive::read_armap): Add counter.
15248 (Archive::get_file_and_offset): New function.
15249 (Archive::get_elf_object_for_member): New function.
15250 (Archive::read_all_symbols): New function.
15251 (Archive::read_symbols): New function.
15252 (Archive::add_symbols): Add counters.
15253 (Archive::include_all_members): Use armap to find members if it's
15254 already built.
15255 (Archive::include_member): Skip reading symbols if already read.
15256 Factored code into Archive::get_file_and_offset and
15257 Archive::get_elf_object_for_member. Changed call to
15258 Mapfile::report_include_archive_member.
15259 (Archive::print_stats): New function.
15260 * archive.h: Declare Object and Read_symbols_data classes.
15261 (Archive::Archive): Add initializers for new members.
15262 (Archive::setup): Add parameter.
15263 (Archive::print_stats): New function.
15264 (Archive::total_archives, Archive::total_members)
15265 (Archive::total_members_loaded): New variables.
15266 (Archive::get_file_and_offset): New function.
15267 (Archive::get_elf_object_for_member): New function.
15268 (Archive::read_all_symbols): New function.
15269 (Archive::read_symbols): New function.
15270 (Archive::Archive_member): New class.
15271 (Archive::members_): New member.
15272 (Archive::num_members_): New member.
15273 * main.cc: Include archive.h.
15274 (main): Call Archive::print_stats.
15275 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15276 archive parameter; member_name is now the fully-decorated name.
15277 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15278 * options.h: (General_options): Add --preread-archive-symbols option.
15279 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15280 Archive::setup.
15281
de4c45bd
ILT
152822008-08-04 Ian Lance Taylor <iant@google.com>
15283
15284 * symtab.h (Symbol::use_plt_offset): New function.
15285 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15286 * powerpc.cc (Relocate::relocate): Likewise.
15287 * sparc.cc (Relocate::relocate): Likewise.
15288 * x86_64.cc (Relocate::relocate): Likewise.
15289 * testsuite/weak_plt.sh: New test.
15290 * testsuite/weak_plt_main.cc: New test.
15291 * testsuite/weak_plt_shared.cc: New test.
15292 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15293 (check_PROGRAMS): Add weak_plt.
15294 (check_DATA): Add weak_plt_shared.so.
15295 (weak_plt_main_pic.o, weak_plt): New targets.
15296 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15297 * testsuite/Makefile.in: Rebuild.
15298
15299 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15300 gcctestdir/ld.
15301 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15302 * testsuite/Makefile.in: Rebuild.
15303
323ee3f4
AM
153042008-08-04 Alan Modra <amodra@bigpond.net.au>
15305
15306 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15307 * Makefile.in: Regenerate.
15308 * po/POTFILES.in: Regenerate.
15309
7c07ecec
ILT
153102008-07-29 Ian Lance Taylor <iant@google.com>
15311
15312 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15313 symbols before other symbols.
15314 * testsuite/script_test_2.cc (test_addr): Declare.
15315 (test_addr_alias): Declare.
15316 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15317 values.
7c07ecec
ILT
15318 * testsuite/script_test_2.t: Define test_addr_alias and
15319 test_addr.
15320
5778530e
ILT
153212008-07-24 Ian Lance Taylor <iant@google.com>
15322
2a00e4fb
ILT
15323 PR 5990
15324 * descriptors.cc: New file.
15325 * descriptors.h: New file.
15326 * gold-threads.h (class Hold_optional_lock): New class.
15327 * fileread.cc: Include "descriptors.h".
15328 (File_read::~File_read): Release descriptor rather than closing
15329 it.
15330 (File_read::open) [file]: Call open_descriptor rather than open.
15331 Set is_descriptor_opened_.
15332 (File_read::open) [memory]: Assert that descriptor is not open.
15333 (File_read::reopen_descriptor): New function.
15334 (File_read::release): Release descriptor.
15335 (File_read::do_read): Make non-const. Reopen descriptor.
15336 (File_read::read): Make non-const.
15337 (File_read::make_view): Reopen descriptor.
15338 (File_read::do_readv): Likewise.
15339 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15340 Update declarations.
15341 * layout.cc: Include "descriptors.h".
15342 (Layout::create_build_id): Use open_descriptor rather than open.
15343 * output.cc: Include "descriptors.h".
15344 (Output_file::open): Use open_descriptor rather than open.
15345 * archive.cc (Archive::const_iterator): Change Archive to be
15346 non-const.
15347 (Archive::begin, Archive::end): Make non-const.
15348 (Archive::count_members): Likewise.
15349 * archive.h (class Archive): Update declarations.
15350 * object.h (Object::read): Make non-const.
15351 * Makefile.am (CCFILES): Add descriptors.cc.
15352 (HFILES): Add descriptors.h.
15353 * Makefile.in: Rebuild.
15354
801647d1
ILT
15355 PR 6716
15356 * gold.h: Always include <clocale>. Add Solaris workarounds
15357 following code in binutils/sysdep.h.
15358
5edd166e
ILT
15359 PR 6048
15360 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15361 this->eh_frame_hdr_ is NULL before using it.
15362
c89ad728
ILT
15363 * dynobj.cc (Versions::Versions): Update comment.
15364
aa86f06b
ILT
15365 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15366 the base version name.
15367
5778530e
ILT
15368 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15369 array size plus one.
15370 (Stringpool_template::set_string_offsets): Subtract one from key
15371 before using it as an array index.
15372 (Stringpool_template::get_offset_with_length): Likewise.
15373 (Stringpool_template::write_to_buffer): Likewise.
15374 * stringpool.h (Stringpool_template::get_offset_from_key):
15375 Likewise.
15376
057ead22
ILT
153772008-07-23 Ian Lance Taylor <iant@google.com>
15378
7f649c59
ILT
15379 PR 6658
15380 * object.h (Merged_symbol_value::value): Do our best to handle a
15381 negative addend.
15382
057ead22
ILT
15383 PR 6647
15384 * script.cc (Version_script_info::get_versions): Don't add empty
15385 version tag to return value.
15386 (Version_script_info::get_symbol_version_helper): Change return
15387 type to bool. Add pversion parameter. Change all callers.
15388 (script_register_vers_node): Don't require a non-NULL tag.
15389 * script.h (class Version_script_info): Update declarations.
15390 (Version_script_info::get_symbol_version): Change return type to
15391 bool. Add version parameter. Change all callers.
15392 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15393 handling. Handle an empty version from a version script.
15394 (Symbol_table::define_special_symbol): Likewise.
15395 * testsuite/ver_test_10.script: New file.
15396 * testsuite/ver_test_10.sh: New file.
15397 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15398 (check_DATA): Add ver_test_10.syms.
15399 (ver_test_10.syms, ver_test_10.so): New target.
15400 * testsuite/Makefile.in: Rebuild.
15401
58e54ac2
CD
154022008-07-23 Simon Baldwin <simonb@google.com>
15403
15404 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15405 to zero for undefined symbols from dynamic libraries.
15406
95d14cd3
ILT
154072008-07-23 Ian Lance Taylor <iant@google.com>
15408
15409 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15410 Change all callers.
15411 * symtab.h (class Symbol_table): Update declaration.
15412 * testsuite/ver_test_9.cc: New file.
15413 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15414 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15415 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15416 (ver_test_9.so, ver_test_9.o): New targets.
15417 * testsuite/Makefile.in: Rebuild.
15418
92de84a6
ILT
154192008-07-22 Ian Lance Taylor <iant@google.com>
15420
34810851
ILT
15421 * options.h (class General_options): Define --check-sections.
15422 * layout.cc (Layout::set_segment_offsets): Handle
15423 --check-sections.
15424
af6156ef
ILT
15425 * options.h (class General_options): Define -n/--nmagic and
15426 -N/--omagic.
15427 * options.cc (General_options::finalize): For -n/--nmagic or
15428 -N/--omagic, set -static.
15429 * layout.cc (Layout::attach_allocated_section_to_segment): If
15430 -N/--omagic, don't put read-only and read-write sections in
15431 different segments.
15432 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15433 finding a read-only segment.
15434 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15435 don't set the minimum segment alignment to the common page size,
15436 and don't set the file offset to the address modulo the page size.
15437 * script-sections.cc (Script_sections::create_segments): If
15438 -n/--omagic, don't put read-only and read-write sections in
15439 different segments.
15440
92de84a6
ILT
15441 * cref.cc: New file.
15442 * cref.h: New file.
15443 * options.h (class General_options): Add --print-symbol-counts.
15444 * main.cc (main): Issue defined symbol report if requested.
15445 * archive.cc (Archive::interpret_header): Make into a const member
15446 function.
15447 (Archive::add_symbols): Call Input_objects::archive_start and
15448 archive_stop.
15449 (Archive::const_iterator): Define new class.
15450 (Archive::begin, Archive::end): New functions.
15451 (Archive::include_all_members): Rewrite to use iterator.
15452 (Archive::count_members): New function.
15453 * archive.h (class Archive): Update declarations.
15454 (Archive::filename): New function.
15455 * object.cc: Include "cref.h".
15456 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15457 (Sized_relobj::do_get_global_symbol_counts): New function.
15458 (Input_objects::add_object): Add object to cross-referencer.
15459 (Input_objects::archive_start): New function.
15460 (Input_objects::archive_stop): New function.
15461 (Input_objects::print_symbol_counts): New function.
15462 * object.h: Declare Cref and Archive.
15463 (Object::get_global_symbol_counts): New function.
15464 (Object::do_get_global_symbol_counts): New pure virtual function.
15465 (class Sized_relobj): Add defined_count_ field. Update
15466 declarations.
15467 (class Input_objects): Add cref_ field. Update constructor.
15468 Update declarations.
15469 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15470 defined_count_.
15471 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15472 symbol counts.
15473 (Sized_dynobj::do_get_global_symbol_counts): New function.
15474 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15475 defined_count_. Update declarations. Define Symbols typedef.
15476 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15477 parameter. Change all callers.
15478 (Symbol_table::add_from_dynobj): Add sympointers and defined
15479 parameters. Change all callers.
15480 * symtab.h (class Symbol_table): Update declarations.
15481 * Makefile.am (CCFILES): Add cref.cc.
15482 (HFILES): Add cref.h.
15483 * Makefile.in: Rebuild.
15484
3f7c5e1d
CD
154852008-07-22 Simon Baldwin <simonb@google.com>
15486
15487 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15488 to zero when writing undefined symbols.
15489
e0b64032
ILT
154902008-07-22 Ian Lance Taylor <iant@google.com>
15491
15492 * output.cc (Output_section::add_input_section): Don't try to
15493 merge empty merge sections.
15494
096b02cf
CS
154952008-07-21 Craig Silverstein <csilvers@google.com>
15496
15497 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15498 Include symbol version in error message.
cd536b21 15499
1d1f116d
CD
155002008-07-20 Chris Demetriou <cgd@google.com>
15501
cd536b21 15502 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15503 (RANDOM_SEED_CFLAGS): New substituted variable.
15504 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15505 * configure: Rebuild.
15506 * Makefile.in: Likewise.
15507 * testsuite/Makefile.in: Likewise.
15508
a18f591e
ILT
155092008-07-18 Ian Lance Taylor <iant@google.com>
15510
15511 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15512 where we see NAME/NULL and NAME/VERSION as separate symbols.
15513 * testsuite/ver_test_main.cc (main): Call t4.
15514 (t4, t4_2a): Define.
15515 * testsuite/ver_test_2.cc (t4_2): Define.
15516 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15517 * testsuite/ver_test_4.cc (t4_2a): Define.
15518 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15519 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15520
c6e3f6ed
ILT
155212008-07-17 Ian Lance Taylor <iant@google.com>
15522
15523 * dynobj.cc (Versions::add_def): If we give an error about a
15524 missing version, go ahead and create the version anyhow.
15525
ef9beddf
ILT
155262008-07-10 Ian Lance Taylor <iant@google.com>
15527
15528 Handle output sections with more than 0x7fffffff bytes.
15529 * object.h (class Relobj): Change map_to_output_ to
15530 output_sections_, and just keep a section pointer. Change all
15531 uses. Move comdat group support to Sized_relobj.
15532 (Relobj::is_section_specially_mapped): Remove.
15533 (Relobj::output_section): Remove poff parameter. Change all
15534 callers.
15535 (Relobj::output_section_offset): New function.
15536 (Relobj::set_section_offset): Rewrite.
15537 (Relobj::map_to_output): Remove.
15538 (Relobj::output_sections): New function.
15539 (Relobj::do_output_section_offset): New pure virtual function.
15540 (Relobj::do_set_section_offset): Likewise.
15541 (class Sized_relobj): Add section_offsets_ field. Add comdat
15542 group support from Relobj. Update declarations.
15543 (Sized_relobj::get_output_section_offset): New function.
15544 (Sized_relobj::do_output_section_offset): New function.
15545 (Sized_relobj::do_set_section_offset): New function.
15546 * object.cc (Relobj::output_section_address): Remove.
15547 (Sized_relobj::Sized_relobj): Initialize new fields.
15548 (Sized_relobj::include_section_group): Cast find_kept_object to
15549 Sized_relobj.
15550 (Sized_relobj::include_linkonce_section): Likewise.
15551 (Sized_relobj::do_layout): Use separate arrays for output section
15552 and output offset.
15553 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15554 output_sections.
15555 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15556 output_sections and section_offsets.
15557 (Sized_relobj::write_local_symbols): Likewise.
15558 (map_to_kept_section): Compute output address directly.
15559 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15560 output_sections and section_offsets.
15561 (Sized_relobj::write_sections): Likewise.
15562 (Sized_relobj::relocate_sections): Likewise.
15563 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15564 * output.h (class Output_reloc): Update declarations. Change
15565 u2_.relobj to Sized_relobj*.
15566 (class Output_data_reloc): Change add functions to use
15567 Sized_relobj*.
15568 * output.cc (Output_reloc::Output_reloc): Change relobj to
15569 Sized_relobj*.
15570 (Output_reloc::local_section_offset): Change return type to
15571 Elf_Addr. Use get_output_section_offset.
15572 (Output_reloc::get_address): Likewise.
15573 (Output_section::is_input_address_mapped): Don't call
15574 is_section_specially_mapped.
15575 (Output_section::output_offset): Likewise.
15576 (Output_section::output_address): Likewise.
15577 (Output_section::starting_output_address): Likewise.
15578 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15579 parameter to Sized_relobj*.
15580 (Copy_relocs::need_copy_reloc): Likewise.
15581 (Copy_relocs::save): Likewise.
15582 * copy-relocs.h (class Copy_relocs): Update declarations.
15583 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15584 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15585 * target-reloc.h (relocate_for_relocatable): Change
15586 offset_in_output_section type to Elf_Addr. Change code that uses
15587 it as well.
15588 * layout.cc (Layout::layout): Always set *off.
15589 * mapfile.cc (Mapfile::print_input_section): Use
15590 output_section_offset.
15591 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15592 Sized_relobj*.
15593 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15594 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15595 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15596
5cb66f97
ILT
155972008-07-03 Ian Lance Taylor <iant@google.com>
15598
15599 * layout.cc (Layout::include_section): Do not discard unrecognized
15600 SHT_STRTAB sections.
15601
afe47622
CS
156022008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15603
15604 * script.cc (Lex::can_continue_name): Make '?' allowable in
15605 version-script names.
15606 * testsuite/version_script.map: Change glob pattern to use '?'
15607
5adf9721
ILT
156082008-06-30 Manish Singh <yosh@gimp.org>
15609
15610 PR 6585
15611 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15612 Correct typo.
15613
e6fde208
ILT
156142008-06-30 Ian Lance Taylor <iant@google.com>
15615
15616 PR 6660
15617 PR 6682
15618 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15619 versions]: Don't try to read the value in the contents, since we
15620 don't use it. Use the template endianness when writing.
15621
3f2e6a2d
CC
156222008-06-25 Cary Coutant <ccoutant@google.com>
15623
15624 * fileread.cc (File_read::make_view): Assert on zero-length view.
15625 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15626 symbol table when there are no symbols to read.
15627
c43d3a48
CS
156282008-06-23 Craig Silverstein <csilvers@google.com>
15629
15630 * version.cc (version_string): Bump to 1.7
15631
5f494ea0
CS
156322008-06-18 Craig Silverstein <csilvers@google.com>
15633
15634 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15635 constant 0xFFFF to type Valtype.
15636 (Powerpc_relocate_functions::rel16_ha): Likewise.
15637
c42e122e
ILT
156382008-06-17 Ian Lance Taylor <iant@google.com>
15639
f34787f8
ILT
15640 * output.h (Output_section::Input_section): Initialize p2align_ to
15641 zero for Output_section_data constructors.
15642 (Output_section::Input_section::addralign): If not an input
15643 section, return the alignment of the Output_section_data.
15644 * testsuite/copy_test.cc: New file.
15645 * testsuite/copy_test_1.cc: New file.
15646 * testsuite/copy_test_2.cc: New file.
15647 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15648 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15649 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15650 (copy_test_1_pic.o, copy_test_1.so): New targets.
15651 (copy_test_2_pic.o, copy_test_2.so): New targets.
15652 * testsuite/Makefile.in: Rebuild.
15653
c42e122e
ILT
15654 * script-sections.cc (Script_sections::place_orphan): Initialize
15655 local variable exact.
15656
ce3ac18a
DE
156572008-06-13 David Edelsohn <edelsohn@gnu.org>
15658
15659 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15660
42cacb20
DE
156612008-06-12 David Edelsohn <edelsohn@gnu.org>
15662 David S. Miller <davem@davemloft.net>
15663
15664 * powerpc.cc: New file.
15665 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15666 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15667 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15668 * Makefile.in: Rebuild.
15669
7b308235
ILT
156702008-06-09 Ian Lance Taylor <iant@google.com>
15671
15672 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15673 <exception>.
15674 (throwing, orig_terminate): New static variables.
15675 (terminate_handler): New static function.
15676 (t2): Set terminate handler.
15677
f0b886e3
ILT
156782008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15679
15680 PR 6584
cd536b21 15681 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15682 alignment.
15683
3e90f135
CC
156842008-05-30 Cary Coutant <ccoutant@google.com>
15685
15686 * archive.cc (Archive::include_all_members) Correct to step
15687 over symbol table and extended name table in thin archives.
15688
e09ad04a
ILT
156892008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15690
15691 PR 6407
15692 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15693 calculation.
15694
62b01cb5
ILT
156952008-05-28 Caleb Howe <cshowe@google.com>
15696
15697 * reduced_debug_output.cc: New file.
15698 * reduced_debug_output.h: New file.
92de84a6 15699 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15700 * options.cc (General_options::finalize): Add strip_debug_non_line
15701 to the strip heirarchy.
15702 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15703 fields.
15704 * layout.cc: Include "reduced_debug_output.h".
15705 (Layout::Layout): Initialize new fields.
15706 (line_only_debug_sections): New static array.
15707 (is_lines_only_debug_sections): New static inline function.
15708 (Layout::include_section): Handle --strip-debug-non-line.
15709 (Layout::make_output_section): If --strip-debug-non-line, build
15710 new output sections for .debug_abbrev and .debug_info.
15711 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15712 gold. Warn about possible overflow.
15713 (read_signed_LEB_128): Likewise.
15714 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15715 (read_signed_LEB_128): Declare.
15716 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15717 (HFILES): Add reduced_debug_output.h.
15718 * Makefile.in: Rebuild.
15719
7d9e3d98
ILT
157202008-05-21 Ian Lance Taylor <iant@google.com>
15721
15722 * mapfile.cc: New file.
15723 * mapfile.h: New file.
15724 * options.h (class General_options): Add -M/--print-map and -Map.
15725 * options.cc (General_options::finalize): Make -M equivalent to
15726 -Map -.
15727 * main.cc: Include <cstdio> and "mapfile.h".
15728 (main): Open mapfile if requested.
15729 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15730 constructor. Change caller.
15731 (queue_initial_tasks): Add mapfile parameter. Change caller.
15732 (queue_middle_tasks): Likewise.
15733 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15734 declarations.
15735 * archive.cc: Include "mapfile.h".
15736 (Archive::add_symbols): Add mapfile parameter. Change all
15737 callers. Pass mapfile, symbol, and reason to include_member.
15738 (Archive::include_all_members): Add mapfile parameter. Change all
15739 callers.
15740 (Archive::include_member): Add mapfile, sym, and why parameters.
15741 Change all callers. Report inclusion to map file.
15742 * archive.h: Include "fileread.h".
15743 (class Archive): Update declarations.
15744 (Archive::file): New const method.
15745 (class Add_archive_symbols): Add mapfile_ field. Update
15746 constructor. Change all callers.
15747 * readsyms.h (class Read_symbols): Likewise.
15748 (class Finish_group): Likewise.
15749 (class Read_script): Likewise.
15750 * common.cc: Include "mapfile.h".
15751 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15752 all callers.
15753 (Symbol_table::do_allocate_commons): Likewise.
15754 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15755 symbol allocation to mapfile.
15756 * common.h (class Allocate_commons_task): Add mapfile_ field.
15757 Update constructor. Change all callers.
15758 * symtab.h (class Symbol_table): Update declarations.
15759 * layout.cc: Include "mapfile.h".
15760 (Layout_task_runner::run): Print information to mapfile.
15761 (Layout::create_gold_note): Change Output_data_fixed_space to
15762 Output_data_zero_fill.
15763 (Layout::create_build_id): Likewise.
15764 (Layout::print_to_mapfile): New function.
15765 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15766 constructor. Change caller.
15767 (class Layout): Declare print_to_mapfile.
15768 * output.cc (Output_section::Input_section::print_to_mapfile): New
15769 function.
15770 (Output_section::add_input_section): If producing a map, always
15771 add to input_sections_ list.
15772 (Output_section::do_print_to_mapfile): New function.
15773 (Output_segment::print_sections_to_mapfile): New function.
15774 (Output_segment::print_section_list_to_mapfile): New function.
15775 * output.h: Include "mapfile.h".
15776 (Output_data::print_to_mapfile): New function.
15777 (Output_data::do_print_to_mapfile): New virtual function.
15778 (Output_segment_headers::do_print_to_mapfile): New function.
15779 (Output_file_header::do_print_to_mapfile): New function.
15780 (Output_data_const::do_print_to_mapfile): New function.
15781 (class Output_data_const_buffer): Add map_name_ field. Update
15782 constructor. Change all callers. Add do_print_to_mapfile
15783 function.
15784 (class Output_data_fixed_space): Likewise.
15785 (class Output_data_space): Likewise.
15786 (class Output_data_zero_fill): New class.
15787 (Output_data_strtab::do_print_to_mapfile): New function.
15788 (Output_data_reloc_base::do_print_to_mapfile): New function.
15789 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15790 (Output_data_group::do_print_to_mapfile): New function.
15791 (Output_data_got::do_print_to_mapfile): New function.
15792 (Output_data_dynamic::do_print_to_mapfile): New function.
15793 (Output_symtab_xindex::do_print_to_mapfile): New function.
15794 (class Output_section): Declare do_print_to_mapflie. Declare
15795 print_to_mapfile in Input_section.
15796 (class Output_segment): Declare new functions.
15797 * object.h (Sized_relobj::symbol_count): New function.
15798 * script-sections.cc
15799 (Output_section_element_dot_assignment::set_section_addresses):
15800 Change Output_data_fixed_space to Output_data_zero_fill.
15801 (Output_data_expression::do_print_to_mapfile): New function.
15802 * script.cc (read_input_script): Add mapfile parameter. Change
15803 all callers.
15804 * script.h (read_input_script): Update declaration.
15805 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15806 (Eh_frame::do_print_to_mapfile): New function.
15807 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15808 (Output_merge_string::do_print_to_mapfile): New function.
15809 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15810 function.
15811 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15812 function.
15813 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15814 function.
15815 * Makefile.am (CCFILES): Add mapfile.cc.
15816 (HFILES): Add mapfile.h.
15817 * Makefile.in: Rebuild.
15818
9f1d377b
ILT
158192008-05-19 Ian Lance Taylor <iant@google.com>
15820
15821 * options.h (class General_options): Add -z relro.
15822 * layout.cc (Layout::Layout): Initialize relro_segment_.
15823 (Layout::add_output_section_data): Return the output section.
15824 (Layout::make_output_section): Rcognize relro sections and mark
15825 them appropriately.
15826 (Layout::attach_allocated_section_to_segment): Put relro sections
15827 in a PT_GNU_RELRO segment.
15828 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15829 section as relro.
15830 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15831 PT_TLS segments.
15832 (Layout::linkonce_mapping): Map d.rel.ro.local to
15833 .data.rel.ro.local.
15834 (Layout::output_section_name): Us .data.rel.ro.local for any
15835 section which begins with that.
15836 * layout.h (class Layout): Update add_output_section_data
15837 declaration. Add relro_segment_ field.
15838 * output.cc (Output_section::Output_section): Initialize is_relro_
15839 and is_relro_local_ fields.
15840 (Output_segment::add_output_section): Group relro sections.
15841 (Output_segment::is_first_section_relro): New function.
15842 (Output_segment::maximum_alignment): If there is a relro section,
15843 align the segment to the common page size.
15844 (Output_segment::set_section_addresses): Track whether we are
15845 looking at relro sections. If the last section is a relro
15846 section, align to the common page size.
15847 (Output_segment::set_section_list_addresses): Add in_relro
15848 parameter. Change all callers. Align to the page size when
15849 moving from relro to non-relro section.
15850 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15851 segment.
15852 * output.h (class Output_section): Add is_relro_ and
15853 is_relro_local_ fields.
15854 (Output_section::is_relro): New function.
15855 (Output_section::set_is_relro): New function.
15856 (Output_section::is_relro_local): New function.
15857 (Output_section::set_is_relro_local): New function.
15858 (class Output_segment): Update declarations.
15859 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15860 * sparc.cc (Target_sparc::got_section): Likewise.
15861 * x86_64.cc (Target_x86_64::got_section): Likewise.
15862 * testsuite/relro_test_main.cc: New file.
15863 * testsuite/relro_test.cc: New file.
15864 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15865 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15866 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15867 (relro_test.so, relro_test_pic.o): New targets.
15868 * testsuite/Makefile.in: Rebuild.
15869
a984ee1d
ILT
158702008-05-16 Ian Lance Taylor <iant@google.com>
15871
01676dcd
ILT
15872 * output.cc (Output_segment::add_output_section): Remove front
15873 parameter.
15874 * output.h (class Output_segment): Remove
15875 add_initial_output_section and overloaded add_output_section.
15876 Update declaration of remaining add_output_section.
15877 * layout.cc (Layout::create_interp): Call add_output_section
15878 rather than add_initial_output_section.
15879 (Layout::finish_dynamic_section): Likewise.
15880
497897f9
ILT
15881 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15882 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15883 know the dynamic type.
15884 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15885 field. Initialize it in constructor.
15886 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15887 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15888 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15889 reloc.
15890
a984ee1d
ILT
15891 * output.cc (Output_reloc::get_address): Change return type to
15892 Elf_Addr.
15893 * output.h (class Output_reloc): Update get_address declaration.
15894 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15895 for section addresses.
15896
55ba0940
ILT
158972008-05-09 Ian Lance Taylor <iant@google.com>
15898
15899 PR 6493
15900 * gold.cc (gold_nomem): Use return value of write.
15901
75517b77
ILT
159022008-05-08 Ian Lance Taylor <iant@google.com>
15903
15904 * symtab.c (Symbol::init_base_output_data): Add version
15905 parameter. Change all callers.
15906 (Symbol::init_base_output_segment): Likewise.
15907 (Symbol::init_base_constant): Likewise.
15908 (Symbol::init_base_undefined): Likewise.
15909 (Sized_symbol::init_output_data): Likewise.
15910 (Sized_symbol::init_output_segment): Likewise.
15911 (Sized_symbol::init_constant): Likewise.
15912 (Sized_symbol::init_undefined): Likewise.
15913 (Symbol_table::do_define_in_output_data): If the new symbol has a
15914 version, mark it as the default.
15915 (Symbol_table::do_define_in_output_segment): Likewise.
15916 (Symbol_table::do_define_as_constant): Likewise.
15917 * symtab.h (class Symbol): Update declarations.
15918 (class Sized_symbol): Likewise.
15919 * resolve.cc (Symbol::override_version): New function.
c42e122e 15920 (Symbol::override_base): Call override_version.
75517b77
ILT
15921 (Symbol::override_base_with_special): Likewise.
15922 * testsuite/ver_script_8.script: New file.
15923 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15924 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15925 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15926 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15927
f1f70eae
ILT
159282008-05-06 Ian Lance Taylor <iant@google.com>
15929
f3e9c5c5
ILT
15930 PR 6049
15931 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15932 functions.
15933 (class General_options): Remove existing --undefined, and add
15934 --no-undefined instead. Add new --undefined as synonym for -u.
15935 * archive.cc (Archive::add_symbols): Check whether symbol was
15936 named with -u.
15937 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15938 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15939 all uses. Add IS_UNDEFINED. Update declarations to split
15940 different versions of init_base. Declare init_base_undefined.
15941 (Symbol::is_defined): Handle IS_UNDEFINED.
15942 (Symbol::is_undefined): Likewise.
15943 (Symbol::is_weak_undefined): Call is_undefined.
15944 (Symbol::is_absolute): Handle IS_CONSTANT.
15945 (class Sized_symbol): Update declarations to split different
15946 versions of init. Declare init_undefined.
15947 (class Symbol_table): Declare new functions.
15948 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15949 Change all callers.
15950 (Symbol::init_base_output_data): Likewise.
15951 (Symbol::init_base_output_segment): Likewise.
15952 (Symbol::init_base_constant): Likewise.
15953 (Symbol::init_base_undefined): New function.
15954 (Sized_symbol::init_object): Rename from init. Change all
15955 callers.
15956 (Sized_symbol::init_output_data): Likewise.
15957 (Sized_symbol::init_output_segment): Likewise.
15958 (Sized_symbol::init_constant): Likewise.
15959 (Sized_symbol::init_undefined): New function.
15960 (Symbol_table::add_undefined_symbols_from_command_line): New
15961 function.
15962 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15963 function.
15964 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15965 (Symbol::output_section): Likewise.
15966 (Symbol::set_output_section): Likewise.
15967 (Symbol_table::sized_finalize_symbol): Likewise.
15968 (Symbol_table::sized_write_globals): Likewise.
15969 * resolve.cc (Symbol_table::should_override): Likewise.
15970 (Symbol::override_base_with_special): Likewise.
15971
8bdcdf2c
ILT
15972 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15973 symbol, change it to have default visibility.
15974 * testsuite/protected_1.cc: New file.
15975 * testsuite/protected_2.cc: New file.
15976 * testsuite/protected_3.cc: New file.
15977 * testsuite/protected_main_1.cc: New file.
15978 * testsuite/protected_main_2.cc: New file.
15979 * testsuite/protected_main_3.cc: New file.
15980 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15981 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15982 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15983 (protected_1.so): New target.
15984 (protected_1_pic.o, protected_2_pic.o): New targets.
15985 (protected_3_pic.o): New target.
15986 (check_PROGRAMS): Add protected_2.
15987 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15988 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15989 * testsuite/Makefile.in: Rebuild.
15990
2b706932
ILT
15991 * options.h (DEFINE_var): Add set_user_set_##varname__.
15992 (DEFINE_bool_alias): New macro.
15993 (class General_options): Define -Bstatic using DEFINE_bool_alias
15994 rather than DEFINE_special. Add --undefined as an alias for -z
15995 defs.
15996 * options.cc (General_options::parse_Bstatic): Remove.
15997
d82a5bcc
ILT
15998 * options.h (class General_options): Add --fatal-warnings.
15999 * main.cc (main): Implement --fatal-warnings.
16000 * errors.h (Errors::warning_count): New function.
16001
f1f70eae
ILT
16002 * options.h (class General_options): Add -Bsymbolic-functions.
16003 * symtab.h (Symbol::is_preemptible): Check for
16004 -Bsymbolic-functions.
16005
8825ac63
ILT
160062008-05-05 Ian Lance Taylor <iant@google.com>
16007
d98bc257
ILT
16008 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16009 as noVARNAME rather than no-VARNAME.
16010 (class General_options): Add option -z combreloc.
16011 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16012 get_address.
16013 (Output_reloc::sort_before) [SHT_REL]: New function.
16014 (Output_reloc::sort_before) [SHT_RELA]: New function.
16015 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16016 Sort_relocs_comparison.
16017 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16018 parameter. Change all callers.
16019 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16020 sort_relocs parameter. Change all callers.
16021 * output.cc (Output_reloc::get_address): New function, broken out
16022 of write_rel.
16023 (Output_reloc::write_rel): Call it.
16024 (Output_reloc::compare): New function.
16025 (Output_data_reloc_base::do_write): Optionally sort relocs.
16026
60b2b4e7
ILT
16027 * configure.ac: If targ_extra_obj is set, link it in.
16028 * configure.tgt: Initialize all variables.
16029 (x86_64*): Set targ_extra_obj and targ_extra_size.
16030 * configure: Rebuild.
16031
8825ac63
ILT
16032 * object.cc (Sized_relobj::include_section_group): Adjust section
16033 indexes read from group data. Build vector to pass to
16034 layout_group.
16035 * layout.cc (Layout::layout_group): Add flags and shndxes
16036 parameters. Remove contents parameter. Change caller. Update
16037 explicit instantiations.
16038 * layout.h (class Layout): Update layout_group declaration.
16039 * output.cc (Output_data_group::Output_data_group): Add flags and
16040 input_shndxes parameters. Remove contents parameter. Change
16041 caller.
16042 (Output_data_group::do_write): Change input_sections_ to
16043 input_shndxes_.
16044 * output.h (class Output_data_group): Update constructor
16045 declaration. Rename input_sections_ to input_shndxes_.
16046 * testsuite/many_sections_test.cc: Add template.
16047
e94cf127
CC
160482008-04-30 Cary Coutant <ccoutant@google.com>
16049
4418b2d5
CC
16050 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16051
e94cf127
CC
16052 * layout.cc (Layout::include_section): Refactored check for debug
16053 info section.
16054 (Layout::add_comdat): Add new parameters. Change type
16055 of signature parameter. Add object and shndx to signatures table.
16056 (Layout::find_kept_object): New function.
16057 * layout.h: Include <cstring>.
16058 (Layout::is_debug_info_section): New function.
16059 (Layout::add_comdat): Add new parameters.
16060 (Layout::find_kept_object): New function.
16061 (Layout::Kept_section): New struct.
16062 (Layout::Signatures): Change type of map range.
16063 * object.cc (Relobj::output_section_address): New function.
16064 (Sized_relobj::include_section_group): Add new parameters. Change
16065 calls to Layout::add_comdat. Change to build table of kept comdat
16066 groups and table mapping discarded sections to kept sections.
16067 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16068 (Sized_relobj::do_layout): Change calls to include_section_group and
16069 include_linkonce_section.
16070 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16071 value to zero when section is discarded.
16072 (Sized_relobj::map_to_kept_section): New function.
16073 * object.h (Relobj::output_section_address): New function.
16074 (Relobj::Comdat_group): New type.
16075 (Relobj::find_comdat_group): New function.
16076 (Relobj::Comdat_group_table): New type.
16077 (Relobj::Kept_comdat_section): New type.
16078 (Relobj::Kept_comdat_section_table): New type.
16079 (Relobj::add_comdat_group): New function.
16080 (Relobj::set_kept_comdat_section): New function.
16081 (Relobj::get_kept_comdat_section): New function.
16082 (Relobj::comdat_groups_): New field.
16083 (Relobj::kept_comdat_sections_): New field.
16084 (Symbol_value::input_value): Update comment.
16085 (Sized_relobj::map_to_kept_section) New function.
16086 (Sized_relobj::include_linkonce_section): Add new parameter.
16087 * target-reloc.h (Comdat_behavior): New type.
16088 (get_comdat_behavior): New function.
16089 (relocate_section): Add code to map a discarded section to the
16090 corresponding kept section when applying a relocation.
16091
e4e5049b
CS
160922008-04-30 Craig Silverstein <csilvers@google.com>
16093
16094 * dwarf_reader.cc (next_generation_count): New static var.
16095 (Addr2line_cache_entry): New struct.
16096 (addr2line_cache): New static var.
16097 (Dwarf_line_info::one_addr2line): Added caching.
16098 (Dwarf_line_info::clear_addr2line_cache): New function.
16099 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16100 cache-size parameter.
16101 (Dwarf_line_info::one_addr2line_cache): New function.
16102 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16103 new cache-size argument to one_addr2line(), and clear cache.
16104
d09e9154
CC
161052008-04-28 Cary Coutant <ccoutant@google.com>
16106
16107 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16108 R_386_PC8 relocations.
16109
7ef73768
ILT
161102008-04-23 Ian Lance Taylor <iant@google.com>
16111
55438702
ILT
16112 * object.cc (Sized_relobj::include_section_group): Check for
16113 invalid section group.
16114
c165fb93
ILT
16115 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16116 header size.
16117
7ef73768
ILT
16118 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16119 than read for file header.
16120 * archive.cc (Archive::include_member): Likewise.
16121
6194aaab
L
161222008-04-23 Paolo Bonzini <bonzini@gnu.org>
16123
16124 * aclocal.m4: Regenerate.
16125 * configure: Regenerate.
16126
d491d34e
ILT
161272008-04-19 Ian Lance Taylor <iant@google.com>
16128
5ea2bac6
ILT
16129 * version.cc (version_string): Bump to 1.6.
16130
7bc3e21a
ILT
16131 * testsuite/Makefile.am (many_sections_r_test): New target.
16132 (many_sections_r_test_SOURCES): Remove.
16133 (many_sections_r_test_DEPENDENCIES): Remove.
16134 (many_sections_r_test_LDFLAGS): Remove.
16135 (many_sections_r_test_LDADD): Remove.
16136
7fcd3aa9
ILT
16137 * object.cc (Sized_relobj::do_add_symbols): Always pass
16138 local_symbol_count_ to add_from_relobj.
16139
4c94d6ae
ILT
16140 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16141 every thousand variables.
16142 * testsuite/Makefile.in: Rebuild.
16143
d491d34e
ILT
16144 * object.cc (Xindex::initialize_symtab_xindex): New function.
16145 (Xindex::read_symtab_xindex): New function.
16146 (Xindex::sym_xindex_to_shndx): New function.
16147 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16148 available.
16149 (Sized_relobj::do_initialize_xindex): New function.
16150 (Sized_relobj::do_read_symbols): Adjust section links.
16151 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16152 parameter. Change all callers.
16153 (Sized_relobj::include_section_group): Adjust section links and
16154 symbol section indexes.
16155 (Sized_relobj::do_layout): Adjust section links.
16156 (Sized_relobj::do_count_local_symbols): Adjust section links and
16157 symbol section indexes.
16158 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16159 ordinary and special symbols.
16160 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16161 dynsym_xindex parameters. Change all callers. Adjust section
16162 links. Use SHN_XINDEX when needed.
16163 (Sized_relobj::get_symbol_location_info): Adjust section links.
16164 Don't get fooled by special symbols.
16165 * object.h (class Xindex): Define.
16166 (class Object): Add xindex_ parameter. Declare virtual functoin
16167 do_initialize_xindex.
16168 (Object::adjust_sym_shndx): New function.
16169 (Object::set_xindex): New protected function.
16170 (class Symbol_value): Add is_ordinary_shndx_ field.
16171 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16172 (Symbol_value::value): Assert ordinary section.
16173 (Symbol_value::initialize_input_to_output_map): Likewise.
16174 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16175 Change all callers.
16176 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16177 all callers.
16178 (class Sized_relobj): Update declarations.
16179 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16180 parameter. Change all callers.
16181 (Sized_relobj::adjust_shndx): New function.
16182 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16183 field.
16184 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16185 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16186 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16187 (Sized_dynobj::read_dynsym_section): Adjust section links.
16188 (Sized_dynobj::read_dynamic): Likewise.
16189 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16190 section links.
16191 (Sized_dynobj::do_initialize_xindex): New function.
16192 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16193 do_initialize_xindex.
16194 (Sized_dynobj::adjust_shndx): New function.
16195 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16196 dynsym_xindex_ fields.
16197 (Layout::finalize): Add a call to set_section_indexes before
16198 creating the symtab sections.
16199 (Layout::set_section_indexes): Don't do anything if the section
16200 already has a section index.
16201 (Layout::create_symtab_sections): Add shnum parameter. Change
16202 caller. Create .symtab_shndx section if needed.
16203 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16204 caller.
16205 (Layout::allocated_output_section_count): New function.
16206 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16207 needed.
16208 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16209 fields. Update declarations.
16210 (Layout::symtab_xindex): New function.
16211 (Layout::dynsym_xindex): New function.
16212 (class Write_symbols_task): Add layout_ field.
16213 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16214 Change caller.
16215 * output.cc (Output_section_headers::Output_section_headers): Add
16216 shstrtab_section parameter. Change all callers.
16217 (Output_section_headers::do_sized_write): Store overflow values
16218 for section count and section string table section index in
16219 section header zero.
16220 (Output_file_header::do_sized_write): Check for overflow of
16221 section count and section string table section index.
16222 (Output_symtab_xindex::do_write): New function.
16223 (Output_symtab_xindex::endian_do_write): New function.
16224 * output.h (class Output_section_headers): Add shstrtab_section_.
16225 Update declarations.
16226 (class Output_symtab_xindex): Define.
16227 (Output_section::has_out_shndx): New function.
16228 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16229 field.
16230 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16231 Change all callers.
16232 (Sized_symbol::init): Likewise.
16233 (Symbol::output_section): Check for ordinary symbol.
16234 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16235 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16236 callers.
16237 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16238 Change all callers. Simplify handling of symbols from sections
16239 not included in the link.
16240 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16241 distinction.
16242 (Weak_alias_sorter::operator()): Assert that symbols are
16243 ordinary.
16244 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16245 distinction.
16246 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16247 parameters. Change all callers.
16248 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16249 symbol distinction. Use SHN_XINDEX when needed.
16250 (Symbol_table::write_section_symbol): Add symtab_xindex
16251 parameter. Change all callers.
16252 (Symbol_table::sized_write_section_symbol): Likewise. Use
16253 SHN_XINDEX when needed.
16254 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16255 declarations.
16256 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16257 (Symbol::is_defined): Check is_ordinary.
16258 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16259 (Symbol::is_absolute, Symbol::is_common): Likewise.
16260 (class Sized_symbol): Update declarations.
16261 (class Symbol_table): Update declarations.
16262 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16263 parameters. Change all callers.
16264 (Sized_symbol::override): Likewise.
16265 (Symbol_table::override): Likewise.
16266 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16267 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16268 is_ordinary, and orig_st_shndx parameters. Change all callers.
16269 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16270 to be in an ordinary section.
16271 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16272 object and is_ordinary parameters. Change all callers.
16273 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16274 Change all callers. Don't add undefined or non-ordinary symbols
16275 to reloc_map_.
16276 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16277 Change all callers.
16278 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16279 declarations.
16280 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16281 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16282 (Sized_relobj::relocate_sections): Likewise.
16283 * target-reloc.h (scan_relocs): Adjust section symbol index.
16284 (scan_relocatable_relocs): Likewise.
16285 * i386.cc (Scan::local): Check for ordinary symbols.
16286 * sparc.cc (Scan::local): Likewise.
16287 * x86_64.cc (Scan::local): Likewise.
16288 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16289 to symbol_section_and_value.
16290 * testsuite/many_sections_test.cc: New file.
16291 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16292 (check_PROGRAMS): Add many_sections_test.
16293 (many_sections_test_SOURCES): Define.
16294 (many_sections_test_DEPENDENCIES): Define.
16295 (many_sections_test_LDFLAGS): Define.
16296 (BUILT_SOURCES): Add many_sections_define.h.
16297 (many_sections_define.h): New target.
16298 (BUILT_SOURCES): Add many_sections_check.h.
16299 (many_sections_check.h): New target.
16300 (check_PROGRAMS): Add many_sections_r_test.
16301 (many_sections_r_test_SOURCES): Define.
16302 (many_sections_r_test_DEPENDENCIES): Define.
16303 (many_sections_r_test_LDFLAGS): Define.
16304 (many_sections_r_test_LDADD): Define.
16305 (many_sections_r_test.o): New target.
16306 * testsuite/Makefile.in: Rebuild.
16307
c5818ff1
CC
163082008-04-17 Cary Coutant <ccoutant@google.com>
16309
16310 * errors.cc (Errors::info): New function.
16311 (gold_info): New function.
16312 * errors.h (Errors::info): New function.
16313 * gold.h (gold_info): New function.
16314 * object.cc (Input_objects::add_object): Print trace output.
16315 * options.cc (options::parse_set): New function.
16316 (General_options::parse_wrap): Deleted.
16317 (General_options::General_options): Deleted initializer.
16318 * options.h (options::String_set): New typedef.
16319 (options::parse_set): New function.
16320 (DEFINE_set): New macro.
16321 (General_options::wrap): Changed to use DEFINE_set. Changed
16322 callers of any_wrap_symbols and is_wrap_symbol.
16323 (General_options::trace, General_options::trace_symbol):
16324 New options.
16325 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16326 (General_options::wrap_symbols_): Deleted.
16327 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16328
b5be4a7c
DM
163292008-04-17 David S. Miller <davem@davemloft.net>
16330
16331 * options.cc (General_options::parse_V): New function.
16332 * options.h: Add entries for -V and -Qy.
16333
155a0dd7
ILT
163342008-04-17 Ian Lance Taylor <iant@google.com>
16335
16336 * common.cc (Symbol_table::allocate_commons): Remove options
16337 parameter. Change caller.
16338 (Symbol_table::do_allocate_commons): Remove options parameter.
16339 Change caller. Just call do_allocate_commons_list twice.
16340 (Symbol_table::do_allocate_commons_list): New function, broken out
16341 of do_allocate_commons.
16342 * common.h (class Allocate_commons_task): Remove options_ field.
16343 Update constructor.
16344 * symtab.cc (Symbol_table::Symbol_table): Initialize
16345 tls_commons_.
16346 (Symbol_table::add_from_object): Put TLS common symbols on
16347 tls_commons_ list.
16348 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16349 which are IN_OUTPUT_DATA.
16350 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16351 allocate_commons and do_allocate_commons declarations. Declare
16352 do_allocate_commons_list.
16353 * gold.cc (queue_middle_tasks): Update creation of
16354 Allocate_commons_task to not pass options.
16355 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16356 (TLS_TEST_C_FLAGS): New variable.
16357 (tls_test_c_pic.o): New target.
16358 (tls_test_shared.so): Link in tls_test_c_pic.o.
16359 (tls_test_c_pic_ie.o): New target.
16360 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16361 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16362 (tls_test_c.o): New target.
16363 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16364 (tls_pic_test_LDADD): Likewise.
16365 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16366 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16367 (tls_test_c_gnu2.o): New target.
16368 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16369 tls_test_c_gnu2.o.
16370 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16371 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16372 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16373 * testsuite/tls_test.cc: Include "config.h".
16374 (t_last): Call t11_last.
16375 * testsuite/tls_test.h (t11, t11_last): Declare.
16376 * testsuite/tls_test_c.c: New file.
16377 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16378 * configure.ac: Check for OpenMP support.
16379 * configure, config.in, Makefile.in: Rebuild.
16380 * testsuite/Makefile.in: Rebuild.
16381
edfbb029
CC
163822008-04-16 Cary Coutant <ccoutant@google.com>
16383
16384 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16385 (Target_i386::tls_base_symbol_defined_): New field.
16386 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16387 (Target_i386::Scan::global): Likewise.
16388 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16389 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16390 (Target_x86_64::tls_base_symbol_defined_): New field.
16391 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16392 (Target_x86_64::Scan::global): Likewise.
16393
f3c69fca
CC
163942008-04-16 Cary Coutant <ccoutant@google.com>
16395
16396 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16397 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16398 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16399 building shared libraries.
16400 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16401 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16402 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16403 * testsuite/Makefile.in: Rebuild.
16404 * testsuite/weak_undef.h: New file.
16405 * testsuite/weak_undef_file1.cc: Add extra test cases.
16406 * testsuite/weak_undef_file2.cc: Likewise.
16407 * testsuite/weak_undef_test.cc: Likewise.
16408
7c414435
DM
164092008-04-16 David S. Miller <davem@davemloft.net>
16410
32b769e1
DM
16411 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16412 Add issued_non_pic_error_ field. Declare check_non_pic.
16413 (Target_sparc::Scan::check_non_pic): New function.
16414 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16415 (Target_sparc::Scan::global): Likewise.
16416
11936fb1
DM
16417 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16418 * configure: Rebuild.
16419
7c414435
DM
16420 * options.h (DEFINE_enable): New macro.
16421 (new_dtags): New enable option.
16422 (initfirst, interpose, loadfltr, nodefaultlib,
16423 nodelete, nodlopen, nodump): New -z options.
16424 * layout.cc (Layout:finish_dynamic_section): If new
16425 dtags enabled, emit DT_RUNPATH. Also, emit a
16426 DT_FLAGS_1 containing any specified -z flags.
16427
85c7bf8b
ILT
164282008-04-16 Ian Lance Taylor <iant@google.com>
16429
12c0daef
ILT
16430 * copy-relocs.cc: New file.
16431 * copy-relocs.h: New file.
16432 * reloc.cc: Remove Copy_relocs code.
16433 * reloc.h: Likewise.
16434 * reloc-types.h (struct Reloc_types) [both versions]: Add
16435 get_reloc_addend_noerror.
16436 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16437 variants of add_global which take an addend which must be zero.
16438 * i386.cc: Include "copy-relocs.h".
16439 (class Target_i386): Change type of copy_relocs_ to variable,
16440 update initializer.
16441 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16442 Change all callers.
16443 (Target_i386::do_finalize_sections): Change handling of
16444 copy_relocs_.
16445 * sparc.cc: Include "copy-relocs.h".
16446 (class Target_sparc): Change type of copy_relocs_ to variable,
16447 update initializer.
16448 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16449 Change all callers.
16450 (Target_sparc::do_finalize_sections): Change handling of
16451 copy_relocs_.
16452 * x86_64.cc: Include "copy-relocs.h".
16453 (class Target_x86_64): Change type of copy_relocs_ to variable,
16454 update initializer.
16455 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16456 class. Change all callers.
16457 (Target_x86_64::do_finalize_sections): Change handling of
16458 copy_relocs_.
16459 * Makefile.am (CCFILES): Add copy-relocs.cc.
16460 (HFILES): Add copy-relocs.h.
16461
4f4995b6
ILT
16462 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16463
85c7bf8b
ILT
16464 * testsuite/script_test_4.sh: Permit leading zeroes.
16465
4f2a9edd
ILT
164662008-04-15 Ian Lance Taylor <iant@google.com>
16467
e6188289
ILT
16468 * script-sections.cc (Script_sections::create_segments): Use
16469 header_size_adjustment even when there is enough room for the
16470 headers.
16471 * testsuite/script_test_4.sh: New file.
16472 * testsuite/script_test_4.t: New file.
16473 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16474 (check_DATA): Add script_test_4.stdout.
16475 (MOSTLYCLEANFILES): Likewise.
16476 (script_test_4): New target.
16477 (script_test_4.stdout): New target.
16478 * testsuite/Makefile.in: Rebuild.
16479
4f2a9edd
ILT
16480 * sparc.cc: Add definitions for Output_data_plt_sparc class
16481 constants.
16482
f5314dd5
DM
164832008-04-14 David S. Miller <davem@davemloft.net>
16484
16485 * sparc.cc: New file.
16486 * Makefile.am (TARGETSOURCES): Add sparc.cc
16487 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16488 * configure.tgt: Document targ_extra_size and
16489 targ_extra_big_endian. Add entries for sparc-* and
16490 sparc64-*.
16491 * configure.ac: Handle targ_extra_size and
16492 targ_extra_big_endian.
16493 * Makefile.in: Rebuild.
16494 * configure: Likewise.
16495 * po/POTFILES.in: Likewise.
16496 * po/gold.pot: Likewise.
16497
154e0e9a
ILT
164982008-04-14 Ian Lance Taylor <iant@google.com>
16499
16500 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16501 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16502 in the name/type/flags to section mapping. Don't call
16503 allocate_output_section.
16504 (Layout::choose_output_section): Change parameter from adjust_name
16505 to is_input_section. Don't permit input sections after sections
16506 are attached to segments. Don't call allocate_output_section.
16507 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16508 not write_enable_output_section.
16509 (Layout::make_output_section): Don't push to
16510 unattached_section_list_ nor call attach_to_segment. Call
16511 attach_section_to_segment if sections are attached.
16512 (Layout::attach_sections_to_segments): New function.
16513 (Layout::attach_section_to_segment): New function.
16514 (Layout::attach_allocated_section_to_segment): Rename from
16515 attach_to_segment. Remove flags parameter.
16516 (Layout::allocate_output_section): Remove function.
16517 (Layout::write_enable_output_section): Remove function.
16518 * layout.h (class Layout): Update for above changes. Add new
16519 field sections_are_attached_.
16520 * output.h (Output_section::update_flags_for_input_section): New
16521 function.
16522 * output.cc (Output_section::add_input_section): Call
16523 update_flags_for_input_section.
16524 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16525
009a67a2
CC
165262008-04-11 Cary Coutant <ccoutant@google.com>
16527
16528 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16529 thought unnecessary.
16530 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16531
759b1a24
ILT
165322008-04-11 Ian Lance Taylor <iant@google.com>
16533
16534 * output.h (class Output_section_data): Remove inline definition
16535 of set_addralign.
16536 * output.cc (Output_section_data::set_addralign): New function.
16537
c2b45e22
CC
165382008-04-11 Cary Coutant <ccoutant@google.com>
16539
16540 Add support for TLS descriptors for i386 and x86_64.
16541 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16542 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16543 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16544 GOT_TYPE_TLS_DESC.
16545 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16546 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16547 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16548 relocations.
16549 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16550 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16551 Fix problem with initial-exec relocations.
16552 (Target_i386::Relocate::relocate_tls): Likewise.
16553 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16554 relaxation.
16555 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16556 support for section-plus-offset dynamic table entries.
16557 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16558 (Output_data_dynamic::Dynamic_entry): Add support for
16559 section-plus-offset dynamic table entries.
16560 (Output_data_dynamic::Classification): Likewise.
16561 (Output_data_dynamic::classification_): Renamed offset_.
16562 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16563 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16564 (Target_x86_64::make_plt_section): New function.
16565 (Target_x86_64::reserve_tlsdesc_entries): New function.
16566 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16567 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16568 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16569 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16570 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16571 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16572 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16573 add extra PLT entry for TLS descriptors.
16574 (Output_data_plt_x86_64::got_): New field.
16575 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16576 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16577 fields.
16578 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16579 descriptors.
16580 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16581 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16582 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16583 R_386_TLS_DESC_CALL relocations.
16584 (Target_x86_64::Scan::global): Likewise.
16585 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16586 for TLS descriptors.
16587 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16588 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16589 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16590 GD-to-IE relaxation.
16591 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16592 and TLS_DESCRIPTORS.
16593 * Makefile.in: Rebuild.
16594 * configure: Rebuild.
16595 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16596 (tls_test_shared2.so): New target.
16597 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16598 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16599 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16600 (tls_shared_gd_to_ie_test_LDADD): New variable.
16601 (tls_shared_gnu2_gd_to_ie_test): New target.
16602 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16603 New targets.
16604 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16605 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16606 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16607 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16608 (tls_shared_gnu2_test): New target.
16609 (tls_test_gnu2_shared.so): New target.
16610 (tls_shared_gnu2_test_SOURCES): New variable.
16611 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16612 (tls_shared_gnu2_test_LDFLAGS): New variable.
16613 (tls_shared_gnu2_test_LDADD): New variable.
16614 * testsuite/Makefile.in: Rebuild.
16615 * testsuite/Makefile.
16616
83bfb6b7
ILT
166172008-04-11 Ian Lance Taylor <iant@google.com>
16618
16619 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16620 justsyms.t.
16621 * testsuite/Makefile.in: Rebuild.
16622
16623 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16624 long.
16625 * testsuite/script_test_2.cc (main): Adjust test.
16626
706e1f5e
ILT
166272008-04-11 David S. Miller <davem@davemloft.net>
16628 Ian Lance Taylor <iant@google.com>
16629
16630 * options.h (General_options): Add entries for '-Y' and
16631 '-relax'.
16632 * options.cc (General_options:finalize): If -Y was used, add those
16633 entries to the library path instead of the default "/lib" and
16634 "/usr/lib".
16635
7c98e6bb
DM
166362008-04-11 David S. Miller <davem@davemloft.net>
16637
16638 * testsuite/justsyms.t: Start at 0x100.
16639 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16640 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16641 long.
16642 * testsuite/script_test_2.cc: Adjust string and section length
16643 checks.
7c98e6bb 16644
99a37bfd
ILT
166452008-04-09 Ian Lance Taylor <iant@google.com>
16646
2cefc357
ILT
16647 PR gold/5996
16648 * script-sections.cc (Sections_element::allocate_to_segment): Add
16649 orphan parameter.
16650 (Output_section_definition::allocate_to_segment): Likewise.
16651 (Orphan_output_section::allocate_to_segment): Likewise.
16652 (Script_sections::attach_sections_using_phdrs_clause): Don't
16653 propagate non-PT_LOAD segments to orphan sections.
16654 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16655 readelf rather than objdump.
16656 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16657 .interp section and PT_INTERP segment are the same size.
16658 * testsuite/Makefile.in: Rebuild.
16659
99a37bfd
ILT
16660 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16661 aliases for symbols defined in the same object.
16662 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16663 (weak_alias_test_SOURCES): New variable.
16664 (weak_alias_test_DEPENDENCIES): New variable.
16665 (weak_alias_test_LDFLAGS): New variable.
16666 (weak_alias_test_LDADD): New variable.
16667 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16668 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16669 (weak_alias_test_3.o): New target.
16670 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16671 * testsuite/weak_alias_test_main.cc: New file.
16672 * testsuite/weak_alias_test_1.cc: New file.
16673 * testsuite/weak_alias_test_2.cc: New file.
16674 * testsuite/weak_alias_test_3.cc: New file.
16675
780e49c5
ILT
166762008-04-08 Ian Lance Taylor <iant@google.com>
16677
cdb0b8f5
ILT
16678 * options.h (class General_options): Add --noinhibit-exec option.
16679 * main.cc (main): Check --noinhibit-exec.
16680
0864d551
ILT
16681 * options.h (class General_options): Define --wrap as a special
16682 option. Add wrap_symbols_ field.
16683 (General_options::any_wrap_symbols): New function.
16684 (General_options::is_wrap_symbol): New function.
16685 * options.cc (General_options::parse_wrap): New function.
16686 (General_options::General_options): Initialize wrap_symbols_.
16687 * symtab.cc (Symbol_table::wrap_symbol): New function.
16688 (Symbol_table::add_from_object): Handle --wrap.
16689 * symtab.h (class Symbol_table): Declare wrap_symbol.
16690 * target.h (Target::wrap_char): New function.
16691 (Target::Target_info): Add wrap_char field.
16692 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16693 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16694 * testsuite/testfile.cc (Target_test::test_target_info):
16695 Likewise.
16696
789aa6de
ILT
16697 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16698 there is one.
16699
2c38906f
ILT
16700 * layout.h (class Layout): Add added_eh_frame_data_ field.
16701 * layout.cc (Layout::Layout): Initialize new field.
16702 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16703 output section until we find a section we merged successfully.
16704 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16705 that the size be non-zero.
16706
780e49c5
ILT
16707 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16708 qualifier.
16709
7fcd0256
ILT
167102008-04-08 Craig Silverstein <csilvers@google.com>
16711
16712 * configure.ac: Export new conditional variable HAVE_ZLIB.
16713 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16714 on HAVE_ZLIB.
16715 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16716 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16717
6835af53
ILT
167182008-04-07 Ian Lance Taylor <iant@google.com>
16719
e24f324c
ILT
16720 * version.cc (version_string): Set to "1.5".
16721
a036edd8
ILT
16722 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16723 Add issued_non_pic_error_ field. Declare check_non_pic.
16724 (Target_x86_64::Scan::check_non_pic): New function.
16725 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16726 (Target_x86_64::Scan::global): Likewise.
16727
624f8810
ILT
16728 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16729 addend parameter. Change caller. Handle merge sections.
16730 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16731 Address to Addend. Don't add in the result of
16732 local_section_offset, pass down the addend and use the returned
16733 value.
16734 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16735 Update declarations of local_section_offset and symbol_value.
16736 * testsuite/two_file_test_1.cc (t18): New function.
16737 * testsuite/two_file_test_2.cc (f18): New function.
16738 * testsuite/two_file_test_main.cc (main): Call t18.
16739 * testsuite/two_file_test.h (t18, f18): Declare.
16740
6835af53
ILT
16741 * configure.ac: Don't test for objdump, c++filt, or readelf.
16742 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16743 conditionals.
16744 (TEST_READELF): New variable.
16745 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16746 (check_PROGRAMS): Add two_file_strip_test.
16747 (two_file_strip_test): New target.
16748 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16749 (two_file_same_shared_strip_test_SOURCES): New variable.
16750 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16751 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16752 (two_file_same_shared_strip_test_LDADD): New variable.
16753 (two_file_shared_strip.so): New target.
16754 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16755 (ver_test_5.syms, ver_test_7.syms): Likewise.
16756 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16757 (strip_test_3.stdout): Use TEST_OBJDUMP.
16758 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16759
86925eef
CC
167602008-04-04 Cary Coutant <ccoutant@google.com>
16761
16762 * symtab.h (Symbol::is_weak_undefined): New function.
16763 (Symbol::is_strong_undefined): New function.
16764 (Symbol::is_absolute): New function.
16765 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16766 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16767 absolute symbols.
16768 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16769 (weak_undef_test): New target.
16770 * testsuite/Makefile.in: Rebuild.
16771 * testsuite/weak_undef_file1.cc: New file.
16772 * testsuite/weak_undef_file2.cc: New file.
16773 * testsuite/weak_undef_test.cc: New file.
16774
126f3ece
ILT
167752008-04-03 Craig Silverstein <csilvers@google.com>
16776
16777 * compressed_output.h (class Output_compressed_section): Use
16778 unsigned buffer.
16779 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16780 add zlib header.
16781 (zlib_compressed_suffix): Removed.
16782 (Output_compressed_section::set_final_data_size): Use unsigned
16783 buffers.
16784 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16785 Fix linker invocation.
16786 (flagstest_o_specialfile_and_compress_debug_sections):
16787 Likewise.
16788 * testsuite/Makefile.in: Regenerated.
16789
deae2a14
DM
167902008-04-02 David S. Miller <davem@davemloft.net>
16791
16792 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16793 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16794
70752818
ILT
167952008-04-02 Craig Silverstein <csilvers@google.com>
16796
16797 * TODO: New file.
16798
39d0cb0e
ILT
167992008-04-02 Ian Lance Taylor <iant@google.com>
16800
16801 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16802 parameters. Update for new key type to views_. Change all
16803 callers.
16804 (File_read::read): Adjust for byteshift in returned view.
16805 (File_read::add_view): New function, broken out of
16806 find_and_make_view.
16807 (File_read::make_view): New function, broken out of
16808 find_and_make_view.
16809 (File_read::find_or_make_view): Add offset and aligned
16810 parameters. Rewrite accordingly. Change all callers.
16811 (File_read::get_view): Add offset and aligned parameters. Adjust
16812 for byteshift in return value.
16813 (File_read::get_lasting_view): Likewise.
16814 * fileread.h (class File_read): Update declarations.
16815 (class File_read::View): Add byteshift_ field. Add byteshift to
16816 constructor. Add byteshift method.
16817 * archive.h (Archive::clear_uncached_views): New function.
16818 (Archive::get_view): Add aligned parameter. Change all callers.
16819 * object.h (Object::get_view): Add aligned parameter. Change all
16820 callers.
16821 (Object::get_lasting_view): Likewise.
16822
16823 * fileread.cc (File_read::release): Don't call clear_views if
16824 there are multiple objects.
16825 * fileread.h (File_read::clear_uncached_views): New function.
16826 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16827 on the archive.
16828
a1207466
CC
168292008-03-31 Cary Coutant <ccoutant@google.com>
16830
16831 Add thin archive support.
16832 * archive.cc (Archive::armagt): New const.
16833 (Archive::setup): Remove task parameter and calls to unlock.
16834 (Archive::unlock_nested_archives): New function.
16835 (Archive::read_header): Add nested_off parameter. Change
16836 all callers.
16837 (Archive::interpret_header): Likewise.
16838 (Archive::include_all_members): Change to handle thin
16839 archives.
16840 (Archive::include_member): Likewise.
16841 * archive.h (Archive::Archive): Add new parameters and
16842 initializers.
16843 (Archive::armagt): New const.
16844 (Archive::setup): Remove task parameter.
16845 (Archive::unlock_nested_archives): New function.
16846 (Archive::read_header): Add nested_off parameter.
16847 (Archive::interpret_header): Likewise.
16848 (Archive::Nested_archive_table): New typedef.
16849 (Archive::is_thin_archive_): New field.
16850 (Archive::nested_archives_): New field.
16851 (Archive::options_): New field.
16852 (Archive::dirpath_): New field.
16853 (Archive::task_): New field.
16854 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16855 for thin archives. Pass additional parameters to
16856 Archive::Archive. Unlock the archive file after calling
16857 Archive::setup.
cd536b21 16858
479f6503
ILT
168592008-03-29 Ian Lance Taylor <iant@google.com>
16860
686c8caf
ILT
16861 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16862 version symbol to be local.
16863 * testsuite/ver_test_4.sh: New file.
16864 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16865 (check_DATA): Add ver_test_4.syms.
16866 (ver_test_4.syms): New target.
16867 * testsuite/Makefile.in: Rebuild.
16868
ab794b6b
ILT
16869 * output.cc
16870 (Output_section::Input_section_sort_entry::has_priority): New
16871 function.
16872 (Output_section::Input_section_sort_entry::match_file_name): New
16873 function.
16874 (Output_section::Input_section_sort_entry::match_section_name):
16875 Remove.
16876 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16877 Remove.
16878 (Output_section::Input_section_sort_entry::match_section_file):
16879 Remove.
16880 (Output_section::Input_section_sort_compare::operator()): Rewrite
16881 using new Input_section_sort_entry functions. Sort crtbegin and
16882 crtend first. Sort sections with no priority before sections with
16883 a priority.
16884 * testsuite/initpri1.c (d3): Check j != 4.
16885 (cd5): New constructor/destructor function.
16886 (main): Check j != 2.
16887
479f6503
ILT
16888 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16889 new symbol when resolving, don't call set_is_default.
16890 * testsuite/ver_test_7.cc: New file.
16891 * testsuite/ver_test_7.sh: New file.
16892 * testsuite/Makefile.am (ver_test_7.so): New target.
16893 (ver_test_7.o): New target.
16894 (check_SCRIPTS): Add ver_test_7.sh.
16895 (check_DATA): Add ver_test_7.syms.
16896 (ver_test_7.syms): New target.
16897
2fd32231
ILT
168982008-03-28 Ian Lance Taylor <iant@google.com>
16899
16900 * layout.cc (Layout::layout): If we see an input section with a
16901 name that needs sorting, set the must_sort flag for the output
16902 section.
16903 (Layout::make_output_section): If the name of the output section
16904 indicates that it might require sorting, set the may_sort flag.
16905 * output.h (Output_section::may_sort_attached_input_sections): New
16906 function.
16907 (Output_section::set_may_sort_attached_input_sections): New
16908 function.
16909 (Output_section::must_sort_attached_input_sections): New
16910 function.
16911 (Output_section::set_must_sort_attached_input_sections): New
16912 function.
16913 (class Output_section): Declare Input_section_sort_entry. Define
16914 Input_section_sort_compare. Declare
16915 sort_attached_input_sections. Add new fields:
16916 may_sort_attached_input_sections_,
16917 must_sort_attached_input_sections_,
16918 attached_input_sections_are_sorted_.
16919 * output.cc (Output_section::Output_section): Initialize new
16920 fields.
16921 (Output_section::add_input_section): Add an entry to
16922 input_sections_ if may_sort or must_sort are true.
16923 (Output_section::set_final_data_size): Call
16924 sort_attached_input_sections if necessary.
16925 (Output_section::Input_section_sort_entry): Define new class.
16926 (Output_section::Input_section_sort_compare::operator()): New
16927 function.
16928 (Output_section::sort_attached_input_sections): New function.
16929 * configure.ac: Check whether the compiler supports constructor
16930 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16931 * testsuite/initpri1.c: New file.
16932 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16933 CONSTRUCTOR_PRIORITY.
16934 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16935 (initpri1_LDFLAGS): New variable.
16936 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16937
18e6b24e
ILT
169382008-03-27 Ian Lance Taylor <iant@google.com>
16939
49bdd526
ILT
16940 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16941 * testsuite/common_test_1.c: New file.
16942 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16943 (common_test_1_SOURCES): New variable.
16944 (common_test_1_DEPENDENCIES): New variable.
16945 (common_test_1_LDFLAGS): New variable.
16946
18e6b24e
ILT
16947 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16948 and commons_ correctly when NAME/VERSION does not override
16949 NAME/NULL.
16950 * testsuite/ver_test_6.c: New file.
16951 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16952 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16953 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16954
04bf7072
ILT
169552008-03-26 Ian Lance Taylor <iant@google.com>
16956
5871526f
ILT
16957 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16958 of an undefined symbol from a version script.
16959 * testsuite/Makefile.am (ver_test_5.so): New target.
16960 (ver_test_5.o): New target.
16961 (check_SCRIPTS): Add ver_test_5.sh.
16962 (check_DATA): Add ver_test_5.syms.
16963 (ver_test_5.syms): New target.
16964 * testsuite/ver_test_5.cc: New file.
16965 * testsuite/ver_test_5.script: New file.
16966 * testsuite/ver_test_5.sh: New file.
16967 * Makefile.in, testsuite/Makefile.in: Rebuild.
16968
04bf7072
ILT
16969 PR gold/5986
16970 Fix problems building gold with gcc 4.3.0.
16971 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16972 (gold_error_at_location, gold_warning_at_location): Use it.
16973 * configure.ac: Check whether we can compile and use a template
16974 function with a printf attribute.
16975 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16976 when jumping over bytes.
16977 * object.cc: Instantiate Object::read_section_data.
16978 * debug.h: Include <cstring>
16979 * dwarf_reader.cc: Include <algorithm>
16980 * main.cc: Include <cstring>.
16981 * options.cc: Include <cstring>.
16982 * output.cc: Include <cstring>.
16983 * script.cc: Include <cstring>.
16984 * script.h: Include <string>.
16985 * symtab.cc: Include <cstring> and <algorithm>.
16986 * target-select.cc: Include <cstring>.
16987 * version.cc: Include <string>.
16988 * testsuite/testmain.cc: Include <cstdlib>.
16989 * configure, config.in: Rebuild.
16990
874c5b28
ILT
169912008-03-25 Ian Lance Taylor <iant@google.com>
16992
819d6c3a
ILT
16993 * options.cc: Include "../bfd/bfdver.h".
16994 (options::help): Print bug reporting address.
16995
f4b2c6f5
ILT
16996 * version.cc (print_version): Adjust output for current value of
16997 BFD_VERSION_STRING.
16998
16999 * NEWS: New file.
17000
e96caa79
ILT
17001 * options.cc (options::help): Print list of supported targets.
17002 * target-select.h: Include <vector>.
17003 (class Target_selector): Make machine_, size_, and is_big_endian_
17004 fields const. Add bfd_name_ and instantiated_target_ fields.
17005 (Target_selector::Target_selector): Add bfd_name parameter.
17006 (Target_selector::recognize): Make non-virtual, call
17007 do_recognize.
17008 (Target_selector::recognize_by_name): Make non-virtual, call
17009 do_recognize_by_name.
17010 (Target_selector::supported_names): New function.
17011 (Target_selector::bfd_name): New function.
17012 (Target_selector::do_instantiate_target): New pure virtual
17013 function.
17014 (Target_selector::do_recognize): New virtual function.
17015 (Target_selector::do_recognize_by_name): New virtual function.
17016 (Target_selector::instantiate_target): New private function.
17017 (supported_target_names): Declare.
17018 * target-select.cc (Target_selector::Target_selector): Update for
17019 new parameter and fields.
17020 (select_target_by_name): Check that the name matches before
17021 calling recognize_by_name.
17022 (supported_target_names): New function.
17023 * i386.cc (class Target_selector_i386): Update Target_selector
17024 constructor call. Remove recognize and recognize_by_name. Add
17025 do_instantiate_target.
17026 * x86_64.cc (class Target_selector_x86_64): Likewise.
17027 * testsuite/testfile.cc (class Target_selector_test): Update for
17028 changes to Target_selector.
17029
874c5b28
ILT
17030 * README: Rewrite, with some notes on unsupported features.
17031
0a65a3a7
CC
170322008-03-24 Cary Coutant <ccoutant@google.com>
17033
17034 * i386.cc (Target_i386::Got_type): New enum declaration.
17035 (Target_i386::Scan::local): Updated callers of Output_data_got
17036 member functions.
17037 (Target_i386::Scan::global): Likewise.
17038 (Target_i386::Relocate::relocate): Likewise.
17039 (Target_i386::Relocate::relocate_tls): Likewise.
17040 * object.h (Got_offset_list): New class.
17041 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17042 (Sized_relobj::local_got_offset): Likewise.
17043 (Sized_relobj::set_local_got_offset): Likewise.
17044 (Sized_relobj::local_has_tls_got_offset): Removed.
17045 (Sized_relobj::local_tls_got_offset): Removed.
17046 (Sized_relobj::set_local_tls_got_offset): Removed.
17047 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17048 * output.cc (Output_data_got::add_global): Added got_type parameter.
17049 (Output_data_got::add_global_with_rel): Likewise.
17050 (Output_data_got::add_global_with_rela): Likewise.
17051 (Output_data_got::add_global_pair_with_rel): New function.
17052 (Output_data_got::add_global_pair_with_rela): New function.
17053 (Output_data_got::add_local): Added got_type parameter.
17054 (Output_data_got::add_local_with_rel): Likewise.
17055 (Output_data_got::add_local_with_rela): Likewise.
17056 (Output_data_got::add_local_pair_with_rel): New function.
17057 (Output_data_got::add_local_pair_with_rela): New function.
17058 (Output_data_got::add_global_tls): Removed.
17059 (Output_data_got::add_global_tls_with_rel): Removed.
17060 (Output_data_got::add_global_tls_with_rela): Removed.
17061 (Output_data_got::add_local_tls): Removed.
17062 (Output_data_got::add_local_tls_with_rel): Removed.
17063 (Output_data_got::add_local_tls_with_rela): Removed.
17064 * output.h (Output_data_got::add_global): Added got_type parameter.
17065 (Output_data_got::add_global_with_rel): Likewise.
17066 (Output_data_got::add_global_with_rela): Likewise.
17067 (Output_data_got::add_global_pair_with_rel): New function.
17068 (Output_data_got::add_global_pair_with_rela): New function.
17069 (Output_data_got::add_local): Added got_type parameter.
17070 (Output_data_got::add_local_with_rel): Likewise.
17071 (Output_data_got::add_local_with_rela): Likewise.
17072 (Output_data_got::add_local_pair_with_rel): New function.
17073 (Output_data_got::add_local_pair_with_rela): New function.
17074 (Output_data_got::add_global_tls): Removed.
17075 (Output_data_got::add_global_tls_with_rel): Removed.
17076 (Output_data_got::add_global_tls_with_rela): Removed.
17077 (Output_data_got::add_local_tls): Removed.
17078 (Output_data_got::add_local_tls_with_rel): Removed.
17079 (Output_data_got::add_local_tls_with_rela): Removed.
17080 * resolve.cc (Symbol::override_base_with_special): Removed
17081 reference to has_got_offset_ field.
17082 * symtab.cc (Symbol::init_fields): Replaced initialization
17083 of got_offset_ with got_offsets_. Removed initialization
17084 of has_got_offset_
53fcba31 17085 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17086 (Symbol::got_offset): Likewise.
17087 (Symbol::set_got_offset): Likewise.
17088 (Symbol::has_tls_got_offset): Removed.
17089 (Symbol::tls_got_offset): Removed.
17090 (Symbol::set_tls_got_offset): Removed.
17091 (Symbol::got_offset_): Removed.
17092 (Symbol::tls_mod_got_offset_): Removed.
17093 (Symbol::tls_pair_got_offset_): Removed.
17094 (Symbol::got_offsets_): New field.
17095 (Symbol::has_got_offset): Removed.
17096 (Symbol::has_tls_mod_got_offset): Removed.
17097 (Symbol::has_tls_pair_got_offset): Removed.
17098 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17099 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17100 member functions.
17101 (Target_x86_64::Scan::global): Likewise.
17102 (Target_x86_64::Relocate::relocate): Likewise.
17103 (Target_x86_64::Relocate::relocate_tls): Likewise.
17104
bd52eafb
BE
171052008-03-25 Ben Elliston <bje@au.ibm.com>
17106
17107 * yyscript.y: Fix spelling error in comment.
17108
8b105e34
ILT
171092008-03-24 Ian Lance Taylor <iant@google.com>
17110
8ed814a9
ILT
17111 * options.h (class General_options): Define build_id option.
17112 * layout.h (class Layout): Declare write_build_id, create_note,
17113 create_build_id. Add build_id_note_ member.
17114 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17115 "libiberty.h", "md5.h", "sha1.h".
17116 (Layout::Layout): Initialize eh_frame_data_,
17117 eh_frame_hdr_section_, and build_id_note_.
17118 (Layout::finalize): Call create_build_id.
17119 (Layout::create_note): New function, broken out of
17120 Layout::create_gold_note.
17121 (Layout::create_gold_note): Call create_note.
17122 (Layout::create_build_id): New function.
17123 (Layout::write_build_id): New function.
17124 (Close_task_runner::run): Call write_build_id.
17125
8b105e34
ILT
17126 * x86_64.cc: Correct license to GPLv3.
17127
086a1841
ILT
171282008-03-23 Ian Lance Taylor <iant@google.com>
17129
17130 * options.cc: Include "demangle.h".
17131 (parse_optional_string): New function.
17132 (parse_long_option): Handle takes_optional_argument.
17133 (parse_short_option): Update dash_z initializer. Handle
17134 takes_optional_argument.
17135 (General_options::General_options): Initialize do_demangle_.
17136 (General_options::finalize): Set do_demangle_. Handle demangling
17137 style.
17138 * options.h (parse_optional_string): Declare.
17139 (struct One_option): Add optional_arg field. Update constructor.
17140 Update call constructor calls. Add takes_optional_argument
17141 function.
17142 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17143 (DEFINE_optional_string): Define.
17144 (General_options::demangle): Change from DEFINE_bool to
17145 DEFINE_optional_string.
17146 (General_options::no_demangle): New function.
17147 (General_options::do_demangle): New function.
17148 (General_options::set_do_demangle): New function.
17149 (General_options::execstack_status_): Move definition to end of
17150 class definition.
17151 (General_options::static_): Likewise.
17152 (General_options::do_demangle_): New field.
17153 * object.cc (big_endian>::get_symbol_location_info): Call
17154 Options::do_demangle, not Options::demangle.
17155 * symtab.cc (demangle): Likewise.
17156
cbb93e63
ILT
171572008-03-22 Ian Lance Taylor <iant@google.com>
17158
17159 * gold.h: Include <cstddef> and <sys/types.h>
17160 * options.h: Include <cstring>.
17161
ec531623
ILT
171622008-03-21 Ian Lance Taylor <iant@google.com>
17163
17164 * Added source code to GNU binutils.
752937aa 17165\f
b90efa5b 17166Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17167
17168Copying and distribution of this file, with or without modification,
17169are permitted in any medium without royalty provided the copyright
17170notice and this notice are preserved.
17171
17172Local Variables:
17173mode: change-log
17174left-margin: 8
17175fill-column: 74
17176version-control: never
17177End: