Merge include/partition.h from GCC.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
5019d64a
HS
12015-04/16 Han Shen <shenhan@google.com>
2
3 * aarch64.cc (AArch64_insn_utilities): New utility class.
4 (AArch64_relobj::Mapping_symbol_position): New struct.
5 (AArch64_relobj::Mapping_symbol_info): New typedef.
6 (AArch64_relobj::do_count_local_symbols): New function overriding
7 parent's implementation.
8 (AArch64_relobj::mapping_symbol_info_): New member
9 (AArch64_relobj::scan_erratum_843419): New method.
10 (Target_aarch64::scan_erratum_843419_span): New method.
11 (Target_aarch64::is_erratum_843419_sequence): New method.
12 * options.h (fix_cortex_a53): New option.
13
a6a17750
CC
142015-04-09 Cary Coutant <ccoutant@google.com>
15
16 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
17 in a PIE link.
18 * testsuite/Makefile.am (tls_pie_test.sh): New test.
19 * testsuite/Makefile.in: Regenerate.
20 * testsuite/tls_pie_test.sh: New.
21
437ddf0c
CC
222015-04-09 Cary Coutant <ccoutant@google.com>
23
24 * debug.h (DEBUG_LOCATION): New.
25 (DEBUG_ALL): Include DEBUG_LOCATION.
26 (debug_string_to_enum): Add DEBUG_LOCATION.
27 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
28 output to print correct context.
29 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
30 up to 4 more locations at the beginning of the function.
31 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
32 result before sorting list of line numbers.
33 * testsuite/debug_msg.sh: Allow range of line numbers for
34 canonical results on optimized code.
35
24491327
HS
362015-04-07 HC Yen <hc.yen@mediatek.com>
37
38 Add AArch32 support for gold linker.
39 gold/
40 * arm.cc: Add V8 arch combine table.
41
7fa5525f
RÁE
422015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
43
44 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
45
5368dcf2
RÁE
462015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
47
48 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
49 to find by using the return value of insert.
50
9dbb4b02
RÁE
512015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
52
53 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
54 constructor call.
55
1fa29f10
IT
562015-04-06 Ilya Tocar <ilya.tocar@intel.com>
57
58 PR gold/17641
59 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
60 (Target_x86_64::Scan::local): Don't create GOT entry, when we
61 can convert mov to lea.
62 (Target_x86_64::Scan::global): Ditto.
63 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
64 %reg to lea foo(%rip), %reg if possible.
65 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
66 * testsuite/x86_64_mov_to_lea1.s: New.
67 * testsuite/x86_64_mov_to_lea2.s: Ditto.
68 * testsuite/x86_64_mov_to_lea3.s: Ditto.
69 * testsuite/x86_64_mov_to_lea4.s: Ditto.
70 * testsuite/x86_64_mov_to_lea.sh: Ditto.
71
39f3de7c
L
722015-04-02 H.J. Lu <hongjiu.lu@intel.com>
73
74 * configure: Regenerated.
75
c4fc4724
IT
762015-04-01 Ilya Tocar <ilya.tocar@intel.com>
77
78 PR gold/17640
79 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
80 (Target_i386::Scan::local): Don't create GOT entry, when we
81 can convert GOT to GOTOFF.
82 (Target_i386::Scan::global): Ditto.
83 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
84 lea foo@GOTOFF(%reg), %reg if possible.
85 * testsuite/Makefile.am (i386_mov_to_lea): New test.
86 * testsuite/i386_mov_to_lea1.s: New.
87 * testsuite/i386_mov_to_lea2.s: Ditto.
88 * testsuite/i386_mov_to_lea3.s: Ditto.
89 * testsuite/i386_mov_to_lea4.s: Ditto.
90 * testsuite/i386_mov_to_lea5.s: Ditto.
91 * testsuite/i386_mov_to_lea.sh: Ditto.
92
918357b9
L
932015-04-01 H.J. Lu <hongjiu.lu@intel.com>
94
95 * Makefile.am (ZLIB): New.
96 (ZLIBINC): Likewise.
97 (AM_CFLAGS): Add $(ZLIBINC).
98 (AM_CXXFLAGS): Likewise.
99 (ldadd_varldadd_var): Add $(ZLIB).
100 (incremental_dump_LDADD): Likewise.
101 (dwp_LDADD): Likewise.
102 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
103 <zlib.h>.
104 (zlib_compress): Don't check HAVE_ZLIB_H.
105 (zlib_decompress): Likewise.
106 * options.h (compress_debug_sections): Likewise.
107 * configure.ac (AM_CONDITIONAL): Removed.
108 * testsuite/Makefile.am (ZLIB): New.
109 (LDADD): Add $(ZLIB).
110 Don't check HAVE_ZLIB.
111 * Makefile.in: Regenerated.
112 * config.in: Likewise.
113 * configure: Likewise.
114 * testsuite/Makefile.in: Likewise.
115
6b0ad2eb
JY
1162015-03-30 Jing Yu <jingyu@google.com>
117
118 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
119 TLSLD_ADD_DTPREL_LO12_NC.
120 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
121 _TLS_MODULE_BASE_ point to the start of tls segment.
122 (Target_aarch64::optimize_tls_reloc): Add cases for
123 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
124 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
125 (Target_aarch64::Scan::local): Likewise.
126 (Target_aarch64::Scan::global): Likewise.
127 (Target_aarch64::Relocate::relocate): Likewise.
128 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
129 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
130 relocations.
131
0916f9e7
RÁE
1322015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
133
134 * merge.cc (Object_merge_map::add_mapping): call
135 Object_merge_map::Input_merge_map::add_mapping.
136 (Object_merge_map::Input_merge_map::add_mapping): New.
137 (Output_merge_data::do_add_input_section): Call
138 get_or_make_input_merge_map before a loop.
139 (Output_merge_string<Char_type>::finalize_merged_data): Call
140 get_or_make_input_merge_map before a loop.
141 * merge.h (Object_merge_map): Make Input_merge_map public.
142 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
143 (Relobj::get_or_create_merge_map): New.
144 * object.h (Relobj::get_or_create_merge_map): New.
145
282c9750
AM
1462015-03-24 Alan Modra <amodra@gmail.com>
147
148 PR 18147
149 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
150 relocation errors for branches to strong undefined symbols.
151
67f95b96
RÁE
1522015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
153
154 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
155 (Object_merge_map::is_merge_section_for): Remove.
156 (Object_merge_map::find_merge_section): New.
157 * merge.h (Object_merge_map::is_merge_section_for): Remove.
158 (Object_merge_map::find_merge_section): New.
159 (Object_merge_map::get_input_merge_map): Add a const version.
160 * object.cc (Relobj::is_merge_section_for): Remove.
161 (Relobj::find_merge_section): New.
162 * object.h (Relobj::is_merge_section_for): Remove.
163 (Relobj::find_merge_section): New.
164 * output.cc
165 (Output_section::Input_section::is_merge_section_for): Remove.
166 (Output_section::add_merge_input_section): Don't call
167 add_merge_input_section.
168 (Output_section::find_merge_section): Return const. Use
169 object->find_merge_section.
170 (Output_section::build_lookup_maps): Don't build a map for
171 merge sections.
172 (Output_section::is_input_address_mapped): Return false if
173 section is not found.
174 (Output_section::find_starting_output_address): Use
175 find_merge_section instead of is_merge_section_for.
176 (Output_section::add_script_input_section): Don't build a map for
177 merge sections.
178 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
179 (Output_section_lookup_maps::find_merge_section): Remove.
180 (Output_section_lookup_maps::add_merge_input_section) Remove.
181 (Output_section::find_merge_section): Return const.
182
152f7024
CC
1832015-03-22 Cary Coutant <cary@google.com>
184
185 PR gold/18106
186 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
187 non-SIB form of lea, with nop after the call.
188
bccffdfd
CC
1892015-03-21 Cary Coutant <cary@google.com>
190
191 PR gold/14217
192 * output.cc (Output_segment::is_first_section_relro): Don't ignore
193 .tdata section.
194 (Output_segment::set_section_addresses): Don't align size of relro
195 segment for .tbss.
196
1c582fe7
CC
1972015-03-21 Cary Coutant <cary@google.com>
198
199 PR gold/18010
200 * stringpool.cc (Stringpool_template): Don't optimize if section
201 alignment is greater than sizeof(char).
202
410da591
CC
2032015-03-21 Cary Coutant <cary@google.com>
204
205 PR gold/18048
206 * script-c.h (script_include_directive): Add first_token parameter.
207 * script.cc (script_include_directive): Add first_token parameter, and
208 pass it to read_script_file.
209 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
210 (PARSING_MEMORY_DEF): New tokens.
211 (top): Add new productions for INCLUDE files.
212 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
213 Pass PARSING_LINKER_SCRIPT to script_include_directive.
214 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
215 (section_cmd): Pass PARSING_SECTION_CMDS.
216 (file_or_sections_cmd): Remove.
217 (memory_def): Pass PARSING_MEMORY_DEF.
218 * testsuite/Makefile.am (memory_test_2): New test.
219 * testsuite/Makefile.in: Regenerate.
220 * testsuite/memory_test_inc.t: New script file.
221 * testsuite/memory_test_inc_1.t.src: New script file.
222 * testsuite/memory_test_inc_2.t.src: New script file.
223 * testsuite/memory_test_inc_3.t.src: New script file.
224
0d5bbdb0
CC
2252015-03-21 Cary Coutant <cary@google.com>
226
227 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
228 (Sized_relobj_dwo::setup): Build compressed section map.
229 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
230 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
231 section map.
232 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
233 compressed_sections_ field.
234 (build_compressed_section_map): Take Object instead of
235 Sized_relobj_file parameter; add decompress_if_needed parameter.
236 (Sized_relobj_file::do_find_special_sections): Store compressed
237 section map in parent Object.
238 (Sized_relobj_file::do_decompressed_section_contents): Move
239 implementation to Object::decompressed_section_contents.
240 (Sized_relobj_file::do_discard_decompressed_sections): Move
241 implementation to Object::discard_decompressed_sections.
242 * object.h (build_compressed_section_map): Declare.
243 (Object::Object): Add compressed_sections_ field.
244 (Object::section_is_compressed): Move implementation here.
245 (Object::decompressed_section_contents): De-virtualize.
246 (Object::discard_decompressed_sections): De-virtualize.
247 (Object::do_section_is_compressed): Delete.
248 (Object::do_decompressed_section_contents): Delete.
249 (Object::set_compressed_sections): New method.
250 (Object::compressed_sections): New method.
251 (Object::compressed_sections_): New data member.
252 (Compressed_section_info, Compressed_section_map): Move to top of file.
253 (Sized_relobj_file::do_section_is_compressed): Delete.
254 (Sized_relobj_file::do_decompressed_section_contents): Delete.
255 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
256 (Sized_relobj_file::compressed_sections_): Move to Object class.
257
bd9e0d46
CC
2582015-03-21 Cary Coutant <ccoutant@google.com>
259
260 PR gold/18152
261 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
262 deferred objects.
263
943c8b43
CC
2642015-03-11 Cary Coutant <ccoutant@google.com>
265
266 * options.cc (General_options::finalize): Don't allow -z relro
267 with incremental linking.
268 * testsuite/Makefile.am (incremental_test): Add -z norelro.
269 (incremental_test_2): Likewise.
270 (incremental_test_3): Likewise.
271 (incremental_test_4): Likewise.
272 (incremental_test_5): Likewise.
273 (incremental_test_6): Likewise.
274 (incremental_copy_test): Likewise.
275 (incremental_common_test_1): Likewise.
276 (incremental_comdat_test_1): Likewise.
277 * testsuite/Makefile.in: Regenerate.
278
e1663197
CC
2792015-03-09 Cary Coutant <ccoutant@google.com>
280
281 PR gold/14675
282 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
283 return enum indicating whether .eh_frame section is empty, optimizable,
284 unrecognized, or an end marker. Adjust explicit instantiations.
285 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
286 (Eh_frame::add_ehframe_input_section): Change return type.
287 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
288 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
289 to the .eh_frame output section until we see the end marker.
290 (Layout::finalize_eh_frame_section): New.
291 * layout.h: (Layout::finalize_eh_frame_section): New.
292
beb8418f
L
2932015-03-05 H.J. Lu <hongjiu.lu@intel.com>
294
295 * output.cc (Relobj::initialize_input_to_output_map<size>):
296 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
297
48c73428
CC
2982015-03-04 Cary Coutant <ccoutant@google.com>
299
300 * parameters.cc (Parameters::set_target_once): Call
301 Target::select_as_default_target just once from here...
302 (set_parameters_target): ...instead of from here.
303
3042015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
305
306 * ehframe.cc (Cie::set_output_offset): Pass in and use a
307 Output_section_data instead of a Merge_map.
308 (Eh_frame::Eh_frame): Don't initialize merge_map_.
309 (Eh_frame::read_cie): Use add_merge_mapping instead of
310 Merge_map::add_mapping.
311 (Eh_frame::read_fde): Ditto.
312 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
313 (Eh_frame::do_output_offset): Use merge_output_offset istead of
314 merge_map_->get_output_offset.
315 (Eh_frame::do_is_merge_section_for): Delete.
316 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
317 instead of a Merge_map.
318 (Cie::set_output_offset): Pass in a Output_section_data instead of a
319 Merge_map.
320 (Eh_frame::do_is_merge_section_for): Delete.
321 (Eh_frame::merge_map_): Delete.
322 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
323 and use a Output_section_data instead of a Merge_map.
324 (Object_merge_map::add_mapping): Ditto.
325 (Object_merge_map::get_output_offset): Remove the merge_map argument.
326 (Object_merge_map::is_merge_section_for): Pass in and use a
327 Output_section_data instead of a Merge_map.
328 (Merge_map): Delete.
329 (Output_merge_base::do_output_offset): Use merge_output_offset instead
330 of merge_map_.get_output_offset.
331 (Output_merge_base::do_is_merge_section_for): Delete.
332 (Output_merge_data::do_add_input_section): Use
333 object->add_merge_mapping instead of add_mapping.
334 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
335 * merge.h (Merge_map): Delete forward declaration.
336 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
337 instead of a Merge_map.
338 (Object_merge_map::get_output_offset): Remove the merge_map argument.
339 (Object_merge_map::is_merge_section_for): Pass in and use a
340 Output_section_data instead of a Merge_map.
341 (Input_merge_map::Object_merge_map::merge_map): Replace with
342 output_data.
343 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
344 Output_section_data instead of a Merge_map.
345 (Merge_map): Delete.
346 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
347 (Output_merge_base::do_is_merge_section_for): Delete.
348 (Output_merge_base::add_mapping): Delete.
349 (Output_merge_base::merge_map_): Delete.
350 * object.cc (Relobj::initialize_input_to_output_map): New.
351 (Relobj::initialize_input_to_output_map): New.
352 (Relobj::merge_output_offset): New.
353 (Relobj::is_merge_section_for): New.
354 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
355 bits.
356 * object.h (Relobj::merge_map): Delete.
357 (initialize_input_to_output_map): New.
358 (set_merge_map): Delete.
359 (add_merge_mapping): New.
360 (merge_output_offset): New.
361 (is_merge_section_for): New.
362 * output.cc (Output_section::Input_section::is_merge_section_for):
363 Use object->is_merge_section_for.
364 * output.h (Output_section_data::is_merge_section_for): Delete.
365 (Output_section_data::do_is_merge_section_for): Delete.
366 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
367 Use object->initialize_input_to_output_map.
368 (Merged_symbol_value<size>::value_from_output_section): Use
369 object->merge_output_offset.
370
48c73428 3712015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
372 Cary Coutant <ccoutant@google.com>
373
374 * output.cc (Output_section::add_merge_input_section): Do not
375 attempt to merge sections with an entsize of 0.
376
48c73428 3772015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
378
379 * attributes.h (class Output_attributes_section_data ): Add
380 do_print_to_mapfile function.
381
ec86f434
AM
3822015-02-24 Alan Modra <amodra@gmail.com>
383
384 PR 18010
385 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
386 complain if value is not a multiple of four.
387 (Target_powerpc::Relocate::relocate): Correct handling of
388 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
389
be66981e
L
3902015-02-21 H.J. Lu <hongjiu.lu@intel.com>
391
392 * configure.ac (default_size): Set to 32 for x32.
393 * configure: Regenerated.
394
e3ee8ed4
AM
3952015-02-18 Alan Modra <amodra@gmail.com>
396
397 PR 17954
398 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
399 visibility.
400
3a935c6c
RÁE
4012015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
402
403 * gc.h (Garbage_collection::add_reference): Don't use find.
404
e0a1e121
RÁE
4052015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
406
407 * object.cc (write_local_symbols): avoid std::vector copy.
408
45a4fb1a
RÁE
4092015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
410
411 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
412
2d9afefe
MW
4132015-02-09 Mark Wielaard <mjw@redhat.com>
414
415 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
416 DW_LANG_Fortran03 and DW_LANG_Fortran08.
417
e9c1bdad
CC
4182015-02-16 Cary Coutant <ccoutant@google.com>
419
420 PR gold/13577
421 PR gold/16992
422 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
423 DF_SYMBOLIC if --dynamic-list option is used.
424 * options.cc (General_options::finalize): --dynamic-list is not
425 mutually exclusive with -Bsymbolic.
426 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
427 listed in --dynamic-list.
428 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
429 -Bsymbolic-functions.
430 * testsuite/Makefile.in: Regenerate.
431
0ed4b0bf
CC
4322015-02-16 Cary Coutant <ccoutant@google.com>
433
434 PR gold/17971
435 * incremental.cc: Remove redundant include of "output.h".
436
1a920511
JY
4372015-02-12 Jing Yu <jingyu@google.com>
438
439 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
440 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
441 New relocation.
442 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
443 TLSLE_MOVW_* relocations.
444 (Target_aarch64::Scan::global): Likewise.
445 (Target_aarch64::Relocate::relocate): Likewise.
446 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
447 for new TLSLE_MOVW_* relocations.
448
07f107f3
WN
4492015-02-11 Will Newton <will.newton@linaro.org>
450
451 PR gold/13321
452 * arm.cc (Target_arm::make_plt_section): Create an ARM
453 state mapping symbol at the start of the PLT.
454
e051a5b5
L
4552015-02-09 H.J. Lu <hongjiu.lu@intel.com>
456
457 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
458 Replace two_file_shared_2.so with two_file_shared_1.so.
459 * testsuite/Makefile.in: Regenerated.
460
dddcc5b9
AM
4612015-02-09 Alan Modra <amodra@gmail.com>
462
463 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
464 plugin_test_thin.a and defsym_test.
465 * testsuite/Makefile.in: Regenerate.
466
b39b8b9d
RÁE
4672015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
468
469 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
470 body.
471
b66d1c52
CC
4722015-02-04 Peter Collingbourne <pcc@google.com>
473
474 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
475 forwarding symbols when computing symbol resolution info for plugins.
476 * plugin.h (Plugin_manager::symtab): New method.
477 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
478
23081de0
CC
4792015-02-03 Cary Coutant <ccoutant@google.com>
480 Peter Collingbourne <pcc@google.com>
481
482 PR gold/15660
483 * archive.cc (Thin_archive_object_unlocker): New class.
484 (Archive::include_member): Unlock external members of thin archives.
485 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
486 (plugin_test_2): Likewise.
487 (plugin_test_3): Likewise.
488 (plugin_test_4): Likewise.
489 (plugin_test_5): Likewise.
490 (plugin_test_6): Likewise.
491 (plugin_test_7): Likewise.
492 (plugin_test_8): Likewise.
493 (plugin_test_9): Likewise.
494 (plugin_test_10): Likewise.
495 (plugin_test_11): New test case.
496 * testsuite/Makefile.in: Regenerate.
497 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
498 file to decide whether to claim file.
499 (all_symbols_read_hook): Likewise.
500 * testsuite/plugin_test_1.sh: Adjust expected output.
501 * testsuite/plugin_test_2.sh: Likewise.
502 * testsuite/plugin_test_3.sh: Likewise.
503 * testsuite/plugin_test_6.sh: Likewise.
504 * testsuite/plugin_test_tls.sh: Likewise.
505 * testsuite/plugin_test_11.sh: New testcase.
506
5072015-02-03 Cary Coutant <ccoutant@google.com>
508
509 * descriptors.cc (Descriptors::open): Set artificially-low limit for
510 file descriptors when debugging enabled. Add debug output.
511 (Descriptors::release): Add debug output.
512 (Descriptors::close_some_descriptor): Likewise.
513 (Descriptors::close_all): Likewise.
514 * fileread.cc (File_read::lock): Likewise.
515 (File_read::unlock): Likewise.
516
24dd5808
CC
5172015-02-02 Cary Coutant <ccoutant@google.com>
518
519 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
520 executable output file.
521
fa89cc82
HS
5222015-01-22 Han Shen <shenhan@google.com>
523
524 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
525 (Target_arm::do_plt_address_for_global): New method.
526 (Target_arm::do_plt_address_for_local): New method.
527 (Target_arm::rel_irelative_section): New method.
528 (Target_arm::make_data_plt): Add more parameters for plt ctor.
529 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
530 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
531 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
532 (Target_arm::Scan::check_non_pic): Add ifunc support.
533 (Target_arm::Scan::local): Add ifunc support.
534 (Target_arm::Scan::global): Add ifunc support.
535 (Target_arm::make_plt_section): New method.
536 (Target_arm::make_plt_entry): Change to call to make_plt_section.
537 (Target_arm::make_local_ifunc_plt_entry): New method.
538 (Target_arm::got_irelative_): New member.
539 (Target_arm::rel_irelative_): New member.
540 (Target_arm::got_section): Add creation for got_irelative_.
541 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
542 (Target_arm::Relocate::relocate): Properly set local ifunc address.
543 (Target_arm::do_dynsym_value): Properly set global ifunc address.
544 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
545 (Output_data_plt_arm::IRelative_data): New type.
546 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
547 (Output_data_plt_arm::add_entry): Add more parameters.
548 (Output_data_plt_arm::add_relocation): New method.
549 (Output_data_plt_arm::add_local_ifunc_entry): New method.
550 (Output_data_plt_arm::rel_irelative): New method.
551 (Output_data_plt_arm::entry_count): Modified.
552 (Output_data_plt_arm::address_for_global): New method.
553 (Output_data_plt_arm::address_for_local): New method.
23081de0 554gold/
fa89cc82
HS
555 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
556 (Output_data_plt_arm::insert_irelative_data): New method.
557 (Output_data_plt_arm::irelative_rel_): New member.
558 (Output_data_plt_arm::got_): New member.
559 (Output_data_plt_arm::got_irelative_): New member.
560 (Output_data_plt_arm::irelative_count_): New member.
561 (Output_data_plt_arm::IRelative_data_vec): New typedef.
562 (Output_data_plt_arm::irelative_data_vec_): New member.
563 (Output_data_plt_arm::do_write): Write out irelative entries.
564 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
565 more parameters to ctor.
566 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
567 more parameters to ctor.
568 * output.h (Output_data_reloc::add_local_relative): New method.
569 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
570
0f81d3f0
AM
5712015-01-29 Alan Modra <amodra@gmail.com>
572
573 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
574 and GOT_TLSGD to LE optimization.
575
65d92137
CC
5762015-01-28 Cary Coutant <ccoutant@google.com>
577
578 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
579 for undef TLS symbols.
580 (Target_x86_64::Relocate::relocate_tls): Likewise.
581 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
582
5485698a
CC
5832015-01-25 Cary Coutant <ccoutant@google.com>
584
585 * output.cc (Output_segment::set_section_addresses): Fix calculation
586 of size of relro segment.
587
b01a4b04
AM
5882015-01-22 Alan Modra <amodra@gmail.com>
589
590 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
591 condition for need of ifunc plt entry.
592 (Target_powerpc::Scan::global <got relocs>): Likewise.
593
3d0064a9
CC
5942015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
595
596 * mips.cc (reloc_high): Add r_sym.
597 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
598 reloc_high constructor.
599 (Mips_relocate_functions::relgot16_local): Likewise.
600 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
601 r_type to decide whether LO16 matches HI16.
602 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
603 rello16 and relgot16_local.
604
a5cd8f05
CC
6052015-01-09 Cary Coutant <ccoutant@google.com>
606
607 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
608 unless alignment is larger than page size.
609
4fc1b9d4
L
6102015-01-06 H.J. Lu <hongjiu.lu@intel.com>
611 Cary Coutant <ccoutant@google.com>
612
613 PR gold/17729
614 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
615 (DEFAULT_TARGET_X32): Set for x32.
616 * x86_64.cc (cmp_insn_32): New.
617 (lea_r10_insn_32): Likewise.
618 (lea_r11_insn_32): Likewise.
619 (cmp_insn_64): Likewise.
620 (lea_r10_insn_64): Likewise.
621 (lea_r11_insn_64): Likewise.
622 (Target_x86_64<size>::do_calls_non_split): Handle x32.
623 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
624 (check_DATA): Add split_x32 files.
625 (split_x32_[1234n].o): New targets.
626 (split_x32_[124]): New targets.
627 (split_x32_[1234r].stdout): New targets.
628 * testsuite/split_x32.sh: New file.
629 * testsuite/split_x32_1.s: Likewise.
630 * testsuite/split_x32_2.s: Likewise.
631 * testsuite/split_x32_3.s: Likewise.
632 * testsuite/split_x32_4.s: Likewise.
633 * testsuite/split_x32_n.s: Likewise.
634 * configure: Regenerated.
635 * testsuite/Makefile.in: Likewise.
636
e749cab8
L
6372015-01-06 H.J. Lu <hongjiu.lu@intel.com>
638
639 PR gold/17809
640 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
641 x32.
642
af759df0
AM
6432015-01-02 Alan Modra <amodra@gmail.com>
644
645 * version.cc (print_version): Just print current year.
646 * dwp.cc (print_version): Likewise.
647
b90efa5b
AM
6482015-01-01 Alan Modra <amodra@gmail.com>
649
650 Update year range in copyright notice of all files.
651
f12d1e8a
AM
6522014-12-25 Alan Modra <amodra@gmail.com>
653
654 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
655 new enums.
656 (Target_arm::merge_object_attributes, ): Likewise.
657
5c294fee
TG
6582014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
659
660 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
661 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
662 AEABI_VFP_args_vfp to check that.
663 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
664 value and replace hardcoded values by enum values.
665
e30880c2
CC
6662014-12-22 Cary Coutant <ccoutant@google.com>
667
668 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
669
bd040da1
L
6702014-12-20 H.J. Lu <hongjiu.lu@intel.com>
671
672 PR gold/14608
673 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
674 to "return i * i * 3;".
675
e02a4046
CC
6762014-12-16 Cary Coutant <ccoutant@google.com>
677
678 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
679 (Mapfile::print_output_data): Use current_data_size() to avoid
680 assert for sections requiring postprocessing; if address is not valid,
681 print 0.
682 (Mapfile::print_output_section): Use current_data_size(); print note
683 that addresses and sizes are before compression.
684
add6016b
L
6852014-12-14 H.J. Lu <hongjiu.lu@intel.com>
686
687 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
688 Cast current_group_size to unsigned long when reporting error.
689
0bf32ea9
JY
6902014-12-10 Jing Yu <jingyu@google.com>
691
692 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
693 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
694 Update error message.
695 (Target_aarch64::do_relax): Use absolute value of option
696 stub_group_size. Replace local variable with class member
697 stub_group_size_.
698
cbcb23fa
AM
6992014-12-04 Alan Modra <amodra@gmail.com>
700
701 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
702 addend of PLTREL24 reloc when not generating a plt stub. Make
703 max_branch_offset an "Address".
fbad6518 704 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
705 (Target_powerpc::Relocate::relocate): Likewise.
706
1611bc4a
AM
7072014-12-04 Alan Modra <amodra@gmail.com>
708
709 PR 17670
710 * symtab.cc (Symbol::set_undefined): Remove assertion.
711 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
712 on symbols defined in discarded sections, instead return false.
713 Rearrange params, update all callers.
714 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
715 branches to syms in discarded sections.
716 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
717 undefined and flag as discarded.
718 (Target_powerpc::Relocate::relocate): Localize variable.
719
4759c34e
L
7202014-12-03 H.J. Lu <hongjiu.lu@intel.com>
721
722 PR gold/17675
723 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
724 * testsuite/Makefile.in: Regenerated.
725
1f98a074
AM
7262014-12-03 Alan Modra <amodra@gmail.com>
727
728 PR 17566
729 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
730 when adding dynamic relocations against section symbols.
731
fb257835
DI
7322014-12-01 Dimitry Ivanov <dimitry@google.com>
733
734 * layout.cc (Layout::finish_dynamic_section): When '-z global'
735 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
736 * options.h (General_options): New -z option (global).
737
d8e60314
CC
7382014-12-01 Cary Coutant <ccoutant@google.com>
739
740 PR gold/17578
741 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
742 is given.
743 (Layout::create_executable_stack_info): Warn when -z noexecstack is
744 given but some inputs require executable stack.
745
982bbd97
CC
7462014-11-26 Cary Coutant <ccoutant@google.com>
747
748 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
749 .debug_str_offsets; strip .debug_gnu_pubnames and
750 .debug_gnu_pubtypes.
751 (lines_only_debug_sections): Strip all four new sections.
752
bb779192
HS
7532014-11-26 Jing Yu <jingyu@google.com>
754
755 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
756 register to be x0 when to relax TLSDESC_LD64_LO12.
757
a3e60ddb
AM
7582014-11-26 Alan Modra <amodra@gmail.com>
759
760 * powerpc.cc (struct Stub_table_owner): New.
761 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
762 unsigned int vector. Update all references.
763 (powerpc_relobj::set_stub_table): Take an unsigned int param
764 rather than a Stub_table. Update callers.
765 (Powerpc_relobj::clear_stub_table): New function.
766 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
767 stub_group_size_ vars.
768 (Target_powerpc::new_stub_table): Delete.
769 (max_branch_delta): New function, extracted from..
770 (Target_powerpc::Relocate::relocate): ..here..
771 (Target_powerpc::Branch_info::make_stub): ..and here. Return
772 status on whether stub created successfully.
773 (Stub_control::Stub_control): Add "no_size_errors" param. Move
774 default sizing to..
775 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
776 reduce on relax failure.
777 (Target_powerpc::group_sections): Add "no_size_errors" param.
778 Use stub_group_size_. Set up group info in a temp vector,
779 before building Stub_table vector. Account for input sections
780 possibly already converted to relaxed sections.
781 (Stub_table::init): Delete. Merge into..
782 (Stub_table::Stub_table): ..here.
783 (Stub_table::can_reach_stub): New function.
784 (Stub_table::add_plt_call_entry): Add "from" parameter and
785 return true iff stub could be reached.
786 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
787 param too.
788 (Stub_table::clear_stubs): Add "all" param.
789
a20605cf
AM
7902014-11-26 Alan Modra <amodra@gmail.com>
791
792 * powerpc.cc (Stub_control::set_output_and_owner): New function.
793 (Target_powerpc::group_sections): Use it.
794
43b64deb
CC
7952014-11-25 Cary Coutant <ccoutant@google.com>
796
797 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
798 (Binary_to_elf::write_symbol): Add st_size parameter.
799 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
800
c924eb67
CC
8012014-11-25 Cary Coutant <ccoutant@google.com>
802
803 PR gold/17639
804 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
805 (Sized_relobj_file::do_layout): Handle deferred sections properly
806 during GC pass 1. Don't add reloc sections to deferred list twice.
807 * object.h (Sized_relobj_file::is_deferred_layout): New function.
808 (Sized_relobj_file::is_deferred_layout_): New data member.
809
9d585188
L
8102014-11-21 H.J. Lu <hongjiu.lu@intel.com>
811
812 PR gold/17619
813 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
814 Check PC-relative offset overflow in PLT entry.
815
3ffaac20
AM
8162014-11-21 Alan Modra <amodra@gmail.com>
817
818 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
819 for undefined weaks.
820
0cfb0717
AM
8212014-11-20 Alan Modra <amodra@gmail.com>
822
823 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
824 from --stub-group-size parameter divided by 1024.
825 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
826 template parameter. Update all uses.
827 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
828 has_stub_value. Set for long branches. Don't report overflow for
829 branch to undefined weak symbols. Print info message on
830 overflowing branch to stub.
831
f9dffbf0
AM
8322014-11-20 Alan Modra <amodra@gmail.com>
833
834 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
835
e88ba8d5
L
8362014-11-13 H.J. Lu <hongjiu.lu@intel.com>
837
838 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
839 entry for R_X86_64_GOTPLT64.
840 (Target_x86_64<size>::Relocate::relocate): Update comments for
841 R_X86_64_GOTPLT64.
842
d37ffe25
ED
8432014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
844
845 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
846 * plugin.h: add lock definition
847
9726c3c1
HS
8482014-10-29 Han Shen <shenhan@google.com>
849 Jing Yu <jingyu@google.com>
850
851 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
852 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
853 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
854 Symbol::TLS_REF.
855 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
856 method.
857 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
858 (Target_aarch64::tls_ld_to_le): New method.
859 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
860 for 64bit targets.
861 (Output_data_plt_aarch64::irelative_rel_): New data member.
862 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
863 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
864 (Output_data_plt_aarch64::add_relocation): New method.
865 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
866 offset. Add got_irelative size to got size.
867 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
868 type string with the new typename.
869 (AArch64_relocate_functions::update_adr): Replace parameter x with
870 immed.
871 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
872 (AArch64_relocate_functions::reloc_common): New method.
873 (AArch64_relocate_funcsions::rela_general): Extract common part out
874 into reloc_common method.
875 (AArch64_relocate_functions::rela_general): Likewise.
876 (AArch64_relocate_functions::pcrela_general): Likewise.
877 (AArch64_relocate_functions::adr): New method.
878 (AArch64_relocate_functions::adrp): Calculate immed before calling
879 update_adr.
880 (AArch64_relocate_functions::adrp): Likewise.
881 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
882 comparing x to 0. Calculate immed from ~x when x < 0.
883 (Target_aarch64::optimize_tls_reloc): Add new cases for
884 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
885 TLSLD_MOVW_DTPREL_G0_NC.
886 (Target_aarch64::possible_function_pointer_reloc): Implement this
887 method.
888 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
889 comment.
890 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
891 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
892 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
893 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
894 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
895 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
896 (Target_aarch64::make_plt_entry): Call add_entry with two more
897 parameters.
898 (Target_aarch64::make_local_ifunc_plt_entry): New method.
899 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
900 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
901 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
902 (Target_aarch64::Relocate::relocate_tls): Add cases for
903 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
904 TLSLD_MOVW_DTPREL_G0_NC.
905 * testsuite/icf_safe_so_test.cc: Correct test comment.
906 * testsuite/icf_safe_test.sh: Add AArch64 arch.
907
80272b8c
AM
9082014-10-22 Alan Modra <amodra@gmail.com>
909
910 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
911 thread_starter.
912
998a69f4
AS
9132014-10-18 Andreas Schwab <schwab@linux-m68k.org>
914
915 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
916
aed56ec5
CC
9172014-10-17 Cary Coutant <ccoutant@google.com>
918
919 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
920 Add "typename" keyword.
921
bb779192 9222014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
923 Jing Yu <jingyu@google.com>
924
925 Patch for gold aarch64 backend to support relaxation.
926 * aarch64-reloc.def: Change format.
927 * aarch64.cc (class Reloc_stub): New class.
928 (class Stub_table): New class.
929 (class AArch64_relobj): New class.
930 (class AArch64_input_section): New class.
931 (class AArch64_output_section): New class.
932 (Target_aarch64::new_stub_table): New method.
933 (Target_aarch64::new_aarch64_input_section): New method.
934 (Target_aarch64::find_aarch64_input_section): New method.
935 (Target_aarch64::scan_section_for_stubs): New method.
936 (Target_aarch64::scan_reloc_section_for_stubs): New method.
937 (Target_aarch64::relocate_stub): New method.
938 (Target_aarch64::current_target): New method.
939 (Target_aarch64::do_make_elf_object): New method.
940 (Target_aarch64::do_may_relax): New method.
941 (Target_aarch64::do_relax): New method.
942 (Target_aarch64::group_sections): New method.
943 (Target_aarch64::scan_reloc_for_stub): New method.
944 (Target_aarch64::do_make_output_section): New method.
945 (Target_aarch64::stub_tables_): New data member.
946 (Target_aarch64::aarch64_input_section_map_): New data member.
947 (AArch64_relocate_functions::maybe_apply_stub): New method.
948
db4c9594
CC
9492014-09-30 Cary Coutant <ccoutant@google.com>
950
951 PR gold/17432
952 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
953
cd6da036
KC
9542014-09-30 Kito Cheng <kito@0xlab.org>
955
956 PR gold/13597
957 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
958 hash table before sysv-style hash table.
959
5f772412
ST
9602014-09-29 Sriraman Tallam <tmsriram@google.com>
961
962 * options.h (--pic-executable): Add negative to alias to -no-pie.
963
5efeedf6
CC
9642014-09-26 Cary Coutant <ccoutant@google.com>
965
966 PR gold/16773
967 * object.cc (Sized_relobj_file): Compute value of section symbols
968 for TLS sections the same as TLS symbols.
969
1707f183
CC
9702014-09-25 Cary Coutant <ccoutant@google.com>
971
972 PR gold/17432
973 * resolve.cc (Symbol_table::resolve): Override common placeholder
974 symbols, but adjust sizes.
975 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
976 symbols to common lists.
977
00cac886
AM
9782014-09-24 Alan Modra <amodra@gmail.com>
979
980 * po/POTFILES.in: Regenerate.
981
635aa30e
CC
9822014-09-23 Taiju Tsuiki <tzik@google.com>
983 Cary Coutant <ccoutant@google.com>
984
71b9b91b 985 PR gold/14860
635aa30e
CC
986 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
987 on input_sections_blocker.
988 * layout.cc (Write_sections_task::locks): Unblock
989 input_sections_blocker_.
990 * layout.h (Write_sections_task::Write_sections_task): Add
991 input_sections_blocker.
992 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
993 to DEPENDENCIES.
994 * testsuite/Makefile.in: Regenerate.
995
c0c71592
RÁE
9962014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
997
998 * testsuite/Makefile.am (plugin_test_10): New test.
999 * testsuite/Makefile.in: Regenerate
1000 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1001 * testsuite/plugin_test_10.sh: New file.
1002
6168c2a1
RÁE
10032014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1004
1005 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1006 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1007 during the replacement phase.
1008
3a531937
JY
10092014-09-17 Han Shen <shenhan@google.com>
1010 Jing Yu <jingyu@google.com>
1011
1012 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1013 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1014 * aarch64.cc (Target_aarch64): Add data members
1015 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1016 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1017 constructor.
1018 (Target_aarch64::do_reloc_symbol_index): New method.
1019 (Target_aarch64::do_reloc_addend): New method.
1020 (Target_aarch64::add_tlsdesc_info): New method.
1021 (Target_aarch64::do_dynsym_value): New method.
1022 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1023 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1024 (Target_aarch64::make_data_plt): Add new parameters: got,
1025 got_irelative. Pass them to do_make_data_plt.
1026 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1027 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1028 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1029 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1030 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1031 (Target_aarch64::got_tlsdesc_section): New method.
1032 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1033 (Target_aarch64::define_tls_base_symbol): New method.
1034 (Target_aarch64::reserve_tlsdesc_entries): New method.
1035 (Target_aarch64::got_mod_index_entry): New method.
1036 (Target_aarch64::rela_tlsdesc_section): New method.
1037 (Target_aarch64::rela_irelative_section): New method.
1038 (Target_aarch64::Tlsdesc_info): New struct.
1039 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1040 relocations and tlsdesc relocations.
1041 (Target_aarch64::optimize_tls_reloc): Implement method.
1042 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1043 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1044 in constructor.
1045 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1046 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1047 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1048 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1049 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1050 (Output_data_plt_aarch64::rela_irelative): New method.
1051 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1052 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1053 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1054 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1055 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1056 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1057 (Output_data_plt_aarch64_standard): New member variables:
1058 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1059 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1060 New parameter: got, got_irelative.
1061 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1062 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1063 (Output_data_plt_aarch64::do_write): Replace got_address with
1064 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1065 (AArch64_relocate_functions::update_movnz): New method.
1066 (AArch64_relocate_functions): Correct format.
1067 (AArch64_relocate_functions::movnz): New method.
1068 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1069 before the switch. Add new cases to switch.
00cac886 1070 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1071 tlsgd tlsdesc cases.
1072 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1073 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1074 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1075 Call reloc_name_in_error_message to print unsupported reloc.
1076 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1077 make_data_plt.
1078 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1079 relocs. Fill in some more dynamic tags.
1080 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1081 Skip call tls_get_addr when tlsgd is relaxed.
1082 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1083 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1084 tlsdesc->ie relaxation.
1085
62661c93
SS
10862014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1087
1088 * mips.cc (Target_mips_nacl): New class.
1089 (Target_selector_mips_nacl): New class.
1090 (target_selector_mips32): Rename from target_selector_mips32be and use
1091 Target_selector_mips_nacl instead of Target_selector_mips.
1092 (target_selector_mips32el): Rename from target_selector_mips32 and use
1093 Target_selector_mips_nacl instead of Target_selector_mips.
1094 (target_selector_mips64): Rename from target_selector_mips64be and use
1095 Target_selector_mips_nacl instead of Target_selector_mips.
1096 (target_selector_mips64el): Rename from target_selector_mips64 and use
1097 Target_selector_mips_nacl instead of Target_selector_mips.
1098 (Target_mips::mips_info): Add const attribute.
1099
54674d38
CC
11002014-09-02 Cary Coutant <ccoutant@google.com>
1101
1102 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1103 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1104 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1105 (Sized_incr_dynobj::do_section_name): Likewise.
1106 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1107 (Sized_incr_dynobj::do_section_name): Likewise.
1108 * object.h (Object::section_name): Likewise.
1109 (Object::do_section_name): Likewise.
1110 (Sized_relobj_file::do_section_name): Likewise.
1111 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1112 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1113
9860cbcf
CC
11142014-09-02 Cary Coutant <ccoutant@google.com>
1115
1116 PR gold/17005
1117 * ehframe.cc (Fde::write): Add output_offset parameter.
1118 (Cie::write): Likewise.
1119 (Eh_frame::set_final_data_size): Account for offset within output
1120 section.
1121 (Eh_frame::do_sized_write): Likewise.
1122 * ehframe.h (Fde::write): Add output_offset parameter.
1123 (Cie::write): Likewise.
1124 * output.cc (Output_section::Input_section_sort_entry): Remove
1125 section_has_name_; add output_section_name parameter. Use
1126 output section name for non-input sections.
1127 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1128 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1129 (Output_section::Input_section_sort_compare): Remove logic for
1130 sections without names.
1131 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1132 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1133 Likewise.
1134 (Output_section::Input_section_sort_section_name_compare): Likewise.
1135
8e33481e
HS
11362014-08-29 Han Shen <shenhan@google.com>
1137 Jing Yu <jingyu@google.com>
1138
1139 * aarch64-reloc-property.cc
1140 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1141 reference reloc property in the table.
1142 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1143 3 other entries.
1144 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1145 2 new overloaded methods.
1146 (Output_data_got_aarch64::do_write): Add code to write out
1147 static relocs.
1148 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1149 static relocs.
1150 (Output_data_got_aarch64::static_relocs): New vector to
1151 hold static relocs.
1152 (Target_aarch64::TCB_SIZE): New const static memeber.
1153 (Target_aarch64::tcb_size): New method.
1154 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1155 (Target_aarch64::Relocate::relocate_tls): New method.
1156 (Target_aarch64::Scan::local): Add code handling new reloc types.
1157 (Target_aarch64::Scan::global): Add code handling new reloc types.
1158
81233653
ST
11592014-08-13 Sriraman Tallam <tmsriram@google.com>
1160
1161 * options.h (-no-pie): Add option.
1162
9363c7c3
JY
11632014-08-08 Jing Yu <jingyu@google.com>
1164 Han Shen <shenhan@google.com>
1165
1166 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1167 (DEFFILES): add aarch64-reloc.def.
1168 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1169 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1170 * Makefile.in: Regenerate.
1171 * aarch64-reloc-property.cc: New file.
1172 * aarch64-reloc-property.h: New file.
1173 * aarch64-reloc.def: New file.
1174 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1175 with tab to make the format consistent.
1176 (Output_data_got_aarch64::symbol_table_): New method.
1177 (Target_aarch64::do_plt_address_for_global): New method.
1178 (Target_aarch64::do_plt_address_for_local): New method.
1179 (Target_aarch64::do_select_as_default_target): New method.
1180 (Target_aarch64::do_make_data_plt): New method.
1181 (Target_aarch64::make_data_plt): New method.
1182 (Output_data_plt_aarch64::has_irelative_section): New method.
1183 (Output_data_plt_aarch64::address_for_global): New method.
1184 (Output_data_plt_aarch64::address_for_local): New method.
1185 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1186 (Output_data_plt_aarch64::add_entry): Implement contents.
1187 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1188 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1189 the got_pov entry to plt0.
1190 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1191 Implement contents.
1192 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1193 (AArch64_howto): New struct.
1194 (aarch64_howto[]): New static const array.
1195 (AArch64_relocate_functions): New class.
1196 (Target_aarch64::Scan::get_reference_flags): Remove method.
1197 (Target_aarch64::Scan::local): Implement to support a few relocations.
1198 (Target_aarch64::Scan::global): Implement to support a few relocations.
1199 (Target_aarch64::make_plt_section): Implement contents.
1200 (Target_aarch64::make_plt_entry): Implement contents.
1201 (Target_aarch64::do_finalize_sections): Implement contents.
1202 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1203 (Target_aarch64::relocate_section): Implement contents.
1204
ad9fe6c1
AM
12052014-08-06 Alan Modra <amodra@gmail.com>
1206
1207 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1208
7cd4e5b7
AM
12092014-08-06 Alan Modra <amodra@gmail.com>
1210
1211 PR 13227
1212 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1213
5ad9b0a7
ST
12142014-07-21 Sriraman Tallam <tmsriram@google.com>
1215
1216 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1217 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1218
e051745c
CC
12192014-07-08 Cary Coutant <ccoutant@google.com>
1220
1221 * expression.cc (struct Expression::Expression_eval_info): Add
1222 new fields type_pointer, vis_pointer, and nonvis_pointer.
1223 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1224 nonvis_pointer parameters. Adjust all calls.
1225 (Symbol_expression::value): Update type, visibility, and nonvis bits
1226 in caller.
1227 * script.cc (Symbol_assignment::sized_finalize): Update type,
1228 visibility, and remaining st_other bits for new symbol.
1229 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1230 vis_pointer, and nonvis_pointer parameters.
1231 * symtab.h (Symbol::set_type): New method.
1232
1233 * testsuite/Makefile.am (defsym_test): New test.
1234 * testsuite/Makefile.in: Regenerate.
1235 * testsuite/defsym_test.c: New file.
1236 * testsuite/defsym_test.sh: New file.
1237
f35c4853
CC
12382014-07-08 Cary Coutant <ccoutant@google.com>
1239
1240 PR gold/15639
1241 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1242 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1243 (Sized_dynobj::base_read_symbols): ...new method.
1244 * object.h (Sized_relobj_file::base_read_symbols): New method.
1245 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1246 (Sized_relobj_file::base_read_symbols): ...new method.
1247 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1248 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1249 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1250
2900af2d
AM
12512014-07-04 Alan Modra <amodra@gmail.com>
1252
1253 * po/POTFILES.in: Regenerate.
1254
053a4d68
JY
12552014-07-02 Jing Yu <jingyu@google.com>
1256
1257 * aarch64.cc: New file
1258 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1259 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1260 * Makefile.in: Regenerate.
1261 * configure.tgt: Add entries for aarch64*.
1262 * configure.ac: Likewise.
1263 * configure: Likewise.
1264
7b549045
AM
12652014-06-27 Alan Modra <amodra@gmail.com>
1266
1267 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1268
cb818dbf
CC
12692014-06-24 Cary Coutant <ccoutant@google.com>
1270
1271 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1272 sections.
1273 (Dwo_file::sized_read_unit_index): Likewise.
1274
9810d34d
SS
12752014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1276
1277 * mips.cc: New file.
1278 * Makefile.am (TARGETSOURCES): Add mips.cc
1279 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1280 * configure.tgt: Add entries for mips*.
1281 * configure.ac: Likewise.
1282 * Makefile.in: Regenerate.
1283 * configure: Likewise.
1284
9baa787b
CC
12852014-06-09 Cary Coutant <ccoutant@google.com>
1286
1287 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1288 unit_length is within section bounds.
1289
8f89af0a
CC
12902014-06-09 Cary Coutant <ccoutant@google.com>
1291
1292 PR gold/16980
1293 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1294 map.
1295
a47622ac
AM
12962014-06-07 Alan Modra <amodra@gmail.com>
1297
1298 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1299
4320c691
CC
13002014-06-06 Cary Coutant <ccoutant@google.com>
1301
1302 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1303 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1304 (Dwarf_pubnames_table::read_header): Likewise.
1305 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1306 .debug_gnu_pubtypes.
1307
270c9937
JB
13082014-06-05 Joel Brobecker <brobecker@adacore.com>
1309
1310 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1311 * Makefile.in, configure: Regenerate.
1312
397998fc
AM
13132014-06-03 Alan Modra <amodra@gmail.com>
1314
1315 * powerpc.cc (addis_12_2): Define.
1316 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1317
61f5c66f
AM
13182014-06-03 Alan Modra <amodra@gmail.com>
1319
1320 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1321 st_other output.
1322
f6971787
AM
13232014-06-02 Alan Modra <amodra@gmail.com>
1324
1325 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1326 Only ignore relocs on ELFv1.
1327 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1328
f6fb8322
CC
13292014-05-30 Cary Coutant <ccoutant@google.com>
1330
1331 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1332 * testsuite/Makefile.in: Regenerate.
1333 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1334
c23dd342
L
13352014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1336
1337 PR gold/16945
1338 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1339 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1340
5fe7ffdc
AM
13412014-05-15 Alan Modra <amodra@gmail.com>
1342
1343 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1344 Compare FDE contents with DW_CFA_nop rather than 0.
1345
a82bef93
ST
13462014-05-13 Sriraman Tallam <tmsriram@google.com>
1347
1348 * symtab.h (may_need_copy_reloc): Remove check for position independent
1349 code.
1350 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1351 position independence before pc absolute may_need_copy_reloc call.
1352 Add check for executable output befor pc relative may_need_copy_reloc
1353 call.
1354 * i386.cc: Ditto.
1355 * arm.cc: Ditto.
1356 * sparc.cc: Ditto.
1357 * tilegx.cc: Ditto.
1358 * powerpc.cc: Add check for no position independence before
1359 may_need_copy_reloc calls.
1360 * testsuite/pie_copyrelocs_test.cc: New file.
1361 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1362 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1363 * Makefile.in: Regenerate.
a82bef93 1364
53c66605
ML
13652014-05-08 Martin Liška <mliska@suse.cz>
1366
1367 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1368
57b2284c
CC
13692014-05-06 Cary Coutant <ccoutant@google.com>
1370
1371 PR gold/16900
1372 * i386.cc (Output_data_got_plt_i386): New class.
1373 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1374 parameter. Change all callers.
1375 (Output_data_plt_i386::layout_): Remove.
1376 (Output_data_plt_i386::got_plt_): Change type.
1377 (Target_i386::got_plt_): Change type. Change all references.
1378 (Target_i386::got_section): Create instance of new class.
1379 (Output_data_got_plt_i386::do_write): New function.
1380 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1381 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1382 parameter. Change all callers.
1383 (Output_data_plt_x86_64::layout_): Remove.
1384 (Output_data_plt_x86_64::got_plt_): Change type.
1385 (Target_x86_64::got_plt_): Change type. Change all references.
1386 (Target_x86_64::got_section): Create instance of new class.
1387 (Output_data_got_plt_x86_64::do_write): New function.
1388 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1389 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1390 class.
1391
6b97515d 13922014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1393
6b97515d
CC
1394 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1395 if we have pubnames/pubtypes.
1396
d1bddd3c
CC
13972014-05-02 Cary Coutant <ccoutant@google.com>
1398
5fe7ffdc
AM
1399 * defstd.cc (in_segment): Define __ehdr_start here...
1400 * layout.cc (Layout::finalize): ...Instead of here. Set the
1401 output segment when known.
1402 * resolve.cc (Symbol::override_base_with_special): Remember
1403 the original binding.
1404 * symtab.cc (Symbol::set_output_segment): New function.
1405 (Symbol::set_undefined): New function.
1406 * symtab.h (Symbol::is_weak_undefined): Check original undef
1407 binding.
1408 (Symbol::is_strong_undefined): New function.
1409 (Symbol::set_output_segment): New function.
1410 (Symbol::set_undefined): New function.
1411 * target-reloc.h (is_strong_undefined): Remove.
1412 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1413 Check for hidden undefs.
1414 (relocate_section): Call Symbol::is_strong_undefined.
1415
1416 * testsuite/Makefile.am (ehdr_start_test_1)
1417 (ehdr_start_test_2, ehdr_start_test_3)
1418 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1419 * testsuite/Makefile.in: Regenerate.
1420 * testsuite/ehdr_start_def.cc: New source file.
1421 * testsuite/ehdr_start_test.cc: New source file.
1422 * testsuite/ehdr_start_test.t: New linker script.
1423 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1424
7849f6d8
CC
14252014-04-23 Cary Coutant <ccoutant@google.com>
1426
bf2cc635 1427 PR gold/16870
7849f6d8
CC
1428 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1429
99fd8cff
CC
14302014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1431
1432 * layout.cc (Layout::include_section): Allow a target to decide
1433 whether to include a section.
1434 * target.h (Target::should_include_section): New function.
1435 (Target::do_should_include_section): New function.
1436
91f43acd
CC
14372014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1438
1439 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1440 inline into ...
1441 (Copy_relocs::emit): ... here.
1442 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1443 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1444 (Copy_reloc_entry::entries_): Change from private to protected.
1445
c4eb27e1
ST
14462014-04-02 Sriraman Tallam <tmsriram@google.com>
1447
1448 * icf.cc (get_section_contents): Replace copies of reloc
1449 vectors with const references.
1450
ae447ddd
CC
14512014-04-02 Cary Coutant <ccoutant@google.com>
1452
1453 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1454 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1455 * configure: Regenerate.
1456 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1457 -fno-use-linker-plugin.
1458 (LINK1, CXXLINK1): Add it to the link command.
1459 * testsuite/Makefile.in: Regenerate.
1460
fa47fa92
AM
14612014-03-12 Alan Modra <amodra@gmail.com>
1462
1463 * Makefile.in: Regenerate.
1464
9b12c500
CC
14652014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1466
1467 * symtab.h (Symbol::set_nonvis): New function.
1468
beacaa96
CC
14692014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1470
1471 * symtab.cc (Sized_symbol<32>::init_output_data):
1472 Instantiate the template.
1473 (Sized_symbol<64>::init_output_data): Likewise.
1474
800d9823
CC
14752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1476
1477 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1478 adjust dynamic symbol value.
1479 * target.h (Target::adjust_dyn_symbol): New function.
1480 (Target::do_adjust_dyn_symbol): New function.
1481
918fc1f8 14822014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1483
918fc1f8
CC
1484 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1485 Get the value of DYNAMIC_CUSTOM dynamic entry.
1486 * output.h (Output_data_dynamic::add_custom): New function.
1487 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1488 dynamic entry.
1489 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1490 * target.h (Target::dynamic_tag_custom_value): New function.
1491 (Target::do_dynamic_tag_custom_value): New function.
1492
98ff9231
CC
14932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1494
1495 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1496 dynsym indexes.
1497 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1498 (Target::do_has_custom_set_dynsym_indexes): New function.
1499 (Target::set_dynsym_indexes): New function.
1500 (Target::do_set_dynsym_indexes): New function.
1501
b80eed39
AM
15022014-03-07 Alan Modra <amodra@gmail.com>
1503
1504 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1505 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1506 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1507 (Powerpc_relocate_functions::has_overflow_bitfield,
1508 overflowed): Use the above.
1509 (Target_powerpc::Relocate::relocate): Correct overflow checking
1510 for a number of relocations. Modify overflow test for 16-bit
1511 fields in instructions to signed/unsigned according to whether
1512 the field takes a signed or unsigned value.
1513
4b95cf5c
AM
15142014-03-05 Alan Modra <amodra@gmail.com>
1515
1516 Update copyright years.
1517
45965137
AM
15182014-03-05 Alan Modra <amodra@gmail.com>
1519
1520 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1521 R_PPC64_ADDR64_LOCAL.
1522 (Target_powerpc::Relocate::relocate): Likewise.
1523
2c80b753
AM
15242014-03-03 Alan Modra <amodra@gmail.com>
1525
1526 * dwp.cc (print_version): Update copyright year to current.
1527
c1c69e83
AM
15282014-02-10 Alan Modra <amodra@gmail.com>
1529
1530 * po/gold.pot: Regenerate.
1531
dd0c4e70
CC
15322014-02-06 Cary Coutant <ccoutant@google.com>
1533
1534 Fix problem where -u is ignored when a weak undef is seen.
1535
1536 * archive.cc (Library_base::should_include_member): Reorder
1537 code to check for -u option if a weak undef has already been seen.
1538 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1539 * testsuite/Makefile.in: Regenerate.
1540 * testsuite/weak_undef_file3.cc: New file.
1541 * testsuite/weak_undef_file4.cc: New file.
1542 * testsuite/weak_undef_test_2.cc: New file.
1543
1a221d3d
CC
15442014-02-05 Cary Coutant <ccoutant@google.com>
1545
1546 Fix issues with gold undefined symbol diagnostics.
1547
1548 PR binutils/15435
1549 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1550 check to here.
1551 * target-reloc.h (is_strong_undefined): New function.
1552 (relocate_section): Move undef vtable symbol check from here.
1553 Check for is_strong_undefined.
1554
e889f0a4 15552014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1556
e889f0a4
CC
1557 Fix problems with the --dynamic-list option.
1558
1559 PR gold/13577
1560 * options.cc (General_options::parse_dynamic_list):
1561 Set have_dynamic_list_.
1562 (General_options::General_options): Initialize have_dynamic_list_.
1563 (General_options::finalize): Turn off -Bsymbolic and
1564 -Bsymbolic-functions if --dynamic-list provided.
1565 * options.h (General_options::have_dynamic_list): New function.
1566 (General_options::have_dynamic_list_): New data member.
1567 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1568 correctly.
5fe7ffdc 1569
e889f0a4
CC
1570 PR gold/16530
1571 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1572 in --dynamic-list, mark it.
5fe7ffdc 1573
e889f0a4
CC
1574 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1575 (dynamic_list_2): New test case.
1576 * testsuite/Makefile.in: Regenerate.
1577 * testsuite/dynamic_list_2.cc: New file.
1578 * testsuite/dynamic_list_2.t: New file.
1579 * testsuite/dynamic_list_lib1.cc: New file.
1580 * testsuite/dynamic_list_lib2.cc: New file.
1581 * testsuite/gc_dynamic_list_test.c: New file.
1582 * testsuite/gc_dynamic_list_test.sh: New file.
1583 * testsuite/gc_dynamic_list_test.t: New file.
1584
ec673e64
CC
15852014-01-28 Cary Coutant <ccoutant@google.com>
1586
1587 Add .gdb_index version 7 support.
1588
1589 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1590 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1591 debug sections.
1592 (Dwarf_ranges_table::read_ranges_table): Likewise.
1593 (Dwarf_pubnames_table::read_section): Check for GNU-style
1594 sections, and for compressed debug sections.
1595 (Dwarf_pubnames_table::read_header): Compute end address of table.
1596 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1597 for end of list by offset, not by offset == 0.
1598 (Dwarf_info_reader::do_read_string_table): Check for compressed
1599 debug sections.
1600 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1601 Initialize new data members.
1602 (Dwarf_pubnames_table::next_name): return flag_byte.
1603 (Dwarf_pubnames_table::end_of_table_): New data member.
1604 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1605 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1606 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1607 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1608 read skeleton type unit DIEs.
1609 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1610 (Gdb_index::do_write): Write flag_byte.
1611 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1612 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1613 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1614 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1615
221fd5d5
L
16162014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1617
1618 * version.cc (print_version): Update copyright year to 2014.
1619
6c09fb0b
ILT
16202013-12-19 Dimitry Andric <dimitry@andric.com>
1621
1622 * stringpool.cc (Stringpool_template::reserve): Add
1623 HAVE_UNORDERED_MAP case.
1624 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1625
8356f2d0
CC
16262013-12-18 Cary Coutant <ccoutant@google.com>
1627
1628 * configure.ac: Check for <unordered_set> and <unordered_map>.
1629 * config.in: Regenerate.
1630 * configure: Regenerate.
1631 * system.h: Use <unordered_set> and <unordered_map> if available.
1632
f2c7d7ee
RM
16332013-12-10 Roland McGrath <mcgrathr@google.com>
1634
1635 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1636 with $(INSTALL_PROGRAM_ENV).
1637 * Makefile.in: Regenerate.
1638
6632e8cc
CC
16392013-11-22 Cary Coutant <ccoutant@google.com>
1640
1641 * configure.ac: Add check for which library is needed for
1642 dlopen.
1643 * configure: Regenerate.
1644
0c075858
CC
16452013-11-22 Cary Coutant <ccoutant@google.com>
1646
1647 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1648 assembler.
1649 * testsuite/Makefile.in: Regenerate.
1650
f49fe902
L
16512013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1652
1653 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1654 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1655 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1656 (Target_x86_64<size>::Scan::local): Likewise.
1657 (Target_x86_64<size>::Scan::global): Likewise.
1658 (Target_x86_64<size>::Relocate::relocate): Likewise.
1659 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1660 Likewise.
1661 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1662 R_X86_64_PC32_BND.
1663
1664 * testsuite/Makefile.am (check_PROGRAMS): Add
1665 exception_x86_64_bnd_test.
1666 (exception_x86_64_bnd_test_SOURCES): New macro.
1667 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1668 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1669 (exception_x86_64_bnd_test_LDADD): Likewise.
1670 (exception_x86_64_bnd_1.o): New rule.
1671 (exception_x86_64_bnd_2.o): Likewise.
1672 * testsuite/Makefile.in: Regenerated.
1673
9055360d
AM
16742013-11-15 Alan Modra <amodra@gmail.com>
1675
1676 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1677 accessor.
1678 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1679 Only call ppc64_local_entry_offset for 64-bit. Restrict
1680 symval_for_branch lookup to ELFv1.
1681 (Stub_table::add_plt_call_entry): Use unsigned int off.
1682 (Output_data_glink::Address, invalid_address): New.
1683 (Output_data_glink::add_eh_frame): Move out of line. Add
1684 support for ELFv2.
1685 (Output_data_glink::add_global_entry, find_global_entry,
1686 global_entry_address): New functions.
1687 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1688 ge_size): New variables.
1689 (Output_data_glink::set_final_data_size): Add global entry
1690 stub sizing.
1691 (Output_data_glink::do_write): Write global entry stubs.
1692 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1693 parameter. Return true for ELFv2. Adjust callers.
1694 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1695 ELFv1. Similarly for ifunc and dynamic relocation processing
1696 specific to ELFv1. Recognize that symbols are defined on
1697 their plt entries for ELFv2.
1698 (Target_powerpc::symval_for_branch): Assert if called for
1699 ELFv2 or ppc32.
1700 (Target_powerpc::Relocate::relocate): Use global entry plt
1701 stub for symbol value if such exists on ELFv2.
1702 (Target_powerpc::Relocate::relocate): Don't call
1703 symval_for_branch when ELFv2. Do adjust for local entry
1704 offset when ELFv2.
1705 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1706 plt stub for ELFv2.
1707 (Target_powerpc::do_plt_address_for_global): Similarly.
1708
cafdd569
CC
17092013-11-14 Cary Coutant <ccoutant@google.com>
1710
1711 Revert patch -- this did not fix the problem, and there is
1712 no race there.
1713
1714 2013-11-14 Cary Coutant <ccoutant@google.com>
1715
1716 PR gold/14860
1717 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1718 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1719 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1720 updating fde_offsets_.
1721 (Eh_frame_hdr::lock_): New data member.
1722
94e49e16
CC
17232013-11-14 Cary Coutant <ccoutant@google.com>
1724
1725 * dwp.cc (Dwo_file_entry): New type.
1726 (File_list): Use Dwo_file_entry.
1727 (Dwo_file::verify): New function.
1728 (Dwo_file::verify_dwo_list): New function.
1729 (Dwo_file::sized_verify_dwo_list): New function.
1730 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1731 list.
1732 (Dwp_options): New enum type.
1733 (dwp_options): Add --verify-only.
1734 (usage): Likewise.
1735 (main): Likewise.
1736 * dwp.h (gold_info): Add declaration.
1737
7cdd7d57
CC
17382013-11-14 Cary Coutant <ccoutant@google.com>
1739
1740 PR gold/14860
1741 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1742 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1743 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1744 updating fde_offsets_.
1745 (Eh_frame_hdr::lock_): New data member.
1746
1d946cb3
CC
17472013-11-06 Cary Coutant <ccoutant@google.com>
1748
1749 PR gold/15758
1750 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1751 before reloc sections.
1752
4f65b40e
AM
17532013-11-04 Alan Modra <amodra@gmail.com>
1754
1755 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1756 (Symbol::needs_dynamic_reloc): Test new flag.
1757 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1758 (Target_powerpc::Scan::get_reference_flags): Add target param.
1759 Return FUNC_DESC_ABI for 64-bit ELFv1.
1760 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1761 call.
1762 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1763 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1764
908794a9
CC
17652013-10-31 Cary Coutant <ccoutant@google.com>
1766
1767 Restore support for dwp v2 DWARF package file format.
1768
1769 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1770 tu_length parameter. Adjust all callers.
1771 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1772 * dwp.cc: Include dwarf.h.
1773 (Section_bounds): New struct type.
1774 (Unit_set): New struct type.
1775 (Dwo_file::Dwo_file): Initialize new data member.
1776 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1777 Combine and rename to...
1778 (Dwo_file::read_unit_index): ...this.
1779 (Dwo_file::sized_read_compunit_index)
1780 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1781 (Dwo_file::sized_read_unit_index): ...this.
1782 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1783 parameters; add section_id parameter.
1784 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1785 (Dwo_file::add_unit_set): ...this.
1786 (Dwo_file::shndx_map_): Remove.
1787 (Dwo_file::sect_offsets_): New data member.
1788 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1789 (Dwp_output_file::add_section): Rename to...
1790 (Dwp_output_file::add_contribution): ...this.
1791 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1792 (Dwp_output_file::add_tu_set): Likewise.
1793 (Dwp_output_file::Contribution): New type.
1794 (Dwp_output_file::Section::contributions): New data member.
1795 (Dwp_output_file::Cu_or_tu_set): Remove.
1796 (Dwp_output_file::Section::Section): New ctor.
1797 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1798 (Dwp_output_file::Dwp_index::Section_table): New type.
1799 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1800 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1801 parameter.
1802 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1803 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1804 (Dwp_output_file::Dwp_index::section_table): New member function.
1805 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1806 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1807 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1808 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1809 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1810 (Dwp_output_file::Dwp_index::section_table_): New data member.
1811 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1812 (Dwp_output_file::add_output_section): New member function.
1813 (Dwp_output_file::write_new_section): New member function.
1814 (Dwp_output_file::write_contributions): New member function.
1815 (Dwp_output_file::section_id_map_): New data member.
1816 (class Dwo_id_info_reader): Remove.
1817 (class Unit_reader): New class.
1818 (get_dwarf_section_name): New function.
1819 (Dwo_file::read_executable): Adjust initializations of class data.
1820 (Dwo_file::read): Add support for v2 package file format.
1821 (Dwo_file::read_unit_index): Likewise.
1822 (Dwo_file::sized_read_unit_index): Likewise.
1823 (Dwo_file::copy_section): Likewise.
1824 (Dwo_file::add_unit_set): Likewise.
1825 (Dwp_output_file::add_output_section): Likewise.
1826 (Dwp_output_file::add_contribution): Likewise.
1827 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1828 for empty slot.
1829 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1830 file format.
1831 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1832 slot.
1833 (Dwp_output_file::initialize): Remove unused function.
1834 (Dwp_output_file::finalize): Add support for v2 package file format.
1835 (Dwp_output_file::write_index): Likewise.
1836 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1837 function prototype.
1838
2500c017
CC
18392013-10-31 Cary Coutant <ccoutant@google.com>
1840
1841 * configure.ac: Fix check for -fmerge-constants.
1842 * configure.ac: Regenerate.
1843
dd0845d7
RM
18442013-10-30 Roland McGrath <mcgrathr@google.com>
1845
1846 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1847 Correct 9-byte nop sequence to match what the assembler generates.
1848
b4f7960d
AM
18492013-10-30 Alan Modra <amodra@gmail.com>
1850
1851 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1852 ppc64_local_entry_offset, ppc64_local_entry_offset,
1853 do_read_symbols): New functions.
1854 (Powerpc_relobj::e_flags_, st_other_): New vars.
1855 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1856 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1857 (Powerpc_relobj::e_flags_): New var.
1858 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1859 and adjust for ELFv2.
1860 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1861 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1862 (Powerpc_dynobj::do_find_special_sections): Likewise.
1863 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1864 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1865 to ELFv2 local entry.
1866 (Target_powerpc::do_relax): No thread safe barriers needed for
1867 ELFv2.
1868 (Output_data_plt_powerpc::initial_plt_entry_size_,
1869 plt_entry_size): Delete. Replace all uses with
1870 first_plt_entry_offset() and plt_entry_size().
1871 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1872 reserved_size parm. Update callers.
1873 (Output_data_plt_powerpc::entry_count): Update.
1874 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1875 and use Target_powerpc::first_plt_entry_offset().
1876 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1877 rename to plt_entry_size.
1878 (Output_data_plt_powerpc::add_ifunc_entry,
1879 add_local_ifunc_entry): Adjust reloc for ELFv2.
1880 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1881 (glink_eh_frame_fde_64v2): New.
1882 (Stub_table::plt_call_size): Support ELFv2 sizing.
1883 (Output_data_glink::add_eh_frame): Use the new FDE.
1884 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1885 (Stub_table::do_write): Write ELFv2 stubs and glink.
1886 (Target_powerpc::Relocate::relocate): Replaces nop after call
1887 with ld 2,24(1) and adjust local offset destination for ELFv2.
1888
f9c6b907
AM
18892013-10-30 Alan Modra <amodra@gmail.com>
1890
1891 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1892 (Target_powerpc::Scan::global, local): Likewise.
1893 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1894 on all ppc64 @h and @ha relocs.
1895
e84fe78f
AM
18962013-10-14 Alan Modra <amodra@gmail.com>
1897
1898 * output.h (Output_data_got::add_constant): Tidy.
1899 (Output_data_got::add_constant_pair): New function.
1900 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1901 methods used so as to first call reserve_ent().
1902
679e4abf
RM
19032013-10-11 Roland McGrath <mcgrathr@google.com>
1904
44dcb735
RM
1905 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1906 add_got_entry and add_got_entry_pair.
1907
13323c49
RM
1908 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1909 (HAVE_PUBNAMES): Likewise.
1910 * configure: Regenerate.
1911
1496b446
RM
1912 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1913 * testsuite/Makefile.in: Regenerate.
1914
cc84c10b
RM
1915 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1916 Remove const from declaration.
1917 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1918 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1919 * output.h (Output_file_header): Remove const from member target_
1920 and corresponding constructor argument.
1921 * output.cc (Output_file_header::Output_file_header): Update prototype.
1922 (Output_file_header::do_sized_write): Use this->target_ in place
1923 of parameters()->target().
1924
52f66a2c
RM
1925 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1926
2b64b551
RM
1927 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1928 * configure: Regenerate.
1929 * Makefile.in: Regenerate.
1930 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1931 * testsuite/merge_string_literals_2.c: Likewise.
1932 * testsuite/Makefile.am
1933 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1934 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1935 literal -fmerge-constants.
1936 * testsuite/Makefile.in: Regenerate.
1937
43819297
RM
1938 * i386.cc (Target_i386): Remove unused member dynbss_.
1939 * arm.cc (Target_arm): Likewise.
1940 * powerpc.cc (Target_powerpc): Likewise.
1941 * sparc.cc (Target_sparc): Likewise.
1942 * tilegx.cc (Target_tilegx): Likewise.
1943 * x86_64.cc (Target_x86_64): Likewise.
1944 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1945 type_signature_, type_offset_.
1946 * plugin.h (Plugin_hook): Remove unused member layout_.
1947 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1948 mapfile_.
1949 (Read_member): Remove unused members input_objects_, symtab_,
1950 mapfile_, layout_.
1951 (Check_library): Remove unused member symtab_.
1952 * archive.h (Lib_group): Remove unused member lib_.
1953 * archive.cc (Lib_group::Lib_group): Update initializer.
1954 * incremental.h (Incremental_binary): Remove unused member target_.
1955 (Incremental_script_entry): Removed unused member script_.
1956 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1957 * icf.h (Icf): Remove unused member num_tracked_relocs.
1958
39d9ead7
RM
1959 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1960 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1961 its only use.
1962 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1963
679e4abf
RM
1964 * archive.h: Use struct rather than class for forward declaration
1965 of Read_symbols_data.
1966
54de2ea6
CC
19672013-10-07 Cary Coutant <ccoutant@google.com>
1968
1969 PR gold/16010
1970 * testsuite/Makefile.am (icf_test): Fix dependencies.
1971 (icf_safe_test): Likewise.
1972 (icf_safe_so_test): Likewise.
1973 (large_symbol_alignment): Add empty _LDADD rule.
1974 * testsuite/Makefile.in: Regenerate.
1975
b14016f0
L
19762013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1977
1978 PR gold/15927
1979 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1980 relocation for R_X86_64_32 on x32.
1981
eb426534
RM
19822013-08-27 Roland McGrath <mcgrathr@google.com>
1983
1984 * output.cc (Output_segment::set_section_addresses): Take new
1985 Target* argument. If target->isolate_execinstr() and the segment
1986 is executable and starts at a target->abi_pagesize() boundary,
1987 pad its end out to a target->abi_pagesize() boundary with code fill.
1988 * output.h (Output_segment::set_section_addresses): Update decl.
1989 * layout.h (Layout::check_output_data_for_reset_values): Take new
1990 argument RELAX_OUTPUTS.
1991 (Layout): New member relax_output_list_.
1992 (Layout::add_relax_output): New method.
1993 * layout.cc (Layout::Layout): Update constructor.
1994 (Layout::reset_relax_output): New method.
1995 (Layout::clean_up_after_relaxation): Call it.
1996 (Layout::prepare_for_relaxation): Update caller.
1997 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1998 Call reset_relax_output before re-processing segments for
1999 isolate_execinstr case.
2000 (Layout::write_data): Handle relax_output_list_.
2001 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2002 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2003
9aff4b7a
NC
20042013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2005
2006 PR binutils/15834
2007 * object.h: Fix typos.
2008
93f8221c
RM
20092013-08-16 Roland McGrath <mcgrathr@google.com>
2010
2011 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2012 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2013
e44c3715
CC
20142013-08-07 Cary Coutant <ccoutant@google.com>
2015
2016 Revert support for v2 DWP files:
2017
2018 2013-03-01 Cary Coutant <ccoutant@google.com>
2019
2020 Add dwp support for v2 DWARF package file format.
2021 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2022 tu_length parameter. Adjust all callers.
2023 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2024 * dwp.cc: Include dwarf.h.
2025 (Section_bounds): New struct type.
2026 (Unit_set): New struct type.
2027 (Dwo_file::Dwo_file): Initialize new data member.
2028 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2029 Combine and rename to...
2030 (Dwo_file::read_unit_index): ...this.
2031 (Dwo_file::sized_read_compunit_index)
2032 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2033 (Dwo_file::sized_read_unit_index): ...this.
2034 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2035 parameters; add section_id parameter.
2036 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2037 (Dwo_file::add_unit_set): ...this.
2038 (Dwo_file::shndx_map_): Remove.
2039 (Dwo_file::sect_offsets_): New data member.
2040 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2041 (Dwp_output_file::add_section): Rename to...
2042 (Dwp_output_file::add_contribution): ...this.
2043 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2044 (Dwp_output_file::add_tu_set): Likewise.
2045 (Dwp_output_file::Contribution): New type.
2046 (Dwp_output_file::Section::contributions): New data member.
2047 (Dwp_output_file::Cu_or_tu_set): Remove.
2048 (Dwp_output_file::Section::Section): New ctor.
2049 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2050 (Dwp_output_file::Dwp_index::Section_table): New type.
2051 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2052 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2053 parameter.
2054 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2055 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2056 (Dwp_output_file::Dwp_index::section_table): New member function.
2057 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2058 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2059 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2060 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2061 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2062 (Dwp_output_file::Dwp_index::section_table_): New data member.
2063 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2064 (Dwp_output_file::add_output_section): New member function.
2065 (Dwp_output_file::write_new_section): New member function.
2066 (Dwp_output_file::write_contributions): New member function.
2067 (Dwp_output_file::section_id_map_): New data member.
2068 (class Dwo_id_info_reader): Remove.
2069 (class Unit_reader): New class.
2070 (get_dwarf_section_name): New function.
2071 (Dwo_file::read_executable): Adjust initializations of class data.
2072 (Dwo_file::read): Add support for v2 package file format.
2073 (Dwo_file::read_unit_index): Likewise.
2074 (Dwo_file::sized_read_unit_index): Likewise.
2075 (Dwo_file::copy_section): Likewise.
2076 (Dwo_file::add_unit_set): Likewise.
2077 (Dwp_output_file::add_output_section): Likewise.
2078 (Dwp_output_file::add_contribution): Likewise.
2079 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2080 for empty slot.
2081 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2082 file format.
2083 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2084 slot.
2085 (Dwp_output_file::initialize): Remove unused function.
2086 (Dwp_output_file::finalize): Add support for v2 package file format.
2087 (Dwp_output_file::write_index): Likewise.
2088 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2089 function prototype.
2090
c6905c28
CC
20912013-07-31 Cary Coutant <ccoutant@google.com>
2092
2093 * object.cc (Sized_relobj::do_output_section_address): New function.
2094 (Sized_relobj): Instantiate explicitly.
2095 * object.h (Object::output_section_address): New function.
2096 (Object::do_output_section_address): New function.
2097 (Sized_relobj::do_output_section_address): New function.
2098 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2099
21002013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2101 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2102
2103 * parameters.cc (Parameters::entry): Return target-specific entry
2104 symbol name.
2105 * target.h (Target::entry_symbol_name): New function.
2106 (Target_info::entry_symbol_name): New data member.
2107
2108 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2109 * i386.cc (Target_i386::i386_info): Likewise.
2110 (Target_i386_nacl::i386_nacl_info): Likewise.
2111 * sparc.cc (Target_sparc::sparc_info): Likewise.
2112 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2113 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2114 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2115 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2116
234d4ab8
SA
21172013-07-22 Sterling Augustine <saugustine@google.com>
2118
2119 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2120 Convert parameter shndx to local variable. Add parameters symtab
2121 and symtab_size. Scan over section names. Find relocation
2122 section corresponding to current section. Create and initialize
2123 reloc_mapper_ and reloc_type_.
2124 (Dwarf_pubnames_table::read_header): Add assertion. Change
2125 unit_length to off_t. Initialize member unit_length_. Fill in field
2126 cu_offset_.
2127 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2128 Initialize new fields unit_length_ and cu_offset_.
2129 (Dwarf_pubnames_table::read_section): Update prototype.
2130 (Dwarf_pubnames_table::cu_offset): New member function.
2131 (Dwarf_pubnames_table::subsection_size): Likewise.
2132 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2133 New fields.
2134 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2135 member functions public.
2136 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2137 Update comment. Rework logic. Move repeated parts to...
2138 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2139 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2140 pubtypes_table_, and stmt_list_offset.
2141 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2142 Gdb_index::find_pubtype_offset,
2143 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2144 (Gdb_index::pubnames_read): Update prototype and rework logic.
2145 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2146 Forward declare.
2147 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2148 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2149 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2150 Gdb_index::map_pubtable_to_dies):
2151 Declare functions.
2152 (Gdb_index::pubnames_read): Update declaration.
2153 (Gdb_index::Pubname_offset_map): New type.
2154 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2155 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2156 Gdb_index::stmt_list_offset): Declare.
2157 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2158 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2159 Gdb_index::pubtypes_offset_): Remove.
2160
a3ed37d8
RM
21612013-07-19 Roland McGrath <mcgrathr@google.com>
2162
2163 * options.h (General_options): Add -Trodata-segment option.
2164 * parameters.cc (Parameters::check_rodata_segment): New function.
2165 (Parameters::set_target_once): Call it.
2166 * parameters.h (Parameters): Declare it (private member function).
2167 * layout.cc (load_seg_unusable_for_headers): New function, broken
2168 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2169 then validate rodata segment rather than text segment.
2170 (relaxation_loop_body): Call that.
2171 (is_text_segment): New function. Don't admit a non-executable
2172 segment if TARGET->isolate_execinstr().
2173 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2174
eb5b4ded
CC
21752013-07-15 Shawn Landden <shawnlandden@gmail.com>
2176
2177 PR gold/15070
2178 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2179 * nacl.h (Sniff_file::View::View): Request aligned view.
2180
4d5effb9
CC
21812013-07-11 Cary Coutant <ccoutant@google.com>
2182
2183 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2184 correct BRLT entry size.
2185
ba8ca3e7
AM
21862013-07-03 Alan Modra <amodra@gmail.com>
2187
2188 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2189 comment.
2190
267257d2
CC
21912013-07-01 Cary Coutant <ccoutant@google.com>
2192
2193 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2194 reloc_type_.
2195 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2196 (Dwarf_ranges_table::lookup_reloc): New function.
2197 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2198 reloc_type_.
2199 (Dwarf_ranges_table::lookup_reloc): New function.
2200 (Dwarf_ranges_table::reloc_type_): New data member.
2201
06f30c9d
CC
22022013-06-27 Jing Yu <jingyu@google.com>
2203
2204 PR gold/15662
2205 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2206 function.
2207 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2208 (Target_powerpc::do_relax): Call the above.
2209
a2d7bf59
AM
22102013-06-27 Cary Coutant <ccoutant@google.com>
2211
2212 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2213 on garbage collected .opd section.
2214
22152013-06-27 Alan Modra <amodra@gmail.com>
2216
2217 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2218 is non-zero.
2219 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2220 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2221
32364e50
CC
22222013-06-14 Cary Coutant <ccoutant@google.com>
2223
2224 * resolve.cc (Symbol::override_base): Don't override st_type
2225 from plugin placeholder symbols.
2226 (Symbol_table::resolve): Likewise.
2227 (Symbol_table::should_override): Don't complain about TLS mismatch
2228 if the TO symbol is a plugin placeholder.
2229 * testsuite/Makefile.am (plugin_test_tls): New test.
2230 * testsuite/Makefile.in: Regenerate.
2231 * testsuite/plugin_test_tls.sh: New test script.
2232 * testsuite/two_file_test_2_tls.cc: New test source.
2233 * testsuite/two_file_test_tls.cc: New test source.
2234
7fb47cc9
CC
22352013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2236
2237 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2238 the maximum segment alignment is larger than the page size.
2239 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2240 correctly aligns the symbols with large alignemnt.
2241 * testsuite/Makefile.in: Regenerate.
2242 * testsuite/large_symbol_alignment.cc: New file.
2243
6934001a
CC
22442013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2245 Sriraman Tallam <tmsriram@google.com>
2246
2247 * options.h (sort_section): New option.
2248 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2249 Rename from Input_section_sort_section_name_special_ordering_compare.
2250 (Input_section_sort_section_name_compare): New struct.
2251 * output.cc (Output_section::Input_section_sort_section_name_compare::
2252 operator()): New function.
2253 (Output_section::sort_attached_input_sections): Use new sort function
2254 for .text if --sort-section=name is specified.
2255 * layout.cc (Layout::make_output_section):
2256 Add sorting by name when --sort-section=name is specified.
2257 * testsuite/Makefile.am (text_section_grouping): Test option
2258 --sort-section=name.
2259 * testsuite/Makefile.in: Regenerate.
2260 * testsuite/section_sorting_name.cc: New file.
2261 * testsuite/section_sorting_name.sh: New file.
2262
93acabad
CC
22632013-05-21 Cary Coutant <ccoutant@google.com>
2264
2265 * symtab.h (Symbol::is_cxx_vtable): New function.
2266 * target-reloc.h (relocate_section): Check for vtable symbol.
2267 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2268 * testsuite/Makefile.in: Regenerate.
2269 * testsuite/missing_key_func.cc: New test source.
2270 * testsuite/missing_key_func.sh: New test script.
2271
60e8b3fc
CC
22722013-05-21 Cary Coutant <ccoutant@google.com>
2273
2b64b551
RM
2274 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2275 type of enclosing symbol.
2276 (Relocate_info::location): Check symbol type when describing symbol.
2277 * object.h (Symbol_location_info): Remove unused line_number;
2278 add enclosing_symbol_type.
2279 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2280
9df9de2c
CC
22812013-05-13 Cary Coutant <ccoutant@google.com>
2282
2b64b551
RM
2283 * configure.ac: Export DEFAULT_TARGET.
2284 * configure: Regenerate.
2285 * Makefile.in: Regenerate.
2286 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2287 * testsuite/Makefile.in: Regenerate.
2288 * testsuite/debug_msg.sh: Delete duplicate tests.
2289 Don't check undef_int error message match for powerpc where the
2290 source file and line number aren't available.
9df9de2c 2291
bbc5ae17
RM
22922013-05-10 Roland McGrath <mcgrathr@google.com>
2293
2294 * options.h (General_options): Add --rosegment-gap option.
2295 * options.cc (finalize): --rosegment-gap implies --rosegment.
2296 * layout.cc (set_segment_offsets): Let user option override
2297 target->rosegment_gap().
2298
0c6e6c39
RM
22992013-05-10 Roland McGrath <mcgrathr@google.com>
2300
2301 * options.h (General_options): Remove leading space from help
2302 messages for -nostdlib and --rosegment.
2303
cde7cb01
MR
23042013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2305
2306 PR ld/15365
2307 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2308
f31ae5b8
AM
23092013-05-03 Alan Modra <amodra@gmail.com>
2310
2311 * merge.cc (Output_merge_string::do_add_input_section): Correct
2312 scan for number of strings. Rename vars to avoid shadowing.
2313 Include missing terminator in input_size_.
2314
d3a7cd45
L
23152013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2316
2317 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2318 Restore empty string handling.
2319
6ad3daba
CC
23202013-05-01 Cary Coutant <ccoutant@google.com>
2321
2322 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2323 uninitialized warning.
2324
e31908b6
CC
23252013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2326
2327 * output.cc (Output_section::add_merge_input_section): Allow
2328 to merge sections if the alignment is more than character size.
2329 * merge.h (Output_merge_string::Output_merge_string): Remove
2330 assert.
2331 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2332 only not-null strings. Check the alignment of strings.
2333 * stringpool.h
2334 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2335 alignment as the argument.
2336 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2337 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2338 Align non-zero length strings according to the addralign_.
2339 (Stringpool_template<Stringpool_char>::set_string_offsets):
2340 Updating offsets according to the given alignment.
2341 * testsuite/Makefile.am (text_section_grouping): Test if string
2342 literals are getting merged.
2343 * testsuite/Makefile.in: Regenerate.
2344 * testsuite/merge_string_literals_1.c: New file.
2345 * testsuite/merge_string_literals_2.c: Ditto.
2346 * testsuite/merge_string_literals.sh: Ditto.
2347
0e804863
ILT
23482013-04-26 Ian Lance Taylor <iant@google.com>
2349
2350 * target-reloc.h (relocate_section): If the reloc offset is out of
2351 range, pass VIEW as NULL to relocate.relocate.
2352 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2353 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2354 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2355 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2356 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2357 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2358
e7c5ea40
CC
23592013-04-26 Geoff Pike <gpike@chromium.org>
2360
2361 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2362 * layout.cc (Hash_task): New class.
2363 (Layout::queue_build_id_tasks): New function.
2364 (Layout::write_build_id): Handle single-thread portion of build ID
2365 computation. (In some cases, all of it is single-threaded.) Replace
2366 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2367 functionality in fewer lines of code.
2368 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2369 * options.h (General_options): make "--build-id" default to tree
2370 rather than sha1. Add two new options related to --build-id=tree:
2371 --build-id-chunk-size-for-treehash and
2372 --build-id-min-file-size-for-treehash.
2373 * Makefile.am: add testing of --build-id=tree and related new options
2374 (these tests will be invoked by "make check").
2375 * Makefile.in: Regenerate.
2376
49926cd0
AM
23772013-04-25 Alan Modra <amodra@gmail.com>
2378
2379 * configure.tgt: Add powerpcle and powerpc64le.
2380
a4034750
AM
23812013-04-22 Alan Modra <amodra@gmail.com>
2382
2383 PR gold/15355
2384 * layout.cc (Layout::segment_precedes): Allow more than one
2385 segment with the same type and flags.
2386
e79c84aa
CC
23872013-04-15 Cary Coutant <ccoutant@google.com>
2388
2389 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2390 allocate space in file for BSS sections.
2391
2199fbe7
CC
23922013-04-15 Cary Coutant <ccoutant@google.com>
2393
2394 * script-sections.cc (Orphan_output_section): Reset address
2395 to zero after each orphaned section for relocatable links.
2396
502e8a84
CC
23972013-04-15 Cary Coutant <ccoutant@google.com>
2398
a4034750
AM
2399 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2400 section starting address for relocatable link.
2401 * testsuite/Makefile.am (script_test_11): New test.
2402 * testsuite/Makefile.in: Regenerate.
2403 * testsuite/script_test_11.c: New source file.
2404 * testsuite/script_test_11.t: New linker script.
502e8a84 2405
0cfdc767
AM
24062013-04-13 Alan Modra <amodra@gmail.com>
2407
2408 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2409 owner when sections are not adjacent and exceed group size.
2410 (Target_powerpc::group_sections): Handle corner case.
2411 (Target_powerpc::Branch_info::make_stub): Handle case where
2412 stub table doesn't exist due to branches in non-exec sections.
2413 (Target_powerpc::Relocate::relocate): Likewise.
2414
6830ee24
AM
24152013-04-11 Alan Modra <amodra@gmail.com>
2416
2417 PR gold/15354
2418 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2419 .branch_lt to match bfd ld. Adjust comments throughout file.
2420
54a3d865
ILT
24212013-04-04 Ian Lance Taylor <iant@google.com>
2422
2423 GCC PR c++/56840
2424 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2425 sections before checking whether they are included in the link.
2426
9993ba11
ST
24272013-03-29 Sriraman Tallam <tmsriram@google.com>
2428
2429 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2430 object before calling the plugin claim_file handler. Pass the elf
2431 object of the archive to the plugin. Delete the elf object if the
2432 plugin claims the file.
2433
ebacd51e
AM
24342013-03-21 Alan Modra <amodra@gmail.com>
2435
2436 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2437 segment when omagic.
2438
117be58f
AM
24392013-03-21 Alan Modra <amodra@gmail.com>
2440
2441 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2442 comparison warning.
2443 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2444 uninitialized" warning.
2445
32e2b61d
AM
24462013-03-20 Alan Modra <amodra@gmail.com>
2447
2448 * symtab.h (Symbol::clear_version): New function.
2449 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2450 is_needed by weak references. Clear version for symbols defined
2451 in as-needed objects that are not needed.
2452
b3ccdeb5
AM
24532013-03-15 Alan Modra <amodra@gmail.com>
2454
2455 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2456 static and public. Add report_err param. Return false for data refs.
2457 (Target_powerpc::rela_dyn_section): New overloaded function.
2458 (Target_powerpc::plt_, iplt_): Elucidate.
2459 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2460 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2461 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2462 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2463 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2464 push_branch and make_plt_entry for ifunc syms when
2465 reloc_needs_plt_for_ifunc.
2466 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2467 for ifunc unless reloc_needs_plt_for_ifunc.
2468
ad3d8a2f
AM
24692013-03-15 Alan Modra <amodra@gmail.com>
2470
2471 * gc.h (gc_process_relocs): Don't look through function descriptors.
2472 * icf.cc (get_section_contents): Do so here instead.
2473
4d9aa155
AM
24742013-03-13 Alan Modra <amodra@gmail.com>
2475
2476 * powerpc.cc (is_branch_reloc): Forward declare.
2477 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2478 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2479 false for 64-bit, true for 32-bit non-branch relocs.
2480 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2481 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2482 nm output.
2483 (icf_safe_test): Generate linker map file as well as nm output.
2484 (icf_safe_so_test): Likewise.
2485 * testsuite/Makefile.in: Regenerate.
2486 * testsuite/icf_test.sh: Parse linker map file to determine
2487 section folding.
2488 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2489 * testsuite/icf_safe_so_test.sh: Likewise.
2490 (X86_32_or_ARM_specific_safe_fold): Merge into..
2491 (arch_specific_safe_fold): ..this.
2492 (X86_64_specific_safe_fold): Delete unused function.
2493
57420c20
AM
24942013-03-12 Alan Modra <amodra@gmail.com>
2495
2496 * gc.h (gc_process_relocs): Look through function descriptors
2497 to determine shndx, symvalue and addend used by ICF. Tidy
2498 variable duplication.
2499
dc3714f3
AM
25002013-03-11 Alan Modra <amodra@gmail.com>
2501
2502 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2503 * layout.cc (Layout_task_runner::run): ..to here.
2504 * symtab.h (struct Symbol_location): Extract from..
2505 (class Symbol_table): ..here.
2506 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2507 * target.h (class Target): Add function_location and
2508 do_function_location functions.
2509 (class Sized_target): Add do_function_location.
2510 * object.h (class Sized_relobj_file): Move find_shdr..
2511 (class Object): ..to here.
2512 * object.cc: Likewise. Update to suit. Instantiate.
2513 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2514 * powerpc.cc (class Powerpc_dynobj): New.
2515 (Target_powerpc::do_function_location): New function.
2516 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2517 (Powerpc_dynobj::do_read_symbols): New function.
2518 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2519
956b03bb
ILT
25202013-03-08 Ian Lance Taylor <iant@google.com>
2521
2522 * options.cc (General_options::string_to_object_format): Accept
2523 "default".
2524
4bead2d5
AM
25252013-03-08 Alan Modra <amodra@gmail.com>
2526
2527 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2528 pointer to Post_fde.
2529 (struct Post_fde): Move definition to here..
2530 * ehframe.cc (struct Post_fde): ..from here.
2531 (Cie::write): Don't alloc Post_fde.
2532 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2533
02e60bf7
AM
25342013-03-07 Alan Modra <amodra@gmail.com>
2535
2536 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2537 relocation referencing .LC0.
2538 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2539
8343f03a
AM
25402013-03-07 Alan Modra <amodra@gmail.com>
2541
2542 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2543 always_inline. Add assembly for powerpc to avoid GOT.
2544
3366d57c
AM
25452013-03-07 Alan Modra <amodra@gmail.com>
2546
2547 * testsuite/script_test_10.sh: Don't test .bss section
2548 header number.
2549
6c77229c
AM
25502013-03-06 Alan Modra <amodra@gmail.com>
2551
2552 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2553 (Target_powerpc::symval_for_branch): Add symtab param. Update
2554 all callers. Handle folded sections.
2555 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2556 to Powerpc_relobj.
2557 (Global_symbol_visitor_opd::operator()): Likewise.
2558
a39e4af6
AM
25592013-03-04 Alan Modra <amodra@gmail.com>
2560
2561 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2562 * testsuite/Makefile.in: Regenerate.
2563
d5834edb
CC
25642013-03-01 Cary Coutant <ccoutant@google.com>
2565
2566 Add dwp support for v2 DWARF package file format.
2567 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2568 tu_length parameter. Adjust all callers.
2569 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2570 * dwp.cc: Include dwarf.h.
2571 (Section_bounds): New struct type.
2572 (Unit_set): New struct type.
2573 (Dwo_file::Dwo_file): Initialize new data member.
2574 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2575 Combine and rename to...
2576 (Dwo_file::read_unit_index): ...this.
2577 (Dwo_file::sized_read_compunit_index)
2578 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2579 (Dwo_file::sized_read_unit_index): ...this.
2580 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2581 parameters; add section_id parameter.
2582 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2583 (Dwo_file::add_unit_set): ...this.
2584 (Dwo_file::shndx_map_): Remove.
2585 (Dwo_file::sect_offsets_): New data member.
2586 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2587 (Dwp_output_file::add_section): Rename to...
2588 (Dwp_output_file::add_contribution): ...this.
2589 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2590 (Dwp_output_file::add_tu_set): Likewise.
2591 (Dwp_output_file::Contribution): New type.
2592 (Dwp_output_file::Section::contributions): New data member.
2593 (Dwp_output_file::Cu_or_tu_set): Remove.
2594 (Dwp_output_file::Section::Section): New ctor.
2595 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2596 (Dwp_output_file::Dwp_index::Section_table): New type.
2597 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2598 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2599 parameter.
2600 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2601 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2602 (Dwp_output_file::Dwp_index::section_table): New member function.
2603 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2604 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2605 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2606 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2607 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2608 (Dwp_output_file::Dwp_index::section_table_): New data member.
2609 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2610 (Dwp_output_file::add_output_section): New member function.
2611 (Dwp_output_file::write_new_section): New member function.
2612 (Dwp_output_file::write_contributions): New member function.
2613 (Dwp_output_file::section_id_map_): New data member.
2614 (class Dwo_id_info_reader): Remove.
2615 (class Unit_reader): New class.
2616 (get_dwarf_section_name): New function.
2617 (Dwo_file::read_executable): Adjust initializations of class data.
2618 (Dwo_file::read): Add support for v2 package file format.
2619 (Dwo_file::read_unit_index): Likewise.
2620 (Dwo_file::sized_read_unit_index): Likewise.
2621 (Dwo_file::copy_section): Likewise.
2622 (Dwo_file::add_unit_set): Likewise.
2623 (Dwp_output_file::add_output_section): Likewise.
2624 (Dwp_output_file::add_contribution): Likewise.
2625 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2626 for empty slot.
2627 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2628 file format.
2629 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2630 slot.
2631 (Dwp_output_file::initialize): Remove unused function.
2632 (Dwp_output_file::finalize): Add support for v2 package file format.
2633 (Dwp_output_file::write_index): Likewise.
2634 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2635 function prototype.
2636
a68a081d
CC
26372013-03-01 Cary Coutant <ccoutant@google.com>
2638
2639 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2640 function into class definition in header file.
2641 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2642 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2643 New function.
2644 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2645
9d5781f8
AM
26462013-02-28 Alan Modra <amodra@gmail.com>
2647
2648 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2649 * target.cc (Target::do_plt_fde_location): New function.
2650 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2651 accessor function, and constructor param.
2652 (struct Post_fde, Post_fdes): Declare.
2653 (Cie::write): Add post_fdes param.
2654 * ehframe.cc (Fde::write): Use plt_fde_location.
2655 (struct Post_fde): Define.
2656 (Cie::write): Stash FDEs added post merge mapping.
2657 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2658 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2659 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2660 other FDEs.
2661 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2662 (Target_powerpc::has_glink): New function.
2663 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2664 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2665 glink_eh_frame_fde_32, default_fde): New data.
2666 (Stub_table::eh_frame_added_): New var.
2667 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2668 Make const.
2669 (Stub_table::add_eh_frame): New function.
2670 (Output_data_glink::add_eh_frame): New function.
2671 (Target_powerpc::make_glink_section): Call add_eh_frame.
2672
214383dd
ILT
26732013-02-15 Ian Lance Taylor <iant@google.com>
2674
2675 * options.h (DEFINE_uint64_alias): Define.
2676 (class General_options): Add -Ttext-segment as an alias for
2677 -Ttext.
2678
91c2b899
AM
26792013-02-15 Alan Modra <amodra@gmail.com>
2680
2681 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2682 (Stub_table::do_write): ..here, two places.
2683 (Stub_table::plt_call_size): Use it here too.
2684
20e2a8aa
ILT
26852013-02-11 Ian Lance Taylor <iant@google.com>
2686
2687 * descriptors.cc (Descriptors::close_all): New function.
2688 * descriptors.h (class Descriptors): Declare close_all.
2689 (close_all_descriptors): New inline function.
2690 * plugin.cc: Include "descriptors.h".
2691 (Plugin_manager::cleanup): Call close_all_descriptors.
2692
8952bc69
AM
26932013-02-06 Alan Modra <amodra@gmail.com>
2694
2695 * README: Update coding style link.
2696
29bd8b6b
CC
26972013-01-28 Cary Coutant <ccoutant@google.com>
2698
a4034750
AM
2699 * dwp.cc (File_list): New typedef.
2700 (Dwo_name_info_reader): New class.
2701 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2702 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2703 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2704 (Dwo_file::read_executable): New function.
2705 (Dwo_file::read): Move common setup code to ...
2706 (Dwo_file::make_object): ... here.
2707 (dwp_options): Add --exec/-e.
2708 (usage): Likewise.
2709 (main): Likewise.
29bd8b6b 2710
c6ac678d
ST
27112013-01-24 Sriraman Tallam <tmsriram@google.com>
2712
2713 * layout.cc (Layout::layout): Check for option text_reorder.
2714 (Layout::make_output_section): Ditto.
2715 * options.h (text_reorder): New option.
2716 * output.cc (Input_section_sort_compare): Remove special ordering
2717 of section names.
2718 (Output_section::
2719 Input_section_sort_section_name_special_ordering_compare::
2720 operator()): New function.
2721 (Output_section::sort_attached_input_sections): Use new sort function
2722 for .text.
2723 * output.h (Input_section_sort_section_name_special_ordering_compare):
2724 New struct.
2725 * testsuite/Makefile.am (text_section_grouping): Test option
2726 --no-text-reorder
2727 * testsuite/Makefile.in: Regenerate.
2728 * testsuite/text_section_grouping.sh: Check order of functions without
2729 default text reordering.
2730
50701cc1
MF
27312013-01-18 Mike Frysinger <vapier@gentoo.org>
2732
2733 * options.h (General_options): Change default to true for new_dtags.
2734
b1b00fcc
MF
27352013-01-18 Mike Frysinger <vapier@gentoo.org>
2736
2737 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2738 when enable_new_dtags is false. Only add DT_RUNPATH when
2739 enable_new_dtags is true.
2740
ec5b8187
AM
27412013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2742
2743 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2744 used in declaration and definition consistent.
2745 (Target_powerpc::symval_for_branch): Ditto.
2746
a880d4c4
ST
27472013-01-16 Sriraman Tallam <tmsriram@google.com>
2748
2749 * testsuite/plugin_final_layout.cc: Fix comment.
2750
7c381248
ST
27512013-01-16 Sriraman Tallam <tmsriram@google.com>
2752
2753 * layout.cc (Layout::layout): Do not do default sorting for
2754 text sections when section ordering is specified.
2755 (make_output_section): Ditto.
2756 * testsuite/plugin_final_layout.cc: Name the function sections
2757 to catch reordering issues.
2758
e2458743
AM
27592013-01-15 Alan Modra <amodra@gmail.com>
2760
2761 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2762 plt-thread-safe.
2763
431ed302
AM
27642013-01-15 Alan Modra <amodra@gmail.com>
2765
2766 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2767 * testsuite/Makefile.in: Regenerate.
2768
0ec6429b
AM
27692013-01-14 Alan Modra <amodra@gmail.com>
2770
2771 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2772 * testsuite/Makefile.in: Regenerate.
2773
0bf402d5
ILT
27742013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2775
36af3926 2776 PR bfd/14430
0bf402d5
ILT
2777 Fix mingw gold build with plugins enabled
2778 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2779 * configure.ac: Export DLOPEN_LIBS and add headers check.
2780 * plugin.cc: Handle non-dlfcn case.
2781 * Makefile.in: Regenerate.
2782 * config.in: Regenerate.
2783 * configure: Regenerate.
2784 * testsuite/Makefile.in: Regenerate.
2785
9e9143bc
ST
27862013-01-09 Sriraman Tallam <tmsriram@google.com>
2787
2788 * output.h (sort_attached_input_sections): Change to be public.
2789 * script-sections.cc
2790 (Output_section_definition::set_section_addresses): Sort
2791 attached input sections according to section order before linker
2792 script assigns section addresses.
2793 (Orphan_output_section::set_section_addresses): Sort
2794 attached input sections according to section order before linker
2795 script assigns section addresses.
2796 * Makefile.am (final_layout.sh): Use a simple linker script to
2797 check if section ordering still works.
2798 * Makefile.in: Regenerate.
2799
679af368
ILT
28002013-01-09 Ben Cheng <bccheng@google.com>
2801
2802 * arm.cc (Target_arm::attributes_accept_div): New function.
2803 (Target_arm::attributes_forbid_div): New function.
2804 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2805 attribute using the same new functions as what bfd/elf32_arm.c
2806 does.
2807
3136a00e
CC
28082013-01-07 Cary Coutant <ccoutant@google.com>
2809
2810 PR gold/14993
2811 * output.cc (Output_section::add_input_section): For incremental
2812 updates, don't track input sections that are allocated from patch
2813 space.
2814
f2a6224b
L
28152013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2816 Ian Lance Taylor <iant@google.com>
2817
2818 PR gold/14897
2819 * configure.ac (--enable-ld): Removed.
2820 (install_as_default): Set to yes only for --enable-gold=default
2821 or --disable-ld.
2822 * configure: Regenerated.
2823
4f46f626
L
28242013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2825
2826 * options.h (General_options): Add -fuse-ld= for GCC linker
2827 option compatibility.
2828
26e4ef59
CC
28292013-01-04 Cary Coutant <ccoutant@google.com>
2830
2831 * configure.ac: Fix typo restoring CXXFLAGS.
2832 * configure: Regenerate.
2833
3d587466
CC
28342013-01-04 Cary Coutant <ccoutant@google.com>
2835
4f46f626
L
2836 * testsuite/Makefile.am (CXXLINK_S): New macro.
2837 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2838 * testsuite/Makefile.in: Regenerate.
3d587466 2839
44db6695
L
28402013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2841
2842 * version.cc (print_version): Update copyright year to 2013.
2843
edcac0c1
ILT
28442012-12-20 Ian Lance Taylor <iant@google.com>
2845
2846 * layout.cc (Layout::special_ordering_of_input_section): New
2847 function.
2848 (Layout::layout): If input section requires special ordering, must
2849 sort input sections.
2850 (Layout::make_output_section): May sort .text input sections.
2851 (Layout::is_section_name_prefix_grouped): Remove.
2852 * layout.h (class Layout): Declare
2853 special_ordering_of_input_section. Don't declare
2854 is_section_name_prefix_grouped.
2855 * output.cc (Output_section::add_input_section): Revert last
2856 change.
2857 (Output_section::Input_section_sort::match_file_name): Don't crash
2858 if called on output section data.
2859 (Output_section::Input_section_sort_compare): Sort based on
2860 special ordering.
2861 (Output_section::Input_section_sort_section_order_index_compare):
2862 Revert last patch.
2863 (Output_section::sort_attached_input_sections): Likewise.
2864
28f2a4ac
ST
28652012-12-18 Sriraman Tallam <tmsriram@google.com>
2866
edcac0c1 2867 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2868 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2869 * output.cc (Output_section::add_input_section): Check if section
2870 name contains special prefix. Keep input sections to sort such
2871 sections.
2872 (Output_section::Input_section_sort_section_order_index_compare
2873 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2874 (Output_section::sort_attached_input_sections): Add condition to
2875 Input_section_entry constructor call.
28f2a4ac
ST
2876 * testsuite/Makefile.am (text_section_grouping): New test.
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/text_section_grouping.cc: New file.
2879 * testsuite/text_section_grouping.sh: New file.
2880
5bf135a7
NC
28812012-12-17 Nick Clifton <nickc@redhat.com>
2882
2883 * Makefile.am: Add copyright notice.
2884 * NEWS: Likewise.
2885 * README: Likewise.
2886 * configure.ac: Likewise.
2887 * ftruncate.c: Likewise.
2888 * Makefile.in: Regenerate.
2889
59965708
CC
28902012-12-14 Cary Coutant <ccoutant@google.com>
2891
a4034750
AM
2892 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2893 --no-as-needed flag.
2894 (exception_separate_shared_12_test): Likewise.
2895 (incremental_copy_test): Likewise.
2896 * testsuite/Makefile.in: Regenerate.
59965708 2897
2a77e2ab
CC
28982012-12-14 Cary Coutant <ccoutant@google.com>
2899
2900 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2901 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2902
e3deeb9c
AM
29032012-12-12 Alan Modra <amodra@gmail.com>
2904
2905 * powerpc.cc (class Track_tls): New.
2906 (class Relocate, class Scan): Inherit Track_tls.
2907 (Target_powerpc::Scan::local, global): Track tls optimization
2908 and avoid creating plt entry for __tls_get_addr if all uses
2909 are optimized away.
2910 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2911
d8f5a274
AM
29122012-12-12 Alan Modra <amodra@gmail.com>
2913
2914 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2915 Replace no_toc_optimize with toc_optimize.
2916 * output.h (Output_section::input_sections): Provide non-const variant.
2917 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2918 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2919 accessors.
2920 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2921 (class Sort_toc_sections): New.
2922 (Target_powerpc::do_finalize_sections): Sort toc sections.
2923 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2924
4c8a1de1
RM
29252012-12-10 Roland McGrath <mcgrathr@google.com>
2926
2927 * testsuite/binary_unittest.cc (read_all): New function.
2928 (Sized_binary_test): Use it instead of ::read.
2929 * fileread.cc (do_read): Don't assume pread always reads the whole
2930 amount in a single call.
2931
edc27beb
AM
29322012-12-10 Alan Modra <amodra@gmail.com>
2933
2934 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2935 Set EM_PPC64 or EM_PPC here.
2936 (Target_selector_powerpc::do_recognize): Delete.
2937
906b9150
AM
29382012-12-10 Alan Modra <amodra@gmail.com>
2939
2940 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2941 stub_table_.
2942 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2943
418c15ae
RM
29442012-12-07 Roland McGrath <mcgrathr@google.com>
2945
2946 * testsuite/binary_unittest.cc (Sized_binary_test):
2947 Use open_descriptor rather than ::open.
2948
decdd3bc
AM
29492012-12-07 Alan Modra <amodra@gmail.com>
2950
2951 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2952 typedef and invalid_address constant.
2953 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2954 instantiate constants.
2955
db399005
ILT
29562012-12-06 Roland McGrath <mcgrathr@google.com>
2957
2958 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2959 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2960 * aclocal.m4: Regenerate.
2961 * configure: Regenerate.
2962 * Makefile.in: Regenerate.
2963 * testsuite/Makefile.in: Regenerate.
2964
aba6bc71
AM
29652012-12-07 Alan Modra <amodra@gmail.com>
2966
2967 * options.h (General_options): Add no_toc_optimize.
2968 * powerpc.cc (ok_lo_toc_insn): New function.
2969 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2970
9e69ed50
AM
29712012-12-06 Alan Modra <amodra@gmail.com>
2972
2973 * options.h (General_options): Add plt_align, plt_static_chain,
2974 plt_thread_safe. Update stub_group_size help text.
2975 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2976 for new plt_thread_safe_ var.
2977 (use_plt_offset): Correct comments.
2978 (Target_powerpc::do_relax): Look for thread creation symbols to
2979 determine default plt_thread_safe value. Clear plt call stubs
2980 as well as branch stubs each iteration.
2981 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2982 insn constants.
2983 (l, hi, ha, write_insn): Move earlier.
2984 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2985 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2986 plt stubs too.
2987 (Stub_table::update_size): Adjust.
2988 (Stub_table::prev_size, set_prev_size): Delete.
2989 (Stub_table::stub_align): Let --plt-align affect result.
2990 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2991 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2992 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2993 (Stub_table::do_write): Support more stub variants.
2994
f43ba157
AM
29952012-12-04 Alan Modra <amodra@gmail.com>
2996
2997 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2998 (Target_powerpc::do_define_standard_symbols): New function.
2999
34171bc5
AM
30002012-12-03 Alan Modra <amodra@gmail.com>
3001
3002 * output.h: Formatting, whitespace.
3003
dc9589e9 30042012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3005
3006 * layout.h (Layout::get_executable_sections): Declare.
3007 * layout.cc (Layout::get_executable_sections): New function.
3008 * arm.cc (Target_arm::group_sections): Use it.
3009 (Arm_output_section::group_sections): Delete now redundant test.
3010 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3011 param to handle relative relocs.
3012 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3013 (Output_data_reloc::add_absolute): Adjust.
3014 (Output_data_reloc::add_relative): New function.
3015 (Output_data::reset_data_size): New function.
3016 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3017 (Output_section::set_addralign): New function.
3018 (Output_section::checkpoint_set_addralign): New function.
3019 (Output_section::clear_section_offsets_need_adjustment): New function.
3020 (Output_section::input_sections): Make public.
3021 * powerpc.cc (class Output_data_brlt_powerpc): New.
3022 (class Stub_table, class Stub_control): New.
3023 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3024 stub_table_, set_stub_table, stub_table): New vectors and accessor
3025 functions.
3026 (Target_powerpc::do_may_relax, do_relax, push_branch,
3027 new_stub_table, stub_tables, brlt_section, group_sections,
3028 add_branch_lookup_table, find_branch_lookup_table,
3029 write_branch_lookup_table, make_brlt_section): New functions.
3030 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3031 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3032 branch_info_): New vars.
3033 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3034 make call stubs here.
3035 (Output_data_glink): Remove all call stub handling from this class.
3036 (Target_powerpc::Scan::local, global): Save interesting branch
3037 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3038 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3039 functions on final link.
3040 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3041 Handle long branch destinations too.
3042 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3043 do_plt_address_for_local): Adjust lookup of plt call stubs.
3044
627b30b7
AM
30452012-11-30 Alan Modra <amodra@gmail.com>
3046
3047 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3048 relocs against protected symbols when building 32-bit shared libs.
3049
40b469d7
AM
30502012-11-30 Alan Modra <amodra@gmail.com>
3051
3052 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3053 param. Call got_section() to make .got. Update all callers
3054 and their callers and so on.
3055
bb66a627
AM
30562012-11-30 Alan Modra <amodra@gmail.com>
3057
3058 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3059 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3060 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3061 value if it already exists.
3062
d2cf1c6c
L
30632012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3064
3065 PR gold/14858
3066 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3067
edccdf7c
RM
30682012-11-14 Roland McGrath <mcgrathr@google.com>
3069
3070 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3071 than bfc instruction for data sandboxing.
3072
6febeb74
AM
30732012-11-08 Alan Modra <amodra@gmail.com>
3074
3075 * po/POTFILES.in: Regenerate.
3076
0a6f1bf2
AM
30772012-11-05 Alan Modra <amodra@gmail.com>
3078
3079 * configure.ac: Apply 2012-09-10 change to config.in here.
3080 * configure: Regenerate.
3081
26a4e9cb
AM
30822012-11-05 Alan Modra <amodra@gmail.com>
3083
3084 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3085 (struct Opd_ent): Use "Address" rather than "Offset".
3086 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3087 (Target_powerpc::got_section): Make public.
3088 (Target_powerpc::scan_relocs): Move code setting symbols..
3089 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3090 Create _SDA_BASE_ only when referenced.
3091
cc928013
RM
30922012-11-02 Roland McGrath <mcgrathr@google.com>
3093
3094 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3095 from last change.
3096
50ed5eb1
RM
30972012-11-01 Roland McGrath <mcgrathr@google.com>
3098
62fe925a
RM
3099 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3100 for offset_in_output_section parameter.
3101 (Sized_target::relocate_special_relocatable): Likewise.
3102 * arm.cc (Target_arm::relocate_relocs): Likewise.
3103 (Target_arm::relocate_special_relocatable): Likewise.
3104 * i386.cc (Target_i386::relocate_relocs): Likewise.
3105 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3106 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3107 * target-reloc.h (relocate_relocs): Likewise.
3108 * testsuite/testfile.cc (Target_test): Likewise.
3109 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3110 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3111
3112 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3113 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3114
3115 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3116 parameter, which is unused in the [!F_SETFD] case.
3117
50ed5eb1
RM
3118 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3119 SYMNDX to off_t before comparing it to this->data_size().
3120 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3121 * incremental.cc (Output_section_incremental_inputs::do_write):
3122 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3123
2cadc0bf
RM
3124 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3125
3bfcb652
NC
31262012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3127
3128 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3129 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3130 in EABI_VER5.
3131
c1a8d56e
CC
31322012-10-29 Cary Coutant <ccoutant@google.com>
3133
3134 * dwp.cc (usage): Add file and exit status parameters;
3135 add --help and --version options.
3136 (print_version): New function.
3137 (main): Add --help and --version options.
3138
b2490a7b
L
31392012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3140
3141 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3142 final_layout_sequence.txt.
3143 * testsuite/Makefile.in: Regenerated.
3144
aa543512
L
31452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3146
3147 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3148 COMPILE generated by automake.
3149 (LINK1): Likewise.
3150 (CXXCOMPILE1): Likewise.
3151 (CXXLINK1): Likewise.
3152 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3153 (LINK): Likewise.
3154 (CXXCOMPILE): Likewise.
3155 (CXXLINK): Likewise.
3156 * testsuite/Makefile.in: Regenerated.
3157
d361fafb
L
31582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3159
3160 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3161 on bad fwrite return.
3162
598c7410
L
31632012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3164
3165 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3166 on val.
3167
35c813e2
CC
31682012-10-23 Cary Coutant <ccoutant@google.com>
3169
3170 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3171 * testsuite/Makefile.in: Regenerate.
3172 * testsuite/dwp_test.h: New source file.
3173 * testsuite/dwp_test_1.cc: New source file.
3174 * testsuite/dwp_test_1.s: New source file.
3175 * testsuite/dwp_test_1.sh: New source file.
3176 * testsuite/dwp_test_1b.cc: New source file.
3177 * testsuite/dwp_test_1b.s: New source file.
3178 * testsuite/dwp_test_2.cc: New source file.
3179 * testsuite/dwp_test_2.s: New source file.
3180 * testsuite/dwp_test_2.sh: New source file.
3181 * testsuite/dwp_test_main.cc: New source file.
3182 * testsuite/dwp_test_main.s: New source file.
3183
77429909
CC
31842012-10-23 Cary Coutant <ccoutant@google.com>
3185
3186 * dwp.h: New header file.
3187 * dwp.cc: New source file.
3188 * gold.h: Move shared declarations to system.h.
3189 * system.h: New header file.
3190 * Makefile.am: Add dwp.
3191 * Makefile.in: Regenerate.
3192
ed5d6712
CC
31932012-10-23 Cary Coutant <ccoutant@google.com>
3194
3195 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3196 Dwarf_info_reader::read_from_pointer.
3197 (Dwarf_pubnames_table::read_header): Likewise.
3198 (Dwarf_pubnames_table::next_name): Likewise.
3199 (Dwarf_die::read_attributes): Likewise.
3200 (Dwarf_die::skip_attributes): Likewise.
3201 (Dwarf_info_reader::read_from_pointer): New function template.
3202 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3203 (Dwarf_pubnames_table): Likewise.
3204 (Dwarf_info_reader::read_from_pointer): New function template.
3205 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3206 Dwarf_pubnames_table ctor.
3207
8787852d
CC
32082012-10-23 Cary Coutant <ccoutant@google.com>
3209
3210 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3211 abbrev_shndx.
3212 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3213 abbrev_shndx_.
3214 (Dwarf_info_reader::set_abbrev_shndx): New method.
3215 (Dwarf_info_reader::abbrev_shndx_): New data member.
3216
9fc236f3
CC
32172012-10-23 Cary Coutant <ccoutant@google.com>
3218
3219 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3220 from object, not parameters.
3221 (Dwarf_info_reader::parse): Likewise.
3222 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3223 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3224 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3225 methods.
3226
effe8365
CC
32272012-10-23 Cary Coutant <ccoutant@google.com>
3228
3229 * fileread.cc (Input_file::Input_file): New constructor.
3230 * fileread.h (class Input_file): Add new constructor.
3231
1698990d
AM
32322012-10-18 Alan Modra <amodra@gmail.com>
3233
3234 PR gold/14727
3235 * object.cc (Relobj::is_section_name_included): Also match
3236 .sdata personality section.
3237
168a4726
AM
32382012-10-18 Alan Modra <amodra@gmail.com>
3239
3240 * target-reloc.h (class Default_comdat_behavior): New, package up..
3241 (get_comdat_behaviour): ..this.
3242 (relocate_section): Add Relocate_comdat_behavior template arg,
3243 adjust code to suit.
3244 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3245 (Target_arm::scan_reloc_section): Likewise.
3246 * i386.cc (Target_i386::relocate_section): Likewise.
3247 * sparc.cc (Target_sparc::relocate_section): Likewise.
3248 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3249 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3250 * powerpc.cc (class Relocate_comdat_behavior): New.
3251 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3252 gold::relocate_section with new template arg.
3253
acc276d8
AM
32542012-10-18 Alan Modra <amodra@gmail.com>
3255
3256 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3257 dynamic relocs for GOT_TPREL got entries, without symbol if
3258 resolving locally.
3259 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3260 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3261 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3262
e10f9870
AM
32632012-10-17 Alan Modra <amodra@gmail.com>
3264
3265 PR gold/14726
3266 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3267
ae034989
ST
32682012-10-16 Sriraman Tallam <tmsriram@google.com>
3269
3270 * layout.cc (Layout::include_section): Keep sections marked
3271 SHF_EXCLUDE when doing relocatable links.
3272
f3a0ed29
AM
32732012-10-16 Alan Modra <amodra@gmail.com>
3274
3275 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3276 (Target_powerpc::do_finalize_sections): Call it.
3277 (Output_data_save_res): New class and supporting functions.
3278 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3279 normal symbols defined in object files.
3280
c6de8ed4
AM
32812012-10-12 Alan Modra <amodra@gmail.com>
3282
3283 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3284 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3285 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3286 section if scan_opd_relocs not yet called.
3287 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3288
03e25981
AM
32892012-10-12 Alan Modra <amodra@gmail.com>
3290
3291 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3292 add_local_ifunc_entry): Revert last change.
3293 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3294
c9824451
AM
32952012-10-05 Alan Modra <amodra@gmail.com>
3296
3297 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3298 do_plt_address_for_global): New functions.
3299 (Output_data_got_powerpc::do_write): Don't segfault when linking
3300 statically.
3301 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3302 add_local_ifunc_entry): Return true on adding entry..
3303 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3304 glink->add_entry call. Remove unused symtab param. Adjust calls.
3305 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3306 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3307 set up symbols here.
3308 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3309 syms here. Do so even when no .iplt. Don't segfault when linking
3310 statically.
3311 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3312 new variants without reloc param.
3313 (Glink_sym_ent::Glink_sym_ent): Likewise.
3314 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3315 reloc when refs will resolve to plt call stub.
3316 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3317 R_PPC_PLTREL24 to resolve locally.
3318 (Target_powerpc::Scan::global): Correct ifunc handling.
3319 (Target_powerpc::Relocate::relocate): Correct local sym glink
3320 lookup. Don't destroy "value" when we have a plt call stub,
3321 and when checking plt call validity.
3322 (Target_powerpc::do_dynsym_value): Simplify.
3323
19fec8c1
AM
33242012-10-05 Alan Modra <amodra@gmail.com>
3325
3326 * i386.cc (Output_data_plt_i386::address_for_global,
3327 address_for_local): Add plt offset to returned value. Adjust uses.
3328 * sparc.cc (Output_data_plt_sparc::address_for_global,
3329 address_for_local): Likewise.
3330 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3331 address_for_local): Likewise.
3332 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3333 address_for_local): Likewise.
3334 * target.h (Target::plt_address_for_global, plt_address_for_local):
3335 Update comment.
3336 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3337 (Output_data_got::Got_entry::write): Nor here.
3338 * output.h: Comment fix.
3339
e867b647
WL
33402012-10-02 Jiong Wang <jiwang@tilera.com>
3341
3342 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3343 global_offset_table_ value for larget got.
3344 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3345
e5d5f5ed
AM
33462012-09-29 Alan Modra <amodra@gmail.com>
3347
3348 * powerpc.cc (Target_powerpc::iplt_): New output section.
3349 (Target_powerpc::iplt_section, make_iplt_section,
3350 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3351 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3352 Target_powerpc::plt_entry_count): Count iplt entries too.
3353 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3354 reloc section in constructor. New params.
3355 (Target_powerpc::make_plt_section): Create reloc section here instead.
3356 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3357 functions.
3358 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3359 (Output_data_glink::add_entry, find_entry): New functions to
3360 deal with local syms.
3361 (Glink_sym_ent): Add support for local syms.
3362 (Output_data_glink::do_write): Handle ifunc plt entries.
3363 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3364 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3365 (Target_powerpc::Relocate::relocate): Likewise.
3366 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3367
ec4dbad3
AM
33682012-09-25 Alan Modra <amodra@gmail.com>
3369
3370 * object.h (Sized_relobj_file::adjust_local_symbol,
3371 do_adjust_local_symbol): New functions.
3372 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3373 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3374 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3375 and irregular opd entry spacing.
3376 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3377 (Global_symbol_visitor_opd): New functor.
3378 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3379 on deleted opd entries.
3380
5c0b3823
WL
33812012-09-15 Jiong Wang <jiwang@tilera.com>
3382
3383 * tilegx.cc: New file.
3384 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3385 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3386 * configure.tgt: Add entries for tilegx*.
3387 * configure.ac: Likewise.
3388 * Makefile.in: Rebuild.
3389 * configure: Likewise.
3390 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3391 tilegx.
3392
bfdfa4cd
AM
33932012-09-13 Alan Modra <amodra@gmail.com>
3394
3395 * target-reloc.h (scan_relocs): Call scan.local for relocs
3396 against symbols in discarded sections. Pass is_discarded
3397 param.
3398 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3399 Add is_discarded param.
3400 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3401 is_discarded to flag opd entry as discarded. Don't emit dyn
3402 relocs on such entries.
3403 (Target_powerpc::Scan::global): Similarly detect and handle
3404 such opd entries.
3405 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3406 opd_ent_. Update all uses.
3407 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3408 (Target_powerpc::relocate_section): Zero out discarded opd
3409 entry relocs.
3410
d77a0555
ILT
34112012-09-12 Ian Lance Taylor <iant@google.com>
3412
3413 PR gold/14570
3414 * output.cc: Rename Output_data_got template parameter from size
3415 to got_size for all functions. Compile all variants of
3416 Output_data_got.
3417 (Output_data_got::Got_entry::write): Correct use of size for
3418 symbol value. Use local_is_tls rather than casting to
3419 Sized_relobj_file.
3420 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3421 (class Sized_relobj_file): Add do_local_is_tls.
3422 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3423
815a1205
AM
34242012-09-11 Alan Modra <amodra@gmail.com>
3425
3426 PR gold/14566
3427 * layout.cc (Layout::set_segment_offsets): When using
3428 common-page-size alignment, ensure we are on a new max-page-size
3429 page.
3430 * output.cc (Output_segment::set_section_addresses): Use
3431 abi_pagesize, not common_pagesize for relro boundary.
3432 (Output_segment::set_offset): Likewise.
3433
bd73a62d
AM
34342012-09-11 Alan Modra <amodra@gmail.com>
3435
3436 * output.h (Output_data_got::add_global_tls, add_local_tls,
3437 add_local_tls_pair): New functions.
3438 (Output_data_got::add_local_pair_with_rel): Remove second
3439 reloc param. Expand comment.
3440 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3441 use_plt_or_tls_offset_, similarly for constructor param.
3442 (Output_data_got::Got_entry::write): Add got_index param.
3443 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3444 add_local_tls_pair): New functions.
3445 (Output_data_got::Got_entry::write): Handle tls symbols
3446 with use_plt_or_tls_offset_ set specially.
3447 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3448 (Output_data_got::do_write): Replace iterator with index, pass
3449 index to entry write function.
3450 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3451 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3452 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3453 call.
3454 * i386.cc (Target_i386::Scan::local): Likewise.
3455 * sparc.cc (Target_sparc::Scan::local): Likewise.
3456 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3457 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3458 do_tls_offset_for_global): New functions.
3459 (Target_powerpc::Scan::local): Correct TLS relocations and got
3460 entry values.
3461 (Target_powerpc::Scan::global): Don't emit unnecessary
3462 dynamic relocations on TLS GOT entries.
3463
00716ab1
AM
34642012-09-10 Matthias Klose <doko@ubuntu.com>
3465
3466 * config.in: Disable sanity check for kfreebsd.
3467
c891b3f9
SA
34682012-09-10 Sterling Augustine <saugustine@google.com>
3469
3470 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3471 (Gdb_index::pubtypes_read): New parameter.
3472 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3473 to calls.
3474 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3475 pubtypes_object_.
3476
e81fea4d
AM
34772012-09-09 Alan Modra <amodra@gmail.com>
3478
3479 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3480 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3481 * gc.h (gc_process_relocs): Call target gc_add_reference.
3482 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3483 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3484 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3485 unnecessary cast.
3486 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3487 to cater for when we don't need code offset. Update use.
3488 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3489 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3490 set_opd_valid): New functions.
3491 (Target_powerpc::do_gc_add_reference): New function.
3492 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3493 stashed refs.
3494 (Target_powerpc::do_gc_mark_symbol): New function.
3495
d2d60eef
CC
34962012-09-06 Cary Coutant <ccoutant@google.com>
3497
3498 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3499 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3500 (Dwarf_die::skip_attributes): Likewise.
3501 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3502 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3503 (main): Call it.
3504 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3505
32ed4573
L
35062012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3507
3508 * testsuite/script_test_3.t: Add .got.plt output section
3509 statement.
3510 * testsuite/script_test_4.t: Likewise.
3511
f4baf0d4
AM
35122012-09-05 Alan Modra <amodra@gmail.com>
3513
3514 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3515 update all uses and lose "enum" when using type.
3516
864a1b56
AM
35172012-09-05 Alan Modra <amodra@gmail.com>
3518
3519 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3520 * configure: Regenerate.
3521 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3522 (plugin_final_layout.stdout): Likewise.
3523 (memory_test): Set page sizes to 0x1000.
3524 * testsuite/Makefile.in: Regenerate.
3525 * testsuite/discard_locals_test.sh: Add FIXME comment.
3526 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3527 * testsuite/pr14265.t: Add .got output section statement.
3528 * testsuite/script_test_2.t: Likewise.
3529 * testsuite/script_test_3.t: Likewise.
3530 * testsuite/script_test_4.t: Likewise.
3531 * testsuite/script_test_5.t: Likewise.
3532 * testsuite/script_test_6.t: Likewise.
3533 * testsuite/script_test_7.t: Likewise.
3534 * testsuite/script_test_9.t: Likewise.
3535
3ea0a085
AM
35362012-09-05 Alan Modra <amodra@gmail.com>
3537
3538 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3539 (Powerpc_relocate_functions::Status): New typedef.
3540 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3541 (Target_powerpc::Scan::local): Handle REL64.
3542 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3543 for REL32 and REL64.
3544 (Target_powerpc::symval_for_branch): New function, extracted from..
3545 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3546 checks. Report overflow errors.
3547
7404fe1b
AM
35482012-09-05 Alan Modra <amodra@gmail.com>
3549
3550 * object.h (Sized_relobj_file::emit_relocs): Delete.
3551 (Sized_relobj_file::emit_relocs_reltype): Delete.
3552 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3553 relocate_relocs for --emit-relocs.
3554 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3555 * output.h: Update comment.
3556 (Output_segment::first_section): New function.
3557 (Output_segment::first_section_load_address): Use first_section.
3558 * output.cc (Output_segment::first_section): New function extracted..
3559 (Output_segment::first_section_load_address): ..from here. Delete.
3560 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3561 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3562 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3563 adjust call to target.h function.
3564 * i386.cc (Target_i386): Likewise.
3565 * sparc.cc (Target_sparc): Likewise.
3566 * x86_64.cc (Target_x86_64): Likewise.
3567 * powerpc.cc (Target_powerpc): Likewise.
3568 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3569 first tls section has section symbol for optimised local dynamic
3570 output relocs.
3571 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3572 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3573 optimised tls code.
3574 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3575 Rename to relocate_relocs. Update error message.
3576
957564c9
AS
35772012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3578
3579 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3580 --just-symbols.
3581
dd93cd0a
AM
35822012-08-31 Alan Modra <amodra@gmail.com>
3583
3584 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3585 (Powerpc_relobj::toc_base_offset): New stub function.
3586 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3587 got_mod_index_offset to tlsld_got_offset. Update all refs.
3588 (Target_powerpc::Relocate::enum skip_tls): New.
3589 (Target_powerpc::call_tls_get_addr_): New var.
3590 (Target_powerpc::is_branch_reloc): Move to file scope.
3591 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3592 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3593 New functions.
3594 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3595 (powerpc_info): Correct common_pagesize for ppc64.
3596 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3597 (Powerpc_relocate_functions): Add overflow check enums and functions.
3598 Add non-shift version of rela, rela_ua. Delete all rel public
3599 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3600 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3601 addr16_ha3, addr14 functions.
3602 (Output_data_got_powerpc::add_constant_pair): New function.
3603 (Output_data_got_powerpc::got_base_offset): Likewise.
3604 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3605 (instruction constants): Sort, add some more.
3606 (Output_data_glink::do_write): Add and use Address typedef. Use
3607 object->toc_base_offset() stub for 64-bit.
3608 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3609 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3610 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3611 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3612 Always treat .opd relocs as against locally defined symbol.
3613 Correct condition for RELATIVE relocs.
3614 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3615 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3616 for 32-bit syms with a plt entry. Correct ppc64 toc base
3617 calculations. Handle TLS relocs, and more. Add overflow
3618 checking and adjust for Powerpc_relocate_functions changes.
3619 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3620 Reinstate --emit-relocs code with FIXME.
3621
a1373b60
AM
36222012-08-30 Alan Modra <amodra@gmail.com>
3623
3624 * layout.cc (Layout::set_segment_offsets): Set p_align to
3625 abi_pagesize, not common_pagesize.
3626 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3627 to determine whether file header can go in segment.
3628
703d02da
AM
36292012-08-30 Alan Modra <amodra@gmail.com>
3630
3631 * output.h (Output_reloc::Output_reloc <output section>): Add
3632 is_relative param. Adjust calls.
3633 (Output_reloc::add_output_section_relative): New functions.
3634 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3635 is_relative.
3636 (Output_reloc::symbol_value): Handle SECTION_CODE.
3637
16164a6b
ST
36382012-08-24 Sriraman Tallam <tmsriram@google.com>
3639
3640 * gold.cc (queue_middle_tasks): Call layout again when unique
3641 segments for sections is desired.
3642 * layout.cc (Layout::Layout): Initialize new members.
3643 (Layout::get_output_section_flags): New function.
3644 (Layout::choose_output_section): Call get_output_section_flags.
3645 (Layout::layout): Make output section for mapping to a unique segment.
3646 (Layout::insert_section_segment_map): New function.
3647 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3648 output sections marked so.
16164a6b
ST
3649 (Layout::segment_precedes): Check for unique segments when sorting.
3650 * layout.h (Layout::Unique_segment_info): New struct.
3651 (Layout::Section_segment_map): New typedef.
3652 (Layout::insert_section_segment_map): New function.
3653 (Layout::get_output_section_flags): New function.
3654 (Layout::is_unique_segment_for_sections_specified): New function.
3655 (Layout::set_unique_segment_for_sections_specified): New function.
3656 (Layout::unique_segment_for_sections_specified_): New member.
3657 (Layout::section_segment_map_): New member.
3658 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3659 Rename is_gc_pass_one to is_pass_one.
3660 Rename is_gc_pass_two to is_pass_two.
3661 Rename is_gc_or_icf to is_two_pass.
3662 Check for which pass based on whether symbols data is present.
3663 Make it two pass when unique segments for sections is desired.
3664 * output.cc (Output_section::Output_section): Initialize new
3665 members.
3666 * output.h (Output_section::is_unique_segment): New function.
3667 (Output_section::set_is_unique_segment): New function.
3668 (Output_section::is_unique_segment_): New member.
3669 (Output_section::extra_segment_flags): New function.
3670 (Output_section::set_extra_segment_flags): New function.
3671 (Output_section::extra_segment_flags_): New member.
3672 (Output_section::segment_alignment): New function.
3673 (Output_section::set_segment_alignment): New function.
3674 (Output_section::segment_alignment_): New member.
3675 (Output_segment::Output_segment): Initialize is_unique_segment_.
3676 (Output_segment::is_unique_segment): New function.
3677 (Output_segment::set_is_unique_segment): New function.
3678 (Output_segment::is_unique_segment_): New member.
3679 * plugin.cc (allow_unique_segment_for_sections): New function.
3680 (unique_segment_for_sections): New function.
3681 (Plugin::load): Add new functions to transfer vector.
3682 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3683 * Makefile.in: Regenerate.
3684 * testsuite/plugin_final_layout.sh: Check if unique segment
3685 functionality works.
3686 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3687 are available.
3688 (allow_unique_segment_for_sections): New global.
3689 (unique_segment_for_sections): New global.
3690 (claim_file_hook): Call allow_unique_segment_for_sections.
3691 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3692
1e2bee4f
CC
36932012-08-22 Cary Coutant <ccoutant@google.com>
3694
3695 * layout.cc (Layout::include_section): Don't assert on GROUP
3696 sections with --emit-relocs.
3697
1d5dfe78
CC
36982012-08-21 Cary Coutant <ccoutant@google.com>
3699
3700 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3701 if --export-dynamic-symbol names an undef symbol.
3702
c9269dff
AM
37032012-08-18 Alan Modra <amodra@gmail.com>
3704
3705 * powerpc.cc: Formatting and white space.
3706 (Powerpc_relobj): Rename got2_section_ to special_.
3707 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3708 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3709 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3710 (Target_powerpc): Add Address typedef and invalid_address. Use
3711 throughout.
3712 (Target_powerpc::is_branch_reloc): New function.
3713 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3714 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3715 for dst_mask, value and addend.
3716 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3717 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3718 (Output_data_glink::do_write): Correct toc base. Don't try to use
3719 uint16_t for 24-bit offset. Use get_output_section_offset and
3720 check return.
3721 (Target_powerpc::Scan::local): Handle more relocs.
3722 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3723 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3724 Plug in toc restoring insn after plt calls. Translate branches
3725 to function descriptor symbols to corresponding entry point.
3726 (Target_powerpc::relocate_for_relocatable): Check return from
3727 get_output_section_offset.
3728 * symtab.h: Comment typo.
3729
b1759dce
ILT
37302012-08-14 Ian Lance Taylor <iant@google.com>
3731
3732 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3733 unsupported_relocal_local to call unsupported_reloc_global.
3734
b9b2ae8b
NC
37352012-08-14 Nick Clifton <nickc@redhat.com>
3736
3737 PR ld/14265
3738 * script-sections.cc (Sections_element::output_section_name): Add
3739 keep return parameter.
3740 (Output_section_element::match_name): Add keep return parameter.
3741 Return the value of the keep_ member.
3742 * script-sections.h (class Output_section): Update
3743 output_section_name prototype.
3744 * layout.cc (Layout::keep_input_section): New public member
3745 function.
3746 (Layout::choose_output_section): Pass keep parameter to
3747 output_section_name.
3748 * layout.h (class Layout): Add keep_input_section.
3749 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3750 sections.
3751 * testsuite/Makefile.am: Add a test.
3752 * testsuite/Makefile.in: Regenerate.
3753 * testsuite/pr14265.c: Source file for the test.
3754 * testsuite/pr14265.t: Linker script for the test.
3755 * testsuite/pr14265.sh: Shell script for the test.
3756
921b5322
AM
37572012-08-14 Alan Modra <amodra@gmail.com>
3758
3759 * target.h (Target::output_section_name): New function.
3760 (Target::do_output_section_name): New function.
3761 * layout.cc (Layout::choose_output_section): Call the above.
3762 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3763
6ce78956
AM
37642012-08-14 Alan Modra <amodra@gmail.com>
3765
3766 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3767 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3768 for replace_constant call.
3769 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3770 (Output_data_glink::do_print_to_mapfile): New function.
3771 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3772 (Target_powerpc::Relocate::relocate): Likewise.
3773
d1a8cabd
AM
37742012-08-14 Alan Modra <amodra@gmail.com>
3775
3776 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3777 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3778 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3779 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3780 all references to shndx_. Handle special case for R_PPC_PLTREL24
3781 here.
3782 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3783 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3784 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3785 here.
3786 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3787 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3788
d83ce4e3
AM
37892012-08-12 Alan Modra <amodra@gmail.com>
3790
3791 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3792 (glink insn constants): Use uint32_t.
3793 (Output_data_glink::add_entry): Use insert, not [] operator.
3794
cf43a2fe
AM
37952012-08-11 Alan Modra <amodra@gmail.com>
3796
3797 * object.h (Sized_relobj_file::find_shdr): New function.
3798 (Sized_relobj_file::find_special_sections): New function.
3799 * object.cc (Sized_relobj_file::find_shdr): New function.
3800 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3801 (Sized_relobj_file::find_special_sections): New function, split out..
3802 (Sized_relobj_file::do_read_symbols): ..from here.
3803 * output.h (Output_data_got::replace_constant): New function.
3804 (Output_data_got::num_entries): New function.
3805 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3806 (Output_data_got::got_offset): Protected rather than private.
3807 (Output_data_got::replace_got_entry): New function.
3808 * output.cc (Output_data_got::replace_got_entry): New function.
3809 * powerpc.cc (class Powerpc_relobj): New.
3810 (class Powerpc_relocate_functions): Delete all psymval variants or
3811 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3812 Implement _ha functions using corresponding _hi function.
3813 (Powerpc_relobj::find_special_sections): New function.
3814 (Target_powerpc::do_make_elf_object): New function.
3815 (class Output_data_got_powerpc): New.
3816 (class Output_data_glink): New.
3817 (class Powerpc_scan_relocatable_reloc): New.
3818 Many more changes througout file.
3819
3c892704
NC
38202012-08-09 Nick Clifton <nickc@redhat.com>
3821
3822 * po/vi.po: Updated Vietnamese translation.
3823
82435b3b
ILT
38242012-08-07 Ian Lance Taylor <iant@google.com>
3825
3826 * layout.cc (Layout::add_target_dynamic_tags): If
3827 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3828 plt_rel.
3829
a6dc81d2
NC
38302012-07-30 Nick Clifton <nickc@redhat.com>
3831
3832 * po/gold.pot: Updated template.
3833 * po/es.po: Updated Spanish translation.
3834
f1415016
CC
38352012-07-18 Cary Coutant <ccoutant@google.com>
3836
3837 PR gold/14344
3838 * configure.ac: Add check for -gpubnames support.
3839 * configure: Regenerate.
3840 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3841 support; force -gno-pubnames.
3842 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3843 support.
3844 (gdb_index_test_4): New test.
3845 * testsuite/Makefile.in: Regenerate.
3846 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3847 * testsuite/gdb_index_test_2.sh: Likewise.
3848 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3849 * testsuite/gdb_index_test_4.sh: New script.
3850 * testsuite/gdb_index_test_comm.sh: New script with common code;
3851 don't look for space after colon.
3852
b7fd7c37
ST
38532012-07-16 Sriraman Tallam <tmsriram@google.com>
3854
3855 * gold.cc (queue_middle_tasks): Update function order only after
3856 deferred objects due to plugins are processed.
3857
1f3212db
ILT
38582012-07-11 Ian Lance Taylor <iant@google.com>
3859
3860 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3861 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3862 (Target_arm::scan_reloc_for_stub): Likewise.
3863 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3864 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3865 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3866 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3867 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3868
81c82a68
ILT
38692012-07-10 Dodji Seketeli <dodji@redhat.com>
3870 Ian Lance Taylor <iant@google.com>
3871
3872 PR gold/14309
3873 * configure.ac: Test whether std::tr1::hash<off_t> works.
3874 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3875 needed.
3876 * output.h (class Output_fill): Add virtual destructor.
3877 * configure, config.in: Rebuild.
3878
eabc84f4
RM
38792012-06-22 Roland McGrath <mcgrathr@google.com>
3880
3881 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3882
370e30b6
RÁE
38832012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3884
3885 * plugin.cc (Plugin::load): Handle position independent executables.
3886
fb1b895d
CC
38872012-06-06 Cary Coutant <ccoutant@google.com>
3888
3889 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3890 add .debug_macro.
3891 (lines_only_debug_sections): Likewise.
3892 (gdb_fast_lookup_sections): New static array.
3893 (is_gdb_debug_section): Rename formal parameter.
3894 (is_lines_only_debug_section): Likewise.
3895 (is_gdb_fast_lookup_section): New function.
3896 (Layout::include_section): Check for ".zdebug_" prefix; pass
3897 section name suffix to is_gdb_debug_section, et al.; check for
3898 fast-lookup sections when building .gdb_index.
3899 * options.h (--strip-debug-gdb): Update GDB version number.
3900
7c0640fa
CC
39012012-06-06 Cary Coutant <ccoutant@google.com>
3902
3903 * configure.ac: Add check for fallocate.
3904 * configure: Regenerate.
3905 * config.in: Regenerate.
3906
3907 * options.h (class General_options): Add --mmap-output-file and
3908 --posix-fallocate options.
3909 * output.cc: (posix_fallocate): Remove; replace with...
3910 (gold_fallocate): New function.
3911 (Output_file::map_no_anonymous): Call gold_fallocate.
3912 (Output_file::map): Check --mmap-output-file option.
3913
2a49eb69
DK
39142012-06-05 Jing Yu <jingyu@google.com>
3915
3916 * gold.h (textdomain): Add do {} to empty while(0).
3917 (bindtextdomain): Likewise.
3918
fad072ac
CC
39192012-06-04 Cary Coutant <ccoutant@google.com>
3920
3921 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3922 has_dynsym_index.
3923
8cc69fb6
ST
39242012-05-25 Sriraman Tallam <tmsriram@google.com>
3925
3926 * symtab.cc (Symbol_table::define_special_symbol):
3927 Initialize *poldsym to prevent uninitialized variable errors.
3928
1be75daa
CC
39292012-05-23 Cary Coutant <ccoutant@google.com>
3930
3931 * layout.cc (Layout::section_name_mapping): Add rules to handle
3932 exact match on .data.rel.ro.local or .data.rel.ro.
3933 (Layout::output_section_name): Check for exact matches.
3934
9b689de0
CC
39352012-05-23 Cary Coutant <ccoutant@google.com>
3936
3937 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3938 more carefully.
3939
b24fdbf5
CC
39402012-05-22 Cary Coutant <ccoutant@google.com>
3941
3942 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3943 object before exporting symbol.
3944
e550e1a2
L
39452012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3946
3947 * testsuite/tls_test.cc: Include "config.h" first.
3948 * testsuite/tls_test_c.c: Likewise.
3949
df7b86aa
NC
39502012-05-17 Daniel Richard G. <skunk@iskunk.org>
3951 Nick Clifton <nickc@redhat.com>
3952
3953 PR 14072
3954 * configure.in: Add check that sysdep.h has been included before
3955 any system header files.
3956 * configure: Regenerate.
3957 * config.in: Regenerate.
3958
1007b503
CC
39592012-05-14 Cary Coutant <ccoutant@google.com>
3960
3961 * layout.cc (Layout::make_output_section): Mark .tdata section
3962 as RELRO.
3963 * testsuite/relro_test.cc: Add a TLS variable.
3964
fd885f3a
L
39652012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3966
3967 PR gold/14091
3968 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3969 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3970 R_X86_64_64.
3971
80f5885c
CC
39722012-05-08 Cary Coutant <ccoutant@google.com>
3973
3974 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3975 (lines_only_debug_sections): Likewise.
3976
2e702c99
RM
39772012-05-02 Roland McGrath <mcgrathr@google.com>
3978
3979 * nacl.cc: New file.
3980 * nacl.h: New file.
3981 * Makefile.am (CCFILES, HFILES): Add them.
3982 * Makefile.in: Regenerate.
3983 * i386.cc (Output_data_plt_i386_nacl): New class.
3984 (Output_data_plt_i386_nacl_exec): New class.
3985 (Output_data_plt_i386_nacl_dyn): New class.
3986 (Target_i386_nacl): New class.
3987 (Target_selector_i386_nacl): New class.
3988 (target_selector_i386): Use it instead of Target_selector_i386.
3989 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3990 (Target_x86_64_nacl): New class.
3991 (Target_selector_x86_64_nacl): New class.
3992 (target_selector_x86_64, target_selector_x32): Use it instead of
3993 Target_selector_x86_64.
3994 * arm.cc (Output_data_plt_arm_nacl): New class.
3995 (Target_arm_nacl): New class.
3996 (Target_selector_arm_nacl): New class.
3997 (target_selector_arm, target_selector_armbe): Use it instead of
3998 Target_selector_arm.
3999
4000 * target-select.cc (select_target): Take new Input_file* and off_t
4001 arguments, pass them on to recognize method of selector.
4002 * object.cc (make_elf_sized_object): Update caller.
4003 * parameters.cc (parameters_force_valid_target): Likewise.
4004 * incremental.cc (make_sized_incremental_binary): Likewise.
4005 * target-select.h: Update decl.
4006 (Target_selector::recognize): Take new Input_file* argument,
4007 pass it on to do_recognize.
4008 (Target_selector::do_recognize): Take new Input_file* argument.
4009 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4010 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4011 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4012 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4013
4014 * target.h (Target::Target_info): New members isolate_execinstr
4015 and rosegment_gap.
4016 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4017 * arm.cc (Target_arm::arm_info): Update initializer.
4018 * i386.cc (Target_i386::i386_info): Likewise.
4019 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4020 * sparc.cc (Target_sparc::sparc_info): Likewise.
4021 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4022 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4023 * layout.cc (Layout::attach_allocated_section_to_segment):
4024 Take new const Target* argument. If target->isolate_execinstr(), act
4025 like --rosegment.
4026 (Layout::find_first_load_seg): Take new const Target* argument;
4027 if target->isolate_execinstr(), reject PF_X segments.
4028 (Layout::relaxation_loop_body): Update caller.
4029 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4030 reset file offset to zero when we hit LOAD_SEG, and then do a second
4031 loop over the segments before LOAD_SEG to reassign offsets after
4032 addresses have been determined. Handle target->rosegment_gap().
4033 (Layout::attach_section_to_segment): Take new const Target* argument;
4034 pass it to attach_allocated_section_to_segment.
4035 (Layout::make_output_section): Update caller.
4036 (Layout::attach_sections_to_segments): Take new const Target* argument;
4037 pass it to attach_section_to_segment.
4038 * gold.cc (queue_middle_tasks): Update caller.
4039 * layout.h (Layout): Update method decls with new arguments.
4040
4041 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4042 Target_info pointer to use.
4043 (Target_arm::do_make_data_plt): New virtual method.
4044 (Target_arm::make_data_plt): New method that calls it.
4045 (Target_arm::make_plt_entry): Use it.
4046 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4047 for the section alignment.
4048 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4049 method.
4050 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4051 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4052 method.
4053 (Output_data_plt_arm::get_plt_entry_size): Call it.
4054 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4055 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4056 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4057 method.
4058 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4059 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4060 method instead of sizeof(plt_entry).
4061 (Output_data_plt_arm::add_entry): Likewise.
4062 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4063 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4064 than static method.
4065 (Target_arm::plt_entry_size): Likewise.
4066 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4067 Move to ...
4068 (Output_data_plt_arm_standard): ... here, new class.
4069 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4070 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4071 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4072
4073 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4074 Take additional argument for the PLT entry size.
4075 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4076 Use get_plt_entry_size method rather than plt_entry_size variable.
4077 (Output_data_plt_x86_64::reserve_slot): Likewise.
4078 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4079 (Output_data_plt_x86_64::add_entry): Likewise.
4080 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4081 (Output_data_plt_x86_64::address_for_global): Likewise.
4082 (Output_data_plt_x86_64::address_for_local): Likewise.
4083 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4084 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4085 Make method non-static.
4086 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4087 method.
4088 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4089 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4090 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4091 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4092 virtual method.
4093 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4094 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4095 virtual method.
4096 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4097 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4098 virtual method.
4099 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4100 (Output_data_plt_x86_64::plt_entry_size)
4101 (Output_data_plt_x86_64::first_plt_entry)
4102 (Output_data_plt_x86_64::plt_entry)
4103 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4104 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4105 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4106 (Output_data_plt_x86_64_standard): ... here, new class.
4107 (Target_x86_64::Target_x86_64): Take optional argument for the
4108 Target_info pointer to use.
4109 (Target_x86_64::do_make_data_plt): New virtual method.
4110 (Target_x86_64::make_data_plt): New method to call it.
4111 (Target_x86_64::init_got_plt_for_update): Use that.
4112 Call this->plt_->add_eh_frame method here.
4113 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4114 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4115 rather than static method.
4116 (Target_x86_64::plt_entry_size): Likewise.
4117 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4118 rather than plt_entry_size variable. Move guts of PLT filling to...
4119 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4120 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4121 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4122
4123 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4124 additional argument for the section alignment.
4125 Don't do add_eh_frame_for_plt here.
4126 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4127 non-static. Use get_plt_entry_size method rather than plt_entry_size
4128 variable.
4129 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4130 method.
4131 (Output_data_plt_i386::get_plt_entry_size): Call it.
4132 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4133 (Output_data_plt_i386::add_eh_frame): New method to call it.
4134 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4135 method.
4136 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4137 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4138 method.
4139 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4140 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4141 method instead of plt_entry_size.
4142 (Output_data_plt_i386::plt_entry_size)
4143 (Output_data_plt_i386::plt_eh_frame_fde_size)
4144 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4145 (Output_data_plt_i386_standard): ... here, new class.
4146 (Output_data_plt_i386_exec): New class.
4147 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4148 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4149 (Output_data_plt_i386::exec_plt_entry): Move to ...
4150 (Output_data_plt_i386_exec::plt_entry): ... here.
4151 (Output_data_plt_i386_dyn): New class.
4152 (Output_data_plt_i386::first_plt_entry): Move to ...
4153 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4154 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4155 (Output_data_plt_i386_dyn::plt_entry): ... here.
4156 (Target_i386::Target_i386): Take optional argument for the Target_info
4157 pointer to use.
4158 (Target_i386::do_make_data_plt): New virtual method.
4159 (Target_i386::make_data_plt): New method to call it.
4160 (Target_i386::make_plt_section): Use that.
4161 Call this->plt_->add_eh_frame method here.
4162 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4163 rather than plt_entry_size variable.
4164 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4165 (Output_data_plt_i386::address_for_local): Likewise.
4166 (Output_data_plt_i386::do_write): Likewise.
4167 Move guts of PLT filling to...
4168 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4169 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4170 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4171 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4172
b9b9f2ee
CC
41732012-05-01 Cary Coutant <ccoutant@google.com>
4174
4175 * dwarf_reader.cc (Dwarf_die::read_attributes)
4176 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4177 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4178 * reduced_debug_output.cc
4179 (Output_reduced_debug_info_section::get_die_end): Remove
4180 DW_FORM_GNU_ref_index. Add default case.
4181
57923f48
MW
41822012-04-26 Mark Wielaard <mjw@redhat.com>
4183
4184 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4185 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4186 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4187 DW_AT_high_pc as offset from DW_AT_low_pc.
4188
4189 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4190 * testsuite/Makefile.in: Regenerate.
4191 * testsuite/gdb_index_test_3.c: New test source file.
4192 * testsuite/gdb_index_test_3.sh: New test source file.
4193
2c54b4f4
ILT
41942012-04-25 Ian Lance Taylor <iant@google.com>
4195
4196 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4197 pointer.
4198 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4199 as a class, not a struct.
4200 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4201 (Target_arm::apply_cortex_a8_workaround): Likewise.
4202 * gc.h: Declare Reloc_types as a struct, not a class.
4203 * object.h: Declare Symbols_data as a struct.
4204 * reloc.h: Declare Read_relocs_data as a struct.
4205 * target.h: Declare Relocate_info as a struct.
4206
a5a5f7a3
DM
42072012-04-24 David S. Miller <davem@davemloft.net>
4208
4209 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4210 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4211 and R_SPARC_WPLT30.
4212
f038d496
CC
42132012-04-24 Cary Coutant <ccoutant@google.com>
4214
4215 * incremental-dump.cc (find_input_containing_global): Replace
4216 magic number with symbolic constant.
4217 (dump_incremental_inputs): Update version number.
4218 * incremental.cc (Output_section_incremental_inputs): Update version
4219 number; import symbolic constants from Incremental_inputs_reader.
4220 (Incremental_inputs::create_data_sections): Align relocations
4221 section correctly for 64-bit targets.
4222 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4223 constants; add padding.
4224 (Output_section_incremental_inputs::write_header): Add assert for
4225 header_size.
4226 (Output_section_incremental_inputs::write_input_files): Add assert
4227 for input_entry_size.
4228 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4229 add assert for object_info_size, input_section_entry_size,
4230 global_sym_entry_size.
4231 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4232 for data structure sizes; use them.
4233 (Incremental_input_entry_reader): Import symbolic constants from
4234 Incremental_inputs_reader; use them.
4235
a4d85145
DM
42362012-04-23 David S. Miller <davem@davemloft.net>
4237
4238 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4239 and elf_flags_set_.
4240 (Target_sparc::Target_sparc): Initialize new fields.
4241 (Target_sparc::do_make_elf_object): New function.
4242 (Target_sparc::do_adjust_elf_header): New function.
4243
1d509098
CC
42442012-04-23 Cary Coutant <ccoutant@google.com>
4245
4246 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4247 CU range table of gdb index.
4248
7ebeff7f
DM
42492012-04-20 David S. Miller <davem@davemloft.net>
4250
4251 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4252 instead of false.
4253
13cf9988
DM
42542012-04-16 David S. Miller <davem@davemloft.net>
4255
2a1079e8
DM
4256 * sparc.cc (Target_sparc::got_address): New function.
4257 (Sparc_relocate_functions::gdop_hix22): New function.
4258 (Sparc_relocate_functions::gdop_lox10): New function.
4259 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4260 relocs.
4261 (Target_sparc::Scan::local): Likewise if the global symbol is not
4262 preemptible and is not IFUNC.
4263 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4264 transformations for local and non-preemptible non-IFUNC global
4265 symbols.
4266
0bc964fc
DM
4267 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4268 writing out 64-bit part of ranges.
4269
661d7a80
DM
4270 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4271 -fpic and -fpie respectively.
4272 * Makefile.in: Regenerate.
4273
8c2bf391
DM
4274 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4275 (Target_sparc::Target_sparc): Initialize new field.
4276 (Target_sparc::do_plt_section_for_global): New function.
4277 (Target_sparc::do_plt_section_for_local): New function.
4278 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4279 (Target_sparc::make_plt_section): New function, broken out of
4280 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4281 (Target_sparc::make_plt_entry): Call make_plt_section.
4282 (Target_sparc::make_local_ifunc_plt_entry): New function.
4283 (Target_sparc::rela_ifunc_section): New function.
4284 (Target_sparc::plt_section): Remove const.
4285 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4286 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4287 and ifunc_count_ fields.
4288 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4289 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4290 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4291 (Output_data_plt_sparc::rela_ifunc): New function.
4292 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4293 (Output_data_plt_sparc::has_ifunc_section): New function.
4294 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4295 (Output_data_plt_sparc::address_for_global): New function.
4296 (Output_data_plt_sparc::address_for_local): New function.
4297 (Output_data_plt_sparc::plt_index_to_offset): New function.
4298 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4299 and entry_count.
4300 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4301 entry_count.
4302 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4303 R_SPARC_JMP_IREL to switch.
4304 (Target_sparc::Scan::check_non_pic): Likewise.
4305 (Target_sparc::Scan::local): Handle IFUNC symbols.
4306 (Target_sparc::Scan::local): Likewise.
4307 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4308 and plt_address_for_local.
4309 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4310 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4311
13cf9988
DM
4312 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4313 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4314 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4315 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4316 global relocs too.
4317 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4318 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4319 calls.
4320 * sparc.cc (Target_sparc::Scan::global): Likewise.
4321 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4322
31821be0
CC
43232012-04-16 Cary Coutant <ccoutant@google.com>
4324
4325 * archive.cc (Library_base::should_include_member): Check for
4326 --export-dynamic-symbol.
4327 * options.h (class General_options): Add --export-dynamic-symbol.
4328 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4329 --export-dynamic-symbol.
4330 (Symbol_table::gc_mark_undef_symbols): Likewise.
4331 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4332
2615994e
DM
43332012-04-12 David S. Miller <davem@davemloft.net>
4334
4335 * sparc.cc (Reloc::wdisp10): New relocation method.
4336 (Reloc::h34): Likewise.
4337 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4338 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4339 R_SPARC_WDISP10.
4340 (Target_sparc::Scan::local): Likewise.
4341 (Target_sparc::Scan::global): Likewise.
4342 (Target_sparc::Relocate::relocate): Likewise.
4343
6782735d
CC
43442012-04-09 Cary Coutant <ccoutant@google.com>
4345
4346 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4347 low_pc == 0.
4348
8c7a0b00
ILT
43492012-04-06 Ian Lance Taylor <iant@google.com>
4350
4351 * timer.cc: #include <unistd.h>.
4352
58797674
RM
43532012-04-06 Roland McGrath <mcgrathr@google.com>
4354
4355 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4356 * config.in: Regenerate.
4357 * configure: Regenerate.
4358
44350750
NC
43592012-04-05 Nick Clifton <nickc@redhat.com>
4360
4361 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4362 (AM_LC_MESSAGES): Add.
4363 * aclocal.m4: Regenerate.
4364 * config.in: Regenerate.
4365 * configure: Regenerate.
4366
c1027032
CC
43672012-03-21 Cary Coutant <ccoutant@google.com>
4368
4369 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4370 * Makefile.in: Regenerate.
4371 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4372 (Sized_elf_reloc_mapper::symbol_section): New function.
4373 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4374 (make_elf_reloc_mapper): New function.
4375 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4376 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4377 (Dwarf_abbrev_table::do_get_abbrev): New function.
4378 (Dwarf_ranges_table::read_ranges_table): New function.
4379 (Dwarf_ranges_table::read_range_list): New function.
4380 (Dwarf_pubnames_table::read_section): New function.
4381 (Dwarf_pubnames_table::read_header): New function.
4382 (Dwarf_pubnames_table::next_name): New function.
4383 (Dwarf_die::Dwarf_die): New function.
4384 (Dwarf_die::read_attributes): New function.
4385 (Dwarf_die::skip_attributes): New function.
4386 (Dwarf_die::set_name): New function.
4387 (Dwarf_die::set_linkage_name): New function.
4388 (Dwarf_die::attribute): New function.
4389 (Dwarf_die::string_attribute): New function.
4390 (Dwarf_die::int_attribute): New function.
4391 (Dwarf_die::uint_attribute): New function.
4392 (Dwarf_die::ref_attribute): New function.
4393 (Dwarf_die::child_offset): New function.
4394 (Dwarf_die::sibling_offset): New function.
4395 (Dwarf_info_reader::check_buffer): New function.
4396 (Dwarf_info_reader::parse): New function.
4397 (Dwarf_info_reader::do_parse): New function.
4398 (Dwarf_info_reader::do_read_string_table): New function.
4399 (Dwarf_info_reader::lookup_reloc): New function.
4400 (Dwarf_info_reader::get_string): New function.
4401 (Dwarf_info_reader::visit_compilation_unit): New function.
4402 (Dwarf_info_reader::visit_type_unit): New function.
4403 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4404 Sized_elf_reloc_mapper.
4405 (Sized_dwarf_line_info::symbol_section): Remove function.
4406 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4407 (Sized_dwarf_line_info::read_line_mappings): Remove object
4408 parameter, adjust callers.
4409 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4410 * dwarf_reader.h: Include <sys/types.h>.
4411 (class Track_relocs): Remove forward declaration.
4412 (class Elf_reloc_mapper): New class.
4413 (class Sized_elf_reloc_mapper): New class.
4414 (class Dwarf_abbrev_table): New class.
4415 (class Dwarf_range_list): New class.
4416 (class Dwarf_ranges_table): New class.
4417 (class Dwarf_pubnames_table): New class.
4418 (class Dwarf_die): New class.
4419 (class Dwarf_info_reader): New class.
4420 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4421 (Sized_dwarf_line_info::symbol_section): Remove member function.
4422 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4423 base class.
4424 * gdb-index.cc: New source file.
4425 * gdb-index.h: New source file.
4426 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4427 and .debug_types sections, call Layout::add_to_gdb_index.
4428 (Sized_relobj_incr::do_section_name): Implement.
4429 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4430 return type; Implement.
4431 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4432 return type.
4433 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4434 parameter list and return type.
4435 (Sized_incr_dynobj::do_section_contents): Likewise.
4436 * layout.cc: Include gdb-index.h.
4437 (Layout::Layout): Initialize gdb_index_data_.
4438 (Layout::init_fixed_output_section): Check for .gdb_index section.
4439 (Layout::add_to_gdb_index): New function. Instantiate.
4440 * layout.h: Add forward declaration for class Gdb_index.
4441 (Layout::add_to_gdb_index): New member function.
4442 (Layout::gdb_index_data_): New data member.
4443 * main.cc: Include gdb-index.h.
4444 (main): Print statistics for gdb index.
4445 * object.cc (Object::section_contents): Move code into
4446 do_section_contents.
4447 (need_decompressed_section): Check for sections needed when building
4448 gdb index.
4449 (build_compressed_section_map): Likewise.
4450 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4451 gdb index.
4452 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4453 sections; call Layout::add_to_gdb_index.
4454 (Sized_relobj_file::do_decompressed_section_contents): Call
4455 do_section_contents directly.
4456 * object.h (Object::do_section_contents): Adjust parameter list and
4457 return type.
4458 (Object::do_decompressed_section_contents): Call do_section_contents
4459 directly.
4460 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4461 return type.
4462 * options.h (class General_options): Add --gdb-index option.
4463 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4464 list and return type.
4465 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4466 * reloc.h (Track_relocs::checkpoint): New function.
4467 (Track_relocs::reset): New function.
4468
4469 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4470 New test cases.
4471 * testsuite/Makefile.in: Regenerate.
4472 * testsuite/gdb_index_test.cc: New test source file.
4473 * testsuite/gdb_index_test_1.sh: New test source file.
4474 * testsuite/gdb_index_test_2.sh: New test source file.
4475
647f1574
DK
44762012-03-19 Doug Kwan <dougkwan@google.com>
4477
4478 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4479 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4480 __exidx_start and __exidx_end. Make symbol table parameter
4481 anonymous as it is not used.
4482 * gold.cc (queue_middle_tasks): Call target hook to define any
4483 target-specific symbols.
4484 * target.h (Target::define_standard_symbols): New method.
4485 (Target::do_define_standard_symbols): Same.
4486 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4487 * testsuite/Makefile.in: Regenerate.
4488 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4489 and __exidx_end.
4490 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4491 relocations are generated for __exidx_start and __exidx_end.
4492
7c6109da
DK
44932012-03-16 Doug Kwan <dougkwan@google.com>
4494
4495 * testsuite/Makefile.am: Disable test initpri3b.
4496 * testsuite/Makefile.in: Regenerate.
4497
7b8957f8
DK
44982012-03-15 Doug Kwan <dougkwan@google.com>
4499
4500 * arm.cc (Target_arm::got_section): Make .got section read-only
4501 if -z now is given.
4502
14dc9ef7
ILT
45032012-03-15 Ian Lance Taylor <iant@google.com>
4504
4505 PR gold/13850
4506 * layout.cc (Layout::make_output_section): Correctly mark
4507 SHT_INIT_ARRAY, et. al., as relro.
4508
fa40b62a
DK
45092012-03-14 Doug Kwan <dougkwan@google.com>
4510
4511 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4512 dynamic relocations for protected symbols in shared objects.
4513
fd325007
ILT
45142012-03-13 Ian Lance Taylor <iant@google.com>
4515
4516 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4517 keep the larger alignment.
4518
e8dd54e1
CC
45192012-03-12 Cary Coutant <ccoutant@google.com>
4520
4521 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4522 handling of DW_LNE_define_file.
4523
feb5f3b0
CC
45242012-03-12 Cary Coutant <ccoutant@google.com>
4525
4526 * reduced_debug_output.cc
4527 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4528 codes to switch.
4529
a1fb4256
CC
45302012-02-29 Cary Coutant <ccoutant@google.com>
4531
4532 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4533
5dd8762a
CC
45342012-02-29 Cary Coutant <ccoutant@google.com>
4535
4536 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4537 Call Object::decompressed_section_contents.
4538 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4539 New dtor.
4540 (Sized_dwarf_line_info::buffer_start_): New data member.
4541 * merge.cc (Output_merge_data::do_add_input_section): Call
4542 Object::decompressed_section_contents.
4543 (Output_merge_string::do_add_input_section): Likewise.
4544 * object.cc (need_decompressed_section): New function.
4545 (build_compressed_section_map): Decompress sections needed later.
4546 (Sized_relobj_file::do_decompressed_section_contents): New function.
4547 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4548 * object.h (Object::decompressed_section_contents): New function.
4549 (Object::discard_decompressed_sections): New function.
4550 (Object::do_decompressed_section_contents): New function.
4551 (Object::do_discard_decompressed_sections): New function.
4552 (Compressed_section_info): New type.
4553 (Compressed_section_map): Include decompressed section contents.
4554 (Sized_relobj_file::do_decompressed_section_contents): New function.
4555 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4556
7b5de7ee
CC
45572012-02-16 Cary Coutant <ccoutant@google.com>
4558
4559 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4560 * testsuite/Makefile.in: Regenerate.
4561
f9fa4a63
CC
45622012-02-14 Cary Coutant <ccoutant@google.com>
4563
4564 * options.cc (General_options::finalize): Disallow -pie and -static.
4565
2c175ebc
DK
45662012-02-03 Doug Kwan <dougkwan@google.com>
4567
4568 * arm.cc (Arm_relocate_functions::abs8,
4569 Arm_relocate_functions::abs16): Use
4570 Bits::has_signed_unsigned_overflow32.
4571 (Arm_relocate_functions::thm_abs8): Correct range of
4572 overflow check.
4573 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4574 in assertions.
4575
90cff06f
DK
45762012-02-02 Doug Kwan <dougkwan@google.com>
4577
4578 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4579 position independent outputs, not just shared objects.
4580
63887f3d
L
45812012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4582
4583 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4584 * configure: Regenerated.
4585
bef2b434
ILT
45862012-01-27 Ian Lance Taylor <iant@google.com>
4587
4588 * reloc.h (Bits): New class with static functions, copied from
4589 namespace utils in arm.cc.
4590 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4591 instead.
4592
c335b55d
L
45932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4594
4595 * incremental.cc (write_info_blocks): Correct relocation offset.
4596
41194d9f
L
45972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4598
4599 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4600 (Relocate::tls_gd_to_le): Likewise.
4601
1bae613c
L
46022012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4603
4604 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4605
24482ca0
L
46062012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4607
4608 * configure.ac: Check if -mcmodel=medium works.
4609 * configure: Regenerated.
4610
c2c7840a
CC
46112012-01-24 Cary Coutant <ccoutant@google.com>
4612
4613 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4614 definition and ...
4615 (read_unsigned_LEB_128_x): ... this new function.
4616 (read_signed_LEB_128): Replaced with inline definition and ...
4617 (read_signed_LEB_128_x): ... this new function.
4618 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4619 (read_unsigned_LEB_128): Add inline definition.
4620 (read_signed_LEB_128_x): New function.
4621 (read_signed_LEB_128): Add inline definition.
4622 * testsuite/Makefile.am (leb128_unittest): New unit test.
4623 * testsuite/Makefile.in: Regenerate.
4624 * testsuite/leb128_unittest.cc: New unit test.
4625
833de760 46262012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4627
4628 PR gold/13617
4629 * i386.cc (Target_i386::do_code_fill): When using a jmp
4630 instruction, pad with nop instructions.
4631 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4632
618d6666
L
46332012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4634
4635 * x86_64.cc (gc_process_relocs): Add typename on types used in
4636 template.
4637 (scan_relocs): Likewise.
4638 (relocate_section): Likewise.
4639 (apply_relocation): Likewise.
4640
3660ff06
L
46412012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4642
4643 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4644 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4645 under x32.
4646
fc51264f
L
46472012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4648
4649 * x86_64.cc: Initial support for x32.
4650
dd74ae06
CC
46512012-01-03 Cary Coutant <ccoutant@google.com>
4652
4653 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4654 Use abstract base class for GOT.
4655 * gold/output.h (class Output_data_got_base): New abstract base class.
4656 (class Output_data_got): Derive from new base class, adjust ctors.
4657 (Output_data_got::reserve_slot): Make virtual; rename to
4658 do_reserve_slot; Adjust callers.
4659 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4660 pointer to abstract base class.
4661 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4662
83896202
ILT
46632011-12-18 Ian Lance Taylor <iant@google.com>
4664
4665 * object.h (Relobj::local_symbol_value): New function.
4666 (Relobj::local_plt_offset): New function.
4667 (Relobj::local_has_got_offset): New function.
4668 (Relobj::local_got_offset): New function.
4669 (Relobj::set_local_got_offset): New function.
4670 (Relobj::do_local_symbol_value): New pure virtual function.
4671 (Relobj::do_local_plt_offset): Likewise.
4672 (Relobj::do_local_has_got_offset): Likewise.
4673 (Relobj::do_local_got_offset): Likewise.
4674 (Relobj::do_set_local_got_offset): Likewise.
4675 (Sized_relobj::do_local_has_got_offset): Rename from
4676 local_has_got_offset.
4677 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4678 (Sized_relobj::do_set_local_got_offset): Rename from
4679 set_local_got_offset.
4680 (Sized_relobj_file::do_local_plt_offset): Rename from
4681 local_plt_offset.
4682 (Sized_relobj_file::do_local_symbol_value): New function.
4683 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4684 local_plt_offset.
4685 * output.cc (Output_data_got::Got_entry::write): Change object to
4686 Relobj. Use local_symbol_value.
4687 (Output_data_got::add_global_with_rel): Change rel_dyn to
4688 Output_data_reloc_generic*. Use add_global_generic.
4689 (Output_data_got::add_global_with_rela): Remove. Change all
4690 callers to use add_global_with_rel.
4691 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4692 Output_data_reloc_generic*. Use add_global_generic.
4693 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4694 callers to use add_global_pair_with_rel.
4695 (Output_data_got::add_local): Change object to Relobj*.
4696 (Output_data_got::add_local_plt): Likewise.
4697 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4698 change rel_dyn to Output_data_reloc_generic*. Use
4699 add_local_generic.
4700 (Output_data_got::add_local_with_rela): Remove. Change all
4701 callers to use all_local_with_rel.
4702 (Output_data_got::add_local_pair_with_rel): Change object to
4703 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4704 add_output_section_generic.
4705 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4706 callers to use add_local_pair_with_rel.
4707 (Output_data_got::reserve_local): Change object to Relobj*.
4708 * output.h: (class Output_data_reloc_generic): Add pure virtual
4709 declarations for add_global_generic, add_local_generic,
4710 add_output_section_generic.
4711 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4712 functions for Output_data_reloc_generic. Update declarations for
4713 changes listed in output.cc.
4714 (class Output_data_got): Change template parameter to got_size.
4715 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4716 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4717 function.
4718 (Sized_relobj_incr::do_local_plt_offset): New function.
4719 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4720 add_global_generic.
4721
76677ad0
CC
47222011-12-17 Cary Coutant <ccoutant@google.com>
4723
4724 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4725 * resolve.cc (Symbol_table::resolve): Likewise.
4726 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4727 arrays.
4728 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4729
8b8dd8d5
ILT
47302011-12-16 Ian Lance Taylor <iant@google.com>
4731
4732 * output.h (Output_data_reloc_generic::add): Only call
4733 add_dynamic_reloc if this is a dynamic reloc section.
4734
d55525b9
L
47352011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4736
4737 PR gold/13505
4738 * target-reloc.h (apply_relocation): Replace <64, false> with
4739 <size, big_endian>.
4740
ff81c7c1
NC
47412011-11-25 Nick Clifton <nickc@redhat.com>
4742
4743 * po/it.po: New Italian translation.
4744
628f39be
SA
47452011-11-17 Sterling Augustine <saugustine@google.com>
4746
4747 * script.cc (script_include_directive): Implement.
4748 (read_script_file): New local variables name and search_path. Update
4749 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4750 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4751 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4752
98ef3ea4
SA
47532011-11-11 Sterling Augustine <saugustine@google.com>
4754
4755 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4756 (file_or_sections_cmd): Likewise.
4757
f4a8b6d7
DK
47582011-11-11 Doug Kwan <dougkwan@google.com>
4759
4760 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4761 if --just-symbols is given.
4762
29ab395d
DK
47632011-11-10 Doug Kwan <dougkwan@google.com>
4764
4765 PR gold/13362
4766 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4767 when processing data relocs.
4768 * reloc.h (Relocate_functions::rel_unaligned): New method.
4769 (Relocate_functions::pcrel_unaligned): Ditto.
4770 (Relocate_functions::rel32_unaligned): Ditto.
4771 (Relocate_functions::pcrel32_unaligned): Ditto.
4772
2c339f71
DK
47732011-11-09 Doug Kwan <dougkwan@google.com>
4774
4775 PR gold/13362
4776 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4777 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4778 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4779 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4780 (Relocate_functions::rel_unaligned): New.
4781 (Relocate_functions::rel32_unaligned): New.
4782 * target-reloc.h (relocate_for_relocatable): Add code to handle
4783 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4784 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4785 arm_unaligned_reloc_r): New targets.
4786 * testsuite/Makefile.in: Regenerate.
4787 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4788 linking.
4789
3f3cddf1
ILT
47902011-11-02 Ian Lance Taylor <iant@google.com>
4791
4792 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4793 NATIVE_LINKER.
4794 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4795 * options.cc (General_options::finalize): Use library search path
4796 from configure script if specified. If not native and no sysroot,
4797 only search TOOLLIBDIR.
4798 * options.h (Search_directory::Search_directory): Change name to
4799 const std::string&.
4800 (General_options::add_to_library_path_with_sysroot): Change arg to
4801 const std::string&.
4802 * configure, Makefile.in, config.in: Rebuild.
4803
a8e2273b
ILT
48042011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4805
4806 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4807 we are working around the ARM1176 Erratum.
4808 * options.h (General_options::fix_arm1176): Add option.
4809 * testsuite/Makefile.am: Add testcases, and keep current ones
4810 working.
4811 * testsuite/Makefile.in: Regenerate.
4812 * testsuite/arm_fix_1176.s: New file.
4813 * testsuite/arm_fix_1176.sh: Likewise.
4814
cd6eab1c
ILT
48152011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4816
4817 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4818 may_use_blx_.
4819 (Target_arm::may_use_blx): Remove method.
4820 (Target_arm::set_may_use_blx): Likewise.
4821 (Target_arm::may_use_v4t_interworking): New method.
4822 (Target_arm::may_use_v5t_interworking): Likewise.
4823 (Target_arm::may_use_blx_): Remove member variable.
4824 (Arm_relocate_functions::arm_branch_common): Check for v5T
4825 interworking.
4826 (Arm_relocate_functions::thumb_branch_common): Likewise.
4827 (Reloc_stub::stub_type_for_reloc): Likewise.
4828 (Target_arm::do_finalize_sections): Correct interworking checks.
4829 * testsuite/Makefile.am: Add new tests.
4830 * testsuite/Makefile.in: Regenerate.
4831 * testsuite/arm_farcall_arm_arm.s: New test.
4832 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4833 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4834 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4835 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4836 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4837 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4838 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4839
286adcf4
CC
48402011-10-31 Cary Coutant <ccoutant@google.com>
4841
4842 PR gold/13023
4843 * expression.cc (Expression::eval_with_dot): Add
4844 is_section_dot_assignment parameter.
4845 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4846 absolute and assigning to dot within a section.
4847 * script-sections.cc
4848 (Output_section_element_assignment::set_section_addresses): Pass
4849 dot_section to set_if_absolute.
4850 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4851 as is_section_dot_assignment flag to eval_with_dot.
4852 (Output_section_element_dot_assignment::set_section_addresses):
4853 Likewise.
4854 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4855 parameter. Also set value if relative to dot_section; set the
4856 symbol's output_section.
4857 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4858 parameter. Adjust all callers.
4859 (Expression::eval_maybe_dot): Likewise.
4860 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4861 Adjust all callers.
4862 * testsuite/script_test_2.t: Test assignment of an absolute value
4863 to dot within an output section element.
4864
9634ed06
CC
48652011-10-31 Cary Coutant <ccoutant@google.com>
4866
4867 * options.h (class General_options): Add --[no-]gnu-unique options.
4868 * symtab.cc (Symbol_table::sized_write_globals): Convert
4869 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4870
de4101c7
CC
48712011-10-31 Cary Coutant <ccoutant@google.com>
4872
4873 PR gold/13359
4874 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4875 unnecessary assertion.
4876 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4877
7257cc92
ST
48782011-10-31 Sriraman Tallam <tmsriram@google.com>
4879
4880 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4881 gc_mark_symbol.
4882 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4883 gc_mark_symbol.
4884 Change to just keep the section associated with symbol.
4885 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4886 they are externally visible and --export-dynamic is turned on.
4887 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4888
bfc34b3f
ILT
48892011-10-19 Ian Lance Taylor <iant@google.com>
4890
4891 PR gold/13163
4892 * script-sections.cc
4893 (Output_section_element_dot_assignment::needs_output_section): New
4894 function.
4895
ea0d8c47
ILT
48962011-10-19 Ian Lance Taylor <iant@google.com>
4897
4898 PR gold/13204
4899 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4900 --section-start option was seen.
4901 * options.h (General_options::any_section_start): New function.
4902
abd242a9
DM
49032011-10-18 David S. Miller <davem@davemloft.net>
4904
4905 PR binutils/13301
4906 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4907 member to track relocation locations that have moved during TLS
4908 reloc optimizations.
4909 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4910 (Target_sparc::Relocate::relocate): Adjust view down by 4
4911 bytes if it matches reloc_adjust_addr_.
4912 (Target_sparc::Relocate::relocate_tls): Always move the
4913 __tls_get_addr call delay slot instruction forward 4 bytes when
4914 performing relaxation.
4915
bab9090f
CC
49162011-10-18 Cary Coutant <ccoutant@google.com>
4917
4918 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4919 (Output_file::map_no_anonymous): Check for non-zero
4920 return code from posix_fallocate.
4921
f7c5b166
CC
49222011-10-17 Cary Coutant <ccoutant@google.com>
4923
4924 PR gold/13245
4925 * plugin.cc (is_visible_from_outside): Check for symbols
4926 referenced from dynamic objects.
4927 * resolve.cc (Symbol_table::resolve): Don't count references
4928 from dynamic objects as references from real ELF files.
4929 * testsuite/plugin_test_2.sh: Adjust expected result.
4930
b490c0bb
CC
49312011-10-17 Cary Coutant <ccoutant@google.com>
4932
4933 * gold.cc: Include timer.h.
4934 (queue_middle_tasks): Stamp time.
4935 (queue_final_tasks): Likewise.
4936 * main.cc (main): Store timer in parameters. Print timers
4937 for each pass.
4938 * parameters.cc (Parameters::Parameters): Initialize timer_.
4939 (Parameters::set_timer): New function.
4940 (set_parameters_timer): New function.
4941 * parameters.h (Parameters::set_timer): New function.
4942 (Parameters::timer): New function.
4943 (Parameters::timer_): New data member.
4944 (set_parameters_timer): New function.
4945 * timer.cc (Timer::stamp): New function.
4946 (Timer::get_pass_time): New function.
4947 * timer.h (Timer::stamp): New function.
4948 (Timer::get_pass_time): New function.
4949 (Timer::pass_times_): New data member.
4950
f475cf7b
CC
49512011-10-17 Cary Coutant <ccoutant@google.com>
4952
4953 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4954 task for members of lib groups.
4955
cdd7e244
CC
49562011-10-17 Cary Coutant <ccoutant@google.com>
4957
4958 PR gold/13288
4f95c8b4 4959 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4960 (File_read::make_view): Move bounds check (replace with assert)...
4961 (File_read::find_or_make_view): ... to here.
4962
dfb45471
CC
49632011-10-12 Cary Coutant <ccoutant@google.com>
4964
4f95c8b4 4965 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4966 ::read returns less than requested size.
4967
53bbcc1b
CC
49682011-10-10 Cary Coutant <ccoutant@google.com>
4969
4f95c8b4 4970 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4971 Initialize defined_count_.
4972 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4973 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4974 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4975 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4976 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4977 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4978 member.
4979 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4980 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4981 Return zeroes instead of internal error.
4982
397b129b
CC
49832011-10-10 Cary Coutant <ccoutant@google.com>
4984
4985 PR gold/13249
4f95c8b4 4986 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4987 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4988 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4989 (Output_reloc::type_): Adjust size of bit field.
4990 (Output_reloc::use_plt_offset_): New bit field.
4991 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4992 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4993 flag. Adjust all callers.
4f95c8b4 4994 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4995 creating RELATIVE relocations.
4996
d5698657
NC
49972011-10-10 Nick Clifton <nickc@redhat.com>
4998
4999 * po/es.po: Updated Spanish translation.
5000 * po/fi.po: Updated Finnish translation.
5001
6a59a5c2
DN
50022011-10-03 Diego Novillo <dnovillo@google.com>
5003
5004 * options.cc (parse_uint): Fix dereference of RETVAL.
5005
f0558624
ST
50062011-09-29 Sriraman Tallam <tmsriram@google.com>
5007
5008 * layout.h (section_order_map_): New member.
5009 (get_section_order_map): New member function.
5010 * output.cc (Output_section::add_input_section): Check for patterns
5011 only when --section-ordering-file is specified.
5012 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5013 output_sections have been formed.
5014 * layout.cc (Layout_Layout): Initialize section_order_map_.
5015 * plugin.cc (update_section_order): Store order in order_map. Do not
5016 update the order.
5017 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5018 * testsuite/Makefile.in: Regenerate.
5019 * testsuite/plugin_section_order.c: New file.
5020 * testsuite/plugin_final_layout.cc: New file.
5021 * testsuite/plugin_final_layout.sh: New file.
5022
a7dac153
CC
50232011-09-29 Cary Coutant <ccoutant@google.com>
5024
4f95c8b4 5025 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5026 Check for NULL.
4f95c8b4 5027 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5028 symbols during incremental update.
5029 (Symbol_table::add_from_dynobj): Likewise.
5030
eebd87a5
ILT
50312011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5032 Ian Lance Taylor <iant@google.com>
5033
5034 * symtab.cc (Symbol_table::define_special_symbol): Always
5035 canonicalize version string.
5036
403a3331
CC
50372011-09-26 Cary Coutant <ccoutant@google.com>
5038
4f95c8b4
CC
5039 * gold.cc (queue_initial_tasks): Move option checks ...
5040 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5041 some options; make others fatal.
5042
235061c2
CC
50432011-09-26 Cary Coutant <ccoutant@google.com>
5044
5045 gcc PR lto/47247
5046 * plugin.cc (get_symbols_v2): New function.
5047 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5048 (is_referenced_from_outside): New function.
5049 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5050 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5051 (get_symbols): Pass version parameter.
5052 (get_symbols_v2): New function.
5053 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5054 parameter.
5055 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5056 (onload): Add LDPT_GET_SYMBOLS_V2.
5057 (all_symbols_read_hook): Use get_symbols_v2; check for
5058 LDPR_PREVAILING_DEF_IRONLY_EXP.
5059 * testsuite/plugin_test_3.sh: Update expected results.
5060
dc87f620
ILT
50612011-09-23 Simon Baldwin <simonb@google.com>
5062
5063 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5064 configuration options.
5065 * configure: Regenerate.
5066 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5067 * Makefile.in: Regenerate.
5068 * testsuite/Makefile.in: Regenerate.
5069
a8279f82
ST
50702011-09-19 Sriraman Tallam <tmsriram@google.com>
5071
5072 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5073
0c9350c8
CC
50742011-09-19 Cary Coutant <ccoutant@google.com>
5075
5076 * incremental.cc (can_incremental_update): Fix typo in comment.
5077 * incremental.h (can_incremental_update): Likewise.
5078
aa06ae28
CC
50792011-09-18 Cary Coutant <ccoutant@google.com>
5080
5081 * incremental.cc (can_incremental_update): New function.
5082 * incremental.h (can_incremental_update): New function.
5083 * layout.cc (Layout::init_fixed_output_section): Call it.
5084 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5085 * object.cc (Sized_relobj_file::do_layout): Call
5086 can_incremental_update.
5087
ebb300b2
CC
50882011-09-13 Cary Coutant <ccoutant@google.com>
5089
5090 * configure.ac: Check for glibc support for gnu_indirect_function
5091 support with static linking, setting automake conditional
5092 IFUNC_STATIC.
5093 * Makefile.in: Regenerate.
5094 * configure: Regenerate.
5095
5096 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5097 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5098 for IFUNC_STATIC.
5099 * testsuite/Makefile.in: Regenerate.
5100
1206d0d5
CC
51012011-09-13 Cary Coutant <ccoutant@google.com>
5102
5103 * incremental.cc (Sized_relobj_incr::do_layout): Call
5104 report_comdat_group for kept comdat sections.
5105 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5106 * testsuite/Makefile.in: Regenerate.
5107 * testsuite/incr_comdat_test_1.cc: New source file.
5108 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5109 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5110 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5111
40b29874
ILT
51122011-09-13 Ian Lance Taylor <iant@google.com>
5113
5114 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5115 variable external_symbols_offset.
5116
1b045aac
ILT
51172011-09-12 Ian Lance Taylor <iant@google.com>
5118
5119 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5120 triggered if object has no symbols.
5121
24c6c55a
DM
51222011-09-09 David S. Miller <davem@davemloft.net>
5123
5124 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5125 (Output_fill_debug_line::do_write): Likewise.
5126
66570254
CC
51272011-08-29 Cary Coutant <ccoutant@google.com>
5128
5129 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5130 casts to match formatting specs.
5131 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5132
8ea8cd50
CC
51332011-08-26 Cary Coutant <ccoutant@google.com>
5134
5135 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5136 remaining hole size when allocating.
5137 (Layout::make_output_section): Set fill methods for debug sections.
5138 * layout.h (Free_list::Free_list_node): Move from private to
5139 public.
5140 (Free_list::set_min_hole_size): New function.
5141 (Free_list::begin, Free_list::end): New functions.
5142 (Free_list::min_hole_): New data member.
5143 * output.cc: Include dwarf.h.
5144 (Output_fill_debug_info::do_minimum_hole_size): New function.
5145 (Output_fill_debug_info::do_write): New function.
5146 (Output_fill_debug_line::do_minimum_hole_size): New function.
5147 (Output_fill_debug_line::do_write): New function.
5148 (Output_section::Output_section): Initialize new data member.
5149 (Output_section::set_final_data_size): Ensure patch space is larger
5150 than minimum hole size.
5151 (Output_section::do_write): Fill holes in debug sections.
5152 * output.h (Output_fill): New class.
5153 (Output_fill_debug_info): New class.
5154 (Output_fill_debug_line): New class.
5155 (Output_section::set_free_space_fill): New function.
5156 (Output_section::free_space_fill_): New data member.
5157 * testsuite/Makefile.am (incremental_test_3): Add
5158 --incremental-patch option.
5159 (incremental_test_4): Likewise.
5160 (incremental_test_5): Likewise.
5161 (incremental_test_6): Likewise.
5162 (incremental_copy_test): Likewise.
5163 (incremental_common_test_1): Likewise.
5164 * testsuite/Makefile.in: Regenerate.
5165
7cf80422
NC
51662011-08-26 Nick Clifton <nickc@redhat.com>
5167
5168 * po/es.po: Updated Spanish translation.
5169
c3f7b0e5
CC
51702011-08-01 Cary Coutant <ccoutant@google.com>
5171
5172 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5173 * gold/testsuite/Makefile.in: Regenerate.
5174 * gold/testsuite/justsyms_exec.c: New source file.
5175 * gold/testsuite/justsyms_lib.c: New source file.
5176
9590bf25
CC
51772011-08-01 Cary Coutant <ccoutant@google.com>
5178
5179 * layout.cc (Layout::set_segment_offsets): Don't realign text
5180 segment if -Ttext was specified.
5181 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5182 file type.
5183 * object.h (Sized_relobj_file::e_type): New function.
5184 (Sized_relobj_file::e_type_): New data member.
5185 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5186 base address for ET_EXEC files.
5187 * target.cc (Target::do_make_elf_object_implementation): Allow
5188 ET_EXEC files with --just-symbols option.
5189
dcd8d12e
CC
51902011-07-28 Cary Coutant <ccoutant@google.com>
5191
5192 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5193 Add thread_number parameter.
5194 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5195 * workqueue-threads.cc
5196 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5197 current thread if its thread number is greater than desired thread
5198 count.
5199 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5200 Add thread_number parameter.
5201 (Workqueue::should_cancel_thread): Likewise.
5202 (Workqueue::find_runnable_or_wait): Pass thread_number to
5203 should_cancel_thread.
5204 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5205 parameter.
5206
804eb480
ST
52072011-07-22 Sriraman Tallam <tmsriram@google.com>
5208
5209 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5210 only after checking if it cannot be forced local.
5211 * symtab.h (is_externally_visible): Check if the symbol is not forced
5212 local.
5213
f1ddb600
ILT
52142011-07-15 Ian Lance Taylor <iant@google.com>
5215
5216 * options.h (class General_options): Add --print-output-format.
5217 Move -EL next to -EB, for better --help output.
5218 * target-select.cc: Include <cstdio>, "options.h", and
5219 "parameters.h".
5220 (Target_selector::do_target_bfd_name): New function.
5221 (print_output_format): New function.
5222 * target-select.h (class Target_selector): Update declarations.
5223 (Target_selector::target_bfd_name): New function.
5224 (print_output_format): Declare.
5225 * main.cc: Include "target-select.h".
5226 (main): Handle --print-output-format.
5227 * gold.cc: Include "target-select.h".
5228 (queue_initial_tasks): Handle --print-output-format when there are
5229 no input files.
5230 * parameters.cc (parameters_force_valid_target): Give a better
5231 error message if -EB/-EL does not match target.
5232 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5233 function.
5234
7d172687
ILT
52352011-07-15 Ian Lance Taylor <iant@google.com>
5236
5237 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5238 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5239 (Output_data_plt_i386::do_write): Write address of .dynamic
5240 section to first entry in .got.plt section.
5241 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5242 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5243 Initialize layout_.
5244 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5245 section to first entry in .got.plt section.
5246 * layout.h (Layout::dynamic_section): New function.
5247
e9552f7e
ST
52482011-07-13 Sriraman Tallam <tmsriram@google.com>
5249
5250 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5251 to claim_file call.
5252 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5253 input_section_position_, and input_section_glob_.
5254 (read_layout_from_file): Call function section_ordering_specified.
5255 * layout.h (is_section_ordering_specified): New function.
5256 (section_ordering_specified): New function.
5257 (section_ordering_specified_): New boolean member.
5258 * main.cc(main): Call load_plugins after layout object is defined.
5259 * output.cc (Output_section::add_input_section): Use
5260 function section_ordering_specified to check if section ordering is
5261 needed.
5262 * output.cc (Output_section::add_relaxed_input_section): Use
5263 function section_ordering_specified to check if section ordering is
5264 needed.
5265 (Output_section::update_section_layout): New function.
5266 (Output_section::sort_attached_input_sections): Check if input section
5267 must be reordered.
5268 * output.h (Output_section::update_section_layout): New function.
5269 * plugin.cc (get_section_count): New function.
5270 (get_section_type): New function.
5271 (get_section_name): New function.
5272 (get_section_contents): New function.
5273 (update_section_order): New function.
58797674 5274 (allow_section_ordering): New function.
e9552f7e
ST
5275 (Plugin::load): Add the new interfaces to the transfer vector.
5276 (Plugin_manager::load_plugins): New parameter.
5277 (Plugin_manager::all_symbols_read): New parameter.
5278 (Plugin_manager::claim_file): New parameter. Save the elf object for
5279 unclaimed objects.
5280 (Plugin_manager::get_elf_object): New function.
5281 (Plugin_manager::get_view): Change to directly use the bool to check
5282 if get_view is called from claim_file_hook.
5283 * plugin.h (input_objects): New function
5284 (Plugin__manager::load_plugins): New parameter.
5285 (Plugin_manager::claim_file): New parameter.
5286 (Plugin_manager::get_elf_object): New function.
5287 (Plugin_manager::in_claim_file_handler): New function.
5288 (Plugin_manager::in_claim_file_handler_): New member.
5289 (layout): New function.
5290 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5291 handler with an extra parameter. Make the elf object before calling
5292 claim_file handler.
5293 * testsuite/plugin_test.c (get_section_count): New function pointer.
5294 (get_section_type): New function pointer.
5295 (get_section_name): New function pointer.
5296 (get_section_contents): New function pointer.
5297 (update_section_order): New function pointer.
5298 (allow_section_ordering): New function pointer.
5299 (onload): Check if the new interfaces exist.
5300
9446efde
ILT
53012011-07-13 Ian Lance Taylor <iant@google.com>
5302
5303 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5304 relro section.
5305 * x86_64.cc (Target_x86_64::got_section): Likewise.
5306 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5307 (relro_now_test_SOURCES): New variable.
5308 (relro_now_test_DEPENDENCIES): New variable.
5309 (relro_now_test_LDFLAGS): New variable.
5310 (relro_now_test_LDADD): New variable.
5311 (relro_now_test.so): New target.
5312 * testsuite/Makefile.in: Rebuild.
5313
07aa62f2
ILT
53142011-07-12 Ian Lance Taylor <iant@google.com>
5315
5316 PR gold/12980
5317 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5318 GLOB_DAT relocation rather than a RELATIVE relocation for a
5319 protected symbol when creating a shared library.
5320 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5321 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5322 * testsuite/protected_main_1.cc (main): Test that protected
5323 function has same address.
5324
e2153196
ILT
53252011-07-11 Ian Lance Taylor <iant@google.com>
5326
5327 PR gold/12979
5328 * options.h (class General_options): Add -Bgroup.
5329 * options.cc (General_options::finalize): If -Bgroup is set,
5330 default to --unresolved-symbols=report-all.
5331 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5332 * target-reloc.h (issue_undefined_symbol_error): Handle
5333 --unresolved-symbols=report-all.
5334
6daf5215
ILT
53352011-07-08 Ian Lance Taylor <iant@google.com>
5336
5337 PR gold/11985
5338 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5339 if linker script discards key sections.
5340 (Layout::create_dynamic_symtab): Likewise.
5341 (Layout::assign_local_dynsym_offsets): Likewise.
5342 (Layout::sized_create_version_sections): Likewise.
5343 (Layout::create_interp): Likewise.
5344 (Layout::finish_dynamic_section): Likewise.
5345 (Layout::set_dynamic_symbol_size): Likewise.
5346
beabb2c6
ILT
53472011-07-08 Ian Lance Taylor <iant@google.com>
5348
5349 PR gold/12386
5350 * options.h (class General_options): Add --unresolved-symbols.
5351 * target-reloc.h (issue_undefined_symbol_error): Check
5352 --unresolved-symbols. Add comments.
5353
9c16daf1
ILT
53542011-07-08 Ian Lance Taylor <iant@google.com>
5355
5356 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5357 expression more complex.
5358
191f1a2d
ILT
53592011-07-08 Ian Lance Taylor <iant@google.com>
5360
5361 PR gold/11317
5362 * target-reloc.h (issue_undefined_symbol_error): New inline
5363 function, broken out of relocate_section.
5364 (relocate_section): Call issue_undefined_symbol_error.
5365 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5366 there is no TLS segment if we are about to issue an undefined
5367 symbol error.
5368 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5369
62855347
ILT
53702011-07-08 Ian Lance Taylor <iant@google.com>
5371
5372 PR gold/12279
5373 * resolve.cc (Symbol_table::should_override): Add fromtype
5374 parameter. Change all callers. Give error when linking together
5375 TLS and non-TLS symbol.
5376 (Symbol_table::should_override_with_special): Add fromtype
5377 parameter. Change all callers.
5378 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5379 there is no TLS segment if we have reported some errors.
5380 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5381
67181c72
ILT
53822011-07-08 Ian Lance Taylor <iant@google.com>
5383
5384 PR gold/12372
5385 * target.h (Target::plt_address_for_global): New function.
5386 (Target::plt_address_for_local): New function.
5387 (Target::plt_section_for_global): Remove.
5388 (Target::plt_section_for_local): Remove.
5389 (Target::do_plt_address_for_global): New virtual function.
5390 (Target::do_plt_address_for_local): New virtual function.
5391 (Target::do_plt_section_for_global): Remove.
5392 (Target::do_plt_section_for_local): Remove.
5393 (Target::register_global_plt_entry): Add Symbol_table and Layout
5394 parameters.
5395 * output.cc (Output_data_got::Got_entry::write): Use
5396 plt_address_for_global and plt_address_for_local.
5397 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5398 address of output section.
5399 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5400 got_irelative_, and irelative_count_ fields. Update
5401 declarations.
5402 (Output_data_plt_i386::has_irelative_section): New function.
5403 (Output_data_plt_i386::entry_count): Add irelative_count_.
5404 (Output_data_plt_i386::set_final_data_size): Likewise.
5405 (class Target_i386): Add got_irelative_ and rel_irelative_
5406 fields. Update declarations.
5407 (Target_i386::Target_i386): Initialize new fields.
5408 (Target_i386::do_plt_address_for_global): New function replacing
5409 do_plt_section_for_global.
5410 (Target_i386::do_plt_address_for_local): New function replacing
5411 do_plt_section_for_local.
5412 (Target_i386::got_section): Create got_irelative_.
5413 (Target_i386::rel_irelative_section): New function.
5414 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5415 fields. Don't define __rel_iplt_{start,end}.
5416 (Output_data_plt_i386::add_entry): Add symtab and layout
5417 parameters. Change all callers. Use different PLT and GOT for
5418 IFUNC symbols.
5419 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5420 layout parameters. Change all callers. Use different PLT and
5421 GOT.
5422 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5423 (Output_data_plt_i386::rel_irelative): New function.
5424 (Output_data_plt_i386::address_for_global): New function.
5425 (Output_data_plt_i386::address_for_local): New function.
5426 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5427 IRELATIVE GOT when changing IFUNC GOT entries.
5428 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5429 reloc.
5430 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5431 if we didn't create an IRELATIVE GOT.
5432 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5433 plt_address_for_local.
5434 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5435 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5436 got_irelative_, and irelative_count_ fields. Update
5437 declarations.
5438 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5439 Initialize new fields. Remove symtab parameter. Change all
5440 callers.
5441 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5442 irelative_count_.
5443 (Output_data_plt_x86_64::has_irelative_section): New function.
5444 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5445 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5446 fields. Update declarations.
5447 (Target_x86_64::Target_x86_64): Initialize new fields.
5448 (Target_x86_64::do_plt_address_for_global): New function replacing
5449 do_plt_section_for_global.
5450 (Target_x86_64::do_plt_address_for_local): New function replacing
5451 do_plt_section_for_local.
5452 (Target_x86_64::got_section): Create got_irelative_.
5453 (Target_x86_64::rela_irelative_section): New function.
5454 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5455 all callers. Don't create __rel_iplt_{start,end}.
5456 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5457 parameters. Change all callers. Use different PLT and GOT for
5458 IFUNC symbols.
5459 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5460 layout parameters. Change all callers. Use different PLT and
5461 GOT.
5462 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5463 parameters. Change all callers. Use different PLT and GOT for
5464 IFUNC symbols.
5465 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5466 (Output_data_plt_x86_64::rela_irelative): New function.
5467 (Output_data_plt_x86_64::address_for_global): New function.
5468 (Output_data_plt_x86_64::address_for_local): New function.
5469 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5470 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5471 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5472 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5473 parameters.
5474 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5475 reloc.
5476 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5477 symbols if we didn't create an IRELATIVE GOT.
5478 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5479 plt_address_for_local.
5480 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5481 * testsuite/ifuncvar1.c: New test file.
5482 * testsuite/ifuncvar2.c: New test file.
5483 * testsuite/ifuncvar3.c: New test file.
5484 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5485 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5486 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5487 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5488 * testsuite/Makefile.in: Rebuild.
5489
33c15b45
CC
54902011-07-07 Cary Coutant <ccoutant@google.com>
5491
5492 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5493 (two_file_test_1_ndebug.o): Likewise.
5494 (two_file_test_1b_ndebug.o): Likewise.
5495 (two_file_test_2_ndebug.o): Likewise.
5496 (two_file_test_main_ndebug.o): Likewise.
5497 (incremental_test_2): Link with no-debug versions.
5498
f48b5fb7
CC
54992011-07-06 Cary Coutant <ccoutant@google.com>
5500
5501 * gold/incremental.cc
5502 (Output_section_incremental_inputs::write_info_blocks): Check for
5503 hidden and internal symbols.
5504
221597a5
CC
55052011-07-06 Cary Coutant <ccoutant@google.com>
5506
5507 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5508 Check disposition for startup file.
5509 (Incremental_inputs::report_command_line): Ignore
5510 --incremental-startup-unchanged option.
5511 * options.cc (General_options::parse_incremental_startup_unchanged):
5512 New function.
5513 (General_options::General_options): Initialize new data member.
5514 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5515 (General_options): Add --incremental-startup-unchanged option.
5516 (General_options::incremental_startup_disposition): New function.
5517 (General_options::incremental_startup_disposition_): New data member.
5518
e24719f6
CC
55192011-07-06 Cary Coutant <ccoutant@google.com>
5520
5521 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5522 input file index to Script_info ctor.
5523 (Sized_incremental_binary::do_file_has_changed): Find the
5524 command-line argument for files named in scripts.
5525 * incremental.h (Script_info::Script_info): New ctor
5526 with input file index.
5527 (Script_info::input_file_index): New function.
5528 (Script_info::input_file_index_): New data member.
5529 (Incremental_binary::get_library): Add const.
5530 (Incremental_binary::get_script_info): Add const.
5531 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5532 * testsuite/Makefile.am (incremental_test_5): New test case.
5533 (incremental_test_6): New test case.
5534 * testsuite/Makefile.in: Regenerate.
5535
8f7c81e8
CC
55362011-07-06 Cary Coutant <ccoutant@google.com>
5537
5538 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5539 debug output when command lines differ.
5540
9fbd3822
CC
55412011-07-06 Cary Coutant <ccoutant@google.com>
5542
5543 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5544 --incremental-patch option.
5545 * layout.cc (Free_list::allocate): Extend allocation beyond original
5546 end if enabled.
5547 (Layout::make_output_section): Mark sections that should get
5548 patch space.
5549 * options.cc (parse_percent): New function.
5550 * options.h (parse_percent): New function.
5551 (DEFINE_percent): New macro.
5552 (General_options): Add --incremental-patch option.
5553 * output.cc (Output_section::Output_section): Initialize new data
5554 members.
5555 (Output_section::add_input_section): Print section name when out
5556 of patch space.
5557 (Output_section::add_output_section_data): Likewise.
5558 (Output_section::set_final_data_size): Add patch space when
5559 doing --incremental-full.
5560 (Output_section::do_reset_address_and_file_offset): Remove patch
5561 space.
5562 (Output_segment::set_section_list_addresses): Print debug output
5563 only if --incremental-update.
5564 * output.h (Output_section::set_is_patch_space_allowed): New function.
5565 (Output_section::is_patch_space_allowed_): New data member.
5566 (Output_section::patch_space_): New data member.
5567 * parameters.cc (Parameters::incremental_full): New function.
5568 * parameters.h (Parameters::incremental_full): New function
5569 * testsuite/Makefile.am (incremental_test_2): Add test for
5570 --incremental-patch option.
5571 * testsuite/Makefile.in: Regenerate.
5572 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5573 (t18): Remove function body.
5574
f6cccc2c
DK
55752011-07-05 Doug Kwan <dougkwan@google.com>
5576
5577 PR gold/12771
5578 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5579 Arm_Address type for relocation result.
5580 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5581 overflow check.
5582 (Arm_relocate_functions::abs32): Use unaligned access.
5583 (Arm_relocate_functions::rel32): Ditto.
5584 (Arm_relocate_functions::prel31): Ditto.
5585 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5586 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5587 static data relocations.
5588 * testsuite/Makefile.in: Regnerate.
5589 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5590
28a13fec
ILT
55912011-07-05 Ian Lance Taylor <iant@google.com>
5592
5593 PR gold/12392
5594 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5595 symbols if necessary.
5596 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5597
24d47b34
ILT
55982011-07-05 Ian Lance Taylor <iant@google.com>
5599
5600 PR gold/12952
5601 * resolve.cc (Symbol::override_base_with_special): Simply override
5602 version with special symbol version, ignoring previous version.
5603
41f9cbbe
ILT
56042011-07-05 Ian Lance Taylor <iant@google.com>
5605
5606 * object.cc (Sized_relobj_file::include_section_group): Add
5607 information to comment about signature location.
5608
886288f1
ILT
56092011-07-02 Ian Lance Taylor <iant@google.com>
5610
5611 PR gold/12957
5612 * options.h (class General_options): Add -f and -F.
5613 * options.cc (General_options::finalize): Fatal error if -f/-F
5614 are used without -shared.
5615 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5616
ae3a6d4f
ILT
56172011-07-02 Ian Lance Taylor <iant@google.com>
5618
5619 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5620
21131061
ILT
56212011-07-01 Ian Lance Taylor <iant@google.com>
5622
5623 PR gold/12525
5624 PR gold/12952
5625 * resolve.cc (Symbol::override_base_with_special): Don't override
5626 the version if the overriding symbol has a different name.
5627 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5628 all callers. If we give an error about an undefined version,
5629 define the base version if necessary.
5630 * dynobj.h (class Versions): Update declaration.
5631 * testsuite/weak_alias_test_5.cc: New file.
5632 * testsuite/weak_alias_test.script: New file.
5633 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5634 and versioned_alias have the right value, and call t2.
5635 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5636 weak_alias_test_5.so.
5637 (weak_alias_test_LDADD): Likewise.
5638 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5639 * testsuite/Makefile.in: Rebuild.
5640
611062c0
ILT
56412011-07-01 Ian Lance Taylor <iant@google.com>
5642
5643 PR gold/12525
5644 * options.h (class General_options): Support -z notext.
5645 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5646 -Wl,-z,notext.
5647 (two_file_shared_nonpic.so): Likewise.
5648 (two_file_shared_mixed.so): Likewise.
5649 (two_file_shared_mixed_1.so): Likewise.
5650 (weak_undef_lib_nonpic.so): Likewise.
5651 (alt/weak_undef_lib_nonpic.so): Likewise.
5652 (tls_test_shared_nonpic.so): Likewise.
5653 * testsuite/Makefile.in: Rebuild.
5654
328c7c2f
ILT
56552011-07-01 Ian Lance Taylor <iant@google.com>
5656
5657 PR gold/12525
5658 * configure.ac: Test whether static linking works, setting
5659 the automake conditional HAVE_STATIC.
5660 * testsuite/Makefile.am: Disable tests using -static if
5661 HAVE_STATIC is not true.
5662 * configure, testsuite/Makefile.in: Rebuild.
5663
02d7cd44
ILT
56642011-07-01 Ian Lance Taylor <iant@google.com>
5665
5666 PR gold/12525
5667 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5668 Assert if we see DW_EH_PE_indirect.
5669 * target.h (Target::ehframe_datarel_base): New function.
5670 (Target::do_ehframe_datarel_base): New target function.
5671 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5672 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5673 function.
5674
07a60597
ILT
56752011-07-01 Ian Lance Taylor <iant@google.com>
5676
5677 PR gold/12571
5678 * options.h (class General_options): Add
5679 --ld-generated-unwind-info.
5680 * ehframe.cc (Fde::write): Add address parameter. Change all
5681 callers. If associated with PLT, fill in address and size.
5682 (Cie::set_output_offset): Only add merge mapping if there is an
5683 object.
5684 (Cie::write): Add address parameter. Change all callers.
5685 (Eh_frame::add_ehframe_for_plt): New function.
5686 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5687 input_offset_ fields into union u_, with new plt field.
5688 (Fde::Fde): Adjust for new union field.
5689 (Fde::Fde) [Output_data version]: New constructor.
5690 (Fde::add_mapping): Only add merge mapping if there is an object.
5691 (class Cie): Update declarations.
5692 (class Eh_frame): Declare add_ehframe_for_plt.
5693 * layout.cc (Layout::layout_eh_frame): Break out code into
5694 make_eh_frame_section, and call it.
5695 (Layout::make_eh_frame_section): New function.
5696 (Layout::add_eh_frame_for_plt): New function.
5697 * layout.h (class Layout): Update declarations.
5698 * merge.cc (Merge_map::add_mapping): Add assertion.
5699 * i386.cc: Include "dwarf.h".
5700 (class Output_data_plt_i386): Make first_plt_entry,
5701 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5702 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5703 and plt_eh_frame_fde.
5704 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5705 boundary. Call add_eh_frame_for_plt if appropriate.
5706 * x86_64.cc: Include "dwarf.h".
5707 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5708 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5709 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5710 and plt_eh_frame_fde.
5711 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5712 appropriate.
5713
14788a3f
ILT
57142011-06-29 Ian Lance Taylor <iant@google.com>
5715
5716 PR gold/12629
5717 * object.cc (Sized_relobj_file::layout_section): Change shdr
5718 parameter to be const.
5719 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5720 out of do_layout.
5721 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5722 appropriate. Call layout_eh_frame_section.
5723 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5724 sections.
5725 * object.h (class Sized_relobj_file): Update declarations.
5726
6c21fce1
ILT
57272011-06-29 Ian Lance Taylor <iant@google.com>
5728
37e41b03 5729 PR gold/12652
6c21fce1
ILT
5730 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5731 modifier.
5732 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5733
4d5e4e62
ILT
57342011-06-29 Ian Lance Taylor <iant@google.com>
5735
5736 PR gold/12675
5737 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5738 SHT_X86_64_UNWIND.
5739 * layout.cc (Layout::layout_eh_frame): Likewise.
5740
886f533a
ILT
57412011-06-29 Ian Lance Taylor <iant@google.com>
5742
5743 PR gold/12695
5744 * layout.cc (Layout::symtab_section_shndx): New function.
5745 * layout.h (class Layout): Declare symtab_section_shndx.
5746 * output.cc (Output_section::write_header): Call it.
5747
f3ae1b28
ILT
57482011-06-29 Ian Lance Taylor <iant@google.com>
5749
5750 PR gold/12818
5751 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5752 symbols which are not used in a relocation.
5753
aecf301f
ILT
57542011-06-28 Ian Lance Taylor <iant@google.com>
5755
5756 PR gold/12898
5757 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5758 script create indistinguishable segments.
5759 (Layout::set_segment_offsets): Use stable_sort when sorting
5760 segments. Pass this to Compare_segments constructor.
5761 * layout.h (class Layout): Make segment_precedes non-static.
5762 (class Compare_segments): Change from struct to class. Add
5763 layout_ field. Add constructor.
5764 * script-sections.cc
5765 (Script_sections::attach_sections_using_phdrs_clause): Rename
5766 local orphan to is_orphan. Don't report failure to put empty
5767 section in segment. On attachment failure, report name of
5768 section, and attach to first PT_LOAD segment.
5769
03ef7571
ILT
57702011-06-28 Ian Lance Taylor <iant@google.com>
5771
5772 PR gold/12934
5773 * target-select.cc (Target_selector::Target_selector): Add
5774 emulation parameter. Change all callers.
5775 (select_target_by_bfd_name): Rename from select_target_by_name.
5776 Change all callers.
5777 (select_target_by_emulation): New function.
5778 (supported_emulation_names): New function.
5779 * target-select.h (class Target_selector): Add emulation_ field.
5780 Update declarations.
5781 (Target_selector::recognize_by_bfd_name): Rename from
5782 recognize_by_name. Change all callers.
5783 (Target_selector::supported_bfd_names): Rename from
5784 supported_names. Change all callers.
5785 (Target_selector::recognize_by_emulation): New function.
5786 (Target_selector::supported_emulations): New function.
5787 (Target_selector::emulation): New function.
5788 (Target_selector::do_recognize_by_bfd_name): Rename from
5789 do_recognize_by_name. Change all callers.
5790 (Target_selector::do_supported_bfd_names): Rename from
5791 do_supported_names. Change all callers.
5792 (Target_selector::do_recognize_by_emulation): New function.
5793 (Target_selector::do_supported_emulations): New function.
5794 (select_target_by_bfd_name): Change name in declaration.
5795 (select_target_by_emulation): Declare.
5796 (supported_emulation_names): Declare.
5797 * parameters.cc (parameters_force_valid_target): Try to find
5798 target based on emulation from -m option.
5799 * options.h (class General_options): Change doc string for -m.
5800 * options.cc (help): Print emulations.
5801 (General_options::parse_V): Likewise.
5802 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5803 Add emulation parameter. Change all callers.
5804
200b2bb9
ILT
58052011-06-28 Ian Lance Taylor <iant@google.com>
5806
5807 * target.h (class Target): Add osabi_ field.
5808 (Target::osabi): New function.
5809 (Target::set_osabi): New function.
5810 (Target::Target): Initialize osabi_.
5811 (Target::do_adjust_elf_header): Make pure virtual.
5812 (Sized_target::do_adjust_elf_header): Declare.
5813 * target.cc (Sized_target::do_adjust_elf_header): New function.
5814 (class Sized_target): Instantiate all versions.
5815 * freebsd.h (class Target_freebsd): Remove.
5816 (Target_selector_freebsd::do_recognize): Call set_osabi on
5817 Target.
5818 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5819 (Target_selector_freebsd::set_osabi): Remove.
5820 * i386.cc (class Target_i386): Inherit from Sized_target rather
5821 than Target_freebsd.
5822 * x86_64.cc (class Target_x86_64): Likewise.
5823
b3ce541e
ILT
58242011-06-28 Ian Lance Taylor <iant@google.com>
5825
5826 * target.h (Target::can_check_for_function_pointers): Rewrite.
5827 Make non-virtual.
5828 (Target::can_icf_inline_merge_sections): Likewise.
5829 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5830 (Target::Target_info): Add can_icf_inline_merge_sections field.
5831 (Target::do_can_check_for_function_pointers): New virtual
5832 function.
5833 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5834 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5835 from can_check_for_function_pointers, move in file.
5836 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5837 section_may_have_icf_unsafe_poineters, move in file.
5838 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5839 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5840 Rename from can_check_for_function_pointers, move in file.
5841 (Target_i386::can_icf_inline_merge_sections): Remove.
5842 (Target_i386::i386_info): Initialize
5843 can_icf_inline_merge_sections.
5844 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5845 Initialize can_icf_inline_merge_sections.
5846 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5847 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5848 Rename from can_check_for_function_pointers, move in file.
5849 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5850 (Target_x86_64::x86_64_info): Initialize
5851 can_icf_inline_merge_sections.
5852 * testsuite/testfile.cc (Target_test::test_target_info):
5853 Likewise.
5854 * icf.cc (get_section_contents): Correct formatting.
5855
6d1c4efb
ILT
58562011-06-27 Ian Lance Taylor <iant@google.com>
5857
5858 * symtab.cc (Symbol::versioned_name): New function.
5859 (Symbol_table::add_to_final_symtab): Use versioned_name when
5860 appropriate.
5861 (Symbol_table::sized_write_symbol): Likewise.
5862 * symtab.h (class Symbol): Declare versioned_name.
5863 * stringpool.h (class Stringpool_template): Add variant of add
5864 which takes a std::basic_string.
5865 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5866 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5867 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5868 (ver_test_12.o): New target.
5869 * testsuite/Makefile.in: Rebuild.
5870
57eb9b50
DK
58712011-06-27 Doug Kwan <dougkwan@google.com>
5872
5873 * arm.cc (Arm_relocate_functions::thm_jump8,
5874 Arm_relocate_functions::thm_jump11): Use a wider signed
5875 type to compute offset.
5876 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5877 arm_thm_jump8.
5878 * testsuite/Makefile.in: Regenerate.
5879 * testsuite/arm_branch_in_range.sh: Check test results of
5880 arm_thm_jump11 and arm_thm_jump8.
5881 * testsuite/arm_thm_jump11.s: New test source file.
5882 * testsuite/arm_thm_jump11.t: New linker script.
5883 * testsuite/arm_thm_jump8.s: New test source file.
5884 * testsuite/arm_thm_jump8.t: New linker script.
5885
487b39df
ILT
58862011-06-24 Ian Lance Taylor <iant@google.com>
5887
5888 * layout.cc: Include "object.h".
5889 (ctors_sections_in_init_array): New static variable.
5890 (Layout::is_ctors_in_init_array): New function.
5891 (Layout::layout): Add entry to ctors_sections_in_init_array if
5892 appropriate.
5893 * layout.h (class Layout): Declare is_ctors_in_init_array.
5894 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5895 is_ctors_reverse_view is set.
5896 (Sized_relobj_file::write_sections): Add layout parameter. Change
5897 all callers. Set is_ctors_reverse_view field of View_size.
5898 (Sized_relobj_file::reverse_words): New function.
5899 * object.h (Sized_relobj_file::View_size): Add
5900 is_ctors_reverse_view field.
5901 (class Sized_relobj_file): Update declarations.
5902 * testsuite/initpri3.c: New test.
5903 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5904 initpri3b.
5905 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5906 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5907 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5908 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5909 * testsuite/Makefile.in: Rebuild.
5910
472076e4
CC
59112011-06-24 Cary Coutant <ccoutant@google.com>
5912
5913 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5914 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5915 (debug_msg_cdebug.err): New targets.
5916 * testsuite/Makefile.in: Regenerate.
5917 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5918 Fix checks for link with shared library.
5919
a60af0db
DK
59202011-06-24 Doug Kwan <dougkwan@google.com>
5921
5922 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5923 skip empty text sections.
5924 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5925
5393d741
ILT
59262011-06-22 Ian Lance Taylor <iant@google.com>
5927
5928 PR gold/12910
5929 * options.h (class General_options): Add --ctors-in-init-array.
5930 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5931 friends as SHT_PROGBITS for merging sections.
5932 (Layout::layout): Remove special handling of .init_array and
5933 friends. Don't sort if doing relocatable link. Sort for .ctors
5934 and .dtors if ctors_in_init_array.
5935 (Layout::make_output_section): Force correct section types for
5936 .init_array and friends. Don't sort if doing relocatable link,
5937 Don't sort .ctors and .dtors if ctors_in_init_array.
5938 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5939 (Layout::output_section_name): Add relobj parameter. Change all
5940 callers. Handle .ctors. and .dtors. in code rather than table.
5941 Handle .ctors and .dtors if ctors_in_init_array.
5942 (Layout::match_file_name): New function, moved from output.cc.
5943 * layout.h (class Layout): Update declarations.
5944 * output.cc: Include "layout.h".
5945 (Input_section_sort_entry::get_priority): New function.
5946 (Input_section_sort_entry::match_file_name): Just call
5947 Layout::match_file_name.
5948 (Output_section::Input_section_sort_init_fini_compare::operator()):
5949 Handle .ctors and .dtors. Sort by explicit priority rather than
5950 by name.
5951 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5952 * testsuite/initpri2.c: New test.
5953 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5954 (check_PROGRAMS): Add initpri2.
5955 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5956 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5957 * configure, testsuite/Makefile.in: Rebuild.
5958
e1f74f98
ILT
59592011-06-19 Ian Lance Taylor <iant@google.com>
5960
5961 PR gold/12880
5962 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5963 .interp section to a PT_INTERP segment even if we have seen a
5964 --dynamic-linker option. Don't do it if we have seen a PHDRS
5965 clause in a linker script.
5966 (Layout::finalize): Don't create a .interp section if we've
5967 already create a PT_INTERP segment.
5968 (Layout::create_interp): Always call choose_output_section (revert
5969 patch of 2011-06-17). Don't create PT_INTERP segment.
5970 * script-sections.cc
5971 (Script_sections::create_note_and_tls_segments): Add a .interp
5972 section to a PT_INTERP segment even if we have seen a
5973 --dynamic-linker option.
5974
766f91bb
ILT
59752011-06-18 Ian Lance Taylor <iant@google.com>
5976
5977 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5978 merely because a non-PT_LOAD segment has a dynamic reloc.
5979
0d212c3a
ILT
59802011-06-18 Ian Lance Taylor <iant@google.com>
5981
5982 * layout.cc (Layout::finish_dynamic_section): Don't create
5983 DT_FLAGS entry if not needed.
5984
911a5072
ILT
59852011-06-18 Ian Lance Taylor <iant@google.com>
5986
5987 PR gold/12745
5988 * layout.cc (Layout::layout_eh_frame): Correct handling of
5989 writable .eh_frame section.
5990
534b4e5f
ILT
59912011-06-17 Ian Lance Taylor <iant@google.com>
5992
5993 PR gold/12893
5994 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5995 symbol is redefined with the exact same object and value.
5996
10b4f102
ILT
59972011-06-17 Ian Lance Taylor <iant@google.com>
5998
5999 PR gold/12880
6000 * layout.h (class Layout): Add interp_segment_ field.
6001 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6002 (Layout::attach_allocated_section_to_segment): If making shared
6003 library, put .interp section in PT_INTERP segment.
6004 (Layout::finalize): Also call create_interp if -dynamic-linker
6005 option was used.
6006 (Layout::create_interp): Assert that there is no PT_INTERP
6007 segment. If not using a SECTIONS clause, use make_output_section.
6008 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6009 * script-sections.cc
6010 (Script_sections::create_note_and_tls_segments): If making shared
6011 library, put .interp section in PT_INTERP segment.
6012
a29b0dad
ILT
60132011-06-17 Ian Lance Taylor <iant@google.com>
6014
e588ea8d
ILT
6015 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6016 when making a shared library.
6017
60182011-06-17 Ian Lance Taylor <iant@google.com>
6019
6020 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6021 parameter. Change all callers. Don't issue warning about PC32
6022 against locally defined symbol.
a29b0dad 6023
9d3b0698
ILT
60242011-06-16 Ian Lance Taylor <iant@google.com>
6025
6026 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6027 occurs in same object.
6028
85b0f90c
AM
60292011-06-14 Alan Modra <amodra@gmail.com>
6030
6031 * po/POTFILES.in: Regenerate.
6032
a94907d9
ILT
60332011-06-09 Ian Lance Taylor <iant@google.com>
6034
6035 * script-sections.cc
6036 (Orphan_output_section::set_section_addresses): For a relocatable
6037 link set address to 0.
6038
4fb3a1c3
CC
60392011-06-09 Cary Coutant <ccoutant@google.com>
6040
6041 PR gold/12804
6042 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6043 used with --compress-debug-sections.
6044 * gold/object.cc (Sized_relobj_file::do_layout): Report
6045 uncompressed size of compressed input sections.
6046
61220854
CC
60472011-06-08 Cary Coutant <ccoutant@google.com>
6048
6049 PR gold/12804
6050 * testsuite/two_file_test_2_v1.cc: Change initialization of
6051 v2 to keep it in .data.
6052
e6455dfb
CC
60532011-06-07 Cary Coutant <ccoutant@google.com>
6054
6055 * common.cc (Symbol_table::do_allocate_commons_list): Call
6056 gold_fallback.
6057 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6058 (Errors::fallback): New function.
6059 (gold_fallback): New function.
6060 * errors.h (Errors::fallback): New function.
6061 * gold.cc (gold_exit): Change status parameter to enum; adjust
6062 all callers.
6063 (queue_initial_tasks): Call gold_fallback.
6064 * gold.h: Include cstdlib.
6065 (Exit_status): New enum type.
6066 (gold_exit): Change status parameter to enum.
6067 (gold_fallback): New function.
6068 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6069 (Layout::create_symtab_sections): Likewise.
6070 (Layout::create_shdrs): Likewise.
6071 * main.cc (main): Adjust call to gold_exit.
6072 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6073 (Output_data_got::add_got_entry_pair): Likewise.
6074 (Output_section::add_input_section): Likewise.
6075 (Output_section::add_output_section_data): Likewise.
6076 (Output_segment::set_section_list_addresses): Likewise.
6077 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6078
fb0e076f
CC
60792011-06-07 Cary Coutant <ccoutant@google.com>
6080
6081 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6082 for incremental links.
6083 * output.cc (Output_segment::set_section_list_addresses): Remove
6084 FIXME and test for TLS or BSS.
6085
a5ee4d5d
CC
60862011-06-07 Cary Coutant <ccoutant@google.com>
6087
6088 * testsuite/Makefile.am: Add incremental_copy_test,
6089 incremental_common_test_1.
6090 * testsuite/Makefile.in: Regenerate.
6091 * testsuite/common_test_1_v1.c: New source file.
6092 * testsuite/common_test_1_v2.c: New source file.
6093 * testsuite/copy_test_v1.cc: New source file.
6094
5146f448
CC
60952011-06-07 Cary Coutant <ccoutant@google.com>
6096
6097 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6098 update, allocate common from bss section's free list.
6099 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6100 linker-defined symbols.
6101 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6102 Skip GOT and PLT entries that are no longer referenced.
6103 (Output_section_incremental_inputs::write_info_blocks): Mark
6104 linker-defined symbols.
6105 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6106 * output.cc (Output_section::allocate): New function.
6107 * output.h (Output_section::allocate): New function.
6108 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6109 linker-defined symbols.
6110 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6111 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6112 (Symbol::init_base_output_data): Likewise.
6113 (Symbol::init_base_output_segment): Likewise.
6114 (Symbol::init_base_constant): Likewise.
6115 (Sized_symbol::init_output_data): Likewise.
6116 (Sized_symbol::init_output_segment): Likewise.
6117 (Sized_symbol::init_constant): Likewise.
6118 (Symbol_table::do_define_in_output_data): Likewise.
6119 (Symbol_table::do_define_in_output_segment): Likewise.
6120 (Symbol_table::do_define_as_constant): Likewise.
6121 * symtab.h (Symbol::is_predefined): New function.
6122 (Symbol::init_base_output_data): Add is_predefined parameter.
6123 (Symbol::init_base_output_segment): Likewise.
6124 (Symbol::init_base_constant): Likewise.
6125 (Symbol::is_predefined_): New data member.
6126 (Sized_symbol::init_output_data): Add is_predefined parameter.
6127 (Sized_symbol::init_output_segment): Likewise.
6128 (Sized_symbol::init_constant): Likewise.
6129 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6130
26d3c67d
CC
61312011-06-07 Cary Coutant <ccoutant@google.com>
6132
6133 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6134 instead of emit_copy_reloc.
6135 (Copy_relocs::emit_copy_reloc): Refactor.
6136 (Copy_relocs::make_copy_reloc): New function.
6137 (Copy_relocs::add_copy_reloc): Remove.
6138 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6139 section.
6140 (Copy_relocs::make_copy_reloc): New function.
6141 (Copy_relocs::add_copy_reloc): Remove.
6142 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6143 unchanged input files.
6144 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6145 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6146 Reserve BSS space for COPY relocations.
6147 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6148 (Output_section_incremental_inputs::write_info_blocks): Record
6149 whether a symbol is copied from a shared object.
6150 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6151 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6152 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6153 (Incremental_input_entry_reader::get_output_symbol_index): Add
6154 is_copy parameter.
6155 (Incremental_binary::emit_copy_relocs): New function.
6156 (Incremental_binary::do_emit_copy_relocs): New function.
6157 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6158 new data member.
6159 (Sized_incremental_binary::add_copy_reloc): New function.
6160 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6161 (Sized_incremental_binary::Copy_reloc): New struct.
6162 (Sized_incremental_binary::Copy_relocs): New typedef.
6163 (Sized_incremental_binary::copy_relocs_): New data member.
6164 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6165 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6166 * target.h (Sized_target::emit_copy_reloc): New function.
6167 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6168
7cdb37d9
CC
61692011-06-02 Cary Coutant <ccoutant@google.com>
6170
6171 PR gold/12163
6172 * gold/archive.cc (Archive::Archive): Initialize new data member.
6173 (Archive::include_all_members): Return if archive has already been
6174 included.
6175 * gold/archive.h (Archive::include_all_members_): New data member.
6176
cc643b88
NC
61772011-06-02 Nick Clifton <nickc@redhat.com>
6178
6179 * dynobj.h: Fix spelling mistake in comment.
6180 * output.cc: Likewise.
6181
f62a3ca7 61822011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6183 Asier Llano
f62a3ca7
DK
6184
6185 PR gold/12826
cc643b88 6186 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6187 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6188 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6189 redundant arm_exidx_test.so.
6190 * testsuite/Makefile.in: Regenerate.
6191 (check_SCRIPTS): Add pr12826.sh
6192 (check_DATA): Add pr12826.stdout
6193 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6194 * testsuite/pr12826.sh: New file.
6195 * testsuite/pr12826_1.s: Ditto.
6196 * testsuite/pr12826_1.s: Ditto.
6197
8dbe1edc
ILT
61982011-05-30 Ian Lance Taylor <iant@google.com>
6199
6200 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6201 sections.
6202
c49875be
ILT
62032011-05-29 Ian Lance Taylor <iant@google.com>
6204
6205 PR gold/12804
6206 * testsuite/Makefile.am: Use different file name for two_file_test
6207 temporary file for each incremental test.
6208 * testsuite/Makefile.in: Rebuild.
6209
69d53f7a
ILT
62102011-05-29 Ian Lance Taylor <iant@google.com>
6211
6212 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6213 binary input file is empty.
6214
41d0ab5f
ILT
62152011-05-27 Ian Lance Taylor <iant@google.com>
6216
6217 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6218 (ver_test_9.so): Likewise.
6219 * testsuite/Makefile.in: Rebuild.
6220
89d8a36b
CC
62212011-05-26 Cary Coutant <ccoutant@google.com>
6222
6223 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6224 * incremental.cc (Incremental_inputs::report_input_section): Fix
6225 comment, indentation.
6226 (Incremental_inputs::report_comdat_group): New function.
6227 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6228 of data for incremental input file entry.
6229 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6230 group count, COMDAT group signatures.
6231 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6232 an unchanged input file.
6233 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6234 Initialize new data member.
6235 (Incremental_object_entry::add_comdat_group): New function.
6236 (Incremental_object_entry::get_comdat_group_count): New function.
6237 (Incremental_object_entry::get_comdat_signature_key): New function.
6238 (Incremental_object_entry::groups_): New data member.
6239 (Incremental_inputs::report_comdat_group): New function.
6240 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6241 data for incremental input file entry.
6242 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6243 (Incremental_input_entry_reader::get_input_section): Adjust size of
6244 data for incremental input file entry.
6245 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6246 (Incremental_input_entry_reader::get_comdat_group_signature): New
6247 function.
6248 * object.cc (Sized_relobj::include_section_group): Report kept
6249 COMDAT groups for incremental links.
6250
1706a06f
ILT
62512011-05-24 David Meyer <pdox@google.com>
6252
6253 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6254 with name parameter. Add found_name parameter.
6255 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6256 * dirsearch.h (class Dirsearch): Update declaration.
6257
a10ae760
ILT
62582011-05-24 Ian Lance Taylor <iant@google.com>
6259
6260 * archive.cc (Library_base::should_include_member): Pull in object
6261 from archive if it defines the entry symbol.
6262 * parameters.cc (Parameters::entry): New function.
6263 * parameters.h (class Parameters): Declare entry.
6264 * output.h (class Output_file_header): Remove entry_ field.
6265 * output.cc (Output_file_header::Output_file_header): Remove entry
6266 parameter. Change all callers.
6267 (Output_file_header::entry): Use parameters->entry.
6268 * gold.cc (queue_middle_tasks): Likewise.
6269 * plugin.cc (Plugin_hook::run): Likewise.
6270
aa92d6ed
CC
62712011-05-24 Cary Coutant <ccoutant@google.com>
6272
6273 * gold.cc (queue_initial_tasks): Pass incremental base filename
6274 to Output_file::open_base_file; don't print error message.
6275 * incremental-dump.cc (main): Adjust call to
6276 Output_file::open_for_modification.
6277 * incremental-dump.cc (main): Likewise.
6278 * incremental.cc (Incremental_inputs::report_command_line):
6279 Ignore --incremental-base option when comparing command lines.
6280 Ignore parameter when given as separate argument.
6281 * options.h (class General_options): Add --incremental-base.
6282 * output.cc (Output_file::Output_file):
6283 (Output_file::open_base_file): Add base_name and writable parameters;
6284 read base file into new file; print error message here.
6285 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6286 callers.
6287 * output.h (Output_file::open_for_modification): Rename to...
6288 (Output_file::open_base_file): ...this; add base_name and
6289 writable parameters; adjust all callers.
6290 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6291 callers.
6292 * testsuite/Makefile.am (incremental_test_4): Test
6293 --incremental-base.
6294 * testsuite/Makefile.in: Regenerate.
6295
2eedd706
CC
62962011-05-24 Cary Coutant <ccoutant@google.com>
6297
6298 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6299 incremental_test_4.
6300 * testsuite/Makefile.in: Regenerate.
6301 * testsuite/two_file_test_1_v1.cc: New test source file.
6302 * testsuite/two_file_test_1b_v1.cc: New test source file.
6303 * testsuite/two_file_test_2_v1.cc: New test source file.
6304
0f1c85a6
CC
63052011-05-24 Cary Coutant <ccoutant@google.com>
6306
6307 * dynobj.h (Dynobj::do_dynobj): New function.
6308 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6309 flag and soname for shared objects.
6310 * incremental.cc (Incremental_inputs::report_object): Make
6311 either Incremental_object_entry or Incremental_dynobj_entry; add
6312 soname to string table.
6313 (Incremental_inputs::report_input_section): Add assertion.
6314 (Output_section_incremental_inputs::set_final_data_size): Adjust
6315 type of input file entry for shared libraries; adjust size of
6316 shared library info entry.
6317 (Output_section_incremental_inputs::write_input_files): Write
6318 as_needed flag for shared libraries.
6319 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6320 of input file entry for shared libraries; write soname.
6321 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6322 soname from incremental info.
6323 * incremental.h (enum Incremental_input_flags): Add
6324 INCREMENTAL_INPUT_AS_NEEDED.
6325 (Incremental_input_entry::Incremental_input_entry): Initialize new
6326 data member.
6327 (Incremental_input_entry::set_as_needed): New function.
6328 (Incremental_input_entry::as_needed): New function.
6329 (Incremental_input_entry::do_dynobj_entry): New function.
6330 (Incremental_input_entry::as_needed_): New data member.
6331 (Incremental_object_entry::Incremental_object_entry): Don't check
6332 for shared library.
6333 (Incremental_object_entry::do_type): Likewise.
6334 (class Incremental_dynobj_entry): New class.
6335 (Incremental_input_entry_reader::as_needed): New function.
6336 (Incremental_input_entry_reader::get_soname): New function.
6337 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6338 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6339 size of shared library info entry.
58797674 6340 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6341 incremental link when adding DT_NEEDED entries.
6342 * object.h (Object::Object): Initialize new data member.
6343 (Object::dynobj): New function.
6344 (Object::set_as_needed): New function.
6345 (Object::as_needed): New function.
6346 (Object::do_dynobj): New function.
6347 (Object::as_needed_): New data member.
6348
6fa2a40b
CC
63492011-05-24 Cary Coutant <ccoutant@google.com>
6350
6351 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6352 info; adjust display of GOT entries.
6353 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6354 vector of input objects; remove file_status_.
6355 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6356 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6357 got_plt reader; call target hooks to reserve GOT entries.
6358 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6359 of input file info header and GOT info entry.
6360 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6361 relocation info.
6362 (Got_plt_view_info::got_descriptor): Remove.
6363 (Got_plt_view_info::sym_index): New data member.
6364 (Got_plt_view_info::input_index): New data member.
6365 (Local_got_offset_visitor::visit): Write input file index.
6366 (Global_got_offset_visitor::visit): Write 0 for input file index.
6367 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6368 with sym_index and input_index.
6369 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6370 incremental info GOT entry; replace got_descriptor with input_index.
6371 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6372 map from input file index to object.
6373 (Sized_relobj_incr::do_layout): Replace direct data member reference
6374 with accessor function.
6375 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6376 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6377 Adjust size of input file info header.
6378 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6379 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6380 (Incremental_input_entry_reader::get_input_section): Adjust size of
6381 input file info header.
6382 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6383 of incremental info GOT entry.
6384 (Incremental_got_plt_reader::get_got_desc): Remove.
6385 (Incremental_got_plt_reader::get_got_symndx): New function.
6386 (Incremental_got_plt_reader::get_got_input_index): New function.
6387 (Sized_incremental_binary::Sized_incremental_binary): Remove
6388 file_status_; add input_objects_.
6389 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6390 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6391 (Sized_incremental_binary::file_is_unchanged): Remove.
6392 (Sized_incremental_binary::set_input_object): New function.
6393 (Sized_incremental_binary::input_object): New function.
6394 (Sized_incremental_binary::file_status_): Remove.
6395 (Sized_incremental_binary::input_objects_): New data member.
6396 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6397 references.
6398 (Sized_relobj_incr::invalid_address): Move to base class.
6399 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6400 class.
6401 (Sized_relobj_incr::do_output_section_offset): Likewise.
6402 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6403 (Sized_relobj_incr::section_offsets_): Likewise.
6404 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6405 function.
6406 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6407 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6408 with accessor function.
6409 (Sized_relobj_file::do_layout): Likewise.
6410 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6411 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6412 (Sized_relobj_file::compute_final_local_value): Replace refs to
6413 section_offsets_ with accessor function.
6414 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6415 * object.h (Relobj::Relobj): Initialize new data members.
6416 (Relobj::add_dyn_reloc): New function.
6417 (Relobj::first_dyn_reloc): New function.
6418 (Relobj::dyn_reloc_count): New function.
6419 (Relobj::first_dyn_reloc_): New data member.
6420 (Relobj::dyn_reloc_count_): New data member.
6421 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6422 references.
6423 (Sized_relobj::Address): New typedef.
6424 (Sized_relobj::invalid_address): Move here from child class.
6425 (Sized_relobj::Sized_relobj): Initialize new data members.
6426 (Sized_relobj::sized_relobj): New function.
6427 (Sized_relobj::is_output_section_offset_invalid): Move here from
6428 child class.
6429 (Sized_relobj::get_output_section_offset): Likewise.
6430 (Sized_relobj::local_has_got_offset): Likewise.
6431 (Sized_relobj::local_got_offset): Likewise.
6432 (Sized_relobj::set_local_got_offset): Likewise.
6433 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6434 (Sized_relobj::clear_got_offsets): New function.
6435 (Sized_relobj::section_offsets): Move here from child class.
6436 (Sized_relobj::do_output_section_offset): Likewise.
6437 (Sized_relobj::do_set_section_offset): Likewise.
6438 (Sized_relobj::Local_got_offsets): Likewise.
6439 (Sized_relobj::local_got_offsets_): Likewise.
6440 (Sized_relobj::section_offsets_): Likewise.
6441 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6442 references.
6443 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6444 class.
6445 (Sized_relobj_file::sized_relobj): New function
6446 (Sized_relobj_file::local_has_got_offset): Move to base class.
6447 (Sized_relobj_file::local_got_offset): Likewise.
6448 (Sized_relobj_file::set_local_got_offset): Likewise.
6449 (Sized_relobj_file::get_output_section_offset): Likewise.
6450 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6451 (Sized_relobj_file::do_output_section_offset): Likewise.
6452 (Sized_relobj_file::do_set_section_offset): Likewise.
6453 (Sized_relobj_file::Local_got_offsets): Likewise.
6454 (Sized_relobj_file::local_got_offsets_): Likewise.
6455 (Sized_relobj_file::section_offsets_): Likewise.
6456 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6457 (all constructors).
6458 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6459 (Output_reloc::get_symbol_index): Likewise.
6460 (Output_reloc::local_section_offset): Likewise.
6461 (Output_reloc::get_address): Likewise.
6462 (Output_reloc::symbol_value): Likewise.
6463 (Output_data_got::reserve_slot): Move to class definition.
6464 (Output_data_got::reserve_local): New function.
6465 (Output_data_got::reserve_slot_for_global): Remove.
6466 (Output_data_got::reserve_global): New function.
6467 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6468 (all constructors, two instantiations).
6469 (Output_reloc::get_relobj): New function (two instantiations).
6470 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6471 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6472 (Output_data_reloc::add_global): Adjust type of relobj.
6473 (Output_data_reloc::add_global_relative): Likewise.
6474 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6475 (Output_data_reloc::add_local): Likewise.
6476 (Output_data_reloc::add_local_relative): Likewise.
6477 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6478 (Output_data_reloc::add_local_section): Likewise.
6479 (Output_data_reloc::add_output_section): Likewise.
6480 (Output_data_reloc::add_absolute): Likewise.
6481 (Output_data_reloc::add_target_specific): Likewise.
6482 (Output_data_got::reserve_slot): Move definition here.
6483 (Output_data_got::reserve_local): New function.
6484 (Output_data_got::reserve_global): New function.
6485 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6486 section_offsets_ with accessor function.
6487 (Sized_relobj_file::write_sections): Likewise.
6488 (Sized_relobj_file::do_relocate_sections): Likewise.
6489 * target.h (Sized_target::reserve_local_got_entry): New function.
6490 (Sized_target::reserve_global_got_entry): New function.
6491 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6492 (Target_x86_64::reserve_global_got_entry): New function.
6493 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6494
4829d394
CC
64952011-05-23 Cary Coutant <ccoutant@google.com>
6496
6497 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6498 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6499 bit when checking got_type.
6500 * incremental.cc (Sized_incremental_binary::setup_readers):
6501 Store symbol table and string table locations; initialize bit vector
6502 of file status flags.
6503 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6504 unchanged files.
6505 (Sized_incremental_binary::do_process_got_plt): New function.
6506 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6507 (Output_section_incremental_inputs::set_final_data_size): Record
6508 file index for each input file.
6509 (Output_section_incremental_inputs::write_got_plt): Store file index
6510 instead of input entry offset for each GOT entry.
6511 * incremental.h
6512 (Incremental_input_entry::Incremental_input_entry): Initialize new
6513 data member.
6514 (Incremental_input_entry::set_offset): Store file index.
6515 (Incremental_input_entry::get_file_index): New function.
6516 (Incremental_input_entry::file_index_): New data member.
6517 (Incremental_binary::process_got_plt): New function.
6518 (Incremental_binary::do_process_got_plt): New function.
6519 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6520 data members.
6521 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6522 (Sized_incremental_binary::set_file_is_unchanged): New function.
6523 (Sized_incremental_binary::file_is_unchanged): New function.
6524 (Sized_incremental_binary::do_process_got_plt): New function.
6525 (Sized_incremental_binary::file_status_): New data member.
6526 (Sized_incremental_binary::main_symtab_loc_): New data member.
6527 (Sized_incremental_binary::main_strtab_loc_): New data member.
6528 * output.cc (Output_data_got::Got_entry::write): Add case
6529 RESERVED_CODE.
6530 (Output_data_got::add_global): Call add_got_entry.
6531 (Output_data_got::add_global_plt): Likewise.
6532 (Output_data_got::add_global_with_rel): Likewise.
6533 (Output_data_got::add_global_with_rela): Likewise.
6534 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6535 (Output_data_got::add_global_pair_with_rela): Likewise.
6536 (Output_data_got::add_local): Call add_got_entry.
6537 (Output_data_got::add_local_plt): Likewise.
6538 (Output_data_got::add_local_with_rel): Likewise.
6539 (Output_data_got::add_local_with_rela): Likewise.
6540 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6541 (Output_data_got::add_local_pair_with_rela): Likewise.
6542 (Output_data_got::reserve_slot): New function.
6543 (Output_data_got::reserve_slot_for_global): New function.
6544 (Output_data_got::add_got_entry): New function.
6545 (Output_data_got::add_got_entry_pair): New function.
6546 (Output_section::add_output_section_data): Edit FIXME.
6547 * output.h
6548 (Output_section_data_build::Output_section_data_build): New
6549 constructor with size parameter.
6550 (Output_data_space::Output_data_space): Likewise.
6551 (Output_data_got::Output_data_got): Initialize new data member; new
6552 constructor with size parameter.
6553 (Output_data_got::add_constant): Call add_got_entry.
6554 (Output_data_got::reserve_slot): New function.
6555 (Output_data_got::reserve_slot_for_global): New function.
6556 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6557 (Output_data_got::add_got_entry): New function.
6558 (Output_data_got::add_got_entry_pair): New function.
6559 (Output_data_got::free_list_): New data member.
6560 * target.h (Sized_target::init_got_plt_for_update): New function.
6561 (Sized_target::register_global_plt_entry): New function.
6562 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6563 Initialize new data member; call init; add constructor with PLT count.
6564 (Output_data_plt_x86_64::init): New function.
6565 (Output_data_plt_x86_64::add_relocation): New function.
6566 (Output_data_plt_x86_64::reserve_slot): New function.
6567 (Output_data_plt_x86_64::free_list_): New data member.
6568 (Target_x86_64::init_got_plt_for_update): New function.
6569 (Target_x86_64::register_global_plt_entry): New function.
6570 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6571 incremental updates.
6572 (Output_data_plt_x86_64::add_relocation): New function.
6573 * testsuite/object_unittest.cc (Object_test): Set default options.
6574
ec69d6da
ILT
65752011-05-16 Ian Lance Taylor <iant@google.com>
6576
6577 * options.h (class General_options): Make -i a synonym for -r.
6578
732e31de
ILT
65792011-05-16 Ian Lance Taylor <iant@google.com>
6580
6581 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6582
403676b5
CC
65832011-05-10 Cary Coutant <ccoutant@google.com>
6584
6585 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6586 strip_all (-s).
6587
5b7b7d6e
ILT
65882011-05-06 Ian Lance Taylor <iant@google.com>
6589
6590 * layout.cc (Layout::layout): If the output section flags change,
6591 update the ordering.
6592
f0f9babf
CC
65932011-04-25 Cary Coutant <ccoutant@google.com>
6594
6595 * incremental-dump.cc (dump_incremental_inputs): Print local
6596 symbol info for each input file.
6597 * incremental.cc
6598 (Output_section_incremental_inputs::set_final_data_size): Add local
6599 symbol info to input file entries in incremental info.
6600 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6601 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6602 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6603 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6604 implementation.
6605 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6606 (Sized_incr_relobj::do_relocate): Write the local symbols.
6607 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6608 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6609 Adjust size of input file header.
6610 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6611 (Incremental_inputs_reader::get_local_symbol_count): New function.
6612 (Incremental_inputs_reader::get_input_section): Adjust size of input
6613 file header.
6614 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6615 (Sized_incr_relobj::This): New typedef.
6616 (Sized_incr_relobj::sym_size): New const data member.
6617 (Sized_incr_relobj::Local_symbol): New struct.
6618 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6619 (Sized_incr_relobj::do_local_symbol_offset): New function.
6620 (Sized_incr_relobj::local_symbol_count_): New data member.
6621 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6622 (Sized_incr_relobj::local_symbol_index_): New data member.
6623 (Sized_incr_relobj::local_symbol_offset_): New data member.
6624 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6625 (Sized_incr_relobj::local_symbols_): New data member.
6626 * object.h (Relobj::output_local_symbol_count): New function.
6627 (Relobj::local_symbol_offset): New function.
6628 (Relobj::do_output_local_symbol_count): New function.
6629 (Relobj::do_local_symbol_offset): New function.
6630 (Sized_relobj::do_output_local_symbol_count): New function.
6631 (Sized_relobj::do_local_symbol_offset): New function.
6632
d0a9ace3
ILT
66332011-04-22 Vladimir Simonov <sv@sw.ru>
6634
6635 * descriptors.cc (set_close_on_exec): New function.
6636 (Descriptors::open): Use set_close_on_exec.
6637 * output.cc (S_ISLNK): Define if not defined.
6638
94a3fc8b
CC
66392011-04-22 Cary Coutant <ccoutant@google.com>
6640
6641 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6642 global symbol map.
6643 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6644 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6645 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6646 relocations.
6647 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6648 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6649 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6650 * incremental.h
6651 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6652 function.
6653 (Incremental_binary::apply_incremental_relocs): New function.
6654 (Incremental_binary::do_apply_incremental_relocs): New function.
6655 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6656 data member.
6657 (Sized_incremental_binary::add_global_symbol): New function.
6658 (Sized_incremental_binary::global_symbol): New function.
6659 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6660 (Sized_incremental_binary::symbol_map_): New data member.
6661 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6662 * target.h (Sized_target::apply_relocation): New function.
6663 * target-reloc.h (apply_relocation): New function.
6664 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6665
c87e4302
DK
66662011-04-22 Doug Kwan <dougkwan@google.com>
6667
6668 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6669 flag of a SHT_ARM_EXIDX section.
2e702c99 6670 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6671 * testsuite/Makefile.in: Regenerate.
6672 * testsuite/arm_exidx_test.s: New file.
6673 * testsuite/arm_exidx_test.sh: Same.
6674
e7782cf6
CC
66752011-04-20 Cary Coutant <ccoutant@google.com>
6676
6677 PR gold/12689
6678 * archive.h (Incremental_archive_entry::Archive_member):
6679 Initialize arg_serial_ (second constructor).
6680
308ecdc7
ILT
66812011-04-17 Ian Lance Taylor <iant@google.com>
6682
6683 * object.cc (Relocate_info::location): Simplify location string.
6684 * errors.cc (Errors::error_at_location): Don't print program
6685 name.
6686 (Errors::warning_at_location): Likewise.
6687 (Errors::undefined_symbol): Likewise.
6688 * testsuite/debug_msg.sh: Update accordingly.
6689
bec5b579
CC
66902011-04-14 Cary Coutant <ccoutant@google.com>
6691
6692 * gold/layout.cc (Layout::symtab_section_offset): New function.
6693 * gold/layout.h (Layout::symtab_section_offset): New function.
6694 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6695
88597d34
ILT
66962011-04-12 Ian Lance Taylor <iant@google.com>
6697
6698 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6699 with MREMAP_MAYMOVE.
6700 * output.h (class Output_file): Add map_is_allocated_ field.
6701 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6702 not available, provide stubs. If mremap is not available, #define
6703 it to gold_mremap.
6704 (MREMAP_MAYMOVE): Define if not defined.
6705 (Output_file::Output_file): Initialize map_is_allocated_.
6706 (Output_file::resize): Check map_is_allocated_.
6707 (Output_file::map_anonymous): If mmap fails, use malloc.
6708 (Output_file::unmap): Don't do anything for an anonymous map.
6709 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6710 is not available, provide stubs.
6711 (File_read::View::~View): Use free rather than delete[].
6712 (File_read::make_view): Use malloc rather than new[]. If mmap
6713 fails, use malloc.
6714 (File_read::find_or_make_view): Use malloc rather than new[].
6715 * gold.h: Remove HAVE_REMAP code.
6716 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6717 exists. Rename mremap to gold_mremap. If mmap is not available
6718 don't do anything.
6719 * configure, config.in: Rebuild.
6720
11e361bc
ILT
67212011-04-11 Ian Lance Taylor <iant@google.com>
6722
6723 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6724 initialize local variable v.
6725
cdc29364
CC
67262011-04-11 Cary Coutant <ccoutant@google.com>
6727
6728 * archive.cc (Archive::include_member): Adjust call to
6729 report_object.
6730 (Add_archive_symbols::run): Track argument serial numbers.
6731 (Lib_group::include_member): Likewise.
6732 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6733 * archive.h (Incremental_archive_entry::Archive_member):
6734 Initialize arg_serial_.
6735 (Archive_member::arg_serial_): New data member.
6736 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6737 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6738 incremental link.
6739 (Sized_dynobj::do_for_all_local_got_entries): New function.
6740 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6741 function.
6742 * fileread.cc (get_mtime): New function.
6743 * fileread.h (get_mtime): New function.
6744 * gold.cc (queue_initial_tasks): Check for incremental update.
6745 (process_incremental_input): New function.
6746 (queue_middle_tasks): Don't force valid target for incremental
6747 update.
6748 * incremental-dump.cc (find_input_containing_global): Adjust
6749 size of symbol info entry.
6750 (dump_incremental_inputs): Dump argument serial number and
6751 in_system_directory flag; bias shndx by 1; print symbol names
6752 when dumping per-file symbol lists; use new symbol info readers.
6753 * incremental.cc
6754 (Output_section_incremental_inputs:update_data_size): New function.
6755 (Sized_incremental_binary::setup_readers): Setup input readers
6756 for each input file; build maps for files added from libraries
6757 and scripts.
6758 (Sized_incremental_binary::check_input_args): New function.
6759 (Sized_incremental_binary::do_check_inputs): Build map of argument
6760 serial numbers to input arguments.
6761 (Sized_incremental_binary::do_file_has_changed): Rename
6762 do_file_is_unchanged to this; compare file modification times.
6763 (Sized_incremental_binary::do_init_layout): New function.
6764 (Sized_incremental_binary::do_reserve_layout): New function.
6765 (Sized_incremental_binary::do_get_input_reader): Remove.
6766 (Sized_incremental_binary::get_symtab_view): New function.
6767 (Incremental_checker::can_incrementally_link_output_file): Remove.
6768 (Incremental_inputs::report_command_line): Exclude --debug options.
6769 (Incremental_inputs::report_archive_begin): Add parameter; track
6770 argument serial numbers; don't put input file entry for archive
6771 before archive members.
6772 (Incremental_inputs::report_archive_end): Put input file entry
6773 for archive after archive members.
6774 (Incremental_inputs::report_object): Add parameter; track argument
6775 serial numbers and in_system_directory flag.
6776 (Incremental_inputs::report_script): Add parameter; track argument
6777 serial numbers.
6778 (Output_section_incremental_inputs::set_final_data_size): Adjust
6779 size of symbol info entry; check for forwarding symbols.
6780 (Output_section_incremental_inputs::write_input_files): Write
6781 in_system_directory flag and argument serial number.
6782 (Output_section_incremental_inputs::write_info_blocks): Map section
6783 indices between incremental info and original input file; store
6784 input section index for each symbol.
6785 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6786 change operator() to visit().
6787 (class Global_got_offset_visitor): Likewise.
6788 (class Global_symbol_visitor_got_plt):
6789 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6790 classes.
6791 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6792 (Sized_incr_relobj::do_read_symbols): New function.
6793 (Sized_incr_relobj::do_layout): New function.
6794 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6795 (Sized_incr_relobj::do_add_symbols): New function.
6796 (Sized_incr_relobj::do_should_include_member): New function.
6797 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6798 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6799 (Sized_incr_relobj::do_section_size): New function.
6800 (Sized_incr_relobj::do_section_name): New function.
6801 (Sized_incr_relobj::do_section_contents): New function.
6802 (Sized_incr_relobj::do_section_flags): New function.
6803 (Sized_incr_relobj::do_section_entsize): New function.
6804 (Sized_incr_relobj::do_section_address): New function.
6805 (Sized_incr_relobj::do_section_type): New function.
6806 (Sized_incr_relobj::do_section_link): New function.
6807 (Sized_incr_relobj::do_section_info): New function.
6808 (Sized_incr_relobj::do_section_addralign): New function.
6809 (Sized_incr_relobj::do_initialize_xindex): New function.
6810 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6811 (Sized_incr_relobj::do_read_relocs): New function.
6812 (Sized_incr_relobj::do_gc_process_relocs): New function.
6813 (Sized_incr_relobj::do_scan_relocs): New function.
6814 (Sized_incr_relobj::do_count_local_symbols): New function.
6815 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6816 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6817 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6818 (Sized_incr_relobj::do_relocate): New function.
6819 (Sized_incr_relobj::do_set_section_offset): New function.
6820 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6821 (Sized_incr_dynobj::do_read_symbols): New function.
6822 (Sized_incr_dynobj::do_layout): New function.
6823 (Sized_incr_dynobj::do_add_symbols): New function.
6824 (Sized_incr_dynobj::do_should_include_member): New function.
6825 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6826 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6827 (Sized_incr_dynobj::do_section_size): New function.
6828 (Sized_incr_dynobj::do_section_name): New function.
6829 (Sized_incr_dynobj::do_section_contents): New function.
6830 (Sized_incr_dynobj::do_section_flags): New function.
6831 (Sized_incr_dynobj::do_section_entsize): New function.
6832 (Sized_incr_dynobj::do_section_address): New function.
6833 (Sized_incr_dynobj::do_section_type): New function.
6834 (Sized_incr_dynobj::do_section_link): New function.
6835 (Sized_incr_dynobj::do_section_info): New function.
6836 (Sized_incr_dynobj::do_section_addralign): New function.
6837 (Sized_incr_dynobj::do_initialize_xindex): New function.
6838 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6839 (make_sized_incremental_object): New function.
6840 (Incremental_library::copy_unused_symbols): New function.
6841 (Incremental_library::do_for_all_unused_symbols): New function.
6842 * incremental.h (enum Incremental_input_flags): New type.
6843 (class Incremental_checker): Remove.
6844 (Incremental_input_entry::Incremental_input_entry): Add argument
6845 serial number.
6846 (Incremental_input_entry::arg_serial): New function.
6847 (Incremental_input_entry::set_is_in_system_directory): New function.
6848 (Incremental_input_entry::is_in_system_directory): New function.
6849 (Incremental_input_entry::arg_serial_): New data member.
6850 (Incremental_input_entry::is_in_system_directory_): New data member.
6851 (class Script_info): Move here from script.h.
6852 (Script_info::Script_info): Add filename parameter.
6853 (Script_info::filename): New function.
6854 (Script_info::filename_): New data member.
6855 (Incremental_script_entry::Incremental_script_entry): Add argument
6856 serial number.
6857 (Incremental_object_entry::Incremental_object_entry): Likewise.
6858 (Incremental_object_entry::add_input_section): Build list of input
6859 sections with map to original shndx.
6860 (Incremental_object_entry::get_input_section_index): New function.
6861 (Incremental_object_entry::shndx_): New data member.
6862 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6863 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6864 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6865 serial number.
6866 (Incremental_inputs::report_archive_begin): Likewise.
6867 (Incremental_inputs::report_object): Likewise.
6868 (Incremental_inputs::report_script): Likewise.
6869 (class Incremental_global_symbol_reader): New class.
6870 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6871 and store flags and input file type.
6872 (Incremental_input_entry_reader::arg_serial): New function.
6873 (Incremental_input_entry_reader::type): Extract type from flags.
6874 (Incremental_input_entry_reader::is_in_system_directory): New function.
6875 (Incremental_input_entry_reader::get_input_section_count): Call
6876 accessor function for type.
6877 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6878 function for type; adjust size of global symbol entry.
6879 (Incremental_input_entry_reader::get_global_symbol_count): Call
6880 accessor function for type.
6881 (Incremental_input_entry_reader::get_object_count): Likewise.
6882 (Incremental_input_entry_reader::get_object_offset): Likewise.
6883 (Incremental_input_entry_reader::get_member_count): Likewise.
6884 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6885 (Incremental_input_entry_reader::get_member_offset): Likewise.
6886 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6887 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6888 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6889 (Incremental_input_entry_reader::get_global_symbol_reader): New
6890 function.
6891 (Incremental_input_entry_reader::get_output_symbol_index): New
6892 function.
6893 (Incremental_input_entry_reader::type_): Remove.
6894 (Incremental_input_entry_reader::flags_): New data member.
6895 (Incremental_inputs_reader::input_file_offset): New function.
6896 (Incremental_inputs_reader::input_file_index): New function.
6897 (Incremental_inputs_reader::input_file): Call input_file_offset.
6898 (Incremental_inputs_reader::input_file_at_offset): New function.
6899 (Incremental_relocs_reader::get_r_type): Reformat.
6900 (Incremental_relocs_reader::get_r_shndx): Reformat.
6901 (Incremental_relocs_reader::get_r_offset): Reformat.
6902 (Incremental_relocs_reader::data): New function.
6903 (Incremental_binary::Incremental_binary): Initialize new data members.
6904 (Incremental_binary::check_inputs): Add cmdline parameter.
6905 (Incremental_binary::file_is_unchanged): Remove.
6906 (Input_reader::arg_serial): New function.
6907 (Input_reader::get_unused_symbol_count): New function.
6908 (Input_reader::get_unused_symbol): New function.
6909 (Input_reader::do_arg_serial): New function.
6910 (Input_reader::do_get_unused_symbol_count): New function.
6911 (Input_reader::do_get_unused_symbol): New function.
6912 (Incremental_binary::input_file_count): New function.
6913 (Incremental_binary::get_input_reader): Change signature to use
6914 index instead of filename.
6915 (Incremental_binary::file_has_changed): New function.
6916 (Incremental_binary::get_input_argument): New function.
6917 (Incremental_binary::get_library): New function.
6918 (Incremental_binary::get_script_info): New function.
6919 (Incremental_binary::init_layout): New function.
6920 (Incremental_binary::reserve_layout): New function.
6921 (Incremental_binary::output_file): New function.
6922 (Incremental_binary::do_check_inputs): New function.
6923 (Incremental_binary::do_file_is_unchanged): Remove.
6924 (Incremental_binary::do_file_has_changed): New function.
6925 (Incremental_binary::do_init_layout): New function.
6926 (Incremental_binary::do_reserve_layout): New function.
6927 (Incremental_binary::do_input_file_count): New function.
6928 (Incremental_binary::do_get_input_reader): Change signature.
6929 (Incremental_binary::input_args_map_): New data member.
6930 (Incremental_binary::library_map_): New data member.
6931 (Incremental_binary::script_map_): New data member.
6932 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6933 new data members.
6934 (Sized_incremental_binary::output_section): New function.
6935 (Sized_incremental_binary::inputs_reader): Add const.
6936 (Sized_incremental_binary::symtab_reader): Add const.
6937 (Sized_incremental_binary::relocs_reader): Add const.
6938 (Sized_incremental_binary::got_plt_reader): Add const.
6939 (Sized_incremental_binary::get_symtab_view): New function.
6940 (Sized_incremental_binary::Inputs_reader): New typedef.
6941 (Sized_incremental_binary::Input_entry_reader): New typedef.
6942 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6943 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6944 (Sized_incremental_binary::do_file_has_changed): New function.
6945 (Sized_incremental_binary::do_init_layout): New function.
6946 (Sized_incremental_binary::do_reserve_layout): New function.
6947 (Sized_input_reader::Inputs_reader): Remove.
6948 (Sized_input_reader::Input_entry_reader): Remove.
6949 (Sized_input_reader::do_arg_serial): New function.
6950 (Sized_input_reader::do_get_unused_symbol_count): New function.
6951 (Sized_input_reader::do_get_unused_symbol): New function.
6952 (Sized_incremental_binary::do_input_file_count): New function.
6953 (Sized_incremental_binary::do_get_input_reader): Change signature;
6954 use index instead of filename.
6955 (Sized_incremental_binary::section_map_): New data member.
6956 (Sized_incremental_binary::input_entry_readers_): New data member.
6957 (class Sized_incr_relobj): New class.
6958 (class Sized_incr_dynobj): New class.
6959 (make_sized_incremental_object): New function.
6960 (class Incremental_library): New class.
6961 * layout.cc (Free_list::num_lists): New static data member.
6962 (Free_list::num_nodes): New static data member.
6963 (Free_list::num_removes): New static data member.
6964 (Free_list::num_remove_visits): New static data member.
6965 (Free_list::num_allocates): New static data member.
6966 (Free_list::num_allocate_visits): New static data member.
6967 (Free_list::init): New function.
6968 (Free_list::remove): New function.
6969 (Free_list::allocate): New function.
6970 (Free_list::dump): New function.
6971 (Free_list::print_stats): New function.
6972 (Layout_task_runner::run): Resize output file for incremental updates.
6973 (Layout::Layout): Initialize new data members.
6974 (Layout::set_incremental_base): New function.
6975 (Layout::init_fixed_output_section): New function.
6976 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6977 incremental updates.
6978 (Layout::create_gold_note): Do not create gold note section for
6979 incremental updates.
6980 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6981 for incremental updates.
6982 (Layout::set_section_offsets): For incremental updates, allocate space
6983 from free list.
6984 (Layout::create_symtab_sections): Layout with offsets relative to
6985 start of section; for incremental updates, allocate space from free
6986 list.
6987 (Layout::create_shdrs): For incremental updates, allocate space from
6988 free list.
6989 (Layout::finish_dynamic_section): For incremental updates, do not
6990 check --as-needed (fixed in subsequent patch).
6991 * layout.h (class Free_list): New class.
6992 (Layout::set_incremental_base): New function.
6993 (Layout::incremental_base): New function.
6994 (Layout::init_fixed_output_section): New function.
6995 (Layout::allocate): New function.
6996 (Layout::incremental_base_): New data member.
6997 (Layout::free_list_): New data member.
6998 * main.cc (main): Print Free_list statistics.
6999 * object.cc (Relobj::finalize_incremental_relocs): Add
7000 clear_counts parameter; clear counts only when clear_counts is set.
7001 (Sized_relobj::Sized_relobj): Initialize new base class.
7002 (Sized_relobj::do_layout): Don't report special sections.
7003 (Sized_relobj::do_for_all_local_got_entries): New function.
7004 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7005 symtab_off to all symbol table offsets.
7006 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7007 * object.h (class Got_offset_list): Move to top of file.
7008 (Object::Object): Allow case where input_file == NULL.
7009 (Object::~Object): Likewise.
7010 (Object::input_file): Assert that input_file != NULL.
7011 (Object::lock): Allow case where input_file == NULL.
7012 (Object::unlock): Likewise.
7013 (Object::is_locked): Likewise.
7014 (Object::token): Likewise.
7015 (Object::release): Likewise.
7016 (Object::is_incremental): New function.
7017 (Object::get_mtime): New function.
7018 (Object::for_all_local_got_entries): New function.
7019 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7020 (Object::set_is_in_system_directory): New function.
7021 (Object::is_in_system_directory): New function.
7022 (Object::do_is_incremental): New function.
7023 (Object::do_get_mtime): New function.
7024 (Object::do_for_all_local_got_entries): New function.
7025 (Object::is_in_system_directory_): New data member.
7026 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7027 (class Sized_relobj_base): New class.
7028 (class Sized_relobj): Derive from Sized_relobj_base.
7029 (class Sized_relobj::Symbols): Redeclare from base class.
7030 (class Sized_relobj::local_got_offset_list): Remove.
7031 (class Sized_relobj::Output_sections): Redeclare from base class.
7032 (class Sized_relobj::do_for_all_local_got_entries): New function.
7033 (class Sized_relobj::write_local_symbols): Add offset parameter.
7034 (class Sized_relobj::local_symbol_offset_): Update comment.
7035 (class Sized_relobj::local_dynsym_offset_): Update comment.
7036 * options.cc (Input_arguments::add_file): Remove const.
7037 * options.h (Input_file_argument::Input_file_argument):
7038 Initialize arg_serial_ (all constructors).
7039 (Input_file_argument::set_arg_serial): New function.
7040 (Input_file_argument::arg_serial): New function.
7041 (Input_file_argument::arg_serial_): New data member.
7042 (Input_arguments::Input_arguments): Initialize file_count_.
7043 (Input_arguments::add_file): Remove const.
7044 (Input_arguments::number_of_input_files): New function.
7045 (Input_arguments::file_count_): New data member.
7046 (Command_line::number_of_input_files): Call
7047 Input_arguments::number_of_input_files.
7048 * output.cc (Output_segment_headers::Output_segment_headers):
7049 Set current size.
7050 (Output_section::Input_section::current_data_size): New function.
7051 (Output_section::Output_section): Initialize new data members.
7052 (Output_section::add_input_section): Don't do merge sections for
7053 an incremental link; allocate space from free list for an
7054 incremental update.
7055 (Output_section::add_output_section_data): Allocate space from
7056 free list for an incremental update.
7057 (Output_section::update_data_size): New function.
7058 (Output_section::set_fixed_layout): New function.
7059 (Output_section::reserve): New function.
7060 (Output_segment::set_section_addresses): Remove const.
7061 (Output_segment::set_section_list_addresses): Remove const; allocate
7062 space from free list for an incremental update.
7063 (Output_segment::set_offset): Adjust size of RELRO segment for an
7064 incremental update.
7065 * output.h (Output_data::current_data_size): Move here from
7066 child classes.
7067 (Output_data::pre_finalize_data_size): New function.
7068 (Output_data::update_data_size): New function.
7069 (Output_section_headers::update_data_size): new function.
7070 (Output_section_data_build::current_data_size): Move to Output_data.
7071 (Output_data_strtab::update_data_size): New function.
7072 (Output_section::current_data_size): Move to Output_data.
7073 (Output_section::set_fixed_layout): New function.
7074 (Output_section::has_fixed_layout): New function.
7075 (Output_section::reserve): New function.
7076 (Output_section::update_data_size): New function.
7077 (Output_section::has_fixed_layout_): New data member.
7078 (Output_section::free_list_): New data member.
7079 (Output_segment::set_section_addresses): Remove const.
7080 (Output_segment::set_section_list_addresses): Remove const.
7081 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7082 New function.
7083 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7084 New function.
7085 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7086 parameter when calling Add_symbols constructor; store argument
7087 serial number for members of a lib group.
7088 (Add_symbols::locks): Allow case where token == NULL.
7089 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7090 (Read_member::~Read_member): New function.
7091 (Read_member::is_runnable): New function.
7092 (Read_member::locks): New function.
7093 (Read_member::run): New function.
7094 (Check_script::~Check_script): New function.
7095 (Check_script::is_runnable): New function.
7096 (Check_script::locks): New function.
7097 (Check_script::run): New function.
7098 (Check_library::~Check_library): New function.
7099 (Check_library::is_runnable): New function.
7100 (Check_library::locks): New function.
7101 (Check_library::run): New function.
7102 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7103 (Add_symbols::library_): New data member.
7104 (class Read_member): New class.
7105 (class Check_script): New class.
7106 (class Check_library): New class.
7107 * reloc.cc (Read_relocs::is_runnable): Allow case where
7108 token == NULL.
7109 (Read_relocs::locks): Likewise.
7110 (Scan_relocs::locks): Likewise.
7111 (Relocate_task::locks): Likewise.
7112 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7113 to clear counters.
7114 (Sized_relobj::incremental_relocs_scan): Fix comment.
7115 (Sized_relobj::do_relocate): Pass output file offset to
7116 write_local_symbols.
7117 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7118 from class declaration.
7119 * script.cc (read_input_script): Allocate Script_info; pass
7120 argument serial number to report_script.
7121 * script.h (class Script_info): Move to incremental.h.
7122 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7123 * symtab.h (Symbol_table::add_from_incrobj): New function.
7124 (Symbol_table::set_file_offset): New function.
7125
b961d0d7
CC
71262011-04-05 Cary Coutant <ccoutant@google.com>
7127
7128 * incremental-dump.cc (dump_incremental_inputs): Change signature
7129 to take a Sized_incremental_binary; change caller. Use readers
7130 in Sized_incremental_binary.
7131 * incremental.cc
7132 (Sized_incremental_binary::find_incremental_inputs_sections):
7133 Rename do_find_incremental_inputs_sections to this.
7134 (Sized_incremental_binary::setup_readers): New function.
7135 (Sized_incremental_binary::do_check_inputs): Check
7136 has_incremental_info_ flag; move setup code to setup_readers;
7137 use input readers.
7138 (Sized_incremental_binary::do_file_is_unchanged): New function.
7139 (Sized_incremental_binary::do_get_input_reader): New function.
7140 * incremental.h (class Incremental_binary): Move to end of file.
7141 (Incremental_binary::file_is_unchanged): New function.
7142 (Incremental_binary::do_file_is_unchanged): New function.
7143 (Incremental_binary::Input_reader): New class.
7144 (Incremental_binary::get_input_reader): New function.
7145 (class Sized_incremental_binary): Move to end of file.
7146 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7147 input section reader classes.
7148 (Sized_incremental_binary::has_incremental_info): New function.
7149 (Sized_incremental_binary::inputs_reader): New function.
7150 (Sized_incremental_binary::symtab_reader): New function.
7151 (Sized_incremental_binary::relocs_reader): New function.
7152 (Sized_incremental_binary::got_plt_reader): New function.
7153 (Sized_incremental_binary::do_file_is_unchanged): New function.
7154 (Sized_incremental_binary::Sized_input_reader): New class.
7155 (Sized_incremental_binary::get_input_reader): New function.
7156 (Sized_incremental_binary::find_incremental_inputs_sections):
7157 Rename do_find_incremental_inputs_sections to this.
7158 (Sized_incremental_binary::setup_readers): New function.
7159 (Sized_incremental_binary::has_incremental_info_): New data member.
7160 (Sized_incremental_binary::inputs_reader_): New data member.
7161 (Sized_incremental_binary::symtab_reader_): New data member.
7162 (Sized_incremental_binary::relocs_reader_): New data member.
7163 (Sized_incremental_binary::got_plt_reader_): New data member.
7164 (Sized_incremental_binary::current_input_file_): New data member.
7165
a869183f
PP
71662011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7167
7168 PR gold/12640
7169 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7170 violation.
7171
71722011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7173
7174 * archive.cc (Archive::include_member): Adjust call to report_object.
7175 (Add_archive_symbols::run): Add script_info to call to
7176 report_archive_begin.
7177 (Lib_group::include_member): Adjust call to report_object.
7178 (Add_lib_group_symbols::run): Adjust call to report_object.
7179 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7180 blocks. Add object count for script input files.
7181 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7182 script_info parameter; change all callers.
7183 (Incremental_inputs::report_object): Add script_info parameter;
7184 change all callers.
7185 (Incremental_inputs::report_script): Store backpointer to
7186 incremental info entry.
7187 (Output_section_incremental_inputs::set_final_data_size): Record
7188 additional information for scripts.
7189 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7190 * incremental.h (Incremental_script_entry::add_object): New function.
7191 (Incremental_script_entry::get_object_count): New function.
7192 (Incremental_script_entry::get_object): New function.
7193 (Incremental_script_entry::objects_): New data member; adjust
7194 constructor.
7195 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7196 (Incremental_inputs::report_object): Add script_info parameter.
7197 (Incremental_inputs_reader::get_object_count): New function.
7198 (Incremental_inputs_reader::get_object_offset): New function.
7199 * options.cc (Input_arguments::add_file): Return reference to
7200 new input argument.
7201 * options.h (Input_argument::set_script_info): New function.
7202 (Input_argument::script_info): New function.
7203 (Input_argument::script_info_): New data member; adjust all
7204 constructors.
7205 (Input_file_group::add_file): Return reference to new input argument.
7206 (Input_file_lib::add_file): Likewise.
7207 (Input_arguments::add_file): Likewise.
7208 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7209 * script.cc (Parser_closure::Parser_closure): Add script_info
7210 parameter; adjust all callers.
7211 (Parser_closure::script_info): New function.
7212 (Parser_closure::script_info_): New data member.
7213 (read_input_script): Report scripts earlier to incremental info.
7214 (script_add_file): Set script_info in Input_argument.
7215 (script_add_library): Likewise.
7216 * script.h (Script_options::Script_info): Rewrite class.
7217
a869183f 72182011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7219
7220 * archive.cc (Library_base::should_include_member): Move
7221 method here from class Archive.
7222 (Archive::Archive): Initialize base class.
7223 (Archive::should_include_member): Move to base class.
7224 (Archive::do_for_all_unused_symbols): New function.
7225 (Add_archive_symbols::run): Remove redundant access to
7226 incremental_inputs.
7227 (Lib_group::Lib_group): Initialize base class.
7228 (Lib_group::do_filename): New function.
7229 (Lib_group::include_member): Pass pointer to Lib_group to
7230 report_object.
7231 (Lib_group::do_for_all_unused_symbols): New function.
7232 (Add_lib_group_symbols::run): Report archive information for
7233 incremental links.
7234 * archive.h (class Library_base): New base class.
7235 (class Archive): Derive from Library_base.
7236 (Archive::filename): Move to base class.
7237 (Archive::set_incremental_info): Likewise.
7238 (Archive::incremental_info): Likewise.
7239 (Archive::Should_include): Likewise.
7240 (Archive::should_include_member): Likewise.
7241 (Archive::Armap_entry): Remove.
7242 (Archive::Unused_symbol_iterator): Remove.
7243 (Archive::unused_symbols_begin): Remove.
7244 (Archive::unused_symbols_end): Remove.
7245 (Archive::do_filename): New function.
7246 (Archive::do_get_mtime): New function.
7247 (Archive::do_for_all_unused_symbols): New function.
7248 (Archive::task_): Move to base class.
7249 (Archive::incremental_info_): Likewise.
7250 (class Lib_group): Derive from Library_base.
7251 (Lib_group::do_filename): New function.
7252 (Lib_group::do_get_mtime): New function.
7253 (Lib_group::do_for_all_unused_symbols): New function.
7254 (Lib_group::task_): Move to base class.
7255 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7256 function.
7257 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7258 function.
7259 * incremental.cc (Incremental_inputs::report_archive_begin):
7260 Use Library_base; call library's get_mtime; add incremental inputs
7261 entry before members.
7262 (class Unused_symbol_visitor): New class.
7263 (Incremental_inputs::report_archive_end): Use Library_base; use
7264 visitor class to record unused symbols; don't add incremental inputs
7265 entry after members.
7266 (Incremental_inputs::report_object): Use Library_base.
7267 * incremental.h
7268 (Incremental_archive_entry::Incremental_archive_entry): Remove
7269 unused Archive parameter.
7270 (Incremental_inputs::report_archive_begin): Use Library_base.
7271 (Incremental_inputs::report_archive_end): Likewise.
7272 (Incremental_inputs::report_object): Likewise.
7273 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7274 function.
7275 * object.h (Object::for_all_global_symbols): New function.
7276 (Object::do_for_all_global_symbols): New function.
7277 (Sized_relobj::do_for_all_global_symbols): New function.
7278 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7279 function.
7280 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7281 function.
7282
61ab3e40
ILT
72832011-03-27 Ian Lance Taylor <iant@google.com>
7284
7285 * archive.cc (Archive::interpret_header): Return -1 if something
7286 goes wrong. Change callers accordingly.
7287
30e1f9e6
CC
72882011-03-25 Cary Coutant <ccoutant@google.com>
7289
7290 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7291 * testsuite/Makefile.in: Regenerate.
7292
9370ce59 72932011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7294
7295 * plugin.cc (get_view): New.
7296 (Plugin::load): Pass get_view to the plugin.
7297 (Plugin_manager::get_view): New.
7298
9312bb0a
ILT
72992011-03-21 Ian Lance Taylor <iant@google.com>
7300
7301 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7302 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7303
7e12ba9e
ST
73042011-03-21 Sriraman Tallam <tmsriram@google.com>
7305
7306 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7307 Change == to -eq.
7308 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7309 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7310 Change == to -eq.
7311 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7312 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7313
fd7a005d
ILT
73142011-03-14 Ian Lance Taylor <iant@google.com>
7315
7316 * script-sections.cc (Sort_output_sections::script_compare):
7317 Rename from is_before, change return type.
7318 (Sort_output_sections::operator()): Adjust accordingly.
7319
ed16fd1b
ILT
73202011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7321
7322 PR gold/12572
7323 * testsuite/odr_violation2.cc: Add comment to make all error line
7324 numbers double digits.
7325 * testsuite/debug_msg.sh: Adjust expected errors.
7326
71ff8986
ILT
73272011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7328
7329 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7330 but mark earlier ones as non-canonical
7331 (offset_to_iterator): Update search target and example
7332 (do_addr2line): Return extra lines in a vector*
7333 (format_file_lineno): Extract from do_addr2line
7334 (one_addr2line): Add vector* out-param
7335 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7336 when a lineno entry appeared last for its instruction
7337 (Dwarf_line_info): Add vector* out-param
7338 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7339 * symtab.cc (Odr_violation_compare): Include the lineno in the
7340 comparison again.
7341 (linenos_from_loc): New. Combine the canonical line for an
7342 address with its other lines.
7343 (True_if_intersect): New. Helper functor to make
7344 std::set_intersection a query.
7345 (detect_odr_violations): Compare sets of lines instead of just
7346 one line for each function. This became less deterministic, but
7347 has fewer false positives.
7348 * symtab.h: Declarations.
7349 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7350 mix an optimized and non-optimized object in the same binary
7351 (odr_violation2.so): Same.
7352 * testsuite/Makefile.in: Regenerate from Makefile.am.
7353 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7354 * testsuite/debug_msg.sh: Update line numbers and add
7355 assertions.
7356 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7357 non-optimized context.
7358 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7359 isn't inlined, and use OdrDerived in an optimized context.
7360 * testsuite/odr_header1.h: Defines OdrDerived, where
7361 optimization will change the
7362 first-instruction-in-the-destructor's file and line number.
7363 * testsuite/odr_header2.h: Defines OdrBase.
7364
a19fefdc
ILT
73652011-03-09 Ian Lance Taylor <iant@google.com>
7366
7367 * fileread.cc (File_read::clear_views): Don't delete the whole
7368 file view.
7369
ecb351e9
ILT
73702011-03-08 Ian Lance Taylor <iant@google.com>
7371
7372 PR gold/12525
7373 * fileread.cc: #include <climits>.
7374 (GOLD_IOV_MAX): Define.
7375 (File_read::read_multiple): Limit number of entries by iov_max.
7376 * fileread.h (class File_read): Always set max_readv_entries to
7377 128.
7378
b821d13c
ILT
73792011-03-07 Ian Lance Taylor <iant@google.com>
7380
7381 PR gold/12525
7382 * options.h (class General_options): Add -dy and -dn.
7383
89243142
CC
73842011-03-02 Cary Coutant <ccoutant@google.com>
7385
7386 * testsuite/script_test_9.t: Add TLS segment.
7387
d0773f31
ILT
73882011-03-02 Simon Baldwin <simonb@google.com>
7389
7390 * configure.ac: Add check for gnu_indirect_function support in
7391 the toolchain building binutils.
7392 * configure: Rebuild.
7393
9370ce59 73942011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7395
7396 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7397 plugin only symbols.
7398 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7399 in plugin files as not needed in the symbol table.
7400
4cf7a849
ST
74012011-02-11 Sriraman Tallam <tmsriram@google.com>
7402
7403 * output.cc (Output_section::add_input_section): Delay fill
7404 generation for section ordering.
7405
b578bd7d
ILT
74062011-02-09 Ian Lance Taylor <iant@google.com>
7407
7408 PR gold/12316
7409 * object.h (class Sized_relobj): Remove clear_local_symbols.
7410 * reloc.cc (Sized_relobj::do_relocate): Don't call
7411 clear_local_symbols.
7412
9370ce59 74132011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7414
7415 * plugin.cc (is_visible_from_outside): Return true for symbols
7416 in the -u option.
7417
55382fb7
ILT
74182011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7419
7420 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7421 filename.
7422
4e271fff
ST
74232011-02-02 Sriraman Tallam <tmsriram@google.com>
7424
7425 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7426 to std::string.
4e271fff 7427 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7428 section_name to be std::string.
4e271fff
ST
7429 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7430
d433c3ac
ILT
74312011-01-25 Ian Lance Taylor <iant@google.com>
7432
7433 * script.cc (script_add_extern): Rewrite to use
7434 add_symbol_reference.
7435
880473a6
DK
74362011-01-25 Doug Kwan <dougkwan@google.com>
7437
d433c3ac 7438 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7439
f30f86fa
ILT
74402011-01-24 Ian Lance Taylor <iant@google.com>
7441
7442 * options.h (class General_options): Accept
7443 --no-detect-odr-violations.
7444
8e51a0b9
ILT
74452011-01-24 Ian Lance Taylor <iant@google.com>
7446
7447 * version.cc (version_string): Bump to 1.11.
7448
0f3b89d8
ILT
74492011-01-24 Ian Lance Taylor <iant@google.com>
7450
7451 * plugin.cc (class Plugin_rescan): Define new class.
7452 (Plugin_manager::claim_file): Set any_claimed_.
7453 (Plugin_manager::save_archive): New function.
7454 (Plugin_manager::save_input_group): New function.
7455 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7456 necessary.
7457 (Plugin_manager::new_undefined_symbol): New function.
7458 (Plugin_manager::rescan): New function.
7459 (Plugin_manager::rescannable_defines): New function.
7460 (Plugin_manager::add_input_file): Set any_added_.
7461 * plugin.h (class Plugin_manager): define new fields rescannable_,
7462 undefined_symbols_, any_claimed_, and any_added_. Declare
7463 Plugin_rescan as friend. Declare new functions.
7464 (Plugin_manager::Rescannable): Define type.
7465 (Plugin_manager::Rescannable_list): Define type.
7466 (Plugin_manager::Undefined_symbol_list): Define type.
7467 (Plugin_manager::Plugin_manager): Initialize new fields.
7468 * archive.cc (Archive::defines_symbol): New function.
7469 (Add_archive_symbols::run): Pass archive to plugins if any.
7470 * archive.h (class Archive): Declare defines_symbol.
7471 * readsyms.cc (Input_group::~Input_group): New function.
7472 (Finish_group::run): Pass input_group to plugins if any.
7473 * readsyms.h (class Input_group): Declare destructor.
7474 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7475 any.
7476
3bb951e5
ILT
74772011-01-10 Ian Lance Taylor <iant@google.com>
7478
7479 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7480 section as relro.
7481 (Layout::set_segment_offsets): Reset increase_relro before calling
7482 set_section_addresses a second time.
7483
0aa45fac
CC
74842011-01-04 Cary Coutant <ccoutant@google.com>
7485
7486 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7487 sections before NOBITS sections.
7488
0db46eb4
L
74892011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7490
7491 * version.cc (print_version): Update copyright to 2011.
7492
829c9745
CC
74932010-12-23 Cary Coutant <ccoutant@google.com>
7494
7495 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7496 of OS to this->add. Add OD parameter to second form of the function.
7497
7500420b
ILT
74982010-12-20 Ian Lance Taylor <iant@google.com>
7499
7500 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7501 second of two consecutive entries with same offset.
7502
f8e9a930
RW
75032010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7504
7505 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7506 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7507 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7508 to avoid unneeded links against $(LDADD).
7509 * testsuite/Makefile.in: Regenerate.
7510
2fbb4320
ILT
75112010-12-15 Ian Lance Taylor <iant@google.com>
7512
7513 PR gold/12324
7514 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7515 for R_X86_64_32 and R_X86_64_PC32.
7516 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7517 ver_matching_def_pic.o.
7518 (ver_matching_def_pic.o): New target.
7519
fedb228d
RW
75202010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7521
7522 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7523 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7524 Move definition before File_read::View member definitions.
7525 (File_read::View::~View): Initialize and hold lock before
7526 updating current_mapped_bytes.
7527
9b547ce6
RW
75282010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7529
7530 * dwarf_reader.cc: Remove outdated comment.
7531 * gold-threads.cc: Fix typo in error message.
7532 * archive.cc: Fix typos in comments.
7533 * archive.h: Likewise.
7534 * arm-reloc-property.cc: Likewise.
7535 * arm-reloc-property.h: Likewise.
7536 * arm-reloc.def: Likewise.
7537 * arm.cc: Likewise.
7538 * attributes.h: Likewise.
7539 * cref.cc: Likewise.
7540 * ehframe.cc: Likewise.
7541 * fileread.h: Likewise.
7542 * gold.h: Likewise.
7543 * i386.cc: Likewise.
7544 * icf.cc: Likewise.
7545 * incremental.h: Likewise.
7546 * int_encoding.cc: Likewise.
7547 * layout.h: Likewise.
7548 * main.cc: Likewise.
7549 * merge.h: Likewise.
7550 * object.cc: Likewise.
7551 * object.h: Likewise.
7552 * options.cc: Likewise.
7553 * readsyms.cc: Likewise.
7554 * reduced_debug_output.cc: Likewise.
7555 * reloc.cc: Likewise.
7556 * script-sections.cc: Likewise.
7557 * sparc.cc: Likewise.
7558 * symtab.h: Likewise.
7559 * target-reloc.h: Likewise.
7560 * target.cc: Likewise.
7561 * target.h: Likewise.
7562 * timer.cc: Likewise.
7563 * timer.h: Likewise.
7564 * x86_64.cc: Likewise.
7565
83e17bd5
CC
75662010-12-09 Cary Coutant <ccoutant@google.com>
7567
7568 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7569 stack.
7570 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7571 parameter; change all callers.
7572 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7573 * options.h (warn_execstack): New option.
7574
017257f8
DK
75752010-12-07 Doug Kwan <dougkwan@google.com>
7576
7577 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7578 like function call relocations.
7579
c20cbc06
ILT
75802010-12-07 Ian Lance Taylor <iant@google.com>
7581
7582 * archive.cc (Archive::get_elf_object_for_member): Permit
7583 punconfigured to be NULL.
7584 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7585 (Archive::include_member): Pass NULL to get_elf_object_for_member
7586 if we searched for the archive and this is the first included
7587 object.
7588
4dbfafcc
ILT
75892010-12-01 Ian Lance Taylor <iant@google.com>
7590
7591 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7592 track_relocs_type_ field.
7593 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7594 Set track_relocs_type_.
7595 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7596 contents when using RELA relocs.
7597 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7598 reloc_map_.
7599 * reloc.cc (Track_relocs::next_addend): New function.
7600 * reloc.h (class Track_relocs): Declare next_addend.
7601
e5e19edd
ILT
76022010-12-01 Ian Lance Taylor <iant@google.com>
7603
7604 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7605 virtual destructor.
7606
9a5ce24c
ILT
76072010-12-01 Ian Lance Taylor <iant@google.com>
7608
7609 * README: Update compilers known to work and fail.
7610
c7791212
NC
76112010-11-23 Matthias Klose <doko@ubuntu.com>
7612
7613 * configure.in: For --enable-gold, handle value `default' instead of
7614 `both*'. Always install ld as ld.bfd, install as ld if gold is
7615 not the default.
7616 * configure: Regenerate.
7617
0ad220c9
DK
76182010-11-18 Doug Kwan <dougkwan@google.com>
7619
7620 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7621 and right_alignment to be zero. Store result alignment only if it is
7622 greater than existing alignment.
7623
ab8056e0
CC
76242010-11-16 Cary Coutant <ccoutant@google.com>
7625
7626 PR gold/12220
7627 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7628 Check for ".zdebug_line".
7629
fd064a5b
CC
76302010-11-16 Doug Kwan <dougkwan@google.com>
7631 Cary Coutant <ccoutant@google.com>
7632
7633 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7634 by reference; adjust all callers.
7635 * output.cc (Output_segment::set_section_addresses): Adjust references
7636 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7637 list is empty.
7638 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7639 end at page boundary.
7640
6fc6ea19
CC
76412010-11-16 Cary Coutant <ccoutant@google.com>
7642
7643 PR gold/12220
7644 * layout.cc (Layout::choose_output_section): Transform names of
7645 compressed sections even when using a script with a SECTIONS clause.
7646 (Layout::output_section_name): Remove code to transform
7647 compressed debug section names.
7648 * output.cc (Output_section::add_input_section): Use uncompressed
7649 section size when tracking input sections.
7650
95a2c8d6
RS
76512010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7652
7653 * symtab.h (Symbol::NON_PIC_REF): Remove.
7654 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7655 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7656 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7657 (Symbol::use_plt_offset): Take a flags argument and pass it
7658 directly to needs_dynamic_reloc. Restrict check for undefined
7659 weak symbols to function calls.
7660 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7661 (Target_arm::Scan::global): Use it.
7662 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7663 (Target_arm::Relocate::relocate): Likewise.
7664 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7665 parameter with an r_type parameter. Use get_reference_flags
7666 to get the flags.
7667 (Target_arm::Relocate::relocate): Update accordingly.
7668 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7669 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7670 (Target_i386::Scan::global): Likewise.
7671 (Target_i386::Relocate::relocate): Likewise.
7672 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7673 parameter with an r_type parameter. Use get_reference_flags
7674 to get the flags.
7675 (Target_i386::Relocate::relocate): Update accordingly.
7676 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7677 (Target_powerpc::Scan::global): Use it.
7678 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7679 (Target_powerpc::Relocate::relocate): Likewise.
7680 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7681 (Target_sparc::Scan::global): Use it.
7682 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7683 (Target_sparc::Relocate::relocate): Likewise.
7684 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7685 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7686 (Target_x86_64::Scan::global): Likewise.
7687 (Target_x86_64::Relocate::relocate): Likewise.
7688
f625ae50
DK
76892010-11-08 Doug Kwan <dougkwan@google.com>
7690 Cary Coutant <ccoutant@google.com>
7691
7692 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7693 (Arm_exidx_merge_section::section_contents_): New data member.
7694 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7695 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7696 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7697 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7698 in parameters instead of calling Object::section_contents without
7699 locking.
7700 (Arm_output_section::group_section): New parameter TASK. Pass it
7701 to callees that need locking objects.
7702 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7703 to lock EXIDX input sections. Fix a formatting issue. Call
7704 Arm_exidx_merged_section::build_contents to create merged section
7705 contents.
7706 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7707 to lock object of stub table owner.
7708 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7709 TEXT_SIZE to initialize data member TEXT_SIZE_.
7710 (Arm_exidx_input_section::addralign): Fix typo in comment.
7711 (Arm_exidx_input_section::text_size): New method.
7712 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7713 that require locking objects. Lock objects before scanning for stubs
7714 and updating local symbols.
7715 (Arm_input_section<big_endian>::init): Copy contents of original
7716 input section.
2e702c99 7717 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7718 original input section instead of calling Object::section_contents
7719 without locking.
7720 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7721 size without calling Object::section_size().
7722 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7723 for size. Allocate a buffer for merged EXIDX entries.
7724 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7725 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7726 building code to Arm_exidx_merged_section::build_contetns. Write
7727 out contetns in buffer instead of building it on the fly.
7728 (Arm_relobj::make_exidx_input_section): Also pass text section size
7729 to Arm_exidx_input_section constructor.
7730 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7731 (Arm_dynobj::do_read_symbols): Fix memory leak.
7732 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7733 * target.h: (class Task): Add forward declaration.
7734 (Target::relax): Add new parameter TASK and pass it to
7735 Target::do_relax().
7736 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7737
5f9bcf58
CC
77382010-11-05 Cary Coutant <ccoutant@google.com>
7739
7740 PR gold/10708
7741 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7742 object when reading from the file.
7743 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7744 second layout pass.
7745 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7746 when reading section contents.
7747 (get_section_contents): Likewise.
7748 (icf::find_identical_sections): Likewise.
7749 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7750 object when reading from the file.
7751 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7752 the object when doing deferred section layout.
7753
e597fa08
NC
77542010-11-03 Nick Clifton <nickc@redhat.com>
7755
7756 PR gold/12001
7757 * script.h (class Symbol_assignment: name): New member. Returns
7758 the name of the symbol.
7759 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7760 Returns true if the given symbol name is on the list of
7761 assignments wating to be processed.
7762 * archive.cc (should_incldue_member): If the symbol is undefined,
7763 check to see if it is on the list of symbols pending assignment.
7764
3f9a3278
ILT
77652010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7766
7767 * script-sections.cc (Script_sections::find_memory_region): Check
7768 for a NULL output section pointer.
7769
d06fb4d1
DK
77702010-10-29 Doug Kwan <dougkwan@google.com>
7771
7772 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7773 Output_section::add_relaxed_input_section.
7774 * output.cc (Output_section::add_relaxed_input_section): Add new
7775 arguments LAYOUT and NAME. Set section order index.
7776 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7777 Copy section order index.
7778 * output.h (Output_section::add_relaxed_input_section): Add new
7779 arguments LAYOUT and NAME.
7780
90e24de5
ILT
77812010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7782
7783 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7784 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7785 * testsuite/Makefile.in: Regenerate.
7786
c9484ea5
DK
77872010-10-20 Doug Kwan <dougkwan@google.com>
7788
7789 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7790 without SHF_LINK_ORDER flags.
7791 * layout.cc (Layout::choose_output_section): Do not filter
7792 SHF_LINK_ORDER flag in a relocatable link.
7793
5bc2f5be
CC
77942010-10-17 Cary Coutant <ccoutant@google.com>
7795
7796 * output.h (Output_segment::set_section_addresses): Change function
7797 signature. Update all callers.
7798 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7799 sections.
7800 (Output_segment::set_section_addresses): Align after last TLS
7801 section. Add padding before last relro section instead of after.
7802
0c91cf04
DK
78032010-10-17 Doug Kwan <dougkwan@google.com>
7804
7805 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7806 GOT output section to be writable.
7807
8c21d9d3
CC
78082010-10-14 Cary Coutant <ccoutant@google.com>
7809
7810 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7811 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7812 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7813 mode.
7814 * incremental.cc (report_command_line): Ignore all forms of
7815 --incremental.
7816 * layout.cc (Layout::Layout): Check parameters for incremental link
7817 mode.
7818 * options.cc (General_options::parse_incremental): New function.
7819 (General_options::parse_no_incremental): New function.
7820 (General_options::parse_incremental_full): New function.
7821 (General_options::parse_incremental_update): New function.
7822 (General_options::incremental_mode_): New data member.
7823 (General_options::finalize): Check incremental_mode_.
7824 * options.h (General_options): Update help text for --incremental.
7825 Add --no-incremental, --incremental-full, --incremental-update.
7826 (General_options::Incremental_mode): New enum type.
7827 (General_options::incremental_mode): New function.
7828 (General_options::incremental_mode_): New data member.
7829 * parameters.cc (Parameters::incremental_mode_): New data member.
7830 (Parameters::set_options): Set incremental_mode_.
7831 (Parameters::set_incremental_full): New function.
7832 (Parameters::incremental): New function.
7833 (Parameters::incremental_update): New function.
7834 (set_parameters_incremental_full): New function.
7835 * parameters.h (Parameters::set_incremental_full): New function.
7836 (Parameters::incremental): New function.
7837 (Parameters::incremental_update): New function.
7838 (Parameters::incremental_mode_): New data member.
7839 (set_parameters_incremental_full): New function.
7840 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7841 incremental link mode.
7842 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7843 (Sized_relobj::do_relocate_sections): Likewise.
7844 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7845 option.
7846 * testsuite/Makefile.in: Regenerate.
7847 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7848
bb32aa18 78492010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7850
7851 * script-sections.h (class Script_sections): Make
7852 Sections_elements typedef public.
7853 * script-sections.cc (class Sort_output_sections): Add elements_
7854 field. Add constructor which sets it; change all callers.
7855 (Sort_output_sections::is_before): New function.
7856 (Sort_output_sections::operator()): Call is_before.
7857 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7858 conditional.
7859 * testsuite/script_test_10.sh: New test. Test script section
7860 order.
7861 * testsuite/script_test_10.t: Likewise.
7862 * testsuite/script_test_10.s: Likewise.
7863 * testsuite/Makefile.am: Wrap the cross linker tests and the
7864 common tests into NATIVE_OR_CROSS_LINKER.
7865 (check_SCRIPTS): Add script_test_10.sh.
7866 (check_DATA): Add script_test_10.stdout.
7867 (script_test_10.o, script_test_10): New targets.
7868 (script_test_10.stdout): New target.
7869 * configure, testsuite/Makefile.in: Regenerate.
7870
3cef7179
ILT
78712010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7872
7873 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7874 error for the deprecated relocations.
7875 (Target_arm::Scan::global): Likewise.
7876 (Target_arm::Relocate::relocate): Likewise.
7877
7411e9a8
RS
78782010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7879
7880 * fileread.cc (Input_file::find_file): Initialize *found_name
7881 and *namep when using the fallback search for case 4.
7882
6a9da32a
CC
78832010-10-11 Cary Coutant <ccoutant@google.com>
7884
7885 * options.h (class General_options): Redefine -z lazy as an alias for
7886 the negation of -z now.
7887
ac897c20
ILT
78882010-10-11 Ian Lance Taylor <iant@google.com>
7889
7890 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7891 binding.
7892
ea5cae92
NC
78932010-10-06 Nick Clifton <nickc@redhat.com>
7894
7895 * script-sections.cc(class Memory_region): Remove
7896 current_lma_offset_ field. Rename current_vma_offset_ to
7897 current_offset_. Add last_section_ field.
7898 (Memory_region::get_current_vma_address): Rename to
7899 get_current_address.
7900 (Memory_region::get_current_lma_address): Delete.
7901 (Memory_region::increment_vma_offset): Rename to
7902 increment_offset.
7903 (Memory_region::increment_lma_offset): Delete.
7904 (Memory_region::attributes_compatible): New method. Returns
7905 true if the provided section is compatible with the region.
7906 (Memory_region::get_last_section): New method. Returns the last
7907 section to use the region.
7908 (Memory_region::set_last_section): New method. Stores the last
7909 section to use the region.
7910 (Script_sections::block_in_region): New method. Returns true if
7911 a block of memory is contained within a region.
7912 (Script_sections::find_memory_region): New method. Locates a
7913 memory region to be used to set a VMA or LMA address.
7914 (Output_section_definition::set_section_addresses): Add code to
7915 check for addresses set by memory regions.
7916 (Output_segment::set_section_addresses): Remove memory region
7917 walking code.
7918 (Script_sections::create_segment): Add a warning if a header
7919 segment is created outside of any region.
7920 * script-sections.h (class Script_sections): Add prototypes for
7921 find_memory_region and block_in_region methods.
7922 * testsuite/memory_test.s: Use .long instead of .word.
7923 * testsuite/memory_test.t: Add some more output sections.
7924 * testsuite/memory_test.sh: Update expected output.
7925
a9bfd952
DK
79262010-10-02 Doug Kwan <dougkwan@google.com>
7927
7928 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7929 defintion to symtab.h
7930 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7931 declaration to defintion.
7932
bacff3ab
NC
79332010-10-01 Nick Clifton <nickc@redhat.com>
7934
7935 * expression.cc (eval): Replace dummy argument with NULL.
7936 (eval_maybe_dot): Check for a NULL result section pointer.
7937 (Symbol_expression::value): Likewise.
7938 (Dot_expression::value): Likewise.
7939 (BINARY_EXPRESSION): Likewise.
7940 (Max_expression::value): Likewise.
7941 (Min_expression::value): Likewise.
7942 (Absolute_expression::value): Likewise.
7943 (Addr_expression::value_from_output_section): Likewise.
7944 (Loaddddr_expression::value_from_output_section): Likewise.
7945 (Segment_start_expression::value): Likewise.
7946 * script-sections.cc
7947 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7948 argument with NULL.
7949 (Sections_elememt_dot_assignment::set_section_addresses):
7950 Likewise.
7951 (Output_data_expression::do_write_to_buffer): Likewise.
7952 (Output_section_definition::finalize_symbols): Likewise.
7953 (Output_section_definition::set_section_addresses): Likewise.
7954
f81bc8b5
DK
79552010-09-30 Doug Kwan <dougkwan@google.com>
7956
7957 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7958
c95e9f27
ST
79592010-09-28 Sriraman Tallam <tmsriram@google.com>
7960
7961 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7962 function.
c95e9f27
ST
7963 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7964 virtual function.
7965 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7966 virtual function.
7967 * icf.cc (get_section_contents): Inline merge sections only when
7968 target allows it.
7969
3cac54d2
RW
79702010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7971
7972 * configure: Regenerate.
7973
2904037a
ILT
79742010-09-17 Ian Lance Taylor <iant@google.com>
7975
7976 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7977 * testsuite/Makefile.am (memory_test.o): New target.
7978 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7979 memory_test.t.
7980 * testsuite/Makefile.in: Rebuild.
2904037a 7981
bca7fb63
DK
79822010-09-17 Doug Kwan <dougkwan@google.com>
7983
7984 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7985 defintion if relocation uses GOT entries of the symbol.
7986 * testsuite/icf_safe_test.sh: Fix test.
7987 * testsuite/icf_safe_so_test.sh: Fix test.
7988
4ef28648
CC
79892010-09-16 Cary Coutant <ccoutant@google.com>
7990
7991 * script_sections.cc (class Memory_region): Remove "NULL" from
7992 vector initializations.
7993
793990de
CC
79942010-09-15 Cary Coutant <ccoutant@google.com>
7995
7996 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7997 Resolve forwarding symbols.
7998
81e015e2
DK
79992010-09-15 Doug Kwan <dougkwan@google.com>
8000
8001 * gold/testsuite/script_test_3.t: Add ARM special sections.
8002 * gold/testsuite/script_test_4.t: Same.
8003 * gold/testsuite/script_test_5.t: Same.
8004 * gold/testsuite/script_test_6.t: Same.
8005 * gold/testsuite/script_test_7.t: Same.
8006 * gold/testsuite/script_test_7.t: Same.
8007 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8008
36171d64
CC
80092010-09-14 Cary Coutant <ccoutant@google.com>
8010
8011 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8012 (Target_x86_64::Relocate::relocate_tls): Replace check for
8013 saw_tls_block_reloc_ with test for executable section.
8014
d89051bd
CC
80152010-09-12 Cary Coutant <ccoutant@google.com>
8016
8017 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8018 position-independent executables to shared libraries need dynamic
8019 relocations.
8020 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8021 position-independent executables.
8022 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8023 * testsuite/Makefile.in: Regenerate.
8024
fca41f0f
NC
80252010-09-10 Nick Clifton <nickc@redhat.com>
8026
8027 PR gold/11997
8028 * testsuite/memory_test.t: Discard any sections that are not
8029 needed.
8030
6695e4b3
L
80312010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8032
8033 PR gold/11996
8034 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8035 "This::" to work around a bug in gcc 4.2.
8036
8037 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8038
0f72bf6f
RÁE
80392010-09-09 Rafael Espindola <espindola@google.com>
8040
8041 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8042 sections with different PF_X flags in the same segment.
8043 (Layout::find_first_load_seg): Search all segments to find the first
8044 one.
8045 * options.h (rosegment): New.
8046
80472010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8048
05a79166 8049 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8050
aa98ff75
DK
80512010-09-08 Doug Kwan <dougkwan@google.com>
8052
8053 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8054 (Arm_relobj::do_relocate_sections): Add new parameter for output
8055 file to match the parent.
8056 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8057 of local symbols instead of input values. Update code to track
8058 changes in gold::relocate_section.
8059 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8060 (Sized_relobj::compute_final_local_value_internal): New methods.
8061 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8062 body into private version of Sized_relobj::compute_final_local_value.
8063 Call the inline method.
8064 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8065 merged symbol value if there is one.
8066 (Symbol_value::has_output_value): New method defintiion.
8067 (Sized_relobj::Compute_final_local_value_status): New enum type.
8068 (Sized_relobj::compute_final_local_value): New methods.
8069 (Sized_relobj::compute_final_local_value_internal): New methods.
8070 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8071 and arm_cortex_a8.sh.
8072 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8073 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8074 New tests.
8075 * Makefile.in: Regenerate.
8076 * testsuite/arm_bl_out_of_range.s: Update test.
8077 * testsuite/thumb_bl_out_of_range.s: Ditto.
8078 * testsuite/thumb_blx_out_of_range.s: Ditto.
8079 * testsuite/arm_branch_out_of_range.sh: New file.
8080 * testsuite/arm_cortex_a8.sh: Ditto.
8081 * testsuite/arm_cortex_a8_b.s: Ditto.
8082 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8083 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8084 * testsuite/arm_cortex_a8_bl.s: Ditto.
8085 * testsuite/arm_cortex_a8_blx.s: Ditto.
8086 * testsuite/arm_cortex_a8_local.s: Ditto.
8087 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8088 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8089
05a79166
L
80902010-09-08 Rafael Espindola <espindola@google.com>
8091
8092 * Makefile.am (memory_test.stdout): Run readelf with -W.
8093 * Makefile.in: Regenerate.
8094 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8095 64 bit output.
8096
33dbc701
RÁE
80972010-09-08 Rafael Espindola <espindola@google.com>
8098
8099 * script-sections.cc (Script_sections::add_memory_region): Convert
8100 field precision to int.
8101 * script.cc (script_set_section_region, script_set_section_region):
8102 Convert field precision to int.
8103
731ca54a
RÁE
81042010-09-08 Rafael Espindola <espindola@google.com>
8105
8106 * arm.cc (do_finalize_sections): Create the __exidx_start and
8107 __exdix_end symbols even when the section is missing.
8108
7f8cd844
NC
81092010-09-08 Nick Clifton <nickc@redhat.com>
8110
8111 * README: Remove claim that MEMORY is not supported.
8112 * expression.cc (script_exp_function_origin)
8113 (script_exp_function_length): Move from here to ...
8114 * script.cc: ... here.
8115 (script_set_section_region, script_add_memory)
8116 (script_parse_memory_attr, script_include_directive): New
8117 functions.
8118 * script-sections.cc
8119 (class Memory_region): New class.
8120 (class Output_section_definition): Add set_memory_region,
8121 set_section_vma, set_section_lma and get_section_name methods.
8122 (class Script_Sections): Add add_memory_region,
8123 find_memory_region, find_memory_region_origin,
8124 find_memory_region_length and set_memory_region methods.
8125 Have set_section_addresses method walk the list of set memory
8126 regions.
8127 Extend the print methos to display memory regions.
8128 * script-sections.h: Add prototypes for new methods.
8129 Add enum for MEMORY region attributes.
8130 * yyscript.y: Add support for parsing MEMORY regions.
8131 * script-c.h: Add prototypes for new functions.
8132 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8133 * testsuite/Makefile.in: Regenerate.
8134 * testsuite/memory_test.sh: New script.
8135 * testsuite/memory_test.s: New assembler source file.
8136 * testsuite/memory_test.t: New linker script.
8137
a4649286
DK
81382010-08-27 Doug Kwan <dougkwan@google.com>
8139
8140 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8141 reference override an existing dynamic weak reference.
8142 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8143 * testsuite/Makefile.in: Regenerate.
8144 * testsuite/dyn_weak_ref.sh: New file.
8145 * testsuite/dyn_weak_ref_1.c: Ditto.
8146 * testsuite/dyn_weak_ref_2.c: Ditto.
8147
b56648ad
ILT
81482010-08-27 Ian Lance Taylor <iant@google.com>
8149
8150 * incremental.h (class Incremental_input_entry): Add virtual
8151 destructor.
8152
809313cb
ILT
81532010-08-27 Ian Lance Taylor <iant@google.com>
8154
8155 * testsuite/start_lib_test_3.c: Mark t3 as used.
8156
11e32464
NC
81572010-08-27 Nick Clifton <nickc@redhat.com>
8158
8159 * options.cc (version_script): Fix small typo in previous
8160 whitespace tidyup.
8161
ca09d69a
NC
81622010-08-25 Nick Clifton <nickc@redhat.com>
8163
8164 * archive.cc: Formatting fixes: Remove whitespace between
8165 typename and following asterisk. Remove whitespace between
8166 function name and opening parenthesis.
8167 * archive.h: Likewise.
8168 * arm.cc: Likewise.
8169 * attributes.cc: Likewise.
8170 * attributes.h: Likewise.
8171 * common.cc: Likewise.
8172 * copy-relocs.cc: Likewise.
8173 * dirsearch.h: Likewise.
8174 * dynobj.cc: Likewise.
8175 * ehframe.cc: Likewise.
8176 * ehframe.h: Likewise.
8177 * expression.cc: Likewise.
8178 * fileread.cc: Likewise.
8179 * fileread.h: Likewise.
8180 * gc.h: Likewise.
8181 * gold-threads.cc: Likewise.
8182 * gold.cc: Likewise.
8183 * i386.cc: Likewise.
8184 * icf.h: Likewise.
8185 * incremental-dump.cc: Likewise.
8186 * incremental.cc: Likewise.
8187 * layout.cc: Likewise.
8188 * layout.h: Likewise.
8189 * main.cc: Likewise.
8190 * merge.cc: Likewise.
8191 * merge.h: Likewise.
8192 * object.cc: Likewise.
8193 * object.h: Likewise.
8194 * options.cc: Likewise.
8195 * options.h: Likewise.
8196 * output.cc: Likewise.
8197 * output.h: Likewise.
8198 * plugin.cc: Likewise.
8199 * plugin.h: Likewise.
8200 * powerpc.cc: Likewise.
8201 * reloc.cc: Likewise.
8202 * script-c.h: Likewise.
8203 * script-sections.cc: Likewise.
8204 * script.cc: Likewise.
8205 * stringpool.cc: Likewise.
8206 * symtab.cc: Likewise.
8207 * symtab.h: Likewise.
8208 * target.cc: Likewise.
8209 * timer.cc: Likewise.
8210 * timer.h: Likewise.
8211 * version.cc: Likewise.
8212 * x86_64.cc: Likewise.
8213
b8fa8750
NC
82142010-08-24 Nick Clifton <nickc@redhat.com>
8215
8216 PR 11899
8217 * layout.cc (segment_precedes): Sort segments by their physical
8218 addresses, if they have been set.
8219
9919d93b
CC
82202010-08-23 Cary Coutant <ccoutant@google.com>
8221
8222 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8223 symbols data.
8224 (Lib_group::include_member): Unlock object after deleting its
8225 symbols data.
8226 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8227 the bug fixed here.
8228
97b4be1c
CC
82292010-08-19 Neil Vachharajani <nvachhar@google.com>
8230 Cary Coutant <ccoutant@google.com>
8231
8232 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8233 constructor, and set_blocker.
8234 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8235 readsyms_blocker_.
8236 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8237 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8238 * testsuite/Makefile.am (start_lib_test): New test case.
8239 * testsuite/Makefile.in: Regenerate.
8240 * testsuite/start_lib_test_main.c: New file.
8241 * testsuite/start_lib_test_1.c: New file.
8242 * testsuite/start_lib_test_2.c: New file.
8243 * testsuite/start_lib_test_3.c: New file.
8244
dd0b1884
ILT
82452010-08-19 Ian Lance Taylor <iant@google.com>
8246
8247 * Makefile.in: Rebuild with automake 1.11.1.
8248 * aclocal.m4: Likewise.
8249 * testsuite/Makefile.in: Likewise.
8250
7223e9ca
ILT
82512010-08-19 Ian Lance Taylor <iant@google.com>
8252
8253 PR 10893
8254 * i386.cc (class Output_data_plt_i386): Update declarations.
8255 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8256 local_ifuncs_ fields.
8257 (Target_i386::do_plt_section_for_global): New function.
8258 (Target_i386::do_plt_section_for_local): New function.
8259 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8260 parameter; change all callers. Initialize global_ifuncs_ and
8261 local_ifuncs_. If doing a static link define __rel_iplt_start and
8262 __rel_iplt_end.
8263 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8264 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8265 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8266 symbols.
8267 (Target_i386::make_plt_section): New function, broken out of
8268 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8269 (Target_i386::make_plt_entry): Call make_plt_section.
8270 (Target_i386::make_local_ifunc_plt_entry): New function.
8271 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8272 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8273 R_386_IRELATIVE to switch.
8274 (Target_i386::Scan::global): Likewise.
8275 (Target_i386::Relocate::relocate): Likewise.
8276 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8277 switch.
8278 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8279 (Target_x86_64::do_plt_section_for_global): New function.
8280 (Target_x86_64::do_plt_section_for_local): New function.
8281 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8282 parameter; change all callers. If doing a static link define
8283 __rela_iplt_start and __rela_iplt_end.
8284 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8285 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8286 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8287 to point to .plt.
8288 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8289 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8290 switch.
8291 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8292 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8293 R_X86_64_IRELATIVE to switch.
8294 (Target_x86_64::Scan::global): Likewise.
8295 (Target_x86_64::Relocate::relocate): Likewise.
8296 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8297 switch.
8298 * target.h (class Target): Add plt_section_for_global and
8299 plt_section_for_local functions. Add do_plt_section_for_global
8300 and do_plt_section_for_local virtual functions.
8301 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8302 clarifying comments.
8303 (Symbol::use_plt_offset): Handle IFUNC symbol.
8304 * object.cc (Sized_relobj::Sized_relobj): Initialize
8305 local_plt_offsets_.
8306 (Sized_relobj::local_has_plt_offset): New function.
8307 (Sized_relobj::local_plt_offset): New function.
8308 (Sized_relobj::set_local_plt_offset): New function.
8309 (Sized_relobj::do_count): Handle IFUNC symbol.
8310 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8311 a bit away from input_shndx_ field. Add set_is_func_symbol and
8312 is_ifunc_symbol functions.
8313 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8314 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8315 local_plt_offsets_ field.
8316 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8317 * output.h (class Output_section_data): Add non-const
8318 output_section function.
8319 (class Output_data_got): Update declarations.
8320 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8321 Add use_plt_offset parameter to global and local constructors.
8322 Change all callers. Change local_sym_index_ field to 31 bits.
8323 Change GSYM_CODE and CONSTANT_CODE accordingly.
8324 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8325 doing a static link don't set sh_link field.
8326 (Output_data_got::Got_entry::write): Use PLT offset if
8327 appropriate.
8328 (Output_data_got::add_global_plt): New function.
8329 (Output_data_got::add_local_plt): New function.
8330 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8331 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8332 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8333 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8334 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8335 IFUNC conditional.
8336 * testsuite/ifunc-sel.h: New file.
8337 * testsuite/ifuncmain1.c: New file.
8338 * testsuite/ifuncmain1vis.c: New file.
8339 * testsuite/ifuncmod1.c: New file.
8340 * testsuite/ifuncdep2.c: New file.
8341 * testsuite/ifuncmain2.c: New file.
8342 * testsuite/ifuncmain3.c: New file.
8343 * testsuite/ifuncmod3.c: New file.
8344 * testsuite/ifuncmain4.c: New file.
8345 * testsuite/ifuncmain5.c: New file.
8346 * testsuite/ifuncmod5.c: New file.
8347 * testsuite/ifuncmain6pie.c: New file.
8348 * testsuite/ifuncmod6.c: New file.
8349 * testsuite/ifuncmain7.c: New file.
8350 * configure, testsuite/Makefile.in: Rebuild.
8351
56f75c03
ILT
83522010-08-18 Ian Lance Taylor <iant@google.com>
8353
8354 * incremental.cc
8355 (Output_section_incremental_inputs::write_input_files): Add cast
8356 to avoid signed/unsigned comparison warning.
8357 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8358
55455f89
CC
83592010-08-12 Cary Coutant <ccoutant@google.com>
8360
8361 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8362
e2054bcb
ILT
83632010-08-13 Ian Lance Taylor <iant@google.com>
8364
8365 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8366
74f67560
DK
83672010-08-12 Cary Coutant <ccoutant@google.com>
8368 Doug Kwan <dougkwan@google.com>
8369
8370 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8371 defintion overrides non-weak undef, remember that the original undef
8372 is not weak.
8373 * symtab.cc (Symbol_table::sized_write_global): For undef without
8374 an original weak binding, set binding to global in output.
8375 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8376 * testsuite/Makefile.in: Regenerate.
8377 * testsuite/strong_ref_weak_def.sh: New file.
8378 * testsuite/strong_ref_weak_def_1.c: Ditto.
8379 * testsuite/strong_ref_weak_def_2.c: Ditto.
8380
d1238d12
CC
83812010-08-12 Cary Coutant <ccoutant@google.com>
8382
8383 * testsuite/incremental_test.sh: Rewrite.
8384 * testsuite/incremental_test_1.c: Rewrite.
8385 * testsuite/incremental_test_2.c: Rewrite.
8386
0e70b911
CC
83872010-08-12 Cary Coutant <ccoutant@google.com>
8388
8389 * arm.cc (Target_arm::got_size): Add const.
8390 (Target_arm::got_entry_count): New function.
8391 (Target_arm::plt_entry_count): New function.
8392 (Target_arm::first_plt_entry_offset): New function.
8393 (Target_arm::plt_entry_size): New function.
8394 (Output_data_plt_arm::entry_count): New function.
8395 (Output_data_plt_arm::first_plt_entry_offset): New function.
8396 (Output_data_plt_arm::get_plt_entry_size): New function.
8397 * i386.cc (Target_i386::got_size): Add const.
8398 (Target_i386::got_entry_count): New function.
8399 (Target_i386::plt_entry_count): New function.
8400 (Target_i386::first_plt_entry_offset): New function.
8401 (Target_i386::plt_entry_size): New function.
8402 (Output_data_plt_i386::entry_count): New function.
8403 (Output_data_plt_i386::first_plt_entry_offset): New function.
8404 (Output_data_plt_i386::get_plt_entry_size): New function.
8405 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8406 find_incremental_inputs_sections. Dump incremental_got_plt section.
8407 * incremental.cc: Include target.h.
8408 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8409 parameter. Adjust all callers. Find incremental_got_plt section.
8410 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8411 section.
8412 (Output_section_incremental_inputs::set_final_data_size): Calculate
8413 size of incremental_got_plt section.
8414 (Output_section_incremental_inputs::do_write): Write the
8415 incremental_got_plt section.
8416 (Got_plt_view_info): New struct.
8417 (Local_got_offset_visitor): New class.
8418 (Global_got_offset_visitor): New class.
8419 (Global_symbol_visitor_got_plt): New class.
8420 (Output_section_incremental_inputs::write_got_plt): New function.
8421 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8422 Add parameter. Adjust all callers.
8423 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8424 (Incremental_inputs::got_plt_section): New function.
8425 (Incremental_inputs::got_plt_section_): New data member.
8426 (Incremental_got_plt_reader): New class.
8427 * layout.cc (Layout::create_incremental_info_sections): Add the
8428 incremental_got_plt section.
8429 * object.h (Got_offset_list::get_list): New function.
8430 (Got offset_list::for_all_got_offsets): New function.
8431 (Sized_relobj::local_got_offset_list): New function.
8432 * powerpc.cc (Target_powerpc::got_size): Add const.
8433 (Target_powerpc::got_entry_count): New function.
8434 (Target_powerpc::plt_entry_count): New function.
8435 (Target_powerpc::first_plt_entry_offset): New function.
8436 (Target_powerpc::plt_entry_size): New function.
8437 (Output_data_plt_powerpc::entry_count): New function.
8438 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8439 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8440 * sparc.cc (Target_sparc::got_size): Add const.
8441 (Target_sparc::got_entry_count): New function.
8442 (Target_sparc::plt_entry_count): New function.
8443 (Target_sparc::first_plt_entry_offset): New function.
8444 (Target_sparc::plt_entry_size): New function.
8445 (Output_data_plt_sparc::entry_count): New function.
8446 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8447 (Output_data_plt_sparc::get_plt_entry_size): New function.
8448 * symtab.h (Symbol::got_offset_list): New function.
8449 (Symbol_table::for_all_symbols): New function.
8450 * target.h (Sized_target::got_entry_count): New function.
8451 (Sized_target::plt_entry_count): New function.
8452 (Sized_target::plt_entry_size): New function.
8453 * x86_64.cc (Target_x86_64::got_size): Add const.
8454 (Target_x86_64::got_entry_count): New function.
8455 (Target_x86_64::plt_entry_count): New function.
8456 (Target_x86_64::first_plt_entry_offset): New function.
8457 (Target_x86_64::plt_entry_size): New function.
8458 (Output_data_plt_x86_64::entry_count): New function.
8459 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8460 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8461
09ec0418
CC
84622010-08-12 Cary Coutant <ccoutant@google.com>
8463
8464 * archive.cc: Include incremental.h.
8465 (Archive::Archive): Initialize incremental_info_.
8466 (Archive::include_member): Record archive members in incremental info.
8467 (Add_archive_symbols::run): Record begin and end of an archive in
8468 incremental info.
8469 (Lib_group::include_member): Record objects in incremental info.
8470 * archive.h (Incremental_archive_entry): Forward declaration.
8471 (Archive::set_incremental_info): New member function.
8472 (Archive::incremental_info): New member function.
8473 (Archive::Unused_symbol_iterator): New class.
8474 (Archive::unused_symbols_begin): New member function.
8475 (Archive::unused_symbols_end): New member function.
8476 (Archive::incremental_info_): New data member.
8477 * incremental-dump.cc (find_input_containing_global): New function.
8478 (dump_incremental_inputs): Dump new incremental info sections.
8479 * incremental.cc: Include symtab.h.
8480 (Output_section_incremental_inputs): New class.
8481 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8482 new incremental info sections.
8483 (Sized_incremental_binary::do_check_inputs): Likewise.
8484 (Incremental_inputs::report_archive): Remove.
8485 (Incremental_inputs::report_archive_begin): New function.
8486 (Incremental_inputs::report_archive_end): New function.
8487 (Incremental_inputs::report_object): New function.
8488 (Incremental_inputs::finalize_inputs): Remove.
8489 (Incremental_inputs::report_input_section): New function.
8490 (Incremental_inputs::report_script): Rewrite.
8491 (Incremental_inputs::finalize): Do nothing but finalize string table.
8492 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8493 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8494 (Incremental_inputs::create_data_sections): New function.
8495 (Incremental_inputs::relocs_entsize): New function.
8496 (Output_section_incremental_inputs::set_final_data_size): New function.
8497 (Output_section_incremental_inputs::do_write): New function.
8498 (Output_section_incremental_inputs::write_header): New function.
8499 (Output_section_incremental_inputs::write_input_files): New function.
8500 (Output_section_incremental_inputs::write_info_blocks): New function.
8501 (Output_section_incremental_inputs::write_symtab): New function.
8502 * incremental.h (Incremental_script_entry): Forward declaration.
8503 (Incremental_object_entry): Forward declaration.
8504 (Incremental_archive_entry): Forward declaration.
8505 (Incremental_inputs): Forward declaration.
8506 (Incremental_inputs_header_data): Remove.
8507 (Incremental_inputs_header): Remove.
8508 (Incremental_inputs_header_write): Remove.
8509 (Incremental_inputs_entry_data): Remove.
8510 (Incremental_inputs_entry): Remove.
8511 (Incremental_inputs_entry_write): Remove.
8512 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8513 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8514 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8515 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8516 Likewise.
8517 (Incremental_input_entry): New class.
8518 (Incremental_script_entry): New class.
8519 (Incremental_object_entry): New class.
8520 (Incremental_archive_entry): New class.
8521 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8522 (Incremental_inputs::report_inputs): Remove.
8523 (Incremental_inputs::report_archive): Remove.
8524 (Incremental_inputs::report_archive_begin): New function.
8525 (Incremental_inputs::report_archive_end): New function.
8526 (Incremental_inputs::report_object): Change prototype.
8527 (Incremental_inputs::report_input_section): New function.
8528 (Incremental_inputs::report_script): Change prototype.
8529 (Incremental_inputs::get_reloc_count): New function.
8530 (Incremental_inputs::set_reloc_count): New function.
8531 (Incremental_inputs::create_data_sections): New function.
8532 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8533 (Incremental_inputs::inputs_section): New function.
8534 (Incremental_inputs::symtab_section): New function.
8535 (Incremental_inputs::relocs_section): New function.
8536 (Incremental_inputs::get_stringpool): Add const.
8537 (Incremental_inputs::command_line): Add const.
8538 (Incremental_inputs::inputs): Remove.
8539 (Incremental_inputs::command_line_key): New function.
8540 (Incremental_inputs::input_file_count): New function.
8541 (Incremental_inputs::input_files): New function.
8542 (Incremental_inputs::relocs_entsize): New function.
8543 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8544 (Incremental_inputs::finalize_inputs): Remove.
8545 (Incremental_inputs::Input_info): Remove.
8546 (Incremental_inputs::lock_): Remove.
8547 (Incremental_inputs::inputs_): Change type.
8548 (Incremental_inputs::inputs_map_): Remove.
8549 (Incremental_inputs::current_object_entry_): New data member.
8550 (Incremental_inputs::inputs_section_): New data member.
8551 (Incremental_inputs::symtab_section_): New data member.
8552 (Incremental_inputs::relocs_section_): New data member.
8553 (Incremental_inputs::reloc_count_): New data member.
8554 (Incremental_inputs_reader): New class.
8555 (Incremental_symtab_reader): New class.
8556 (Incremental_relocs_reader): New class.
8557 * layout.cc (Layout::finalize): Move finalization of incremental info
8558 and creation of incremental info sections to follow finalization of
8559 symbol table. Set offsets for postprocessing sections.
8560 (Layout::create_incremental_info_sections): Call
8561 Incremental_inputs::create_data_sections. Add incremental symtab
8562 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8563 sections to layout after input sections.
8564 * layout.h (struct Timespec): Forward declaration.
8565 (Layout::incremental_inputs): Add const.
8566 (Layout::create_incremental_info_sections): Add parameter.
8567 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8568 * object.cc: Include incremental.h.
8569 (Relobj::finalize_incremental_relocs): New function.
8570 (Sized_relobj::do_layout): Record input sections in incremental info.
8571 * object.h (Object::output_section): New function.
8572 (Object::output_section_offset): Moved from Relobj.
8573 (Object::get_incremental_reloc_base): New function.
8574 (Object::get_incremental_reloc_count): New function.
8575 (Object::do_output_section): New function.
8576 (Object::do_output_section_offset): Moved from Relobj.
8577 (Object::do_get_incremental_reloc_base): New function.
8578 (Object::do_get_incremental_reloc_count): New function.
8579 (Object::Object): Initialize new data members.
8580 (Relobj::output_section): Renamed do_output_section and moved to
8581 protected.
8582 (Relobj::output_section_offset): Moved to Object.
8583 (Relobj::do_get_incremental_reloc_base): New function.
8584 (Relobj::do_get_incremental_reloc_count): New function.
8585 (Relobj::allocate_incremental_reloc_counts): New function.
8586 (Relobj::count_incremental_reloc): New function.
8587 (Relobj::finalize_incremental_relocs): New function.
8588 (Relobj::next_incremental_reloc_index): New function.
8589 (Relobj::reloc_counts_): New data member.
8590 (Relobj::reloc_bases_): New data member.
8591 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8592 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8593 (Sized_relobj::incremental_relocs_scan): New function.
8594 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8595 (Sized_relobj::incremental_relocs_write): New function.
8596 (Sized_relobj::incremental_relocs_write_reltype): New function.
8597 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8598 incremental link.
8599 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8600 archives and object files elsewhere.
8601 (Add_symbols::run): Report object files here.
8602 (Finish_group::run): Report end of archive at end of group.
8603 * reloc.cc: Include layout.h, incremental.h.
8604 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8605 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8606 (Sized_relobj::incremental_relocs_scan): New function.
8607 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8608 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8609 (Sized_relobj::incremental_relocs_write): New function.
8610 (Sized_relobj::incremental_relocs_write_reltype): New function.
8611 * script.cc (read_input_script): Rewrite test for incremental link.
8612 Change call to Incremental_inputs::report_script.
8613 * symtab.h (Symbol_table::first_global_index): New function.
8614 (Symbol_table::output_count): New function.
8615
ce0d1972
DK
86162010-08-12 Doug Kwan <dougkwan@google.com>
8617
8618 * arm.cc (Target_arm::merge_object_attributes): Check command line
8619 options --no-wchar-size-warning and --no-enum-size-warning.
8620 * options.h (General_options): Add ld-compatible options
8621 --no-enum-size-warning and --no-wchar-size-warning.
8622
6e5710ce
ILT
86232010-08-04 Ian Lance Taylor <iant@google.com>
8624
8625 * x86_64.cc (Target_x86_64::Scan::local): Use
8626 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8627 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8628 (Target_x86_64::Scan::global): Likewise.
8629 (Target_x86_64::Relocate::relocate): Likewise.
8630 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8631 Likewise.
8632
fef830db
CC
86332010-08-03 Cary Coutant <ccoutant@google.com>
8634
8635 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8636 to reserve space in merged_strings vector. Keep total input size
8637 for stats.
8638 (Output_merge_string::do_print_merge_stats): Print total input size.
8639 * merge.h (Output_merge_string): Add input_size_ field.
8640 * stringpool.cc (Stringpool_template::string_length): Move
8641 implementations out of Stringpool_template class and place in
8642 stringpool.h.
8643 * stringpool.h (string_length): Move out of Stringpool_template.
8644
1e3811b0
ILT
86452010-08-03 Ian Lance Taylor <iant@google.com>
8646
8647 PR 11712
8648 * layout.cc (relaxation_loop_body): If address of load segment is
8649 set, adjust address to include headers if possible.
8650
7af0c620
ILT
86512010-08-03 Ian Lance Taylor <iant@google.com>
8652
8653 * version.cc (version_string): Bump to 1.10.
8654
22f0da72
ILT
86552010-08-03 Ian Lance Taylor <iant@google.com>
8656
8657 PR 11805
8658 * layout.h (enum Output_section_order): Define.
8659 (class Layout): Update declarations.
8660 * layout.cc (Layout::get_output_section): Add order parameter.
8661 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8662 is_first_non_relro parameters. Change all callers.
8663 (Layout::choose_output_section): Likewise.
8664 (Layout::add_output_section_data): Likewise.
8665 (Layout::make_output_section): Likewise. Set order.
8666 (Layout::default_section_order): New function.
8667 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8668 * output.cc (Output_section::Output_section): Initialize order_.
8669 Don't initialize deleted fields.
8670 (Output_segment::Output_segment): Don't initialize deleted
8671 fields.
8672 (Output_segment::add_output_section_to_load): New function
8673 replacing add_output_section. Change all callers to call this or
8674 add_output_section_to_nonload.
8675 (Output_segment::add_output_section_to_nonload): New function.
8676 (Output_segment::remove_output_section): Rewrite.
8677 (Output_segment::add_initial_output_data): Likewise.
8678 (Output_segment::has_any_data_sections): Likewise.
8679 (Output_segment::is_first_section_relro): Likewise.
8680 (Output_segment::maximum_alignment): Likewise.
8681 (Output_segment::has_dynamic_reloc): New function replacing
8682 dynamic_reloc_count. Change all callers.
8683 (Output_segment::has_dynamic_reloc_list): New function replacing
8684 dynamic_reloc_count_list. Change all callers.
8685 (Output_segment::set_section_addresses): Rewrite.
8686 (Output_segment::set_offset): Rewrite.
8687 (Output_segment::find_first_and_last_list): Remove.
8688 (Output_segment::set_tls_offsets): Rewrite.
8689 (Output_segment::first_section_load_address): Likewise.
8690 (Output_segment::output_section_count): Likewise.
8691 (Output_segment::section_with_lowest_load_address): Likewise.
8692 (Output_segment::write_section_headers): Likewise.
8693 (Output_segment::print_sections_to_map): Likewise.
8694 * output.h (class Output_data): Remove dynamic_reloc_count_
8695 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8696 (Output_data::add_dynamic_reloc): Rewrite.
8697 (Output_data::has_dynamic_reloc): New function.
8698 (Output_data::dynamic_reloc_count): Remove.
8699 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8700 is_last_relro_, is_first_non_relro_, is_interp_,
8701 is_dynamic_linker_section_ fields. Add order and set_order
8702 functions. Remove is_relro_local, set_is_relro_local,
8703 is_last_relro, set_is_last_relro, is_first_non_relro,
8704 set_is_first_non_relro functions, is_interp, set_is_interp,
8705 is_dynamic_linker_section, and set_is_dynamic_linker_section
8706 functions.
8707 (class Output_segment): Change Output_data_list from std::list to
8708 std:;vector. Add output_lists_ field. Remove output_data_ and
8709 output_bss_ fields. Update declarations.
8710
3ff2ccb0
ILT
87112010-08-02 Ian Lance Taylor <iant@google.com>
8712
8713 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8714 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8715 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8716
88a4108b
ILT
87172010-08-02 Ian Lance Taylor <iant@google.com>
8718
8719 PR 11855
8720 * script.cc (Script_options::Script_options): Initialize
8721 symbol_definitions_ and symbol_references_.
8722 (Script_options::add_symbol_assignment): Update
8723 symbol_definitions_ and symbol_references_.
8724 (Script_options::add_symbol_reference): New function.
8725 (script_symbol): New function.
8726 * script.h (class Script_options): Add symbol_definitions_ and
8727 symbol_references_ fields.
8728 (Script_options::referenced_const_iterator): New type.
8729 (Script_options::referenced_begin): New function.
8730 (Script_options::referenced_end): New function.
8731 (Script_options::is_referenced): New function.
8732 (Script_options::any_unreferenced): New function.
8733 * script-c.h (script_symbol): Declare.
8734 * yyscript.y (exp): Call script_symbol.
8735 * symtab.cc: Include "script.h".
8736 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8737 Change all callers. Check symbols referenced by scripts.
8738 (Symbol_table::add_undefined_symbols_from_command_line): Add
8739 layout parameter. Change all callers.
8740 (Symbol_table::do_add_undefined_symbols_from_command_line):
8741 Likewise. Break out loop body. Check symbols referenced by
8742 scripts.
8743 (Symbol_table::add_undefined_symbol_from_command_line): New
8744 function broken out of
8745 do_add_undefined_symbols_from_command_line.
8746 * symtab.h (class Symbol_table): Update declarations.
8747 * archive.cc: Include "layout.h".
8748 (Archive::should_include_member): Add layout parameter. Change
8749 all callers. Check for symbol mentioned in expression.
8750 * archive.h (class Archive): Update declaration.
8751 * object.cc (Sized_relobj::do_should_include_member): Add layout
8752 parameter.
8753 * object.h (Object::should_include_member): Add layout parameter.
8754 Change all callers.
8755 (Object::do_should_include_member): Add layout parameter.
8756 (class Sized_relobj): Update declaration.
8757 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8758 parameter.
8759 * dynobj.h (class Sized_dynobj): Update declaration.
8760 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8761 layout parameter.
8762 * plugin.h (class Sized_pluginobj): Update declaration.
8763
5f1ab67a
ILT
87642010-08-02 Ian Lance Taylor <iant@google.com>
8765
8766 PR 11866
8767 * output.cc (Output_segment::set_offset): Search for the first and
8768 last sections rather than assuming that the list is in order.
8769 (Output_segment::find_first_and_last_list): New function.
8770 * output.h (class Output_segment): Update declarations.
8771 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8772 (relro_strip_test_SOURCES): New variable.
8773 (relro_strip_test_DEPENDENCIES): New variable.
8774 (relro_strip_test_LDFLAGS): New variable.
8775 (relro_strip_test_LDADD): New variable.
8776 (relro_strip_test.so): New target.
8777
a8df5856
ILT
87782010-08-02 Ian Lance Taylor <iant@google.com>
8779
8780 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8781 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8782 (Target_i386::got_tlsdesc_section): New function.
8783 (Target_i386::got_section): Create space for GOT entries for
8784 TLSDESC relocations.
8785 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8786 R_386_TLS_GOTDESC.
8787 (Target_i386::Scan::global): Likewise.
8788 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8789 using TLSDESC GOT.
8790 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8791 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8792 (Target_x86_64::got_tlsdesc_section): New function.
8793 (Target_x86_64::got_section): Create space for GOT entries for
8794 TLSDESC relocations.
8795 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8796 R_386_TLS_GOTDESC.
8797 (Target_x86_64::Scan::global): Likewise.
8798 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8799 using TLSDESC GOT.
8800
0c10a0a6
ILT
88012010-08-02 Ian Lance Taylor <iant@google.com>
8802
8803 * testsuite/final_layout.sh: Use dc to convert from hex to
8804 decimal.
8805
41cbeecc
ST
88062010-07-29 Sriraman Tallam <tmsriram@google.com>
8807
8808 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8809 paramter to the call to gold::gc_process_relocs.
8810 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8811 paramter to the call to gold::gc_process_relocs.
8812 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8813 parameter to the call to gold::gc_process_relocs.
8814 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8815 template parameter to the call to gold::gc_process_relocs.
8816 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8817 paramter to the call to gold::gc_process_relocs.
8818 * gc.h (get_embedded_addend_size): New function.
8819 (gc_process_relocs): Save the size of the reloc for use by ICF.
8820 * icf.cc (get_section_contents): Get the addend from the text section
8821 for SHT_REL relocation sections.
8822 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8823 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8824 * int_encoding.h (read_from_pointer): New overloaded function.
8825 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8826 * testsuite/icf_sht_rel_addend_test.sh: New file.
8827 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8828 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8829
6ea55b82
RW
88302010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8831
8832 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8833 * Makefile.in: Regenerate.
8834 * testsuite/Makefile.in: Regenerate.
8835
9691462b
ILT
88362010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8837
8838 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8839 * gold/testsuite/debug_msg.cc: Likewise.
8840 * gold/testsuite/odr_violation1.cc
8841 * gold/testsuite/odr_violation2.cc
8842
76897331
CC
88432010-07-21 Cary Coutant <ccoutant@google.com>
8844
8845 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8846 string, and length fields.
8847 (Output_merge_string::Merged_strings_list): New type.
8848 (Output_merge_string::Merged_strings_lists): New typedef.
8849 (Output_merge_string): Replace merged_strings_ with
8850 merged_strings_lists_.
8851 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8852 Merged_strings_list per input object and section. Don't store pointer
8853 to the string. Don't store length with each merged string entry.
8854 (Output_merge_string::finalize_merged_data): Loop over list of merged
8855 strings lists. Recompute length of each merged string.
8856
78384e8f
CC
88572010-07-15 Cary Coutant <ccoutant@google.com>
8858
8859 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8860 here.
8861
783659f9
ILT
88622010-07-14 Ian Lance Taylor <iant@google.com>
8863
8864 * descriptors.cc (Descriptors::open): Report correct name in error
8865 message.
8866
131687b4
DK
88672010-07-13 Doug Kwan <dougkwan@google.com>
8868
8869 * arm.cc (Arm_input_section::Arm_input_section): For a
8870 SHT_ARM_EXIDX section, always keeps the input sections.
8871 (Arm_input_section::set_exidx_section_link): New method.
8872 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8873 has_errors_ to false.
8874 (Arm_exidx_input_section::has_errors,
8875 Arm_exidx_input_section::set_has_errors): New methods.
8876 (Arm_exidx_input_section::has_errors_): New data member.
8877 (Arm_relobj::get_exidx_shndx_list): New method.
8878 (Arm_output_section::append_text_sections_to_list): Do not skip
8879 section without SHF_EXECINSTR.
8880 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8881 errors.
2e702c99 8882 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8883 section header. Make error messages more verbose. Check for
8884 a non-executable section linked to an EXIDX section.
8885 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8886 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8887 check that there is no deferred EXIDX section if we exit early.
8888 Instead of not making an EXIDX section in case of an error, make one
8889 and set the has_errors flag of it.
8890 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8891 in a relocatable link.
8892 (Target_arm::do_relax): Look for the EXIDX output section instead of
8893 assuming that it is called .ARM.exidx.
2e702c99 8894 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8895 section list. Do not check for SHF_EXECINSTR section flags but
8896 skip any input section with errors.
8897 * output.cc (Output_section::Output_section): Initialize
8898 always_keeps_input_sections_ to false.
8899 (Output_section::add_input_section): Check for
8900 always_keeps_input_sections_.
8901 * output.h (Output_section::always_keeps_input_sections,
8902 Output_section::set_always_keeps_input_sections): New methods.
8903 (Output_section::always_keeps_input_sections): New data member.
8904
69517287
RÁE
89052010-07-13 Rafael Espindola <espindola@google.com>
8906
8907 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8908 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8909
82742395
ILT
89102010-07-13 Philip Herron <herron.philip@googlemail.com>
8911 Ian Lance Taylor <iant@google.com>
8912
8913 * output.h (Output_section_lookup_maps::add_merge_section):
8914 Correct check of whether value was inserted.
8915 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8916 (Output_section_lookup_maps::add_relaxed_input_section):
8917 Likewise.
8918 * arm.cc (Target_arm::got_section): Remove used local os.
8919 * i386.cc (Target_i386::got_section): Likewise.
8920 * x86_64.cc (Target_x86_64::got_section): Likewise.
8921 * sparc.cc (Target_sparc::got_section): Likewise.
8922 (Target_sparc::relocate): Remove unused local have_got_offset.
8923 * powerpc.cc (Target_powerpc::relocate): Likewise.
8924
f2d707b5
ILT
89252010-07-13 Ian Lance Taylor <iant@google.com>
8926
241531d6
ILT
8927 * compressed_output.cc (zlib_decompress): Fix signature in
8928 !HAVE_ZLIB_H case.
8929
f2d707b5
ILT
8930 * archive.cc (Archive::include_member): Unlock an external member
8931 of a thin archive. Don't bother to delete an object we know is
8932 NULL.
8933
a2e47362
CC
89342010-07-12 Cary Coutant <ccoutant@google.com>
8935
8936 * compressed_output.cc (zlib_decompress): New function.
8937 (get_uncompressed_size): New function.
8938 (decompress_input_section): New function.
8939 * compressed_output.h (get_uncompressed_size): New function.
8940 (decompress_input_section): New function.
8941 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8942 Handle compressed debug sections.
8943 * layout.cc (is_compressed_debug_section): New function.
8944 (Layout::output_section_name): Map compressed section names to
8945 canonical names.
8946 * layout.h (is_compressed_debug_section): New function.
8947 (is_debug_info_section): Recognize compressed debug sections.
8948 * merge.cc: Include compressed_output.h.
8949 (Output_merge_data::do_add_input_section): Handle compressed
8950 debug sections.
8951 (Output_merge_string::do_add_input_section): Handle compressed
8952 debug sections.
8953 * object.cc: Include compressed_output.h.
8954 (Sized_relobj::Sized_relobj): Initialize new data members.
8955 (build_compressed_section_map): New function.
8956 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8957 * object.h (Object::section_is_compressed): New method.
8958 (Object::do_section_is_compressed): New method.
8959 (Sized_relobj::Compressed_section_map): New type.
8960 (Sized_relobj::do_section_is_compressed): New method.
8961 (Sized_relobj::compressed_sections_): New data member.
8962 * output.cc (Output_section::add_input_section): Handle compressed
8963 debug sections.
8964 * reloc.cc: Include compressed_output.h.
8965 (Sized_relobj::write_sections): Handle compressed debug sections.
8966
ce279a62
CC
89672010-07-08 Cary Coutant <ccoutant@google.com>
8968
8969 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8970 weak when resolving to a dynamic def.
8971 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8972 for weak undef/dynamic def cases. Adjust callers.
8973 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8974 undef_binding_weak_.
8975 (Symbol_table::sized_write_globals): Adjust symbol binding.
8976 (Symbol_table::sized_write_symbol): Add binding parameter.
8977 * symtab.h (Symbol::set_undef_binding): New method.
8978 (Symbol::is_undef_binding_weak): New method.
8979 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8980 (Symbol_table::should_override): Add new parameter.
8981 (Symbol_table::sized_write_symbol): Add new parameter.
8982
8983 * testsuite/weak_undef_file1.cc: Add new test case.
8984 * testsuite/weak_undef_file2.cc: Fix header comment.
8985 * testsuite/weak_undef_test.cc: Add new test case.
8986
b2286c10
DK
89872010-06-29 Doug Kwan <dougkwan@google.com>
8988
8989 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8990 Initialize USE_SYMBOL_.
8991 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8992 definition.
8993 (Arm_reloc_property::uses_symbol_): New data member declaration.
8994 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8995 uses symbol value and symbol is undefined but not weakly undefined.
8996
4802450a
RÁE
89972010-06-28 Rafael Espindola <espindola@google.com>
8998
8999 * plugin.cc (Plugin::load): Use dlerror.
9000
e5ca47ba
ILT
90012010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9002
9003 * symtab.cc (detect_odr_violations): When reporting an ODR
9004 violation, report an object where the symbol is defined.
9005
8a75a161
DK
90062010-06-25 Doug Kwan <dougkwan@google.com>
9007
9008 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9009 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9010 definition.
9011 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9012 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9013 target hook to detect function points.
9014 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9015 * icf.h (Icf::check_section_for_function_pointers): Change type of
9016 parameter SECTION_NAME to const reference to std::string. Use
9017 target hook to determine if section may have unsafe pointers.
9018 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9019 method definition.
9020
42218b9f
RÁE
90212010-06-21 Rafael Espindola <espindola@google.com>
9022
9023 * fileread.cc (Input_file::find_fie): New
9024 (Input_file::open): Use Input_file::find_fie.
9025 * fileread.h (Input_file::find_fie): New
9026 * plugin.cc (set_extra_library_path): New.
9027 (Plugin::load): Add set_extra_library_path to the transfer vector.
9028 (Plugin_manager::set_extra_library_path): New.
9029 (Plugin_manager::add_input_file): Use the extra search path if set.
9030 (set_extra_library_path(): New.
9031 * plugin.h (Plugin_manager): Add set_extra_library_path and
9032 extra_search_path_.
9033
a0506cca
CC
90342010-06-19 Cary Coutant <ccoutant@google.com>
9035
9036 * layout.cc (gdb_sections): Add .debug_types.
9037 (lines_only_debug_sections): Likewise.
9038
6508b958
RÁE
90392010-06-18 Rafael Espindola <espindola@google.com>
9040
9041 * plugin.cc (add_input_file,add_input_library)
9042 (Plugin_manager::add_input_file): Make filename arguments const.
9043 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9044 const.
9045
3e235302
DK
90462010-06-16 Doug Kwan <dougkwan@google.com>
9047
9048 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9049 .ARM.attributes section if we have not merged any input
9050 attributes sections.
9051
106e8a6c
DK
90522010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9053
9054 * arm.cc: Allow combining objects with no EABI version
9055 information.
9056
91ff43fe
RÁE
90572010-06-15 Rafael Espindola <espindola@google.com>
9058
9059 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9060
68ed838c
ILT
90612010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9062
9063 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9064 (struct iovec): Correct !HAVE_READV definition.
9065
f3a2388f
CC
90662010-06-10 Cary Coutant <ccoutant@google.com>
9067
9068 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9069 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9070 reloc sections.
9071 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9072
9073 PR 11683
9074 * symtab.h (Symbol::is_placeholder): New member function.
9075 * target-reloc.h (relocate_section): Check for placeholder symbols.
9076
9077 * testsuite/Makefile.am (plugin_test_8): New test.
9078 (plugin_test_9): New test.
9079 * testsuite/Makefile.in: Regenerate.
9080
e1df38aa
NC
90812010-06-09 Nick Clifton <nickc@redhat.com>
9082
9083 * yyscript.y (input_list_element): Allow strings prefixed with
9084 the '-' character. Treat these as libraries.
9085 * script.cc (script_add_library): New function. Adds a library
9086 specified by "-l<name>" found in an input script.
9087 * script-c.h: Add prototype for script_add_library.
9088
25bbe950
DK
90892010-06-07 Doug Kwan <dougkwan@google.com>
9090
9091 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9092 Restrict stub-group size to be within long conditional branch
9093 range when working around cortex-A8 erratum.
9094
0f32ea4c
ILT
90952010-06-07 Damien Diederen <dd@crosstwine.com>
9096
9097 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9098 #ifdef typo.
9099
8fe2a369
ST
91002010-06-03 Sriraman Tallam <tmsriram@google.com>
9101
9102 PR gold/11658
9103 * output.cc
9104 (Output_section::Input_section_sort_entry::compare_section_ordering):
9105 Change to return non-zero correctly.
9106 (Output_section::Input_section_sort_section_order_index_compare
9107 ::operator()): Change to fix ambiguity in comparisons.
9108
6e9ba2ca
ST
91092010-06-01 Sriraman Tallam <tmsriram@google.com>
9110
9111 * gold.h (is_wildcard_string): New function.
9112 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9113 (Layout::layout_eh_frame): Ditto.
9114 (Layout::find_section_order_index): New method.
9115 (Layout::read_layout_from_file): New method.
9116 * layout.h (Layout::find_section_order_index): New method.
9117 (Layout::read_layout_from_file): New method.
9118 (Layout::input_section_position_): New private member.
9119 (Layout::input_section_glob_): New private member.
9120 * main.cc (main): Call read_layout_from_file here.
9121 * options.h (--section-ordering-file): New option.
9122 * output.cc (Output_section::input_section_order_specified_): New
9123 member.
9124 (Output_section::Output_section): Initialize new member.
9125 (Output_section::add_input_section): Add new parameter.
9126 Keep input sections when --section-ordering-file is used.
9127 (Output_section::set_final_data_size): Sort input sections when
9128 section ordering file is specified.
9129 (Output_section::Input_section_sort_entry): Add new parameter.
9130 Check sorting type.
9131 (Output_section::Input_section_sort_entry::compare_section_ordering):
9132 New method.
9133 (Output_section::Input_section_sort_compare::operator()): Change to
9134 consider section_order_index.
9135 (Output_section::Input_section_sort_init_fini_compare::operator()):
9136 Change to consider section_order_index.
9137 (Output_section::Input_section_sort_section_order_index_compare
9138 ::operator()): New method.
9139 (Output_section::sort_attached_input_sections): Change to sort
9140 according to section order when specified.
e1df38aa
NC
9141 (Output_section::add_input_section<32, true>): Add new parameter.
9142 (Output_section::add_input_section<64, true>): Add new parameter.
9143 (Output_section::add_input_section<32, false>): Add new parameter.
9144 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9145 * output.h (Output_section::add_input_section): Add new parameter.
9146 (Output_section::input_section_order_specified): New
9147 method.
9148 (Output_section::set_input_section_order_specified): New method.
9149 (Input_section::Input_section): Initialize section_order_index_.
9150 (Input_section::section_order_index): New method.
9151 (Input_section::set_section_order_index): New method.
9152 (Input_section::section_order_index_): New member.
9153 (Input_section::Input_section_sort_section_order_index_compare): New
9154 struct.
9155 (Output_section::input_section_order_specified_): New member.
9156 * script-sections.cc (is_wildcard_string): Delete and move modified
9157 method to gold.h.
9158 (Output_section_element_input::Output_section_element_input): Modify
9159 call to is_wildcard_string.
9160 (Output_section_element_input::Input_section_pattern
9161 ::Input_section_pattern): Ditto.
9162 (Output_section_element_input::Output_section_element_input): Ditto.
9163 * testsuite/Makefile.am (final_layout): New test case.
9164 * testsuite/Makefile.in: Regenerate.
9165 * testsuite/final_layout.cc: New file.
9166 * testsuite/final_layout.sh: New file.
9167
3537c84b
RÁE
91682010-06-01 Rafael Espindola <espindola@google.com>
9169
9170 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9171
105b6afd
RÁE
91722010-06-01 Rafael Espindola <espindola@google.com>
9173
9174 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9175 visibility of symbols.
9176
29e11421
DK
91772010-05-27 Doug Kwan <dougkwan@google.com>
9178
9179 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9180 from start of output section instead of address for a local symbol
9181 in a merged or relaxed section when doing a relocatable link.
9182
5e0f337e
RÁE
91832010-05-26 Rafael Espindola <espindola@google.com>
9184
703d02da 9185 PR 11604
5e0f337e
RÁE
9186 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9187 adding sections the garbage collector removed.
9188 * gold/testsuite/Makefile.am: Add test.
9189 * gold/testsuite/Makefile.in: Regenerate.
9190 * gold/testsuite/plugin_test_7.sh: New.
9191 * gold/testsuite/plugin_test_7_1.c: New.
9192 * gold/testsuite/plugin_test_7_2.c: New.
9193
f4187277
RÁE
91942010-05-26 Rafael Espindola <espindola@google.com>
9195
9196 * script-sections.cc (Output_section_definition::set_section_addresses):
9197 Check for --section-start.
9198
5c388529
DK
91992010-05-26 Doug Kwan <dougkwan@google.com>
9200
9201 * arm.cc (Arm_scan_relocatable_relocs): New class.
9202 (Target_arm::relocate_special_relocatable): New method.
9203 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9204 (Arm_relocate_functions::thumb_branch_common): Same.
9205 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9206 instead of Default_scan_relocatable_relocs.
9207 * target-reloc.h (relocate_for_relocatable): Let target handle
9208 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9209 * target.h (Sized_target::relocate_special_relocatable): New method.
9210
bca1c3ae
ILT
92112010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9212
9213 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9214
0439c796
DK
92152010-05-23 Doug Kwan <dougkwan@google.com>
9216
9217 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9218 instead of a cast.
9219 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9220 with a direct branch, not a conditional branch, to a stub.
9221 * merge.cc (Output_merge_base::record_input_section): New method
9222 defintion.
9223 (Output_merge_data::do_add_input_section): Record input section if
9224 keeps-input-sections flag is set.
9225 (Output_merge_string::do_add_input_section): Ditto.
9226 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9227 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9228 INPUT_SECTIONS_.
9229 (Output_merge_base::keeps_input_sections,
9230 Output_merge_base::set_keeps_input_sections,
9231 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9232 method definitions.
9233 (Output_merge_base::Input_sections): New type declaration.
9234 (Output_merge_base::input_sections_begin,
9235 Output_merge_base::input_sections_end,
9236 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9237 (Output_merge_base::bool keeps_input_sections_,
9238 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9239 Output_merge_base::input_sections_): New data members.
9240 (Output_merge_data::do_set_keeps_input_sections): New method
9241 defintion.
9242 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9243 * output.cc (Output_section::Input_section::relobj): Move method
9244 defintion from class declaration to here and handle merge sections.
9245 (Output_section::Input_section::shndx): Ditto.
9246 (Output_section::Output_section): Remove initializations of removed
9247 data members and initialize new data member LOOKUP_MAPS_.
9248 (Output_section::add_input_section): Set keeps-input-sections flag
9249 for a newly created merge output section as appropriate. Adjust code
9250 to use Output_section_lookup_maps class.
9251 (Output_section::add_relaxed_input_section): Adjst code for lookup
9252 maps code refactoring.
2e702c99 9253 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9254 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9255 class. If adding input section to a newly created merge output
9256 section fails, remove the new merge section.
9257 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9258 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9259 (Output_section::find_merge_section): Ditto.
0439c796 9260 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9261 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9262 Output_section_lookup_maps class.
9263 (Output_section::get_input_sections): Export merge sections. Adjust
9264 code to use Output_section_lookup_maps class.
9265 (Output_section:::add_script_input_section): Adjust code to use
9266 Output_section_lookup_maps class. Update lookup maps for merge
9267 sections also.
9268 (Output_section::discard_states): Use Output_section_lookup_maps.
9269 (Output_section::restore_states): Same.
9270 * output.h (Merge_section_properties): Move class defintion out of
9271 Output_section.
9272 (Output_section_lookup_maps): New class.
9273 (Output_section::Input_section::is_merge_section): New method
9274 defintion.
9275 (Output_section::Input_section::relobj): Move defintion out of class
9276 defintion. Declare method only.
9277 (Output_section::Input_section::shndx): Ditto.
9278 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9279 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9280 (Output_section::Merge_section_by_properties_map,
9281 Output_section::Output_section_data_by_input_section_map,
9282 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9283 Remove types.
2e702c99 9284 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9285 KEEPS_INPUT_SECTIONS.
9286 (Output_section::build_lookup_maps): New method declaration.
9287 (Output_section::merge_section_map_,
9288 Output_section::merge_section_by_properties_map_,
9289 Output_section::relaxed_input_section_map_,
9290 Output_section::is_relaxed_input_section_map_valid_): Remove data
9291 members.
9292 (Output_section::lookup_maps_): New data member.
9293
76295588
L
92942010-05-21 Doug Kwan <dougkwan@google.com>
9295
9296 PR gold/11619
9297 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9298 avoid a compilation error.
9299
d103a984
RÁE
93002010-05-19 Rafael Espindola <espindola@google.com>
9301
9302 * script-sections.cc (Output_section_definition::allocate_to_segment):
9303 Update the phdrs_list even when the output section is NULL.
9304 * testsuite/Makefile.am: Add test.
9305 * testsuite/Makefile.in: Regenerate.
9306 * testsuite/script_test_9.cc: New.
9307 * testsuite/script_test_9.sh: New.
9308 * testsuite/script_test_9.t: New.
9309
6625d24e
DK
93102010-05-19 Doug Kwan <dougkwan@google.com>
9311
9312 * arm.cc (Arm_input_section::original_size): New method.
9313 (Arm_input_section::do_addralign): Add a cast.
9314 (Arm_input_section::do_output_offset): Remove static cast.
9315 (Arm_input_section::original_addralign,
9316 Arm_input_section::original_size_): Change type to uint32_t.
9317 (Arm_input_section::init): Add safe casts for section alignment
9318 and size.
9319 (Arm_input_section::set_final_data_size): Do not set address and
9320 offset of stub table.
9321 (Arm_output_section::fix_exidx_coverage): Change use of of
9322 Output_section::Simple_input_section to that of
9323 Output_section::Input_section.
9324 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9325 except for the first pass.
9326 * output.cc (Output_section::get_input_sections): Change type of
9327 input_sections to std::list<Input_section>.
9328 (Output_section::add_script_input_section): Rename from
9329 Output_section::add_simple_input_section. Change type of SIS
9330 parameter from Simple_input_section to Input_section.
9331 * output.h (Output_section::Simple_input_section): Remove class.
9332 (Output_section::Input_section): Change class visibility to public.
9333 (Output_section::Input_section::addralign): Use stored alignments
9334 for special input sections if set.
9335 (Output_section::Input_section::set_addralign): New method.
9336 (Output_section::get_input_sections): Change parameter type from
9337 list of Simple_input_section to list of Input_section.
9338 (Output_section::add_script_input_section): Rename from
9339 Output_section::add_simple_input_section. Change first parameter's
9340 type from Simple_input_section to Input_section and remove the
9341 second and third parameters.
9342 * script-sections.cc (Input_section::Input_section_list): Change
9343 type to list of Output_section::Input_section/
9344 (Input_section_info::Input_section_info): Change parameter type of
9345 INPUT_SECTION to Output_section::Input_section.
9346 (Input_section_info::input_section): Change return type.
9347 (Input_section_info::input_section_): Change type to
9348 Output_section::Input_section.
9349 (Output_section_element_input::set_section_addresses): Adjust code
9350 to use Output_section::Input_section instead of
9351 Output_section::Simple_input_section. Adjust code for renaming
9352 of Output_section::add_simple_input_section.
9353 (Orphan_output_section::set_section_addresses): Ditto.
9354
e1e82ea4
RW
93552010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9356
9357 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9358 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9359
91e75c8a
RÁE
93602010-05-18 Rafael Espindola <espindola@google.com>
9361
9362 * options.cc (General_options::finalize): Handle -nostdlib.
9363 * options.h (nostdlib): New option.
9364 * script.cc (script_add_search_dir): Handle -nostdlib.
9365
da59ad79
DK
93662010-05-12 Doug Kwan <dougkwan@google.com>
9367
9368 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9369 attributes section only if there no attributes section after merging.
9370 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9371 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9372 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9373 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9374 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9375 and arm_attr_merge_7.stdout.
9376 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9377 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9378 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9379 arm_attr_merge_7b.o): New rules.
9380 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9381 arm_attr_merge_7
9382 * testsuite/Makefile.in: Regenerate.
9383 * testsuite/arm_attr_merge.sh: New file.
9384 * testsuite/arm_attr_merge_[67][ab].s: Same.
9385
3e01a7fd
NC
93862010-05-05 Nick Clifton <nickc@redhat.com>
9387
9388 * po/es.po: Updated Spanish translation.
9389
7ad2014a
L
93902010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9391
9392 * Makefile.am (install-exec-local): Properly install gold as
9393 default cross linker.
9394 * Makefile.in: Regenerated.
9395
4fda8867
NC
93962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9397 Nick Clifton <nickc@redhat.com>
9398
9399 * configure.ac (install_as_default): Define and set to false
9400 unless --enable-gold or --enable-gold=both/gold has been
9401 specified.
9402 * configure: Regenerate.
9403
9404 * Makefile.am (install-exec-local): Install the executable as
9405 'ld.gold'. If install_as_default is true then also install it as
9406 'ld'.
9407 * Makefile.in: Regenerated.
9408
bd288ea2
ILT
94092010-04-24 Ian Lance Taylor <iant@google.com>
9410
9411 * layout.cc (Layout::layout_reloc): In relocatable link don't
9412 combine reloc sections for grouped sections.
9413
ef38fd8a
ST
94142010-04-23 Sriraman Tallam <tmsriram@google.com>
9415
9416 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9417 sections that are not ordinary to icf.
9418 * icf.cc (get_section_contents): Handle relocation pointing to section
9419 with no object or shndx information.
9420 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9421 * testsuite/Makefile.in: Regenerate.
9422 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9423 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9424
f6973bdc
ILT
94252010-04-22 Ian Lance Taylor <iant@google.com>
9426
9427 * expression.cc (Expression::Expression_eval_info): Add
9428 result_alignment_pointer field.
9429 (Expression::eval_with_dot): Add result_alignment_pointer
9430 parameter. Change all callers.
9431 (Expression::eval_maybe_dot): Likewise.
9432 (class Binary_expression): Add alignment_pointer parameter to
9433 left_value and right_value. Change all callers.
9434 (BINARY_EXPRESSION): Set result alignment.
9435 (class Trinary_expression): Add alignment_pointer parameter to
9436 arg2_value and arg3_value. Change all callers.
9437 (Trinary_cond::value): Set result alignment.
9438 (Max_expression::value, Min_expression::value): Likewise.
9439 (Align_expression::value): Likewise.
9440 * script-sections.cc (class Sections_element): Add dot_alignment
9441 parameter to set_section_addresses virtual function. Update
9442 instantiations.
9443 (class Output_section_element): Likewise.
9444 (Script_sections::create_segments): Add dot_alignment parameter.
9445 Change all callers.
9446 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9447 (Script_sections::set_phdrs_clause_addresses): Likewise.
9448 * script-sections.h: Update declarations.
9449 * script.h: Update declarations.
9450 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9451 min_p_align.
9452 * testsuite/script_test_3.t: Set large alignment.
9453 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9454 segment has expected alignment.
9455
9c9c98a5
NC
94562010-04-22 Nick Clifton <nickc@redhat.com>
9457
9458 * po/gold.pot: Updated by the Translation project.
9459 * po/vi.po: Updated Vietnamese translation.
9460
2253bfba
L
94612010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9462
9463 * testsuite/Makefile.am (check_PROGRAMS): Add
9464 icf_virtual_function_folding_test.
9465 * testsuite/Makefile.in: Regenerated.
9466
85fdf906
AH
94672010-04-15 Andrew Haley <aph@redhat.com>
9468
9469 * options.h (merge_exidx_entries): New option.
9470 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9471 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9472 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9473 (Target_arm::merge_exidx_entries): New function.
9474 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9475 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9476 to Arm_exidx_fixup constructor.
9477 Add new arg, merge_exidx_entries.
9478 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9479 Arm_output_section::fix_exidx_coverage.
9480
ce97fa81
ST
94812010-04-18 Sriraman Tallam <tmsriram@google.com>
9482
9483 * icf.cc (get_section_contents): Check for preemptible functions.
9484 Ignore addend when appropriate.
9485 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9486 section folded.
9487 (add_from_relobj): Check for section folded.
9488 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9489 * symtab.h (should_add_dynsym_entry): Add new parameter.
9490 * target-reloc.h (scan_relocs): Check for section folded.
9491 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9492 Check reloc types for function pointers in shared objects.
9493 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9494 case.
9495 (icf_preemptible_functions_test): New test case.
9496 (icf_string_merge_test): New test case.
9497 * testsuite.Makefile.in: Regenerate.
9498 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9499 bar_glob. Refactor code.
9500 * testsuite/icf_preemptible_functions_test.cc: New file.
9501 * testsuite/icf_preemptible_functions_test.sh: New file.
9502 * testsuite/icf_string_merge_test.cc: New file.
9503 * testsuite/icf_string_merge_test.sh: New file.
9504 * testsuite/icf_virtual_function_folding_test.cc: New file.
9505 * testsuite/icf_virtual_function_folding_test.sh: New file.
9506
04ceb17c
DK
95072010-04-14 Doug Kwan <dougkwan@google.com>
9508
9509 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9510 for local symbol recounting if we remove a section due to ICF.
9511 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9512 there are no regular objects in input.
9513
153e7da4
DK
95142010-04-13 Doug Kwan <dougkwan@google.com>
9515
9516 * arm.cc (Arm_input_section::set_final_data_size): Compute
9517 accurate final data size instead of using current data size.
9518
4dbd9faf
DK
95192010-04-09 Doug Kwan <dougkwan@google.com>
9520
9521 * layout.cc (Layout::choose_output_section): Handle script section
9522 types.
9523 (Layout::make_output_section_for_script): Add section type parameter.
9524 Handle script section types.
9525 * layout.h (Layout::make_output_section_for_script): Add section
9526 type parameter.
9527 * output.cc (Output_section::Output_section): Initialize data member
9528 is_noload_.
9529 (Output_section::do_reset_address_and_file_offset): Do not set address
9530 to 0 if section is a NOLOAD section.
9531 * output.h (Output_section::is_noload): New method.
9532 (Output_section::set_is_noload): Ditto.
9533 (Output_section::is_noload_): New data member.
9534 * script-c.h (Script_section_type): New enum type.
9535 (struct Parser_output_section_header): Add new file section_type.
9536 * script-sections.cc (Sections_element::output_section_name): Add
9537 parameter for returning script section type.
9538 (Output_section_definition::output_section_name): Ditto.
9539 (Output_section_definition::section_type)P; New method.
9540 (Output_section_definiton::script_section_type_name): Ditto.
9541 (Output_section_definition::script_section_type_): New data member.
9542 (Output_section_definition::Output_section_definition): Initialize
9543 data member Output_section_definition::script_section_type_.
9544 (Output_section_definition::create_sections): Pass script section type
9545 to Layout::make_output_section_for_script.
9546 (Output_section_definition::output_section_name): Return script
9547 section type to caller.
9548 (Output_section_definition::set_section_address): Do not advance
9549 dot value and load address if section type is NOLOAD. Set address
9550 of NOLOAD sections regardless of section flags.
9551 (Output_section_definition::print): Print section type if it is
9552 not SCRIPT_SECTION_TYPE_NONE.
9553 (Output_section_definition::section_type): New method.
9554 (Output_section_definition::script_section_type_name): Ditto.
9555 (Script_sections::output_section_name): Add new parameter
9556 PSECTION_TYPE for returning script section type. Pass it to
9557 section elements. Handle discard sections.
9558 (Sort_output_sections::operator()): Handle NOLOAD sections.
9559 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9560 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9561 returning script section type.
9562 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9563 INFO and NOLOAD.
9564 * yyscript.y (union): Add new field SECTION_TYPE.
9565 (COPY, DSECT, INFO, NOLOAD): New tokens.
9566 (opt_address_and_section_type): Change type to output_section_header.
9567 (section_type): New non-terminal
9568 (section_header): Handle section type.
2253bfba 9569 (opt_address_and_section_type): Return section type value.
4dbd9faf 9570
721ea635
L
95712010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9572
9573 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9574 * testsuite/plugin_common_test_2.c (foo): Likewise.
9575
6bf924b0
DK
95762010-04-08 Doug Kwan <dougkwan@google.com>
9577
9578 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9579 Output_merge_data.
9580 * output.cc (Output_section::add_merge_input_section): Simplify
9581 code and return status of Output_merge_base::add_input_section.
e1df38aa 9582 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9583 returns true.
9584
24af6f92
DK
95852010-04-07 Doug Kwan <dougkwan@google.com>
9586
9587 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9588 if section is marked as containing instructions but has no mapping
9589 symbols.
9590 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9591 correct section index.
9592 (Arm_relobj::find_linked_text_section): Ditto.
9593
00698fc5
CC
95942010-04-07 Cary Coutant <ccoutant@google.com>
9595
9596 * archive.cc (include_member): Destroy Read_symbols_data object before
9597 releasing file.
9598 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9599 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9600 (Read_symbols_data::~Read_symbols_data) New destructor.
9601 (Section_relocs::Section_relocs) New constructor.
9602 (Section_relocs::~Section_relocs) New destructor.
9603 (Read_relocs_data::Read_relocs_data) New constructor.
9604 (Read_relocs_data::~Read_relocs_data) New destructor.
9605 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9606 pointers to NULL after deleting.
9607
7296d933
DK
96082010-04-07 Doug Kwan <dougkwan@google.com>
9609
9610 * arm.cc: Replace "endianity" with "endianness" in comments.
9611 (Arm_exidx_cantunwind): Ditto.
9612 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9613 (Arm_relobj::merge_flags_and_attributes): New method.
9614 (Arm_relobj::merge_flags_and_attributes_): New data member.
9615 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9616 (Arm_relobj::scan_sections_for_stubs): Ditto.
9617 (Arm_relobj::do_read_symbols): Check to see if we really want to
9618 merge processor-specific flags and attributes. Exit early if
9619 an object is empty except for section names and the undefined symbol.
9620 (Target_arm::do_finalize_sections): Move check for ELF format to
9621 Arm_relobj::do_read_symbols. Merge processor specific flags and
9622 attributes from a regular object only when we have determined that
9623 it is aapropriate. Do not create an .ARM.attributes section in
9624 output if there is no regular input object.
9625 (Target_arm::merge_processor_specific_flags): Check
9626 --warn-mismatch before printing any error.
9627 (Target_arm::merge_object_attributes): Ditto.
9628 * gold.cc (queue_middle_tasks): Handle the case in which there is
9629 no regular object in input.
9630 * options.cc (General_options::parse_EB): New method.
9631 (General_options::parse_EL): Same.
9632 (General_options::General_options): Initialize endianness_.
9633 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9634 New options.
9635 (General_options::Endianness): New enum.
9636 (General_options::endianness): New method.
9637 (General_options::endianness_): New data member.
9638 * parameters.cc (Parameters::set_options): Check target endianness.
9639 (Parameters::set_target_once): Ditto.
9640 (Parameters::check_target_endianness): New method.
9641 (parameters_force_valid_target): If either -EL or -EB is specified,
9642 use it to define endianness of default target.
9643 * parameters.h (Parameters::check_target_endianness): New method
9644 declaration.
9645 * target.h (class Target): Change "endianity" to "endianness"
9646 in comments.
9647
efc8d4f2
RW
96482010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9649
9650 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9651 * configure: Regenerate.
9652 * Makefile.in: Regenerate.
9653 * testsuite/Makefile.in: Regenerate.
9654
be234d88
CC
96552010-04-06 Cary Coutant <ccoutant@google.com>
9656
9657 gcc PR lto/42757
9658 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9659 prevailing definitions of common symbols.
9660 * testsuite/plugin_test_6.sh: New test case.
9661 * testsuite/plugin_common_test_1.c: New test case.
9662 * testsuite/plugin_common_test_2.c: New test case.
9663 * testsuite/Makefile.am (plugin_test_6): New test case.
9664 * testsuite/Makefile.in: Regenerate.
9665
bd32c6bd
NC
96662010-04-06 Nick Clifton <nickc@redhat.com>
9667
9668 * po/vi.po: New Vietnamese translation.
9669
323c532f
DK
96702010-03-30 Doug Kwan <dougkwan@google.com>
9671
9672 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9673
4fcd97eb
DK
96742010-03-25 Doug Kwan <dougkwan@google.com>
9675
9676 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9677 to avoid a conversion warning on a 32-bit host.
9678
4ebf39db
ILT
96792010-03-24 Ian Lance Taylor <iant@google.com>
9680
9681 * testsuite/script_test_3.t: Add a TLS segment.
9682 * testsuite/Makefile.am (check_PROGRAMS): Add
9683 tls_phdrs_script_test.
9684 (tls_phdrs_script_test_SOURCES): Define.
9685 (tls_phdrs_script_test_DEPENDENCIES): Define.
9686 (tls_phdrs_script_test_LDFLAGS): Define.
9687 (tls_phdrs_script_test_LDADD): Define.
9688 * testsuite/Makefile.in: Rebuild.
9689
4a599bdd
CC
96902010-03-23 Cary Coutant <ccoutant@google.com>
9691
9692 * fileread.cc (find_or_make_view): Fix comment.
9693
6c93b22c
ILT
96942010-03-23 Ian Lance Taylor <iant@google.com>
9695
9696 * script-sections.cc (class Orphan_section_placement): Define
9697 PLACE_TLS and PLACE_TLS_BSS.
9698 (Orphan_section_placement::Orphan_section_placement): Initialize
9699 new places.
9700 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9701 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9702 (tls_script_test_SOURCES): Define.
9703 (tls_script_test_DEPENDENCIES): Define.
9704 (tls_script_test_LDFLAGS): Define.
9705 (tls_script_test_LDADD): Define.
9706 * testsuite/Makefile.in: Rebuild.
9707
a2c7281b
DK
97082010-03-22 Doug Kwan <dougkwan@google.com>
9709
9710 * arm.cc (Arm_relocate_functions::abs8,
9711 Arm_relocate_functions::abs16): Use correct check for overflow
9712 specified in the ARM ELF specs.
9713 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9714 target of a BLX instruction specially.
9715 (Reloc_stub::stub_type_for_reloc): Ditto.
9716 (Relocate::relocate): Use symbolic names instead of numeric relocation
9717 codes to report error.
9718 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9719 workaround.
9720 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9721 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9722 thumb2_blx_out_of_range.stdout
9723 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9724 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9725 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9726 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9727 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9728 thumb2_blx_in_range, thumb2_blx_in_range.o,
9729 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9730 thumb2_blx_out_of_range.o): New rules.
2e702c99 9731 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9732 thumb2_blx_in_range and thumb2_blx_out_of_range.
9733 * testsuite/Makefile.in: Regenerate.
9734 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9735 * testsuite/thumb_blx_in_range.s: New file.
9736 * testsuite/thumb_blx_out_of_range.s: New file.
9737
b0193076
RÁE
97382010-03-22 Rafael Espindola <espindola@google.com>
9739
9740 * archive.cc (Should_include): Move to archive.h.
9741 (should_include_member): Make it a member of Archive.
9742 (Lib_group): New.
9743 (Add_lib_group_symbols): New.
9744 * archive.h: Include options.h.
9745 (Archive_member): Moved from Archive.
9746 (Should_include): Moved from archive.cc.
9747 (Lib_group): New.
9748 (Add_lib_group_symbols): New.
9749 * dynobj.cc (do_should_include_member): New.
9750 * dynobj.h (do_should_include_member): New.
9751 * gold.cc (queue_initial_tasks): Update call to queue.
9752 * main.cc (main): Print lib group stats.
9753 * object.cc (do_should_include_member): New.
9754 * object.h: Include archive.h.
9755 (Object::should_include_member): New.
9756 (Object::do_should_include_member): New.
9757 (Sized_relobj::do_should_include_member): New.
9758 * options.cc (General_options::parse_start_lib): New.
9759 (General_options::parse_end_lib): New.
9760 (Input_arguments::add_file): Handle lib groups.
9761 (Input_arguments::start_group): Check we are not in a lib.
9762 (Input_arguments::start_lib): New.
9763 (Input_arguments::end_lib): New.
9764 * options.h (General_options): Add start_lib and end_lib.
9765 (Input_argument::lib_): New.
9766 (Input_argument::lib): New.
9767 (Input_argument::is_lib): New.
9768 (Input_file_lib): New.
9769 (Input_arguments::in_lib_): New.
9770 (Input_arguments::in_lib): New.
9771 (Input_arguments::start_lib): New.
9772 (Input_arguments::end_lib_): New.
9773 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9774 in unused members as preempted.
9775 (Sized_pluginobj::do_should_include_member): New.
9776 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9777 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9778 return the blocker.
9779 (Read_symbols::do_whole_lib_group): New.
9780 (Read_symbols::do_lib_group): New.
9781 (Read_symbols::do_read_symbols): Handle lib groups.
9782 (Read_symbols::get_name): Handle lib groups.
9783 * readsyms.h (Read_symbols): Add an archive member pointer.
9784 (Read_symbols::do_whole_lib_group): New.
9785 (Read_symbols::do_lib_group): New.
9786 (Read_symbols::member_): New.
9787 * script.cc (read_input_script): Update call to queue_soon.
9788
d099120c
DK
97892010-03-19 Doug Kwan <dougkwan@google.com>
9790
9791 * arm.cc (Stub_table::Stub_table): Initialize new data members
9792 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9793 (Stub_table::add_reloc_stub): Assign stub offset and update
9794 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9795 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9796 New data members.
2e702c99 9797 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9798 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9799 instead of going over all reloc stubs.
2e702c99 9800 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9801 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9802 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9803 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9804 Stringpool_template::offset_.
9805 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9806 Stringpool_template::offset_ to zero.
9807
1aa37384
DK
98082010-03-15 Doug Kwan <dougkwan@google.com>
9809
9810 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9811 offset_.
9812 (Stringpool_template::new_key_offset): New method.
9813 (Stringpool_template::add_string): Assign offsets when adding new
9814 strings.
9815 (Stringpool_template::set_string_offsets): Do not set string offsets
9816 when not optimizing.
9817 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9818 member size_.
2e702c99
RM
9819 (Chunked_vector::clear): Clear size_.
9820 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9821 (Chunked_vector::size): Return size_.
9822 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9823 (Chunked_vector::size_): New data member.
1aa37384
DK
9824 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9825 (Stringpool_template::new_key_offset): New method declaration.
9826 (Stringpool_template::offset_): New data member.
9827
b672b057
RÁE
98282010-03-15 Rafael Espindola <espindola@google.com>
9829
9830 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9831 Add_symbols' constructor.
9832 * readsyms.h (Add_symbols): Remove the input_group member.
9833
b6848d3c
ILT
98342010-03-10 Ian Lance Taylor <iant@google.com>
9835
9836 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9837 target to ask whether a reference to a symbol requires a stack
9838 split.
9839 * target.h (Target::is_call_to_non_split): New function.
9840 (Target::do_is_call_to_non_split): Declare virtual function.
9841 * target.cc: Include "symtab.h".
9842 (Target::do_is_call_to_non_split): New function.
9843 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9844
a2a5469e
CC
98452010-03-10 Cary Coutant <ccoutant@google.com>
9846
9847 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9848 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9849 (File_read::open[2]): Add whole_file_view_ to list of views.
9850 (File_read::make_view): Remove test of whole_file_view_.
9851 (File_read::find_or_make_view): Create whole_file_view_ if
9852 necessary.
9853 (File_read::clear_views): Replace bool parameter with enum;
9854 adjust all callers. Don't delete views with permanent data;
9855 do delete cached views and views from archives if
9856 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9857 if clearing the corresponding view.
9858 * fileread.h (File_read::Clear_views_mode): New enum.
9859 (File_read::View::is_permanent_view): New method.
9860 (File_read::clear_views): Replace bool parameter
9861 with enum; adjust all callers.
9862 * options.h (General_options): Change keep_files_mapped option;
9863 add map_whole_files.
9864 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9865 releasing the file.
9866 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9867 the file.
9868
8861f32b
DM
98692010-03-10 David S. Miller <davem@davemloft.net>
9870
9871 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9872
d62d0f5f
ST
98732010-03-09 Sriraman Tallam <tmsriram@google.com>
9874
9875 * icf.cc (get_section_contents): Add '@' marker after processing the
9876 merge reloc.
9877
9177756d
DK
98782010-03-08 Doug Kwan <dougkwan@google.com>
9879
9880 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9881 due to a conversion warning.
9882 (Arm_relobj::update_output_local_symbol_count): Check for local
9883 symbol with unset output index.
9884
9e9e071b
ILT
98852010-03-05 Ian Lance Taylor <iant@google.com>
9886
9887 * options.h (class General_options): Add --spare-dynamic-tags.
9888 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9889 --spare-dynamic-tags.
9890
a81ee015
ILT
98912010-03-05 Ian Lance Taylor <iant@google.com>
9892
9893 * incremental.cc: Include "libiberty.h".
9894
44ec90b9
RO
98952010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9896
9897 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9898 function, is_info_ member.
9899 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9900 (Versions::Versions): Update caller.
9901 (Versions::define_base_version): Likewise.
9902 (Versions::add_def): Likewise.
9903
0897ed3b
ST
99042010-03-03 Sriraman Tallam <tmsriram@google.com>
9905
9906 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9907 (Scan::possible_function_pointer_reloc): New function.
9908 (Scan::local_reloc_may_be_function_pointer): Change to call
9909 possible_function_pointer_reloc.
9910 (Scan::global_reloc_may_be_function_pointer): Ditto.
9911 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9912 relocations in ".data.rel.ro._ZTV" section.
9913 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9914 * testsuite/icf_safe_so_test.cc: Ditto.
9915 * testsuite/icf_safe_test.cc: Ditto.
9916 * testsuite/icf_safe_test.sh: Ditto.
9917
d3bbad62
ILT
99182010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9919 Ian Lance Taylor <iant@google.com>
9920
9921 * target-reloc.h (relocate_section): Check the symbol table index
9922 for -1U before setting the local symbol index.
9923 (scan_relocatable_relocs): If copying the relocation, record that
9924 the local symbol is required.
9925 * object.h (Symbol_value::is_output_symtab_index_set): New
9926 function.
9927 (Symbol_value::may_be_discarded_from_output_symtab): New
9928 function.
9929 (Symbol_value::has_output_symtab_entry): New function.
9930 (Symbol_value::needs_output_symtab_entry): Remove.
9931 (Symbol_value::output_symtab_index): Make sure the symbol index is
9932 set.
9933 (Symbol_value::set_output_symtab_index): Make sure the symbol
9934 index is not set. Make sure the new index is valid.
9935 (Symbol_value::set_must_have_output_symtab_entry): New function.
9936 (Symbol_value::has_output_dynsym_entry): New function.
9937 (Symbol_value::set_output_dynsym_index): Make sure the new index
9938 is valid.
9939 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9940 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9941 local symbol if permitted.
9942 (Sized_relobj::do_finalize_local_symbols): Call
9943 is_output_symtab_index_set rather than needs_output_symtab_entry.
9944 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9945 rather than needs_output_symtab_entry. Call
9946 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9947 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9948 is_output_symtab_index_set rather than needs_output_symtab_entry.
9949 * testsuite/discard_locals_relocatable_test.c: New file.
9950 * testsuite/discard_locals_test.sh: Test -r.
9951 * testsuite/Makefile.am (check_DATA): Add
9952 discard_locals_relocatable_test1.syms,
9953 discard_local_relocatable_test2.syms.
9954 (MOSTLYCLEANFILES): Likewise. Also add
9955 discard_locals_relocatable_test1.lout and
9956 discard_locals_relocatable_test2.out.
9957 (discard_locals_relocatable_test1.syms): New target.
9958 (discard_locals_relocatable_test.o): New target.
9959 (discard_locals_relocatable_test1.out): New target.
9960 (discard_locals_relocatable_test2.syms): New target.
9961 (discard_locals_relocatable_test2.out): New target.
9962 (various): Add missing ../ld-new dependencies.
9963 * testsuite/Makefile.in: Rebuild.
9964
7e8ccf26
NC
99652010-03-03 Nick Clifton <nickc@redhat.com>
9966
9967 * po/fi.po: New Finnish translation.
9968
2a0ff005
DK
99692010-03-01 Doug Kwan <dougkwan@google.com>
9970
9971 * layout.cc (Layout::Layout): Force section types of .init_array*,
9972 .preinit_array* and .fini_array* sections.
9973 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9974 Fix check of return value of std::string::find.().
9975 (Output_section::Input_section_sort_compare::operator()): Remove
9976 comment about .init_array.
9977 (Output_section::Input_section_sort_init_fini_compare::operator()):
9978 New method.
9979 (Output_section::sort_attached_input_sections): Handle .init_array
9980 and .fini_array specially.
9981 * output.h (Output_section::Inut_section_sort_compare): Update
9982 comment.
9983 (Output_section::Input_section_sort_init_fini_compare): New struct.
9984
c3e4ae29
DK
99852010-02-26 Doug Kwan <dougkwan@google.com>
9986
9987 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9988 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9989 * testsuite/debug_msg.sh: Avoid matching source line number for
9990 use of global variable undef_int.
9991
2fd9ae7a
DK
99922010-02-26 Doug Kwan <dougkwan@google.com>
9993
9994 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9995 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9996 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9997 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9998 * options.cc (General_options::General_options): Initialize member
9999 fix_v4bx_.
10000 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10001 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10002 and rm_no_fix_v4bx.stdout
10003 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10004 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10005 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10006 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10007 and arm_no_fix_v4bx.
10008 * Makefile.in: Regenerate.
10009 * testsuite/arm_fix_v4bx.s: New file.
10010 * testsuite/arm_fix_v4bx.sh: Ditto.
10011
67ec7d0b
DK
100122010-02-24 Doug Kwan <dougkwan@google.com>
10013
10014 * arm.cc (Target_arm::got_section): Make the .got section the first
10015 non RELRO section in the data segment.
10016 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10017 suffixes of section names.
10018
10165461
DK
100192010-02-24 Doug Kwan <dougkwan@google.com>
10020
10021 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10022 flags and attributes merging if an input file is a binary file.
10023 * fileread.cc (Input_file::open): Record format of original file.
10024 * fileread.h (Input_file::Format): New enum type.
2e702c99 10025 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10026 (Input_file::format): New method definition.
10027 (Input_file::format_):: New data member.
10028
4a54abbb
DK
100292010-02-24 Doug Kwan <dougkwan@google.com>
10030
10031 * arm.cc (Arm_output_data_got): New class.
10032 (ARM_TCB_SIZE): New constant
10033 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10034 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10035 If user uses a script with a SECTIONS clause, issue only a warning
10036 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10037 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10038 garbage collection.
10039 (Target_arm::got_mode_index_entry): Handle static linking.
10040 (Target_arm::Scan::local): Ditto.
10041 (Target_arm::Scan::global): Ditto.
10042 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10043 all incorrectly implemented relocations.
e1df38aa 10044 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10045 Arm_output_section::fix_exidx_coverage.
10046 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10047 from ".ARM.exidx." and ".ARM.extab.".
10048
ca419a6f
ILT
100492010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10050
10051 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10052 section if it does not already exist.
10053 * attributes.cc (Attributes_section_data::Attributes_section_data):
10054 Don't crash if size is zero.
10055
135b9c78
ILT
100562010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10057 Ian Lance Taylor <iant@google.com>
10058
10059 * gold.cc (queue_middle_tasks): If no input files were opened,
10060 exit.
10061 * workqueue.h (Task_function::Task_function): Assert that there is
10062 a blocker.
10063
bb0bfe4f
DK
100642010-02-22 Doug Kwan <dougkwan@google.com>
10065
10066 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10067 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10068 types to avoid warnings due to different uint64_t implementations
10069 on different hosts.
10070
2a2b6d42
DK
100712010-02-21 Doug Kwan <dougkwan@google.com>
10072
10073 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10074 handling of the maximum backward branch offset.
2e702c99 10075 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10076 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10077 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10078 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10079 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10080 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10081 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10082 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10083 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10084 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10085 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10086 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10087 thumb2_bl_out_of_range.o): New rules.
10088 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10089 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10090 thumb2_bl_out_of_range
10091 * testsuite/Makefile.in: Regenerate.
10092 * testsuite/arm_bl_in_range.s: New file.
10093 * testsuite/arm_bl_out_of_range.s: Ditto.
10094 * testsuite/arm_branch_in_range.sh: Ditto.
10095 * testsuite/arm_branch_range.t: Ditto.
10096 * testsuite/thumb2_branch_range.t: Ditto.
10097 * testsuite/thumb_bl_in_range.s: Ditto.
10098 * testsuite/thumb_bl_out_of_range.s: Ditto.
10099 * testsuite/thumb_branch_range.t: Ditto.
10100
b487ad64
ST
101012010-02-20 Sriraman Tallam <tmsriram@google.com>
10102
10103 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10104 Add reloc offset information.
10105 * icf.cc (get_section_contents): Change iterators to point to the new
10106 vectors. Add reloc offset information to the contents.
10107 * icf.h (Icf::Sections_reachable_info): New typedef.
10108 (Icf::Sections_reachable_list): New typedef.
10109 (Icf::Offset_info): New typedef.
10110 (Icf::Reloc_info): New struct typedef.
10111 (Icf::Reloc_info_list): New typedef.
10112 (Icf::symbol_reloc_list): Delete method.
10113 (Icf::addend_reloc_list): Delete method.
10114 (Icf::section_reloc_list): Delete method.
10115 (Icf::reloc_info_list): New method.
10116 (Icf::reloc_info_list_): New member.
10117
f96accdf
DK
101182010-02-19 Doug Kwan <dougkwan@google.com>
10119
10120 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10121 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10122 * arm.cc (Arm_relocation_functions): New forward declaration.
10123 (Target_arm::Target_arm): Initialize new data members
10124 got_mod_index_offset_ and tls_base_symbol_defined_.
10125 (Target_arm::Relocate::relocate_tls): New method.
10126 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10127 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10128 New methods.
2e702c99 10129 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10130 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10131 (Target_arm::got_mod_index_offset_,
10132 Target_arm::tls_base_symbol_defined_): New data members.
10133 (Target_arm::Scan::local, Target::Scan::global,
10134 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10135 relocations.
10136
c8761b9a
DK
101372010-02-18 Doug Kwan <dougkwan@google.com>
10138
10139 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10140 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10141 text section as a parameter becuase some broken tools may not set
10142 the link in section header.
10143 (Target_arm::has_got_section): New method.
10144 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10145 without any mapping symbol as data only. Remove warning.
10146 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10147 link in its section header, try to discover the link by inspecting the
10148 REL31 relocation at the beginning of the section.
10149 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10150 in error message.
10151 (Target_arm::Scan::global): Treat any reference to the symbol
10152 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10153
21bb3914
ST
101542010-02-12 Sriraman Tallam <tmsriram@google.com>
10155
10156 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10157 (Scan::global_reloc_may_be_function_pointer): New function.
10158 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10159 (Scan::global_reloc_may_be_function_pointer): New function.
10160 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10161 (Scan::global_reloc_may_be_function_pointer): New function.
10162 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10163 (Scan::global_reloc_may_be_function_pointer): New function.
10164 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10165 (Scan::global_reloc_may_be_function_pointer): New function.
10166 (Scan::possible_function_pointer_reloc): New function.
10167 (Target_x86_64::can_check_for_function_pointers): New function.
10168 * gc.h (gc_process_relocs): Scan relocation types to determine if
10169 function pointers were taken for targets that support it.
10170 * icf.cc (Icf::find_identical_sections): Include functions for
10171 folding in safe ICF whose pointer is not taken.
10172 * icf.h (Secn_fptr_taken_set): New typedef.
10173 (fptr_section_id_): New member.
10174 (section_has_function_pointers): New function.
10175 (set_section_has_function_pointers): New function.
10176 (check_section_for_function_pointers): New function.
10177 * options.h: Fix comment for safe ICF option.
10178 * target.h (can_check_for_function_pointers): New function.
10179 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10180 Modify icf_safe_test for X86-64.
10181 * testsuite/Makefile.in: Regenerate.
10182 * testsuite/icf_safe_so_test.cc: New file.
10183 * testsuite/icf_safe_so_test.sh: New file.
10184 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10185 (main): Change to take pointer to function kept_func_3.
10186 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10187 folding is done correctly for X86-64.
10188
0da6fa6c
DM
101892010-02-12 David S. Miller <davem@davemloft.net>
10190
10191 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10192 is_symbolless parameter.
10193 (Output_reloc<SHT_REL>::is_symbolless): New.
10194 (Output_reloc<SHT_REL>::is_symbolless_): New.
10195 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10196 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10197 (Output_reloc<SHT_RELA>::is_symbolless): New.
10198 (Output_data_reloc::add_global): Handle is_symbolless.
10199 (Output_data_reloc::add_global_relative): Likewise.
10200 (Output_data_reloc::add_local): Likewise.
10201 (Output_data_reloc::add_local_relative): Likewise.
10202 (Output_data_reloc::add_symbolless_global_addend): New.
10203 (Output_data_reloc::add_symbolless_local_addend): New.
10204 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10205 is_symbolless.
10206 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10207 instead of ->is_relative_
10208 (Output_reloc::write): Likewise.
10209 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10210 (Output_reloc::write_rel): Simplify.
10211
10212 * sparc.cc (Target_sparc::Scan::local): Use
10213 ->add_symbolless_local_addend as needed.
10214 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10215 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10216 based upon relocation offset.
10217
e4782e83
DK
102182010-02-11 Doug Kwan <dougkwan@google.com>
10219
10220 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10221 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10222 beginning of function.
10223 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10224 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10225 parameter is_32bit in calls to should_apply_static_reloc.
10226 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10227 (check_DATA): Add arm_abs_global.stdout.
10228 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10229 arm_abs_global.stdout): New rules.
10230 (MOSTLLYCLEANFILES): Add arm_abs_global
10231 * Makefile.in: Regenerate.
10232 * testsuite/arm_abs_global.s: New file.
10233 * testsuite/arm_abs_global.sh: Ditto.
10234 * testsuite/arm_abs_lib.s: Ditto.
10235
93ceb764
ILT
102362010-02-11 Ian Lance Taylor <iant@google.com>
10237
10238 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10239 Read_relocs task.
10240 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10241 Allocate_commons_task first.
10242 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10243 task, rather than symtab_lock_.
10244 (Gc_process_relocs::~Gc_process_relocs): New function.
10245 (Gc_process_relocs::is_runnable): Check this_blocker_.
10246 (Gc_process_relocs::locks): Use next_blocker_ rather than
10247 blocker_.
10248 (Scan_relocs::~Scan_relocs): New function.
10249 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10250 symtab_lock_.
10251 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10252 next_blocker_.
10253 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10254 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10255 constructor accordingly.
10256 (class Gc_process_relocs): Likewise.
10257 (class Scan_relocs): Likewise.
10258 * common.h (class Allocate_commons_task): Remove symtab_lock_
10259 field, and corresponding constructor parameter.
10260 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10261 symtab_lock_.
10262 (Allocate_commons_task::locks): Likewise.
10263
114dfbe1
ILT
102642010-02-11 Ian Lance Taylor <iant@google.com>
10265
10266 * gold-threads.h (class Once): Define.
10267 (class Initialize_lock): Rewrite as child of Once.
10268 * gold-threads.cc (class Once_initialize): Define.
10269 (once_pointer_control): New static variable.
10270 (once_pointer, once_arg): New static variables.
10271 (c_run_once): New static function.
10272 (Once::Once, Once::run_once, Once::internal_run): New functions.
10273 (class Initialize_lock_once): Remove.
10274 (initialize_lock_control): Remove.
10275 (initialize_lock_pointer): Remove.
10276 (initialize_lock_once): Remove.
10277 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10278 (Initialize_lock::initialize): Rewrite.
10279 (Initialize_lock::do_run_once): New function.
10280 * archive.cc (Archive::interpret_header): Only clear name if it is
10281 not already empty.
10282 * fileread.cc: Include "gold-threads.h"
10283 (file_counts_lock): New static variable.
10284 (file_counts_initialize_lock): Likewise.
10285 (File_read::release): Only increment counts when using --stats.
10286 Use a lock around the increment.
10287 * parameters.cc (class Set_parameters_target_once): Define.
10288 (set_parameters_target_once): New static variable.
10289 (Parameters::Parameters): Move here from parameters.h.
10290 (Parameters::set_target): Rewrite.
10291 (Parameters::set_target_once): New function.
10292 (Parameters::clear_target): Move here and rewrite.
10293 * parameters.h (class Parameters): Update declarations. Add
10294 set_parameters_target_once_ field.
10295 (Parameters::Parameters): Move to parameters.cc.
10296 (Parameters::clear_target): Likewise.
10297 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10298 task.
10299 (Start_group::~Start_group): New function.
10300 (Start_group::is_runnable): New function.
10301 (Start_group::locks, Start_group::run): New functions.
10302 (Finish_group::run): Change saw_undefined to size_t.
10303 * readsyms.h (class Start_group): Define.
10304 (class Finish_group): Change saw_undefined_ field to size_t.
10305 (Finish_group::Finish_group): Remove saw_undefined and
10306 this_blocker parameters. Change all callers.
10307 (Finish_group::set_saw_undefined): New function.
10308 (Finish_group::set_blocker): New function.
10309 * symtab.h (class Symbol_table): Change saw_undefined to return
10310 size_t. Change saw_undefined_ field to size_t.
10311 * target-select.cc (Set_target_once::do_run_once): New function.
10312 (Target_selector::Target_selector): Initialize set_target_once_
10313 field. Don't initialize lock_ and initialize_lock_ fields.
10314 (Target_selector::instantiate_target): Rewrite.
10315 (Target_selector::set_target): New function.
10316 * target-select.h (class Set_target_once): Define.
10317 (class Target_selector): Update declarations. Make
10318 Set_target_once a friend. Remove lock_ and initialize_lock_
10319 fields. Add set_target_once_ field.
10320
fa17a3f4
ILT
103212010-02-10 Ian Lance Taylor <iant@google.com>
10322
10323 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10324 queueing any tasks.
10325 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10326 (queue_middle_tasks): Add all blockers before queueing any tasks.
10327 (queue_final_tasks): Likewise.
10328 * token.h (Task_token::add_blockers): New function.
10329 * object.h (Input_objects::number_of_relobjs): New function.
10330
c7177d31
ILT
103312010-02-10 Ian Lance Taylor <iant@google.com>
10332
5de0e392
ILT
10333 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10334 shared, not if not position independent.
10335 * x86_64.cc (Relocate::relocate_tls): Likewise.
10336 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10337 (tls_pie_pic_test): New target.
10338 * testsuite/Makefile.in: Rebuild.
10339
c7177d31
ILT
10340 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10341 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10342 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10343 * testsuite/Makefile.in: Rebuild.
10344
684b268a
DM
103452010-02-09 David S. Miller <davem@davemloft.net>
10346
10347 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10348 R_SPARC_RELATIVE using ->add_local_relative().
10349 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10350
612a8d3d
DM
10351 * output.h (Output_data_dynamic::add_section_size): New method
10352 that takes two Output_data objects.
10353 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10354 entry param. Handle it in initializers.
10355 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10356 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10357 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10358 arg.
10359 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10360 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10361 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10362 for dynrel_includes_plt.
10363 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10364 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10365 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10366 before .rela.plt
10367 (Target_sparc::do_finalize_sections): Update to pass true for
10368 dynrel_includes_plt.
10369 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10370 output before .rela.plt
10371 (Target_powerpc::do_finalize_sections): Update to pass true for
10372 dynrel_includes_plt when 32-bit.
10373
cb1be87e
DK
103742010-02-08 Doug Kwan <dougkwan@google.com>
10375
10376 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10377 method.
10378 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10379 Arm_relobj::scan_section_for_cortex_a8_stubs,
10380 Arm_relobj::do_relocation_section): Instead of calling
10381 Output_section::output_address, use faster
10382 Arm_relobj::simple_input_section_output_address.
10383
705b5121
DM
103842010-02-08 David S. Miller <davem@davemloft.net>
10385
10386 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10387 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10388 relocation helper function.
10389
024c4466
DM
10390 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10391 just like R_SPARC_GOT{10,13,22}.
10392 (Target_sparc::Scan::local): Likewise.
10393 (Target_sparc::Relocate:relocate): Likewise.
10394
9109c078
ILT
103952010-02-06 Ian Lance Taylor <iant@google.com>
10396
10397 * configure.ac: Rewrite targetobjs duplicate removal code to use
10398 only shell constructs.
10399 * configure: Rebuild.
10400
cf846138
DK
104012010-02-05 Doug Kwan <dougkwan@google.com>
10402
10403 PR 11247
10404 * arm.cc (Arm_relobj::section_is_scannable): New method.
10405 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10406 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10407
6cfaf60b
DK
104082010-02-04 Doug Kwan <dougkwan@google.com>
10409
10410 PR 11247
10411 * arm-reloc-property.cc (cstdio): Include.
10412 * configure.ac (targetobjs): Remove duplicates.
10413 * configure: Regenerate.
10414 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10415 big and little endian version for a given address size.
10416
5c57f1be
DK
104172010-02-03 Doug Kwan <dougkwan@google.com>
10418
10419 * arm-reloc-property.cc
10420 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10421 definition.
10422 * arm-reloc-property.h
10423 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10424 New method definition.
10425 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10426 declaration.
10427 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10428 overflow to N.
10429 (GOT_PREL): Change implemented to Y.
10430 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10431 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10432 (Arm_relocate_functions::movw_abs_nc): Remove method.
10433 (Arm_relocate_functions::movt_abs): Ditto.
10434 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10435 (Arm_relocate_functions::thm_movt_abs): Ditto.
10436 (Arm_relocate_functions::movw_rel_nc): Ditto.
10437 (Arm_relocate_functions::movw_rel): Ditto.
10438 (Arm_relocate_functions::movt_rel): Ditto.
10439 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10440 (Arm_relocate_functions:thm_movw_rel): Ditto.
10441 (Arm_relocate_functions:thm_movt_rel): Ditto.
10442 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10443 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10444 New method definitions.
10445 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10446 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10447 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10448 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10449 (Target_arm::Relocate::relocate): Check for non-static or
10450 unimplemented relocation code and exit early. Change calls to
10451 Target_arm::reloc_uses_thumb_bit and
10452 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10453 instead. Refactor code to handle similar relocations to increase
10454 code sharing. Remove check for unsupported relocation code in switch
10455 statement.
10456 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10457 relocation property table to find out size. Change error message to
10458 print out the name of a relocation code instead of the numeric value.
10459 (Target_arm::scan_reloc_for_stub): Use relocation property table
10460 instead of calling Target_arm::reloc_uses_thumb_bit().
10461
218c5831
DK
104622010-02-02 Doug Kwan <dougkwan@google.com>
10463
10464 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10465 types of relaxed input section.
10466
0d31c79d
DK
104672010-02-02 Doug Kwan <dougkwan@google.com>
10468
10469 * Makefile.am (HFILES): Add arm-reloc-property.h.
10470 (DEFFILES): New.
2e702c99
RM
10471 (TARGETSOURCES): Add arm-reloc-property.cc
10472 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10473 (libgold_a_SOURCES): $(DEFFILES)
10474 * Makefile.in: Regenerate.
10475 * arm-reloc-property.cc: New file.
10476 * arm-reloc-property.h: New file.
10477 * arm-reloc.def: New file.
10478 * arm.cc: Update comments.
10479 (arm-reloc-property.h): New included header.
10480 (arm_reloc_property_table): New global variable.
10481 (Target_arm::do_select_as_default_target): New method definition.
10482 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10483 arm-reloc-property to targ_extra_obj.
10484 * parameters.cc (set_parameters_target): Call
10485 Target::select_as_default_target().
10486 * target.h (Target::select_as_default_target): New method definition.
10487 (Target::do_select_as_default_target): Same.
10488
546c7457
DK
104892010-02-01 Doug Kwan <dougkwan@google.com>
10490
10491 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10492 first_output_text_section_.
10493 (Arm_exidx_fixup::first_output_text_section): New method definition.
10494 (Arm_exidx_fixup::first_output_text_section_): New data member.
10495 (Arm_exidx_fixup::process_exidx_section): Record the first text
10496 output section seen.
10497 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10498 and entsize in output section header.
10499
11b861d5
DK
105002010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10501
10502 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10503 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10504 (Arm_relocate_functions::thm_alu11): New Method.
10505 (Arm_relocate_functions::thm_pc8): New Method.
10506 (Arm_relocate_functions::thm_pc12): New Method.
10507 (Target_arm::Scan::local): Handle the relocations.
10508 (Target_arm::Scan::global): Likewise.
10509 (Target_arm::Relocate::relocate): Likewise.
10510 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10511
c9a2c125
DK
105122010-01-29 Doug Kwan <dougkwan@google.com>
10513
10514 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10515 of relocation types as ld.
10516
1521477a
DK
105172010-01-29 Doug Kwan <dougkwan@google.com>
10518
10519 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10520 to public.
10521 (Arm_relocate_functions::thumb_branch_common): Ditto.
10522 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10523 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10524 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10525 Arm_relocate_functions::jump24): Remove.
10526 (Target_arm::Relocate::relocate): Adjust code to call
10527 Arm_relocation_functions::arm_branch_common and
10528 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10529 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10530
e7eca48c
DK
105312010-01-29 Doug Kwan <dougkwan@google.com>
10532
10533 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10534 output_local_symbol_count_needs_update_.
10535 (Arm_relobj::output_local_symbol_count_needs_update,
10536 Arm_relobj::set_output_local_symbol_count_needs_update,
10537 Arm_relobj::update_output_local_symbol_count): New methods.
10538 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10539 member.
10540 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10541 of pointed function as in a R_ARM_PREL31 relocation.
10542 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10543 for output local symbol count updating.
10544 (Target_arm::do_relax): Update output local symbol counts in objects
10545 if necessary.
10546 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10547
02961d7e
ILT
105482010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10549
10550 * arm.cc: Added support for the ARM relocations:
10551 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10552 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10553 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10554 movw_prel_nc).
10555 (Arm_relocate_functions::movw_rel): New method.
10556 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10557 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10558 thm_movw_prel_nc).
10559 (Arm_relocate_functions::thm_movw_rel): New method.
10560 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10561 thm_movt_prel).
10562 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10563 relocations.
10564 (Target_arm::Scan::global): Likewise.
10565 (Target_arm::Relocate::relocate): Likewise.
10566 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10567 Likewise.
10568
b10d2873
ILT
105692010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10570
10571 * arm.cc: Added support for ARM group relocations.
10572 (Target_arm::reloc_needs_sym_origin): New method.
10573 (Arm_relocate_functions::calc_grp_kn): New method.
10574 (Arm_relocate_functions::calc_grp_residual): New method.
10575 (Arm_relocate_functions::calc_grp_gn): New method.
10576 (Arm_relocate_functions::arm_grp_alu): New Method.
10577 (Arm_relocate_functions::arm_grp_ldr): New Method.
10578 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10579 (Arm_relocate_functions::arm_grp_ldc): New Method.
10580 (Target_arm::Scan::local): Handle the ARM group relocations.
10581 (Target_arm::Scan::global): Likewise.
10582 (Target_arm::Relocate::relocate): Likewise.
10583 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10584 Likewise.
10585
2b328d4e
DK
105862010-01-26 Doug Kwan <dougkwan@google.com>
10587
10588 * arm.cc (set): Include.
10589 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10590 pointer type.
2e702c99 10591 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10592 (Arm_output_section::append_text_sections_to_list): New method.
10593 (Arm_output_section::fix_exidx_coverage): Ditto.
10594 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10595 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10596 Relobj::set_section_offset() instead of
10597 Sized_relobj::invalidate_section_offset().
2e702c99 10598 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10599 parameter for section headers. Ignore relocation sections for
10600 unallocated sections and EXIDX sections.
10601 (Target_arm::fix_exidx_coverage): New method.
10602 (Target_arm::output_section_address_less_than): New type.
10603 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10604 linked text section instead of the EXIDX section.
10605 (Arm_output_section::create_stub_group): Add an assertion to check
10606 that this is not an EXIDX output section.
10607 (Arm_output_section::append_text_sections_to_list): New method.
10608 (Arm_output_section::fix_exidx_coverage): Ditto.
10609 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10610 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10611 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10612 first pass.
10613 (Target_arm::fix_exidx_coverage): New method.
10614 * object.h (Relobj::set_output_section): New method.
10615 (Sized_relobj::invalidate_section_offset): Remove method.
10616 (Sized_relobj::do_invalidate_section_offset): Remove method.
10617 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10618
c7f3c371
DK
106192010-01-25 Doug Kwan <dougkwan@google.com>
10620
10621 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10622 Fix warning due to signed and unsigned comparison on a 32-bit host.
10623
8923b24c
DK
106242010-01-22 Doug Kwan <dougkwan@google.com>
10625
10626 * arm.cc (Target_arm::do_relax): Record an output section for section
10627 offset adjustment it contains any stub table that has changed.
10628 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10629 offsets in an output section if necessary.
10630 * output.cc (Output_section::Output_section): Initialize
10631 section_offsets_need_adjustments_.
10632 (Output_section::add_input_section_for_script): Renamed to
10633 Output_section::add_simple_input_section.
10634 (Output_section::save_states): Add a comment.
10635 (Output_section::discard_states): New method defintion.
10636 (Output_section::adjust_section_offsets): Same.
10637 * output.h (Output_section::add_input_section_for_script): Renamed to
10638 Output_section::add_simple_input_section.
10639 (Output_section::discard_states): New method declaration.
10640 (Output_section::adjust_section_offsets): Same.
10641 (Output_section::section_offsets_need_adjustment,
10642 Output_section::set_section_offsets_need_adjustment): New method
10643 definitions.
10644 (Output_section::section_offsets_need_adjustment_): New data member.
10645 * script-sections.cc
10646 (Output_section_element_input::set_section_address): Adjust code for
10647 renaming of Output_section::add_input_section_for_script.
10648 (Orphan_output_section::set_section_address): Same.
10649
9b2fd367
DK
106502010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10651
10652 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10653 Fix_v4bx enum values .
10654 * gold/options.h (General_options): New option definitions.
10655 (General_options::fix_v4bx): New method.
10656 (General_options::Fix_v4bx): New enum.
10657 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10658 (General_options::parse_fix_v4bx_interworking): New method.
10659
80d0d023
DK
106602010-01-22 Doug Kwan <dougkwan@google.com>
10661
10662 * arm.cc (Arm_exidx_fixup): New class.
10663
af2cdeae
DK
106642010-01-21 Doug Kwan <dougkwan@google.com>
10665
10666 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10667 classes.
10668 (Arm_exidx_section_offset_map): New type.
10669
993d07c1
DK
106702010-01-21 Doug Kwan <dougkwan@google.com>
10671
10672 * arm.cc (Arm_exidx_input_section): New class.
10673 (Arm_relobj::exidx_input_section_by_link,
10674 Arm_relobj::exidx_input_section_by_shndx,
10675 Arm_relobj::make_exidx_input_section): New methods.
10676 (read_arm_attributes_section): Remove.
10677 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10678 information about them.
10679 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10680 to here.
10681
5ac169d4
DK
106822010-01-20 Doug Kwan <dougkwan@google.com>
10683
10684 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10685 Input_section_specifier to Section_id.
10686 (Target_arm::new_arm_input_section: Adjust code for change of key
10687 type.
10688 (Target_arm::find_arm_input_section): Ditto.
10689 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10690 (Section_id): Remove.
10691 (Garbage_collection::Section_id_hash): Remove.
10692 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10693 (Section_id): Remove.
10694 (Icf::Section_id_hash): Remove.
10695 * object.h (Section_id, Const_section_id, Section_id_hash,
10696 Const_section_id_hash): New type definitions.
10697 * output.cc (Output_section::add_relaxed_input_section): Change to
10698 use Const_section_id instead of Input_section_specifier as key type.
10699 (Output_section::add_merge_input_section): Ditto.
10700 (Output_section::build_relaxation_map): Change to use Section_id
10701 instead of Input_section_specifier as key type.
2e702c99 10702 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10703 Ditto.
10704 (Output_section::convert_input_sections_to_relaxed_sections): Change
10705 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10706 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10707 (Output_section::find_relaxed_input_section): Ditto.
10708 * output.h (Input_section_specifier): Remove class.
10709 (Output_section::Output_section_data_by_input_section_map): Change
10710 key type to Const_section_id.
10711 (Output_section::Output_relaxed_input_section_by_input_section_map):
10712 Ditto.
10713 (Output_section::Relaxation_map): Change key type to Section_id.
10714
a2162063
ILT
107152010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10716
10717 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10718 (class Arm_v4bx_stub): New class.
10719 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10720 (Stub_factory::make_arm_v4bx_stub): New method.
10721 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10722 (Stub_table::empty): Handle v4bx stubs.
10723 (Stub_table::add_arm_v4bx_stub): New method.
10724 (Stub_table::find_arm_v4bx_stub): New method.
10725 (Arm_relocate_functions::v4bx): New method.
10726 (Target_arm::fix_v4bx): New method.
10727 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10728 (Stub_table::relocate_stubs): Likewise.
10729 (Stub_table::do_write): Likewise.
10730 (Stub_table::update_data_size_and_addralign): Likewise.
10731 (Stub_table::finalize_stubs): Likewise.
10732 (Target_arm::Scan::local): Likewise.
10733 (Target_arm::Scan::global): Likewise.
10734 (Target_arm::do_finalize_sections): Likewise.
10735 (Target_arm::Relocate::relocate): Likewise.
10736 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10737 Likewise.
10738 (Target_arm::scan_reloc_for_stub): Likewise.
10739 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10740
5696ab0b
ILT
107412010-01-19 Ian Lance Taylor <iant@google.com>
10742
10743 * output.cc (Output_section_headers::do_sized_write): Write large
10744 segment count to sh_info field.
10745 (Output_file_header::do_sized_write): For large segment count,
10746 write PN_XNUM to e_phnum field.
10747
800d0f56
ILT
107482010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10749
10750 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10751 (Arm_relocate_functions::thm_jump8): New function.
10752 (Arm_relocate_functions::thm_jump11): New function.
10753 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10754 R_ARM_THM_JUMP11.
10755 (Target_arm::Scan::global): Likewise.
10756 (Target_arm::Relocate::relocate): Likewise.
10757 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10758 Likewise.
10759
41263c05
DK
107602010-01-14 Doug Kwan <dougkwan@google.com>
10761
10762 * arm.cc (map, utility): Include headers.
10763 (Target_arm::apply_cortex_a8_workaround): New method.
10764 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10765 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10766 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10767 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10768 the --[no-]fix-cortex-a8 command line options.
10769 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10770 (Target_arm::relocate_stub): Use addend in instruction template.
10771 * options.h (DEFINE_bool): Set the user-set flag.
10772 (General_options): Add --[no-]-fix-cortex options.
10773 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10774 : Update fast look-up map after conversion.
41263c05 10775
459e9b03
ST
107762010-01-14 Sriraman Tallam <tmsriram@google.com>
10777
10778 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10779 in the first pass of do_layout.
10780
b521dfe4
DK
107812010-01-13 Doug Kwan <dougkwan@google.com>
10782
10783 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10784 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10785 apparent compiler problem of not folding static constant integral
10786 data members of elfcpp::Elf_sizes<32>.
10787
44272192
DK
107882010-01-13 Doug Kwan <dougkwan@google.com>
10789
10790 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10791 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10792 Arm_relobj::scan_section_for_cortex_a8_erratum,
10793 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10794 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10795 sections to scan for relocation stubs into a new method
10796 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10797 relocation and Cortex-A8 stub scanning.
10798 (Target_arm::do_relax): Force stubs to be after stubbed sections
10799 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10800 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10801 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10802
44b71ece
ILT
108032010-01-12 Ian Lance Taylor <iant@google.com>
10804
10805 * target-reloc.h (visibility_error): New inline function.
10806 (relocate_section): Call visibility_error.
10807 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10808 (MOSTLYCLEANFILES): Likewise.
10809 (protected_4_pic.o, protected_3.err): New targets.
10810 * testsuite/protected_4.cc: New file.
10811
a120bc7f
DK
108122010-01-12 Doug Kwan <dougkwan@google.com>
10813
10814 * arm.cc (Cortex_a8_reloc): New class.
10815 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10816 and cortex_a8_relocs_info_.
10817 (Target_arm::fix_cortex_a8): New method definition.
10818 (Target_arm::Cortex_a8_relocs_info): New type.
10819 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10820 New data member declarations.
10821 (Target_arm::scan_reloc_for_stub): Record information about
10822 relocations for THUMB branches that might be exempted from the
10823 Cortex-A8 workaround.
10824 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10825 at the beginning of a relaxation pass.
10826
20138696
DK
108272010-01-12 Doug Kwan <dougkwan@google.com>
10828
10829 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10830 (Arm_relobj::Mapping_symbol_position,
10831 Arm_reloj::Mapping_symbol_position_less,
10832 Arm_relobj::Mapping_symbols_info): New types.
10833 (Target_arm::is_mapping_symbol_name): New method definition.
10834 (Arm_relobj::do_count_local_symbols): Save information about mapping
10835 symbols.
10836
089d69dc
DK
108372010-01-11 Doug Kwan <dougkwan@google.com>
10838
10839 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10840 Arm_relocate_functions::thumb32_branch_upper,
10841 Arm_relocate_functions::thumb32_branch_lower,
10842 Arm_relocate_functions::thumb32_cond_branch_offset,
10843 Arm_relocate_functions::thumb32_cond_branch_upper,
10844 Arm_relocate_functions::thumb32_cond_branch_lower,
10845 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10846 branch offset encoding.
10847 (Arm_relocate_functions::thumb_branch_common): Use new branch
10848 offset encoding methods to avoid code duplication.
10849 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10850 (Stub_addend_reader::operator()): Use new branch encoding method
10851 to avoid code duplication.
10852
99e5bff2
DK
108532010-01-11 Doug Kwan <dougkwan@google.com>
10854
10855 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10856 (Target_arm::do_finalize_sections): Define special EXIDX section
10857 symbols only if referenced.
10858 * gc.h (Garbage_collection::add_reference): New method.
10859 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10860 code duplication.
10861
98e090bd
ILT
108622010-01-11 Ian Lance Taylor <iant@google.com>
10863
d0a91bd8
ILT
10864 * script.cc (Version_script_info::build_expression_list_lookup):
10865 Change complaing about duplicate wildcard match from error to
10866 warning.
10867
98e090bd
ILT
10868 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10869 of 2009-12-30.
10870 (Version_script_info::Version_script_info): Initialize globs_,
10871 default_version_, default_is_global_, and exact_. Don't
10872 initialize globals_ or locals_.
10873 (Version_script_info::build_lookup_tables): Build local symbols
10874 first.
10875 (Version_script_info::unquote): New function.
10876 (Version_script_info::add_exact_match): New function.
10877 (Version_script_info::build_expression_list_lookup): Remove lookup
10878 parameter. Add is_global parameter. Change all callers. Handle
10879 wildcard pattern specially. Unquote pattern. Call
10880 add_exact_match.
10881 (Version_script_info::get_name_to_match): New function.
10882 (Version_script_info::get_symbol_version): New function.
10883 (Version_script_info::get_symbol_version_helper): Remove.
10884 (Version_script_info::check_unmatched_names): Call unquote.
10885 * script.h (class Version_script_info): Change get_symbol_version
10886 to be non-inline and add is_global parameter; change all callers.
10887 Rewrite symbol_is_local. Update declarations. Define struct
10888 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10889 Remove globals_ and locals_ members. Add exact_, globs_,
10890 default_version_, is_global_.
10891 (Version_script_info::Glob): Remove pattern, add expression and
10892 is_global. Update constructor. Change all callers.
10893 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10894 default version.
10895 (Versions::symbol_section_contents): If a symbol is undefined, or
10896 defined in a dynamic object, set the version index to
10897 VER_NDX_LOCAL.
10898 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10899 symbol_is_local.
10900 (Symbol_table::add_from_pluginobj): Likewise.
10901 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10902
d56962d3
DK
109032010-01-11 Doug Kwan <dougkwan@google.com>
10904
10905 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10906 (incremental_dump_LDADD): Add linking option for libintl.
10907 * Makefile.in: Regenerate.
10908
94e6ee91
L
109092010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10910
10911 PR gold/11144
10912 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10913 instead of -Ds.
10914 * testsuite/Makefile.in: Regenerated.
10915
e96c574b
DK
109162010-01-10 Doug Kwan <dougkwan@google.com>
10917
10918 * options.h (DEFINE_var): Use parentheses around argument varname__
10919 in macro body to avoid any unintended subsequent substitutions.
10920
7198066b
ILT
109212010-01-10 Ian Lance Taylor <iant@google.com>
10922
ba4d53bf
ILT
10923 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10924 candidates before doing symbol resolution.
10925
7198066b
ILT
10926 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10927 ODR candidates if only one is weak.
10928
a2beed37
ILT
109292010-01-08 Ian Lance Taylor <iant@google.com>
10930
10931 * script.cc (Version_script_info::build_expression_list_lookup):
10932 Don't warn about ambiguous version, just record the ambiguity.
10933 (Version_script_info::get_symbol_version_helper): Give error if
10934 version is ambiguous.
10935
2fb7225c
DK
109362010-01-08 Doug Kwan <dougkwan@google.com>
10937
10938 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10939 prev_data_size_ and prev_addralign_. Remove initializer for
10940 deleted data member has_been_changed_.
10941 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10942 to determine if the table is empty.
10943 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10944 Remove.
10945 (Stub_table::add_reloc_stub): Define method in class definition
10946 instead of just declaring it there.
10947 (Stub_table::add_cortex_a8_stub): New method definition.
10948 (Stub_table::update_data_size_and_addralign): Ditto.
10949 (Stub_table::finalize_stubs): Ditto.
10950 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10951 (Stub_table::do_addralign_): Return address alignment in the
10952 (Stub_table::do_reset_address_and_file_offset): Define method in
10953 class definition instead of declaring it there. Set current data
10954 size to be the data size of the previous pass.
10955 (Stub_table::set_final_data_size): Use current data size as the
10956 final data size.
10957 (Stub_table::relocate_stub): Change parameter type of stub from
10958 Reloc_stub pointer to Stub pointer.
10959 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10960 (Stub_table::Cortex_a8_stub_list): New typedef.
10961 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10962 Stub_table::prev_addralign_): New data member.
10963 (Arm_relobj::Arm_relobj): Initialize data member
10964 section_has_cortex_a8_workaround_.
10965 (Arm_relobj::section_has_cortex_a8_workaround,
10966 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10967 definitions.
10968 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10969 declarations.
10970 (Target_arm::relocate_stub): Change parameter type of stub from
10971 Reloc_stub pointer to Stub pointer.
10972 (Insn_template::size, Insn_template::alignment): Handle
10973 THUMB16_SPECIAL_TYPE.
10974 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10975 Stub_table::update_data_size_and_addralign,
10976 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10977 definitions.
10978 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10979 (Stub_table::do_write): Ditto.
10980 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10981
880cd20d
ILT
109822010-01-08 Ian Lance Taylor <iant@google.com>
10983
10984 PR 11108
10985 * symtab.h (class Symbol): Remove fields is_target_special_ and
10986 has_plt_offset_. Add field is_defined_in_discarded_section_.
10987 (Symbol::is_defined_in_discarded_section): New function.
10988 (Symbol::set_is_defined_in_discarded_section): New function.
10989 (Symbol::has_plt_offset): Rewrite.
10990 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10991 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10992 Don't initialize is_target_special_ or has_plt_offset_.
10993 Initialize is_defined_in_discarded_section_.
10994 (Symbol_table::add_from_relobj): If appropriate, set
10995 is_defined_in_discarded_section.
10996 * resolve.cc (Symbol::override_base_with_special): Don't test
10997 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10998 * target-reloc.h (relocate_section): Do special handling for
10999 symbols defined in discarded sections for global symbols as well
11000 as local symbols.
11001
2703e3eb
ILT
110022010-01-08 Ian Lance Taylor <iant@google.com>
11003
11004 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11005 the SHT_SYMTAB case.
11006
339d40a3
ILT
110072010-01-08 Ian Lance Taylor <iant@google.com>
11008
11009 * object.cc (Sized_relobj::do_layout): Don't get confused if
11010 layout_eh_frame returns NULL.
11011
abecea76
ILT
110122010-01-08 Ian Lance Taylor <iant@google.com>
11013
11014 PR 11084
11015 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11016 dynamic symbol table, use the normal symbol table.
11017 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11018 symbol table.
11019
6b7dd3f3
ILT
110202010-01-08 Ian Lance Taylor <iant@google.com>
11021
11022 PR 11072
11023 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11024 sections.
11025
36c50e63
L
110262010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11027
11028 * version.cc (print_version): Change to "Copyright 2010".
11029
e291e7b9
ILT
110302010-01-08 Ian Lance Taylor <iant@google.com>
11031
11032 PR 10287
11033 PR 11063
11034 * i386.cc (class Target_i386): Change return type of plt_section
11035 to be non-const.
11036 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11037 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11038 tls_desc_rel_ field.
11039 (Output_data_plt_i386::rel_tls_desc): New function.
11040 (Target_i386::rel_tls_desc_section): New function.
11041 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11042 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11043 R_386_TLS_DESC reloc in rel_tls_desc_section.
11044 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11045 Define struct Tlsdesc_info.
11046 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11047 (Target_x86_64::do_reloc_symbol_index): New function.
11048 (Target_x86_64::add_tlsdesc_info): New function.
11049 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11050 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11051 tlsdesc_rel_ field.
11052 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11053 all callers.
11054 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11055 (Target_x86_64::rela_tlsdesc_section): New function.
11056 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11057 handling.
11058 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11059 (Target_x86_64::do_reloc_addend): New function.
11060 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11061 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11062 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11063 (Output_reloc::type): New function.
11064 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11065 (Output_reloc::is_target_specific): New function.
11066 (Output_reloc::target_arg): New function.
11067 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11068 absolute relocs and target specific relocs.
11069 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11070 add_target_specific.
11071 (class Output_data_reloc) [SHT_RELA]: Likewise.
11072 * output.cc (Output_reloc::Output_reloc): Add four new versions
11073 for absolute relocs and target specific relocs.
11074 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11075 (Output_reloc::get_symbol_index): Likewise.
11076 (Output_reloc::local_section_offset): Check that local_sym_index_
11077 is not TARGET_CODE or 0.
11078 (Output_reloc::symbol_value): Likewise.
11079 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11080 reloc.
11081 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11082 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11083 functions.
11084 * layout.cc (add_target_dynamic_tags): Use output section for
11085 DT_PLTRELSZ and DT_JMPREL.
11086
3a44184e
ILT
110872010-01-07 Ian Lance Taylor <iant@google.com>
11088
11089 PR 11061
11090 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11091 function.
11092 (class Output_data_reloc_generic): Define.
11093 (class Output_data_reloc_base): Change base class to
11094 Output_data_reloc_generic. Change add() method to call
11095 bump_relative_reloc_count for a relative reloc. Remove
11096 sort_relocs_ field.
11097 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11098 to sort_relocs().
11099 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11100 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11101 appropriate.
11102 * layout.h (class Layout): Update declaration.
11103
ea715a34
ILT
111042010-01-07 Ian Lance Taylor <iant@google.com>
11105
11106 * output.h (class Output_data): Add const version of
11107 output_section and do_output_section.
11108 (class Output_section_data): Add const version of
11109 do_output_section.
11110 (class Output_section): Likewise.
11111 * layout.cc (Layout::add_target_dynamic_tags): New function.
11112 * layout.h (class Layout): Update declarations.
11113 * arm.cc (Target_arm::do_finalize_sections): Use
11114 add_target_dynamic_tags.
11115 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11116 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11117 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11118 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11119
659948a4
ILT
111202010-01-07 Ian Lance Taylor <iant@google.com>
11121
11122 PR 11042
11123 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11124 object as needed.
11125
9d3b86f6
ILT
111262010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11127 Ian Lance Taylor <iant@google.com>
11128
11129 PR 11019
11130 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11131 Xindex::read_symtab_xindex.
11132
bb0d3eb0
DK
111332010-01-07 Doug Kwan <dougkwan@google.com>
11134
11135 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11136 (Insn_template::thumb16_bcond_insn): New method declaration.
11137 (Insn_template): Fix spelling.
11138 (Stub::thumb16_special): New method declaration.
11139 (Stub::do_write): Define virtual method which was previously pure
11140 virtual.
11141 (Stub::do_thumb16_special): New method declaration.
11142 (Stub::do_fixed_endian_write): New template member.
11143 (Reloc_stub::do_write): Remove.
11144 (Reloc_stub::do_fixed_endian_write): Remove.
11145 (Cortex_a8_stub): New class definition.
11146 (Stub_factory::make_cortex_a8_stub): New method definition.
11147 (Stub_factory::Stub_factory): Add missing static storage class
11148 qualifier for elf32_arm_stub_a8_veneer_blx.
11149
ffeef7df
ILT
111502010-01-07 Ian Lance Taylor <iant@google.com>
11151
dc3f80fe
ILT
11152 PR 10980
11153 * options.h (class General_options): Add --warn-unresolved-symbols
11154 and --error-unresolved-symbols.
11155 * errors.cc (Errors::undefined_symbol): Implement
11156 --warn-unresolved-symbols.
11157
ffeef7df
ILT
11158 * options.h (class General_options): Add -z text and -z textoff.
11159 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11160
f1ec9ded
ST
111612010-01-06 Sriraman Tallam <tmsriram@google.com>
11162
11163 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11164 (Garbage_collection::cident_sections): New function.
11165 (Garbage_collection::add_cident_section): New function.
11166 (Garbage_collection::cident_sections_): New member.
11167 (gc_process_relocs): Add references to sections whose names are C
11168 identifiers.
11169 * gold.h (cident_section_start_prefix): New constant.
11170 (cident_section_stop_prefix): New constant.
11171 (is_cident): New function.
11172 * layout.cc (Layout::define_section_symbols): Replace string constants
11173 with the newly defined constants.
11174 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11175 C identifiers.
11176 * testsuite/Makefile.am: Add gc_orphan_section_test.
11177 * testsuite/Makefile.in: Regenerate.
11178 * testsuite/gc_orphan_section_test.cc: New file.
11179 * testsuite/gc_orphan_section_test.sh: New file.
11180
6eda8c29
ILT
111812010-01-06 Ian Lance Taylor <iant@google.com>
11182
b9674e17
ILT
11183 PR 10980
11184 * options.h (class General_options): Add --warn-shared-textrel.
11185 * layout.cc (Layout::finish_dynamic_section): Implement
11186 --warn-shared-textrel.
11187
6eda8c29
ILT
11188 PR 10980
11189 * options.h (class General_options): Add --warn-multiple-gp.
11190
32dcd44e
ILT
111912010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11192
11193 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11194 $(THREADSLIB) and $(LIBDL).
11195 * Makefile.in: Rebuild.
11196
a192ba05
ILT
111972010-01-06 Ian Lance Taylor <iant@google.com>
11198
11199 PR 10980
11200 * options.cc (General_options::parse_section_start): New function.
11201 (General_options::section_start): New function.
11202 (General_options::General_options): Initialize all members.
11203 * options.h: Include <map>
11204 (class General_options): Add --section-start. Add section_starts_
11205 member.
11206 * layout.cc (Layout::attach_allocated_section_to_segment): If
11207 --section-start was used, set the address of the segment. Remove
11208 local sort_sections.
11209 (Layout::relaxation_loop_body): If the address of the load segment
11210 has been set by --section-start, don't use it.
11211 * output.h (Output_segment::update_flags_for_output_section): New
11212 function.
11213 * output.cc (Output_segment::add_output_section): Call
11214 update_flags_for_output_section.
11215
dde3f402
ILT
112162010-01-05 Ian Lance Taylor <iant@google.com>
11217
62dfdd4d
ILT
11218 PR 10980
11219 * options.h (class General_options): Add --undefined-version.
11220 * script.cc (struct Version_expression): Add was_matched_by_symbol
11221 field.
11222 (Version_script_info::matched_symbol): New function.
11223 (Version_script_info::get_symbol_version_helper): Call
11224 matched_symbol.
11225 (Version_script_info::check_unmatched_names): New function.
11226 * script.h (class Version_script_info): Update declarations.
11227 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11228
9c4ae156
ILT
11229 * options.h (class General_options): Use DEFINE_bool_alias for
11230 allow_multiple_definition.
11231 * resolve.cc (Symbol_table::should_override): Don't test
11232 allow_multiple_definition.
11233
dde3f402
ILT
11234 PR 10980
11235 * options.h (class General_options): Add --cref.
11236 * main.cc (main): Print cref table if --cref. Don't close mapfile
11237 until after printing cref table.
11238 * cref.cc: Include "symtab.h".
11239 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11240 (Cref_table_compare::operator()): New function.
11241 (Cref_inputs::gather_cref): New function.
11242 (filecol): New static const.
11243 (Cref_inputs::print_cref): New function.
11244 (Cref::print_cref): New function.
11245 * cref.h: Include <cstdio>.
11246 (class Cref): Update declarations.
11247 * mapfile.h (Mapfile::file): New function.
11248 * object.h (class Object): Define Symbols. Declare virtual
11249 do_get_global_symbols.
11250 (Object::get_global_symbols): New function.
11251 * object.cc (Input_objects::add_object): Pass object to cref_ if
11252 --cref.
11253 (Input_objects::archive_start): Likewise.
11254 (Input_objects::archive_stop): Likewise.
11255 (Input_objects::print_cref): New function.
11256 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11257 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11258 --cref.
11259 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11260 function.
11261 * plugin.h (class Sized_pluginobj): Update declarations.
11262
8781f709
ILT
112632010-01-05 Ian Lance Taylor <iant@google.com>
11264
11265 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11266 to is_default_version. Rename insdef to insdefault.
11267 (Symbol_table::add_from_relobj): Rename def to is_default_version
11268 and local to is_forced_local.
11269 (Symbol_table::add_from_pluginobj): Likewise.
11270 (Symbol_table::add_from_dynobj): Likewise.
11271 (Symbol_table::define_special_symbol): Rename insdef to
11272 insdefault.
11273
fe35d28d
ILT
112742010-01-04 Ian Lance Taylor <iant@google.com>
11275
30bc8c46
ILT
11276 PR 10980
11277 * options.h (class General_options): Add
11278 --allow-multiple-definition and -z muldefs.
11279 * resolve.cc (Symbol_table::should_override): Don't warn about a
11280 multiple symbol definition if --allow-multiple-definition or -z
11281 muldefs.
11282
7eaea549
ILT
11283 PR 10980
11284 * options.h (class General_options): Add --add-needed and
11285 --copy-dt-needed-entries. Tweak --as-needed help entry.
11286 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11287 error if --copy-dt-needed-entries aka --add-needed is used and
11288 would cause a change in behaviour.
11289
fe35d28d
ILT
11290 PR 10980
11291 * options.h (class General_options): Add -G as a short version of
11292 --shared. Add no-op options -assert, -g, and -i.
11293
55a2bb35
ST
112942010-01-04 Sriraman Tallam <tmsriram@google.com>
11295
11296 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11297 check for .text or .gnu.linkonce.t sections.
11298 * icf.cc (Icf::find_identical_sections): Ditto.
11299 Change the detection for mangled function name within the section
11300 name.
11301 * icf.h (is_section_foldable_candidate): New function.
11302
719328e1
ILT
113032009-12-30 Ian Lance Taylor <iant@google.com>
11304
11305 PR 10980
11306 * options.h (class General_options): Permit two dashes with
11307 --retain-symbols-file.
11308
d7bb5745
ILT
113092009-12-30 Ian Lance Taylor <iant@google.com>
11310
403a15dd
ILT
11311 PR 10979
11312 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11313 don't put the file header and segment headers in the text
11314 segment.
11315
eda294df
ILT
11316 PR 10979
11317 * common.cc (Sort_commons::operator()): Stabilize sort when both
11318 entries are NULL.
11319 (Symbol_table::do_allocate_commons_list): When allocating common
11320 symbols, skip a symbol which is no longer common.
11321 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11322 an object before checking its type.
11323 * testsuite/common_test_2.c: New file.
11324 * testsuite/common_test_3.c: New file.
11325 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11326 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11327 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11328 (common_test_2_pic.o, common_test_2.so): New targets.
11329 (common_test_3_pic.o, common_test_3.so): New targets.
11330 * testsuite/Makefile.in: Rebuild.
11331
d7bb5745
ILT
11332 PR 10979
11333 * script.cc (read_input_script): If we see a new SECTIONS clause,
11334 and we have added an input section, give an error.
11335 * layout.h (class Layout): Add have_added_input_section function.
11336 Add have_added_input_section_ field.
11337 * layout.cc (Layout::Layout): Initialize
11338 have_added_input_section_.
11339 (Layout::layout): Set have_added_input_section_.
11340 (Layout::layout_eh_frame): Likewise.
11341
fc59c572
ILT
113422009-12-30 Ian Lance Taylor <iant@google.com>
11343
11344 PR 10931
11345 * options.h (class General_options): Add --sort-common option.
11346 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11347 * common.cc (Sort_common): Add sort_order parameter to
11348 constructor. Add sort_order_ field.
11349 (Sort_commons::operator): Check sort_order_.
11350 (Symbol_table::allocate_commons): Determine the sort order.
11351 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11352 Change all callers.
11353 (Symbol_table::do_allocate_commons_list): Likewise.
11354
1c74fab0
ILT
113552009-12-30 Ian Lance Taylor <iant@google.com>
11356
11357 PR 10916
11358 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11359 symbols from this object, don't change the visibility of an
11360 undefined symbol.
11361 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11362
6affe781
ILT
113632009-12-30 Ian Lance Taylor <iant@google.com>
11364
11365 PR 10861
11366 * script.h (class Version_script_info): Define Language enum.
11367 Update declarations. Define Glob, Exact, and Lookup types. Add
11368 new fields globals_, locals_, and is_finalized_.
11369 * script.cc: Various formatting fixes.
11370 (class Parser_closure): Change language_stack_ from a vector of
11371 std::string to one of Version_script_info::Language. Adjust all
11372 uses accordingly.
11373 (class Lazy_demangler): Remove.
11374 (struct Version_expression): Change language from std::string to
11375 Version_script_info::Language.
11376 (Version_script_info::Version_script_info): New function.
11377 (Version_script_info::~Version_script_info): Don't call clear.
11378 (Version_script_info::finalize): New function.
11379 (Version_script_info::build_lookup_tables): New function.
11380 (Version_script_info::build_expression_list_lookup): New
11381 function.
11382 (Version_script_info::get_symbol_version_helper): Rewrite to use
11383 lookup tables.
11384 (Version_script_info::print_expression_list): Adjust to use
11385 Version_script_info::Language.
11386 (script_push_lex_into_version_mode): Check that the version script
11387 has not been finalized.
11388 (version_script_push_lang): Change language string to
11389 Version_script_info::Language.
11390 * options.cc (Command_line::version_script): New function.
11391 * options.h (class General_options): Add finalize_dynamic_list
11392 function. Change version_script from declaration to definition.
11393 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11394 * testsuite/version_script.map: Remove duplicate def of foo.
11395 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11396 version_script.map.
11397 * testsuite/Makefile.in: Rebuild.
11398
818bf354
ILT
113992009-12-30 Ian Lance Taylor <iant@google.com>
11400
11401 PR 10843
11402 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11403 if the input symbol index is 0, make the output symbol index 0.
11404
ebcc8304
ILT
114052009-12-30 Ian Lance Taylor <iant@google.com>
11406
11407 PR 10670
11408 * options.h (class General_options): Add -x/--discard-all.
11409 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11410 --discard-all. If the local symbol needs a dynamic entry, check
11411 that before handling --discard-locals.
11412
176fe33f
ILT
114132009-12-30 Ian Lance Taylor <iant@google.com>
11414
bb321bb1
ILT
11415 PR 10450
11416 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11417 flags to PF_R.
11418 (Output_segment::add_output_section): Don't change the flags if
11419 the type is PT_TLS.
11420
176fe33f
ILT
11421 PR 10450
11422 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11423 GNU hash table if they need a dynamic value. Otherwise, don't add
11424 them if they are defined in a dynamic object or are forced local.
11425
e8cd95c7
ILT
114262009-12-29 Ian Lance Taylor <iant@google.com>
11427
1b81fb71
ILT
11428 PR 10450
11429 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11430 .gnu.hash table for a 32-bit target.
11431
8d6d383d
ILT
11432 PR 10450
11433 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11434 regular and a dynamic object only needs a dynamic symbol table
11435 entry if it is externally visible.
11436
e785ec03
ILT
11437 PR 10450
11438 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11439 constructor. Add global_offset_table_ field.
11440 (Target_i386::got_section): Set global_offset_table_.
11441 (Target_i386::do_finalize_sections): Set global_offset_table_
11442 size.
11443 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11444 in constructor. Add global_offset_table_ field.
11445 (Target_x86_64::got_section): Set global_offset_table_.
11446 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11447 size.
11448
1a2dff53
ILT
11449 * layout.cc (Layout::Layout): Initialize increase_relro_.
11450 (Layout::get_output_section): Add is_relro, is_last_relro, and
11451 is_first_non_relro parameters. Change all callers.
11452 (Layout::choose_output_section): Likewise.
11453 (Layout::add_output_section_data): Likewise.
11454 (Layout::make_output_section): Likewise.
11455 (Layout::set_segment_offsets): Clear increase_relro when using a
11456 linker script.
11457 * layout.h (class Layout): Add increase_relro method. Add
11458 increase_relro_ field. Update declarations.
11459 * output.cc (Output_section::Output_section): Initialize
11460 is_last_relro_ and is_first_non_relro_.
11461 (Output_segment::add_output_section): Group relro sections is
11462 do_sort is true. Handle is_last_relro and is_first_non_relro.
11463 (Output_segment::maximum_alignment): Remove relro handling.
11464 (Output_segment::set_section_addresses): Add increase_relro
11465 parameter. Change all callers. Add initial alignment to align
11466 relro sections on separate page. Remove old relro handling.
11467 (Output_segment::set_section_list_addresses): Remove in_relro
11468 parameter. Change all callers.
11469 (Output_segment::set_offset): Add increase parameter. Change all
11470 callers. Remove old relro handling.
11471 * output.h (class Output_section): Add new methods: is_last_relro,
11472 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11473 Add is_last_relro_ and is_first_non_relro_ fields.
11474 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11475 Create separate .got.plt section. Call increase_relro.
11476 * x86_64.cc (Target_x86_64::got_section): Likewise.
11477 * testsuite/relro_script_test.t: Add .got.plt.
11478
f0ba79e2
ILT
11479 PR 10450
11480 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11481 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11482 (Layout::finalize): Call set_dynamic_symbol_size.
11483 (Layout::set_dynamic_symbol_size): New function.
11484 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11485 set_dynamic_symbol_size.
11486
e8cd95c7
ILT
11487 PR 10450
11488 * output.h (class Output_section): Add is_entsize_zero_ field.
11489 * output.cc (Output_section::Output_section): Initialize
11490 is_entsize_zero_.
11491 (Output_section::set_entsize): If two different entsizes are
11492 requested, force it to zero.
11493 (Output_section::add_input_section): Set flags for .debug_str
11494 before updating section flags. Set entsize.
11495 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11496 and SHF_STRING if all input sections have those flags.
11497
3e1b9a8a
RÁE
114982009-12-29 Rafael Espindola <espindola@google.com>
11499
11500 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11501 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11502 reporting.
3e1b9a8a 11503
3dcad376
ST
115042009-12-29 Sriraman Tallam <tmsriram@google.com>
11505
11506 * options.cc (General_options::parse_version): Allow -v to exit
11507 without an error if there is nothing to link.
11508
084e2665
ILT
115092009-12-29 Ian Lance Taylor <iant@google.com>
11510
11511 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11512 using a version of gcc before 4.1.
11513 * configure: Rebuild.
11514
250acde3
CD
115152009-12-28 Chris Demetriou <cgd@google.com>
11516
11517 * attributes.cc (Output_attributes_section_data::do_write): Use
11518 std::vector::front rather than std::vector::data.
11519
99fff23b
ILT
115202009-12-28 Ian Lance Taylor <iant@google.com>
11521
11522 * symtab.h (class Symbol_table): Add enum Defined.
11523 * resolve.cc (Symbol_table::should_override): Add defined
11524 parameter. Change all callers. Test whether object is NULL
11525 before calling a method on it.
11526 (Symbol_table::report_resolve_problem): Add defined parameter.
11527 Change all callers.
11528 (Symbol_table::should_override_with_special): Likewise.
11529 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11530 parameter. Change all callers.
11531 (Symbol_table::do_define_in_output_data): Likewise.
11532 (Symbol_table::define_in_output_segment): Likewise.
11533 (Symbol_table::do_define_in_output_segment): Likewise.
11534 (Symbol_table::define_as_constant): Likewise.
11535 (Symbol_table::do_define_as_constant): Likewise.
11536 * script.h (class Symbol_assignment): Add is_defsym parameter to
11537 constructor; change all callers.
11538 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11539 parameter. Change all callers. Add is_defsym_ field.
11540 (class Parser_closure): Add parsing_defsym parameter to
11541 constructor; change all callers. Add parsing_defsym accessor
11542 function. Add parsing_defsym_ field.
11543
556bd683
ILT
115442009-12-28 Ian Lance Taylor <iant@google.com>
11545
11546 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11547 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11548
1782c879
ILT
115492009-12-23 Ian Lance Taylor <iant@google.com>
11550
11551 * i386.cc (Target_i386::do_calls_non_split): Recognize
11552 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11553 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11554 -fsplit-stack prologue when using %r11.
1782c879 11555
329ca2b1
ST
115562009-12-21 Sriraman Tallam <tmsriram@google.com>
11557
11558 * options.cc (General_options::parse_version): Make -v continue and do
11559 the link like GNU ld does.
11560
d675ff46
RÁE
115612009-12-17 Rafael Avila de Espindola <espindola@google.com>
11562
11563 * Makefile.am (CCFILES): Add timer.cc.
11564 (HFILES): Add timer.h.
11565 * configure.ac: Check for sysconf and times.
11566 * main.cc: include timer.h.
11567 (main): Use Timer instead of get_run_time.
11568 * timer.cc: New.
11569 * timer.h: New.
11570 * workqueue.cc: include timer.h.
11571 (Workqueue::find_and_run_task):
11572 Report user, sys and wall time.
11573 * Makefile.in: Regenerate.
11574 * config.in: Regenerate.
11575 * configure: Regenerate.
11576
d6344fb5
DK
115772009-12-16 Doug Kwan <dougkwan@google.com>
11578
11579 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11580 sections.
11581 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11582 relaxed input sections.
11583 * output.cc (Output_section::find_relaxed_input_section): Change
11584 return type to Output_relaxed_input_section pointer. Adjust code
11585 for new type of relaxed_input_section_map_.
11586 * output.h (Output_section::find_relaxed_input_section): Change
11587 return type to Output_relaxed_input_section pointer.
11588 (Output_section::Output_relaxed_input_section_by_input_section_map):
11589 New type.
11590 (Output_section::relaxed_input_section_map_): Change type to
11591 Output_section::Output_relaxed_input_section_by_input_section_map.
11592 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11593 input section.
11594
0e0d5469
ILT
115952009-12-15 Ian Lance Taylor <iant@google.com>
11596
11597 * layout.cc (Layout::create_shstrtab): Only write out after input
11598 sections if we are compressing debug sections.
11599
0649a889
ILT
116002009-12-15 Ian Lance Taylor <iant@google.com>
11601
11602 * archive.cc (Archive::add_symbols): Only look up a symbol without
11603 a version if there is, in fact, a version.
11604
2ea97941
ILT
116052009-12-14 Ian Lance Taylor <iant@google.com>
11606
11607 Revert -Wshadow changes, all changes from:
11608 2009-12-11 Doug Kwan <dougkwan@google.com>
11609 2009-12-11 Nick Clifton <nickc@redhat.com>
11610 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11611
b0eec2cc
DK
116122009-12-11 Doug Kwan <dougkwan@google.com>
11613
11614 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11615 due to -Wshadow.
11616 * attributes.cc (Object_attribute::size): Ditto.
11617 (Attributes_section_data::size): Ditto.
11618 (Attributes_section_data::Attributes_section_data): Ditto.
11619 (Output_attributes_section_data::do_write): Ditto.
11620 * attributes.h (Object_attribute::set_type): Ditto.
11621 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11622
91d6fa6a
NC
116232009-12-11 Nick Clifton <nickc@redhat.com>
11624
11625 * archive.cc: Fix shadowed variable warnings.
11626 * arm.cc: Likewise.
11627 * compressed_output.cc: Likewise.
11628 * compressed_output.h: Likewise.
11629 * configure: Likewise.
11630 * dwarf_reader.cc: Likewise.
11631 * dynobj.cc: Likewise.
11632 * dynobj.h: Likewise.
11633 * ehframe.cc: Likewise.
11634 * ehframe.h: Likewise.
11635 * errors.cc: Likewise.
11636 * expression.cc: Likewise.
11637 * fileread.cc: Likewise.
11638 * fileread.h: Likewise.
11639 * freebsd.h: Likewise.
11640 * i386.cc: Likewise.
11641 * icf.cc: Likewise.
11642 * incremental.h: Likewise.
11643 * layout.cc: Likewise.
11644 * layout.h: Likewise.
11645 * mapfile.cc: Likewise.
11646 * merge.cc: Likewise.
11647 * merge.h: Likewise.
11648 * object.cc: Likewise.
11649 * object.h: Likewise.
11650 * options.h: Likewise.
11651 * output.cc: Likewise.
11652 * output.h: Likewise.
11653 * parameters.cc: Likewise.
11654 * plugin.cc: Likewise.
11655 * powerpc.cc: Likewise.
11656 * reduced_debug_output.cc: Likewise.
11657 * reduced_debug_output.h: Likewise.
11658 * reloc.cc: Likewise.
11659 * reloc.h: Likewise.
11660 * resolve.cc: Likewise.
11661 * script-sections.cc: Likewise.
11662 * script.cc: Likewise.
11663 * script.h: Likewise.
11664 * sparc.cc: Likewise.
11665 * symtab.cc: Likewise.
11666 * symtab.h: Likewise.
11667 * target-select.cc: Likewise.
11668 * target-select.h: Likewise.
11669 * token.h: Likewise.
11670 * workqueue.cc: Likewise.
11671 * workqueue.h: Likewise.
11672 * x86_64.cc: Likewise.
11673
a0351a69
DK
116742009-12-10 Doug Kwan <dougkwan@google.com>
11675
11676 * arm.cc (attributes.h): New include.
11677 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11678 (Arm_relobj::~Arm_relobj): Delete object pointed by
11679 attributes_section_data_.
11680 (Arm_relobj::attributes_section_data): New method definition.
11681 (Arm_relobj::attributes_section_data_): New data member declaration.
11682 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11683 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11684 attributes_section_data_.
11685 (Arm_dynobj::attributes_section_data): New method definition.
11686 (Arm_dynobj::attributes_section_data_): New data member declaration.
11687 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11688 initialization value of may_use_blx_ to false.
2e702c99 11689 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11690 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11691 object attributes to compute results instead of hard-coding.
11692 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11693 Target_arm::get_secondary_compatible_arch,
11694 Target_arm::set_secondary_compatible_arch
11695 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11696 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11697 New method declarations.
11698 (Target_arm::get_aeabi_object_attribute): New method definition.
11699 (Target_arm::attributes_section_data_): New data member declaration.
11700 (read_arm_attributes_section): New template definition.
11701 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11702 (Arm_dynobj::do_read_symbols): Ditto.
11703 (Target_arm::do_finalize_sections): Merge attributes sections from
11704 input. Check for BLX use after attributes section merging.
11705 Fix __exidx_start and __exidx_end visibility. Create an
11706 .ARM.attributes section if necessary.
11707 (Target_arm::get_secondary_compatible_arch,
11708 Target_arm::set_secondary_compatible_arch,
11709 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11710 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11711 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11712 New method definitions.
11713
b59befec
ILT
117142009-12-09 Ian Lance Taylor <iant@google.com>
11715
11716 * plugin.cc (Plugin::load): Don't cast from void* to a function
11717 pointer.
11718
1276bc89
ILT
117192009-12-09 Ian Lance Taylor <iant@google.com>
11720
11721 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11722 information fields.
11723
2f2de248
L
117242009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11725
11726 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11727 Replace two_file_shared_1.so with two_file_shared_2.so.
11728 * testsuite/Makefile.in: Regenerated.
11729
4f787271
DK
117302009-12-08 Doug Kwan <dougkwan@google.com>
11731
11732 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11733 (HFILES): Add attributes.h and int_encoding.h.
11734 * Makefile.in: Regenerate.
11735 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11736 function definitions to int_encoding.cc
11737 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11738 prototypes to int_encoding.h
11739 * reduced_debug_output.cc (int_encoding.h): New include.
11740 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11741 function definitions to int_encoding.cc
11742 (insert_into_vector, read_from_pointer): Move template definitions to
11743 int_encoding.h
11744 * attributes.cc: New file.
11745 * attributes.h: New file.
11746 * int_encoding.cc: New file.
11747 * int_encoding.h: New file.
11748
20b52f1a
RÁE
117492009-12-07 Rafael Avila de Espindola <espindola@google.com>
11750
11751 PR gold/11055
11752 * incremental-dump.cc (dump_incremental_inputs): New.
11753 (main): Use dump_incremental_inputs.
11754
53d7974c
L
117552009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11756
11757 PR gold/10893
11758 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11759 checking elfcpp::STT_FUNC.
11760 (Target_i386::Relocate::relocate): Likewise.
11761 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11762
11763 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11764 symbols from shared libraries into normal FUNC symbols.
11765
11766 * symtab.h (Symbol): Add is_func and use it.
11767
05a352e6
DK
117682009-12-05 Doug Kwan <dougkwan@google.com>
11769
11770 * arm.cc (Target_arm::arm_info): Initialize new fields
11771 attributes_section and attributes_vendor.
11772 * i386.cc (Target_i386::i386_info): Same.
11773 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11774 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11775 fields attributes_section and attributes_vendor.
53d7974c 11776 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11777 * target.h (Target::attributes_section, Target::attributes_vendor,
11778 Target::is_attributes_section, Target::attribute_arg_type,
11779 Target::attributes_order): New method definitions.
11780 (Target::Target_info::attributes_section,
11781 Target::Target_info::attributes_vendor): New fields.
11782 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11783 virtual method definitions.
11784 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11785 attributes_section and attributes_vendor.
11786 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11787
f4e5969c
DK
117882009-12-05 Doug Kwan <dougkwan@google.com>
11789
11790 * arm.cc: Update comments about interworking and stub generation.
11791 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11792 considered as non-PIC.
11793 (Arm_relocate_functions::base_abs): Fix formatting.
11794 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11795 of function to use GOT entry address instead of offset.
11796 (Target_arm::Scan::global): Issue an error if a symbol would need a
11797 PLT does not get one because it is untyped. Remove code to create
11798 dynamic symbols for relative branches.
11799 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11800 takes unsigned integer instead of boolean.
11801
1abce4a6
L
118022009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11803
11804 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11805 (two_file_test_LDADD): Likewise.
11806 (common_test_1_LDADD): Likewise.
11807 (exception_test_LDADD) Likewise.
11808 (weak_test_LDADD): Likewise.
11809 (many_sections_test_LDADD): Likewise.
11810 (initpri1_LDADD): Likewise.
11811 (script_test_1_LDADD): Likewise.
11812 (script_test_2_LDADD): Likewise.
11813 (justsyms_LDADD): Likewise.
11814 (binary_test_LDADD): Likewise.
11815 (large_LDADD): Likewise.
11816 * testsuite/Makefile.in: Regenerated.
11817
adcf2816 118182009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11819
adcf2816
L
11820 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11821 (Symbol_table::override_with_special): Likewise.
11822 (Symbol_table::add_from_object): Likewise.
11823
28e67f5d
RÁE
118242009-12-04 Rafael Avila de Espindola <espindola@google.com>
11825
11826 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11827 Don't set the data_offset twice.
11828
ae10a101
RÁE
118292009-12-04 Rafael Avila de Espindola <espindola@google.com>
11830
11831 * testsuite/Makefile.in: Regenerate.
11832
f59f41f3
DK
118332009-12-03 Doug Kwan <dougkwan@google.com>
11834
11835 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11836 (Target_arm::do_finalize_sections): Add parameter for symbol table
11837 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11838 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11839 parameter for symbol table pointer.
11840 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11841 an additional parameter for a pointer to symbol table.
11842 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11843 parameter for a symbol table pointer.
11844 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11845 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11846 Ditto.
11847 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11848 parameter for a symbol table pointer.
11849
ca55d848
RÁE
118502009-12-03 Rafael Avila de Espindola <espindola@google.com>
11851
11852 * incremental.cc (Incremental_inputs_header)
11853 (Incremental_inputs_header_write, Incremental_inputs_entry)
11854 (Incremental_inputs_entry_write): Move ...
11855 * incremental.h (Incremental_inputs_header)
11856 (Incremental_inputs_header_write, Incremental_inputs_entry)
11857 (Incremental_inputs_entry_write): here.
11858
3aec4f9c
RÁE
118592009-12-02 Rafael Avila de Espindola <espindola@google.com>
11860
11861 * incremental.cc (make_sized_incremental_binary): Set the target.
11862 Error if it is incompatible.
11863 * output.h (Output_file): Add filename method.
11864
9c0ae74d
RÁE
118652009-12-02 Rafael Avila de Espindola <espindola@google.com>
11866
11867 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11868 from the get_* methods.
11869
a45500ae
RÁE
118702009-12-02 Rafael Avila de Espindola <espindola@google.com>
11871
11872 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11873 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11874 Write 0 for the data_offset of scripts.
11875
325e6408
RÁE
118762009-12-02 Rafael Avila de Espindola <espindola@google.com>
11877
11878 * testsuite/Makefile.am: Add the incremental_test.sh test.
11879 * testsuite/incremental_test.sh: New.
11880 * testsuite/incremental_test_1.c: New.
11881 * testsuite/incremental_test_2.c: New.
11882
954c3e2e
RÁE
118832009-12-01 Rafael Avila de Espindola <espindola@google.com>
11884
703d02da 11885 * incremental-dump.cc (main): Fix typos.
954c3e2e 11886
f8086623
RÁE
118872009-11-27 Rafael Avila de Espindola <espindola@google.com>
11888
11889 PR gold/11025
11890 * incremental-dump.cc (main): Use llu to print 64 bit values.
11891
3b0dd6ac
L
118922009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11893 H.J. Lu <hongjiu.lu@intel.com>
11894
11895 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11896 $(LIBDL).
11897 (incremental_dump_LDADD): Likewise.
11898 * Makefile.in: Regenerated.
11899
a6d1ef57 119002009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11901
a6d1ef57
DK
11902 Revert:
11903
11904 2009-11-25 Doug Kwan <dougkwan@google.com>
11905
11906 * arm.cc (Target_arm::Target_arm): Move method definition
11907 outside of class definition. Add code to handle
11908 --target1-rel, --target1-abs and --target2= options.
11909 (Target_arm::get_reloc_reloc_type): Change method to be
11910 non-static and const.
11911 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11912 New data member declaration.
11913 (Target_arm::Scan::local, Target_arm::Scan::global,
11914 Target_arm::Relocate::relocate,
11915 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11916 Adjust call to Target_arm::get_real_reloc_type.
11917 (Target_arm::get_real_reloc_type): Use command line options
11918 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11919 * options.h (--target1-rel, --target1-abs, --target2): New
11920 ARM-only options.
11921
50aeb7d4
DK
119222009-11-25 Doug Kwan <dougkwan@google.com>
11923
11924 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11925 class definition. Add code to handle --target1-rel, --target1-abs
11926 and --target2= options.
11927 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11928 and const.
11929 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11930 member declaration.
11931 (Target_arm::Scan::local, Target_arm::Scan::global,
11932 Target_arm::Relocate::relocate,
11933 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11934 call to Target_arm::get_real_reloc_type.
11935 (Target_arm::get_real_reloc_type): Use command line options to
11936 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11937 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11938 options.
11939
51938283
DK
119402009-11-25 Doug Kwan <dougkwan@google.com>
11941
11942 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11943 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11944 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11945 formatting.
11946 (Arm_relocate_functions::thm_call): Replace body with a call to
11947 Arm_relocate_functions::thumb_branch_common.
11948 (Arm_relocate_functions::thm_jump24,
11949 Arm_relocate_functions::thm_xpc22): New method definitions.
11950 (Arm_relocate_functions::thumb_branch_common): New method definition.
11951 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11952 operator.
11953 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11954 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11955
e2b8f3c4
RÁE
119562009-11-24 Rafael Avila de Espindola <espindola@google.com>
11957
11958 * Makefile.am: Build incremental-dump
11959 * Makefile.in: Regenerate.
11960 * incremental-dump.cc: New.
11961 * incremental.cc (Incremental_inputs_header_data,
11962 Incremental_inputs_entry_data): Move to incremental.h
11963 * incremental.h: (Incremental_inputs_header_data,
11964 Incremental_inputs_entry_data): Move from incremental.cc
11965
bcba9aec
RÁE
119662009-11-24 Rafael Avila de Espindola <espindola@google.com>
11967
11968 * incremental.cc (Incremental_inputs_header,
11969 Incremental_inputs_header_write, Incremental_inputs_entry,
11970 Incremental_inputs_entry_write): Add a typedef with the data type.
11971
7c3afe08
RÁE
119722009-11-24 Rafael Avila de Espindola <espindola@google.com>
11973
11974 * incremental.cc (Incremental_inputs_header,
11975 Incremental_inputs_header_write, Incremental_inputs_entry,
11976 Incremental_inputs_entry_write): Update comment about which
11977 type has the filed descriptions.
11978
d204b6e9
DK
119792009-11-15 Doug Kwan <dougkwan@google.com>
11980
11981 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11982 (Arm_relocate_functions::arm_branch_common): Change method defintion
11983 in class definition to a method declaration and update list of formal
11984 parameters.
11985 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11986 Arm_relocation_functions::jump24): Adjust call to
11987 Arm_relocate_functions::arm_branch_common. Update list of formal
11988 parameters.
11989 (Arm_relocate_functions::xpc25): New method definition.
11990 (Arm_relocate_functions::arm_branch_common): Move method defintion
11991 out from class definition. Use stubs for mode-switching and extending
11992 branch ranges.
11993 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11994 specially. Change code to enable use of stubs in ARM branches.
11995
43d12afe
DK
119962009-11-10 Doug Kwan <dougkwan@google.com>
11997
11998 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11999 in method declaration.
12000 (Target_arm::relocate_stub): New method declaration.
12001 (Target_arm::default_target): Change to return a pointer instead of
12002 a const reference.
12003 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12004 Target_arm::default_target.
12005 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12006 method definition.
12007 (Target_arm::relocate_section): Adjust view.
12008 (Target_arm::relocate_stub): New method definition.
12009
ac33a407
DK
120102009-11-10 Doug Kwan <dougkwan@google.com>
12011
12012 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12013 a format warning.
12014 * incremental.cc (open_incremental_binary): Initialized local
12015 variables to avoid warnings.
12016 * object.cc (make_elf_object): Ditto.
12017 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12018 a format warning.
e1df38aa 12019
88ee28e9
L
12020009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12021
12022 PR gold/10930
12023 * testsuite/plugin_test.c: Include "config.h".
12024
2daedcd6
DK
120252009-11-09 Doug Kwan <dougkwan@google.com>
12026
12027 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12028 (arm_symbol_value): Remove.
12029 (Arm_relocate_functions::arm_branch_common,
12030 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12031 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12032 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12033 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12034 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12035 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12036 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12037 Arm_relocate_functions::thm_mobw_abs_nc,
12038 Arm_relocate_functions::thm_mov_abs,
12039 Arm_relocate_functions::movw_prel_nc,
12040 Arm_relocate_functions::thm_movt_abs,
12041 Arm_relocate_functions::movt_prel,
12042 Arm_relocate_functions::thm_movw_prel_nc,
12043 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12044 (Target_arm::Relocate::relocate): Only decompose address into two
12045 parts if relocation type uses the thumb-bit and pass the actual
12046 bit instead of a flag indicating that the thumb-bit is used. Adjust
12047 calls to methods in Arm_relocate_functions for this change.
12048
1276bc89 120492009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12050
12051 PR 10925
12052 * reloc.cc: Instantiate
12053 Sized_relobj::initialize_input_to_output_maps and
12054 Sized_relobj:free_input_to_output_maps.
12055
e53ad1b5
ILT
120562009-11-06 Ian Lance Taylor <iant@google.com>
12057
12058 PR 10876
12059 * defstd.cc (in_segment): Set only_if_ref true for "end".
12060
eb44217c
DK
120612009-11-06 Doug Kwan <dougkwan@google.com>
12062
12063 * arm.cc (class Reloc_stub): Correct a comment.
12064 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12065 (Target_arm::scan_section_for_stubs): New method declaration.
12066 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12067 Change methods from private to protected.
12068 (Target_arm::do_may_relax): New method definition.
12069 (Target_arm::do_relax, Target_arm::group_sections,
12070 Target_arm::scan_reloc_for_stub,
12071 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12072 (Target_arm::arm_input_section_map_): New data member declaration.
12073 (Target_arm::scan_reloc_for_stub,
12074 Target_arm::scan_reloc_section_for_stubs,
12075 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12076 Target_arm::do_relax): New method definitions.
12077
5d329b7d
ILT
120782009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12079
12080 * configure.ac: Check for (struct stat)::st_mtim
12081 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12082 * config.in: Regenerate.
12083 * configure: Regenerate.
12084
96a0d71b
ILT
120852009-11-05 Ian Lance Taylor <iant@google.com>
12086
12087 PR 10910
12088 * output.cc (Output_segment::add_output_section): Add missing
12089 return statement.
12090
594c8e5e
ILT
120912009-11-04 Ian Lance Taylor <iant@google.com>
12092
12093 PR 10880
12094 * object.h (class Object): Add is_needed and set_is_needed
12095 methods. Add is_needed_ field. Make bool fields into bitfields.
12096 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12097 defined in a dynamic object and referenced by a regular object,
12098 set is_needed for the dynamic object.
12099 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12100 if the file is marked with as_needed and it is not needed.
12101
22b127cc
ILT
121022009-11-04 Ian Lance Taylor <iant@google.com>
12103
12104 PR 10887
12105 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12106 tags if data is discarded by linker script.
12107 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12108 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12109 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12110 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12111
f5c870d2
ILT
121122009-11-04 Ian Lance Taylor <iant@google.com>
12113
12114 * layout.cc (Layout::get_output_section): Add is_interp and
12115 is_dynamic_linker_section parameters. Change all callers.
12116 (Layout::choose_output_section): Likewise.
12117 (Layout::make_output_section): Likewise.
12118 (Layout::add_output_section_data): Add is_dynamic_linker_section
12119 parameter. Change all callers.
12120 * layout.h (class Layout): Update declarations.
12121 * output.h (class Output_section): Add is_interp, set_is_interp,
12122 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12123 Add is_interp_, is_dynamic_linker_section_ fields. Change
12124 generate_code_fills_at_write_ to a bitfield.
12125 * output.cc (Output_section::Output_sections): Initialize new
12126 fields.
12127 (Output_segment::add_output_section): Add do_sort parameter.
12128 Change all callers.
12129
1ae4d23b
ILT
121302009-11-03 Ian Lance Taylor <iant@google.com>
12131
12132 PR 10860
12133 * options.h (class General_options): Add --warn-common.
12134 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12135 merging two common symbols.
12136 (Symbol_table::should_override): Handle --warn-common when merging
12137 a common symbol with a defined symbol. Use report_resolve_problem
12138 for multiple definitions.
12139 (Symbol_table::report_resolve_problem): New function.
12140 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12141
55da9579
DK
121422009-11-03 Doug Kwan <dougkwan@google.com>
12143
12144 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12145 stub_factory_.
12146 (Target_arm::stub_factory): New method definition.
12147 (Target_arm::new_arm_input_section,
12148 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12149 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12150 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12151 New type definitions.
12152 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12153 member declarations.
12154 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12155 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12156 New method definitions.
12157
37a9ac43
ILT
121582009-11-03 Ian Lance Taylor <iant@google.com>
12159
12160 * options.h (class General_options): Add --warn_constructors.
12161
b3d6a3d4
ILT
121622009-11-03 Ian Lance Taylor <iant@google.com>
12163
12164 PR 10893
12165 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12166 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12167
934b01dd
ILT
121682009-11-03 Ian Lance Taylor <iant@google.com>
12169
12170 PR 10895
12171 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12172 --msgid-bugs-address.
12173 (install-pdf): New target.
12174 (install-data_yes): Look up one directory to find mkinstalldirs.
12175
03c1939b
L
121762009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12177
12178 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12179 tree.
12180
ebd95253
DK
121812009-10-30 Doug Kwan <dougkwan@google.com>
12182
12183 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12184
e9bbb538
DK
121852009-10-30 Doug Kwan <dougkwan@google.com>
12186
12187 * arm.cc (Stub_addend_reader): New struct template definition
12188 and partial specializations.
12189 (Stub_addend_reader::operator()): New method definition for a
12190 partially specialized template.
12191
d5b40221
DK
121922009-10-30 Doug Kwan <dougkwan@google.com>
12193
12194 * arm.cc (Arm_relobj::processor_specific_flags): New method
12195 definition.
12196 (Arm_relobj::do_read_symbols): New method declaration.
12197 (Arm_relobj::processor_specific_flags_): New data member declaration.
12198 (Arm_dynobj): New class definition.
12199 (Target_arm::do_finalize_sections): Add input_objects parameter.
12200 (Target_arm::do_adjust_elf_header): New method declaration.
12201 (Target_arm::are_eabi_versions_compatible,
12202 (Target_arm::merge_processor_specific_flags): New method declaration.
12203 (Target_arm::do_make_elf_object): New overloaded method definitions
12204 and declaration.
12205 (Arm_relobj::do_read_symbols): New method definition.
12206 (Arm_dynobj::do_read_symbols): Ditto.
12207 (Target_arm::do_finalize_sections): Add input_objects parameters.
12208 Merge processor-specific flags from all input objects.
12209 (Target_arm::are_eabi_versions_compatible,
12210 Target_arm::merge_processor_specific_flags,
12211 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12212 New method definitions.
12213 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12214 Input_objects pointer type parameter.
12215 * layout.cc (Layout::finalize): Pass input objects to target's.
12216 finalize_sections function.
12217 * output.cc (Output_file_header::do_sized_write): Set ELF file
12218 header's processor-specific flags.
12219 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12220 Input_objects pointer type parameter.
12221 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12222 * target.h (Input_objects): New forward class declaration.
12223 (Target::processor_specific_flags,
12224 Target::are_processor_specific_flags_sect): New method definitions.
12225 (Target::finalize_sections): Add input_objects parameter.
12226 (Target::Target): Initialize processor_specific_flags_ and
12227 are_processor_specific_flags_set_.
12228 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12229 parameter.
12230 (Target::set_processor_specific_flags): New method definition.
12231 (Target::processor_specific_flags_,
12232 Target::are_processor_specific_flags_set_): New data member
12233 declarations.
12234 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12235 Input_objects pointer type parameter.
12236
ebabffbd
DK
122372009-10-30 Doug Kwan <dougkwan@google.com>
12238
12239 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12240
ad0f2072
ILT
122412009-10-28 Ian Lance Taylor <iant@google.com>
12242
12243 * object.h (class Relobj): Drop options parameter from
12244 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12245 do_scan_relocs, do_relocate. Change all callers.
12246 (class Sized_relobj): Drop options parameters from
12247 do_gc_process_relocs, do_scan_relocs, do_relocate,
12248 do_relocate_sections, relocate_sections, emit_relocs_scan,
12249 emit_relocs_scan_reltype. Change all callers.
12250 (struct Relocate_info): Remove options field and all references to
12251 it.
12252 * reloc.h (class Read_relocs): Remove options constructor
12253 parameter and options_ field. Change all callers.
12254 (class Gc_process_relocs, class Scan_relocs): Likewise.
12255 (class Relocate_task): Likewise.
12256 * target-reloc.h (scan_relocs): Remove options parameter. Change
12257 all callers.
12258 (scan_relocatable_relocs): Likewise.
12259 * target.h (class Sized_target): Remove options parameter from
12260 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12261 all callers.
12262 * gc.h (gc_process_relocs): Remove options parameter. Change all
12263 callers.
12264 * arm.cc: Update functions to remove options parameters.
12265 * i386.cc: Likewise.
12266 * powerpc.cc: Likewise.
12267 * sparc.cc: Likewise.
12268 * x86_64.cc: Likewise.
12269 * testsuite/testfile.cc: Likewise.
12270
8ffa3667
DK
122712009-10-28 Doug Kwan <dougkwan@google.com>
12272
12273 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12274 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12275 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12276 New method definitions.
12277
40f36857
CC
122782009-10-28 Cary Coutant <ccoutant@google.com>
12279
12280 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12281 (Plugin::cleanup_done_): New member.
12282 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12283 (Plugin_manager::cleanup_done_): Remove.
12284 (Plugin_manager::add_input_file): Edit error message.
12285 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12286 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12287
2c849493
ILT
122882009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12289
12290 * fileread.cc: (File_read::View::~View): Use the new
12291 data_ownership_ filed.
12292 (File_read::~File_read): Dispose the new whole_file_view_.
12293 (File_read::open): Mmap the whole file if needed.
12294 (File_read::open): Use whole_file_view_ instead of contents_.
12295 (File_read::find_view): Use whole_file_view_ if applicable.
12296 (File_read::do_read): Use whole_file_view_ instead of contents_.
12297 (File_read::make_view): Use whole_file_view_ instead of contents_,
12298 update File_read::View::View call.
12299 (File_read::find_or_make_view): Update File_read::View::View
12300 call.
12301 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12302 remove contents_
12303 (File_read::View::Data_ownership): New enum.
12304 (File_read::View::View): Replace bool mapped_ with Data_ownership
12305 argument.
12306 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12307 (File_read::View::data_ownership_): New field.
12308 (File_read::contents_): Remove (replaced by whole_file_view_).
12309 (File_read::whole_file_view_): New field.
12310 * options.h (class General_options): Add --keep-files-mapped.
12311
24998053
CC
123122009-10-27 Cary Coutant <ccoutant@google.com>
12313
12314 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12315 * testsuite/Makefile.am (plugin_test_5): New test case.
12316 * testsuite/Makefile.in: Regenerate.
12317
72adc4fa
DK
123182009-10-25 Doug Kwan <dougkwan@google.com>
12319
12320 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12321 from private to protected to allow access by child class.
12322 (Sized_relobj::do_relocate_sections): New method declaration.
12323 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12324 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12325 Sized_relobj::relocate_sections. Instantiate template explicitly
12326 for different target sizes and endianity.
12327
07f508a2
DK
123282009-10-24 Doug Kwan <dougkwan@google.com>
12329
12330 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12331 (Arm_input_section::as_arm_input_section): New method.
12332 (Arm_output_section): New class definition.
12333 (Arm_output_section::create_stub_group,
12334 Arm_output_section::group_sections): New method definitions.
12335
10ad9fe5
DK
123362009-10-22 Doug Kwan <dougkwan@google.com>
12337
12338 * arm.cc (Arm_input_section): New class definition.
12339 (Arm_input_section::init, Arm_input_section:do_write,
12340 Arm_input_section::set_final_data_size,
12341 Arm_input_section::do_reset_address_and_file_offset): New method
12342 definitions.
12343
56ee5e00
DK
123442009-10-21 Doug Kwan <dougkwan@google.com>
12345
12346 * arm.cc (Stub_table, Arm_input_section): New forward class
12347 declarations.
12348 (Stub_table): New class defintion.
12349 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12350 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12351 New method definition.
12352
b569affa
DK
123532009-10-21 Doug Kwan <dougkwan@google.com>
12354
12355 * arm.cc: Update copyright comments.
12356 (Target_arm): New forward class template declaration.
12357 (Arm_address): New type.
12358 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12359 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12360 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12361 constants.
12362 (Insn_template): Same.
12363 (DEF_STUBS): New macro.
12364 (Stub_type): New enum type.
12365 (Stub_template): New class definition.
12366 (Stub): Same.
12367 (Reloc_stub): Same.
12368 (Stub_factory): Same.
12369 (Target_arm::Target_arm): Initialize may_use_blx_ and
12370 should_force_pic_veneer_.
12371 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12372 Target_arm::should_force_pic_veneer,
12373 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12374 Target_arm::using_thumb_only, Target_arm:;default_target): New
12375 method defintions.
12376 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12377 New data member declarations.
12378 (Insn_template::size, Insn_template::alignment): New method defintions.
12379 (Stub_template::Stub_template): New method definition.
12380 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12381 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12382 (Stub_factory::Stub_factory): New method definition.
12383 * gold.h (string_hash): New template.
12384 * output.h (Input_section_specifier::hash_value): Use
12385 gold::string_hash.
12386 (Input_section_specifier::string_hash): Remove.
12387 * stringpool.cc (Stringpool_template::string_hash): Use
12388 gold::string_hash.
12389
6c172549
DK
123902009-10-20 Doug Kwan <dougkwan@google.com>
12391
12392 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12393 symbols of relaxed input sections.
12394 * output.h (Output_section::find_relaxed_input_section): Make
12395 method public.
12396
c5617f2f
DK
123972009-10-16 Doug Kwan <dougkwan@google.com>
12398
12399 * dynobj.cc (Versions::Versions): Initialize version_script_.
12400 Only insert base version symbol definition for a shared object
12401 if version script defines any version versions.
12402 (Versions::define_base_version): New method definition.
12403 (Versions::add_def): Check that base version is not needed.
12404 (Versions::add_need): Define base version lazily.
12405 * dynobj.h (Versions::define_base_version): New method declaration.
12406 (Versions::needs_base_version_): New data member declaration.
12407 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12408 (check_DATA): Add no_version_test.stdout.
12409 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12410 New make rules.
12411 * testsuite/Makefile.in: Regenerate.
12412 * testsuite/no_version_test.c: New file.
12413 * testsuite/no_version_test.sh: Ditto.
12414
3c12dcdb
DK
124152009-10-16 Doug Kwan <dougkwan@google.com>
12416
12417 * expression.cc (class Segment_start_expression): New class definition.
12418 (Segment_start_expression::value): New method definition.
12419 (script_exp_function_segment_start): Return a new
12420 Segment_start_expression.
12421 * gold/script-c.h (script_saw_segment_start_expression): New function
12422 prototype.
12423 * script-sections.cc (Script_sections::Script_sections): Initialize
12424 SAW_SEGMENT_START_EXPRESSION_ to false.
12425 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12426 and -Tbbs options to specify section addresses if given in
12427 command line and no SEGMENT_START expression is seen in a script.
12428 * script-sections.h (Script_sections::saw_segment_start_expression,
12429 Script_sections::set_saw_segment_start_expression): New method
12430 definition.
12431 (Script_sections::saw_segment_start_expression_): New data member
12432 declaration.
12433 * script.cc (script_saw_segment_start_expression): New function.
12434 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12435 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12436 script_test_7.sh and script_test_8.sh.
12437 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12438 script_test_8.stdout.
12439 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12440 (script_test_6, script_test_6.stdout, script_test_7,
12441 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12442 * Makefile.in: Regenerate.
12443 * testsuite/script_test_6.sh: New file.
12444 * testsuite/script_test_6.t: Same.
12445 * testsuite/script_test_7.sh: Same.
12446 * testsuite/script_test_7.t: Same.
12447 * testsuite/script_test_8.sh: Same.
12448
64b1ae37
DK
124492009-10-16 Doug Kwan <dougkwan@google.com>
12450
12451 * output.cc (Output_segment::set_section_list_address): Cast
12452 expressions to unsigned long long type to avoid format warnings.
12453
661be1e2
ILT
124542009-10-15 Ian Lance Taylor <iant@google.com>
12455
12edd763 12456 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12457 dot assignment to script_sections_.
12edd763
ILT
12458 * script-sections.cc (Script_sections::add_dot_assignment):
12459 Initialize if necessary.
12460
68b6574b
ILT
12461 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12462 program headers with no load segment if there is a linker script.
12463
661be1e2
ILT
12464 * layout.cc (Layout::set_segment_offsets): Align the file offset
12465 to the segment aligment for -N or -n with no load segment.
12466 * output.cc (Output_segment::add_output_section): Don't crash if
12467 the first section is a TLS section.
12468 (Output_segment::set_section_list_addresses): Print an error
12469 message if the address moves backward in a linker script.
12470 * script-sections.cc
12471 (Output_section_element_input::set_section_addresses): Don't
12472 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12473 (Orphan_output_section::set_section_addresses): Likewise.
12474
f15f61a7
DK
124752009-10-15 Doug Kwan <dougkwan@google.com>
12476
12477 * layout.cc (Layout::finish_dynamic_section): Generate tags
12478 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12479 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12480 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12481
82bb573a
ILT
124822009-10-14 Ian Lance Taylor <iant@google.com>
12483
12484 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12485 fields.
12486 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12487 data_shdr fields of relinfo.
12488 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12489 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12490 R_386_TLS_LDO_32, adjust based on section flags.
12491 (Target_i386::Relocate::fix_up_ldo): Remove.
12492
374ad285
ILT
124932009-10-13 Ian Lance Taylor <iant@google.com>
12494
12495 Add support for -pie.
12496 * options.h (class General_options): Add -pie and
12497 --pic-executable.
12498 (General_options::output_is_position_independent): Test -pie.
12499 (General_options::output_is_executable): Return true if not shared
12500 and not relocatable.
12501 (General_options::output_is_pie): Remove.
12502 * options.cc (General_options::finalize): Reject incompatible uses
12503 of -pie.
12504 * gold.cc (queue_middle_tasks): A -pie link is not static.
12505 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12506 * symtab.cc (Symbol::final_value_is_known): Return false if
12507 output_is_position_independent.
12508 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12509 output_is_position_independent.
12510 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12511 output_is_position_independent.
12512 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12513 output_is_position_independent.
12514 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12515 two_file_pie_test.
12516 (basic_pie_test.o, basic_pie_test): New targets.
12517 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12518 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12519 (two_file_pie_test): New target.
12520 * testsuite/Makefile.in: Rebuild.
12521 * README: Remove note saying that -pie is not supported.
12522
c6585162
ILT
125232009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12524
12525 * options.h (class General_options): Add -init and -fini.
12526 * layout.cc (Layout::finish_dynamic_section): Emit
12527 given init and fini functions.
12528
032ce4e9
ST
125292009-10-13 Sriraman Tallam <tmsriram@google.com>
12530
12531 * gc.h (gc_process_relocs): Check if icf is enabled using new
12532 function.
12533 * gold.cc (queue_initial_tasks): Likewise.
12534 (queue_middle_tasks): Likewise.
12535 * object.cc (do_layout): Likewise.
12536 * symtab.cc (is_section_folded): Likewise.
12537 * main.cc (main): Likewise.
12538 * reloc.cc (Read_relocs::run): Likewise.
12539 (Sized_relobj::do_scan_relocs): Likewise.
12540 * icf.cc (is_function_ctor_or_dtor): New function.
12541 (Icf::find_identical_sections): Check if function is ctor or dtor when
12542 safe icf is chosen.
12543 * options.h (General_options::icf): Change option to be an enum.
12544 (Icf_status): New enum.
12545 (icf_enabled): New method.
12546 (icf_safe_folding): New method.
12547 (set_icf_status): New method.
12548 (icf_status_): New variable.
12549 * (options.cc) (General_options::finalize): Set icf_status_.
12550 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12551 icf_test and icf_keep_unique_test to use the --icf enum flag.
12552 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12553 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12554
f345227a
ST
125552009-10-12 Sriraman Tallam <tmsriram@google.com>
12556
12557 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12558 includes to gc.h and icf.h.
12559 * arm.cc: Include gc.h.
12560 * gold.cc: Likewise.
12561 * i386.cc: Likewise.
12562 * powerpc.cc: Likewise.
12563 * sparc.cc: Likewise.
12564 * x86_64.cc: Likewise.
12565 * gc.h: Include icf.h.
12566
1c7814ed
ILT
125672009-10-11 Ian Lance Taylor <iant@google.com>
12568
12569 * plugin.cc: Include "gold.h" before other header files.
12570
ae3b5189
CD
125712009-10-10 Chris Demetriou <cgd@google.com>
12572
12573 * options.h (Input_file_argument::Input_file_type): New enum.
12574 (Input_file_argument::is_lib_): Replace with...
12575 (Input_file_argument::type_): New member.
12576 (Input_file_argument::Input_file_argument): Take Input_file_type
12577 'type' rather than boolean 'is_lib' as second argument.
12578 (Input_file_argument::is_lib): Use type_.
12579 (Input_file_argument::is_searched_file): New function.
12580 (Input_file_argument::may_need_search): Handle is_searched_file.
12581 * options.cc (General_options::parse_library): Support -l:filename.
12582 (General_options::parse_just_symbols): Update for Input_file_argument
12583 changes.
12584 (Command_line::process): Likewise.
12585 * archive.cc (Archive::get_file_and_offset): Likewise.
12586 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12587 * script.cc (read_script_file, script_add_file): Likewise.
12588 * fileread.cc (Input_file::Input_file): Likewise.
12589 (Input_file::will_search_for): Handle is_searched_file.
12590 (Input_file::open): Likewise.
12591 * readsyms.cc (Read_symbols::get_name): Likewise.
12592 * testsuite/Makefile.am (searched_file_test): New test.
12593 * testsuite/Makefile.in: Regenerate.
12594 * testsuite/searched_file_test.cc: New file.
12595 * testsuite/searched_file_test_lib.cc: New file.
12596
f3048a1d
ILT
125972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12598 Ian Lance Taylor <iant@google.com>
12599
12600 * descriptor.cc: Include <cstdio> and "binary-io.h".
12601 (Descriptors::open): Open the files in binary mode always.
12602 * script.cc (Lex::get_token): Treat \r as whitespace.
12603
d4780e57
ILT
126042009-10-09 Ian Lance Taylor <iant@google.com>
12605
12606 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12607
d9a893b8
ILT
126082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12609 Ian Lance Taylor <iant@google.com>
12610
12611 * configure.ac: Check for readv function also.
12612 * fileread.cc (readv): Define if not HAVE_READV.
12613 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12614 does not exist.
12615 * config.in: Regenerate.
12616 * configure: Regenerate.
12617
c0a62865
DK
126182009-10-09 Doug Kwan <dougkwan@google.com>
12619
12620 * layout.cc (Layout::make_output_section): Call target hook to make
12621 ordinary output section.
12622 (Layout::finalize): Adjust parameter list of call the
12623 Target::may_relax().
12624 * layout.h (class Layout::section_list): New method.
12625 * merge.h (Output_merge_base::entsize): Change visibility to public.
12626 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12627 New methods.
12628 (Output_merge_string::do_is_string): New method.
12629 * object.cc (Sized_relobj::do_setup): renamed from
12630 Sized_relobj::set_up.
12631 * object.h (Sized_relobj::adjust_shndx,
12632 Sized_relobj::initializ_input_to_output_maps,
12633 Sized_relobj::free_input_to_output_maps): Change visibilities to
12634 protected.
12635 (Sized_relobj::setup): Virtualize.
12636 (Sized_relobj::do_setup): New method declaration.
12637 (Sized_relobj::invalidate_section_offset,
12638 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12639 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12640 * options.cc (parse_int): New function.
12641 * options.h (parse_int): New declaration.
12642 (DEFINE_int): New macro.
12643 (stub_group_size): New option.
12644 * output.cc (Output_section::Output_section): Initialize memebers
12645 merge_section_map_, merge_section_by_properties_map_,
12646 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12647 (Output_section::add_input_section): Handled deferred code-fill
12648 generation and remove an old comment.
12649 (Output_section::add_relaxed_input_section): New method definition.
12650 (Output_section::add_merge_input_section): Use merge section by
12651 properties map to speed to search. Update merge section maps
12652 as appropriate.
12653 (Output_section::build_relaxation_map): New method definition.
12654 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12655 Same.
12656 (Output_section::relax_input_section): Renamed to
12657 Output_section::convert_input_sections_to_relaxed_sections and change
12658 interface to take a vector of pointers to relaxed sections.
12659 (Output_section::find_merge_section,
12660 Output_section::find_relaxed_input_section): New method definitions.
12661 (Output_section::is_input_address_mapped,
12662 Output_section::output_offset, Output_section::output_address):
12663 Use output section data maps to speed up searching.
12664 (Output_section::find_starting_output_address): Add comments.
12665 (Output_section::do_write,
12666 Output_section::write_to_postprocessing_buffer): Do code-fill
12667 generation as appropriate.
12668 (Output_section::get_input_sections): Invalidate relaxed input section
12669 map.
12670 (Output_section::restore_states): Adjust type of checkpoint .
12671 Invalidate relaxed input section map.
12672 * output.h (Output_merge_base): New class declaration.
12673 (Input_section_specifier): New class defintion.
12674 (class Output_relaxed_input_section) Change base class to
12675 Output_section_data_build.
12676 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12677 base class initializer.
12678 (Output_section::add_relaxed_input_section): New method declaration.
12679 (Output_section::Input_section): Change visibility to protected.
2e702c99 12680 (Output_section::Input_section::relobj,
c0a62865
DK
12681 Output_section::Input_section::shndx): Handle relaxed input sections.
12682 Output_section::input_sections) Change visibility to protected. Also
12683 define overload to return a non-const pointer.
12684 (Output_section::Merge_section_properties): New class defintion.
12685 (Output_section::Merge_section_by_properties_map,
12686 Output_section::Output_section_data_by_input_section_map,
12687 Output_section::Relaxation_map): New types.
12688 (Output_section::relax_input_section): Rename method to
12689 Output_section::convert_input_sections_to_relaxed_sections and change
12690 interface to take a vector of relaxed section pointers.
12691 (Output_section::find_merge_section,
12692 Output_section::find_relaxed_input_section,
12693 Output_section::build_relaxation_map,
12694 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12695 New method declarations.
12696 (Output_section::merge_section_map_
12697 Output_section::merge_section_by_properties_map_,
12698 Output_section::relaxed_input_section_map_,
12699 Output_section::is_relaxed_input_section_map_valid_,
12700 Output_section::generate_code_fills_at_write_): New data members.
12701 * script-sections.cc
12702 (Output_section_element_input::set_section_addresses): Call
12703 current_data_size and addralign methods of relaxed input sections.
12704 (Orphan_output_section::set_section_addresses): Call current_data_size
12705 and addralign methods of relaxed input sections.
12706 * symtab.cc (Symbol_table::compute_final_value): Extract template
12707 from the body of Symbol_table::sized_finalize_symbol.
12708 (Symbol_table::sized_finalized_symbol): Call
12709 Symbol_table::compute_final_value.
12710 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12711 (Symbol_table::compute_final_value): New templated method declaration.
12712 * target.cc (Target::do_make_output_section): New method defintion.
12713 * target.h (Target::make_output_section): New method declaration.
12714 (Target::relax): Add more parameters for input objects, symbol table
12715 and layout. Adjust call to do_relax.
12716 (Target::do_make_output_section): New method declaration.
12717 (Target::do_relax): Add parameters for input objects, symbol table
12718 and layout.
12719
d446d6c4
ILT
127202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12721
12722 * pread.c: Include stdio.h.
12723
bc06c745
ILT
127242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12725
12726 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12727 defined.
12728
75aea3d0
ILT
127292009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12730
12731 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12732 Change read_shndx type to unsigned int.
12733 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12734 int.
12735 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12736 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12737 Change read_shndx type to unsigned int.
12738 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12739 int.
12740 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12741 * layout.cc (Layout::create_symtab_sections): Cast the result of
12742 local_symcount * symsize to off_t in the gold_assert.
12743
be8fcb75
ILT
127442009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12745
12746 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12747 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12748 R_ARM_BASE_ABS.
12749 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12750 (Arm_relocate_functions::thm_abs5): New function.
12751 (Arm_relocate_functions::abs12): New function.
12752 (Arm_relocate_functions::abs16): New function.
12753 (Arm_relocate_functions::base_abs): New function.
12754 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12755 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12756 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12757 R_ARM_BASE_ABS.
12758 (Scan::global): Likewise.
12759 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12760 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12761 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12762 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12763 R_ARM_BASE_ABS.
12764
c2a122b6
ILT
127652009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12766
12767 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12768 (Arm_relocate_functions::movt_prel): New function.
12769 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12770 (Arm_relocate_functions::thm_movt_prel): New function.
12771 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12772 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12773 (Scan::global, Relocate::relocate): Likewise.
12774 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12775
c4aa1e2d
ILT
127762009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12777
12778 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12779 Incremental_checker.
12780 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12781 unsigned int.
12782 (class Incremental_inputs_header): New class.
12783 (Incremental_inputs_header_writer): Edit comment.
12784 (Incremental_inputs_entry): New class.
12785 (Incremental_inputs_entry_writer): Edit comment.
12786 (Sized_incremental_binary::do_find_incremental_inputs_section):
12787 Add *strtab_shndx parameter, fill it.
12788 (Sized_incremental_binary::do_check_inputs): New method.
12789 (Incremental_checker::can_incrementally_link_output_file): Use
12790 Sized_incremental_binary::check_inputs.
12791 (Incremental_inputs::report_command_line): Save command line in
12792 command_line_.
12793 * incremental.h:
12794 (Incremental_binary::find_incremental_inputs_section): New
12795 method.
12796 (Incremental_binary::do_find_incremental_inputs_section): Add
12797 strtab_shndx parameter.
12798 (Incremental_binary::do_check_inputs): New pure virtual method.
12799 (Sized_incremental_binary::do_check_inputs): Declare.
12800 (Incremental_checker::Incremental_checker): Add incremental_inputs
12801 parameter, use it to initialize incremental_inputs_.
12802 (Incremental_checker::incremental_inputs_): New field.
12803 (Incremental_checker::command_line): New method.
12804 (Incremental_checker::inputs): New method.
12805 (Incremental_checker::command_line_): New field.
12806
c549a694
ILT
128072009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12808
12809 * incremental.cc: Include <cstdarg> and "target-select.h".
12810 (vexplain_no_incremental): New function.
12811 (explain_no_incremental): New function.
12812 (Incremental_binary::error): New method.
12813 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12814 method.
12815 (make_sized_incremental_binary): New function.
12816 (open_incremental_binary): New function.
12817 (can_incrementally_link_file): Add checks if output is ELF and has
12818 inputs section.
12819 * incremental.h: Include "elfcpp_file.h" and "output.h".
12820 (Incremental_binary): New class.
12821 (Sized_incremental_binary): New class.
12822 (open_incremental_binary): Declare.
12823 * object.cc (is_elf_object): Use
12824 elfcpp::Elf_recognizer::is_elf_file.
12825 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12826 * output.h (Output_file::filesize): New method.
12827
fd3c5f0b
ILT
128282009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12829
12830 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12831 New function.
12832 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12833 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12834 function.
12835 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12836 function.
12837 (Arm_relocate_functions::movw_abs_nc): New function.
12838 (Arm_relocate_functions::movt_abs): New function.
12839 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12840 (Arm_relocate_functions::thm_movt_abs): New function.
12841 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12842 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12843 (Scan::global): Likewise.
12844 (Relocate::relocate): Likewise.
12845 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12846
7f5309a5
ILT
128472009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12848
12849 * arm.cc (Arm_relocate_functions::got_prel) New function.
12850 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12851 (Relocate::relocate): Likewise.
12852 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12853
364c7fa5
ILT
128542009-10-06 Ian Lance Taylor <iant@google.com>
12855
12856 * options.h (class General_options): Define
12857 split_stack_adjust_size parameter.
12858 * object.h (class Object): Add uses_split_stack_ and
12859 has_no_split_stack_ fields. Add uses_split_stack and
12860 has_no_split_stack accessor functions. Declare
12861 handle_split_stack_section.
12862 (class Reloc_symbol_changes): Define.
12863 (class Sized_relobj): Define Function_offsets. Declare
12864 split_stack_adjust, split_stack_adjust_reltype, and
12865 find_functions.
12866 * object.cc (Object::handle_split_stack_section): New function.
12867 (Sized_relobj::do_layout): Call handle_split_stack_section.
12868 * dynobj.cc (Sized_dynobj::do_layout): Call
12869 handle_split_stack_section.
12870 * reloc.cc (Sized_relobj::relocate_sections): Call
12871 split_stack_adjust for executable sections in split_stack
12872 objects. Pass reloc_map to relocate_section.
12873 (Sized_relobj::split_stack_adjust): New function.
12874 (Sized_relobj::split_stack_adjust_reltype): New function.
12875 (Sized_relobj::find_functions): New function.
12876 * target-reloc.h: Include "object.h".
12877 (relocate_section): Add reloc_symbol_changes parameter. Change
12878 all callers.
12879 * target.h (class Target): Add calls_non_split method. Declare
12880 do_calls_non_split virtual method. Declare match_view and
12881 set_view_to_nop.
12882 * target.cc: Include "elfcpp.h".
12883 (Target::do_calls_non_split): New function.
12884 (Target::match_view): New function.
12885 (Target::set_view_to_nop): New function.
12886 * gold.cc (queue_middle_tasks): Give an error if mixing
12887 split-stack and non-split-stack objects with -r.
12888 * i386.cc (Target_i386::relocate_section): Add
12889 reloc_symbol_changes parameter.
12890 (Target_i386::do_calls_non_split): New function.
12891 * x86_64.cc (Target_x86_64::relocate_section): Add
12892 reloc_symbol_changes parameter.
12893 (Target_x86_64::do_calls_non_split): New function.
12894 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12895 parameter.
12896 * powerpc.cc (Target_powerpc::relocate_section): Add
12897 reloc_symbol_changes parameter.
12898 * sparc.cc (Target_sparc::relocate_section): Add
12899 reloc_symbol_changes parameter.
12900 * configure.ac: Call AM_CONDITIONAL for the default target.
12901 * configure: Rebuild.
12902 * testsuite/Makefile.am (TEST_AS): New variable.
12903 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12904 (check_DATA): Add split_i386 and split_x86_64 files.
12905 (SPLIT_DEFSYMS): Define.
12906 (split_i386_[1234n].o): New targets.
12907 (split_i386_[124]): New targets.
12908 (split_i386_[1234r].stdout): New targets.
12909 (split_x86_64_[1234n].o): New targets.
12910 (split_x86_64_[124]): New targets.
12911 (split_x86_64_[1234r].stdout): New targets.
12912 (MOSTLYCLEANFILES): Add new executables.
12913 * testsuite/split_i386.sh: New file.
12914 * testsuite/split_x86_64.sh: New file.
12915 * testsuite/split_i386_1.s: New file.
12916 * testsuite/split_i386_2.s: New file.
12917 * testsuite/split_i386_3.s: New file.
12918 * testsuite/split_i386_4.s: New file.
12919 * testsuite/split_i386_n.s: New file.
12920 * testsuite/split_x86_64_1.s: New file.
12921 * testsuite/split_x86_64_2.s: New file.
12922 * testsuite/split_x86_64_3.s: New file.
12923 * testsuite/split_x86_64_4.s: New file.
12924 * testsuite/split_x86_64_n.s: New file.
12925 * testsuite/testfile.cc (Target_test): Update relocation_section
12926 function.
12927 * testsuite/Makefile.in: Rebuild.
12928
e8a9fcda
ILT
129292009-10-06 Ian Lance Taylor <iant@google.com>
12930
12931 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12932 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12933 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12934 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12935 the address on ldo_addrs_.
12936 (Target_i386::Relocate::fix_up_ldo): New function.
12937
e99daf92
ILT
129382009-10-06 Rafael Espindola <espindola@google.com>
12939
12940 * plugin.cc (add_input_library): New.
12941 (Plugin::load): Add add_input_library to tv.
12942 (Plugin_manager::add_input_file): Add the is_lib argument.
12943 (add_input_file): Update call to Plugin_manager::add_input_file.
12944 (add_input_library): New.
12945 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12946
966d4097
DK
129472009-09-30 Doug Kwan <dougkwan@google.com>
12948
12949 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12950 symbol and call Symbol::may_need_copy_reloc to determine if
12951 a copy reloc is needed.
12952 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12953 nocopyreloc is given in command line.
12954 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12955 given in command line.
12956 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12957 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12958 of the removed Target_i386::may_need_copy_reloc.
12959 * options.h (copyreloc): New option with default value false.
12960 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12961 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12962 instead of the removed Target_powerpc::may_need_copy_reloc.
12963 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12964 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12965 instead of the removed Target_sparc::may_need_copy_reloc.
12966 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12967 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12968 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12969 instead of the removed Target_x86_64::may_need_copy_reloc.
12970
029ba973
ILT
129712009-09-30 Ian Lance Taylor <iant@google.com>
12972
12973 * object.h (class Object): Remove target_ field, and target,
12974 sized_target, and set_target methods.
12975 (Object::sized_target): Remove.
12976 (class Sized_relobj): Update declarations. Remove sized_target.
12977 * object.cc (Sized_relobj::setup): Remove target parameter.
12978 Change all callers.
12979 (Input_objects::add_object): Don't do anything with the target.
12980 (make_elf_sized_object): Add punconfigured parameter. Change all
12981 callers. Set or test parameter target.
12982 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12983 Change all callers.
12984 * parameters.cc (Parameters::set_target): Change parameter type to
12985 be non-const.
12986 (Parameters::default_target): Remove.
12987 (set_parameters_target): Change parameter type to be non-const.
12988 (parameters_force_valid_target): New function.
12989 (parameters_clear_target): New function.
12990 * parameters.h (class Parameters): Update declarations. Remove
12991 default_target method. Add sized_target and clear_target
12992 methods. Change target_ to be non-const.
12993 (set_parameters_target): Update declaration.
12994 (parameters_force_valid_target): Declare.
12995 (parameters_clear_target): Declare.
12996 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12997 as NULL if we aren't searching.
12998 (Add_symbols::run): Don't check for compatible target.
12999 * fileread.cc (Input_file::open_binary): Call
13000 parameters_force_valid_target.
13001 * gold.cc (queue_middle_tasks): Likewise.
13002 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13003 set_target on object.
13004 * dynobj.h (class Sized_dynobj): Update declarations.
13005 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13006 make_elf_object returns NULL.
13007 (Archive::include_member): Don't check whether object target is
13008 compatible.
13009 * output.cc (Output_section::add_input_section): Get target from
13010 parameters.
13011 (Output_section::relax_input_section): Likewise.
13012 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13013 parameters.
13014 (Sized_relobj::do_scan_relocs): Likewise.
13015 (Sized_relobj::relocate_sections): Likewise.
13016 * resolve.cc (Symbol_table::resolve): Likewise.
13017 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13018 parameter. Change all callers.
13019 (Symbol_table::add_from_object): Get target from parameters.
13020 (Symbol_table::add_from_relobj): Don't check object target.
13021 (Symbol_table::add_from_dynobj): Likewise.
13022 (Symbol_table::define_special_symbol): Get target from
13023 parameters.
13024 * symtab.h (class Symbol_table): Update declaration.
13025 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13026 parameter. Change all callers. Clear parameter target.
13027 (Binary_test): Test target here.
13028 * testsuite/object_unittest.cc (gold_testsuite): Remove
13029 target_test_pointer parameter. Change all callers.
13030 (Object_test): Test target here.
13031
a6a22b83
ILT
130322009-09-26 Ian Lance Taylor <iant@google.com>
13033
13034 * testsuite/initpri1.c: Don't try to use constructor priorities if
13035 compiling with gcc before 4.3.
13036
6a8f49fe
ILT
130372009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13038
13039 * testsuite/retain_symbols_file_test.sh (check_present): Change
13040 output file name to retain_symbols_file_test.stdout.
13041 (check_absent): Likewise.
13042
8c604651
CS
130432009-09-18 Craig Silverstein <csilvers@google.com>
13044
13045 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13046 * options.cc: Include <cerrno> and <fstream>.
13047 (General_options::finalize): Parse -retain-symbols-file tag.
13048 * options.h: New flag.
13049 (General_options): New method should_retain_symbol, new
13050 variable symbols_to_retain.
13051 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13052 should_retain_symbol map.
13053 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13054 * testsuite/Makefile.in: Regenerate.
13055 * testsuite/retain_symbols_file_test.sh: New file.
13056
ca58b19f
NC
130572009-09-18 Nick Clifton <nickc@redhat.com>
13058
13059 * po/es.po: Updated Spanish translation.
13060
20e6d0d6
DK
130612009-09-17 Doug Kwan <dougkwan@google.com>
13062
13063 * debug.h (DEBUG_RELAXATION): New constant.
13064 (DEBUG_ALL): Add DEBUG_RELAXATION.
13065 (debug_string_to_enum): Add relaxation debug option.
13066 * layout.cc
13067 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13068 Layout::Relaxation_debug_check::read_sections,
13069 Layout::Relaxation_debug_check::read_sections): New method definitions.
13070 (Layout::Layout): Initialize data members
13071 record_output_section_data_from_scrips_,
13072 script_output_section_data_list_ and relaxation_debug_check_.
13073 (Layout::save_segments, Layout::restore_segments,
13074 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13075 Layout::relaxation_loop_body): New method definitions.
13076 (Layout::finalize): Support relaxation. Move section layout code to
13077 Layout::relaxation_loop_body.
13078 (Layout::set_asection_address_from_script): Move code for orphan
13079 section placement out.
13080 (Layout::place_orphan_sections_in_script): New method definition.
13081 * layout.h (Output_segment_headers, Output_file_header):
13082 New forward class declarations.
13083 (Layout::~Layout): Define.
13084 (Layout::new_output_section_data_from_script): New method definition.
13085 (Layout::place_orphan_sections_in_script): New method declaration.
13086 (Layout::Segment_states): New type declaration.
13087 (Layout::save_segments, Layout::restore_segments,
13088 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13089 Layout::relaxation_loop_body): New method declarations.
13090 (Layout::Output_section_data_list): New type declaration.
13091 (Layout::Relaxation_debug_check): New class definition.
13092 (Layout::record_output_section_data_from_script_,
13093 Layout::script_output_section_data_list_, Layout::segment_states_,
13094 Layout::relaxation_debug_check_): New data members.
13095 * output.cc: (Output_section_headers::do_size): New method definition.
13096 (Output_section_headers::Output_section_headers): Move size
13097 computation to Output_section_headers::do_size.
13098 (Output_segment_headers::do_size): New method definition.
e1df38aa 13099 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13100 Output_file_header::do_size and call it.
13101 (Output_file_header::do_size): New method definition.
13102 (Output_data_group::Output_data_group): Adjust call to
13103 Output_section_data.
13104 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13105 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13106 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13107 RELAXED_INPUT_SECTION_CODE.
13108 (Output_section::Output_section): Initialize data member checkpoint_.
13109 (Output_section::~Output_section): Delete checkpoint object pointed
13110 by checkpoint_.
13111 (Output_section::add_input_section): Always add an Input_section if
13112 relaxing.
13113 (Output_section::add_merge_input_section): Add assert.
13114 (Output_section::relax_input_section): New method definition.
13115 (Output_section::set_final_data_size): Set load address to zero for
13116 an unallocated section.
13117 (Output_section::do_address_and_file_offset_have_reset_values):
13118 New method definition.
13119 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13120 Handle relaxed input section.
13121 (Output_section::sort_attached_input_sections): Checkpoint input
13122 section list lazily.
13123 (Output_section::get_input_sections): Change type of input_sections to
13124 list of Simple_input_section pointers. Checkpoint input section list
13125 lazily. Also handle relaxed input sections.
13126 (Output_section::add_input_section_for_script): Take a reference to
13127 a Simple_input_section object instead of Relobj pointer and section
13128 index as parameter. Handle relaxed input sections.
13129 (Output_section::save_states, Output_section::restore_states): New
13130 method definitions.
13131 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13132 (Output_data::is_data_size_fixed): New method definition.
13133 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13134 if it is fixed.
13135 (Output_data::address_and_file_offset_have_reset_values): New method
13136 definition.
13137 (Output_data::do_address_and_file_offset_have_reset_values): New method
13138 definition.
13139 (Output_data::set_data_size): Check that data size is not fixed.
13140 (Output_data::fix_data_size): New method definition.
13141 (Output_data::is_data_size_fixed_): New data member.
13142 (Output_section_headers::set_final_data_size): New method definition.
13143 (Output_section_headers::do_size): New method declaration.
13144 (Output_segment_headers::set_final_data_size): New method definition.
13145 (Output_segment_headers::do_size): New method declaration.
13146 (Output_file_header::set_final_data_size)::New method definition.
13147 (Output_file_header::do_size)::New method declaration.
13148 (Output_section_data::Output_section_data): Add new parameter
13149 is_data_size_fixed and use it to fix data size.
13150 (Output_data_const::Output_data_const): Adjust call to base class
13151 constructor and fix data size.
13152 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13153 base class constructor and fix data size.
13154 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13155 base class constructor and fix data size.
13156 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13157 class constructor and fix data size.
13158 (Output_data_group::set_final_data_size): New method definition.
13159 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13160 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13161 class constructor and fix data size.
13162 (Output_relaxed_input_section): New class definition.
13163 (Output_section::Simple_input_section): New class definition.
13164 (Output_section::get_input_sections): Adjust parameter list.
13165 (Output_section::add_input_section_for_script): Same.
13166 (Output_section::save_states, Output_section::restore_states,
13167 Output_section::do_address_and_file_offset_have_reset_values,
13168 (Output_section::Input_section::Input_section): Handle
13169 RELAXED_INPUT_SECTION_CODE. Add new overload for
13170 Output_relaxed_input_section.
13171 (Output_section::Input_section::is_input_section,
13172 Output_section::Input_section::set_output_section): Handle relaxed
13173 input section.
13174 (Output_section::Input_section::is_relaxed_input_section,
13175 Output_section::Input_section::output_section_data,
13176 Output_section::Input_section::relaxed_input_section): New method
13177 definitions.
13178 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13179 value.
13180 (Output_section::Input_section::u1_): Update comments.
13181 (Output_section::Input_section::u2_): Add new union member poris.
13182 (Output_section::Checkpoint_output_section): New classs definition.
13183 (Output_section::relax_input_section): New method declaration.
13184 (Output_section::checkpoint_): New data member.
13185 (Output_segment): Update comments.
13186 (Output_segment::Output_segment): Un-privatize copy constructor.
13187 (Output_segment::operator=): Un-privatize.
13188 * script-sections.cc (Output_section_element::Input_section_list):
13189 Change element type to Output_section::Simple_input_section.
13190 (Output_section_element_dot_assignment::set_section_addresses):
13191 Register output section data for relaxation clean up.
13192 (Output_data_exression::Output_data_expression): Adjust call to base
13193 constructor to fix data size.
13194 (Output_section_element_data::set_section_addresses): Register
13195 Output_data_expression object for relaxation clean up.
13196 (struct Input_section_info): Replace Relobj pointer and section index
13197 pair with Output_section::Simple_input_section and Convert struct to a
13198 class.
13199 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13200 Input_section_info data member to use accessors.
20e6d0d6
DK
13201 (Output_section_element_input::set_section_addresses): Use layout
13202 parameter. Adjust code to use Output_section::Simple_input_section
13203 and Input_secction_info classes. Register filler for relaxation
13204 clean up.
13205 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13206 and section index pair with Output_section::Simple_input_section
13207 class. Adjust code accordingly.
13208 (Phdrs_element::release_segment): New method definition.
13209 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13210 segment list.
13211 (Script_sections::release_segments): New method definition.
13212 * gold/script-sections.h (Script_sections::release_segments): New
13213 method declaration.
13214 * gold/target.h (Target::may_relax, Target::relax,
13215 Target::do_may_relax, Target::do_relax): New method definitions.
13216
5e445df6
ILT
132172009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13218
13219 * arm.cc (has_signed_unsigned_overflow): New function.
13220 (Arm_relocate_functions::abs8): New function.
13221 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13222 (Target_arm::Scan::global): Likewise.
13223 (Target_arm::relocate::relocate): Likewise.
13224 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13225 Likewise.
13226
8c604651 132272009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13228
13229 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13230 * testsuite/Makefile.in: Regenerate.
13231
1e9cc1c2
NC
132322009-09-11 Nick Clifton <nickc@redhat.com>
13233
13234 * po/gold.pot: Updated by the Translation project.
13235
6a89f575
CC
132362009-09-08 Cary Coutant <ccoutant@google.com>
13237
13238 * output.cc (Output_file::open): Add execute permission to empty file.
13239 * testsuite/Makefile.am (permission_test): New test.
13240 * testsuite/Makefile.in: Regenerate.
13241
fdcac5af
ILT
132422009-09-02 Ian Lance Taylor <iant@google.com>
13243
13244 * output.cc (Output_file::resize): Call map_no_anonymous rather
13245 than map.
13246
44453f85
ILT
132472009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13248
13249 * gold.cc: Include "incremental.h".
13250 (queue_initial_tasks): Call Incremental_checker methods.
13251 * incremental.cc: Include "output.h".
13252 (Incremental_checker::can_incrementally_link_output_file): New
13253 method.
13254 * incremental.h (Incremental_checker): New class.
13255
13256 * output.cc (Output_file::open_for_modification): New method.
13257 (Output_file::map_anonymous): Changed return type to bool. Record
13258 map in base_ field.
13259 (Output_file::map_no_anonymous): New method, broken out of map.
13260 (Output_file::map): Use map_no_anonymous and map_anonymous.
13261 * output.h (class Output_file): Update declarations.
13262
293c1386
CC
132632009-08-24 Cary Coutant <ccoutant@google.com>
13264
13265 * options.h (Command_line::Pre_options): New class.
13266 (Command_line::pre_options): New member.
13267 * options.cc (gold::options::ready_to_register): New variable.
13268 (One_option::register_option): Do nothing if not registering options.
13269 Assert if same short option registered twice.
13270 (General_options::General_options): Turn off option registration when
13271 done constructing.
13272 (Command_line::Pre_options::Pre_options): New constructor.
13273
f773f3d2
CC
132742009-08-24 Cary Coutant <ccoutant@google.com>
13275
06a73cfe
CC
13276 * options.h (General_options::no_keep_memory): Remove incorrect
13277 short option.
f773f3d2 13278
a15af8e2
RW
132792009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13280
13281 * Makefile.am (am__skiplex, am__skipyacc): New.
13282 * Makefile.in: Regenerate.
13283
c462b41b
RW
132842009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13285
14ec8efd
RW
13286 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13287 (INCLUDES): ... this.
13288 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13289 (AM_CPPFLAGS): Renamed from ...
13290 (INCLUDE): ... this.
13291 * Makefile.in, testsuite/Makefile.in: Regenerate.
13292
81ecdfbb
RW
13293 * Makefile.in: Regenerate.
13294 * aclocal.m4: Likewise.
13295 * config.in: Likewise.
13296 * configure: Likewise.
13297 * testsuite/Makefile.in: Likewise.
13298
c462b41b
RW
13299 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13300 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13301 * Makefile.in: Regenerate.
13302 * testsuite/Makefile.in: Regenerate.
13303
2da73f13
CC
133042009-08-19 Cary Coutant <ccoutant@google.com>
13305
13306 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13307 symbols in shared libraries overridden by hidden or internal symbols
13308 in the main program.
13309
2db70501
CD
133102009-08-19 Chris Demetriou <cgd@google.com>
13311
13312 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13313 checking source file names in error messages.
13314
f733487b
DK
133152009-08-18 Doug Kwan <dougkwan@google.com>
13316
13317 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13318 an elcpp::Ehdr as parameter. Adjust call to set_target.
13319 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13320 an elfcpp::Ehdr as parameter.
13321 * object.cc (Object::set_target): Remove the version that looks up
13322 a target and sets it.
13323 (Sized_relobj::setup): Take a Target object instead of
13324 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13325 (make_elf_sized_object): Find target and ask target to
13326 make an ELF object.
13327 * object.h: (Object::set_target): Remove the version that looks up
13328 a target and sets it.
13329 (Sized_relobj::setup): Take a Target object instead of
13330 an elfcpp:Ehdr as parameter.
13331 * target.cc: Include dynobj.h.
13332 (Target::do_make_elf_object_implementation): New.
2e702c99 13333 (Target::do_make_elf_object): New.
f733487b
DK
13334 * target.h (Target::make_elf_object): New template declaration.
13335 (Target::do_make_elf_object): New method declarations.
13336 (Target::do_make_elf_object_implementation): New template declaration.
13337
cc70f101
ILT
133382009-08-14 Ian Lance Taylor <iant@google.com>
13339
13340 * gold.h (FUNCTION_NAME): Define.
13341 (gold_unreachable): Use FUNCTION_NAME.
13342
ef5e0cb1
ST
133432009-08-12 Sriraman Tallam <tmsriram@google.com>
13344
13345 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13346 symbol in the --keep-unique list is not found.
13347
48c187ce
ST
133482009-08-12 Sriraman Tallam <tmsriram@google.com>
13349
13350 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13351 been maked as --keep-unique.
13352 (Icf::unfold_section): New function.
13353 * icf.h (Icf::unfold_section): New function.
13354 * options.h (General_options::keep_unique): New option.
13355 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13356 * testsuite/Makefile.in: Regenerate.
13357 * testsuite/icf_keep_unique_test.sh: New file.
13358 * testsuite/icf_keep_unique_test.cc: New file.
13359
645afe0c
CC
133602009-08-12 Cary Coutant <ccoutant@google.com>
13361
13362 PR 10471
13363 * resolve.cc (Symbol_table::resolve): Check for references from
13364 dynamic objects to hidden and internal symbols.
13365 * testsuite/Makefile.am (hidden_test.sh): New test.
13366 * testsuite/Makefile.in: Regenerate.
13367 * testsuite/hidden_test.sh: New script.
13368 * testsuite/hidden_test_1.c: New test source.
13369 * testsuite/hidden_test_main.c: New test source.
13370
11af873f
DK
133712009-08-11 Doug Kwan <dougkwan@google.com>
13372
13373 * arm.cc: Update comments.
13374 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13375 segment to locate the .ARM.exidx section if present.
13376
b9f7d72d
DK
133772009-08-09 Doug Kwan <dougkwan@google.com>
13378
13379 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13380 patch.
13381
ddd3c53c
ST
133822009-08-07 Sriraman Tallam <tmsriram@google.com>
13383 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13384 compiler warnings.
13385
27721062
ST
133862009-08-06 Sriraman Tallam <tmsriram@google.com>
13387
13388 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13389 valid tls_segment only for non-debug-section relocations.
13390 * testsuite/Makefile.am: Add gc_tls_test.
13391 * testsuite/Makefile.in: Regenerate.
13392 * testsuite/gc_tls_test.cc: New file.
13393 * testsuite/gc_tls_test.sh: New file.
13394
ef15dade 133952009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13396
ef15dade
ST
13397 * icf.cc: New file.
13398 * icf.h: New file.
13399 * Makefile.am (CCFILES): Add icf.cc.
13400 (HFILES): Add icf.h
13401 * Makefile.in: Regenerate.
13402 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13403 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13404 section, symbol and addend information for the relocs.
13405 * gold.cc (queue_middle_tasks): Call identical code folding.
13406 * gold.h: Add defines for multimap.
13407 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13408 to the call of finalize_local_symbols.
13409 * main.cc (main): Create object of class Icf.
13410 * object.cc (Sized_relobj::do_layout): Allow this function to be
13411 called twice during icf.
13412 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13413 to sections marked as identical by icf.
13414 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13415 when available.
13416 (Sized_relobj::do_section_entsize): New function.
13417 * object.h (Object::section_entsize): New function.
13418 (Object::do_section_entsize): New pure virtual function.
13419 (Relobj::finalize_local_symbols): Add new parameter.
13420 (Relobj::do_section_entsize): New function.
13421 * options.h (General_options::icf): New option.
13422 (General_options::icf_iterations): New option.
13423 (General_options::print_icf_sections): New option.
13424 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13425 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13426 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13427 icf.
13428 * symtab.cc (Symbol_table::is_section_folded): New function.
13429 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13430 to sections marked as identical by icf.
13431 * symtab.h (Symbol_table::set_icf): New function.
13432 (Symbol_table::icf): New function.
13433 (Symbol_table::is_section_folded): New function.
13434 (Symbol_table::icf_): New data member.
13435 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13436 * testsuite/Makefile.am: Add commands to build icf_test.
13437 * testsuite/Makefile.in: Regenerate.
13438 * testsuite/icf_test.sh: New file.
13439 * testsuite/icf_test.cc: New file.
13440
c3b65ac4
CD
134412009-07-24 Chris Demetriou <cgd@google.com>
13442
13443 * layout.cc (is_compressible_debug_section): Fix incorrect
13444 comment about compressed section names.
13445
1caf2c51
ILT
134462009-07-20 Ian Lance Taylor <ian@airs.com>
13447
13448 PR 10419
13449 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13450
1ef4d87f
ILT
134512009-07-16 Ian Lance Taylor <iant@google.com>
13452
13453 PR 10400
13454 * layout.h: #include <map>.
13455 (class Kept_section): Change from struct to class. Add accessors
13456 and setters. Add section size to Comdat_group mapping. Change
13457 Comdat_group to std::map. Add is_comdat_ field. Add
13458 linkonce_size field in union.
13459 (class Layout): Update declaration of find_or_add_kept_section.
13460 Don't declare find_kept_object.
13461 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13462 parameter. Add object, shndx, is_comdat, and is_group_name
13463 parameters. Change all callers. Adjust for new Kept_section.
13464 (Layout::find_kept_object): Remove.
13465 * object.cc (Sized_relobj::include_section_group): Update use of
13466 Kept_section. Rename secnum to shndx. Only record
13467 Kept_comdat_section if sections are the same size.
13468 (Sized_relobj::include_linkonce_section): Update use of
13469 Kept_section. Only record Kept_comdat_section if sections are the
13470 same size. Set size of linkonce section.
13471 (Sized_relobj::map_to_kept_section): Update call to
13472 get_kept_comdat_section.
13473 * object.h (class Sized_relobj): Rename fields in
13474 Kept_comdat_section to drop trailing underscores; change object
13475 field to Relobj*. Change Kept_comdat_section_table to store
13476 struct rather than pointer.
13477 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13478 Add kept_object and kept_shndx parameters. Change all callers.
13479 (Sized_relobj::get_kept_comdat_section): Change return type to
13480 bool. Add kept_object and kept_shndx parameters. Change all
13481 callers.
13482 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13483 Layout::find_or_add_kept_section.
13484
37c3b7b0
ILT
134852009-07-09 Ian Lance Taylor <iant@google.com>
13486
13487 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13488 Reserve space in the hash table.
13489
98fa85cb
ILT
134902009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13491
13492 * fileread.cc (File_read::get_mtime): New method.
13493 * fileread.h (Timespec): New structure.
13494 (File_read::get_mtime): New method.
13495 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13496 Renamed from timestamp_nsec.
13497 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13498 Elf_Xword.
e1df38aa 13499 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13500 timestamp_nsec.
e1df38aa 13501 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13502 (Incremental_inputs::report_obejct): Save mtime; style fix.
13503 (Incremental_inputs::report_script): Save mtime; style fix.
13504 (Incremental_inputs::finalize_inputs): Style fix.
13505 (Incremental_inputs::finalize): Style fix.
13506 (Incremental_inputs::create_input_section_data): Store inputs
13507 mtime.
13508 * incremental.h (Incremental_inputs::report_script): Add mtime
13509 argument.
13510 (Incremental_inputs::Input_info::Input_info): Intialize only one
13511 union member.
13512 (Incremental_inputs::Input_info::archive): Move to nameless
13513 union.
13514 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13515 (Incremental_inputs::Input_info::script): Move to nameless union.
13516 (Incremental_inputs::mtime): New field.
13517 * script.cc (read_input_script): Pass file mtime to
13518 Incremental_input.
13519 * script.h (Script_info::inputs): Style fix.
13520
c9d70757
ILT
135212009-07-01 Ian Lance Taylor <ian@airs.com>
13522
13523 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13524 instead of 32.
13525
9c547ec3
ILT
135262009-06-24 Ian Lance Taylor <iant@google.com>
13527
13528 PR 10156
13529 * layout.cc (Layout::choose_output_section): If we find an
13530 existing section, update the flags.
13531 (Layout::create_notes): New function, broken out of
13532 Layout::finalize.
13533 (Layout::finalize): Don't create note sections.
13534 (Layout::create_note): Don't crash if linker script discards
13535 section.
13536 (Layout::create_gold_note): Likewise.
13537 (Layout::create_build_id): Likewise. Don't set
13538 after_input_sections on the section.
13539 (Layout::create_executable_stack_info): Remove target parameter.
13540 Change caller.
13541 * layout.h (class Layout): Declare create_notes. Update
13542 declaration of create_executable_stack_info.
13543 * gold.cc (queue_middle_tasks): Call create_notes.
13544 * output.cc (Output_section::update_flags_for_input_section): Move
13545 here from output.h. If SHF_ALLOC flag is newly set, mark address
13546 invalid.
13547 * output.h (Output_data::mark_address_invalid): New function.
13548 (class Output_section): Only declare, not define,
13549 update_flags_for_input_section. Remove set_flags.
13550
55458500
ILT
135512009-06-24 Ian Lance Taylor <iant@google.com>
13552
13553 * script-sections.cc (Output_section_definition::
13554 set_section_addresses): Rename shadowing local load_address to
13555 laddr.
13556
1307d6cd
ILT
135572009-06-24 Ian Lance Taylor <iant@google.com>
13558
13559 PR 10244
13560 * reloc.cc (relocate_sections): Skip empty relocation sections.
13561
ec3f783e
ILT
135622009-06-23 Ian Lance Taylor <iant@google.com>
13563
13564 PR 10156
13565 * layout.cc (Layout::create_note): Use choose_output_section
13566 rather than make_output_section.
13567
459c9f1c
ILT
135682009-06-23 Ian Lance Taylor <iant@google.com>
13569
13570 PR 10237
13571 * options.cc (General_options::parse_V): Set printed_version_.
13572 (General_options::General_options): Initialize printed_version_.
13573 * options.h (class General_options): Add printed_version_ field.
13574 * gold.cc (queue_initial_tasks): If there are no input files,
13575 don't give a fatal error if we printed the version information.
13576 (queue_middle_tasks): If using -r with a shared object, give a
13577 fatal error rather than an ordinary error.
13578
1518dc8f
ILT
135792009-06-23 Ian Lance Taylor <iant@google.com>
13580
13581 PR 10219
13582 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13583 (Layout::make_output_section): Set have_stabstr_section_ if we see
13584 a .stab*str section.
13585 (Layout::finalize): Call link_stabs_sections.
13586 (Layout::link_stabs_sections): New file.
13587 * layout.h (class Layout): Add have_stabstr_section_ field.
13588 Declare link_stabs_sections.
13589
3d857b98
DK
135902009-06-23 Doug Kwan <dougkwan@google.com>
13591
13592 * Makefile.am (libgold_a_LIBADD): New.
13593 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13594 * Makefile.in: Regenerate.
3d857b98
DK
13595 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13596 * configure: Regenerate.
13597 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13598 * fileread.cc: Include sys/state.h
13599 * gold.h: Declare memmem and strndup if found missing.
13600 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13601
0639a6f6
ILT
136022009-06-23 Ian Lance Taylor <iant@google.com>
13603
13604 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13605 * configure: Rebuild.
13606
8d63875c
ILT
136072009-06-23 Ian Lance Taylor <iant@google.com>
13608
13609 PR 10147
13610 * object.cc (Object::section_contents): Don't try to get a view if
13611 the section has length zero.
13612 (Object::handle_gnu_warning_section): If the section is empty, use
13613 the name of the section as the warning.
13614
f7c8a183
ILT
136152009-06-23 Ian Lance Taylor <iant@google.com>
13616
13617 PR 10133
13618 * stringpool.h (class Stringpool_template): Add optimize_ field.
13619 (Stringpool_template::set_optimize): New function.
13620 * stringpool.cc (Stringpool_template::Stringpool_template):
13621 Initialize optimize_ field.
13622 (Stringpool_template::set_string_offsets): Test local optimize
13623 fild rather than parameter.
13624 * layout.cc (Layout::Layout): Call set_optimize on the section
13625 name stringpool.
13626
e6a307ba
ILT
136272009-06-22 Ian Lance Taylor <iant@google.com>
13628
13629 PR 10030
13630 * yyscript.y: Parse TARGET.
13631 * script.cc (script_set_target): New function.
13632 * script-c.h (script_set_target): Declare.
13633 * options.cc (General_options::string_to_object_format): Rename
13634 from string_to_object_format in anonymous namespace. Change
13635 callers.
13636 * options.h (class General_options): Declare
13637 string_to_object_format.
13638
3ee173de
ILT
136392009-06-22 Ian Lance Taylor <iant@google.com>
13640
13641 * script-sections.cc (Script_sections::create_segments): Don't put
13642 program headers in a PT_LOAD segment if -n or -N.
13643
136442009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13645
13646 PR 10141
13647 * options.h (class General_options): Add -z lazy and -z now. Sort
13648 -z options into alphabetical order.
13649 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13650
cd6739a1 136512009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13652
13653 * layout.cc (Layout::make_output_section): Call
13654 Target::new_output_section.
13655 (Layout::attach_allocated_section_to_segment): Put large section
13656 sections in a separate load segment with the large segment flag
13657 set.
13658 (Layout::segment_precedes): Sort large data segments after other
13659 load segments.
13660 (align_file_offset): New static function.
13661 (Layout::set_segment_offsets): Use align_file_offset.
13662 * output.h (class Output_section): Add is_small_section_ and
13663 is_large_section_ fields.
13664 (Output_section::is_small_section): New function.
13665 (Output_section::set_is_small_section): New function.
13666 (Output_section::is_large_section): New function.
13667 (Output_section::set_is_large_section): New function.
13668 (Output_section::is_large_data_section): New function.
13669 (class Output_segment): Add is_large_data_segment_ field.
13670 (Output_segment::is_large_data_segment): New function.
13671 (Output_segment::set_is_large_data_segment): New function.
13672 * output.cc (Output_section::Output_section): Initialize new
13673 fields.
13674 (Output_segment::Output_segment): Likewise.
13675 (Output_segment::add_output_section): Add assertion that large
13676 data sections always go in large data segments. Force small data
13677 sections to the end of the list of data sections. Force small BSS
13678 sections to the start of the list of BSS sections. For large BSS
13679 sections to the end of the list of BSS sections.
13680 * symtab.h (class Symbol): Declare is_common_shndx.
13681 (Symbol::is_defined): Check Symbol::is_common_shndx.
13682 (Symbol::is_common): Likewise.
13683 (class Symbol_table): Define enum Commons_section_type. Update
13684 declarations. Add small_commons_ and large_commons_ fields.
13685 * symtab.cc (Symbol::is_common_shndx): New function.
13686 (Symbol_table::Symbol_table): Initialize new fields.
13687 (Symbol_table::add_from_object): Put small and large common
13688 symbols in the right list.
13689 (Symbol_table::sized_finalized_symbol): Check
13690 Symbol::is_common_shndx.
13691 (Symbol_table::sized_write_globals): Likewise.
13692 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13693 common symbol lists. Don't call do_allocate_commons_list if the
13694 list is empty.
13695 (Symbol_table::do_allocate_commons_list): Remove is_tls
13696 parameter. Add comons_section_type parameter. Change all
13697 callers. Handle small and large common symbols.
13698 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13699 Symbol::is_common_shndx.
13700 * resolve.cc (symbol_to_bits): Likewise.
13701 * target.h (Target::small_common_shndx): New function.
13702 (Target::small_common_section_flags): New function.
13703 (Target::large_common_shndx): New function.
13704 (Target::large_common_section_flags): New function.
13705 (Target::new_output_section): New function.
13706 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13707 small_common_section_flags, and large_common_section_flags
13708 fields.
13709 (Target::do_new_output_section): New virtual function.
13710 * arm.cc (Target_arm::arm_info): Initialize new fields.
13711 * i386.cc (Target_i386::i386_info): Likewise.
13712 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13713 Likewise.
13714 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13715 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13716 (Target_x86_64::do_new_output_section): New function.
13717 * configure.ac: Define conditional MCMODEL_MEDIUM.
13718 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13719 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13720 (large_LDFLAGS): Define.
13721 * testsuite/large.c: New file.
13722 * testsuite/testfile.cc (Target_test::test_target_info):
13723 Initialize new fields.
13724 * configure, testsuite/Makefile.in: Rebuild.
13725
bb04269c
DK
137262009-06-05 Doug Kwan <dougkwan@google.com>
13727
13728 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13729 * Makefile.in: Regenerate.
bb04269c
DK
13730 * i386.cc (class Target_i386): Define new virtual method to
13731 override do_is_local_label_name in parent.
13732 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13733 local symbols if --discard-locals or -X is given.
13734 * options.h (class General_options): Declare new options
13735 '--discard-locals' and '-X' for discarding locals.
13736 * target.h (class Target): Define new methods is_local_label_name.
13737 Declare new virtual method do_is_local_label_name.
13738 * target.cc: New file.
13739 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13740 (check_SCRIPTS): Add discard_locals_test.sh.
13741 (check_DATA): Add discard_local_tests.syms.
13742 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13743 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13744 * testsuite/Makefile.in: Regenerate.
13745 * testsuite/discard_locals_test.c: New file.
13746 * testsuite/discard_locals_test.sh: Same.
13747
805bb01c
DK
137482009-06-05 Doug Kwan <dougkwan@google.com>
13749
13750 * object.cc (Sized_relobj::Sized_relobj): Initialize
13751 discarded_eh_frame_shndx_ to -1U.
13752 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13753 section.
13754 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13755 a discarded .eh_frame section.
13756 (Sized_relobj::do_finalize_local_symbols): Ditto.
13757 * object.h (class Sized_relobj): Declare new member
13758 discarded_eh_frame_shndx_.
13759 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13760 (local_labels_test.o, local_labels_test): New rules.
13761 * testsuite/Makefile.in: Regenerate.
13762
1dcd334d
DK
137632009-06-04 Doug Kwan <dougkwan@google.com>
13764
13765 * layout.cc (Layout::section_name_mapping): Add mapping for
13766 special ARM sections.
13767
96d49306
DK
137682009-06-03 Doug Kwan <dougkwan@google.com>
13769
13770 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13771 (utils::has_overflow): Same.
13772
dff16297
ILT
137732009-06-03 Ian Lance Taylor <iant@google.com>
13774
13775 * layout.cc (Layout::section_name_mapping): New array, replacing
13776 Layout::linkonce_mapping.
13777 (Layout::section_name_mapping_count): New variable, replacing
13778 Layout::linkonce_mapping_count.
13779 (Layout::linkonce_output_name): Remove.
13780 (Layout::output_section_name): Rewrite.
13781 * layout.h (class Layout): Rename Linkonce_mapping to
13782 Section_name_mapping, linkonce_mapping to section_name_mapping,
13783 linkonce_mapping_count to section_name_mapping_count. Don't
13784 declare linkonce_output_name.
13785
c121c671
DK
137862009-06-03 Doug Kwan <dougkwan@google.com>
13787
13788 * gold/arm.cc (namespace utils): New.
13789 (Target_arm::reloc_is_non_pic): Define new method.
13790 (class Arm_relocate_functions): New.
13791 (Target_arm::Relocate::relocate): Handle relocation types used by
13792 Android.
13793
07800fab
ILT
137942009-06-03 Ian Lance Taylor <iant@google.com>
13795
13796 * arm.cc (Target_arm::scan::global): Use || instead of |.
13797
c121c671
DK
137982009-06-02 Doug Kwan <dougkwan@google.com>
13799
13800 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13801 issued_non_pic_error_.
13802 (class Target_arm::Scan): Declare new method check_non_pic.
13803 Define new method symbol_needs_plt_entry.
13804 Declare new data member issued_non_pic_error_.
13805 (class Target_arm::Relocate): Declare new method
13806 should_apply_static_reloc.
13807 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13808 (Target_arm::Scan::check_non_pic): Define new method.
13809 (Target_arm::Scan::local): Handle a small subset of reloc types used
13810 by Android.
13811 (Target_arm::Scan::local): Same.
13812 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13813
b19b0c6d
ILT
138142009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13815
13816 * incremental.cc (Incremental_inputs::report_command_line): Filter
13817 out --incremental-* options.
13818
94cdfcff
DK
138192009-05-29 Doug Kwan <dougkwan@google.com>
13820
13821 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13822 template class.
13823 (class Target_arm): Update comment.
13824 (Target_arm::Target_arm): Initialize new data members GOT_,
13825 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13826 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13827 and Target_arm::rel_dyn_section.
13828 Declare new_enum Target_arm::Got_type.
13829 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13830 and DYNBSS_.
13831 Update commments for member do_dynsym_value.
13832 (Target_arm::got_size, Target_arm::plt_section,
13833 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13834 new methods inside class defintion.
13835 (Target_arm::got_section): Define new method.
13836 (Target_arm::rel_dyn_section): Same.
13837 (Output_data_plt_arm): New template class.
13838 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13839 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13840 (Output_data_plt_arm::add_entry): Same.
13841 (Output_data_plt_arm::first_plt_entry): Define new
13842 static data member for PLT instruction template.
13843 (Output_data_plt_arm::plt_entry): Same.
13844 (Output_data_plt_arm::do_write): Define new method.
13845 (Target_arm::make_plt_entry): Same.
13846 (Target_arm::do_finalize_sections): Same.
13847 (Target_arm::do_dynsym_value): Same.
13848
4a657b0d
DK
138492009-05-28 Doug Kwan <dougkwan@google.com>
13850
13851 * Makefile.am (TARGETSOURCES): Add arm.cc.
13852 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13853 * Makefile.in: Regenerate.
13854 * arm.cc: New file.
13855 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13856
e7ae8c36
DK
138572009-05-26 Doug Kwan <dougkwan@google.com>
13858
13859 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13860 (General_options::check_excluded_libs): Strip off directories in
13861 archive name before matching like GNU ld does.
13862 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13863 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13864 (exclude_libs_test_LDFLAGS): Add linker option
13865 -Wl,--exclude-libs,libexclude_libs_test_3
13866 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13867 an explicit archive without using -l.
13868 (alt/libexclude_libs_test_3.a): New make rule.
13869 * testsuite/Makefile.in: Regenerate.
13870 * testsuite/exclude_libs_test.c : Declare lib3_default().
13871 (main): Call it.
13872 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13873 * exclude_libs_test_3.c: New file.
13874
f12e7348
NC
138752009-05-26 Nick Clifton <nickc@redhat.com>
13876
13877 * po/id.po: New Indonesian translation.
13878 * po/gold.pot: Updated template file.
13879
4daadc0d
ST
138802009-05-22 Sriraman Tallam <tmsriram@google.com>
13881
e1df38aa 13882 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13883 gc_comdat_test files. Add -Wl,--gc-sections to build
13884 gc_comdat_test.
13885 * testsuite/Makefile.in: Regenerate.
13886 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13887
531813ad
ST
138882009-05-21 Sriraman Tallam <tmsriram@google.com>
13889
13890 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13891 kept comdat section was garbage collected.
13892 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13893 * testsuite/Makefile.in: Regenerate.
13894 * testsuite/gc_comdat_test.sh: New file.
13895 * testsuite/gc_comdat_test_1.cc: New file.
13896 * testsuite/gc_comdat_test_2.cc: New file.
13897
65514900
CC
138982009-05-19 Doug Kwan <dougkwan@google.com>
13899
13900 * archive.cc (Archive::Archive): Move constructor from archive.h
13901 to here. Initialize no_export_.
13902 (Archive::get_elf_object_for_member): Set no_export flag of object.
13903 * archive.h (Archive::Archive): Move constructor body to
13904 archive.cc.
13905 (Archive::no_export): New method.
13906 (Archive::no_export_): New field.
13907 * object.h (Object::Object): Initialize no_export_ to false.
13908 (Object::no_export, Object::set_no_export): New methods.
13909 (Object::no_export_): New field.
13910 * options.cc (General_options::parse_exclude_libs): New method.
13911 (General_options::check_excluded_libs) Same.
13912 * options.h (exclude_libs): New option.
13913 (General_options::check_excluded_libs): New method declaration.
13914 (General_options::excluded_libs_): New field.
13915 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13916 default or protected visibility if an object has no-export flag set.
13917 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13918 (check_SCRIPTS): Add exclude_libs_test.sh.
13919 (check_DATA): Add exclude_libs_test.syms.
13920 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13921 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13922 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13923 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13924 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13925 libexclude_libs_test_2.a): New rules.
13926 * testsuite/Makefile.in: Regenerate.
13927 * testsuite/exclude_libs_test.c: New file.
13928 * testsuite/exclude_libs_test.sh: Ditto.
13929 * testsuite/exclude_libs_test_1.c: Ditto.
13930 * testsuite/exclude_libs_test_2.c: Ditto.
13931
1b77ea50
ILT
139322009-05-15 Ian Lance Taylor <iant@google.com>
13933
13934 * configure.ac: Check for declarations for cases where libiberty.h
13935 checks HAVE_DECL_xxx.
13936 * configure, config.in: Rebuild.
13937
072fe7ce
ILT
139382009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13939
13940 * gold.h (Incremental_argument_list): Remove (invalid) forward
13941 declaration.
13942 * incremental.cc (Incremental_inputs::report_achive): New method.
13943 (Incremental_inputs::report_object): New method.
13944 (Incremental_inputs::report_script): New method.
13945 (Incremental_inputs::finalize_inputs): New method.
13946 (Incremental_inputs::finalize): Call finalize_inputs().
13947 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13948 Create inputs entries.
13949 * incremental.h (Incremental_input_type): New enum.
13950 (Incremental_inputs::Incremental_input): Initialize new fields.
13951 (Incremental_inputs::report_inputs): New method.
13952 (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::Input_info): New struct.
13957 (Incremental_inputs::Input_info_map): New typedef.
13958 (Incremental_inputs::lock_): New field.
13959 (Incremental_inputs::Inputs_): New field.
13960 (Incremental_inputs::Inputs_map): New field.
13961 * main.cc (main): Call Incremental_input::report_inputs.
13962 * options.h (Input_argument_list): Typedef moved from
13963 Input_arguments.
13964 (Input_file_group::Files): Remove, use ::Input_argument_list.
13965 (Input_file_group::Input_argument_list): Remove, use
13966 ::Input_argument_list.
13967 * plugin.cc (Plugin_manager::add_input_file): Add error in
13968 incremental build.
13969 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13970 functions.
13971 * script.cc (read_input_script): Call
13972 Incremental_input::report_script.
13973 * script.h (Script_info): New class.
13974
b0481b0b
ILT
139752009-04-27 Ian Lance Taylor <iant@google.com>
13976
13977 * x86_64.cc (do_adjust_output_section): Set entsize to
13978 plt_entry_size.
13979
b22a5a41 139802009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13981
13982 * output.cc (Output_file::close): After short writes, continue
13983 writing from the correct offset in the buffer being written.
13984
40fde488
CD
139852009-04-23 Chris Demetriou <cgd@google.com>
13986
13987 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13988 * configure: Regenerate.
13989 * config.in: Regenerate.
13990 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13991 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13992
3ce2c28e
ILT
139932009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13994
13995 * incremental.cc (Incremental_inputs_header_data): Renamed from
13996 Incremental_input_header_data.
13997 (Incremental_inputs_header_data::data_size): New field.
13998 (Incremental_inputs_header_data::put_input_file_count): Renamed
13999 from input_file_count.
14000 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14001 from command_line_offset.
14002 (Incremental_inputs_header_data::put_reserved): Renamed from
14003 put_reserved.
14004 (Incremental_inputs_entry_data): Renamed from
14005 Incremental_input_entry_data.
14006 (Incremental_inputs_entry_data::data_size): New field.
14007 (Incremental_inputs::report_command_line): New method.
14008 (Incremental_inputs::finalize): New method.
14009 (Incremental_inputs::create_incremental_inputs_data): New method.
14010 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14011 * incremental.h: New file.
14012 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14013 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14014 incremental builds.
703d02da 14015 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14016 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14017 (Layout::create_incremental_info_sections): New method.
14018 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14019 * main.cc (main): Notify Incremental_input of the command line.
14020
e55bde5e
ILT
140212009-04-01 Ian Lance Taylor <iant@google.com>
14022 Mikolaj Zalewski <mikolajz@google.com>
14023
14024 * gold.h (reserve_unordered_map): Define, three versions, one for
14025 each version of Unordered_map.
14026 * layout.cc (Layout::Layout): Remove options parameter. Add
14027 number_of_input_files parameter. Don't initialize options_.
14028 Initialize number_of_input_files_ and resized_signatures_. Move
14029 sections_are_attached_.
14030 (Layout::layout_group): Reserve space for group_signatures_.
14031 (Layout::find_or_add_kept_section): Change name parameter to be a
14032 reference. Resize signatures_ map when it gets large enough.
14033 (Layout::layout_eh_frame): Use parameters->options() instead of
14034 this->options_.
14035 (Layout::make_output_section): Likewise.
14036 (Layout::attach_allocated_section_to_segment): Likewise.
14037 (Layout::finalize, Layout::create_executable_stack): Likewise.
14038 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14039 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14040 * layout.h (class Layout): Update declarations. Remove options_
14041 field. Add number_of_input_files_ and resized_signatures_
14042 fields. Move sections_are_attached_ field.
14043 * main.cc (main): Pass number of input files to Layout
14044 constructor. Don't pass options.
14045
154b857c
ILT
140462009-03-30 Ian Lance Taylor <iant@google.com>
14047
14048 * ffsll.c (ffsll): Correct implementation.
14049
2f35ab9b
ILT
140502009-03-27 Ian Lance Taylor <iant@google.com>
14051
fd03461a
ILT
14052 * ffsll.c: New file.
14053 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14054 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14055 * ftruncate.c (ftruncate): Declare before definition.
14056 * mremap.c (mremap): Likewise.
14057 * pread.c (pread): Likewise.
14058 * configure, Makefile.in, config.in: Rebuild.
14059
2f35ab9b
ILT
14060 * mremap.c: New file.
14061 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14062 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14063 (mremap): Declare if HAVE_MREMAP is not defined.
14064 * configure, Makefile.in, config.in: Rebuild.
14065
33aea2fd
CC
140662009-03-27 Cary Coutant <ccoutant@google.com>
14067
14068 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14069 position independent.
14070 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14071 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14072
6d479619
CC
140732009-03-24 Cary Coutant <ccoutant@google.com>
14074
14075 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14076 an executable.
14077 (needs_dynamic_reloc): Likewise.
14078
afc06bb8
ILT
140792009-03-24 Ian Lance Taylor <iant@google.com>
14080
14081 * yyscript.y (file_cmd): Recognize EXTERN.
14082 (extern_name_list, extern_name_list_body): New nonterminals.
14083 * script.cc (script_add_extern): Define.
14084 * script-c.h (script_add_extern): Declare.
14085
f6060a4d
ILT
140862009-03-24 Rafael Avila de Espindola <espindola@google.com>
14087
14088 * object.cc (is_elf_object): Define.
14089 * object.h (is_elf_object): Declare.
14090 * archive.cc (Archive::get_elf_object_for_member): Call
14091 is_elf_object.
33aea2fd 14092 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14093
26736d8e
ILT
140942009-03-24 Elliott Hughes <enh@google.com>
14095
14096 * output.cc (Output_file::map_anonymous): Define.
14097 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14098 try an anonymous one. Report the size if the mmap fails.
14099 * output.h (class Output_file): Declare map_anonymous.
14100
22fd9730
ILT
141012009-03-24 Ian Lance Taylor <iant@google.com>
14102
14103 * target-select.cc (instantiate_target): Don't acquire the lock if
14104 the instantiated_target_ field has already been set.
14105
cb010894
ILT
141062009-03-23 Ian Lance Taylor <iant@google.com>
14107
7f055c20
ILT
14108 * gold-threads.h (class Initialize_lock): Define.
14109 * gold-threads.cc (class Initialize_lock_once): Define.
14110 (initialize_lock_control): New static variable.
14111 (initialize_lock_pointer): New static variable.
14112 (initialize_lock_once): New static function.
14113 (Initialize_lock::Initialize_lock): Define.
14114 (Initialize_lock::initialize): Define.
14115 * target-select.h: Include "gold-threads.h".
14116 (class Target_selector): Add lock_ and initialize_lock_ fields.
14117 Don't define instantiate_target, just declare it.
14118 * target-select.cc (Target_selector::Target_selector): Initialize
14119 new fields.
14120 (Target_selector::instantiate_target): Define.
14121 * descriptors.h: Include "gold-threads.h".
14122 (class Descriptors): Add initialize_lock_ field.
14123 * descriptors.cc (Descriptors::Descriptors): Initialize new
14124 field.
14125 (Descriptors::open): Use initialize_lock_ field
14126 * errors.h (class Errors): Add initialize_lock_ field.
14127 * errors.cc (Errors::Errors): Initialize new field.
14128 (Errors::initialize_lock): Use initialize_lock_ field.
14129 * powerpc.cc (class Target_selector_powerpc): Remove
14130 instantiated_target_ field. In do_recognize call
14131 instantiate_target rather than do_instantiate_target. In
14132 do_instantiate_target just allocate a new target.
14133 * sparc.cc (class Target_selector_sparc): Likewise.
14134
36959681
ILT
14135 * freebsd.h: New file.
14136 * i386.cc: Include "freebsd.h".
14137 (Target_i386): Derive from Target_freebsd rather than
14138 Sized_target.
14139 (Target_selector_i386): Derive from Target_selector_freebsd rather
14140 than Target_selector.
14141 * x86_64.cc: Include "freebsd.h".
14142 (Target_x86_64): Derive from Target_freebsd rather than
14143 Sized_target.
14144 (Target_selector_x86_64): Derive from Target_selector_freebsd
14145 rather than Target_selector.
14146 * target.h (class Target): Add adjust_elf_header and
14147 do_adjust_elf_header.
14148 * output.cc (Output_file_header:: do_sized_write): Call target
14149 adjust_elf_header routine.
14150 * configure.tgt: Set targ_osabi.
14151 * configure.ac: Define GOLD_DEFAULT_OSABI.
14152 * parameters.cc (Parameters::default_target): Pass
14153 GOLD_DEFAULT_OSABI to select_target.
14154 * target-select.h (class Target_selector): Make instantiate_target
14155 protected rather than private.
14156 * Makefile.am (HFILES): Add freebsd.h.
14157 * configure, Makefile.in, config.in: Rebuild.
14158
cb010894
ILT
14159 * merge.cc (do_add_input_section): Correct pend value. Change
14160 message about last entry not being null terminated from error to
14161 warning.
14162
0e879927
ILT
141632009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14164
14165 * incremental.cc: New file.
14166 * Makefile.am (CCFILES): Add incremental.cc.
14167 * Makefile.in: Rebuild.
14168
41105937
PP
141692009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14170
14171 * layout.cc (Layout::output_section_name): Preserve names
14172 of '.note.' sections.
e1df38aa 14173
60439920
ILT
141742009-03-19 Ian Lance Taylor <iant@google.com>
14175
14176 * descriptors.cc (Descriptors::open): Check that the options are
14177 valid before using them.
14178
0d371ad3
ILT
141792009-03-18 Ian Lance Taylor <iant@google.com>
14180
14181 * script-sections.h: Include <list>.
14182 (class Script_sections): Change Sections_elements from std::vector
14183 to std::list. Typedef public Elements_iterator. Add
14184 orphan_section_placement_, data_segment_align_start_, and
14185 saw_data_segment_align_ fields. Remove data_segment_align_index_
14186 field.
14187 * script-sections.cc (class Orphan_section_placement): New class.
14188 (class Sections_element): Add virtual functions is_relro and
14189 orphan_section_init. Remove virtual function place_orphan_here.
14190 (class Output_section_definition): Add is_relro and
14191 orphan_section_init. Remove place_orphan_here.
14192 (class Orphan_output_section): Likewise.
14193 (Script_sections::Script_sections): Update for field changes.
14194 (Script_sections::data_segment_align): Set saw_data_segment_align_
14195 and data_segment_align_start_, not data_segment_align_index.
14196 (Script_sections::data_segment_relro_end): Check
14197 saw_data_segment_align_. Use data_segment_align_start_ rather
14198 than data_segment_align_index_.
14199 (Script_sections::place_orphan): Rewrite to use
14200 Orphan_section_placement.
14201
9201d894
ILT
142022009-03-17 Ian Lance Taylor <iant@google.com>
14203
9c5b8369
ILT
14204 * archive.cc (Archive::add_symbols): Check for a version attached
14205 to the symbol name in the archive map.
14206 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14207 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14208 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14209 (ver_test_11.a): New target.
14210 * testsuite/Makefile.in: Rebuild.
14211
9201d894
ILT
14212 * configure.ac: Check for chsize and posix_fallocate. Replace
14213 ftruncate.
14214 * ftruncate.c: New file, from gnulib.
14215 * output.cc (posix_fallocate): Define dummy version if not
14216 HAVE_POSIX_FALLOCATE.
14217 (Output_file::map): Call posix_fallocate rather than lseek and
14218 write.
14219 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14220 * configure, Makefile.in, config.in: Rebuild.
14221
ef4ab7a8 142222009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14223
ef4ab7a8
PP
14224 * layout.h (Layout::create_note): Add section_name parameter.
14225 * layout.cc (Layout::create_note): Likewise.
14226 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14227
8c500701
ILT
142282009-03-17 Ian Lance Taylor <iant@google.com>
14229
e85b18e1
ILT
14230 * descriptors.cc: Include "options.h".
14231 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14232 (Descriptors::open): Always use O_CLOEXEC when opening a new
14233 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14234 then set FD_CLOEXEC.
14235
9efe6174
ILT
14236 * sparc.cc (class Target_sparc): Add has_got_section.
14237 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14238 make sure we have a GOT section.
14239
14240 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14241 (Target_sparc::Scan::local): Likewise.
14242 (Target_sparc::Scan::global): Likewise.
14243 (Target_sparc::Relocate::relocate): Likewise.
14244 (Target_sparc::Relocate::relocate_tls): Likewise.
14245
8c500701
ILT
14246 * symtab.cc (Symbol_table::define_default_version): New function,
14247 broken out of add_from_object.
14248 (Symbol_table::add_from_object): Call define_default_version.
14249 (Symbol_table::define_special_symbol): Add resolve_oldsym
14250 parameter. Change all callers. If the version for a symbol comes
14251 from a version script, resolve it with the symbol with the same
14252 name with no version. Also add the symbol without a version if
14253 appropriate.
14254 (do_define_in_output_data): If resolving with oldsym, don't delete
14255 sym.
14256 (do_define_in_output_segment): Likewise.
14257 (do_define_as_constant): Likewise.
14258 * symtab.h (class Symbol_table): Update declarations.
14259
f1ed28fb
ILT
142602009-03-13 Ian Lance Taylor <iant@google.com>
14261
15f8229b
ILT
14262 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14263 (Read_symbols::requeue): New function.
14264 (Read_symbols::do_read_symbols): If make_elf_object fails because
14265 the target type is not configured, and the file was searched for,
14266 issue a warning and retry with the next directory.
14267 (Add_symbols::run): If the file has an incompatible format, and
14268 it was searched for, requeue the Read_symbols task. On error,
14269 release the object.
14270 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14271 dirindex parameter to constructor. Change all callers. Declare
14272 incompatible_warning and requeue.
14273 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14274 input_argument_ and input_group_ fields. Add them to
14275 constructor. Change all callers.
14276 (class Read_script): Add dirindex_ field. Add it to constructor.
14277 Change all callers.
14278 * archive.cc (Archive::setup): Remove input_objects parameter.
14279 Change all callers.
14280 (Archive::get_file_and_offset): Likewise.
14281 (Archive::read_all_symbols): Likewise.
14282 (Archive::read_symbols): Likewise.
14283 (Archive::get_elf_object_for_member): Remove input_objects
14284 parameter. Add punconfigured parameter. Change all callers.
14285 (Archive::add_symbols): Change return type to bool. Check return
14286 value of include_member.
14287 (Archive::include_all_members): Likewise.
14288 (Archive::include_member): Change return type to bool. Return
14289 false if first included object has incompatible target. Set
14290 included_member_ field.
14291 (Add_archive_symbols::run): If add_symbols returns false, requeue
14292 Read_symbols task.
14293 * archive.h (class Archive): Add included_member_ field.
14294 Initialize it in constructor. Add input_file and searched_for
14295 methods. Update declarations.
14296 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14297 input_argument_ fields. Add them to constructor. Change all
14298 callers.
14299 * script.cc: Include "target-select.h".
14300 (class Parser_closure): Add skip_on_incompatible_target_ and
14301 found_incompatible_target_ fields. Add
14302 skip_on_incompatible_target parameter to constructor. Change all
14303 callers. Add methods skip_on_incompatible_target,
14304 clear_skip_on_incompatible_target, found_incompatible_target, and
14305 set_found_incompatible_target.
14306 (read_input_script): Add dirindex parameter. Change all callers.
14307 If parser finds an incompatible target, requeue Read_symbols
14308 task.
14309 (script_set_symbol): Clear skip_on_incompatible_target in
14310 closure.
14311 (script_add_assertion, script_parse_option): Likewise.
14312 (script_start_sections, script_add_phdr): Likewise.
14313 (script_check_output_format): New function.
14314 * script.h (read_input_script): Update declaration.
14315 * script-c.h (script_check_output_format): Declare.
14316 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14317 (ignore_cmd): Remove OUTPUT_FORMAT.
14318 * fileread.cc (Input_file::Input_file): Add explicit this.
14319 (Input_file::will_search_for): New function.
14320 (Input_file::open): Add pindex parameter. Change all callers.
14321 * fileread.h (class Input_file): Add input_file_argument method.
14322 Declare will_search_for. Update declarations.
14323 * object.cc (make_elf_object): Add punconfigured parameter.
14324 Change all callers.
14325 * object.h (class Object): Make input_file public. Add
14326 searched_for method.
14327 (make_elf_object): Update declaration.
14328 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14329 restart search.
14330 * dirsearch.h (class Dirsearch): Update declaration.
14331 * options.h (class General_options): Add --warn-search-mismatch.
14332 * parameters.cc (Parameters::is_compatible_target): New function.
14333 * parameters.h (class Parameters): Declare is_compatible_target.
14334 * workqueue.cc (Workqueue::add_blocker): New function.
14335 * workqueue.h (class Workqueue): Declare add_blocker.
14336
f1ed28fb
ILT
14337 * fileread.cc (Input_file::open): Remove options parameter.
14338 Change all callers.
14339 (Input_file::open_binary): Likewise.
14340 * script.cc (read_input_script): Likewise.
14341 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14342 options parameter from constructor. Change all callers.
14343 (class Read_script): Likewise.
14344 * fileread.h (class Input_file): Update declarations.
14345 * script.h (read_input_script): Update declaration.
14346
34dd024a
NC
143472009-03-10 Nick Clifton <nickc@redhat.com>
14348
14349 * po/es.po: New Spanish translation.
14350
6d71b17c
CC
143512009-03-06 Cary Coutant <ccoutant@google.com>
14352
14353 * options.cc (parse_short_option): Keep dash_z from registering itself.
14354
031cdbed
ILT
143552009-03-03 Ian Lance Taylor <iant@google.com>
14356
14357 PR 9918
14358 * target-reloc.h (relocate_section): Pass output_section to
14359 relocate.
14360 * i386.cc (Target_i386::should_apply_static_reloc): Add
14361 output_section parameter. Change all callers.
14362 (Target_i386::Relocate::relocate): Add output_section parameter.
14363 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14364 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14365 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14366 * testsuite/two_file_shared.sh: New script.
14367 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14368 (check_DATA): Add two_file_shared.dbg.
14369 (two_file_shared.dbg): New target.
14370 * testsuite/Makefile.in: Rebuild.
14371
15d5fa16
ILT
143722009-03-01 Ian Lance Taylor <iant@google.com>
14373
14374 * configure.ac: Check for byteswap.h.
14375 * configure: Rebuild.
14376 * config.in: Rebuild.
14377
8a4c0b0d
ILT
143782009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14379
14380 * layout.cc (Layout::find_or_add_kept_section): New function.
14381 (Layout::add_comdat): Removed.
14382 * layout.h (struct Kept_section): Move out of class Layout.
14383 Remove trailing underscores from field names. Add group_sections
14384 field. Rename group_ field to is_group. Change all uses.
14385 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14386 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14387 comdat_groups_ field.
14388 (Sized_relobj::include_section_group): Use
14389 find_or_add_kept_section and Kept_section::group_sections.
14390 (Sized_relobj::include_linkonce_section): Likewise.
14391 * object.cc (class Sized_relobj): Don't define Comdat_group or
14392 Comdat_group_table. Remove find_comdat_group and
14393 add_comdat_group. Remove comdat_groups_ field.
14394 * plugin.cc (include_comdat_group): Use
14395 Layout::find_or_add_kept_section.
14396
b4ecf66b
ILT
143972009-02-28 Ian Lance Taylor <iant@google.com>
14398
14359ca0
ILT
14399 * README: --gc-sections and map files are now supported. Document
14400 some build requirements.
14401
b4ecf66b
ILT
14402 PR 6992
14403 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14404 relocatable link set the value of the section symbol to zero.
14405 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14406 relocatable link don't include the section address in the local
14407 symbol value.
14408
0602e05a
ILT
144092009-02-27 Ian Lance Taylor <iant@google.com>
14410
fd9d194f
ILT
14411 PR 6811
14412 * options.h (class Search_directory): Add is_system_directory.
14413 (class General_options): Declare is_in_system_directory.
14414 * options.cc (get_relative_sysroot): Make static.
14415 (get_default_sysroot): Make static.
14416 (General_optoins::is_in_system_directory): New function.
14417 * fileread.cc (Input_file::is_in_system_directory): New function.
14418 * fileread.h (class Input_file): Declare is_in_system_directory.
14419 * object.h (class Object): Add is_in_system_directory.
14420 (class Input_objects): Remove system_library_directory_ field.
14421 * object.cc (Input_objects::add_object): Don't set
14422 system_library_directory_.
14423 (input_objects::found_in_system_library_directory): Remove.
14424 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14425 parameter. Change all callers.
14426 (Symbol_table::sized_write_globals): Likewise.
14427 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14428 Call Object::is_in_system_directory.
14429 * symtab.h (class Symbol_table): Update declarations.
14430
61edd21f
ILT
14431 PR 5990
14432 * descriptors.h (Open_descriptor): Add is_on_stack field.
14433 * descriptors.cc (Descriptors::open): If the descriptor is on the
14434 top of the stack, remove it. Initialize is_on_stack field.
14435 (Descriptors::release): Only add pod to stack if it is not on the
14436 stack already.
14437 (Descriptors::close_some_descriptor): Clear stack_next and
14438 is_on_stack fields.
14439
e29e076a
ILT
14440 PR 7091
14441 * output.cc (Output_section::find_starting_output_address): Rename
14442 from starting_output_address; add PADDR parameter; change return
14443 type.
14444 * output.h (class Output_section): Declare
14445 find_starting_output_address instead of starting_output_address.
14446 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14447 section symbol for which we can't find a merge section.
14448
0602e05a
ILT
14449 PR 9836
14450 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14451 hidden or internal, force the symbol to be local.
14452 * resolve.cc (Symbol::override_visibility): Define.
14453 (Symbol::override_base): Use override_visibility.
14454 (Symbol_table::resolve): Likewise.
14455 (Symbol::override_base_with_special): Likewise.
14456 (Symbol_table::override_with_special): If the visibility is hidden
14457 or internal, force the symbol to be local.
14458 * symtab.h (class Symbol): Add set_visibility and
14459 override_visibility.
14460 * testsuite/ver_test_1.sh: New file.
14461 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14462 (check_DATA): Add ver_test_1.syms.
14463 (ver_test_1.syms): New target.
14464 * testsuite/Makefile.in: Rebuild.
14465
401a9a73
CC
144662009-02-25 Cary Coutant <ccoutant@google.com>
14467
14468 * layout.cc (Layout::choose_output_section): Don't rename sections
14469 when using a linker script that has a SECTIONS clause.
14470 * Makefile.in: Regenerate.
14471
14472 * testsuite/Makefile.am (script_test_5.sh): New test case.
14473 * testsuite/Makefile.in: Regenerate.
14474 * testsuite/script_test_5.cc: New file.
14475 * testsuite/script_test_5.sh: New file.
14476 * testsuite/script_test_5.t: New file.
14477
f488e4b0
CC
144782009-02-13 Rafael Avila de Espindola <espindola@google.com>
14479
14480 * archive.cc (Archive::include_member): Update calls to add_symbols.
14481 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14482 the Layout argument.
14483 * dynobj.h (do_add_symbols): Add the Layout argument.
14484 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14485 Layout argument.
14486 * object.h (Object::add_symbols): Add the Layout argument.
14487 (Object::do_add_symbols): Add the Layout argument.
14488 (Sized_relobj::do_add_symbols): Add the Layout argument.
14489 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14490 Unify the two versions.
14491 (Add_plugin_symbols): Remove.
14492 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14493 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14494 (Add_plugin_symbols): Remove.
14495 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14496 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14497 (Add_symbols::run): Make it work with Pulginobj.
14498
89dd1680
ILT
144992009-02-06 Ian Lance Taylor <iant@google.com>
14500
14501 * object.cc (Sized_relobj::do_layout): Make info message start
14502 with lower case letter.
14503
266d0a74
ILT
145042009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14505
602b464e
ILT
14506 * binary.cc: Fix file comment.
14507
266d0a74
ILT
14508 * options.h (enum Incremental_disposition): Define.
14509 (class General_options): Add new options: --incremental,
14510 --incremental_changed, --incremental_unchanged,
14511 --incremental_unknown. Add incremental_disposition_ and
14512 implicit_incremental_ fields.
14513 (General_options::incremental_disposition): New function.
14514 (class Position_dependent_options): Add incremental_disposition
14515 option.
14516 (Position_dependent_options::copy_from_options): Set incremental
14517 dispositions.
14518 * options.cc (General_options::parse_incremental_changed): New
14519 function.
2e702c99
RM
14520 (General_options::parse_incremental_unchanged): New function.
14521 (General_options::parse_incremental_unknown): New function.
14522 (General_options::General_options): Initialize new fields
266d0a74 14523 incremental_disposition_ and implicit_incremental_.
2e702c99 14524 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14525 without --incremental.
14526
f073bbf7
CD
145272009-02-06 Chris Demetriou <cgd@google.com>
14528
14529 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14530 pointer and to report location as the file name associated with
14531 the symbol.
14532 (gold_undefined_symbol_at_location): New function to replace the
14533 old gold_undefined_symbol functionality.
14534 * target-reloc.h (relocate_section): Update to use
14535 gold_undefined_symbol_at_location.
14536 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14537 Call gold_undefined_symbol function rather than gold_error.
14538 * errors.h (Errors::undefined_symbol): Take location as a
14539 string, rather than calculating it from a relocation.
14540 * errors.cc (Errors::fatal): Print "fatal error:" before the
14541 formatted message.
14542 (Errors::error, Errors::error_at_location): Print "error: "
14543 before the formatted message.
14544 (Errors::undefined_symbol): Take location as a string, rather
14545 than calculating it from a relocation.
14546 (gold_undefined_symbol_at_location): New function akin to
14547 old gold_undefined_symbol, calculates location from relocation.
14548 (gold_undefined_symbol): Change to take only a Symbol pointer
14549 and to report location as the file name associated with the symbol.
14550 * testsuite/debug_msg.sh: Update for changed error messages.
14551 * testsuite/undef_symbol.sh: Likewise.
14552
8e94a90c
ILT
145532009-02-04 Duncan Sands <baldrick@free.fr>
14554
14555 PR 9812
14556 * reduced_debug_output.h
14557 (Output_reduced_debug_abbrev_section::failed): Use format for
14558 gold_warning.
14559 (Output_reduced_debug_info_section::faild): Likewise.
14560
88a0e15b
ILT
145612009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14562
14563 * script.cc (Lazy_demangler): New class.
2e702c99 14564 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14565 symbol only once.
14566
5efc7cd2
CC
145672009-01-29 Cary Coutant <ccoutant@google.com>
14568
14569 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14570 to __tls_get_addr.
14571 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14572
e0ebcf42
ILT
145732009-01-28 Ian Lance Taylor <iant@google.com>
14574
5efc7cd2 14575 * version.cc (version_string): Bump to 1.9.
75fe7426 14576
e0ebcf42
ILT
14577 * gold.h: Include <cstring> and <stdint.h>.
14578 * version.cc: Include <cstdio>.
14579 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14580 warning.
14581 * reduced_debug_output.cc (insert_into_vector): Rename from
14582 Insert_into_vector; change all callers. Use Swap_unaligned to
14583 avoid aliasing issue; remove union since it is unnecessary.
14584
8e2813be 145852009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14586
14587 * Makefile.am (CCFILES): Add gc.cc.
14588 (HFILES): Add gc.h.
14589 * Makefile.in: Regenerate.
14590 * gold.cc (Gc_runner): New class.
14591 (queue_initial_tasks): Call garbage collection related tasks
14592 when corresponding options are invoked.
14593 (queue_middle_gc_tasks): New function.
14594 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14595 processed early before laying out sections during garbage collection.
14596 * gold.h (queue_middle_gc_tasks): New function.
14597 (is_prefix_of): Move from "layout.cc".
14598 * i386.cc (Target_i386::gc_process_relocs): New function.
14599 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14600 * main.cc (main): Create object of class "Garbage_collection".
14601 * object.cc (Relobj::copy_symbols_data): New function.
14602 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14603 (Sized_relobj::do_layout): Allow this function to be called twice
14604 during garbage collection and defer layout of section during the
6d03d481
ST
14605 first call.
14606 * object.h (Relobj::get_symbols_data): New function.
14607 (Relobj::is_section_name_included): New function.
14608 (Relobj::copy_symbols_data): New function.
14609 (Relobj::set_symbols_data): New function.
14610 (Relobj::get_relocs_data): New function.
14611 (Relobj::set_relocs_data): New function.
14612 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14613 (Relobj::gc_process_relocs): New function.
14614 (Relobj::do_gc_process_relocs): New pure virtual function.
14615 (Relobj::sd_): New data member.
14616 (Sized_relobj::is_output_section_offset_invalid): New function.
14617 (Sized_relobj::do_gc_process_relocs): New function.
14618 * options.h (General_options::gc_sections): Modify to not be a no-op.
14619 (General_options::print_gc_sections): New option.
14620 * plugin.cc (Plugin_finish::run): Remove function call to
14621 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14622 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14623 * reloc.cc (Read_relocs::run): Add task to process relocs and
14624 determine unreferenced sections when doing garbage collection.
14625 (Gc_process_relocs): New class.
14626 (Sized_relobj::do_gc_process_relocs): New function.
14627 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14628 sections that are garbage collected.
14629 * reloc.h (Gc_process_relocs): New class.
14630 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14631 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14632 symbols whose corresponding sections are garbage collected.
14633 (Symbol_table::Symbol_table): Add new parameter for the garbage
14634 collection object.
14635 (Symbol_table::gc_mark_undef_symbols): New function.
14636 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14637 (Symbol_table::gc_mark_dyn_syms): New function.
14638 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14639 as garbage.
14640 (Symbol_table::add_from_object): Likewise.
14641 (Symbol_table::add_from_relobj): When building shared objects, do not
14642 treat externally visible symbols as garbage.
14643 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14644 table information for static and relocatable links.
14645 * symtab.h (Symbol_table::set_gc): New function.
14646 (Symbol_table::gc): New function.
14647 (Symbol_table::gc_mark_undef_symbols): New function.
14648 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14649 (Symbol_table::gc_mark_dyn_syms): New function.
14650 (Symbol_table::gc_): New data member.
e1df38aa 14651 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14652 function.
14653 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14654 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14655
3b293544
CF
146562009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14657
14658 * options.h (General_options::gc_sections): Define as a no-op for now.
14659 (General_options::no_keep_memory): Ditto.
14660 (General_options::Bshareable): Define.
14661 * options.cc (General_options::finalize): Honor -Bshareable.
14662
83d22aa8
AS
146632009-01-20 Andreas Schwab <schwab@suse.de>
14664
14665 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14666 read the value in the contents, since we don't use it. Use the
14667 template endianness when writing.
14668 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14669
cd536b21
AS
146702009-01-19 Andreas Schwab <schwab@suse.de>
14671
14672 * configure.tgt (powerpc64-*): Fix targ_obj.
14673
99e9a495
ILT
146742009-01-15 Ian Lance Taylor <iant@google.com>
14675
14676 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14677 local symbols when stripping all symbols.
14678
bbbfea06
CC
146792009-01-14 Cary Coutant <ccoutant@google.com>
14680
99e9a495 14681 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14682
0f7c0701
CC
146832009-01-14 Cary Coutant <ccoutant@google.com>
14684
14685 * archive.cc (Archive::get_elf_object_for_member): Remove call
14686 to File_read::claim_for_plugin.
14687 * descriptors.cc (Descriptors::open): Remove reference to
14688 is_claimed.
14689 (Descriptors::claim_for_plugin): Remove.
14690 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14691 (Descriptors::is_claimed): Remove.
14692 (claim_descriptor_for_plugin): Remove.
14693 * fileread.cc (File_read::claim_for_plugin): Remove.
14694 * fileread.h (File_read::claim_for_plugin): Remove.
14695 (File_read::descriptor): Reopen descriptor if necessary.
14696 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14697 (Plugin_manager::all_symbols_read): Add task parameter. Change
14698 all callers.
14699 (Plugin_manager::get_input_file): New function.
14700 (Plugin_manager::release_input_file): New function.
14701 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14702 corresponding data member.
14703 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14704 and pass to base constructor. Change all callers.
14705 (get_input_file, release_input_file): New functions.
14706 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14707 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14708 (Plugin_manager::all_symbols_read): Add task parameter.
14709 (Plugin_manager::get_input_file): New function.
14710 (Plugin_manager::release_input_file): New function.
14711 (Plugin_manager::task_): New data member.
14712 (Pluginobj::Pluginobj): Add filesize parameter.
14713 (Pluginobj::filename): New function.
14714 (Pluginobj::descriptor): New function.
14715 (Pluginobj::filesize): New function.
14716 (Pluginobj::filesize_): New data member.
14717 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14718 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14719 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14720
14721 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14722 with archive libraries.
14723 * testsuite/Makefile.in: Regenerate.
14724 * testsuite/plugin_test.c (struct sym_info): New type.
14725 (get_input_file, release_input_file): New static variables.
14726 (onload): Capture new transfer vector entries.
14727 (claim_file_hook): Stop reading at end of file according to filesize.
14728 Factor out parsing of readelf output into separate function.
14729 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14730 APIs and get the source file name from the symbol table. Convert
14731 source file name to corresponding object file name. Print info
14732 message when adding new input files.
14733 (parse_readelf_line): New function.
14734 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14735 * testsuite/plugin_test_2.sh: Likewise.
14736 * testsuite/plugin_test_3.sh: Likewise.
14737 * testsuite/plugin_test_4.sh: New test case.
14738
62a6d109
ILT
147392009-01-07 Ian Lance Taylor <iant@google.com>
14740
14741 * version.cc (version_string): Bump to 1.8.
14742
483620e8
CC
147432008-12-23 Cary Coutant <ccoutant@google.com>
14744
14745 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14746 * plugin.cc (Plugin_manager::finish): Rename as
14747 layout_deferred_objects. Move cleanup to separate function.
14748 (Plugin_manager::cleanup): New function.
14749 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14750 separately.
14751 * plugin.h (Plugin_manager::finish): Rename as
14752 layout_deferred_objects.
14753 (Plugin_manager::cleanup): New function.
14754 (Plugin_manager::cleanup_done): New field.
14755
d66a9eb3
CC
147562008-12-23 Cary Coutant <ccoutant@google.com>
14757
14758 * plugin.cc (is_visible_from_outside): New function.
14759 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14760 so we don't return "IR only" status for exported symbols or -r links.
14761
14762 * testsuite/Makefile.am (plugin_test_3): New test case.
14763 * testsuite/Makefile.in: Regenerate.
14764 * testsuite/plugin_test_3.sh: New file.
14765
5995b570
CC
147662008-12-22 Cary Coutant <ccoutant@google.com>
14767
14768 * object.cc (Sized_relobj::layout_section): New function.
14769 (Sized_relobj::do_layout): Defer layout of input sections until after
14770 plugin has provided replacement files.
14771 (Sized_relobj::do_layout_deferred_sections): New function.
14772 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14773 (Relobj::layout_deferred_sections): New function.
14774 (Relobj::do_layout_deferred_sections): New function.
14775 (Sized_relobj::do_layout_deferred_sections): New function.
14776 (Sized_relobj::layout_section): New function.
14777 (Sized_relobj::Deferred_layout): New structure.
14778 (Sized_relobj::deferred_layout_): New field.
14779 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14780 Change all callers. Layout deferred sections.
14781 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14782 references.
14783 (Plugin_hook::run): Move code from do_plugin_hook inline.
14784 (Plugin_hook::do_plugin_hook): Remove.
14785 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14786 (Plugin_manager::finish): Renamed, was cleanup.
14787 (Plugin_manager::should_defer_layout): New function.
14788 (Plugin_manager::add_deferred_layout_object): New function.
14789 (Plugin_manager::Deferred_layout_list): New type.
14790 (Plugin_manager::deferred_layout_objects_): New field.
14791 (Plugin_hook::do_plugin_hook): Remove.
14792
ee769c88
ILT
147932008-12-17 Ian Lance Taylor <iant@google.com>
14794
14795 * options.h (class General_options): Add --no case for
14796 --export-dynamic.
14797
abc8dcba
CC
147982008-12-16 Cary Coutant <ccoutant@google.com>
14799
14800 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14801 vector.
14802 (Plugin_manager::claim_file): Create plugin object even if
14803 plugin did not call the add_symbols callback.
14804 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14805 asking for more symbols than were added.
14806 * testsuite/Makefile.am (plugin_test_1): Add test case with
14807 no global symbols.
14808 (empty.syms): New target.
14809 * testsuite/Makefile.in: Regenerate.
14810 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14811 message. Don't call add_symbols if no globals.
14812 (all_symbols_read_hook): Don't provide replacement for empty
14813 claimed file.
14814
b0074644
ILT
148152008-12-12 Ian Lance Taylor <iant@google.com>
14816
68943102
ILT
14817 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14818 r_type == 0 for a local symbol with r_sym == 0.
14819 (scan_relocatable_relocs): Pass r_sym to
14820 local_non_section_strategy.
14821 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14822 r_sym parameter.
14823
b0074644
ILT
14824 * configure.ac: Update test for TLS descriptors: they are
14825 supported as of glibc 2.9.
14826 * configure: Rebuild.
14827
c2508178
ILT
148282008-12-11 Ian Lance Taylor <iant@google.com>
14829
14830 PR 7091
14831 * target-reloc.h (Default_scan_relocatable_relocs): For each
14832 function, map r_type == 0 to RELOC_DISCARD.
14833
2756a258
CC
148342008-12-10 Cary Coutant <ccoutant@google.com>
14835
14836 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14837 object to override a kept COMDAT group from a plugin object.
14838
bb6f53d3
ILT
148392008-12-09 Ian Lance Taylor <iant@google.com>
14840
fbc558e1
ILT
14841 PR 7088
14842 * yyscript.y (file_cmd): Handle INPUT.
14843
bb6f53d3
ILT
14844 * testsuite/initpri1.c: Change all declarations to be full
14845 prototypes by adding void, to avoid compiler warnings.
14846
4674ecfc
CC
148472008-12-05 Rafael Avila de Espindola <espindola@google.com>
14848
14849 * options.cc (General_options::parse_plugin_opt): New.
14850 (General_options::add_plugin): The argument now is just the filename.
14851 (General_options::add_plugin_option): New.
14852 * options.h (plugin_opt): New.
14853 (add_plugin): Change argument name.
14854 (add_plugin_option): New.
14855 * plugin.cc (Plugin::load): Don't parse the plugin option.
14856 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14857 (Plugin::add_option): New.
14858 (Plugin::args_): Change type.
14859 (Plugin::filename_): New.
14860 (Plugin_manager::add_plugin_option): New.
14861 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14862 * testsuite/Makefile.in: Regenerate.
14863
fd06b4aa
CC
148642008-12-05 Cary Coutant <ccoutant@google.com>
14865
14866 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14867 Handle --strip-lto-sections option.
14868 * options.h (strip_lto_sections): New option.
14869
6c52134c
CC
148702008-12-01 Cary Coutant <ccoutant@google.com>
14871
14872 * plugin.cc (ld_plugin_message): Change format parameter to const.
14873 Fix mismatch between new[] and delete.
14874
a45248e0
CC
148752008-11-14 Cary Coutant <ccoutant@google.com>
14876
14877 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14878 instead of -1U.
14879
c82fbeee
CS
148802008-11-05 Craig Silverstein <csilvers@google.com>
14881
14882 * options.cc (General_options::parse_dynamic_list): New function.
14883 * options.h (General_options): New flags dynamic_list,
14884 dynamic_list_data, dynamic_list_cpp_new, and
14885 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14886 (General_options::in_dynamic_list): New function.
14887 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14888 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14889 (Lex::can_continue_name): Likewise.
14890 (yylex): Likewise.
14891 (read_script_file): New parameter script_options.
14892 (read_dynamic_list): New function.
14893 (Script_options::define_dynamic_list): New function.
14894 (dynamic_list_keyword_parsecodes): New variable.
14895 (dynamic_list_keywords): New variable.
14896 * script.h (Script_options::define_dynamic_list): New function
14897 prototype.
14898 (read_dynamic_list): New function prototype.
14899 * symtab.cc (strprefix): New macro.
14900 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14901 dynamic_list_data, dynamic_list_cpp_new, and
14902 dynamic_list_cpp_typeinfo.
14903 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14904 (dynamic_list_expr): New rule.
14905 (dynamic_list_nodes): Likewise.
14906 (dynamic_list_node): Likewise.
14907 * testsuite/Makefile.am (dynamic_list): New test.
14908 * testsuite/Makefile.in: Regenerated.
14909 * testsuite/dynamic_list.t: New file.
14910 * testsuite/dynamic_list.sh: New file.
14911
e0bb29a5
CS
149122008-11-05 Craig Silverstein <csilvers@google.com>
14913
14914 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14915 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14916 (t11_last): Likewise.
14917 * testsuite/ver_test_6.c (main): Likewise.
14918
4e1e25e0
CC
149192008-10-07 Cary Coutant <ccoutant@google.com>
14920
14921 * options.c (General_options::finalize): Add check for -static and
14922 -shared.
14923 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14924 is not empty.
14925
92f03fcb
CC
149262008-10-02 Cary Coutant <ccoutant@google.com>
14927
14928 * plugin.cc (make_sized_plugin_object): Fix conditional
14929 compilation to work when not all targets are enabled.
14930
fbd8a257
CC
149312008-09-29 Cary Coutant <ccoutant@google.com>
14932
14933 * archive.cc (Archive::get_file_and_offset): Use filename instead
14934 of name to get library path.
14935 (Archive::include_member): Unlock external member of a thin archive.
14936
14937 * testsuite/Makefile.am (TEST_AR): New variable.
14938 (thin_archive_test_1): New test.
14939 (thin_archive_test_2): New test.
81636b3f
CC
14940 * testsuite/Makefile.in: Regenerate.
14941 * testsuite/thin_archive_main.cc: New file.
14942 * testsuite/thin_archive_test_1.cc: New file.
14943 * testsuite/thin_archive_test_2.cc: New file.
14944 * testsuite/thin_archive_test_3.cc: New file.
14945 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14946
eff45813
CC
149472008-09-29 Cary Coutant <ccoutant@google.com>
14948
14949 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14950 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14951 instead of -1U.
14952 (Sized_relobj::do_finalize_local_symbols): Likewise.
14953 (Sized_relobj::map_to_kept_section): Likewise.
14954 * object.h (Sized_relobj::invalid_address): New constant.
14955 (Sized_relobj::do_output_section_offset): Check for invalid_address
14956 and return -1ULL.
14957 * output.cc (Output_reloc::local_section_offset): Use constant
14958 invalid_address instead of -1U.
14959 (Output_reloc::get_address): Likewise.
14960 (Output_section::output_address): Change -1U to -1ULL.
14961 * output.h (Output_reloc::invalid_address): New constant.
14962 * reloc.cc (Sized_relobj::write_sections): Use constant
14963 invalid_address instead of -1U.
14964 (Sized_relobj::relocate_sections): Likewise.
14965 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14966 values for merge sections.
14967 * target-reloc.h (relocate_for_relocatable): Use constant
14968 invalid_address instead of -1U.
14969
89fc3421
CC
149702008-09-19 Cary Coutant <ccoutant@google.com>
14971
14972 Add plugin functionality for link-time optimization (LTO).
14973 * configure.ac (plugins): Add --enable-plugins option.
14974 * configure: Regenerate.
14975 * config.in: Regenerate.
14976 * Makefile.am (LIBDL): New variable.
14977 (CCFILES): Add plugin.cc.
14978 (HFILES): Add plugin.h.
14979 (ldadd_var): Add LIBDL.
14980 * Makefile.in: Regenerate.
14981
14982 * archive.cc: Include "plugin.h".
14983 (Archive::setup): Don't preread archive symbols when using a plugin.
14984 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14985 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14986 files.
14987 (Archive::include_member): Add symbols from plugin objects.
14988 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14989 * descriptors.cc (Descriptors::open): Check for file descriptors
14990 abandoned by plugins.
14991 (Descriptors::claim_for_plugin): New function.
14992 * descriptors.h (Descriptors::claim_for_plugin): New function.
14993 (Open_descriptor::is_claimed): New field.
14994 (claim_descriptor_for_plugin): New function.
14995 * fileread.cc (File_read::claim_for_plugin): New function.
14996 * fileread.h (File_read::claim_for_plugin): New function.
14997 (File_read::descriptor): New function.
14998 * gold.cc: Include "plugin.h".
14999 (queue_initial_tasks): Add task to call plugin hooks for generating
15000 new object files.
15001 * main.cc: Include "plugin.h".
15002 (main): Load plugin libraries.
15003 * object.h (Pluginobj): Declare.
15004 (Object::pluginobj): New function.
15005 (Object::do_pluginobj): New function.
15006 (Object::set_target): New function.
15007 * options.cc: Include "plugin.h".
15008 (General_options::parse_plugin): New function.
15009 (General_options::General_options): Initialize plugins_ field.
15010 (General_options::add_plugin): New function.
15011 * options.h (Plugin_manager): Declare.
15012 (General_options): Add --plugin option.
15013 (General_options::has_plugins): New function.
15014 (General_options::plugins): New function.
15015 (General_options::add_plugin): New function.
15016 (General_options::plugins_): New field.
15017 * plugin.cc: New file.
15018 * plugin.h: New file.
15019 * readsyms.cc: Include "plugin.h".
15020 (Read_symbols::do_read_symbols): Check for archive before checking
15021 for ELF file. Call plugin hooks to claim files.
15022 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15023 from a real object file; force override when processing replacement
15024 files.
15025 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15026 (Symbol::init_base_object): Likewise.
15027 (Symbol::init_base_output_data): Likewise.
15028 (Symbol::init_base_output_segment): Likewise.
15029 (Symbol::init_base_constant): Likewise.
15030 (Symbol::init_base_undefined): Likewise.
15031 (Symbol::output_section): Assert that object is not a plugin.
15032 (Symbol_table::add_from_pluginobj): New function.
15033 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15034 undefined.
15035 (Symbol_table::sized_write_globals): Likewise.
15036 (Symbol_table::add_from_pluginobj): Instantiate template.
15037 * symtab.h (Sized_pluginobj): Declare.
15038 (Symbol::in_real_elf): New function.
15039 (Symbol::set_in_real_elf): New function.
15040 (Symbol::in_real_elf_): New field.
15041 (Symbol_table::add_from_pluginobj): New function.
15042
15043 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15044 (LIBDL): New variable.
15045 (LDADD): Add LIBDL.
15046 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15047 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15048 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15049 (MOSTLYCLEANFILES): Likewise.
15050 * testsuite/Makefile.in: Regenerate.
15051 * testsuite/plugin_test.c: New file.
15052 * testsuite/plugin_test_1.sh: New file.
15053 * testsuite/plugin_test_2.sh: New file.
15054
de31bda5
ILT
150552008-09-16 Ian Lance Taylor <iant@google.com>
15056
9c2d0ef9
ILT
15057 * target-reloc.h (relocate_section): Check whether a symbol is
15058 defined by the ABI before reporting an undefined symbol error.
15059 * target.h (Target::is_defined_by_abi): Make parameter const.
15060 (Target::do_is_defined_by_abi): Likewise.
15061 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15062 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15063 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15064 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15065 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15066 * testsuite/Makefile.in: Rebuild.
15067
de31bda5
ILT
15068 * fileread.cc (make_view): Add casts to avoid warning.
15069
9fa33bee
AO
150702008-09-16 Alexandre Oliva <aoliva@redhat.com>
15071
15072 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15073 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15074
183fd0e3
AO
150752008-09-16 Alexandre Oliva <aoliva@redhat.com>
15076
15077 * options.h (General_options::output_is_executable): New.
15078 (General_options::output_is_pie): New.
15079 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15080 for shared libraries.
15081 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15082
7be8330a
CD
150832008-09-11 Chris Demetriou <cgd@google.com>
15084
15085 * options.h (origin): New -z option.
15086 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15087 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15088 in DT_FLAGS_1.
15089
a9caad02
CC
150902008-09-05 Cary Coutant <ccoutant@google.com>
15091
15092 * fileread.cc (File_read::make_view): Add check for attempt to map
15093 beyond end of file.
15094
ae6dce4d
CC
150952008-09-05 Cary Coutant <ccoutant@google.com>
15096
15097 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15098 explicit instantiations.
15099
d7ab2a47
KVH
151002008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15101
15102 PR gold/6858
15103 * options.cc (General_options::finalize): Allow undefined symbols
15104 in shlibs if linking -shared.
15105
15106 PR gold/6859
15107 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15108 symbols as not needing a dynsym entry.
15109
1e52a9c1
CS
151102008-08-20 Craig Silverstein <csilvers@google.com>
15111
15112 * fileread.cc (File_read::open): Do not lock the file unless it
15113 was successfully opened.
15114
d85c80a3
CC
151152008-08-14 Cary Coutant <ccoutant@google.com>
15116
15117 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15118 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15119 * testsuite/tls_test.cc (struct int128): 128-bit struct
15120 for testing TLS relocs with non-zero addend.
15121 (v12): New TLS variable.
15122 (t12): New test.
15123 (t_last): Add check for v12.
15124 * testsuite/tls_test.h (t12): New function.
15125 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15126
2d924fd9
ILT
151272008-08-13 Ian Lance Taylor <iant@google.com>
15128
15129 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15130 set tls_segment_ or relro_segment_.
15131 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15132 when appropriate.
15133 * output.h (Output_section::clear_is_relro): New function.
15134 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15135 sections specially even when output_data_ is empty.
15136 (Output_segment::maximum_alignment): When first section is relro,
15137 only force alignment for PT_LOAD segments.
15138 * script.cc (script_data_segment_align): New function.
15139 (script_data_segment_relro_end): New function.
15140 * script-c.h (script_data_segment_align): Declare.
15141 (script_data_segment_relro_end): Declare.
15142 * script-sections.h (class Script_sections): Declare
15143 data_segment_align and data_segment_relro_end. Add fields
15144 segment_align_index_ and saw_relro_end_.
15145 * script-sections.cc (class Sections_element): Add set_is_relro
15146 virtual function. Add new bool* parameter to place_orphan_here.
15147 Add get_output_section virtual function.
15148 (class Output_section_definition): Add set_is_relro. Add new
15149 bool* parameter to place_orphan_here. Add get_output_section.
15150 Add is_relro_ field.
15151 (Output_section_definition::Output_section_definition): Initialize
15152 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15153 and is_relro_ fields.
15154 (Output_section_definition::place_orphan_here): Add is_relro
15155 parameter.
15156 (Output_section_definition::set_section_addresses): Set relro for
15157 output section.
15158 (Output_section_definition::alternate_constraint): Likewise.
15159 (class Orphan_output_section): Add new bool* parameter to
15160 place_orphan_here. Add get_output_section.
15161 (Orphan_output_section::place_orphan_here): Add is_relro
15162 parameter.
15163 (Script_sections::Script_sections): Initialize
15164 data_segment_align_index_ and saw_relro_end_.
15165 (Script_sections::data_segment_align): New function.
15166 (Script_sections::data_segment_relro_end): New function.
15167 (Script_sections::place_orphan): Set or clear is_relro.
15168 (Script_sections::set_section_addresses): Force alignment of first
15169 TLS section.
15170 * yyscript.y (exp): Call script_data_segment_align and
15171 script_data_segment_relro_end.
15172 * testsuite/relro_script_test.t: New file.
15173 * testsuite/relro_test.cc (using_script): Declare.
15174 (t1, t2): Test using_script.
15175 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15176 (relro_script_test_SOURCES): Define.
15177 (relro_script_test_DEPENDENCIES): Define.
15178 (relro_script_test_LDFLAGS): Define.
15179 (relro_script_test_LDADD): Define.
15180 (relro_script_test.so): New target.
15181 * testsuite/Makefile.in: Rebuild.
15182
f827c9a9
CC
151832008-08-06 Cary Coutant <ccoutant@google.com>
15184
15185 * archive.cc (Archive::total_archives, Archive::total_members)
15186 (Archive::total_members_loaded): New variables.
15187 (Archive::setup): Add parameter. Add option to preread
15188 archive symbols.
15189 (Archive::read_armap): Add counter.
15190 (Archive::get_file_and_offset): New function.
15191 (Archive::get_elf_object_for_member): New function.
15192 (Archive::read_all_symbols): New function.
15193 (Archive::read_symbols): New function.
15194 (Archive::add_symbols): Add counters.
15195 (Archive::include_all_members): Use armap to find members if it's
15196 already built.
15197 (Archive::include_member): Skip reading symbols if already read.
15198 Factored code into Archive::get_file_and_offset and
15199 Archive::get_elf_object_for_member. Changed call to
15200 Mapfile::report_include_archive_member.
15201 (Archive::print_stats): New function.
15202 * archive.h: Declare Object and Read_symbols_data classes.
15203 (Archive::Archive): Add initializers for new members.
15204 (Archive::setup): Add parameter.
15205 (Archive::print_stats): New function.
15206 (Archive::total_archives, Archive::total_members)
15207 (Archive::total_members_loaded): New variables.
15208 (Archive::get_file_and_offset): New function.
15209 (Archive::get_elf_object_for_member): New function.
15210 (Archive::read_all_symbols): New function.
15211 (Archive::read_symbols): New function.
15212 (Archive::Archive_member): New class.
15213 (Archive::members_): New member.
15214 (Archive::num_members_): New member.
15215 * main.cc: Include archive.h.
15216 (main): Call Archive::print_stats.
15217 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15218 archive parameter; member_name is now the fully-decorated name.
15219 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15220 * options.h: (General_options): Add --preread-archive-symbols option.
15221 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15222 Archive::setup.
15223
de4c45bd
ILT
152242008-08-04 Ian Lance Taylor <iant@google.com>
15225
15226 * symtab.h (Symbol::use_plt_offset): New function.
15227 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15228 * powerpc.cc (Relocate::relocate): Likewise.
15229 * sparc.cc (Relocate::relocate): Likewise.
15230 * x86_64.cc (Relocate::relocate): Likewise.
15231 * testsuite/weak_plt.sh: New test.
15232 * testsuite/weak_plt_main.cc: New test.
15233 * testsuite/weak_plt_shared.cc: New test.
15234 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15235 (check_PROGRAMS): Add weak_plt.
15236 (check_DATA): Add weak_plt_shared.so.
15237 (weak_plt_main_pic.o, weak_plt): New targets.
15238 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15239 * testsuite/Makefile.in: Rebuild.
15240
15241 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15242 gcctestdir/ld.
15243 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15244 * testsuite/Makefile.in: Rebuild.
15245
323ee3f4
AM
152462008-08-04 Alan Modra <amodra@bigpond.net.au>
15247
15248 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15249 * Makefile.in: Regenerate.
15250 * po/POTFILES.in: Regenerate.
15251
7c07ecec
ILT
152522008-07-29 Ian Lance Taylor <iant@google.com>
15253
15254 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15255 symbols before other symbols.
15256 * testsuite/script_test_2.cc (test_addr): Declare.
15257 (test_addr_alias): Declare.
15258 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15259 values.
7c07ecec
ILT
15260 * testsuite/script_test_2.t: Define test_addr_alias and
15261 test_addr.
15262
5778530e
ILT
152632008-07-24 Ian Lance Taylor <iant@google.com>
15264
2a00e4fb
ILT
15265 PR 5990
15266 * descriptors.cc: New file.
15267 * descriptors.h: New file.
15268 * gold-threads.h (class Hold_optional_lock): New class.
15269 * fileread.cc: Include "descriptors.h".
15270 (File_read::~File_read): Release descriptor rather than closing
15271 it.
15272 (File_read::open) [file]: Call open_descriptor rather than open.
15273 Set is_descriptor_opened_.
15274 (File_read::open) [memory]: Assert that descriptor is not open.
15275 (File_read::reopen_descriptor): New function.
15276 (File_read::release): Release descriptor.
15277 (File_read::do_read): Make non-const. Reopen descriptor.
15278 (File_read::read): Make non-const.
15279 (File_read::make_view): Reopen descriptor.
15280 (File_read::do_readv): Likewise.
15281 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15282 Update declarations.
15283 * layout.cc: Include "descriptors.h".
15284 (Layout::create_build_id): Use open_descriptor rather than open.
15285 * output.cc: Include "descriptors.h".
15286 (Output_file::open): Use open_descriptor rather than open.
15287 * archive.cc (Archive::const_iterator): Change Archive to be
15288 non-const.
15289 (Archive::begin, Archive::end): Make non-const.
15290 (Archive::count_members): Likewise.
15291 * archive.h (class Archive): Update declarations.
15292 * object.h (Object::read): Make non-const.
15293 * Makefile.am (CCFILES): Add descriptors.cc.
15294 (HFILES): Add descriptors.h.
15295 * Makefile.in: Rebuild.
15296
801647d1
ILT
15297 PR 6716
15298 * gold.h: Always include <clocale>. Add Solaris workarounds
15299 following code in binutils/sysdep.h.
15300
5edd166e
ILT
15301 PR 6048
15302 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15303 this->eh_frame_hdr_ is NULL before using it.
15304
c89ad728
ILT
15305 * dynobj.cc (Versions::Versions): Update comment.
15306
aa86f06b
ILT
15307 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15308 the base version name.
15309
5778530e
ILT
15310 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15311 array size plus one.
15312 (Stringpool_template::set_string_offsets): Subtract one from key
15313 before using it as an array index.
15314 (Stringpool_template::get_offset_with_length): Likewise.
15315 (Stringpool_template::write_to_buffer): Likewise.
15316 * stringpool.h (Stringpool_template::get_offset_from_key):
15317 Likewise.
15318
057ead22
ILT
153192008-07-23 Ian Lance Taylor <iant@google.com>
15320
7f649c59
ILT
15321 PR 6658
15322 * object.h (Merged_symbol_value::value): Do our best to handle a
15323 negative addend.
15324
057ead22
ILT
15325 PR 6647
15326 * script.cc (Version_script_info::get_versions): Don't add empty
15327 version tag to return value.
15328 (Version_script_info::get_symbol_version_helper): Change return
15329 type to bool. Add pversion parameter. Change all callers.
15330 (script_register_vers_node): Don't require a non-NULL tag.
15331 * script.h (class Version_script_info): Update declarations.
15332 (Version_script_info::get_symbol_version): Change return type to
15333 bool. Add version parameter. Change all callers.
15334 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15335 handling. Handle an empty version from a version script.
15336 (Symbol_table::define_special_symbol): Likewise.
15337 * testsuite/ver_test_10.script: New file.
15338 * testsuite/ver_test_10.sh: New file.
15339 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15340 (check_DATA): Add ver_test_10.syms.
15341 (ver_test_10.syms, ver_test_10.so): New target.
15342 * testsuite/Makefile.in: Rebuild.
15343
58e54ac2
CD
153442008-07-23 Simon Baldwin <simonb@google.com>
15345
15346 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15347 to zero for undefined symbols from dynamic libraries.
15348
95d14cd3
ILT
153492008-07-23 Ian Lance Taylor <iant@google.com>
15350
15351 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15352 Change all callers.
15353 * symtab.h (class Symbol_table): Update declaration.
15354 * testsuite/ver_test_9.cc: New file.
15355 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15356 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15357 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15358 (ver_test_9.so, ver_test_9.o): New targets.
15359 * testsuite/Makefile.in: Rebuild.
15360
92de84a6
ILT
153612008-07-22 Ian Lance Taylor <iant@google.com>
15362
34810851
ILT
15363 * options.h (class General_options): Define --check-sections.
15364 * layout.cc (Layout::set_segment_offsets): Handle
15365 --check-sections.
15366
af6156ef
ILT
15367 * options.h (class General_options): Define -n/--nmagic and
15368 -N/--omagic.
15369 * options.cc (General_options::finalize): For -n/--nmagic or
15370 -N/--omagic, set -static.
15371 * layout.cc (Layout::attach_allocated_section_to_segment): If
15372 -N/--omagic, don't put read-only and read-write sections in
15373 different segments.
15374 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15375 finding a read-only segment.
15376 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15377 don't set the minimum segment alignment to the common page size,
15378 and don't set the file offset to the address modulo the page size.
15379 * script-sections.cc (Script_sections::create_segments): If
15380 -n/--omagic, don't put read-only and read-write sections in
15381 different segments.
15382
92de84a6
ILT
15383 * cref.cc: New file.
15384 * cref.h: New file.
15385 * options.h (class General_options): Add --print-symbol-counts.
15386 * main.cc (main): Issue defined symbol report if requested.
15387 * archive.cc (Archive::interpret_header): Make into a const member
15388 function.
15389 (Archive::add_symbols): Call Input_objects::archive_start and
15390 archive_stop.
15391 (Archive::const_iterator): Define new class.
15392 (Archive::begin, Archive::end): New functions.
15393 (Archive::include_all_members): Rewrite to use iterator.
15394 (Archive::count_members): New function.
15395 * archive.h (class Archive): Update declarations.
15396 (Archive::filename): New function.
15397 * object.cc: Include "cref.h".
15398 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15399 (Sized_relobj::do_get_global_symbol_counts): New function.
15400 (Input_objects::add_object): Add object to cross-referencer.
15401 (Input_objects::archive_start): New function.
15402 (Input_objects::archive_stop): New function.
15403 (Input_objects::print_symbol_counts): New function.
15404 * object.h: Declare Cref and Archive.
15405 (Object::get_global_symbol_counts): New function.
15406 (Object::do_get_global_symbol_counts): New pure virtual function.
15407 (class Sized_relobj): Add defined_count_ field. Update
15408 declarations.
15409 (class Input_objects): Add cref_ field. Update constructor.
15410 Update declarations.
15411 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15412 defined_count_.
15413 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15414 symbol counts.
15415 (Sized_dynobj::do_get_global_symbol_counts): New function.
15416 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15417 defined_count_. Update declarations. Define Symbols typedef.
15418 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15419 parameter. Change all callers.
15420 (Symbol_table::add_from_dynobj): Add sympointers and defined
15421 parameters. Change all callers.
15422 * symtab.h (class Symbol_table): Update declarations.
15423 * Makefile.am (CCFILES): Add cref.cc.
15424 (HFILES): Add cref.h.
15425 * Makefile.in: Rebuild.
15426
3f7c5e1d
CD
154272008-07-22 Simon Baldwin <simonb@google.com>
15428
15429 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15430 to zero when writing undefined symbols.
15431
e0b64032
ILT
154322008-07-22 Ian Lance Taylor <iant@google.com>
15433
15434 * output.cc (Output_section::add_input_section): Don't try to
15435 merge empty merge sections.
15436
096b02cf
CS
154372008-07-21 Craig Silverstein <csilvers@google.com>
15438
15439 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15440 Include symbol version in error message.
cd536b21 15441
1d1f116d
CD
154422008-07-20 Chris Demetriou <cgd@google.com>
15443
cd536b21 15444 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15445 (RANDOM_SEED_CFLAGS): New substituted variable.
15446 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15447 * configure: Rebuild.
15448 * Makefile.in: Likewise.
15449 * testsuite/Makefile.in: Likewise.
15450
a18f591e
ILT
154512008-07-18 Ian Lance Taylor <iant@google.com>
15452
15453 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15454 where we see NAME/NULL and NAME/VERSION as separate symbols.
15455 * testsuite/ver_test_main.cc (main): Call t4.
15456 (t4, t4_2a): Define.
15457 * testsuite/ver_test_2.cc (t4_2): Define.
15458 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15459 * testsuite/ver_test_4.cc (t4_2a): Define.
15460 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15461 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15462
c6e3f6ed
ILT
154632008-07-17 Ian Lance Taylor <iant@google.com>
15464
15465 * dynobj.cc (Versions::add_def): If we give an error about a
15466 missing version, go ahead and create the version anyhow.
15467
ef9beddf
ILT
154682008-07-10 Ian Lance Taylor <iant@google.com>
15469
15470 Handle output sections with more than 0x7fffffff bytes.
15471 * object.h (class Relobj): Change map_to_output_ to
15472 output_sections_, and just keep a section pointer. Change all
15473 uses. Move comdat group support to Sized_relobj.
15474 (Relobj::is_section_specially_mapped): Remove.
15475 (Relobj::output_section): Remove poff parameter. Change all
15476 callers.
15477 (Relobj::output_section_offset): New function.
15478 (Relobj::set_section_offset): Rewrite.
15479 (Relobj::map_to_output): Remove.
15480 (Relobj::output_sections): New function.
15481 (Relobj::do_output_section_offset): New pure virtual function.
15482 (Relobj::do_set_section_offset): Likewise.
15483 (class Sized_relobj): Add section_offsets_ field. Add comdat
15484 group support from Relobj. Update declarations.
15485 (Sized_relobj::get_output_section_offset): New function.
15486 (Sized_relobj::do_output_section_offset): New function.
15487 (Sized_relobj::do_set_section_offset): New function.
15488 * object.cc (Relobj::output_section_address): Remove.
15489 (Sized_relobj::Sized_relobj): Initialize new fields.
15490 (Sized_relobj::include_section_group): Cast find_kept_object to
15491 Sized_relobj.
15492 (Sized_relobj::include_linkonce_section): Likewise.
15493 (Sized_relobj::do_layout): Use separate arrays for output section
15494 and output offset.
15495 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15496 output_sections.
15497 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15498 output_sections and section_offsets.
15499 (Sized_relobj::write_local_symbols): Likewise.
15500 (map_to_kept_section): Compute output address directly.
15501 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15502 output_sections and section_offsets.
15503 (Sized_relobj::write_sections): Likewise.
15504 (Sized_relobj::relocate_sections): Likewise.
15505 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15506 * output.h (class Output_reloc): Update declarations. Change
15507 u2_.relobj to Sized_relobj*.
15508 (class Output_data_reloc): Change add functions to use
15509 Sized_relobj*.
15510 * output.cc (Output_reloc::Output_reloc): Change relobj to
15511 Sized_relobj*.
15512 (Output_reloc::local_section_offset): Change return type to
15513 Elf_Addr. Use get_output_section_offset.
15514 (Output_reloc::get_address): Likewise.
15515 (Output_section::is_input_address_mapped): Don't call
15516 is_section_specially_mapped.
15517 (Output_section::output_offset): Likewise.
15518 (Output_section::output_address): Likewise.
15519 (Output_section::starting_output_address): Likewise.
15520 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15521 parameter to Sized_relobj*.
15522 (Copy_relocs::need_copy_reloc): Likewise.
15523 (Copy_relocs::save): Likewise.
15524 * copy-relocs.h (class Copy_relocs): Update declarations.
15525 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15526 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15527 * target-reloc.h (relocate_for_relocatable): Change
15528 offset_in_output_section type to Elf_Addr. Change code that uses
15529 it as well.
15530 * layout.cc (Layout::layout): Always set *off.
15531 * mapfile.cc (Mapfile::print_input_section): Use
15532 output_section_offset.
15533 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15534 Sized_relobj*.
15535 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15536 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15537 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15538
5cb66f97
ILT
155392008-07-03 Ian Lance Taylor <iant@google.com>
15540
15541 * layout.cc (Layout::include_section): Do not discard unrecognized
15542 SHT_STRTAB sections.
15543
afe47622
CS
155442008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15545
15546 * script.cc (Lex::can_continue_name): Make '?' allowable in
15547 version-script names.
15548 * testsuite/version_script.map: Change glob pattern to use '?'
15549
5adf9721
ILT
155502008-06-30 Manish Singh <yosh@gimp.org>
15551
15552 PR 6585
15553 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15554 Correct typo.
15555
e6fde208
ILT
155562008-06-30 Ian Lance Taylor <iant@google.com>
15557
15558 PR 6660
15559 PR 6682
15560 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15561 versions]: Don't try to read the value in the contents, since we
15562 don't use it. Use the template endianness when writing.
15563
3f2e6a2d
CC
155642008-06-25 Cary Coutant <ccoutant@google.com>
15565
15566 * fileread.cc (File_read::make_view): Assert on zero-length view.
15567 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15568 symbol table when there are no symbols to read.
15569
c43d3a48
CS
155702008-06-23 Craig Silverstein <csilvers@google.com>
15571
15572 * version.cc (version_string): Bump to 1.7
15573
5f494ea0
CS
155742008-06-18 Craig Silverstein <csilvers@google.com>
15575
15576 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15577 constant 0xFFFF to type Valtype.
15578 (Powerpc_relocate_functions::rel16_ha): Likewise.
15579
c42e122e
ILT
155802008-06-17 Ian Lance Taylor <iant@google.com>
15581
f34787f8
ILT
15582 * output.h (Output_section::Input_section): Initialize p2align_ to
15583 zero for Output_section_data constructors.
15584 (Output_section::Input_section::addralign): If not an input
15585 section, return the alignment of the Output_section_data.
15586 * testsuite/copy_test.cc: New file.
15587 * testsuite/copy_test_1.cc: New file.
15588 * testsuite/copy_test_2.cc: New file.
15589 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15590 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15591 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15592 (copy_test_1_pic.o, copy_test_1.so): New targets.
15593 (copy_test_2_pic.o, copy_test_2.so): New targets.
15594 * testsuite/Makefile.in: Rebuild.
15595
c42e122e
ILT
15596 * script-sections.cc (Script_sections::place_orphan): Initialize
15597 local variable exact.
15598
ce3ac18a
DE
155992008-06-13 David Edelsohn <edelsohn@gnu.org>
15600
15601 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15602
42cacb20
DE
156032008-06-12 David Edelsohn <edelsohn@gnu.org>
15604 David S. Miller <davem@davemloft.net>
15605
15606 * powerpc.cc: New file.
15607 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15608 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15609 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15610 * Makefile.in: Rebuild.
15611
7b308235
ILT
156122008-06-09 Ian Lance Taylor <iant@google.com>
15613
15614 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15615 <exception>.
15616 (throwing, orig_terminate): New static variables.
15617 (terminate_handler): New static function.
15618 (t2): Set terminate handler.
15619
f0b886e3
ILT
156202008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15621
15622 PR 6584
cd536b21 15623 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15624 alignment.
15625
3e90f135
CC
156262008-05-30 Cary Coutant <ccoutant@google.com>
15627
15628 * archive.cc (Archive::include_all_members) Correct to step
15629 over symbol table and extended name table in thin archives.
15630
e09ad04a
ILT
156312008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15632
15633 PR 6407
15634 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15635 calculation.
15636
62b01cb5
ILT
156372008-05-28 Caleb Howe <cshowe@google.com>
15638
15639 * reduced_debug_output.cc: New file.
15640 * reduced_debug_output.h: New file.
92de84a6 15641 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15642 * options.cc (General_options::finalize): Add strip_debug_non_line
15643 to the strip heirarchy.
15644 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15645 fields.
15646 * layout.cc: Include "reduced_debug_output.h".
15647 (Layout::Layout): Initialize new fields.
15648 (line_only_debug_sections): New static array.
15649 (is_lines_only_debug_sections): New static inline function.
15650 (Layout::include_section): Handle --strip-debug-non-line.
15651 (Layout::make_output_section): If --strip-debug-non-line, build
15652 new output sections for .debug_abbrev and .debug_info.
15653 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15654 gold. Warn about possible overflow.
15655 (read_signed_LEB_128): Likewise.
15656 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15657 (read_signed_LEB_128): Declare.
15658 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15659 (HFILES): Add reduced_debug_output.h.
15660 * Makefile.in: Rebuild.
15661
7d9e3d98
ILT
156622008-05-21 Ian Lance Taylor <iant@google.com>
15663
15664 * mapfile.cc: New file.
15665 * mapfile.h: New file.
15666 * options.h (class General_options): Add -M/--print-map and -Map.
15667 * options.cc (General_options::finalize): Make -M equivalent to
15668 -Map -.
15669 * main.cc: Include <cstdio> and "mapfile.h".
15670 (main): Open mapfile if requested.
15671 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15672 constructor. Change caller.
15673 (queue_initial_tasks): Add mapfile parameter. Change caller.
15674 (queue_middle_tasks): Likewise.
15675 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15676 declarations.
15677 * archive.cc: Include "mapfile.h".
15678 (Archive::add_symbols): Add mapfile parameter. Change all
15679 callers. Pass mapfile, symbol, and reason to include_member.
15680 (Archive::include_all_members): Add mapfile parameter. Change all
15681 callers.
15682 (Archive::include_member): Add mapfile, sym, and why parameters.
15683 Change all callers. Report inclusion to map file.
15684 * archive.h: Include "fileread.h".
15685 (class Archive): Update declarations.
15686 (Archive::file): New const method.
15687 (class Add_archive_symbols): Add mapfile_ field. Update
15688 constructor. Change all callers.
15689 * readsyms.h (class Read_symbols): Likewise.
15690 (class Finish_group): Likewise.
15691 (class Read_script): Likewise.
15692 * common.cc: Include "mapfile.h".
15693 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15694 all callers.
15695 (Symbol_table::do_allocate_commons): Likewise.
15696 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15697 symbol allocation to mapfile.
15698 * common.h (class Allocate_commons_task): Add mapfile_ field.
15699 Update constructor. Change all callers.
15700 * symtab.h (class Symbol_table): Update declarations.
15701 * layout.cc: Include "mapfile.h".
15702 (Layout_task_runner::run): Print information to mapfile.
15703 (Layout::create_gold_note): Change Output_data_fixed_space to
15704 Output_data_zero_fill.
15705 (Layout::create_build_id): Likewise.
15706 (Layout::print_to_mapfile): New function.
15707 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15708 constructor. Change caller.
15709 (class Layout): Declare print_to_mapfile.
15710 * output.cc (Output_section::Input_section::print_to_mapfile): New
15711 function.
15712 (Output_section::add_input_section): If producing a map, always
15713 add to input_sections_ list.
15714 (Output_section::do_print_to_mapfile): New function.
15715 (Output_segment::print_sections_to_mapfile): New function.
15716 (Output_segment::print_section_list_to_mapfile): New function.
15717 * output.h: Include "mapfile.h".
15718 (Output_data::print_to_mapfile): New function.
15719 (Output_data::do_print_to_mapfile): New virtual function.
15720 (Output_segment_headers::do_print_to_mapfile): New function.
15721 (Output_file_header::do_print_to_mapfile): New function.
15722 (Output_data_const::do_print_to_mapfile): New function.
15723 (class Output_data_const_buffer): Add map_name_ field. Update
15724 constructor. Change all callers. Add do_print_to_mapfile
15725 function.
15726 (class Output_data_fixed_space): Likewise.
15727 (class Output_data_space): Likewise.
15728 (class Output_data_zero_fill): New class.
15729 (Output_data_strtab::do_print_to_mapfile): New function.
15730 (Output_data_reloc_base::do_print_to_mapfile): New function.
15731 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15732 (Output_data_group::do_print_to_mapfile): New function.
15733 (Output_data_got::do_print_to_mapfile): New function.
15734 (Output_data_dynamic::do_print_to_mapfile): New function.
15735 (Output_symtab_xindex::do_print_to_mapfile): New function.
15736 (class Output_section): Declare do_print_to_mapflie. Declare
15737 print_to_mapfile in Input_section.
15738 (class Output_segment): Declare new functions.
15739 * object.h (Sized_relobj::symbol_count): New function.
15740 * script-sections.cc
15741 (Output_section_element_dot_assignment::set_section_addresses):
15742 Change Output_data_fixed_space to Output_data_zero_fill.
15743 (Output_data_expression::do_print_to_mapfile): New function.
15744 * script.cc (read_input_script): Add mapfile parameter. Change
15745 all callers.
15746 * script.h (read_input_script): Update declaration.
15747 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15748 (Eh_frame::do_print_to_mapfile): New function.
15749 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15750 (Output_merge_string::do_print_to_mapfile): New function.
15751 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15752 function.
15753 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15754 function.
15755 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15756 function.
15757 * Makefile.am (CCFILES): Add mapfile.cc.
15758 (HFILES): Add mapfile.h.
15759 * Makefile.in: Rebuild.
15760
9f1d377b
ILT
157612008-05-19 Ian Lance Taylor <iant@google.com>
15762
15763 * options.h (class General_options): Add -z relro.
15764 * layout.cc (Layout::Layout): Initialize relro_segment_.
15765 (Layout::add_output_section_data): Return the output section.
15766 (Layout::make_output_section): Rcognize relro sections and mark
15767 them appropriately.
15768 (Layout::attach_allocated_section_to_segment): Put relro sections
15769 in a PT_GNU_RELRO segment.
15770 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15771 section as relro.
15772 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15773 PT_TLS segments.
15774 (Layout::linkonce_mapping): Map d.rel.ro.local to
15775 .data.rel.ro.local.
15776 (Layout::output_section_name): Us .data.rel.ro.local for any
15777 section which begins with that.
15778 * layout.h (class Layout): Update add_output_section_data
15779 declaration. Add relro_segment_ field.
15780 * output.cc (Output_section::Output_section): Initialize is_relro_
15781 and is_relro_local_ fields.
15782 (Output_segment::add_output_section): Group relro sections.
15783 (Output_segment::is_first_section_relro): New function.
15784 (Output_segment::maximum_alignment): If there is a relro section,
15785 align the segment to the common page size.
15786 (Output_segment::set_section_addresses): Track whether we are
15787 looking at relro sections. If the last section is a relro
15788 section, align to the common page size.
15789 (Output_segment::set_section_list_addresses): Add in_relro
15790 parameter. Change all callers. Align to the page size when
15791 moving from relro to non-relro section.
15792 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15793 segment.
15794 * output.h (class Output_section): Add is_relro_ and
15795 is_relro_local_ fields.
15796 (Output_section::is_relro): New function.
15797 (Output_section::set_is_relro): New function.
15798 (Output_section::is_relro_local): New function.
15799 (Output_section::set_is_relro_local): New function.
15800 (class Output_segment): Update declarations.
15801 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15802 * sparc.cc (Target_sparc::got_section): Likewise.
15803 * x86_64.cc (Target_x86_64::got_section): Likewise.
15804 * testsuite/relro_test_main.cc: New file.
15805 * testsuite/relro_test.cc: New file.
15806 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15807 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15808 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15809 (relro_test.so, relro_test_pic.o): New targets.
15810 * testsuite/Makefile.in: Rebuild.
15811
a984ee1d
ILT
158122008-05-16 Ian Lance Taylor <iant@google.com>
15813
01676dcd
ILT
15814 * output.cc (Output_segment::add_output_section): Remove front
15815 parameter.
15816 * output.h (class Output_segment): Remove
15817 add_initial_output_section and overloaded add_output_section.
15818 Update declaration of remaining add_output_section.
15819 * layout.cc (Layout::create_interp): Call add_output_section
15820 rather than add_initial_output_section.
15821 (Layout::finish_dynamic_section): Likewise.
15822
497897f9
ILT
15823 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15824 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15825 know the dynamic type.
15826 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15827 field. Initialize it in constructor.
15828 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15829 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15830 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15831 reloc.
15832
a984ee1d
ILT
15833 * output.cc (Output_reloc::get_address): Change return type to
15834 Elf_Addr.
15835 * output.h (class Output_reloc): Update get_address declaration.
15836 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15837 for section addresses.
15838
55ba0940
ILT
158392008-05-09 Ian Lance Taylor <iant@google.com>
15840
15841 PR 6493
15842 * gold.cc (gold_nomem): Use return value of write.
15843
75517b77
ILT
158442008-05-08 Ian Lance Taylor <iant@google.com>
15845
15846 * symtab.c (Symbol::init_base_output_data): Add version
15847 parameter. Change all callers.
15848 (Symbol::init_base_output_segment): Likewise.
15849 (Symbol::init_base_constant): Likewise.
15850 (Symbol::init_base_undefined): Likewise.
15851 (Sized_symbol::init_output_data): Likewise.
15852 (Sized_symbol::init_output_segment): Likewise.
15853 (Sized_symbol::init_constant): Likewise.
15854 (Sized_symbol::init_undefined): Likewise.
15855 (Symbol_table::do_define_in_output_data): If the new symbol has a
15856 version, mark it as the default.
15857 (Symbol_table::do_define_in_output_segment): Likewise.
15858 (Symbol_table::do_define_as_constant): Likewise.
15859 * symtab.h (class Symbol): Update declarations.
15860 (class Sized_symbol): Likewise.
15861 * resolve.cc (Symbol::override_version): New function.
c42e122e 15862 (Symbol::override_base): Call override_version.
75517b77
ILT
15863 (Symbol::override_base_with_special): Likewise.
15864 * testsuite/ver_script_8.script: New file.
15865 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15866 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15867 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15868 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15869
f1f70eae
ILT
158702008-05-06 Ian Lance Taylor <iant@google.com>
15871
f3e9c5c5
ILT
15872 PR 6049
15873 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15874 functions.
15875 (class General_options): Remove existing --undefined, and add
15876 --no-undefined instead. Add new --undefined as synonym for -u.
15877 * archive.cc (Archive::add_symbols): Check whether symbol was
15878 named with -u.
15879 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15880 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15881 all uses. Add IS_UNDEFINED. Update declarations to split
15882 different versions of init_base. Declare init_base_undefined.
15883 (Symbol::is_defined): Handle IS_UNDEFINED.
15884 (Symbol::is_undefined): Likewise.
15885 (Symbol::is_weak_undefined): Call is_undefined.
15886 (Symbol::is_absolute): Handle IS_CONSTANT.
15887 (class Sized_symbol): Update declarations to split different
15888 versions of init. Declare init_undefined.
15889 (class Symbol_table): Declare new functions.
15890 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15891 Change all callers.
15892 (Symbol::init_base_output_data): Likewise.
15893 (Symbol::init_base_output_segment): Likewise.
15894 (Symbol::init_base_constant): Likewise.
15895 (Symbol::init_base_undefined): New function.
15896 (Sized_symbol::init_object): Rename from init. Change all
15897 callers.
15898 (Sized_symbol::init_output_data): Likewise.
15899 (Sized_symbol::init_output_segment): Likewise.
15900 (Sized_symbol::init_constant): Likewise.
15901 (Sized_symbol::init_undefined): New function.
15902 (Symbol_table::add_undefined_symbols_from_command_line): New
15903 function.
15904 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15905 function.
15906 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15907 (Symbol::output_section): Likewise.
15908 (Symbol::set_output_section): Likewise.
15909 (Symbol_table::sized_finalize_symbol): Likewise.
15910 (Symbol_table::sized_write_globals): Likewise.
15911 * resolve.cc (Symbol_table::should_override): Likewise.
15912 (Symbol::override_base_with_special): Likewise.
15913
8bdcdf2c
ILT
15914 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15915 symbol, change it to have default visibility.
15916 * testsuite/protected_1.cc: New file.
15917 * testsuite/protected_2.cc: New file.
15918 * testsuite/protected_3.cc: New file.
15919 * testsuite/protected_main_1.cc: New file.
15920 * testsuite/protected_main_2.cc: New file.
15921 * testsuite/protected_main_3.cc: New file.
15922 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15923 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15924 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15925 (protected_1.so): New target.
15926 (protected_1_pic.o, protected_2_pic.o): New targets.
15927 (protected_3_pic.o): New target.
15928 (check_PROGRAMS): Add protected_2.
15929 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15930 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15931 * testsuite/Makefile.in: Rebuild.
15932
2b706932
ILT
15933 * options.h (DEFINE_var): Add set_user_set_##varname__.
15934 (DEFINE_bool_alias): New macro.
15935 (class General_options): Define -Bstatic using DEFINE_bool_alias
15936 rather than DEFINE_special. Add --undefined as an alias for -z
15937 defs.
15938 * options.cc (General_options::parse_Bstatic): Remove.
15939
d82a5bcc
ILT
15940 * options.h (class General_options): Add --fatal-warnings.
15941 * main.cc (main): Implement --fatal-warnings.
15942 * errors.h (Errors::warning_count): New function.
15943
f1f70eae
ILT
15944 * options.h (class General_options): Add -Bsymbolic-functions.
15945 * symtab.h (Symbol::is_preemptible): Check for
15946 -Bsymbolic-functions.
15947
8825ac63
ILT
159482008-05-05 Ian Lance Taylor <iant@google.com>
15949
d98bc257
ILT
15950 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15951 as noVARNAME rather than no-VARNAME.
15952 (class General_options): Add option -z combreloc.
15953 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15954 get_address.
15955 (Output_reloc::sort_before) [SHT_REL]: New function.
15956 (Output_reloc::sort_before) [SHT_RELA]: New function.
15957 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15958 Sort_relocs_comparison.
15959 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15960 parameter. Change all callers.
15961 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15962 sort_relocs parameter. Change all callers.
15963 * output.cc (Output_reloc::get_address): New function, broken out
15964 of write_rel.
15965 (Output_reloc::write_rel): Call it.
15966 (Output_reloc::compare): New function.
15967 (Output_data_reloc_base::do_write): Optionally sort relocs.
15968
60b2b4e7
ILT
15969 * configure.ac: If targ_extra_obj is set, link it in.
15970 * configure.tgt: Initialize all variables.
15971 (x86_64*): Set targ_extra_obj and targ_extra_size.
15972 * configure: Rebuild.
15973
8825ac63
ILT
15974 * object.cc (Sized_relobj::include_section_group): Adjust section
15975 indexes read from group data. Build vector to pass to
15976 layout_group.
15977 * layout.cc (Layout::layout_group): Add flags and shndxes
15978 parameters. Remove contents parameter. Change caller. Update
15979 explicit instantiations.
15980 * layout.h (class Layout): Update layout_group declaration.
15981 * output.cc (Output_data_group::Output_data_group): Add flags and
15982 input_shndxes parameters. Remove contents parameter. Change
15983 caller.
15984 (Output_data_group::do_write): Change input_sections_ to
15985 input_shndxes_.
15986 * output.h (class Output_data_group): Update constructor
15987 declaration. Rename input_sections_ to input_shndxes_.
15988 * testsuite/many_sections_test.cc: Add template.
15989
e94cf127
CC
159902008-04-30 Cary Coutant <ccoutant@google.com>
15991
4418b2d5
CC
15992 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15993
e94cf127
CC
15994 * layout.cc (Layout::include_section): Refactored check for debug
15995 info section.
15996 (Layout::add_comdat): Add new parameters. Change type
15997 of signature parameter. Add object and shndx to signatures table.
15998 (Layout::find_kept_object): New function.
15999 * layout.h: Include <cstring>.
16000 (Layout::is_debug_info_section): New function.
16001 (Layout::add_comdat): Add new parameters.
16002 (Layout::find_kept_object): New function.
16003 (Layout::Kept_section): New struct.
16004 (Layout::Signatures): Change type of map range.
16005 * object.cc (Relobj::output_section_address): New function.
16006 (Sized_relobj::include_section_group): Add new parameters. Change
16007 calls to Layout::add_comdat. Change to build table of kept comdat
16008 groups and table mapping discarded sections to kept sections.
16009 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16010 (Sized_relobj::do_layout): Change calls to include_section_group and
16011 include_linkonce_section.
16012 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16013 value to zero when section is discarded.
16014 (Sized_relobj::map_to_kept_section): New function.
16015 * object.h (Relobj::output_section_address): New function.
16016 (Relobj::Comdat_group): New type.
16017 (Relobj::find_comdat_group): New function.
16018 (Relobj::Comdat_group_table): New type.
16019 (Relobj::Kept_comdat_section): New type.
16020 (Relobj::Kept_comdat_section_table): New type.
16021 (Relobj::add_comdat_group): New function.
16022 (Relobj::set_kept_comdat_section): New function.
16023 (Relobj::get_kept_comdat_section): New function.
16024 (Relobj::comdat_groups_): New field.
16025 (Relobj::kept_comdat_sections_): New field.
16026 (Symbol_value::input_value): Update comment.
16027 (Sized_relobj::map_to_kept_section) New function.
16028 (Sized_relobj::include_linkonce_section): Add new parameter.
16029 * target-reloc.h (Comdat_behavior): New type.
16030 (get_comdat_behavior): New function.
16031 (relocate_section): Add code to map a discarded section to the
16032 corresponding kept section when applying a relocation.
16033
e4e5049b
CS
160342008-04-30 Craig Silverstein <csilvers@google.com>
16035
16036 * dwarf_reader.cc (next_generation_count): New static var.
16037 (Addr2line_cache_entry): New struct.
16038 (addr2line_cache): New static var.
16039 (Dwarf_line_info::one_addr2line): Added caching.
16040 (Dwarf_line_info::clear_addr2line_cache): New function.
16041 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16042 cache-size parameter.
16043 (Dwarf_line_info::one_addr2line_cache): New function.
16044 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16045 new cache-size argument to one_addr2line(), and clear cache.
16046
d09e9154
CC
160472008-04-28 Cary Coutant <ccoutant@google.com>
16048
16049 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16050 R_386_PC8 relocations.
16051
7ef73768
ILT
160522008-04-23 Ian Lance Taylor <iant@google.com>
16053
55438702
ILT
16054 * object.cc (Sized_relobj::include_section_group): Check for
16055 invalid section group.
16056
c165fb93
ILT
16057 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16058 header size.
16059
7ef73768
ILT
16060 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16061 than read for file header.
16062 * archive.cc (Archive::include_member): Likewise.
16063
6194aaab
L
160642008-04-23 Paolo Bonzini <bonzini@gnu.org>
16065
16066 * aclocal.m4: Regenerate.
16067 * configure: Regenerate.
16068
d491d34e
ILT
160692008-04-19 Ian Lance Taylor <iant@google.com>
16070
5ea2bac6
ILT
16071 * version.cc (version_string): Bump to 1.6.
16072
7bc3e21a
ILT
16073 * testsuite/Makefile.am (many_sections_r_test): New target.
16074 (many_sections_r_test_SOURCES): Remove.
16075 (many_sections_r_test_DEPENDENCIES): Remove.
16076 (many_sections_r_test_LDFLAGS): Remove.
16077 (many_sections_r_test_LDADD): Remove.
16078
7fcd3aa9
ILT
16079 * object.cc (Sized_relobj::do_add_symbols): Always pass
16080 local_symbol_count_ to add_from_relobj.
16081
4c94d6ae
ILT
16082 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16083 every thousand variables.
16084 * testsuite/Makefile.in: Rebuild.
16085
d491d34e
ILT
16086 * object.cc (Xindex::initialize_symtab_xindex): New function.
16087 (Xindex::read_symtab_xindex): New function.
16088 (Xindex::sym_xindex_to_shndx): New function.
16089 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16090 available.
16091 (Sized_relobj::do_initialize_xindex): New function.
16092 (Sized_relobj::do_read_symbols): Adjust section links.
16093 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16094 parameter. Change all callers.
16095 (Sized_relobj::include_section_group): Adjust section links and
16096 symbol section indexes.
16097 (Sized_relobj::do_layout): Adjust section links.
16098 (Sized_relobj::do_count_local_symbols): Adjust section links and
16099 symbol section indexes.
16100 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16101 ordinary and special symbols.
16102 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16103 dynsym_xindex parameters. Change all callers. Adjust section
16104 links. Use SHN_XINDEX when needed.
16105 (Sized_relobj::get_symbol_location_info): Adjust section links.
16106 Don't get fooled by special symbols.
16107 * object.h (class Xindex): Define.
16108 (class Object): Add xindex_ parameter. Declare virtual functoin
16109 do_initialize_xindex.
16110 (Object::adjust_sym_shndx): New function.
16111 (Object::set_xindex): New protected function.
16112 (class Symbol_value): Add is_ordinary_shndx_ field.
16113 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16114 (Symbol_value::value): Assert ordinary section.
16115 (Symbol_value::initialize_input_to_output_map): Likewise.
16116 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16117 Change all callers.
16118 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16119 all callers.
16120 (class Sized_relobj): Update declarations.
16121 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16122 parameter. Change all callers.
16123 (Sized_relobj::adjust_shndx): New function.
16124 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16125 field.
16126 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16127 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16128 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16129 (Sized_dynobj::read_dynsym_section): Adjust section links.
16130 (Sized_dynobj::read_dynamic): Likewise.
16131 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16132 section links.
16133 (Sized_dynobj::do_initialize_xindex): New function.
16134 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16135 do_initialize_xindex.
16136 (Sized_dynobj::adjust_shndx): New function.
16137 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16138 dynsym_xindex_ fields.
16139 (Layout::finalize): Add a call to set_section_indexes before
16140 creating the symtab sections.
16141 (Layout::set_section_indexes): Don't do anything if the section
16142 already has a section index.
16143 (Layout::create_symtab_sections): Add shnum parameter. Change
16144 caller. Create .symtab_shndx section if needed.
16145 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16146 caller.
16147 (Layout::allocated_output_section_count): New function.
16148 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16149 needed.
16150 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16151 fields. Update declarations.
16152 (Layout::symtab_xindex): New function.
16153 (Layout::dynsym_xindex): New function.
16154 (class Write_symbols_task): Add layout_ field.
16155 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16156 Change caller.
16157 * output.cc (Output_section_headers::Output_section_headers): Add
16158 shstrtab_section parameter. Change all callers.
16159 (Output_section_headers::do_sized_write): Store overflow values
16160 for section count and section string table section index in
16161 section header zero.
16162 (Output_file_header::do_sized_write): Check for overflow of
16163 section count and section string table section index.
16164 (Output_symtab_xindex::do_write): New function.
16165 (Output_symtab_xindex::endian_do_write): New function.
16166 * output.h (class Output_section_headers): Add shstrtab_section_.
16167 Update declarations.
16168 (class Output_symtab_xindex): Define.
16169 (Output_section::has_out_shndx): New function.
16170 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16171 field.
16172 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16173 Change all callers.
16174 (Sized_symbol::init): Likewise.
16175 (Symbol::output_section): Check for ordinary symbol.
16176 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16177 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16178 callers.
16179 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16180 Change all callers. Simplify handling of symbols from sections
16181 not included in the link.
16182 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16183 distinction.
16184 (Weak_alias_sorter::operator()): Assert that symbols are
16185 ordinary.
16186 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16187 distinction.
16188 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16189 parameters. Change all callers.
16190 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16191 symbol distinction. Use SHN_XINDEX when needed.
16192 (Symbol_table::write_section_symbol): Add symtab_xindex
16193 parameter. Change all callers.
16194 (Symbol_table::sized_write_section_symbol): Likewise. Use
16195 SHN_XINDEX when needed.
16196 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16197 declarations.
16198 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16199 (Symbol::is_defined): Check is_ordinary.
16200 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16201 (Symbol::is_absolute, Symbol::is_common): Likewise.
16202 (class Sized_symbol): Update declarations.
16203 (class Symbol_table): Update declarations.
16204 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16205 parameters. Change all callers.
16206 (Sized_symbol::override): Likewise.
16207 (Symbol_table::override): Likewise.
16208 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16209 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16210 is_ordinary, and orig_st_shndx parameters. Change all callers.
16211 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16212 to be in an ordinary section.
16213 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16214 object and is_ordinary parameters. Change all callers.
16215 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16216 Change all callers. Don't add undefined or non-ordinary symbols
16217 to reloc_map_.
16218 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16219 Change all callers.
16220 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16221 declarations.
16222 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16223 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16224 (Sized_relobj::relocate_sections): Likewise.
16225 * target-reloc.h (scan_relocs): Adjust section symbol index.
16226 (scan_relocatable_relocs): Likewise.
16227 * i386.cc (Scan::local): Check for ordinary symbols.
16228 * sparc.cc (Scan::local): Likewise.
16229 * x86_64.cc (Scan::local): Likewise.
16230 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16231 to symbol_section_and_value.
16232 * testsuite/many_sections_test.cc: New file.
16233 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16234 (check_PROGRAMS): Add many_sections_test.
16235 (many_sections_test_SOURCES): Define.
16236 (many_sections_test_DEPENDENCIES): Define.
16237 (many_sections_test_LDFLAGS): Define.
16238 (BUILT_SOURCES): Add many_sections_define.h.
16239 (many_sections_define.h): New target.
16240 (BUILT_SOURCES): Add many_sections_check.h.
16241 (many_sections_check.h): New target.
16242 (check_PROGRAMS): Add many_sections_r_test.
16243 (many_sections_r_test_SOURCES): Define.
16244 (many_sections_r_test_DEPENDENCIES): Define.
16245 (many_sections_r_test_LDFLAGS): Define.
16246 (many_sections_r_test_LDADD): Define.
16247 (many_sections_r_test.o): New target.
16248 * testsuite/Makefile.in: Rebuild.
16249
c5818ff1
CC
162502008-04-17 Cary Coutant <ccoutant@google.com>
16251
16252 * errors.cc (Errors::info): New function.
16253 (gold_info): New function.
16254 * errors.h (Errors::info): New function.
16255 * gold.h (gold_info): New function.
16256 * object.cc (Input_objects::add_object): Print trace output.
16257 * options.cc (options::parse_set): New function.
16258 (General_options::parse_wrap): Deleted.
16259 (General_options::General_options): Deleted initializer.
16260 * options.h (options::String_set): New typedef.
16261 (options::parse_set): New function.
16262 (DEFINE_set): New macro.
16263 (General_options::wrap): Changed to use DEFINE_set. Changed
16264 callers of any_wrap_symbols and is_wrap_symbol.
16265 (General_options::trace, General_options::trace_symbol):
16266 New options.
16267 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16268 (General_options::wrap_symbols_): Deleted.
16269 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16270
b5be4a7c
DM
162712008-04-17 David S. Miller <davem@davemloft.net>
16272
16273 * options.cc (General_options::parse_V): New function.
16274 * options.h: Add entries for -V and -Qy.
16275
155a0dd7
ILT
162762008-04-17 Ian Lance Taylor <iant@google.com>
16277
16278 * common.cc (Symbol_table::allocate_commons): Remove options
16279 parameter. Change caller.
16280 (Symbol_table::do_allocate_commons): Remove options parameter.
16281 Change caller. Just call do_allocate_commons_list twice.
16282 (Symbol_table::do_allocate_commons_list): New function, broken out
16283 of do_allocate_commons.
16284 * common.h (class Allocate_commons_task): Remove options_ field.
16285 Update constructor.
16286 * symtab.cc (Symbol_table::Symbol_table): Initialize
16287 tls_commons_.
16288 (Symbol_table::add_from_object): Put TLS common symbols on
16289 tls_commons_ list.
16290 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16291 which are IN_OUTPUT_DATA.
16292 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16293 allocate_commons and do_allocate_commons declarations. Declare
16294 do_allocate_commons_list.
16295 * gold.cc (queue_middle_tasks): Update creation of
16296 Allocate_commons_task to not pass options.
16297 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16298 (TLS_TEST_C_FLAGS): New variable.
16299 (tls_test_c_pic.o): New target.
16300 (tls_test_shared.so): Link in tls_test_c_pic.o.
16301 (tls_test_c_pic_ie.o): New target.
16302 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16303 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16304 (tls_test_c.o): New target.
16305 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16306 (tls_pic_test_LDADD): Likewise.
16307 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16308 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16309 (tls_test_c_gnu2.o): New target.
16310 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16311 tls_test_c_gnu2.o.
16312 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16313 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16314 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16315 * testsuite/tls_test.cc: Include "config.h".
16316 (t_last): Call t11_last.
16317 * testsuite/tls_test.h (t11, t11_last): Declare.
16318 * testsuite/tls_test_c.c: New file.
16319 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16320 * configure.ac: Check for OpenMP support.
16321 * configure, config.in, Makefile.in: Rebuild.
16322 * testsuite/Makefile.in: Rebuild.
16323
edfbb029
CC
163242008-04-16 Cary Coutant <ccoutant@google.com>
16325
16326 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16327 (Target_i386::tls_base_symbol_defined_): New field.
16328 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16329 (Target_i386::Scan::global): Likewise.
16330 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16331 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16332 (Target_x86_64::tls_base_symbol_defined_): New field.
16333 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16334 (Target_x86_64::Scan::global): Likewise.
16335
f3c69fca
CC
163362008-04-16 Cary Coutant <ccoutant@google.com>
16337
16338 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16339 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16340 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16341 building shared libraries.
16342 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16343 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16344 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16345 * testsuite/Makefile.in: Rebuild.
16346 * testsuite/weak_undef.h: New file.
16347 * testsuite/weak_undef_file1.cc: Add extra test cases.
16348 * testsuite/weak_undef_file2.cc: Likewise.
16349 * testsuite/weak_undef_test.cc: Likewise.
16350
7c414435
DM
163512008-04-16 David S. Miller <davem@davemloft.net>
16352
32b769e1
DM
16353 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16354 Add issued_non_pic_error_ field. Declare check_non_pic.
16355 (Target_sparc::Scan::check_non_pic): New function.
16356 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16357 (Target_sparc::Scan::global): Likewise.
16358
11936fb1
DM
16359 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16360 * configure: Rebuild.
16361
7c414435
DM
16362 * options.h (DEFINE_enable): New macro.
16363 (new_dtags): New enable option.
16364 (initfirst, interpose, loadfltr, nodefaultlib,
16365 nodelete, nodlopen, nodump): New -z options.
16366 * layout.cc (Layout:finish_dynamic_section): If new
16367 dtags enabled, emit DT_RUNPATH. Also, emit a
16368 DT_FLAGS_1 containing any specified -z flags.
16369
85c7bf8b
ILT
163702008-04-16 Ian Lance Taylor <iant@google.com>
16371
12c0daef
ILT
16372 * copy-relocs.cc: New file.
16373 * copy-relocs.h: New file.
16374 * reloc.cc: Remove Copy_relocs code.
16375 * reloc.h: Likewise.
16376 * reloc-types.h (struct Reloc_types) [both versions]: Add
16377 get_reloc_addend_noerror.
16378 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16379 variants of add_global which take an addend which must be zero.
16380 * i386.cc: Include "copy-relocs.h".
16381 (class Target_i386): Change type of copy_relocs_ to variable,
16382 update initializer.
16383 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16384 Change all callers.
16385 (Target_i386::do_finalize_sections): Change handling of
16386 copy_relocs_.
16387 * sparc.cc: Include "copy-relocs.h".
16388 (class Target_sparc): Change type of copy_relocs_ to variable,
16389 update initializer.
16390 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16391 Change all callers.
16392 (Target_sparc::do_finalize_sections): Change handling of
16393 copy_relocs_.
16394 * x86_64.cc: Include "copy-relocs.h".
16395 (class Target_x86_64): Change type of copy_relocs_ to variable,
16396 update initializer.
16397 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16398 class. Change all callers.
16399 (Target_x86_64::do_finalize_sections): Change handling of
16400 copy_relocs_.
16401 * Makefile.am (CCFILES): Add copy-relocs.cc.
16402 (HFILES): Add copy-relocs.h.
16403
4f4995b6
ILT
16404 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16405
85c7bf8b
ILT
16406 * testsuite/script_test_4.sh: Permit leading zeroes.
16407
4f2a9edd
ILT
164082008-04-15 Ian Lance Taylor <iant@google.com>
16409
e6188289
ILT
16410 * script-sections.cc (Script_sections::create_segments): Use
16411 header_size_adjustment even when there is enough room for the
16412 headers.
16413 * testsuite/script_test_4.sh: New file.
16414 * testsuite/script_test_4.t: New file.
16415 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16416 (check_DATA): Add script_test_4.stdout.
16417 (MOSTLYCLEANFILES): Likewise.
16418 (script_test_4): New target.
16419 (script_test_4.stdout): New target.
16420 * testsuite/Makefile.in: Rebuild.
16421
4f2a9edd
ILT
16422 * sparc.cc: Add definitions for Output_data_plt_sparc class
16423 constants.
16424
f5314dd5
DM
164252008-04-14 David S. Miller <davem@davemloft.net>
16426
16427 * sparc.cc: New file.
16428 * Makefile.am (TARGETSOURCES): Add sparc.cc
16429 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16430 * configure.tgt: Document targ_extra_size and
16431 targ_extra_big_endian. Add entries for sparc-* and
16432 sparc64-*.
16433 * configure.ac: Handle targ_extra_size and
16434 targ_extra_big_endian.
16435 * Makefile.in: Rebuild.
16436 * configure: Likewise.
16437 * po/POTFILES.in: Likewise.
16438 * po/gold.pot: Likewise.
16439
154e0e9a
ILT
164402008-04-14 Ian Lance Taylor <iant@google.com>
16441
16442 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16443 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16444 in the name/type/flags to section mapping. Don't call
16445 allocate_output_section.
16446 (Layout::choose_output_section): Change parameter from adjust_name
16447 to is_input_section. Don't permit input sections after sections
16448 are attached to segments. Don't call allocate_output_section.
16449 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16450 not write_enable_output_section.
16451 (Layout::make_output_section): Don't push to
16452 unattached_section_list_ nor call attach_to_segment. Call
16453 attach_section_to_segment if sections are attached.
16454 (Layout::attach_sections_to_segments): New function.
16455 (Layout::attach_section_to_segment): New function.
16456 (Layout::attach_allocated_section_to_segment): Rename from
16457 attach_to_segment. Remove flags parameter.
16458 (Layout::allocate_output_section): Remove function.
16459 (Layout::write_enable_output_section): Remove function.
16460 * layout.h (class Layout): Update for above changes. Add new
16461 field sections_are_attached_.
16462 * output.h (Output_section::update_flags_for_input_section): New
16463 function.
16464 * output.cc (Output_section::add_input_section): Call
16465 update_flags_for_input_section.
16466 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16467
009a67a2
CC
164682008-04-11 Cary Coutant <ccoutant@google.com>
16469
16470 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16471 thought unnecessary.
16472 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16473
759b1a24
ILT
164742008-04-11 Ian Lance Taylor <iant@google.com>
16475
16476 * output.h (class Output_section_data): Remove inline definition
16477 of set_addralign.
16478 * output.cc (Output_section_data::set_addralign): New function.
16479
c2b45e22
CC
164802008-04-11 Cary Coutant <ccoutant@google.com>
16481
16482 Add support for TLS descriptors for i386 and x86_64.
16483 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16484 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16485 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16486 GOT_TYPE_TLS_DESC.
16487 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16488 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16489 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16490 relocations.
16491 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16492 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16493 Fix problem with initial-exec relocations.
16494 (Target_i386::Relocate::relocate_tls): Likewise.
16495 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16496 relaxation.
16497 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16498 support for section-plus-offset dynamic table entries.
16499 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16500 (Output_data_dynamic::Dynamic_entry): Add support for
16501 section-plus-offset dynamic table entries.
16502 (Output_data_dynamic::Classification): Likewise.
16503 (Output_data_dynamic::classification_): Renamed offset_.
16504 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16505 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16506 (Target_x86_64::make_plt_section): New function.
16507 (Target_x86_64::reserve_tlsdesc_entries): New function.
16508 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16509 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16510 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16511 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16512 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16513 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16514 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16515 add extra PLT entry for TLS descriptors.
16516 (Output_data_plt_x86_64::got_): New field.
16517 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16518 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16519 fields.
16520 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16521 descriptors.
16522 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16523 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16524 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16525 R_386_TLS_DESC_CALL relocations.
16526 (Target_x86_64::Scan::global): Likewise.
16527 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16528 for TLS descriptors.
16529 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16530 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16531 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16532 GD-to-IE relaxation.
16533 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16534 and TLS_DESCRIPTORS.
16535 * Makefile.in: Rebuild.
16536 * configure: Rebuild.
16537 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16538 (tls_test_shared2.so): New target.
16539 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16540 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16541 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16542 (tls_shared_gd_to_ie_test_LDADD): New variable.
16543 (tls_shared_gnu2_gd_to_ie_test): New target.
16544 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16545 New targets.
16546 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16547 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16548 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16549 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16550 (tls_shared_gnu2_test): New target.
16551 (tls_test_gnu2_shared.so): New target.
16552 (tls_shared_gnu2_test_SOURCES): New variable.
16553 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16554 (tls_shared_gnu2_test_LDFLAGS): New variable.
16555 (tls_shared_gnu2_test_LDADD): New variable.
16556 * testsuite/Makefile.in: Rebuild.
16557 * testsuite/Makefile.
16558
83bfb6b7
ILT
165592008-04-11 Ian Lance Taylor <iant@google.com>
16560
16561 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16562 justsyms.t.
16563 * testsuite/Makefile.in: Rebuild.
16564
16565 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16566 long.
16567 * testsuite/script_test_2.cc (main): Adjust test.
16568
706e1f5e
ILT
165692008-04-11 David S. Miller <davem@davemloft.net>
16570 Ian Lance Taylor <iant@google.com>
16571
16572 * options.h (General_options): Add entries for '-Y' and
16573 '-relax'.
16574 * options.cc (General_options:finalize): If -Y was used, add those
16575 entries to the library path instead of the default "/lib" and
16576 "/usr/lib".
16577
7c98e6bb
DM
165782008-04-11 David S. Miller <davem@davemloft.net>
16579
16580 * testsuite/justsyms.t: Start at 0x100.
16581 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16582 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16583 long.
16584 * testsuite/script_test_2.cc: Adjust string and section length
16585 checks.
7c98e6bb 16586
99a37bfd
ILT
165872008-04-09 Ian Lance Taylor <iant@google.com>
16588
2cefc357
ILT
16589 PR gold/5996
16590 * script-sections.cc (Sections_element::allocate_to_segment): Add
16591 orphan parameter.
16592 (Output_section_definition::allocate_to_segment): Likewise.
16593 (Orphan_output_section::allocate_to_segment): Likewise.
16594 (Script_sections::attach_sections_using_phdrs_clause): Don't
16595 propagate non-PT_LOAD segments to orphan sections.
16596 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16597 readelf rather than objdump.
16598 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16599 .interp section and PT_INTERP segment are the same size.
16600 * testsuite/Makefile.in: Rebuild.
16601
99a37bfd
ILT
16602 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16603 aliases for symbols defined in the same object.
16604 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16605 (weak_alias_test_SOURCES): New variable.
16606 (weak_alias_test_DEPENDENCIES): New variable.
16607 (weak_alias_test_LDFLAGS): New variable.
16608 (weak_alias_test_LDADD): New variable.
16609 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16610 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16611 (weak_alias_test_3.o): New target.
16612 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16613 * testsuite/weak_alias_test_main.cc: New file.
16614 * testsuite/weak_alias_test_1.cc: New file.
16615 * testsuite/weak_alias_test_2.cc: New file.
16616 * testsuite/weak_alias_test_3.cc: New file.
16617
780e49c5
ILT
166182008-04-08 Ian Lance Taylor <iant@google.com>
16619
cdb0b8f5
ILT
16620 * options.h (class General_options): Add --noinhibit-exec option.
16621 * main.cc (main): Check --noinhibit-exec.
16622
0864d551
ILT
16623 * options.h (class General_options): Define --wrap as a special
16624 option. Add wrap_symbols_ field.
16625 (General_options::any_wrap_symbols): New function.
16626 (General_options::is_wrap_symbol): New function.
16627 * options.cc (General_options::parse_wrap): New function.
16628 (General_options::General_options): Initialize wrap_symbols_.
16629 * symtab.cc (Symbol_table::wrap_symbol): New function.
16630 (Symbol_table::add_from_object): Handle --wrap.
16631 * symtab.h (class Symbol_table): Declare wrap_symbol.
16632 * target.h (Target::wrap_char): New function.
16633 (Target::Target_info): Add wrap_char field.
16634 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16635 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16636 * testsuite/testfile.cc (Target_test::test_target_info):
16637 Likewise.
16638
789aa6de
ILT
16639 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16640 there is one.
16641
2c38906f
ILT
16642 * layout.h (class Layout): Add added_eh_frame_data_ field.
16643 * layout.cc (Layout::Layout): Initialize new field.
16644 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16645 output section until we find a section we merged successfully.
16646 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16647 that the size be non-zero.
16648
780e49c5
ILT
16649 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16650 qualifier.
16651
7fcd0256
ILT
166522008-04-08 Craig Silverstein <csilvers@google.com>
16653
16654 * configure.ac: Export new conditional variable HAVE_ZLIB.
16655 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16656 on HAVE_ZLIB.
16657 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16658 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16659
6835af53
ILT
166602008-04-07 Ian Lance Taylor <iant@google.com>
16661
e24f324c
ILT
16662 * version.cc (version_string): Set to "1.5".
16663
a036edd8
ILT
16664 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16665 Add issued_non_pic_error_ field. Declare check_non_pic.
16666 (Target_x86_64::Scan::check_non_pic): New function.
16667 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16668 (Target_x86_64::Scan::global): Likewise.
16669
624f8810
ILT
16670 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16671 addend parameter. Change caller. Handle merge sections.
16672 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16673 Address to Addend. Don't add in the result of
16674 local_section_offset, pass down the addend and use the returned
16675 value.
16676 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16677 Update declarations of local_section_offset and symbol_value.
16678 * testsuite/two_file_test_1.cc (t18): New function.
16679 * testsuite/two_file_test_2.cc (f18): New function.
16680 * testsuite/two_file_test_main.cc (main): Call t18.
16681 * testsuite/two_file_test.h (t18, f18): Declare.
16682
6835af53
ILT
16683 * configure.ac: Don't test for objdump, c++filt, or readelf.
16684 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16685 conditionals.
16686 (TEST_READELF): New variable.
16687 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16688 (check_PROGRAMS): Add two_file_strip_test.
16689 (two_file_strip_test): New target.
16690 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16691 (two_file_same_shared_strip_test_SOURCES): New variable.
16692 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16693 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16694 (two_file_same_shared_strip_test_LDADD): New variable.
16695 (two_file_shared_strip.so): New target.
16696 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16697 (ver_test_5.syms, ver_test_7.syms): Likewise.
16698 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16699 (strip_test_3.stdout): Use TEST_OBJDUMP.
16700 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16701
86925eef
CC
167022008-04-04 Cary Coutant <ccoutant@google.com>
16703
16704 * symtab.h (Symbol::is_weak_undefined): New function.
16705 (Symbol::is_strong_undefined): New function.
16706 (Symbol::is_absolute): New function.
16707 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16708 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16709 absolute symbols.
16710 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16711 (weak_undef_test): New target.
16712 * testsuite/Makefile.in: Rebuild.
16713 * testsuite/weak_undef_file1.cc: New file.
16714 * testsuite/weak_undef_file2.cc: New file.
16715 * testsuite/weak_undef_test.cc: New file.
16716
126f3ece
ILT
167172008-04-03 Craig Silverstein <csilvers@google.com>
16718
16719 * compressed_output.h (class Output_compressed_section): Use
16720 unsigned buffer.
16721 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16722 add zlib header.
16723 (zlib_compressed_suffix): Removed.
16724 (Output_compressed_section::set_final_data_size): Use unsigned
16725 buffers.
16726 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16727 Fix linker invocation.
16728 (flagstest_o_specialfile_and_compress_debug_sections):
16729 Likewise.
16730 * testsuite/Makefile.in: Regenerated.
16731
deae2a14
DM
167322008-04-02 David S. Miller <davem@davemloft.net>
16733
16734 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16735 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16736
70752818
ILT
167372008-04-02 Craig Silverstein <csilvers@google.com>
16738
16739 * TODO: New file.
16740
39d0cb0e
ILT
167412008-04-02 Ian Lance Taylor <iant@google.com>
16742
16743 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16744 parameters. Update for new key type to views_. Change all
16745 callers.
16746 (File_read::read): Adjust for byteshift in returned view.
16747 (File_read::add_view): New function, broken out of
16748 find_and_make_view.
16749 (File_read::make_view): New function, broken out of
16750 find_and_make_view.
16751 (File_read::find_or_make_view): Add offset and aligned
16752 parameters. Rewrite accordingly. Change all callers.
16753 (File_read::get_view): Add offset and aligned parameters. Adjust
16754 for byteshift in return value.
16755 (File_read::get_lasting_view): Likewise.
16756 * fileread.h (class File_read): Update declarations.
16757 (class File_read::View): Add byteshift_ field. Add byteshift to
16758 constructor. Add byteshift method.
16759 * archive.h (Archive::clear_uncached_views): New function.
16760 (Archive::get_view): Add aligned parameter. Change all callers.
16761 * object.h (Object::get_view): Add aligned parameter. Change all
16762 callers.
16763 (Object::get_lasting_view): Likewise.
16764
16765 * fileread.cc (File_read::release): Don't call clear_views if
16766 there are multiple objects.
16767 * fileread.h (File_read::clear_uncached_views): New function.
16768 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16769 on the archive.
16770
a1207466
CC
167712008-03-31 Cary Coutant <ccoutant@google.com>
16772
16773 Add thin archive support.
16774 * archive.cc (Archive::armagt): New const.
16775 (Archive::setup): Remove task parameter and calls to unlock.
16776 (Archive::unlock_nested_archives): New function.
16777 (Archive::read_header): Add nested_off parameter. Change
16778 all callers.
16779 (Archive::interpret_header): Likewise.
16780 (Archive::include_all_members): Change to handle thin
16781 archives.
16782 (Archive::include_member): Likewise.
16783 * archive.h (Archive::Archive): Add new parameters and
16784 initializers.
16785 (Archive::armagt): New const.
16786 (Archive::setup): Remove task parameter.
16787 (Archive::unlock_nested_archives): New function.
16788 (Archive::read_header): Add nested_off parameter.
16789 (Archive::interpret_header): Likewise.
16790 (Archive::Nested_archive_table): New typedef.
16791 (Archive::is_thin_archive_): New field.
16792 (Archive::nested_archives_): New field.
16793 (Archive::options_): New field.
16794 (Archive::dirpath_): New field.
16795 (Archive::task_): New field.
16796 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16797 for thin archives. Pass additional parameters to
16798 Archive::Archive. Unlock the archive file after calling
16799 Archive::setup.
cd536b21 16800
479f6503
ILT
168012008-03-29 Ian Lance Taylor <iant@google.com>
16802
686c8caf
ILT
16803 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16804 version symbol to be local.
16805 * testsuite/ver_test_4.sh: New file.
16806 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16807 (check_DATA): Add ver_test_4.syms.
16808 (ver_test_4.syms): New target.
16809 * testsuite/Makefile.in: Rebuild.
16810
ab794b6b
ILT
16811 * output.cc
16812 (Output_section::Input_section_sort_entry::has_priority): New
16813 function.
16814 (Output_section::Input_section_sort_entry::match_file_name): New
16815 function.
16816 (Output_section::Input_section_sort_entry::match_section_name):
16817 Remove.
16818 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16819 Remove.
16820 (Output_section::Input_section_sort_entry::match_section_file):
16821 Remove.
16822 (Output_section::Input_section_sort_compare::operator()): Rewrite
16823 using new Input_section_sort_entry functions. Sort crtbegin and
16824 crtend first. Sort sections with no priority before sections with
16825 a priority.
16826 * testsuite/initpri1.c (d3): Check j != 4.
16827 (cd5): New constructor/destructor function.
16828 (main): Check j != 2.
16829
479f6503
ILT
16830 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16831 new symbol when resolving, don't call set_is_default.
16832 * testsuite/ver_test_7.cc: New file.
16833 * testsuite/ver_test_7.sh: New file.
16834 * testsuite/Makefile.am (ver_test_7.so): New target.
16835 (ver_test_7.o): New target.
16836 (check_SCRIPTS): Add ver_test_7.sh.
16837 (check_DATA): Add ver_test_7.syms.
16838 (ver_test_7.syms): New target.
16839
2fd32231
ILT
168402008-03-28 Ian Lance Taylor <iant@google.com>
16841
16842 * layout.cc (Layout::layout): If we see an input section with a
16843 name that needs sorting, set the must_sort flag for the output
16844 section.
16845 (Layout::make_output_section): If the name of the output section
16846 indicates that it might require sorting, set the may_sort flag.
16847 * output.h (Output_section::may_sort_attached_input_sections): New
16848 function.
16849 (Output_section::set_may_sort_attached_input_sections): New
16850 function.
16851 (Output_section::must_sort_attached_input_sections): New
16852 function.
16853 (Output_section::set_must_sort_attached_input_sections): New
16854 function.
16855 (class Output_section): Declare Input_section_sort_entry. Define
16856 Input_section_sort_compare. Declare
16857 sort_attached_input_sections. Add new fields:
16858 may_sort_attached_input_sections_,
16859 must_sort_attached_input_sections_,
16860 attached_input_sections_are_sorted_.
16861 * output.cc (Output_section::Output_section): Initialize new
16862 fields.
16863 (Output_section::add_input_section): Add an entry to
16864 input_sections_ if may_sort or must_sort are true.
16865 (Output_section::set_final_data_size): Call
16866 sort_attached_input_sections if necessary.
16867 (Output_section::Input_section_sort_entry): Define new class.
16868 (Output_section::Input_section_sort_compare::operator()): New
16869 function.
16870 (Output_section::sort_attached_input_sections): New function.
16871 * configure.ac: Check whether the compiler supports constructor
16872 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16873 * testsuite/initpri1.c: New file.
16874 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16875 CONSTRUCTOR_PRIORITY.
16876 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16877 (initpri1_LDFLAGS): New variable.
16878 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16879
18e6b24e
ILT
168802008-03-27 Ian Lance Taylor <iant@google.com>
16881
49bdd526
ILT
16882 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16883 * testsuite/common_test_1.c: New file.
16884 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16885 (common_test_1_SOURCES): New variable.
16886 (common_test_1_DEPENDENCIES): New variable.
16887 (common_test_1_LDFLAGS): New variable.
16888
18e6b24e
ILT
16889 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16890 and commons_ correctly when NAME/VERSION does not override
16891 NAME/NULL.
16892 * testsuite/ver_test_6.c: New file.
16893 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16894 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16895 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16896
04bf7072
ILT
168972008-03-26 Ian Lance Taylor <iant@google.com>
16898
5871526f
ILT
16899 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16900 of an undefined symbol from a version script.
16901 * testsuite/Makefile.am (ver_test_5.so): New target.
16902 (ver_test_5.o): New target.
16903 (check_SCRIPTS): Add ver_test_5.sh.
16904 (check_DATA): Add ver_test_5.syms.
16905 (ver_test_5.syms): New target.
16906 * testsuite/ver_test_5.cc: New file.
16907 * testsuite/ver_test_5.script: New file.
16908 * testsuite/ver_test_5.sh: New file.
16909 * Makefile.in, testsuite/Makefile.in: Rebuild.
16910
04bf7072
ILT
16911 PR gold/5986
16912 Fix problems building gold with gcc 4.3.0.
16913 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16914 (gold_error_at_location, gold_warning_at_location): Use it.
16915 * configure.ac: Check whether we can compile and use a template
16916 function with a printf attribute.
16917 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16918 when jumping over bytes.
16919 * object.cc: Instantiate Object::read_section_data.
16920 * debug.h: Include <cstring>
16921 * dwarf_reader.cc: Include <algorithm>
16922 * main.cc: Include <cstring>.
16923 * options.cc: Include <cstring>.
16924 * output.cc: Include <cstring>.
16925 * script.cc: Include <cstring>.
16926 * script.h: Include <string>.
16927 * symtab.cc: Include <cstring> and <algorithm>.
16928 * target-select.cc: Include <cstring>.
16929 * version.cc: Include <string>.
16930 * testsuite/testmain.cc: Include <cstdlib>.
16931 * configure, config.in: Rebuild.
16932
874c5b28
ILT
169332008-03-25 Ian Lance Taylor <iant@google.com>
16934
819d6c3a
ILT
16935 * options.cc: Include "../bfd/bfdver.h".
16936 (options::help): Print bug reporting address.
16937
f4b2c6f5
ILT
16938 * version.cc (print_version): Adjust output for current value of
16939 BFD_VERSION_STRING.
16940
16941 * NEWS: New file.
16942
e96caa79
ILT
16943 * options.cc (options::help): Print list of supported targets.
16944 * target-select.h: Include <vector>.
16945 (class Target_selector): Make machine_, size_, and is_big_endian_
16946 fields const. Add bfd_name_ and instantiated_target_ fields.
16947 (Target_selector::Target_selector): Add bfd_name parameter.
16948 (Target_selector::recognize): Make non-virtual, call
16949 do_recognize.
16950 (Target_selector::recognize_by_name): Make non-virtual, call
16951 do_recognize_by_name.
16952 (Target_selector::supported_names): New function.
16953 (Target_selector::bfd_name): New function.
16954 (Target_selector::do_instantiate_target): New pure virtual
16955 function.
16956 (Target_selector::do_recognize): New virtual function.
16957 (Target_selector::do_recognize_by_name): New virtual function.
16958 (Target_selector::instantiate_target): New private function.
16959 (supported_target_names): Declare.
16960 * target-select.cc (Target_selector::Target_selector): Update for
16961 new parameter and fields.
16962 (select_target_by_name): Check that the name matches before
16963 calling recognize_by_name.
16964 (supported_target_names): New function.
16965 * i386.cc (class Target_selector_i386): Update Target_selector
16966 constructor call. Remove recognize and recognize_by_name. Add
16967 do_instantiate_target.
16968 * x86_64.cc (class Target_selector_x86_64): Likewise.
16969 * testsuite/testfile.cc (class Target_selector_test): Update for
16970 changes to Target_selector.
16971
874c5b28
ILT
16972 * README: Rewrite, with some notes on unsupported features.
16973
0a65a3a7
CC
169742008-03-24 Cary Coutant <ccoutant@google.com>
16975
16976 * i386.cc (Target_i386::Got_type): New enum declaration.
16977 (Target_i386::Scan::local): Updated callers of Output_data_got
16978 member functions.
16979 (Target_i386::Scan::global): Likewise.
16980 (Target_i386::Relocate::relocate): Likewise.
16981 (Target_i386::Relocate::relocate_tls): Likewise.
16982 * object.h (Got_offset_list): New class.
16983 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16984 (Sized_relobj::local_got_offset): Likewise.
16985 (Sized_relobj::set_local_got_offset): Likewise.
16986 (Sized_relobj::local_has_tls_got_offset): Removed.
16987 (Sized_relobj::local_tls_got_offset): Removed.
16988 (Sized_relobj::set_local_tls_got_offset): Removed.
16989 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16990 * output.cc (Output_data_got::add_global): Added got_type parameter.
16991 (Output_data_got::add_global_with_rel): Likewise.
16992 (Output_data_got::add_global_with_rela): Likewise.
16993 (Output_data_got::add_global_pair_with_rel): New function.
16994 (Output_data_got::add_global_pair_with_rela): New function.
16995 (Output_data_got::add_local): Added got_type parameter.
16996 (Output_data_got::add_local_with_rel): Likewise.
16997 (Output_data_got::add_local_with_rela): Likewise.
16998 (Output_data_got::add_local_pair_with_rel): New function.
16999 (Output_data_got::add_local_pair_with_rela): New function.
17000 (Output_data_got::add_global_tls): Removed.
17001 (Output_data_got::add_global_tls_with_rel): Removed.
17002 (Output_data_got::add_global_tls_with_rela): Removed.
17003 (Output_data_got::add_local_tls): Removed.
17004 (Output_data_got::add_local_tls_with_rel): Removed.
17005 (Output_data_got::add_local_tls_with_rela): Removed.
17006 * output.h (Output_data_got::add_global): Added got_type parameter.
17007 (Output_data_got::add_global_with_rel): Likewise.
17008 (Output_data_got::add_global_with_rela): Likewise.
17009 (Output_data_got::add_global_pair_with_rel): New function.
17010 (Output_data_got::add_global_pair_with_rela): New function.
17011 (Output_data_got::add_local): Added got_type parameter.
17012 (Output_data_got::add_local_with_rel): Likewise.
17013 (Output_data_got::add_local_with_rela): Likewise.
17014 (Output_data_got::add_local_pair_with_rel): New function.
17015 (Output_data_got::add_local_pair_with_rela): New function.
17016 (Output_data_got::add_global_tls): Removed.
17017 (Output_data_got::add_global_tls_with_rel): Removed.
17018 (Output_data_got::add_global_tls_with_rela): Removed.
17019 (Output_data_got::add_local_tls): Removed.
17020 (Output_data_got::add_local_tls_with_rel): Removed.
17021 (Output_data_got::add_local_tls_with_rela): Removed.
17022 * resolve.cc (Symbol::override_base_with_special): Removed
17023 reference to has_got_offset_ field.
17024 * symtab.cc (Symbol::init_fields): Replaced initialization
17025 of got_offset_ with got_offsets_. Removed initialization
17026 of has_got_offset_
53fcba31 17027 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17028 (Symbol::got_offset): Likewise.
17029 (Symbol::set_got_offset): Likewise.
17030 (Symbol::has_tls_got_offset): Removed.
17031 (Symbol::tls_got_offset): Removed.
17032 (Symbol::set_tls_got_offset): Removed.
17033 (Symbol::got_offset_): Removed.
17034 (Symbol::tls_mod_got_offset_): Removed.
17035 (Symbol::tls_pair_got_offset_): Removed.
17036 (Symbol::got_offsets_): New field.
17037 (Symbol::has_got_offset): Removed.
17038 (Symbol::has_tls_mod_got_offset): Removed.
17039 (Symbol::has_tls_pair_got_offset): Removed.
17040 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17041 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17042 member functions.
17043 (Target_x86_64::Scan::global): Likewise.
17044 (Target_x86_64::Relocate::relocate): Likewise.
17045 (Target_x86_64::Relocate::relocate_tls): Likewise.
17046
bd52eafb
BE
170472008-03-25 Ben Elliston <bje@au.ibm.com>
17048
17049 * yyscript.y: Fix spelling error in comment.
17050
8b105e34
ILT
170512008-03-24 Ian Lance Taylor <iant@google.com>
17052
8ed814a9
ILT
17053 * options.h (class General_options): Define build_id option.
17054 * layout.h (class Layout): Declare write_build_id, create_note,
17055 create_build_id. Add build_id_note_ member.
17056 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17057 "libiberty.h", "md5.h", "sha1.h".
17058 (Layout::Layout): Initialize eh_frame_data_,
17059 eh_frame_hdr_section_, and build_id_note_.
17060 (Layout::finalize): Call create_build_id.
17061 (Layout::create_note): New function, broken out of
17062 Layout::create_gold_note.
17063 (Layout::create_gold_note): Call create_note.
17064 (Layout::create_build_id): New function.
17065 (Layout::write_build_id): New function.
17066 (Close_task_runner::run): Call write_build_id.
17067
8b105e34
ILT
17068 * x86_64.cc: Correct license to GPLv3.
17069
086a1841
ILT
170702008-03-23 Ian Lance Taylor <iant@google.com>
17071
17072 * options.cc: Include "demangle.h".
17073 (parse_optional_string): New function.
17074 (parse_long_option): Handle takes_optional_argument.
17075 (parse_short_option): Update dash_z initializer. Handle
17076 takes_optional_argument.
17077 (General_options::General_options): Initialize do_demangle_.
17078 (General_options::finalize): Set do_demangle_. Handle demangling
17079 style.
17080 * options.h (parse_optional_string): Declare.
17081 (struct One_option): Add optional_arg field. Update constructor.
17082 Update call constructor calls. Add takes_optional_argument
17083 function.
17084 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17085 (DEFINE_optional_string): Define.
17086 (General_options::demangle): Change from DEFINE_bool to
17087 DEFINE_optional_string.
17088 (General_options::no_demangle): New function.
17089 (General_options::do_demangle): New function.
17090 (General_options::set_do_demangle): New function.
17091 (General_options::execstack_status_): Move definition to end of
17092 class definition.
17093 (General_options::static_): Likewise.
17094 (General_options::do_demangle_): New field.
17095 * object.cc (big_endian>::get_symbol_location_info): Call
17096 Options::do_demangle, not Options::demangle.
17097 * symtab.cc (demangle): Likewise.
17098
cbb93e63
ILT
170992008-03-22 Ian Lance Taylor <iant@google.com>
17100
17101 * gold.h: Include <cstddef> and <sys/types.h>
17102 * options.h: Include <cstring>.
17103
ec531623
ILT
171042008-03-21 Ian Lance Taylor <iant@google.com>
17105
17106 * Added source code to GNU binutils.
752937aa 17107\f
b90efa5b 17108Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17109
17110Copying and distribution of this file, with or without modification,
17111are permitted in any medium without royalty provided the copyright
17112notice and this notice are preserved.
17113
17114Local Variables:
17115mode: change-log
17116left-margin: 8
17117fill-column: 74
17118version-control: never
17119End:
This page took 1.2587 seconds and 4 git commands to generate.