Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
4277535c
RÁE
12015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
4 push_back.
5 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
6 * object.cc (Sized_relobj_file::do_layout): Use push_back.
7 * powerpc.cc (process_gc_mark): Use push_back.
8 (Target_powerpc::do_gc_mark_symbol): Use push_back.
9 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
10
5019d64a
HS
112015-04/16 Han Shen <shenhan@google.com>
12
13 * aarch64.cc (AArch64_insn_utilities): New utility class.
14 (AArch64_relobj::Mapping_symbol_position): New struct.
15 (AArch64_relobj::Mapping_symbol_info): New typedef.
16 (AArch64_relobj::do_count_local_symbols): New function overriding
17 parent's implementation.
18 (AArch64_relobj::mapping_symbol_info_): New member
19 (AArch64_relobj::scan_erratum_843419): New method.
20 (Target_aarch64::scan_erratum_843419_span): New method.
21 (Target_aarch64::is_erratum_843419_sequence): New method.
22 * options.h (fix_cortex_a53): New option.
23
a6a17750
CC
242015-04-09 Cary Coutant <ccoutant@google.com>
25
26 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
27 in a PIE link.
28 * testsuite/Makefile.am (tls_pie_test.sh): New test.
29 * testsuite/Makefile.in: Regenerate.
30 * testsuite/tls_pie_test.sh: New.
31
437ddf0c
CC
322015-04-09 Cary Coutant <ccoutant@google.com>
33
34 * debug.h (DEBUG_LOCATION): New.
35 (DEBUG_ALL): Include DEBUG_LOCATION.
36 (debug_string_to_enum): Add DEBUG_LOCATION.
37 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
38 output to print correct context.
39 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
40 up to 4 more locations at the beginning of the function.
41 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
42 result before sorting list of line numbers.
43 * testsuite/debug_msg.sh: Allow range of line numbers for
44 canonical results on optimized code.
45
24491327
HS
462015-04-07 HC Yen <hc.yen@mediatek.com>
47
48 Add AArch32 support for gold linker.
49 gold/
50 * arm.cc: Add V8 arch combine table.
51
7fa5525f
RÁE
522015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
53
54 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
55
5368dcf2
RÁE
562015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
57
58 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
59 to find by using the return value of insert.
60
9dbb4b02
RÁE
612015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
62
63 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
64 constructor call.
65
1fa29f10
IT
662015-04-06 Ilya Tocar <ilya.tocar@intel.com>
67
68 PR gold/17641
69 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
70 (Target_x86_64::Scan::local): Don't create GOT entry, when we
71 can convert mov to lea.
72 (Target_x86_64::Scan::global): Ditto.
73 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
74 %reg to lea foo(%rip), %reg if possible.
75 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
76 * testsuite/x86_64_mov_to_lea1.s: New.
77 * testsuite/x86_64_mov_to_lea2.s: Ditto.
78 * testsuite/x86_64_mov_to_lea3.s: Ditto.
79 * testsuite/x86_64_mov_to_lea4.s: Ditto.
80 * testsuite/x86_64_mov_to_lea.sh: Ditto.
81
39f3de7c
L
822015-04-02 H.J. Lu <hongjiu.lu@intel.com>
83
84 * configure: Regenerated.
85
c4fc4724
IT
862015-04-01 Ilya Tocar <ilya.tocar@intel.com>
87
88 PR gold/17640
89 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
90 (Target_i386::Scan::local): Don't create GOT entry, when we
91 can convert GOT to GOTOFF.
92 (Target_i386::Scan::global): Ditto.
93 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
94 lea foo@GOTOFF(%reg), %reg if possible.
95 * testsuite/Makefile.am (i386_mov_to_lea): New test.
96 * testsuite/i386_mov_to_lea1.s: New.
97 * testsuite/i386_mov_to_lea2.s: Ditto.
98 * testsuite/i386_mov_to_lea3.s: Ditto.
99 * testsuite/i386_mov_to_lea4.s: Ditto.
100 * testsuite/i386_mov_to_lea5.s: Ditto.
101 * testsuite/i386_mov_to_lea.sh: Ditto.
102
918357b9
L
1032015-04-01 H.J. Lu <hongjiu.lu@intel.com>
104
105 * Makefile.am (ZLIB): New.
106 (ZLIBINC): Likewise.
107 (AM_CFLAGS): Add $(ZLIBINC).
108 (AM_CXXFLAGS): Likewise.
109 (ldadd_varldadd_var): Add $(ZLIB).
110 (incremental_dump_LDADD): Likewise.
111 (dwp_LDADD): Likewise.
112 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
113 <zlib.h>.
114 (zlib_compress): Don't check HAVE_ZLIB_H.
115 (zlib_decompress): Likewise.
116 * options.h (compress_debug_sections): Likewise.
117 * configure.ac (AM_CONDITIONAL): Removed.
118 * testsuite/Makefile.am (ZLIB): New.
119 (LDADD): Add $(ZLIB).
120 Don't check HAVE_ZLIB.
121 * Makefile.in: Regenerated.
122 * config.in: Likewise.
123 * configure: Likewise.
124 * testsuite/Makefile.in: Likewise.
125
6b0ad2eb
JY
1262015-03-30 Jing Yu <jingyu@google.com>
127
128 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
129 TLSLD_ADD_DTPREL_LO12_NC.
130 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
131 _TLS_MODULE_BASE_ point to the start of tls segment.
132 (Target_aarch64::optimize_tls_reloc): Add cases for
133 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
134 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
135 (Target_aarch64::Scan::local): Likewise.
136 (Target_aarch64::Scan::global): Likewise.
137 (Target_aarch64::Relocate::relocate): Likewise.
138 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
139 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
140 relocations.
141
0916f9e7
RÁE
1422015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
143
144 * merge.cc (Object_merge_map::add_mapping): call
145 Object_merge_map::Input_merge_map::add_mapping.
146 (Object_merge_map::Input_merge_map::add_mapping): New.
147 (Output_merge_data::do_add_input_section): Call
148 get_or_make_input_merge_map before a loop.
149 (Output_merge_string<Char_type>::finalize_merged_data): Call
150 get_or_make_input_merge_map before a loop.
151 * merge.h (Object_merge_map): Make Input_merge_map public.
152 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
153 (Relobj::get_or_create_merge_map): New.
154 * object.h (Relobj::get_or_create_merge_map): New.
155
282c9750
AM
1562015-03-24 Alan Modra <amodra@gmail.com>
157
158 PR 18147
159 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
160 relocation errors for branches to strong undefined symbols.
161
67f95b96
RÁE
1622015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
163
164 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
165 (Object_merge_map::is_merge_section_for): Remove.
166 (Object_merge_map::find_merge_section): New.
167 * merge.h (Object_merge_map::is_merge_section_for): Remove.
168 (Object_merge_map::find_merge_section): New.
169 (Object_merge_map::get_input_merge_map): Add a const version.
170 * object.cc (Relobj::is_merge_section_for): Remove.
171 (Relobj::find_merge_section): New.
172 * object.h (Relobj::is_merge_section_for): Remove.
173 (Relobj::find_merge_section): New.
174 * output.cc
175 (Output_section::Input_section::is_merge_section_for): Remove.
176 (Output_section::add_merge_input_section): Don't call
177 add_merge_input_section.
178 (Output_section::find_merge_section): Return const. Use
179 object->find_merge_section.
180 (Output_section::build_lookup_maps): Don't build a map for
181 merge sections.
182 (Output_section::is_input_address_mapped): Return false if
183 section is not found.
184 (Output_section::find_starting_output_address): Use
185 find_merge_section instead of is_merge_section_for.
186 (Output_section::add_script_input_section): Don't build a map for
187 merge sections.
188 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
189 (Output_section_lookup_maps::find_merge_section): Remove.
190 (Output_section_lookup_maps::add_merge_input_section) Remove.
191 (Output_section::find_merge_section): Return const.
192
152f7024
CC
1932015-03-22 Cary Coutant <cary@google.com>
194
195 PR gold/18106
196 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
197 non-SIB form of lea, with nop after the call.
198
bccffdfd
CC
1992015-03-21 Cary Coutant <cary@google.com>
200
201 PR gold/14217
202 * output.cc (Output_segment::is_first_section_relro): Don't ignore
203 .tdata section.
204 (Output_segment::set_section_addresses): Don't align size of relro
205 segment for .tbss.
206
1c582fe7
CC
2072015-03-21 Cary Coutant <cary@google.com>
208
209 PR gold/18010
210 * stringpool.cc (Stringpool_template): Don't optimize if section
211 alignment is greater than sizeof(char).
212
410da591
CC
2132015-03-21 Cary Coutant <cary@google.com>
214
215 PR gold/18048
216 * script-c.h (script_include_directive): Add first_token parameter.
217 * script.cc (script_include_directive): Add first_token parameter, and
218 pass it to read_script_file.
219 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
220 (PARSING_MEMORY_DEF): New tokens.
221 (top): Add new productions for INCLUDE files.
222 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
223 Pass PARSING_LINKER_SCRIPT to script_include_directive.
224 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
225 (section_cmd): Pass PARSING_SECTION_CMDS.
226 (file_or_sections_cmd): Remove.
227 (memory_def): Pass PARSING_MEMORY_DEF.
228 * testsuite/Makefile.am (memory_test_2): New test.
229 * testsuite/Makefile.in: Regenerate.
230 * testsuite/memory_test_inc.t: New script file.
231 * testsuite/memory_test_inc_1.t.src: New script file.
232 * testsuite/memory_test_inc_2.t.src: New script file.
233 * testsuite/memory_test_inc_3.t.src: New script file.
234
0d5bbdb0
CC
2352015-03-21 Cary Coutant <cary@google.com>
236
237 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
238 (Sized_relobj_dwo::setup): Build compressed section map.
239 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
240 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
241 section map.
242 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
243 compressed_sections_ field.
244 (build_compressed_section_map): Take Object instead of
245 Sized_relobj_file parameter; add decompress_if_needed parameter.
246 (Sized_relobj_file::do_find_special_sections): Store compressed
247 section map in parent Object.
248 (Sized_relobj_file::do_decompressed_section_contents): Move
249 implementation to Object::decompressed_section_contents.
250 (Sized_relobj_file::do_discard_decompressed_sections): Move
251 implementation to Object::discard_decompressed_sections.
252 * object.h (build_compressed_section_map): Declare.
253 (Object::Object): Add compressed_sections_ field.
254 (Object::section_is_compressed): Move implementation here.
255 (Object::decompressed_section_contents): De-virtualize.
256 (Object::discard_decompressed_sections): De-virtualize.
257 (Object::do_section_is_compressed): Delete.
258 (Object::do_decompressed_section_contents): Delete.
259 (Object::set_compressed_sections): New method.
260 (Object::compressed_sections): New method.
261 (Object::compressed_sections_): New data member.
262 (Compressed_section_info, Compressed_section_map): Move to top of file.
263 (Sized_relobj_file::do_section_is_compressed): Delete.
264 (Sized_relobj_file::do_decompressed_section_contents): Delete.
265 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
266 (Sized_relobj_file::compressed_sections_): Move to Object class.
267
bd9e0d46
CC
2682015-03-21 Cary Coutant <ccoutant@google.com>
269
270 PR gold/18152
271 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
272 deferred objects.
273
943c8b43
CC
2742015-03-11 Cary Coutant <ccoutant@google.com>
275
276 * options.cc (General_options::finalize): Don't allow -z relro
277 with incremental linking.
278 * testsuite/Makefile.am (incremental_test): Add -z norelro.
279 (incremental_test_2): Likewise.
280 (incremental_test_3): Likewise.
281 (incremental_test_4): Likewise.
282 (incremental_test_5): Likewise.
283 (incremental_test_6): Likewise.
284 (incremental_copy_test): Likewise.
285 (incremental_common_test_1): Likewise.
286 (incremental_comdat_test_1): Likewise.
287 * testsuite/Makefile.in: Regenerate.
288
e1663197
CC
2892015-03-09 Cary Coutant <ccoutant@google.com>
290
291 PR gold/14675
292 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
293 return enum indicating whether .eh_frame section is empty, optimizable,
294 unrecognized, or an end marker. Adjust explicit instantiations.
295 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
296 (Eh_frame::add_ehframe_input_section): Change return type.
297 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
298 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
299 to the .eh_frame output section until we see the end marker.
300 (Layout::finalize_eh_frame_section): New.
301 * layout.h: (Layout::finalize_eh_frame_section): New.
302
beb8418f
L
3032015-03-05 H.J. Lu <hongjiu.lu@intel.com>
304
305 * output.cc (Relobj::initialize_input_to_output_map<size>):
306 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
307
48c73428
CC
3082015-03-04 Cary Coutant <ccoutant@google.com>
309
310 * parameters.cc (Parameters::set_target_once): Call
311 Target::select_as_default_target just once from here...
312 (set_parameters_target): ...instead of from here.
313
3142015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
315
316 * ehframe.cc (Cie::set_output_offset): Pass in and use a
317 Output_section_data instead of a Merge_map.
318 (Eh_frame::Eh_frame): Don't initialize merge_map_.
319 (Eh_frame::read_cie): Use add_merge_mapping instead of
320 Merge_map::add_mapping.
321 (Eh_frame::read_fde): Ditto.
322 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
323 (Eh_frame::do_output_offset): Use merge_output_offset istead of
324 merge_map_->get_output_offset.
325 (Eh_frame::do_is_merge_section_for): Delete.
326 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
327 instead of a Merge_map.
328 (Cie::set_output_offset): Pass in a Output_section_data instead of a
329 Merge_map.
330 (Eh_frame::do_is_merge_section_for): Delete.
331 (Eh_frame::merge_map_): Delete.
332 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
333 and use a Output_section_data instead of a Merge_map.
334 (Object_merge_map::add_mapping): Ditto.
335 (Object_merge_map::get_output_offset): Remove the merge_map argument.
336 (Object_merge_map::is_merge_section_for): Pass in and use a
337 Output_section_data instead of a Merge_map.
338 (Merge_map): Delete.
339 (Output_merge_base::do_output_offset): Use merge_output_offset instead
340 of merge_map_.get_output_offset.
341 (Output_merge_base::do_is_merge_section_for): Delete.
342 (Output_merge_data::do_add_input_section): Use
343 object->add_merge_mapping instead of add_mapping.
344 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
345 * merge.h (Merge_map): Delete forward declaration.
346 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
347 instead of a Merge_map.
348 (Object_merge_map::get_output_offset): Remove the merge_map argument.
349 (Object_merge_map::is_merge_section_for): Pass in and use a
350 Output_section_data instead of a Merge_map.
351 (Input_merge_map::Object_merge_map::merge_map): Replace with
352 output_data.
353 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
354 Output_section_data instead of a Merge_map.
355 (Merge_map): Delete.
356 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
357 (Output_merge_base::do_is_merge_section_for): Delete.
358 (Output_merge_base::add_mapping): Delete.
359 (Output_merge_base::merge_map_): Delete.
360 * object.cc (Relobj::initialize_input_to_output_map): New.
361 (Relobj::initialize_input_to_output_map): New.
362 (Relobj::merge_output_offset): New.
363 (Relobj::is_merge_section_for): New.
364 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
365 bits.
366 * object.h (Relobj::merge_map): Delete.
367 (initialize_input_to_output_map): New.
368 (set_merge_map): Delete.
369 (add_merge_mapping): New.
370 (merge_output_offset): New.
371 (is_merge_section_for): New.
372 * output.cc (Output_section::Input_section::is_merge_section_for):
373 Use object->is_merge_section_for.
374 * output.h (Output_section_data::is_merge_section_for): Delete.
375 (Output_section_data::do_is_merge_section_for): Delete.
376 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
377 Use object->initialize_input_to_output_map.
378 (Merged_symbol_value<size>::value_from_output_section): Use
379 object->merge_output_offset.
380
48c73428 3812015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
382 Cary Coutant <ccoutant@google.com>
383
384 * output.cc (Output_section::add_merge_input_section): Do not
385 attempt to merge sections with an entsize of 0.
386
48c73428 3872015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
388
389 * attributes.h (class Output_attributes_section_data ): Add
390 do_print_to_mapfile function.
391
ec86f434
AM
3922015-02-24 Alan Modra <amodra@gmail.com>
393
394 PR 18010
395 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
396 complain if value is not a multiple of four.
397 (Target_powerpc::Relocate::relocate): Correct handling of
398 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
399
be66981e
L
4002015-02-21 H.J. Lu <hongjiu.lu@intel.com>
401
402 * configure.ac (default_size): Set to 32 for x32.
403 * configure: Regenerated.
404
e3ee8ed4
AM
4052015-02-18 Alan Modra <amodra@gmail.com>
406
407 PR 17954
408 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
409 visibility.
410
3a935c6c
RÁE
4112015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
412
413 * gc.h (Garbage_collection::add_reference): Don't use find.
414
e0a1e121
RÁE
4152015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
416
417 * object.cc (write_local_symbols): avoid std::vector copy.
418
45a4fb1a
RÁE
4192015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
420
421 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
422
2d9afefe
MW
4232015-02-09 Mark Wielaard <mjw@redhat.com>
424
425 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
426 DW_LANG_Fortran03 and DW_LANG_Fortran08.
427
e9c1bdad
CC
4282015-02-16 Cary Coutant <ccoutant@google.com>
429
430 PR gold/13577
431 PR gold/16992
432 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
433 DF_SYMBOLIC if --dynamic-list option is used.
434 * options.cc (General_options::finalize): --dynamic-list is not
435 mutually exclusive with -Bsymbolic.
436 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
437 listed in --dynamic-list.
438 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
439 -Bsymbolic-functions.
440 * testsuite/Makefile.in: Regenerate.
441
0ed4b0bf
CC
4422015-02-16 Cary Coutant <ccoutant@google.com>
443
444 PR gold/17971
445 * incremental.cc: Remove redundant include of "output.h".
446
1a920511
JY
4472015-02-12 Jing Yu <jingyu@google.com>
448
449 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
450 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
451 New relocation.
452 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
453 TLSLE_MOVW_* relocations.
454 (Target_aarch64::Scan::global): Likewise.
455 (Target_aarch64::Relocate::relocate): Likewise.
456 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
457 for new TLSLE_MOVW_* relocations.
458
07f107f3
WN
4592015-02-11 Will Newton <will.newton@linaro.org>
460
461 PR gold/13321
462 * arm.cc (Target_arm::make_plt_section): Create an ARM
463 state mapping symbol at the start of the PLT.
464
e051a5b5
L
4652015-02-09 H.J. Lu <hongjiu.lu@intel.com>
466
467 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
468 Replace two_file_shared_2.so with two_file_shared_1.so.
469 * testsuite/Makefile.in: Regenerated.
470
dddcc5b9
AM
4712015-02-09 Alan Modra <amodra@gmail.com>
472
473 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
474 plugin_test_thin.a and defsym_test.
475 * testsuite/Makefile.in: Regenerate.
476
b39b8b9d
RÁE
4772015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
478
479 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
480 body.
481
b66d1c52
CC
4822015-02-04 Peter Collingbourne <pcc@google.com>
483
484 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
485 forwarding symbols when computing symbol resolution info for plugins.
486 * plugin.h (Plugin_manager::symtab): New method.
487 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
488
23081de0
CC
4892015-02-03 Cary Coutant <ccoutant@google.com>
490 Peter Collingbourne <pcc@google.com>
491
492 PR gold/15660
493 * archive.cc (Thin_archive_object_unlocker): New class.
494 (Archive::include_member): Unlock external members of thin archives.
495 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
496 (plugin_test_2): Likewise.
497 (plugin_test_3): Likewise.
498 (plugin_test_4): Likewise.
499 (plugin_test_5): Likewise.
500 (plugin_test_6): Likewise.
501 (plugin_test_7): Likewise.
502 (plugin_test_8): Likewise.
503 (plugin_test_9): Likewise.
504 (plugin_test_10): Likewise.
505 (plugin_test_11): New test case.
506 * testsuite/Makefile.in: Regenerate.
507 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
508 file to decide whether to claim file.
509 (all_symbols_read_hook): Likewise.
510 * testsuite/plugin_test_1.sh: Adjust expected output.
511 * testsuite/plugin_test_2.sh: Likewise.
512 * testsuite/plugin_test_3.sh: Likewise.
513 * testsuite/plugin_test_6.sh: Likewise.
514 * testsuite/plugin_test_tls.sh: Likewise.
515 * testsuite/plugin_test_11.sh: New testcase.
516
5172015-02-03 Cary Coutant <ccoutant@google.com>
518
519 * descriptors.cc (Descriptors::open): Set artificially-low limit for
520 file descriptors when debugging enabled. Add debug output.
521 (Descriptors::release): Add debug output.
522 (Descriptors::close_some_descriptor): Likewise.
523 (Descriptors::close_all): Likewise.
524 * fileread.cc (File_read::lock): Likewise.
525 (File_read::unlock): Likewise.
526
24dd5808
CC
5272015-02-02 Cary Coutant <ccoutant@google.com>
528
529 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
530 executable output file.
531
fa89cc82
HS
5322015-01-22 Han Shen <shenhan@google.com>
533
534 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
535 (Target_arm::do_plt_address_for_global): New method.
536 (Target_arm::do_plt_address_for_local): New method.
537 (Target_arm::rel_irelative_section): New method.
538 (Target_arm::make_data_plt): Add more parameters for plt ctor.
539 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
540 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
541 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
542 (Target_arm::Scan::check_non_pic): Add ifunc support.
543 (Target_arm::Scan::local): Add ifunc support.
544 (Target_arm::Scan::global): Add ifunc support.
545 (Target_arm::make_plt_section): New method.
546 (Target_arm::make_plt_entry): Change to call to make_plt_section.
547 (Target_arm::make_local_ifunc_plt_entry): New method.
548 (Target_arm::got_irelative_): New member.
549 (Target_arm::rel_irelative_): New member.
550 (Target_arm::got_section): Add creation for got_irelative_.
551 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
552 (Target_arm::Relocate::relocate): Properly set local ifunc address.
553 (Target_arm::do_dynsym_value): Properly set global ifunc address.
554 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
555 (Output_data_plt_arm::IRelative_data): New type.
556 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
557 (Output_data_plt_arm::add_entry): Add more parameters.
558 (Output_data_plt_arm::add_relocation): New method.
559 (Output_data_plt_arm::add_local_ifunc_entry): New method.
560 (Output_data_plt_arm::rel_irelative): New method.
561 (Output_data_plt_arm::entry_count): Modified.
562 (Output_data_plt_arm::address_for_global): New method.
563 (Output_data_plt_arm::address_for_local): New method.
23081de0 564gold/
fa89cc82
HS
565 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
566 (Output_data_plt_arm::insert_irelative_data): New method.
567 (Output_data_plt_arm::irelative_rel_): New member.
568 (Output_data_plt_arm::got_): New member.
569 (Output_data_plt_arm::got_irelative_): New member.
570 (Output_data_plt_arm::irelative_count_): New member.
571 (Output_data_plt_arm::IRelative_data_vec): New typedef.
572 (Output_data_plt_arm::irelative_data_vec_): New member.
573 (Output_data_plt_arm::do_write): Write out irelative entries.
574 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
575 more parameters to ctor.
576 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
577 more parameters to ctor.
578 * output.h (Output_data_reloc::add_local_relative): New method.
579 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
580
0f81d3f0
AM
5812015-01-29 Alan Modra <amodra@gmail.com>
582
583 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
584 and GOT_TLSGD to LE optimization.
585
65d92137
CC
5862015-01-28 Cary Coutant <ccoutant@google.com>
587
588 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
589 for undef TLS symbols.
590 (Target_x86_64::Relocate::relocate_tls): Likewise.
591 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
592
5485698a
CC
5932015-01-25 Cary Coutant <ccoutant@google.com>
594
595 * output.cc (Output_segment::set_section_addresses): Fix calculation
596 of size of relro segment.
597
b01a4b04
AM
5982015-01-22 Alan Modra <amodra@gmail.com>
599
600 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
601 condition for need of ifunc plt entry.
602 (Target_powerpc::Scan::global <got relocs>): Likewise.
603
3d0064a9
CC
6042015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
605
606 * mips.cc (reloc_high): Add r_sym.
607 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
608 reloc_high constructor.
609 (Mips_relocate_functions::relgot16_local): Likewise.
610 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
611 r_type to decide whether LO16 matches HI16.
612 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
613 rello16 and relgot16_local.
614
a5cd8f05
CC
6152015-01-09 Cary Coutant <ccoutant@google.com>
616
617 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
618 unless alignment is larger than page size.
619
4fc1b9d4
L
6202015-01-06 H.J. Lu <hongjiu.lu@intel.com>
621 Cary Coutant <ccoutant@google.com>
622
623 PR gold/17729
624 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
625 (DEFAULT_TARGET_X32): Set for x32.
626 * x86_64.cc (cmp_insn_32): New.
627 (lea_r10_insn_32): Likewise.
628 (lea_r11_insn_32): Likewise.
629 (cmp_insn_64): Likewise.
630 (lea_r10_insn_64): Likewise.
631 (lea_r11_insn_64): Likewise.
632 (Target_x86_64<size>::do_calls_non_split): Handle x32.
633 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
634 (check_DATA): Add split_x32 files.
635 (split_x32_[1234n].o): New targets.
636 (split_x32_[124]): New targets.
637 (split_x32_[1234r].stdout): New targets.
638 * testsuite/split_x32.sh: New file.
639 * testsuite/split_x32_1.s: Likewise.
640 * testsuite/split_x32_2.s: Likewise.
641 * testsuite/split_x32_3.s: Likewise.
642 * testsuite/split_x32_4.s: Likewise.
643 * testsuite/split_x32_n.s: Likewise.
644 * configure: Regenerated.
645 * testsuite/Makefile.in: Likewise.
646
e749cab8
L
6472015-01-06 H.J. Lu <hongjiu.lu@intel.com>
648
649 PR gold/17809
650 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
651 x32.
652
af759df0
AM
6532015-01-02 Alan Modra <amodra@gmail.com>
654
655 * version.cc (print_version): Just print current year.
656 * dwp.cc (print_version): Likewise.
657
b90efa5b
AM
6582015-01-01 Alan Modra <amodra@gmail.com>
659
660 Update year range in copyright notice of all files.
661
f12d1e8a
AM
6622014-12-25 Alan Modra <amodra@gmail.com>
663
664 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
665 new enums.
666 (Target_arm::merge_object_attributes, ): Likewise.
667
5c294fee
TG
6682014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
669
670 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
671 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
672 AEABI_VFP_args_vfp to check that.
673 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
674 value and replace hardcoded values by enum values.
675
e30880c2
CC
6762014-12-22 Cary Coutant <ccoutant@google.com>
677
678 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
679
bd040da1
L
6802014-12-20 H.J. Lu <hongjiu.lu@intel.com>
681
682 PR gold/14608
683 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
684 to "return i * i * 3;".
685
e02a4046
CC
6862014-12-16 Cary Coutant <ccoutant@google.com>
687
688 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
689 (Mapfile::print_output_data): Use current_data_size() to avoid
690 assert for sections requiring postprocessing; if address is not valid,
691 print 0.
692 (Mapfile::print_output_section): Use current_data_size(); print note
693 that addresses and sizes are before compression.
694
add6016b
L
6952014-12-14 H.J. Lu <hongjiu.lu@intel.com>
696
697 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
698 Cast current_group_size to unsigned long when reporting error.
699
0bf32ea9
JY
7002014-12-10 Jing Yu <jingyu@google.com>
701
702 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
703 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
704 Update error message.
705 (Target_aarch64::do_relax): Use absolute value of option
706 stub_group_size. Replace local variable with class member
707 stub_group_size_.
708
cbcb23fa
AM
7092014-12-04 Alan Modra <amodra@gmail.com>
710
711 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
712 addend of PLTREL24 reloc when not generating a plt stub. Make
713 max_branch_offset an "Address".
fbad6518 714 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
715 (Target_powerpc::Relocate::relocate): Likewise.
716
1611bc4a
AM
7172014-12-04 Alan Modra <amodra@gmail.com>
718
719 PR 17670
720 * symtab.cc (Symbol::set_undefined): Remove assertion.
721 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
722 on symbols defined in discarded sections, instead return false.
723 Rearrange params, update all callers.
724 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
725 branches to syms in discarded sections.
726 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
727 undefined and flag as discarded.
728 (Target_powerpc::Relocate::relocate): Localize variable.
729
4759c34e
L
7302014-12-03 H.J. Lu <hongjiu.lu@intel.com>
731
732 PR gold/17675
733 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
734 * testsuite/Makefile.in: Regenerated.
735
1f98a074
AM
7362014-12-03 Alan Modra <amodra@gmail.com>
737
738 PR 17566
739 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
740 when adding dynamic relocations against section symbols.
741
fb257835
DI
7422014-12-01 Dimitry Ivanov <dimitry@google.com>
743
744 * layout.cc (Layout::finish_dynamic_section): When '-z global'
745 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
746 * options.h (General_options): New -z option (global).
747
d8e60314
CC
7482014-12-01 Cary Coutant <ccoutant@google.com>
749
750 PR gold/17578
751 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
752 is given.
753 (Layout::create_executable_stack_info): Warn when -z noexecstack is
754 given but some inputs require executable stack.
755
982bbd97
CC
7562014-11-26 Cary Coutant <ccoutant@google.com>
757
758 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
759 .debug_str_offsets; strip .debug_gnu_pubnames and
760 .debug_gnu_pubtypes.
761 (lines_only_debug_sections): Strip all four new sections.
762
bb779192
HS
7632014-11-26 Jing Yu <jingyu@google.com>
764
765 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
766 register to be x0 when to relax TLSDESC_LD64_LO12.
767
a3e60ddb
AM
7682014-11-26 Alan Modra <amodra@gmail.com>
769
770 * powerpc.cc (struct Stub_table_owner): New.
771 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
772 unsigned int vector. Update all references.
773 (powerpc_relobj::set_stub_table): Take an unsigned int param
774 rather than a Stub_table. Update callers.
775 (Powerpc_relobj::clear_stub_table): New function.
776 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
777 stub_group_size_ vars.
778 (Target_powerpc::new_stub_table): Delete.
779 (max_branch_delta): New function, extracted from..
780 (Target_powerpc::Relocate::relocate): ..here..
781 (Target_powerpc::Branch_info::make_stub): ..and here. Return
782 status on whether stub created successfully.
783 (Stub_control::Stub_control): Add "no_size_errors" param. Move
784 default sizing to..
785 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
786 reduce on relax failure.
787 (Target_powerpc::group_sections): Add "no_size_errors" param.
788 Use stub_group_size_. Set up group info in a temp vector,
789 before building Stub_table vector. Account for input sections
790 possibly already converted to relaxed sections.
791 (Stub_table::init): Delete. Merge into..
792 (Stub_table::Stub_table): ..here.
793 (Stub_table::can_reach_stub): New function.
794 (Stub_table::add_plt_call_entry): Add "from" parameter and
795 return true iff stub could be reached.
796 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
797 param too.
798 (Stub_table::clear_stubs): Add "all" param.
799
a20605cf
AM
8002014-11-26 Alan Modra <amodra@gmail.com>
801
802 * powerpc.cc (Stub_control::set_output_and_owner): New function.
803 (Target_powerpc::group_sections): Use it.
804
43b64deb
CC
8052014-11-25 Cary Coutant <ccoutant@google.com>
806
807 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
808 (Binary_to_elf::write_symbol): Add st_size parameter.
809 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
810
c924eb67
CC
8112014-11-25 Cary Coutant <ccoutant@google.com>
812
813 PR gold/17639
814 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
815 (Sized_relobj_file::do_layout): Handle deferred sections properly
816 during GC pass 1. Don't add reloc sections to deferred list twice.
817 * object.h (Sized_relobj_file::is_deferred_layout): New function.
818 (Sized_relobj_file::is_deferred_layout_): New data member.
819
9d585188
L
8202014-11-21 H.J. Lu <hongjiu.lu@intel.com>
821
822 PR gold/17619
823 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
824 Check PC-relative offset overflow in PLT entry.
825
3ffaac20
AM
8262014-11-21 Alan Modra <amodra@gmail.com>
827
828 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
829 for undefined weaks.
830
0cfb0717
AM
8312014-11-20 Alan Modra <amodra@gmail.com>
832
833 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
834 from --stub-group-size parameter divided by 1024.
835 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
836 template parameter. Update all uses.
837 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
838 has_stub_value. Set for long branches. Don't report overflow for
839 branch to undefined weak symbols. Print info message on
840 overflowing branch to stub.
841
f9dffbf0
AM
8422014-11-20 Alan Modra <amodra@gmail.com>
843
844 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
845
e88ba8d5
L
8462014-11-13 H.J. Lu <hongjiu.lu@intel.com>
847
848 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
849 entry for R_X86_64_GOTPLT64.
850 (Target_x86_64<size>::Relocate::relocate): Update comments for
851 R_X86_64_GOTPLT64.
852
d37ffe25
ED
8532014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
854
855 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
856 * plugin.h: add lock definition
857
9726c3c1
HS
8582014-10-29 Han Shen <shenhan@google.com>
859 Jing Yu <jingyu@google.com>
860
861 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
862 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
863 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
864 Symbol::TLS_REF.
865 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
866 method.
867 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
868 (Target_aarch64::tls_ld_to_le): New method.
869 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
870 for 64bit targets.
871 (Output_data_plt_aarch64::irelative_rel_): New data member.
872 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
873 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
874 (Output_data_plt_aarch64::add_relocation): New method.
875 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
876 offset. Add got_irelative size to got size.
877 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
878 type string with the new typename.
879 (AArch64_relocate_functions::update_adr): Replace parameter x with
880 immed.
881 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
882 (AArch64_relocate_functions::reloc_common): New method.
883 (AArch64_relocate_funcsions::rela_general): Extract common part out
884 into reloc_common method.
885 (AArch64_relocate_functions::rela_general): Likewise.
886 (AArch64_relocate_functions::pcrela_general): Likewise.
887 (AArch64_relocate_functions::adr): New method.
888 (AArch64_relocate_functions::adrp): Calculate immed before calling
889 update_adr.
890 (AArch64_relocate_functions::adrp): Likewise.
891 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
892 comparing x to 0. Calculate immed from ~x when x < 0.
893 (Target_aarch64::optimize_tls_reloc): Add new cases for
894 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
895 TLSLD_MOVW_DTPREL_G0_NC.
896 (Target_aarch64::possible_function_pointer_reloc): Implement this
897 method.
898 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
899 comment.
900 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
901 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
902 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
903 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
904 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
905 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
906 (Target_aarch64::make_plt_entry): Call add_entry with two more
907 parameters.
908 (Target_aarch64::make_local_ifunc_plt_entry): New method.
909 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
910 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
911 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
912 (Target_aarch64::Relocate::relocate_tls): Add cases for
913 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
914 TLSLD_MOVW_DTPREL_G0_NC.
915 * testsuite/icf_safe_so_test.cc: Correct test comment.
916 * testsuite/icf_safe_test.sh: Add AArch64 arch.
917
80272b8c
AM
9182014-10-22 Alan Modra <amodra@gmail.com>
919
920 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
921 thread_starter.
922
998a69f4
AS
9232014-10-18 Andreas Schwab <schwab@linux-m68k.org>
924
925 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
926
aed56ec5
CC
9272014-10-17 Cary Coutant <ccoutant@google.com>
928
929 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
930 Add "typename" keyword.
931
bb779192 9322014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
933 Jing Yu <jingyu@google.com>
934
935 Patch for gold aarch64 backend to support relaxation.
936 * aarch64-reloc.def: Change format.
937 * aarch64.cc (class Reloc_stub): New class.
938 (class Stub_table): New class.
939 (class AArch64_relobj): New class.
940 (class AArch64_input_section): New class.
941 (class AArch64_output_section): New class.
942 (Target_aarch64::new_stub_table): New method.
943 (Target_aarch64::new_aarch64_input_section): New method.
944 (Target_aarch64::find_aarch64_input_section): New method.
945 (Target_aarch64::scan_section_for_stubs): New method.
946 (Target_aarch64::scan_reloc_section_for_stubs): New method.
947 (Target_aarch64::relocate_stub): New method.
948 (Target_aarch64::current_target): New method.
949 (Target_aarch64::do_make_elf_object): New method.
950 (Target_aarch64::do_may_relax): New method.
951 (Target_aarch64::do_relax): New method.
952 (Target_aarch64::group_sections): New method.
953 (Target_aarch64::scan_reloc_for_stub): New method.
954 (Target_aarch64::do_make_output_section): New method.
955 (Target_aarch64::stub_tables_): New data member.
956 (Target_aarch64::aarch64_input_section_map_): New data member.
957 (AArch64_relocate_functions::maybe_apply_stub): New method.
958
db4c9594
CC
9592014-09-30 Cary Coutant <ccoutant@google.com>
960
961 PR gold/17432
962 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
963
cd6da036
KC
9642014-09-30 Kito Cheng <kito@0xlab.org>
965
966 PR gold/13597
967 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
968 hash table before sysv-style hash table.
969
5f772412
ST
9702014-09-29 Sriraman Tallam <tmsriram@google.com>
971
972 * options.h (--pic-executable): Add negative to alias to -no-pie.
973
5efeedf6
CC
9742014-09-26 Cary Coutant <ccoutant@google.com>
975
976 PR gold/16773
977 * object.cc (Sized_relobj_file): Compute value of section symbols
978 for TLS sections the same as TLS symbols.
979
1707f183
CC
9802014-09-25 Cary Coutant <ccoutant@google.com>
981
982 PR gold/17432
983 * resolve.cc (Symbol_table::resolve): Override common placeholder
984 symbols, but adjust sizes.
985 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
986 symbols to common lists.
987
00cac886
AM
9882014-09-24 Alan Modra <amodra@gmail.com>
989
990 * po/POTFILES.in: Regenerate.
991
635aa30e
CC
9922014-09-23 Taiju Tsuiki <tzik@google.com>
993 Cary Coutant <ccoutant@google.com>
994
71b9b91b 995 PR gold/14860
635aa30e
CC
996 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
997 on input_sections_blocker.
998 * layout.cc (Write_sections_task::locks): Unblock
999 input_sections_blocker_.
1000 * layout.h (Write_sections_task::Write_sections_task): Add
1001 input_sections_blocker.
1002 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1003 to DEPENDENCIES.
1004 * testsuite/Makefile.in: Regenerate.
1005
c0c71592
RÁE
10062014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1007
1008 * testsuite/Makefile.am (plugin_test_10): New test.
1009 * testsuite/Makefile.in: Regenerate
1010 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1011 * testsuite/plugin_test_10.sh: New file.
1012
6168c2a1
RÁE
10132014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1014
1015 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1016 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1017 during the replacement phase.
1018
3a531937
JY
10192014-09-17 Han Shen <shenhan@google.com>
1020 Jing Yu <jingyu@google.com>
1021
1022 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1023 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1024 * aarch64.cc (Target_aarch64): Add data members
1025 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1026 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1027 constructor.
1028 (Target_aarch64::do_reloc_symbol_index): New method.
1029 (Target_aarch64::do_reloc_addend): New method.
1030 (Target_aarch64::add_tlsdesc_info): New method.
1031 (Target_aarch64::do_dynsym_value): New method.
1032 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1033 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1034 (Target_aarch64::make_data_plt): Add new parameters: got,
1035 got_irelative. Pass them to do_make_data_plt.
1036 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1037 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1038 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1039 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1040 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1041 (Target_aarch64::got_tlsdesc_section): New method.
1042 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1043 (Target_aarch64::define_tls_base_symbol): New method.
1044 (Target_aarch64::reserve_tlsdesc_entries): New method.
1045 (Target_aarch64::got_mod_index_entry): New method.
1046 (Target_aarch64::rela_tlsdesc_section): New method.
1047 (Target_aarch64::rela_irelative_section): New method.
1048 (Target_aarch64::Tlsdesc_info): New struct.
1049 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1050 relocations and tlsdesc relocations.
1051 (Target_aarch64::optimize_tls_reloc): Implement method.
1052 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1053 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1054 in constructor.
1055 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1056 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1057 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1058 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1059 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1060 (Output_data_plt_aarch64::rela_irelative): New method.
1061 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1062 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1063 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1064 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1065 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1066 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1067 (Output_data_plt_aarch64_standard): New member variables:
1068 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1069 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1070 New parameter: got, got_irelative.
1071 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1072 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1073 (Output_data_plt_aarch64::do_write): Replace got_address with
1074 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1075 (AArch64_relocate_functions::update_movnz): New method.
1076 (AArch64_relocate_functions): Correct format.
1077 (AArch64_relocate_functions::movnz): New method.
1078 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1079 before the switch. Add new cases to switch.
00cac886 1080 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1081 tlsgd tlsdesc cases.
1082 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1083 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1084 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1085 Call reloc_name_in_error_message to print unsupported reloc.
1086 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1087 make_data_plt.
1088 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1089 relocs. Fill in some more dynamic tags.
1090 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1091 Skip call tls_get_addr when tlsgd is relaxed.
1092 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1093 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1094 tlsdesc->ie relaxation.
1095
62661c93
SS
10962014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1097
1098 * mips.cc (Target_mips_nacl): New class.
1099 (Target_selector_mips_nacl): New class.
1100 (target_selector_mips32): Rename from target_selector_mips32be and use
1101 Target_selector_mips_nacl instead of Target_selector_mips.
1102 (target_selector_mips32el): Rename from target_selector_mips32 and use
1103 Target_selector_mips_nacl instead of Target_selector_mips.
1104 (target_selector_mips64): Rename from target_selector_mips64be and use
1105 Target_selector_mips_nacl instead of Target_selector_mips.
1106 (target_selector_mips64el): Rename from target_selector_mips64 and use
1107 Target_selector_mips_nacl instead of Target_selector_mips.
1108 (Target_mips::mips_info): Add const attribute.
1109
54674d38
CC
11102014-09-02 Cary Coutant <ccoutant@google.com>
1111
1112 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1113 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1114 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1115 (Sized_incr_dynobj::do_section_name): Likewise.
1116 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1117 (Sized_incr_dynobj::do_section_name): Likewise.
1118 * object.h (Object::section_name): Likewise.
1119 (Object::do_section_name): Likewise.
1120 (Sized_relobj_file::do_section_name): Likewise.
1121 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1122 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1123
9860cbcf
CC
11242014-09-02 Cary Coutant <ccoutant@google.com>
1125
1126 PR gold/17005
1127 * ehframe.cc (Fde::write): Add output_offset parameter.
1128 (Cie::write): Likewise.
1129 (Eh_frame::set_final_data_size): Account for offset within output
1130 section.
1131 (Eh_frame::do_sized_write): Likewise.
1132 * ehframe.h (Fde::write): Add output_offset parameter.
1133 (Cie::write): Likewise.
1134 * output.cc (Output_section::Input_section_sort_entry): Remove
1135 section_has_name_; add output_section_name parameter. Use
1136 output section name for non-input sections.
1137 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1138 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1139 (Output_section::Input_section_sort_compare): Remove logic for
1140 sections without names.
1141 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1142 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1143 Likewise.
1144 (Output_section::Input_section_sort_section_name_compare): Likewise.
1145
8e33481e
HS
11462014-08-29 Han Shen <shenhan@google.com>
1147 Jing Yu <jingyu@google.com>
1148
1149 * aarch64-reloc-property.cc
1150 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1151 reference reloc property in the table.
1152 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1153 3 other entries.
1154 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1155 2 new overloaded methods.
1156 (Output_data_got_aarch64::do_write): Add code to write out
1157 static relocs.
1158 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1159 static relocs.
1160 (Output_data_got_aarch64::static_relocs): New vector to
1161 hold static relocs.
1162 (Target_aarch64::TCB_SIZE): New const static memeber.
1163 (Target_aarch64::tcb_size): New method.
1164 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1165 (Target_aarch64::Relocate::relocate_tls): New method.
1166 (Target_aarch64::Scan::local): Add code handling new reloc types.
1167 (Target_aarch64::Scan::global): Add code handling new reloc types.
1168
81233653
ST
11692014-08-13 Sriraman Tallam <tmsriram@google.com>
1170
1171 * options.h (-no-pie): Add option.
1172
9363c7c3
JY
11732014-08-08 Jing Yu <jingyu@google.com>
1174 Han Shen <shenhan@google.com>
1175
1176 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1177 (DEFFILES): add aarch64-reloc.def.
1178 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1179 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1180 * Makefile.in: Regenerate.
1181 * aarch64-reloc-property.cc: New file.
1182 * aarch64-reloc-property.h: New file.
1183 * aarch64-reloc.def: New file.
1184 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1185 with tab to make the format consistent.
1186 (Output_data_got_aarch64::symbol_table_): New method.
1187 (Target_aarch64::do_plt_address_for_global): New method.
1188 (Target_aarch64::do_plt_address_for_local): New method.
1189 (Target_aarch64::do_select_as_default_target): New method.
1190 (Target_aarch64::do_make_data_plt): New method.
1191 (Target_aarch64::make_data_plt): New method.
1192 (Output_data_plt_aarch64::has_irelative_section): New method.
1193 (Output_data_plt_aarch64::address_for_global): New method.
1194 (Output_data_plt_aarch64::address_for_local): New method.
1195 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1196 (Output_data_plt_aarch64::add_entry): Implement contents.
1197 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1198 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1199 the got_pov entry to plt0.
1200 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1201 Implement contents.
1202 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1203 (AArch64_howto): New struct.
1204 (aarch64_howto[]): New static const array.
1205 (AArch64_relocate_functions): New class.
1206 (Target_aarch64::Scan::get_reference_flags): Remove method.
1207 (Target_aarch64::Scan::local): Implement to support a few relocations.
1208 (Target_aarch64::Scan::global): Implement to support a few relocations.
1209 (Target_aarch64::make_plt_section): Implement contents.
1210 (Target_aarch64::make_plt_entry): Implement contents.
1211 (Target_aarch64::do_finalize_sections): Implement contents.
1212 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1213 (Target_aarch64::relocate_section): Implement contents.
1214
ad9fe6c1
AM
12152014-08-06 Alan Modra <amodra@gmail.com>
1216
1217 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1218
7cd4e5b7
AM
12192014-08-06 Alan Modra <amodra@gmail.com>
1220
1221 PR 13227
1222 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1223
5ad9b0a7
ST
12242014-07-21 Sriraman Tallam <tmsriram@google.com>
1225
1226 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1227 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1228
e051745c
CC
12292014-07-08 Cary Coutant <ccoutant@google.com>
1230
1231 * expression.cc (struct Expression::Expression_eval_info): Add
1232 new fields type_pointer, vis_pointer, and nonvis_pointer.
1233 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1234 nonvis_pointer parameters. Adjust all calls.
1235 (Symbol_expression::value): Update type, visibility, and nonvis bits
1236 in caller.
1237 * script.cc (Symbol_assignment::sized_finalize): Update type,
1238 visibility, and remaining st_other bits for new symbol.
1239 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1240 vis_pointer, and nonvis_pointer parameters.
1241 * symtab.h (Symbol::set_type): New method.
1242
1243 * testsuite/Makefile.am (defsym_test): New test.
1244 * testsuite/Makefile.in: Regenerate.
1245 * testsuite/defsym_test.c: New file.
1246 * testsuite/defsym_test.sh: New file.
1247
f35c4853
CC
12482014-07-08 Cary Coutant <ccoutant@google.com>
1249
1250 PR gold/15639
1251 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1252 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1253 (Sized_dynobj::base_read_symbols): ...new method.
1254 * object.h (Sized_relobj_file::base_read_symbols): New method.
1255 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1256 (Sized_relobj_file::base_read_symbols): ...new method.
1257 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1258 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1259 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1260
2900af2d
AM
12612014-07-04 Alan Modra <amodra@gmail.com>
1262
1263 * po/POTFILES.in: Regenerate.
1264
053a4d68
JY
12652014-07-02 Jing Yu <jingyu@google.com>
1266
1267 * aarch64.cc: New file
1268 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1269 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1270 * Makefile.in: Regenerate.
1271 * configure.tgt: Add entries for aarch64*.
1272 * configure.ac: Likewise.
1273 * configure: Likewise.
1274
7b549045
AM
12752014-06-27 Alan Modra <amodra@gmail.com>
1276
1277 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1278
cb818dbf
CC
12792014-06-24 Cary Coutant <ccoutant@google.com>
1280
1281 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1282 sections.
1283 (Dwo_file::sized_read_unit_index): Likewise.
1284
9810d34d
SS
12852014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1286
1287 * mips.cc: New file.
1288 * Makefile.am (TARGETSOURCES): Add mips.cc
1289 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1290 * configure.tgt: Add entries for mips*.
1291 * configure.ac: Likewise.
1292 * Makefile.in: Regenerate.
1293 * configure: Likewise.
1294
9baa787b
CC
12952014-06-09 Cary Coutant <ccoutant@google.com>
1296
1297 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1298 unit_length is within section bounds.
1299
8f89af0a
CC
13002014-06-09 Cary Coutant <ccoutant@google.com>
1301
1302 PR gold/16980
1303 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1304 map.
1305
a47622ac
AM
13062014-06-07 Alan Modra <amodra@gmail.com>
1307
1308 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1309
4320c691
CC
13102014-06-06 Cary Coutant <ccoutant@google.com>
1311
1312 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1313 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1314 (Dwarf_pubnames_table::read_header): Likewise.
1315 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1316 .debug_gnu_pubtypes.
1317
270c9937
JB
13182014-06-05 Joel Brobecker <brobecker@adacore.com>
1319
1320 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1321 * Makefile.in, configure: Regenerate.
1322
397998fc
AM
13232014-06-03 Alan Modra <amodra@gmail.com>
1324
1325 * powerpc.cc (addis_12_2): Define.
1326 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1327
61f5c66f
AM
13282014-06-03 Alan Modra <amodra@gmail.com>
1329
1330 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1331 st_other output.
1332
f6971787
AM
13332014-06-02 Alan Modra <amodra@gmail.com>
1334
1335 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1336 Only ignore relocs on ELFv1.
1337 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1338
f6fb8322
CC
13392014-05-30 Cary Coutant <ccoutant@google.com>
1340
1341 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1342 * testsuite/Makefile.in: Regenerate.
1343 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1344
c23dd342
L
13452014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1346
1347 PR gold/16945
1348 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1349 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1350
5fe7ffdc
AM
13512014-05-15 Alan Modra <amodra@gmail.com>
1352
1353 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1354 Compare FDE contents with DW_CFA_nop rather than 0.
1355
a82bef93
ST
13562014-05-13 Sriraman Tallam <tmsriram@google.com>
1357
1358 * symtab.h (may_need_copy_reloc): Remove check for position independent
1359 code.
1360 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1361 position independence before pc absolute may_need_copy_reloc call.
1362 Add check for executable output befor pc relative may_need_copy_reloc
1363 call.
1364 * i386.cc: Ditto.
1365 * arm.cc: Ditto.
1366 * sparc.cc: Ditto.
1367 * tilegx.cc: Ditto.
1368 * powerpc.cc: Add check for no position independence before
1369 may_need_copy_reloc calls.
1370 * testsuite/pie_copyrelocs_test.cc: New file.
1371 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1372 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1373 * Makefile.in: Regenerate.
a82bef93 1374
53c66605
ML
13752014-05-08 Martin Liška <mliska@suse.cz>
1376
1377 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1378
57b2284c
CC
13792014-05-06 Cary Coutant <ccoutant@google.com>
1380
1381 PR gold/16900
1382 * i386.cc (Output_data_got_plt_i386): New class.
1383 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1384 parameter. Change all callers.
1385 (Output_data_plt_i386::layout_): Remove.
1386 (Output_data_plt_i386::got_plt_): Change type.
1387 (Target_i386::got_plt_): Change type. Change all references.
1388 (Target_i386::got_section): Create instance of new class.
1389 (Output_data_got_plt_i386::do_write): New function.
1390 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1391 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1392 parameter. Change all callers.
1393 (Output_data_plt_x86_64::layout_): Remove.
1394 (Output_data_plt_x86_64::got_plt_): Change type.
1395 (Target_x86_64::got_plt_): Change type. Change all references.
1396 (Target_x86_64::got_section): Create instance of new class.
1397 (Output_data_got_plt_x86_64::do_write): New function.
1398 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1399 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1400 class.
1401
6b97515d 14022014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1403
6b97515d
CC
1404 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1405 if we have pubnames/pubtypes.
1406
d1bddd3c
CC
14072014-05-02 Cary Coutant <ccoutant@google.com>
1408
5fe7ffdc
AM
1409 * defstd.cc (in_segment): Define __ehdr_start here...
1410 * layout.cc (Layout::finalize): ...Instead of here. Set the
1411 output segment when known.
1412 * resolve.cc (Symbol::override_base_with_special): Remember
1413 the original binding.
1414 * symtab.cc (Symbol::set_output_segment): New function.
1415 (Symbol::set_undefined): New function.
1416 * symtab.h (Symbol::is_weak_undefined): Check original undef
1417 binding.
1418 (Symbol::is_strong_undefined): New function.
1419 (Symbol::set_output_segment): New function.
1420 (Symbol::set_undefined): New function.
1421 * target-reloc.h (is_strong_undefined): Remove.
1422 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1423 Check for hidden undefs.
1424 (relocate_section): Call Symbol::is_strong_undefined.
1425
1426 * testsuite/Makefile.am (ehdr_start_test_1)
1427 (ehdr_start_test_2, ehdr_start_test_3)
1428 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1429 * testsuite/Makefile.in: Regenerate.
1430 * testsuite/ehdr_start_def.cc: New source file.
1431 * testsuite/ehdr_start_test.cc: New source file.
1432 * testsuite/ehdr_start_test.t: New linker script.
1433 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1434
7849f6d8
CC
14352014-04-23 Cary Coutant <ccoutant@google.com>
1436
bf2cc635 1437 PR gold/16870
7849f6d8
CC
1438 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1439
99fd8cff
CC
14402014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1441
1442 * layout.cc (Layout::include_section): Allow a target to decide
1443 whether to include a section.
1444 * target.h (Target::should_include_section): New function.
1445 (Target::do_should_include_section): New function.
1446
91f43acd
CC
14472014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1448
1449 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1450 inline into ...
1451 (Copy_relocs::emit): ... here.
1452 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1453 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1454 (Copy_reloc_entry::entries_): Change from private to protected.
1455
c4eb27e1
ST
14562014-04-02 Sriraman Tallam <tmsriram@google.com>
1457
1458 * icf.cc (get_section_contents): Replace copies of reloc
1459 vectors with const references.
1460
ae447ddd
CC
14612014-04-02 Cary Coutant <ccoutant@google.com>
1462
1463 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1464 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1465 * configure: Regenerate.
1466 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1467 -fno-use-linker-plugin.
1468 (LINK1, CXXLINK1): Add it to the link command.
1469 * testsuite/Makefile.in: Regenerate.
1470
fa47fa92
AM
14712014-03-12 Alan Modra <amodra@gmail.com>
1472
1473 * Makefile.in: Regenerate.
1474
9b12c500
CC
14752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1476
1477 * symtab.h (Symbol::set_nonvis): New function.
1478
beacaa96
CC
14792014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1480
1481 * symtab.cc (Sized_symbol<32>::init_output_data):
1482 Instantiate the template.
1483 (Sized_symbol<64>::init_output_data): Likewise.
1484
800d9823
CC
14852014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1486
1487 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1488 adjust dynamic symbol value.
1489 * target.h (Target::adjust_dyn_symbol): New function.
1490 (Target::do_adjust_dyn_symbol): New function.
1491
918fc1f8 14922014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1493
918fc1f8
CC
1494 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1495 Get the value of DYNAMIC_CUSTOM dynamic entry.
1496 * output.h (Output_data_dynamic::add_custom): New function.
1497 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1498 dynamic entry.
1499 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1500 * target.h (Target::dynamic_tag_custom_value): New function.
1501 (Target::do_dynamic_tag_custom_value): New function.
1502
98ff9231
CC
15032014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1504
1505 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1506 dynsym indexes.
1507 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1508 (Target::do_has_custom_set_dynsym_indexes): New function.
1509 (Target::set_dynsym_indexes): New function.
1510 (Target::do_set_dynsym_indexes): New function.
1511
b80eed39
AM
15122014-03-07 Alan Modra <amodra@gmail.com>
1513
1514 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1515 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1516 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1517 (Powerpc_relocate_functions::has_overflow_bitfield,
1518 overflowed): Use the above.
1519 (Target_powerpc::Relocate::relocate): Correct overflow checking
1520 for a number of relocations. Modify overflow test for 16-bit
1521 fields in instructions to signed/unsigned according to whether
1522 the field takes a signed or unsigned value.
1523
4b95cf5c
AM
15242014-03-05 Alan Modra <amodra@gmail.com>
1525
1526 Update copyright years.
1527
45965137
AM
15282014-03-05 Alan Modra <amodra@gmail.com>
1529
1530 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1531 R_PPC64_ADDR64_LOCAL.
1532 (Target_powerpc::Relocate::relocate): Likewise.
1533
2c80b753
AM
15342014-03-03 Alan Modra <amodra@gmail.com>
1535
1536 * dwp.cc (print_version): Update copyright year to current.
1537
c1c69e83
AM
15382014-02-10 Alan Modra <amodra@gmail.com>
1539
1540 * po/gold.pot: Regenerate.
1541
dd0c4e70
CC
15422014-02-06 Cary Coutant <ccoutant@google.com>
1543
1544 Fix problem where -u is ignored when a weak undef is seen.
1545
1546 * archive.cc (Library_base::should_include_member): Reorder
1547 code to check for -u option if a weak undef has already been seen.
1548 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1549 * testsuite/Makefile.in: Regenerate.
1550 * testsuite/weak_undef_file3.cc: New file.
1551 * testsuite/weak_undef_file4.cc: New file.
1552 * testsuite/weak_undef_test_2.cc: New file.
1553
1a221d3d
CC
15542014-02-05 Cary Coutant <ccoutant@google.com>
1555
1556 Fix issues with gold undefined symbol diagnostics.
1557
1558 PR binutils/15435
1559 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1560 check to here.
1561 * target-reloc.h (is_strong_undefined): New function.
1562 (relocate_section): Move undef vtable symbol check from here.
1563 Check for is_strong_undefined.
1564
e889f0a4 15652014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1566
e889f0a4
CC
1567 Fix problems with the --dynamic-list option.
1568
1569 PR gold/13577
1570 * options.cc (General_options::parse_dynamic_list):
1571 Set have_dynamic_list_.
1572 (General_options::General_options): Initialize have_dynamic_list_.
1573 (General_options::finalize): Turn off -Bsymbolic and
1574 -Bsymbolic-functions if --dynamic-list provided.
1575 * options.h (General_options::have_dynamic_list): New function.
1576 (General_options::have_dynamic_list_): New data member.
1577 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1578 correctly.
5fe7ffdc 1579
e889f0a4
CC
1580 PR gold/16530
1581 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1582 in --dynamic-list, mark it.
5fe7ffdc 1583
e889f0a4
CC
1584 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1585 (dynamic_list_2): New test case.
1586 * testsuite/Makefile.in: Regenerate.
1587 * testsuite/dynamic_list_2.cc: New file.
1588 * testsuite/dynamic_list_2.t: New file.
1589 * testsuite/dynamic_list_lib1.cc: New file.
1590 * testsuite/dynamic_list_lib2.cc: New file.
1591 * testsuite/gc_dynamic_list_test.c: New file.
1592 * testsuite/gc_dynamic_list_test.sh: New file.
1593 * testsuite/gc_dynamic_list_test.t: New file.
1594
ec673e64
CC
15952014-01-28 Cary Coutant <ccoutant@google.com>
1596
1597 Add .gdb_index version 7 support.
1598
1599 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1600 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1601 debug sections.
1602 (Dwarf_ranges_table::read_ranges_table): Likewise.
1603 (Dwarf_pubnames_table::read_section): Check for GNU-style
1604 sections, and for compressed debug sections.
1605 (Dwarf_pubnames_table::read_header): Compute end address of table.
1606 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1607 for end of list by offset, not by offset == 0.
1608 (Dwarf_info_reader::do_read_string_table): Check for compressed
1609 debug sections.
1610 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1611 Initialize new data members.
1612 (Dwarf_pubnames_table::next_name): return flag_byte.
1613 (Dwarf_pubnames_table::end_of_table_): New data member.
1614 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1615 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1616 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1617 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1618 read skeleton type unit DIEs.
1619 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1620 (Gdb_index::do_write): Write flag_byte.
1621 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1622 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1623 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1624 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1625
221fd5d5
L
16262014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1627
1628 * version.cc (print_version): Update copyright year to 2014.
1629
6c09fb0b
ILT
16302013-12-19 Dimitry Andric <dimitry@andric.com>
1631
1632 * stringpool.cc (Stringpool_template::reserve): Add
1633 HAVE_UNORDERED_MAP case.
1634 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1635
8356f2d0
CC
16362013-12-18 Cary Coutant <ccoutant@google.com>
1637
1638 * configure.ac: Check for <unordered_set> and <unordered_map>.
1639 * config.in: Regenerate.
1640 * configure: Regenerate.
1641 * system.h: Use <unordered_set> and <unordered_map> if available.
1642
f2c7d7ee
RM
16432013-12-10 Roland McGrath <mcgrathr@google.com>
1644
1645 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1646 with $(INSTALL_PROGRAM_ENV).
1647 * Makefile.in: Regenerate.
1648
6632e8cc
CC
16492013-11-22 Cary Coutant <ccoutant@google.com>
1650
1651 * configure.ac: Add check for which library is needed for
1652 dlopen.
1653 * configure: Regenerate.
1654
0c075858
CC
16552013-11-22 Cary Coutant <ccoutant@google.com>
1656
1657 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1658 assembler.
1659 * testsuite/Makefile.in: Regenerate.
1660
f49fe902
L
16612013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1662
1663 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1664 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1665 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1666 (Target_x86_64<size>::Scan::local): Likewise.
1667 (Target_x86_64<size>::Scan::global): Likewise.
1668 (Target_x86_64<size>::Relocate::relocate): Likewise.
1669 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1670 Likewise.
1671 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1672 R_X86_64_PC32_BND.
1673
1674 * testsuite/Makefile.am (check_PROGRAMS): Add
1675 exception_x86_64_bnd_test.
1676 (exception_x86_64_bnd_test_SOURCES): New macro.
1677 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1678 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1679 (exception_x86_64_bnd_test_LDADD): Likewise.
1680 (exception_x86_64_bnd_1.o): New rule.
1681 (exception_x86_64_bnd_2.o): Likewise.
1682 * testsuite/Makefile.in: Regenerated.
1683
9055360d
AM
16842013-11-15 Alan Modra <amodra@gmail.com>
1685
1686 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1687 accessor.
1688 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1689 Only call ppc64_local_entry_offset for 64-bit. Restrict
1690 symval_for_branch lookup to ELFv1.
1691 (Stub_table::add_plt_call_entry): Use unsigned int off.
1692 (Output_data_glink::Address, invalid_address): New.
1693 (Output_data_glink::add_eh_frame): Move out of line. Add
1694 support for ELFv2.
1695 (Output_data_glink::add_global_entry, find_global_entry,
1696 global_entry_address): New functions.
1697 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1698 ge_size): New variables.
1699 (Output_data_glink::set_final_data_size): Add global entry
1700 stub sizing.
1701 (Output_data_glink::do_write): Write global entry stubs.
1702 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1703 parameter. Return true for ELFv2. Adjust callers.
1704 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1705 ELFv1. Similarly for ifunc and dynamic relocation processing
1706 specific to ELFv1. Recognize that symbols are defined on
1707 their plt entries for ELFv2.
1708 (Target_powerpc::symval_for_branch): Assert if called for
1709 ELFv2 or ppc32.
1710 (Target_powerpc::Relocate::relocate): Use global entry plt
1711 stub for symbol value if such exists on ELFv2.
1712 (Target_powerpc::Relocate::relocate): Don't call
1713 symval_for_branch when ELFv2. Do adjust for local entry
1714 offset when ELFv2.
1715 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1716 plt stub for ELFv2.
1717 (Target_powerpc::do_plt_address_for_global): Similarly.
1718
cafdd569
CC
17192013-11-14 Cary Coutant <ccoutant@google.com>
1720
1721 Revert patch -- this did not fix the problem, and there is
1722 no race there.
1723
1724 2013-11-14 Cary Coutant <ccoutant@google.com>
1725
1726 PR gold/14860
1727 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1728 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1729 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1730 updating fde_offsets_.
1731 (Eh_frame_hdr::lock_): New data member.
1732
94e49e16
CC
17332013-11-14 Cary Coutant <ccoutant@google.com>
1734
1735 * dwp.cc (Dwo_file_entry): New type.
1736 (File_list): Use Dwo_file_entry.
1737 (Dwo_file::verify): New function.
1738 (Dwo_file::verify_dwo_list): New function.
1739 (Dwo_file::sized_verify_dwo_list): New function.
1740 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1741 list.
1742 (Dwp_options): New enum type.
1743 (dwp_options): Add --verify-only.
1744 (usage): Likewise.
1745 (main): Likewise.
1746 * dwp.h (gold_info): Add declaration.
1747
7cdd7d57
CC
17482013-11-14 Cary Coutant <ccoutant@google.com>
1749
1750 PR gold/14860
1751 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1752 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1753 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1754 updating fde_offsets_.
1755 (Eh_frame_hdr::lock_): New data member.
1756
1d946cb3
CC
17572013-11-06 Cary Coutant <ccoutant@google.com>
1758
1759 PR gold/15758
1760 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1761 before reloc sections.
1762
4f65b40e
AM
17632013-11-04 Alan Modra <amodra@gmail.com>
1764
1765 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1766 (Symbol::needs_dynamic_reloc): Test new flag.
1767 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1768 (Target_powerpc::Scan::get_reference_flags): Add target param.
1769 Return FUNC_DESC_ABI for 64-bit ELFv1.
1770 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1771 call.
1772 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1773 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1774
908794a9
CC
17752013-10-31 Cary Coutant <ccoutant@google.com>
1776
1777 Restore support for dwp v2 DWARF package file format.
1778
1779 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1780 tu_length parameter. Adjust all callers.
1781 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1782 * dwp.cc: Include dwarf.h.
1783 (Section_bounds): New struct type.
1784 (Unit_set): New struct type.
1785 (Dwo_file::Dwo_file): Initialize new data member.
1786 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1787 Combine and rename to...
1788 (Dwo_file::read_unit_index): ...this.
1789 (Dwo_file::sized_read_compunit_index)
1790 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1791 (Dwo_file::sized_read_unit_index): ...this.
1792 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1793 parameters; add section_id parameter.
1794 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1795 (Dwo_file::add_unit_set): ...this.
1796 (Dwo_file::shndx_map_): Remove.
1797 (Dwo_file::sect_offsets_): New data member.
1798 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1799 (Dwp_output_file::add_section): Rename to...
1800 (Dwp_output_file::add_contribution): ...this.
1801 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1802 (Dwp_output_file::add_tu_set): Likewise.
1803 (Dwp_output_file::Contribution): New type.
1804 (Dwp_output_file::Section::contributions): New data member.
1805 (Dwp_output_file::Cu_or_tu_set): Remove.
1806 (Dwp_output_file::Section::Section): New ctor.
1807 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1808 (Dwp_output_file::Dwp_index::Section_table): New type.
1809 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1810 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1811 parameter.
1812 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1813 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1814 (Dwp_output_file::Dwp_index::section_table): New member function.
1815 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1816 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1817 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1818 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1819 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1820 (Dwp_output_file::Dwp_index::section_table_): New data member.
1821 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1822 (Dwp_output_file::add_output_section): New member function.
1823 (Dwp_output_file::write_new_section): New member function.
1824 (Dwp_output_file::write_contributions): New member function.
1825 (Dwp_output_file::section_id_map_): New data member.
1826 (class Dwo_id_info_reader): Remove.
1827 (class Unit_reader): New class.
1828 (get_dwarf_section_name): New function.
1829 (Dwo_file::read_executable): Adjust initializations of class data.
1830 (Dwo_file::read): Add support for v2 package file format.
1831 (Dwo_file::read_unit_index): Likewise.
1832 (Dwo_file::sized_read_unit_index): Likewise.
1833 (Dwo_file::copy_section): Likewise.
1834 (Dwo_file::add_unit_set): Likewise.
1835 (Dwp_output_file::add_output_section): Likewise.
1836 (Dwp_output_file::add_contribution): Likewise.
1837 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1838 for empty slot.
1839 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1840 file format.
1841 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1842 slot.
1843 (Dwp_output_file::initialize): Remove unused function.
1844 (Dwp_output_file::finalize): Add support for v2 package file format.
1845 (Dwp_output_file::write_index): Likewise.
1846 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1847 function prototype.
1848
2500c017
CC
18492013-10-31 Cary Coutant <ccoutant@google.com>
1850
1851 * configure.ac: Fix check for -fmerge-constants.
1852 * configure.ac: Regenerate.
1853
dd0845d7
RM
18542013-10-30 Roland McGrath <mcgrathr@google.com>
1855
1856 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1857 Correct 9-byte nop sequence to match what the assembler generates.
1858
b4f7960d
AM
18592013-10-30 Alan Modra <amodra@gmail.com>
1860
1861 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1862 ppc64_local_entry_offset, ppc64_local_entry_offset,
1863 do_read_symbols): New functions.
1864 (Powerpc_relobj::e_flags_, st_other_): New vars.
1865 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1866 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1867 (Powerpc_relobj::e_flags_): New var.
1868 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1869 and adjust for ELFv2.
1870 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1871 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1872 (Powerpc_dynobj::do_find_special_sections): Likewise.
1873 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1874 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1875 to ELFv2 local entry.
1876 (Target_powerpc::do_relax): No thread safe barriers needed for
1877 ELFv2.
1878 (Output_data_plt_powerpc::initial_plt_entry_size_,
1879 plt_entry_size): Delete. Replace all uses with
1880 first_plt_entry_offset() and plt_entry_size().
1881 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1882 reserved_size parm. Update callers.
1883 (Output_data_plt_powerpc::entry_count): Update.
1884 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1885 and use Target_powerpc::first_plt_entry_offset().
1886 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1887 rename to plt_entry_size.
1888 (Output_data_plt_powerpc::add_ifunc_entry,
1889 add_local_ifunc_entry): Adjust reloc for ELFv2.
1890 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1891 (glink_eh_frame_fde_64v2): New.
1892 (Stub_table::plt_call_size): Support ELFv2 sizing.
1893 (Output_data_glink::add_eh_frame): Use the new FDE.
1894 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1895 (Stub_table::do_write): Write ELFv2 stubs and glink.
1896 (Target_powerpc::Relocate::relocate): Replaces nop after call
1897 with ld 2,24(1) and adjust local offset destination for ELFv2.
1898
f9c6b907
AM
18992013-10-30 Alan Modra <amodra@gmail.com>
1900
1901 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1902 (Target_powerpc::Scan::global, local): Likewise.
1903 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1904 on all ppc64 @h and @ha relocs.
1905
e84fe78f
AM
19062013-10-14 Alan Modra <amodra@gmail.com>
1907
1908 * output.h (Output_data_got::add_constant): Tidy.
1909 (Output_data_got::add_constant_pair): New function.
1910 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1911 methods used so as to first call reserve_ent().
1912
679e4abf
RM
19132013-10-11 Roland McGrath <mcgrathr@google.com>
1914
44dcb735
RM
1915 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1916 add_got_entry and add_got_entry_pair.
1917
13323c49
RM
1918 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1919 (HAVE_PUBNAMES): Likewise.
1920 * configure: Regenerate.
1921
1496b446
RM
1922 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1923 * testsuite/Makefile.in: Regenerate.
1924
cc84c10b
RM
1925 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1926 Remove const from declaration.
1927 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1928 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1929 * output.h (Output_file_header): Remove const from member target_
1930 and corresponding constructor argument.
1931 * output.cc (Output_file_header::Output_file_header): Update prototype.
1932 (Output_file_header::do_sized_write): Use this->target_ in place
1933 of parameters()->target().
1934
52f66a2c
RM
1935 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1936
2b64b551
RM
1937 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1938 * configure: Regenerate.
1939 * Makefile.in: Regenerate.
1940 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1941 * testsuite/merge_string_literals_2.c: Likewise.
1942 * testsuite/Makefile.am
1943 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1944 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1945 literal -fmerge-constants.
1946 * testsuite/Makefile.in: Regenerate.
1947
43819297
RM
1948 * i386.cc (Target_i386): Remove unused member dynbss_.
1949 * arm.cc (Target_arm): Likewise.
1950 * powerpc.cc (Target_powerpc): Likewise.
1951 * sparc.cc (Target_sparc): Likewise.
1952 * tilegx.cc (Target_tilegx): Likewise.
1953 * x86_64.cc (Target_x86_64): Likewise.
1954 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1955 type_signature_, type_offset_.
1956 * plugin.h (Plugin_hook): Remove unused member layout_.
1957 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1958 mapfile_.
1959 (Read_member): Remove unused members input_objects_, symtab_,
1960 mapfile_, layout_.
1961 (Check_library): Remove unused member symtab_.
1962 * archive.h (Lib_group): Remove unused member lib_.
1963 * archive.cc (Lib_group::Lib_group): Update initializer.
1964 * incremental.h (Incremental_binary): Remove unused member target_.
1965 (Incremental_script_entry): Removed unused member script_.
1966 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1967 * icf.h (Icf): Remove unused member num_tracked_relocs.
1968
39d9ead7
RM
1969 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1970 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1971 its only use.
1972 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1973
679e4abf
RM
1974 * archive.h: Use struct rather than class for forward declaration
1975 of Read_symbols_data.
1976
54de2ea6
CC
19772013-10-07 Cary Coutant <ccoutant@google.com>
1978
1979 PR gold/16010
1980 * testsuite/Makefile.am (icf_test): Fix dependencies.
1981 (icf_safe_test): Likewise.
1982 (icf_safe_so_test): Likewise.
1983 (large_symbol_alignment): Add empty _LDADD rule.
1984 * testsuite/Makefile.in: Regenerate.
1985
b14016f0
L
19862013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1987
1988 PR gold/15927
1989 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1990 relocation for R_X86_64_32 on x32.
1991
eb426534
RM
19922013-08-27 Roland McGrath <mcgrathr@google.com>
1993
1994 * output.cc (Output_segment::set_section_addresses): Take new
1995 Target* argument. If target->isolate_execinstr() and the segment
1996 is executable and starts at a target->abi_pagesize() boundary,
1997 pad its end out to a target->abi_pagesize() boundary with code fill.
1998 * output.h (Output_segment::set_section_addresses): Update decl.
1999 * layout.h (Layout::check_output_data_for_reset_values): Take new
2000 argument RELAX_OUTPUTS.
2001 (Layout): New member relax_output_list_.
2002 (Layout::add_relax_output): New method.
2003 * layout.cc (Layout::Layout): Update constructor.
2004 (Layout::reset_relax_output): New method.
2005 (Layout::clean_up_after_relaxation): Call it.
2006 (Layout::prepare_for_relaxation): Update caller.
2007 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2008 Call reset_relax_output before re-processing segments for
2009 isolate_execinstr case.
2010 (Layout::write_data): Handle relax_output_list_.
2011 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2012 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2013
9aff4b7a
NC
20142013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2015
2016 PR binutils/15834
2017 * object.h: Fix typos.
2018
93f8221c
RM
20192013-08-16 Roland McGrath <mcgrathr@google.com>
2020
2021 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2022 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2023
e44c3715
CC
20242013-08-07 Cary Coutant <ccoutant@google.com>
2025
2026 Revert support for v2 DWP files:
2027
2028 2013-03-01 Cary Coutant <ccoutant@google.com>
2029
2030 Add dwp support for v2 DWARF package file format.
2031 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2032 tu_length parameter. Adjust all callers.
2033 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2034 * dwp.cc: Include dwarf.h.
2035 (Section_bounds): New struct type.
2036 (Unit_set): New struct type.
2037 (Dwo_file::Dwo_file): Initialize new data member.
2038 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2039 Combine and rename to...
2040 (Dwo_file::read_unit_index): ...this.
2041 (Dwo_file::sized_read_compunit_index)
2042 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2043 (Dwo_file::sized_read_unit_index): ...this.
2044 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2045 parameters; add section_id parameter.
2046 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2047 (Dwo_file::add_unit_set): ...this.
2048 (Dwo_file::shndx_map_): Remove.
2049 (Dwo_file::sect_offsets_): New data member.
2050 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2051 (Dwp_output_file::add_section): Rename to...
2052 (Dwp_output_file::add_contribution): ...this.
2053 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2054 (Dwp_output_file::add_tu_set): Likewise.
2055 (Dwp_output_file::Contribution): New type.
2056 (Dwp_output_file::Section::contributions): New data member.
2057 (Dwp_output_file::Cu_or_tu_set): Remove.
2058 (Dwp_output_file::Section::Section): New ctor.
2059 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2060 (Dwp_output_file::Dwp_index::Section_table): New type.
2061 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2062 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2063 parameter.
2064 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2065 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2066 (Dwp_output_file::Dwp_index::section_table): New member function.
2067 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2068 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2069 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2070 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2071 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2072 (Dwp_output_file::Dwp_index::section_table_): New data member.
2073 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2074 (Dwp_output_file::add_output_section): New member function.
2075 (Dwp_output_file::write_new_section): New member function.
2076 (Dwp_output_file::write_contributions): New member function.
2077 (Dwp_output_file::section_id_map_): New data member.
2078 (class Dwo_id_info_reader): Remove.
2079 (class Unit_reader): New class.
2080 (get_dwarf_section_name): New function.
2081 (Dwo_file::read_executable): Adjust initializations of class data.
2082 (Dwo_file::read): Add support for v2 package file format.
2083 (Dwo_file::read_unit_index): Likewise.
2084 (Dwo_file::sized_read_unit_index): Likewise.
2085 (Dwo_file::copy_section): Likewise.
2086 (Dwo_file::add_unit_set): Likewise.
2087 (Dwp_output_file::add_output_section): Likewise.
2088 (Dwp_output_file::add_contribution): Likewise.
2089 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2090 for empty slot.
2091 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2092 file format.
2093 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2094 slot.
2095 (Dwp_output_file::initialize): Remove unused function.
2096 (Dwp_output_file::finalize): Add support for v2 package file format.
2097 (Dwp_output_file::write_index): Likewise.
2098 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2099 function prototype.
2100
c6905c28
CC
21012013-07-31 Cary Coutant <ccoutant@google.com>
2102
2103 * object.cc (Sized_relobj::do_output_section_address): New function.
2104 (Sized_relobj): Instantiate explicitly.
2105 * object.h (Object::output_section_address): New function.
2106 (Object::do_output_section_address): New function.
2107 (Sized_relobj::do_output_section_address): New function.
2108 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2109
21102013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2111 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2112
2113 * parameters.cc (Parameters::entry): Return target-specific entry
2114 symbol name.
2115 * target.h (Target::entry_symbol_name): New function.
2116 (Target_info::entry_symbol_name): New data member.
2117
2118 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2119 * i386.cc (Target_i386::i386_info): Likewise.
2120 (Target_i386_nacl::i386_nacl_info): Likewise.
2121 * sparc.cc (Target_sparc::sparc_info): Likewise.
2122 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2123 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2124 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2125 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2126
234d4ab8
SA
21272013-07-22 Sterling Augustine <saugustine@google.com>
2128
2129 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2130 Convert parameter shndx to local variable. Add parameters symtab
2131 and symtab_size. Scan over section names. Find relocation
2132 section corresponding to current section. Create and initialize
2133 reloc_mapper_ and reloc_type_.
2134 (Dwarf_pubnames_table::read_header): Add assertion. Change
2135 unit_length to off_t. Initialize member unit_length_. Fill in field
2136 cu_offset_.
2137 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2138 Initialize new fields unit_length_ and cu_offset_.
2139 (Dwarf_pubnames_table::read_section): Update prototype.
2140 (Dwarf_pubnames_table::cu_offset): New member function.
2141 (Dwarf_pubnames_table::subsection_size): Likewise.
2142 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2143 New fields.
2144 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2145 member functions public.
2146 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2147 Update comment. Rework logic. Move repeated parts to...
2148 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2149 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2150 pubtypes_table_, and stmt_list_offset.
2151 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2152 Gdb_index::find_pubtype_offset,
2153 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2154 (Gdb_index::pubnames_read): Update prototype and rework logic.
2155 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2156 Forward declare.
2157 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2158 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2159 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2160 Gdb_index::map_pubtable_to_dies):
2161 Declare functions.
2162 (Gdb_index::pubnames_read): Update declaration.
2163 (Gdb_index::Pubname_offset_map): New type.
2164 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2165 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2166 Gdb_index::stmt_list_offset): Declare.
2167 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2168 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2169 Gdb_index::pubtypes_offset_): Remove.
2170
a3ed37d8
RM
21712013-07-19 Roland McGrath <mcgrathr@google.com>
2172
2173 * options.h (General_options): Add -Trodata-segment option.
2174 * parameters.cc (Parameters::check_rodata_segment): New function.
2175 (Parameters::set_target_once): Call it.
2176 * parameters.h (Parameters): Declare it (private member function).
2177 * layout.cc (load_seg_unusable_for_headers): New function, broken
2178 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2179 then validate rodata segment rather than text segment.
2180 (relaxation_loop_body): Call that.
2181 (is_text_segment): New function. Don't admit a non-executable
2182 segment if TARGET->isolate_execinstr().
2183 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2184
eb5b4ded
CC
21852013-07-15 Shawn Landden <shawnlandden@gmail.com>
2186
2187 PR gold/15070
2188 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2189 * nacl.h (Sniff_file::View::View): Request aligned view.
2190
4d5effb9
CC
21912013-07-11 Cary Coutant <ccoutant@google.com>
2192
2193 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2194 correct BRLT entry size.
2195
ba8ca3e7
AM
21962013-07-03 Alan Modra <amodra@gmail.com>
2197
2198 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2199 comment.
2200
267257d2
CC
22012013-07-01 Cary Coutant <ccoutant@google.com>
2202
2203 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2204 reloc_type_.
2205 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2206 (Dwarf_ranges_table::lookup_reloc): New function.
2207 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2208 reloc_type_.
2209 (Dwarf_ranges_table::lookup_reloc): New function.
2210 (Dwarf_ranges_table::reloc_type_): New data member.
2211
06f30c9d
CC
22122013-06-27 Jing Yu <jingyu@google.com>
2213
2214 PR gold/15662
2215 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2216 function.
2217 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2218 (Target_powerpc::do_relax): Call the above.
2219
a2d7bf59
AM
22202013-06-27 Cary Coutant <ccoutant@google.com>
2221
2222 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2223 on garbage collected .opd section.
2224
22252013-06-27 Alan Modra <amodra@gmail.com>
2226
2227 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2228 is non-zero.
2229 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2230 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2231
32364e50
CC
22322013-06-14 Cary Coutant <ccoutant@google.com>
2233
2234 * resolve.cc (Symbol::override_base): Don't override st_type
2235 from plugin placeholder symbols.
2236 (Symbol_table::resolve): Likewise.
2237 (Symbol_table::should_override): Don't complain about TLS mismatch
2238 if the TO symbol is a plugin placeholder.
2239 * testsuite/Makefile.am (plugin_test_tls): New test.
2240 * testsuite/Makefile.in: Regenerate.
2241 * testsuite/plugin_test_tls.sh: New test script.
2242 * testsuite/two_file_test_2_tls.cc: New test source.
2243 * testsuite/two_file_test_tls.cc: New test source.
2244
7fb47cc9
CC
22452013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2246
2247 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2248 the maximum segment alignment is larger than the page size.
2249 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2250 correctly aligns the symbols with large alignemnt.
2251 * testsuite/Makefile.in: Regenerate.
2252 * testsuite/large_symbol_alignment.cc: New file.
2253
6934001a
CC
22542013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2255 Sriraman Tallam <tmsriram@google.com>
2256
2257 * options.h (sort_section): New option.
2258 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2259 Rename from Input_section_sort_section_name_special_ordering_compare.
2260 (Input_section_sort_section_name_compare): New struct.
2261 * output.cc (Output_section::Input_section_sort_section_name_compare::
2262 operator()): New function.
2263 (Output_section::sort_attached_input_sections): Use new sort function
2264 for .text if --sort-section=name is specified.
2265 * layout.cc (Layout::make_output_section):
2266 Add sorting by name when --sort-section=name is specified.
2267 * testsuite/Makefile.am (text_section_grouping): Test option
2268 --sort-section=name.
2269 * testsuite/Makefile.in: Regenerate.
2270 * testsuite/section_sorting_name.cc: New file.
2271 * testsuite/section_sorting_name.sh: New file.
2272
93acabad
CC
22732013-05-21 Cary Coutant <ccoutant@google.com>
2274
2275 * symtab.h (Symbol::is_cxx_vtable): New function.
2276 * target-reloc.h (relocate_section): Check for vtable symbol.
2277 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2278 * testsuite/Makefile.in: Regenerate.
2279 * testsuite/missing_key_func.cc: New test source.
2280 * testsuite/missing_key_func.sh: New test script.
2281
60e8b3fc
CC
22822013-05-21 Cary Coutant <ccoutant@google.com>
2283
2b64b551
RM
2284 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2285 type of enclosing symbol.
2286 (Relocate_info::location): Check symbol type when describing symbol.
2287 * object.h (Symbol_location_info): Remove unused line_number;
2288 add enclosing_symbol_type.
2289 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2290
9df9de2c
CC
22912013-05-13 Cary Coutant <ccoutant@google.com>
2292
2b64b551
RM
2293 * configure.ac: Export DEFAULT_TARGET.
2294 * configure: Regenerate.
2295 * Makefile.in: Regenerate.
2296 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2297 * testsuite/Makefile.in: Regenerate.
2298 * testsuite/debug_msg.sh: Delete duplicate tests.
2299 Don't check undef_int error message match for powerpc where the
2300 source file and line number aren't available.
9df9de2c 2301
bbc5ae17
RM
23022013-05-10 Roland McGrath <mcgrathr@google.com>
2303
2304 * options.h (General_options): Add --rosegment-gap option.
2305 * options.cc (finalize): --rosegment-gap implies --rosegment.
2306 * layout.cc (set_segment_offsets): Let user option override
2307 target->rosegment_gap().
2308
0c6e6c39
RM
23092013-05-10 Roland McGrath <mcgrathr@google.com>
2310
2311 * options.h (General_options): Remove leading space from help
2312 messages for -nostdlib and --rosegment.
2313
cde7cb01
MR
23142013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2315
2316 PR ld/15365
2317 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2318
f31ae5b8
AM
23192013-05-03 Alan Modra <amodra@gmail.com>
2320
2321 * merge.cc (Output_merge_string::do_add_input_section): Correct
2322 scan for number of strings. Rename vars to avoid shadowing.
2323 Include missing terminator in input_size_.
2324
d3a7cd45
L
23252013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2326
2327 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2328 Restore empty string handling.
2329
6ad3daba
CC
23302013-05-01 Cary Coutant <ccoutant@google.com>
2331
2332 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2333 uninitialized warning.
2334
e31908b6
CC
23352013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2336
2337 * output.cc (Output_section::add_merge_input_section): Allow
2338 to merge sections if the alignment is more than character size.
2339 * merge.h (Output_merge_string::Output_merge_string): Remove
2340 assert.
2341 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2342 only not-null strings. Check the alignment of strings.
2343 * stringpool.h
2344 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2345 alignment as the argument.
2346 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2347 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2348 Align non-zero length strings according to the addralign_.
2349 (Stringpool_template<Stringpool_char>::set_string_offsets):
2350 Updating offsets according to the given alignment.
2351 * testsuite/Makefile.am (text_section_grouping): Test if string
2352 literals are getting merged.
2353 * testsuite/Makefile.in: Regenerate.
2354 * testsuite/merge_string_literals_1.c: New file.
2355 * testsuite/merge_string_literals_2.c: Ditto.
2356 * testsuite/merge_string_literals.sh: Ditto.
2357
0e804863
ILT
23582013-04-26 Ian Lance Taylor <iant@google.com>
2359
2360 * target-reloc.h (relocate_section): If the reloc offset is out of
2361 range, pass VIEW as NULL to relocate.relocate.
2362 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2363 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2364 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2365 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2366 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2367 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2368
e7c5ea40
CC
23692013-04-26 Geoff Pike <gpike@chromium.org>
2370
2371 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2372 * layout.cc (Hash_task): New class.
2373 (Layout::queue_build_id_tasks): New function.
2374 (Layout::write_build_id): Handle single-thread portion of build ID
2375 computation. (In some cases, all of it is single-threaded.) Replace
2376 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2377 functionality in fewer lines of code.
2378 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2379 * options.h (General_options): make "--build-id" default to tree
2380 rather than sha1. Add two new options related to --build-id=tree:
2381 --build-id-chunk-size-for-treehash and
2382 --build-id-min-file-size-for-treehash.
2383 * Makefile.am: add testing of --build-id=tree and related new options
2384 (these tests will be invoked by "make check").
2385 * Makefile.in: Regenerate.
2386
49926cd0
AM
23872013-04-25 Alan Modra <amodra@gmail.com>
2388
2389 * configure.tgt: Add powerpcle and powerpc64le.
2390
a4034750
AM
23912013-04-22 Alan Modra <amodra@gmail.com>
2392
2393 PR gold/15355
2394 * layout.cc (Layout::segment_precedes): Allow more than one
2395 segment with the same type and flags.
2396
e79c84aa
CC
23972013-04-15 Cary Coutant <ccoutant@google.com>
2398
2399 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2400 allocate space in file for BSS sections.
2401
2199fbe7
CC
24022013-04-15 Cary Coutant <ccoutant@google.com>
2403
2404 * script-sections.cc (Orphan_output_section): Reset address
2405 to zero after each orphaned section for relocatable links.
2406
502e8a84
CC
24072013-04-15 Cary Coutant <ccoutant@google.com>
2408
a4034750
AM
2409 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2410 section starting address for relocatable link.
2411 * testsuite/Makefile.am (script_test_11): New test.
2412 * testsuite/Makefile.in: Regenerate.
2413 * testsuite/script_test_11.c: New source file.
2414 * testsuite/script_test_11.t: New linker script.
502e8a84 2415
0cfdc767
AM
24162013-04-13 Alan Modra <amodra@gmail.com>
2417
2418 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2419 owner when sections are not adjacent and exceed group size.
2420 (Target_powerpc::group_sections): Handle corner case.
2421 (Target_powerpc::Branch_info::make_stub): Handle case where
2422 stub table doesn't exist due to branches in non-exec sections.
2423 (Target_powerpc::Relocate::relocate): Likewise.
2424
6830ee24
AM
24252013-04-11 Alan Modra <amodra@gmail.com>
2426
2427 PR gold/15354
2428 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2429 .branch_lt to match bfd ld. Adjust comments throughout file.
2430
54a3d865
ILT
24312013-04-04 Ian Lance Taylor <iant@google.com>
2432
2433 GCC PR c++/56840
2434 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2435 sections before checking whether they are included in the link.
2436
9993ba11
ST
24372013-03-29 Sriraman Tallam <tmsriram@google.com>
2438
2439 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2440 object before calling the plugin claim_file handler. Pass the elf
2441 object of the archive to the plugin. Delete the elf object if the
2442 plugin claims the file.
2443
ebacd51e
AM
24442013-03-21 Alan Modra <amodra@gmail.com>
2445
2446 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2447 segment when omagic.
2448
117be58f
AM
24492013-03-21 Alan Modra <amodra@gmail.com>
2450
2451 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2452 comparison warning.
2453 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2454 uninitialized" warning.
2455
32e2b61d
AM
24562013-03-20 Alan Modra <amodra@gmail.com>
2457
2458 * symtab.h (Symbol::clear_version): New function.
2459 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2460 is_needed by weak references. Clear version for symbols defined
2461 in as-needed objects that are not needed.
2462
b3ccdeb5
AM
24632013-03-15 Alan Modra <amodra@gmail.com>
2464
2465 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2466 static and public. Add report_err param. Return false for data refs.
2467 (Target_powerpc::rela_dyn_section): New overloaded function.
2468 (Target_powerpc::plt_, iplt_): Elucidate.
2469 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2470 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2471 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2472 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2473 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2474 push_branch and make_plt_entry for ifunc syms when
2475 reloc_needs_plt_for_ifunc.
2476 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2477 for ifunc unless reloc_needs_plt_for_ifunc.
2478
ad3d8a2f
AM
24792013-03-15 Alan Modra <amodra@gmail.com>
2480
2481 * gc.h (gc_process_relocs): Don't look through function descriptors.
2482 * icf.cc (get_section_contents): Do so here instead.
2483
4d9aa155
AM
24842013-03-13 Alan Modra <amodra@gmail.com>
2485
2486 * powerpc.cc (is_branch_reloc): Forward declare.
2487 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2488 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2489 false for 64-bit, true for 32-bit non-branch relocs.
2490 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2491 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2492 nm output.
2493 (icf_safe_test): Generate linker map file as well as nm output.
2494 (icf_safe_so_test): Likewise.
2495 * testsuite/Makefile.in: Regenerate.
2496 * testsuite/icf_test.sh: Parse linker map file to determine
2497 section folding.
2498 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2499 * testsuite/icf_safe_so_test.sh: Likewise.
2500 (X86_32_or_ARM_specific_safe_fold): Merge into..
2501 (arch_specific_safe_fold): ..this.
2502 (X86_64_specific_safe_fold): Delete unused function.
2503
57420c20
AM
25042013-03-12 Alan Modra <amodra@gmail.com>
2505
2506 * gc.h (gc_process_relocs): Look through function descriptors
2507 to determine shndx, symvalue and addend used by ICF. Tidy
2508 variable duplication.
2509
dc3714f3
AM
25102013-03-11 Alan Modra <amodra@gmail.com>
2511
2512 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2513 * layout.cc (Layout_task_runner::run): ..to here.
2514 * symtab.h (struct Symbol_location): Extract from..
2515 (class Symbol_table): ..here.
2516 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2517 * target.h (class Target): Add function_location and
2518 do_function_location functions.
2519 (class Sized_target): Add do_function_location.
2520 * object.h (class Sized_relobj_file): Move find_shdr..
2521 (class Object): ..to here.
2522 * object.cc: Likewise. Update to suit. Instantiate.
2523 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2524 * powerpc.cc (class Powerpc_dynobj): New.
2525 (Target_powerpc::do_function_location): New function.
2526 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2527 (Powerpc_dynobj::do_read_symbols): New function.
2528 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2529
956b03bb
ILT
25302013-03-08 Ian Lance Taylor <iant@google.com>
2531
2532 * options.cc (General_options::string_to_object_format): Accept
2533 "default".
2534
4bead2d5
AM
25352013-03-08 Alan Modra <amodra@gmail.com>
2536
2537 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2538 pointer to Post_fde.
2539 (struct Post_fde): Move definition to here..
2540 * ehframe.cc (struct Post_fde): ..from here.
2541 (Cie::write): Don't alloc Post_fde.
2542 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2543
02e60bf7
AM
25442013-03-07 Alan Modra <amodra@gmail.com>
2545
2546 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2547 relocation referencing .LC0.
2548 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2549
8343f03a
AM
25502013-03-07 Alan Modra <amodra@gmail.com>
2551
2552 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2553 always_inline. Add assembly for powerpc to avoid GOT.
2554
3366d57c
AM
25552013-03-07 Alan Modra <amodra@gmail.com>
2556
2557 * testsuite/script_test_10.sh: Don't test .bss section
2558 header number.
2559
6c77229c
AM
25602013-03-06 Alan Modra <amodra@gmail.com>
2561
2562 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2563 (Target_powerpc::symval_for_branch): Add symtab param. Update
2564 all callers. Handle folded sections.
2565 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2566 to Powerpc_relobj.
2567 (Global_symbol_visitor_opd::operator()): Likewise.
2568
a39e4af6
AM
25692013-03-04 Alan Modra <amodra@gmail.com>
2570
2571 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2572 * testsuite/Makefile.in: Regenerate.
2573
d5834edb
CC
25742013-03-01 Cary Coutant <ccoutant@google.com>
2575
2576 Add dwp support for v2 DWARF package file format.
2577 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2578 tu_length parameter. Adjust all callers.
2579 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2580 * dwp.cc: Include dwarf.h.
2581 (Section_bounds): New struct type.
2582 (Unit_set): New struct type.
2583 (Dwo_file::Dwo_file): Initialize new data member.
2584 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2585 Combine and rename to...
2586 (Dwo_file::read_unit_index): ...this.
2587 (Dwo_file::sized_read_compunit_index)
2588 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2589 (Dwo_file::sized_read_unit_index): ...this.
2590 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2591 parameters; add section_id parameter.
2592 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2593 (Dwo_file::add_unit_set): ...this.
2594 (Dwo_file::shndx_map_): Remove.
2595 (Dwo_file::sect_offsets_): New data member.
2596 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2597 (Dwp_output_file::add_section): Rename to...
2598 (Dwp_output_file::add_contribution): ...this.
2599 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2600 (Dwp_output_file::add_tu_set): Likewise.
2601 (Dwp_output_file::Contribution): New type.
2602 (Dwp_output_file::Section::contributions): New data member.
2603 (Dwp_output_file::Cu_or_tu_set): Remove.
2604 (Dwp_output_file::Section::Section): New ctor.
2605 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2606 (Dwp_output_file::Dwp_index::Section_table): New type.
2607 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2608 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2609 parameter.
2610 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2611 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2612 (Dwp_output_file::Dwp_index::section_table): New member function.
2613 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2614 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2615 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2616 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2617 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2618 (Dwp_output_file::Dwp_index::section_table_): New data member.
2619 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2620 (Dwp_output_file::add_output_section): New member function.
2621 (Dwp_output_file::write_new_section): New member function.
2622 (Dwp_output_file::write_contributions): New member function.
2623 (Dwp_output_file::section_id_map_): New data member.
2624 (class Dwo_id_info_reader): Remove.
2625 (class Unit_reader): New class.
2626 (get_dwarf_section_name): New function.
2627 (Dwo_file::read_executable): Adjust initializations of class data.
2628 (Dwo_file::read): Add support for v2 package file format.
2629 (Dwo_file::read_unit_index): Likewise.
2630 (Dwo_file::sized_read_unit_index): Likewise.
2631 (Dwo_file::copy_section): Likewise.
2632 (Dwo_file::add_unit_set): Likewise.
2633 (Dwp_output_file::add_output_section): Likewise.
2634 (Dwp_output_file::add_contribution): Likewise.
2635 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2636 for empty slot.
2637 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2638 file format.
2639 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2640 slot.
2641 (Dwp_output_file::initialize): Remove unused function.
2642 (Dwp_output_file::finalize): Add support for v2 package file format.
2643 (Dwp_output_file::write_index): Likewise.
2644 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2645 function prototype.
2646
a68a081d
CC
26472013-03-01 Cary Coutant <ccoutant@google.com>
2648
2649 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2650 function into class definition in header file.
2651 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2652 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2653 New function.
2654 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2655
9d5781f8
AM
26562013-02-28 Alan Modra <amodra@gmail.com>
2657
2658 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2659 * target.cc (Target::do_plt_fde_location): New function.
2660 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2661 accessor function, and constructor param.
2662 (struct Post_fde, Post_fdes): Declare.
2663 (Cie::write): Add post_fdes param.
2664 * ehframe.cc (Fde::write): Use plt_fde_location.
2665 (struct Post_fde): Define.
2666 (Cie::write): Stash FDEs added post merge mapping.
2667 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2668 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2669 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2670 other FDEs.
2671 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2672 (Target_powerpc::has_glink): New function.
2673 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2674 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2675 glink_eh_frame_fde_32, default_fde): New data.
2676 (Stub_table::eh_frame_added_): New var.
2677 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2678 Make const.
2679 (Stub_table::add_eh_frame): New function.
2680 (Output_data_glink::add_eh_frame): New function.
2681 (Target_powerpc::make_glink_section): Call add_eh_frame.
2682
214383dd
ILT
26832013-02-15 Ian Lance Taylor <iant@google.com>
2684
2685 * options.h (DEFINE_uint64_alias): Define.
2686 (class General_options): Add -Ttext-segment as an alias for
2687 -Ttext.
2688
91c2b899
AM
26892013-02-15 Alan Modra <amodra@gmail.com>
2690
2691 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2692 (Stub_table::do_write): ..here, two places.
2693 (Stub_table::plt_call_size): Use it here too.
2694
20e2a8aa
ILT
26952013-02-11 Ian Lance Taylor <iant@google.com>
2696
2697 * descriptors.cc (Descriptors::close_all): New function.
2698 * descriptors.h (class Descriptors): Declare close_all.
2699 (close_all_descriptors): New inline function.
2700 * plugin.cc: Include "descriptors.h".
2701 (Plugin_manager::cleanup): Call close_all_descriptors.
2702
8952bc69
AM
27032013-02-06 Alan Modra <amodra@gmail.com>
2704
2705 * README: Update coding style link.
2706
29bd8b6b
CC
27072013-01-28 Cary Coutant <ccoutant@google.com>
2708
a4034750
AM
2709 * dwp.cc (File_list): New typedef.
2710 (Dwo_name_info_reader): New class.
2711 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2712 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2713 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2714 (Dwo_file::read_executable): New function.
2715 (Dwo_file::read): Move common setup code to ...
2716 (Dwo_file::make_object): ... here.
2717 (dwp_options): Add --exec/-e.
2718 (usage): Likewise.
2719 (main): Likewise.
29bd8b6b 2720
c6ac678d
ST
27212013-01-24 Sriraman Tallam <tmsriram@google.com>
2722
2723 * layout.cc (Layout::layout): Check for option text_reorder.
2724 (Layout::make_output_section): Ditto.
2725 * options.h (text_reorder): New option.
2726 * output.cc (Input_section_sort_compare): Remove special ordering
2727 of section names.
2728 (Output_section::
2729 Input_section_sort_section_name_special_ordering_compare::
2730 operator()): New function.
2731 (Output_section::sort_attached_input_sections): Use new sort function
2732 for .text.
2733 * output.h (Input_section_sort_section_name_special_ordering_compare):
2734 New struct.
2735 * testsuite/Makefile.am (text_section_grouping): Test option
2736 --no-text-reorder
2737 * testsuite/Makefile.in: Regenerate.
2738 * testsuite/text_section_grouping.sh: Check order of functions without
2739 default text reordering.
2740
50701cc1
MF
27412013-01-18 Mike Frysinger <vapier@gentoo.org>
2742
2743 * options.h (General_options): Change default to true for new_dtags.
2744
b1b00fcc
MF
27452013-01-18 Mike Frysinger <vapier@gentoo.org>
2746
2747 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2748 when enable_new_dtags is false. Only add DT_RUNPATH when
2749 enable_new_dtags is true.
2750
ec5b8187
AM
27512013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2752
2753 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2754 used in declaration and definition consistent.
2755 (Target_powerpc::symval_for_branch): Ditto.
2756
a880d4c4
ST
27572013-01-16 Sriraman Tallam <tmsriram@google.com>
2758
2759 * testsuite/plugin_final_layout.cc: Fix comment.
2760
7c381248
ST
27612013-01-16 Sriraman Tallam <tmsriram@google.com>
2762
2763 * layout.cc (Layout::layout): Do not do default sorting for
2764 text sections when section ordering is specified.
2765 (make_output_section): Ditto.
2766 * testsuite/plugin_final_layout.cc: Name the function sections
2767 to catch reordering issues.
2768
e2458743
AM
27692013-01-15 Alan Modra <amodra@gmail.com>
2770
2771 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2772 plt-thread-safe.
2773
431ed302
AM
27742013-01-15 Alan Modra <amodra@gmail.com>
2775
2776 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2777 * testsuite/Makefile.in: Regenerate.
2778
0ec6429b
AM
27792013-01-14 Alan Modra <amodra@gmail.com>
2780
2781 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2782 * testsuite/Makefile.in: Regenerate.
2783
0bf402d5
ILT
27842013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2785
36af3926 2786 PR bfd/14430
0bf402d5
ILT
2787 Fix mingw gold build with plugins enabled
2788 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2789 * configure.ac: Export DLOPEN_LIBS and add headers check.
2790 * plugin.cc: Handle non-dlfcn case.
2791 * Makefile.in: Regenerate.
2792 * config.in: Regenerate.
2793 * configure: Regenerate.
2794 * testsuite/Makefile.in: Regenerate.
2795
9e9143bc
ST
27962013-01-09 Sriraman Tallam <tmsriram@google.com>
2797
2798 * output.h (sort_attached_input_sections): Change to be public.
2799 * script-sections.cc
2800 (Output_section_definition::set_section_addresses): Sort
2801 attached input sections according to section order before linker
2802 script assigns section addresses.
2803 (Orphan_output_section::set_section_addresses): Sort
2804 attached input sections according to section order before linker
2805 script assigns section addresses.
2806 * Makefile.am (final_layout.sh): Use a simple linker script to
2807 check if section ordering still works.
2808 * Makefile.in: Regenerate.
2809
679af368
ILT
28102013-01-09 Ben Cheng <bccheng@google.com>
2811
2812 * arm.cc (Target_arm::attributes_accept_div): New function.
2813 (Target_arm::attributes_forbid_div): New function.
2814 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2815 attribute using the same new functions as what bfd/elf32_arm.c
2816 does.
2817
3136a00e
CC
28182013-01-07 Cary Coutant <ccoutant@google.com>
2819
2820 PR gold/14993
2821 * output.cc (Output_section::add_input_section): For incremental
2822 updates, don't track input sections that are allocated from patch
2823 space.
2824
f2a6224b
L
28252013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2826 Ian Lance Taylor <iant@google.com>
2827
2828 PR gold/14897
2829 * configure.ac (--enable-ld): Removed.
2830 (install_as_default): Set to yes only for --enable-gold=default
2831 or --disable-ld.
2832 * configure: Regenerated.
2833
4f46f626
L
28342013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2835
2836 * options.h (General_options): Add -fuse-ld= for GCC linker
2837 option compatibility.
2838
26e4ef59
CC
28392013-01-04 Cary Coutant <ccoutant@google.com>
2840
2841 * configure.ac: Fix typo restoring CXXFLAGS.
2842 * configure: Regenerate.
2843
3d587466
CC
28442013-01-04 Cary Coutant <ccoutant@google.com>
2845
4f46f626
L
2846 * testsuite/Makefile.am (CXXLINK_S): New macro.
2847 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2848 * testsuite/Makefile.in: Regenerate.
3d587466 2849
44db6695
L
28502013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2851
2852 * version.cc (print_version): Update copyright year to 2013.
2853
edcac0c1
ILT
28542012-12-20 Ian Lance Taylor <iant@google.com>
2855
2856 * layout.cc (Layout::special_ordering_of_input_section): New
2857 function.
2858 (Layout::layout): If input section requires special ordering, must
2859 sort input sections.
2860 (Layout::make_output_section): May sort .text input sections.
2861 (Layout::is_section_name_prefix_grouped): Remove.
2862 * layout.h (class Layout): Declare
2863 special_ordering_of_input_section. Don't declare
2864 is_section_name_prefix_grouped.
2865 * output.cc (Output_section::add_input_section): Revert last
2866 change.
2867 (Output_section::Input_section_sort::match_file_name): Don't crash
2868 if called on output section data.
2869 (Output_section::Input_section_sort_compare): Sort based on
2870 special ordering.
2871 (Output_section::Input_section_sort_section_order_index_compare):
2872 Revert last patch.
2873 (Output_section::sort_attached_input_sections): Likewise.
2874
28f2a4ac
ST
28752012-12-18 Sriraman Tallam <tmsriram@google.com>
2876
edcac0c1 2877 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2878 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2879 * output.cc (Output_section::add_input_section): Check if section
2880 name contains special prefix. Keep input sections to sort such
2881 sections.
2882 (Output_section::Input_section_sort_section_order_index_compare
2883 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2884 (Output_section::sort_attached_input_sections): Add condition to
2885 Input_section_entry constructor call.
28f2a4ac
ST
2886 * testsuite/Makefile.am (text_section_grouping): New test.
2887 * testsuite/Makefile.in: Regenerate.
2888 * testsuite/text_section_grouping.cc: New file.
2889 * testsuite/text_section_grouping.sh: New file.
2890
5bf135a7
NC
28912012-12-17 Nick Clifton <nickc@redhat.com>
2892
2893 * Makefile.am: Add copyright notice.
2894 * NEWS: Likewise.
2895 * README: Likewise.
2896 * configure.ac: Likewise.
2897 * ftruncate.c: Likewise.
2898 * Makefile.in: Regenerate.
2899
59965708
CC
29002012-12-14 Cary Coutant <ccoutant@google.com>
2901
a4034750
AM
2902 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2903 --no-as-needed flag.
2904 (exception_separate_shared_12_test): Likewise.
2905 (incremental_copy_test): Likewise.
2906 * testsuite/Makefile.in: Regenerate.
59965708 2907
2a77e2ab
CC
29082012-12-14 Cary Coutant <ccoutant@google.com>
2909
2910 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2911 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2912
e3deeb9c
AM
29132012-12-12 Alan Modra <amodra@gmail.com>
2914
2915 * powerpc.cc (class Track_tls): New.
2916 (class Relocate, class Scan): Inherit Track_tls.
2917 (Target_powerpc::Scan::local, global): Track tls optimization
2918 and avoid creating plt entry for __tls_get_addr if all uses
2919 are optimized away.
2920 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2921
d8f5a274
AM
29222012-12-12 Alan Modra <amodra@gmail.com>
2923
2924 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2925 Replace no_toc_optimize with toc_optimize.
2926 * output.h (Output_section::input_sections): Provide non-const variant.
2927 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2928 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2929 accessors.
2930 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2931 (class Sort_toc_sections): New.
2932 (Target_powerpc::do_finalize_sections): Sort toc sections.
2933 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2934
4c8a1de1
RM
29352012-12-10 Roland McGrath <mcgrathr@google.com>
2936
2937 * testsuite/binary_unittest.cc (read_all): New function.
2938 (Sized_binary_test): Use it instead of ::read.
2939 * fileread.cc (do_read): Don't assume pread always reads the whole
2940 amount in a single call.
2941
edc27beb
AM
29422012-12-10 Alan Modra <amodra@gmail.com>
2943
2944 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2945 Set EM_PPC64 or EM_PPC here.
2946 (Target_selector_powerpc::do_recognize): Delete.
2947
906b9150
AM
29482012-12-10 Alan Modra <amodra@gmail.com>
2949
2950 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2951 stub_table_.
2952 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2953
418c15ae
RM
29542012-12-07 Roland McGrath <mcgrathr@google.com>
2955
2956 * testsuite/binary_unittest.cc (Sized_binary_test):
2957 Use open_descriptor rather than ::open.
2958
decdd3bc
AM
29592012-12-07 Alan Modra <amodra@gmail.com>
2960
2961 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2962 typedef and invalid_address constant.
2963 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2964 instantiate constants.
2965
db399005
ILT
29662012-12-06 Roland McGrath <mcgrathr@google.com>
2967
2968 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2969 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2970 * aclocal.m4: Regenerate.
2971 * configure: Regenerate.
2972 * Makefile.in: Regenerate.
2973 * testsuite/Makefile.in: Regenerate.
2974
aba6bc71
AM
29752012-12-07 Alan Modra <amodra@gmail.com>
2976
2977 * options.h (General_options): Add no_toc_optimize.
2978 * powerpc.cc (ok_lo_toc_insn): New function.
2979 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2980
9e69ed50
AM
29812012-12-06 Alan Modra <amodra@gmail.com>
2982
2983 * options.h (General_options): Add plt_align, plt_static_chain,
2984 plt_thread_safe. Update stub_group_size help text.
2985 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2986 for new plt_thread_safe_ var.
2987 (use_plt_offset): Correct comments.
2988 (Target_powerpc::do_relax): Look for thread creation symbols to
2989 determine default plt_thread_safe value. Clear plt call stubs
2990 as well as branch stubs each iteration.
2991 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2992 insn constants.
2993 (l, hi, ha, write_insn): Move earlier.
2994 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2995 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2996 plt stubs too.
2997 (Stub_table::update_size): Adjust.
2998 (Stub_table::prev_size, set_prev_size): Delete.
2999 (Stub_table::stub_align): Let --plt-align affect result.
3000 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3001 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3002 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3003 (Stub_table::do_write): Support more stub variants.
3004
f43ba157
AM
30052012-12-04 Alan Modra <amodra@gmail.com>
3006
3007 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3008 (Target_powerpc::do_define_standard_symbols): New function.
3009
34171bc5
AM
30102012-12-03 Alan Modra <amodra@gmail.com>
3011
3012 * output.h: Formatting, whitespace.
3013
dc9589e9 30142012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3015
3016 * layout.h (Layout::get_executable_sections): Declare.
3017 * layout.cc (Layout::get_executable_sections): New function.
3018 * arm.cc (Target_arm::group_sections): Use it.
3019 (Arm_output_section::group_sections): Delete now redundant test.
3020 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3021 param to handle relative relocs.
3022 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3023 (Output_data_reloc::add_absolute): Adjust.
3024 (Output_data_reloc::add_relative): New function.
3025 (Output_data::reset_data_size): New function.
3026 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3027 (Output_section::set_addralign): New function.
3028 (Output_section::checkpoint_set_addralign): New function.
3029 (Output_section::clear_section_offsets_need_adjustment): New function.
3030 (Output_section::input_sections): Make public.
3031 * powerpc.cc (class Output_data_brlt_powerpc): New.
3032 (class Stub_table, class Stub_control): New.
3033 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3034 stub_table_, set_stub_table, stub_table): New vectors and accessor
3035 functions.
3036 (Target_powerpc::do_may_relax, do_relax, push_branch,
3037 new_stub_table, stub_tables, brlt_section, group_sections,
3038 add_branch_lookup_table, find_branch_lookup_table,
3039 write_branch_lookup_table, make_brlt_section): New functions.
3040 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3041 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3042 branch_info_): New vars.
3043 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3044 make call stubs here.
3045 (Output_data_glink): Remove all call stub handling from this class.
3046 (Target_powerpc::Scan::local, global): Save interesting branch
3047 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3048 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3049 functions on final link.
3050 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3051 Handle long branch destinations too.
3052 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3053 do_plt_address_for_local): Adjust lookup of plt call stubs.
3054
627b30b7
AM
30552012-11-30 Alan Modra <amodra@gmail.com>
3056
3057 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3058 relocs against protected symbols when building 32-bit shared libs.
3059
40b469d7
AM
30602012-11-30 Alan Modra <amodra@gmail.com>
3061
3062 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3063 param. Call got_section() to make .got. Update all callers
3064 and their callers and so on.
3065
bb66a627
AM
30662012-11-30 Alan Modra <amodra@gmail.com>
3067
3068 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3069 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3070 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3071 value if it already exists.
3072
d2cf1c6c
L
30732012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3074
3075 PR gold/14858
3076 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3077
edccdf7c
RM
30782012-11-14 Roland McGrath <mcgrathr@google.com>
3079
3080 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3081 than bfc instruction for data sandboxing.
3082
6febeb74
AM
30832012-11-08 Alan Modra <amodra@gmail.com>
3084
3085 * po/POTFILES.in: Regenerate.
3086
0a6f1bf2
AM
30872012-11-05 Alan Modra <amodra@gmail.com>
3088
3089 * configure.ac: Apply 2012-09-10 change to config.in here.
3090 * configure: Regenerate.
3091
26a4e9cb
AM
30922012-11-05 Alan Modra <amodra@gmail.com>
3093
3094 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3095 (struct Opd_ent): Use "Address" rather than "Offset".
3096 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3097 (Target_powerpc::got_section): Make public.
3098 (Target_powerpc::scan_relocs): Move code setting symbols..
3099 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3100 Create _SDA_BASE_ only when referenced.
3101
cc928013
RM
31022012-11-02 Roland McGrath <mcgrathr@google.com>
3103
3104 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3105 from last change.
3106
50ed5eb1
RM
31072012-11-01 Roland McGrath <mcgrathr@google.com>
3108
62fe925a
RM
3109 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3110 for offset_in_output_section parameter.
3111 (Sized_target::relocate_special_relocatable): Likewise.
3112 * arm.cc (Target_arm::relocate_relocs): Likewise.
3113 (Target_arm::relocate_special_relocatable): Likewise.
3114 * i386.cc (Target_i386::relocate_relocs): Likewise.
3115 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3116 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3117 * target-reloc.h (relocate_relocs): Likewise.
3118 * testsuite/testfile.cc (Target_test): Likewise.
3119 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3120 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3121
3122 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3123 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3124
3125 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3126 parameter, which is unused in the [!F_SETFD] case.
3127
50ed5eb1
RM
3128 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3129 SYMNDX to off_t before comparing it to this->data_size().
3130 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3131 * incremental.cc (Output_section_incremental_inputs::do_write):
3132 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3133
2cadc0bf
RM
3134 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3135
3bfcb652
NC
31362012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3137
3138 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3139 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3140 in EABI_VER5.
3141
c1a8d56e
CC
31422012-10-29 Cary Coutant <ccoutant@google.com>
3143
3144 * dwp.cc (usage): Add file and exit status parameters;
3145 add --help and --version options.
3146 (print_version): New function.
3147 (main): Add --help and --version options.
3148
b2490a7b
L
31492012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3150
3151 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3152 final_layout_sequence.txt.
3153 * testsuite/Makefile.in: Regenerated.
3154
aa543512
L
31552012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3156
3157 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3158 COMPILE generated by automake.
3159 (LINK1): Likewise.
3160 (CXXCOMPILE1): Likewise.
3161 (CXXLINK1): Likewise.
3162 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3163 (LINK): Likewise.
3164 (CXXCOMPILE): Likewise.
3165 (CXXLINK): Likewise.
3166 * testsuite/Makefile.in: Regenerated.
3167
d361fafb
L
31682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3169
3170 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3171 on bad fwrite return.
3172
598c7410
L
31732012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3174
3175 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3176 on val.
3177
35c813e2
CC
31782012-10-23 Cary Coutant <ccoutant@google.com>
3179
3180 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3181 * testsuite/Makefile.in: Regenerate.
3182 * testsuite/dwp_test.h: New source file.
3183 * testsuite/dwp_test_1.cc: New source file.
3184 * testsuite/dwp_test_1.s: New source file.
3185 * testsuite/dwp_test_1.sh: New source file.
3186 * testsuite/dwp_test_1b.cc: New source file.
3187 * testsuite/dwp_test_1b.s: New source file.
3188 * testsuite/dwp_test_2.cc: New source file.
3189 * testsuite/dwp_test_2.s: New source file.
3190 * testsuite/dwp_test_2.sh: New source file.
3191 * testsuite/dwp_test_main.cc: New source file.
3192 * testsuite/dwp_test_main.s: New source file.
3193
77429909
CC
31942012-10-23 Cary Coutant <ccoutant@google.com>
3195
3196 * dwp.h: New header file.
3197 * dwp.cc: New source file.
3198 * gold.h: Move shared declarations to system.h.
3199 * system.h: New header file.
3200 * Makefile.am: Add dwp.
3201 * Makefile.in: Regenerate.
3202
ed5d6712
CC
32032012-10-23 Cary Coutant <ccoutant@google.com>
3204
3205 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3206 Dwarf_info_reader::read_from_pointer.
3207 (Dwarf_pubnames_table::read_header): Likewise.
3208 (Dwarf_pubnames_table::next_name): Likewise.
3209 (Dwarf_die::read_attributes): Likewise.
3210 (Dwarf_die::skip_attributes): Likewise.
3211 (Dwarf_info_reader::read_from_pointer): New function template.
3212 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3213 (Dwarf_pubnames_table): Likewise.
3214 (Dwarf_info_reader::read_from_pointer): New function template.
3215 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3216 Dwarf_pubnames_table ctor.
3217
8787852d
CC
32182012-10-23 Cary Coutant <ccoutant@google.com>
3219
3220 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3221 abbrev_shndx.
3222 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3223 abbrev_shndx_.
3224 (Dwarf_info_reader::set_abbrev_shndx): New method.
3225 (Dwarf_info_reader::abbrev_shndx_): New data member.
3226
9fc236f3
CC
32272012-10-23 Cary Coutant <ccoutant@google.com>
3228
3229 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3230 from object, not parameters.
3231 (Dwarf_info_reader::parse): Likewise.
3232 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3233 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3234 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3235 methods.
3236
effe8365
CC
32372012-10-23 Cary Coutant <ccoutant@google.com>
3238
3239 * fileread.cc (Input_file::Input_file): New constructor.
3240 * fileread.h (class Input_file): Add new constructor.
3241
1698990d
AM
32422012-10-18 Alan Modra <amodra@gmail.com>
3243
3244 PR gold/14727
3245 * object.cc (Relobj::is_section_name_included): Also match
3246 .sdata personality section.
3247
168a4726
AM
32482012-10-18 Alan Modra <amodra@gmail.com>
3249
3250 * target-reloc.h (class Default_comdat_behavior): New, package up..
3251 (get_comdat_behaviour): ..this.
3252 (relocate_section): Add Relocate_comdat_behavior template arg,
3253 adjust code to suit.
3254 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3255 (Target_arm::scan_reloc_section): Likewise.
3256 * i386.cc (Target_i386::relocate_section): Likewise.
3257 * sparc.cc (Target_sparc::relocate_section): Likewise.
3258 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3259 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3260 * powerpc.cc (class Relocate_comdat_behavior): New.
3261 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3262 gold::relocate_section with new template arg.
3263
acc276d8
AM
32642012-10-18 Alan Modra <amodra@gmail.com>
3265
3266 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3267 dynamic relocs for GOT_TPREL got entries, without symbol if
3268 resolving locally.
3269 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3270 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3271 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3272
e10f9870
AM
32732012-10-17 Alan Modra <amodra@gmail.com>
3274
3275 PR gold/14726
3276 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3277
ae034989
ST
32782012-10-16 Sriraman Tallam <tmsriram@google.com>
3279
3280 * layout.cc (Layout::include_section): Keep sections marked
3281 SHF_EXCLUDE when doing relocatable links.
3282
f3a0ed29
AM
32832012-10-16 Alan Modra <amodra@gmail.com>
3284
3285 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3286 (Target_powerpc::do_finalize_sections): Call it.
3287 (Output_data_save_res): New class and supporting functions.
3288 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3289 normal symbols defined in object files.
3290
c6de8ed4
AM
32912012-10-12 Alan Modra <amodra@gmail.com>
3292
3293 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3294 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3295 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3296 section if scan_opd_relocs not yet called.
3297 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3298
03e25981
AM
32992012-10-12 Alan Modra <amodra@gmail.com>
3300
3301 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3302 add_local_ifunc_entry): Revert last change.
3303 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3304
c9824451
AM
33052012-10-05 Alan Modra <amodra@gmail.com>
3306
3307 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3308 do_plt_address_for_global): New functions.
3309 (Output_data_got_powerpc::do_write): Don't segfault when linking
3310 statically.
3311 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3312 add_local_ifunc_entry): Return true on adding entry..
3313 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3314 glink->add_entry call. Remove unused symtab param. Adjust calls.
3315 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3316 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3317 set up symbols here.
3318 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3319 syms here. Do so even when no .iplt. Don't segfault when linking
3320 statically.
3321 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3322 new variants without reloc param.
3323 (Glink_sym_ent::Glink_sym_ent): Likewise.
3324 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3325 reloc when refs will resolve to plt call stub.
3326 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3327 R_PPC_PLTREL24 to resolve locally.
3328 (Target_powerpc::Scan::global): Correct ifunc handling.
3329 (Target_powerpc::Relocate::relocate): Correct local sym glink
3330 lookup. Don't destroy "value" when we have a plt call stub,
3331 and when checking plt call validity.
3332 (Target_powerpc::do_dynsym_value): Simplify.
3333
19fec8c1
AM
33342012-10-05 Alan Modra <amodra@gmail.com>
3335
3336 * i386.cc (Output_data_plt_i386::address_for_global,
3337 address_for_local): Add plt offset to returned value. Adjust uses.
3338 * sparc.cc (Output_data_plt_sparc::address_for_global,
3339 address_for_local): Likewise.
3340 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3341 address_for_local): Likewise.
3342 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3343 address_for_local): Likewise.
3344 * target.h (Target::plt_address_for_global, plt_address_for_local):
3345 Update comment.
3346 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3347 (Output_data_got::Got_entry::write): Nor here.
3348 * output.h: Comment fix.
3349
e867b647
WL
33502012-10-02 Jiong Wang <jiwang@tilera.com>
3351
3352 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3353 global_offset_table_ value for larget got.
3354 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3355
e5d5f5ed
AM
33562012-09-29 Alan Modra <amodra@gmail.com>
3357
3358 * powerpc.cc (Target_powerpc::iplt_): New output section.
3359 (Target_powerpc::iplt_section, make_iplt_section,
3360 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3361 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3362 Target_powerpc::plt_entry_count): Count iplt entries too.
3363 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3364 reloc section in constructor. New params.
3365 (Target_powerpc::make_plt_section): Create reloc section here instead.
3366 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3367 functions.
3368 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3369 (Output_data_glink::add_entry, find_entry): New functions to
3370 deal with local syms.
3371 (Glink_sym_ent): Add support for local syms.
3372 (Output_data_glink::do_write): Handle ifunc plt entries.
3373 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3374 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3375 (Target_powerpc::Relocate::relocate): Likewise.
3376 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3377
ec4dbad3
AM
33782012-09-25 Alan Modra <amodra@gmail.com>
3379
3380 * object.h (Sized_relobj_file::adjust_local_symbol,
3381 do_adjust_local_symbol): New functions.
3382 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3383 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3384 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3385 and irregular opd entry spacing.
3386 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3387 (Global_symbol_visitor_opd): New functor.
3388 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3389 on deleted opd entries.
3390
5c0b3823
WL
33912012-09-15 Jiong Wang <jiwang@tilera.com>
3392
3393 * tilegx.cc: New file.
3394 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3395 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3396 * configure.tgt: Add entries for tilegx*.
3397 * configure.ac: Likewise.
3398 * Makefile.in: Rebuild.
3399 * configure: Likewise.
3400 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3401 tilegx.
3402
bfdfa4cd
AM
34032012-09-13 Alan Modra <amodra@gmail.com>
3404
3405 * target-reloc.h (scan_relocs): Call scan.local for relocs
3406 against symbols in discarded sections. Pass is_discarded
3407 param.
3408 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3409 Add is_discarded param.
3410 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3411 is_discarded to flag opd entry as discarded. Don't emit dyn
3412 relocs on such entries.
3413 (Target_powerpc::Scan::global): Similarly detect and handle
3414 such opd entries.
3415 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3416 opd_ent_. Update all uses.
3417 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3418 (Target_powerpc::relocate_section): Zero out discarded opd
3419 entry relocs.
3420
d77a0555
ILT
34212012-09-12 Ian Lance Taylor <iant@google.com>
3422
3423 PR gold/14570
3424 * output.cc: Rename Output_data_got template parameter from size
3425 to got_size for all functions. Compile all variants of
3426 Output_data_got.
3427 (Output_data_got::Got_entry::write): Correct use of size for
3428 symbol value. Use local_is_tls rather than casting to
3429 Sized_relobj_file.
3430 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3431 (class Sized_relobj_file): Add do_local_is_tls.
3432 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3433
815a1205
AM
34342012-09-11 Alan Modra <amodra@gmail.com>
3435
3436 PR gold/14566
3437 * layout.cc (Layout::set_segment_offsets): When using
3438 common-page-size alignment, ensure we are on a new max-page-size
3439 page.
3440 * output.cc (Output_segment::set_section_addresses): Use
3441 abi_pagesize, not common_pagesize for relro boundary.
3442 (Output_segment::set_offset): Likewise.
3443
bd73a62d
AM
34442012-09-11 Alan Modra <amodra@gmail.com>
3445
3446 * output.h (Output_data_got::add_global_tls, add_local_tls,
3447 add_local_tls_pair): New functions.
3448 (Output_data_got::add_local_pair_with_rel): Remove second
3449 reloc param. Expand comment.
3450 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3451 use_plt_or_tls_offset_, similarly for constructor param.
3452 (Output_data_got::Got_entry::write): Add got_index param.
3453 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3454 add_local_tls_pair): New functions.
3455 (Output_data_got::Got_entry::write): Handle tls symbols
3456 with use_plt_or_tls_offset_ set specially.
3457 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3458 (Output_data_got::do_write): Replace iterator with index, pass
3459 index to entry write function.
3460 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3461 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3462 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3463 call.
3464 * i386.cc (Target_i386::Scan::local): Likewise.
3465 * sparc.cc (Target_sparc::Scan::local): Likewise.
3466 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3467 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3468 do_tls_offset_for_global): New functions.
3469 (Target_powerpc::Scan::local): Correct TLS relocations and got
3470 entry values.
3471 (Target_powerpc::Scan::global): Don't emit unnecessary
3472 dynamic relocations on TLS GOT entries.
3473
00716ab1
AM
34742012-09-10 Matthias Klose <doko@ubuntu.com>
3475
3476 * config.in: Disable sanity check for kfreebsd.
3477
c891b3f9
SA
34782012-09-10 Sterling Augustine <saugustine@google.com>
3479
3480 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3481 (Gdb_index::pubtypes_read): New parameter.
3482 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3483 to calls.
3484 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3485 pubtypes_object_.
3486
e81fea4d
AM
34872012-09-09 Alan Modra <amodra@gmail.com>
3488
3489 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3490 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3491 * gc.h (gc_process_relocs): Call target gc_add_reference.
3492 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3493 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3494 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3495 unnecessary cast.
3496 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3497 to cater for when we don't need code offset. Update use.
3498 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3499 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3500 set_opd_valid): New functions.
3501 (Target_powerpc::do_gc_add_reference): New function.
3502 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3503 stashed refs.
3504 (Target_powerpc::do_gc_mark_symbol): New function.
3505
d2d60eef
CC
35062012-09-06 Cary Coutant <ccoutant@google.com>
3507
3508 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3509 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3510 (Dwarf_die::skip_attributes): Likewise.
3511 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3512 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3513 (main): Call it.
3514 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3515
32ed4573
L
35162012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3517
3518 * testsuite/script_test_3.t: Add .got.plt output section
3519 statement.
3520 * testsuite/script_test_4.t: Likewise.
3521
f4baf0d4
AM
35222012-09-05 Alan Modra <amodra@gmail.com>
3523
3524 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3525 update all uses and lose "enum" when using type.
3526
864a1b56
AM
35272012-09-05 Alan Modra <amodra@gmail.com>
3528
3529 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3530 * configure: Regenerate.
3531 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3532 (plugin_final_layout.stdout): Likewise.
3533 (memory_test): Set page sizes to 0x1000.
3534 * testsuite/Makefile.in: Regenerate.
3535 * testsuite/discard_locals_test.sh: Add FIXME comment.
3536 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3537 * testsuite/pr14265.t: Add .got output section statement.
3538 * testsuite/script_test_2.t: Likewise.
3539 * testsuite/script_test_3.t: Likewise.
3540 * testsuite/script_test_4.t: Likewise.
3541 * testsuite/script_test_5.t: Likewise.
3542 * testsuite/script_test_6.t: Likewise.
3543 * testsuite/script_test_7.t: Likewise.
3544 * testsuite/script_test_9.t: Likewise.
3545
3ea0a085
AM
35462012-09-05 Alan Modra <amodra@gmail.com>
3547
3548 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3549 (Powerpc_relocate_functions::Status): New typedef.
3550 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3551 (Target_powerpc::Scan::local): Handle REL64.
3552 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3553 for REL32 and REL64.
3554 (Target_powerpc::symval_for_branch): New function, extracted from..
3555 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3556 checks. Report overflow errors.
3557
7404fe1b
AM
35582012-09-05 Alan Modra <amodra@gmail.com>
3559
3560 * object.h (Sized_relobj_file::emit_relocs): Delete.
3561 (Sized_relobj_file::emit_relocs_reltype): Delete.
3562 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3563 relocate_relocs for --emit-relocs.
3564 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3565 * output.h: Update comment.
3566 (Output_segment::first_section): New function.
3567 (Output_segment::first_section_load_address): Use first_section.
3568 * output.cc (Output_segment::first_section): New function extracted..
3569 (Output_segment::first_section_load_address): ..from here. Delete.
3570 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3571 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3572 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3573 adjust call to target.h function.
3574 * i386.cc (Target_i386): Likewise.
3575 * sparc.cc (Target_sparc): Likewise.
3576 * x86_64.cc (Target_x86_64): Likewise.
3577 * powerpc.cc (Target_powerpc): Likewise.
3578 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3579 first tls section has section symbol for optimised local dynamic
3580 output relocs.
3581 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3582 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3583 optimised tls code.
3584 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3585 Rename to relocate_relocs. Update error message.
3586
957564c9
AS
35872012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3588
3589 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3590 --just-symbols.
3591
dd93cd0a
AM
35922012-08-31 Alan Modra <amodra@gmail.com>
3593
3594 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3595 (Powerpc_relobj::toc_base_offset): New stub function.
3596 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3597 got_mod_index_offset to tlsld_got_offset. Update all refs.
3598 (Target_powerpc::Relocate::enum skip_tls): New.
3599 (Target_powerpc::call_tls_get_addr_): New var.
3600 (Target_powerpc::is_branch_reloc): Move to file scope.
3601 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3602 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3603 New functions.
3604 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3605 (powerpc_info): Correct common_pagesize for ppc64.
3606 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3607 (Powerpc_relocate_functions): Add overflow check enums and functions.
3608 Add non-shift version of rela, rela_ua. Delete all rel public
3609 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3610 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3611 addr16_ha3, addr14 functions.
3612 (Output_data_got_powerpc::add_constant_pair): New function.
3613 (Output_data_got_powerpc::got_base_offset): Likewise.
3614 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3615 (instruction constants): Sort, add some more.
3616 (Output_data_glink::do_write): Add and use Address typedef. Use
3617 object->toc_base_offset() stub for 64-bit.
3618 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3619 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3620 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3621 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3622 Always treat .opd relocs as against locally defined symbol.
3623 Correct condition for RELATIVE relocs.
3624 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3625 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3626 for 32-bit syms with a plt entry. Correct ppc64 toc base
3627 calculations. Handle TLS relocs, and more. Add overflow
3628 checking and adjust for Powerpc_relocate_functions changes.
3629 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3630 Reinstate --emit-relocs code with FIXME.
3631
a1373b60
AM
36322012-08-30 Alan Modra <amodra@gmail.com>
3633
3634 * layout.cc (Layout::set_segment_offsets): Set p_align to
3635 abi_pagesize, not common_pagesize.
3636 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3637 to determine whether file header can go in segment.
3638
703d02da
AM
36392012-08-30 Alan Modra <amodra@gmail.com>
3640
3641 * output.h (Output_reloc::Output_reloc <output section>): Add
3642 is_relative param. Adjust calls.
3643 (Output_reloc::add_output_section_relative): New functions.
3644 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3645 is_relative.
3646 (Output_reloc::symbol_value): Handle SECTION_CODE.
3647
16164a6b
ST
36482012-08-24 Sriraman Tallam <tmsriram@google.com>
3649
3650 * gold.cc (queue_middle_tasks): Call layout again when unique
3651 segments for sections is desired.
3652 * layout.cc (Layout::Layout): Initialize new members.
3653 (Layout::get_output_section_flags): New function.
3654 (Layout::choose_output_section): Call get_output_section_flags.
3655 (Layout::layout): Make output section for mapping to a unique segment.
3656 (Layout::insert_section_segment_map): New function.
3657 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3658 output sections marked so.
16164a6b
ST
3659 (Layout::segment_precedes): Check for unique segments when sorting.
3660 * layout.h (Layout::Unique_segment_info): New struct.
3661 (Layout::Section_segment_map): New typedef.
3662 (Layout::insert_section_segment_map): New function.
3663 (Layout::get_output_section_flags): New function.
3664 (Layout::is_unique_segment_for_sections_specified): New function.
3665 (Layout::set_unique_segment_for_sections_specified): New function.
3666 (Layout::unique_segment_for_sections_specified_): New member.
3667 (Layout::section_segment_map_): New member.
3668 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3669 Rename is_gc_pass_one to is_pass_one.
3670 Rename is_gc_pass_two to is_pass_two.
3671 Rename is_gc_or_icf to is_two_pass.
3672 Check for which pass based on whether symbols data is present.
3673 Make it two pass when unique segments for sections is desired.
3674 * output.cc (Output_section::Output_section): Initialize new
3675 members.
3676 * output.h (Output_section::is_unique_segment): New function.
3677 (Output_section::set_is_unique_segment): New function.
3678 (Output_section::is_unique_segment_): New member.
3679 (Output_section::extra_segment_flags): New function.
3680 (Output_section::set_extra_segment_flags): New function.
3681 (Output_section::extra_segment_flags_): New member.
3682 (Output_section::segment_alignment): New function.
3683 (Output_section::set_segment_alignment): New function.
3684 (Output_section::segment_alignment_): New member.
3685 (Output_segment::Output_segment): Initialize is_unique_segment_.
3686 (Output_segment::is_unique_segment): New function.
3687 (Output_segment::set_is_unique_segment): New function.
3688 (Output_segment::is_unique_segment_): New member.
3689 * plugin.cc (allow_unique_segment_for_sections): New function.
3690 (unique_segment_for_sections): New function.
3691 (Plugin::load): Add new functions to transfer vector.
3692 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3693 * Makefile.in: Regenerate.
3694 * testsuite/plugin_final_layout.sh: Check if unique segment
3695 functionality works.
3696 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3697 are available.
3698 (allow_unique_segment_for_sections): New global.
3699 (unique_segment_for_sections): New global.
3700 (claim_file_hook): Call allow_unique_segment_for_sections.
3701 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3702
1e2bee4f
CC
37032012-08-22 Cary Coutant <ccoutant@google.com>
3704
3705 * layout.cc (Layout::include_section): Don't assert on GROUP
3706 sections with --emit-relocs.
3707
1d5dfe78
CC
37082012-08-21 Cary Coutant <ccoutant@google.com>
3709
3710 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3711 if --export-dynamic-symbol names an undef symbol.
3712
c9269dff
AM
37132012-08-18 Alan Modra <amodra@gmail.com>
3714
3715 * powerpc.cc: Formatting and white space.
3716 (Powerpc_relobj): Rename got2_section_ to special_.
3717 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3718 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3719 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3720 (Target_powerpc): Add Address typedef and invalid_address. Use
3721 throughout.
3722 (Target_powerpc::is_branch_reloc): New function.
3723 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3724 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3725 for dst_mask, value and addend.
3726 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3727 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3728 (Output_data_glink::do_write): Correct toc base. Don't try to use
3729 uint16_t for 24-bit offset. Use get_output_section_offset and
3730 check return.
3731 (Target_powerpc::Scan::local): Handle more relocs.
3732 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3733 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3734 Plug in toc restoring insn after plt calls. Translate branches
3735 to function descriptor symbols to corresponding entry point.
3736 (Target_powerpc::relocate_for_relocatable): Check return from
3737 get_output_section_offset.
3738 * symtab.h: Comment typo.
3739
b1759dce
ILT
37402012-08-14 Ian Lance Taylor <iant@google.com>
3741
3742 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3743 unsupported_relocal_local to call unsupported_reloc_global.
3744
b9b2ae8b
NC
37452012-08-14 Nick Clifton <nickc@redhat.com>
3746
3747 PR ld/14265
3748 * script-sections.cc (Sections_element::output_section_name): Add
3749 keep return parameter.
3750 (Output_section_element::match_name): Add keep return parameter.
3751 Return the value of the keep_ member.
3752 * script-sections.h (class Output_section): Update
3753 output_section_name prototype.
3754 * layout.cc (Layout::keep_input_section): New public member
3755 function.
3756 (Layout::choose_output_section): Pass keep parameter to
3757 output_section_name.
3758 * layout.h (class Layout): Add keep_input_section.
3759 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3760 sections.
3761 * testsuite/Makefile.am: Add a test.
3762 * testsuite/Makefile.in: Regenerate.
3763 * testsuite/pr14265.c: Source file for the test.
3764 * testsuite/pr14265.t: Linker script for the test.
3765 * testsuite/pr14265.sh: Shell script for the test.
3766
921b5322
AM
37672012-08-14 Alan Modra <amodra@gmail.com>
3768
3769 * target.h (Target::output_section_name): New function.
3770 (Target::do_output_section_name): New function.
3771 * layout.cc (Layout::choose_output_section): Call the above.
3772 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3773
6ce78956
AM
37742012-08-14 Alan Modra <amodra@gmail.com>
3775
3776 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3777 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3778 for replace_constant call.
3779 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3780 (Output_data_glink::do_print_to_mapfile): New function.
3781 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3782 (Target_powerpc::Relocate::relocate): Likewise.
3783
d1a8cabd
AM
37842012-08-14 Alan Modra <amodra@gmail.com>
3785
3786 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3787 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3788 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3789 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3790 all references to shndx_. Handle special case for R_PPC_PLTREL24
3791 here.
3792 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3793 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3794 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3795 here.
3796 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3797 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3798
d83ce4e3
AM
37992012-08-12 Alan Modra <amodra@gmail.com>
3800
3801 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3802 (glink insn constants): Use uint32_t.
3803 (Output_data_glink::add_entry): Use insert, not [] operator.
3804
cf43a2fe
AM
38052012-08-11 Alan Modra <amodra@gmail.com>
3806
3807 * object.h (Sized_relobj_file::find_shdr): New function.
3808 (Sized_relobj_file::find_special_sections): New function.
3809 * object.cc (Sized_relobj_file::find_shdr): New function.
3810 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3811 (Sized_relobj_file::find_special_sections): New function, split out..
3812 (Sized_relobj_file::do_read_symbols): ..from here.
3813 * output.h (Output_data_got::replace_constant): New function.
3814 (Output_data_got::num_entries): New function.
3815 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3816 (Output_data_got::got_offset): Protected rather than private.
3817 (Output_data_got::replace_got_entry): New function.
3818 * output.cc (Output_data_got::replace_got_entry): New function.
3819 * powerpc.cc (class Powerpc_relobj): New.
3820 (class Powerpc_relocate_functions): Delete all psymval variants or
3821 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3822 Implement _ha functions using corresponding _hi function.
3823 (Powerpc_relobj::find_special_sections): New function.
3824 (Target_powerpc::do_make_elf_object): New function.
3825 (class Output_data_got_powerpc): New.
3826 (class Output_data_glink): New.
3827 (class Powerpc_scan_relocatable_reloc): New.
3828 Many more changes througout file.
3829
3c892704
NC
38302012-08-09 Nick Clifton <nickc@redhat.com>
3831
3832 * po/vi.po: Updated Vietnamese translation.
3833
82435b3b
ILT
38342012-08-07 Ian Lance Taylor <iant@google.com>
3835
3836 * layout.cc (Layout::add_target_dynamic_tags): If
3837 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3838 plt_rel.
3839
a6dc81d2
NC
38402012-07-30 Nick Clifton <nickc@redhat.com>
3841
3842 * po/gold.pot: Updated template.
3843 * po/es.po: Updated Spanish translation.
3844
f1415016
CC
38452012-07-18 Cary Coutant <ccoutant@google.com>
3846
3847 PR gold/14344
3848 * configure.ac: Add check for -gpubnames support.
3849 * configure: Regenerate.
3850 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3851 support; force -gno-pubnames.
3852 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3853 support.
3854 (gdb_index_test_4): New test.
3855 * testsuite/Makefile.in: Regenerate.
3856 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3857 * testsuite/gdb_index_test_2.sh: Likewise.
3858 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3859 * testsuite/gdb_index_test_4.sh: New script.
3860 * testsuite/gdb_index_test_comm.sh: New script with common code;
3861 don't look for space after colon.
3862
b7fd7c37
ST
38632012-07-16 Sriraman Tallam <tmsriram@google.com>
3864
3865 * gold.cc (queue_middle_tasks): Update function order only after
3866 deferred objects due to plugins are processed.
3867
1f3212db
ILT
38682012-07-11 Ian Lance Taylor <iant@google.com>
3869
3870 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3871 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3872 (Target_arm::scan_reloc_for_stub): Likewise.
3873 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3874 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3875 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3876 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3877 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3878
81c82a68
ILT
38792012-07-10 Dodji Seketeli <dodji@redhat.com>
3880 Ian Lance Taylor <iant@google.com>
3881
3882 PR gold/14309
3883 * configure.ac: Test whether std::tr1::hash<off_t> works.
3884 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3885 needed.
3886 * output.h (class Output_fill): Add virtual destructor.
3887 * configure, config.in: Rebuild.
3888
eabc84f4
RM
38892012-06-22 Roland McGrath <mcgrathr@google.com>
3890
3891 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3892
370e30b6
RÁE
38932012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3894
3895 * plugin.cc (Plugin::load): Handle position independent executables.
3896
fb1b895d
CC
38972012-06-06 Cary Coutant <ccoutant@google.com>
3898
3899 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3900 add .debug_macro.
3901 (lines_only_debug_sections): Likewise.
3902 (gdb_fast_lookup_sections): New static array.
3903 (is_gdb_debug_section): Rename formal parameter.
3904 (is_lines_only_debug_section): Likewise.
3905 (is_gdb_fast_lookup_section): New function.
3906 (Layout::include_section): Check for ".zdebug_" prefix; pass
3907 section name suffix to is_gdb_debug_section, et al.; check for
3908 fast-lookup sections when building .gdb_index.
3909 * options.h (--strip-debug-gdb): Update GDB version number.
3910
7c0640fa
CC
39112012-06-06 Cary Coutant <ccoutant@google.com>
3912
3913 * configure.ac: Add check for fallocate.
3914 * configure: Regenerate.
3915 * config.in: Regenerate.
3916
3917 * options.h (class General_options): Add --mmap-output-file and
3918 --posix-fallocate options.
3919 * output.cc: (posix_fallocate): Remove; replace with...
3920 (gold_fallocate): New function.
3921 (Output_file::map_no_anonymous): Call gold_fallocate.
3922 (Output_file::map): Check --mmap-output-file option.
3923
2a49eb69
DK
39242012-06-05 Jing Yu <jingyu@google.com>
3925
3926 * gold.h (textdomain): Add do {} to empty while(0).
3927 (bindtextdomain): Likewise.
3928
fad072ac
CC
39292012-06-04 Cary Coutant <ccoutant@google.com>
3930
3931 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3932 has_dynsym_index.
3933
8cc69fb6
ST
39342012-05-25 Sriraman Tallam <tmsriram@google.com>
3935
3936 * symtab.cc (Symbol_table::define_special_symbol):
3937 Initialize *poldsym to prevent uninitialized variable errors.
3938
1be75daa
CC
39392012-05-23 Cary Coutant <ccoutant@google.com>
3940
3941 * layout.cc (Layout::section_name_mapping): Add rules to handle
3942 exact match on .data.rel.ro.local or .data.rel.ro.
3943 (Layout::output_section_name): Check for exact matches.
3944
9b689de0
CC
39452012-05-23 Cary Coutant <ccoutant@google.com>
3946
3947 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3948 more carefully.
3949
b24fdbf5
CC
39502012-05-22 Cary Coutant <ccoutant@google.com>
3951
3952 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3953 object before exporting symbol.
3954
e550e1a2
L
39552012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3956
3957 * testsuite/tls_test.cc: Include "config.h" first.
3958 * testsuite/tls_test_c.c: Likewise.
3959
df7b86aa
NC
39602012-05-17 Daniel Richard G. <skunk@iskunk.org>
3961 Nick Clifton <nickc@redhat.com>
3962
3963 PR 14072
3964 * configure.in: Add check that sysdep.h has been included before
3965 any system header files.
3966 * configure: Regenerate.
3967 * config.in: Regenerate.
3968
1007b503
CC
39692012-05-14 Cary Coutant <ccoutant@google.com>
3970
3971 * layout.cc (Layout::make_output_section): Mark .tdata section
3972 as RELRO.
3973 * testsuite/relro_test.cc: Add a TLS variable.
3974
fd885f3a
L
39752012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3976
3977 PR gold/14091
3978 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3979 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3980 R_X86_64_64.
3981
80f5885c
CC
39822012-05-08 Cary Coutant <ccoutant@google.com>
3983
3984 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3985 (lines_only_debug_sections): Likewise.
3986
2e702c99
RM
39872012-05-02 Roland McGrath <mcgrathr@google.com>
3988
3989 * nacl.cc: New file.
3990 * nacl.h: New file.
3991 * Makefile.am (CCFILES, HFILES): Add them.
3992 * Makefile.in: Regenerate.
3993 * i386.cc (Output_data_plt_i386_nacl): New class.
3994 (Output_data_plt_i386_nacl_exec): New class.
3995 (Output_data_plt_i386_nacl_dyn): New class.
3996 (Target_i386_nacl): New class.
3997 (Target_selector_i386_nacl): New class.
3998 (target_selector_i386): Use it instead of Target_selector_i386.
3999 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4000 (Target_x86_64_nacl): New class.
4001 (Target_selector_x86_64_nacl): New class.
4002 (target_selector_x86_64, target_selector_x32): Use it instead of
4003 Target_selector_x86_64.
4004 * arm.cc (Output_data_plt_arm_nacl): New class.
4005 (Target_arm_nacl): New class.
4006 (Target_selector_arm_nacl): New class.
4007 (target_selector_arm, target_selector_armbe): Use it instead of
4008 Target_selector_arm.
4009
4010 * target-select.cc (select_target): Take new Input_file* and off_t
4011 arguments, pass them on to recognize method of selector.
4012 * object.cc (make_elf_sized_object): Update caller.
4013 * parameters.cc (parameters_force_valid_target): Likewise.
4014 * incremental.cc (make_sized_incremental_binary): Likewise.
4015 * target-select.h: Update decl.
4016 (Target_selector::recognize): Take new Input_file* argument,
4017 pass it on to do_recognize.
4018 (Target_selector::do_recognize): Take new Input_file* argument.
4019 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4020 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4021 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4022 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4023
4024 * target.h (Target::Target_info): New members isolate_execinstr
4025 and rosegment_gap.
4026 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4027 * arm.cc (Target_arm::arm_info): Update initializer.
4028 * i386.cc (Target_i386::i386_info): Likewise.
4029 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4030 * sparc.cc (Target_sparc::sparc_info): Likewise.
4031 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4032 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4033 * layout.cc (Layout::attach_allocated_section_to_segment):
4034 Take new const Target* argument. If target->isolate_execinstr(), act
4035 like --rosegment.
4036 (Layout::find_first_load_seg): Take new const Target* argument;
4037 if target->isolate_execinstr(), reject PF_X segments.
4038 (Layout::relaxation_loop_body): Update caller.
4039 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4040 reset file offset to zero when we hit LOAD_SEG, and then do a second
4041 loop over the segments before LOAD_SEG to reassign offsets after
4042 addresses have been determined. Handle target->rosegment_gap().
4043 (Layout::attach_section_to_segment): Take new const Target* argument;
4044 pass it to attach_allocated_section_to_segment.
4045 (Layout::make_output_section): Update caller.
4046 (Layout::attach_sections_to_segments): Take new const Target* argument;
4047 pass it to attach_section_to_segment.
4048 * gold.cc (queue_middle_tasks): Update caller.
4049 * layout.h (Layout): Update method decls with new arguments.
4050
4051 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4052 Target_info pointer to use.
4053 (Target_arm::do_make_data_plt): New virtual method.
4054 (Target_arm::make_data_plt): New method that calls it.
4055 (Target_arm::make_plt_entry): Use it.
4056 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4057 for the section alignment.
4058 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4059 method.
4060 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4061 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4062 method.
4063 (Output_data_plt_arm::get_plt_entry_size): Call it.
4064 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4065 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4066 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4067 method.
4068 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4069 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4070 method instead of sizeof(plt_entry).
4071 (Output_data_plt_arm::add_entry): Likewise.
4072 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4073 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4074 than static method.
4075 (Target_arm::plt_entry_size): Likewise.
4076 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4077 Move to ...
4078 (Output_data_plt_arm_standard): ... here, new class.
4079 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4080 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4081 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4082
4083 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4084 Take additional argument for the PLT entry size.
4085 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4086 Use get_plt_entry_size method rather than plt_entry_size variable.
4087 (Output_data_plt_x86_64::reserve_slot): Likewise.
4088 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4089 (Output_data_plt_x86_64::add_entry): Likewise.
4090 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4091 (Output_data_plt_x86_64::address_for_global): Likewise.
4092 (Output_data_plt_x86_64::address_for_local): Likewise.
4093 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4094 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4095 Make method non-static.
4096 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4097 method.
4098 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4099 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4100 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4101 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4102 virtual method.
4103 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4104 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4105 virtual method.
4106 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4107 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4108 virtual method.
4109 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4110 (Output_data_plt_x86_64::plt_entry_size)
4111 (Output_data_plt_x86_64::first_plt_entry)
4112 (Output_data_plt_x86_64::plt_entry)
4113 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4114 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4115 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4116 (Output_data_plt_x86_64_standard): ... here, new class.
4117 (Target_x86_64::Target_x86_64): Take optional argument for the
4118 Target_info pointer to use.
4119 (Target_x86_64::do_make_data_plt): New virtual method.
4120 (Target_x86_64::make_data_plt): New method to call it.
4121 (Target_x86_64::init_got_plt_for_update): Use that.
4122 Call this->plt_->add_eh_frame method here.
4123 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4124 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4125 rather than static method.
4126 (Target_x86_64::plt_entry_size): Likewise.
4127 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4128 rather than plt_entry_size variable. Move guts of PLT filling to...
4129 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4130 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4131 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4132
4133 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4134 additional argument for the section alignment.
4135 Don't do add_eh_frame_for_plt here.
4136 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4137 non-static. Use get_plt_entry_size method rather than plt_entry_size
4138 variable.
4139 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4140 method.
4141 (Output_data_plt_i386::get_plt_entry_size): Call it.
4142 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4143 (Output_data_plt_i386::add_eh_frame): New method to call it.
4144 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4145 method.
4146 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4147 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4148 method.
4149 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4150 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4151 method instead of plt_entry_size.
4152 (Output_data_plt_i386::plt_entry_size)
4153 (Output_data_plt_i386::plt_eh_frame_fde_size)
4154 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4155 (Output_data_plt_i386_standard): ... here, new class.
4156 (Output_data_plt_i386_exec): New class.
4157 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4158 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4159 (Output_data_plt_i386::exec_plt_entry): Move to ...
4160 (Output_data_plt_i386_exec::plt_entry): ... here.
4161 (Output_data_plt_i386_dyn): New class.
4162 (Output_data_plt_i386::first_plt_entry): Move to ...
4163 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4164 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4165 (Output_data_plt_i386_dyn::plt_entry): ... here.
4166 (Target_i386::Target_i386): Take optional argument for the Target_info
4167 pointer to use.
4168 (Target_i386::do_make_data_plt): New virtual method.
4169 (Target_i386::make_data_plt): New method to call it.
4170 (Target_i386::make_plt_section): Use that.
4171 Call this->plt_->add_eh_frame method here.
4172 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4173 rather than plt_entry_size variable.
4174 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4175 (Output_data_plt_i386::address_for_local): Likewise.
4176 (Output_data_plt_i386::do_write): Likewise.
4177 Move guts of PLT filling to...
4178 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4179 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4180 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4181 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4182
b9b9f2ee
CC
41832012-05-01 Cary Coutant <ccoutant@google.com>
4184
4185 * dwarf_reader.cc (Dwarf_die::read_attributes)
4186 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4187 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4188 * reduced_debug_output.cc
4189 (Output_reduced_debug_info_section::get_die_end): Remove
4190 DW_FORM_GNU_ref_index. Add default case.
4191
57923f48
MW
41922012-04-26 Mark Wielaard <mjw@redhat.com>
4193
4194 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4195 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4196 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4197 DW_AT_high_pc as offset from DW_AT_low_pc.
4198
4199 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4200 * testsuite/Makefile.in: Regenerate.
4201 * testsuite/gdb_index_test_3.c: New test source file.
4202 * testsuite/gdb_index_test_3.sh: New test source file.
4203
2c54b4f4
ILT
42042012-04-25 Ian Lance Taylor <iant@google.com>
4205
4206 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4207 pointer.
4208 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4209 as a class, not a struct.
4210 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4211 (Target_arm::apply_cortex_a8_workaround): Likewise.
4212 * gc.h: Declare Reloc_types as a struct, not a class.
4213 * object.h: Declare Symbols_data as a struct.
4214 * reloc.h: Declare Read_relocs_data as a struct.
4215 * target.h: Declare Relocate_info as a struct.
4216
a5a5f7a3
DM
42172012-04-24 David S. Miller <davem@davemloft.net>
4218
4219 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4220 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4221 and R_SPARC_WPLT30.
4222
f038d496
CC
42232012-04-24 Cary Coutant <ccoutant@google.com>
4224
4225 * incremental-dump.cc (find_input_containing_global): Replace
4226 magic number with symbolic constant.
4227 (dump_incremental_inputs): Update version number.
4228 * incremental.cc (Output_section_incremental_inputs): Update version
4229 number; import symbolic constants from Incremental_inputs_reader.
4230 (Incremental_inputs::create_data_sections): Align relocations
4231 section correctly for 64-bit targets.
4232 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4233 constants; add padding.
4234 (Output_section_incremental_inputs::write_header): Add assert for
4235 header_size.
4236 (Output_section_incremental_inputs::write_input_files): Add assert
4237 for input_entry_size.
4238 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4239 add assert for object_info_size, input_section_entry_size,
4240 global_sym_entry_size.
4241 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4242 for data structure sizes; use them.
4243 (Incremental_input_entry_reader): Import symbolic constants from
4244 Incremental_inputs_reader; use them.
4245
a4d85145
DM
42462012-04-23 David S. Miller <davem@davemloft.net>
4247
4248 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4249 and elf_flags_set_.
4250 (Target_sparc::Target_sparc): Initialize new fields.
4251 (Target_sparc::do_make_elf_object): New function.
4252 (Target_sparc::do_adjust_elf_header): New function.
4253
1d509098
CC
42542012-04-23 Cary Coutant <ccoutant@google.com>
4255
4256 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4257 CU range table of gdb index.
4258
7ebeff7f
DM
42592012-04-20 David S. Miller <davem@davemloft.net>
4260
4261 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4262 instead of false.
4263
13cf9988
DM
42642012-04-16 David S. Miller <davem@davemloft.net>
4265
2a1079e8
DM
4266 * sparc.cc (Target_sparc::got_address): New function.
4267 (Sparc_relocate_functions::gdop_hix22): New function.
4268 (Sparc_relocate_functions::gdop_lox10): New function.
4269 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4270 relocs.
4271 (Target_sparc::Scan::local): Likewise if the global symbol is not
4272 preemptible and is not IFUNC.
4273 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4274 transformations for local and non-preemptible non-IFUNC global
4275 symbols.
4276
0bc964fc
DM
4277 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4278 writing out 64-bit part of ranges.
4279
661d7a80
DM
4280 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4281 -fpic and -fpie respectively.
4282 * Makefile.in: Regenerate.
4283
8c2bf391
DM
4284 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4285 (Target_sparc::Target_sparc): Initialize new field.
4286 (Target_sparc::do_plt_section_for_global): New function.
4287 (Target_sparc::do_plt_section_for_local): New function.
4288 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4289 (Target_sparc::make_plt_section): New function, broken out of
4290 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4291 (Target_sparc::make_plt_entry): Call make_plt_section.
4292 (Target_sparc::make_local_ifunc_plt_entry): New function.
4293 (Target_sparc::rela_ifunc_section): New function.
4294 (Target_sparc::plt_section): Remove const.
4295 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4296 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4297 and ifunc_count_ fields.
4298 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4299 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4300 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4301 (Output_data_plt_sparc::rela_ifunc): New function.
4302 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4303 (Output_data_plt_sparc::has_ifunc_section): New function.
4304 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4305 (Output_data_plt_sparc::address_for_global): New function.
4306 (Output_data_plt_sparc::address_for_local): New function.
4307 (Output_data_plt_sparc::plt_index_to_offset): New function.
4308 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4309 and entry_count.
4310 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4311 entry_count.
4312 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4313 R_SPARC_JMP_IREL to switch.
4314 (Target_sparc::Scan::check_non_pic): Likewise.
4315 (Target_sparc::Scan::local): Handle IFUNC symbols.
4316 (Target_sparc::Scan::local): Likewise.
4317 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4318 and plt_address_for_local.
4319 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4320 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4321
13cf9988
DM
4322 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4323 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4324 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4325 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4326 global relocs too.
4327 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4328 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4329 calls.
4330 * sparc.cc (Target_sparc::Scan::global): Likewise.
4331 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4332
31821be0
CC
43332012-04-16 Cary Coutant <ccoutant@google.com>
4334
4335 * archive.cc (Library_base::should_include_member): Check for
4336 --export-dynamic-symbol.
4337 * options.h (class General_options): Add --export-dynamic-symbol.
4338 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4339 --export-dynamic-symbol.
4340 (Symbol_table::gc_mark_undef_symbols): Likewise.
4341 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4342
2615994e
DM
43432012-04-12 David S. Miller <davem@davemloft.net>
4344
4345 * sparc.cc (Reloc::wdisp10): New relocation method.
4346 (Reloc::h34): Likewise.
4347 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4348 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4349 R_SPARC_WDISP10.
4350 (Target_sparc::Scan::local): Likewise.
4351 (Target_sparc::Scan::global): Likewise.
4352 (Target_sparc::Relocate::relocate): Likewise.
4353
6782735d
CC
43542012-04-09 Cary Coutant <ccoutant@google.com>
4355
4356 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4357 low_pc == 0.
4358
8c7a0b00
ILT
43592012-04-06 Ian Lance Taylor <iant@google.com>
4360
4361 * timer.cc: #include <unistd.h>.
4362
58797674
RM
43632012-04-06 Roland McGrath <mcgrathr@google.com>
4364
4365 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4366 * config.in: Regenerate.
4367 * configure: Regenerate.
4368
44350750
NC
43692012-04-05 Nick Clifton <nickc@redhat.com>
4370
4371 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4372 (AM_LC_MESSAGES): Add.
4373 * aclocal.m4: Regenerate.
4374 * config.in: Regenerate.
4375 * configure: Regenerate.
4376
c1027032
CC
43772012-03-21 Cary Coutant <ccoutant@google.com>
4378
4379 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4380 * Makefile.in: Regenerate.
4381 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4382 (Sized_elf_reloc_mapper::symbol_section): New function.
4383 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4384 (make_elf_reloc_mapper): New function.
4385 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4386 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4387 (Dwarf_abbrev_table::do_get_abbrev): New function.
4388 (Dwarf_ranges_table::read_ranges_table): New function.
4389 (Dwarf_ranges_table::read_range_list): New function.
4390 (Dwarf_pubnames_table::read_section): New function.
4391 (Dwarf_pubnames_table::read_header): New function.
4392 (Dwarf_pubnames_table::next_name): New function.
4393 (Dwarf_die::Dwarf_die): New function.
4394 (Dwarf_die::read_attributes): New function.
4395 (Dwarf_die::skip_attributes): New function.
4396 (Dwarf_die::set_name): New function.
4397 (Dwarf_die::set_linkage_name): New function.
4398 (Dwarf_die::attribute): New function.
4399 (Dwarf_die::string_attribute): New function.
4400 (Dwarf_die::int_attribute): New function.
4401 (Dwarf_die::uint_attribute): New function.
4402 (Dwarf_die::ref_attribute): New function.
4403 (Dwarf_die::child_offset): New function.
4404 (Dwarf_die::sibling_offset): New function.
4405 (Dwarf_info_reader::check_buffer): New function.
4406 (Dwarf_info_reader::parse): New function.
4407 (Dwarf_info_reader::do_parse): New function.
4408 (Dwarf_info_reader::do_read_string_table): New function.
4409 (Dwarf_info_reader::lookup_reloc): New function.
4410 (Dwarf_info_reader::get_string): New function.
4411 (Dwarf_info_reader::visit_compilation_unit): New function.
4412 (Dwarf_info_reader::visit_type_unit): New function.
4413 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4414 Sized_elf_reloc_mapper.
4415 (Sized_dwarf_line_info::symbol_section): Remove function.
4416 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4417 (Sized_dwarf_line_info::read_line_mappings): Remove object
4418 parameter, adjust callers.
4419 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4420 * dwarf_reader.h: Include <sys/types.h>.
4421 (class Track_relocs): Remove forward declaration.
4422 (class Elf_reloc_mapper): New class.
4423 (class Sized_elf_reloc_mapper): New class.
4424 (class Dwarf_abbrev_table): New class.
4425 (class Dwarf_range_list): New class.
4426 (class Dwarf_ranges_table): New class.
4427 (class Dwarf_pubnames_table): New class.
4428 (class Dwarf_die): New class.
4429 (class Dwarf_info_reader): New class.
4430 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4431 (Sized_dwarf_line_info::symbol_section): Remove member function.
4432 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4433 base class.
4434 * gdb-index.cc: New source file.
4435 * gdb-index.h: New source file.
4436 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4437 and .debug_types sections, call Layout::add_to_gdb_index.
4438 (Sized_relobj_incr::do_section_name): Implement.
4439 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4440 return type; Implement.
4441 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4442 return type.
4443 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4444 parameter list and return type.
4445 (Sized_incr_dynobj::do_section_contents): Likewise.
4446 * layout.cc: Include gdb-index.h.
4447 (Layout::Layout): Initialize gdb_index_data_.
4448 (Layout::init_fixed_output_section): Check for .gdb_index section.
4449 (Layout::add_to_gdb_index): New function. Instantiate.
4450 * layout.h: Add forward declaration for class Gdb_index.
4451 (Layout::add_to_gdb_index): New member function.
4452 (Layout::gdb_index_data_): New data member.
4453 * main.cc: Include gdb-index.h.
4454 (main): Print statistics for gdb index.
4455 * object.cc (Object::section_contents): Move code into
4456 do_section_contents.
4457 (need_decompressed_section): Check for sections needed when building
4458 gdb index.
4459 (build_compressed_section_map): Likewise.
4460 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4461 gdb index.
4462 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4463 sections; call Layout::add_to_gdb_index.
4464 (Sized_relobj_file::do_decompressed_section_contents): Call
4465 do_section_contents directly.
4466 * object.h (Object::do_section_contents): Adjust parameter list and
4467 return type.
4468 (Object::do_decompressed_section_contents): Call do_section_contents
4469 directly.
4470 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4471 return type.
4472 * options.h (class General_options): Add --gdb-index option.
4473 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4474 list and return type.
4475 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4476 * reloc.h (Track_relocs::checkpoint): New function.
4477 (Track_relocs::reset): New function.
4478
4479 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4480 New test cases.
4481 * testsuite/Makefile.in: Regenerate.
4482 * testsuite/gdb_index_test.cc: New test source file.
4483 * testsuite/gdb_index_test_1.sh: New test source file.
4484 * testsuite/gdb_index_test_2.sh: New test source file.
4485
647f1574
DK
44862012-03-19 Doug Kwan <dougkwan@google.com>
4487
4488 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4489 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4490 __exidx_start and __exidx_end. Make symbol table parameter
4491 anonymous as it is not used.
4492 * gold.cc (queue_middle_tasks): Call target hook to define any
4493 target-specific symbols.
4494 * target.h (Target::define_standard_symbols): New method.
4495 (Target::do_define_standard_symbols): Same.
4496 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4497 * testsuite/Makefile.in: Regenerate.
4498 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4499 and __exidx_end.
4500 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4501 relocations are generated for __exidx_start and __exidx_end.
4502
7c6109da
DK
45032012-03-16 Doug Kwan <dougkwan@google.com>
4504
4505 * testsuite/Makefile.am: Disable test initpri3b.
4506 * testsuite/Makefile.in: Regenerate.
4507
7b8957f8
DK
45082012-03-15 Doug Kwan <dougkwan@google.com>
4509
4510 * arm.cc (Target_arm::got_section): Make .got section read-only
4511 if -z now is given.
4512
14dc9ef7
ILT
45132012-03-15 Ian Lance Taylor <iant@google.com>
4514
4515 PR gold/13850
4516 * layout.cc (Layout::make_output_section): Correctly mark
4517 SHT_INIT_ARRAY, et. al., as relro.
4518
fa40b62a
DK
45192012-03-14 Doug Kwan <dougkwan@google.com>
4520
4521 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4522 dynamic relocations for protected symbols in shared objects.
4523
fd325007
ILT
45242012-03-13 Ian Lance Taylor <iant@google.com>
4525
4526 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4527 keep the larger alignment.
4528
e8dd54e1
CC
45292012-03-12 Cary Coutant <ccoutant@google.com>
4530
4531 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4532 handling of DW_LNE_define_file.
4533
feb5f3b0
CC
45342012-03-12 Cary Coutant <ccoutant@google.com>
4535
4536 * reduced_debug_output.cc
4537 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4538 codes to switch.
4539
a1fb4256
CC
45402012-02-29 Cary Coutant <ccoutant@google.com>
4541
4542 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4543
5dd8762a
CC
45442012-02-29 Cary Coutant <ccoutant@google.com>
4545
4546 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4547 Call Object::decompressed_section_contents.
4548 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4549 New dtor.
4550 (Sized_dwarf_line_info::buffer_start_): New data member.
4551 * merge.cc (Output_merge_data::do_add_input_section): Call
4552 Object::decompressed_section_contents.
4553 (Output_merge_string::do_add_input_section): Likewise.
4554 * object.cc (need_decompressed_section): New function.
4555 (build_compressed_section_map): Decompress sections needed later.
4556 (Sized_relobj_file::do_decompressed_section_contents): New function.
4557 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4558 * object.h (Object::decompressed_section_contents): New function.
4559 (Object::discard_decompressed_sections): New function.
4560 (Object::do_decompressed_section_contents): New function.
4561 (Object::do_discard_decompressed_sections): New function.
4562 (Compressed_section_info): New type.
4563 (Compressed_section_map): Include decompressed section contents.
4564 (Sized_relobj_file::do_decompressed_section_contents): New function.
4565 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4566
7b5de7ee
CC
45672012-02-16 Cary Coutant <ccoutant@google.com>
4568
4569 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4570 * testsuite/Makefile.in: Regenerate.
4571
f9fa4a63
CC
45722012-02-14 Cary Coutant <ccoutant@google.com>
4573
4574 * options.cc (General_options::finalize): Disallow -pie and -static.
4575
2c175ebc
DK
45762012-02-03 Doug Kwan <dougkwan@google.com>
4577
4578 * arm.cc (Arm_relocate_functions::abs8,
4579 Arm_relocate_functions::abs16): Use
4580 Bits::has_signed_unsigned_overflow32.
4581 (Arm_relocate_functions::thm_abs8): Correct range of
4582 overflow check.
4583 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4584 in assertions.
4585
90cff06f
DK
45862012-02-02 Doug Kwan <dougkwan@google.com>
4587
4588 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4589 position independent outputs, not just shared objects.
4590
63887f3d
L
45912012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4592
4593 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4594 * configure: Regenerated.
4595
bef2b434
ILT
45962012-01-27 Ian Lance Taylor <iant@google.com>
4597
4598 * reloc.h (Bits): New class with static functions, copied from
4599 namespace utils in arm.cc.
4600 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4601 instead.
4602
c335b55d
L
46032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4604
4605 * incremental.cc (write_info_blocks): Correct relocation offset.
4606
41194d9f
L
46072012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4608
4609 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4610 (Relocate::tls_gd_to_le): Likewise.
4611
1bae613c
L
46122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4613
4614 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4615
24482ca0
L
46162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4617
4618 * configure.ac: Check if -mcmodel=medium works.
4619 * configure: Regenerated.
4620
c2c7840a
CC
46212012-01-24 Cary Coutant <ccoutant@google.com>
4622
4623 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4624 definition and ...
4625 (read_unsigned_LEB_128_x): ... this new function.
4626 (read_signed_LEB_128): Replaced with inline definition and ...
4627 (read_signed_LEB_128_x): ... this new function.
4628 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4629 (read_unsigned_LEB_128): Add inline definition.
4630 (read_signed_LEB_128_x): New function.
4631 (read_signed_LEB_128): Add inline definition.
4632 * testsuite/Makefile.am (leb128_unittest): New unit test.
4633 * testsuite/Makefile.in: Regenerate.
4634 * testsuite/leb128_unittest.cc: New unit test.
4635
833de760 46362012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4637
4638 PR gold/13617
4639 * i386.cc (Target_i386::do_code_fill): When using a jmp
4640 instruction, pad with nop instructions.
4641 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4642
618d6666
L
46432012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4644
4645 * x86_64.cc (gc_process_relocs): Add typename on types used in
4646 template.
4647 (scan_relocs): Likewise.
4648 (relocate_section): Likewise.
4649 (apply_relocation): Likewise.
4650
3660ff06
L
46512012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4652
4653 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4654 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4655 under x32.
4656
fc51264f
L
46572012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4658
4659 * x86_64.cc: Initial support for x32.
4660
dd74ae06
CC
46612012-01-03 Cary Coutant <ccoutant@google.com>
4662
4663 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4664 Use abstract base class for GOT.
4665 * gold/output.h (class Output_data_got_base): New abstract base class.
4666 (class Output_data_got): Derive from new base class, adjust ctors.
4667 (Output_data_got::reserve_slot): Make virtual; rename to
4668 do_reserve_slot; Adjust callers.
4669 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4670 pointer to abstract base class.
4671 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4672
83896202
ILT
46732011-12-18 Ian Lance Taylor <iant@google.com>
4674
4675 * object.h (Relobj::local_symbol_value): New function.
4676 (Relobj::local_plt_offset): New function.
4677 (Relobj::local_has_got_offset): New function.
4678 (Relobj::local_got_offset): New function.
4679 (Relobj::set_local_got_offset): New function.
4680 (Relobj::do_local_symbol_value): New pure virtual function.
4681 (Relobj::do_local_plt_offset): Likewise.
4682 (Relobj::do_local_has_got_offset): Likewise.
4683 (Relobj::do_local_got_offset): Likewise.
4684 (Relobj::do_set_local_got_offset): Likewise.
4685 (Sized_relobj::do_local_has_got_offset): Rename from
4686 local_has_got_offset.
4687 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4688 (Sized_relobj::do_set_local_got_offset): Rename from
4689 set_local_got_offset.
4690 (Sized_relobj_file::do_local_plt_offset): Rename from
4691 local_plt_offset.
4692 (Sized_relobj_file::do_local_symbol_value): New function.
4693 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4694 local_plt_offset.
4695 * output.cc (Output_data_got::Got_entry::write): Change object to
4696 Relobj. Use local_symbol_value.
4697 (Output_data_got::add_global_with_rel): Change rel_dyn to
4698 Output_data_reloc_generic*. Use add_global_generic.
4699 (Output_data_got::add_global_with_rela): Remove. Change all
4700 callers to use add_global_with_rel.
4701 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4702 Output_data_reloc_generic*. Use add_global_generic.
4703 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4704 callers to use add_global_pair_with_rel.
4705 (Output_data_got::add_local): Change object to Relobj*.
4706 (Output_data_got::add_local_plt): Likewise.
4707 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4708 change rel_dyn to Output_data_reloc_generic*. Use
4709 add_local_generic.
4710 (Output_data_got::add_local_with_rela): Remove. Change all
4711 callers to use all_local_with_rel.
4712 (Output_data_got::add_local_pair_with_rel): Change object to
4713 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4714 add_output_section_generic.
4715 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4716 callers to use add_local_pair_with_rel.
4717 (Output_data_got::reserve_local): Change object to Relobj*.
4718 * output.h: (class Output_data_reloc_generic): Add pure virtual
4719 declarations for add_global_generic, add_local_generic,
4720 add_output_section_generic.
4721 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4722 functions for Output_data_reloc_generic. Update declarations for
4723 changes listed in output.cc.
4724 (class Output_data_got): Change template parameter to got_size.
4725 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4726 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4727 function.
4728 (Sized_relobj_incr::do_local_plt_offset): New function.
4729 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4730 add_global_generic.
4731
76677ad0
CC
47322011-12-17 Cary Coutant <ccoutant@google.com>
4733
4734 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4735 * resolve.cc (Symbol_table::resolve): Likewise.
4736 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4737 arrays.
4738 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4739
8b8dd8d5
ILT
47402011-12-16 Ian Lance Taylor <iant@google.com>
4741
4742 * output.h (Output_data_reloc_generic::add): Only call
4743 add_dynamic_reloc if this is a dynamic reloc section.
4744
d55525b9
L
47452011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4746
4747 PR gold/13505
4748 * target-reloc.h (apply_relocation): Replace <64, false> with
4749 <size, big_endian>.
4750
ff81c7c1
NC
47512011-11-25 Nick Clifton <nickc@redhat.com>
4752
4753 * po/it.po: New Italian translation.
4754
628f39be
SA
47552011-11-17 Sterling Augustine <saugustine@google.com>
4756
4757 * script.cc (script_include_directive): Implement.
4758 (read_script_file): New local variables name and search_path. Update
4759 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4760 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4761 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4762
98ef3ea4
SA
47632011-11-11 Sterling Augustine <saugustine@google.com>
4764
4765 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4766 (file_or_sections_cmd): Likewise.
4767
f4a8b6d7
DK
47682011-11-11 Doug Kwan <dougkwan@google.com>
4769
4770 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4771 if --just-symbols is given.
4772
29ab395d
DK
47732011-11-10 Doug Kwan <dougkwan@google.com>
4774
4775 PR gold/13362
4776 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4777 when processing data relocs.
4778 * reloc.h (Relocate_functions::rel_unaligned): New method.
4779 (Relocate_functions::pcrel_unaligned): Ditto.
4780 (Relocate_functions::rel32_unaligned): Ditto.
4781 (Relocate_functions::pcrel32_unaligned): Ditto.
4782
2c339f71
DK
47832011-11-09 Doug Kwan <dougkwan@google.com>
4784
4785 PR gold/13362
4786 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4787 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4788 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4789 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4790 (Relocate_functions::rel_unaligned): New.
4791 (Relocate_functions::rel32_unaligned): New.
4792 * target-reloc.h (relocate_for_relocatable): Add code to handle
4793 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4794 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4795 arm_unaligned_reloc_r): New targets.
4796 * testsuite/Makefile.in: Regenerate.
4797 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4798 linking.
4799
3f3cddf1
ILT
48002011-11-02 Ian Lance Taylor <iant@google.com>
4801
4802 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4803 NATIVE_LINKER.
4804 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4805 * options.cc (General_options::finalize): Use library search path
4806 from configure script if specified. If not native and no sysroot,
4807 only search TOOLLIBDIR.
4808 * options.h (Search_directory::Search_directory): Change name to
4809 const std::string&.
4810 (General_options::add_to_library_path_with_sysroot): Change arg to
4811 const std::string&.
4812 * configure, Makefile.in, config.in: Rebuild.
4813
a8e2273b
ILT
48142011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4815
4816 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4817 we are working around the ARM1176 Erratum.
4818 * options.h (General_options::fix_arm1176): Add option.
4819 * testsuite/Makefile.am: Add testcases, and keep current ones
4820 working.
4821 * testsuite/Makefile.in: Regenerate.
4822 * testsuite/arm_fix_1176.s: New file.
4823 * testsuite/arm_fix_1176.sh: Likewise.
4824
cd6eab1c
ILT
48252011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4826
4827 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4828 may_use_blx_.
4829 (Target_arm::may_use_blx): Remove method.
4830 (Target_arm::set_may_use_blx): Likewise.
4831 (Target_arm::may_use_v4t_interworking): New method.
4832 (Target_arm::may_use_v5t_interworking): Likewise.
4833 (Target_arm::may_use_blx_): Remove member variable.
4834 (Arm_relocate_functions::arm_branch_common): Check for v5T
4835 interworking.
4836 (Arm_relocate_functions::thumb_branch_common): Likewise.
4837 (Reloc_stub::stub_type_for_reloc): Likewise.
4838 (Target_arm::do_finalize_sections): Correct interworking checks.
4839 * testsuite/Makefile.am: Add new tests.
4840 * testsuite/Makefile.in: Regenerate.
4841 * testsuite/arm_farcall_arm_arm.s: New test.
4842 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4843 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4844 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4845 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4846 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4847 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4848 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4849
286adcf4
CC
48502011-10-31 Cary Coutant <ccoutant@google.com>
4851
4852 PR gold/13023
4853 * expression.cc (Expression::eval_with_dot): Add
4854 is_section_dot_assignment parameter.
4855 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4856 absolute and assigning to dot within a section.
4857 * script-sections.cc
4858 (Output_section_element_assignment::set_section_addresses): Pass
4859 dot_section to set_if_absolute.
4860 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4861 as is_section_dot_assignment flag to eval_with_dot.
4862 (Output_section_element_dot_assignment::set_section_addresses):
4863 Likewise.
4864 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4865 parameter. Also set value if relative to dot_section; set the
4866 symbol's output_section.
4867 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4868 parameter. Adjust all callers.
4869 (Expression::eval_maybe_dot): Likewise.
4870 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4871 Adjust all callers.
4872 * testsuite/script_test_2.t: Test assignment of an absolute value
4873 to dot within an output section element.
4874
9634ed06
CC
48752011-10-31 Cary Coutant <ccoutant@google.com>
4876
4877 * options.h (class General_options): Add --[no-]gnu-unique options.
4878 * symtab.cc (Symbol_table::sized_write_globals): Convert
4879 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4880
de4101c7
CC
48812011-10-31 Cary Coutant <ccoutant@google.com>
4882
4883 PR gold/13359
4884 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4885 unnecessary assertion.
4886 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4887
7257cc92
ST
48882011-10-31 Sriraman Tallam <tmsriram@google.com>
4889
4890 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4891 gc_mark_symbol.
4892 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4893 gc_mark_symbol.
4894 Change to just keep the section associated with symbol.
4895 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4896 they are externally visible and --export-dynamic is turned on.
4897 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4898
bfc34b3f
ILT
48992011-10-19 Ian Lance Taylor <iant@google.com>
4900
4901 PR gold/13163
4902 * script-sections.cc
4903 (Output_section_element_dot_assignment::needs_output_section): New
4904 function.
4905
ea0d8c47
ILT
49062011-10-19 Ian Lance Taylor <iant@google.com>
4907
4908 PR gold/13204
4909 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4910 --section-start option was seen.
4911 * options.h (General_options::any_section_start): New function.
4912
abd242a9
DM
49132011-10-18 David S. Miller <davem@davemloft.net>
4914
4915 PR binutils/13301
4916 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4917 member to track relocation locations that have moved during TLS
4918 reloc optimizations.
4919 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4920 (Target_sparc::Relocate::relocate): Adjust view down by 4
4921 bytes if it matches reloc_adjust_addr_.
4922 (Target_sparc::Relocate::relocate_tls): Always move the
4923 __tls_get_addr call delay slot instruction forward 4 bytes when
4924 performing relaxation.
4925
bab9090f
CC
49262011-10-18 Cary Coutant <ccoutant@google.com>
4927
4928 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4929 (Output_file::map_no_anonymous): Check for non-zero
4930 return code from posix_fallocate.
4931
f7c5b166
CC
49322011-10-17 Cary Coutant <ccoutant@google.com>
4933
4934 PR gold/13245
4935 * plugin.cc (is_visible_from_outside): Check for symbols
4936 referenced from dynamic objects.
4937 * resolve.cc (Symbol_table::resolve): Don't count references
4938 from dynamic objects as references from real ELF files.
4939 * testsuite/plugin_test_2.sh: Adjust expected result.
4940
b490c0bb
CC
49412011-10-17 Cary Coutant <ccoutant@google.com>
4942
4943 * gold.cc: Include timer.h.
4944 (queue_middle_tasks): Stamp time.
4945 (queue_final_tasks): Likewise.
4946 * main.cc (main): Store timer in parameters. Print timers
4947 for each pass.
4948 * parameters.cc (Parameters::Parameters): Initialize timer_.
4949 (Parameters::set_timer): New function.
4950 (set_parameters_timer): New function.
4951 * parameters.h (Parameters::set_timer): New function.
4952 (Parameters::timer): New function.
4953 (Parameters::timer_): New data member.
4954 (set_parameters_timer): New function.
4955 * timer.cc (Timer::stamp): New function.
4956 (Timer::get_pass_time): New function.
4957 * timer.h (Timer::stamp): New function.
4958 (Timer::get_pass_time): New function.
4959 (Timer::pass_times_): New data member.
4960
f475cf7b
CC
49612011-10-17 Cary Coutant <ccoutant@google.com>
4962
4963 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4964 task for members of lib groups.
4965
cdd7e244
CC
49662011-10-17 Cary Coutant <ccoutant@google.com>
4967
4968 PR gold/13288
4f95c8b4 4969 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4970 (File_read::make_view): Move bounds check (replace with assert)...
4971 (File_read::find_or_make_view): ... to here.
4972
dfb45471
CC
49732011-10-12 Cary Coutant <ccoutant@google.com>
4974
4f95c8b4 4975 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4976 ::read returns less than requested size.
4977
53bbcc1b
CC
49782011-10-10 Cary Coutant <ccoutant@google.com>
4979
4f95c8b4 4980 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4981 Initialize defined_count_.
4982 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4983 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4984 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4985 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4986 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4987 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4988 member.
4989 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4990 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4991 Return zeroes instead of internal error.
4992
397b129b
CC
49932011-10-10 Cary Coutant <ccoutant@google.com>
4994
4995 PR gold/13249
4f95c8b4 4996 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4997 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4998 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4999 (Output_reloc::type_): Adjust size of bit field.
5000 (Output_reloc::use_plt_offset_): New bit field.
5001 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5002 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5003 flag. Adjust all callers.
4f95c8b4 5004 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5005 creating RELATIVE relocations.
5006
d5698657
NC
50072011-10-10 Nick Clifton <nickc@redhat.com>
5008
5009 * po/es.po: Updated Spanish translation.
5010 * po/fi.po: Updated Finnish translation.
5011
6a59a5c2
DN
50122011-10-03 Diego Novillo <dnovillo@google.com>
5013
5014 * options.cc (parse_uint): Fix dereference of RETVAL.
5015
f0558624
ST
50162011-09-29 Sriraman Tallam <tmsriram@google.com>
5017
5018 * layout.h (section_order_map_): New member.
5019 (get_section_order_map): New member function.
5020 * output.cc (Output_section::add_input_section): Check for patterns
5021 only when --section-ordering-file is specified.
5022 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5023 output_sections have been formed.
5024 * layout.cc (Layout_Layout): Initialize section_order_map_.
5025 * plugin.cc (update_section_order): Store order in order_map. Do not
5026 update the order.
5027 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5028 * testsuite/Makefile.in: Regenerate.
5029 * testsuite/plugin_section_order.c: New file.
5030 * testsuite/plugin_final_layout.cc: New file.
5031 * testsuite/plugin_final_layout.sh: New file.
5032
a7dac153
CC
50332011-09-29 Cary Coutant <ccoutant@google.com>
5034
4f95c8b4 5035 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5036 Check for NULL.
4f95c8b4 5037 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5038 symbols during incremental update.
5039 (Symbol_table::add_from_dynobj): Likewise.
5040
eebd87a5
ILT
50412011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5042 Ian Lance Taylor <iant@google.com>
5043
5044 * symtab.cc (Symbol_table::define_special_symbol): Always
5045 canonicalize version string.
5046
403a3331
CC
50472011-09-26 Cary Coutant <ccoutant@google.com>
5048
4f95c8b4
CC
5049 * gold.cc (queue_initial_tasks): Move option checks ...
5050 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5051 some options; make others fatal.
5052
235061c2
CC
50532011-09-26 Cary Coutant <ccoutant@google.com>
5054
5055 gcc PR lto/47247
5056 * plugin.cc (get_symbols_v2): New function.
5057 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5058 (is_referenced_from_outside): New function.
5059 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5060 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5061 (get_symbols): Pass version parameter.
5062 (get_symbols_v2): New function.
5063 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5064 parameter.
5065 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5066 (onload): Add LDPT_GET_SYMBOLS_V2.
5067 (all_symbols_read_hook): Use get_symbols_v2; check for
5068 LDPR_PREVAILING_DEF_IRONLY_EXP.
5069 * testsuite/plugin_test_3.sh: Update expected results.
5070
dc87f620
ILT
50712011-09-23 Simon Baldwin <simonb@google.com>
5072
5073 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5074 configuration options.
5075 * configure: Regenerate.
5076 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5077 * Makefile.in: Regenerate.
5078 * testsuite/Makefile.in: Regenerate.
5079
a8279f82
ST
50802011-09-19 Sriraman Tallam <tmsriram@google.com>
5081
5082 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5083
0c9350c8
CC
50842011-09-19 Cary Coutant <ccoutant@google.com>
5085
5086 * incremental.cc (can_incremental_update): Fix typo in comment.
5087 * incremental.h (can_incremental_update): Likewise.
5088
aa06ae28
CC
50892011-09-18 Cary Coutant <ccoutant@google.com>
5090
5091 * incremental.cc (can_incremental_update): New function.
5092 * incremental.h (can_incremental_update): New function.
5093 * layout.cc (Layout::init_fixed_output_section): Call it.
5094 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5095 * object.cc (Sized_relobj_file::do_layout): Call
5096 can_incremental_update.
5097
ebb300b2
CC
50982011-09-13 Cary Coutant <ccoutant@google.com>
5099
5100 * configure.ac: Check for glibc support for gnu_indirect_function
5101 support with static linking, setting automake conditional
5102 IFUNC_STATIC.
5103 * Makefile.in: Regenerate.
5104 * configure: Regenerate.
5105
5106 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5107 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5108 for IFUNC_STATIC.
5109 * testsuite/Makefile.in: Regenerate.
5110
1206d0d5
CC
51112011-09-13 Cary Coutant <ccoutant@google.com>
5112
5113 * incremental.cc (Sized_relobj_incr::do_layout): Call
5114 report_comdat_group for kept comdat sections.
5115 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5116 * testsuite/Makefile.in: Regenerate.
5117 * testsuite/incr_comdat_test_1.cc: New source file.
5118 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5119 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5120 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5121
40b29874
ILT
51222011-09-13 Ian Lance Taylor <iant@google.com>
5123
5124 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5125 variable external_symbols_offset.
5126
1b045aac
ILT
51272011-09-12 Ian Lance Taylor <iant@google.com>
5128
5129 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5130 triggered if object has no symbols.
5131
24c6c55a
DM
51322011-09-09 David S. Miller <davem@davemloft.net>
5133
5134 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5135 (Output_fill_debug_line::do_write): Likewise.
5136
66570254
CC
51372011-08-29 Cary Coutant <ccoutant@google.com>
5138
5139 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5140 casts to match formatting specs.
5141 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5142
8ea8cd50
CC
51432011-08-26 Cary Coutant <ccoutant@google.com>
5144
5145 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5146 remaining hole size when allocating.
5147 (Layout::make_output_section): Set fill methods for debug sections.
5148 * layout.h (Free_list::Free_list_node): Move from private to
5149 public.
5150 (Free_list::set_min_hole_size): New function.
5151 (Free_list::begin, Free_list::end): New functions.
5152 (Free_list::min_hole_): New data member.
5153 * output.cc: Include dwarf.h.
5154 (Output_fill_debug_info::do_minimum_hole_size): New function.
5155 (Output_fill_debug_info::do_write): New function.
5156 (Output_fill_debug_line::do_minimum_hole_size): New function.
5157 (Output_fill_debug_line::do_write): New function.
5158 (Output_section::Output_section): Initialize new data member.
5159 (Output_section::set_final_data_size): Ensure patch space is larger
5160 than minimum hole size.
5161 (Output_section::do_write): Fill holes in debug sections.
5162 * output.h (Output_fill): New class.
5163 (Output_fill_debug_info): New class.
5164 (Output_fill_debug_line): New class.
5165 (Output_section::set_free_space_fill): New function.
5166 (Output_section::free_space_fill_): New data member.
5167 * testsuite/Makefile.am (incremental_test_3): Add
5168 --incremental-patch option.
5169 (incremental_test_4): Likewise.
5170 (incremental_test_5): Likewise.
5171 (incremental_test_6): Likewise.
5172 (incremental_copy_test): Likewise.
5173 (incremental_common_test_1): Likewise.
5174 * testsuite/Makefile.in: Regenerate.
5175
7cf80422
NC
51762011-08-26 Nick Clifton <nickc@redhat.com>
5177
5178 * po/es.po: Updated Spanish translation.
5179
c3f7b0e5
CC
51802011-08-01 Cary Coutant <ccoutant@google.com>
5181
5182 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5183 * gold/testsuite/Makefile.in: Regenerate.
5184 * gold/testsuite/justsyms_exec.c: New source file.
5185 * gold/testsuite/justsyms_lib.c: New source file.
5186
9590bf25
CC
51872011-08-01 Cary Coutant <ccoutant@google.com>
5188
5189 * layout.cc (Layout::set_segment_offsets): Don't realign text
5190 segment if -Ttext was specified.
5191 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5192 file type.
5193 * object.h (Sized_relobj_file::e_type): New function.
5194 (Sized_relobj_file::e_type_): New data member.
5195 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5196 base address for ET_EXEC files.
5197 * target.cc (Target::do_make_elf_object_implementation): Allow
5198 ET_EXEC files with --just-symbols option.
5199
dcd8d12e
CC
52002011-07-28 Cary Coutant <ccoutant@google.com>
5201
5202 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5203 Add thread_number parameter.
5204 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5205 * workqueue-threads.cc
5206 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5207 current thread if its thread number is greater than desired thread
5208 count.
5209 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5210 Add thread_number parameter.
5211 (Workqueue::should_cancel_thread): Likewise.
5212 (Workqueue::find_runnable_or_wait): Pass thread_number to
5213 should_cancel_thread.
5214 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5215 parameter.
5216
804eb480
ST
52172011-07-22 Sriraman Tallam <tmsriram@google.com>
5218
5219 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5220 only after checking if it cannot be forced local.
5221 * symtab.h (is_externally_visible): Check if the symbol is not forced
5222 local.
5223
f1ddb600
ILT
52242011-07-15 Ian Lance Taylor <iant@google.com>
5225
5226 * options.h (class General_options): Add --print-output-format.
5227 Move -EL next to -EB, for better --help output.
5228 * target-select.cc: Include <cstdio>, "options.h", and
5229 "parameters.h".
5230 (Target_selector::do_target_bfd_name): New function.
5231 (print_output_format): New function.
5232 * target-select.h (class Target_selector): Update declarations.
5233 (Target_selector::target_bfd_name): New function.
5234 (print_output_format): Declare.
5235 * main.cc: Include "target-select.h".
5236 (main): Handle --print-output-format.
5237 * gold.cc: Include "target-select.h".
5238 (queue_initial_tasks): Handle --print-output-format when there are
5239 no input files.
5240 * parameters.cc (parameters_force_valid_target): Give a better
5241 error message if -EB/-EL does not match target.
5242 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5243 function.
5244
7d172687
ILT
52452011-07-15 Ian Lance Taylor <iant@google.com>
5246
5247 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5248 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5249 (Output_data_plt_i386::do_write): Write address of .dynamic
5250 section to first entry in .got.plt section.
5251 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5252 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5253 Initialize layout_.
5254 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5255 section to first entry in .got.plt section.
5256 * layout.h (Layout::dynamic_section): New function.
5257
e9552f7e
ST
52582011-07-13 Sriraman Tallam <tmsriram@google.com>
5259
5260 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5261 to claim_file call.
5262 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5263 input_section_position_, and input_section_glob_.
5264 (read_layout_from_file): Call function section_ordering_specified.
5265 * layout.h (is_section_ordering_specified): New function.
5266 (section_ordering_specified): New function.
5267 (section_ordering_specified_): New boolean member.
5268 * main.cc(main): Call load_plugins after layout object is defined.
5269 * output.cc (Output_section::add_input_section): Use
5270 function section_ordering_specified to check if section ordering is
5271 needed.
5272 * output.cc (Output_section::add_relaxed_input_section): Use
5273 function section_ordering_specified to check if section ordering is
5274 needed.
5275 (Output_section::update_section_layout): New function.
5276 (Output_section::sort_attached_input_sections): Check if input section
5277 must be reordered.
5278 * output.h (Output_section::update_section_layout): New function.
5279 * plugin.cc (get_section_count): New function.
5280 (get_section_type): New function.
5281 (get_section_name): New function.
5282 (get_section_contents): New function.
5283 (update_section_order): New function.
58797674 5284 (allow_section_ordering): New function.
e9552f7e
ST
5285 (Plugin::load): Add the new interfaces to the transfer vector.
5286 (Plugin_manager::load_plugins): New parameter.
5287 (Plugin_manager::all_symbols_read): New parameter.
5288 (Plugin_manager::claim_file): New parameter. Save the elf object for
5289 unclaimed objects.
5290 (Plugin_manager::get_elf_object): New function.
5291 (Plugin_manager::get_view): Change to directly use the bool to check
5292 if get_view is called from claim_file_hook.
5293 * plugin.h (input_objects): New function
5294 (Plugin__manager::load_plugins): New parameter.
5295 (Plugin_manager::claim_file): New parameter.
5296 (Plugin_manager::get_elf_object): New function.
5297 (Plugin_manager::in_claim_file_handler): New function.
5298 (Plugin_manager::in_claim_file_handler_): New member.
5299 (layout): New function.
5300 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5301 handler with an extra parameter. Make the elf object before calling
5302 claim_file handler.
5303 * testsuite/plugin_test.c (get_section_count): New function pointer.
5304 (get_section_type): New function pointer.
5305 (get_section_name): New function pointer.
5306 (get_section_contents): New function pointer.
5307 (update_section_order): New function pointer.
5308 (allow_section_ordering): New function pointer.
5309 (onload): Check if the new interfaces exist.
5310
9446efde
ILT
53112011-07-13 Ian Lance Taylor <iant@google.com>
5312
5313 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5314 relro section.
5315 * x86_64.cc (Target_x86_64::got_section): Likewise.
5316 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5317 (relro_now_test_SOURCES): New variable.
5318 (relro_now_test_DEPENDENCIES): New variable.
5319 (relro_now_test_LDFLAGS): New variable.
5320 (relro_now_test_LDADD): New variable.
5321 (relro_now_test.so): New target.
5322 * testsuite/Makefile.in: Rebuild.
5323
07aa62f2
ILT
53242011-07-12 Ian Lance Taylor <iant@google.com>
5325
5326 PR gold/12980
5327 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5328 GLOB_DAT relocation rather than a RELATIVE relocation for a
5329 protected symbol when creating a shared library.
5330 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5331 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5332 * testsuite/protected_main_1.cc (main): Test that protected
5333 function has same address.
5334
e2153196
ILT
53352011-07-11 Ian Lance Taylor <iant@google.com>
5336
5337 PR gold/12979
5338 * options.h (class General_options): Add -Bgroup.
5339 * options.cc (General_options::finalize): If -Bgroup is set,
5340 default to --unresolved-symbols=report-all.
5341 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5342 * target-reloc.h (issue_undefined_symbol_error): Handle
5343 --unresolved-symbols=report-all.
5344
6daf5215
ILT
53452011-07-08 Ian Lance Taylor <iant@google.com>
5346
5347 PR gold/11985
5348 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5349 if linker script discards key sections.
5350 (Layout::create_dynamic_symtab): Likewise.
5351 (Layout::assign_local_dynsym_offsets): Likewise.
5352 (Layout::sized_create_version_sections): Likewise.
5353 (Layout::create_interp): Likewise.
5354 (Layout::finish_dynamic_section): Likewise.
5355 (Layout::set_dynamic_symbol_size): Likewise.
5356
beabb2c6
ILT
53572011-07-08 Ian Lance Taylor <iant@google.com>
5358
5359 PR gold/12386
5360 * options.h (class General_options): Add --unresolved-symbols.
5361 * target-reloc.h (issue_undefined_symbol_error): Check
5362 --unresolved-symbols. Add comments.
5363
9c16daf1
ILT
53642011-07-08 Ian Lance Taylor <iant@google.com>
5365
5366 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5367 expression more complex.
5368
191f1a2d
ILT
53692011-07-08 Ian Lance Taylor <iant@google.com>
5370
5371 PR gold/11317
5372 * target-reloc.h (issue_undefined_symbol_error): New inline
5373 function, broken out of relocate_section.
5374 (relocate_section): Call issue_undefined_symbol_error.
5375 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5376 there is no TLS segment if we are about to issue an undefined
5377 symbol error.
5378 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5379
62855347
ILT
53802011-07-08 Ian Lance Taylor <iant@google.com>
5381
5382 PR gold/12279
5383 * resolve.cc (Symbol_table::should_override): Add fromtype
5384 parameter. Change all callers. Give error when linking together
5385 TLS and non-TLS symbol.
5386 (Symbol_table::should_override_with_special): Add fromtype
5387 parameter. Change all callers.
5388 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5389 there is no TLS segment if we have reported some errors.
5390 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5391
67181c72
ILT
53922011-07-08 Ian Lance Taylor <iant@google.com>
5393
5394 PR gold/12372
5395 * target.h (Target::plt_address_for_global): New function.
5396 (Target::plt_address_for_local): New function.
5397 (Target::plt_section_for_global): Remove.
5398 (Target::plt_section_for_local): Remove.
5399 (Target::do_plt_address_for_global): New virtual function.
5400 (Target::do_plt_address_for_local): New virtual function.
5401 (Target::do_plt_section_for_global): Remove.
5402 (Target::do_plt_section_for_local): Remove.
5403 (Target::register_global_plt_entry): Add Symbol_table and Layout
5404 parameters.
5405 * output.cc (Output_data_got::Got_entry::write): Use
5406 plt_address_for_global and plt_address_for_local.
5407 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5408 address of output section.
5409 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5410 got_irelative_, and irelative_count_ fields. Update
5411 declarations.
5412 (Output_data_plt_i386::has_irelative_section): New function.
5413 (Output_data_plt_i386::entry_count): Add irelative_count_.
5414 (Output_data_plt_i386::set_final_data_size): Likewise.
5415 (class Target_i386): Add got_irelative_ and rel_irelative_
5416 fields. Update declarations.
5417 (Target_i386::Target_i386): Initialize new fields.
5418 (Target_i386::do_plt_address_for_global): New function replacing
5419 do_plt_section_for_global.
5420 (Target_i386::do_plt_address_for_local): New function replacing
5421 do_plt_section_for_local.
5422 (Target_i386::got_section): Create got_irelative_.
5423 (Target_i386::rel_irelative_section): New function.
5424 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5425 fields. Don't define __rel_iplt_{start,end}.
5426 (Output_data_plt_i386::add_entry): Add symtab and layout
5427 parameters. Change all callers. Use different PLT and GOT for
5428 IFUNC symbols.
5429 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5430 layout parameters. Change all callers. Use different PLT and
5431 GOT.
5432 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5433 (Output_data_plt_i386::rel_irelative): New function.
5434 (Output_data_plt_i386::address_for_global): New function.
5435 (Output_data_plt_i386::address_for_local): New function.
5436 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5437 IRELATIVE GOT when changing IFUNC GOT entries.
5438 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5439 reloc.
5440 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5441 if we didn't create an IRELATIVE GOT.
5442 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5443 plt_address_for_local.
5444 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5445 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5446 got_irelative_, and irelative_count_ fields. Update
5447 declarations.
5448 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5449 Initialize new fields. Remove symtab parameter. Change all
5450 callers.
5451 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5452 irelative_count_.
5453 (Output_data_plt_x86_64::has_irelative_section): New function.
5454 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5455 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5456 fields. Update declarations.
5457 (Target_x86_64::Target_x86_64): Initialize new fields.
5458 (Target_x86_64::do_plt_address_for_global): New function replacing
5459 do_plt_section_for_global.
5460 (Target_x86_64::do_plt_address_for_local): New function replacing
5461 do_plt_section_for_local.
5462 (Target_x86_64::got_section): Create got_irelative_.
5463 (Target_x86_64::rela_irelative_section): New function.
5464 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5465 all callers. Don't create __rel_iplt_{start,end}.
5466 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5467 parameters. Change all callers. Use different PLT and GOT for
5468 IFUNC symbols.
5469 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5470 layout parameters. Change all callers. Use different PLT and
5471 GOT.
5472 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5473 parameters. Change all callers. Use different PLT and GOT for
5474 IFUNC symbols.
5475 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5476 (Output_data_plt_x86_64::rela_irelative): New function.
5477 (Output_data_plt_x86_64::address_for_global): New function.
5478 (Output_data_plt_x86_64::address_for_local): New function.
5479 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5480 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5481 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5482 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5483 parameters.
5484 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5485 reloc.
5486 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5487 symbols if we didn't create an IRELATIVE GOT.
5488 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5489 plt_address_for_local.
5490 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5491 * testsuite/ifuncvar1.c: New test file.
5492 * testsuite/ifuncvar2.c: New test file.
5493 * testsuite/ifuncvar3.c: New test file.
5494 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5495 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5496 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5497 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5498 * testsuite/Makefile.in: Rebuild.
5499
33c15b45
CC
55002011-07-07 Cary Coutant <ccoutant@google.com>
5501
5502 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5503 (two_file_test_1_ndebug.o): Likewise.
5504 (two_file_test_1b_ndebug.o): Likewise.
5505 (two_file_test_2_ndebug.o): Likewise.
5506 (two_file_test_main_ndebug.o): Likewise.
5507 (incremental_test_2): Link with no-debug versions.
5508
f48b5fb7
CC
55092011-07-06 Cary Coutant <ccoutant@google.com>
5510
5511 * gold/incremental.cc
5512 (Output_section_incremental_inputs::write_info_blocks): Check for
5513 hidden and internal symbols.
5514
221597a5
CC
55152011-07-06 Cary Coutant <ccoutant@google.com>
5516
5517 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5518 Check disposition for startup file.
5519 (Incremental_inputs::report_command_line): Ignore
5520 --incremental-startup-unchanged option.
5521 * options.cc (General_options::parse_incremental_startup_unchanged):
5522 New function.
5523 (General_options::General_options): Initialize new data member.
5524 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5525 (General_options): Add --incremental-startup-unchanged option.
5526 (General_options::incremental_startup_disposition): New function.
5527 (General_options::incremental_startup_disposition_): New data member.
5528
e24719f6
CC
55292011-07-06 Cary Coutant <ccoutant@google.com>
5530
5531 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5532 input file index to Script_info ctor.
5533 (Sized_incremental_binary::do_file_has_changed): Find the
5534 command-line argument for files named in scripts.
5535 * incremental.h (Script_info::Script_info): New ctor
5536 with input file index.
5537 (Script_info::input_file_index): New function.
5538 (Script_info::input_file_index_): New data member.
5539 (Incremental_binary::get_library): Add const.
5540 (Incremental_binary::get_script_info): Add const.
5541 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5542 * testsuite/Makefile.am (incremental_test_5): New test case.
5543 (incremental_test_6): New test case.
5544 * testsuite/Makefile.in: Regenerate.
5545
8f7c81e8
CC
55462011-07-06 Cary Coutant <ccoutant@google.com>
5547
5548 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5549 debug output when command lines differ.
5550
9fbd3822
CC
55512011-07-06 Cary Coutant <ccoutant@google.com>
5552
5553 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5554 --incremental-patch option.
5555 * layout.cc (Free_list::allocate): Extend allocation beyond original
5556 end if enabled.
5557 (Layout::make_output_section): Mark sections that should get
5558 patch space.
5559 * options.cc (parse_percent): New function.
5560 * options.h (parse_percent): New function.
5561 (DEFINE_percent): New macro.
5562 (General_options): Add --incremental-patch option.
5563 * output.cc (Output_section::Output_section): Initialize new data
5564 members.
5565 (Output_section::add_input_section): Print section name when out
5566 of patch space.
5567 (Output_section::add_output_section_data): Likewise.
5568 (Output_section::set_final_data_size): Add patch space when
5569 doing --incremental-full.
5570 (Output_section::do_reset_address_and_file_offset): Remove patch
5571 space.
5572 (Output_segment::set_section_list_addresses): Print debug output
5573 only if --incremental-update.
5574 * output.h (Output_section::set_is_patch_space_allowed): New function.
5575 (Output_section::is_patch_space_allowed_): New data member.
5576 (Output_section::patch_space_): New data member.
5577 * parameters.cc (Parameters::incremental_full): New function.
5578 * parameters.h (Parameters::incremental_full): New function
5579 * testsuite/Makefile.am (incremental_test_2): Add test for
5580 --incremental-patch option.
5581 * testsuite/Makefile.in: Regenerate.
5582 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5583 (t18): Remove function body.
5584
f6cccc2c
DK
55852011-07-05 Doug Kwan <dougkwan@google.com>
5586
5587 PR gold/12771
5588 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5589 Arm_Address type for relocation result.
5590 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5591 overflow check.
5592 (Arm_relocate_functions::abs32): Use unaligned access.
5593 (Arm_relocate_functions::rel32): Ditto.
5594 (Arm_relocate_functions::prel31): Ditto.
5595 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5596 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5597 static data relocations.
5598 * testsuite/Makefile.in: Regnerate.
5599 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5600
28a13fec
ILT
56012011-07-05 Ian Lance Taylor <iant@google.com>
5602
5603 PR gold/12392
5604 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5605 symbols if necessary.
5606 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5607
24d47b34
ILT
56082011-07-05 Ian Lance Taylor <iant@google.com>
5609
5610 PR gold/12952
5611 * resolve.cc (Symbol::override_base_with_special): Simply override
5612 version with special symbol version, ignoring previous version.
5613
41f9cbbe
ILT
56142011-07-05 Ian Lance Taylor <iant@google.com>
5615
5616 * object.cc (Sized_relobj_file::include_section_group): Add
5617 information to comment about signature location.
5618
886288f1
ILT
56192011-07-02 Ian Lance Taylor <iant@google.com>
5620
5621 PR gold/12957
5622 * options.h (class General_options): Add -f and -F.
5623 * options.cc (General_options::finalize): Fatal error if -f/-F
5624 are used without -shared.
5625 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5626
ae3a6d4f
ILT
56272011-07-02 Ian Lance Taylor <iant@google.com>
5628
5629 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5630
21131061
ILT
56312011-07-01 Ian Lance Taylor <iant@google.com>
5632
5633 PR gold/12525
5634 PR gold/12952
5635 * resolve.cc (Symbol::override_base_with_special): Don't override
5636 the version if the overriding symbol has a different name.
5637 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5638 all callers. If we give an error about an undefined version,
5639 define the base version if necessary.
5640 * dynobj.h (class Versions): Update declaration.
5641 * testsuite/weak_alias_test_5.cc: New file.
5642 * testsuite/weak_alias_test.script: New file.
5643 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5644 and versioned_alias have the right value, and call t2.
5645 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5646 weak_alias_test_5.so.
5647 (weak_alias_test_LDADD): Likewise.
5648 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5649 * testsuite/Makefile.in: Rebuild.
5650
611062c0
ILT
56512011-07-01 Ian Lance Taylor <iant@google.com>
5652
5653 PR gold/12525
5654 * options.h (class General_options): Support -z notext.
5655 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5656 -Wl,-z,notext.
5657 (two_file_shared_nonpic.so): Likewise.
5658 (two_file_shared_mixed.so): Likewise.
5659 (two_file_shared_mixed_1.so): Likewise.
5660 (weak_undef_lib_nonpic.so): Likewise.
5661 (alt/weak_undef_lib_nonpic.so): Likewise.
5662 (tls_test_shared_nonpic.so): Likewise.
5663 * testsuite/Makefile.in: Rebuild.
5664
328c7c2f
ILT
56652011-07-01 Ian Lance Taylor <iant@google.com>
5666
5667 PR gold/12525
5668 * configure.ac: Test whether static linking works, setting
5669 the automake conditional HAVE_STATIC.
5670 * testsuite/Makefile.am: Disable tests using -static if
5671 HAVE_STATIC is not true.
5672 * configure, testsuite/Makefile.in: Rebuild.
5673
02d7cd44
ILT
56742011-07-01 Ian Lance Taylor <iant@google.com>
5675
5676 PR gold/12525
5677 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5678 Assert if we see DW_EH_PE_indirect.
5679 * target.h (Target::ehframe_datarel_base): New function.
5680 (Target::do_ehframe_datarel_base): New target function.
5681 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5682 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5683 function.
5684
07a60597
ILT
56852011-07-01 Ian Lance Taylor <iant@google.com>
5686
5687 PR gold/12571
5688 * options.h (class General_options): Add
5689 --ld-generated-unwind-info.
5690 * ehframe.cc (Fde::write): Add address parameter. Change all
5691 callers. If associated with PLT, fill in address and size.
5692 (Cie::set_output_offset): Only add merge mapping if there is an
5693 object.
5694 (Cie::write): Add address parameter. Change all callers.
5695 (Eh_frame::add_ehframe_for_plt): New function.
5696 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5697 input_offset_ fields into union u_, with new plt field.
5698 (Fde::Fde): Adjust for new union field.
5699 (Fde::Fde) [Output_data version]: New constructor.
5700 (Fde::add_mapping): Only add merge mapping if there is an object.
5701 (class Cie): Update declarations.
5702 (class Eh_frame): Declare add_ehframe_for_plt.
5703 * layout.cc (Layout::layout_eh_frame): Break out code into
5704 make_eh_frame_section, and call it.
5705 (Layout::make_eh_frame_section): New function.
5706 (Layout::add_eh_frame_for_plt): New function.
5707 * layout.h (class Layout): Update declarations.
5708 * merge.cc (Merge_map::add_mapping): Add assertion.
5709 * i386.cc: Include "dwarf.h".
5710 (class Output_data_plt_i386): Make first_plt_entry,
5711 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5712 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5713 and plt_eh_frame_fde.
5714 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5715 boundary. Call add_eh_frame_for_plt if appropriate.
5716 * x86_64.cc: Include "dwarf.h".
5717 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5718 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5719 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5720 and plt_eh_frame_fde.
5721 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5722 appropriate.
5723
14788a3f
ILT
57242011-06-29 Ian Lance Taylor <iant@google.com>
5725
5726 PR gold/12629
5727 * object.cc (Sized_relobj_file::layout_section): Change shdr
5728 parameter to be const.
5729 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5730 out of do_layout.
5731 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5732 appropriate. Call layout_eh_frame_section.
5733 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5734 sections.
5735 * object.h (class Sized_relobj_file): Update declarations.
5736
6c21fce1
ILT
57372011-06-29 Ian Lance Taylor <iant@google.com>
5738
37e41b03 5739 PR gold/12652
6c21fce1
ILT
5740 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5741 modifier.
5742 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5743
4d5e4e62
ILT
57442011-06-29 Ian Lance Taylor <iant@google.com>
5745
5746 PR gold/12675
5747 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5748 SHT_X86_64_UNWIND.
5749 * layout.cc (Layout::layout_eh_frame): Likewise.
5750
886f533a
ILT
57512011-06-29 Ian Lance Taylor <iant@google.com>
5752
5753 PR gold/12695
5754 * layout.cc (Layout::symtab_section_shndx): New function.
5755 * layout.h (class Layout): Declare symtab_section_shndx.
5756 * output.cc (Output_section::write_header): Call it.
5757
f3ae1b28
ILT
57582011-06-29 Ian Lance Taylor <iant@google.com>
5759
5760 PR gold/12818
5761 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5762 symbols which are not used in a relocation.
5763
aecf301f
ILT
57642011-06-28 Ian Lance Taylor <iant@google.com>
5765
5766 PR gold/12898
5767 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5768 script create indistinguishable segments.
5769 (Layout::set_segment_offsets): Use stable_sort when sorting
5770 segments. Pass this to Compare_segments constructor.
5771 * layout.h (class Layout): Make segment_precedes non-static.
5772 (class Compare_segments): Change from struct to class. Add
5773 layout_ field. Add constructor.
5774 * script-sections.cc
5775 (Script_sections::attach_sections_using_phdrs_clause): Rename
5776 local orphan to is_orphan. Don't report failure to put empty
5777 section in segment. On attachment failure, report name of
5778 section, and attach to first PT_LOAD segment.
5779
03ef7571
ILT
57802011-06-28 Ian Lance Taylor <iant@google.com>
5781
5782 PR gold/12934
5783 * target-select.cc (Target_selector::Target_selector): Add
5784 emulation parameter. Change all callers.
5785 (select_target_by_bfd_name): Rename from select_target_by_name.
5786 Change all callers.
5787 (select_target_by_emulation): New function.
5788 (supported_emulation_names): New function.
5789 * target-select.h (class Target_selector): Add emulation_ field.
5790 Update declarations.
5791 (Target_selector::recognize_by_bfd_name): Rename from
5792 recognize_by_name. Change all callers.
5793 (Target_selector::supported_bfd_names): Rename from
5794 supported_names. Change all callers.
5795 (Target_selector::recognize_by_emulation): New function.
5796 (Target_selector::supported_emulations): New function.
5797 (Target_selector::emulation): New function.
5798 (Target_selector::do_recognize_by_bfd_name): Rename from
5799 do_recognize_by_name. Change all callers.
5800 (Target_selector::do_supported_bfd_names): Rename from
5801 do_supported_names. Change all callers.
5802 (Target_selector::do_recognize_by_emulation): New function.
5803 (Target_selector::do_supported_emulations): New function.
5804 (select_target_by_bfd_name): Change name in declaration.
5805 (select_target_by_emulation): Declare.
5806 (supported_emulation_names): Declare.
5807 * parameters.cc (parameters_force_valid_target): Try to find
5808 target based on emulation from -m option.
5809 * options.h (class General_options): Change doc string for -m.
5810 * options.cc (help): Print emulations.
5811 (General_options::parse_V): Likewise.
5812 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5813 Add emulation parameter. Change all callers.
5814
200b2bb9
ILT
58152011-06-28 Ian Lance Taylor <iant@google.com>
5816
5817 * target.h (class Target): Add osabi_ field.
5818 (Target::osabi): New function.
5819 (Target::set_osabi): New function.
5820 (Target::Target): Initialize osabi_.
5821 (Target::do_adjust_elf_header): Make pure virtual.
5822 (Sized_target::do_adjust_elf_header): Declare.
5823 * target.cc (Sized_target::do_adjust_elf_header): New function.
5824 (class Sized_target): Instantiate all versions.
5825 * freebsd.h (class Target_freebsd): Remove.
5826 (Target_selector_freebsd::do_recognize): Call set_osabi on
5827 Target.
5828 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5829 (Target_selector_freebsd::set_osabi): Remove.
5830 * i386.cc (class Target_i386): Inherit from Sized_target rather
5831 than Target_freebsd.
5832 * x86_64.cc (class Target_x86_64): Likewise.
5833
b3ce541e
ILT
58342011-06-28 Ian Lance Taylor <iant@google.com>
5835
5836 * target.h (Target::can_check_for_function_pointers): Rewrite.
5837 Make non-virtual.
5838 (Target::can_icf_inline_merge_sections): Likewise.
5839 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5840 (Target::Target_info): Add can_icf_inline_merge_sections field.
5841 (Target::do_can_check_for_function_pointers): New virtual
5842 function.
5843 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5844 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5845 from can_check_for_function_pointers, move in file.
5846 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5847 section_may_have_icf_unsafe_poineters, move in file.
5848 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5849 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5850 Rename from can_check_for_function_pointers, move in file.
5851 (Target_i386::can_icf_inline_merge_sections): Remove.
5852 (Target_i386::i386_info): Initialize
5853 can_icf_inline_merge_sections.
5854 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5855 Initialize can_icf_inline_merge_sections.
5856 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5857 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5858 Rename from can_check_for_function_pointers, move in file.
5859 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5860 (Target_x86_64::x86_64_info): Initialize
5861 can_icf_inline_merge_sections.
5862 * testsuite/testfile.cc (Target_test::test_target_info):
5863 Likewise.
5864 * icf.cc (get_section_contents): Correct formatting.
5865
6d1c4efb
ILT
58662011-06-27 Ian Lance Taylor <iant@google.com>
5867
5868 * symtab.cc (Symbol::versioned_name): New function.
5869 (Symbol_table::add_to_final_symtab): Use versioned_name when
5870 appropriate.
5871 (Symbol_table::sized_write_symbol): Likewise.
5872 * symtab.h (class Symbol): Declare versioned_name.
5873 * stringpool.h (class Stringpool_template): Add variant of add
5874 which takes a std::basic_string.
5875 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5876 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5877 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5878 (ver_test_12.o): New target.
5879 * testsuite/Makefile.in: Rebuild.
5880
57eb9b50
DK
58812011-06-27 Doug Kwan <dougkwan@google.com>
5882
5883 * arm.cc (Arm_relocate_functions::thm_jump8,
5884 Arm_relocate_functions::thm_jump11): Use a wider signed
5885 type to compute offset.
5886 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5887 arm_thm_jump8.
5888 * testsuite/Makefile.in: Regenerate.
5889 * testsuite/arm_branch_in_range.sh: Check test results of
5890 arm_thm_jump11 and arm_thm_jump8.
5891 * testsuite/arm_thm_jump11.s: New test source file.
5892 * testsuite/arm_thm_jump11.t: New linker script.
5893 * testsuite/arm_thm_jump8.s: New test source file.
5894 * testsuite/arm_thm_jump8.t: New linker script.
5895
487b39df
ILT
58962011-06-24 Ian Lance Taylor <iant@google.com>
5897
5898 * layout.cc: Include "object.h".
5899 (ctors_sections_in_init_array): New static variable.
5900 (Layout::is_ctors_in_init_array): New function.
5901 (Layout::layout): Add entry to ctors_sections_in_init_array if
5902 appropriate.
5903 * layout.h (class Layout): Declare is_ctors_in_init_array.
5904 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5905 is_ctors_reverse_view is set.
5906 (Sized_relobj_file::write_sections): Add layout parameter. Change
5907 all callers. Set is_ctors_reverse_view field of View_size.
5908 (Sized_relobj_file::reverse_words): New function.
5909 * object.h (Sized_relobj_file::View_size): Add
5910 is_ctors_reverse_view field.
5911 (class Sized_relobj_file): Update declarations.
5912 * testsuite/initpri3.c: New test.
5913 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5914 initpri3b.
5915 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5916 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5917 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5918 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5919 * testsuite/Makefile.in: Rebuild.
5920
472076e4
CC
59212011-06-24 Cary Coutant <ccoutant@google.com>
5922
5923 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5924 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5925 (debug_msg_cdebug.err): New targets.
5926 * testsuite/Makefile.in: Regenerate.
5927 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5928 Fix checks for link with shared library.
5929
a60af0db
DK
59302011-06-24 Doug Kwan <dougkwan@google.com>
5931
5932 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5933 skip empty text sections.
5934 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5935
5393d741
ILT
59362011-06-22 Ian Lance Taylor <iant@google.com>
5937
5938 PR gold/12910
5939 * options.h (class General_options): Add --ctors-in-init-array.
5940 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5941 friends as SHT_PROGBITS for merging sections.
5942 (Layout::layout): Remove special handling of .init_array and
5943 friends. Don't sort if doing relocatable link. Sort for .ctors
5944 and .dtors if ctors_in_init_array.
5945 (Layout::make_output_section): Force correct section types for
5946 .init_array and friends. Don't sort if doing relocatable link,
5947 Don't sort .ctors and .dtors if ctors_in_init_array.
5948 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5949 (Layout::output_section_name): Add relobj parameter. Change all
5950 callers. Handle .ctors. and .dtors. in code rather than table.
5951 Handle .ctors and .dtors if ctors_in_init_array.
5952 (Layout::match_file_name): New function, moved from output.cc.
5953 * layout.h (class Layout): Update declarations.
5954 * output.cc: Include "layout.h".
5955 (Input_section_sort_entry::get_priority): New function.
5956 (Input_section_sort_entry::match_file_name): Just call
5957 Layout::match_file_name.
5958 (Output_section::Input_section_sort_init_fini_compare::operator()):
5959 Handle .ctors and .dtors. Sort by explicit priority rather than
5960 by name.
5961 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5962 * testsuite/initpri2.c: New test.
5963 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5964 (check_PROGRAMS): Add initpri2.
5965 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5966 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5967 * configure, testsuite/Makefile.in: Rebuild.
5968
e1f74f98
ILT
59692011-06-19 Ian Lance Taylor <iant@google.com>
5970
5971 PR gold/12880
5972 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5973 .interp section to a PT_INTERP segment even if we have seen a
5974 --dynamic-linker option. Don't do it if we have seen a PHDRS
5975 clause in a linker script.
5976 (Layout::finalize): Don't create a .interp section if we've
5977 already create a PT_INTERP segment.
5978 (Layout::create_interp): Always call choose_output_section (revert
5979 patch of 2011-06-17). Don't create PT_INTERP segment.
5980 * script-sections.cc
5981 (Script_sections::create_note_and_tls_segments): Add a .interp
5982 section to a PT_INTERP segment even if we have seen a
5983 --dynamic-linker option.
5984
766f91bb
ILT
59852011-06-18 Ian Lance Taylor <iant@google.com>
5986
5987 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5988 merely because a non-PT_LOAD segment has a dynamic reloc.
5989
0d212c3a
ILT
59902011-06-18 Ian Lance Taylor <iant@google.com>
5991
5992 * layout.cc (Layout::finish_dynamic_section): Don't create
5993 DT_FLAGS entry if not needed.
5994
911a5072
ILT
59952011-06-18 Ian Lance Taylor <iant@google.com>
5996
5997 PR gold/12745
5998 * layout.cc (Layout::layout_eh_frame): Correct handling of
5999 writable .eh_frame section.
6000
534b4e5f
ILT
60012011-06-17 Ian Lance Taylor <iant@google.com>
6002
6003 PR gold/12893
6004 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6005 symbol is redefined with the exact same object and value.
6006
10b4f102
ILT
60072011-06-17 Ian Lance Taylor <iant@google.com>
6008
6009 PR gold/12880
6010 * layout.h (class Layout): Add interp_segment_ field.
6011 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6012 (Layout::attach_allocated_section_to_segment): If making shared
6013 library, put .interp section in PT_INTERP segment.
6014 (Layout::finalize): Also call create_interp if -dynamic-linker
6015 option was used.
6016 (Layout::create_interp): Assert that there is no PT_INTERP
6017 segment. If not using a SECTIONS clause, use make_output_section.
6018 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6019 * script-sections.cc
6020 (Script_sections::create_note_and_tls_segments): If making shared
6021 library, put .interp section in PT_INTERP segment.
6022
a29b0dad
ILT
60232011-06-17 Ian Lance Taylor <iant@google.com>
6024
e588ea8d
ILT
6025 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6026 when making a shared library.
6027
60282011-06-17 Ian Lance Taylor <iant@google.com>
6029
6030 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6031 parameter. Change all callers. Don't issue warning about PC32
6032 against locally defined symbol.
a29b0dad 6033
9d3b0698
ILT
60342011-06-16 Ian Lance Taylor <iant@google.com>
6035
6036 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6037 occurs in same object.
6038
85b0f90c
AM
60392011-06-14 Alan Modra <amodra@gmail.com>
6040
6041 * po/POTFILES.in: Regenerate.
6042
a94907d9
ILT
60432011-06-09 Ian Lance Taylor <iant@google.com>
6044
6045 * script-sections.cc
6046 (Orphan_output_section::set_section_addresses): For a relocatable
6047 link set address to 0.
6048
4fb3a1c3
CC
60492011-06-09 Cary Coutant <ccoutant@google.com>
6050
6051 PR gold/12804
6052 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6053 used with --compress-debug-sections.
6054 * gold/object.cc (Sized_relobj_file::do_layout): Report
6055 uncompressed size of compressed input sections.
6056
61220854
CC
60572011-06-08 Cary Coutant <ccoutant@google.com>
6058
6059 PR gold/12804
6060 * testsuite/two_file_test_2_v1.cc: Change initialization of
6061 v2 to keep it in .data.
6062
e6455dfb
CC
60632011-06-07 Cary Coutant <ccoutant@google.com>
6064
6065 * common.cc (Symbol_table::do_allocate_commons_list): Call
6066 gold_fallback.
6067 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6068 (Errors::fallback): New function.
6069 (gold_fallback): New function.
6070 * errors.h (Errors::fallback): New function.
6071 * gold.cc (gold_exit): Change status parameter to enum; adjust
6072 all callers.
6073 (queue_initial_tasks): Call gold_fallback.
6074 * gold.h: Include cstdlib.
6075 (Exit_status): New enum type.
6076 (gold_exit): Change status parameter to enum.
6077 (gold_fallback): New function.
6078 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6079 (Layout::create_symtab_sections): Likewise.
6080 (Layout::create_shdrs): Likewise.
6081 * main.cc (main): Adjust call to gold_exit.
6082 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6083 (Output_data_got::add_got_entry_pair): Likewise.
6084 (Output_section::add_input_section): Likewise.
6085 (Output_section::add_output_section_data): Likewise.
6086 (Output_segment::set_section_list_addresses): Likewise.
6087 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6088
fb0e076f
CC
60892011-06-07 Cary Coutant <ccoutant@google.com>
6090
6091 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6092 for incremental links.
6093 * output.cc (Output_segment::set_section_list_addresses): Remove
6094 FIXME and test for TLS or BSS.
6095
a5ee4d5d
CC
60962011-06-07 Cary Coutant <ccoutant@google.com>
6097
6098 * testsuite/Makefile.am: Add incremental_copy_test,
6099 incremental_common_test_1.
6100 * testsuite/Makefile.in: Regenerate.
6101 * testsuite/common_test_1_v1.c: New source file.
6102 * testsuite/common_test_1_v2.c: New source file.
6103 * testsuite/copy_test_v1.cc: New source file.
6104
5146f448
CC
61052011-06-07 Cary Coutant <ccoutant@google.com>
6106
6107 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6108 update, allocate common from bss section's free list.
6109 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6110 linker-defined symbols.
6111 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6112 Skip GOT and PLT entries that are no longer referenced.
6113 (Output_section_incremental_inputs::write_info_blocks): Mark
6114 linker-defined symbols.
6115 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6116 * output.cc (Output_section::allocate): New function.
6117 * output.h (Output_section::allocate): New function.
6118 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6119 linker-defined symbols.
6120 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6121 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6122 (Symbol::init_base_output_data): Likewise.
6123 (Symbol::init_base_output_segment): Likewise.
6124 (Symbol::init_base_constant): Likewise.
6125 (Sized_symbol::init_output_data): Likewise.
6126 (Sized_symbol::init_output_segment): Likewise.
6127 (Sized_symbol::init_constant): Likewise.
6128 (Symbol_table::do_define_in_output_data): Likewise.
6129 (Symbol_table::do_define_in_output_segment): Likewise.
6130 (Symbol_table::do_define_as_constant): Likewise.
6131 * symtab.h (Symbol::is_predefined): New function.
6132 (Symbol::init_base_output_data): Add is_predefined parameter.
6133 (Symbol::init_base_output_segment): Likewise.
6134 (Symbol::init_base_constant): Likewise.
6135 (Symbol::is_predefined_): New data member.
6136 (Sized_symbol::init_output_data): Add is_predefined parameter.
6137 (Sized_symbol::init_output_segment): Likewise.
6138 (Sized_symbol::init_constant): Likewise.
6139 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6140
26d3c67d
CC
61412011-06-07 Cary Coutant <ccoutant@google.com>
6142
6143 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6144 instead of emit_copy_reloc.
6145 (Copy_relocs::emit_copy_reloc): Refactor.
6146 (Copy_relocs::make_copy_reloc): New function.
6147 (Copy_relocs::add_copy_reloc): Remove.
6148 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6149 section.
6150 (Copy_relocs::make_copy_reloc): New function.
6151 (Copy_relocs::add_copy_reloc): Remove.
6152 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6153 unchanged input files.
6154 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6155 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6156 Reserve BSS space for COPY relocations.
6157 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6158 (Output_section_incremental_inputs::write_info_blocks): Record
6159 whether a symbol is copied from a shared object.
6160 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6161 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6162 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6163 (Incremental_input_entry_reader::get_output_symbol_index): Add
6164 is_copy parameter.
6165 (Incremental_binary::emit_copy_relocs): New function.
6166 (Incremental_binary::do_emit_copy_relocs): New function.
6167 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6168 new data member.
6169 (Sized_incremental_binary::add_copy_reloc): New function.
6170 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6171 (Sized_incremental_binary::Copy_reloc): New struct.
6172 (Sized_incremental_binary::Copy_relocs): New typedef.
6173 (Sized_incremental_binary::copy_relocs_): New data member.
6174 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6175 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6176 * target.h (Sized_target::emit_copy_reloc): New function.
6177 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6178
7cdb37d9
CC
61792011-06-02 Cary Coutant <ccoutant@google.com>
6180
6181 PR gold/12163
6182 * gold/archive.cc (Archive::Archive): Initialize new data member.
6183 (Archive::include_all_members): Return if archive has already been
6184 included.
6185 * gold/archive.h (Archive::include_all_members_): New data member.
6186
cc643b88
NC
61872011-06-02 Nick Clifton <nickc@redhat.com>
6188
6189 * dynobj.h: Fix spelling mistake in comment.
6190 * output.cc: Likewise.
6191
f62a3ca7 61922011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6193 Asier Llano
f62a3ca7
DK
6194
6195 PR gold/12826
cc643b88 6196 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6197 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6198 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6199 redundant arm_exidx_test.so.
6200 * testsuite/Makefile.in: Regenerate.
6201 (check_SCRIPTS): Add pr12826.sh
6202 (check_DATA): Add pr12826.stdout
6203 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6204 * testsuite/pr12826.sh: New file.
6205 * testsuite/pr12826_1.s: Ditto.
6206 * testsuite/pr12826_1.s: Ditto.
6207
8dbe1edc
ILT
62082011-05-30 Ian Lance Taylor <iant@google.com>
6209
6210 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6211 sections.
6212
c49875be
ILT
62132011-05-29 Ian Lance Taylor <iant@google.com>
6214
6215 PR gold/12804
6216 * testsuite/Makefile.am: Use different file name for two_file_test
6217 temporary file for each incremental test.
6218 * testsuite/Makefile.in: Rebuild.
6219
69d53f7a
ILT
62202011-05-29 Ian Lance Taylor <iant@google.com>
6221
6222 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6223 binary input file is empty.
6224
41d0ab5f
ILT
62252011-05-27 Ian Lance Taylor <iant@google.com>
6226
6227 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6228 (ver_test_9.so): Likewise.
6229 * testsuite/Makefile.in: Rebuild.
6230
89d8a36b
CC
62312011-05-26 Cary Coutant <ccoutant@google.com>
6232
6233 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6234 * incremental.cc (Incremental_inputs::report_input_section): Fix
6235 comment, indentation.
6236 (Incremental_inputs::report_comdat_group): New function.
6237 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6238 of data for incremental input file entry.
6239 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6240 group count, COMDAT group signatures.
6241 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6242 an unchanged input file.
6243 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6244 Initialize new data member.
6245 (Incremental_object_entry::add_comdat_group): New function.
6246 (Incremental_object_entry::get_comdat_group_count): New function.
6247 (Incremental_object_entry::get_comdat_signature_key): New function.
6248 (Incremental_object_entry::groups_): New data member.
6249 (Incremental_inputs::report_comdat_group): New function.
6250 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6251 data for incremental input file entry.
6252 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6253 (Incremental_input_entry_reader::get_input_section): Adjust size of
6254 data for incremental input file entry.
6255 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6256 (Incremental_input_entry_reader::get_comdat_group_signature): New
6257 function.
6258 * object.cc (Sized_relobj::include_section_group): Report kept
6259 COMDAT groups for incremental links.
6260
1706a06f
ILT
62612011-05-24 David Meyer <pdox@google.com>
6262
6263 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6264 with name parameter. Add found_name parameter.
6265 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6266 * dirsearch.h (class Dirsearch): Update declaration.
6267
a10ae760
ILT
62682011-05-24 Ian Lance Taylor <iant@google.com>
6269
6270 * archive.cc (Library_base::should_include_member): Pull in object
6271 from archive if it defines the entry symbol.
6272 * parameters.cc (Parameters::entry): New function.
6273 * parameters.h (class Parameters): Declare entry.
6274 * output.h (class Output_file_header): Remove entry_ field.
6275 * output.cc (Output_file_header::Output_file_header): Remove entry
6276 parameter. Change all callers.
6277 (Output_file_header::entry): Use parameters->entry.
6278 * gold.cc (queue_middle_tasks): Likewise.
6279 * plugin.cc (Plugin_hook::run): Likewise.
6280
aa92d6ed
CC
62812011-05-24 Cary Coutant <ccoutant@google.com>
6282
6283 * gold.cc (queue_initial_tasks): Pass incremental base filename
6284 to Output_file::open_base_file; don't print error message.
6285 * incremental-dump.cc (main): Adjust call to
6286 Output_file::open_for_modification.
6287 * incremental-dump.cc (main): Likewise.
6288 * incremental.cc (Incremental_inputs::report_command_line):
6289 Ignore --incremental-base option when comparing command lines.
6290 Ignore parameter when given as separate argument.
6291 * options.h (class General_options): Add --incremental-base.
6292 * output.cc (Output_file::Output_file):
6293 (Output_file::open_base_file): Add base_name and writable parameters;
6294 read base file into new file; print error message here.
6295 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6296 callers.
6297 * output.h (Output_file::open_for_modification): Rename to...
6298 (Output_file::open_base_file): ...this; add base_name and
6299 writable parameters; adjust all callers.
6300 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6301 callers.
6302 * testsuite/Makefile.am (incremental_test_4): Test
6303 --incremental-base.
6304 * testsuite/Makefile.in: Regenerate.
6305
2eedd706
CC
63062011-05-24 Cary Coutant <ccoutant@google.com>
6307
6308 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6309 incremental_test_4.
6310 * testsuite/Makefile.in: Regenerate.
6311 * testsuite/two_file_test_1_v1.cc: New test source file.
6312 * testsuite/two_file_test_1b_v1.cc: New test source file.
6313 * testsuite/two_file_test_2_v1.cc: New test source file.
6314
0f1c85a6
CC
63152011-05-24 Cary Coutant <ccoutant@google.com>
6316
6317 * dynobj.h (Dynobj::do_dynobj): New function.
6318 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6319 flag and soname for shared objects.
6320 * incremental.cc (Incremental_inputs::report_object): Make
6321 either Incremental_object_entry or Incremental_dynobj_entry; add
6322 soname to string table.
6323 (Incremental_inputs::report_input_section): Add assertion.
6324 (Output_section_incremental_inputs::set_final_data_size): Adjust
6325 type of input file entry for shared libraries; adjust size of
6326 shared library info entry.
6327 (Output_section_incremental_inputs::write_input_files): Write
6328 as_needed flag for shared libraries.
6329 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6330 of input file entry for shared libraries; write soname.
6331 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6332 soname from incremental info.
6333 * incremental.h (enum Incremental_input_flags): Add
6334 INCREMENTAL_INPUT_AS_NEEDED.
6335 (Incremental_input_entry::Incremental_input_entry): Initialize new
6336 data member.
6337 (Incremental_input_entry::set_as_needed): New function.
6338 (Incremental_input_entry::as_needed): New function.
6339 (Incremental_input_entry::do_dynobj_entry): New function.
6340 (Incremental_input_entry::as_needed_): New data member.
6341 (Incremental_object_entry::Incremental_object_entry): Don't check
6342 for shared library.
6343 (Incremental_object_entry::do_type): Likewise.
6344 (class Incremental_dynobj_entry): New class.
6345 (Incremental_input_entry_reader::as_needed): New function.
6346 (Incremental_input_entry_reader::get_soname): New function.
6347 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6348 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6349 size of shared library info entry.
58797674 6350 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6351 incremental link when adding DT_NEEDED entries.
6352 * object.h (Object::Object): Initialize new data member.
6353 (Object::dynobj): New function.
6354 (Object::set_as_needed): New function.
6355 (Object::as_needed): New function.
6356 (Object::do_dynobj): New function.
6357 (Object::as_needed_): New data member.
6358
6fa2a40b
CC
63592011-05-24 Cary Coutant <ccoutant@google.com>
6360
6361 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6362 info; adjust display of GOT entries.
6363 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6364 vector of input objects; remove file_status_.
6365 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6366 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6367 got_plt reader; call target hooks to reserve GOT entries.
6368 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6369 of input file info header and GOT info entry.
6370 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6371 relocation info.
6372 (Got_plt_view_info::got_descriptor): Remove.
6373 (Got_plt_view_info::sym_index): New data member.
6374 (Got_plt_view_info::input_index): New data member.
6375 (Local_got_offset_visitor::visit): Write input file index.
6376 (Global_got_offset_visitor::visit): Write 0 for input file index.
6377 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6378 with sym_index and input_index.
6379 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6380 incremental info GOT entry; replace got_descriptor with input_index.
6381 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6382 map from input file index to object.
6383 (Sized_relobj_incr::do_layout): Replace direct data member reference
6384 with accessor function.
6385 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6386 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6387 Adjust size of input file info header.
6388 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6389 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6390 (Incremental_input_entry_reader::get_input_section): Adjust size of
6391 input file info header.
6392 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6393 of incremental info GOT entry.
6394 (Incremental_got_plt_reader::get_got_desc): Remove.
6395 (Incremental_got_plt_reader::get_got_symndx): New function.
6396 (Incremental_got_plt_reader::get_got_input_index): New function.
6397 (Sized_incremental_binary::Sized_incremental_binary): Remove
6398 file_status_; add input_objects_.
6399 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6400 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6401 (Sized_incremental_binary::file_is_unchanged): Remove.
6402 (Sized_incremental_binary::set_input_object): New function.
6403 (Sized_incremental_binary::input_object): New function.
6404 (Sized_incremental_binary::file_status_): Remove.
6405 (Sized_incremental_binary::input_objects_): New data member.
6406 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6407 references.
6408 (Sized_relobj_incr::invalid_address): Move to base class.
6409 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6410 class.
6411 (Sized_relobj_incr::do_output_section_offset): Likewise.
6412 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6413 (Sized_relobj_incr::section_offsets_): Likewise.
6414 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6415 function.
6416 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6417 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6418 with accessor function.
6419 (Sized_relobj_file::do_layout): Likewise.
6420 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6421 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6422 (Sized_relobj_file::compute_final_local_value): Replace refs to
6423 section_offsets_ with accessor function.
6424 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6425 * object.h (Relobj::Relobj): Initialize new data members.
6426 (Relobj::add_dyn_reloc): New function.
6427 (Relobj::first_dyn_reloc): New function.
6428 (Relobj::dyn_reloc_count): New function.
6429 (Relobj::first_dyn_reloc_): New data member.
6430 (Relobj::dyn_reloc_count_): New data member.
6431 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6432 references.
6433 (Sized_relobj::Address): New typedef.
6434 (Sized_relobj::invalid_address): Move here from child class.
6435 (Sized_relobj::Sized_relobj): Initialize new data members.
6436 (Sized_relobj::sized_relobj): New function.
6437 (Sized_relobj::is_output_section_offset_invalid): Move here from
6438 child class.
6439 (Sized_relobj::get_output_section_offset): Likewise.
6440 (Sized_relobj::local_has_got_offset): Likewise.
6441 (Sized_relobj::local_got_offset): Likewise.
6442 (Sized_relobj::set_local_got_offset): Likewise.
6443 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6444 (Sized_relobj::clear_got_offsets): New function.
6445 (Sized_relobj::section_offsets): Move here from child class.
6446 (Sized_relobj::do_output_section_offset): Likewise.
6447 (Sized_relobj::do_set_section_offset): Likewise.
6448 (Sized_relobj::Local_got_offsets): Likewise.
6449 (Sized_relobj::local_got_offsets_): Likewise.
6450 (Sized_relobj::section_offsets_): Likewise.
6451 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6452 references.
6453 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6454 class.
6455 (Sized_relobj_file::sized_relobj): New function
6456 (Sized_relobj_file::local_has_got_offset): Move to base class.
6457 (Sized_relobj_file::local_got_offset): Likewise.
6458 (Sized_relobj_file::set_local_got_offset): Likewise.
6459 (Sized_relobj_file::get_output_section_offset): Likewise.
6460 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6461 (Sized_relobj_file::do_output_section_offset): Likewise.
6462 (Sized_relobj_file::do_set_section_offset): Likewise.
6463 (Sized_relobj_file::Local_got_offsets): Likewise.
6464 (Sized_relobj_file::local_got_offsets_): Likewise.
6465 (Sized_relobj_file::section_offsets_): Likewise.
6466 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6467 (all constructors).
6468 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6469 (Output_reloc::get_symbol_index): Likewise.
6470 (Output_reloc::local_section_offset): Likewise.
6471 (Output_reloc::get_address): Likewise.
6472 (Output_reloc::symbol_value): Likewise.
6473 (Output_data_got::reserve_slot): Move to class definition.
6474 (Output_data_got::reserve_local): New function.
6475 (Output_data_got::reserve_slot_for_global): Remove.
6476 (Output_data_got::reserve_global): New function.
6477 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6478 (all constructors, two instantiations).
6479 (Output_reloc::get_relobj): New function (two instantiations).
6480 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6481 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6482 (Output_data_reloc::add_global): Adjust type of relobj.
6483 (Output_data_reloc::add_global_relative): Likewise.
6484 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6485 (Output_data_reloc::add_local): Likewise.
6486 (Output_data_reloc::add_local_relative): Likewise.
6487 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6488 (Output_data_reloc::add_local_section): Likewise.
6489 (Output_data_reloc::add_output_section): Likewise.
6490 (Output_data_reloc::add_absolute): Likewise.
6491 (Output_data_reloc::add_target_specific): Likewise.
6492 (Output_data_got::reserve_slot): Move definition here.
6493 (Output_data_got::reserve_local): New function.
6494 (Output_data_got::reserve_global): New function.
6495 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6496 section_offsets_ with accessor function.
6497 (Sized_relobj_file::write_sections): Likewise.
6498 (Sized_relobj_file::do_relocate_sections): Likewise.
6499 * target.h (Sized_target::reserve_local_got_entry): New function.
6500 (Sized_target::reserve_global_got_entry): New function.
6501 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6502 (Target_x86_64::reserve_global_got_entry): New function.
6503 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6504
4829d394
CC
65052011-05-23 Cary Coutant <ccoutant@google.com>
6506
6507 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6508 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6509 bit when checking got_type.
6510 * incremental.cc (Sized_incremental_binary::setup_readers):
6511 Store symbol table and string table locations; initialize bit vector
6512 of file status flags.
6513 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6514 unchanged files.
6515 (Sized_incremental_binary::do_process_got_plt): New function.
6516 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6517 (Output_section_incremental_inputs::set_final_data_size): Record
6518 file index for each input file.
6519 (Output_section_incremental_inputs::write_got_plt): Store file index
6520 instead of input entry offset for each GOT entry.
6521 * incremental.h
6522 (Incremental_input_entry::Incremental_input_entry): Initialize new
6523 data member.
6524 (Incremental_input_entry::set_offset): Store file index.
6525 (Incremental_input_entry::get_file_index): New function.
6526 (Incremental_input_entry::file_index_): New data member.
6527 (Incremental_binary::process_got_plt): New function.
6528 (Incremental_binary::do_process_got_plt): New function.
6529 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6530 data members.
6531 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6532 (Sized_incremental_binary::set_file_is_unchanged): New function.
6533 (Sized_incremental_binary::file_is_unchanged): New function.
6534 (Sized_incremental_binary::do_process_got_plt): New function.
6535 (Sized_incremental_binary::file_status_): New data member.
6536 (Sized_incremental_binary::main_symtab_loc_): New data member.
6537 (Sized_incremental_binary::main_strtab_loc_): New data member.
6538 * output.cc (Output_data_got::Got_entry::write): Add case
6539 RESERVED_CODE.
6540 (Output_data_got::add_global): Call add_got_entry.
6541 (Output_data_got::add_global_plt): Likewise.
6542 (Output_data_got::add_global_with_rel): Likewise.
6543 (Output_data_got::add_global_with_rela): Likewise.
6544 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6545 (Output_data_got::add_global_pair_with_rela): Likewise.
6546 (Output_data_got::add_local): Call add_got_entry.
6547 (Output_data_got::add_local_plt): Likewise.
6548 (Output_data_got::add_local_with_rel): Likewise.
6549 (Output_data_got::add_local_with_rela): Likewise.
6550 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6551 (Output_data_got::add_local_pair_with_rela): Likewise.
6552 (Output_data_got::reserve_slot): New function.
6553 (Output_data_got::reserve_slot_for_global): New function.
6554 (Output_data_got::add_got_entry): New function.
6555 (Output_data_got::add_got_entry_pair): New function.
6556 (Output_section::add_output_section_data): Edit FIXME.
6557 * output.h
6558 (Output_section_data_build::Output_section_data_build): New
6559 constructor with size parameter.
6560 (Output_data_space::Output_data_space): Likewise.
6561 (Output_data_got::Output_data_got): Initialize new data member; new
6562 constructor with size parameter.
6563 (Output_data_got::add_constant): Call add_got_entry.
6564 (Output_data_got::reserve_slot): New function.
6565 (Output_data_got::reserve_slot_for_global): New function.
6566 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6567 (Output_data_got::add_got_entry): New function.
6568 (Output_data_got::add_got_entry_pair): New function.
6569 (Output_data_got::free_list_): New data member.
6570 * target.h (Sized_target::init_got_plt_for_update): New function.
6571 (Sized_target::register_global_plt_entry): New function.
6572 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6573 Initialize new data member; call init; add constructor with PLT count.
6574 (Output_data_plt_x86_64::init): New function.
6575 (Output_data_plt_x86_64::add_relocation): New function.
6576 (Output_data_plt_x86_64::reserve_slot): New function.
6577 (Output_data_plt_x86_64::free_list_): New data member.
6578 (Target_x86_64::init_got_plt_for_update): New function.
6579 (Target_x86_64::register_global_plt_entry): New function.
6580 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6581 incremental updates.
6582 (Output_data_plt_x86_64::add_relocation): New function.
6583 * testsuite/object_unittest.cc (Object_test): Set default options.
6584
ec69d6da
ILT
65852011-05-16 Ian Lance Taylor <iant@google.com>
6586
6587 * options.h (class General_options): Make -i a synonym for -r.
6588
732e31de
ILT
65892011-05-16 Ian Lance Taylor <iant@google.com>
6590
6591 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6592
403676b5
CC
65932011-05-10 Cary Coutant <ccoutant@google.com>
6594
6595 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6596 strip_all (-s).
6597
5b7b7d6e
ILT
65982011-05-06 Ian Lance Taylor <iant@google.com>
6599
6600 * layout.cc (Layout::layout): If the output section flags change,
6601 update the ordering.
6602
f0f9babf
CC
66032011-04-25 Cary Coutant <ccoutant@google.com>
6604
6605 * incremental-dump.cc (dump_incremental_inputs): Print local
6606 symbol info for each input file.
6607 * incremental.cc
6608 (Output_section_incremental_inputs::set_final_data_size): Add local
6609 symbol info to input file entries in incremental info.
6610 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6611 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6612 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6613 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6614 implementation.
6615 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6616 (Sized_incr_relobj::do_relocate): Write the local symbols.
6617 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6618 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6619 Adjust size of input file header.
6620 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6621 (Incremental_inputs_reader::get_local_symbol_count): New function.
6622 (Incremental_inputs_reader::get_input_section): Adjust size of input
6623 file header.
6624 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6625 (Sized_incr_relobj::This): New typedef.
6626 (Sized_incr_relobj::sym_size): New const data member.
6627 (Sized_incr_relobj::Local_symbol): New struct.
6628 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6629 (Sized_incr_relobj::do_local_symbol_offset): New function.
6630 (Sized_incr_relobj::local_symbol_count_): New data member.
6631 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6632 (Sized_incr_relobj::local_symbol_index_): New data member.
6633 (Sized_incr_relobj::local_symbol_offset_): New data member.
6634 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6635 (Sized_incr_relobj::local_symbols_): New data member.
6636 * object.h (Relobj::output_local_symbol_count): New function.
6637 (Relobj::local_symbol_offset): New function.
6638 (Relobj::do_output_local_symbol_count): New function.
6639 (Relobj::do_local_symbol_offset): New function.
6640 (Sized_relobj::do_output_local_symbol_count): New function.
6641 (Sized_relobj::do_local_symbol_offset): New function.
6642
d0a9ace3
ILT
66432011-04-22 Vladimir Simonov <sv@sw.ru>
6644
6645 * descriptors.cc (set_close_on_exec): New function.
6646 (Descriptors::open): Use set_close_on_exec.
6647 * output.cc (S_ISLNK): Define if not defined.
6648
94a3fc8b
CC
66492011-04-22 Cary Coutant <ccoutant@google.com>
6650
6651 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6652 global symbol map.
6653 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6654 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6655 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6656 relocations.
6657 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6658 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6659 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6660 * incremental.h
6661 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6662 function.
6663 (Incremental_binary::apply_incremental_relocs): New function.
6664 (Incremental_binary::do_apply_incremental_relocs): New function.
6665 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6666 data member.
6667 (Sized_incremental_binary::add_global_symbol): New function.
6668 (Sized_incremental_binary::global_symbol): New function.
6669 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6670 (Sized_incremental_binary::symbol_map_): New data member.
6671 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6672 * target.h (Sized_target::apply_relocation): New function.
6673 * target-reloc.h (apply_relocation): New function.
6674 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6675
c87e4302
DK
66762011-04-22 Doug Kwan <dougkwan@google.com>
6677
6678 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6679 flag of a SHT_ARM_EXIDX section.
2e702c99 6680 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6681 * testsuite/Makefile.in: Regenerate.
6682 * testsuite/arm_exidx_test.s: New file.
6683 * testsuite/arm_exidx_test.sh: Same.
6684
e7782cf6
CC
66852011-04-20 Cary Coutant <ccoutant@google.com>
6686
6687 PR gold/12689
6688 * archive.h (Incremental_archive_entry::Archive_member):
6689 Initialize arg_serial_ (second constructor).
6690
308ecdc7
ILT
66912011-04-17 Ian Lance Taylor <iant@google.com>
6692
6693 * object.cc (Relocate_info::location): Simplify location string.
6694 * errors.cc (Errors::error_at_location): Don't print program
6695 name.
6696 (Errors::warning_at_location): Likewise.
6697 (Errors::undefined_symbol): Likewise.
6698 * testsuite/debug_msg.sh: Update accordingly.
6699
bec5b579
CC
67002011-04-14 Cary Coutant <ccoutant@google.com>
6701
6702 * gold/layout.cc (Layout::symtab_section_offset): New function.
6703 * gold/layout.h (Layout::symtab_section_offset): New function.
6704 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6705
88597d34
ILT
67062011-04-12 Ian Lance Taylor <iant@google.com>
6707
6708 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6709 with MREMAP_MAYMOVE.
6710 * output.h (class Output_file): Add map_is_allocated_ field.
6711 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6712 not available, provide stubs. If mremap is not available, #define
6713 it to gold_mremap.
6714 (MREMAP_MAYMOVE): Define if not defined.
6715 (Output_file::Output_file): Initialize map_is_allocated_.
6716 (Output_file::resize): Check map_is_allocated_.
6717 (Output_file::map_anonymous): If mmap fails, use malloc.
6718 (Output_file::unmap): Don't do anything for an anonymous map.
6719 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6720 is not available, provide stubs.
6721 (File_read::View::~View): Use free rather than delete[].
6722 (File_read::make_view): Use malloc rather than new[]. If mmap
6723 fails, use malloc.
6724 (File_read::find_or_make_view): Use malloc rather than new[].
6725 * gold.h: Remove HAVE_REMAP code.
6726 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6727 exists. Rename mremap to gold_mremap. If mmap is not available
6728 don't do anything.
6729 * configure, config.in: Rebuild.
6730
11e361bc
ILT
67312011-04-11 Ian Lance Taylor <iant@google.com>
6732
6733 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6734 initialize local variable v.
6735
cdc29364
CC
67362011-04-11 Cary Coutant <ccoutant@google.com>
6737
6738 * archive.cc (Archive::include_member): Adjust call to
6739 report_object.
6740 (Add_archive_symbols::run): Track argument serial numbers.
6741 (Lib_group::include_member): Likewise.
6742 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6743 * archive.h (Incremental_archive_entry::Archive_member):
6744 Initialize arg_serial_.
6745 (Archive_member::arg_serial_): New data member.
6746 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6747 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6748 incremental link.
6749 (Sized_dynobj::do_for_all_local_got_entries): New function.
6750 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6751 function.
6752 * fileread.cc (get_mtime): New function.
6753 * fileread.h (get_mtime): New function.
6754 * gold.cc (queue_initial_tasks): Check for incremental update.
6755 (process_incremental_input): New function.
6756 (queue_middle_tasks): Don't force valid target for incremental
6757 update.
6758 * incremental-dump.cc (find_input_containing_global): Adjust
6759 size of symbol info entry.
6760 (dump_incremental_inputs): Dump argument serial number and
6761 in_system_directory flag; bias shndx by 1; print symbol names
6762 when dumping per-file symbol lists; use new symbol info readers.
6763 * incremental.cc
6764 (Output_section_incremental_inputs:update_data_size): New function.
6765 (Sized_incremental_binary::setup_readers): Setup input readers
6766 for each input file; build maps for files added from libraries
6767 and scripts.
6768 (Sized_incremental_binary::check_input_args): New function.
6769 (Sized_incremental_binary::do_check_inputs): Build map of argument
6770 serial numbers to input arguments.
6771 (Sized_incremental_binary::do_file_has_changed): Rename
6772 do_file_is_unchanged to this; compare file modification times.
6773 (Sized_incremental_binary::do_init_layout): New function.
6774 (Sized_incremental_binary::do_reserve_layout): New function.
6775 (Sized_incremental_binary::do_get_input_reader): Remove.
6776 (Sized_incremental_binary::get_symtab_view): New function.
6777 (Incremental_checker::can_incrementally_link_output_file): Remove.
6778 (Incremental_inputs::report_command_line): Exclude --debug options.
6779 (Incremental_inputs::report_archive_begin): Add parameter; track
6780 argument serial numbers; don't put input file entry for archive
6781 before archive members.
6782 (Incremental_inputs::report_archive_end): Put input file entry
6783 for archive after archive members.
6784 (Incremental_inputs::report_object): Add parameter; track argument
6785 serial numbers and in_system_directory flag.
6786 (Incremental_inputs::report_script): Add parameter; track argument
6787 serial numbers.
6788 (Output_section_incremental_inputs::set_final_data_size): Adjust
6789 size of symbol info entry; check for forwarding symbols.
6790 (Output_section_incremental_inputs::write_input_files): Write
6791 in_system_directory flag and argument serial number.
6792 (Output_section_incremental_inputs::write_info_blocks): Map section
6793 indices between incremental info and original input file; store
6794 input section index for each symbol.
6795 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6796 change operator() to visit().
6797 (class Global_got_offset_visitor): Likewise.
6798 (class Global_symbol_visitor_got_plt):
6799 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6800 classes.
6801 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6802 (Sized_incr_relobj::do_read_symbols): New function.
6803 (Sized_incr_relobj::do_layout): New function.
6804 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6805 (Sized_incr_relobj::do_add_symbols): New function.
6806 (Sized_incr_relobj::do_should_include_member): New function.
6807 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6808 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6809 (Sized_incr_relobj::do_section_size): New function.
6810 (Sized_incr_relobj::do_section_name): New function.
6811 (Sized_incr_relobj::do_section_contents): New function.
6812 (Sized_incr_relobj::do_section_flags): New function.
6813 (Sized_incr_relobj::do_section_entsize): New function.
6814 (Sized_incr_relobj::do_section_address): New function.
6815 (Sized_incr_relobj::do_section_type): New function.
6816 (Sized_incr_relobj::do_section_link): New function.
6817 (Sized_incr_relobj::do_section_info): New function.
6818 (Sized_incr_relobj::do_section_addralign): New function.
6819 (Sized_incr_relobj::do_initialize_xindex): New function.
6820 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6821 (Sized_incr_relobj::do_read_relocs): New function.
6822 (Sized_incr_relobj::do_gc_process_relocs): New function.
6823 (Sized_incr_relobj::do_scan_relocs): New function.
6824 (Sized_incr_relobj::do_count_local_symbols): New function.
6825 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6826 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6827 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6828 (Sized_incr_relobj::do_relocate): New function.
6829 (Sized_incr_relobj::do_set_section_offset): New function.
6830 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6831 (Sized_incr_dynobj::do_read_symbols): New function.
6832 (Sized_incr_dynobj::do_layout): New function.
6833 (Sized_incr_dynobj::do_add_symbols): New function.
6834 (Sized_incr_dynobj::do_should_include_member): New function.
6835 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6836 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6837 (Sized_incr_dynobj::do_section_size): New function.
6838 (Sized_incr_dynobj::do_section_name): New function.
6839 (Sized_incr_dynobj::do_section_contents): New function.
6840 (Sized_incr_dynobj::do_section_flags): New function.
6841 (Sized_incr_dynobj::do_section_entsize): New function.
6842 (Sized_incr_dynobj::do_section_address): New function.
6843 (Sized_incr_dynobj::do_section_type): New function.
6844 (Sized_incr_dynobj::do_section_link): New function.
6845 (Sized_incr_dynobj::do_section_info): New function.
6846 (Sized_incr_dynobj::do_section_addralign): New function.
6847 (Sized_incr_dynobj::do_initialize_xindex): New function.
6848 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6849 (make_sized_incremental_object): New function.
6850 (Incremental_library::copy_unused_symbols): New function.
6851 (Incremental_library::do_for_all_unused_symbols): New function.
6852 * incremental.h (enum Incremental_input_flags): New type.
6853 (class Incremental_checker): Remove.
6854 (Incremental_input_entry::Incremental_input_entry): Add argument
6855 serial number.
6856 (Incremental_input_entry::arg_serial): New function.
6857 (Incremental_input_entry::set_is_in_system_directory): New function.
6858 (Incremental_input_entry::is_in_system_directory): New function.
6859 (Incremental_input_entry::arg_serial_): New data member.
6860 (Incremental_input_entry::is_in_system_directory_): New data member.
6861 (class Script_info): Move here from script.h.
6862 (Script_info::Script_info): Add filename parameter.
6863 (Script_info::filename): New function.
6864 (Script_info::filename_): New data member.
6865 (Incremental_script_entry::Incremental_script_entry): Add argument
6866 serial number.
6867 (Incremental_object_entry::Incremental_object_entry): Likewise.
6868 (Incremental_object_entry::add_input_section): Build list of input
6869 sections with map to original shndx.
6870 (Incremental_object_entry::get_input_section_index): New function.
6871 (Incremental_object_entry::shndx_): New data member.
6872 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6873 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6874 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6875 serial number.
6876 (Incremental_inputs::report_archive_begin): Likewise.
6877 (Incremental_inputs::report_object): Likewise.
6878 (Incremental_inputs::report_script): Likewise.
6879 (class Incremental_global_symbol_reader): New class.
6880 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6881 and store flags and input file type.
6882 (Incremental_input_entry_reader::arg_serial): New function.
6883 (Incremental_input_entry_reader::type): Extract type from flags.
6884 (Incremental_input_entry_reader::is_in_system_directory): New function.
6885 (Incremental_input_entry_reader::get_input_section_count): Call
6886 accessor function for type.
6887 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6888 function for type; adjust size of global symbol entry.
6889 (Incremental_input_entry_reader::get_global_symbol_count): Call
6890 accessor function for type.
6891 (Incremental_input_entry_reader::get_object_count): Likewise.
6892 (Incremental_input_entry_reader::get_object_offset): Likewise.
6893 (Incremental_input_entry_reader::get_member_count): Likewise.
6894 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6895 (Incremental_input_entry_reader::get_member_offset): Likewise.
6896 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6897 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6898 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6899 (Incremental_input_entry_reader::get_global_symbol_reader): New
6900 function.
6901 (Incremental_input_entry_reader::get_output_symbol_index): New
6902 function.
6903 (Incremental_input_entry_reader::type_): Remove.
6904 (Incremental_input_entry_reader::flags_): New data member.
6905 (Incremental_inputs_reader::input_file_offset): New function.
6906 (Incremental_inputs_reader::input_file_index): New function.
6907 (Incremental_inputs_reader::input_file): Call input_file_offset.
6908 (Incremental_inputs_reader::input_file_at_offset): New function.
6909 (Incremental_relocs_reader::get_r_type): Reformat.
6910 (Incremental_relocs_reader::get_r_shndx): Reformat.
6911 (Incremental_relocs_reader::get_r_offset): Reformat.
6912 (Incremental_relocs_reader::data): New function.
6913 (Incremental_binary::Incremental_binary): Initialize new data members.
6914 (Incremental_binary::check_inputs): Add cmdline parameter.
6915 (Incremental_binary::file_is_unchanged): Remove.
6916 (Input_reader::arg_serial): New function.
6917 (Input_reader::get_unused_symbol_count): New function.
6918 (Input_reader::get_unused_symbol): New function.
6919 (Input_reader::do_arg_serial): New function.
6920 (Input_reader::do_get_unused_symbol_count): New function.
6921 (Input_reader::do_get_unused_symbol): New function.
6922 (Incremental_binary::input_file_count): New function.
6923 (Incremental_binary::get_input_reader): Change signature to use
6924 index instead of filename.
6925 (Incremental_binary::file_has_changed): New function.
6926 (Incremental_binary::get_input_argument): New function.
6927 (Incremental_binary::get_library): New function.
6928 (Incremental_binary::get_script_info): New function.
6929 (Incremental_binary::init_layout): New function.
6930 (Incremental_binary::reserve_layout): New function.
6931 (Incremental_binary::output_file): New function.
6932 (Incremental_binary::do_check_inputs): New function.
6933 (Incremental_binary::do_file_is_unchanged): Remove.
6934 (Incremental_binary::do_file_has_changed): New function.
6935 (Incremental_binary::do_init_layout): New function.
6936 (Incremental_binary::do_reserve_layout): New function.
6937 (Incremental_binary::do_input_file_count): New function.
6938 (Incremental_binary::do_get_input_reader): Change signature.
6939 (Incremental_binary::input_args_map_): New data member.
6940 (Incremental_binary::library_map_): New data member.
6941 (Incremental_binary::script_map_): New data member.
6942 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6943 new data members.
6944 (Sized_incremental_binary::output_section): New function.
6945 (Sized_incremental_binary::inputs_reader): Add const.
6946 (Sized_incremental_binary::symtab_reader): Add const.
6947 (Sized_incremental_binary::relocs_reader): Add const.
6948 (Sized_incremental_binary::got_plt_reader): Add const.
6949 (Sized_incremental_binary::get_symtab_view): New function.
6950 (Sized_incremental_binary::Inputs_reader): New typedef.
6951 (Sized_incremental_binary::Input_entry_reader): New typedef.
6952 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6953 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6954 (Sized_incremental_binary::do_file_has_changed): New function.
6955 (Sized_incremental_binary::do_init_layout): New function.
6956 (Sized_incremental_binary::do_reserve_layout): New function.
6957 (Sized_input_reader::Inputs_reader): Remove.
6958 (Sized_input_reader::Input_entry_reader): Remove.
6959 (Sized_input_reader::do_arg_serial): New function.
6960 (Sized_input_reader::do_get_unused_symbol_count): New function.
6961 (Sized_input_reader::do_get_unused_symbol): New function.
6962 (Sized_incremental_binary::do_input_file_count): New function.
6963 (Sized_incremental_binary::do_get_input_reader): Change signature;
6964 use index instead of filename.
6965 (Sized_incremental_binary::section_map_): New data member.
6966 (Sized_incremental_binary::input_entry_readers_): New data member.
6967 (class Sized_incr_relobj): New class.
6968 (class Sized_incr_dynobj): New class.
6969 (make_sized_incremental_object): New function.
6970 (class Incremental_library): New class.
6971 * layout.cc (Free_list::num_lists): New static data member.
6972 (Free_list::num_nodes): New static data member.
6973 (Free_list::num_removes): New static data member.
6974 (Free_list::num_remove_visits): New static data member.
6975 (Free_list::num_allocates): New static data member.
6976 (Free_list::num_allocate_visits): New static data member.
6977 (Free_list::init): New function.
6978 (Free_list::remove): New function.
6979 (Free_list::allocate): New function.
6980 (Free_list::dump): New function.
6981 (Free_list::print_stats): New function.
6982 (Layout_task_runner::run): Resize output file for incremental updates.
6983 (Layout::Layout): Initialize new data members.
6984 (Layout::set_incremental_base): New function.
6985 (Layout::init_fixed_output_section): New function.
6986 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6987 incremental updates.
6988 (Layout::create_gold_note): Do not create gold note section for
6989 incremental updates.
6990 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6991 for incremental updates.
6992 (Layout::set_section_offsets): For incremental updates, allocate space
6993 from free list.
6994 (Layout::create_symtab_sections): Layout with offsets relative to
6995 start of section; for incremental updates, allocate space from free
6996 list.
6997 (Layout::create_shdrs): For incremental updates, allocate space from
6998 free list.
6999 (Layout::finish_dynamic_section): For incremental updates, do not
7000 check --as-needed (fixed in subsequent patch).
7001 * layout.h (class Free_list): New class.
7002 (Layout::set_incremental_base): New function.
7003 (Layout::incremental_base): New function.
7004 (Layout::init_fixed_output_section): New function.
7005 (Layout::allocate): New function.
7006 (Layout::incremental_base_): New data member.
7007 (Layout::free_list_): New data member.
7008 * main.cc (main): Print Free_list statistics.
7009 * object.cc (Relobj::finalize_incremental_relocs): Add
7010 clear_counts parameter; clear counts only when clear_counts is set.
7011 (Sized_relobj::Sized_relobj): Initialize new base class.
7012 (Sized_relobj::do_layout): Don't report special sections.
7013 (Sized_relobj::do_for_all_local_got_entries): New function.
7014 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7015 symtab_off to all symbol table offsets.
7016 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7017 * object.h (class Got_offset_list): Move to top of file.
7018 (Object::Object): Allow case where input_file == NULL.
7019 (Object::~Object): Likewise.
7020 (Object::input_file): Assert that input_file != NULL.
7021 (Object::lock): Allow case where input_file == NULL.
7022 (Object::unlock): Likewise.
7023 (Object::is_locked): Likewise.
7024 (Object::token): Likewise.
7025 (Object::release): Likewise.
7026 (Object::is_incremental): New function.
7027 (Object::get_mtime): New function.
7028 (Object::for_all_local_got_entries): New function.
7029 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7030 (Object::set_is_in_system_directory): New function.
7031 (Object::is_in_system_directory): New function.
7032 (Object::do_is_incremental): New function.
7033 (Object::do_get_mtime): New function.
7034 (Object::do_for_all_local_got_entries): New function.
7035 (Object::is_in_system_directory_): New data member.
7036 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7037 (class Sized_relobj_base): New class.
7038 (class Sized_relobj): Derive from Sized_relobj_base.
7039 (class Sized_relobj::Symbols): Redeclare from base class.
7040 (class Sized_relobj::local_got_offset_list): Remove.
7041 (class Sized_relobj::Output_sections): Redeclare from base class.
7042 (class Sized_relobj::do_for_all_local_got_entries): New function.
7043 (class Sized_relobj::write_local_symbols): Add offset parameter.
7044 (class Sized_relobj::local_symbol_offset_): Update comment.
7045 (class Sized_relobj::local_dynsym_offset_): Update comment.
7046 * options.cc (Input_arguments::add_file): Remove const.
7047 * options.h (Input_file_argument::Input_file_argument):
7048 Initialize arg_serial_ (all constructors).
7049 (Input_file_argument::set_arg_serial): New function.
7050 (Input_file_argument::arg_serial): New function.
7051 (Input_file_argument::arg_serial_): New data member.
7052 (Input_arguments::Input_arguments): Initialize file_count_.
7053 (Input_arguments::add_file): Remove const.
7054 (Input_arguments::number_of_input_files): New function.
7055 (Input_arguments::file_count_): New data member.
7056 (Command_line::number_of_input_files): Call
7057 Input_arguments::number_of_input_files.
7058 * output.cc (Output_segment_headers::Output_segment_headers):
7059 Set current size.
7060 (Output_section::Input_section::current_data_size): New function.
7061 (Output_section::Output_section): Initialize new data members.
7062 (Output_section::add_input_section): Don't do merge sections for
7063 an incremental link; allocate space from free list for an
7064 incremental update.
7065 (Output_section::add_output_section_data): Allocate space from
7066 free list for an incremental update.
7067 (Output_section::update_data_size): New function.
7068 (Output_section::set_fixed_layout): New function.
7069 (Output_section::reserve): New function.
7070 (Output_segment::set_section_addresses): Remove const.
7071 (Output_segment::set_section_list_addresses): Remove const; allocate
7072 space from free list for an incremental update.
7073 (Output_segment::set_offset): Adjust size of RELRO segment for an
7074 incremental update.
7075 * output.h (Output_data::current_data_size): Move here from
7076 child classes.
7077 (Output_data::pre_finalize_data_size): New function.
7078 (Output_data::update_data_size): New function.
7079 (Output_section_headers::update_data_size): new function.
7080 (Output_section_data_build::current_data_size): Move to Output_data.
7081 (Output_data_strtab::update_data_size): New function.
7082 (Output_section::current_data_size): Move to Output_data.
7083 (Output_section::set_fixed_layout): New function.
7084 (Output_section::has_fixed_layout): New function.
7085 (Output_section::reserve): New function.
7086 (Output_section::update_data_size): New function.
7087 (Output_section::has_fixed_layout_): New data member.
7088 (Output_section::free_list_): New data member.
7089 (Output_segment::set_section_addresses): Remove const.
7090 (Output_segment::set_section_list_addresses): Remove const.
7091 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7092 New function.
7093 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7094 New function.
7095 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7096 parameter when calling Add_symbols constructor; store argument
7097 serial number for members of a lib group.
7098 (Add_symbols::locks): Allow case where token == NULL.
7099 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7100 (Read_member::~Read_member): New function.
7101 (Read_member::is_runnable): New function.
7102 (Read_member::locks): New function.
7103 (Read_member::run): New function.
7104 (Check_script::~Check_script): New function.
7105 (Check_script::is_runnable): New function.
7106 (Check_script::locks): New function.
7107 (Check_script::run): New function.
7108 (Check_library::~Check_library): New function.
7109 (Check_library::is_runnable): New function.
7110 (Check_library::locks): New function.
7111 (Check_library::run): New function.
7112 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7113 (Add_symbols::library_): New data member.
7114 (class Read_member): New class.
7115 (class Check_script): New class.
7116 (class Check_library): New class.
7117 * reloc.cc (Read_relocs::is_runnable): Allow case where
7118 token == NULL.
7119 (Read_relocs::locks): Likewise.
7120 (Scan_relocs::locks): Likewise.
7121 (Relocate_task::locks): Likewise.
7122 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7123 to clear counters.
7124 (Sized_relobj::incremental_relocs_scan): Fix comment.
7125 (Sized_relobj::do_relocate): Pass output file offset to
7126 write_local_symbols.
7127 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7128 from class declaration.
7129 * script.cc (read_input_script): Allocate Script_info; pass
7130 argument serial number to report_script.
7131 * script.h (class Script_info): Move to incremental.h.
7132 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7133 * symtab.h (Symbol_table::add_from_incrobj): New function.
7134 (Symbol_table::set_file_offset): New function.
7135
b961d0d7
CC
71362011-04-05 Cary Coutant <ccoutant@google.com>
7137
7138 * incremental-dump.cc (dump_incremental_inputs): Change signature
7139 to take a Sized_incremental_binary; change caller. Use readers
7140 in Sized_incremental_binary.
7141 * incremental.cc
7142 (Sized_incremental_binary::find_incremental_inputs_sections):
7143 Rename do_find_incremental_inputs_sections to this.
7144 (Sized_incremental_binary::setup_readers): New function.
7145 (Sized_incremental_binary::do_check_inputs): Check
7146 has_incremental_info_ flag; move setup code to setup_readers;
7147 use input readers.
7148 (Sized_incremental_binary::do_file_is_unchanged): New function.
7149 (Sized_incremental_binary::do_get_input_reader): New function.
7150 * incremental.h (class Incremental_binary): Move to end of file.
7151 (Incremental_binary::file_is_unchanged): New function.
7152 (Incremental_binary::do_file_is_unchanged): New function.
7153 (Incremental_binary::Input_reader): New class.
7154 (Incremental_binary::get_input_reader): New function.
7155 (class Sized_incremental_binary): Move to end of file.
7156 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7157 input section reader classes.
7158 (Sized_incremental_binary::has_incremental_info): New function.
7159 (Sized_incremental_binary::inputs_reader): New function.
7160 (Sized_incremental_binary::symtab_reader): New function.
7161 (Sized_incremental_binary::relocs_reader): New function.
7162 (Sized_incremental_binary::got_plt_reader): New function.
7163 (Sized_incremental_binary::do_file_is_unchanged): New function.
7164 (Sized_incremental_binary::Sized_input_reader): New class.
7165 (Sized_incremental_binary::get_input_reader): New function.
7166 (Sized_incremental_binary::find_incremental_inputs_sections):
7167 Rename do_find_incremental_inputs_sections to this.
7168 (Sized_incremental_binary::setup_readers): New function.
7169 (Sized_incremental_binary::has_incremental_info_): New data member.
7170 (Sized_incremental_binary::inputs_reader_): New data member.
7171 (Sized_incremental_binary::symtab_reader_): New data member.
7172 (Sized_incremental_binary::relocs_reader_): New data member.
7173 (Sized_incremental_binary::got_plt_reader_): New data member.
7174 (Sized_incremental_binary::current_input_file_): New data member.
7175
a869183f
PP
71762011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7177
7178 PR gold/12640
7179 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7180 violation.
7181
71822011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7183
7184 * archive.cc (Archive::include_member): Adjust call to report_object.
7185 (Add_archive_symbols::run): Add script_info to call to
7186 report_archive_begin.
7187 (Lib_group::include_member): Adjust call to report_object.
7188 (Add_lib_group_symbols::run): Adjust call to report_object.
7189 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7190 blocks. Add object count for script input files.
7191 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7192 script_info parameter; change all callers.
7193 (Incremental_inputs::report_object): Add script_info parameter;
7194 change all callers.
7195 (Incremental_inputs::report_script): Store backpointer to
7196 incremental info entry.
7197 (Output_section_incremental_inputs::set_final_data_size): Record
7198 additional information for scripts.
7199 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7200 * incremental.h (Incremental_script_entry::add_object): New function.
7201 (Incremental_script_entry::get_object_count): New function.
7202 (Incremental_script_entry::get_object): New function.
7203 (Incremental_script_entry::objects_): New data member; adjust
7204 constructor.
7205 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7206 (Incremental_inputs::report_object): Add script_info parameter.
7207 (Incremental_inputs_reader::get_object_count): New function.
7208 (Incremental_inputs_reader::get_object_offset): New function.
7209 * options.cc (Input_arguments::add_file): Return reference to
7210 new input argument.
7211 * options.h (Input_argument::set_script_info): New function.
7212 (Input_argument::script_info): New function.
7213 (Input_argument::script_info_): New data member; adjust all
7214 constructors.
7215 (Input_file_group::add_file): Return reference to new input argument.
7216 (Input_file_lib::add_file): Likewise.
7217 (Input_arguments::add_file): Likewise.
7218 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7219 * script.cc (Parser_closure::Parser_closure): Add script_info
7220 parameter; adjust all callers.
7221 (Parser_closure::script_info): New function.
7222 (Parser_closure::script_info_): New data member.
7223 (read_input_script): Report scripts earlier to incremental info.
7224 (script_add_file): Set script_info in Input_argument.
7225 (script_add_library): Likewise.
7226 * script.h (Script_options::Script_info): Rewrite class.
7227
a869183f 72282011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7229
7230 * archive.cc (Library_base::should_include_member): Move
7231 method here from class Archive.
7232 (Archive::Archive): Initialize base class.
7233 (Archive::should_include_member): Move to base class.
7234 (Archive::do_for_all_unused_symbols): New function.
7235 (Add_archive_symbols::run): Remove redundant access to
7236 incremental_inputs.
7237 (Lib_group::Lib_group): Initialize base class.
7238 (Lib_group::do_filename): New function.
7239 (Lib_group::include_member): Pass pointer to Lib_group to
7240 report_object.
7241 (Lib_group::do_for_all_unused_symbols): New function.
7242 (Add_lib_group_symbols::run): Report archive information for
7243 incremental links.
7244 * archive.h (class Library_base): New base class.
7245 (class Archive): Derive from Library_base.
7246 (Archive::filename): Move to base class.
7247 (Archive::set_incremental_info): Likewise.
7248 (Archive::incremental_info): Likewise.
7249 (Archive::Should_include): Likewise.
7250 (Archive::should_include_member): Likewise.
7251 (Archive::Armap_entry): Remove.
7252 (Archive::Unused_symbol_iterator): Remove.
7253 (Archive::unused_symbols_begin): Remove.
7254 (Archive::unused_symbols_end): Remove.
7255 (Archive::do_filename): New function.
7256 (Archive::do_get_mtime): New function.
7257 (Archive::do_for_all_unused_symbols): New function.
7258 (Archive::task_): Move to base class.
7259 (Archive::incremental_info_): Likewise.
7260 (class Lib_group): Derive from Library_base.
7261 (Lib_group::do_filename): New function.
7262 (Lib_group::do_get_mtime): New function.
7263 (Lib_group::do_for_all_unused_symbols): New function.
7264 (Lib_group::task_): Move to base class.
7265 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7266 function.
7267 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7268 function.
7269 * incremental.cc (Incremental_inputs::report_archive_begin):
7270 Use Library_base; call library's get_mtime; add incremental inputs
7271 entry before members.
7272 (class Unused_symbol_visitor): New class.
7273 (Incremental_inputs::report_archive_end): Use Library_base; use
7274 visitor class to record unused symbols; don't add incremental inputs
7275 entry after members.
7276 (Incremental_inputs::report_object): Use Library_base.
7277 * incremental.h
7278 (Incremental_archive_entry::Incremental_archive_entry): Remove
7279 unused Archive parameter.
7280 (Incremental_inputs::report_archive_begin): Use Library_base.
7281 (Incremental_inputs::report_archive_end): Likewise.
7282 (Incremental_inputs::report_object): Likewise.
7283 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7284 function.
7285 * object.h (Object::for_all_global_symbols): New function.
7286 (Object::do_for_all_global_symbols): New function.
7287 (Sized_relobj::do_for_all_global_symbols): New function.
7288 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7289 function.
7290 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7291 function.
7292
61ab3e40
ILT
72932011-03-27 Ian Lance Taylor <iant@google.com>
7294
7295 * archive.cc (Archive::interpret_header): Return -1 if something
7296 goes wrong. Change callers accordingly.
7297
30e1f9e6
CC
72982011-03-25 Cary Coutant <ccoutant@google.com>
7299
7300 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7301 * testsuite/Makefile.in: Regenerate.
7302
9370ce59 73032011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7304
7305 * plugin.cc (get_view): New.
7306 (Plugin::load): Pass get_view to the plugin.
7307 (Plugin_manager::get_view): New.
7308
9312bb0a
ILT
73092011-03-21 Ian Lance Taylor <iant@google.com>
7310
7311 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7312 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7313
7e12ba9e
ST
73142011-03-21 Sriraman Tallam <tmsriram@google.com>
7315
7316 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7317 Change == to -eq.
7318 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7319 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7320 Change == to -eq.
7321 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7322 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7323
fd7a005d
ILT
73242011-03-14 Ian Lance Taylor <iant@google.com>
7325
7326 * script-sections.cc (Sort_output_sections::script_compare):
7327 Rename from is_before, change return type.
7328 (Sort_output_sections::operator()): Adjust accordingly.
7329
ed16fd1b
ILT
73302011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7331
7332 PR gold/12572
7333 * testsuite/odr_violation2.cc: Add comment to make all error line
7334 numbers double digits.
7335 * testsuite/debug_msg.sh: Adjust expected errors.
7336
71ff8986
ILT
73372011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7338
7339 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7340 but mark earlier ones as non-canonical
7341 (offset_to_iterator): Update search target and example
7342 (do_addr2line): Return extra lines in a vector*
7343 (format_file_lineno): Extract from do_addr2line
7344 (one_addr2line): Add vector* out-param
7345 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7346 when a lineno entry appeared last for its instruction
7347 (Dwarf_line_info): Add vector* out-param
7348 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7349 * symtab.cc (Odr_violation_compare): Include the lineno in the
7350 comparison again.
7351 (linenos_from_loc): New. Combine the canonical line for an
7352 address with its other lines.
7353 (True_if_intersect): New. Helper functor to make
7354 std::set_intersection a query.
7355 (detect_odr_violations): Compare sets of lines instead of just
7356 one line for each function. This became less deterministic, but
7357 has fewer false positives.
7358 * symtab.h: Declarations.
7359 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7360 mix an optimized and non-optimized object in the same binary
7361 (odr_violation2.so): Same.
7362 * testsuite/Makefile.in: Regenerate from Makefile.am.
7363 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7364 * testsuite/debug_msg.sh: Update line numbers and add
7365 assertions.
7366 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7367 non-optimized context.
7368 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7369 isn't inlined, and use OdrDerived in an optimized context.
7370 * testsuite/odr_header1.h: Defines OdrDerived, where
7371 optimization will change the
7372 first-instruction-in-the-destructor's file and line number.
7373 * testsuite/odr_header2.h: Defines OdrBase.
7374
a19fefdc
ILT
73752011-03-09 Ian Lance Taylor <iant@google.com>
7376
7377 * fileread.cc (File_read::clear_views): Don't delete the whole
7378 file view.
7379
ecb351e9
ILT
73802011-03-08 Ian Lance Taylor <iant@google.com>
7381
7382 PR gold/12525
7383 * fileread.cc: #include <climits>.
7384 (GOLD_IOV_MAX): Define.
7385 (File_read::read_multiple): Limit number of entries by iov_max.
7386 * fileread.h (class File_read): Always set max_readv_entries to
7387 128.
7388
b821d13c
ILT
73892011-03-07 Ian Lance Taylor <iant@google.com>
7390
7391 PR gold/12525
7392 * options.h (class General_options): Add -dy and -dn.
7393
89243142
CC
73942011-03-02 Cary Coutant <ccoutant@google.com>
7395
7396 * testsuite/script_test_9.t: Add TLS segment.
7397
d0773f31
ILT
73982011-03-02 Simon Baldwin <simonb@google.com>
7399
7400 * configure.ac: Add check for gnu_indirect_function support in
7401 the toolchain building binutils.
7402 * configure: Rebuild.
7403
9370ce59 74042011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7405
7406 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7407 plugin only symbols.
7408 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7409 in plugin files as not needed in the symbol table.
7410
4cf7a849
ST
74112011-02-11 Sriraman Tallam <tmsriram@google.com>
7412
7413 * output.cc (Output_section::add_input_section): Delay fill
7414 generation for section ordering.
7415
b578bd7d
ILT
74162011-02-09 Ian Lance Taylor <iant@google.com>
7417
7418 PR gold/12316
7419 * object.h (class Sized_relobj): Remove clear_local_symbols.
7420 * reloc.cc (Sized_relobj::do_relocate): Don't call
7421 clear_local_symbols.
7422
9370ce59 74232011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7424
7425 * plugin.cc (is_visible_from_outside): Return true for symbols
7426 in the -u option.
7427
55382fb7
ILT
74282011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7429
7430 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7431 filename.
7432
4e271fff
ST
74332011-02-02 Sriraman Tallam <tmsriram@google.com>
7434
7435 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7436 to std::string.
4e271fff 7437 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7438 section_name to be std::string.
4e271fff
ST
7439 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7440
d433c3ac
ILT
74412011-01-25 Ian Lance Taylor <iant@google.com>
7442
7443 * script.cc (script_add_extern): Rewrite to use
7444 add_symbol_reference.
7445
880473a6
DK
74462011-01-25 Doug Kwan <dougkwan@google.com>
7447
d433c3ac 7448 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7449
f30f86fa
ILT
74502011-01-24 Ian Lance Taylor <iant@google.com>
7451
7452 * options.h (class General_options): Accept
7453 --no-detect-odr-violations.
7454
8e51a0b9
ILT
74552011-01-24 Ian Lance Taylor <iant@google.com>
7456
7457 * version.cc (version_string): Bump to 1.11.
7458
0f3b89d8
ILT
74592011-01-24 Ian Lance Taylor <iant@google.com>
7460
7461 * plugin.cc (class Plugin_rescan): Define new class.
7462 (Plugin_manager::claim_file): Set any_claimed_.
7463 (Plugin_manager::save_archive): New function.
7464 (Plugin_manager::save_input_group): New function.
7465 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7466 necessary.
7467 (Plugin_manager::new_undefined_symbol): New function.
7468 (Plugin_manager::rescan): New function.
7469 (Plugin_manager::rescannable_defines): New function.
7470 (Plugin_manager::add_input_file): Set any_added_.
7471 * plugin.h (class Plugin_manager): define new fields rescannable_,
7472 undefined_symbols_, any_claimed_, and any_added_. Declare
7473 Plugin_rescan as friend. Declare new functions.
7474 (Plugin_manager::Rescannable): Define type.
7475 (Plugin_manager::Rescannable_list): Define type.
7476 (Plugin_manager::Undefined_symbol_list): Define type.
7477 (Plugin_manager::Plugin_manager): Initialize new fields.
7478 * archive.cc (Archive::defines_symbol): New function.
7479 (Add_archive_symbols::run): Pass archive to plugins if any.
7480 * archive.h (class Archive): Declare defines_symbol.
7481 * readsyms.cc (Input_group::~Input_group): New function.
7482 (Finish_group::run): Pass input_group to plugins if any.
7483 * readsyms.h (class Input_group): Declare destructor.
7484 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7485 any.
7486
3bb951e5
ILT
74872011-01-10 Ian Lance Taylor <iant@google.com>
7488
7489 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7490 section as relro.
7491 (Layout::set_segment_offsets): Reset increase_relro before calling
7492 set_section_addresses a second time.
7493
0aa45fac
CC
74942011-01-04 Cary Coutant <ccoutant@google.com>
7495
7496 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7497 sections before NOBITS sections.
7498
0db46eb4
L
74992011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7500
7501 * version.cc (print_version): Update copyright to 2011.
7502
829c9745
CC
75032010-12-23 Cary Coutant <ccoutant@google.com>
7504
7505 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7506 of OS to this->add. Add OD parameter to second form of the function.
7507
7500420b
ILT
75082010-12-20 Ian Lance Taylor <iant@google.com>
7509
7510 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7511 second of two consecutive entries with same offset.
7512
f8e9a930
RW
75132010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7514
7515 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7516 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7517 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7518 to avoid unneeded links against $(LDADD).
7519 * testsuite/Makefile.in: Regenerate.
7520
2fbb4320
ILT
75212010-12-15 Ian Lance Taylor <iant@google.com>
7522
7523 PR gold/12324
7524 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7525 for R_X86_64_32 and R_X86_64_PC32.
7526 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7527 ver_matching_def_pic.o.
7528 (ver_matching_def_pic.o): New target.
7529
fedb228d
RW
75302010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7531
7532 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7533 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7534 Move definition before File_read::View member definitions.
7535 (File_read::View::~View): Initialize and hold lock before
7536 updating current_mapped_bytes.
7537
9b547ce6
RW
75382010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7539
7540 * dwarf_reader.cc: Remove outdated comment.
7541 * gold-threads.cc: Fix typo in error message.
7542 * archive.cc: Fix typos in comments.
7543 * archive.h: Likewise.
7544 * arm-reloc-property.cc: Likewise.
7545 * arm-reloc-property.h: Likewise.
7546 * arm-reloc.def: Likewise.
7547 * arm.cc: Likewise.
7548 * attributes.h: Likewise.
7549 * cref.cc: Likewise.
7550 * ehframe.cc: Likewise.
7551 * fileread.h: Likewise.
7552 * gold.h: Likewise.
7553 * i386.cc: Likewise.
7554 * icf.cc: Likewise.
7555 * incremental.h: Likewise.
7556 * int_encoding.cc: Likewise.
7557 * layout.h: Likewise.
7558 * main.cc: Likewise.
7559 * merge.h: Likewise.
7560 * object.cc: Likewise.
7561 * object.h: Likewise.
7562 * options.cc: Likewise.
7563 * readsyms.cc: Likewise.
7564 * reduced_debug_output.cc: Likewise.
7565 * reloc.cc: Likewise.
7566 * script-sections.cc: Likewise.
7567 * sparc.cc: Likewise.
7568 * symtab.h: Likewise.
7569 * target-reloc.h: Likewise.
7570 * target.cc: Likewise.
7571 * target.h: Likewise.
7572 * timer.cc: Likewise.
7573 * timer.h: Likewise.
7574 * x86_64.cc: Likewise.
7575
83e17bd5
CC
75762010-12-09 Cary Coutant <ccoutant@google.com>
7577
7578 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7579 stack.
7580 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7581 parameter; change all callers.
7582 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7583 * options.h (warn_execstack): New option.
7584
017257f8
DK
75852010-12-07 Doug Kwan <dougkwan@google.com>
7586
7587 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7588 like function call relocations.
7589
c20cbc06
ILT
75902010-12-07 Ian Lance Taylor <iant@google.com>
7591
7592 * archive.cc (Archive::get_elf_object_for_member): Permit
7593 punconfigured to be NULL.
7594 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7595 (Archive::include_member): Pass NULL to get_elf_object_for_member
7596 if we searched for the archive and this is the first included
7597 object.
7598
4dbfafcc
ILT
75992010-12-01 Ian Lance Taylor <iant@google.com>
7600
7601 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7602 track_relocs_type_ field.
7603 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7604 Set track_relocs_type_.
7605 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7606 contents when using RELA relocs.
7607 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7608 reloc_map_.
7609 * reloc.cc (Track_relocs::next_addend): New function.
7610 * reloc.h (class Track_relocs): Declare next_addend.
7611
e5e19edd
ILT
76122010-12-01 Ian Lance Taylor <iant@google.com>
7613
7614 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7615 virtual destructor.
7616
9a5ce24c
ILT
76172010-12-01 Ian Lance Taylor <iant@google.com>
7618
7619 * README: Update compilers known to work and fail.
7620
c7791212
NC
76212010-11-23 Matthias Klose <doko@ubuntu.com>
7622
7623 * configure.in: For --enable-gold, handle value `default' instead of
7624 `both*'. Always install ld as ld.bfd, install as ld if gold is
7625 not the default.
7626 * configure: Regenerate.
7627
0ad220c9
DK
76282010-11-18 Doug Kwan <dougkwan@google.com>
7629
7630 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7631 and right_alignment to be zero. Store result alignment only if it is
7632 greater than existing alignment.
7633
ab8056e0
CC
76342010-11-16 Cary Coutant <ccoutant@google.com>
7635
7636 PR gold/12220
7637 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7638 Check for ".zdebug_line".
7639
fd064a5b
CC
76402010-11-16 Doug Kwan <dougkwan@google.com>
7641 Cary Coutant <ccoutant@google.com>
7642
7643 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7644 by reference; adjust all callers.
7645 * output.cc (Output_segment::set_section_addresses): Adjust references
7646 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7647 list is empty.
7648 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7649 end at page boundary.
7650
6fc6ea19
CC
76512010-11-16 Cary Coutant <ccoutant@google.com>
7652
7653 PR gold/12220
7654 * layout.cc (Layout::choose_output_section): Transform names of
7655 compressed sections even when using a script with a SECTIONS clause.
7656 (Layout::output_section_name): Remove code to transform
7657 compressed debug section names.
7658 * output.cc (Output_section::add_input_section): Use uncompressed
7659 section size when tracking input sections.
7660
95a2c8d6
RS
76612010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7662
7663 * symtab.h (Symbol::NON_PIC_REF): Remove.
7664 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7665 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7666 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7667 (Symbol::use_plt_offset): Take a flags argument and pass it
7668 directly to needs_dynamic_reloc. Restrict check for undefined
7669 weak symbols to function calls.
7670 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7671 (Target_arm::Scan::global): Use it.
7672 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7673 (Target_arm::Relocate::relocate): Likewise.
7674 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7675 parameter with an r_type parameter. Use get_reference_flags
7676 to get the flags.
7677 (Target_arm::Relocate::relocate): Update accordingly.
7678 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7679 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7680 (Target_i386::Scan::global): Likewise.
7681 (Target_i386::Relocate::relocate): Likewise.
7682 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7683 parameter with an r_type parameter. Use get_reference_flags
7684 to get the flags.
7685 (Target_i386::Relocate::relocate): Update accordingly.
7686 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7687 (Target_powerpc::Scan::global): Use it.
7688 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7689 (Target_powerpc::Relocate::relocate): Likewise.
7690 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7691 (Target_sparc::Scan::global): Use it.
7692 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7693 (Target_sparc::Relocate::relocate): Likewise.
7694 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7695 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7696 (Target_x86_64::Scan::global): Likewise.
7697 (Target_x86_64::Relocate::relocate): Likewise.
7698
f625ae50
DK
76992010-11-08 Doug Kwan <dougkwan@google.com>
7700 Cary Coutant <ccoutant@google.com>
7701
7702 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7703 (Arm_exidx_merge_section::section_contents_): New data member.
7704 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7705 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7706 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7707 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7708 in parameters instead of calling Object::section_contents without
7709 locking.
7710 (Arm_output_section::group_section): New parameter TASK. Pass it
7711 to callees that need locking objects.
7712 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7713 to lock EXIDX input sections. Fix a formatting issue. Call
7714 Arm_exidx_merged_section::build_contents to create merged section
7715 contents.
7716 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7717 to lock object of stub table owner.
7718 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7719 TEXT_SIZE to initialize data member TEXT_SIZE_.
7720 (Arm_exidx_input_section::addralign): Fix typo in comment.
7721 (Arm_exidx_input_section::text_size): New method.
7722 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7723 that require locking objects. Lock objects before scanning for stubs
7724 and updating local symbols.
7725 (Arm_input_section<big_endian>::init): Copy contents of original
7726 input section.
2e702c99 7727 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7728 original input section instead of calling Object::section_contents
7729 without locking.
7730 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7731 size without calling Object::section_size().
7732 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7733 for size. Allocate a buffer for merged EXIDX entries.
7734 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7735 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7736 building code to Arm_exidx_merged_section::build_contetns. Write
7737 out contetns in buffer instead of building it on the fly.
7738 (Arm_relobj::make_exidx_input_section): Also pass text section size
7739 to Arm_exidx_input_section constructor.
7740 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7741 (Arm_dynobj::do_read_symbols): Fix memory leak.
7742 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7743 * target.h: (class Task): Add forward declaration.
7744 (Target::relax): Add new parameter TASK and pass it to
7745 Target::do_relax().
7746 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7747
5f9bcf58
CC
77482010-11-05 Cary Coutant <ccoutant@google.com>
7749
7750 PR gold/10708
7751 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7752 object when reading from the file.
7753 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7754 second layout pass.
7755 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7756 when reading section contents.
7757 (get_section_contents): Likewise.
7758 (icf::find_identical_sections): Likewise.
7759 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7760 object when reading from the file.
7761 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7762 the object when doing deferred section layout.
7763
e597fa08
NC
77642010-11-03 Nick Clifton <nickc@redhat.com>
7765
7766 PR gold/12001
7767 * script.h (class Symbol_assignment: name): New member. Returns
7768 the name of the symbol.
7769 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7770 Returns true if the given symbol name is on the list of
7771 assignments wating to be processed.
7772 * archive.cc (should_incldue_member): If the symbol is undefined,
7773 check to see if it is on the list of symbols pending assignment.
7774
3f9a3278
ILT
77752010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7776
7777 * script-sections.cc (Script_sections::find_memory_region): Check
7778 for a NULL output section pointer.
7779
d06fb4d1
DK
77802010-10-29 Doug Kwan <dougkwan@google.com>
7781
7782 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7783 Output_section::add_relaxed_input_section.
7784 * output.cc (Output_section::add_relaxed_input_section): Add new
7785 arguments LAYOUT and NAME. Set section order index.
7786 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7787 Copy section order index.
7788 * output.h (Output_section::add_relaxed_input_section): Add new
7789 arguments LAYOUT and NAME.
7790
90e24de5
ILT
77912010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7792
7793 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7794 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7795 * testsuite/Makefile.in: Regenerate.
7796
c9484ea5
DK
77972010-10-20 Doug Kwan <dougkwan@google.com>
7798
7799 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7800 without SHF_LINK_ORDER flags.
7801 * layout.cc (Layout::choose_output_section): Do not filter
7802 SHF_LINK_ORDER flag in a relocatable link.
7803
5bc2f5be
CC
78042010-10-17 Cary Coutant <ccoutant@google.com>
7805
7806 * output.h (Output_segment::set_section_addresses): Change function
7807 signature. Update all callers.
7808 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7809 sections.
7810 (Output_segment::set_section_addresses): Align after last TLS
7811 section. Add padding before last relro section instead of after.
7812
0c91cf04
DK
78132010-10-17 Doug Kwan <dougkwan@google.com>
7814
7815 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7816 GOT output section to be writable.
7817
8c21d9d3
CC
78182010-10-14 Cary Coutant <ccoutant@google.com>
7819
7820 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7821 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7822 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7823 mode.
7824 * incremental.cc (report_command_line): Ignore all forms of
7825 --incremental.
7826 * layout.cc (Layout::Layout): Check parameters for incremental link
7827 mode.
7828 * options.cc (General_options::parse_incremental): New function.
7829 (General_options::parse_no_incremental): New function.
7830 (General_options::parse_incremental_full): New function.
7831 (General_options::parse_incremental_update): New function.
7832 (General_options::incremental_mode_): New data member.
7833 (General_options::finalize): Check incremental_mode_.
7834 * options.h (General_options): Update help text for --incremental.
7835 Add --no-incremental, --incremental-full, --incremental-update.
7836 (General_options::Incremental_mode): New enum type.
7837 (General_options::incremental_mode): New function.
7838 (General_options::incremental_mode_): New data member.
7839 * parameters.cc (Parameters::incremental_mode_): New data member.
7840 (Parameters::set_options): Set incremental_mode_.
7841 (Parameters::set_incremental_full): New function.
7842 (Parameters::incremental): New function.
7843 (Parameters::incremental_update): New function.
7844 (set_parameters_incremental_full): New function.
7845 * parameters.h (Parameters::set_incremental_full): New function.
7846 (Parameters::incremental): New function.
7847 (Parameters::incremental_update): New function.
7848 (Parameters::incremental_mode_): New data member.
7849 (set_parameters_incremental_full): New function.
7850 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7851 incremental link mode.
7852 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7853 (Sized_relobj::do_relocate_sections): Likewise.
7854 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7855 option.
7856 * testsuite/Makefile.in: Regenerate.
7857 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7858
bb32aa18 78592010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7860
7861 * script-sections.h (class Script_sections): Make
7862 Sections_elements typedef public.
7863 * script-sections.cc (class Sort_output_sections): Add elements_
7864 field. Add constructor which sets it; change all callers.
7865 (Sort_output_sections::is_before): New function.
7866 (Sort_output_sections::operator()): Call is_before.
7867 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7868 conditional.
7869 * testsuite/script_test_10.sh: New test. Test script section
7870 order.
7871 * testsuite/script_test_10.t: Likewise.
7872 * testsuite/script_test_10.s: Likewise.
7873 * testsuite/Makefile.am: Wrap the cross linker tests and the
7874 common tests into NATIVE_OR_CROSS_LINKER.
7875 (check_SCRIPTS): Add script_test_10.sh.
7876 (check_DATA): Add script_test_10.stdout.
7877 (script_test_10.o, script_test_10): New targets.
7878 (script_test_10.stdout): New target.
7879 * configure, testsuite/Makefile.in: Regenerate.
7880
3cef7179
ILT
78812010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7882
7883 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7884 error for the deprecated relocations.
7885 (Target_arm::Scan::global): Likewise.
7886 (Target_arm::Relocate::relocate): Likewise.
7887
7411e9a8
RS
78882010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7889
7890 * fileread.cc (Input_file::find_file): Initialize *found_name
7891 and *namep when using the fallback search for case 4.
7892
6a9da32a
CC
78932010-10-11 Cary Coutant <ccoutant@google.com>
7894
7895 * options.h (class General_options): Redefine -z lazy as an alias for
7896 the negation of -z now.
7897
ac897c20
ILT
78982010-10-11 Ian Lance Taylor <iant@google.com>
7899
7900 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7901 binding.
7902
ea5cae92
NC
79032010-10-06 Nick Clifton <nickc@redhat.com>
7904
7905 * script-sections.cc(class Memory_region): Remove
7906 current_lma_offset_ field. Rename current_vma_offset_ to
7907 current_offset_. Add last_section_ field.
7908 (Memory_region::get_current_vma_address): Rename to
7909 get_current_address.
7910 (Memory_region::get_current_lma_address): Delete.
7911 (Memory_region::increment_vma_offset): Rename to
7912 increment_offset.
7913 (Memory_region::increment_lma_offset): Delete.
7914 (Memory_region::attributes_compatible): New method. Returns
7915 true if the provided section is compatible with the region.
7916 (Memory_region::get_last_section): New method. Returns the last
7917 section to use the region.
7918 (Memory_region::set_last_section): New method. Stores the last
7919 section to use the region.
7920 (Script_sections::block_in_region): New method. Returns true if
7921 a block of memory is contained within a region.
7922 (Script_sections::find_memory_region): New method. Locates a
7923 memory region to be used to set a VMA or LMA address.
7924 (Output_section_definition::set_section_addresses): Add code to
7925 check for addresses set by memory regions.
7926 (Output_segment::set_section_addresses): Remove memory region
7927 walking code.
7928 (Script_sections::create_segment): Add a warning if a header
7929 segment is created outside of any region.
7930 * script-sections.h (class Script_sections): Add prototypes for
7931 find_memory_region and block_in_region methods.
7932 * testsuite/memory_test.s: Use .long instead of .word.
7933 * testsuite/memory_test.t: Add some more output sections.
7934 * testsuite/memory_test.sh: Update expected output.
7935
a9bfd952
DK
79362010-10-02 Doug Kwan <dougkwan@google.com>
7937
7938 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7939 defintion to symtab.h
7940 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7941 declaration to defintion.
7942
bacff3ab
NC
79432010-10-01 Nick Clifton <nickc@redhat.com>
7944
7945 * expression.cc (eval): Replace dummy argument with NULL.
7946 (eval_maybe_dot): Check for a NULL result section pointer.
7947 (Symbol_expression::value): Likewise.
7948 (Dot_expression::value): Likewise.
7949 (BINARY_EXPRESSION): Likewise.
7950 (Max_expression::value): Likewise.
7951 (Min_expression::value): Likewise.
7952 (Absolute_expression::value): Likewise.
7953 (Addr_expression::value_from_output_section): Likewise.
7954 (Loaddddr_expression::value_from_output_section): Likewise.
7955 (Segment_start_expression::value): Likewise.
7956 * script-sections.cc
7957 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7958 argument with NULL.
7959 (Sections_elememt_dot_assignment::set_section_addresses):
7960 Likewise.
7961 (Output_data_expression::do_write_to_buffer): Likewise.
7962 (Output_section_definition::finalize_symbols): Likewise.
7963 (Output_section_definition::set_section_addresses): Likewise.
7964
f81bc8b5
DK
79652010-09-30 Doug Kwan <dougkwan@google.com>
7966
7967 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7968
c95e9f27
ST
79692010-09-28 Sriraman Tallam <tmsriram@google.com>
7970
7971 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7972 function.
c95e9f27
ST
7973 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7974 virtual function.
7975 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7976 virtual function.
7977 * icf.cc (get_section_contents): Inline merge sections only when
7978 target allows it.
7979
3cac54d2
RW
79802010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7981
7982 * configure: Regenerate.
7983
2904037a
ILT
79842010-09-17 Ian Lance Taylor <iant@google.com>
7985
7986 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7987 * testsuite/Makefile.am (memory_test.o): New target.
7988 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7989 memory_test.t.
7990 * testsuite/Makefile.in: Rebuild.
2904037a 7991
bca7fb63
DK
79922010-09-17 Doug Kwan <dougkwan@google.com>
7993
7994 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7995 defintion if relocation uses GOT entries of the symbol.
7996 * testsuite/icf_safe_test.sh: Fix test.
7997 * testsuite/icf_safe_so_test.sh: Fix test.
7998
4ef28648
CC
79992010-09-16 Cary Coutant <ccoutant@google.com>
8000
8001 * script_sections.cc (class Memory_region): Remove "NULL" from
8002 vector initializations.
8003
793990de
CC
80042010-09-15 Cary Coutant <ccoutant@google.com>
8005
8006 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8007 Resolve forwarding symbols.
8008
81e015e2
DK
80092010-09-15 Doug Kwan <dougkwan@google.com>
8010
8011 * gold/testsuite/script_test_3.t: Add ARM special sections.
8012 * gold/testsuite/script_test_4.t: Same.
8013 * gold/testsuite/script_test_5.t: Same.
8014 * gold/testsuite/script_test_6.t: Same.
8015 * gold/testsuite/script_test_7.t: Same.
8016 * gold/testsuite/script_test_7.t: Same.
8017 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8018
36171d64
CC
80192010-09-14 Cary Coutant <ccoutant@google.com>
8020
8021 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8022 (Target_x86_64::Relocate::relocate_tls): Replace check for
8023 saw_tls_block_reloc_ with test for executable section.
8024
d89051bd
CC
80252010-09-12 Cary Coutant <ccoutant@google.com>
8026
8027 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8028 position-independent executables to shared libraries need dynamic
8029 relocations.
8030 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8031 position-independent executables.
8032 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8033 * testsuite/Makefile.in: Regenerate.
8034
fca41f0f
NC
80352010-09-10 Nick Clifton <nickc@redhat.com>
8036
8037 PR gold/11997
8038 * testsuite/memory_test.t: Discard any sections that are not
8039 needed.
8040
6695e4b3
L
80412010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8042
8043 PR gold/11996
8044 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8045 "This::" to work around a bug in gcc 4.2.
8046
8047 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8048
0f72bf6f
RÁE
80492010-09-09 Rafael Espindola <espindola@google.com>
8050
8051 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8052 sections with different PF_X flags in the same segment.
8053 (Layout::find_first_load_seg): Search all segments to find the first
8054 one.
8055 * options.h (rosegment): New.
8056
80572010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8058
05a79166 8059 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8060
aa98ff75
DK
80612010-09-08 Doug Kwan <dougkwan@google.com>
8062
8063 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8064 (Arm_relobj::do_relocate_sections): Add new parameter for output
8065 file to match the parent.
8066 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8067 of local symbols instead of input values. Update code to track
8068 changes in gold::relocate_section.
8069 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8070 (Sized_relobj::compute_final_local_value_internal): New methods.
8071 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8072 body into private version of Sized_relobj::compute_final_local_value.
8073 Call the inline method.
8074 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8075 merged symbol value if there is one.
8076 (Symbol_value::has_output_value): New method defintiion.
8077 (Sized_relobj::Compute_final_local_value_status): New enum type.
8078 (Sized_relobj::compute_final_local_value): New methods.
8079 (Sized_relobj::compute_final_local_value_internal): New methods.
8080 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8081 and arm_cortex_a8.sh.
8082 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8083 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8084 New tests.
8085 * Makefile.in: Regenerate.
8086 * testsuite/arm_bl_out_of_range.s: Update test.
8087 * testsuite/thumb_bl_out_of_range.s: Ditto.
8088 * testsuite/thumb_blx_out_of_range.s: Ditto.
8089 * testsuite/arm_branch_out_of_range.sh: New file.
8090 * testsuite/arm_cortex_a8.sh: Ditto.
8091 * testsuite/arm_cortex_a8_b.s: Ditto.
8092 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8093 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8094 * testsuite/arm_cortex_a8_bl.s: Ditto.
8095 * testsuite/arm_cortex_a8_blx.s: Ditto.
8096 * testsuite/arm_cortex_a8_local.s: Ditto.
8097 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8098 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8099
05a79166
L
81002010-09-08 Rafael Espindola <espindola@google.com>
8101
8102 * Makefile.am (memory_test.stdout): Run readelf with -W.
8103 * Makefile.in: Regenerate.
8104 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8105 64 bit output.
8106
33dbc701
RÁE
81072010-09-08 Rafael Espindola <espindola@google.com>
8108
8109 * script-sections.cc (Script_sections::add_memory_region): Convert
8110 field precision to int.
8111 * script.cc (script_set_section_region, script_set_section_region):
8112 Convert field precision to int.
8113
731ca54a
RÁE
81142010-09-08 Rafael Espindola <espindola@google.com>
8115
8116 * arm.cc (do_finalize_sections): Create the __exidx_start and
8117 __exdix_end symbols even when the section is missing.
8118
7f8cd844
NC
81192010-09-08 Nick Clifton <nickc@redhat.com>
8120
8121 * README: Remove claim that MEMORY is not supported.
8122 * expression.cc (script_exp_function_origin)
8123 (script_exp_function_length): Move from here to ...
8124 * script.cc: ... here.
8125 (script_set_section_region, script_add_memory)
8126 (script_parse_memory_attr, script_include_directive): New
8127 functions.
8128 * script-sections.cc
8129 (class Memory_region): New class.
8130 (class Output_section_definition): Add set_memory_region,
8131 set_section_vma, set_section_lma and get_section_name methods.
8132 (class Script_Sections): Add add_memory_region,
8133 find_memory_region, find_memory_region_origin,
8134 find_memory_region_length and set_memory_region methods.
8135 Have set_section_addresses method walk the list of set memory
8136 regions.
8137 Extend the print methos to display memory regions.
8138 * script-sections.h: Add prototypes for new methods.
8139 Add enum for MEMORY region attributes.
8140 * yyscript.y: Add support for parsing MEMORY regions.
8141 * script-c.h: Add prototypes for new functions.
8142 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8143 * testsuite/Makefile.in: Regenerate.
8144 * testsuite/memory_test.sh: New script.
8145 * testsuite/memory_test.s: New assembler source file.
8146 * testsuite/memory_test.t: New linker script.
8147
a4649286
DK
81482010-08-27 Doug Kwan <dougkwan@google.com>
8149
8150 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8151 reference override an existing dynamic weak reference.
8152 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8153 * testsuite/Makefile.in: Regenerate.
8154 * testsuite/dyn_weak_ref.sh: New file.
8155 * testsuite/dyn_weak_ref_1.c: Ditto.
8156 * testsuite/dyn_weak_ref_2.c: Ditto.
8157
b56648ad
ILT
81582010-08-27 Ian Lance Taylor <iant@google.com>
8159
8160 * incremental.h (class Incremental_input_entry): Add virtual
8161 destructor.
8162
809313cb
ILT
81632010-08-27 Ian Lance Taylor <iant@google.com>
8164
8165 * testsuite/start_lib_test_3.c: Mark t3 as used.
8166
11e32464
NC
81672010-08-27 Nick Clifton <nickc@redhat.com>
8168
8169 * options.cc (version_script): Fix small typo in previous
8170 whitespace tidyup.
8171
ca09d69a
NC
81722010-08-25 Nick Clifton <nickc@redhat.com>
8173
8174 * archive.cc: Formatting fixes: Remove whitespace between
8175 typename and following asterisk. Remove whitespace between
8176 function name and opening parenthesis.
8177 * archive.h: Likewise.
8178 * arm.cc: Likewise.
8179 * attributes.cc: Likewise.
8180 * attributes.h: Likewise.
8181 * common.cc: Likewise.
8182 * copy-relocs.cc: Likewise.
8183 * dirsearch.h: Likewise.
8184 * dynobj.cc: Likewise.
8185 * ehframe.cc: Likewise.
8186 * ehframe.h: Likewise.
8187 * expression.cc: Likewise.
8188 * fileread.cc: Likewise.
8189 * fileread.h: Likewise.
8190 * gc.h: Likewise.
8191 * gold-threads.cc: Likewise.
8192 * gold.cc: Likewise.
8193 * i386.cc: Likewise.
8194 * icf.h: Likewise.
8195 * incremental-dump.cc: Likewise.
8196 * incremental.cc: Likewise.
8197 * layout.cc: Likewise.
8198 * layout.h: Likewise.
8199 * main.cc: Likewise.
8200 * merge.cc: Likewise.
8201 * merge.h: Likewise.
8202 * object.cc: Likewise.
8203 * object.h: Likewise.
8204 * options.cc: Likewise.
8205 * options.h: Likewise.
8206 * output.cc: Likewise.
8207 * output.h: Likewise.
8208 * plugin.cc: Likewise.
8209 * plugin.h: Likewise.
8210 * powerpc.cc: Likewise.
8211 * reloc.cc: Likewise.
8212 * script-c.h: Likewise.
8213 * script-sections.cc: Likewise.
8214 * script.cc: Likewise.
8215 * stringpool.cc: Likewise.
8216 * symtab.cc: Likewise.
8217 * symtab.h: Likewise.
8218 * target.cc: Likewise.
8219 * timer.cc: Likewise.
8220 * timer.h: Likewise.
8221 * version.cc: Likewise.
8222 * x86_64.cc: Likewise.
8223
b8fa8750
NC
82242010-08-24 Nick Clifton <nickc@redhat.com>
8225
8226 PR 11899
8227 * layout.cc (segment_precedes): Sort segments by their physical
8228 addresses, if they have been set.
8229
9919d93b
CC
82302010-08-23 Cary Coutant <ccoutant@google.com>
8231
8232 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8233 symbols data.
8234 (Lib_group::include_member): Unlock object after deleting its
8235 symbols data.
8236 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8237 the bug fixed here.
8238
97b4be1c
CC
82392010-08-19 Neil Vachharajani <nvachhar@google.com>
8240 Cary Coutant <ccoutant@google.com>
8241
8242 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8243 constructor, and set_blocker.
8244 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8245 readsyms_blocker_.
8246 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8247 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8248 * testsuite/Makefile.am (start_lib_test): New test case.
8249 * testsuite/Makefile.in: Regenerate.
8250 * testsuite/start_lib_test_main.c: New file.
8251 * testsuite/start_lib_test_1.c: New file.
8252 * testsuite/start_lib_test_2.c: New file.
8253 * testsuite/start_lib_test_3.c: New file.
8254
dd0b1884
ILT
82552010-08-19 Ian Lance Taylor <iant@google.com>
8256
8257 * Makefile.in: Rebuild with automake 1.11.1.
8258 * aclocal.m4: Likewise.
8259 * testsuite/Makefile.in: Likewise.
8260
7223e9ca
ILT
82612010-08-19 Ian Lance Taylor <iant@google.com>
8262
8263 PR 10893
8264 * i386.cc (class Output_data_plt_i386): Update declarations.
8265 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8266 local_ifuncs_ fields.
8267 (Target_i386::do_plt_section_for_global): New function.
8268 (Target_i386::do_plt_section_for_local): New function.
8269 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8270 parameter; change all callers. Initialize global_ifuncs_ and
8271 local_ifuncs_. If doing a static link define __rel_iplt_start and
8272 __rel_iplt_end.
8273 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8274 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8275 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8276 symbols.
8277 (Target_i386::make_plt_section): New function, broken out of
8278 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8279 (Target_i386::make_plt_entry): Call make_plt_section.
8280 (Target_i386::make_local_ifunc_plt_entry): New function.
8281 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8282 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8283 R_386_IRELATIVE to switch.
8284 (Target_i386::Scan::global): Likewise.
8285 (Target_i386::Relocate::relocate): Likewise.
8286 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8287 switch.
8288 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8289 (Target_x86_64::do_plt_section_for_global): New function.
8290 (Target_x86_64::do_plt_section_for_local): New function.
8291 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8292 parameter; change all callers. If doing a static link define
8293 __rela_iplt_start and __rela_iplt_end.
8294 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8295 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8296 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8297 to point to .plt.
8298 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8299 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8300 switch.
8301 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8302 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8303 R_X86_64_IRELATIVE to switch.
8304 (Target_x86_64::Scan::global): Likewise.
8305 (Target_x86_64::Relocate::relocate): Likewise.
8306 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8307 switch.
8308 * target.h (class Target): Add plt_section_for_global and
8309 plt_section_for_local functions. Add do_plt_section_for_global
8310 and do_plt_section_for_local virtual functions.
8311 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8312 clarifying comments.
8313 (Symbol::use_plt_offset): Handle IFUNC symbol.
8314 * object.cc (Sized_relobj::Sized_relobj): Initialize
8315 local_plt_offsets_.
8316 (Sized_relobj::local_has_plt_offset): New function.
8317 (Sized_relobj::local_plt_offset): New function.
8318 (Sized_relobj::set_local_plt_offset): New function.
8319 (Sized_relobj::do_count): Handle IFUNC symbol.
8320 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8321 a bit away from input_shndx_ field. Add set_is_func_symbol and
8322 is_ifunc_symbol functions.
8323 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8324 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8325 local_plt_offsets_ field.
8326 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8327 * output.h (class Output_section_data): Add non-const
8328 output_section function.
8329 (class Output_data_got): Update declarations.
8330 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8331 Add use_plt_offset parameter to global and local constructors.
8332 Change all callers. Change local_sym_index_ field to 31 bits.
8333 Change GSYM_CODE and CONSTANT_CODE accordingly.
8334 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8335 doing a static link don't set sh_link field.
8336 (Output_data_got::Got_entry::write): Use PLT offset if
8337 appropriate.
8338 (Output_data_got::add_global_plt): New function.
8339 (Output_data_got::add_local_plt): New function.
8340 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8341 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8342 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8343 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8344 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8345 IFUNC conditional.
8346 * testsuite/ifunc-sel.h: New file.
8347 * testsuite/ifuncmain1.c: New file.
8348 * testsuite/ifuncmain1vis.c: New file.
8349 * testsuite/ifuncmod1.c: New file.
8350 * testsuite/ifuncdep2.c: New file.
8351 * testsuite/ifuncmain2.c: New file.
8352 * testsuite/ifuncmain3.c: New file.
8353 * testsuite/ifuncmod3.c: New file.
8354 * testsuite/ifuncmain4.c: New file.
8355 * testsuite/ifuncmain5.c: New file.
8356 * testsuite/ifuncmod5.c: New file.
8357 * testsuite/ifuncmain6pie.c: New file.
8358 * testsuite/ifuncmod6.c: New file.
8359 * testsuite/ifuncmain7.c: New file.
8360 * configure, testsuite/Makefile.in: Rebuild.
8361
56f75c03
ILT
83622010-08-18 Ian Lance Taylor <iant@google.com>
8363
8364 * incremental.cc
8365 (Output_section_incremental_inputs::write_input_files): Add cast
8366 to avoid signed/unsigned comparison warning.
8367 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8368
55455f89
CC
83692010-08-12 Cary Coutant <ccoutant@google.com>
8370
8371 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8372
e2054bcb
ILT
83732010-08-13 Ian Lance Taylor <iant@google.com>
8374
8375 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8376
74f67560
DK
83772010-08-12 Cary Coutant <ccoutant@google.com>
8378 Doug Kwan <dougkwan@google.com>
8379
8380 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8381 defintion overrides non-weak undef, remember that the original undef
8382 is not weak.
8383 * symtab.cc (Symbol_table::sized_write_global): For undef without
8384 an original weak binding, set binding to global in output.
8385 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8386 * testsuite/Makefile.in: Regenerate.
8387 * testsuite/strong_ref_weak_def.sh: New file.
8388 * testsuite/strong_ref_weak_def_1.c: Ditto.
8389 * testsuite/strong_ref_weak_def_2.c: Ditto.
8390
d1238d12
CC
83912010-08-12 Cary Coutant <ccoutant@google.com>
8392
8393 * testsuite/incremental_test.sh: Rewrite.
8394 * testsuite/incremental_test_1.c: Rewrite.
8395 * testsuite/incremental_test_2.c: Rewrite.
8396
0e70b911
CC
83972010-08-12 Cary Coutant <ccoutant@google.com>
8398
8399 * arm.cc (Target_arm::got_size): Add const.
8400 (Target_arm::got_entry_count): New function.
8401 (Target_arm::plt_entry_count): New function.
8402 (Target_arm::first_plt_entry_offset): New function.
8403 (Target_arm::plt_entry_size): New function.
8404 (Output_data_plt_arm::entry_count): New function.
8405 (Output_data_plt_arm::first_plt_entry_offset): New function.
8406 (Output_data_plt_arm::get_plt_entry_size): New function.
8407 * i386.cc (Target_i386::got_size): Add const.
8408 (Target_i386::got_entry_count): New function.
8409 (Target_i386::plt_entry_count): New function.
8410 (Target_i386::first_plt_entry_offset): New function.
8411 (Target_i386::plt_entry_size): New function.
8412 (Output_data_plt_i386::entry_count): New function.
8413 (Output_data_plt_i386::first_plt_entry_offset): New function.
8414 (Output_data_plt_i386::get_plt_entry_size): New function.
8415 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8416 find_incremental_inputs_sections. Dump incremental_got_plt section.
8417 * incremental.cc: Include target.h.
8418 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8419 parameter. Adjust all callers. Find incremental_got_plt section.
8420 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8421 section.
8422 (Output_section_incremental_inputs::set_final_data_size): Calculate
8423 size of incremental_got_plt section.
8424 (Output_section_incremental_inputs::do_write): Write the
8425 incremental_got_plt section.
8426 (Got_plt_view_info): New struct.
8427 (Local_got_offset_visitor): New class.
8428 (Global_got_offset_visitor): New class.
8429 (Global_symbol_visitor_got_plt): New class.
8430 (Output_section_incremental_inputs::write_got_plt): New function.
8431 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8432 Add parameter. Adjust all callers.
8433 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8434 (Incremental_inputs::got_plt_section): New function.
8435 (Incremental_inputs::got_plt_section_): New data member.
8436 (Incremental_got_plt_reader): New class.
8437 * layout.cc (Layout::create_incremental_info_sections): Add the
8438 incremental_got_plt section.
8439 * object.h (Got_offset_list::get_list): New function.
8440 (Got offset_list::for_all_got_offsets): New function.
8441 (Sized_relobj::local_got_offset_list): New function.
8442 * powerpc.cc (Target_powerpc::got_size): Add const.
8443 (Target_powerpc::got_entry_count): New function.
8444 (Target_powerpc::plt_entry_count): New function.
8445 (Target_powerpc::first_plt_entry_offset): New function.
8446 (Target_powerpc::plt_entry_size): New function.
8447 (Output_data_plt_powerpc::entry_count): New function.
8448 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8449 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8450 * sparc.cc (Target_sparc::got_size): Add const.
8451 (Target_sparc::got_entry_count): New function.
8452 (Target_sparc::plt_entry_count): New function.
8453 (Target_sparc::first_plt_entry_offset): New function.
8454 (Target_sparc::plt_entry_size): New function.
8455 (Output_data_plt_sparc::entry_count): New function.
8456 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8457 (Output_data_plt_sparc::get_plt_entry_size): New function.
8458 * symtab.h (Symbol::got_offset_list): New function.
8459 (Symbol_table::for_all_symbols): New function.
8460 * target.h (Sized_target::got_entry_count): New function.
8461 (Sized_target::plt_entry_count): New function.
8462 (Sized_target::plt_entry_size): New function.
8463 * x86_64.cc (Target_x86_64::got_size): Add const.
8464 (Target_x86_64::got_entry_count): New function.
8465 (Target_x86_64::plt_entry_count): New function.
8466 (Target_x86_64::first_plt_entry_offset): New function.
8467 (Target_x86_64::plt_entry_size): New function.
8468 (Output_data_plt_x86_64::entry_count): New function.
8469 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8470 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8471
09ec0418
CC
84722010-08-12 Cary Coutant <ccoutant@google.com>
8473
8474 * archive.cc: Include incremental.h.
8475 (Archive::Archive): Initialize incremental_info_.
8476 (Archive::include_member): Record archive members in incremental info.
8477 (Add_archive_symbols::run): Record begin and end of an archive in
8478 incremental info.
8479 (Lib_group::include_member): Record objects in incremental info.
8480 * archive.h (Incremental_archive_entry): Forward declaration.
8481 (Archive::set_incremental_info): New member function.
8482 (Archive::incremental_info): New member function.
8483 (Archive::Unused_symbol_iterator): New class.
8484 (Archive::unused_symbols_begin): New member function.
8485 (Archive::unused_symbols_end): New member function.
8486 (Archive::incremental_info_): New data member.
8487 * incremental-dump.cc (find_input_containing_global): New function.
8488 (dump_incremental_inputs): Dump new incremental info sections.
8489 * incremental.cc: Include symtab.h.
8490 (Output_section_incremental_inputs): New class.
8491 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8492 new incremental info sections.
8493 (Sized_incremental_binary::do_check_inputs): Likewise.
8494 (Incremental_inputs::report_archive): Remove.
8495 (Incremental_inputs::report_archive_begin): New function.
8496 (Incremental_inputs::report_archive_end): New function.
8497 (Incremental_inputs::report_object): New function.
8498 (Incremental_inputs::finalize_inputs): Remove.
8499 (Incremental_inputs::report_input_section): New function.
8500 (Incremental_inputs::report_script): Rewrite.
8501 (Incremental_inputs::finalize): Do nothing but finalize string table.
8502 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8503 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8504 (Incremental_inputs::create_data_sections): New function.
8505 (Incremental_inputs::relocs_entsize): New function.
8506 (Output_section_incremental_inputs::set_final_data_size): New function.
8507 (Output_section_incremental_inputs::do_write): New function.
8508 (Output_section_incremental_inputs::write_header): New function.
8509 (Output_section_incremental_inputs::write_input_files): New function.
8510 (Output_section_incremental_inputs::write_info_blocks): New function.
8511 (Output_section_incremental_inputs::write_symtab): New function.
8512 * incremental.h (Incremental_script_entry): Forward declaration.
8513 (Incremental_object_entry): Forward declaration.
8514 (Incremental_archive_entry): Forward declaration.
8515 (Incremental_inputs): Forward declaration.
8516 (Incremental_inputs_header_data): Remove.
8517 (Incremental_inputs_header): Remove.
8518 (Incremental_inputs_header_write): Remove.
8519 (Incremental_inputs_entry_data): Remove.
8520 (Incremental_inputs_entry): Remove.
8521 (Incremental_inputs_entry_write): Remove.
8522 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8523 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8524 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8525 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8526 Likewise.
8527 (Incremental_input_entry): New class.
8528 (Incremental_script_entry): New class.
8529 (Incremental_object_entry): New class.
8530 (Incremental_archive_entry): New class.
8531 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8532 (Incremental_inputs::report_inputs): Remove.
8533 (Incremental_inputs::report_archive): Remove.
8534 (Incremental_inputs::report_archive_begin): New function.
8535 (Incremental_inputs::report_archive_end): New function.
8536 (Incremental_inputs::report_object): Change prototype.
8537 (Incremental_inputs::report_input_section): New function.
8538 (Incremental_inputs::report_script): Change prototype.
8539 (Incremental_inputs::get_reloc_count): New function.
8540 (Incremental_inputs::set_reloc_count): New function.
8541 (Incremental_inputs::create_data_sections): New function.
8542 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8543 (Incremental_inputs::inputs_section): New function.
8544 (Incremental_inputs::symtab_section): New function.
8545 (Incremental_inputs::relocs_section): New function.
8546 (Incremental_inputs::get_stringpool): Add const.
8547 (Incremental_inputs::command_line): Add const.
8548 (Incremental_inputs::inputs): Remove.
8549 (Incremental_inputs::command_line_key): New function.
8550 (Incremental_inputs::input_file_count): New function.
8551 (Incremental_inputs::input_files): New function.
8552 (Incremental_inputs::relocs_entsize): New function.
8553 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8554 (Incremental_inputs::finalize_inputs): Remove.
8555 (Incremental_inputs::Input_info): Remove.
8556 (Incremental_inputs::lock_): Remove.
8557 (Incremental_inputs::inputs_): Change type.
8558 (Incremental_inputs::inputs_map_): Remove.
8559 (Incremental_inputs::current_object_entry_): New data member.
8560 (Incremental_inputs::inputs_section_): New data member.
8561 (Incremental_inputs::symtab_section_): New data member.
8562 (Incremental_inputs::relocs_section_): New data member.
8563 (Incremental_inputs::reloc_count_): New data member.
8564 (Incremental_inputs_reader): New class.
8565 (Incremental_symtab_reader): New class.
8566 (Incremental_relocs_reader): New class.
8567 * layout.cc (Layout::finalize): Move finalization of incremental info
8568 and creation of incremental info sections to follow finalization of
8569 symbol table. Set offsets for postprocessing sections.
8570 (Layout::create_incremental_info_sections): Call
8571 Incremental_inputs::create_data_sections. Add incremental symtab
8572 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8573 sections to layout after input sections.
8574 * layout.h (struct Timespec): Forward declaration.
8575 (Layout::incremental_inputs): Add const.
8576 (Layout::create_incremental_info_sections): Add parameter.
8577 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8578 * object.cc: Include incremental.h.
8579 (Relobj::finalize_incremental_relocs): New function.
8580 (Sized_relobj::do_layout): Record input sections in incremental info.
8581 * object.h (Object::output_section): New function.
8582 (Object::output_section_offset): Moved from Relobj.
8583 (Object::get_incremental_reloc_base): New function.
8584 (Object::get_incremental_reloc_count): New function.
8585 (Object::do_output_section): New function.
8586 (Object::do_output_section_offset): Moved from Relobj.
8587 (Object::do_get_incremental_reloc_base): New function.
8588 (Object::do_get_incremental_reloc_count): New function.
8589 (Object::Object): Initialize new data members.
8590 (Relobj::output_section): Renamed do_output_section and moved to
8591 protected.
8592 (Relobj::output_section_offset): Moved to Object.
8593 (Relobj::do_get_incremental_reloc_base): New function.
8594 (Relobj::do_get_incremental_reloc_count): New function.
8595 (Relobj::allocate_incremental_reloc_counts): New function.
8596 (Relobj::count_incremental_reloc): New function.
8597 (Relobj::finalize_incremental_relocs): New function.
8598 (Relobj::next_incremental_reloc_index): New function.
8599 (Relobj::reloc_counts_): New data member.
8600 (Relobj::reloc_bases_): New data member.
8601 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8602 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8603 (Sized_relobj::incremental_relocs_scan): New function.
8604 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8605 (Sized_relobj::incremental_relocs_write): New function.
8606 (Sized_relobj::incremental_relocs_write_reltype): New function.
8607 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8608 incremental link.
8609 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8610 archives and object files elsewhere.
8611 (Add_symbols::run): Report object files here.
8612 (Finish_group::run): Report end of archive at end of group.
8613 * reloc.cc: Include layout.h, incremental.h.
8614 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8615 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8616 (Sized_relobj::incremental_relocs_scan): New function.
8617 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8618 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8619 (Sized_relobj::incremental_relocs_write): New function.
8620 (Sized_relobj::incremental_relocs_write_reltype): New function.
8621 * script.cc (read_input_script): Rewrite test for incremental link.
8622 Change call to Incremental_inputs::report_script.
8623 * symtab.h (Symbol_table::first_global_index): New function.
8624 (Symbol_table::output_count): New function.
8625
ce0d1972
DK
86262010-08-12 Doug Kwan <dougkwan@google.com>
8627
8628 * arm.cc (Target_arm::merge_object_attributes): Check command line
8629 options --no-wchar-size-warning and --no-enum-size-warning.
8630 * options.h (General_options): Add ld-compatible options
8631 --no-enum-size-warning and --no-wchar-size-warning.
8632
6e5710ce
ILT
86332010-08-04 Ian Lance Taylor <iant@google.com>
8634
8635 * x86_64.cc (Target_x86_64::Scan::local): Use
8636 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8637 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8638 (Target_x86_64::Scan::global): Likewise.
8639 (Target_x86_64::Relocate::relocate): Likewise.
8640 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8641 Likewise.
8642
fef830db
CC
86432010-08-03 Cary Coutant <ccoutant@google.com>
8644
8645 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8646 to reserve space in merged_strings vector. Keep total input size
8647 for stats.
8648 (Output_merge_string::do_print_merge_stats): Print total input size.
8649 * merge.h (Output_merge_string): Add input_size_ field.
8650 * stringpool.cc (Stringpool_template::string_length): Move
8651 implementations out of Stringpool_template class and place in
8652 stringpool.h.
8653 * stringpool.h (string_length): Move out of Stringpool_template.
8654
1e3811b0
ILT
86552010-08-03 Ian Lance Taylor <iant@google.com>
8656
8657 PR 11712
8658 * layout.cc (relaxation_loop_body): If address of load segment is
8659 set, adjust address to include headers if possible.
8660
7af0c620
ILT
86612010-08-03 Ian Lance Taylor <iant@google.com>
8662
8663 * version.cc (version_string): Bump to 1.10.
8664
22f0da72
ILT
86652010-08-03 Ian Lance Taylor <iant@google.com>
8666
8667 PR 11805
8668 * layout.h (enum Output_section_order): Define.
8669 (class Layout): Update declarations.
8670 * layout.cc (Layout::get_output_section): Add order parameter.
8671 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8672 is_first_non_relro parameters. Change all callers.
8673 (Layout::choose_output_section): Likewise.
8674 (Layout::add_output_section_data): Likewise.
8675 (Layout::make_output_section): Likewise. Set order.
8676 (Layout::default_section_order): New function.
8677 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8678 * output.cc (Output_section::Output_section): Initialize order_.
8679 Don't initialize deleted fields.
8680 (Output_segment::Output_segment): Don't initialize deleted
8681 fields.
8682 (Output_segment::add_output_section_to_load): New function
8683 replacing add_output_section. Change all callers to call this or
8684 add_output_section_to_nonload.
8685 (Output_segment::add_output_section_to_nonload): New function.
8686 (Output_segment::remove_output_section): Rewrite.
8687 (Output_segment::add_initial_output_data): Likewise.
8688 (Output_segment::has_any_data_sections): Likewise.
8689 (Output_segment::is_first_section_relro): Likewise.
8690 (Output_segment::maximum_alignment): Likewise.
8691 (Output_segment::has_dynamic_reloc): New function replacing
8692 dynamic_reloc_count. Change all callers.
8693 (Output_segment::has_dynamic_reloc_list): New function replacing
8694 dynamic_reloc_count_list. Change all callers.
8695 (Output_segment::set_section_addresses): Rewrite.
8696 (Output_segment::set_offset): Rewrite.
8697 (Output_segment::find_first_and_last_list): Remove.
8698 (Output_segment::set_tls_offsets): Rewrite.
8699 (Output_segment::first_section_load_address): Likewise.
8700 (Output_segment::output_section_count): Likewise.
8701 (Output_segment::section_with_lowest_load_address): Likewise.
8702 (Output_segment::write_section_headers): Likewise.
8703 (Output_segment::print_sections_to_map): Likewise.
8704 * output.h (class Output_data): Remove dynamic_reloc_count_
8705 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8706 (Output_data::add_dynamic_reloc): Rewrite.
8707 (Output_data::has_dynamic_reloc): New function.
8708 (Output_data::dynamic_reloc_count): Remove.
8709 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8710 is_last_relro_, is_first_non_relro_, is_interp_,
8711 is_dynamic_linker_section_ fields. Add order and set_order
8712 functions. Remove is_relro_local, set_is_relro_local,
8713 is_last_relro, set_is_last_relro, is_first_non_relro,
8714 set_is_first_non_relro functions, is_interp, set_is_interp,
8715 is_dynamic_linker_section, and set_is_dynamic_linker_section
8716 functions.
8717 (class Output_segment): Change Output_data_list from std::list to
8718 std:;vector. Add output_lists_ field. Remove output_data_ and
8719 output_bss_ fields. Update declarations.
8720
3ff2ccb0
ILT
87212010-08-02 Ian Lance Taylor <iant@google.com>
8722
8723 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8724 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8725 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8726
88a4108b
ILT
87272010-08-02 Ian Lance Taylor <iant@google.com>
8728
8729 PR 11855
8730 * script.cc (Script_options::Script_options): Initialize
8731 symbol_definitions_ and symbol_references_.
8732 (Script_options::add_symbol_assignment): Update
8733 symbol_definitions_ and symbol_references_.
8734 (Script_options::add_symbol_reference): New function.
8735 (script_symbol): New function.
8736 * script.h (class Script_options): Add symbol_definitions_ and
8737 symbol_references_ fields.
8738 (Script_options::referenced_const_iterator): New type.
8739 (Script_options::referenced_begin): New function.
8740 (Script_options::referenced_end): New function.
8741 (Script_options::is_referenced): New function.
8742 (Script_options::any_unreferenced): New function.
8743 * script-c.h (script_symbol): Declare.
8744 * yyscript.y (exp): Call script_symbol.
8745 * symtab.cc: Include "script.h".
8746 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8747 Change all callers. Check symbols referenced by scripts.
8748 (Symbol_table::add_undefined_symbols_from_command_line): Add
8749 layout parameter. Change all callers.
8750 (Symbol_table::do_add_undefined_symbols_from_command_line):
8751 Likewise. Break out loop body. Check symbols referenced by
8752 scripts.
8753 (Symbol_table::add_undefined_symbol_from_command_line): New
8754 function broken out of
8755 do_add_undefined_symbols_from_command_line.
8756 * symtab.h (class Symbol_table): Update declarations.
8757 * archive.cc: Include "layout.h".
8758 (Archive::should_include_member): Add layout parameter. Change
8759 all callers. Check for symbol mentioned in expression.
8760 * archive.h (class Archive): Update declaration.
8761 * object.cc (Sized_relobj::do_should_include_member): Add layout
8762 parameter.
8763 * object.h (Object::should_include_member): Add layout parameter.
8764 Change all callers.
8765 (Object::do_should_include_member): Add layout parameter.
8766 (class Sized_relobj): Update declaration.
8767 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8768 parameter.
8769 * dynobj.h (class Sized_dynobj): Update declaration.
8770 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8771 layout parameter.
8772 * plugin.h (class Sized_pluginobj): Update declaration.
8773
5f1ab67a
ILT
87742010-08-02 Ian Lance Taylor <iant@google.com>
8775
8776 PR 11866
8777 * output.cc (Output_segment::set_offset): Search for the first and
8778 last sections rather than assuming that the list is in order.
8779 (Output_segment::find_first_and_last_list): New function.
8780 * output.h (class Output_segment): Update declarations.
8781 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8782 (relro_strip_test_SOURCES): New variable.
8783 (relro_strip_test_DEPENDENCIES): New variable.
8784 (relro_strip_test_LDFLAGS): New variable.
8785 (relro_strip_test_LDADD): New variable.
8786 (relro_strip_test.so): New target.
8787
a8df5856
ILT
87882010-08-02 Ian Lance Taylor <iant@google.com>
8789
8790 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8791 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8792 (Target_i386::got_tlsdesc_section): New function.
8793 (Target_i386::got_section): Create space for GOT entries for
8794 TLSDESC relocations.
8795 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8796 R_386_TLS_GOTDESC.
8797 (Target_i386::Scan::global): Likewise.
8798 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8799 using TLSDESC GOT.
8800 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8801 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8802 (Target_x86_64::got_tlsdesc_section): New function.
8803 (Target_x86_64::got_section): Create space for GOT entries for
8804 TLSDESC relocations.
8805 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8806 R_386_TLS_GOTDESC.
8807 (Target_x86_64::Scan::global): Likewise.
8808 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8809 using TLSDESC GOT.
8810
0c10a0a6
ILT
88112010-08-02 Ian Lance Taylor <iant@google.com>
8812
8813 * testsuite/final_layout.sh: Use dc to convert from hex to
8814 decimal.
8815
41cbeecc
ST
88162010-07-29 Sriraman Tallam <tmsriram@google.com>
8817
8818 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8819 paramter to the call to gold::gc_process_relocs.
8820 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8821 paramter to the call to gold::gc_process_relocs.
8822 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8823 parameter to the call to gold::gc_process_relocs.
8824 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8825 template parameter to the call to gold::gc_process_relocs.
8826 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8827 paramter to the call to gold::gc_process_relocs.
8828 * gc.h (get_embedded_addend_size): New function.
8829 (gc_process_relocs): Save the size of the reloc for use by ICF.
8830 * icf.cc (get_section_contents): Get the addend from the text section
8831 for SHT_REL relocation sections.
8832 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8833 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8834 * int_encoding.h (read_from_pointer): New overloaded function.
8835 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8836 * testsuite/icf_sht_rel_addend_test.sh: New file.
8837 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8838 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8839
6ea55b82
RW
88402010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8841
8842 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8843 * Makefile.in: Regenerate.
8844 * testsuite/Makefile.in: Regenerate.
8845
9691462b
ILT
88462010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8847
8848 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8849 * gold/testsuite/debug_msg.cc: Likewise.
8850 * gold/testsuite/odr_violation1.cc
8851 * gold/testsuite/odr_violation2.cc
8852
76897331
CC
88532010-07-21 Cary Coutant <ccoutant@google.com>
8854
8855 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8856 string, and length fields.
8857 (Output_merge_string::Merged_strings_list): New type.
8858 (Output_merge_string::Merged_strings_lists): New typedef.
8859 (Output_merge_string): Replace merged_strings_ with
8860 merged_strings_lists_.
8861 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8862 Merged_strings_list per input object and section. Don't store pointer
8863 to the string. Don't store length with each merged string entry.
8864 (Output_merge_string::finalize_merged_data): Loop over list of merged
8865 strings lists. Recompute length of each merged string.
8866
78384e8f
CC
88672010-07-15 Cary Coutant <ccoutant@google.com>
8868
8869 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8870 here.
8871
783659f9
ILT
88722010-07-14 Ian Lance Taylor <iant@google.com>
8873
8874 * descriptors.cc (Descriptors::open): Report correct name in error
8875 message.
8876
131687b4
DK
88772010-07-13 Doug Kwan <dougkwan@google.com>
8878
8879 * arm.cc (Arm_input_section::Arm_input_section): For a
8880 SHT_ARM_EXIDX section, always keeps the input sections.
8881 (Arm_input_section::set_exidx_section_link): New method.
8882 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8883 has_errors_ to false.
8884 (Arm_exidx_input_section::has_errors,
8885 Arm_exidx_input_section::set_has_errors): New methods.
8886 (Arm_exidx_input_section::has_errors_): New data member.
8887 (Arm_relobj::get_exidx_shndx_list): New method.
8888 (Arm_output_section::append_text_sections_to_list): Do not skip
8889 section without SHF_EXECINSTR.
8890 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8891 errors.
2e702c99 8892 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8893 section header. Make error messages more verbose. Check for
8894 a non-executable section linked to an EXIDX section.
8895 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8896 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8897 check that there is no deferred EXIDX section if we exit early.
8898 Instead of not making an EXIDX section in case of an error, make one
8899 and set the has_errors flag of it.
8900 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8901 in a relocatable link.
8902 (Target_arm::do_relax): Look for the EXIDX output section instead of
8903 assuming that it is called .ARM.exidx.
2e702c99 8904 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8905 section list. Do not check for SHF_EXECINSTR section flags but
8906 skip any input section with errors.
8907 * output.cc (Output_section::Output_section): Initialize
8908 always_keeps_input_sections_ to false.
8909 (Output_section::add_input_section): Check for
8910 always_keeps_input_sections_.
8911 * output.h (Output_section::always_keeps_input_sections,
8912 Output_section::set_always_keeps_input_sections): New methods.
8913 (Output_section::always_keeps_input_sections): New data member.
8914
69517287
RÁE
89152010-07-13 Rafael Espindola <espindola@google.com>
8916
8917 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8918 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8919
82742395
ILT
89202010-07-13 Philip Herron <herron.philip@googlemail.com>
8921 Ian Lance Taylor <iant@google.com>
8922
8923 * output.h (Output_section_lookup_maps::add_merge_section):
8924 Correct check of whether value was inserted.
8925 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8926 (Output_section_lookup_maps::add_relaxed_input_section):
8927 Likewise.
8928 * arm.cc (Target_arm::got_section): Remove used local os.
8929 * i386.cc (Target_i386::got_section): Likewise.
8930 * x86_64.cc (Target_x86_64::got_section): Likewise.
8931 * sparc.cc (Target_sparc::got_section): Likewise.
8932 (Target_sparc::relocate): Remove unused local have_got_offset.
8933 * powerpc.cc (Target_powerpc::relocate): Likewise.
8934
f2d707b5
ILT
89352010-07-13 Ian Lance Taylor <iant@google.com>
8936
241531d6
ILT
8937 * compressed_output.cc (zlib_decompress): Fix signature in
8938 !HAVE_ZLIB_H case.
8939
f2d707b5
ILT
8940 * archive.cc (Archive::include_member): Unlock an external member
8941 of a thin archive. Don't bother to delete an object we know is
8942 NULL.
8943
a2e47362
CC
89442010-07-12 Cary Coutant <ccoutant@google.com>
8945
8946 * compressed_output.cc (zlib_decompress): New function.
8947 (get_uncompressed_size): New function.
8948 (decompress_input_section): New function.
8949 * compressed_output.h (get_uncompressed_size): New function.
8950 (decompress_input_section): New function.
8951 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8952 Handle compressed debug sections.
8953 * layout.cc (is_compressed_debug_section): New function.
8954 (Layout::output_section_name): Map compressed section names to
8955 canonical names.
8956 * layout.h (is_compressed_debug_section): New function.
8957 (is_debug_info_section): Recognize compressed debug sections.
8958 * merge.cc: Include compressed_output.h.
8959 (Output_merge_data::do_add_input_section): Handle compressed
8960 debug sections.
8961 (Output_merge_string::do_add_input_section): Handle compressed
8962 debug sections.
8963 * object.cc: Include compressed_output.h.
8964 (Sized_relobj::Sized_relobj): Initialize new data members.
8965 (build_compressed_section_map): New function.
8966 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8967 * object.h (Object::section_is_compressed): New method.
8968 (Object::do_section_is_compressed): New method.
8969 (Sized_relobj::Compressed_section_map): New type.
8970 (Sized_relobj::do_section_is_compressed): New method.
8971 (Sized_relobj::compressed_sections_): New data member.
8972 * output.cc (Output_section::add_input_section): Handle compressed
8973 debug sections.
8974 * reloc.cc: Include compressed_output.h.
8975 (Sized_relobj::write_sections): Handle compressed debug sections.
8976
ce279a62
CC
89772010-07-08 Cary Coutant <ccoutant@google.com>
8978
8979 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8980 weak when resolving to a dynamic def.
8981 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8982 for weak undef/dynamic def cases. Adjust callers.
8983 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8984 undef_binding_weak_.
8985 (Symbol_table::sized_write_globals): Adjust symbol binding.
8986 (Symbol_table::sized_write_symbol): Add binding parameter.
8987 * symtab.h (Symbol::set_undef_binding): New method.
8988 (Symbol::is_undef_binding_weak): New method.
8989 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8990 (Symbol_table::should_override): Add new parameter.
8991 (Symbol_table::sized_write_symbol): Add new parameter.
8992
8993 * testsuite/weak_undef_file1.cc: Add new test case.
8994 * testsuite/weak_undef_file2.cc: Fix header comment.
8995 * testsuite/weak_undef_test.cc: Add new test case.
8996
b2286c10
DK
89972010-06-29 Doug Kwan <dougkwan@google.com>
8998
8999 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9000 Initialize USE_SYMBOL_.
9001 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9002 definition.
9003 (Arm_reloc_property::uses_symbol_): New data member declaration.
9004 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9005 uses symbol value and symbol is undefined but not weakly undefined.
9006
4802450a
RÁE
90072010-06-28 Rafael Espindola <espindola@google.com>
9008
9009 * plugin.cc (Plugin::load): Use dlerror.
9010
e5ca47ba
ILT
90112010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9012
9013 * symtab.cc (detect_odr_violations): When reporting an ODR
9014 violation, report an object where the symbol is defined.
9015
8a75a161
DK
90162010-06-25 Doug Kwan <dougkwan@google.com>
9017
9018 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9019 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9020 definition.
9021 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9022 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9023 target hook to detect function points.
9024 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9025 * icf.h (Icf::check_section_for_function_pointers): Change type of
9026 parameter SECTION_NAME to const reference to std::string. Use
9027 target hook to determine if section may have unsafe pointers.
9028 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9029 method definition.
9030
42218b9f
RÁE
90312010-06-21 Rafael Espindola <espindola@google.com>
9032
9033 * fileread.cc (Input_file::find_fie): New
9034 (Input_file::open): Use Input_file::find_fie.
9035 * fileread.h (Input_file::find_fie): New
9036 * plugin.cc (set_extra_library_path): New.
9037 (Plugin::load): Add set_extra_library_path to the transfer vector.
9038 (Plugin_manager::set_extra_library_path): New.
9039 (Plugin_manager::add_input_file): Use the extra search path if set.
9040 (set_extra_library_path(): New.
9041 * plugin.h (Plugin_manager): Add set_extra_library_path and
9042 extra_search_path_.
9043
a0506cca
CC
90442010-06-19 Cary Coutant <ccoutant@google.com>
9045
9046 * layout.cc (gdb_sections): Add .debug_types.
9047 (lines_only_debug_sections): Likewise.
9048
6508b958
RÁE
90492010-06-18 Rafael Espindola <espindola@google.com>
9050
9051 * plugin.cc (add_input_file,add_input_library)
9052 (Plugin_manager::add_input_file): Make filename arguments const.
9053 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9054 const.
9055
3e235302
DK
90562010-06-16 Doug Kwan <dougkwan@google.com>
9057
9058 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9059 .ARM.attributes section if we have not merged any input
9060 attributes sections.
9061
106e8a6c
DK
90622010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9063
9064 * arm.cc: Allow combining objects with no EABI version
9065 information.
9066
91ff43fe
RÁE
90672010-06-15 Rafael Espindola <espindola@google.com>
9068
9069 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9070
68ed838c
ILT
90712010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9072
9073 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9074 (struct iovec): Correct !HAVE_READV definition.
9075
f3a2388f
CC
90762010-06-10 Cary Coutant <ccoutant@google.com>
9077
9078 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9079 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9080 reloc sections.
9081 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9082
9083 PR 11683
9084 * symtab.h (Symbol::is_placeholder): New member function.
9085 * target-reloc.h (relocate_section): Check for placeholder symbols.
9086
9087 * testsuite/Makefile.am (plugin_test_8): New test.
9088 (plugin_test_9): New test.
9089 * testsuite/Makefile.in: Regenerate.
9090
e1df38aa
NC
90912010-06-09 Nick Clifton <nickc@redhat.com>
9092
9093 * yyscript.y (input_list_element): Allow strings prefixed with
9094 the '-' character. Treat these as libraries.
9095 * script.cc (script_add_library): New function. Adds a library
9096 specified by "-l<name>" found in an input script.
9097 * script-c.h: Add prototype for script_add_library.
9098
25bbe950
DK
90992010-06-07 Doug Kwan <dougkwan@google.com>
9100
9101 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9102 Restrict stub-group size to be within long conditional branch
9103 range when working around cortex-A8 erratum.
9104
0f32ea4c
ILT
91052010-06-07 Damien Diederen <dd@crosstwine.com>
9106
9107 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9108 #ifdef typo.
9109
8fe2a369
ST
91102010-06-03 Sriraman Tallam <tmsriram@google.com>
9111
9112 PR gold/11658
9113 * output.cc
9114 (Output_section::Input_section_sort_entry::compare_section_ordering):
9115 Change to return non-zero correctly.
9116 (Output_section::Input_section_sort_section_order_index_compare
9117 ::operator()): Change to fix ambiguity in comparisons.
9118
6e9ba2ca
ST
91192010-06-01 Sriraman Tallam <tmsriram@google.com>
9120
9121 * gold.h (is_wildcard_string): New function.
9122 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9123 (Layout::layout_eh_frame): Ditto.
9124 (Layout::find_section_order_index): New method.
9125 (Layout::read_layout_from_file): New method.
9126 * layout.h (Layout::find_section_order_index): New method.
9127 (Layout::read_layout_from_file): New method.
9128 (Layout::input_section_position_): New private member.
9129 (Layout::input_section_glob_): New private member.
9130 * main.cc (main): Call read_layout_from_file here.
9131 * options.h (--section-ordering-file): New option.
9132 * output.cc (Output_section::input_section_order_specified_): New
9133 member.
9134 (Output_section::Output_section): Initialize new member.
9135 (Output_section::add_input_section): Add new parameter.
9136 Keep input sections when --section-ordering-file is used.
9137 (Output_section::set_final_data_size): Sort input sections when
9138 section ordering file is specified.
9139 (Output_section::Input_section_sort_entry): Add new parameter.
9140 Check sorting type.
9141 (Output_section::Input_section_sort_entry::compare_section_ordering):
9142 New method.
9143 (Output_section::Input_section_sort_compare::operator()): Change to
9144 consider section_order_index.
9145 (Output_section::Input_section_sort_init_fini_compare::operator()):
9146 Change to consider section_order_index.
9147 (Output_section::Input_section_sort_section_order_index_compare
9148 ::operator()): New method.
9149 (Output_section::sort_attached_input_sections): Change to sort
9150 according to section order when specified.
e1df38aa
NC
9151 (Output_section::add_input_section<32, true>): Add new parameter.
9152 (Output_section::add_input_section<64, true>): Add new parameter.
9153 (Output_section::add_input_section<32, false>): Add new parameter.
9154 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9155 * output.h (Output_section::add_input_section): Add new parameter.
9156 (Output_section::input_section_order_specified): New
9157 method.
9158 (Output_section::set_input_section_order_specified): New method.
9159 (Input_section::Input_section): Initialize section_order_index_.
9160 (Input_section::section_order_index): New method.
9161 (Input_section::set_section_order_index): New method.
9162 (Input_section::section_order_index_): New member.
9163 (Input_section::Input_section_sort_section_order_index_compare): New
9164 struct.
9165 (Output_section::input_section_order_specified_): New member.
9166 * script-sections.cc (is_wildcard_string): Delete and move modified
9167 method to gold.h.
9168 (Output_section_element_input::Output_section_element_input): Modify
9169 call to is_wildcard_string.
9170 (Output_section_element_input::Input_section_pattern
9171 ::Input_section_pattern): Ditto.
9172 (Output_section_element_input::Output_section_element_input): Ditto.
9173 * testsuite/Makefile.am (final_layout): New test case.
9174 * testsuite/Makefile.in: Regenerate.
9175 * testsuite/final_layout.cc: New file.
9176 * testsuite/final_layout.sh: New file.
9177
3537c84b
RÁE
91782010-06-01 Rafael Espindola <espindola@google.com>
9179
9180 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9181
105b6afd
RÁE
91822010-06-01 Rafael Espindola <espindola@google.com>
9183
9184 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9185 visibility of symbols.
9186
29e11421
DK
91872010-05-27 Doug Kwan <dougkwan@google.com>
9188
9189 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9190 from start of output section instead of address for a local symbol
9191 in a merged or relaxed section when doing a relocatable link.
9192
5e0f337e
RÁE
91932010-05-26 Rafael Espindola <espindola@google.com>
9194
703d02da 9195 PR 11604
5e0f337e
RÁE
9196 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9197 adding sections the garbage collector removed.
9198 * gold/testsuite/Makefile.am: Add test.
9199 * gold/testsuite/Makefile.in: Regenerate.
9200 * gold/testsuite/plugin_test_7.sh: New.
9201 * gold/testsuite/plugin_test_7_1.c: New.
9202 * gold/testsuite/plugin_test_7_2.c: New.
9203
f4187277
RÁE
92042010-05-26 Rafael Espindola <espindola@google.com>
9205
9206 * script-sections.cc (Output_section_definition::set_section_addresses):
9207 Check for --section-start.
9208
5c388529
DK
92092010-05-26 Doug Kwan <dougkwan@google.com>
9210
9211 * arm.cc (Arm_scan_relocatable_relocs): New class.
9212 (Target_arm::relocate_special_relocatable): New method.
9213 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9214 (Arm_relocate_functions::thumb_branch_common): Same.
9215 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9216 instead of Default_scan_relocatable_relocs.
9217 * target-reloc.h (relocate_for_relocatable): Let target handle
9218 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9219 * target.h (Sized_target::relocate_special_relocatable): New method.
9220
bca1c3ae
ILT
92212010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9222
9223 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9224
0439c796
DK
92252010-05-23 Doug Kwan <dougkwan@google.com>
9226
9227 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9228 instead of a cast.
9229 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9230 with a direct branch, not a conditional branch, to a stub.
9231 * merge.cc (Output_merge_base::record_input_section): New method
9232 defintion.
9233 (Output_merge_data::do_add_input_section): Record input section if
9234 keeps-input-sections flag is set.
9235 (Output_merge_string::do_add_input_section): Ditto.
9236 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9237 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9238 INPUT_SECTIONS_.
9239 (Output_merge_base::keeps_input_sections,
9240 Output_merge_base::set_keeps_input_sections,
9241 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9242 method definitions.
9243 (Output_merge_base::Input_sections): New type declaration.
9244 (Output_merge_base::input_sections_begin,
9245 Output_merge_base::input_sections_end,
9246 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9247 (Output_merge_base::bool keeps_input_sections_,
9248 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9249 Output_merge_base::input_sections_): New data members.
9250 (Output_merge_data::do_set_keeps_input_sections): New method
9251 defintion.
9252 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9253 * output.cc (Output_section::Input_section::relobj): Move method
9254 defintion from class declaration to here and handle merge sections.
9255 (Output_section::Input_section::shndx): Ditto.
9256 (Output_section::Output_section): Remove initializations of removed
9257 data members and initialize new data member LOOKUP_MAPS_.
9258 (Output_section::add_input_section): Set keeps-input-sections flag
9259 for a newly created merge output section as appropriate. Adjust code
9260 to use Output_section_lookup_maps class.
9261 (Output_section::add_relaxed_input_section): Adjst code for lookup
9262 maps code refactoring.
2e702c99 9263 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9264 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9265 class. If adding input section to a newly created merge output
9266 section fails, remove the new merge section.
9267 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9268 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9269 (Output_section::find_merge_section): Ditto.
0439c796 9270 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9271 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9272 Output_section_lookup_maps class.
9273 (Output_section::get_input_sections): Export merge sections. Adjust
9274 code to use Output_section_lookup_maps class.
9275 (Output_section:::add_script_input_section): Adjust code to use
9276 Output_section_lookup_maps class. Update lookup maps for merge
9277 sections also.
9278 (Output_section::discard_states): Use Output_section_lookup_maps.
9279 (Output_section::restore_states): Same.
9280 * output.h (Merge_section_properties): Move class defintion out of
9281 Output_section.
9282 (Output_section_lookup_maps): New class.
9283 (Output_section::Input_section::is_merge_section): New method
9284 defintion.
9285 (Output_section::Input_section::relobj): Move defintion out of class
9286 defintion. Declare method only.
9287 (Output_section::Input_section::shndx): Ditto.
9288 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9289 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9290 (Output_section::Merge_section_by_properties_map,
9291 Output_section::Output_section_data_by_input_section_map,
9292 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9293 Remove types.
2e702c99 9294 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9295 KEEPS_INPUT_SECTIONS.
9296 (Output_section::build_lookup_maps): New method declaration.
9297 (Output_section::merge_section_map_,
9298 Output_section::merge_section_by_properties_map_,
9299 Output_section::relaxed_input_section_map_,
9300 Output_section::is_relaxed_input_section_map_valid_): Remove data
9301 members.
9302 (Output_section::lookup_maps_): New data member.
9303
76295588
L
93042010-05-21 Doug Kwan <dougkwan@google.com>
9305
9306 PR gold/11619
9307 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9308 avoid a compilation error.
9309
d103a984
RÁE
93102010-05-19 Rafael Espindola <espindola@google.com>
9311
9312 * script-sections.cc (Output_section_definition::allocate_to_segment):
9313 Update the phdrs_list even when the output section is NULL.
9314 * testsuite/Makefile.am: Add test.
9315 * testsuite/Makefile.in: Regenerate.
9316 * testsuite/script_test_9.cc: New.
9317 * testsuite/script_test_9.sh: New.
9318 * testsuite/script_test_9.t: New.
9319
6625d24e
DK
93202010-05-19 Doug Kwan <dougkwan@google.com>
9321
9322 * arm.cc (Arm_input_section::original_size): New method.
9323 (Arm_input_section::do_addralign): Add a cast.
9324 (Arm_input_section::do_output_offset): Remove static cast.
9325 (Arm_input_section::original_addralign,
9326 Arm_input_section::original_size_): Change type to uint32_t.
9327 (Arm_input_section::init): Add safe casts for section alignment
9328 and size.
9329 (Arm_input_section::set_final_data_size): Do not set address and
9330 offset of stub table.
9331 (Arm_output_section::fix_exidx_coverage): Change use of of
9332 Output_section::Simple_input_section to that of
9333 Output_section::Input_section.
9334 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9335 except for the first pass.
9336 * output.cc (Output_section::get_input_sections): Change type of
9337 input_sections to std::list<Input_section>.
9338 (Output_section::add_script_input_section): Rename from
9339 Output_section::add_simple_input_section. Change type of SIS
9340 parameter from Simple_input_section to Input_section.
9341 * output.h (Output_section::Simple_input_section): Remove class.
9342 (Output_section::Input_section): Change class visibility to public.
9343 (Output_section::Input_section::addralign): Use stored alignments
9344 for special input sections if set.
9345 (Output_section::Input_section::set_addralign): New method.
9346 (Output_section::get_input_sections): Change parameter type from
9347 list of Simple_input_section to list of Input_section.
9348 (Output_section::add_script_input_section): Rename from
9349 Output_section::add_simple_input_section. Change first parameter's
9350 type from Simple_input_section to Input_section and remove the
9351 second and third parameters.
9352 * script-sections.cc (Input_section::Input_section_list): Change
9353 type to list of Output_section::Input_section/
9354 (Input_section_info::Input_section_info): Change parameter type of
9355 INPUT_SECTION to Output_section::Input_section.
9356 (Input_section_info::input_section): Change return type.
9357 (Input_section_info::input_section_): Change type to
9358 Output_section::Input_section.
9359 (Output_section_element_input::set_section_addresses): Adjust code
9360 to use Output_section::Input_section instead of
9361 Output_section::Simple_input_section. Adjust code for renaming
9362 of Output_section::add_simple_input_section.
9363 (Orphan_output_section::set_section_addresses): Ditto.
9364
e1e82ea4
RW
93652010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9366
9367 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9368 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9369
91e75c8a
RÁE
93702010-05-18 Rafael Espindola <espindola@google.com>
9371
9372 * options.cc (General_options::finalize): Handle -nostdlib.
9373 * options.h (nostdlib): New option.
9374 * script.cc (script_add_search_dir): Handle -nostdlib.
9375
da59ad79
DK
93762010-05-12 Doug Kwan <dougkwan@google.com>
9377
9378 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9379 attributes section only if there no attributes section after merging.
9380 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9381 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9382 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9383 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9384 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9385 and arm_attr_merge_7.stdout.
9386 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9387 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9388 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9389 arm_attr_merge_7b.o): New rules.
9390 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9391 arm_attr_merge_7
9392 * testsuite/Makefile.in: Regenerate.
9393 * testsuite/arm_attr_merge.sh: New file.
9394 * testsuite/arm_attr_merge_[67][ab].s: Same.
9395
3e01a7fd
NC
93962010-05-05 Nick Clifton <nickc@redhat.com>
9397
9398 * po/es.po: Updated Spanish translation.
9399
7ad2014a
L
94002010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9401
9402 * Makefile.am (install-exec-local): Properly install gold as
9403 default cross linker.
9404 * Makefile.in: Regenerated.
9405
4fda8867
NC
94062010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9407 Nick Clifton <nickc@redhat.com>
9408
9409 * configure.ac (install_as_default): Define and set to false
9410 unless --enable-gold or --enable-gold=both/gold has been
9411 specified.
9412 * configure: Regenerate.
9413
9414 * Makefile.am (install-exec-local): Install the executable as
9415 'ld.gold'. If install_as_default is true then also install it as
9416 'ld'.
9417 * Makefile.in: Regenerated.
9418
bd288ea2
ILT
94192010-04-24 Ian Lance Taylor <iant@google.com>
9420
9421 * layout.cc (Layout::layout_reloc): In relocatable link don't
9422 combine reloc sections for grouped sections.
9423
ef38fd8a
ST
94242010-04-23 Sriraman Tallam <tmsriram@google.com>
9425
9426 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9427 sections that are not ordinary to icf.
9428 * icf.cc (get_section_contents): Handle relocation pointing to section
9429 with no object or shndx information.
9430 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9431 * testsuite/Makefile.in: Regenerate.
9432 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9433 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9434
f6973bdc
ILT
94352010-04-22 Ian Lance Taylor <iant@google.com>
9436
9437 * expression.cc (Expression::Expression_eval_info): Add
9438 result_alignment_pointer field.
9439 (Expression::eval_with_dot): Add result_alignment_pointer
9440 parameter. Change all callers.
9441 (Expression::eval_maybe_dot): Likewise.
9442 (class Binary_expression): Add alignment_pointer parameter to
9443 left_value and right_value. Change all callers.
9444 (BINARY_EXPRESSION): Set result alignment.
9445 (class Trinary_expression): Add alignment_pointer parameter to
9446 arg2_value and arg3_value. Change all callers.
9447 (Trinary_cond::value): Set result alignment.
9448 (Max_expression::value, Min_expression::value): Likewise.
9449 (Align_expression::value): Likewise.
9450 * script-sections.cc (class Sections_element): Add dot_alignment
9451 parameter to set_section_addresses virtual function. Update
9452 instantiations.
9453 (class Output_section_element): Likewise.
9454 (Script_sections::create_segments): Add dot_alignment parameter.
9455 Change all callers.
9456 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9457 (Script_sections::set_phdrs_clause_addresses): Likewise.
9458 * script-sections.h: Update declarations.
9459 * script.h: Update declarations.
9460 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9461 min_p_align.
9462 * testsuite/script_test_3.t: Set large alignment.
9463 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9464 segment has expected alignment.
9465
9c9c98a5
NC
94662010-04-22 Nick Clifton <nickc@redhat.com>
9467
9468 * po/gold.pot: Updated by the Translation project.
9469 * po/vi.po: Updated Vietnamese translation.
9470
2253bfba
L
94712010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9472
9473 * testsuite/Makefile.am (check_PROGRAMS): Add
9474 icf_virtual_function_folding_test.
9475 * testsuite/Makefile.in: Regenerated.
9476
85fdf906
AH
94772010-04-15 Andrew Haley <aph@redhat.com>
9478
9479 * options.h (merge_exidx_entries): New option.
9480 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9481 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9482 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9483 (Target_arm::merge_exidx_entries): New function.
9484 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9485 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9486 to Arm_exidx_fixup constructor.
9487 Add new arg, merge_exidx_entries.
9488 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9489 Arm_output_section::fix_exidx_coverage.
9490
ce97fa81
ST
94912010-04-18 Sriraman Tallam <tmsriram@google.com>
9492
9493 * icf.cc (get_section_contents): Check for preemptible functions.
9494 Ignore addend when appropriate.
9495 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9496 section folded.
9497 (add_from_relobj): Check for section folded.
9498 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9499 * symtab.h (should_add_dynsym_entry): Add new parameter.
9500 * target-reloc.h (scan_relocs): Check for section folded.
9501 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9502 Check reloc types for function pointers in shared objects.
9503 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9504 case.
9505 (icf_preemptible_functions_test): New test case.
9506 (icf_string_merge_test): New test case.
9507 * testsuite.Makefile.in: Regenerate.
9508 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9509 bar_glob. Refactor code.
9510 * testsuite/icf_preemptible_functions_test.cc: New file.
9511 * testsuite/icf_preemptible_functions_test.sh: New file.
9512 * testsuite/icf_string_merge_test.cc: New file.
9513 * testsuite/icf_string_merge_test.sh: New file.
9514 * testsuite/icf_virtual_function_folding_test.cc: New file.
9515 * testsuite/icf_virtual_function_folding_test.sh: New file.
9516
04ceb17c
DK
95172010-04-14 Doug Kwan <dougkwan@google.com>
9518
9519 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9520 for local symbol recounting if we remove a section due to ICF.
9521 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9522 there are no regular objects in input.
9523
153e7da4
DK
95242010-04-13 Doug Kwan <dougkwan@google.com>
9525
9526 * arm.cc (Arm_input_section::set_final_data_size): Compute
9527 accurate final data size instead of using current data size.
9528
4dbd9faf
DK
95292010-04-09 Doug Kwan <dougkwan@google.com>
9530
9531 * layout.cc (Layout::choose_output_section): Handle script section
9532 types.
9533 (Layout::make_output_section_for_script): Add section type parameter.
9534 Handle script section types.
9535 * layout.h (Layout::make_output_section_for_script): Add section
9536 type parameter.
9537 * output.cc (Output_section::Output_section): Initialize data member
9538 is_noload_.
9539 (Output_section::do_reset_address_and_file_offset): Do not set address
9540 to 0 if section is a NOLOAD section.
9541 * output.h (Output_section::is_noload): New method.
9542 (Output_section::set_is_noload): Ditto.
9543 (Output_section::is_noload_): New data member.
9544 * script-c.h (Script_section_type): New enum type.
9545 (struct Parser_output_section_header): Add new file section_type.
9546 * script-sections.cc (Sections_element::output_section_name): Add
9547 parameter for returning script section type.
9548 (Output_section_definition::output_section_name): Ditto.
9549 (Output_section_definition::section_type)P; New method.
9550 (Output_section_definiton::script_section_type_name): Ditto.
9551 (Output_section_definition::script_section_type_): New data member.
9552 (Output_section_definition::Output_section_definition): Initialize
9553 data member Output_section_definition::script_section_type_.
9554 (Output_section_definition::create_sections): Pass script section type
9555 to Layout::make_output_section_for_script.
9556 (Output_section_definition::output_section_name): Return script
9557 section type to caller.
9558 (Output_section_definition::set_section_address): Do not advance
9559 dot value and load address if section type is NOLOAD. Set address
9560 of NOLOAD sections regardless of section flags.
9561 (Output_section_definition::print): Print section type if it is
9562 not SCRIPT_SECTION_TYPE_NONE.
9563 (Output_section_definition::section_type): New method.
9564 (Output_section_definition::script_section_type_name): Ditto.
9565 (Script_sections::output_section_name): Add new parameter
9566 PSECTION_TYPE for returning script section type. Pass it to
9567 section elements. Handle discard sections.
9568 (Sort_output_sections::operator()): Handle NOLOAD sections.
9569 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9570 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9571 returning script section type.
9572 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9573 INFO and NOLOAD.
9574 * yyscript.y (union): Add new field SECTION_TYPE.
9575 (COPY, DSECT, INFO, NOLOAD): New tokens.
9576 (opt_address_and_section_type): Change type to output_section_header.
9577 (section_type): New non-terminal
9578 (section_header): Handle section type.
2253bfba 9579 (opt_address_and_section_type): Return section type value.
4dbd9faf 9580
721ea635
L
95812010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9582
9583 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9584 * testsuite/plugin_common_test_2.c (foo): Likewise.
9585
6bf924b0
DK
95862010-04-08 Doug Kwan <dougkwan@google.com>
9587
9588 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9589 Output_merge_data.
9590 * output.cc (Output_section::add_merge_input_section): Simplify
9591 code and return status of Output_merge_base::add_input_section.
e1df38aa 9592 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9593 returns true.
9594
24af6f92
DK
95952010-04-07 Doug Kwan <dougkwan@google.com>
9596
9597 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9598 if section is marked as containing instructions but has no mapping
9599 symbols.
9600 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9601 correct section index.
9602 (Arm_relobj::find_linked_text_section): Ditto.
9603
00698fc5
CC
96042010-04-07 Cary Coutant <ccoutant@google.com>
9605
9606 * archive.cc (include_member): Destroy Read_symbols_data object before
9607 releasing file.
9608 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9609 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9610 (Read_symbols_data::~Read_symbols_data) New destructor.
9611 (Section_relocs::Section_relocs) New constructor.
9612 (Section_relocs::~Section_relocs) New destructor.
9613 (Read_relocs_data::Read_relocs_data) New constructor.
9614 (Read_relocs_data::~Read_relocs_data) New destructor.
9615 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9616 pointers to NULL after deleting.
9617
7296d933
DK
96182010-04-07 Doug Kwan <dougkwan@google.com>
9619
9620 * arm.cc: Replace "endianity" with "endianness" in comments.
9621 (Arm_exidx_cantunwind): Ditto.
9622 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9623 (Arm_relobj::merge_flags_and_attributes): New method.
9624 (Arm_relobj::merge_flags_and_attributes_): New data member.
9625 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9626 (Arm_relobj::scan_sections_for_stubs): Ditto.
9627 (Arm_relobj::do_read_symbols): Check to see if we really want to
9628 merge processor-specific flags and attributes. Exit early if
9629 an object is empty except for section names and the undefined symbol.
9630 (Target_arm::do_finalize_sections): Move check for ELF format to
9631 Arm_relobj::do_read_symbols. Merge processor specific flags and
9632 attributes from a regular object only when we have determined that
9633 it is aapropriate. Do not create an .ARM.attributes section in
9634 output if there is no regular input object.
9635 (Target_arm::merge_processor_specific_flags): Check
9636 --warn-mismatch before printing any error.
9637 (Target_arm::merge_object_attributes): Ditto.
9638 * gold.cc (queue_middle_tasks): Handle the case in which there is
9639 no regular object in input.
9640 * options.cc (General_options::parse_EB): New method.
9641 (General_options::parse_EL): Same.
9642 (General_options::General_options): Initialize endianness_.
9643 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9644 New options.
9645 (General_options::Endianness): New enum.
9646 (General_options::endianness): New method.
9647 (General_options::endianness_): New data member.
9648 * parameters.cc (Parameters::set_options): Check target endianness.
9649 (Parameters::set_target_once): Ditto.
9650 (Parameters::check_target_endianness): New method.
9651 (parameters_force_valid_target): If either -EL or -EB is specified,
9652 use it to define endianness of default target.
9653 * parameters.h (Parameters::check_target_endianness): New method
9654 declaration.
9655 * target.h (class Target): Change "endianity" to "endianness"
9656 in comments.
9657
efc8d4f2
RW
96582010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9659
9660 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9661 * configure: Regenerate.
9662 * Makefile.in: Regenerate.
9663 * testsuite/Makefile.in: Regenerate.
9664
be234d88
CC
96652010-04-06 Cary Coutant <ccoutant@google.com>
9666
9667 gcc PR lto/42757
9668 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9669 prevailing definitions of common symbols.
9670 * testsuite/plugin_test_6.sh: New test case.
9671 * testsuite/plugin_common_test_1.c: New test case.
9672 * testsuite/plugin_common_test_2.c: New test case.
9673 * testsuite/Makefile.am (plugin_test_6): New test case.
9674 * testsuite/Makefile.in: Regenerate.
9675
bd32c6bd
NC
96762010-04-06 Nick Clifton <nickc@redhat.com>
9677
9678 * po/vi.po: New Vietnamese translation.
9679
323c532f
DK
96802010-03-30 Doug Kwan <dougkwan@google.com>
9681
9682 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9683
4fcd97eb
DK
96842010-03-25 Doug Kwan <dougkwan@google.com>
9685
9686 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9687 to avoid a conversion warning on a 32-bit host.
9688
4ebf39db
ILT
96892010-03-24 Ian Lance Taylor <iant@google.com>
9690
9691 * testsuite/script_test_3.t: Add a TLS segment.
9692 * testsuite/Makefile.am (check_PROGRAMS): Add
9693 tls_phdrs_script_test.
9694 (tls_phdrs_script_test_SOURCES): Define.
9695 (tls_phdrs_script_test_DEPENDENCIES): Define.
9696 (tls_phdrs_script_test_LDFLAGS): Define.
9697 (tls_phdrs_script_test_LDADD): Define.
9698 * testsuite/Makefile.in: Rebuild.
9699
4a599bdd
CC
97002010-03-23 Cary Coutant <ccoutant@google.com>
9701
9702 * fileread.cc (find_or_make_view): Fix comment.
9703
6c93b22c
ILT
97042010-03-23 Ian Lance Taylor <iant@google.com>
9705
9706 * script-sections.cc (class Orphan_section_placement): Define
9707 PLACE_TLS and PLACE_TLS_BSS.
9708 (Orphan_section_placement::Orphan_section_placement): Initialize
9709 new places.
9710 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9711 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9712 (tls_script_test_SOURCES): Define.
9713 (tls_script_test_DEPENDENCIES): Define.
9714 (tls_script_test_LDFLAGS): Define.
9715 (tls_script_test_LDADD): Define.
9716 * testsuite/Makefile.in: Rebuild.
9717
a2c7281b
DK
97182010-03-22 Doug Kwan <dougkwan@google.com>
9719
9720 * arm.cc (Arm_relocate_functions::abs8,
9721 Arm_relocate_functions::abs16): Use correct check for overflow
9722 specified in the ARM ELF specs.
9723 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9724 target of a BLX instruction specially.
9725 (Reloc_stub::stub_type_for_reloc): Ditto.
9726 (Relocate::relocate): Use symbolic names instead of numeric relocation
9727 codes to report error.
9728 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9729 workaround.
9730 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9731 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9732 thumb2_blx_out_of_range.stdout
9733 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9734 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9735 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9736 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9737 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9738 thumb2_blx_in_range, thumb2_blx_in_range.o,
9739 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9740 thumb2_blx_out_of_range.o): New rules.
2e702c99 9741 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9742 thumb2_blx_in_range and thumb2_blx_out_of_range.
9743 * testsuite/Makefile.in: Regenerate.
9744 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9745 * testsuite/thumb_blx_in_range.s: New file.
9746 * testsuite/thumb_blx_out_of_range.s: New file.
9747
b0193076
RÁE
97482010-03-22 Rafael Espindola <espindola@google.com>
9749
9750 * archive.cc (Should_include): Move to archive.h.
9751 (should_include_member): Make it a member of Archive.
9752 (Lib_group): New.
9753 (Add_lib_group_symbols): New.
9754 * archive.h: Include options.h.
9755 (Archive_member): Moved from Archive.
9756 (Should_include): Moved from archive.cc.
9757 (Lib_group): New.
9758 (Add_lib_group_symbols): New.
9759 * dynobj.cc (do_should_include_member): New.
9760 * dynobj.h (do_should_include_member): New.
9761 * gold.cc (queue_initial_tasks): Update call to queue.
9762 * main.cc (main): Print lib group stats.
9763 * object.cc (do_should_include_member): New.
9764 * object.h: Include archive.h.
9765 (Object::should_include_member): New.
9766 (Object::do_should_include_member): New.
9767 (Sized_relobj::do_should_include_member): New.
9768 * options.cc (General_options::parse_start_lib): New.
9769 (General_options::parse_end_lib): New.
9770 (Input_arguments::add_file): Handle lib groups.
9771 (Input_arguments::start_group): Check we are not in a lib.
9772 (Input_arguments::start_lib): New.
9773 (Input_arguments::end_lib): New.
9774 * options.h (General_options): Add start_lib and end_lib.
9775 (Input_argument::lib_): New.
9776 (Input_argument::lib): New.
9777 (Input_argument::is_lib): New.
9778 (Input_file_lib): New.
9779 (Input_arguments::in_lib_): New.
9780 (Input_arguments::in_lib): New.
9781 (Input_arguments::start_lib): New.
9782 (Input_arguments::end_lib_): New.
9783 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9784 in unused members as preempted.
9785 (Sized_pluginobj::do_should_include_member): New.
9786 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9787 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9788 return the blocker.
9789 (Read_symbols::do_whole_lib_group): New.
9790 (Read_symbols::do_lib_group): New.
9791 (Read_symbols::do_read_symbols): Handle lib groups.
9792 (Read_symbols::get_name): Handle lib groups.
9793 * readsyms.h (Read_symbols): Add an archive member pointer.
9794 (Read_symbols::do_whole_lib_group): New.
9795 (Read_symbols::do_lib_group): New.
9796 (Read_symbols::member_): New.
9797 * script.cc (read_input_script): Update call to queue_soon.
9798
d099120c
DK
97992010-03-19 Doug Kwan <dougkwan@google.com>
9800
9801 * arm.cc (Stub_table::Stub_table): Initialize new data members
9802 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9803 (Stub_table::add_reloc_stub): Assign stub offset and update
9804 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9805 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9806 New data members.
2e702c99 9807 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9808 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9809 instead of going over all reloc stubs.
2e702c99 9810 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9811 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9812 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9813 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9814 Stringpool_template::offset_.
9815 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9816 Stringpool_template::offset_ to zero.
9817
1aa37384
DK
98182010-03-15 Doug Kwan <dougkwan@google.com>
9819
9820 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9821 offset_.
9822 (Stringpool_template::new_key_offset): New method.
9823 (Stringpool_template::add_string): Assign offsets when adding new
9824 strings.
9825 (Stringpool_template::set_string_offsets): Do not set string offsets
9826 when not optimizing.
9827 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9828 member size_.
2e702c99
RM
9829 (Chunked_vector::clear): Clear size_.
9830 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9831 (Chunked_vector::size): Return size_.
9832 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9833 (Chunked_vector::size_): New data member.
1aa37384
DK
9834 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9835 (Stringpool_template::new_key_offset): New method declaration.
9836 (Stringpool_template::offset_): New data member.
9837
b672b057
RÁE
98382010-03-15 Rafael Espindola <espindola@google.com>
9839
9840 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9841 Add_symbols' constructor.
9842 * readsyms.h (Add_symbols): Remove the input_group member.
9843
b6848d3c
ILT
98442010-03-10 Ian Lance Taylor <iant@google.com>
9845
9846 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9847 target to ask whether a reference to a symbol requires a stack
9848 split.
9849 * target.h (Target::is_call_to_non_split): New function.
9850 (Target::do_is_call_to_non_split): Declare virtual function.
9851 * target.cc: Include "symtab.h".
9852 (Target::do_is_call_to_non_split): New function.
9853 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9854
a2a5469e
CC
98552010-03-10 Cary Coutant <ccoutant@google.com>
9856
9857 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9858 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9859 (File_read::open[2]): Add whole_file_view_ to list of views.
9860 (File_read::make_view): Remove test of whole_file_view_.
9861 (File_read::find_or_make_view): Create whole_file_view_ if
9862 necessary.
9863 (File_read::clear_views): Replace bool parameter with enum;
9864 adjust all callers. Don't delete views with permanent data;
9865 do delete cached views and views from archives if
9866 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9867 if clearing the corresponding view.
9868 * fileread.h (File_read::Clear_views_mode): New enum.
9869 (File_read::View::is_permanent_view): New method.
9870 (File_read::clear_views): Replace bool parameter
9871 with enum; adjust all callers.
9872 * options.h (General_options): Change keep_files_mapped option;
9873 add map_whole_files.
9874 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9875 releasing the file.
9876 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9877 the file.
9878
8861f32b
DM
98792010-03-10 David S. Miller <davem@davemloft.net>
9880
9881 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9882
d62d0f5f
ST
98832010-03-09 Sriraman Tallam <tmsriram@google.com>
9884
9885 * icf.cc (get_section_contents): Add '@' marker after processing the
9886 merge reloc.
9887
9177756d
DK
98882010-03-08 Doug Kwan <dougkwan@google.com>
9889
9890 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9891 due to a conversion warning.
9892 (Arm_relobj::update_output_local_symbol_count): Check for local
9893 symbol with unset output index.
9894
9e9e071b
ILT
98952010-03-05 Ian Lance Taylor <iant@google.com>
9896
9897 * options.h (class General_options): Add --spare-dynamic-tags.
9898 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9899 --spare-dynamic-tags.
9900
a81ee015
ILT
99012010-03-05 Ian Lance Taylor <iant@google.com>
9902
9903 * incremental.cc: Include "libiberty.h".
9904
44ec90b9
RO
99052010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9906
9907 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9908 function, is_info_ member.
9909 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9910 (Versions::Versions): Update caller.
9911 (Versions::define_base_version): Likewise.
9912 (Versions::add_def): Likewise.
9913
0897ed3b
ST
99142010-03-03 Sriraman Tallam <tmsriram@google.com>
9915
9916 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9917 (Scan::possible_function_pointer_reloc): New function.
9918 (Scan::local_reloc_may_be_function_pointer): Change to call
9919 possible_function_pointer_reloc.
9920 (Scan::global_reloc_may_be_function_pointer): Ditto.
9921 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9922 relocations in ".data.rel.ro._ZTV" section.
9923 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9924 * testsuite/icf_safe_so_test.cc: Ditto.
9925 * testsuite/icf_safe_test.cc: Ditto.
9926 * testsuite/icf_safe_test.sh: Ditto.
9927
d3bbad62
ILT
99282010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9929 Ian Lance Taylor <iant@google.com>
9930
9931 * target-reloc.h (relocate_section): Check the symbol table index
9932 for -1U before setting the local symbol index.
9933 (scan_relocatable_relocs): If copying the relocation, record that
9934 the local symbol is required.
9935 * object.h (Symbol_value::is_output_symtab_index_set): New
9936 function.
9937 (Symbol_value::may_be_discarded_from_output_symtab): New
9938 function.
9939 (Symbol_value::has_output_symtab_entry): New function.
9940 (Symbol_value::needs_output_symtab_entry): Remove.
9941 (Symbol_value::output_symtab_index): Make sure the symbol index is
9942 set.
9943 (Symbol_value::set_output_symtab_index): Make sure the symbol
9944 index is not set. Make sure the new index is valid.
9945 (Symbol_value::set_must_have_output_symtab_entry): New function.
9946 (Symbol_value::has_output_dynsym_entry): New function.
9947 (Symbol_value::set_output_dynsym_index): Make sure the new index
9948 is valid.
9949 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9950 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9951 local symbol if permitted.
9952 (Sized_relobj::do_finalize_local_symbols): Call
9953 is_output_symtab_index_set rather than needs_output_symtab_entry.
9954 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9955 rather than needs_output_symtab_entry. Call
9956 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9957 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9958 is_output_symtab_index_set rather than needs_output_symtab_entry.
9959 * testsuite/discard_locals_relocatable_test.c: New file.
9960 * testsuite/discard_locals_test.sh: Test -r.
9961 * testsuite/Makefile.am (check_DATA): Add
9962 discard_locals_relocatable_test1.syms,
9963 discard_local_relocatable_test2.syms.
9964 (MOSTLYCLEANFILES): Likewise. Also add
9965 discard_locals_relocatable_test1.lout and
9966 discard_locals_relocatable_test2.out.
9967 (discard_locals_relocatable_test1.syms): New target.
9968 (discard_locals_relocatable_test.o): New target.
9969 (discard_locals_relocatable_test1.out): New target.
9970 (discard_locals_relocatable_test2.syms): New target.
9971 (discard_locals_relocatable_test2.out): New target.
9972 (various): Add missing ../ld-new dependencies.
9973 * testsuite/Makefile.in: Rebuild.
9974
7e8ccf26
NC
99752010-03-03 Nick Clifton <nickc@redhat.com>
9976
9977 * po/fi.po: New Finnish translation.
9978
2a0ff005
DK
99792010-03-01 Doug Kwan <dougkwan@google.com>
9980
9981 * layout.cc (Layout::Layout): Force section types of .init_array*,
9982 .preinit_array* and .fini_array* sections.
9983 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9984 Fix check of return value of std::string::find.().
9985 (Output_section::Input_section_sort_compare::operator()): Remove
9986 comment about .init_array.
9987 (Output_section::Input_section_sort_init_fini_compare::operator()):
9988 New method.
9989 (Output_section::sort_attached_input_sections): Handle .init_array
9990 and .fini_array specially.
9991 * output.h (Output_section::Inut_section_sort_compare): Update
9992 comment.
9993 (Output_section::Input_section_sort_init_fini_compare): New struct.
9994
c3e4ae29
DK
99952010-02-26 Doug Kwan <dougkwan@google.com>
9996
9997 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9998 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9999 * testsuite/debug_msg.sh: Avoid matching source line number for
10000 use of global variable undef_int.
10001
2fd9ae7a
DK
100022010-02-26 Doug Kwan <dougkwan@google.com>
10003
10004 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10005 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10006 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10007 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10008 * options.cc (General_options::General_options): Initialize member
10009 fix_v4bx_.
10010 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10011 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10012 and rm_no_fix_v4bx.stdout
10013 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10014 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10015 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10016 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10017 and arm_no_fix_v4bx.
10018 * Makefile.in: Regenerate.
10019 * testsuite/arm_fix_v4bx.s: New file.
10020 * testsuite/arm_fix_v4bx.sh: Ditto.
10021
67ec7d0b
DK
100222010-02-24 Doug Kwan <dougkwan@google.com>
10023
10024 * arm.cc (Target_arm::got_section): Make the .got section the first
10025 non RELRO section in the data segment.
10026 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10027 suffixes of section names.
10028
10165461
DK
100292010-02-24 Doug Kwan <dougkwan@google.com>
10030
10031 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10032 flags and attributes merging if an input file is a binary file.
10033 * fileread.cc (Input_file::open): Record format of original file.
10034 * fileread.h (Input_file::Format): New enum type.
2e702c99 10035 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10036 (Input_file::format): New method definition.
10037 (Input_file::format_):: New data member.
10038
4a54abbb
DK
100392010-02-24 Doug Kwan <dougkwan@google.com>
10040
10041 * arm.cc (Arm_output_data_got): New class.
10042 (ARM_TCB_SIZE): New constant
10043 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10044 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10045 If user uses a script with a SECTIONS clause, issue only a warning
10046 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10047 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10048 garbage collection.
10049 (Target_arm::got_mode_index_entry): Handle static linking.
10050 (Target_arm::Scan::local): Ditto.
10051 (Target_arm::Scan::global): Ditto.
10052 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10053 all incorrectly implemented relocations.
e1df38aa 10054 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10055 Arm_output_section::fix_exidx_coverage.
10056 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10057 from ".ARM.exidx." and ".ARM.extab.".
10058
ca419a6f
ILT
100592010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10060
10061 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10062 section if it does not already exist.
10063 * attributes.cc (Attributes_section_data::Attributes_section_data):
10064 Don't crash if size is zero.
10065
135b9c78
ILT
100662010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10067 Ian Lance Taylor <iant@google.com>
10068
10069 * gold.cc (queue_middle_tasks): If no input files were opened,
10070 exit.
10071 * workqueue.h (Task_function::Task_function): Assert that there is
10072 a blocker.
10073
bb0bfe4f
DK
100742010-02-22 Doug Kwan <dougkwan@google.com>
10075
10076 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10077 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10078 types to avoid warnings due to different uint64_t implementations
10079 on different hosts.
10080
2a2b6d42
DK
100812010-02-21 Doug Kwan <dougkwan@google.com>
10082
10083 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10084 handling of the maximum backward branch offset.
2e702c99 10085 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10086 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10087 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10088 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10089 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10090 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10091 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10092 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10093 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10094 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10095 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10096 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10097 thumb2_bl_out_of_range.o): New rules.
10098 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10099 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10100 thumb2_bl_out_of_range
10101 * testsuite/Makefile.in: Regenerate.
10102 * testsuite/arm_bl_in_range.s: New file.
10103 * testsuite/arm_bl_out_of_range.s: Ditto.
10104 * testsuite/arm_branch_in_range.sh: Ditto.
10105 * testsuite/arm_branch_range.t: Ditto.
10106 * testsuite/thumb2_branch_range.t: Ditto.
10107 * testsuite/thumb_bl_in_range.s: Ditto.
10108 * testsuite/thumb_bl_out_of_range.s: Ditto.
10109 * testsuite/thumb_branch_range.t: Ditto.
10110
b487ad64
ST
101112010-02-20 Sriraman Tallam <tmsriram@google.com>
10112
10113 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10114 Add reloc offset information.
10115 * icf.cc (get_section_contents): Change iterators to point to the new
10116 vectors. Add reloc offset information to the contents.
10117 * icf.h (Icf::Sections_reachable_info): New typedef.
10118 (Icf::Sections_reachable_list): New typedef.
10119 (Icf::Offset_info): New typedef.
10120 (Icf::Reloc_info): New struct typedef.
10121 (Icf::Reloc_info_list): New typedef.
10122 (Icf::symbol_reloc_list): Delete method.
10123 (Icf::addend_reloc_list): Delete method.
10124 (Icf::section_reloc_list): Delete method.
10125 (Icf::reloc_info_list): New method.
10126 (Icf::reloc_info_list_): New member.
10127
f96accdf
DK
101282010-02-19 Doug Kwan <dougkwan@google.com>
10129
10130 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10131 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10132 * arm.cc (Arm_relocation_functions): New forward declaration.
10133 (Target_arm::Target_arm): Initialize new data members
10134 got_mod_index_offset_ and tls_base_symbol_defined_.
10135 (Target_arm::Relocate::relocate_tls): New method.
10136 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10137 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10138 New methods.
2e702c99 10139 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10140 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10141 (Target_arm::got_mod_index_offset_,
10142 Target_arm::tls_base_symbol_defined_): New data members.
10143 (Target_arm::Scan::local, Target::Scan::global,
10144 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10145 relocations.
10146
c8761b9a
DK
101472010-02-18 Doug Kwan <dougkwan@google.com>
10148
10149 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10150 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10151 text section as a parameter becuase some broken tools may not set
10152 the link in section header.
10153 (Target_arm::has_got_section): New method.
10154 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10155 without any mapping symbol as data only. Remove warning.
10156 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10157 link in its section header, try to discover the link by inspecting the
10158 REL31 relocation at the beginning of the section.
10159 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10160 in error message.
10161 (Target_arm::Scan::global): Treat any reference to the symbol
10162 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10163
21bb3914
ST
101642010-02-12 Sriraman Tallam <tmsriram@google.com>
10165
10166 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10167 (Scan::global_reloc_may_be_function_pointer): New function.
10168 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10169 (Scan::global_reloc_may_be_function_pointer): New function.
10170 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10171 (Scan::global_reloc_may_be_function_pointer): New function.
10172 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10173 (Scan::global_reloc_may_be_function_pointer): New function.
10174 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10175 (Scan::global_reloc_may_be_function_pointer): New function.
10176 (Scan::possible_function_pointer_reloc): New function.
10177 (Target_x86_64::can_check_for_function_pointers): New function.
10178 * gc.h (gc_process_relocs): Scan relocation types to determine if
10179 function pointers were taken for targets that support it.
10180 * icf.cc (Icf::find_identical_sections): Include functions for
10181 folding in safe ICF whose pointer is not taken.
10182 * icf.h (Secn_fptr_taken_set): New typedef.
10183 (fptr_section_id_): New member.
10184 (section_has_function_pointers): New function.
10185 (set_section_has_function_pointers): New function.
10186 (check_section_for_function_pointers): New function.
10187 * options.h: Fix comment for safe ICF option.
10188 * target.h (can_check_for_function_pointers): New function.
10189 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10190 Modify icf_safe_test for X86-64.
10191 * testsuite/Makefile.in: Regenerate.
10192 * testsuite/icf_safe_so_test.cc: New file.
10193 * testsuite/icf_safe_so_test.sh: New file.
10194 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10195 (main): Change to take pointer to function kept_func_3.
10196 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10197 folding is done correctly for X86-64.
10198
0da6fa6c
DM
101992010-02-12 David S. Miller <davem@davemloft.net>
10200
10201 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10202 is_symbolless parameter.
10203 (Output_reloc<SHT_REL>::is_symbolless): New.
10204 (Output_reloc<SHT_REL>::is_symbolless_): New.
10205 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10206 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10207 (Output_reloc<SHT_RELA>::is_symbolless): New.
10208 (Output_data_reloc::add_global): Handle is_symbolless.
10209 (Output_data_reloc::add_global_relative): Likewise.
10210 (Output_data_reloc::add_local): Likewise.
10211 (Output_data_reloc::add_local_relative): Likewise.
10212 (Output_data_reloc::add_symbolless_global_addend): New.
10213 (Output_data_reloc::add_symbolless_local_addend): New.
10214 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10215 is_symbolless.
10216 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10217 instead of ->is_relative_
10218 (Output_reloc::write): Likewise.
10219 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10220 (Output_reloc::write_rel): Simplify.
10221
10222 * sparc.cc (Target_sparc::Scan::local): Use
10223 ->add_symbolless_local_addend as needed.
10224 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10225 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10226 based upon relocation offset.
10227
e4782e83
DK
102282010-02-11 Doug Kwan <dougkwan@google.com>
10229
10230 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10231 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10232 beginning of function.
10233 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10234 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10235 parameter is_32bit in calls to should_apply_static_reloc.
10236 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10237 (check_DATA): Add arm_abs_global.stdout.
10238 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10239 arm_abs_global.stdout): New rules.
10240 (MOSTLLYCLEANFILES): Add arm_abs_global
10241 * Makefile.in: Regenerate.
10242 * testsuite/arm_abs_global.s: New file.
10243 * testsuite/arm_abs_global.sh: Ditto.
10244 * testsuite/arm_abs_lib.s: Ditto.
10245
93ceb764
ILT
102462010-02-11 Ian Lance Taylor <iant@google.com>
10247
10248 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10249 Read_relocs task.
10250 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10251 Allocate_commons_task first.
10252 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10253 task, rather than symtab_lock_.
10254 (Gc_process_relocs::~Gc_process_relocs): New function.
10255 (Gc_process_relocs::is_runnable): Check this_blocker_.
10256 (Gc_process_relocs::locks): Use next_blocker_ rather than
10257 blocker_.
10258 (Scan_relocs::~Scan_relocs): New function.
10259 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10260 symtab_lock_.
10261 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10262 next_blocker_.
10263 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10264 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10265 constructor accordingly.
10266 (class Gc_process_relocs): Likewise.
10267 (class Scan_relocs): Likewise.
10268 * common.h (class Allocate_commons_task): Remove symtab_lock_
10269 field, and corresponding constructor parameter.
10270 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10271 symtab_lock_.
10272 (Allocate_commons_task::locks): Likewise.
10273
114dfbe1
ILT
102742010-02-11 Ian Lance Taylor <iant@google.com>
10275
10276 * gold-threads.h (class Once): Define.
10277 (class Initialize_lock): Rewrite as child of Once.
10278 * gold-threads.cc (class Once_initialize): Define.
10279 (once_pointer_control): New static variable.
10280 (once_pointer, once_arg): New static variables.
10281 (c_run_once): New static function.
10282 (Once::Once, Once::run_once, Once::internal_run): New functions.
10283 (class Initialize_lock_once): Remove.
10284 (initialize_lock_control): Remove.
10285 (initialize_lock_pointer): Remove.
10286 (initialize_lock_once): Remove.
10287 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10288 (Initialize_lock::initialize): Rewrite.
10289 (Initialize_lock::do_run_once): New function.
10290 * archive.cc (Archive::interpret_header): Only clear name if it is
10291 not already empty.
10292 * fileread.cc: Include "gold-threads.h"
10293 (file_counts_lock): New static variable.
10294 (file_counts_initialize_lock): Likewise.
10295 (File_read::release): Only increment counts when using --stats.
10296 Use a lock around the increment.
10297 * parameters.cc (class Set_parameters_target_once): Define.
10298 (set_parameters_target_once): New static variable.
10299 (Parameters::Parameters): Move here from parameters.h.
10300 (Parameters::set_target): Rewrite.
10301 (Parameters::set_target_once): New function.
10302 (Parameters::clear_target): Move here and rewrite.
10303 * parameters.h (class Parameters): Update declarations. Add
10304 set_parameters_target_once_ field.
10305 (Parameters::Parameters): Move to parameters.cc.
10306 (Parameters::clear_target): Likewise.
10307 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10308 task.
10309 (Start_group::~Start_group): New function.
10310 (Start_group::is_runnable): New function.
10311 (Start_group::locks, Start_group::run): New functions.
10312 (Finish_group::run): Change saw_undefined to size_t.
10313 * readsyms.h (class Start_group): Define.
10314 (class Finish_group): Change saw_undefined_ field to size_t.
10315 (Finish_group::Finish_group): Remove saw_undefined and
10316 this_blocker parameters. Change all callers.
10317 (Finish_group::set_saw_undefined): New function.
10318 (Finish_group::set_blocker): New function.
10319 * symtab.h (class Symbol_table): Change saw_undefined to return
10320 size_t. Change saw_undefined_ field to size_t.
10321 * target-select.cc (Set_target_once::do_run_once): New function.
10322 (Target_selector::Target_selector): Initialize set_target_once_
10323 field. Don't initialize lock_ and initialize_lock_ fields.
10324 (Target_selector::instantiate_target): Rewrite.
10325 (Target_selector::set_target): New function.
10326 * target-select.h (class Set_target_once): Define.
10327 (class Target_selector): Update declarations. Make
10328 Set_target_once a friend. Remove lock_ and initialize_lock_
10329 fields. Add set_target_once_ field.
10330
fa17a3f4
ILT
103312010-02-10 Ian Lance Taylor <iant@google.com>
10332
10333 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10334 queueing any tasks.
10335 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10336 (queue_middle_tasks): Add all blockers before queueing any tasks.
10337 (queue_final_tasks): Likewise.
10338 * token.h (Task_token::add_blockers): New function.
10339 * object.h (Input_objects::number_of_relobjs): New function.
10340
c7177d31
ILT
103412010-02-10 Ian Lance Taylor <iant@google.com>
10342
5de0e392
ILT
10343 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10344 shared, not if not position independent.
10345 * x86_64.cc (Relocate::relocate_tls): Likewise.
10346 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10347 (tls_pie_pic_test): New target.
10348 * testsuite/Makefile.in: Rebuild.
10349
c7177d31
ILT
10350 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10351 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10352 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10353 * testsuite/Makefile.in: Rebuild.
10354
684b268a
DM
103552010-02-09 David S. Miller <davem@davemloft.net>
10356
10357 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10358 R_SPARC_RELATIVE using ->add_local_relative().
10359 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10360
612a8d3d
DM
10361 * output.h (Output_data_dynamic::add_section_size): New method
10362 that takes two Output_data objects.
10363 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10364 entry param. Handle it in initializers.
10365 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10366 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10367 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10368 arg.
10369 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10370 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10371 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10372 for dynrel_includes_plt.
10373 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10374 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10375 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10376 before .rela.plt
10377 (Target_sparc::do_finalize_sections): Update to pass true for
10378 dynrel_includes_plt.
10379 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10380 output before .rela.plt
10381 (Target_powerpc::do_finalize_sections): Update to pass true for
10382 dynrel_includes_plt when 32-bit.
10383
cb1be87e
DK
103842010-02-08 Doug Kwan <dougkwan@google.com>
10385
10386 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10387 method.
10388 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10389 Arm_relobj::scan_section_for_cortex_a8_stubs,
10390 Arm_relobj::do_relocation_section): Instead of calling
10391 Output_section::output_address, use faster
10392 Arm_relobj::simple_input_section_output_address.
10393
705b5121
DM
103942010-02-08 David S. Miller <davem@davemloft.net>
10395
10396 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10397 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10398 relocation helper function.
10399
024c4466
DM
10400 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10401 just like R_SPARC_GOT{10,13,22}.
10402 (Target_sparc::Scan::local): Likewise.
10403 (Target_sparc::Relocate:relocate): Likewise.
10404
9109c078
ILT
104052010-02-06 Ian Lance Taylor <iant@google.com>
10406
10407 * configure.ac: Rewrite targetobjs duplicate removal code to use
10408 only shell constructs.
10409 * configure: Rebuild.
10410
cf846138
DK
104112010-02-05 Doug Kwan <dougkwan@google.com>
10412
10413 PR 11247
10414 * arm.cc (Arm_relobj::section_is_scannable): New method.
10415 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10416 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10417
6cfaf60b
DK
104182010-02-04 Doug Kwan <dougkwan@google.com>
10419
10420 PR 11247
10421 * arm-reloc-property.cc (cstdio): Include.
10422 * configure.ac (targetobjs): Remove duplicates.
10423 * configure: Regenerate.
10424 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10425 big and little endian version for a given address size.
10426
5c57f1be
DK
104272010-02-03 Doug Kwan <dougkwan@google.com>
10428
10429 * arm-reloc-property.cc
10430 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10431 definition.
10432 * arm-reloc-property.h
10433 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10434 New method definition.
10435 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10436 declaration.
10437 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10438 overflow to N.
10439 (GOT_PREL): Change implemented to Y.
10440 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10441 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10442 (Arm_relocate_functions::movw_abs_nc): Remove method.
10443 (Arm_relocate_functions::movt_abs): Ditto.
10444 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10445 (Arm_relocate_functions::thm_movt_abs): Ditto.
10446 (Arm_relocate_functions::movw_rel_nc): Ditto.
10447 (Arm_relocate_functions::movw_rel): Ditto.
10448 (Arm_relocate_functions::movt_rel): Ditto.
10449 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10450 (Arm_relocate_functions:thm_movw_rel): Ditto.
10451 (Arm_relocate_functions:thm_movt_rel): Ditto.
10452 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10453 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10454 New method definitions.
10455 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10456 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10457 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10458 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10459 (Target_arm::Relocate::relocate): Check for non-static or
10460 unimplemented relocation code and exit early. Change calls to
10461 Target_arm::reloc_uses_thumb_bit and
10462 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10463 instead. Refactor code to handle similar relocations to increase
10464 code sharing. Remove check for unsupported relocation code in switch
10465 statement.
10466 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10467 relocation property table to find out size. Change error message to
10468 print out the name of a relocation code instead of the numeric value.
10469 (Target_arm::scan_reloc_for_stub): Use relocation property table
10470 instead of calling Target_arm::reloc_uses_thumb_bit().
10471
218c5831
DK
104722010-02-02 Doug Kwan <dougkwan@google.com>
10473
10474 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10475 types of relaxed input section.
10476
0d31c79d
DK
104772010-02-02 Doug Kwan <dougkwan@google.com>
10478
10479 * Makefile.am (HFILES): Add arm-reloc-property.h.
10480 (DEFFILES): New.
2e702c99
RM
10481 (TARGETSOURCES): Add arm-reloc-property.cc
10482 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10483 (libgold_a_SOURCES): $(DEFFILES)
10484 * Makefile.in: Regenerate.
10485 * arm-reloc-property.cc: New file.
10486 * arm-reloc-property.h: New file.
10487 * arm-reloc.def: New file.
10488 * arm.cc: Update comments.
10489 (arm-reloc-property.h): New included header.
10490 (arm_reloc_property_table): New global variable.
10491 (Target_arm::do_select_as_default_target): New method definition.
10492 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10493 arm-reloc-property to targ_extra_obj.
10494 * parameters.cc (set_parameters_target): Call
10495 Target::select_as_default_target().
10496 * target.h (Target::select_as_default_target): New method definition.
10497 (Target::do_select_as_default_target): Same.
10498
546c7457
DK
104992010-02-01 Doug Kwan <dougkwan@google.com>
10500
10501 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10502 first_output_text_section_.
10503 (Arm_exidx_fixup::first_output_text_section): New method definition.
10504 (Arm_exidx_fixup::first_output_text_section_): New data member.
10505 (Arm_exidx_fixup::process_exidx_section): Record the first text
10506 output section seen.
10507 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10508 and entsize in output section header.
10509
11b861d5
DK
105102010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10511
10512 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10513 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10514 (Arm_relocate_functions::thm_alu11): New Method.
10515 (Arm_relocate_functions::thm_pc8): New Method.
10516 (Arm_relocate_functions::thm_pc12): New Method.
10517 (Target_arm::Scan::local): Handle the relocations.
10518 (Target_arm::Scan::global): Likewise.
10519 (Target_arm::Relocate::relocate): Likewise.
10520 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10521
c9a2c125
DK
105222010-01-29 Doug Kwan <dougkwan@google.com>
10523
10524 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10525 of relocation types as ld.
10526
1521477a
DK
105272010-01-29 Doug Kwan <dougkwan@google.com>
10528
10529 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10530 to public.
10531 (Arm_relocate_functions::thumb_branch_common): Ditto.
10532 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10533 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10534 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10535 Arm_relocate_functions::jump24): Remove.
10536 (Target_arm::Relocate::relocate): Adjust code to call
10537 Arm_relocation_functions::arm_branch_common and
10538 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10539 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10540
e7eca48c
DK
105412010-01-29 Doug Kwan <dougkwan@google.com>
10542
10543 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10544 output_local_symbol_count_needs_update_.
10545 (Arm_relobj::output_local_symbol_count_needs_update,
10546 Arm_relobj::set_output_local_symbol_count_needs_update,
10547 Arm_relobj::update_output_local_symbol_count): New methods.
10548 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10549 member.
10550 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10551 of pointed function as in a R_ARM_PREL31 relocation.
10552 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10553 for output local symbol count updating.
10554 (Target_arm::do_relax): Update output local symbol counts in objects
10555 if necessary.
10556 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10557
02961d7e
ILT
105582010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10559
10560 * arm.cc: Added support for the ARM relocations:
10561 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10562 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10563 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10564 movw_prel_nc).
10565 (Arm_relocate_functions::movw_rel): New method.
10566 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10567 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10568 thm_movw_prel_nc).
10569 (Arm_relocate_functions::thm_movw_rel): New method.
10570 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10571 thm_movt_prel).
10572 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10573 relocations.
10574 (Target_arm::Scan::global): Likewise.
10575 (Target_arm::Relocate::relocate): Likewise.
10576 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10577 Likewise.
10578
b10d2873
ILT
105792010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10580
10581 * arm.cc: Added support for ARM group relocations.
10582 (Target_arm::reloc_needs_sym_origin): New method.
10583 (Arm_relocate_functions::calc_grp_kn): New method.
10584 (Arm_relocate_functions::calc_grp_residual): New method.
10585 (Arm_relocate_functions::calc_grp_gn): New method.
10586 (Arm_relocate_functions::arm_grp_alu): New Method.
10587 (Arm_relocate_functions::arm_grp_ldr): New Method.
10588 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10589 (Arm_relocate_functions::arm_grp_ldc): New Method.
10590 (Target_arm::Scan::local): Handle the ARM group relocations.
10591 (Target_arm::Scan::global): Likewise.
10592 (Target_arm::Relocate::relocate): Likewise.
10593 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10594 Likewise.
10595
2b328d4e
DK
105962010-01-26 Doug Kwan <dougkwan@google.com>
10597
10598 * arm.cc (set): Include.
10599 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10600 pointer type.
2e702c99 10601 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10602 (Arm_output_section::append_text_sections_to_list): New method.
10603 (Arm_output_section::fix_exidx_coverage): Ditto.
10604 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10605 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10606 Relobj::set_section_offset() instead of
10607 Sized_relobj::invalidate_section_offset().
2e702c99 10608 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10609 parameter for section headers. Ignore relocation sections for
10610 unallocated sections and EXIDX sections.
10611 (Target_arm::fix_exidx_coverage): New method.
10612 (Target_arm::output_section_address_less_than): New type.
10613 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10614 linked text section instead of the EXIDX section.
10615 (Arm_output_section::create_stub_group): Add an assertion to check
10616 that this is not an EXIDX output section.
10617 (Arm_output_section::append_text_sections_to_list): New method.
10618 (Arm_output_section::fix_exidx_coverage): Ditto.
10619 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10620 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10621 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10622 first pass.
10623 (Target_arm::fix_exidx_coverage): New method.
10624 * object.h (Relobj::set_output_section): New method.
10625 (Sized_relobj::invalidate_section_offset): Remove method.
10626 (Sized_relobj::do_invalidate_section_offset): Remove method.
10627 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10628
c7f3c371
DK
106292010-01-25 Doug Kwan <dougkwan@google.com>
10630
10631 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10632 Fix warning due to signed and unsigned comparison on a 32-bit host.
10633
8923b24c
DK
106342010-01-22 Doug Kwan <dougkwan@google.com>
10635
10636 * arm.cc (Target_arm::do_relax): Record an output section for section
10637 offset adjustment it contains any stub table that has changed.
10638 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10639 offsets in an output section if necessary.
10640 * output.cc (Output_section::Output_section): Initialize
10641 section_offsets_need_adjustments_.
10642 (Output_section::add_input_section_for_script): Renamed to
10643 Output_section::add_simple_input_section.
10644 (Output_section::save_states): Add a comment.
10645 (Output_section::discard_states): New method defintion.
10646 (Output_section::adjust_section_offsets): Same.
10647 * output.h (Output_section::add_input_section_for_script): Renamed to
10648 Output_section::add_simple_input_section.
10649 (Output_section::discard_states): New method declaration.
10650 (Output_section::adjust_section_offsets): Same.
10651 (Output_section::section_offsets_need_adjustment,
10652 Output_section::set_section_offsets_need_adjustment): New method
10653 definitions.
10654 (Output_section::section_offsets_need_adjustment_): New data member.
10655 * script-sections.cc
10656 (Output_section_element_input::set_section_address): Adjust code for
10657 renaming of Output_section::add_input_section_for_script.
10658 (Orphan_output_section::set_section_address): Same.
10659
9b2fd367
DK
106602010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10661
10662 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10663 Fix_v4bx enum values .
10664 * gold/options.h (General_options): New option definitions.
10665 (General_options::fix_v4bx): New method.
10666 (General_options::Fix_v4bx): New enum.
10667 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10668 (General_options::parse_fix_v4bx_interworking): New method.
10669
80d0d023
DK
106702010-01-22 Doug Kwan <dougkwan@google.com>
10671
10672 * arm.cc (Arm_exidx_fixup): New class.
10673
af2cdeae
DK
106742010-01-21 Doug Kwan <dougkwan@google.com>
10675
10676 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10677 classes.
10678 (Arm_exidx_section_offset_map): New type.
10679
993d07c1
DK
106802010-01-21 Doug Kwan <dougkwan@google.com>
10681
10682 * arm.cc (Arm_exidx_input_section): New class.
10683 (Arm_relobj::exidx_input_section_by_link,
10684 Arm_relobj::exidx_input_section_by_shndx,
10685 Arm_relobj::make_exidx_input_section): New methods.
10686 (read_arm_attributes_section): Remove.
10687 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10688 information about them.
10689 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10690 to here.
10691
5ac169d4
DK
106922010-01-20 Doug Kwan <dougkwan@google.com>
10693
10694 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10695 Input_section_specifier to Section_id.
10696 (Target_arm::new_arm_input_section: Adjust code for change of key
10697 type.
10698 (Target_arm::find_arm_input_section): Ditto.
10699 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10700 (Section_id): Remove.
10701 (Garbage_collection::Section_id_hash): Remove.
10702 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10703 (Section_id): Remove.
10704 (Icf::Section_id_hash): Remove.
10705 * object.h (Section_id, Const_section_id, Section_id_hash,
10706 Const_section_id_hash): New type definitions.
10707 * output.cc (Output_section::add_relaxed_input_section): Change to
10708 use Const_section_id instead of Input_section_specifier as key type.
10709 (Output_section::add_merge_input_section): Ditto.
10710 (Output_section::build_relaxation_map): Change to use Section_id
10711 instead of Input_section_specifier as key type.
2e702c99 10712 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10713 Ditto.
10714 (Output_section::convert_input_sections_to_relaxed_sections): Change
10715 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10716 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10717 (Output_section::find_relaxed_input_section): Ditto.
10718 * output.h (Input_section_specifier): Remove class.
10719 (Output_section::Output_section_data_by_input_section_map): Change
10720 key type to Const_section_id.
10721 (Output_section::Output_relaxed_input_section_by_input_section_map):
10722 Ditto.
10723 (Output_section::Relaxation_map): Change key type to Section_id.
10724
a2162063
ILT
107252010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10726
10727 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10728 (class Arm_v4bx_stub): New class.
10729 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10730 (Stub_factory::make_arm_v4bx_stub): New method.
10731 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10732 (Stub_table::empty): Handle v4bx stubs.
10733 (Stub_table::add_arm_v4bx_stub): New method.
10734 (Stub_table::find_arm_v4bx_stub): New method.
10735 (Arm_relocate_functions::v4bx): New method.
10736 (Target_arm::fix_v4bx): New method.
10737 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10738 (Stub_table::relocate_stubs): Likewise.
10739 (Stub_table::do_write): Likewise.
10740 (Stub_table::update_data_size_and_addralign): Likewise.
10741 (Stub_table::finalize_stubs): Likewise.
10742 (Target_arm::Scan::local): Likewise.
10743 (Target_arm::Scan::global): Likewise.
10744 (Target_arm::do_finalize_sections): Likewise.
10745 (Target_arm::Relocate::relocate): Likewise.
10746 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10747 Likewise.
10748 (Target_arm::scan_reloc_for_stub): Likewise.
10749 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10750
5696ab0b
ILT
107512010-01-19 Ian Lance Taylor <iant@google.com>
10752
10753 * output.cc (Output_section_headers::do_sized_write): Write large
10754 segment count to sh_info field.
10755 (Output_file_header::do_sized_write): For large segment count,
10756 write PN_XNUM to e_phnum field.
10757
800d0f56
ILT
107582010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10759
10760 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10761 (Arm_relocate_functions::thm_jump8): New function.
10762 (Arm_relocate_functions::thm_jump11): New function.
10763 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10764 R_ARM_THM_JUMP11.
10765 (Target_arm::Scan::global): Likewise.
10766 (Target_arm::Relocate::relocate): Likewise.
10767 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10768 Likewise.
10769
41263c05
DK
107702010-01-14 Doug Kwan <dougkwan@google.com>
10771
10772 * arm.cc (map, utility): Include headers.
10773 (Target_arm::apply_cortex_a8_workaround): New method.
10774 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10775 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10776 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10777 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10778 the --[no-]fix-cortex-a8 command line options.
10779 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10780 (Target_arm::relocate_stub): Use addend in instruction template.
10781 * options.h (DEFINE_bool): Set the user-set flag.
10782 (General_options): Add --[no-]-fix-cortex options.
10783 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10784 : Update fast look-up map after conversion.
41263c05 10785
459e9b03
ST
107862010-01-14 Sriraman Tallam <tmsriram@google.com>
10787
10788 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10789 in the first pass of do_layout.
10790
b521dfe4
DK
107912010-01-13 Doug Kwan <dougkwan@google.com>
10792
10793 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10794 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10795 apparent compiler problem of not folding static constant integral
10796 data members of elfcpp::Elf_sizes<32>.
10797
44272192
DK
107982010-01-13 Doug Kwan <dougkwan@google.com>
10799
10800 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10801 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10802 Arm_relobj::scan_section_for_cortex_a8_erratum,
10803 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10804 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10805 sections to scan for relocation stubs into a new method
10806 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10807 relocation and Cortex-A8 stub scanning.
10808 (Target_arm::do_relax): Force stubs to be after stubbed sections
10809 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10810 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10811 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10812
44b71ece
ILT
108132010-01-12 Ian Lance Taylor <iant@google.com>
10814
10815 * target-reloc.h (visibility_error): New inline function.
10816 (relocate_section): Call visibility_error.
10817 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10818 (MOSTLYCLEANFILES): Likewise.
10819 (protected_4_pic.o, protected_3.err): New targets.
10820 * testsuite/protected_4.cc: New file.
10821
a120bc7f
DK
108222010-01-12 Doug Kwan <dougkwan@google.com>
10823
10824 * arm.cc (Cortex_a8_reloc): New class.
10825 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10826 and cortex_a8_relocs_info_.
10827 (Target_arm::fix_cortex_a8): New method definition.
10828 (Target_arm::Cortex_a8_relocs_info): New type.
10829 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10830 New data member declarations.
10831 (Target_arm::scan_reloc_for_stub): Record information about
10832 relocations for THUMB branches that might be exempted from the
10833 Cortex-A8 workaround.
10834 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10835 at the beginning of a relaxation pass.
10836
20138696
DK
108372010-01-12 Doug Kwan <dougkwan@google.com>
10838
10839 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10840 (Arm_relobj::Mapping_symbol_position,
10841 Arm_reloj::Mapping_symbol_position_less,
10842 Arm_relobj::Mapping_symbols_info): New types.
10843 (Target_arm::is_mapping_symbol_name): New method definition.
10844 (Arm_relobj::do_count_local_symbols): Save information about mapping
10845 symbols.
10846
089d69dc
DK
108472010-01-11 Doug Kwan <dougkwan@google.com>
10848
10849 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10850 Arm_relocate_functions::thumb32_branch_upper,
10851 Arm_relocate_functions::thumb32_branch_lower,
10852 Arm_relocate_functions::thumb32_cond_branch_offset,
10853 Arm_relocate_functions::thumb32_cond_branch_upper,
10854 Arm_relocate_functions::thumb32_cond_branch_lower,
10855 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10856 branch offset encoding.
10857 (Arm_relocate_functions::thumb_branch_common): Use new branch
10858 offset encoding methods to avoid code duplication.
10859 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10860 (Stub_addend_reader::operator()): Use new branch encoding method
10861 to avoid code duplication.
10862
99e5bff2
DK
108632010-01-11 Doug Kwan <dougkwan@google.com>
10864
10865 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10866 (Target_arm::do_finalize_sections): Define special EXIDX section
10867 symbols only if referenced.
10868 * gc.h (Garbage_collection::add_reference): New method.
10869 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10870 code duplication.
10871
98e090bd
ILT
108722010-01-11 Ian Lance Taylor <iant@google.com>
10873
d0a91bd8
ILT
10874 * script.cc (Version_script_info::build_expression_list_lookup):
10875 Change complaing about duplicate wildcard match from error to
10876 warning.
10877
98e090bd
ILT
10878 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10879 of 2009-12-30.
10880 (Version_script_info::Version_script_info): Initialize globs_,
10881 default_version_, default_is_global_, and exact_. Don't
10882 initialize globals_ or locals_.
10883 (Version_script_info::build_lookup_tables): Build local symbols
10884 first.
10885 (Version_script_info::unquote): New function.
10886 (Version_script_info::add_exact_match): New function.
10887 (Version_script_info::build_expression_list_lookup): Remove lookup
10888 parameter. Add is_global parameter. Change all callers. Handle
10889 wildcard pattern specially. Unquote pattern. Call
10890 add_exact_match.
10891 (Version_script_info::get_name_to_match): New function.
10892 (Version_script_info::get_symbol_version): New function.
10893 (Version_script_info::get_symbol_version_helper): Remove.
10894 (Version_script_info::check_unmatched_names): Call unquote.
10895 * script.h (class Version_script_info): Change get_symbol_version
10896 to be non-inline and add is_global parameter; change all callers.
10897 Rewrite symbol_is_local. Update declarations. Define struct
10898 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10899 Remove globals_ and locals_ members. Add exact_, globs_,
10900 default_version_, is_global_.
10901 (Version_script_info::Glob): Remove pattern, add expression and
10902 is_global. Update constructor. Change all callers.
10903 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10904 default version.
10905 (Versions::symbol_section_contents): If a symbol is undefined, or
10906 defined in a dynamic object, set the version index to
10907 VER_NDX_LOCAL.
10908 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10909 symbol_is_local.
10910 (Symbol_table::add_from_pluginobj): Likewise.
10911 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10912
d56962d3
DK
109132010-01-11 Doug Kwan <dougkwan@google.com>
10914
10915 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10916 (incremental_dump_LDADD): Add linking option for libintl.
10917 * Makefile.in: Regenerate.
10918
94e6ee91
L
109192010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10920
10921 PR gold/11144
10922 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10923 instead of -Ds.
10924 * testsuite/Makefile.in: Regenerated.
10925
e96c574b
DK
109262010-01-10 Doug Kwan <dougkwan@google.com>
10927
10928 * options.h (DEFINE_var): Use parentheses around argument varname__
10929 in macro body to avoid any unintended subsequent substitutions.
10930
7198066b
ILT
109312010-01-10 Ian Lance Taylor <iant@google.com>
10932
ba4d53bf
ILT
10933 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10934 candidates before doing symbol resolution.
10935
7198066b
ILT
10936 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10937 ODR candidates if only one is weak.
10938
a2beed37
ILT
109392010-01-08 Ian Lance Taylor <iant@google.com>
10940
10941 * script.cc (Version_script_info::build_expression_list_lookup):
10942 Don't warn about ambiguous version, just record the ambiguity.
10943 (Version_script_info::get_symbol_version_helper): Give error if
10944 version is ambiguous.
10945
2fb7225c
DK
109462010-01-08 Doug Kwan <dougkwan@google.com>
10947
10948 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10949 prev_data_size_ and prev_addralign_. Remove initializer for
10950 deleted data member has_been_changed_.
10951 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10952 to determine if the table is empty.
10953 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10954 Remove.
10955 (Stub_table::add_reloc_stub): Define method in class definition
10956 instead of just declaring it there.
10957 (Stub_table::add_cortex_a8_stub): New method definition.
10958 (Stub_table::update_data_size_and_addralign): Ditto.
10959 (Stub_table::finalize_stubs): Ditto.
10960 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10961 (Stub_table::do_addralign_): Return address alignment in the
10962 (Stub_table::do_reset_address_and_file_offset): Define method in
10963 class definition instead of declaring it there. Set current data
10964 size to be the data size of the previous pass.
10965 (Stub_table::set_final_data_size): Use current data size as the
10966 final data size.
10967 (Stub_table::relocate_stub): Change parameter type of stub from
10968 Reloc_stub pointer to Stub pointer.
10969 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10970 (Stub_table::Cortex_a8_stub_list): New typedef.
10971 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10972 Stub_table::prev_addralign_): New data member.
10973 (Arm_relobj::Arm_relobj): Initialize data member
10974 section_has_cortex_a8_workaround_.
10975 (Arm_relobj::section_has_cortex_a8_workaround,
10976 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10977 definitions.
10978 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10979 declarations.
10980 (Target_arm::relocate_stub): Change parameter type of stub from
10981 Reloc_stub pointer to Stub pointer.
10982 (Insn_template::size, Insn_template::alignment): Handle
10983 THUMB16_SPECIAL_TYPE.
10984 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10985 Stub_table::update_data_size_and_addralign,
10986 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10987 definitions.
10988 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10989 (Stub_table::do_write): Ditto.
10990 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10991
880cd20d
ILT
109922010-01-08 Ian Lance Taylor <iant@google.com>
10993
10994 PR 11108
10995 * symtab.h (class Symbol): Remove fields is_target_special_ and
10996 has_plt_offset_. Add field is_defined_in_discarded_section_.
10997 (Symbol::is_defined_in_discarded_section): New function.
10998 (Symbol::set_is_defined_in_discarded_section): New function.
10999 (Symbol::has_plt_offset): Rewrite.
11000 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11001 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11002 Don't initialize is_target_special_ or has_plt_offset_.
11003 Initialize is_defined_in_discarded_section_.
11004 (Symbol_table::add_from_relobj): If appropriate, set
11005 is_defined_in_discarded_section.
11006 * resolve.cc (Symbol::override_base_with_special): Don't test
11007 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11008 * target-reloc.h (relocate_section): Do special handling for
11009 symbols defined in discarded sections for global symbols as well
11010 as local symbols.
11011
2703e3eb
ILT
110122010-01-08 Ian Lance Taylor <iant@google.com>
11013
11014 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11015 the SHT_SYMTAB case.
11016
339d40a3
ILT
110172010-01-08 Ian Lance Taylor <iant@google.com>
11018
11019 * object.cc (Sized_relobj::do_layout): Don't get confused if
11020 layout_eh_frame returns NULL.
11021
abecea76
ILT
110222010-01-08 Ian Lance Taylor <iant@google.com>
11023
11024 PR 11084
11025 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11026 dynamic symbol table, use the normal symbol table.
11027 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11028 symbol table.
11029
6b7dd3f3
ILT
110302010-01-08 Ian Lance Taylor <iant@google.com>
11031
11032 PR 11072
11033 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11034 sections.
11035
36c50e63
L
110362010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11037
11038 * version.cc (print_version): Change to "Copyright 2010".
11039
e291e7b9
ILT
110402010-01-08 Ian Lance Taylor <iant@google.com>
11041
11042 PR 10287
11043 PR 11063
11044 * i386.cc (class Target_i386): Change return type of plt_section
11045 to be non-const.
11046 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11047 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11048 tls_desc_rel_ field.
11049 (Output_data_plt_i386::rel_tls_desc): New function.
11050 (Target_i386::rel_tls_desc_section): New function.
11051 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11052 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11053 R_386_TLS_DESC reloc in rel_tls_desc_section.
11054 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11055 Define struct Tlsdesc_info.
11056 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11057 (Target_x86_64::do_reloc_symbol_index): New function.
11058 (Target_x86_64::add_tlsdesc_info): New function.
11059 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11060 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11061 tlsdesc_rel_ field.
11062 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11063 all callers.
11064 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11065 (Target_x86_64::rela_tlsdesc_section): New function.
11066 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11067 handling.
11068 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11069 (Target_x86_64::do_reloc_addend): New function.
11070 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11071 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11072 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11073 (Output_reloc::type): New function.
11074 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11075 (Output_reloc::is_target_specific): New function.
11076 (Output_reloc::target_arg): New function.
11077 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11078 absolute relocs and target specific relocs.
11079 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11080 add_target_specific.
11081 (class Output_data_reloc) [SHT_RELA]: Likewise.
11082 * output.cc (Output_reloc::Output_reloc): Add four new versions
11083 for absolute relocs and target specific relocs.
11084 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11085 (Output_reloc::get_symbol_index): Likewise.
11086 (Output_reloc::local_section_offset): Check that local_sym_index_
11087 is not TARGET_CODE or 0.
11088 (Output_reloc::symbol_value): Likewise.
11089 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11090 reloc.
11091 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11092 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11093 functions.
11094 * layout.cc (add_target_dynamic_tags): Use output section for
11095 DT_PLTRELSZ and DT_JMPREL.
11096
3a44184e
ILT
110972010-01-07 Ian Lance Taylor <iant@google.com>
11098
11099 PR 11061
11100 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11101 function.
11102 (class Output_data_reloc_generic): Define.
11103 (class Output_data_reloc_base): Change base class to
11104 Output_data_reloc_generic. Change add() method to call
11105 bump_relative_reloc_count for a relative reloc. Remove
11106 sort_relocs_ field.
11107 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11108 to sort_relocs().
11109 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11110 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11111 appropriate.
11112 * layout.h (class Layout): Update declaration.
11113
ea715a34
ILT
111142010-01-07 Ian Lance Taylor <iant@google.com>
11115
11116 * output.h (class Output_data): Add const version of
11117 output_section and do_output_section.
11118 (class Output_section_data): Add const version of
11119 do_output_section.
11120 (class Output_section): Likewise.
11121 * layout.cc (Layout::add_target_dynamic_tags): New function.
11122 * layout.h (class Layout): Update declarations.
11123 * arm.cc (Target_arm::do_finalize_sections): Use
11124 add_target_dynamic_tags.
11125 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11126 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11127 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11128 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11129
659948a4
ILT
111302010-01-07 Ian Lance Taylor <iant@google.com>
11131
11132 PR 11042
11133 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11134 object as needed.
11135
9d3b86f6
ILT
111362010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11137 Ian Lance Taylor <iant@google.com>
11138
11139 PR 11019
11140 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11141 Xindex::read_symtab_xindex.
11142
bb0d3eb0
DK
111432010-01-07 Doug Kwan <dougkwan@google.com>
11144
11145 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11146 (Insn_template::thumb16_bcond_insn): New method declaration.
11147 (Insn_template): Fix spelling.
11148 (Stub::thumb16_special): New method declaration.
11149 (Stub::do_write): Define virtual method which was previously pure
11150 virtual.
11151 (Stub::do_thumb16_special): New method declaration.
11152 (Stub::do_fixed_endian_write): New template member.
11153 (Reloc_stub::do_write): Remove.
11154 (Reloc_stub::do_fixed_endian_write): Remove.
11155 (Cortex_a8_stub): New class definition.
11156 (Stub_factory::make_cortex_a8_stub): New method definition.
11157 (Stub_factory::Stub_factory): Add missing static storage class
11158 qualifier for elf32_arm_stub_a8_veneer_blx.
11159
ffeef7df
ILT
111602010-01-07 Ian Lance Taylor <iant@google.com>
11161
dc3f80fe
ILT
11162 PR 10980
11163 * options.h (class General_options): Add --warn-unresolved-symbols
11164 and --error-unresolved-symbols.
11165 * errors.cc (Errors::undefined_symbol): Implement
11166 --warn-unresolved-symbols.
11167
ffeef7df
ILT
11168 * options.h (class General_options): Add -z text and -z textoff.
11169 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11170
f1ec9ded
ST
111712010-01-06 Sriraman Tallam <tmsriram@google.com>
11172
11173 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11174 (Garbage_collection::cident_sections): New function.
11175 (Garbage_collection::add_cident_section): New function.
11176 (Garbage_collection::cident_sections_): New member.
11177 (gc_process_relocs): Add references to sections whose names are C
11178 identifiers.
11179 * gold.h (cident_section_start_prefix): New constant.
11180 (cident_section_stop_prefix): New constant.
11181 (is_cident): New function.
11182 * layout.cc (Layout::define_section_symbols): Replace string constants
11183 with the newly defined constants.
11184 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11185 C identifiers.
11186 * testsuite/Makefile.am: Add gc_orphan_section_test.
11187 * testsuite/Makefile.in: Regenerate.
11188 * testsuite/gc_orphan_section_test.cc: New file.
11189 * testsuite/gc_orphan_section_test.sh: New file.
11190
6eda8c29
ILT
111912010-01-06 Ian Lance Taylor <iant@google.com>
11192
b9674e17
ILT
11193 PR 10980
11194 * options.h (class General_options): Add --warn-shared-textrel.
11195 * layout.cc (Layout::finish_dynamic_section): Implement
11196 --warn-shared-textrel.
11197
6eda8c29
ILT
11198 PR 10980
11199 * options.h (class General_options): Add --warn-multiple-gp.
11200
32dcd44e
ILT
112012010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11202
11203 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11204 $(THREADSLIB) and $(LIBDL).
11205 * Makefile.in: Rebuild.
11206
a192ba05
ILT
112072010-01-06 Ian Lance Taylor <iant@google.com>
11208
11209 PR 10980
11210 * options.cc (General_options::parse_section_start): New function.
11211 (General_options::section_start): New function.
11212 (General_options::General_options): Initialize all members.
11213 * options.h: Include <map>
11214 (class General_options): Add --section-start. Add section_starts_
11215 member.
11216 * layout.cc (Layout::attach_allocated_section_to_segment): If
11217 --section-start was used, set the address of the segment. Remove
11218 local sort_sections.
11219 (Layout::relaxation_loop_body): If the address of the load segment
11220 has been set by --section-start, don't use it.
11221 * output.h (Output_segment::update_flags_for_output_section): New
11222 function.
11223 * output.cc (Output_segment::add_output_section): Call
11224 update_flags_for_output_section.
11225
dde3f402
ILT
112262010-01-05 Ian Lance Taylor <iant@google.com>
11227
62dfdd4d
ILT
11228 PR 10980
11229 * options.h (class General_options): Add --undefined-version.
11230 * script.cc (struct Version_expression): Add was_matched_by_symbol
11231 field.
11232 (Version_script_info::matched_symbol): New function.
11233 (Version_script_info::get_symbol_version_helper): Call
11234 matched_symbol.
11235 (Version_script_info::check_unmatched_names): New function.
11236 * script.h (class Version_script_info): Update declarations.
11237 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11238
9c4ae156
ILT
11239 * options.h (class General_options): Use DEFINE_bool_alias for
11240 allow_multiple_definition.
11241 * resolve.cc (Symbol_table::should_override): Don't test
11242 allow_multiple_definition.
11243
dde3f402
ILT
11244 PR 10980
11245 * options.h (class General_options): Add --cref.
11246 * main.cc (main): Print cref table if --cref. Don't close mapfile
11247 until after printing cref table.
11248 * cref.cc: Include "symtab.h".
11249 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11250 (Cref_table_compare::operator()): New function.
11251 (Cref_inputs::gather_cref): New function.
11252 (filecol): New static const.
11253 (Cref_inputs::print_cref): New function.
11254 (Cref::print_cref): New function.
11255 * cref.h: Include <cstdio>.
11256 (class Cref): Update declarations.
11257 * mapfile.h (Mapfile::file): New function.
11258 * object.h (class Object): Define Symbols. Declare virtual
11259 do_get_global_symbols.
11260 (Object::get_global_symbols): New function.
11261 * object.cc (Input_objects::add_object): Pass object to cref_ if
11262 --cref.
11263 (Input_objects::archive_start): Likewise.
11264 (Input_objects::archive_stop): Likewise.
11265 (Input_objects::print_cref): New function.
11266 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11267 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11268 --cref.
11269 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11270 function.
11271 * plugin.h (class Sized_pluginobj): Update declarations.
11272
8781f709
ILT
112732010-01-05 Ian Lance Taylor <iant@google.com>
11274
11275 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11276 to is_default_version. Rename insdef to insdefault.
11277 (Symbol_table::add_from_relobj): Rename def to is_default_version
11278 and local to is_forced_local.
11279 (Symbol_table::add_from_pluginobj): Likewise.
11280 (Symbol_table::add_from_dynobj): Likewise.
11281 (Symbol_table::define_special_symbol): Rename insdef to
11282 insdefault.
11283
fe35d28d
ILT
112842010-01-04 Ian Lance Taylor <iant@google.com>
11285
30bc8c46
ILT
11286 PR 10980
11287 * options.h (class General_options): Add
11288 --allow-multiple-definition and -z muldefs.
11289 * resolve.cc (Symbol_table::should_override): Don't warn about a
11290 multiple symbol definition if --allow-multiple-definition or -z
11291 muldefs.
11292
7eaea549
ILT
11293 PR 10980
11294 * options.h (class General_options): Add --add-needed and
11295 --copy-dt-needed-entries. Tweak --as-needed help entry.
11296 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11297 error if --copy-dt-needed-entries aka --add-needed is used and
11298 would cause a change in behaviour.
11299
fe35d28d
ILT
11300 PR 10980
11301 * options.h (class General_options): Add -G as a short version of
11302 --shared. Add no-op options -assert, -g, and -i.
11303
55a2bb35
ST
113042010-01-04 Sriraman Tallam <tmsriram@google.com>
11305
11306 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11307 check for .text or .gnu.linkonce.t sections.
11308 * icf.cc (Icf::find_identical_sections): Ditto.
11309 Change the detection for mangled function name within the section
11310 name.
11311 * icf.h (is_section_foldable_candidate): New function.
11312
719328e1
ILT
113132009-12-30 Ian Lance Taylor <iant@google.com>
11314
11315 PR 10980
11316 * options.h (class General_options): Permit two dashes with
11317 --retain-symbols-file.
11318
d7bb5745
ILT
113192009-12-30 Ian Lance Taylor <iant@google.com>
11320
403a15dd
ILT
11321 PR 10979
11322 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11323 don't put the file header and segment headers in the text
11324 segment.
11325
eda294df
ILT
11326 PR 10979
11327 * common.cc (Sort_commons::operator()): Stabilize sort when both
11328 entries are NULL.
11329 (Symbol_table::do_allocate_commons_list): When allocating common
11330 symbols, skip a symbol which is no longer common.
11331 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11332 an object before checking its type.
11333 * testsuite/common_test_2.c: New file.
11334 * testsuite/common_test_3.c: New file.
11335 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11336 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11337 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11338 (common_test_2_pic.o, common_test_2.so): New targets.
11339 (common_test_3_pic.o, common_test_3.so): New targets.
11340 * testsuite/Makefile.in: Rebuild.
11341
d7bb5745
ILT
11342 PR 10979
11343 * script.cc (read_input_script): If we see a new SECTIONS clause,
11344 and we have added an input section, give an error.
11345 * layout.h (class Layout): Add have_added_input_section function.
11346 Add have_added_input_section_ field.
11347 * layout.cc (Layout::Layout): Initialize
11348 have_added_input_section_.
11349 (Layout::layout): Set have_added_input_section_.
11350 (Layout::layout_eh_frame): Likewise.
11351
fc59c572
ILT
113522009-12-30 Ian Lance Taylor <iant@google.com>
11353
11354 PR 10931
11355 * options.h (class General_options): Add --sort-common option.
11356 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11357 * common.cc (Sort_common): Add sort_order parameter to
11358 constructor. Add sort_order_ field.
11359 (Sort_commons::operator): Check sort_order_.
11360 (Symbol_table::allocate_commons): Determine the sort order.
11361 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11362 Change all callers.
11363 (Symbol_table::do_allocate_commons_list): Likewise.
11364
1c74fab0
ILT
113652009-12-30 Ian Lance Taylor <iant@google.com>
11366
11367 PR 10916
11368 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11369 symbols from this object, don't change the visibility of an
11370 undefined symbol.
11371 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11372
6affe781
ILT
113732009-12-30 Ian Lance Taylor <iant@google.com>
11374
11375 PR 10861
11376 * script.h (class Version_script_info): Define Language enum.
11377 Update declarations. Define Glob, Exact, and Lookup types. Add
11378 new fields globals_, locals_, and is_finalized_.
11379 * script.cc: Various formatting fixes.
11380 (class Parser_closure): Change language_stack_ from a vector of
11381 std::string to one of Version_script_info::Language. Adjust all
11382 uses accordingly.
11383 (class Lazy_demangler): Remove.
11384 (struct Version_expression): Change language from std::string to
11385 Version_script_info::Language.
11386 (Version_script_info::Version_script_info): New function.
11387 (Version_script_info::~Version_script_info): Don't call clear.
11388 (Version_script_info::finalize): New function.
11389 (Version_script_info::build_lookup_tables): New function.
11390 (Version_script_info::build_expression_list_lookup): New
11391 function.
11392 (Version_script_info::get_symbol_version_helper): Rewrite to use
11393 lookup tables.
11394 (Version_script_info::print_expression_list): Adjust to use
11395 Version_script_info::Language.
11396 (script_push_lex_into_version_mode): Check that the version script
11397 has not been finalized.
11398 (version_script_push_lang): Change language string to
11399 Version_script_info::Language.
11400 * options.cc (Command_line::version_script): New function.
11401 * options.h (class General_options): Add finalize_dynamic_list
11402 function. Change version_script from declaration to definition.
11403 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11404 * testsuite/version_script.map: Remove duplicate def of foo.
11405 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11406 version_script.map.
11407 * testsuite/Makefile.in: Rebuild.
11408
818bf354
ILT
114092009-12-30 Ian Lance Taylor <iant@google.com>
11410
11411 PR 10843
11412 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11413 if the input symbol index is 0, make the output symbol index 0.
11414
ebcc8304
ILT
114152009-12-30 Ian Lance Taylor <iant@google.com>
11416
11417 PR 10670
11418 * options.h (class General_options): Add -x/--discard-all.
11419 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11420 --discard-all. If the local symbol needs a dynamic entry, check
11421 that before handling --discard-locals.
11422
176fe33f
ILT
114232009-12-30 Ian Lance Taylor <iant@google.com>
11424
bb321bb1
ILT
11425 PR 10450
11426 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11427 flags to PF_R.
11428 (Output_segment::add_output_section): Don't change the flags if
11429 the type is PT_TLS.
11430
176fe33f
ILT
11431 PR 10450
11432 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11433 GNU hash table if they need a dynamic value. Otherwise, don't add
11434 them if they are defined in a dynamic object or are forced local.
11435
e8cd95c7
ILT
114362009-12-29 Ian Lance Taylor <iant@google.com>
11437
1b81fb71
ILT
11438 PR 10450
11439 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11440 .gnu.hash table for a 32-bit target.
11441
8d6d383d
ILT
11442 PR 10450
11443 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11444 regular and a dynamic object only needs a dynamic symbol table
11445 entry if it is externally visible.
11446
e785ec03
ILT
11447 PR 10450
11448 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11449 constructor. Add global_offset_table_ field.
11450 (Target_i386::got_section): Set global_offset_table_.
11451 (Target_i386::do_finalize_sections): Set global_offset_table_
11452 size.
11453 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11454 in constructor. Add global_offset_table_ field.
11455 (Target_x86_64::got_section): Set global_offset_table_.
11456 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11457 size.
11458
1a2dff53
ILT
11459 * layout.cc (Layout::Layout): Initialize increase_relro_.
11460 (Layout::get_output_section): Add is_relro, is_last_relro, and
11461 is_first_non_relro parameters. Change all callers.
11462 (Layout::choose_output_section): Likewise.
11463 (Layout::add_output_section_data): Likewise.
11464 (Layout::make_output_section): Likewise.
11465 (Layout::set_segment_offsets): Clear increase_relro when using a
11466 linker script.
11467 * layout.h (class Layout): Add increase_relro method. Add
11468 increase_relro_ field. Update declarations.
11469 * output.cc (Output_section::Output_section): Initialize
11470 is_last_relro_ and is_first_non_relro_.
11471 (Output_segment::add_output_section): Group relro sections is
11472 do_sort is true. Handle is_last_relro and is_first_non_relro.
11473 (Output_segment::maximum_alignment): Remove relro handling.
11474 (Output_segment::set_section_addresses): Add increase_relro
11475 parameter. Change all callers. Add initial alignment to align
11476 relro sections on separate page. Remove old relro handling.
11477 (Output_segment::set_section_list_addresses): Remove in_relro
11478 parameter. Change all callers.
11479 (Output_segment::set_offset): Add increase parameter. Change all
11480 callers. Remove old relro handling.
11481 * output.h (class Output_section): Add new methods: is_last_relro,
11482 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11483 Add is_last_relro_ and is_first_non_relro_ fields.
11484 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11485 Create separate .got.plt section. Call increase_relro.
11486 * x86_64.cc (Target_x86_64::got_section): Likewise.
11487 * testsuite/relro_script_test.t: Add .got.plt.
11488
f0ba79e2
ILT
11489 PR 10450
11490 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11491 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11492 (Layout::finalize): Call set_dynamic_symbol_size.
11493 (Layout::set_dynamic_symbol_size): New function.
11494 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11495 set_dynamic_symbol_size.
11496
e8cd95c7
ILT
11497 PR 10450
11498 * output.h (class Output_section): Add is_entsize_zero_ field.
11499 * output.cc (Output_section::Output_section): Initialize
11500 is_entsize_zero_.
11501 (Output_section::set_entsize): If two different entsizes are
11502 requested, force it to zero.
11503 (Output_section::add_input_section): Set flags for .debug_str
11504 before updating section flags. Set entsize.
11505 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11506 and SHF_STRING if all input sections have those flags.
11507
3e1b9a8a
RÁE
115082009-12-29 Rafael Espindola <espindola@google.com>
11509
11510 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11511 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11512 reporting.
3e1b9a8a 11513
3dcad376
ST
115142009-12-29 Sriraman Tallam <tmsriram@google.com>
11515
11516 * options.cc (General_options::parse_version): Allow -v to exit
11517 without an error if there is nothing to link.
11518
084e2665
ILT
115192009-12-29 Ian Lance Taylor <iant@google.com>
11520
11521 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11522 using a version of gcc before 4.1.
11523 * configure: Rebuild.
11524
250acde3
CD
115252009-12-28 Chris Demetriou <cgd@google.com>
11526
11527 * attributes.cc (Output_attributes_section_data::do_write): Use
11528 std::vector::front rather than std::vector::data.
11529
99fff23b
ILT
115302009-12-28 Ian Lance Taylor <iant@google.com>
11531
11532 * symtab.h (class Symbol_table): Add enum Defined.
11533 * resolve.cc (Symbol_table::should_override): Add defined
11534 parameter. Change all callers. Test whether object is NULL
11535 before calling a method on it.
11536 (Symbol_table::report_resolve_problem): Add defined parameter.
11537 Change all callers.
11538 (Symbol_table::should_override_with_special): Likewise.
11539 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11540 parameter. Change all callers.
11541 (Symbol_table::do_define_in_output_data): Likewise.
11542 (Symbol_table::define_in_output_segment): Likewise.
11543 (Symbol_table::do_define_in_output_segment): Likewise.
11544 (Symbol_table::define_as_constant): Likewise.
11545 (Symbol_table::do_define_as_constant): Likewise.
11546 * script.h (class Symbol_assignment): Add is_defsym parameter to
11547 constructor; change all callers.
11548 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11549 parameter. Change all callers. Add is_defsym_ field.
11550 (class Parser_closure): Add parsing_defsym parameter to
11551 constructor; change all callers. Add parsing_defsym accessor
11552 function. Add parsing_defsym_ field.
11553
556bd683
ILT
115542009-12-28 Ian Lance Taylor <iant@google.com>
11555
11556 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11557 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11558
1782c879
ILT
115592009-12-23 Ian Lance Taylor <iant@google.com>
11560
11561 * i386.cc (Target_i386::do_calls_non_split): Recognize
11562 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11563 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11564 -fsplit-stack prologue when using %r11.
1782c879 11565
329ca2b1
ST
115662009-12-21 Sriraman Tallam <tmsriram@google.com>
11567
11568 * options.cc (General_options::parse_version): Make -v continue and do
11569 the link like GNU ld does.
11570
d675ff46
RÁE
115712009-12-17 Rafael Avila de Espindola <espindola@google.com>
11572
11573 * Makefile.am (CCFILES): Add timer.cc.
11574 (HFILES): Add timer.h.
11575 * configure.ac: Check for sysconf and times.
11576 * main.cc: include timer.h.
11577 (main): Use Timer instead of get_run_time.
11578 * timer.cc: New.
11579 * timer.h: New.
11580 * workqueue.cc: include timer.h.
11581 (Workqueue::find_and_run_task):
11582 Report user, sys and wall time.
11583 * Makefile.in: Regenerate.
11584 * config.in: Regenerate.
11585 * configure: Regenerate.
11586
d6344fb5
DK
115872009-12-16 Doug Kwan <dougkwan@google.com>
11588
11589 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11590 sections.
11591 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11592 relaxed input sections.
11593 * output.cc (Output_section::find_relaxed_input_section): Change
11594 return type to Output_relaxed_input_section pointer. Adjust code
11595 for new type of relaxed_input_section_map_.
11596 * output.h (Output_section::find_relaxed_input_section): Change
11597 return type to Output_relaxed_input_section pointer.
11598 (Output_section::Output_relaxed_input_section_by_input_section_map):
11599 New type.
11600 (Output_section::relaxed_input_section_map_): Change type to
11601 Output_section::Output_relaxed_input_section_by_input_section_map.
11602 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11603 input section.
11604
0e0d5469
ILT
116052009-12-15 Ian Lance Taylor <iant@google.com>
11606
11607 * layout.cc (Layout::create_shstrtab): Only write out after input
11608 sections if we are compressing debug sections.
11609
0649a889
ILT
116102009-12-15 Ian Lance Taylor <iant@google.com>
11611
11612 * archive.cc (Archive::add_symbols): Only look up a symbol without
11613 a version if there is, in fact, a version.
11614
2ea97941
ILT
116152009-12-14 Ian Lance Taylor <iant@google.com>
11616
11617 Revert -Wshadow changes, all changes from:
11618 2009-12-11 Doug Kwan <dougkwan@google.com>
11619 2009-12-11 Nick Clifton <nickc@redhat.com>
11620 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11621
b0eec2cc
DK
116222009-12-11 Doug Kwan <dougkwan@google.com>
11623
11624 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11625 due to -Wshadow.
11626 * attributes.cc (Object_attribute::size): Ditto.
11627 (Attributes_section_data::size): Ditto.
11628 (Attributes_section_data::Attributes_section_data): Ditto.
11629 (Output_attributes_section_data::do_write): Ditto.
11630 * attributes.h (Object_attribute::set_type): Ditto.
11631 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11632
91d6fa6a
NC
116332009-12-11 Nick Clifton <nickc@redhat.com>
11634
11635 * archive.cc: Fix shadowed variable warnings.
11636 * arm.cc: Likewise.
11637 * compressed_output.cc: Likewise.
11638 * compressed_output.h: Likewise.
11639 * configure: Likewise.
11640 * dwarf_reader.cc: Likewise.
11641 * dynobj.cc: Likewise.
11642 * dynobj.h: Likewise.
11643 * ehframe.cc: Likewise.
11644 * ehframe.h: Likewise.
11645 * errors.cc: Likewise.
11646 * expression.cc: Likewise.
11647 * fileread.cc: Likewise.
11648 * fileread.h: Likewise.
11649 * freebsd.h: Likewise.
11650 * i386.cc: Likewise.
11651 * icf.cc: Likewise.
11652 * incremental.h: Likewise.
11653 * layout.cc: Likewise.
11654 * layout.h: Likewise.
11655 * mapfile.cc: Likewise.
11656 * merge.cc: Likewise.
11657 * merge.h: Likewise.
11658 * object.cc: Likewise.
11659 * object.h: Likewise.
11660 * options.h: Likewise.
11661 * output.cc: Likewise.
11662 * output.h: Likewise.
11663 * parameters.cc: Likewise.
11664 * plugin.cc: Likewise.
11665 * powerpc.cc: Likewise.
11666 * reduced_debug_output.cc: Likewise.
11667 * reduced_debug_output.h: Likewise.
11668 * reloc.cc: Likewise.
11669 * reloc.h: Likewise.
11670 * resolve.cc: Likewise.
11671 * script-sections.cc: Likewise.
11672 * script.cc: Likewise.
11673 * script.h: Likewise.
11674 * sparc.cc: Likewise.
11675 * symtab.cc: Likewise.
11676 * symtab.h: Likewise.
11677 * target-select.cc: Likewise.
11678 * target-select.h: Likewise.
11679 * token.h: Likewise.
11680 * workqueue.cc: Likewise.
11681 * workqueue.h: Likewise.
11682 * x86_64.cc: Likewise.
11683
a0351a69
DK
116842009-12-10 Doug Kwan <dougkwan@google.com>
11685
11686 * arm.cc (attributes.h): New include.
11687 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11688 (Arm_relobj::~Arm_relobj): Delete object pointed by
11689 attributes_section_data_.
11690 (Arm_relobj::attributes_section_data): New method definition.
11691 (Arm_relobj::attributes_section_data_): New data member declaration.
11692 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11693 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11694 attributes_section_data_.
11695 (Arm_dynobj::attributes_section_data): New method definition.
11696 (Arm_dynobj::attributes_section_data_): New data member declaration.
11697 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11698 initialization value of may_use_blx_ to false.
2e702c99 11699 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11700 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11701 object attributes to compute results instead of hard-coding.
11702 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11703 Target_arm::get_secondary_compatible_arch,
11704 Target_arm::set_secondary_compatible_arch
11705 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11706 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11707 New method declarations.
11708 (Target_arm::get_aeabi_object_attribute): New method definition.
11709 (Target_arm::attributes_section_data_): New data member declaration.
11710 (read_arm_attributes_section): New template definition.
11711 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11712 (Arm_dynobj::do_read_symbols): Ditto.
11713 (Target_arm::do_finalize_sections): Merge attributes sections from
11714 input. Check for BLX use after attributes section merging.
11715 Fix __exidx_start and __exidx_end visibility. Create an
11716 .ARM.attributes section if necessary.
11717 (Target_arm::get_secondary_compatible_arch,
11718 Target_arm::set_secondary_compatible_arch,
11719 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11720 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11721 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11722 New method definitions.
11723
b59befec
ILT
117242009-12-09 Ian Lance Taylor <iant@google.com>
11725
11726 * plugin.cc (Plugin::load): Don't cast from void* to a function
11727 pointer.
11728
1276bc89
ILT
117292009-12-09 Ian Lance Taylor <iant@google.com>
11730
11731 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11732 information fields.
11733
2f2de248
L
117342009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11735
11736 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11737 Replace two_file_shared_1.so with two_file_shared_2.so.
11738 * testsuite/Makefile.in: Regenerated.
11739
4f787271
DK
117402009-12-08 Doug Kwan <dougkwan@google.com>
11741
11742 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11743 (HFILES): Add attributes.h and int_encoding.h.
11744 * Makefile.in: Regenerate.
11745 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11746 function definitions to int_encoding.cc
11747 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11748 prototypes to int_encoding.h
11749 * reduced_debug_output.cc (int_encoding.h): New include.
11750 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11751 function definitions to int_encoding.cc
11752 (insert_into_vector, read_from_pointer): Move template definitions to
11753 int_encoding.h
11754 * attributes.cc: New file.
11755 * attributes.h: New file.
11756 * int_encoding.cc: New file.
11757 * int_encoding.h: New file.
11758
20b52f1a
RÁE
117592009-12-07 Rafael Avila de Espindola <espindola@google.com>
11760
11761 PR gold/11055
11762 * incremental-dump.cc (dump_incremental_inputs): New.
11763 (main): Use dump_incremental_inputs.
11764
53d7974c
L
117652009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11766
11767 PR gold/10893
11768 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11769 checking elfcpp::STT_FUNC.
11770 (Target_i386::Relocate::relocate): Likewise.
11771 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11772
11773 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11774 symbols from shared libraries into normal FUNC symbols.
11775
11776 * symtab.h (Symbol): Add is_func and use it.
11777
05a352e6
DK
117782009-12-05 Doug Kwan <dougkwan@google.com>
11779
11780 * arm.cc (Target_arm::arm_info): Initialize new fields
11781 attributes_section and attributes_vendor.
11782 * i386.cc (Target_i386::i386_info): Same.
11783 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11784 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11785 fields attributes_section and attributes_vendor.
53d7974c 11786 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11787 * target.h (Target::attributes_section, Target::attributes_vendor,
11788 Target::is_attributes_section, Target::attribute_arg_type,
11789 Target::attributes_order): New method definitions.
11790 (Target::Target_info::attributes_section,
11791 Target::Target_info::attributes_vendor): New fields.
11792 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11793 virtual method definitions.
11794 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11795 attributes_section and attributes_vendor.
11796 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11797
f4e5969c
DK
117982009-12-05 Doug Kwan <dougkwan@google.com>
11799
11800 * arm.cc: Update comments about interworking and stub generation.
11801 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11802 considered as non-PIC.
11803 (Arm_relocate_functions::base_abs): Fix formatting.
11804 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11805 of function to use GOT entry address instead of offset.
11806 (Target_arm::Scan::global): Issue an error if a symbol would need a
11807 PLT does not get one because it is untyped. Remove code to create
11808 dynamic symbols for relative branches.
11809 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11810 takes unsigned integer instead of boolean.
11811
1abce4a6
L
118122009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11813
11814 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11815 (two_file_test_LDADD): Likewise.
11816 (common_test_1_LDADD): Likewise.
11817 (exception_test_LDADD) Likewise.
11818 (weak_test_LDADD): Likewise.
11819 (many_sections_test_LDADD): Likewise.
11820 (initpri1_LDADD): Likewise.
11821 (script_test_1_LDADD): Likewise.
11822 (script_test_2_LDADD): Likewise.
11823 (justsyms_LDADD): Likewise.
11824 (binary_test_LDADD): Likewise.
11825 (large_LDADD): Likewise.
11826 * testsuite/Makefile.in: Regenerated.
11827
adcf2816 118282009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11829
adcf2816
L
11830 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11831 (Symbol_table::override_with_special): Likewise.
11832 (Symbol_table::add_from_object): Likewise.
11833
28e67f5d
RÁE
118342009-12-04 Rafael Avila de Espindola <espindola@google.com>
11835
11836 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11837 Don't set the data_offset twice.
11838
ae10a101
RÁE
118392009-12-04 Rafael Avila de Espindola <espindola@google.com>
11840
11841 * testsuite/Makefile.in: Regenerate.
11842
f59f41f3
DK
118432009-12-03 Doug Kwan <dougkwan@google.com>
11844
11845 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11846 (Target_arm::do_finalize_sections): Add parameter for symbol table
11847 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11848 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11849 parameter for symbol table pointer.
11850 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11851 an additional parameter for a pointer to symbol table.
11852 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11853 parameter for a symbol table pointer.
11854 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11855 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11856 Ditto.
11857 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11858 parameter for a symbol table pointer.
11859
ca55d848
RÁE
118602009-12-03 Rafael Avila de Espindola <espindola@google.com>
11861
11862 * incremental.cc (Incremental_inputs_header)
11863 (Incremental_inputs_header_write, Incremental_inputs_entry)
11864 (Incremental_inputs_entry_write): Move ...
11865 * incremental.h (Incremental_inputs_header)
11866 (Incremental_inputs_header_write, Incremental_inputs_entry)
11867 (Incremental_inputs_entry_write): here.
11868
3aec4f9c
RÁE
118692009-12-02 Rafael Avila de Espindola <espindola@google.com>
11870
11871 * incremental.cc (make_sized_incremental_binary): Set the target.
11872 Error if it is incompatible.
11873 * output.h (Output_file): Add filename method.
11874
9c0ae74d
RÁE
118752009-12-02 Rafael Avila de Espindola <espindola@google.com>
11876
11877 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11878 from the get_* methods.
11879
a45500ae
RÁE
118802009-12-02 Rafael Avila de Espindola <espindola@google.com>
11881
11882 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11883 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11884 Write 0 for the data_offset of scripts.
11885
325e6408
RÁE
118862009-12-02 Rafael Avila de Espindola <espindola@google.com>
11887
11888 * testsuite/Makefile.am: Add the incremental_test.sh test.
11889 * testsuite/incremental_test.sh: New.
11890 * testsuite/incremental_test_1.c: New.
11891 * testsuite/incremental_test_2.c: New.
11892
954c3e2e
RÁE
118932009-12-01 Rafael Avila de Espindola <espindola@google.com>
11894
703d02da 11895 * incremental-dump.cc (main): Fix typos.
954c3e2e 11896
f8086623
RÁE
118972009-11-27 Rafael Avila de Espindola <espindola@google.com>
11898
11899 PR gold/11025
11900 * incremental-dump.cc (main): Use llu to print 64 bit values.
11901
3b0dd6ac
L
119022009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11903 H.J. Lu <hongjiu.lu@intel.com>
11904
11905 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11906 $(LIBDL).
11907 (incremental_dump_LDADD): Likewise.
11908 * Makefile.in: Regenerated.
11909
a6d1ef57 119102009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11911
a6d1ef57
DK
11912 Revert:
11913
11914 2009-11-25 Doug Kwan <dougkwan@google.com>
11915
11916 * arm.cc (Target_arm::Target_arm): Move method definition
11917 outside of class definition. Add code to handle
11918 --target1-rel, --target1-abs and --target2= options.
11919 (Target_arm::get_reloc_reloc_type): Change method to be
11920 non-static and const.
11921 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11922 New data member declaration.
11923 (Target_arm::Scan::local, Target_arm::Scan::global,
11924 Target_arm::Relocate::relocate,
11925 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11926 Adjust call to Target_arm::get_real_reloc_type.
11927 (Target_arm::get_real_reloc_type): Use command line options
11928 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11929 * options.h (--target1-rel, --target1-abs, --target2): New
11930 ARM-only options.
11931
50aeb7d4
DK
119322009-11-25 Doug Kwan <dougkwan@google.com>
11933
11934 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11935 class definition. Add code to handle --target1-rel, --target1-abs
11936 and --target2= options.
11937 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11938 and const.
11939 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11940 member declaration.
11941 (Target_arm::Scan::local, Target_arm::Scan::global,
11942 Target_arm::Relocate::relocate,
11943 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11944 call to Target_arm::get_real_reloc_type.
11945 (Target_arm::get_real_reloc_type): Use command line options to
11946 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11947 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11948 options.
11949
51938283
DK
119502009-11-25 Doug Kwan <dougkwan@google.com>
11951
11952 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11953 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11954 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11955 formatting.
11956 (Arm_relocate_functions::thm_call): Replace body with a call to
11957 Arm_relocate_functions::thumb_branch_common.
11958 (Arm_relocate_functions::thm_jump24,
11959 Arm_relocate_functions::thm_xpc22): New method definitions.
11960 (Arm_relocate_functions::thumb_branch_common): New method definition.
11961 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11962 operator.
11963 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11964 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11965
e2b8f3c4
RÁE
119662009-11-24 Rafael Avila de Espindola <espindola@google.com>
11967
11968 * Makefile.am: Build incremental-dump
11969 * Makefile.in: Regenerate.
11970 * incremental-dump.cc: New.
11971 * incremental.cc (Incremental_inputs_header_data,
11972 Incremental_inputs_entry_data): Move to incremental.h
11973 * incremental.h: (Incremental_inputs_header_data,
11974 Incremental_inputs_entry_data): Move from incremental.cc
11975
bcba9aec
RÁE
119762009-11-24 Rafael Avila de Espindola <espindola@google.com>
11977
11978 * incremental.cc (Incremental_inputs_header,
11979 Incremental_inputs_header_write, Incremental_inputs_entry,
11980 Incremental_inputs_entry_write): Add a typedef with the data type.
11981
7c3afe08
RÁE
119822009-11-24 Rafael Avila de Espindola <espindola@google.com>
11983
11984 * incremental.cc (Incremental_inputs_header,
11985 Incremental_inputs_header_write, Incremental_inputs_entry,
11986 Incremental_inputs_entry_write): Update comment about which
11987 type has the filed descriptions.
11988
d204b6e9
DK
119892009-11-15 Doug Kwan <dougkwan@google.com>
11990
11991 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11992 (Arm_relocate_functions::arm_branch_common): Change method defintion
11993 in class definition to a method declaration and update list of formal
11994 parameters.
11995 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11996 Arm_relocation_functions::jump24): Adjust call to
11997 Arm_relocate_functions::arm_branch_common. Update list of formal
11998 parameters.
11999 (Arm_relocate_functions::xpc25): New method definition.
12000 (Arm_relocate_functions::arm_branch_common): Move method defintion
12001 out from class definition. Use stubs for mode-switching and extending
12002 branch ranges.
12003 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12004 specially. Change code to enable use of stubs in ARM branches.
12005
43d12afe
DK
120062009-11-10 Doug Kwan <dougkwan@google.com>
12007
12008 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12009 in method declaration.
12010 (Target_arm::relocate_stub): New method declaration.
12011 (Target_arm::default_target): Change to return a pointer instead of
12012 a const reference.
12013 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12014 Target_arm::default_target.
12015 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12016 method definition.
12017 (Target_arm::relocate_section): Adjust view.
12018 (Target_arm::relocate_stub): New method definition.
12019
ac33a407
DK
120202009-11-10 Doug Kwan <dougkwan@google.com>
12021
12022 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12023 a format warning.
12024 * incremental.cc (open_incremental_binary): Initialized local
12025 variables to avoid warnings.
12026 * object.cc (make_elf_object): Ditto.
12027 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12028 a format warning.
e1df38aa 12029
88ee28e9
L
12030009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12031
12032 PR gold/10930
12033 * testsuite/plugin_test.c: Include "config.h".
12034
2daedcd6
DK
120352009-11-09 Doug Kwan <dougkwan@google.com>
12036
12037 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12038 (arm_symbol_value): Remove.
12039 (Arm_relocate_functions::arm_branch_common,
12040 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12041 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12042 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12043 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12044 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12045 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12046 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12047 Arm_relocate_functions::thm_mobw_abs_nc,
12048 Arm_relocate_functions::thm_mov_abs,
12049 Arm_relocate_functions::movw_prel_nc,
12050 Arm_relocate_functions::thm_movt_abs,
12051 Arm_relocate_functions::movt_prel,
12052 Arm_relocate_functions::thm_movw_prel_nc,
12053 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12054 (Target_arm::Relocate::relocate): Only decompose address into two
12055 parts if relocation type uses the thumb-bit and pass the actual
12056 bit instead of a flag indicating that the thumb-bit is used. Adjust
12057 calls to methods in Arm_relocate_functions for this change.
12058
1276bc89 120592009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12060
12061 PR 10925
12062 * reloc.cc: Instantiate
12063 Sized_relobj::initialize_input_to_output_maps and
12064 Sized_relobj:free_input_to_output_maps.
12065
e53ad1b5
ILT
120662009-11-06 Ian Lance Taylor <iant@google.com>
12067
12068 PR 10876
12069 * defstd.cc (in_segment): Set only_if_ref true for "end".
12070
eb44217c
DK
120712009-11-06 Doug Kwan <dougkwan@google.com>
12072
12073 * arm.cc (class Reloc_stub): Correct a comment.
12074 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12075 (Target_arm::scan_section_for_stubs): New method declaration.
12076 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12077 Change methods from private to protected.
12078 (Target_arm::do_may_relax): New method definition.
12079 (Target_arm::do_relax, Target_arm::group_sections,
12080 Target_arm::scan_reloc_for_stub,
12081 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12082 (Target_arm::arm_input_section_map_): New data member declaration.
12083 (Target_arm::scan_reloc_for_stub,
12084 Target_arm::scan_reloc_section_for_stubs,
12085 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12086 Target_arm::do_relax): New method definitions.
12087
5d329b7d
ILT
120882009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12089
12090 * configure.ac: Check for (struct stat)::st_mtim
12091 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12092 * config.in: Regenerate.
12093 * configure: Regenerate.
12094
96a0d71b
ILT
120952009-11-05 Ian Lance Taylor <iant@google.com>
12096
12097 PR 10910
12098 * output.cc (Output_segment::add_output_section): Add missing
12099 return statement.
12100
594c8e5e
ILT
121012009-11-04 Ian Lance Taylor <iant@google.com>
12102
12103 PR 10880
12104 * object.h (class Object): Add is_needed and set_is_needed
12105 methods. Add is_needed_ field. Make bool fields into bitfields.
12106 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12107 defined in a dynamic object and referenced by a regular object,
12108 set is_needed for the dynamic object.
12109 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12110 if the file is marked with as_needed and it is not needed.
12111
22b127cc
ILT
121122009-11-04 Ian Lance Taylor <iant@google.com>
12113
12114 PR 10887
12115 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12116 tags if data is discarded by linker script.
12117 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12118 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12119 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12120 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12121
f5c870d2
ILT
121222009-11-04 Ian Lance Taylor <iant@google.com>
12123
12124 * layout.cc (Layout::get_output_section): Add is_interp and
12125 is_dynamic_linker_section parameters. Change all callers.
12126 (Layout::choose_output_section): Likewise.
12127 (Layout::make_output_section): Likewise.
12128 (Layout::add_output_section_data): Add is_dynamic_linker_section
12129 parameter. Change all callers.
12130 * layout.h (class Layout): Update declarations.
12131 * output.h (class Output_section): Add is_interp, set_is_interp,
12132 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12133 Add is_interp_, is_dynamic_linker_section_ fields. Change
12134 generate_code_fills_at_write_ to a bitfield.
12135 * output.cc (Output_section::Output_sections): Initialize new
12136 fields.
12137 (Output_segment::add_output_section): Add do_sort parameter.
12138 Change all callers.
12139
1ae4d23b
ILT
121402009-11-03 Ian Lance Taylor <iant@google.com>
12141
12142 PR 10860
12143 * options.h (class General_options): Add --warn-common.
12144 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12145 merging two common symbols.
12146 (Symbol_table::should_override): Handle --warn-common when merging
12147 a common symbol with a defined symbol. Use report_resolve_problem
12148 for multiple definitions.
12149 (Symbol_table::report_resolve_problem): New function.
12150 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12151
55da9579
DK
121522009-11-03 Doug Kwan <dougkwan@google.com>
12153
12154 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12155 stub_factory_.
12156 (Target_arm::stub_factory): New method definition.
12157 (Target_arm::new_arm_input_section,
12158 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12159 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12160 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12161 New type definitions.
12162 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12163 member declarations.
12164 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12165 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12166 New method definitions.
12167
37a9ac43
ILT
121682009-11-03 Ian Lance Taylor <iant@google.com>
12169
12170 * options.h (class General_options): Add --warn_constructors.
12171
b3d6a3d4
ILT
121722009-11-03 Ian Lance Taylor <iant@google.com>
12173
12174 PR 10893
12175 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12176 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12177
934b01dd
ILT
121782009-11-03 Ian Lance Taylor <iant@google.com>
12179
12180 PR 10895
12181 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12182 --msgid-bugs-address.
12183 (install-pdf): New target.
12184 (install-data_yes): Look up one directory to find mkinstalldirs.
12185
03c1939b
L
121862009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12187
12188 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12189 tree.
12190
ebd95253
DK
121912009-10-30 Doug Kwan <dougkwan@google.com>
12192
12193 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12194
e9bbb538
DK
121952009-10-30 Doug Kwan <dougkwan@google.com>
12196
12197 * arm.cc (Stub_addend_reader): New struct template definition
12198 and partial specializations.
12199 (Stub_addend_reader::operator()): New method definition for a
12200 partially specialized template.
12201
d5b40221
DK
122022009-10-30 Doug Kwan <dougkwan@google.com>
12203
12204 * arm.cc (Arm_relobj::processor_specific_flags): New method
12205 definition.
12206 (Arm_relobj::do_read_symbols): New method declaration.
12207 (Arm_relobj::processor_specific_flags_): New data member declaration.
12208 (Arm_dynobj): New class definition.
12209 (Target_arm::do_finalize_sections): Add input_objects parameter.
12210 (Target_arm::do_adjust_elf_header): New method declaration.
12211 (Target_arm::are_eabi_versions_compatible,
12212 (Target_arm::merge_processor_specific_flags): New method declaration.
12213 (Target_arm::do_make_elf_object): New overloaded method definitions
12214 and declaration.
12215 (Arm_relobj::do_read_symbols): New method definition.
12216 (Arm_dynobj::do_read_symbols): Ditto.
12217 (Target_arm::do_finalize_sections): Add input_objects parameters.
12218 Merge processor-specific flags from all input objects.
12219 (Target_arm::are_eabi_versions_compatible,
12220 Target_arm::merge_processor_specific_flags,
12221 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12222 New method definitions.
12223 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12224 Input_objects pointer type parameter.
12225 * layout.cc (Layout::finalize): Pass input objects to target's.
12226 finalize_sections function.
12227 * output.cc (Output_file_header::do_sized_write): Set ELF file
12228 header's processor-specific flags.
12229 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12230 Input_objects pointer type parameter.
12231 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12232 * target.h (Input_objects): New forward class declaration.
12233 (Target::processor_specific_flags,
12234 Target::are_processor_specific_flags_sect): New method definitions.
12235 (Target::finalize_sections): Add input_objects parameter.
12236 (Target::Target): Initialize processor_specific_flags_ and
12237 are_processor_specific_flags_set_.
12238 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12239 parameter.
12240 (Target::set_processor_specific_flags): New method definition.
12241 (Target::processor_specific_flags_,
12242 Target::are_processor_specific_flags_set_): New data member
12243 declarations.
12244 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12245 Input_objects pointer type parameter.
12246
ebabffbd
DK
122472009-10-30 Doug Kwan <dougkwan@google.com>
12248
12249 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12250
ad0f2072
ILT
122512009-10-28 Ian Lance Taylor <iant@google.com>
12252
12253 * object.h (class Relobj): Drop options parameter from
12254 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12255 do_scan_relocs, do_relocate. Change all callers.
12256 (class Sized_relobj): Drop options parameters from
12257 do_gc_process_relocs, do_scan_relocs, do_relocate,
12258 do_relocate_sections, relocate_sections, emit_relocs_scan,
12259 emit_relocs_scan_reltype. Change all callers.
12260 (struct Relocate_info): Remove options field and all references to
12261 it.
12262 * reloc.h (class Read_relocs): Remove options constructor
12263 parameter and options_ field. Change all callers.
12264 (class Gc_process_relocs, class Scan_relocs): Likewise.
12265 (class Relocate_task): Likewise.
12266 * target-reloc.h (scan_relocs): Remove options parameter. Change
12267 all callers.
12268 (scan_relocatable_relocs): Likewise.
12269 * target.h (class Sized_target): Remove options parameter from
12270 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12271 all callers.
12272 * gc.h (gc_process_relocs): Remove options parameter. Change all
12273 callers.
12274 * arm.cc: Update functions to remove options parameters.
12275 * i386.cc: Likewise.
12276 * powerpc.cc: Likewise.
12277 * sparc.cc: Likewise.
12278 * x86_64.cc: Likewise.
12279 * testsuite/testfile.cc: Likewise.
12280
8ffa3667
DK
122812009-10-28 Doug Kwan <dougkwan@google.com>
12282
12283 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12284 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12285 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12286 New method definitions.
12287
40f36857
CC
122882009-10-28 Cary Coutant <ccoutant@google.com>
12289
12290 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12291 (Plugin::cleanup_done_): New member.
12292 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12293 (Plugin_manager::cleanup_done_): Remove.
12294 (Plugin_manager::add_input_file): Edit error message.
12295 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12296 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12297
2c849493
ILT
122982009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12299
12300 * fileread.cc: (File_read::View::~View): Use the new
12301 data_ownership_ filed.
12302 (File_read::~File_read): Dispose the new whole_file_view_.
12303 (File_read::open): Mmap the whole file if needed.
12304 (File_read::open): Use whole_file_view_ instead of contents_.
12305 (File_read::find_view): Use whole_file_view_ if applicable.
12306 (File_read::do_read): Use whole_file_view_ instead of contents_.
12307 (File_read::make_view): Use whole_file_view_ instead of contents_,
12308 update File_read::View::View call.
12309 (File_read::find_or_make_view): Update File_read::View::View
12310 call.
12311 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12312 remove contents_
12313 (File_read::View::Data_ownership): New enum.
12314 (File_read::View::View): Replace bool mapped_ with Data_ownership
12315 argument.
12316 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12317 (File_read::View::data_ownership_): New field.
12318 (File_read::contents_): Remove (replaced by whole_file_view_).
12319 (File_read::whole_file_view_): New field.
12320 * options.h (class General_options): Add --keep-files-mapped.
12321
24998053
CC
123222009-10-27 Cary Coutant <ccoutant@google.com>
12323
12324 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12325 * testsuite/Makefile.am (plugin_test_5): New test case.
12326 * testsuite/Makefile.in: Regenerate.
12327
72adc4fa
DK
123282009-10-25 Doug Kwan <dougkwan@google.com>
12329
12330 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12331 from private to protected to allow access by child class.
12332 (Sized_relobj::do_relocate_sections): New method declaration.
12333 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12334 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12335 Sized_relobj::relocate_sections. Instantiate template explicitly
12336 for different target sizes and endianity.
12337
07f508a2
DK
123382009-10-24 Doug Kwan <dougkwan@google.com>
12339
12340 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12341 (Arm_input_section::as_arm_input_section): New method.
12342 (Arm_output_section): New class definition.
12343 (Arm_output_section::create_stub_group,
12344 Arm_output_section::group_sections): New method definitions.
12345
10ad9fe5
DK
123462009-10-22 Doug Kwan <dougkwan@google.com>
12347
12348 * arm.cc (Arm_input_section): New class definition.
12349 (Arm_input_section::init, Arm_input_section:do_write,
12350 Arm_input_section::set_final_data_size,
12351 Arm_input_section::do_reset_address_and_file_offset): New method
12352 definitions.
12353
56ee5e00
DK
123542009-10-21 Doug Kwan <dougkwan@google.com>
12355
12356 * arm.cc (Stub_table, Arm_input_section): New forward class
12357 declarations.
12358 (Stub_table): New class defintion.
12359 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12360 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12361 New method definition.
12362
b569affa
DK
123632009-10-21 Doug Kwan <dougkwan@google.com>
12364
12365 * arm.cc: Update copyright comments.
12366 (Target_arm): New forward class template declaration.
12367 (Arm_address): New type.
12368 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12369 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12370 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12371 constants.
12372 (Insn_template): Same.
12373 (DEF_STUBS): New macro.
12374 (Stub_type): New enum type.
12375 (Stub_template): New class definition.
12376 (Stub): Same.
12377 (Reloc_stub): Same.
12378 (Stub_factory): Same.
12379 (Target_arm::Target_arm): Initialize may_use_blx_ and
12380 should_force_pic_veneer_.
12381 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12382 Target_arm::should_force_pic_veneer,
12383 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12384 Target_arm::using_thumb_only, Target_arm:;default_target): New
12385 method defintions.
12386 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12387 New data member declarations.
12388 (Insn_template::size, Insn_template::alignment): New method defintions.
12389 (Stub_template::Stub_template): New method definition.
12390 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12391 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12392 (Stub_factory::Stub_factory): New method definition.
12393 * gold.h (string_hash): New template.
12394 * output.h (Input_section_specifier::hash_value): Use
12395 gold::string_hash.
12396 (Input_section_specifier::string_hash): Remove.
12397 * stringpool.cc (Stringpool_template::string_hash): Use
12398 gold::string_hash.
12399
6c172549
DK
124002009-10-20 Doug Kwan <dougkwan@google.com>
12401
12402 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12403 symbols of relaxed input sections.
12404 * output.h (Output_section::find_relaxed_input_section): Make
12405 method public.
12406
c5617f2f
DK
124072009-10-16 Doug Kwan <dougkwan@google.com>
12408
12409 * dynobj.cc (Versions::Versions): Initialize version_script_.
12410 Only insert base version symbol definition for a shared object
12411 if version script defines any version versions.
12412 (Versions::define_base_version): New method definition.
12413 (Versions::add_def): Check that base version is not needed.
12414 (Versions::add_need): Define base version lazily.
12415 * dynobj.h (Versions::define_base_version): New method declaration.
12416 (Versions::needs_base_version_): New data member declaration.
12417 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12418 (check_DATA): Add no_version_test.stdout.
12419 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12420 New make rules.
12421 * testsuite/Makefile.in: Regenerate.
12422 * testsuite/no_version_test.c: New file.
12423 * testsuite/no_version_test.sh: Ditto.
12424
3c12dcdb
DK
124252009-10-16 Doug Kwan <dougkwan@google.com>
12426
12427 * expression.cc (class Segment_start_expression): New class definition.
12428 (Segment_start_expression::value): New method definition.
12429 (script_exp_function_segment_start): Return a new
12430 Segment_start_expression.
12431 * gold/script-c.h (script_saw_segment_start_expression): New function
12432 prototype.
12433 * script-sections.cc (Script_sections::Script_sections): Initialize
12434 SAW_SEGMENT_START_EXPRESSION_ to false.
12435 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12436 and -Tbbs options to specify section addresses if given in
12437 command line and no SEGMENT_START expression is seen in a script.
12438 * script-sections.h (Script_sections::saw_segment_start_expression,
12439 Script_sections::set_saw_segment_start_expression): New method
12440 definition.
12441 (Script_sections::saw_segment_start_expression_): New data member
12442 declaration.
12443 * script.cc (script_saw_segment_start_expression): New function.
12444 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12445 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12446 script_test_7.sh and script_test_8.sh.
12447 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12448 script_test_8.stdout.
12449 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12450 (script_test_6, script_test_6.stdout, script_test_7,
12451 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12452 * Makefile.in: Regenerate.
12453 * testsuite/script_test_6.sh: New file.
12454 * testsuite/script_test_6.t: Same.
12455 * testsuite/script_test_7.sh: Same.
12456 * testsuite/script_test_7.t: Same.
12457 * testsuite/script_test_8.sh: Same.
12458
64b1ae37
DK
124592009-10-16 Doug Kwan <dougkwan@google.com>
12460
12461 * output.cc (Output_segment::set_section_list_address): Cast
12462 expressions to unsigned long long type to avoid format warnings.
12463
661be1e2
ILT
124642009-10-15 Ian Lance Taylor <iant@google.com>
12465
12edd763 12466 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12467 dot assignment to script_sections_.
12edd763
ILT
12468 * script-sections.cc (Script_sections::add_dot_assignment):
12469 Initialize if necessary.
12470
68b6574b
ILT
12471 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12472 program headers with no load segment if there is a linker script.
12473
661be1e2
ILT
12474 * layout.cc (Layout::set_segment_offsets): Align the file offset
12475 to the segment aligment for -N or -n with no load segment.
12476 * output.cc (Output_segment::add_output_section): Don't crash if
12477 the first section is a TLS section.
12478 (Output_segment::set_section_list_addresses): Print an error
12479 message if the address moves backward in a linker script.
12480 * script-sections.cc
12481 (Output_section_element_input::set_section_addresses): Don't
12482 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12483 (Orphan_output_section::set_section_addresses): Likewise.
12484
f15f61a7
DK
124852009-10-15 Doug Kwan <dougkwan@google.com>
12486
12487 * layout.cc (Layout::finish_dynamic_section): Generate tags
12488 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12489 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12490 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12491
82bb573a
ILT
124922009-10-14 Ian Lance Taylor <iant@google.com>
12493
12494 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12495 fields.
12496 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12497 data_shdr fields of relinfo.
12498 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12499 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12500 R_386_TLS_LDO_32, adjust based on section flags.
12501 (Target_i386::Relocate::fix_up_ldo): Remove.
12502
374ad285
ILT
125032009-10-13 Ian Lance Taylor <iant@google.com>
12504
12505 Add support for -pie.
12506 * options.h (class General_options): Add -pie and
12507 --pic-executable.
12508 (General_options::output_is_position_independent): Test -pie.
12509 (General_options::output_is_executable): Return true if not shared
12510 and not relocatable.
12511 (General_options::output_is_pie): Remove.
12512 * options.cc (General_options::finalize): Reject incompatible uses
12513 of -pie.
12514 * gold.cc (queue_middle_tasks): A -pie link is not static.
12515 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12516 * symtab.cc (Symbol::final_value_is_known): Return false if
12517 output_is_position_independent.
12518 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12519 output_is_position_independent.
12520 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12521 output_is_position_independent.
12522 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12523 output_is_position_independent.
12524 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12525 two_file_pie_test.
12526 (basic_pie_test.o, basic_pie_test): New targets.
12527 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12528 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12529 (two_file_pie_test): New target.
12530 * testsuite/Makefile.in: Rebuild.
12531 * README: Remove note saying that -pie is not supported.
12532
c6585162
ILT
125332009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12534
12535 * options.h (class General_options): Add -init and -fini.
12536 * layout.cc (Layout::finish_dynamic_section): Emit
12537 given init and fini functions.
12538
032ce4e9
ST
125392009-10-13 Sriraman Tallam <tmsriram@google.com>
12540
12541 * gc.h (gc_process_relocs): Check if icf is enabled using new
12542 function.
12543 * gold.cc (queue_initial_tasks): Likewise.
12544 (queue_middle_tasks): Likewise.
12545 * object.cc (do_layout): Likewise.
12546 * symtab.cc (is_section_folded): Likewise.
12547 * main.cc (main): Likewise.
12548 * reloc.cc (Read_relocs::run): Likewise.
12549 (Sized_relobj::do_scan_relocs): Likewise.
12550 * icf.cc (is_function_ctor_or_dtor): New function.
12551 (Icf::find_identical_sections): Check if function is ctor or dtor when
12552 safe icf is chosen.
12553 * options.h (General_options::icf): Change option to be an enum.
12554 (Icf_status): New enum.
12555 (icf_enabled): New method.
12556 (icf_safe_folding): New method.
12557 (set_icf_status): New method.
12558 (icf_status_): New variable.
12559 * (options.cc) (General_options::finalize): Set icf_status_.
12560 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12561 icf_test and icf_keep_unique_test to use the --icf enum flag.
12562 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12563 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12564
f345227a
ST
125652009-10-12 Sriraman Tallam <tmsriram@google.com>
12566
12567 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12568 includes to gc.h and icf.h.
12569 * arm.cc: Include gc.h.
12570 * gold.cc: Likewise.
12571 * i386.cc: Likewise.
12572 * powerpc.cc: Likewise.
12573 * sparc.cc: Likewise.
12574 * x86_64.cc: Likewise.
12575 * gc.h: Include icf.h.
12576
1c7814ed
ILT
125772009-10-11 Ian Lance Taylor <iant@google.com>
12578
12579 * plugin.cc: Include "gold.h" before other header files.
12580
ae3b5189
CD
125812009-10-10 Chris Demetriou <cgd@google.com>
12582
12583 * options.h (Input_file_argument::Input_file_type): New enum.
12584 (Input_file_argument::is_lib_): Replace with...
12585 (Input_file_argument::type_): New member.
12586 (Input_file_argument::Input_file_argument): Take Input_file_type
12587 'type' rather than boolean 'is_lib' as second argument.
12588 (Input_file_argument::is_lib): Use type_.
12589 (Input_file_argument::is_searched_file): New function.
12590 (Input_file_argument::may_need_search): Handle is_searched_file.
12591 * options.cc (General_options::parse_library): Support -l:filename.
12592 (General_options::parse_just_symbols): Update for Input_file_argument
12593 changes.
12594 (Command_line::process): Likewise.
12595 * archive.cc (Archive::get_file_and_offset): Likewise.
12596 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12597 * script.cc (read_script_file, script_add_file): Likewise.
12598 * fileread.cc (Input_file::Input_file): Likewise.
12599 (Input_file::will_search_for): Handle is_searched_file.
12600 (Input_file::open): Likewise.
12601 * readsyms.cc (Read_symbols::get_name): Likewise.
12602 * testsuite/Makefile.am (searched_file_test): New test.
12603 * testsuite/Makefile.in: Regenerate.
12604 * testsuite/searched_file_test.cc: New file.
12605 * testsuite/searched_file_test_lib.cc: New file.
12606
f3048a1d
ILT
126072009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12608 Ian Lance Taylor <iant@google.com>
12609
12610 * descriptor.cc: Include <cstdio> and "binary-io.h".
12611 (Descriptors::open): Open the files in binary mode always.
12612 * script.cc (Lex::get_token): Treat \r as whitespace.
12613
d4780e57
ILT
126142009-10-09 Ian Lance Taylor <iant@google.com>
12615
12616 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12617
d9a893b8
ILT
126182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12619 Ian Lance Taylor <iant@google.com>
12620
12621 * configure.ac: Check for readv function also.
12622 * fileread.cc (readv): Define if not HAVE_READV.
12623 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12624 does not exist.
12625 * config.in: Regenerate.
12626 * configure: Regenerate.
12627
c0a62865
DK
126282009-10-09 Doug Kwan <dougkwan@google.com>
12629
12630 * layout.cc (Layout::make_output_section): Call target hook to make
12631 ordinary output section.
12632 (Layout::finalize): Adjust parameter list of call the
12633 Target::may_relax().
12634 * layout.h (class Layout::section_list): New method.
12635 * merge.h (Output_merge_base::entsize): Change visibility to public.
12636 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12637 New methods.
12638 (Output_merge_string::do_is_string): New method.
12639 * object.cc (Sized_relobj::do_setup): renamed from
12640 Sized_relobj::set_up.
12641 * object.h (Sized_relobj::adjust_shndx,
12642 Sized_relobj::initializ_input_to_output_maps,
12643 Sized_relobj::free_input_to_output_maps): Change visibilities to
12644 protected.
12645 (Sized_relobj::setup): Virtualize.
12646 (Sized_relobj::do_setup): New method declaration.
12647 (Sized_relobj::invalidate_section_offset,
12648 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12649 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12650 * options.cc (parse_int): New function.
12651 * options.h (parse_int): New declaration.
12652 (DEFINE_int): New macro.
12653 (stub_group_size): New option.
12654 * output.cc (Output_section::Output_section): Initialize memebers
12655 merge_section_map_, merge_section_by_properties_map_,
12656 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12657 (Output_section::add_input_section): Handled deferred code-fill
12658 generation and remove an old comment.
12659 (Output_section::add_relaxed_input_section): New method definition.
12660 (Output_section::add_merge_input_section): Use merge section by
12661 properties map to speed to search. Update merge section maps
12662 as appropriate.
12663 (Output_section::build_relaxation_map): New method definition.
12664 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12665 Same.
12666 (Output_section::relax_input_section): Renamed to
12667 Output_section::convert_input_sections_to_relaxed_sections and change
12668 interface to take a vector of pointers to relaxed sections.
12669 (Output_section::find_merge_section,
12670 Output_section::find_relaxed_input_section): New method definitions.
12671 (Output_section::is_input_address_mapped,
12672 Output_section::output_offset, Output_section::output_address):
12673 Use output section data maps to speed up searching.
12674 (Output_section::find_starting_output_address): Add comments.
12675 (Output_section::do_write,
12676 Output_section::write_to_postprocessing_buffer): Do code-fill
12677 generation as appropriate.
12678 (Output_section::get_input_sections): Invalidate relaxed input section
12679 map.
12680 (Output_section::restore_states): Adjust type of checkpoint .
12681 Invalidate relaxed input section map.
12682 * output.h (Output_merge_base): New class declaration.
12683 (Input_section_specifier): New class defintion.
12684 (class Output_relaxed_input_section) Change base class to
12685 Output_section_data_build.
12686 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12687 base class initializer.
12688 (Output_section::add_relaxed_input_section): New method declaration.
12689 (Output_section::Input_section): Change visibility to protected.
2e702c99 12690 (Output_section::Input_section::relobj,
c0a62865
DK
12691 Output_section::Input_section::shndx): Handle relaxed input sections.
12692 Output_section::input_sections) Change visibility to protected. Also
12693 define overload to return a non-const pointer.
12694 (Output_section::Merge_section_properties): New class defintion.
12695 (Output_section::Merge_section_by_properties_map,
12696 Output_section::Output_section_data_by_input_section_map,
12697 Output_section::Relaxation_map): New types.
12698 (Output_section::relax_input_section): Rename method to
12699 Output_section::convert_input_sections_to_relaxed_sections and change
12700 interface to take a vector of relaxed section pointers.
12701 (Output_section::find_merge_section,
12702 Output_section::find_relaxed_input_section,
12703 Output_section::build_relaxation_map,
12704 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12705 New method declarations.
12706 (Output_section::merge_section_map_
12707 Output_section::merge_section_by_properties_map_,
12708 Output_section::relaxed_input_section_map_,
12709 Output_section::is_relaxed_input_section_map_valid_,
12710 Output_section::generate_code_fills_at_write_): New data members.
12711 * script-sections.cc
12712 (Output_section_element_input::set_section_addresses): Call
12713 current_data_size and addralign methods of relaxed input sections.
12714 (Orphan_output_section::set_section_addresses): Call current_data_size
12715 and addralign methods of relaxed input sections.
12716 * symtab.cc (Symbol_table::compute_final_value): Extract template
12717 from the body of Symbol_table::sized_finalize_symbol.
12718 (Symbol_table::sized_finalized_symbol): Call
12719 Symbol_table::compute_final_value.
12720 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12721 (Symbol_table::compute_final_value): New templated method declaration.
12722 * target.cc (Target::do_make_output_section): New method defintion.
12723 * target.h (Target::make_output_section): New method declaration.
12724 (Target::relax): Add more parameters for input objects, symbol table
12725 and layout. Adjust call to do_relax.
12726 (Target::do_make_output_section): New method declaration.
12727 (Target::do_relax): Add parameters for input objects, symbol table
12728 and layout.
12729
d446d6c4
ILT
127302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12731
12732 * pread.c: Include stdio.h.
12733
bc06c745
ILT
127342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12735
12736 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12737 defined.
12738
75aea3d0
ILT
127392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12740
12741 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12742 Change read_shndx type to unsigned int.
12743 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12744 int.
12745 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12746 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12747 Change read_shndx type to unsigned int.
12748 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12749 int.
12750 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12751 * layout.cc (Layout::create_symtab_sections): Cast the result of
12752 local_symcount * symsize to off_t in the gold_assert.
12753
be8fcb75
ILT
127542009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12755
12756 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12757 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12758 R_ARM_BASE_ABS.
12759 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12760 (Arm_relocate_functions::thm_abs5): New function.
12761 (Arm_relocate_functions::abs12): New function.
12762 (Arm_relocate_functions::abs16): New function.
12763 (Arm_relocate_functions::base_abs): New function.
12764 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12765 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12766 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12767 R_ARM_BASE_ABS.
12768 (Scan::global): Likewise.
12769 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12770 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12771 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12772 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12773 R_ARM_BASE_ABS.
12774
c2a122b6
ILT
127752009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12776
12777 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12778 (Arm_relocate_functions::movt_prel): New function.
12779 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12780 (Arm_relocate_functions::thm_movt_prel): New function.
12781 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12782 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12783 (Scan::global, Relocate::relocate): Likewise.
12784 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12785
c4aa1e2d
ILT
127862009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12787
12788 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12789 Incremental_checker.
12790 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12791 unsigned int.
12792 (class Incremental_inputs_header): New class.
12793 (Incremental_inputs_header_writer): Edit comment.
12794 (Incremental_inputs_entry): New class.
12795 (Incremental_inputs_entry_writer): Edit comment.
12796 (Sized_incremental_binary::do_find_incremental_inputs_section):
12797 Add *strtab_shndx parameter, fill it.
12798 (Sized_incremental_binary::do_check_inputs): New method.
12799 (Incremental_checker::can_incrementally_link_output_file): Use
12800 Sized_incremental_binary::check_inputs.
12801 (Incremental_inputs::report_command_line): Save command line in
12802 command_line_.
12803 * incremental.h:
12804 (Incremental_binary::find_incremental_inputs_section): New
12805 method.
12806 (Incremental_binary::do_find_incremental_inputs_section): Add
12807 strtab_shndx parameter.
12808 (Incremental_binary::do_check_inputs): New pure virtual method.
12809 (Sized_incremental_binary::do_check_inputs): Declare.
12810 (Incremental_checker::Incremental_checker): Add incremental_inputs
12811 parameter, use it to initialize incremental_inputs_.
12812 (Incremental_checker::incremental_inputs_): New field.
12813 (Incremental_checker::command_line): New method.
12814 (Incremental_checker::inputs): New method.
12815 (Incremental_checker::command_line_): New field.
12816
c549a694
ILT
128172009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12818
12819 * incremental.cc: Include <cstdarg> and "target-select.h".
12820 (vexplain_no_incremental): New function.
12821 (explain_no_incremental): New function.
12822 (Incremental_binary::error): New method.
12823 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12824 method.
12825 (make_sized_incremental_binary): New function.
12826 (open_incremental_binary): New function.
12827 (can_incrementally_link_file): Add checks if output is ELF and has
12828 inputs section.
12829 * incremental.h: Include "elfcpp_file.h" and "output.h".
12830 (Incremental_binary): New class.
12831 (Sized_incremental_binary): New class.
12832 (open_incremental_binary): Declare.
12833 * object.cc (is_elf_object): Use
12834 elfcpp::Elf_recognizer::is_elf_file.
12835 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12836 * output.h (Output_file::filesize): New method.
12837
fd3c5f0b
ILT
128382009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12839
12840 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12841 New function.
12842 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12843 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12844 function.
12845 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12846 function.
12847 (Arm_relocate_functions::movw_abs_nc): New function.
12848 (Arm_relocate_functions::movt_abs): New function.
12849 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12850 (Arm_relocate_functions::thm_movt_abs): New function.
12851 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12852 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12853 (Scan::global): Likewise.
12854 (Relocate::relocate): Likewise.
12855 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12856
7f5309a5
ILT
128572009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12858
12859 * arm.cc (Arm_relocate_functions::got_prel) New function.
12860 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12861 (Relocate::relocate): Likewise.
12862 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12863
364c7fa5
ILT
128642009-10-06 Ian Lance Taylor <iant@google.com>
12865
12866 * options.h (class General_options): Define
12867 split_stack_adjust_size parameter.
12868 * object.h (class Object): Add uses_split_stack_ and
12869 has_no_split_stack_ fields. Add uses_split_stack and
12870 has_no_split_stack accessor functions. Declare
12871 handle_split_stack_section.
12872 (class Reloc_symbol_changes): Define.
12873 (class Sized_relobj): Define Function_offsets. Declare
12874 split_stack_adjust, split_stack_adjust_reltype, and
12875 find_functions.
12876 * object.cc (Object::handle_split_stack_section): New function.
12877 (Sized_relobj::do_layout): Call handle_split_stack_section.
12878 * dynobj.cc (Sized_dynobj::do_layout): Call
12879 handle_split_stack_section.
12880 * reloc.cc (Sized_relobj::relocate_sections): Call
12881 split_stack_adjust for executable sections in split_stack
12882 objects. Pass reloc_map to relocate_section.
12883 (Sized_relobj::split_stack_adjust): New function.
12884 (Sized_relobj::split_stack_adjust_reltype): New function.
12885 (Sized_relobj::find_functions): New function.
12886 * target-reloc.h: Include "object.h".
12887 (relocate_section): Add reloc_symbol_changes parameter. Change
12888 all callers.
12889 * target.h (class Target): Add calls_non_split method. Declare
12890 do_calls_non_split virtual method. Declare match_view and
12891 set_view_to_nop.
12892 * target.cc: Include "elfcpp.h".
12893 (Target::do_calls_non_split): New function.
12894 (Target::match_view): New function.
12895 (Target::set_view_to_nop): New function.
12896 * gold.cc (queue_middle_tasks): Give an error if mixing
12897 split-stack and non-split-stack objects with -r.
12898 * i386.cc (Target_i386::relocate_section): Add
12899 reloc_symbol_changes parameter.
12900 (Target_i386::do_calls_non_split): New function.
12901 * x86_64.cc (Target_x86_64::relocate_section): Add
12902 reloc_symbol_changes parameter.
12903 (Target_x86_64::do_calls_non_split): New function.
12904 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12905 parameter.
12906 * powerpc.cc (Target_powerpc::relocate_section): Add
12907 reloc_symbol_changes parameter.
12908 * sparc.cc (Target_sparc::relocate_section): Add
12909 reloc_symbol_changes parameter.
12910 * configure.ac: Call AM_CONDITIONAL for the default target.
12911 * configure: Rebuild.
12912 * testsuite/Makefile.am (TEST_AS): New variable.
12913 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12914 (check_DATA): Add split_i386 and split_x86_64 files.
12915 (SPLIT_DEFSYMS): Define.
12916 (split_i386_[1234n].o): New targets.
12917 (split_i386_[124]): New targets.
12918 (split_i386_[1234r].stdout): New targets.
12919 (split_x86_64_[1234n].o): New targets.
12920 (split_x86_64_[124]): New targets.
12921 (split_x86_64_[1234r].stdout): New targets.
12922 (MOSTLYCLEANFILES): Add new executables.
12923 * testsuite/split_i386.sh: New file.
12924 * testsuite/split_x86_64.sh: New file.
12925 * testsuite/split_i386_1.s: New file.
12926 * testsuite/split_i386_2.s: New file.
12927 * testsuite/split_i386_3.s: New file.
12928 * testsuite/split_i386_4.s: New file.
12929 * testsuite/split_i386_n.s: New file.
12930 * testsuite/split_x86_64_1.s: New file.
12931 * testsuite/split_x86_64_2.s: New file.
12932 * testsuite/split_x86_64_3.s: New file.
12933 * testsuite/split_x86_64_4.s: New file.
12934 * testsuite/split_x86_64_n.s: New file.
12935 * testsuite/testfile.cc (Target_test): Update relocation_section
12936 function.
12937 * testsuite/Makefile.in: Rebuild.
12938
e8a9fcda
ILT
129392009-10-06 Ian Lance Taylor <iant@google.com>
12940
12941 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12942 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12943 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12944 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12945 the address on ldo_addrs_.
12946 (Target_i386::Relocate::fix_up_ldo): New function.
12947
e99daf92
ILT
129482009-10-06 Rafael Espindola <espindola@google.com>
12949
12950 * plugin.cc (add_input_library): New.
12951 (Plugin::load): Add add_input_library to tv.
12952 (Plugin_manager::add_input_file): Add the is_lib argument.
12953 (add_input_file): Update call to Plugin_manager::add_input_file.
12954 (add_input_library): New.
12955 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12956
966d4097
DK
129572009-09-30 Doug Kwan <dougkwan@google.com>
12958
12959 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12960 symbol and call Symbol::may_need_copy_reloc to determine if
12961 a copy reloc is needed.
12962 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12963 nocopyreloc is given in command line.
12964 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12965 given in command line.
12966 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12967 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12968 of the removed Target_i386::may_need_copy_reloc.
12969 * options.h (copyreloc): New option with default value false.
12970 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12971 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12972 instead of the removed Target_powerpc::may_need_copy_reloc.
12973 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12974 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12975 instead of the removed Target_sparc::may_need_copy_reloc.
12976 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12977 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12978 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12979 instead of the removed Target_x86_64::may_need_copy_reloc.
12980
029ba973
ILT
129812009-09-30 Ian Lance Taylor <iant@google.com>
12982
12983 * object.h (class Object): Remove target_ field, and target,
12984 sized_target, and set_target methods.
12985 (Object::sized_target): Remove.
12986 (class Sized_relobj): Update declarations. Remove sized_target.
12987 * object.cc (Sized_relobj::setup): Remove target parameter.
12988 Change all callers.
12989 (Input_objects::add_object): Don't do anything with the target.
12990 (make_elf_sized_object): Add punconfigured parameter. Change all
12991 callers. Set or test parameter target.
12992 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12993 Change all callers.
12994 * parameters.cc (Parameters::set_target): Change parameter type to
12995 be non-const.
12996 (Parameters::default_target): Remove.
12997 (set_parameters_target): Change parameter type to be non-const.
12998 (parameters_force_valid_target): New function.
12999 (parameters_clear_target): New function.
13000 * parameters.h (class Parameters): Update declarations. Remove
13001 default_target method. Add sized_target and clear_target
13002 methods. Change target_ to be non-const.
13003 (set_parameters_target): Update declaration.
13004 (parameters_force_valid_target): Declare.
13005 (parameters_clear_target): Declare.
13006 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13007 as NULL if we aren't searching.
13008 (Add_symbols::run): Don't check for compatible target.
13009 * fileread.cc (Input_file::open_binary): Call
13010 parameters_force_valid_target.
13011 * gold.cc (queue_middle_tasks): Likewise.
13012 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13013 set_target on object.
13014 * dynobj.h (class Sized_dynobj): Update declarations.
13015 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13016 make_elf_object returns NULL.
13017 (Archive::include_member): Don't check whether object target is
13018 compatible.
13019 * output.cc (Output_section::add_input_section): Get target from
13020 parameters.
13021 (Output_section::relax_input_section): Likewise.
13022 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13023 parameters.
13024 (Sized_relobj::do_scan_relocs): Likewise.
13025 (Sized_relobj::relocate_sections): Likewise.
13026 * resolve.cc (Symbol_table::resolve): Likewise.
13027 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13028 parameter. Change all callers.
13029 (Symbol_table::add_from_object): Get target from parameters.
13030 (Symbol_table::add_from_relobj): Don't check object target.
13031 (Symbol_table::add_from_dynobj): Likewise.
13032 (Symbol_table::define_special_symbol): Get target from
13033 parameters.
13034 * symtab.h (class Symbol_table): Update declaration.
13035 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13036 parameter. Change all callers. Clear parameter target.
13037 (Binary_test): Test target here.
13038 * testsuite/object_unittest.cc (gold_testsuite): Remove
13039 target_test_pointer parameter. Change all callers.
13040 (Object_test): Test target here.
13041
a6a22b83
ILT
130422009-09-26 Ian Lance Taylor <iant@google.com>
13043
13044 * testsuite/initpri1.c: Don't try to use constructor priorities if
13045 compiling with gcc before 4.3.
13046
6a8f49fe
ILT
130472009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13048
13049 * testsuite/retain_symbols_file_test.sh (check_present): Change
13050 output file name to retain_symbols_file_test.stdout.
13051 (check_absent): Likewise.
13052
8c604651
CS
130532009-09-18 Craig Silverstein <csilvers@google.com>
13054
13055 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13056 * options.cc: Include <cerrno> and <fstream>.
13057 (General_options::finalize): Parse -retain-symbols-file tag.
13058 * options.h: New flag.
13059 (General_options): New method should_retain_symbol, new
13060 variable symbols_to_retain.
13061 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13062 should_retain_symbol map.
13063 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13064 * testsuite/Makefile.in: Regenerate.
13065 * testsuite/retain_symbols_file_test.sh: New file.
13066
ca58b19f
NC
130672009-09-18 Nick Clifton <nickc@redhat.com>
13068
13069 * po/es.po: Updated Spanish translation.
13070
20e6d0d6
DK
130712009-09-17 Doug Kwan <dougkwan@google.com>
13072
13073 * debug.h (DEBUG_RELAXATION): New constant.
13074 (DEBUG_ALL): Add DEBUG_RELAXATION.
13075 (debug_string_to_enum): Add relaxation debug option.
13076 * layout.cc
13077 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13078 Layout::Relaxation_debug_check::read_sections,
13079 Layout::Relaxation_debug_check::read_sections): New method definitions.
13080 (Layout::Layout): Initialize data members
13081 record_output_section_data_from_scrips_,
13082 script_output_section_data_list_ and relaxation_debug_check_.
13083 (Layout::save_segments, Layout::restore_segments,
13084 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13085 Layout::relaxation_loop_body): New method definitions.
13086 (Layout::finalize): Support relaxation. Move section layout code to
13087 Layout::relaxation_loop_body.
13088 (Layout::set_asection_address_from_script): Move code for orphan
13089 section placement out.
13090 (Layout::place_orphan_sections_in_script): New method definition.
13091 * layout.h (Output_segment_headers, Output_file_header):
13092 New forward class declarations.
13093 (Layout::~Layout): Define.
13094 (Layout::new_output_section_data_from_script): New method definition.
13095 (Layout::place_orphan_sections_in_script): New method declaration.
13096 (Layout::Segment_states): New type declaration.
13097 (Layout::save_segments, Layout::restore_segments,
13098 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13099 Layout::relaxation_loop_body): New method declarations.
13100 (Layout::Output_section_data_list): New type declaration.
13101 (Layout::Relaxation_debug_check): New class definition.
13102 (Layout::record_output_section_data_from_script_,
13103 Layout::script_output_section_data_list_, Layout::segment_states_,
13104 Layout::relaxation_debug_check_): New data members.
13105 * output.cc: (Output_section_headers::do_size): New method definition.
13106 (Output_section_headers::Output_section_headers): Move size
13107 computation to Output_section_headers::do_size.
13108 (Output_segment_headers::do_size): New method definition.
e1df38aa 13109 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13110 Output_file_header::do_size and call it.
13111 (Output_file_header::do_size): New method definition.
13112 (Output_data_group::Output_data_group): Adjust call to
13113 Output_section_data.
13114 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13115 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13116 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13117 RELAXED_INPUT_SECTION_CODE.
13118 (Output_section::Output_section): Initialize data member checkpoint_.
13119 (Output_section::~Output_section): Delete checkpoint object pointed
13120 by checkpoint_.
13121 (Output_section::add_input_section): Always add an Input_section if
13122 relaxing.
13123 (Output_section::add_merge_input_section): Add assert.
13124 (Output_section::relax_input_section): New method definition.
13125 (Output_section::set_final_data_size): Set load address to zero for
13126 an unallocated section.
13127 (Output_section::do_address_and_file_offset_have_reset_values):
13128 New method definition.
13129 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13130 Handle relaxed input section.
13131 (Output_section::sort_attached_input_sections): Checkpoint input
13132 section list lazily.
13133 (Output_section::get_input_sections): Change type of input_sections to
13134 list of Simple_input_section pointers. Checkpoint input section list
13135 lazily. Also handle relaxed input sections.
13136 (Output_section::add_input_section_for_script): Take a reference to
13137 a Simple_input_section object instead of Relobj pointer and section
13138 index as parameter. Handle relaxed input sections.
13139 (Output_section::save_states, Output_section::restore_states): New
13140 method definitions.
13141 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13142 (Output_data::is_data_size_fixed): New method definition.
13143 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13144 if it is fixed.
13145 (Output_data::address_and_file_offset_have_reset_values): New method
13146 definition.
13147 (Output_data::do_address_and_file_offset_have_reset_values): New method
13148 definition.
13149 (Output_data::set_data_size): Check that data size is not fixed.
13150 (Output_data::fix_data_size): New method definition.
13151 (Output_data::is_data_size_fixed_): New data member.
13152 (Output_section_headers::set_final_data_size): New method definition.
13153 (Output_section_headers::do_size): New method declaration.
13154 (Output_segment_headers::set_final_data_size): New method definition.
13155 (Output_segment_headers::do_size): New method declaration.
13156 (Output_file_header::set_final_data_size)::New method definition.
13157 (Output_file_header::do_size)::New method declaration.
13158 (Output_section_data::Output_section_data): Add new parameter
13159 is_data_size_fixed and use it to fix data size.
13160 (Output_data_const::Output_data_const): Adjust call to base class
13161 constructor and fix data size.
13162 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13163 base class constructor and fix data size.
13164 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13165 base class constructor and fix data size.
13166 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13167 class constructor and fix data size.
13168 (Output_data_group::set_final_data_size): New method definition.
13169 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13170 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13171 class constructor and fix data size.
13172 (Output_relaxed_input_section): New class definition.
13173 (Output_section::Simple_input_section): New class definition.
13174 (Output_section::get_input_sections): Adjust parameter list.
13175 (Output_section::add_input_section_for_script): Same.
13176 (Output_section::save_states, Output_section::restore_states,
13177 Output_section::do_address_and_file_offset_have_reset_values,
13178 (Output_section::Input_section::Input_section): Handle
13179 RELAXED_INPUT_SECTION_CODE. Add new overload for
13180 Output_relaxed_input_section.
13181 (Output_section::Input_section::is_input_section,
13182 Output_section::Input_section::set_output_section): Handle relaxed
13183 input section.
13184 (Output_section::Input_section::is_relaxed_input_section,
13185 Output_section::Input_section::output_section_data,
13186 Output_section::Input_section::relaxed_input_section): New method
13187 definitions.
13188 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13189 value.
13190 (Output_section::Input_section::u1_): Update comments.
13191 (Output_section::Input_section::u2_): Add new union member poris.
13192 (Output_section::Checkpoint_output_section): New classs definition.
13193 (Output_section::relax_input_section): New method declaration.
13194 (Output_section::checkpoint_): New data member.
13195 (Output_segment): Update comments.
13196 (Output_segment::Output_segment): Un-privatize copy constructor.
13197 (Output_segment::operator=): Un-privatize.
13198 * script-sections.cc (Output_section_element::Input_section_list):
13199 Change element type to Output_section::Simple_input_section.
13200 (Output_section_element_dot_assignment::set_section_addresses):
13201 Register output section data for relaxation clean up.
13202 (Output_data_exression::Output_data_expression): Adjust call to base
13203 constructor to fix data size.
13204 (Output_section_element_data::set_section_addresses): Register
13205 Output_data_expression object for relaxation clean up.
13206 (struct Input_section_info): Replace Relobj pointer and section index
13207 pair with Output_section::Simple_input_section and Convert struct to a
13208 class.
13209 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13210 Input_section_info data member to use accessors.
20e6d0d6
DK
13211 (Output_section_element_input::set_section_addresses): Use layout
13212 parameter. Adjust code to use Output_section::Simple_input_section
13213 and Input_secction_info classes. Register filler for relaxation
13214 clean up.
13215 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13216 and section index pair with Output_section::Simple_input_section
13217 class. Adjust code accordingly.
13218 (Phdrs_element::release_segment): New method definition.
13219 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13220 segment list.
13221 (Script_sections::release_segments): New method definition.
13222 * gold/script-sections.h (Script_sections::release_segments): New
13223 method declaration.
13224 * gold/target.h (Target::may_relax, Target::relax,
13225 Target::do_may_relax, Target::do_relax): New method definitions.
13226
5e445df6
ILT
132272009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13228
13229 * arm.cc (has_signed_unsigned_overflow): New function.
13230 (Arm_relocate_functions::abs8): New function.
13231 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13232 (Target_arm::Scan::global): Likewise.
13233 (Target_arm::relocate::relocate): Likewise.
13234 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13235 Likewise.
13236
8c604651 132372009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13238
13239 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13240 * testsuite/Makefile.in: Regenerate.
13241
1e9cc1c2
NC
132422009-09-11 Nick Clifton <nickc@redhat.com>
13243
13244 * po/gold.pot: Updated by the Translation project.
13245
6a89f575
CC
132462009-09-08 Cary Coutant <ccoutant@google.com>
13247
13248 * output.cc (Output_file::open): Add execute permission to empty file.
13249 * testsuite/Makefile.am (permission_test): New test.
13250 * testsuite/Makefile.in: Regenerate.
13251
fdcac5af
ILT
132522009-09-02 Ian Lance Taylor <iant@google.com>
13253
13254 * output.cc (Output_file::resize): Call map_no_anonymous rather
13255 than map.
13256
44453f85
ILT
132572009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13258
13259 * gold.cc: Include "incremental.h".
13260 (queue_initial_tasks): Call Incremental_checker methods.
13261 * incremental.cc: Include "output.h".
13262 (Incremental_checker::can_incrementally_link_output_file): New
13263 method.
13264 * incremental.h (Incremental_checker): New class.
13265
13266 * output.cc (Output_file::open_for_modification): New method.
13267 (Output_file::map_anonymous): Changed return type to bool. Record
13268 map in base_ field.
13269 (Output_file::map_no_anonymous): New method, broken out of map.
13270 (Output_file::map): Use map_no_anonymous and map_anonymous.
13271 * output.h (class Output_file): Update declarations.
13272
293c1386
CC
132732009-08-24 Cary Coutant <ccoutant@google.com>
13274
13275 * options.h (Command_line::Pre_options): New class.
13276 (Command_line::pre_options): New member.
13277 * options.cc (gold::options::ready_to_register): New variable.
13278 (One_option::register_option): Do nothing if not registering options.
13279 Assert if same short option registered twice.
13280 (General_options::General_options): Turn off option registration when
13281 done constructing.
13282 (Command_line::Pre_options::Pre_options): New constructor.
13283
f773f3d2
CC
132842009-08-24 Cary Coutant <ccoutant@google.com>
13285
06a73cfe
CC
13286 * options.h (General_options::no_keep_memory): Remove incorrect
13287 short option.
f773f3d2 13288
a15af8e2
RW
132892009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13290
13291 * Makefile.am (am__skiplex, am__skipyacc): New.
13292 * Makefile.in: Regenerate.
13293
c462b41b
RW
132942009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13295
14ec8efd
RW
13296 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13297 (INCLUDES): ... this.
13298 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13299 (AM_CPPFLAGS): Renamed from ...
13300 (INCLUDE): ... this.
13301 * Makefile.in, testsuite/Makefile.in: Regenerate.
13302
81ecdfbb
RW
13303 * Makefile.in: Regenerate.
13304 * aclocal.m4: Likewise.
13305 * config.in: Likewise.
13306 * configure: Likewise.
13307 * testsuite/Makefile.in: Likewise.
13308
c462b41b
RW
13309 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13310 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13311 * Makefile.in: Regenerate.
13312 * testsuite/Makefile.in: Regenerate.
13313
2da73f13
CC
133142009-08-19 Cary Coutant <ccoutant@google.com>
13315
13316 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13317 symbols in shared libraries overridden by hidden or internal symbols
13318 in the main program.
13319
2db70501
CD
133202009-08-19 Chris Demetriou <cgd@google.com>
13321
13322 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13323 checking source file names in error messages.
13324
f733487b
DK
133252009-08-18 Doug Kwan <dougkwan@google.com>
13326
13327 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13328 an elcpp::Ehdr as parameter. Adjust call to set_target.
13329 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13330 an elfcpp::Ehdr as parameter.
13331 * object.cc (Object::set_target): Remove the version that looks up
13332 a target and sets it.
13333 (Sized_relobj::setup): Take a Target object instead of
13334 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13335 (make_elf_sized_object): Find target and ask target to
13336 make an ELF object.
13337 * object.h: (Object::set_target): Remove the version that looks up
13338 a target and sets it.
13339 (Sized_relobj::setup): Take a Target object instead of
13340 an elfcpp:Ehdr as parameter.
13341 * target.cc: Include dynobj.h.
13342 (Target::do_make_elf_object_implementation): New.
2e702c99 13343 (Target::do_make_elf_object): New.
f733487b
DK
13344 * target.h (Target::make_elf_object): New template declaration.
13345 (Target::do_make_elf_object): New method declarations.
13346 (Target::do_make_elf_object_implementation): New template declaration.
13347
cc70f101
ILT
133482009-08-14 Ian Lance Taylor <iant@google.com>
13349
13350 * gold.h (FUNCTION_NAME): Define.
13351 (gold_unreachable): Use FUNCTION_NAME.
13352
ef5e0cb1
ST
133532009-08-12 Sriraman Tallam <tmsriram@google.com>
13354
13355 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13356 symbol in the --keep-unique list is not found.
13357
48c187ce
ST
133582009-08-12 Sriraman Tallam <tmsriram@google.com>
13359
13360 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13361 been maked as --keep-unique.
13362 (Icf::unfold_section): New function.
13363 * icf.h (Icf::unfold_section): New function.
13364 * options.h (General_options::keep_unique): New option.
13365 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13366 * testsuite/Makefile.in: Regenerate.
13367 * testsuite/icf_keep_unique_test.sh: New file.
13368 * testsuite/icf_keep_unique_test.cc: New file.
13369
645afe0c
CC
133702009-08-12 Cary Coutant <ccoutant@google.com>
13371
13372 PR 10471
13373 * resolve.cc (Symbol_table::resolve): Check for references from
13374 dynamic objects to hidden and internal symbols.
13375 * testsuite/Makefile.am (hidden_test.sh): New test.
13376 * testsuite/Makefile.in: Regenerate.
13377 * testsuite/hidden_test.sh: New script.
13378 * testsuite/hidden_test_1.c: New test source.
13379 * testsuite/hidden_test_main.c: New test source.
13380
11af873f
DK
133812009-08-11 Doug Kwan <dougkwan@google.com>
13382
13383 * arm.cc: Update comments.
13384 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13385 segment to locate the .ARM.exidx section if present.
13386
b9f7d72d
DK
133872009-08-09 Doug Kwan <dougkwan@google.com>
13388
13389 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13390 patch.
13391
ddd3c53c
ST
133922009-08-07 Sriraman Tallam <tmsriram@google.com>
13393 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13394 compiler warnings.
13395
27721062
ST
133962009-08-06 Sriraman Tallam <tmsriram@google.com>
13397
13398 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13399 valid tls_segment only for non-debug-section relocations.
13400 * testsuite/Makefile.am: Add gc_tls_test.
13401 * testsuite/Makefile.in: Regenerate.
13402 * testsuite/gc_tls_test.cc: New file.
13403 * testsuite/gc_tls_test.sh: New file.
13404
ef15dade 134052009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13406
ef15dade
ST
13407 * icf.cc: New file.
13408 * icf.h: New file.
13409 * Makefile.am (CCFILES): Add icf.cc.
13410 (HFILES): Add icf.h
13411 * Makefile.in: Regenerate.
13412 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13413 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13414 section, symbol and addend information for the relocs.
13415 * gold.cc (queue_middle_tasks): Call identical code folding.
13416 * gold.h: Add defines for multimap.
13417 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13418 to the call of finalize_local_symbols.
13419 * main.cc (main): Create object of class Icf.
13420 * object.cc (Sized_relobj::do_layout): Allow this function to be
13421 called twice during icf.
13422 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13423 to sections marked as identical by icf.
13424 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13425 when available.
13426 (Sized_relobj::do_section_entsize): New function.
13427 * object.h (Object::section_entsize): New function.
13428 (Object::do_section_entsize): New pure virtual function.
13429 (Relobj::finalize_local_symbols): Add new parameter.
13430 (Relobj::do_section_entsize): New function.
13431 * options.h (General_options::icf): New option.
13432 (General_options::icf_iterations): New option.
13433 (General_options::print_icf_sections): New option.
13434 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13435 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13436 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13437 icf.
13438 * symtab.cc (Symbol_table::is_section_folded): New function.
13439 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13440 to sections marked as identical by icf.
13441 * symtab.h (Symbol_table::set_icf): New function.
13442 (Symbol_table::icf): New function.
13443 (Symbol_table::is_section_folded): New function.
13444 (Symbol_table::icf_): New data member.
13445 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13446 * testsuite/Makefile.am: Add commands to build icf_test.
13447 * testsuite/Makefile.in: Regenerate.
13448 * testsuite/icf_test.sh: New file.
13449 * testsuite/icf_test.cc: New file.
13450
c3b65ac4
CD
134512009-07-24 Chris Demetriou <cgd@google.com>
13452
13453 * layout.cc (is_compressible_debug_section): Fix incorrect
13454 comment about compressed section names.
13455
1caf2c51
ILT
134562009-07-20 Ian Lance Taylor <ian@airs.com>
13457
13458 PR 10419
13459 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13460
1ef4d87f
ILT
134612009-07-16 Ian Lance Taylor <iant@google.com>
13462
13463 PR 10400
13464 * layout.h: #include <map>.
13465 (class Kept_section): Change from struct to class. Add accessors
13466 and setters. Add section size to Comdat_group mapping. Change
13467 Comdat_group to std::map. Add is_comdat_ field. Add
13468 linkonce_size field in union.
13469 (class Layout): Update declaration of find_or_add_kept_section.
13470 Don't declare find_kept_object.
13471 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13472 parameter. Add object, shndx, is_comdat, and is_group_name
13473 parameters. Change all callers. Adjust for new Kept_section.
13474 (Layout::find_kept_object): Remove.
13475 * object.cc (Sized_relobj::include_section_group): Update use of
13476 Kept_section. Rename secnum to shndx. Only record
13477 Kept_comdat_section if sections are the same size.
13478 (Sized_relobj::include_linkonce_section): Update use of
13479 Kept_section. Only record Kept_comdat_section if sections are the
13480 same size. Set size of linkonce section.
13481 (Sized_relobj::map_to_kept_section): Update call to
13482 get_kept_comdat_section.
13483 * object.h (class Sized_relobj): Rename fields in
13484 Kept_comdat_section to drop trailing underscores; change object
13485 field to Relobj*. Change Kept_comdat_section_table to store
13486 struct rather than pointer.
13487 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13488 Add kept_object and kept_shndx parameters. Change all callers.
13489 (Sized_relobj::get_kept_comdat_section): Change return type to
13490 bool. Add kept_object and kept_shndx parameters. Change all
13491 callers.
13492 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13493 Layout::find_or_add_kept_section.
13494
37c3b7b0
ILT
134952009-07-09 Ian Lance Taylor <iant@google.com>
13496
13497 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13498 Reserve space in the hash table.
13499
98fa85cb
ILT
135002009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13501
13502 * fileread.cc (File_read::get_mtime): New method.
13503 * fileread.h (Timespec): New structure.
13504 (File_read::get_mtime): New method.
13505 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13506 Renamed from timestamp_nsec.
13507 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13508 Elf_Xword.
e1df38aa 13509 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13510 timestamp_nsec.
e1df38aa 13511 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13512 (Incremental_inputs::report_obejct): Save mtime; style fix.
13513 (Incremental_inputs::report_script): Save mtime; style fix.
13514 (Incremental_inputs::finalize_inputs): Style fix.
13515 (Incremental_inputs::finalize): Style fix.
13516 (Incremental_inputs::create_input_section_data): Store inputs
13517 mtime.
13518 * incremental.h (Incremental_inputs::report_script): Add mtime
13519 argument.
13520 (Incremental_inputs::Input_info::Input_info): Intialize only one
13521 union member.
13522 (Incremental_inputs::Input_info::archive): Move to nameless
13523 union.
13524 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13525 (Incremental_inputs::Input_info::script): Move to nameless union.
13526 (Incremental_inputs::mtime): New field.
13527 * script.cc (read_input_script): Pass file mtime to
13528 Incremental_input.
13529 * script.h (Script_info::inputs): Style fix.
13530
c9d70757
ILT
135312009-07-01 Ian Lance Taylor <ian@airs.com>
13532
13533 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13534 instead of 32.
13535
9c547ec3
ILT
135362009-06-24 Ian Lance Taylor <iant@google.com>
13537
13538 PR 10156
13539 * layout.cc (Layout::choose_output_section): If we find an
13540 existing section, update the flags.
13541 (Layout::create_notes): New function, broken out of
13542 Layout::finalize.
13543 (Layout::finalize): Don't create note sections.
13544 (Layout::create_note): Don't crash if linker script discards
13545 section.
13546 (Layout::create_gold_note): Likewise.
13547 (Layout::create_build_id): Likewise. Don't set
13548 after_input_sections on the section.
13549 (Layout::create_executable_stack_info): Remove target parameter.
13550 Change caller.
13551 * layout.h (class Layout): Declare create_notes. Update
13552 declaration of create_executable_stack_info.
13553 * gold.cc (queue_middle_tasks): Call create_notes.
13554 * output.cc (Output_section::update_flags_for_input_section): Move
13555 here from output.h. If SHF_ALLOC flag is newly set, mark address
13556 invalid.
13557 * output.h (Output_data::mark_address_invalid): New function.
13558 (class Output_section): Only declare, not define,
13559 update_flags_for_input_section. Remove set_flags.
13560
55458500
ILT
135612009-06-24 Ian Lance Taylor <iant@google.com>
13562
13563 * script-sections.cc (Output_section_definition::
13564 set_section_addresses): Rename shadowing local load_address to
13565 laddr.
13566
1307d6cd
ILT
135672009-06-24 Ian Lance Taylor <iant@google.com>
13568
13569 PR 10244
13570 * reloc.cc (relocate_sections): Skip empty relocation sections.
13571
ec3f783e
ILT
135722009-06-23 Ian Lance Taylor <iant@google.com>
13573
13574 PR 10156
13575 * layout.cc (Layout::create_note): Use choose_output_section
13576 rather than make_output_section.
13577
459c9f1c
ILT
135782009-06-23 Ian Lance Taylor <iant@google.com>
13579
13580 PR 10237
13581 * options.cc (General_options::parse_V): Set printed_version_.
13582 (General_options::General_options): Initialize printed_version_.
13583 * options.h (class General_options): Add printed_version_ field.
13584 * gold.cc (queue_initial_tasks): If there are no input files,
13585 don't give a fatal error if we printed the version information.
13586 (queue_middle_tasks): If using -r with a shared object, give a
13587 fatal error rather than an ordinary error.
13588
1518dc8f
ILT
135892009-06-23 Ian Lance Taylor <iant@google.com>
13590
13591 PR 10219
13592 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13593 (Layout::make_output_section): Set have_stabstr_section_ if we see
13594 a .stab*str section.
13595 (Layout::finalize): Call link_stabs_sections.
13596 (Layout::link_stabs_sections): New file.
13597 * layout.h (class Layout): Add have_stabstr_section_ field.
13598 Declare link_stabs_sections.
13599
3d857b98
DK
136002009-06-23 Doug Kwan <dougkwan@google.com>
13601
13602 * Makefile.am (libgold_a_LIBADD): New.
13603 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13604 * Makefile.in: Regenerate.
3d857b98
DK
13605 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13606 * configure: Regenerate.
13607 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13608 * fileread.cc: Include sys/state.h
13609 * gold.h: Declare memmem and strndup if found missing.
13610 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13611
0639a6f6
ILT
136122009-06-23 Ian Lance Taylor <iant@google.com>
13613
13614 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13615 * configure: Rebuild.
13616
8d63875c
ILT
136172009-06-23 Ian Lance Taylor <iant@google.com>
13618
13619 PR 10147
13620 * object.cc (Object::section_contents): Don't try to get a view if
13621 the section has length zero.
13622 (Object::handle_gnu_warning_section): If the section is empty, use
13623 the name of the section as the warning.
13624
f7c8a183
ILT
136252009-06-23 Ian Lance Taylor <iant@google.com>
13626
13627 PR 10133
13628 * stringpool.h (class Stringpool_template): Add optimize_ field.
13629 (Stringpool_template::set_optimize): New function.
13630 * stringpool.cc (Stringpool_template::Stringpool_template):
13631 Initialize optimize_ field.
13632 (Stringpool_template::set_string_offsets): Test local optimize
13633 fild rather than parameter.
13634 * layout.cc (Layout::Layout): Call set_optimize on the section
13635 name stringpool.
13636
e6a307ba
ILT
136372009-06-22 Ian Lance Taylor <iant@google.com>
13638
13639 PR 10030
13640 * yyscript.y: Parse TARGET.
13641 * script.cc (script_set_target): New function.
13642 * script-c.h (script_set_target): Declare.
13643 * options.cc (General_options::string_to_object_format): Rename
13644 from string_to_object_format in anonymous namespace. Change
13645 callers.
13646 * options.h (class General_options): Declare
13647 string_to_object_format.
13648
3ee173de
ILT
136492009-06-22 Ian Lance Taylor <iant@google.com>
13650
13651 * script-sections.cc (Script_sections::create_segments): Don't put
13652 program headers in a PT_LOAD segment if -n or -N.
13653
136542009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13655
13656 PR 10141
13657 * options.h (class General_options): Add -z lazy and -z now. Sort
13658 -z options into alphabetical order.
13659 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13660
cd6739a1 136612009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13662
13663 * layout.cc (Layout::make_output_section): Call
13664 Target::new_output_section.
13665 (Layout::attach_allocated_section_to_segment): Put large section
13666 sections in a separate load segment with the large segment flag
13667 set.
13668 (Layout::segment_precedes): Sort large data segments after other
13669 load segments.
13670 (align_file_offset): New static function.
13671 (Layout::set_segment_offsets): Use align_file_offset.
13672 * output.h (class Output_section): Add is_small_section_ and
13673 is_large_section_ fields.
13674 (Output_section::is_small_section): New function.
13675 (Output_section::set_is_small_section): New function.
13676 (Output_section::is_large_section): New function.
13677 (Output_section::set_is_large_section): New function.
13678 (Output_section::is_large_data_section): New function.
13679 (class Output_segment): Add is_large_data_segment_ field.
13680 (Output_segment::is_large_data_segment): New function.
13681 (Output_segment::set_is_large_data_segment): New function.
13682 * output.cc (Output_section::Output_section): Initialize new
13683 fields.
13684 (Output_segment::Output_segment): Likewise.
13685 (Output_segment::add_output_section): Add assertion that large
13686 data sections always go in large data segments. Force small data
13687 sections to the end of the list of data sections. Force small BSS
13688 sections to the start of the list of BSS sections. For large BSS
13689 sections to the end of the list of BSS sections.
13690 * symtab.h (class Symbol): Declare is_common_shndx.
13691 (Symbol::is_defined): Check Symbol::is_common_shndx.
13692 (Symbol::is_common): Likewise.
13693 (class Symbol_table): Define enum Commons_section_type. Update
13694 declarations. Add small_commons_ and large_commons_ fields.
13695 * symtab.cc (Symbol::is_common_shndx): New function.
13696 (Symbol_table::Symbol_table): Initialize new fields.
13697 (Symbol_table::add_from_object): Put small and large common
13698 symbols in the right list.
13699 (Symbol_table::sized_finalized_symbol): Check
13700 Symbol::is_common_shndx.
13701 (Symbol_table::sized_write_globals): Likewise.
13702 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13703 common symbol lists. Don't call do_allocate_commons_list if the
13704 list is empty.
13705 (Symbol_table::do_allocate_commons_list): Remove is_tls
13706 parameter. Add comons_section_type parameter. Change all
13707 callers. Handle small and large common symbols.
13708 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13709 Symbol::is_common_shndx.
13710 * resolve.cc (symbol_to_bits): Likewise.
13711 * target.h (Target::small_common_shndx): New function.
13712 (Target::small_common_section_flags): New function.
13713 (Target::large_common_shndx): New function.
13714 (Target::large_common_section_flags): New function.
13715 (Target::new_output_section): New function.
13716 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13717 small_common_section_flags, and large_common_section_flags
13718 fields.
13719 (Target::do_new_output_section): New virtual function.
13720 * arm.cc (Target_arm::arm_info): Initialize new fields.
13721 * i386.cc (Target_i386::i386_info): Likewise.
13722 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13723 Likewise.
13724 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13725 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13726 (Target_x86_64::do_new_output_section): New function.
13727 * configure.ac: Define conditional MCMODEL_MEDIUM.
13728 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13729 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13730 (large_LDFLAGS): Define.
13731 * testsuite/large.c: New file.
13732 * testsuite/testfile.cc (Target_test::test_target_info):
13733 Initialize new fields.
13734 * configure, testsuite/Makefile.in: Rebuild.
13735
bb04269c
DK
137362009-06-05 Doug Kwan <dougkwan@google.com>
13737
13738 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13739 * Makefile.in: Regenerate.
bb04269c
DK
13740 * i386.cc (class Target_i386): Define new virtual method to
13741 override do_is_local_label_name in parent.
13742 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13743 local symbols if --discard-locals or -X is given.
13744 * options.h (class General_options): Declare new options
13745 '--discard-locals' and '-X' for discarding locals.
13746 * target.h (class Target): Define new methods is_local_label_name.
13747 Declare new virtual method do_is_local_label_name.
13748 * target.cc: New file.
13749 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13750 (check_SCRIPTS): Add discard_locals_test.sh.
13751 (check_DATA): Add discard_local_tests.syms.
13752 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13753 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13754 * testsuite/Makefile.in: Regenerate.
13755 * testsuite/discard_locals_test.c: New file.
13756 * testsuite/discard_locals_test.sh: Same.
13757
805bb01c
DK
137582009-06-05 Doug Kwan <dougkwan@google.com>
13759
13760 * object.cc (Sized_relobj::Sized_relobj): Initialize
13761 discarded_eh_frame_shndx_ to -1U.
13762 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13763 section.
13764 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13765 a discarded .eh_frame section.
13766 (Sized_relobj::do_finalize_local_symbols): Ditto.
13767 * object.h (class Sized_relobj): Declare new member
13768 discarded_eh_frame_shndx_.
13769 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13770 (local_labels_test.o, local_labels_test): New rules.
13771 * testsuite/Makefile.in: Regenerate.
13772
1dcd334d
DK
137732009-06-04 Doug Kwan <dougkwan@google.com>
13774
13775 * layout.cc (Layout::section_name_mapping): Add mapping for
13776 special ARM sections.
13777
96d49306
DK
137782009-06-03 Doug Kwan <dougkwan@google.com>
13779
13780 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13781 (utils::has_overflow): Same.
13782
dff16297
ILT
137832009-06-03 Ian Lance Taylor <iant@google.com>
13784
13785 * layout.cc (Layout::section_name_mapping): New array, replacing
13786 Layout::linkonce_mapping.
13787 (Layout::section_name_mapping_count): New variable, replacing
13788 Layout::linkonce_mapping_count.
13789 (Layout::linkonce_output_name): Remove.
13790 (Layout::output_section_name): Rewrite.
13791 * layout.h (class Layout): Rename Linkonce_mapping to
13792 Section_name_mapping, linkonce_mapping to section_name_mapping,
13793 linkonce_mapping_count to section_name_mapping_count. Don't
13794 declare linkonce_output_name.
13795
c121c671
DK
137962009-06-03 Doug Kwan <dougkwan@google.com>
13797
13798 * gold/arm.cc (namespace utils): New.
13799 (Target_arm::reloc_is_non_pic): Define new method.
13800 (class Arm_relocate_functions): New.
13801 (Target_arm::Relocate::relocate): Handle relocation types used by
13802 Android.
13803
07800fab
ILT
138042009-06-03 Ian Lance Taylor <iant@google.com>
13805
13806 * arm.cc (Target_arm::scan::global): Use || instead of |.
13807
c121c671
DK
138082009-06-02 Doug Kwan <dougkwan@google.com>
13809
13810 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13811 issued_non_pic_error_.
13812 (class Target_arm::Scan): Declare new method check_non_pic.
13813 Define new method symbol_needs_plt_entry.
13814 Declare new data member issued_non_pic_error_.
13815 (class Target_arm::Relocate): Declare new method
13816 should_apply_static_reloc.
13817 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13818 (Target_arm::Scan::check_non_pic): Define new method.
13819 (Target_arm::Scan::local): Handle a small subset of reloc types used
13820 by Android.
13821 (Target_arm::Scan::local): Same.
13822 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13823
b19b0c6d
ILT
138242009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13825
13826 * incremental.cc (Incremental_inputs::report_command_line): Filter
13827 out --incremental-* options.
13828
94cdfcff
DK
138292009-05-29 Doug Kwan <dougkwan@google.com>
13830
13831 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13832 template class.
13833 (class Target_arm): Update comment.
13834 (Target_arm::Target_arm): Initialize new data members GOT_,
13835 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13836 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13837 and Target_arm::rel_dyn_section.
13838 Declare new_enum Target_arm::Got_type.
13839 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13840 and DYNBSS_.
13841 Update commments for member do_dynsym_value.
13842 (Target_arm::got_size, Target_arm::plt_section,
13843 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13844 new methods inside class defintion.
13845 (Target_arm::got_section): Define new method.
13846 (Target_arm::rel_dyn_section): Same.
13847 (Output_data_plt_arm): New template class.
13848 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13849 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13850 (Output_data_plt_arm::add_entry): Same.
13851 (Output_data_plt_arm::first_plt_entry): Define new
13852 static data member for PLT instruction template.
13853 (Output_data_plt_arm::plt_entry): Same.
13854 (Output_data_plt_arm::do_write): Define new method.
13855 (Target_arm::make_plt_entry): Same.
13856 (Target_arm::do_finalize_sections): Same.
13857 (Target_arm::do_dynsym_value): Same.
13858
4a657b0d
DK
138592009-05-28 Doug Kwan <dougkwan@google.com>
13860
13861 * Makefile.am (TARGETSOURCES): Add arm.cc.
13862 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13863 * Makefile.in: Regenerate.
13864 * arm.cc: New file.
13865 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13866
e7ae8c36
DK
138672009-05-26 Doug Kwan <dougkwan@google.com>
13868
13869 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13870 (General_options::check_excluded_libs): Strip off directories in
13871 archive name before matching like GNU ld does.
13872 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13873 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13874 (exclude_libs_test_LDFLAGS): Add linker option
13875 -Wl,--exclude-libs,libexclude_libs_test_3
13876 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13877 an explicit archive without using -l.
13878 (alt/libexclude_libs_test_3.a): New make rule.
13879 * testsuite/Makefile.in: Regenerate.
13880 * testsuite/exclude_libs_test.c : Declare lib3_default().
13881 (main): Call it.
13882 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13883 * exclude_libs_test_3.c: New file.
13884
f12e7348
NC
138852009-05-26 Nick Clifton <nickc@redhat.com>
13886
13887 * po/id.po: New Indonesian translation.
13888 * po/gold.pot: Updated template file.
13889
4daadc0d
ST
138902009-05-22 Sriraman Tallam <tmsriram@google.com>
13891
e1df38aa 13892 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13893 gc_comdat_test files. Add -Wl,--gc-sections to build
13894 gc_comdat_test.
13895 * testsuite/Makefile.in: Regenerate.
13896 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13897
531813ad
ST
138982009-05-21 Sriraman Tallam <tmsriram@google.com>
13899
13900 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13901 kept comdat section was garbage collected.
13902 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13903 * testsuite/Makefile.in: Regenerate.
13904 * testsuite/gc_comdat_test.sh: New file.
13905 * testsuite/gc_comdat_test_1.cc: New file.
13906 * testsuite/gc_comdat_test_2.cc: New file.
13907
65514900
CC
139082009-05-19 Doug Kwan <dougkwan@google.com>
13909
13910 * archive.cc (Archive::Archive): Move constructor from archive.h
13911 to here. Initialize no_export_.
13912 (Archive::get_elf_object_for_member): Set no_export flag of object.
13913 * archive.h (Archive::Archive): Move constructor body to
13914 archive.cc.
13915 (Archive::no_export): New method.
13916 (Archive::no_export_): New field.
13917 * object.h (Object::Object): Initialize no_export_ to false.
13918 (Object::no_export, Object::set_no_export): New methods.
13919 (Object::no_export_): New field.
13920 * options.cc (General_options::parse_exclude_libs): New method.
13921 (General_options::check_excluded_libs) Same.
13922 * options.h (exclude_libs): New option.
13923 (General_options::check_excluded_libs): New method declaration.
13924 (General_options::excluded_libs_): New field.
13925 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13926 default or protected visibility if an object has no-export flag set.
13927 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13928 (check_SCRIPTS): Add exclude_libs_test.sh.
13929 (check_DATA): Add exclude_libs_test.syms.
13930 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13931 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13932 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13933 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13934 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13935 libexclude_libs_test_2.a): New rules.
13936 * testsuite/Makefile.in: Regenerate.
13937 * testsuite/exclude_libs_test.c: New file.
13938 * testsuite/exclude_libs_test.sh: Ditto.
13939 * testsuite/exclude_libs_test_1.c: Ditto.
13940 * testsuite/exclude_libs_test_2.c: Ditto.
13941
1b77ea50
ILT
139422009-05-15 Ian Lance Taylor <iant@google.com>
13943
13944 * configure.ac: Check for declarations for cases where libiberty.h
13945 checks HAVE_DECL_xxx.
13946 * configure, config.in: Rebuild.
13947
072fe7ce
ILT
139482009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13949
13950 * gold.h (Incremental_argument_list): Remove (invalid) forward
13951 declaration.
13952 * incremental.cc (Incremental_inputs::report_achive): New method.
13953 (Incremental_inputs::report_object): New method.
13954 (Incremental_inputs::report_script): New method.
13955 (Incremental_inputs::finalize_inputs): New method.
13956 (Incremental_inputs::finalize): Call finalize_inputs().
13957 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13958 Create inputs entries.
13959 * incremental.h (Incremental_input_type): New enum.
13960 (Incremental_inputs::Incremental_input): Initialize new fields.
13961 (Incremental_inputs::report_inputs): New method.
13962 (Incremental_inputs::report_achive): New method.
13963 (Incremental_inputs::report_object): New method.
13964 (Incremental_inputs::report_script): New method.
13965 (Incremental_inputs::finalize_inputs): New method.
13966 (Incremental_inputs::Input_info): New struct.
13967 (Incremental_inputs::Input_info_map): New typedef.
13968 (Incremental_inputs::lock_): New field.
13969 (Incremental_inputs::Inputs_): New field.
13970 (Incremental_inputs::Inputs_map): New field.
13971 * main.cc (main): Call Incremental_input::report_inputs.
13972 * options.h (Input_argument_list): Typedef moved from
13973 Input_arguments.
13974 (Input_file_group::Files): Remove, use ::Input_argument_list.
13975 (Input_file_group::Input_argument_list): Remove, use
13976 ::Input_argument_list.
13977 * plugin.cc (Plugin_manager::add_input_file): Add error in
13978 incremental build.
13979 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13980 functions.
13981 * script.cc (read_input_script): Call
13982 Incremental_input::report_script.
13983 * script.h (Script_info): New class.
13984
b0481b0b
ILT
139852009-04-27 Ian Lance Taylor <iant@google.com>
13986
13987 * x86_64.cc (do_adjust_output_section): Set entsize to
13988 plt_entry_size.
13989
b22a5a41 139902009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13991
13992 * output.cc (Output_file::close): After short writes, continue
13993 writing from the correct offset in the buffer being written.
13994
40fde488
CD
139952009-04-23 Chris Demetriou <cgd@google.com>
13996
13997 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13998 * configure: Regenerate.
13999 * config.in: Regenerate.
14000 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14001 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14002
3ce2c28e
ILT
140032009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14004
14005 * incremental.cc (Incremental_inputs_header_data): Renamed from
14006 Incremental_input_header_data.
14007 (Incremental_inputs_header_data::data_size): New field.
14008 (Incremental_inputs_header_data::put_input_file_count): Renamed
14009 from input_file_count.
14010 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14011 from command_line_offset.
14012 (Incremental_inputs_header_data::put_reserved): Renamed from
14013 put_reserved.
14014 (Incremental_inputs_entry_data): Renamed from
14015 Incremental_input_entry_data.
14016 (Incremental_inputs_entry_data::data_size): New field.
14017 (Incremental_inputs::report_command_line): New method.
14018 (Incremental_inputs::finalize): New method.
14019 (Incremental_inputs::create_incremental_inputs_data): New method.
14020 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14021 * incremental.h: New file.
14022 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14023 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14024 incremental builds.
703d02da 14025 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14026 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14027 (Layout::create_incremental_info_sections): New method.
14028 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14029 * main.cc (main): Notify Incremental_input of the command line.
14030
e55bde5e
ILT
140312009-04-01 Ian Lance Taylor <iant@google.com>
14032 Mikolaj Zalewski <mikolajz@google.com>
14033
14034 * gold.h (reserve_unordered_map): Define, three versions, one for
14035 each version of Unordered_map.
14036 * layout.cc (Layout::Layout): Remove options parameter. Add
14037 number_of_input_files parameter. Don't initialize options_.
14038 Initialize number_of_input_files_ and resized_signatures_. Move
14039 sections_are_attached_.
14040 (Layout::layout_group): Reserve space for group_signatures_.
14041 (Layout::find_or_add_kept_section): Change name parameter to be a
14042 reference. Resize signatures_ map when it gets large enough.
14043 (Layout::layout_eh_frame): Use parameters->options() instead of
14044 this->options_.
14045 (Layout::make_output_section): Likewise.
14046 (Layout::attach_allocated_section_to_segment): Likewise.
14047 (Layout::finalize, Layout::create_executable_stack): Likewise.
14048 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14049 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14050 * layout.h (class Layout): Update declarations. Remove options_
14051 field. Add number_of_input_files_ and resized_signatures_
14052 fields. Move sections_are_attached_ field.
14053 * main.cc (main): Pass number of input files to Layout
14054 constructor. Don't pass options.
14055
154b857c
ILT
140562009-03-30 Ian Lance Taylor <iant@google.com>
14057
14058 * ffsll.c (ffsll): Correct implementation.
14059
2f35ab9b
ILT
140602009-03-27 Ian Lance Taylor <iant@google.com>
14061
fd03461a
ILT
14062 * ffsll.c: New file.
14063 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14064 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14065 * ftruncate.c (ftruncate): Declare before definition.
14066 * mremap.c (mremap): Likewise.
14067 * pread.c (pread): Likewise.
14068 * configure, Makefile.in, config.in: Rebuild.
14069
2f35ab9b
ILT
14070 * mremap.c: New file.
14071 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14072 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14073 (mremap): Declare if HAVE_MREMAP is not defined.
14074 * configure, Makefile.in, config.in: Rebuild.
14075
33aea2fd
CC
140762009-03-27 Cary Coutant <ccoutant@google.com>
14077
14078 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14079 position independent.
14080 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14081 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14082
6d479619
CC
140832009-03-24 Cary Coutant <ccoutant@google.com>
14084
14085 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14086 an executable.
14087 (needs_dynamic_reloc): Likewise.
14088
afc06bb8
ILT
140892009-03-24 Ian Lance Taylor <iant@google.com>
14090
14091 * yyscript.y (file_cmd): Recognize EXTERN.
14092 (extern_name_list, extern_name_list_body): New nonterminals.
14093 * script.cc (script_add_extern): Define.
14094 * script-c.h (script_add_extern): Declare.
14095
f6060a4d
ILT
140962009-03-24 Rafael Avila de Espindola <espindola@google.com>
14097
14098 * object.cc (is_elf_object): Define.
14099 * object.h (is_elf_object): Declare.
14100 * archive.cc (Archive::get_elf_object_for_member): Call
14101 is_elf_object.
33aea2fd 14102 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14103
26736d8e
ILT
141042009-03-24 Elliott Hughes <enh@google.com>
14105
14106 * output.cc (Output_file::map_anonymous): Define.
14107 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14108 try an anonymous one. Report the size if the mmap fails.
14109 * output.h (class Output_file): Declare map_anonymous.
14110
22fd9730
ILT
141112009-03-24 Ian Lance Taylor <iant@google.com>
14112
14113 * target-select.cc (instantiate_target): Don't acquire the lock if
14114 the instantiated_target_ field has already been set.
14115
cb010894
ILT
141162009-03-23 Ian Lance Taylor <iant@google.com>
14117
7f055c20
ILT
14118 * gold-threads.h (class Initialize_lock): Define.
14119 * gold-threads.cc (class Initialize_lock_once): Define.
14120 (initialize_lock_control): New static variable.
14121 (initialize_lock_pointer): New static variable.
14122 (initialize_lock_once): New static function.
14123 (Initialize_lock::Initialize_lock): Define.
14124 (Initialize_lock::initialize): Define.
14125 * target-select.h: Include "gold-threads.h".
14126 (class Target_selector): Add lock_ and initialize_lock_ fields.
14127 Don't define instantiate_target, just declare it.
14128 * target-select.cc (Target_selector::Target_selector): Initialize
14129 new fields.
14130 (Target_selector::instantiate_target): Define.
14131 * descriptors.h: Include "gold-threads.h".
14132 (class Descriptors): Add initialize_lock_ field.
14133 * descriptors.cc (Descriptors::Descriptors): Initialize new
14134 field.
14135 (Descriptors::open): Use initialize_lock_ field
14136 * errors.h (class Errors): Add initialize_lock_ field.
14137 * errors.cc (Errors::Errors): Initialize new field.
14138 (Errors::initialize_lock): Use initialize_lock_ field.
14139 * powerpc.cc (class Target_selector_powerpc): Remove
14140 instantiated_target_ field. In do_recognize call
14141 instantiate_target rather than do_instantiate_target. In
14142 do_instantiate_target just allocate a new target.
14143 * sparc.cc (class Target_selector_sparc): Likewise.
14144
36959681
ILT
14145 * freebsd.h: New file.
14146 * i386.cc: Include "freebsd.h".
14147 (Target_i386): Derive from Target_freebsd rather than
14148 Sized_target.
14149 (Target_selector_i386): Derive from Target_selector_freebsd rather
14150 than Target_selector.
14151 * x86_64.cc: Include "freebsd.h".
14152 (Target_x86_64): Derive from Target_freebsd rather than
14153 Sized_target.
14154 (Target_selector_x86_64): Derive from Target_selector_freebsd
14155 rather than Target_selector.
14156 * target.h (class Target): Add adjust_elf_header and
14157 do_adjust_elf_header.
14158 * output.cc (Output_file_header:: do_sized_write): Call target
14159 adjust_elf_header routine.
14160 * configure.tgt: Set targ_osabi.
14161 * configure.ac: Define GOLD_DEFAULT_OSABI.
14162 * parameters.cc (Parameters::default_target): Pass
14163 GOLD_DEFAULT_OSABI to select_target.
14164 * target-select.h (class Target_selector): Make instantiate_target
14165 protected rather than private.
14166 * Makefile.am (HFILES): Add freebsd.h.
14167 * configure, Makefile.in, config.in: Rebuild.
14168
cb010894
ILT
14169 * merge.cc (do_add_input_section): Correct pend value. Change
14170 message about last entry not being null terminated from error to
14171 warning.
14172
0e879927
ILT
141732009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14174
14175 * incremental.cc: New file.
14176 * Makefile.am (CCFILES): Add incremental.cc.
14177 * Makefile.in: Rebuild.
14178
41105937
PP
141792009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14180
14181 * layout.cc (Layout::output_section_name): Preserve names
14182 of '.note.' sections.
e1df38aa 14183
60439920
ILT
141842009-03-19 Ian Lance Taylor <iant@google.com>
14185
14186 * descriptors.cc (Descriptors::open): Check that the options are
14187 valid before using them.
14188
0d371ad3
ILT
141892009-03-18 Ian Lance Taylor <iant@google.com>
14190
14191 * script-sections.h: Include <list>.
14192 (class Script_sections): Change Sections_elements from std::vector
14193 to std::list. Typedef public Elements_iterator. Add
14194 orphan_section_placement_, data_segment_align_start_, and
14195 saw_data_segment_align_ fields. Remove data_segment_align_index_
14196 field.
14197 * script-sections.cc (class Orphan_section_placement): New class.
14198 (class Sections_element): Add virtual functions is_relro and
14199 orphan_section_init. Remove virtual function place_orphan_here.
14200 (class Output_section_definition): Add is_relro and
14201 orphan_section_init. Remove place_orphan_here.
14202 (class Orphan_output_section): Likewise.
14203 (Script_sections::Script_sections): Update for field changes.
14204 (Script_sections::data_segment_align): Set saw_data_segment_align_
14205 and data_segment_align_start_, not data_segment_align_index.
14206 (Script_sections::data_segment_relro_end): Check
14207 saw_data_segment_align_. Use data_segment_align_start_ rather
14208 than data_segment_align_index_.
14209 (Script_sections::place_orphan): Rewrite to use
14210 Orphan_section_placement.
14211
9201d894
ILT
142122009-03-17 Ian Lance Taylor <iant@google.com>
14213
9c5b8369
ILT
14214 * archive.cc (Archive::add_symbols): Check for a version attached
14215 to the symbol name in the archive map.
14216 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14217 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14218 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14219 (ver_test_11.a): New target.
14220 * testsuite/Makefile.in: Rebuild.
14221
9201d894
ILT
14222 * configure.ac: Check for chsize and posix_fallocate. Replace
14223 ftruncate.
14224 * ftruncate.c: New file, from gnulib.
14225 * output.cc (posix_fallocate): Define dummy version if not
14226 HAVE_POSIX_FALLOCATE.
14227 (Output_file::map): Call posix_fallocate rather than lseek and
14228 write.
14229 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14230 * configure, Makefile.in, config.in: Rebuild.
14231
ef4ab7a8 142322009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14233
ef4ab7a8
PP
14234 * layout.h (Layout::create_note): Add section_name parameter.
14235 * layout.cc (Layout::create_note): Likewise.
14236 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14237
8c500701
ILT
142382009-03-17 Ian Lance Taylor <iant@google.com>
14239
e85b18e1
ILT
14240 * descriptors.cc: Include "options.h".
14241 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14242 (Descriptors::open): Always use O_CLOEXEC when opening a new
14243 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14244 then set FD_CLOEXEC.
14245
9efe6174
ILT
14246 * sparc.cc (class Target_sparc): Add has_got_section.
14247 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14248 make sure we have a GOT section.
14249
14250 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14251 (Target_sparc::Scan::local): Likewise.
14252 (Target_sparc::Scan::global): Likewise.
14253 (Target_sparc::Relocate::relocate): Likewise.
14254 (Target_sparc::Relocate::relocate_tls): Likewise.
14255
8c500701
ILT
14256 * symtab.cc (Symbol_table::define_default_version): New function,
14257 broken out of add_from_object.
14258 (Symbol_table::add_from_object): Call define_default_version.
14259 (Symbol_table::define_special_symbol): Add resolve_oldsym
14260 parameter. Change all callers. If the version for a symbol comes
14261 from a version script, resolve it with the symbol with the same
14262 name with no version. Also add the symbol without a version if
14263 appropriate.
14264 (do_define_in_output_data): If resolving with oldsym, don't delete
14265 sym.
14266 (do_define_in_output_segment): Likewise.
14267 (do_define_as_constant): Likewise.
14268 * symtab.h (class Symbol_table): Update declarations.
14269
f1ed28fb
ILT
142702009-03-13 Ian Lance Taylor <iant@google.com>
14271
15f8229b
ILT
14272 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14273 (Read_symbols::requeue): New function.
14274 (Read_symbols::do_read_symbols): If make_elf_object fails because
14275 the target type is not configured, and the file was searched for,
14276 issue a warning and retry with the next directory.
14277 (Add_symbols::run): If the file has an incompatible format, and
14278 it was searched for, requeue the Read_symbols task. On error,
14279 release the object.
14280 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14281 dirindex parameter to constructor. Change all callers. Declare
14282 incompatible_warning and requeue.
14283 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14284 input_argument_ and input_group_ fields. Add them to
14285 constructor. Change all callers.
14286 (class Read_script): Add dirindex_ field. Add it to constructor.
14287 Change all callers.
14288 * archive.cc (Archive::setup): Remove input_objects parameter.
14289 Change all callers.
14290 (Archive::get_file_and_offset): Likewise.
14291 (Archive::read_all_symbols): Likewise.
14292 (Archive::read_symbols): Likewise.
14293 (Archive::get_elf_object_for_member): Remove input_objects
14294 parameter. Add punconfigured parameter. Change all callers.
14295 (Archive::add_symbols): Change return type to bool. Check return
14296 value of include_member.
14297 (Archive::include_all_members): Likewise.
14298 (Archive::include_member): Change return type to bool. Return
14299 false if first included object has incompatible target. Set
14300 included_member_ field.
14301 (Add_archive_symbols::run): If add_symbols returns false, requeue
14302 Read_symbols task.
14303 * archive.h (class Archive): Add included_member_ field.
14304 Initialize it in constructor. Add input_file and searched_for
14305 methods. Update declarations.
14306 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14307 input_argument_ fields. Add them to constructor. Change all
14308 callers.
14309 * script.cc: Include "target-select.h".
14310 (class Parser_closure): Add skip_on_incompatible_target_ and
14311 found_incompatible_target_ fields. Add
14312 skip_on_incompatible_target parameter to constructor. Change all
14313 callers. Add methods skip_on_incompatible_target,
14314 clear_skip_on_incompatible_target, found_incompatible_target, and
14315 set_found_incompatible_target.
14316 (read_input_script): Add dirindex parameter. Change all callers.
14317 If parser finds an incompatible target, requeue Read_symbols
14318 task.
14319 (script_set_symbol): Clear skip_on_incompatible_target in
14320 closure.
14321 (script_add_assertion, script_parse_option): Likewise.
14322 (script_start_sections, script_add_phdr): Likewise.
14323 (script_check_output_format): New function.
14324 * script.h (read_input_script): Update declaration.
14325 * script-c.h (script_check_output_format): Declare.
14326 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14327 (ignore_cmd): Remove OUTPUT_FORMAT.
14328 * fileread.cc (Input_file::Input_file): Add explicit this.
14329 (Input_file::will_search_for): New function.
14330 (Input_file::open): Add pindex parameter. Change all callers.
14331 * fileread.h (class Input_file): Add input_file_argument method.
14332 Declare will_search_for. Update declarations.
14333 * object.cc (make_elf_object): Add punconfigured parameter.
14334 Change all callers.
14335 * object.h (class Object): Make input_file public. Add
14336 searched_for method.
14337 (make_elf_object): Update declaration.
14338 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14339 restart search.
14340 * dirsearch.h (class Dirsearch): Update declaration.
14341 * options.h (class General_options): Add --warn-search-mismatch.
14342 * parameters.cc (Parameters::is_compatible_target): New function.
14343 * parameters.h (class Parameters): Declare is_compatible_target.
14344 * workqueue.cc (Workqueue::add_blocker): New function.
14345 * workqueue.h (class Workqueue): Declare add_blocker.
14346
f1ed28fb
ILT
14347 * fileread.cc (Input_file::open): Remove options parameter.
14348 Change all callers.
14349 (Input_file::open_binary): Likewise.
14350 * script.cc (read_input_script): Likewise.
14351 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14352 options parameter from constructor. Change all callers.
14353 (class Read_script): Likewise.
14354 * fileread.h (class Input_file): Update declarations.
14355 * script.h (read_input_script): Update declaration.
14356
34dd024a
NC
143572009-03-10 Nick Clifton <nickc@redhat.com>
14358
14359 * po/es.po: New Spanish translation.
14360
6d71b17c
CC
143612009-03-06 Cary Coutant <ccoutant@google.com>
14362
14363 * options.cc (parse_short_option): Keep dash_z from registering itself.
14364
031cdbed
ILT
143652009-03-03 Ian Lance Taylor <iant@google.com>
14366
14367 PR 9918
14368 * target-reloc.h (relocate_section): Pass output_section to
14369 relocate.
14370 * i386.cc (Target_i386::should_apply_static_reloc): Add
14371 output_section parameter. Change all callers.
14372 (Target_i386::Relocate::relocate): Add output_section parameter.
14373 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14374 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14375 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14376 * testsuite/two_file_shared.sh: New script.
14377 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14378 (check_DATA): Add two_file_shared.dbg.
14379 (two_file_shared.dbg): New target.
14380 * testsuite/Makefile.in: Rebuild.
14381
15d5fa16
ILT
143822009-03-01 Ian Lance Taylor <iant@google.com>
14383
14384 * configure.ac: Check for byteswap.h.
14385 * configure: Rebuild.
14386 * config.in: Rebuild.
14387
8a4c0b0d
ILT
143882009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14389
14390 * layout.cc (Layout::find_or_add_kept_section): New function.
14391 (Layout::add_comdat): Removed.
14392 * layout.h (struct Kept_section): Move out of class Layout.
14393 Remove trailing underscores from field names. Add group_sections
14394 field. Rename group_ field to is_group. Change all uses.
14395 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14396 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14397 comdat_groups_ field.
14398 (Sized_relobj::include_section_group): Use
14399 find_or_add_kept_section and Kept_section::group_sections.
14400 (Sized_relobj::include_linkonce_section): Likewise.
14401 * object.cc (class Sized_relobj): Don't define Comdat_group or
14402 Comdat_group_table. Remove find_comdat_group and
14403 add_comdat_group. Remove comdat_groups_ field.
14404 * plugin.cc (include_comdat_group): Use
14405 Layout::find_or_add_kept_section.
14406
b4ecf66b
ILT
144072009-02-28 Ian Lance Taylor <iant@google.com>
14408
14359ca0
ILT
14409 * README: --gc-sections and map files are now supported. Document
14410 some build requirements.
14411
b4ecf66b
ILT
14412 PR 6992
14413 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14414 relocatable link set the value of the section symbol to zero.
14415 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14416 relocatable link don't include the section address in the local
14417 symbol value.
14418
0602e05a
ILT
144192009-02-27 Ian Lance Taylor <iant@google.com>
14420
fd9d194f
ILT
14421 PR 6811
14422 * options.h (class Search_directory): Add is_system_directory.
14423 (class General_options): Declare is_in_system_directory.
14424 * options.cc (get_relative_sysroot): Make static.
14425 (get_default_sysroot): Make static.
14426 (General_optoins::is_in_system_directory): New function.
14427 * fileread.cc (Input_file::is_in_system_directory): New function.
14428 * fileread.h (class Input_file): Declare is_in_system_directory.
14429 * object.h (class Object): Add is_in_system_directory.
14430 (class Input_objects): Remove system_library_directory_ field.
14431 * object.cc (Input_objects::add_object): Don't set
14432 system_library_directory_.
14433 (input_objects::found_in_system_library_directory): Remove.
14434 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14435 parameter. Change all callers.
14436 (Symbol_table::sized_write_globals): Likewise.
14437 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14438 Call Object::is_in_system_directory.
14439 * symtab.h (class Symbol_table): Update declarations.
14440
61edd21f
ILT
14441 PR 5990
14442 * descriptors.h (Open_descriptor): Add is_on_stack field.
14443 * descriptors.cc (Descriptors::open): If the descriptor is on the
14444 top of the stack, remove it. Initialize is_on_stack field.
14445 (Descriptors::release): Only add pod to stack if it is not on the
14446 stack already.
14447 (Descriptors::close_some_descriptor): Clear stack_next and
14448 is_on_stack fields.
14449
e29e076a
ILT
14450 PR 7091
14451 * output.cc (Output_section::find_starting_output_address): Rename
14452 from starting_output_address; add PADDR parameter; change return
14453 type.
14454 * output.h (class Output_section): Declare
14455 find_starting_output_address instead of starting_output_address.
14456 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14457 section symbol for which we can't find a merge section.
14458
0602e05a
ILT
14459 PR 9836
14460 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14461 hidden or internal, force the symbol to be local.
14462 * resolve.cc (Symbol::override_visibility): Define.
14463 (Symbol::override_base): Use override_visibility.
14464 (Symbol_table::resolve): Likewise.
14465 (Symbol::override_base_with_special): Likewise.
14466 (Symbol_table::override_with_special): If the visibility is hidden
14467 or internal, force the symbol to be local.
14468 * symtab.h (class Symbol): Add set_visibility and
14469 override_visibility.
14470 * testsuite/ver_test_1.sh: New file.
14471 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14472 (check_DATA): Add ver_test_1.syms.
14473 (ver_test_1.syms): New target.
14474 * testsuite/Makefile.in: Rebuild.
14475
401a9a73
CC
144762009-02-25 Cary Coutant <ccoutant@google.com>
14477
14478 * layout.cc (Layout::choose_output_section): Don't rename sections
14479 when using a linker script that has a SECTIONS clause.
14480 * Makefile.in: Regenerate.
14481
14482 * testsuite/Makefile.am (script_test_5.sh): New test case.
14483 * testsuite/Makefile.in: Regenerate.
14484 * testsuite/script_test_5.cc: New file.
14485 * testsuite/script_test_5.sh: New file.
14486 * testsuite/script_test_5.t: New file.
14487
f488e4b0
CC
144882009-02-13 Rafael Avila de Espindola <espindola@google.com>
14489
14490 * archive.cc (Archive::include_member): Update calls to add_symbols.
14491 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14492 the Layout argument.
14493 * dynobj.h (do_add_symbols): Add the Layout argument.
14494 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14495 Layout argument.
14496 * object.h (Object::add_symbols): Add the Layout argument.
14497 (Object::do_add_symbols): Add the Layout argument.
14498 (Sized_relobj::do_add_symbols): Add the Layout argument.
14499 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14500 Unify the two versions.
14501 (Add_plugin_symbols): Remove.
14502 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14503 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14504 (Add_plugin_symbols): Remove.
14505 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14506 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14507 (Add_symbols::run): Make it work with Pulginobj.
14508
89dd1680
ILT
145092009-02-06 Ian Lance Taylor <iant@google.com>
14510
14511 * object.cc (Sized_relobj::do_layout): Make info message start
14512 with lower case letter.
14513
266d0a74
ILT
145142009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14515
602b464e
ILT
14516 * binary.cc: Fix file comment.
14517
266d0a74
ILT
14518 * options.h (enum Incremental_disposition): Define.
14519 (class General_options): Add new options: --incremental,
14520 --incremental_changed, --incremental_unchanged,
14521 --incremental_unknown. Add incremental_disposition_ and
14522 implicit_incremental_ fields.
14523 (General_options::incremental_disposition): New function.
14524 (class Position_dependent_options): Add incremental_disposition
14525 option.
14526 (Position_dependent_options::copy_from_options): Set incremental
14527 dispositions.
14528 * options.cc (General_options::parse_incremental_changed): New
14529 function.
2e702c99
RM
14530 (General_options::parse_incremental_unchanged): New function.
14531 (General_options::parse_incremental_unknown): New function.
14532 (General_options::General_options): Initialize new fields
266d0a74 14533 incremental_disposition_ and implicit_incremental_.
2e702c99 14534 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14535 without --incremental.
14536
f073bbf7
CD
145372009-02-06 Chris Demetriou <cgd@google.com>
14538
14539 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14540 pointer and to report location as the file name associated with
14541 the symbol.
14542 (gold_undefined_symbol_at_location): New function to replace the
14543 old gold_undefined_symbol functionality.
14544 * target-reloc.h (relocate_section): Update to use
14545 gold_undefined_symbol_at_location.
14546 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14547 Call gold_undefined_symbol function rather than gold_error.
14548 * errors.h (Errors::undefined_symbol): Take location as a
14549 string, rather than calculating it from a relocation.
14550 * errors.cc (Errors::fatal): Print "fatal error:" before the
14551 formatted message.
14552 (Errors::error, Errors::error_at_location): Print "error: "
14553 before the formatted message.
14554 (Errors::undefined_symbol): Take location as a string, rather
14555 than calculating it from a relocation.
14556 (gold_undefined_symbol_at_location): New function akin to
14557 old gold_undefined_symbol, calculates location from relocation.
14558 (gold_undefined_symbol): Change to take only a Symbol pointer
14559 and to report location as the file name associated with the symbol.
14560 * testsuite/debug_msg.sh: Update for changed error messages.
14561 * testsuite/undef_symbol.sh: Likewise.
14562
8e94a90c
ILT
145632009-02-04 Duncan Sands <baldrick@free.fr>
14564
14565 PR 9812
14566 * reduced_debug_output.h
14567 (Output_reduced_debug_abbrev_section::failed): Use format for
14568 gold_warning.
14569 (Output_reduced_debug_info_section::faild): Likewise.
14570
88a0e15b
ILT
145712009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14572
14573 * script.cc (Lazy_demangler): New class.
2e702c99 14574 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14575 symbol only once.
14576
5efc7cd2
CC
145772009-01-29 Cary Coutant <ccoutant@google.com>
14578
14579 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14580 to __tls_get_addr.
14581 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14582
e0ebcf42
ILT
145832009-01-28 Ian Lance Taylor <iant@google.com>
14584
5efc7cd2 14585 * version.cc (version_string): Bump to 1.9.
75fe7426 14586
e0ebcf42
ILT
14587 * gold.h: Include <cstring> and <stdint.h>.
14588 * version.cc: Include <cstdio>.
14589 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14590 warning.
14591 * reduced_debug_output.cc (insert_into_vector): Rename from
14592 Insert_into_vector; change all callers. Use Swap_unaligned to
14593 avoid aliasing issue; remove union since it is unnecessary.
14594
8e2813be 145952009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14596
14597 * Makefile.am (CCFILES): Add gc.cc.
14598 (HFILES): Add gc.h.
14599 * Makefile.in: Regenerate.
14600 * gold.cc (Gc_runner): New class.
14601 (queue_initial_tasks): Call garbage collection related tasks
14602 when corresponding options are invoked.
14603 (queue_middle_gc_tasks): New function.
14604 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14605 processed early before laying out sections during garbage collection.
14606 * gold.h (queue_middle_gc_tasks): New function.
14607 (is_prefix_of): Move from "layout.cc".
14608 * i386.cc (Target_i386::gc_process_relocs): New function.
14609 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14610 * main.cc (main): Create object of class "Garbage_collection".
14611 * object.cc (Relobj::copy_symbols_data): New function.
14612 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14613 (Sized_relobj::do_layout): Allow this function to be called twice
14614 during garbage collection and defer layout of section during the
6d03d481
ST
14615 first call.
14616 * object.h (Relobj::get_symbols_data): New function.
14617 (Relobj::is_section_name_included): New function.
14618 (Relobj::copy_symbols_data): New function.
14619 (Relobj::set_symbols_data): New function.
14620 (Relobj::get_relocs_data): New function.
14621 (Relobj::set_relocs_data): New function.
14622 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14623 (Relobj::gc_process_relocs): New function.
14624 (Relobj::do_gc_process_relocs): New pure virtual function.
14625 (Relobj::sd_): New data member.
14626 (Sized_relobj::is_output_section_offset_invalid): New function.
14627 (Sized_relobj::do_gc_process_relocs): New function.
14628 * options.h (General_options::gc_sections): Modify to not be a no-op.
14629 (General_options::print_gc_sections): New option.
14630 * plugin.cc (Plugin_finish::run): Remove function call to
14631 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14632 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14633 * reloc.cc (Read_relocs::run): Add task to process relocs and
14634 determine unreferenced sections when doing garbage collection.
14635 (Gc_process_relocs): New class.
14636 (Sized_relobj::do_gc_process_relocs): New function.
14637 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14638 sections that are garbage collected.
14639 * reloc.h (Gc_process_relocs): New class.
14640 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14641 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14642 symbols whose corresponding sections are garbage collected.
14643 (Symbol_table::Symbol_table): Add new parameter for the garbage
14644 collection object.
14645 (Symbol_table::gc_mark_undef_symbols): New function.
14646 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14647 (Symbol_table::gc_mark_dyn_syms): New function.
14648 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14649 as garbage.
14650 (Symbol_table::add_from_object): Likewise.
14651 (Symbol_table::add_from_relobj): When building shared objects, do not
14652 treat externally visible symbols as garbage.
14653 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14654 table information for static and relocatable links.
14655 * symtab.h (Symbol_table::set_gc): New function.
14656 (Symbol_table::gc): New function.
14657 (Symbol_table::gc_mark_undef_symbols): New function.
14658 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14659 (Symbol_table::gc_mark_dyn_syms): New function.
14660 (Symbol_table::gc_): New data member.
e1df38aa 14661 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14662 function.
14663 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14664 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14665
3b293544
CF
146662009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14667
14668 * options.h (General_options::gc_sections): Define as a no-op for now.
14669 (General_options::no_keep_memory): Ditto.
14670 (General_options::Bshareable): Define.
14671 * options.cc (General_options::finalize): Honor -Bshareable.
14672
83d22aa8
AS
146732009-01-20 Andreas Schwab <schwab@suse.de>
14674
14675 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14676 read the value in the contents, since we don't use it. Use the
14677 template endianness when writing.
14678 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14679
cd536b21
AS
146802009-01-19 Andreas Schwab <schwab@suse.de>
14681
14682 * configure.tgt (powerpc64-*): Fix targ_obj.
14683
99e9a495
ILT
146842009-01-15 Ian Lance Taylor <iant@google.com>
14685
14686 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14687 local symbols when stripping all symbols.
14688
bbbfea06
CC
146892009-01-14 Cary Coutant <ccoutant@google.com>
14690
99e9a495 14691 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14692
0f7c0701
CC
146932009-01-14 Cary Coutant <ccoutant@google.com>
14694
14695 * archive.cc (Archive::get_elf_object_for_member): Remove call
14696 to File_read::claim_for_plugin.
14697 * descriptors.cc (Descriptors::open): Remove reference to
14698 is_claimed.
14699 (Descriptors::claim_for_plugin): Remove.
14700 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14701 (Descriptors::is_claimed): Remove.
14702 (claim_descriptor_for_plugin): Remove.
14703 * fileread.cc (File_read::claim_for_plugin): Remove.
14704 * fileread.h (File_read::claim_for_plugin): Remove.
14705 (File_read::descriptor): Reopen descriptor if necessary.
14706 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14707 (Plugin_manager::all_symbols_read): Add task parameter. Change
14708 all callers.
14709 (Plugin_manager::get_input_file): New function.
14710 (Plugin_manager::release_input_file): New function.
14711 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14712 corresponding data member.
14713 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14714 and pass to base constructor. Change all callers.
14715 (get_input_file, release_input_file): New functions.
14716 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14717 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14718 (Plugin_manager::all_symbols_read): Add task parameter.
14719 (Plugin_manager::get_input_file): New function.
14720 (Plugin_manager::release_input_file): New function.
14721 (Plugin_manager::task_): New data member.
14722 (Pluginobj::Pluginobj): Add filesize parameter.
14723 (Pluginobj::filename): New function.
14724 (Pluginobj::descriptor): New function.
14725 (Pluginobj::filesize): New function.
14726 (Pluginobj::filesize_): New data member.
14727 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14728 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14729 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14730
14731 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14732 with archive libraries.
14733 * testsuite/Makefile.in: Regenerate.
14734 * testsuite/plugin_test.c (struct sym_info): New type.
14735 (get_input_file, release_input_file): New static variables.
14736 (onload): Capture new transfer vector entries.
14737 (claim_file_hook): Stop reading at end of file according to filesize.
14738 Factor out parsing of readelf output into separate function.
14739 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14740 APIs and get the source file name from the symbol table. Convert
14741 source file name to corresponding object file name. Print info
14742 message when adding new input files.
14743 (parse_readelf_line): New function.
14744 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14745 * testsuite/plugin_test_2.sh: Likewise.
14746 * testsuite/plugin_test_3.sh: Likewise.
14747 * testsuite/plugin_test_4.sh: New test case.
14748
62a6d109
ILT
147492009-01-07 Ian Lance Taylor <iant@google.com>
14750
14751 * version.cc (version_string): Bump to 1.8.
14752
483620e8
CC
147532008-12-23 Cary Coutant <ccoutant@google.com>
14754
14755 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14756 * plugin.cc (Plugin_manager::finish): Rename as
14757 layout_deferred_objects. Move cleanup to separate function.
14758 (Plugin_manager::cleanup): New function.
14759 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14760 separately.
14761 * plugin.h (Plugin_manager::finish): Rename as
14762 layout_deferred_objects.
14763 (Plugin_manager::cleanup): New function.
14764 (Plugin_manager::cleanup_done): New field.
14765
d66a9eb3
CC
147662008-12-23 Cary Coutant <ccoutant@google.com>
14767
14768 * plugin.cc (is_visible_from_outside): New function.
14769 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14770 so we don't return "IR only" status for exported symbols or -r links.
14771
14772 * testsuite/Makefile.am (plugin_test_3): New test case.
14773 * testsuite/Makefile.in: Regenerate.
14774 * testsuite/plugin_test_3.sh: New file.
14775
5995b570
CC
147762008-12-22 Cary Coutant <ccoutant@google.com>
14777
14778 * object.cc (Sized_relobj::layout_section): New function.
14779 (Sized_relobj::do_layout): Defer layout of input sections until after
14780 plugin has provided replacement files.
14781 (Sized_relobj::do_layout_deferred_sections): New function.
14782 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14783 (Relobj::layout_deferred_sections): New function.
14784 (Relobj::do_layout_deferred_sections): New function.
14785 (Sized_relobj::do_layout_deferred_sections): New function.
14786 (Sized_relobj::layout_section): New function.
14787 (Sized_relobj::Deferred_layout): New structure.
14788 (Sized_relobj::deferred_layout_): New field.
14789 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14790 Change all callers. Layout deferred sections.
14791 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14792 references.
14793 (Plugin_hook::run): Move code from do_plugin_hook inline.
14794 (Plugin_hook::do_plugin_hook): Remove.
14795 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14796 (Plugin_manager::finish): Renamed, was cleanup.
14797 (Plugin_manager::should_defer_layout): New function.
14798 (Plugin_manager::add_deferred_layout_object): New function.
14799 (Plugin_manager::Deferred_layout_list): New type.
14800 (Plugin_manager::deferred_layout_objects_): New field.
14801 (Plugin_hook::do_plugin_hook): Remove.
14802
ee769c88
ILT
148032008-12-17 Ian Lance Taylor <iant@google.com>
14804
14805 * options.h (class General_options): Add --no case for
14806 --export-dynamic.
14807
abc8dcba
CC
148082008-12-16 Cary Coutant <ccoutant@google.com>
14809
14810 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14811 vector.
14812 (Plugin_manager::claim_file): Create plugin object even if
14813 plugin did not call the add_symbols callback.
14814 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14815 asking for more symbols than were added.
14816 * testsuite/Makefile.am (plugin_test_1): Add test case with
14817 no global symbols.
14818 (empty.syms): New target.
14819 * testsuite/Makefile.in: Regenerate.
14820 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14821 message. Don't call add_symbols if no globals.
14822 (all_symbols_read_hook): Don't provide replacement for empty
14823 claimed file.
14824
b0074644
ILT
148252008-12-12 Ian Lance Taylor <iant@google.com>
14826
68943102
ILT
14827 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14828 r_type == 0 for a local symbol with r_sym == 0.
14829 (scan_relocatable_relocs): Pass r_sym to
14830 local_non_section_strategy.
14831 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14832 r_sym parameter.
14833
b0074644
ILT
14834 * configure.ac: Update test for TLS descriptors: they are
14835 supported as of glibc 2.9.
14836 * configure: Rebuild.
14837
c2508178
ILT
148382008-12-11 Ian Lance Taylor <iant@google.com>
14839
14840 PR 7091
14841 * target-reloc.h (Default_scan_relocatable_relocs): For each
14842 function, map r_type == 0 to RELOC_DISCARD.
14843
2756a258
CC
148442008-12-10 Cary Coutant <ccoutant@google.com>
14845
14846 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14847 object to override a kept COMDAT group from a plugin object.
14848
bb6f53d3
ILT
148492008-12-09 Ian Lance Taylor <iant@google.com>
14850
fbc558e1
ILT
14851 PR 7088
14852 * yyscript.y (file_cmd): Handle INPUT.
14853
bb6f53d3
ILT
14854 * testsuite/initpri1.c: Change all declarations to be full
14855 prototypes by adding void, to avoid compiler warnings.
14856
4674ecfc
CC
148572008-12-05 Rafael Avila de Espindola <espindola@google.com>
14858
14859 * options.cc (General_options::parse_plugin_opt): New.
14860 (General_options::add_plugin): The argument now is just the filename.
14861 (General_options::add_plugin_option): New.
14862 * options.h (plugin_opt): New.
14863 (add_plugin): Change argument name.
14864 (add_plugin_option): New.
14865 * plugin.cc (Plugin::load): Don't parse the plugin option.
14866 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14867 (Plugin::add_option): New.
14868 (Plugin::args_): Change type.
14869 (Plugin::filename_): New.
14870 (Plugin_manager::add_plugin_option): New.
14871 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14872 * testsuite/Makefile.in: Regenerate.
14873
fd06b4aa
CC
148742008-12-05 Cary Coutant <ccoutant@google.com>
14875
14876 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14877 Handle --strip-lto-sections option.
14878 * options.h (strip_lto_sections): New option.
14879
6c52134c
CC
148802008-12-01 Cary Coutant <ccoutant@google.com>
14881
14882 * plugin.cc (ld_plugin_message): Change format parameter to const.
14883 Fix mismatch between new[] and delete.
14884
a45248e0
CC
148852008-11-14 Cary Coutant <ccoutant@google.com>
14886
14887 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14888 instead of -1U.
14889
c82fbeee
CS
148902008-11-05 Craig Silverstein <csilvers@google.com>
14891
14892 * options.cc (General_options::parse_dynamic_list): New function.
14893 * options.h (General_options): New flags dynamic_list,
14894 dynamic_list_data, dynamic_list_cpp_new, and
14895 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14896 (General_options::in_dynamic_list): New function.
14897 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14898 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14899 (Lex::can_continue_name): Likewise.
14900 (yylex): Likewise.
14901 (read_script_file): New parameter script_options.
14902 (read_dynamic_list): New function.
14903 (Script_options::define_dynamic_list): New function.
14904 (dynamic_list_keyword_parsecodes): New variable.
14905 (dynamic_list_keywords): New variable.
14906 * script.h (Script_options::define_dynamic_list): New function
14907 prototype.
14908 (read_dynamic_list): New function prototype.
14909 * symtab.cc (strprefix): New macro.
14910 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14911 dynamic_list_data, dynamic_list_cpp_new, and
14912 dynamic_list_cpp_typeinfo.
14913 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14914 (dynamic_list_expr): New rule.
14915 (dynamic_list_nodes): Likewise.
14916 (dynamic_list_node): Likewise.
14917 * testsuite/Makefile.am (dynamic_list): New test.
14918 * testsuite/Makefile.in: Regenerated.
14919 * testsuite/dynamic_list.t: New file.
14920 * testsuite/dynamic_list.sh: New file.
14921
e0bb29a5
CS
149222008-11-05 Craig Silverstein <csilvers@google.com>
14923
14924 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14925 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14926 (t11_last): Likewise.
14927 * testsuite/ver_test_6.c (main): Likewise.
14928
4e1e25e0
CC
149292008-10-07 Cary Coutant <ccoutant@google.com>
14930
14931 * options.c (General_options::finalize): Add check for -static and
14932 -shared.
14933 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14934 is not empty.
14935
92f03fcb
CC
149362008-10-02 Cary Coutant <ccoutant@google.com>
14937
14938 * plugin.cc (make_sized_plugin_object): Fix conditional
14939 compilation to work when not all targets are enabled.
14940
fbd8a257
CC
149412008-09-29 Cary Coutant <ccoutant@google.com>
14942
14943 * archive.cc (Archive::get_file_and_offset): Use filename instead
14944 of name to get library path.
14945 (Archive::include_member): Unlock external member of a thin archive.
14946
14947 * testsuite/Makefile.am (TEST_AR): New variable.
14948 (thin_archive_test_1): New test.
14949 (thin_archive_test_2): New test.
81636b3f
CC
14950 * testsuite/Makefile.in: Regenerate.
14951 * testsuite/thin_archive_main.cc: New file.
14952 * testsuite/thin_archive_test_1.cc: New file.
14953 * testsuite/thin_archive_test_2.cc: New file.
14954 * testsuite/thin_archive_test_3.cc: New file.
14955 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14956
eff45813
CC
149572008-09-29 Cary Coutant <ccoutant@google.com>
14958
14959 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14960 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14961 instead of -1U.
14962 (Sized_relobj::do_finalize_local_symbols): Likewise.
14963 (Sized_relobj::map_to_kept_section): Likewise.
14964 * object.h (Sized_relobj::invalid_address): New constant.
14965 (Sized_relobj::do_output_section_offset): Check for invalid_address
14966 and return -1ULL.
14967 * output.cc (Output_reloc::local_section_offset): Use constant
14968 invalid_address instead of -1U.
14969 (Output_reloc::get_address): Likewise.
14970 (Output_section::output_address): Change -1U to -1ULL.
14971 * output.h (Output_reloc::invalid_address): New constant.
14972 * reloc.cc (Sized_relobj::write_sections): Use constant
14973 invalid_address instead of -1U.
14974 (Sized_relobj::relocate_sections): Likewise.
14975 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14976 values for merge sections.
14977 * target-reloc.h (relocate_for_relocatable): Use constant
14978 invalid_address instead of -1U.
14979
89fc3421
CC
149802008-09-19 Cary Coutant <ccoutant@google.com>
14981
14982 Add plugin functionality for link-time optimization (LTO).
14983 * configure.ac (plugins): Add --enable-plugins option.
14984 * configure: Regenerate.
14985 * config.in: Regenerate.
14986 * Makefile.am (LIBDL): New variable.
14987 (CCFILES): Add plugin.cc.
14988 (HFILES): Add plugin.h.
14989 (ldadd_var): Add LIBDL.
14990 * Makefile.in: Regenerate.
14991
14992 * archive.cc: Include "plugin.h".
14993 (Archive::setup): Don't preread archive symbols when using a plugin.
14994 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14995 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14996 files.
14997 (Archive::include_member): Add symbols from plugin objects.
14998 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14999 * descriptors.cc (Descriptors::open): Check for file descriptors
15000 abandoned by plugins.
15001 (Descriptors::claim_for_plugin): New function.
15002 * descriptors.h (Descriptors::claim_for_plugin): New function.
15003 (Open_descriptor::is_claimed): New field.
15004 (claim_descriptor_for_plugin): New function.
15005 * fileread.cc (File_read::claim_for_plugin): New function.
15006 * fileread.h (File_read::claim_for_plugin): New function.
15007 (File_read::descriptor): New function.
15008 * gold.cc: Include "plugin.h".
15009 (queue_initial_tasks): Add task to call plugin hooks for generating
15010 new object files.
15011 * main.cc: Include "plugin.h".
15012 (main): Load plugin libraries.
15013 * object.h (Pluginobj): Declare.
15014 (Object::pluginobj): New function.
15015 (Object::do_pluginobj): New function.
15016 (Object::set_target): New function.
15017 * options.cc: Include "plugin.h".
15018 (General_options::parse_plugin): New function.
15019 (General_options::General_options): Initialize plugins_ field.
15020 (General_options::add_plugin): New function.
15021 * options.h (Plugin_manager): Declare.
15022 (General_options): Add --plugin option.
15023 (General_options::has_plugins): New function.
15024 (General_options::plugins): New function.
15025 (General_options::add_plugin): New function.
15026 (General_options::plugins_): New field.
15027 * plugin.cc: New file.
15028 * plugin.h: New file.
15029 * readsyms.cc: Include "plugin.h".
15030 (Read_symbols::do_read_symbols): Check for archive before checking
15031 for ELF file. Call plugin hooks to claim files.
15032 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15033 from a real object file; force override when processing replacement
15034 files.
15035 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15036 (Symbol::init_base_object): Likewise.
15037 (Symbol::init_base_output_data): Likewise.
15038 (Symbol::init_base_output_segment): Likewise.
15039 (Symbol::init_base_constant): Likewise.
15040 (Symbol::init_base_undefined): Likewise.
15041 (Symbol::output_section): Assert that object is not a plugin.
15042 (Symbol_table::add_from_pluginobj): New function.
15043 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15044 undefined.
15045 (Symbol_table::sized_write_globals): Likewise.
15046 (Symbol_table::add_from_pluginobj): Instantiate template.
15047 * symtab.h (Sized_pluginobj): Declare.
15048 (Symbol::in_real_elf): New function.
15049 (Symbol::set_in_real_elf): New function.
15050 (Symbol::in_real_elf_): New field.
15051 (Symbol_table::add_from_pluginobj): New function.
15052
15053 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15054 (LIBDL): New variable.
15055 (LDADD): Add LIBDL.
15056 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15057 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15058 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15059 (MOSTLYCLEANFILES): Likewise.
15060 * testsuite/Makefile.in: Regenerate.
15061 * testsuite/plugin_test.c: New file.
15062 * testsuite/plugin_test_1.sh: New file.
15063 * testsuite/plugin_test_2.sh: New file.
15064
de31bda5
ILT
150652008-09-16 Ian Lance Taylor <iant@google.com>
15066
9c2d0ef9
ILT
15067 * target-reloc.h (relocate_section): Check whether a symbol is
15068 defined by the ABI before reporting an undefined symbol error.
15069 * target.h (Target::is_defined_by_abi): Make parameter const.
15070 (Target::do_is_defined_by_abi): Likewise.
15071 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15072 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15073 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15074 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15075 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15076 * testsuite/Makefile.in: Rebuild.
15077
de31bda5
ILT
15078 * fileread.cc (make_view): Add casts to avoid warning.
15079
9fa33bee
AO
150802008-09-16 Alexandre Oliva <aoliva@redhat.com>
15081
15082 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15083 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15084
183fd0e3
AO
150852008-09-16 Alexandre Oliva <aoliva@redhat.com>
15086
15087 * options.h (General_options::output_is_executable): New.
15088 (General_options::output_is_pie): New.
15089 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15090 for shared libraries.
15091 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15092
7be8330a
CD
150932008-09-11 Chris Demetriou <cgd@google.com>
15094
15095 * options.h (origin): New -z option.
15096 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15097 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15098 in DT_FLAGS_1.
15099
a9caad02
CC
151002008-09-05 Cary Coutant <ccoutant@google.com>
15101
15102 * fileread.cc (File_read::make_view): Add check for attempt to map
15103 beyond end of file.
15104
ae6dce4d
CC
151052008-09-05 Cary Coutant <ccoutant@google.com>
15106
15107 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15108 explicit instantiations.
15109
d7ab2a47
KVH
151102008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15111
15112 PR gold/6858
15113 * options.cc (General_options::finalize): Allow undefined symbols
15114 in shlibs if linking -shared.
15115
15116 PR gold/6859
15117 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15118 symbols as not needing a dynsym entry.
15119
1e52a9c1
CS
151202008-08-20 Craig Silverstein <csilvers@google.com>
15121
15122 * fileread.cc (File_read::open): Do not lock the file unless it
15123 was successfully opened.
15124
d85c80a3
CC
151252008-08-14 Cary Coutant <ccoutant@google.com>
15126
15127 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15128 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15129 * testsuite/tls_test.cc (struct int128): 128-bit struct
15130 for testing TLS relocs with non-zero addend.
15131 (v12): New TLS variable.
15132 (t12): New test.
15133 (t_last): Add check for v12.
15134 * testsuite/tls_test.h (t12): New function.
15135 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15136
2d924fd9
ILT
151372008-08-13 Ian Lance Taylor <iant@google.com>
15138
15139 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15140 set tls_segment_ or relro_segment_.
15141 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15142 when appropriate.
15143 * output.h (Output_section::clear_is_relro): New function.
15144 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15145 sections specially even when output_data_ is empty.
15146 (Output_segment::maximum_alignment): When first section is relro,
15147 only force alignment for PT_LOAD segments.
15148 * script.cc (script_data_segment_align): New function.
15149 (script_data_segment_relro_end): New function.
15150 * script-c.h (script_data_segment_align): Declare.
15151 (script_data_segment_relro_end): Declare.
15152 * script-sections.h (class Script_sections): Declare
15153 data_segment_align and data_segment_relro_end. Add fields
15154 segment_align_index_ and saw_relro_end_.
15155 * script-sections.cc (class Sections_element): Add set_is_relro
15156 virtual function. Add new bool* parameter to place_orphan_here.
15157 Add get_output_section virtual function.
15158 (class Output_section_definition): Add set_is_relro. Add new
15159 bool* parameter to place_orphan_here. Add get_output_section.
15160 Add is_relro_ field.
15161 (Output_section_definition::Output_section_definition): Initialize
15162 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15163 and is_relro_ fields.
15164 (Output_section_definition::place_orphan_here): Add is_relro
15165 parameter.
15166 (Output_section_definition::set_section_addresses): Set relro for
15167 output section.
15168 (Output_section_definition::alternate_constraint): Likewise.
15169 (class Orphan_output_section): Add new bool* parameter to
15170 place_orphan_here. Add get_output_section.
15171 (Orphan_output_section::place_orphan_here): Add is_relro
15172 parameter.
15173 (Script_sections::Script_sections): Initialize
15174 data_segment_align_index_ and saw_relro_end_.
15175 (Script_sections::data_segment_align): New function.
15176 (Script_sections::data_segment_relro_end): New function.
15177 (Script_sections::place_orphan): Set or clear is_relro.
15178 (Script_sections::set_section_addresses): Force alignment of first
15179 TLS section.
15180 * yyscript.y (exp): Call script_data_segment_align and
15181 script_data_segment_relro_end.
15182 * testsuite/relro_script_test.t: New file.
15183 * testsuite/relro_test.cc (using_script): Declare.
15184 (t1, t2): Test using_script.
15185 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15186 (relro_script_test_SOURCES): Define.
15187 (relro_script_test_DEPENDENCIES): Define.
15188 (relro_script_test_LDFLAGS): Define.
15189 (relro_script_test_LDADD): Define.
15190 (relro_script_test.so): New target.
15191 * testsuite/Makefile.in: Rebuild.
15192
f827c9a9
CC
151932008-08-06 Cary Coutant <ccoutant@google.com>
15194
15195 * archive.cc (Archive::total_archives, Archive::total_members)
15196 (Archive::total_members_loaded): New variables.
15197 (Archive::setup): Add parameter. Add option to preread
15198 archive symbols.
15199 (Archive::read_armap): Add counter.
15200 (Archive::get_file_and_offset): New function.
15201 (Archive::get_elf_object_for_member): New function.
15202 (Archive::read_all_symbols): New function.
15203 (Archive::read_symbols): New function.
15204 (Archive::add_symbols): Add counters.
15205 (Archive::include_all_members): Use armap to find members if it's
15206 already built.
15207 (Archive::include_member): Skip reading symbols if already read.
15208 Factored code into Archive::get_file_and_offset and
15209 Archive::get_elf_object_for_member. Changed call to
15210 Mapfile::report_include_archive_member.
15211 (Archive::print_stats): New function.
15212 * archive.h: Declare Object and Read_symbols_data classes.
15213 (Archive::Archive): Add initializers for new members.
15214 (Archive::setup): Add parameter.
15215 (Archive::print_stats): New function.
15216 (Archive::total_archives, Archive::total_members)
15217 (Archive::total_members_loaded): New variables.
15218 (Archive::get_file_and_offset): New function.
15219 (Archive::get_elf_object_for_member): New function.
15220 (Archive::read_all_symbols): New function.
15221 (Archive::read_symbols): New function.
15222 (Archive::Archive_member): New class.
15223 (Archive::members_): New member.
15224 (Archive::num_members_): New member.
15225 * main.cc: Include archive.h.
15226 (main): Call Archive::print_stats.
15227 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15228 archive parameter; member_name is now the fully-decorated name.
15229 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15230 * options.h: (General_options): Add --preread-archive-symbols option.
15231 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15232 Archive::setup.
15233
de4c45bd
ILT
152342008-08-04 Ian Lance Taylor <iant@google.com>
15235
15236 * symtab.h (Symbol::use_plt_offset): New function.
15237 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15238 * powerpc.cc (Relocate::relocate): Likewise.
15239 * sparc.cc (Relocate::relocate): Likewise.
15240 * x86_64.cc (Relocate::relocate): Likewise.
15241 * testsuite/weak_plt.sh: New test.
15242 * testsuite/weak_plt_main.cc: New test.
15243 * testsuite/weak_plt_shared.cc: New test.
15244 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15245 (check_PROGRAMS): Add weak_plt.
15246 (check_DATA): Add weak_plt_shared.so.
15247 (weak_plt_main_pic.o, weak_plt): New targets.
15248 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15249 * testsuite/Makefile.in: Rebuild.
15250
15251 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15252 gcctestdir/ld.
15253 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15254 * testsuite/Makefile.in: Rebuild.
15255
323ee3f4
AM
152562008-08-04 Alan Modra <amodra@bigpond.net.au>
15257
15258 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15259 * Makefile.in: Regenerate.
15260 * po/POTFILES.in: Regenerate.
15261
7c07ecec
ILT
152622008-07-29 Ian Lance Taylor <iant@google.com>
15263
15264 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15265 symbols before other symbols.
15266 * testsuite/script_test_2.cc (test_addr): Declare.
15267 (test_addr_alias): Declare.
15268 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15269 values.
7c07ecec
ILT
15270 * testsuite/script_test_2.t: Define test_addr_alias and
15271 test_addr.
15272
5778530e
ILT
152732008-07-24 Ian Lance Taylor <iant@google.com>
15274
2a00e4fb
ILT
15275 PR 5990
15276 * descriptors.cc: New file.
15277 * descriptors.h: New file.
15278 * gold-threads.h (class Hold_optional_lock): New class.
15279 * fileread.cc: Include "descriptors.h".
15280 (File_read::~File_read): Release descriptor rather than closing
15281 it.
15282 (File_read::open) [file]: Call open_descriptor rather than open.
15283 Set is_descriptor_opened_.
15284 (File_read::open) [memory]: Assert that descriptor is not open.
15285 (File_read::reopen_descriptor): New function.
15286 (File_read::release): Release descriptor.
15287 (File_read::do_read): Make non-const. Reopen descriptor.
15288 (File_read::read): Make non-const.
15289 (File_read::make_view): Reopen descriptor.
15290 (File_read::do_readv): Likewise.
15291 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15292 Update declarations.
15293 * layout.cc: Include "descriptors.h".
15294 (Layout::create_build_id): Use open_descriptor rather than open.
15295 * output.cc: Include "descriptors.h".
15296 (Output_file::open): Use open_descriptor rather than open.
15297 * archive.cc (Archive::const_iterator): Change Archive to be
15298 non-const.
15299 (Archive::begin, Archive::end): Make non-const.
15300 (Archive::count_members): Likewise.
15301 * archive.h (class Archive): Update declarations.
15302 * object.h (Object::read): Make non-const.
15303 * Makefile.am (CCFILES): Add descriptors.cc.
15304 (HFILES): Add descriptors.h.
15305 * Makefile.in: Rebuild.
15306
801647d1
ILT
15307 PR 6716
15308 * gold.h: Always include <clocale>. Add Solaris workarounds
15309 following code in binutils/sysdep.h.
15310
5edd166e
ILT
15311 PR 6048
15312 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15313 this->eh_frame_hdr_ is NULL before using it.
15314
c89ad728
ILT
15315 * dynobj.cc (Versions::Versions): Update comment.
15316
aa86f06b
ILT
15317 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15318 the base version name.
15319
5778530e
ILT
15320 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15321 array size plus one.
15322 (Stringpool_template::set_string_offsets): Subtract one from key
15323 before using it as an array index.
15324 (Stringpool_template::get_offset_with_length): Likewise.
15325 (Stringpool_template::write_to_buffer): Likewise.
15326 * stringpool.h (Stringpool_template::get_offset_from_key):
15327 Likewise.
15328
057ead22
ILT
153292008-07-23 Ian Lance Taylor <iant@google.com>
15330
7f649c59
ILT
15331 PR 6658
15332 * object.h (Merged_symbol_value::value): Do our best to handle a
15333 negative addend.
15334
057ead22
ILT
15335 PR 6647
15336 * script.cc (Version_script_info::get_versions): Don't add empty
15337 version tag to return value.
15338 (Version_script_info::get_symbol_version_helper): Change return
15339 type to bool. Add pversion parameter. Change all callers.
15340 (script_register_vers_node): Don't require a non-NULL tag.
15341 * script.h (class Version_script_info): Update declarations.
15342 (Version_script_info::get_symbol_version): Change return type to
15343 bool. Add version parameter. Change all callers.
15344 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15345 handling. Handle an empty version from a version script.
15346 (Symbol_table::define_special_symbol): Likewise.
15347 * testsuite/ver_test_10.script: New file.
15348 * testsuite/ver_test_10.sh: New file.
15349 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15350 (check_DATA): Add ver_test_10.syms.
15351 (ver_test_10.syms, ver_test_10.so): New target.
15352 * testsuite/Makefile.in: Rebuild.
15353
58e54ac2
CD
153542008-07-23 Simon Baldwin <simonb@google.com>
15355
15356 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15357 to zero for undefined symbols from dynamic libraries.
15358
95d14cd3
ILT
153592008-07-23 Ian Lance Taylor <iant@google.com>
15360
15361 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15362 Change all callers.
15363 * symtab.h (class Symbol_table): Update declaration.
15364 * testsuite/ver_test_9.cc: New file.
15365 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15366 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15367 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15368 (ver_test_9.so, ver_test_9.o): New targets.
15369 * testsuite/Makefile.in: Rebuild.
15370
92de84a6
ILT
153712008-07-22 Ian Lance Taylor <iant@google.com>
15372
34810851
ILT
15373 * options.h (class General_options): Define --check-sections.
15374 * layout.cc (Layout::set_segment_offsets): Handle
15375 --check-sections.
15376
af6156ef
ILT
15377 * options.h (class General_options): Define -n/--nmagic and
15378 -N/--omagic.
15379 * options.cc (General_options::finalize): For -n/--nmagic or
15380 -N/--omagic, set -static.
15381 * layout.cc (Layout::attach_allocated_section_to_segment): If
15382 -N/--omagic, don't put read-only and read-write sections in
15383 different segments.
15384 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15385 finding a read-only segment.
15386 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15387 don't set the minimum segment alignment to the common page size,
15388 and don't set the file offset to the address modulo the page size.
15389 * script-sections.cc (Script_sections::create_segments): If
15390 -n/--omagic, don't put read-only and read-write sections in
15391 different segments.
15392
92de84a6
ILT
15393 * cref.cc: New file.
15394 * cref.h: New file.
15395 * options.h (class General_options): Add --print-symbol-counts.
15396 * main.cc (main): Issue defined symbol report if requested.
15397 * archive.cc (Archive::interpret_header): Make into a const member
15398 function.
15399 (Archive::add_symbols): Call Input_objects::archive_start and
15400 archive_stop.
15401 (Archive::const_iterator): Define new class.
15402 (Archive::begin, Archive::end): New functions.
15403 (Archive::include_all_members): Rewrite to use iterator.
15404 (Archive::count_members): New function.
15405 * archive.h (class Archive): Update declarations.
15406 (Archive::filename): New function.
15407 * object.cc: Include "cref.h".
15408 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15409 (Sized_relobj::do_get_global_symbol_counts): New function.
15410 (Input_objects::add_object): Add object to cross-referencer.
15411 (Input_objects::archive_start): New function.
15412 (Input_objects::archive_stop): New function.
15413 (Input_objects::print_symbol_counts): New function.
15414 * object.h: Declare Cref and Archive.
15415 (Object::get_global_symbol_counts): New function.
15416 (Object::do_get_global_symbol_counts): New pure virtual function.
15417 (class Sized_relobj): Add defined_count_ field. Update
15418 declarations.
15419 (class Input_objects): Add cref_ field. Update constructor.
15420 Update declarations.
15421 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15422 defined_count_.
15423 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15424 symbol counts.
15425 (Sized_dynobj::do_get_global_symbol_counts): New function.
15426 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15427 defined_count_. Update declarations. Define Symbols typedef.
15428 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15429 parameter. Change all callers.
15430 (Symbol_table::add_from_dynobj): Add sympointers and defined
15431 parameters. Change all callers.
15432 * symtab.h (class Symbol_table): Update declarations.
15433 * Makefile.am (CCFILES): Add cref.cc.
15434 (HFILES): Add cref.h.
15435 * Makefile.in: Rebuild.
15436
3f7c5e1d
CD
154372008-07-22 Simon Baldwin <simonb@google.com>
15438
15439 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15440 to zero when writing undefined symbols.
15441
e0b64032
ILT
154422008-07-22 Ian Lance Taylor <iant@google.com>
15443
15444 * output.cc (Output_section::add_input_section): Don't try to
15445 merge empty merge sections.
15446
096b02cf
CS
154472008-07-21 Craig Silverstein <csilvers@google.com>
15448
15449 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15450 Include symbol version in error message.
cd536b21 15451
1d1f116d
CD
154522008-07-20 Chris Demetriou <cgd@google.com>
15453
cd536b21 15454 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15455 (RANDOM_SEED_CFLAGS): New substituted variable.
15456 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15457 * configure: Rebuild.
15458 * Makefile.in: Likewise.
15459 * testsuite/Makefile.in: Likewise.
15460
a18f591e
ILT
154612008-07-18 Ian Lance Taylor <iant@google.com>
15462
15463 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15464 where we see NAME/NULL and NAME/VERSION as separate symbols.
15465 * testsuite/ver_test_main.cc (main): Call t4.
15466 (t4, t4_2a): Define.
15467 * testsuite/ver_test_2.cc (t4_2): Define.
15468 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15469 * testsuite/ver_test_4.cc (t4_2a): Define.
15470 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15471 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15472
c6e3f6ed
ILT
154732008-07-17 Ian Lance Taylor <iant@google.com>
15474
15475 * dynobj.cc (Versions::add_def): If we give an error about a
15476 missing version, go ahead and create the version anyhow.
15477
ef9beddf
ILT
154782008-07-10 Ian Lance Taylor <iant@google.com>
15479
15480 Handle output sections with more than 0x7fffffff bytes.
15481 * object.h (class Relobj): Change map_to_output_ to
15482 output_sections_, and just keep a section pointer. Change all
15483 uses. Move comdat group support to Sized_relobj.
15484 (Relobj::is_section_specially_mapped): Remove.
15485 (Relobj::output_section): Remove poff parameter. Change all
15486 callers.
15487 (Relobj::output_section_offset): New function.
15488 (Relobj::set_section_offset): Rewrite.
15489 (Relobj::map_to_output): Remove.
15490 (Relobj::output_sections): New function.
15491 (Relobj::do_output_section_offset): New pure virtual function.
15492 (Relobj::do_set_section_offset): Likewise.
15493 (class Sized_relobj): Add section_offsets_ field. Add comdat
15494 group support from Relobj. Update declarations.
15495 (Sized_relobj::get_output_section_offset): New function.
15496 (Sized_relobj::do_output_section_offset): New function.
15497 (Sized_relobj::do_set_section_offset): New function.
15498 * object.cc (Relobj::output_section_address): Remove.
15499 (Sized_relobj::Sized_relobj): Initialize new fields.
15500 (Sized_relobj::include_section_group): Cast find_kept_object to
15501 Sized_relobj.
15502 (Sized_relobj::include_linkonce_section): Likewise.
15503 (Sized_relobj::do_layout): Use separate arrays for output section
15504 and output offset.
15505 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15506 output_sections.
15507 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15508 output_sections and section_offsets.
15509 (Sized_relobj::write_local_symbols): Likewise.
15510 (map_to_kept_section): Compute output address directly.
15511 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15512 output_sections and section_offsets.
15513 (Sized_relobj::write_sections): Likewise.
15514 (Sized_relobj::relocate_sections): Likewise.
15515 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15516 * output.h (class Output_reloc): Update declarations. Change
15517 u2_.relobj to Sized_relobj*.
15518 (class Output_data_reloc): Change add functions to use
15519 Sized_relobj*.
15520 * output.cc (Output_reloc::Output_reloc): Change relobj to
15521 Sized_relobj*.
15522 (Output_reloc::local_section_offset): Change return type to
15523 Elf_Addr. Use get_output_section_offset.
15524 (Output_reloc::get_address): Likewise.
15525 (Output_section::is_input_address_mapped): Don't call
15526 is_section_specially_mapped.
15527 (Output_section::output_offset): Likewise.
15528 (Output_section::output_address): Likewise.
15529 (Output_section::starting_output_address): Likewise.
15530 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15531 parameter to Sized_relobj*.
15532 (Copy_relocs::need_copy_reloc): Likewise.
15533 (Copy_relocs::save): Likewise.
15534 * copy-relocs.h (class Copy_relocs): Update declarations.
15535 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15536 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15537 * target-reloc.h (relocate_for_relocatable): Change
15538 offset_in_output_section type to Elf_Addr. Change code that uses
15539 it as well.
15540 * layout.cc (Layout::layout): Always set *off.
15541 * mapfile.cc (Mapfile::print_input_section): Use
15542 output_section_offset.
15543 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15544 Sized_relobj*.
15545 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15546 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15547 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15548
5cb66f97
ILT
155492008-07-03 Ian Lance Taylor <iant@google.com>
15550
15551 * layout.cc (Layout::include_section): Do not discard unrecognized
15552 SHT_STRTAB sections.
15553
afe47622
CS
155542008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15555
15556 * script.cc (Lex::can_continue_name): Make '?' allowable in
15557 version-script names.
15558 * testsuite/version_script.map: Change glob pattern to use '?'
15559
5adf9721
ILT
155602008-06-30 Manish Singh <yosh@gimp.org>
15561
15562 PR 6585
15563 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15564 Correct typo.
15565
e6fde208
ILT
155662008-06-30 Ian Lance Taylor <iant@google.com>
15567
15568 PR 6660
15569 PR 6682
15570 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15571 versions]: Don't try to read the value in the contents, since we
15572 don't use it. Use the template endianness when writing.
15573
3f2e6a2d
CC
155742008-06-25 Cary Coutant <ccoutant@google.com>
15575
15576 * fileread.cc (File_read::make_view): Assert on zero-length view.
15577 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15578 symbol table when there are no symbols to read.
15579
c43d3a48
CS
155802008-06-23 Craig Silverstein <csilvers@google.com>
15581
15582 * version.cc (version_string): Bump to 1.7
15583
5f494ea0
CS
155842008-06-18 Craig Silverstein <csilvers@google.com>
15585
15586 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15587 constant 0xFFFF to type Valtype.
15588 (Powerpc_relocate_functions::rel16_ha): Likewise.
15589
c42e122e
ILT
155902008-06-17 Ian Lance Taylor <iant@google.com>
15591
f34787f8
ILT
15592 * output.h (Output_section::Input_section): Initialize p2align_ to
15593 zero for Output_section_data constructors.
15594 (Output_section::Input_section::addralign): If not an input
15595 section, return the alignment of the Output_section_data.
15596 * testsuite/copy_test.cc: New file.
15597 * testsuite/copy_test_1.cc: New file.
15598 * testsuite/copy_test_2.cc: New file.
15599 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15600 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15601 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15602 (copy_test_1_pic.o, copy_test_1.so): New targets.
15603 (copy_test_2_pic.o, copy_test_2.so): New targets.
15604 * testsuite/Makefile.in: Rebuild.
15605
c42e122e
ILT
15606 * script-sections.cc (Script_sections::place_orphan): Initialize
15607 local variable exact.
15608
ce3ac18a
DE
156092008-06-13 David Edelsohn <edelsohn@gnu.org>
15610
15611 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15612
42cacb20
DE
156132008-06-12 David Edelsohn <edelsohn@gnu.org>
15614 David S. Miller <davem@davemloft.net>
15615
15616 * powerpc.cc: New file.
15617 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15618 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15619 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15620 * Makefile.in: Rebuild.
15621
7b308235
ILT
156222008-06-09 Ian Lance Taylor <iant@google.com>
15623
15624 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15625 <exception>.
15626 (throwing, orig_terminate): New static variables.
15627 (terminate_handler): New static function.
15628 (t2): Set terminate handler.
15629
f0b886e3
ILT
156302008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15631
15632 PR 6584
cd536b21 15633 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15634 alignment.
15635
3e90f135
CC
156362008-05-30 Cary Coutant <ccoutant@google.com>
15637
15638 * archive.cc (Archive::include_all_members) Correct to step
15639 over symbol table and extended name table in thin archives.
15640
e09ad04a
ILT
156412008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15642
15643 PR 6407
15644 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15645 calculation.
15646
62b01cb5
ILT
156472008-05-28 Caleb Howe <cshowe@google.com>
15648
15649 * reduced_debug_output.cc: New file.
15650 * reduced_debug_output.h: New file.
92de84a6 15651 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15652 * options.cc (General_options::finalize): Add strip_debug_non_line
15653 to the strip heirarchy.
15654 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15655 fields.
15656 * layout.cc: Include "reduced_debug_output.h".
15657 (Layout::Layout): Initialize new fields.
15658 (line_only_debug_sections): New static array.
15659 (is_lines_only_debug_sections): New static inline function.
15660 (Layout::include_section): Handle --strip-debug-non-line.
15661 (Layout::make_output_section): If --strip-debug-non-line, build
15662 new output sections for .debug_abbrev and .debug_info.
15663 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15664 gold. Warn about possible overflow.
15665 (read_signed_LEB_128): Likewise.
15666 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15667 (read_signed_LEB_128): Declare.
15668 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15669 (HFILES): Add reduced_debug_output.h.
15670 * Makefile.in: Rebuild.
15671
7d9e3d98
ILT
156722008-05-21 Ian Lance Taylor <iant@google.com>
15673
15674 * mapfile.cc: New file.
15675 * mapfile.h: New file.
15676 * options.h (class General_options): Add -M/--print-map and -Map.
15677 * options.cc (General_options::finalize): Make -M equivalent to
15678 -Map -.
15679 * main.cc: Include <cstdio> and "mapfile.h".
15680 (main): Open mapfile if requested.
15681 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15682 constructor. Change caller.
15683 (queue_initial_tasks): Add mapfile parameter. Change caller.
15684 (queue_middle_tasks): Likewise.
15685 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15686 declarations.
15687 * archive.cc: Include "mapfile.h".
15688 (Archive::add_symbols): Add mapfile parameter. Change all
15689 callers. Pass mapfile, symbol, and reason to include_member.
15690 (Archive::include_all_members): Add mapfile parameter. Change all
15691 callers.
15692 (Archive::include_member): Add mapfile, sym, and why parameters.
15693 Change all callers. Report inclusion to map file.
15694 * archive.h: Include "fileread.h".
15695 (class Archive): Update declarations.
15696 (Archive::file): New const method.
15697 (class Add_archive_symbols): Add mapfile_ field. Update
15698 constructor. Change all callers.
15699 * readsyms.h (class Read_symbols): Likewise.
15700 (class Finish_group): Likewise.
15701 (class Read_script): Likewise.
15702 * common.cc: Include "mapfile.h".
15703 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15704 all callers.
15705 (Symbol_table::do_allocate_commons): Likewise.
15706 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15707 symbol allocation to mapfile.
15708 * common.h (class Allocate_commons_task): Add mapfile_ field.
15709 Update constructor. Change all callers.
15710 * symtab.h (class Symbol_table): Update declarations.
15711 * layout.cc: Include "mapfile.h".
15712 (Layout_task_runner::run): Print information to mapfile.
15713 (Layout::create_gold_note): Change Output_data_fixed_space to
15714 Output_data_zero_fill.
15715 (Layout::create_build_id): Likewise.
15716 (Layout::print_to_mapfile): New function.
15717 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15718 constructor. Change caller.
15719 (class Layout): Declare print_to_mapfile.
15720 * output.cc (Output_section::Input_section::print_to_mapfile): New
15721 function.
15722 (Output_section::add_input_section): If producing a map, always
15723 add to input_sections_ list.
15724 (Output_section::do_print_to_mapfile): New function.
15725 (Output_segment::print_sections_to_mapfile): New function.
15726 (Output_segment::print_section_list_to_mapfile): New function.
15727 * output.h: Include "mapfile.h".
15728 (Output_data::print_to_mapfile): New function.
15729 (Output_data::do_print_to_mapfile): New virtual function.
15730 (Output_segment_headers::do_print_to_mapfile): New function.
15731 (Output_file_header::do_print_to_mapfile): New function.
15732 (Output_data_const::do_print_to_mapfile): New function.
15733 (class Output_data_const_buffer): Add map_name_ field. Update
15734 constructor. Change all callers. Add do_print_to_mapfile
15735 function.
15736 (class Output_data_fixed_space): Likewise.
15737 (class Output_data_space): Likewise.
15738 (class Output_data_zero_fill): New class.
15739 (Output_data_strtab::do_print_to_mapfile): New function.
15740 (Output_data_reloc_base::do_print_to_mapfile): New function.
15741 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15742 (Output_data_group::do_print_to_mapfile): New function.
15743 (Output_data_got::do_print_to_mapfile): New function.
15744 (Output_data_dynamic::do_print_to_mapfile): New function.
15745 (Output_symtab_xindex::do_print_to_mapfile): New function.
15746 (class Output_section): Declare do_print_to_mapflie. Declare
15747 print_to_mapfile in Input_section.
15748 (class Output_segment): Declare new functions.
15749 * object.h (Sized_relobj::symbol_count): New function.
15750 * script-sections.cc
15751 (Output_section_element_dot_assignment::set_section_addresses):
15752 Change Output_data_fixed_space to Output_data_zero_fill.
15753 (Output_data_expression::do_print_to_mapfile): New function.
15754 * script.cc (read_input_script): Add mapfile parameter. Change
15755 all callers.
15756 * script.h (read_input_script): Update declaration.
15757 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15758 (Eh_frame::do_print_to_mapfile): New function.
15759 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15760 (Output_merge_string::do_print_to_mapfile): New function.
15761 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15762 function.
15763 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15764 function.
15765 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15766 function.
15767 * Makefile.am (CCFILES): Add mapfile.cc.
15768 (HFILES): Add mapfile.h.
15769 * Makefile.in: Rebuild.
15770
9f1d377b
ILT
157712008-05-19 Ian Lance Taylor <iant@google.com>
15772
15773 * options.h (class General_options): Add -z relro.
15774 * layout.cc (Layout::Layout): Initialize relro_segment_.
15775 (Layout::add_output_section_data): Return the output section.
15776 (Layout::make_output_section): Rcognize relro sections and mark
15777 them appropriately.
15778 (Layout::attach_allocated_section_to_segment): Put relro sections
15779 in a PT_GNU_RELRO segment.
15780 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15781 section as relro.
15782 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15783 PT_TLS segments.
15784 (Layout::linkonce_mapping): Map d.rel.ro.local to
15785 .data.rel.ro.local.
15786 (Layout::output_section_name): Us .data.rel.ro.local for any
15787 section which begins with that.
15788 * layout.h (class Layout): Update add_output_section_data
15789 declaration. Add relro_segment_ field.
15790 * output.cc (Output_section::Output_section): Initialize is_relro_
15791 and is_relro_local_ fields.
15792 (Output_segment::add_output_section): Group relro sections.
15793 (Output_segment::is_first_section_relro): New function.
15794 (Output_segment::maximum_alignment): If there is a relro section,
15795 align the segment to the common page size.
15796 (Output_segment::set_section_addresses): Track whether we are
15797 looking at relro sections. If the last section is a relro
15798 section, align to the common page size.
15799 (Output_segment::set_section_list_addresses): Add in_relro
15800 parameter. Change all callers. Align to the page size when
15801 moving from relro to non-relro section.
15802 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15803 segment.
15804 * output.h (class Output_section): Add is_relro_ and
15805 is_relro_local_ fields.
15806 (Output_section::is_relro): New function.
15807 (Output_section::set_is_relro): New function.
15808 (Output_section::is_relro_local): New function.
15809 (Output_section::set_is_relro_local): New function.
15810 (class Output_segment): Update declarations.
15811 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15812 * sparc.cc (Target_sparc::got_section): Likewise.
15813 * x86_64.cc (Target_x86_64::got_section): Likewise.
15814 * testsuite/relro_test_main.cc: New file.
15815 * testsuite/relro_test.cc: New file.
15816 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15817 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15818 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15819 (relro_test.so, relro_test_pic.o): New targets.
15820 * testsuite/Makefile.in: Rebuild.
15821
a984ee1d
ILT
158222008-05-16 Ian Lance Taylor <iant@google.com>
15823
01676dcd
ILT
15824 * output.cc (Output_segment::add_output_section): Remove front
15825 parameter.
15826 * output.h (class Output_segment): Remove
15827 add_initial_output_section and overloaded add_output_section.
15828 Update declaration of remaining add_output_section.
15829 * layout.cc (Layout::create_interp): Call add_output_section
15830 rather than add_initial_output_section.
15831 (Layout::finish_dynamic_section): Likewise.
15832
497897f9
ILT
15833 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15834 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15835 know the dynamic type.
15836 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15837 field. Initialize it in constructor.
15838 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15839 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15840 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15841 reloc.
15842
a984ee1d
ILT
15843 * output.cc (Output_reloc::get_address): Change return type to
15844 Elf_Addr.
15845 * output.h (class Output_reloc): Update get_address declaration.
15846 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15847 for section addresses.
15848
55ba0940
ILT
158492008-05-09 Ian Lance Taylor <iant@google.com>
15850
15851 PR 6493
15852 * gold.cc (gold_nomem): Use return value of write.
15853
75517b77
ILT
158542008-05-08 Ian Lance Taylor <iant@google.com>
15855
15856 * symtab.c (Symbol::init_base_output_data): Add version
15857 parameter. Change all callers.
15858 (Symbol::init_base_output_segment): Likewise.
15859 (Symbol::init_base_constant): Likewise.
15860 (Symbol::init_base_undefined): Likewise.
15861 (Sized_symbol::init_output_data): Likewise.
15862 (Sized_symbol::init_output_segment): Likewise.
15863 (Sized_symbol::init_constant): Likewise.
15864 (Sized_symbol::init_undefined): Likewise.
15865 (Symbol_table::do_define_in_output_data): If the new symbol has a
15866 version, mark it as the default.
15867 (Symbol_table::do_define_in_output_segment): Likewise.
15868 (Symbol_table::do_define_as_constant): Likewise.
15869 * symtab.h (class Symbol): Update declarations.
15870 (class Sized_symbol): Likewise.
15871 * resolve.cc (Symbol::override_version): New function.
c42e122e 15872 (Symbol::override_base): Call override_version.
75517b77
ILT
15873 (Symbol::override_base_with_special): Likewise.
15874 * testsuite/ver_script_8.script: New file.
15875 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15876 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15877 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15878 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15879
f1f70eae
ILT
158802008-05-06 Ian Lance Taylor <iant@google.com>
15881
f3e9c5c5
ILT
15882 PR 6049
15883 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15884 functions.
15885 (class General_options): Remove existing --undefined, and add
15886 --no-undefined instead. Add new --undefined as synonym for -u.
15887 * archive.cc (Archive::add_symbols): Check whether symbol was
15888 named with -u.
15889 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15890 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15891 all uses. Add IS_UNDEFINED. Update declarations to split
15892 different versions of init_base. Declare init_base_undefined.
15893 (Symbol::is_defined): Handle IS_UNDEFINED.
15894 (Symbol::is_undefined): Likewise.
15895 (Symbol::is_weak_undefined): Call is_undefined.
15896 (Symbol::is_absolute): Handle IS_CONSTANT.
15897 (class Sized_symbol): Update declarations to split different
15898 versions of init. Declare init_undefined.
15899 (class Symbol_table): Declare new functions.
15900 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15901 Change all callers.
15902 (Symbol::init_base_output_data): Likewise.
15903 (Symbol::init_base_output_segment): Likewise.
15904 (Symbol::init_base_constant): Likewise.
15905 (Symbol::init_base_undefined): New function.
15906 (Sized_symbol::init_object): Rename from init. Change all
15907 callers.
15908 (Sized_symbol::init_output_data): Likewise.
15909 (Sized_symbol::init_output_segment): Likewise.
15910 (Sized_symbol::init_constant): Likewise.
15911 (Sized_symbol::init_undefined): New function.
15912 (Symbol_table::add_undefined_symbols_from_command_line): New
15913 function.
15914 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15915 function.
15916 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15917 (Symbol::output_section): Likewise.
15918 (Symbol::set_output_section): Likewise.
15919 (Symbol_table::sized_finalize_symbol): Likewise.
15920 (Symbol_table::sized_write_globals): Likewise.
15921 * resolve.cc (Symbol_table::should_override): Likewise.
15922 (Symbol::override_base_with_special): Likewise.
15923
8bdcdf2c
ILT
15924 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15925 symbol, change it to have default visibility.
15926 * testsuite/protected_1.cc: New file.
15927 * testsuite/protected_2.cc: New file.
15928 * testsuite/protected_3.cc: New file.
15929 * testsuite/protected_main_1.cc: New file.
15930 * testsuite/protected_main_2.cc: New file.
15931 * testsuite/protected_main_3.cc: New file.
15932 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15933 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15934 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15935 (protected_1.so): New target.
15936 (protected_1_pic.o, protected_2_pic.o): New targets.
15937 (protected_3_pic.o): New target.
15938 (check_PROGRAMS): Add protected_2.
15939 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15940 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15941 * testsuite/Makefile.in: Rebuild.
15942
2b706932
ILT
15943 * options.h (DEFINE_var): Add set_user_set_##varname__.
15944 (DEFINE_bool_alias): New macro.
15945 (class General_options): Define -Bstatic using DEFINE_bool_alias
15946 rather than DEFINE_special. Add --undefined as an alias for -z
15947 defs.
15948 * options.cc (General_options::parse_Bstatic): Remove.
15949
d82a5bcc
ILT
15950 * options.h (class General_options): Add --fatal-warnings.
15951 * main.cc (main): Implement --fatal-warnings.
15952 * errors.h (Errors::warning_count): New function.
15953
f1f70eae
ILT
15954 * options.h (class General_options): Add -Bsymbolic-functions.
15955 * symtab.h (Symbol::is_preemptible): Check for
15956 -Bsymbolic-functions.
15957
8825ac63
ILT
159582008-05-05 Ian Lance Taylor <iant@google.com>
15959
d98bc257
ILT
15960 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15961 as noVARNAME rather than no-VARNAME.
15962 (class General_options): Add option -z combreloc.
15963 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15964 get_address.
15965 (Output_reloc::sort_before) [SHT_REL]: New function.
15966 (Output_reloc::sort_before) [SHT_RELA]: New function.
15967 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15968 Sort_relocs_comparison.
15969 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15970 parameter. Change all callers.
15971 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15972 sort_relocs parameter. Change all callers.
15973 * output.cc (Output_reloc::get_address): New function, broken out
15974 of write_rel.
15975 (Output_reloc::write_rel): Call it.
15976 (Output_reloc::compare): New function.
15977 (Output_data_reloc_base::do_write): Optionally sort relocs.
15978
60b2b4e7
ILT
15979 * configure.ac: If targ_extra_obj is set, link it in.
15980 * configure.tgt: Initialize all variables.
15981 (x86_64*): Set targ_extra_obj and targ_extra_size.
15982 * configure: Rebuild.
15983
8825ac63
ILT
15984 * object.cc (Sized_relobj::include_section_group): Adjust section
15985 indexes read from group data. Build vector to pass to
15986 layout_group.
15987 * layout.cc (Layout::layout_group): Add flags and shndxes
15988 parameters. Remove contents parameter. Change caller. Update
15989 explicit instantiations.
15990 * layout.h (class Layout): Update layout_group declaration.
15991 * output.cc (Output_data_group::Output_data_group): Add flags and
15992 input_shndxes parameters. Remove contents parameter. Change
15993 caller.
15994 (Output_data_group::do_write): Change input_sections_ to
15995 input_shndxes_.
15996 * output.h (class Output_data_group): Update constructor
15997 declaration. Rename input_sections_ to input_shndxes_.
15998 * testsuite/many_sections_test.cc: Add template.
15999
e94cf127
CC
160002008-04-30 Cary Coutant <ccoutant@google.com>
16001
4418b2d5
CC
16002 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16003
e94cf127
CC
16004 * layout.cc (Layout::include_section): Refactored check for debug
16005 info section.
16006 (Layout::add_comdat): Add new parameters. Change type
16007 of signature parameter. Add object and shndx to signatures table.
16008 (Layout::find_kept_object): New function.
16009 * layout.h: Include <cstring>.
16010 (Layout::is_debug_info_section): New function.
16011 (Layout::add_comdat): Add new parameters.
16012 (Layout::find_kept_object): New function.
16013 (Layout::Kept_section): New struct.
16014 (Layout::Signatures): Change type of map range.
16015 * object.cc (Relobj::output_section_address): New function.
16016 (Sized_relobj::include_section_group): Add new parameters. Change
16017 calls to Layout::add_comdat. Change to build table of kept comdat
16018 groups and table mapping discarded sections to kept sections.
16019 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16020 (Sized_relobj::do_layout): Change calls to include_section_group and
16021 include_linkonce_section.
16022 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16023 value to zero when section is discarded.
16024 (Sized_relobj::map_to_kept_section): New function.
16025 * object.h (Relobj::output_section_address): New function.
16026 (Relobj::Comdat_group): New type.
16027 (Relobj::find_comdat_group): New function.
16028 (Relobj::Comdat_group_table): New type.
16029 (Relobj::Kept_comdat_section): New type.
16030 (Relobj::Kept_comdat_section_table): New type.
16031 (Relobj::add_comdat_group): New function.
16032 (Relobj::set_kept_comdat_section): New function.
16033 (Relobj::get_kept_comdat_section): New function.
16034 (Relobj::comdat_groups_): New field.
16035 (Relobj::kept_comdat_sections_): New field.
16036 (Symbol_value::input_value): Update comment.
16037 (Sized_relobj::map_to_kept_section) New function.
16038 (Sized_relobj::include_linkonce_section): Add new parameter.
16039 * target-reloc.h (Comdat_behavior): New type.
16040 (get_comdat_behavior): New function.
16041 (relocate_section): Add code to map a discarded section to the
16042 corresponding kept section when applying a relocation.
16043
e4e5049b
CS
160442008-04-30 Craig Silverstein <csilvers@google.com>
16045
16046 * dwarf_reader.cc (next_generation_count): New static var.
16047 (Addr2line_cache_entry): New struct.
16048 (addr2line_cache): New static var.
16049 (Dwarf_line_info::one_addr2line): Added caching.
16050 (Dwarf_line_info::clear_addr2line_cache): New function.
16051 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16052 cache-size parameter.
16053 (Dwarf_line_info::one_addr2line_cache): New function.
16054 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16055 new cache-size argument to one_addr2line(), and clear cache.
16056
d09e9154
CC
160572008-04-28 Cary Coutant <ccoutant@google.com>
16058
16059 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16060 R_386_PC8 relocations.
16061
7ef73768
ILT
160622008-04-23 Ian Lance Taylor <iant@google.com>
16063
55438702
ILT
16064 * object.cc (Sized_relobj::include_section_group): Check for
16065 invalid section group.
16066
c165fb93
ILT
16067 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16068 header size.
16069
7ef73768
ILT
16070 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16071 than read for file header.
16072 * archive.cc (Archive::include_member): Likewise.
16073
6194aaab
L
160742008-04-23 Paolo Bonzini <bonzini@gnu.org>
16075
16076 * aclocal.m4: Regenerate.
16077 * configure: Regenerate.
16078
d491d34e
ILT
160792008-04-19 Ian Lance Taylor <iant@google.com>
16080
5ea2bac6
ILT
16081 * version.cc (version_string): Bump to 1.6.
16082
7bc3e21a
ILT
16083 * testsuite/Makefile.am (many_sections_r_test): New target.
16084 (many_sections_r_test_SOURCES): Remove.
16085 (many_sections_r_test_DEPENDENCIES): Remove.
16086 (many_sections_r_test_LDFLAGS): Remove.
16087 (many_sections_r_test_LDADD): Remove.
16088
7fcd3aa9
ILT
16089 * object.cc (Sized_relobj::do_add_symbols): Always pass
16090 local_symbol_count_ to add_from_relobj.
16091
4c94d6ae
ILT
16092 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16093 every thousand variables.
16094 * testsuite/Makefile.in: Rebuild.
16095
d491d34e
ILT
16096 * object.cc (Xindex::initialize_symtab_xindex): New function.
16097 (Xindex::read_symtab_xindex): New function.
16098 (Xindex::sym_xindex_to_shndx): New function.
16099 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16100 available.
16101 (Sized_relobj::do_initialize_xindex): New function.
16102 (Sized_relobj::do_read_symbols): Adjust section links.
16103 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16104 parameter. Change all callers.
16105 (Sized_relobj::include_section_group): Adjust section links and
16106 symbol section indexes.
16107 (Sized_relobj::do_layout): Adjust section links.
16108 (Sized_relobj::do_count_local_symbols): Adjust section links and
16109 symbol section indexes.
16110 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16111 ordinary and special symbols.
16112 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16113 dynsym_xindex parameters. Change all callers. Adjust section
16114 links. Use SHN_XINDEX when needed.
16115 (Sized_relobj::get_symbol_location_info): Adjust section links.
16116 Don't get fooled by special symbols.
16117 * object.h (class Xindex): Define.
16118 (class Object): Add xindex_ parameter. Declare virtual functoin
16119 do_initialize_xindex.
16120 (Object::adjust_sym_shndx): New function.
16121 (Object::set_xindex): New protected function.
16122 (class Symbol_value): Add is_ordinary_shndx_ field.
16123 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16124 (Symbol_value::value): Assert ordinary section.
16125 (Symbol_value::initialize_input_to_output_map): Likewise.
16126 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16127 Change all callers.
16128 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16129 all callers.
16130 (class Sized_relobj): Update declarations.
16131 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16132 parameter. Change all callers.
16133 (Sized_relobj::adjust_shndx): New function.
16134 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16135 field.
16136 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16137 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16138 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16139 (Sized_dynobj::read_dynsym_section): Adjust section links.
16140 (Sized_dynobj::read_dynamic): Likewise.
16141 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16142 section links.
16143 (Sized_dynobj::do_initialize_xindex): New function.
16144 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16145 do_initialize_xindex.
16146 (Sized_dynobj::adjust_shndx): New function.
16147 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16148 dynsym_xindex_ fields.
16149 (Layout::finalize): Add a call to set_section_indexes before
16150 creating the symtab sections.
16151 (Layout::set_section_indexes): Don't do anything if the section
16152 already has a section index.
16153 (Layout::create_symtab_sections): Add shnum parameter. Change
16154 caller. Create .symtab_shndx section if needed.
16155 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16156 caller.
16157 (Layout::allocated_output_section_count): New function.
16158 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16159 needed.
16160 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16161 fields. Update declarations.
16162 (Layout::symtab_xindex): New function.
16163 (Layout::dynsym_xindex): New function.
16164 (class Write_symbols_task): Add layout_ field.
16165 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16166 Change caller.
16167 * output.cc (Output_section_headers::Output_section_headers): Add
16168 shstrtab_section parameter. Change all callers.
16169 (Output_section_headers::do_sized_write): Store overflow values
16170 for section count and section string table section index in
16171 section header zero.
16172 (Output_file_header::do_sized_write): Check for overflow of
16173 section count and section string table section index.
16174 (Output_symtab_xindex::do_write): New function.
16175 (Output_symtab_xindex::endian_do_write): New function.
16176 * output.h (class Output_section_headers): Add shstrtab_section_.
16177 Update declarations.
16178 (class Output_symtab_xindex): Define.
16179 (Output_section::has_out_shndx): New function.
16180 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16181 field.
16182 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16183 Change all callers.
16184 (Sized_symbol::init): Likewise.
16185 (Symbol::output_section): Check for ordinary symbol.
16186 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16187 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16188 callers.
16189 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16190 Change all callers. Simplify handling of symbols from sections
16191 not included in the link.
16192 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16193 distinction.
16194 (Weak_alias_sorter::operator()): Assert that symbols are
16195 ordinary.
16196 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16197 distinction.
16198 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16199 parameters. Change all callers.
16200 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16201 symbol distinction. Use SHN_XINDEX when needed.
16202 (Symbol_table::write_section_symbol): Add symtab_xindex
16203 parameter. Change all callers.
16204 (Symbol_table::sized_write_section_symbol): Likewise. Use
16205 SHN_XINDEX when needed.
16206 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16207 declarations.
16208 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16209 (Symbol::is_defined): Check is_ordinary.
16210 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16211 (Symbol::is_absolute, Symbol::is_common): Likewise.
16212 (class Sized_symbol): Update declarations.
16213 (class Symbol_table): Update declarations.
16214 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16215 parameters. Change all callers.
16216 (Sized_symbol::override): Likewise.
16217 (Symbol_table::override): Likewise.
16218 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16219 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16220 is_ordinary, and orig_st_shndx parameters. Change all callers.
16221 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16222 to be in an ordinary section.
16223 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16224 object and is_ordinary parameters. Change all callers.
16225 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16226 Change all callers. Don't add undefined or non-ordinary symbols
16227 to reloc_map_.
16228 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16229 Change all callers.
16230 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16231 declarations.
16232 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16233 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16234 (Sized_relobj::relocate_sections): Likewise.
16235 * target-reloc.h (scan_relocs): Adjust section symbol index.
16236 (scan_relocatable_relocs): Likewise.
16237 * i386.cc (Scan::local): Check for ordinary symbols.
16238 * sparc.cc (Scan::local): Likewise.
16239 * x86_64.cc (Scan::local): Likewise.
16240 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16241 to symbol_section_and_value.
16242 * testsuite/many_sections_test.cc: New file.
16243 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16244 (check_PROGRAMS): Add many_sections_test.
16245 (many_sections_test_SOURCES): Define.
16246 (many_sections_test_DEPENDENCIES): Define.
16247 (many_sections_test_LDFLAGS): Define.
16248 (BUILT_SOURCES): Add many_sections_define.h.
16249 (many_sections_define.h): New target.
16250 (BUILT_SOURCES): Add many_sections_check.h.
16251 (many_sections_check.h): New target.
16252 (check_PROGRAMS): Add many_sections_r_test.
16253 (many_sections_r_test_SOURCES): Define.
16254 (many_sections_r_test_DEPENDENCIES): Define.
16255 (many_sections_r_test_LDFLAGS): Define.
16256 (many_sections_r_test_LDADD): Define.
16257 (many_sections_r_test.o): New target.
16258 * testsuite/Makefile.in: Rebuild.
16259
c5818ff1
CC
162602008-04-17 Cary Coutant <ccoutant@google.com>
16261
16262 * errors.cc (Errors::info): New function.
16263 (gold_info): New function.
16264 * errors.h (Errors::info): New function.
16265 * gold.h (gold_info): New function.
16266 * object.cc (Input_objects::add_object): Print trace output.
16267 * options.cc (options::parse_set): New function.
16268 (General_options::parse_wrap): Deleted.
16269 (General_options::General_options): Deleted initializer.
16270 * options.h (options::String_set): New typedef.
16271 (options::parse_set): New function.
16272 (DEFINE_set): New macro.
16273 (General_options::wrap): Changed to use DEFINE_set. Changed
16274 callers of any_wrap_symbols and is_wrap_symbol.
16275 (General_options::trace, General_options::trace_symbol):
16276 New options.
16277 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16278 (General_options::wrap_symbols_): Deleted.
16279 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16280
b5be4a7c
DM
162812008-04-17 David S. Miller <davem@davemloft.net>
16282
16283 * options.cc (General_options::parse_V): New function.
16284 * options.h: Add entries for -V and -Qy.
16285
155a0dd7
ILT
162862008-04-17 Ian Lance Taylor <iant@google.com>
16287
16288 * common.cc (Symbol_table::allocate_commons): Remove options
16289 parameter. Change caller.
16290 (Symbol_table::do_allocate_commons): Remove options parameter.
16291 Change caller. Just call do_allocate_commons_list twice.
16292 (Symbol_table::do_allocate_commons_list): New function, broken out
16293 of do_allocate_commons.
16294 * common.h (class Allocate_commons_task): Remove options_ field.
16295 Update constructor.
16296 * symtab.cc (Symbol_table::Symbol_table): Initialize
16297 tls_commons_.
16298 (Symbol_table::add_from_object): Put TLS common symbols on
16299 tls_commons_ list.
16300 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16301 which are IN_OUTPUT_DATA.
16302 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16303 allocate_commons and do_allocate_commons declarations. Declare
16304 do_allocate_commons_list.
16305 * gold.cc (queue_middle_tasks): Update creation of
16306 Allocate_commons_task to not pass options.
16307 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16308 (TLS_TEST_C_FLAGS): New variable.
16309 (tls_test_c_pic.o): New target.
16310 (tls_test_shared.so): Link in tls_test_c_pic.o.
16311 (tls_test_c_pic_ie.o): New target.
16312 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16313 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16314 (tls_test_c.o): New target.
16315 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16316 (tls_pic_test_LDADD): Likewise.
16317 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16318 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16319 (tls_test_c_gnu2.o): New target.
16320 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16321 tls_test_c_gnu2.o.
16322 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16323 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16324 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16325 * testsuite/tls_test.cc: Include "config.h".
16326 (t_last): Call t11_last.
16327 * testsuite/tls_test.h (t11, t11_last): Declare.
16328 * testsuite/tls_test_c.c: New file.
16329 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16330 * configure.ac: Check for OpenMP support.
16331 * configure, config.in, Makefile.in: Rebuild.
16332 * testsuite/Makefile.in: Rebuild.
16333
edfbb029
CC
163342008-04-16 Cary Coutant <ccoutant@google.com>
16335
16336 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16337 (Target_i386::tls_base_symbol_defined_): New field.
16338 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16339 (Target_i386::Scan::global): Likewise.
16340 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16341 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16342 (Target_x86_64::tls_base_symbol_defined_): New field.
16343 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16344 (Target_x86_64::Scan::global): Likewise.
16345
f3c69fca
CC
163462008-04-16 Cary Coutant <ccoutant@google.com>
16347
16348 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16349 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16350 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16351 building shared libraries.
16352 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16353 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16354 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16355 * testsuite/Makefile.in: Rebuild.
16356 * testsuite/weak_undef.h: New file.
16357 * testsuite/weak_undef_file1.cc: Add extra test cases.
16358 * testsuite/weak_undef_file2.cc: Likewise.
16359 * testsuite/weak_undef_test.cc: Likewise.
16360
7c414435
DM
163612008-04-16 David S. Miller <davem@davemloft.net>
16362
32b769e1
DM
16363 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16364 Add issued_non_pic_error_ field. Declare check_non_pic.
16365 (Target_sparc::Scan::check_non_pic): New function.
16366 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16367 (Target_sparc::Scan::global): Likewise.
16368
11936fb1
DM
16369 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16370 * configure: Rebuild.
16371
7c414435
DM
16372 * options.h (DEFINE_enable): New macro.
16373 (new_dtags): New enable option.
16374 (initfirst, interpose, loadfltr, nodefaultlib,
16375 nodelete, nodlopen, nodump): New -z options.
16376 * layout.cc (Layout:finish_dynamic_section): If new
16377 dtags enabled, emit DT_RUNPATH. Also, emit a
16378 DT_FLAGS_1 containing any specified -z flags.
16379
85c7bf8b
ILT
163802008-04-16 Ian Lance Taylor <iant@google.com>
16381
12c0daef
ILT
16382 * copy-relocs.cc: New file.
16383 * copy-relocs.h: New file.
16384 * reloc.cc: Remove Copy_relocs code.
16385 * reloc.h: Likewise.
16386 * reloc-types.h (struct Reloc_types) [both versions]: Add
16387 get_reloc_addend_noerror.
16388 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16389 variants of add_global which take an addend which must be zero.
16390 * i386.cc: Include "copy-relocs.h".
16391 (class Target_i386): Change type of copy_relocs_ to variable,
16392 update initializer.
16393 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16394 Change all callers.
16395 (Target_i386::do_finalize_sections): Change handling of
16396 copy_relocs_.
16397 * sparc.cc: Include "copy-relocs.h".
16398 (class Target_sparc): Change type of copy_relocs_ to variable,
16399 update initializer.
16400 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16401 Change all callers.
16402 (Target_sparc::do_finalize_sections): Change handling of
16403 copy_relocs_.
16404 * x86_64.cc: Include "copy-relocs.h".
16405 (class Target_x86_64): Change type of copy_relocs_ to variable,
16406 update initializer.
16407 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16408 class. Change all callers.
16409 (Target_x86_64::do_finalize_sections): Change handling of
16410 copy_relocs_.
16411 * Makefile.am (CCFILES): Add copy-relocs.cc.
16412 (HFILES): Add copy-relocs.h.
16413
4f4995b6
ILT
16414 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16415
85c7bf8b
ILT
16416 * testsuite/script_test_4.sh: Permit leading zeroes.
16417
4f2a9edd
ILT
164182008-04-15 Ian Lance Taylor <iant@google.com>
16419
e6188289
ILT
16420 * script-sections.cc (Script_sections::create_segments): Use
16421 header_size_adjustment even when there is enough room for the
16422 headers.
16423 * testsuite/script_test_4.sh: New file.
16424 * testsuite/script_test_4.t: New file.
16425 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16426 (check_DATA): Add script_test_4.stdout.
16427 (MOSTLYCLEANFILES): Likewise.
16428 (script_test_4): New target.
16429 (script_test_4.stdout): New target.
16430 * testsuite/Makefile.in: Rebuild.
16431
4f2a9edd
ILT
16432 * sparc.cc: Add definitions for Output_data_plt_sparc class
16433 constants.
16434
f5314dd5
DM
164352008-04-14 David S. Miller <davem@davemloft.net>
16436
16437 * sparc.cc: New file.
16438 * Makefile.am (TARGETSOURCES): Add sparc.cc
16439 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16440 * configure.tgt: Document targ_extra_size and
16441 targ_extra_big_endian. Add entries for sparc-* and
16442 sparc64-*.
16443 * configure.ac: Handle targ_extra_size and
16444 targ_extra_big_endian.
16445 * Makefile.in: Rebuild.
16446 * configure: Likewise.
16447 * po/POTFILES.in: Likewise.
16448 * po/gold.pot: Likewise.
16449
154e0e9a
ILT
164502008-04-14 Ian Lance Taylor <iant@google.com>
16451
16452 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16453 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16454 in the name/type/flags to section mapping. Don't call
16455 allocate_output_section.
16456 (Layout::choose_output_section): Change parameter from adjust_name
16457 to is_input_section. Don't permit input sections after sections
16458 are attached to segments. Don't call allocate_output_section.
16459 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16460 not write_enable_output_section.
16461 (Layout::make_output_section): Don't push to
16462 unattached_section_list_ nor call attach_to_segment. Call
16463 attach_section_to_segment if sections are attached.
16464 (Layout::attach_sections_to_segments): New function.
16465 (Layout::attach_section_to_segment): New function.
16466 (Layout::attach_allocated_section_to_segment): Rename from
16467 attach_to_segment. Remove flags parameter.
16468 (Layout::allocate_output_section): Remove function.
16469 (Layout::write_enable_output_section): Remove function.
16470 * layout.h (class Layout): Update for above changes. Add new
16471 field sections_are_attached_.
16472 * output.h (Output_section::update_flags_for_input_section): New
16473 function.
16474 * output.cc (Output_section::add_input_section): Call
16475 update_flags_for_input_section.
16476 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16477
009a67a2
CC
164782008-04-11 Cary Coutant <ccoutant@google.com>
16479
16480 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16481 thought unnecessary.
16482 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16483
759b1a24
ILT
164842008-04-11 Ian Lance Taylor <iant@google.com>
16485
16486 * output.h (class Output_section_data): Remove inline definition
16487 of set_addralign.
16488 * output.cc (Output_section_data::set_addralign): New function.
16489
c2b45e22
CC
164902008-04-11 Cary Coutant <ccoutant@google.com>
16491
16492 Add support for TLS descriptors for i386 and x86_64.
16493 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16494 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16495 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16496 GOT_TYPE_TLS_DESC.
16497 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16498 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16499 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16500 relocations.
16501 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16502 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16503 Fix problem with initial-exec relocations.
16504 (Target_i386::Relocate::relocate_tls): Likewise.
16505 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16506 relaxation.
16507 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16508 support for section-plus-offset dynamic table entries.
16509 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16510 (Output_data_dynamic::Dynamic_entry): Add support for
16511 section-plus-offset dynamic table entries.
16512 (Output_data_dynamic::Classification): Likewise.
16513 (Output_data_dynamic::classification_): Renamed offset_.
16514 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16515 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16516 (Target_x86_64::make_plt_section): New function.
16517 (Target_x86_64::reserve_tlsdesc_entries): New function.
16518 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16519 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16520 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16521 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16522 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16523 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16524 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16525 add extra PLT entry for TLS descriptors.
16526 (Output_data_plt_x86_64::got_): New field.
16527 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16528 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16529 fields.
16530 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16531 descriptors.
16532 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16533 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16534 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16535 R_386_TLS_DESC_CALL relocations.
16536 (Target_x86_64::Scan::global): Likewise.
16537 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16538 for TLS descriptors.
16539 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16540 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16541 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16542 GD-to-IE relaxation.
16543 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16544 and TLS_DESCRIPTORS.
16545 * Makefile.in: Rebuild.
16546 * configure: Rebuild.
16547 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16548 (tls_test_shared2.so): New target.
16549 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16550 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16551 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16552 (tls_shared_gd_to_ie_test_LDADD): New variable.
16553 (tls_shared_gnu2_gd_to_ie_test): New target.
16554 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16555 New targets.
16556 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16557 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16558 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16559 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16560 (tls_shared_gnu2_test): New target.
16561 (tls_test_gnu2_shared.so): New target.
16562 (tls_shared_gnu2_test_SOURCES): New variable.
16563 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16564 (tls_shared_gnu2_test_LDFLAGS): New variable.
16565 (tls_shared_gnu2_test_LDADD): New variable.
16566 * testsuite/Makefile.in: Rebuild.
16567 * testsuite/Makefile.
16568
83bfb6b7
ILT
165692008-04-11 Ian Lance Taylor <iant@google.com>
16570
16571 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16572 justsyms.t.
16573 * testsuite/Makefile.in: Rebuild.
16574
16575 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16576 long.
16577 * testsuite/script_test_2.cc (main): Adjust test.
16578
706e1f5e
ILT
165792008-04-11 David S. Miller <davem@davemloft.net>
16580 Ian Lance Taylor <iant@google.com>
16581
16582 * options.h (General_options): Add entries for '-Y' and
16583 '-relax'.
16584 * options.cc (General_options:finalize): If -Y was used, add those
16585 entries to the library path instead of the default "/lib" and
16586 "/usr/lib".
16587
7c98e6bb
DM
165882008-04-11 David S. Miller <davem@davemloft.net>
16589
16590 * testsuite/justsyms.t: Start at 0x100.
16591 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16592 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16593 long.
16594 * testsuite/script_test_2.cc: Adjust string and section length
16595 checks.
7c98e6bb 16596
99a37bfd
ILT
165972008-04-09 Ian Lance Taylor <iant@google.com>
16598
2cefc357
ILT
16599 PR gold/5996
16600 * script-sections.cc (Sections_element::allocate_to_segment): Add
16601 orphan parameter.
16602 (Output_section_definition::allocate_to_segment): Likewise.
16603 (Orphan_output_section::allocate_to_segment): Likewise.
16604 (Script_sections::attach_sections_using_phdrs_clause): Don't
16605 propagate non-PT_LOAD segments to orphan sections.
16606 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16607 readelf rather than objdump.
16608 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16609 .interp section and PT_INTERP segment are the same size.
16610 * testsuite/Makefile.in: Rebuild.
16611
99a37bfd
ILT
16612 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16613 aliases for symbols defined in the same object.
16614 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16615 (weak_alias_test_SOURCES): New variable.
16616 (weak_alias_test_DEPENDENCIES): New variable.
16617 (weak_alias_test_LDFLAGS): New variable.
16618 (weak_alias_test_LDADD): New variable.
16619 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16620 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16621 (weak_alias_test_3.o): New target.
16622 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16623 * testsuite/weak_alias_test_main.cc: New file.
16624 * testsuite/weak_alias_test_1.cc: New file.
16625 * testsuite/weak_alias_test_2.cc: New file.
16626 * testsuite/weak_alias_test_3.cc: New file.
16627
780e49c5
ILT
166282008-04-08 Ian Lance Taylor <iant@google.com>
16629
cdb0b8f5
ILT
16630 * options.h (class General_options): Add --noinhibit-exec option.
16631 * main.cc (main): Check --noinhibit-exec.
16632
0864d551
ILT
16633 * options.h (class General_options): Define --wrap as a special
16634 option. Add wrap_symbols_ field.
16635 (General_options::any_wrap_symbols): New function.
16636 (General_options::is_wrap_symbol): New function.
16637 * options.cc (General_options::parse_wrap): New function.
16638 (General_options::General_options): Initialize wrap_symbols_.
16639 * symtab.cc (Symbol_table::wrap_symbol): New function.
16640 (Symbol_table::add_from_object): Handle --wrap.
16641 * symtab.h (class Symbol_table): Declare wrap_symbol.
16642 * target.h (Target::wrap_char): New function.
16643 (Target::Target_info): Add wrap_char field.
16644 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16645 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16646 * testsuite/testfile.cc (Target_test::test_target_info):
16647 Likewise.
16648
789aa6de
ILT
16649 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16650 there is one.
16651
2c38906f
ILT
16652 * layout.h (class Layout): Add added_eh_frame_data_ field.
16653 * layout.cc (Layout::Layout): Initialize new field.
16654 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16655 output section until we find a section we merged successfully.
16656 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16657 that the size be non-zero.
16658
780e49c5
ILT
16659 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16660 qualifier.
16661
7fcd0256
ILT
166622008-04-08 Craig Silverstein <csilvers@google.com>
16663
16664 * configure.ac: Export new conditional variable HAVE_ZLIB.
16665 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16666 on HAVE_ZLIB.
16667 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16668 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16669
6835af53
ILT
166702008-04-07 Ian Lance Taylor <iant@google.com>
16671
e24f324c
ILT
16672 * version.cc (version_string): Set to "1.5".
16673
a036edd8
ILT
16674 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16675 Add issued_non_pic_error_ field. Declare check_non_pic.
16676 (Target_x86_64::Scan::check_non_pic): New function.
16677 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16678 (Target_x86_64::Scan::global): Likewise.
16679
624f8810
ILT
16680 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16681 addend parameter. Change caller. Handle merge sections.
16682 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16683 Address to Addend. Don't add in the result of
16684 local_section_offset, pass down the addend and use the returned
16685 value.
16686 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16687 Update declarations of local_section_offset and symbol_value.
16688 * testsuite/two_file_test_1.cc (t18): New function.
16689 * testsuite/two_file_test_2.cc (f18): New function.
16690 * testsuite/two_file_test_main.cc (main): Call t18.
16691 * testsuite/two_file_test.h (t18, f18): Declare.
16692
6835af53
ILT
16693 * configure.ac: Don't test for objdump, c++filt, or readelf.
16694 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16695 conditionals.
16696 (TEST_READELF): New variable.
16697 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16698 (check_PROGRAMS): Add two_file_strip_test.
16699 (two_file_strip_test): New target.
16700 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16701 (two_file_same_shared_strip_test_SOURCES): New variable.
16702 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16703 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16704 (two_file_same_shared_strip_test_LDADD): New variable.
16705 (two_file_shared_strip.so): New target.
16706 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16707 (ver_test_5.syms, ver_test_7.syms): Likewise.
16708 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16709 (strip_test_3.stdout): Use TEST_OBJDUMP.
16710 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16711
86925eef
CC
167122008-04-04 Cary Coutant <ccoutant@google.com>
16713
16714 * symtab.h (Symbol::is_weak_undefined): New function.
16715 (Symbol::is_strong_undefined): New function.
16716 (Symbol::is_absolute): New function.
16717 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16718 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16719 absolute symbols.
16720 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16721 (weak_undef_test): New target.
16722 * testsuite/Makefile.in: Rebuild.
16723 * testsuite/weak_undef_file1.cc: New file.
16724 * testsuite/weak_undef_file2.cc: New file.
16725 * testsuite/weak_undef_test.cc: New file.
16726
126f3ece
ILT
167272008-04-03 Craig Silverstein <csilvers@google.com>
16728
16729 * compressed_output.h (class Output_compressed_section): Use
16730 unsigned buffer.
16731 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16732 add zlib header.
16733 (zlib_compressed_suffix): Removed.
16734 (Output_compressed_section::set_final_data_size): Use unsigned
16735 buffers.
16736 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16737 Fix linker invocation.
16738 (flagstest_o_specialfile_and_compress_debug_sections):
16739 Likewise.
16740 * testsuite/Makefile.in: Regenerated.
16741
deae2a14
DM
167422008-04-02 David S. Miller <davem@davemloft.net>
16743
16744 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16745 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16746
70752818
ILT
167472008-04-02 Craig Silverstein <csilvers@google.com>
16748
16749 * TODO: New file.
16750
39d0cb0e
ILT
167512008-04-02 Ian Lance Taylor <iant@google.com>
16752
16753 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16754 parameters. Update for new key type to views_. Change all
16755 callers.
16756 (File_read::read): Adjust for byteshift in returned view.
16757 (File_read::add_view): New function, broken out of
16758 find_and_make_view.
16759 (File_read::make_view): New function, broken out of
16760 find_and_make_view.
16761 (File_read::find_or_make_view): Add offset and aligned
16762 parameters. Rewrite accordingly. Change all callers.
16763 (File_read::get_view): Add offset and aligned parameters. Adjust
16764 for byteshift in return value.
16765 (File_read::get_lasting_view): Likewise.
16766 * fileread.h (class File_read): Update declarations.
16767 (class File_read::View): Add byteshift_ field. Add byteshift to
16768 constructor. Add byteshift method.
16769 * archive.h (Archive::clear_uncached_views): New function.
16770 (Archive::get_view): Add aligned parameter. Change all callers.
16771 * object.h (Object::get_view): Add aligned parameter. Change all
16772 callers.
16773 (Object::get_lasting_view): Likewise.
16774
16775 * fileread.cc (File_read::release): Don't call clear_views if
16776 there are multiple objects.
16777 * fileread.h (File_read::clear_uncached_views): New function.
16778 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16779 on the archive.
16780
a1207466
CC
167812008-03-31 Cary Coutant <ccoutant@google.com>
16782
16783 Add thin archive support.
16784 * archive.cc (Archive::armagt): New const.
16785 (Archive::setup): Remove task parameter and calls to unlock.
16786 (Archive::unlock_nested_archives): New function.
16787 (Archive::read_header): Add nested_off parameter. Change
16788 all callers.
16789 (Archive::interpret_header): Likewise.
16790 (Archive::include_all_members): Change to handle thin
16791 archives.
16792 (Archive::include_member): Likewise.
16793 * archive.h (Archive::Archive): Add new parameters and
16794 initializers.
16795 (Archive::armagt): New const.
16796 (Archive::setup): Remove task parameter.
16797 (Archive::unlock_nested_archives): New function.
16798 (Archive::read_header): Add nested_off parameter.
16799 (Archive::interpret_header): Likewise.
16800 (Archive::Nested_archive_table): New typedef.
16801 (Archive::is_thin_archive_): New field.
16802 (Archive::nested_archives_): New field.
16803 (Archive::options_): New field.
16804 (Archive::dirpath_): New field.
16805 (Archive::task_): New field.
16806 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16807 for thin archives. Pass additional parameters to
16808 Archive::Archive. Unlock the archive file after calling
16809 Archive::setup.
cd536b21 16810
479f6503
ILT
168112008-03-29 Ian Lance Taylor <iant@google.com>
16812
686c8caf
ILT
16813 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16814 version symbol to be local.
16815 * testsuite/ver_test_4.sh: New file.
16816 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16817 (check_DATA): Add ver_test_4.syms.
16818 (ver_test_4.syms): New target.
16819 * testsuite/Makefile.in: Rebuild.
16820
ab794b6b
ILT
16821 * output.cc
16822 (Output_section::Input_section_sort_entry::has_priority): New
16823 function.
16824 (Output_section::Input_section_sort_entry::match_file_name): New
16825 function.
16826 (Output_section::Input_section_sort_entry::match_section_name):
16827 Remove.
16828 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16829 Remove.
16830 (Output_section::Input_section_sort_entry::match_section_file):
16831 Remove.
16832 (Output_section::Input_section_sort_compare::operator()): Rewrite
16833 using new Input_section_sort_entry functions. Sort crtbegin and
16834 crtend first. Sort sections with no priority before sections with
16835 a priority.
16836 * testsuite/initpri1.c (d3): Check j != 4.
16837 (cd5): New constructor/destructor function.
16838 (main): Check j != 2.
16839
479f6503
ILT
16840 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16841 new symbol when resolving, don't call set_is_default.
16842 * testsuite/ver_test_7.cc: New file.
16843 * testsuite/ver_test_7.sh: New file.
16844 * testsuite/Makefile.am (ver_test_7.so): New target.
16845 (ver_test_7.o): New target.
16846 (check_SCRIPTS): Add ver_test_7.sh.
16847 (check_DATA): Add ver_test_7.syms.
16848 (ver_test_7.syms): New target.
16849
2fd32231
ILT
168502008-03-28 Ian Lance Taylor <iant@google.com>
16851
16852 * layout.cc (Layout::layout): If we see an input section with a
16853 name that needs sorting, set the must_sort flag for the output
16854 section.
16855 (Layout::make_output_section): If the name of the output section
16856 indicates that it might require sorting, set the may_sort flag.
16857 * output.h (Output_section::may_sort_attached_input_sections): New
16858 function.
16859 (Output_section::set_may_sort_attached_input_sections): New
16860 function.
16861 (Output_section::must_sort_attached_input_sections): New
16862 function.
16863 (Output_section::set_must_sort_attached_input_sections): New
16864 function.
16865 (class Output_section): Declare Input_section_sort_entry. Define
16866 Input_section_sort_compare. Declare
16867 sort_attached_input_sections. Add new fields:
16868 may_sort_attached_input_sections_,
16869 must_sort_attached_input_sections_,
16870 attached_input_sections_are_sorted_.
16871 * output.cc (Output_section::Output_section): Initialize new
16872 fields.
16873 (Output_section::add_input_section): Add an entry to
16874 input_sections_ if may_sort or must_sort are true.
16875 (Output_section::set_final_data_size): Call
16876 sort_attached_input_sections if necessary.
16877 (Output_section::Input_section_sort_entry): Define new class.
16878 (Output_section::Input_section_sort_compare::operator()): New
16879 function.
16880 (Output_section::sort_attached_input_sections): New function.
16881 * configure.ac: Check whether the compiler supports constructor
16882 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16883 * testsuite/initpri1.c: New file.
16884 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16885 CONSTRUCTOR_PRIORITY.
16886 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16887 (initpri1_LDFLAGS): New variable.
16888 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16889
18e6b24e
ILT
168902008-03-27 Ian Lance Taylor <iant@google.com>
16891
49bdd526
ILT
16892 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16893 * testsuite/common_test_1.c: New file.
16894 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16895 (common_test_1_SOURCES): New variable.
16896 (common_test_1_DEPENDENCIES): New variable.
16897 (common_test_1_LDFLAGS): New variable.
16898
18e6b24e
ILT
16899 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16900 and commons_ correctly when NAME/VERSION does not override
16901 NAME/NULL.
16902 * testsuite/ver_test_6.c: New file.
16903 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16904 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16905 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16906
04bf7072
ILT
169072008-03-26 Ian Lance Taylor <iant@google.com>
16908
5871526f
ILT
16909 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16910 of an undefined symbol from a version script.
16911 * testsuite/Makefile.am (ver_test_5.so): New target.
16912 (ver_test_5.o): New target.
16913 (check_SCRIPTS): Add ver_test_5.sh.
16914 (check_DATA): Add ver_test_5.syms.
16915 (ver_test_5.syms): New target.
16916 * testsuite/ver_test_5.cc: New file.
16917 * testsuite/ver_test_5.script: New file.
16918 * testsuite/ver_test_5.sh: New file.
16919 * Makefile.in, testsuite/Makefile.in: Rebuild.
16920
04bf7072
ILT
16921 PR gold/5986
16922 Fix problems building gold with gcc 4.3.0.
16923 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16924 (gold_error_at_location, gold_warning_at_location): Use it.
16925 * configure.ac: Check whether we can compile and use a template
16926 function with a printf attribute.
16927 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16928 when jumping over bytes.
16929 * object.cc: Instantiate Object::read_section_data.
16930 * debug.h: Include <cstring>
16931 * dwarf_reader.cc: Include <algorithm>
16932 * main.cc: Include <cstring>.
16933 * options.cc: Include <cstring>.
16934 * output.cc: Include <cstring>.
16935 * script.cc: Include <cstring>.
16936 * script.h: Include <string>.
16937 * symtab.cc: Include <cstring> and <algorithm>.
16938 * target-select.cc: Include <cstring>.
16939 * version.cc: Include <string>.
16940 * testsuite/testmain.cc: Include <cstdlib>.
16941 * configure, config.in: Rebuild.
16942
874c5b28
ILT
169432008-03-25 Ian Lance Taylor <iant@google.com>
16944
819d6c3a
ILT
16945 * options.cc: Include "../bfd/bfdver.h".
16946 (options::help): Print bug reporting address.
16947
f4b2c6f5
ILT
16948 * version.cc (print_version): Adjust output for current value of
16949 BFD_VERSION_STRING.
16950
16951 * NEWS: New file.
16952
e96caa79
ILT
16953 * options.cc (options::help): Print list of supported targets.
16954 * target-select.h: Include <vector>.
16955 (class Target_selector): Make machine_, size_, and is_big_endian_
16956 fields const. Add bfd_name_ and instantiated_target_ fields.
16957 (Target_selector::Target_selector): Add bfd_name parameter.
16958 (Target_selector::recognize): Make non-virtual, call
16959 do_recognize.
16960 (Target_selector::recognize_by_name): Make non-virtual, call
16961 do_recognize_by_name.
16962 (Target_selector::supported_names): New function.
16963 (Target_selector::bfd_name): New function.
16964 (Target_selector::do_instantiate_target): New pure virtual
16965 function.
16966 (Target_selector::do_recognize): New virtual function.
16967 (Target_selector::do_recognize_by_name): New virtual function.
16968 (Target_selector::instantiate_target): New private function.
16969 (supported_target_names): Declare.
16970 * target-select.cc (Target_selector::Target_selector): Update for
16971 new parameter and fields.
16972 (select_target_by_name): Check that the name matches before
16973 calling recognize_by_name.
16974 (supported_target_names): New function.
16975 * i386.cc (class Target_selector_i386): Update Target_selector
16976 constructor call. Remove recognize and recognize_by_name. Add
16977 do_instantiate_target.
16978 * x86_64.cc (class Target_selector_x86_64): Likewise.
16979 * testsuite/testfile.cc (class Target_selector_test): Update for
16980 changes to Target_selector.
16981
874c5b28
ILT
16982 * README: Rewrite, with some notes on unsupported features.
16983
0a65a3a7
CC
169842008-03-24 Cary Coutant <ccoutant@google.com>
16985
16986 * i386.cc (Target_i386::Got_type): New enum declaration.
16987 (Target_i386::Scan::local): Updated callers of Output_data_got
16988 member functions.
16989 (Target_i386::Scan::global): Likewise.
16990 (Target_i386::Relocate::relocate): Likewise.
16991 (Target_i386::Relocate::relocate_tls): Likewise.
16992 * object.h (Got_offset_list): New class.
16993 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16994 (Sized_relobj::local_got_offset): Likewise.
16995 (Sized_relobj::set_local_got_offset): Likewise.
16996 (Sized_relobj::local_has_tls_got_offset): Removed.
16997 (Sized_relobj::local_tls_got_offset): Removed.
16998 (Sized_relobj::set_local_tls_got_offset): Removed.
16999 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17000 * output.cc (Output_data_got::add_global): Added got_type parameter.
17001 (Output_data_got::add_global_with_rel): Likewise.
17002 (Output_data_got::add_global_with_rela): Likewise.
17003 (Output_data_got::add_global_pair_with_rel): New function.
17004 (Output_data_got::add_global_pair_with_rela): New function.
17005 (Output_data_got::add_local): Added got_type parameter.
17006 (Output_data_got::add_local_with_rel): Likewise.
17007 (Output_data_got::add_local_with_rela): Likewise.
17008 (Output_data_got::add_local_pair_with_rel): New function.
17009 (Output_data_got::add_local_pair_with_rela): New function.
17010 (Output_data_got::add_global_tls): Removed.
17011 (Output_data_got::add_global_tls_with_rel): Removed.
17012 (Output_data_got::add_global_tls_with_rela): Removed.
17013 (Output_data_got::add_local_tls): Removed.
17014 (Output_data_got::add_local_tls_with_rel): Removed.
17015 (Output_data_got::add_local_tls_with_rela): Removed.
17016 * output.h (Output_data_got::add_global): Added got_type parameter.
17017 (Output_data_got::add_global_with_rel): Likewise.
17018 (Output_data_got::add_global_with_rela): Likewise.
17019 (Output_data_got::add_global_pair_with_rel): New function.
17020 (Output_data_got::add_global_pair_with_rela): New function.
17021 (Output_data_got::add_local): Added got_type parameter.
17022 (Output_data_got::add_local_with_rel): Likewise.
17023 (Output_data_got::add_local_with_rela): Likewise.
17024 (Output_data_got::add_local_pair_with_rel): New function.
17025 (Output_data_got::add_local_pair_with_rela): New function.
17026 (Output_data_got::add_global_tls): Removed.
17027 (Output_data_got::add_global_tls_with_rel): Removed.
17028 (Output_data_got::add_global_tls_with_rela): Removed.
17029 (Output_data_got::add_local_tls): Removed.
17030 (Output_data_got::add_local_tls_with_rel): Removed.
17031 (Output_data_got::add_local_tls_with_rela): Removed.
17032 * resolve.cc (Symbol::override_base_with_special): Removed
17033 reference to has_got_offset_ field.
17034 * symtab.cc (Symbol::init_fields): Replaced initialization
17035 of got_offset_ with got_offsets_. Removed initialization
17036 of has_got_offset_
53fcba31 17037 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17038 (Symbol::got_offset): Likewise.
17039 (Symbol::set_got_offset): Likewise.
17040 (Symbol::has_tls_got_offset): Removed.
17041 (Symbol::tls_got_offset): Removed.
17042 (Symbol::set_tls_got_offset): Removed.
17043 (Symbol::got_offset_): Removed.
17044 (Symbol::tls_mod_got_offset_): Removed.
17045 (Symbol::tls_pair_got_offset_): Removed.
17046 (Symbol::got_offsets_): New field.
17047 (Symbol::has_got_offset): Removed.
17048 (Symbol::has_tls_mod_got_offset): Removed.
17049 (Symbol::has_tls_pair_got_offset): Removed.
17050 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17051 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17052 member functions.
17053 (Target_x86_64::Scan::global): Likewise.
17054 (Target_x86_64::Relocate::relocate): Likewise.
17055 (Target_x86_64::Relocate::relocate_tls): Likewise.
17056
bd52eafb
BE
170572008-03-25 Ben Elliston <bje@au.ibm.com>
17058
17059 * yyscript.y: Fix spelling error in comment.
17060
8b105e34
ILT
170612008-03-24 Ian Lance Taylor <iant@google.com>
17062
8ed814a9
ILT
17063 * options.h (class General_options): Define build_id option.
17064 * layout.h (class Layout): Declare write_build_id, create_note,
17065 create_build_id. Add build_id_note_ member.
17066 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17067 "libiberty.h", "md5.h", "sha1.h".
17068 (Layout::Layout): Initialize eh_frame_data_,
17069 eh_frame_hdr_section_, and build_id_note_.
17070 (Layout::finalize): Call create_build_id.
17071 (Layout::create_note): New function, broken out of
17072 Layout::create_gold_note.
17073 (Layout::create_gold_note): Call create_note.
17074 (Layout::create_build_id): New function.
17075 (Layout::write_build_id): New function.
17076 (Close_task_runner::run): Call write_build_id.
17077
8b105e34
ILT
17078 * x86_64.cc: Correct license to GPLv3.
17079
086a1841
ILT
170802008-03-23 Ian Lance Taylor <iant@google.com>
17081
17082 * options.cc: Include "demangle.h".
17083 (parse_optional_string): New function.
17084 (parse_long_option): Handle takes_optional_argument.
17085 (parse_short_option): Update dash_z initializer. Handle
17086 takes_optional_argument.
17087 (General_options::General_options): Initialize do_demangle_.
17088 (General_options::finalize): Set do_demangle_. Handle demangling
17089 style.
17090 * options.h (parse_optional_string): Declare.
17091 (struct One_option): Add optional_arg field. Update constructor.
17092 Update call constructor calls. Add takes_optional_argument
17093 function.
17094 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17095 (DEFINE_optional_string): Define.
17096 (General_options::demangle): Change from DEFINE_bool to
17097 DEFINE_optional_string.
17098 (General_options::no_demangle): New function.
17099 (General_options::do_demangle): New function.
17100 (General_options::set_do_demangle): New function.
17101 (General_options::execstack_status_): Move definition to end of
17102 class definition.
17103 (General_options::static_): Likewise.
17104 (General_options::do_demangle_): New field.
17105 * object.cc (big_endian>::get_symbol_location_info): Call
17106 Options::do_demangle, not Options::demangle.
17107 * symtab.cc (demangle): Likewise.
17108
cbb93e63
ILT
171092008-03-22 Ian Lance Taylor <iant@google.com>
17110
17111 * gold.h: Include <cstddef> and <sys/types.h>
17112 * options.h: Include <cstring>.
17113
ec531623
ILT
171142008-03-21 Ian Lance Taylor <iant@google.com>
17115
17116 * Added source code to GNU binutils.
752937aa 17117\f
b90efa5b 17118Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17119
17120Copying and distribution of this file, with or without modification,
17121are permitted in any medium without royalty provided the copyright
17122notice and this notice are preserved.
17123
17124Local Variables:
17125mode: change-log
17126left-margin: 8
17127fill-column: 74
17128version-control: never
17129End:
This page took 1.105239 seconds and 4 git commands to generate.