*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e1f74f98
ILT
12011-06-19 Ian Lance Taylor <iant@google.com>
2
3 PR gold/12880
4 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5 .interp section to a PT_INTERP segment even if we have seen a
6 --dynamic-linker option. Don't do it if we have seen a PHDRS
7 clause in a linker script.
8 (Layout::finalize): Don't create a .interp section if we've
9 already create a PT_INTERP segment.
10 (Layout::create_interp): Always call choose_output_section (revert
11 patch of 2011-06-17). Don't create PT_INTERP segment.
12 * script-sections.cc
13 (Script_sections::create_note_and_tls_segments): Add a .interp
14 section to a PT_INTERP segment even if we have seen a
15 --dynamic-linker option.
16
766f91bb
ILT
172011-06-18 Ian Lance Taylor <iant@google.com>
18
19 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
20 merely because a non-PT_LOAD segment has a dynamic reloc.
21
0d212c3a
ILT
222011-06-18 Ian Lance Taylor <iant@google.com>
23
24 * layout.cc (Layout::finish_dynamic_section): Don't create
25 DT_FLAGS entry if not needed.
26
911a5072
ILT
272011-06-18 Ian Lance Taylor <iant@google.com>
28
29 PR gold/12745
30 * layout.cc (Layout::layout_eh_frame): Correct handling of
31 writable .eh_frame section.
32
534b4e5f
ILT
332011-06-17 Ian Lance Taylor <iant@google.com>
34
35 PR gold/12893
36 * resolve.cc (Symbol_table::resolve): Don't give an error if a
37 symbol is redefined with the exact same object and value.
38
10b4f102
ILT
392011-06-17 Ian Lance Taylor <iant@google.com>
40
41 PR gold/12880
42 * layout.h (class Layout): Add interp_segment_ field.
43 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
44 (Layout::attach_allocated_section_to_segment): If making shared
45 library, put .interp section in PT_INTERP segment.
46 (Layout::finalize): Also call create_interp if -dynamic-linker
47 option was used.
48 (Layout::create_interp): Assert that there is no PT_INTERP
49 segment. If not using a SECTIONS clause, use make_output_section.
50 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
51 * script-sections.cc
52 (Script_sections::create_note_and_tls_segments): If making shared
53 library, put .interp section in PT_INTERP segment.
54
a29b0dad
ILT
552011-06-17 Ian Lance Taylor <iant@google.com>
56
e588ea8d
ILT
57 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
58 when making a shared library.
59
602011-06-17 Ian Lance Taylor <iant@google.com>
61
62 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
63 parameter. Change all callers. Don't issue warning about PC32
64 against locally defined symbol.
a29b0dad 65
9d3b0698
ILT
662011-06-16 Ian Lance Taylor <iant@google.com>
67
68 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
69 occurs in same object.
70
85b0f90c
AM
712011-06-14 Alan Modra <amodra@gmail.com>
72
73 * po/POTFILES.in: Regenerate.
74
a94907d9
ILT
752011-06-09 Ian Lance Taylor <iant@google.com>
76
77 * script-sections.cc
78 (Orphan_output_section::set_section_addresses): For a relocatable
79 link set address to 0.
80
4fb3a1c3
CC
812011-06-09 Cary Coutant <ccoutant@google.com>
82
83 PR gold/12804
84 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
85 used with --compress-debug-sections.
86 * gold/object.cc (Sized_relobj_file::do_layout): Report
87 uncompressed size of compressed input sections.
88
61220854
CC
892011-06-08 Cary Coutant <ccoutant@google.com>
90
91 PR gold/12804
92 * testsuite/two_file_test_2_v1.cc: Change initialization of
93 v2 to keep it in .data.
94
e6455dfb
CC
952011-06-07 Cary Coutant <ccoutant@google.com>
96
97 * common.cc (Symbol_table::do_allocate_commons_list): Call
98 gold_fallback.
99 * errors.cc (Errors::fatal): Adjust call to gold_exit.
100 (Errors::fallback): New function.
101 (gold_fallback): New function.
102 * errors.h (Errors::fallback): New function.
103 * gold.cc (gold_exit): Change status parameter to enum; adjust
104 all callers.
105 (queue_initial_tasks): Call gold_fallback.
106 * gold.h: Include cstdlib.
107 (Exit_status): New enum type.
108 (gold_exit): Change status parameter to enum.
109 (gold_fallback): New function.
110 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
111 (Layout::create_symtab_sections): Likewise.
112 (Layout::create_shdrs): Likewise.
113 * main.cc (main): Adjust call to gold_exit.
114 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
115 (Output_data_got::add_got_entry_pair): Likewise.
116 (Output_section::add_input_section): Likewise.
117 (Output_section::add_output_section_data): Likewise.
118 (Output_segment::set_section_list_addresses): Likewise.
119 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
120
fb0e076f
CC
1212011-06-07 Cary Coutant <ccoutant@google.com>
122
123 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
124 for incremental links.
125 * output.cc (Output_segment::set_section_list_addresses): Remove
126 FIXME and test for TLS or BSS.
127
a5ee4d5d
CC
1282011-06-07 Cary Coutant <ccoutant@google.com>
129
130 * testsuite/Makefile.am: Add incremental_copy_test,
131 incremental_common_test_1.
132 * testsuite/Makefile.in: Regenerate.
133 * testsuite/common_test_1_v1.c: New source file.
134 * testsuite/common_test_1_v2.c: New source file.
135 * testsuite/copy_test_v1.cc: New source file.
136
5146f448
CC
1372011-06-07 Cary Coutant <ccoutant@google.com>
138
139 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
140 update, allocate common from bss section's free list.
141 * incremental-dump.cc (dump_incremental_inputs): Print flag for
142 linker-defined symbols.
143 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
144 Skip GOT and PLT entries that are no longer referenced.
145 (Output_section_incremental_inputs::write_info_blocks): Mark
146 linker-defined symbols.
147 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
148 * output.cc (Output_section::allocate): New function.
149 * output.h (Output_section::allocate): New function.
150 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
151 linker-defined symbols.
152 (Symbol::override_base_with_special): Copy is_predefined_ flag.
153 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
154 (Symbol::init_base_output_data): Likewise.
155 (Symbol::init_base_output_segment): Likewise.
156 (Symbol::init_base_constant): Likewise.
157 (Sized_symbol::init_output_data): Likewise.
158 (Sized_symbol::init_output_segment): Likewise.
159 (Sized_symbol::init_constant): Likewise.
160 (Symbol_table::do_define_in_output_data): Likewise.
161 (Symbol_table::do_define_in_output_segment): Likewise.
162 (Symbol_table::do_define_as_constant): Likewise.
163 * symtab.h (Symbol::is_predefined): New function.
164 (Symbol::init_base_output_data): Add is_predefined parameter.
165 (Symbol::init_base_output_segment): Likewise.
166 (Symbol::init_base_constant): Likewise.
167 (Symbol::is_predefined_): New data member.
168 (Sized_symbol::init_output_data): Add is_predefined parameter.
169 (Sized_symbol::init_output_segment): Likewise.
170 (Sized_symbol::init_constant): Likewise.
171 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
172
26d3c67d
CC
1732011-06-07 Cary Coutant <ccoutant@google.com>
174
175 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
176 instead of emit_copy_reloc.
177 (Copy_relocs::emit_copy_reloc): Refactor.
178 (Copy_relocs::make_copy_reloc): New function.
179 (Copy_relocs::add_copy_reloc): Remove.
180 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
181 section.
182 (Copy_relocs::make_copy_reloc): New function.
183 (Copy_relocs::add_copy_reloc): Remove.
184 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
185 unchanged input files.
186 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
187 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
188 Reserve BSS space for COPY relocations.
189 (Sized_incremental_binary::do_emit_copy_relocs): New function.
190 (Output_section_incremental_inputs::write_info_blocks): Record
191 whether a symbol is copied from a shared object.
192 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
193 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
194 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
195 (Incremental_input_entry_reader::get_output_symbol_index): Add
196 is_copy parameter.
197 (Incremental_binary::emit_copy_relocs): New function.
198 (Incremental_binary::do_emit_copy_relocs): New function.
199 (Sized_incremental_binary::Sized_incremental_binary): Initialize
200 new data member.
201 (Sized_incremental_binary::add_copy_reloc): New function.
202 (Sized_incremental_binary::do_emit_copy_relocs): New function.
203 (Sized_incremental_binary::Copy_reloc): New struct.
204 (Sized_incremental_binary::Copy_relocs): New typedef.
205 (Sized_incremental_binary::copy_relocs_): New data member.
206 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
207 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
208 * target.h (Sized_target::emit_copy_reloc): New function.
209 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
210
7cdb37d9
CC
2112011-06-02 Cary Coutant <ccoutant@google.com>
212
213 PR gold/12163
214 * gold/archive.cc (Archive::Archive): Initialize new data member.
215 (Archive::include_all_members): Return if archive has already been
216 included.
217 * gold/archive.h (Archive::include_all_members_): New data member.
218
cc643b88
NC
2192011-06-02 Nick Clifton <nickc@redhat.com>
220
221 * dynobj.h: Fix spelling mistake in comment.
222 * output.cc: Likewise.
223
f62a3ca7
DK
2242011-05-31 Doug Kwan <dougkwan@google.com>
225 Asier Llano
226
227 PR gold/12826
cc643b88 228 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
229 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
230 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
231 redundant arm_exidx_test.so.
232 * testsuite/Makefile.in: Regenerate.
233 (check_SCRIPTS): Add pr12826.sh
234 (check_DATA): Add pr12826.stdout
235 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
236 * testsuite/pr12826.sh: New file.
237 * testsuite/pr12826_1.s: Ditto.
238 * testsuite/pr12826_1.s: Ditto.
239
8dbe1edc
ILT
2402011-05-30 Ian Lance Taylor <iant@google.com>
241
242 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
243 sections.
244
c49875be
ILT
2452011-05-29 Ian Lance Taylor <iant@google.com>
246
247 PR gold/12804
248 * testsuite/Makefile.am: Use different file name for two_file_test
249 temporary file for each incremental test.
250 * testsuite/Makefile.in: Rebuild.
251
69d53f7a
ILT
2522011-05-29 Ian Lance Taylor <iant@google.com>
253
254 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
255 binary input file is empty.
256
41d0ab5f
ILT
2572011-05-27 Ian Lance Taylor <iant@google.com>
258
259 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
260 (ver_test_9.so): Likewise.
261 * testsuite/Makefile.in: Rebuild.
262
89d8a36b
CC
2632011-05-26 Cary Coutant <ccoutant@google.com>
264
265 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
266 * incremental.cc (Incremental_inputs::report_input_section): Fix
267 comment, indentation.
268 (Incremental_inputs::report_comdat_group): New function.
269 (Output_section_incremental_inputs::set_final_data_size): Adjust size
270 of data for incremental input file entry.
271 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
272 group count, COMDAT group signatures.
273 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
274 an unchanged input file.
275 * incremental.h (Incremental_object_entry::Incremental_object_entry):
276 Initialize new data member.
277 (Incremental_object_entry::add_comdat_group): New function.
278 (Incremental_object_entry::get_comdat_group_count): New function.
279 (Incremental_object_entry::get_comdat_signature_key): New function.
280 (Incremental_object_entry::groups_): New data member.
281 (Incremental_inputs::report_comdat_group): New function.
282 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
283 data for incremental input file entry.
284 (Incremental_input_entry_reader::get_comdat_group_count): New function.
285 (Incremental_input_entry_reader::get_input_section): Adjust size of
286 data for incremental input file entry.
287 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
288 (Incremental_input_entry_reader::get_comdat_group_signature): New
289 function.
290 * object.cc (Sized_relobj::include_section_group): Report kept
291 COMDAT groups for incremental links.
292
1706a06f
ILT
2932011-05-24 David Meyer <pdox@google.com>
294
295 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
296 with name parameter. Add found_name parameter.
297 * fileread.cc (Input_file::find_file): Adjust code accordingly.
298 * dirsearch.h (class Dirsearch): Update declaration.
299
a10ae760
ILT
3002011-05-24 Ian Lance Taylor <iant@google.com>
301
302 * archive.cc (Library_base::should_include_member): Pull in object
303 from archive if it defines the entry symbol.
304 * parameters.cc (Parameters::entry): New function.
305 * parameters.h (class Parameters): Declare entry.
306 * output.h (class Output_file_header): Remove entry_ field.
307 * output.cc (Output_file_header::Output_file_header): Remove entry
308 parameter. Change all callers.
309 (Output_file_header::entry): Use parameters->entry.
310 * gold.cc (queue_middle_tasks): Likewise.
311 * plugin.cc (Plugin_hook::run): Likewise.
312
aa92d6ed
CC
3132011-05-24 Cary Coutant <ccoutant@google.com>
314
315 * gold.cc (queue_initial_tasks): Pass incremental base filename
316 to Output_file::open_base_file; don't print error message.
317 * incremental-dump.cc (main): Adjust call to
318 Output_file::open_for_modification.
319 * incremental-dump.cc (main): Likewise.
320 * incremental.cc (Incremental_inputs::report_command_line):
321 Ignore --incremental-base option when comparing command lines.
322 Ignore parameter when given as separate argument.
323 * options.h (class General_options): Add --incremental-base.
324 * output.cc (Output_file::Output_file):
325 (Output_file::open_base_file): Add base_name and writable parameters;
326 read base file into new file; print error message here.
327 (Output_file::map_no_anonymous): Add writable parameter; adjust all
328 callers.
329 * output.h (Output_file::open_for_modification): Rename to...
330 (Output_file::open_base_file): ...this; add base_name and
331 writable parameters; adjust all callers.
332 (Output_file::map_no_anonymous): Add writable parameter; adjust all
333 callers.
334 * testsuite/Makefile.am (incremental_test_4): Test
335 --incremental-base.
336 * testsuite/Makefile.in: Regenerate.
337
2eedd706
CC
3382011-05-24 Cary Coutant <ccoutant@google.com>
339
340 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
341 incremental_test_4.
342 * testsuite/Makefile.in: Regenerate.
343 * testsuite/two_file_test_1_v1.cc: New test source file.
344 * testsuite/two_file_test_1b_v1.cc: New test source file.
345 * testsuite/two_file_test_2_v1.cc: New test source file.
346
0f1c85a6
CC
3472011-05-24 Cary Coutant <ccoutant@google.com>
348
349 * dynobj.h (Dynobj::do_dynobj): New function.
350 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
351 flag and soname for shared objects.
352 * incremental.cc (Incremental_inputs::report_object): Make
353 either Incremental_object_entry or Incremental_dynobj_entry; add
354 soname to string table.
355 (Incremental_inputs::report_input_section): Add assertion.
356 (Output_section_incremental_inputs::set_final_data_size): Adjust
357 type of input file entry for shared libraries; adjust size of
358 shared library info entry.
359 (Output_section_incremental_inputs::write_input_files): Write
360 as_needed flag for shared libraries.
361 (Output_section_incremental_inputs::write_info_blocks): Adjust type
362 of input file entry for shared libraries; write soname.
363 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
364 soname from incremental info.
365 * incremental.h (enum Incremental_input_flags): Add
366 INCREMENTAL_INPUT_AS_NEEDED.
367 (Incremental_input_entry::Incremental_input_entry): Initialize new
368 data member.
369 (Incremental_input_entry::set_as_needed): New function.
370 (Incremental_input_entry::as_needed): New function.
371 (Incremental_input_entry::do_dynobj_entry): New function.
372 (Incremental_input_entry::as_needed_): New data member.
373 (Incremental_object_entry::Incremental_object_entry): Don't check
374 for shared library.
375 (Incremental_object_entry::do_type): Likewise.
376 (class Incremental_dynobj_entry): New class.
377 (Incremental_input_entry_reader::as_needed): New function.
378 (Incremental_input_entry_reader::get_soname): New function.
379 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
380 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
381 size of shared library info entry.
382 * layout.cc (Layout::finish_dynamic_section): Don't test for
383 incremental link when adding DT_NEEDED entries.
384 * object.h (Object::Object): Initialize new data member.
385 (Object::dynobj): New function.
386 (Object::set_as_needed): New function.
387 (Object::as_needed): New function.
388 (Object::do_dynobj): New function.
389 (Object::as_needed_): New data member.
390
6fa2a40b
CC
3912011-05-24 Cary Coutant <ccoutant@google.com>
392
393 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
394 info; adjust display of GOT entries.
395 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
396 vector of input objects; remove file_status_.
397 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
398 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
399 got_plt reader; call target hooks to reserve GOT entries.
400 (Output_section_incremental_inputs::set_final_data_size): Adjust size
401 of input file info header and GOT info entry.
402 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
403 relocation info.
404 (Got_plt_view_info::got_descriptor): Remove.
405 (Got_plt_view_info::sym_index): New data member.
406 (Got_plt_view_info::input_index): New data member.
407 (Local_got_offset_visitor::visit): Write input file index.
408 (Global_got_offset_visitor::visit): Write 0 for input file index.
409 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
410 with sym_index and input_index.
411 (Output_section_incremental_inputs::write_got_plt): Adjust size of
412 incremental info GOT entry; replace got_descriptor with input_index.
413 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
414 map from input file index to object.
415 (Sized_relobj_incr::do_layout): Replace direct data member reference
416 with accessor function.
417 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
418 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
419 Adjust size of input file info header.
420 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
421 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
422 (Incremental_input_entry_reader::get_input_section): Adjust size of
423 input file info header.
424 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
425 of incremental info GOT entry.
426 (Incremental_got_plt_reader::get_got_desc): Remove.
427 (Incremental_got_plt_reader::get_got_symndx): New function.
428 (Incremental_got_plt_reader::get_got_input_index): New function.
429 (Sized_incremental_binary::Sized_incremental_binary): Remove
430 file_status_; add input_objects_.
431 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
432 (Sized_incremental_binary::set_file_is_unchanged): Remove.
433 (Sized_incremental_binary::file_is_unchanged): Remove.
434 (Sized_incremental_binary::set_input_object): New function.
435 (Sized_incremental_binary::input_object): New function.
436 (Sized_incremental_binary::file_status_): Remove.
437 (Sized_incremental_binary::input_objects_): New data member.
438 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
439 references.
440 (Sized_relobj_incr::invalid_address): Move to base class.
441 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
442 class.
443 (Sized_relobj_incr::do_output_section_offset): Likewise.
444 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
445 (Sized_relobj_incr::section_offsets_): Likewise.
446 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
447 function.
448 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
449 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
450 with accessor function.
451 (Sized_relobj_file::do_layout): Likewise.
452 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
453 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
454 (Sized_relobj_file::compute_final_local_value): Replace refs to
455 section_offsets_ with accessor function.
456 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
457 * object.h (Relobj::Relobj): Initialize new data members.
458 (Relobj::add_dyn_reloc): New function.
459 (Relobj::first_dyn_reloc): New function.
460 (Relobj::dyn_reloc_count): New function.
461 (Relobj::first_dyn_reloc_): New data member.
462 (Relobj::dyn_reloc_count_): New data member.
463 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
464 references.
465 (Sized_relobj::Address): New typedef.
466 (Sized_relobj::invalid_address): Move here from child class.
467 (Sized_relobj::Sized_relobj): Initialize new data members.
468 (Sized_relobj::sized_relobj): New function.
469 (Sized_relobj::is_output_section_offset_invalid): Move here from
470 child class.
471 (Sized_relobj::get_output_section_offset): Likewise.
472 (Sized_relobj::local_has_got_offset): Likewise.
473 (Sized_relobj::local_got_offset): Likewise.
474 (Sized_relobj::set_local_got_offset): Likewise.
475 (Sized_relobj::do_for_all_local_got_entries): Likewise.
476 (Sized_relobj::clear_got_offsets): New function.
477 (Sized_relobj::section_offsets): Move here from child class.
478 (Sized_relobj::do_output_section_offset): Likewise.
479 (Sized_relobj::do_set_section_offset): Likewise.
480 (Sized_relobj::Local_got_offsets): Likewise.
481 (Sized_relobj::local_got_offsets_): Likewise.
482 (Sized_relobj::section_offsets_): Likewise.
483 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
484 references.
485 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
486 class.
487 (Sized_relobj_file::sized_relobj): New function
488 (Sized_relobj_file::local_has_got_offset): Move to base class.
489 (Sized_relobj_file::local_got_offset): Likewise.
490 (Sized_relobj_file::set_local_got_offset): Likewise.
491 (Sized_relobj_file::get_output_section_offset): Likewise.
492 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
493 (Sized_relobj_file::do_output_section_offset): Likewise.
494 (Sized_relobj_file::do_set_section_offset): Likewise.
495 (Sized_relobj_file::Local_got_offsets): Likewise.
496 (Sized_relobj_file::local_got_offsets_): Likewise.
497 (Sized_relobj_file::section_offsets_): Likewise.
498 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
499 (all constructors).
500 (set_needs_dynsym_index): Convert relobj to derived class pointer.
501 (Output_reloc::get_symbol_index): Likewise.
502 (Output_reloc::local_section_offset): Likewise.
503 (Output_reloc::get_address): Likewise.
504 (Output_reloc::symbol_value): Likewise.
505 (Output_data_got::reserve_slot): Move to class definition.
506 (Output_data_got::reserve_local): New function.
507 (Output_data_got::reserve_slot_for_global): Remove.
508 (Output_data_got::reserve_global): New function.
509 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
510 (all constructors, two instantiations).
511 (Output_reloc::get_relobj): New function (two instantiations).
512 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
513 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
514 (Output_data_reloc::add_global): Adjust type of relobj.
515 (Output_data_reloc::add_global_relative): Likewise.
516 (Output_data_reloc::add_symbolless_global_addend): Likewise.
517 (Output_data_reloc::add_local): Likewise.
518 (Output_data_reloc::add_local_relative): Likewise.
519 (Output_data_reloc::add_symbolless_local_addend): Likewise.
520 (Output_data_reloc::add_local_section): Likewise.
521 (Output_data_reloc::add_output_section): Likewise.
522 (Output_data_reloc::add_absolute): Likewise.
523 (Output_data_reloc::add_target_specific): Likewise.
524 (Output_data_got::reserve_slot): Move definition here.
525 (Output_data_got::reserve_local): New function.
526 (Output_data_got::reserve_global): New function.
527 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
528 section_offsets_ with accessor function.
529 (Sized_relobj_file::write_sections): Likewise.
530 (Sized_relobj_file::do_relocate_sections): Likewise.
531 * target.h (Sized_target::reserve_local_got_entry): New function.
532 (Sized_target::reserve_global_got_entry): New function.
533 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
534 (Target_x86_64::reserve_global_got_entry): New function.
535 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
536
4829d394
CC
5372011-05-23 Cary Coutant <ccoutant@google.com>
538
539 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
540 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
541 bit when checking got_type.
542 * incremental.cc (Sized_incremental_binary::setup_readers):
543 Store symbol table and string table locations; initialize bit vector
544 of file status flags.
545 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
546 unchanged files.
547 (Sized_incremental_binary::do_process_got_plt): New function.
548 (Sized_incremental_binary::get_symtab_view): Use stored locations.
549 (Output_section_incremental_inputs::set_final_data_size): Record
550 file index for each input file.
551 (Output_section_incremental_inputs::write_got_plt): Store file index
552 instead of input entry offset for each GOT entry.
553 * incremental.h
554 (Incremental_input_entry::Incremental_input_entry): Initialize new
555 data member.
556 (Incremental_input_entry::set_offset): Store file index.
557 (Incremental_input_entry::get_file_index): New function.
558 (Incremental_input_entry::file_index_): New data member.
559 (Incremental_binary::process_got_plt): New function.
560 (Incremental_binary::do_process_got_plt): New function.
561 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
562 data members.
563 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
564 (Sized_incremental_binary::set_file_is_unchanged): New function.
565 (Sized_incremental_binary::file_is_unchanged): New function.
566 (Sized_incremental_binary::do_process_got_plt): New function.
567 (Sized_incremental_binary::file_status_): New data member.
568 (Sized_incremental_binary::main_symtab_loc_): New data member.
569 (Sized_incremental_binary::main_strtab_loc_): New data member.
570 * output.cc (Output_data_got::Got_entry::write): Add case
571 RESERVED_CODE.
572 (Output_data_got::add_global): Call add_got_entry.
573 (Output_data_got::add_global_plt): Likewise.
574 (Output_data_got::add_global_with_rel): Likewise.
575 (Output_data_got::add_global_with_rela): Likewise.
576 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
577 (Output_data_got::add_global_pair_with_rela): Likewise.
578 (Output_data_got::add_local): Call add_got_entry.
579 (Output_data_got::add_local_plt): Likewise.
580 (Output_data_got::add_local_with_rel): Likewise.
581 (Output_data_got::add_local_with_rela): Likewise.
582 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
583 (Output_data_got::add_local_pair_with_rela): Likewise.
584 (Output_data_got::reserve_slot): New function.
585 (Output_data_got::reserve_slot_for_global): New function.
586 (Output_data_got::add_got_entry): New function.
587 (Output_data_got::add_got_entry_pair): New function.
588 (Output_section::add_output_section_data): Edit FIXME.
589 * output.h
590 (Output_section_data_build::Output_section_data_build): New
591 constructor with size parameter.
592 (Output_data_space::Output_data_space): Likewise.
593 (Output_data_got::Output_data_got): Initialize new data member; new
594 constructor with size parameter.
595 (Output_data_got::add_constant): Call add_got_entry.
596 (Output_data_got::reserve_slot): New function.
597 (Output_data_got::reserve_slot_for_global): New function.
598 (class Output_data_got::Got_entry): Add RESERVED_CODE.
599 (Output_data_got::add_got_entry): New function.
600 (Output_data_got::add_got_entry_pair): New function.
601 (Output_data_got::free_list_): New data member.
602 * target.h (Sized_target::init_got_plt_for_update): New function.
603 (Sized_target::register_global_plt_entry): New function.
604 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
605 Initialize new data member; call init; add constructor with PLT count.
606 (Output_data_plt_x86_64::init): New function.
607 (Output_data_plt_x86_64::add_relocation): New function.
608 (Output_data_plt_x86_64::reserve_slot): New function.
609 (Output_data_plt_x86_64::free_list_): New data member.
610 (Target_x86_64::init_got_plt_for_update): New function.
611 (Target_x86_64::register_global_plt_entry): New function.
612 (Output_data_plt_x86_64::add_entry): Allocate from free list for
613 incremental updates.
614 (Output_data_plt_x86_64::add_relocation): New function.
615 * testsuite/object_unittest.cc (Object_test): Set default options.
616
ec69d6da
ILT
6172011-05-16 Ian Lance Taylor <iant@google.com>
618
619 * options.h (class General_options): Make -i a synonym for -r.
620
732e31de
ILT
6212011-05-16 Ian Lance Taylor <iant@google.com>
622
623 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
624
403676b5
CC
6252011-05-10 Cary Coutant <ccoutant@google.com>
626
627 * object.cc (Sized_relobj::do_count_local_symbols): Check for
628 strip_all (-s).
629
5b7b7d6e
ILT
6302011-05-06 Ian Lance Taylor <iant@google.com>
631
632 * layout.cc (Layout::layout): If the output section flags change,
633 update the ordering.
634
f0f9babf
CC
6352011-04-25 Cary Coutant <ccoutant@google.com>
636
637 * incremental-dump.cc (dump_incremental_inputs): Print local
638 symbol info for each input file.
639 * incremental.cc
640 (Output_section_incremental_inputs::set_final_data_size): Add local
641 symbol info to input file entries in incremental info.
642 (Output_section_incremental_inputs::write_info_blocks): Likewise.
643 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
644 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
645 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
646 implementation.
647 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
648 (Sized_incr_relobj::do_relocate): Write the local symbols.
649 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
650 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
651 Adjust size of input file header.
652 (Incremental_inputs_reader::get_local_symbol_offset): New function.
653 (Incremental_inputs_reader::get_local_symbol_count): New function.
654 (Incremental_inputs_reader::get_input_section): Adjust size of input
655 file header.
656 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
657 (Sized_incr_relobj::This): New typedef.
658 (Sized_incr_relobj::sym_size): New const data member.
659 (Sized_incr_relobj::Local_symbol): New struct.
660 (Sized_incr_relobj::do_output_local_symbol_count): New function.
661 (Sized_incr_relobj::do_local_symbol_offset): New function.
662 (Sized_incr_relobj::local_symbol_count_): New data member.
663 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
664 (Sized_incr_relobj::local_symbol_index_): New data member.
665 (Sized_incr_relobj::local_symbol_offset_): New data member.
666 (Sized_incr_relobj::local_dynsym_offset_): New data member.
667 (Sized_incr_relobj::local_symbols_): New data member.
668 * object.h (Relobj::output_local_symbol_count): New function.
669 (Relobj::local_symbol_offset): New function.
670 (Relobj::do_output_local_symbol_count): New function.
671 (Relobj::do_local_symbol_offset): New function.
672 (Sized_relobj::do_output_local_symbol_count): New function.
673 (Sized_relobj::do_local_symbol_offset): New function.
674
d0a9ace3
ILT
6752011-04-22 Vladimir Simonov <sv@sw.ru>
676
677 * descriptors.cc (set_close_on_exec): New function.
678 (Descriptors::open): Use set_close_on_exec.
679 * output.cc (S_ISLNK): Define if not defined.
680
94a3fc8b
CC
6812011-04-22 Cary Coutant <ccoutant@google.com>
682
683 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
684 global symbol map.
685 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
686 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
687 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
688 relocations.
689 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
690 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
691 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
692 * incremental.h
693 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
694 function.
695 (Incremental_binary::apply_incremental_relocs): New function.
696 (Incremental_binary::do_apply_incremental_relocs): New function.
697 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
698 data member.
699 (Sized_incremental_binary::add_global_symbol): New function.
700 (Sized_incremental_binary::global_symbol): New function.
701 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
702 (Sized_incremental_binary::symbol_map_): New data member.
703 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
704 * target.h (Sized_target::apply_relocation): New function.
705 * target-reloc.h (apply_relocation): New function.
706 * x86_64.cc (Target_x86_64::apply_relocation): New function.
707
c87e4302
DK
7082011-04-22 Doug Kwan <dougkwan@google.com>
709
710 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
711 flag of a SHT_ARM_EXIDX section.
712 * testsuite/Makefile.am (arm_exidx_test): New test rules.
713 * testsuite/Makefile.in: Regenerate.
714 * testsuite/arm_exidx_test.s: New file.
715 * testsuite/arm_exidx_test.sh: Same.
716
e7782cf6
CC
7172011-04-20 Cary Coutant <ccoutant@google.com>
718
719 PR gold/12689
720 * archive.h (Incremental_archive_entry::Archive_member):
721 Initialize arg_serial_ (second constructor).
722
308ecdc7
ILT
7232011-04-17 Ian Lance Taylor <iant@google.com>
724
725 * object.cc (Relocate_info::location): Simplify location string.
726 * errors.cc (Errors::error_at_location): Don't print program
727 name.
728 (Errors::warning_at_location): Likewise.
729 (Errors::undefined_symbol): Likewise.
730 * testsuite/debug_msg.sh: Update accordingly.
731
bec5b579
CC
7322011-04-14 Cary Coutant <ccoutant@google.com>
733
734 * gold/layout.cc (Layout::symtab_section_offset): New function.
735 * gold/layout.h (Layout::symtab_section_offset): New function.
736 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
737
88597d34
ILT
7382011-04-12 Ian Lance Taylor <iant@google.com>
739
740 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
741 with MREMAP_MAYMOVE.
742 * output.h (class Output_file): Add map_is_allocated_ field.
743 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
744 not available, provide stubs. If mremap is not available, #define
745 it to gold_mremap.
746 (MREMAP_MAYMOVE): Define if not defined.
747 (Output_file::Output_file): Initialize map_is_allocated_.
748 (Output_file::resize): Check map_is_allocated_.
749 (Output_file::map_anonymous): If mmap fails, use malloc.
750 (Output_file::unmap): Don't do anything for an anonymous map.
751 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
752 is not available, provide stubs.
753 (File_read::View::~View): Use free rather than delete[].
754 (File_read::make_view): Use malloc rather than new[]. If mmap
755 fails, use malloc.
756 (File_read::find_or_make_view): Use malloc rather than new[].
757 * gold.h: Remove HAVE_REMAP code.
758 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
759 exists. Rename mremap to gold_mremap. If mmap is not available
760 don't do anything.
761 * configure, config.in: Rebuild.
762
11e361bc
ILT
7632011-04-11 Ian Lance Taylor <iant@google.com>
764
765 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
766 initialize local variable v.
767
cdc29364
CC
7682011-04-11 Cary Coutant <ccoutant@google.com>
769
770 * archive.cc (Archive::include_member): Adjust call to
771 report_object.
772 (Add_archive_symbols::run): Track argument serial numbers.
773 (Lib_group::include_member): Likewise.
774 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
775 * archive.h (Incremental_archive_entry::Archive_member):
776 Initialize arg_serial_.
777 (Archive_member::arg_serial_): New data member.
778 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
779 (Sized_dynobj::do_add_symbols): Track symbols when doing an
780 incremental link.
781 (Sized_dynobj::do_for_all_local_got_entries): New function.
782 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
783 function.
784 * fileread.cc (get_mtime): New function.
785 * fileread.h (get_mtime): New function.
786 * gold.cc (queue_initial_tasks): Check for incremental update.
787 (process_incremental_input): New function.
788 (queue_middle_tasks): Don't force valid target for incremental
789 update.
790 * incremental-dump.cc (find_input_containing_global): Adjust
791 size of symbol info entry.
792 (dump_incremental_inputs): Dump argument serial number and
793 in_system_directory flag; bias shndx by 1; print symbol names
794 when dumping per-file symbol lists; use new symbol info readers.
795 * incremental.cc
796 (Output_section_incremental_inputs:update_data_size): New function.
797 (Sized_incremental_binary::setup_readers): Setup input readers
798 for each input file; build maps for files added from libraries
799 and scripts.
800 (Sized_incremental_binary::check_input_args): New function.
801 (Sized_incremental_binary::do_check_inputs): Build map of argument
802 serial numbers to input arguments.
803 (Sized_incremental_binary::do_file_has_changed): Rename
804 do_file_is_unchanged to this; compare file modification times.
805 (Sized_incremental_binary::do_init_layout): New function.
806 (Sized_incremental_binary::do_reserve_layout): New function.
807 (Sized_incremental_binary::do_get_input_reader): Remove.
808 (Sized_incremental_binary::get_symtab_view): New function.
809 (Incremental_checker::can_incrementally_link_output_file): Remove.
810 (Incremental_inputs::report_command_line): Exclude --debug options.
811 (Incremental_inputs::report_archive_begin): Add parameter; track
812 argument serial numbers; don't put input file entry for archive
813 before archive members.
814 (Incremental_inputs::report_archive_end): Put input file entry
815 for archive after archive members.
816 (Incremental_inputs::report_object): Add parameter; track argument
817 serial numbers and in_system_directory flag.
818 (Incremental_inputs::report_script): Add parameter; track argument
819 serial numbers.
820 (Output_section_incremental_inputs::set_final_data_size): Adjust
821 size of symbol info entry; check for forwarding symbols.
822 (Output_section_incremental_inputs::write_input_files): Write
823 in_system_directory flag and argument serial number.
824 (Output_section_incremental_inputs::write_info_blocks): Map section
825 indices between incremental info and original input file; store
826 input section index for each symbol.
827 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
828 change operator() to visit().
829 (class Global_got_offset_visitor): Likewise.
830 (class Global_symbol_visitor_got_plt):
831 (Output_section_incremental_inputs::write_got_plt): Use new visitor
832 classes.
833 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
834 (Sized_incr_relobj::do_read_symbols): New function.
835 (Sized_incr_relobj::do_layout): New function.
836 (Sized_incr_relobj::do_layout_deferred_sections): New function.
837 (Sized_incr_relobj::do_add_symbols): New function.
838 (Sized_incr_relobj::do_should_include_member): New function.
839 (Sized_incr_relobj::do_for_all_global_symbols): New function.
840 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
841 (Sized_incr_relobj::do_section_size): New function.
842 (Sized_incr_relobj::do_section_name): New function.
843 (Sized_incr_relobj::do_section_contents): New function.
844 (Sized_incr_relobj::do_section_flags): New function.
845 (Sized_incr_relobj::do_section_entsize): New function.
846 (Sized_incr_relobj::do_section_address): New function.
847 (Sized_incr_relobj::do_section_type): New function.
848 (Sized_incr_relobj::do_section_link): New function.
849 (Sized_incr_relobj::do_section_info): New function.
850 (Sized_incr_relobj::do_section_addralign): New function.
851 (Sized_incr_relobj::do_initialize_xindex): New function.
852 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
853 (Sized_incr_relobj::do_read_relocs): New function.
854 (Sized_incr_relobj::do_gc_process_relocs): New function.
855 (Sized_incr_relobj::do_scan_relocs): New function.
856 (Sized_incr_relobj::do_count_local_symbols): New function.
857 (Sized_incr_relobj::do_finalize_local_symbols): New function.
858 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
859 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
860 (Sized_incr_relobj::do_relocate): New function.
861 (Sized_incr_relobj::do_set_section_offset): New function.
862 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
863 (Sized_incr_dynobj::do_read_symbols): New function.
864 (Sized_incr_dynobj::do_layout): New function.
865 (Sized_incr_dynobj::do_add_symbols): New function.
866 (Sized_incr_dynobj::do_should_include_member): New function.
867 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
868 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
869 (Sized_incr_dynobj::do_section_size): New function.
870 (Sized_incr_dynobj::do_section_name): New function.
871 (Sized_incr_dynobj::do_section_contents): New function.
872 (Sized_incr_dynobj::do_section_flags): New function.
873 (Sized_incr_dynobj::do_section_entsize): New function.
874 (Sized_incr_dynobj::do_section_address): New function.
875 (Sized_incr_dynobj::do_section_type): New function.
876 (Sized_incr_dynobj::do_section_link): New function.
877 (Sized_incr_dynobj::do_section_info): New function.
878 (Sized_incr_dynobj::do_section_addralign): New function.
879 (Sized_incr_dynobj::do_initialize_xindex): New function.
880 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
881 (make_sized_incremental_object): New function.
882 (Incremental_library::copy_unused_symbols): New function.
883 (Incremental_library::do_for_all_unused_symbols): New function.
884 * incremental.h (enum Incremental_input_flags): New type.
885 (class Incremental_checker): Remove.
886 (Incremental_input_entry::Incremental_input_entry): Add argument
887 serial number.
888 (Incremental_input_entry::arg_serial): New function.
889 (Incremental_input_entry::set_is_in_system_directory): New function.
890 (Incremental_input_entry::is_in_system_directory): New function.
891 (Incremental_input_entry::arg_serial_): New data member.
892 (Incremental_input_entry::is_in_system_directory_): New data member.
893 (class Script_info): Move here from script.h.
894 (Script_info::Script_info): Add filename parameter.
895 (Script_info::filename): New function.
896 (Script_info::filename_): New data member.
897 (Incremental_script_entry::Incremental_script_entry): Add argument
898 serial number.
899 (Incremental_object_entry::Incremental_object_entry): Likewise.
900 (Incremental_object_entry::add_input_section): Build list of input
901 sections with map to original shndx.
902 (Incremental_object_entry::get_input_section_index): New function.
903 (Incremental_object_entry::shndx_): New data member.
904 (Incremental_object_entry::name_key_): Rename; adjust all refs.
905 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
906 (Incremental_archive_entry::Incremental_archive_entry): Add argument
907 serial number.
908 (Incremental_inputs::report_archive_begin): Likewise.
909 (Incremental_inputs::report_object): Likewise.
910 (Incremental_inputs::report_script): Likewise.
911 (class Incremental_global_symbol_reader): New class.
912 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
913 and store flags and input file type.
914 (Incremental_input_entry_reader::arg_serial): New function.
915 (Incremental_input_entry_reader::type): Extract type from flags.
916 (Incremental_input_entry_reader::is_in_system_directory): New function.
917 (Incremental_input_entry_reader::get_input_section_count): Call
918 accessor function for type.
919 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
920 function for type; adjust size of global symbol entry.
921 (Incremental_input_entry_reader::get_global_symbol_count): Call
922 accessor function for type.
923 (Incremental_input_entry_reader::get_object_count): Likewise.
924 (Incremental_input_entry_reader::get_object_offset): Likewise.
925 (Incremental_input_entry_reader::get_member_count): Likewise.
926 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
927 (Incremental_input_entry_reader::get_member_offset): Likewise.
928 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
929 (Incremental_input_entry_reader::Global_symbol_info): Remove.
930 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
931 (Incremental_input_entry_reader::get_global_symbol_reader): New
932 function.
933 (Incremental_input_entry_reader::get_output_symbol_index): New
934 function.
935 (Incremental_input_entry_reader::type_): Remove.
936 (Incremental_input_entry_reader::flags_): New data member.
937 (Incremental_inputs_reader::input_file_offset): New function.
938 (Incremental_inputs_reader::input_file_index): New function.
939 (Incremental_inputs_reader::input_file): Call input_file_offset.
940 (Incremental_inputs_reader::input_file_at_offset): New function.
941 (Incremental_relocs_reader::get_r_type): Reformat.
942 (Incremental_relocs_reader::get_r_shndx): Reformat.
943 (Incremental_relocs_reader::get_r_offset): Reformat.
944 (Incremental_relocs_reader::data): New function.
945 (Incremental_binary::Incremental_binary): Initialize new data members.
946 (Incremental_binary::check_inputs): Add cmdline parameter.
947 (Incremental_binary::file_is_unchanged): Remove.
948 (Input_reader::arg_serial): New function.
949 (Input_reader::get_unused_symbol_count): New function.
950 (Input_reader::get_unused_symbol): New function.
951 (Input_reader::do_arg_serial): New function.
952 (Input_reader::do_get_unused_symbol_count): New function.
953 (Input_reader::do_get_unused_symbol): New function.
954 (Incremental_binary::input_file_count): New function.
955 (Incremental_binary::get_input_reader): Change signature to use
956 index instead of filename.
957 (Incremental_binary::file_has_changed): New function.
958 (Incremental_binary::get_input_argument): New function.
959 (Incremental_binary::get_library): New function.
960 (Incremental_binary::get_script_info): New function.
961 (Incremental_binary::init_layout): New function.
962 (Incremental_binary::reserve_layout): New function.
963 (Incremental_binary::output_file): New function.
964 (Incremental_binary::do_check_inputs): New function.
965 (Incremental_binary::do_file_is_unchanged): Remove.
966 (Incremental_binary::do_file_has_changed): New function.
967 (Incremental_binary::do_init_layout): New function.
968 (Incremental_binary::do_reserve_layout): New function.
969 (Incremental_binary::do_input_file_count): New function.
970 (Incremental_binary::do_get_input_reader): Change signature.
971 (Incremental_binary::input_args_map_): New data member.
972 (Incremental_binary::library_map_): New data member.
973 (Incremental_binary::script_map_): New data member.
974 (Sized_incremental_binary::Sized_incremental_binary): Initialize
975 new data members.
976 (Sized_incremental_binary::output_section): New function.
977 (Sized_incremental_binary::inputs_reader): Add const.
978 (Sized_incremental_binary::symtab_reader): Add const.
979 (Sized_incremental_binary::relocs_reader): Add const.
980 (Sized_incremental_binary::got_plt_reader): Add const.
981 (Sized_incremental_binary::get_symtab_view): New function.
982 (Sized_incremental_binary::Inputs_reader): New typedef.
983 (Sized_incremental_binary::Input_entry_reader): New typedef.
984 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
985 (Sized_incremental_binary::do_file_is_unchanged): Remove.
986 (Sized_incremental_binary::do_file_has_changed): New function.
987 (Sized_incremental_binary::do_init_layout): New function.
988 (Sized_incremental_binary::do_reserve_layout): New function.
989 (Sized_input_reader::Inputs_reader): Remove.
990 (Sized_input_reader::Input_entry_reader): Remove.
991 (Sized_input_reader::do_arg_serial): New function.
992 (Sized_input_reader::do_get_unused_symbol_count): New function.
993 (Sized_input_reader::do_get_unused_symbol): New function.
994 (Sized_incremental_binary::do_input_file_count): New function.
995 (Sized_incremental_binary::do_get_input_reader): Change signature;
996 use index instead of filename.
997 (Sized_incremental_binary::section_map_): New data member.
998 (Sized_incremental_binary::input_entry_readers_): New data member.
999 (class Sized_incr_relobj): New class.
1000 (class Sized_incr_dynobj): New class.
1001 (make_sized_incremental_object): New function.
1002 (class Incremental_library): New class.
1003 * layout.cc (Free_list::num_lists): New static data member.
1004 (Free_list::num_nodes): New static data member.
1005 (Free_list::num_removes): New static data member.
1006 (Free_list::num_remove_visits): New static data member.
1007 (Free_list::num_allocates): New static data member.
1008 (Free_list::num_allocate_visits): New static data member.
1009 (Free_list::init): New function.
1010 (Free_list::remove): New function.
1011 (Free_list::allocate): New function.
1012 (Free_list::dump): New function.
1013 (Free_list::print_stats): New function.
1014 (Layout_task_runner::run): Resize output file for incremental updates.
1015 (Layout::Layout): Initialize new data members.
1016 (Layout::set_incremental_base): New function.
1017 (Layout::init_fixed_output_section): New function.
1018 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1019 incremental updates.
1020 (Layout::create_gold_note): Do not create gold note section for
1021 incremental updates.
1022 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1023 for incremental updates.
1024 (Layout::set_section_offsets): For incremental updates, allocate space
1025 from free list.
1026 (Layout::create_symtab_sections): Layout with offsets relative to
1027 start of section; for incremental updates, allocate space from free
1028 list.
1029 (Layout::create_shdrs): For incremental updates, allocate space from
1030 free list.
1031 (Layout::finish_dynamic_section): For incremental updates, do not
1032 check --as-needed (fixed in subsequent patch).
1033 * layout.h (class Free_list): New class.
1034 (Layout::set_incremental_base): New function.
1035 (Layout::incremental_base): New function.
1036 (Layout::init_fixed_output_section): New function.
1037 (Layout::allocate): New function.
1038 (Layout::incremental_base_): New data member.
1039 (Layout::free_list_): New data member.
1040 * main.cc (main): Print Free_list statistics.
1041 * object.cc (Relobj::finalize_incremental_relocs): Add
1042 clear_counts parameter; clear counts only when clear_counts is set.
1043 (Sized_relobj::Sized_relobj): Initialize new base class.
1044 (Sized_relobj::do_layout): Don't report special sections.
1045 (Sized_relobj::do_for_all_local_got_entries): New function.
1046 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1047 symtab_off to all symbol table offsets.
1048 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1049 * object.h (class Got_offset_list): Move to top of file.
1050 (Object::Object): Allow case where input_file == NULL.
1051 (Object::~Object): Likewise.
1052 (Object::input_file): Assert that input_file != NULL.
1053 (Object::lock): Allow case where input_file == NULL.
1054 (Object::unlock): Likewise.
1055 (Object::is_locked): Likewise.
1056 (Object::token): Likewise.
1057 (Object::release): Likewise.
1058 (Object::is_incremental): New function.
1059 (Object::get_mtime): New function.
1060 (Object::for_all_local_got_entries): New function.
1061 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1062 (Object::set_is_in_system_directory): New function.
1063 (Object::is_in_system_directory): New function.
1064 (Object::do_is_incremental): New function.
1065 (Object::do_get_mtime): New function.
1066 (Object::do_for_all_local_got_entries): New function.
1067 (Object::is_in_system_directory_): New data member.
1068 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1069 (class Sized_relobj_base): New class.
1070 (class Sized_relobj): Derive from Sized_relobj_base.
1071 (class Sized_relobj::Symbols): Redeclare from base class.
1072 (class Sized_relobj::local_got_offset_list): Remove.
1073 (class Sized_relobj::Output_sections): Redeclare from base class.
1074 (class Sized_relobj::do_for_all_local_got_entries): New function.
1075 (class Sized_relobj::write_local_symbols): Add offset parameter.
1076 (class Sized_relobj::local_symbol_offset_): Update comment.
1077 (class Sized_relobj::local_dynsym_offset_): Update comment.
1078 * options.cc (Input_arguments::add_file): Remove const.
1079 * options.h (Input_file_argument::Input_file_argument):
1080 Initialize arg_serial_ (all constructors).
1081 (Input_file_argument::set_arg_serial): New function.
1082 (Input_file_argument::arg_serial): New function.
1083 (Input_file_argument::arg_serial_): New data member.
1084 (Input_arguments::Input_arguments): Initialize file_count_.
1085 (Input_arguments::add_file): Remove const.
1086 (Input_arguments::number_of_input_files): New function.
1087 (Input_arguments::file_count_): New data member.
1088 (Command_line::number_of_input_files): Call
1089 Input_arguments::number_of_input_files.
1090 * output.cc (Output_segment_headers::Output_segment_headers):
1091 Set current size.
1092 (Output_section::Input_section::current_data_size): New function.
1093 (Output_section::Output_section): Initialize new data members.
1094 (Output_section::add_input_section): Don't do merge sections for
1095 an incremental link; allocate space from free list for an
1096 incremental update.
1097 (Output_section::add_output_section_data): Allocate space from
1098 free list for an incremental update.
1099 (Output_section::update_data_size): New function.
1100 (Output_section::set_fixed_layout): New function.
1101 (Output_section::reserve): New function.
1102 (Output_segment::set_section_addresses): Remove const.
1103 (Output_segment::set_section_list_addresses): Remove const; allocate
1104 space from free list for an incremental update.
1105 (Output_segment::set_offset): Adjust size of RELRO segment for an
1106 incremental update.
1107 * output.h (Output_data::current_data_size): Move here from
1108 child classes.
1109 (Output_data::pre_finalize_data_size): New function.
1110 (Output_data::update_data_size): New function.
1111 (Output_section_headers::update_data_size): new function.
1112 (Output_section_data_build::current_data_size): Move to Output_data.
1113 (Output_data_strtab::update_data_size): New function.
1114 (Output_section::current_data_size): Move to Output_data.
1115 (Output_section::set_fixed_layout): New function.
1116 (Output_section::has_fixed_layout): New function.
1117 (Output_section::reserve): New function.
1118 (Output_section::update_data_size): New function.
1119 (Output_section::has_fixed_layout_): New data member.
1120 (Output_section::free_list_): New data member.
1121 (Output_segment::set_section_addresses): Remove const.
1122 (Output_segment::set_section_list_addresses): Remove const.
1123 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1124 New function.
1125 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1126 New function.
1127 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1128 parameter when calling Add_symbols constructor; store argument
1129 serial number for members of a lib group.
1130 (Add_symbols::locks): Allow case where token == NULL.
1131 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1132 (Read_member::~Read_member): New function.
1133 (Read_member::is_runnable): New function.
1134 (Read_member::locks): New function.
1135 (Read_member::run): New function.
1136 (Check_script::~Check_script): New function.
1137 (Check_script::is_runnable): New function.
1138 (Check_script::locks): New function.
1139 (Check_script::run): New function.
1140 (Check_library::~Check_library): New function.
1141 (Check_library::is_runnable): New function.
1142 (Check_library::locks): New function.
1143 (Check_library::run): New function.
1144 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1145 (Add_symbols::library_): New data member.
1146 (class Read_member): New class.
1147 (class Check_script): New class.
1148 (class Check_library): New class.
1149 * reloc.cc (Read_relocs::is_runnable): Allow case where
1150 token == NULL.
1151 (Read_relocs::locks): Likewise.
1152 (Scan_relocs::locks): Likewise.
1153 (Relocate_task::locks): Likewise.
1154 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1155 to clear counters.
1156 (Sized_relobj::incremental_relocs_scan): Fix comment.
1157 (Sized_relobj::do_relocate): Pass output file offset to
1158 write_local_symbols.
1159 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1160 from class declaration.
1161 * script.cc (read_input_script): Allocate Script_info; pass
1162 argument serial number to report_script.
1163 * script.h (class Script_info): Move to incremental.h.
1164 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1165 * symtab.h (Symbol_table::add_from_incrobj): New function.
1166 (Symbol_table::set_file_offset): New function.
1167
b961d0d7
CC
11682011-04-05 Cary Coutant <ccoutant@google.com>
1169
1170 * incremental-dump.cc (dump_incremental_inputs): Change signature
1171 to take a Sized_incremental_binary; change caller. Use readers
1172 in Sized_incremental_binary.
1173 * incremental.cc
1174 (Sized_incremental_binary::find_incremental_inputs_sections):
1175 Rename do_find_incremental_inputs_sections to this.
1176 (Sized_incremental_binary::setup_readers): New function.
1177 (Sized_incremental_binary::do_check_inputs): Check
1178 has_incremental_info_ flag; move setup code to setup_readers;
1179 use input readers.
1180 (Sized_incremental_binary::do_file_is_unchanged): New function.
1181 (Sized_incremental_binary::do_get_input_reader): New function.
1182 * incremental.h (class Incremental_binary): Move to end of file.
1183 (Incremental_binary::file_is_unchanged): New function.
1184 (Incremental_binary::do_file_is_unchanged): New function.
1185 (Incremental_binary::Input_reader): New class.
1186 (Incremental_binary::get_input_reader): New function.
1187 (class Sized_incremental_binary): Move to end of file.
1188 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1189 input section reader classes.
1190 (Sized_incremental_binary::has_incremental_info): New function.
1191 (Sized_incremental_binary::inputs_reader): New function.
1192 (Sized_incremental_binary::symtab_reader): New function.
1193 (Sized_incremental_binary::relocs_reader): New function.
1194 (Sized_incremental_binary::got_plt_reader): New function.
1195 (Sized_incremental_binary::do_file_is_unchanged): New function.
1196 (Sized_incremental_binary::Sized_input_reader): New class.
1197 (Sized_incremental_binary::get_input_reader): New function.
1198 (Sized_incremental_binary::find_incremental_inputs_sections):
1199 Rename do_find_incremental_inputs_sections to this.
1200 (Sized_incremental_binary::setup_readers): New function.
1201 (Sized_incremental_binary::has_incremental_info_): New data member.
1202 (Sized_incremental_binary::inputs_reader_): New data member.
1203 (Sized_incremental_binary::symtab_reader_): New data member.
1204 (Sized_incremental_binary::relocs_reader_): New data member.
1205 (Sized_incremental_binary::got_plt_reader_): New data member.
1206 (Sized_incremental_binary::current_input_file_): New data member.
1207
a869183f
PP
12082011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1209
1210 PR gold/12640
1211 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1212 violation.
1213
12142011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1215
1216 * archive.cc (Archive::include_member): Adjust call to report_object.
1217 (Add_archive_symbols::run): Add script_info to call to
1218 report_archive_begin.
1219 (Lib_group::include_member): Adjust call to report_object.
1220 (Add_lib_group_symbols::run): Adjust call to report_object.
1221 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1222 blocks. Add object count for script input files.
1223 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1224 script_info parameter; change all callers.
1225 (Incremental_inputs::report_object): Add script_info parameter;
1226 change all callers.
1227 (Incremental_inputs::report_script): Store backpointer to
1228 incremental info entry.
1229 (Output_section_incremental_inputs::set_final_data_size): Record
1230 additional information for scripts.
1231 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1232 * incremental.h (Incremental_script_entry::add_object): New function.
1233 (Incremental_script_entry::get_object_count): New function.
1234 (Incremental_script_entry::get_object): New function.
1235 (Incremental_script_entry::objects_): New data member; adjust
1236 constructor.
1237 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1238 (Incremental_inputs::report_object): Add script_info parameter.
1239 (Incremental_inputs_reader::get_object_count): New function.
1240 (Incremental_inputs_reader::get_object_offset): New function.
1241 * options.cc (Input_arguments::add_file): Return reference to
1242 new input argument.
1243 * options.h (Input_argument::set_script_info): New function.
1244 (Input_argument::script_info): New function.
1245 (Input_argument::script_info_): New data member; adjust all
1246 constructors.
1247 (Input_file_group::add_file): Return reference to new input argument.
1248 (Input_file_lib::add_file): Likewise.
1249 (Input_arguments::add_file): Likewise.
1250 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1251 * script.cc (Parser_closure::Parser_closure): Add script_info
1252 parameter; adjust all callers.
1253 (Parser_closure::script_info): New function.
1254 (Parser_closure::script_info_): New data member.
1255 (read_input_script): Report scripts earlier to incremental info.
1256 (script_add_file): Set script_info in Input_argument.
1257 (script_add_library): Likewise.
1258 * script.h (Script_options::Script_info): Rewrite class.
1259
a869183f 12602011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1261
1262 * archive.cc (Library_base::should_include_member): Move
1263 method here from class Archive.
1264 (Archive::Archive): Initialize base class.
1265 (Archive::should_include_member): Move to base class.
1266 (Archive::do_for_all_unused_symbols): New function.
1267 (Add_archive_symbols::run): Remove redundant access to
1268 incremental_inputs.
1269 (Lib_group::Lib_group): Initialize base class.
1270 (Lib_group::do_filename): New function.
1271 (Lib_group::include_member): Pass pointer to Lib_group to
1272 report_object.
1273 (Lib_group::do_for_all_unused_symbols): New function.
1274 (Add_lib_group_symbols::run): Report archive information for
1275 incremental links.
1276 * archive.h (class Library_base): New base class.
1277 (class Archive): Derive from Library_base.
1278 (Archive::filename): Move to base class.
1279 (Archive::set_incremental_info): Likewise.
1280 (Archive::incremental_info): Likewise.
1281 (Archive::Should_include): Likewise.
1282 (Archive::should_include_member): Likewise.
1283 (Archive::Armap_entry): Remove.
1284 (Archive::Unused_symbol_iterator): Remove.
1285 (Archive::unused_symbols_begin): Remove.
1286 (Archive::unused_symbols_end): Remove.
1287 (Archive::do_filename): New function.
1288 (Archive::do_get_mtime): New function.
1289 (Archive::do_for_all_unused_symbols): New function.
1290 (Archive::task_): Move to base class.
1291 (Archive::incremental_info_): Likewise.
1292 (class Lib_group): Derive from Library_base.
1293 (Lib_group::do_filename): New function.
1294 (Lib_group::do_get_mtime): New function.
1295 (Lib_group::do_for_all_unused_symbols): New function.
1296 (Lib_group::task_): Move to base class.
1297 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1298 function.
1299 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1300 function.
1301 * incremental.cc (Incremental_inputs::report_archive_begin):
1302 Use Library_base; call library's get_mtime; add incremental inputs
1303 entry before members.
1304 (class Unused_symbol_visitor): New class.
1305 (Incremental_inputs::report_archive_end): Use Library_base; use
1306 visitor class to record unused symbols; don't add incremental inputs
1307 entry after members.
1308 (Incremental_inputs::report_object): Use Library_base.
1309 * incremental.h
1310 (Incremental_archive_entry::Incremental_archive_entry): Remove
1311 unused Archive parameter.
1312 (Incremental_inputs::report_archive_begin): Use Library_base.
1313 (Incremental_inputs::report_archive_end): Likewise.
1314 (Incremental_inputs::report_object): Likewise.
1315 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1316 function.
1317 * object.h (Object::for_all_global_symbols): New function.
1318 (Object::do_for_all_global_symbols): New function.
1319 (Sized_relobj::do_for_all_global_symbols): New function.
1320 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1321 function.
1322 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1323 function.
1324
61ab3e40
ILT
13252011-03-27 Ian Lance Taylor <iant@google.com>
1326
1327 * archive.cc (Archive::interpret_header): Return -1 if something
1328 goes wrong. Change callers accordingly.
1329
30e1f9e6
CC
13302011-03-25 Cary Coutant <ccoutant@google.com>
1331
1332 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1333 * testsuite/Makefile.in: Regenerate.
1334
9c793f14
RÁE
13352010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1336
1337 * plugin.cc (get_view): New.
1338 (Plugin::load): Pass get_view to the plugin.
1339 (Plugin_manager::get_view): New.
1340
9312bb0a
ILT
13412011-03-21 Ian Lance Taylor <iant@google.com>
1342
1343 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1344 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1345
7e12ba9e
ST
13462011-03-21 Sriraman Tallam <tmsriram@google.com>
1347
1348 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1349 Change == to -eq.
1350 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1351 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1352 Change == to -eq.
1353 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1354 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1355
fd7a005d
ILT
13562011-03-14 Ian Lance Taylor <iant@google.com>
1357
1358 * script-sections.cc (Sort_output_sections::script_compare):
1359 Rename from is_before, change return type.
1360 (Sort_output_sections::operator()): Adjust accordingly.
1361
ed16fd1b
ILT
13622011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1363
1364 PR gold/12572
1365 * testsuite/odr_violation2.cc: Add comment to make all error line
1366 numbers double digits.
1367 * testsuite/debug_msg.sh: Adjust expected errors.
1368
71ff8986
ILT
13692011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1370
1371 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1372 but mark earlier ones as non-canonical
1373 (offset_to_iterator): Update search target and example
1374 (do_addr2line): Return extra lines in a vector*
1375 (format_file_lineno): Extract from do_addr2line
1376 (one_addr2line): Add vector* out-param
1377 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1378 when a lineno entry appeared last for its instruction
1379 (Dwarf_line_info): Add vector* out-param
1380 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1381 * symtab.cc (Odr_violation_compare): Include the lineno in the
1382 comparison again.
1383 (linenos_from_loc): New. Combine the canonical line for an
1384 address with its other lines.
1385 (True_if_intersect): New. Helper functor to make
1386 std::set_intersection a query.
1387 (detect_odr_violations): Compare sets of lines instead of just
1388 one line for each function. This became less deterministic, but
1389 has fewer false positives.
1390 * symtab.h: Declarations.
1391 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1392 mix an optimized and non-optimized object in the same binary
1393 (odr_violation2.so): Same.
1394 * testsuite/Makefile.in: Regenerate from Makefile.am.
1395 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1396 * testsuite/debug_msg.sh: Update line numbers and add
1397 assertions.
1398 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1399 non-optimized context.
1400 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1401 isn't inlined, and use OdrDerived in an optimized context.
1402 * testsuite/odr_header1.h: Defines OdrDerived, where
1403 optimization will change the
1404 first-instruction-in-the-destructor's file and line number.
1405 * testsuite/odr_header2.h: Defines OdrBase.
1406
a19fefdc
ILT
14072011-03-09 Ian Lance Taylor <iant@google.com>
1408
1409 * fileread.cc (File_read::clear_views): Don't delete the whole
1410 file view.
1411
ecb351e9
ILT
14122011-03-08 Ian Lance Taylor <iant@google.com>
1413
1414 PR gold/12525
1415 * fileread.cc: #include <climits>.
1416 (GOLD_IOV_MAX): Define.
1417 (File_read::read_multiple): Limit number of entries by iov_max.
1418 * fileread.h (class File_read): Always set max_readv_entries to
1419 128.
1420
b821d13c
ILT
14212011-03-07 Ian Lance Taylor <iant@google.com>
1422
1423 PR gold/12525
1424 * options.h (class General_options): Add -dy and -dn.
1425
89243142
CC
14262011-03-02 Cary Coutant <ccoutant@google.com>
1427
1428 * testsuite/script_test_9.t: Add TLS segment.
1429
d0773f31
ILT
14302011-03-02 Simon Baldwin <simonb@google.com>
1431
1432 * configure.ac: Add check for gnu_indirect_function support in
1433 the toolchain building binutils.
1434 * configure: Rebuild.
1435
badc8139
RÁE
14362010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1437
1438 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1439 plugin only symbols.
1440 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1441 in plugin files as not needed in the symbol table.
1442
4cf7a849
ST
14432011-02-11 Sriraman Tallam <tmsriram@google.com>
1444
1445 * output.cc (Output_section::add_input_section): Delay fill
1446 generation for section ordering.
1447
b578bd7d
ILT
14482011-02-09 Ian Lance Taylor <iant@google.com>
1449
1450 PR gold/12316
1451 * object.h (class Sized_relobj): Remove clear_local_symbols.
1452 * reloc.cc (Sized_relobj::do_relocate): Don't call
1453 clear_local_symbols.
1454
84ced98a
RÁE
14552010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1456
1457 * plugin.cc (is_visible_from_outside): Return true for symbols
1458 in the -u option.
1459
55382fb7
ILT
14602011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1461
1462 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1463 filename.
1464
4e271fff
ST
14652011-02-02 Sriraman Tallam <tmsriram@google.com>
1466
1467 * icf.h (is_section_foldable_candidate): Change type of parameter
1468 to std::string.
1469 * icf.cc (Icf::find_identical_sections): Change type of local variable
1470 section_name to be std::string.
1471 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1472
d433c3ac
ILT
14732011-01-25 Ian Lance Taylor <iant@google.com>
1474
1475 * script.cc (script_add_extern): Rewrite to use
1476 add_symbol_reference.
1477
880473a6
DK
14782011-01-25 Doug Kwan <dougkwan@google.com>
1479
d433c3ac 1480 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1481
f30f86fa
ILT
14822011-01-24 Ian Lance Taylor <iant@google.com>
1483
1484 * options.h (class General_options): Accept
1485 --no-detect-odr-violations.
1486
8e51a0b9
ILT
14872011-01-24 Ian Lance Taylor <iant@google.com>
1488
1489 * version.cc (version_string): Bump to 1.11.
1490
0f3b89d8
ILT
14912011-01-24 Ian Lance Taylor <iant@google.com>
1492
1493 * plugin.cc (class Plugin_rescan): Define new class.
1494 (Plugin_manager::claim_file): Set any_claimed_.
1495 (Plugin_manager::save_archive): New function.
1496 (Plugin_manager::save_input_group): New function.
1497 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1498 necessary.
1499 (Plugin_manager::new_undefined_symbol): New function.
1500 (Plugin_manager::rescan): New function.
1501 (Plugin_manager::rescannable_defines): New function.
1502 (Plugin_manager::add_input_file): Set any_added_.
1503 * plugin.h (class Plugin_manager): define new fields rescannable_,
1504 undefined_symbols_, any_claimed_, and any_added_. Declare
1505 Plugin_rescan as friend. Declare new functions.
1506 (Plugin_manager::Rescannable): Define type.
1507 (Plugin_manager::Rescannable_list): Define type.
1508 (Plugin_manager::Undefined_symbol_list): Define type.
1509 (Plugin_manager::Plugin_manager): Initialize new fields.
1510 * archive.cc (Archive::defines_symbol): New function.
1511 (Add_archive_symbols::run): Pass archive to plugins if any.
1512 * archive.h (class Archive): Declare defines_symbol.
1513 * readsyms.cc (Input_group::~Input_group): New function.
1514 (Finish_group::run): Pass input_group to plugins if any.
1515 * readsyms.h (class Input_group): Declare destructor.
1516 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1517 any.
1518
3bb951e5
ILT
15192011-01-10 Ian Lance Taylor <iant@google.com>
1520
1521 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1522 section as relro.
1523 (Layout::set_segment_offsets): Reset increase_relro before calling
1524 set_section_addresses a second time.
1525
0aa45fac
CC
15262011-01-04 Cary Coutant <ccoutant@google.com>
1527
1528 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1529 sections before NOBITS sections.
1530
0db46eb4
L
15312011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1532
1533 * version.cc (print_version): Update copyright to 2011.
1534
829c9745
CC
15352010-12-23 Cary Coutant <ccoutant@google.com>
1536
1537 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1538 of OS to this->add. Add OD parameter to second form of the function.
1539
7500420b
ILT
15402010-12-20 Ian Lance Taylor <iant@google.com>
1541
1542 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1543 second of two consecutive entries with same offset.
1544
f8e9a930
RW
15452010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1546
1547 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1548 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1549 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1550 to avoid unneeded links against $(LDADD).
1551 * testsuite/Makefile.in: Regenerate.
1552
2fbb4320
ILT
15532010-12-15 Ian Lance Taylor <iant@google.com>
1554
1555 PR gold/12324
1556 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1557 for R_X86_64_32 and R_X86_64_PC32.
1558 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1559 ver_matching_def_pic.o.
1560 (ver_matching_def_pic.o): New target.
1561
fedb228d
RW
15622010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1563
1564 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1565 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1566 Move definition before File_read::View member definitions.
1567 (File_read::View::~View): Initialize and hold lock before
1568 updating current_mapped_bytes.
1569
9b547ce6
RW
15702010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1571
1572 * dwarf_reader.cc: Remove outdated comment.
1573 * gold-threads.cc: Fix typo in error message.
1574 * archive.cc: Fix typos in comments.
1575 * archive.h: Likewise.
1576 * arm-reloc-property.cc: Likewise.
1577 * arm-reloc-property.h: Likewise.
1578 * arm-reloc.def: Likewise.
1579 * arm.cc: Likewise.
1580 * attributes.h: Likewise.
1581 * cref.cc: Likewise.
1582 * ehframe.cc: Likewise.
1583 * fileread.h: Likewise.
1584 * gold.h: Likewise.
1585 * i386.cc: Likewise.
1586 * icf.cc: Likewise.
1587 * incremental.h: Likewise.
1588 * int_encoding.cc: Likewise.
1589 * layout.h: Likewise.
1590 * main.cc: Likewise.
1591 * merge.h: Likewise.
1592 * object.cc: Likewise.
1593 * object.h: Likewise.
1594 * options.cc: Likewise.
1595 * readsyms.cc: Likewise.
1596 * reduced_debug_output.cc: Likewise.
1597 * reloc.cc: Likewise.
1598 * script-sections.cc: Likewise.
1599 * sparc.cc: Likewise.
1600 * symtab.h: Likewise.
1601 * target-reloc.h: Likewise.
1602 * target.cc: Likewise.
1603 * target.h: Likewise.
1604 * timer.cc: Likewise.
1605 * timer.h: Likewise.
1606 * x86_64.cc: Likewise.
1607
83e17bd5
CC
16082010-12-09 Cary Coutant <ccoutant@google.com>
1609
1610 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1611 stack.
1612 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1613 parameter; change all callers.
1614 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1615 * options.h (warn_execstack): New option.
1616
017257f8
DK
16172010-12-07 Doug Kwan <dougkwan@google.com>
1618
1619 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1620 like function call relocations.
1621
c20cbc06
ILT
16222010-12-07 Ian Lance Taylor <iant@google.com>
1623
1624 * archive.cc (Archive::get_elf_object_for_member): Permit
1625 punconfigured to be NULL.
1626 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1627 (Archive::include_member): Pass NULL to get_elf_object_for_member
1628 if we searched for the archive and this is the first included
1629 object.
1630
4dbfafcc
ILT
16312010-12-01 Ian Lance Taylor <iant@google.com>
1632
1633 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1634 track_relocs_type_ field.
1635 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1636 Set track_relocs_type_.
1637 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1638 contents when using RELA relocs.
1639 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1640 reloc_map_.
1641 * reloc.cc (Track_relocs::next_addend): New function.
1642 * reloc.h (class Track_relocs): Declare next_addend.
1643
e5e19edd
ILT
16442010-12-01 Ian Lance Taylor <iant@google.com>
1645
1646 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1647 virtual destructor.
1648
9a5ce24c
ILT
16492010-12-01 Ian Lance Taylor <iant@google.com>
1650
1651 * README: Update compilers known to work and fail.
1652
c7791212
NC
16532010-11-23 Matthias Klose <doko@ubuntu.com>
1654
1655 * configure.in: For --enable-gold, handle value `default' instead of
1656 `both*'. Always install ld as ld.bfd, install as ld if gold is
1657 not the default.
1658 * configure: Regenerate.
1659
0ad220c9
DK
16602010-11-18 Doug Kwan <dougkwan@google.com>
1661
1662 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1663 and right_alignment to be zero. Store result alignment only if it is
1664 greater than existing alignment.
1665
ab8056e0
CC
16662010-11-16 Cary Coutant <ccoutant@google.com>
1667
1668 PR gold/12220
1669 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1670 Check for ".zdebug_line".
1671
fd064a5b
CC
16722010-11-16 Doug Kwan <dougkwan@google.com>
1673 Cary Coutant <ccoutant@google.com>
1674
1675 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1676 by reference; adjust all callers.
1677 * output.cc (Output_segment::set_section_addresses): Adjust references
1678 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1679 list is empty.
1680 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1681 end at page boundary.
1682
6fc6ea19
CC
16832010-11-16 Cary Coutant <ccoutant@google.com>
1684
1685 PR gold/12220
1686 * layout.cc (Layout::choose_output_section): Transform names of
1687 compressed sections even when using a script with a SECTIONS clause.
1688 (Layout::output_section_name): Remove code to transform
1689 compressed debug section names.
1690 * output.cc (Output_section::add_input_section): Use uncompressed
1691 section size when tracking input sections.
1692
95a2c8d6
RS
16932010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1694
1695 * symtab.h (Symbol::NON_PIC_REF): Remove.
1696 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1697 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1698 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1699 (Symbol::use_plt_offset): Take a flags argument and pass it
1700 directly to needs_dynamic_reloc. Restrict check for undefined
1701 weak symbols to function calls.
1702 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1703 (Target_arm::Scan::global): Use it.
1704 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1705 (Target_arm::Relocate::relocate): Likewise.
1706 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1707 parameter with an r_type parameter. Use get_reference_flags
1708 to get the flags.
1709 (Target_arm::Relocate::relocate): Update accordingly.
1710 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1711 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1712 (Target_i386::Scan::global): Likewise.
1713 (Target_i386::Relocate::relocate): Likewise.
1714 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1715 parameter with an r_type parameter. Use get_reference_flags
1716 to get the flags.
1717 (Target_i386::Relocate::relocate): Update accordingly.
1718 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1719 (Target_powerpc::Scan::global): Use it.
1720 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1721 (Target_powerpc::Relocate::relocate): Likewise.
1722 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1723 (Target_sparc::Scan::global): Use it.
1724 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1725 (Target_sparc::Relocate::relocate): Likewise.
1726 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1727 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1728 (Target_x86_64::Scan::global): Likewise.
1729 (Target_x86_64::Relocate::relocate): Likewise.
1730
f625ae50
DK
17312010-11-08 Doug Kwan <dougkwan@google.com>
1732 Cary Coutant <ccoutant@google.com>
1733
1734 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1735 (Arm_exidx_merge_section::section_contents_): New data member.
1736 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1737 (Arm_input_section::~Arm_input_section): De-allocate memory.
1738 (Arm_input_section::original_contents_): New data member.
1739 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1740 in parameters instead of calling Object::section_contents without
1741 locking.
1742 (Arm_output_section::group_section): New parameter TASK. Pass it
1743 to callees that need locking objects.
1744 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1745 to lock EXIDX input sections. Fix a formatting issue. Call
1746 Arm_exidx_merged_section::build_contents to create merged section
1747 contents.
1748 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1749 to lock object of stub table owner.
1750 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1751 TEXT_SIZE to initialize data member TEXT_SIZE_.
1752 (Arm_exidx_input_section::addralign): Fix typo in comment.
1753 (Arm_exidx_input_section::text_size): New method.
1754 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1755 that require locking objects. Lock objects before scanning for stubs
1756 and updating local symbols.
1757 (Arm_input_section<big_endian>::init): Copy contents of original
1758 input section.
1759 (Arm_input_section<big_endian>::do_write): Use saved contents of
1760 original input section instead of calling Object::section_contents
1761 without locking.
1762 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1763 size without calling Object::section_size().
1764 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1765 for size. Allocate a buffer for merged EXIDX entries.
1766 (Arm_exidx_merged_section::build_contents): New method.
1767 (Arm_exidx_merged_section::do_write): Move merge section contents
1768 building code to Arm_exidx_merged_section::build_contetns. Write
1769 out contetns in buffer instead of building it on the fly.
1770 (Arm_relobj::make_exidx_input_section): Also pass text section size
1771 to Arm_exidx_input_section constructor.
1772 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1773 (Arm_dynobj::do_read_symbols): Fix memory leak.
1774 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1775 * target.h: (class Task): Add forward declaration.
1776 (Target::relax): Add new parameter TASK and pass it to
1777 Target::do_relax().
1778 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1779
5f9bcf58
CC
17802010-11-05 Cary Coutant <ccoutant@google.com>
1781
1782 PR gold/10708
1783 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1784 object when reading from the file.
1785 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1786 second layout pass.
1787 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1788 when reading section contents.
1789 (get_section_contents): Likewise.
1790 (icf::find_identical_sections): Likewise.
1791 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1792 object when reading from the file.
1793 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1794 the object when doing deferred section layout.
1795
e597fa08
NC
17962010-11-03 Nick Clifton <nickc@redhat.com>
1797
1798 PR gold/12001
1799 * script.h (class Symbol_assignment: name): New member. Returns
1800 the name of the symbol.
1801 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1802 Returns true if the given symbol name is on the list of
1803 assignments wating to be processed.
1804 * archive.cc (should_incldue_member): If the symbol is undefined,
1805 check to see if it is on the list of symbols pending assignment.
1806
3f9a3278
ILT
18072010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1808
1809 * script-sections.cc (Script_sections::find_memory_region): Check
1810 for a NULL output section pointer.
1811
d06fb4d1
DK
18122010-10-29 Doug Kwan <dougkwan@google.com>
1813
1814 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1815 Output_section::add_relaxed_input_section.
1816 * output.cc (Output_section::add_relaxed_input_section): Add new
1817 arguments LAYOUT and NAME. Set section order index.
1818 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1819 Copy section order index.
1820 * output.h (Output_section::add_relaxed_input_section): Add new
1821 arguments LAYOUT and NAME.
1822
90e24de5
ILT
18232010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1824
1825 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1826 NATIVE_OR_CROSS_LINKER.
1827 * testsuite/Makefile.in: Regenerate.
1828
c9484ea5
DK
18292010-10-20 Doug Kwan <dougkwan@google.com>
1830
1831 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1832 without SHF_LINK_ORDER flags.
1833 * layout.cc (Layout::choose_output_section): Do not filter
1834 SHF_LINK_ORDER flag in a relocatable link.
1835
5bc2f5be
CC
18362010-10-17 Cary Coutant <ccoutant@google.com>
1837
1838 * output.h (Output_segment::set_section_addresses): Change function
1839 signature. Update all callers.
1840 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1841 sections.
1842 (Output_segment::set_section_addresses): Align after last TLS
1843 section. Add padding before last relro section instead of after.
1844
0c91cf04
DK
18452010-10-17 Doug Kwan <dougkwan@google.com>
1846
1847 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1848 GOT output section to be writable.
1849
8c21d9d3
CC
18502010-10-14 Cary Coutant <ccoutant@google.com>
1851
1852 * debug.h (DEBUG_INCREMENTAL): New flag.
1853 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1854 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1855 mode.
1856 * incremental.cc (report_command_line): Ignore all forms of
1857 --incremental.
1858 * layout.cc (Layout::Layout): Check parameters for incremental link
1859 mode.
1860 * options.cc (General_options::parse_incremental): New function.
1861 (General_options::parse_no_incremental): New function.
1862 (General_options::parse_incremental_full): New function.
1863 (General_options::parse_incremental_update): New function.
1864 (General_options::incremental_mode_): New data member.
1865 (General_options::finalize): Check incremental_mode_.
1866 * options.h (General_options): Update help text for --incremental.
1867 Add --no-incremental, --incremental-full, --incremental-update.
1868 (General_options::Incremental_mode): New enum type.
1869 (General_options::incremental_mode): New function.
1870 (General_options::incremental_mode_): New data member.
1871 * parameters.cc (Parameters::incremental_mode_): New data member.
1872 (Parameters::set_options): Set incremental_mode_.
1873 (Parameters::set_incremental_full): New function.
1874 (Parameters::incremental): New function.
1875 (Parameters::incremental_update): New function.
1876 (set_parameters_incremental_full): New function.
1877 * parameters.h (Parameters::set_incremental_full): New function.
1878 (Parameters::incremental): New function.
1879 (Parameters::incremental_update): New function.
1880 (Parameters::incremental_mode_): New data member.
1881 (set_parameters_incremental_full): New function.
1882 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1883 incremental link mode.
1884 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1885 (Sized_relobj::do_relocate_sections): Likewise.
1886 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1887 option.
1888 * testsuite/Makefile.in: Regenerate.
1889 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1890
bb32aa18 18912010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1892
1893 * script-sections.h (class Script_sections): Make
1894 Sections_elements typedef public.
1895 * script-sections.cc (class Sort_output_sections): Add elements_
1896 field. Add constructor which sets it; change all callers.
1897 (Sort_output_sections::is_before): New function.
1898 (Sort_output_sections::operator()): Call is_before.
1899 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1900 conditional.
1901 * testsuite/script_test_10.sh: New test. Test script section
1902 order.
1903 * testsuite/script_test_10.t: Likewise.
1904 * testsuite/script_test_10.s: Likewise.
1905 * testsuite/Makefile.am: Wrap the cross linker tests and the
1906 common tests into NATIVE_OR_CROSS_LINKER.
1907 (check_SCRIPTS): Add script_test_10.sh.
1908 (check_DATA): Add script_test_10.stdout.
1909 (script_test_10.o, script_test_10): New targets.
1910 (script_test_10.stdout): New target.
1911 * configure, testsuite/Makefile.in: Regenerate.
1912
3cef7179
ILT
19132010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1914
1915 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1916 error for the deprecated relocations.
1917 (Target_arm::Scan::global): Likewise.
1918 (Target_arm::Relocate::relocate): Likewise.
1919
7411e9a8
RS
19202010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1921
1922 * fileread.cc (Input_file::find_file): Initialize *found_name
1923 and *namep when using the fallback search for case 4.
1924
6a9da32a
CC
19252010-10-11 Cary Coutant <ccoutant@google.com>
1926
1927 * options.h (class General_options): Redefine -z lazy as an alias for
1928 the negation of -z now.
1929
ac897c20
ILT
19302010-10-11 Ian Lance Taylor <iant@google.com>
1931
1932 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1933 binding.
1934
ea5cae92
NC
19352010-10-06 Nick Clifton <nickc@redhat.com>
1936
1937 * script-sections.cc(class Memory_region): Remove
1938 current_lma_offset_ field. Rename current_vma_offset_ to
1939 current_offset_. Add last_section_ field.
1940 (Memory_region::get_current_vma_address): Rename to
1941 get_current_address.
1942 (Memory_region::get_current_lma_address): Delete.
1943 (Memory_region::increment_vma_offset): Rename to
1944 increment_offset.
1945 (Memory_region::increment_lma_offset): Delete.
1946 (Memory_region::attributes_compatible): New method. Returns
1947 true if the provided section is compatible with the region.
1948 (Memory_region::get_last_section): New method. Returns the last
1949 section to use the region.
1950 (Memory_region::set_last_section): New method. Stores the last
1951 section to use the region.
1952 (Script_sections::block_in_region): New method. Returns true if
1953 a block of memory is contained within a region.
1954 (Script_sections::find_memory_region): New method. Locates a
1955 memory region to be used to set a VMA or LMA address.
1956 (Output_section_definition::set_section_addresses): Add code to
1957 check for addresses set by memory regions.
1958 (Output_segment::set_section_addresses): Remove memory region
1959 walking code.
1960 (Script_sections::create_segment): Add a warning if a header
1961 segment is created outside of any region.
1962 * script-sections.h (class Script_sections): Add prototypes for
1963 find_memory_region and block_in_region methods.
1964 * testsuite/memory_test.s: Use .long instead of .word.
1965 * testsuite/memory_test.t: Add some more output sections.
1966 * testsuite/memory_test.sh: Update expected output.
1967
a9bfd952
DK
19682010-10-02 Doug Kwan <dougkwan@google.com>
1969
1970 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1971 defintion to symtab.h
1972 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1973 declaration to defintion.
1974
bacff3ab
NC
19752010-10-01 Nick Clifton <nickc@redhat.com>
1976
1977 * expression.cc (eval): Replace dummy argument with NULL.
1978 (eval_maybe_dot): Check for a NULL result section pointer.
1979 (Symbol_expression::value): Likewise.
1980 (Dot_expression::value): Likewise.
1981 (BINARY_EXPRESSION): Likewise.
1982 (Max_expression::value): Likewise.
1983 (Min_expression::value): Likewise.
1984 (Absolute_expression::value): Likewise.
1985 (Addr_expression::value_from_output_section): Likewise.
1986 (Loaddddr_expression::value_from_output_section): Likewise.
1987 (Segment_start_expression::value): Likewise.
1988 * script-sections.cc
1989 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1990 argument with NULL.
1991 (Sections_elememt_dot_assignment::set_section_addresses):
1992 Likewise.
1993 (Output_data_expression::do_write_to_buffer): Likewise.
1994 (Output_section_definition::finalize_symbols): Likewise.
1995 (Output_section_definition::set_section_addresses): Likewise.
1996
f81bc8b5
DK
19972010-09-30 Doug Kwan <dougkwan@google.com>
1998
1999 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2000
c95e9f27
ST
20012010-09-28 Sriraman Tallam <tmsriram@google.com>
2002
2003 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2004 function.
c95e9f27
ST
2005 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2006 virtual function.
2007 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2008 virtual function.
2009 * icf.cc (get_section_contents): Inline merge sections only when
2010 target allows it.
2011
3cac54d2
RW
20122010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2013
2014 * configure: Regenerate.
2015
2904037a
ILT
20162010-09-17 Ian Lance Taylor <iant@google.com>
2017
2018 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2019 * testsuite/Makefile.am (memory_test.o): New target.
2020 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2021 memory_test.t.
2022 * testsuite/Makefile.in: Rebuild.
2904037a 2023
bca7fb63
DK
20242010-09-17 Doug Kwan <dougkwan@google.com>
2025
2026 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2027 defintion if relocation uses GOT entries of the symbol.
2028 * testsuite/icf_safe_test.sh: Fix test.
2029 * testsuite/icf_safe_so_test.sh: Fix test.
2030
4ef28648
CC
20312010-09-16 Cary Coutant <ccoutant@google.com>
2032
2033 * script_sections.cc (class Memory_region): Remove "NULL" from
2034 vector initializations.
2035
793990de
CC
20362010-09-15 Cary Coutant <ccoutant@google.com>
2037
2038 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2039 Resolve forwarding symbols.
2040
81e015e2
DK
20412010-09-15 Doug Kwan <dougkwan@google.com>
2042
2043 * gold/testsuite/script_test_3.t: Add ARM special sections.
2044 * gold/testsuite/script_test_4.t: Same.
2045 * gold/testsuite/script_test_5.t: Same.
2046 * gold/testsuite/script_test_6.t: Same.
2047 * gold/testsuite/script_test_7.t: Same.
2048 * gold/testsuite/script_test_7.t: Same.
2049 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2050
36171d64
CC
20512010-09-14 Cary Coutant <ccoutant@google.com>
2052
2053 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2054 (Target_x86_64::Relocate::relocate_tls): Replace check for
2055 saw_tls_block_reloc_ with test for executable section.
2056
d89051bd
CC
20572010-09-12 Cary Coutant <ccoutant@google.com>
2058
2059 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2060 position-independent executables to shared libraries need dynamic
2061 relocations.
2062 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2063 position-independent executables.
2064 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2065 * testsuite/Makefile.in: Regenerate.
2066
fca41f0f
NC
20672010-09-10 Nick Clifton <nickc@redhat.com>
2068
2069 PR gold/11997
2070 * testsuite/memory_test.t: Discard any sections that are not
2071 needed.
2072
6695e4b3
L
20732010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2074
2075 PR gold/11996
2076 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2077 "This::" to work around a bug in gcc 4.2.
2078
2079 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2080
0f72bf6f
RÁE
20812010-09-09 Rafael Espindola <espindola@google.com>
2082
2083 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2084 sections with different PF_X flags in the same segment.
2085 (Layout::find_first_load_seg): Search all segments to find the first
2086 one.
2087 * options.h (rosegment): New.
2088
20892010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2090
05a79166 2091 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2092
aa98ff75
DK
20932010-09-08 Doug Kwan <dougkwan@google.com>
2094
2095 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2096 (Arm_relobj::do_relocate_sections): Add new parameter for output
2097 file to match the parent.
2098 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2099 of local symbols instead of input values. Update code to track
2100 changes in gold::relocate_section.
2101 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2102 (Sized_relobj::compute_final_local_value_internal): New methods.
2103 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2104 body into private version of Sized_relobj::compute_final_local_value.
2105 Call the inline method.
2106 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2107 merged symbol value if there is one.
2108 (Symbol_value::has_output_value): New method defintiion.
2109 (Sized_relobj::Compute_final_local_value_status): New enum type.
2110 (Sized_relobj::compute_final_local_value): New methods.
2111 (Sized_relobj::compute_final_local_value_internal): New methods.
2112 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2113 and arm_cortex_a8.sh.
2114 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2115 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2116 New tests.
2117 * Makefile.in: Regenerate.
2118 * testsuite/arm_bl_out_of_range.s: Update test.
2119 * testsuite/thumb_bl_out_of_range.s: Ditto.
2120 * testsuite/thumb_blx_out_of_range.s: Ditto.
2121 * testsuite/arm_branch_out_of_range.sh: New file.
2122 * testsuite/arm_cortex_a8.sh: Ditto.
2123 * testsuite/arm_cortex_a8_b.s: Ditto.
2124 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2125 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2126 * testsuite/arm_cortex_a8_bl.s: Ditto.
2127 * testsuite/arm_cortex_a8_blx.s: Ditto.
2128 * testsuite/arm_cortex_a8_local.s: Ditto.
2129 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2130 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2131
05a79166
L
21322010-09-08 Rafael Espindola <espindola@google.com>
2133
2134 * Makefile.am (memory_test.stdout): Run readelf with -W.
2135 * Makefile.in: Regenerate.
2136 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2137 64 bit output.
2138
33dbc701
RÁE
21392010-09-08 Rafael Espindola <espindola@google.com>
2140
2141 * script-sections.cc (Script_sections::add_memory_region): Convert
2142 field precision to int.
2143 * script.cc (script_set_section_region, script_set_section_region):
2144 Convert field precision to int.
2145
731ca54a
RÁE
21462010-09-08 Rafael Espindola <espindola@google.com>
2147
2148 * arm.cc (do_finalize_sections): Create the __exidx_start and
2149 __exdix_end symbols even when the section is missing.
2150
7f8cd844
NC
21512010-09-08 Nick Clifton <nickc@redhat.com>
2152
2153 * README: Remove claim that MEMORY is not supported.
2154 * expression.cc (script_exp_function_origin)
2155 (script_exp_function_length): Move from here to ...
2156 * script.cc: ... here.
2157 (script_set_section_region, script_add_memory)
2158 (script_parse_memory_attr, script_include_directive): New
2159 functions.
2160 * script-sections.cc
2161 (class Memory_region): New class.
2162 (class Output_section_definition): Add set_memory_region,
2163 set_section_vma, set_section_lma and get_section_name methods.
2164 (class Script_Sections): Add add_memory_region,
2165 find_memory_region, find_memory_region_origin,
2166 find_memory_region_length and set_memory_region methods.
2167 Have set_section_addresses method walk the list of set memory
2168 regions.
2169 Extend the print methos to display memory regions.
2170 * script-sections.h: Add prototypes for new methods.
2171 Add enum for MEMORY region attributes.
2172 * yyscript.y: Add support for parsing MEMORY regions.
2173 * script-c.h: Add prototypes for new functions.
2174 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2175 * testsuite/Makefile.in: Regenerate.
2176 * testsuite/memory_test.sh: New script.
2177 * testsuite/memory_test.s: New assembler source file.
2178 * testsuite/memory_test.t: New linker script.
2179
a4649286
DK
21802010-08-27 Doug Kwan <dougkwan@google.com>
2181
2182 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2183 reference override an existing dynamic weak reference.
2184 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2185 * testsuite/Makefile.in: Regenerate.
2186 * testsuite/dyn_weak_ref.sh: New file.
2187 * testsuite/dyn_weak_ref_1.c: Ditto.
2188 * testsuite/dyn_weak_ref_2.c: Ditto.
2189
b56648ad
ILT
21902010-08-27 Ian Lance Taylor <iant@google.com>
2191
2192 * incremental.h (class Incremental_input_entry): Add virtual
2193 destructor.
2194
809313cb
ILT
21952010-08-27 Ian Lance Taylor <iant@google.com>
2196
2197 * testsuite/start_lib_test_3.c: Mark t3 as used.
2198
11e32464
NC
21992010-08-27 Nick Clifton <nickc@redhat.com>
2200
2201 * options.cc (version_script): Fix small typo in previous
2202 whitespace tidyup.
2203
ca09d69a
NC
22042010-08-25 Nick Clifton <nickc@redhat.com>
2205
2206 * archive.cc: Formatting fixes: Remove whitespace between
2207 typename and following asterisk. Remove whitespace between
2208 function name and opening parenthesis.
2209 * archive.h: Likewise.
2210 * arm.cc: Likewise.
2211 * attributes.cc: Likewise.
2212 * attributes.h: Likewise.
2213 * common.cc: Likewise.
2214 * copy-relocs.cc: Likewise.
2215 * dirsearch.h: Likewise.
2216 * dynobj.cc: Likewise.
2217 * ehframe.cc: Likewise.
2218 * ehframe.h: Likewise.
2219 * expression.cc: Likewise.
2220 * fileread.cc: Likewise.
2221 * fileread.h: Likewise.
2222 * gc.h: Likewise.
2223 * gold-threads.cc: Likewise.
2224 * gold.cc: Likewise.
2225 * i386.cc: Likewise.
2226 * icf.h: Likewise.
2227 * incremental-dump.cc: Likewise.
2228 * incremental.cc: Likewise.
2229 * layout.cc: Likewise.
2230 * layout.h: Likewise.
2231 * main.cc: Likewise.
2232 * merge.cc: Likewise.
2233 * merge.h: Likewise.
2234 * object.cc: Likewise.
2235 * object.h: Likewise.
2236 * options.cc: Likewise.
2237 * options.h: Likewise.
2238 * output.cc: Likewise.
2239 * output.h: Likewise.
2240 * plugin.cc: Likewise.
2241 * plugin.h: Likewise.
2242 * powerpc.cc: Likewise.
2243 * reloc.cc: Likewise.
2244 * script-c.h: Likewise.
2245 * script-sections.cc: Likewise.
2246 * script.cc: Likewise.
2247 * stringpool.cc: Likewise.
2248 * symtab.cc: Likewise.
2249 * symtab.h: Likewise.
2250 * target.cc: Likewise.
2251 * timer.cc: Likewise.
2252 * timer.h: Likewise.
2253 * version.cc: Likewise.
2254 * x86_64.cc: Likewise.
2255
b8fa8750
NC
22562010-08-24 Nick Clifton <nickc@redhat.com>
2257
2258 PR 11899
2259 * layout.cc (segment_precedes): Sort segments by their physical
2260 addresses, if they have been set.
2261
9919d93b
CC
22622010-08-23 Cary Coutant <ccoutant@google.com>
2263
2264 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2265 symbols data.
2266 (Lib_group::include_member): Unlock object after deleting its
2267 symbols data.
2268 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2269 the bug fixed here.
2270
97b4be1c
CC
22712010-08-19 Neil Vachharajani <nvachhar@google.com>
2272 Cary Coutant <ccoutant@google.com>
2273
2274 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2275 constructor, and set_blocker.
2276 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2277 readsyms_blocker_.
2278 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2279 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2280 * testsuite/Makefile.am (start_lib_test): New test case.
2281 * testsuite/Makefile.in: Regenerate.
2282 * testsuite/start_lib_test_main.c: New file.
2283 * testsuite/start_lib_test_1.c: New file.
2284 * testsuite/start_lib_test_2.c: New file.
2285 * testsuite/start_lib_test_3.c: New file.
2286
dd0b1884
ILT
22872010-08-19 Ian Lance Taylor <iant@google.com>
2288
2289 * Makefile.in: Rebuild with automake 1.11.1.
2290 * aclocal.m4: Likewise.
2291 * testsuite/Makefile.in: Likewise.
2292
7223e9ca
ILT
22932010-08-19 Ian Lance Taylor <iant@google.com>
2294
2295 PR 10893
2296 * i386.cc (class Output_data_plt_i386): Update declarations.
2297 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2298 local_ifuncs_ fields.
2299 (Target_i386::do_plt_section_for_global): New function.
2300 (Target_i386::do_plt_section_for_local): New function.
2301 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2302 parameter; change all callers. Initialize global_ifuncs_ and
2303 local_ifuncs_. If doing a static link define __rel_iplt_start and
2304 __rel_iplt_end.
2305 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2306 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2307 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2308 symbols.
2309 (Target_i386::make_plt_section): New function, broken out of
2310 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2311 (Target_i386::make_plt_entry): Call make_plt_section.
2312 (Target_i386::make_local_ifunc_plt_entry): New function.
2313 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2314 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2315 R_386_IRELATIVE to switch.
2316 (Target_i386::Scan::global): Likewise.
2317 (Target_i386::Relocate::relocate): Likewise.
2318 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2319 switch.
2320 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2321 (Target_x86_64::do_plt_section_for_global): New function.
2322 (Target_x86_64::do_plt_section_for_local): New function.
2323 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2324 parameter; change all callers. If doing a static link define
2325 __rela_iplt_start and __rela_iplt_end.
2326 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2327 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2328 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2329 to point to .plt.
2330 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2331 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2332 switch.
2333 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2334 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2335 R_X86_64_IRELATIVE to switch.
2336 (Target_x86_64::Scan::global): Likewise.
2337 (Target_x86_64::Relocate::relocate): Likewise.
2338 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2339 switch.
2340 * target.h (class Target): Add plt_section_for_global and
2341 plt_section_for_local functions. Add do_plt_section_for_global
2342 and do_plt_section_for_local virtual functions.
2343 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2344 clarifying comments.
2345 (Symbol::use_plt_offset): Handle IFUNC symbol.
2346 * object.cc (Sized_relobj::Sized_relobj): Initialize
2347 local_plt_offsets_.
2348 (Sized_relobj::local_has_plt_offset): New function.
2349 (Sized_relobj::local_plt_offset): New function.
2350 (Sized_relobj::set_local_plt_offset): New function.
2351 (Sized_relobj::do_count): Handle IFUNC symbol.
2352 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2353 a bit away from input_shndx_ field. Add set_is_func_symbol and
2354 is_ifunc_symbol functions.
2355 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2356 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2357 local_plt_offsets_ field.
2358 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2359 * output.h (class Output_section_data): Add non-const
2360 output_section function.
2361 (class Output_data_got): Update declarations.
2362 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2363 Add use_plt_offset parameter to global and local constructors.
2364 Change all callers. Change local_sym_index_ field to 31 bits.
2365 Change GSYM_CODE and CONSTANT_CODE accordingly.
2366 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2367 doing a static link don't set sh_link field.
2368 (Output_data_got::Got_entry::write): Use PLT offset if
2369 appropriate.
2370 (Output_data_got::add_global_plt): New function.
2371 (Output_data_got::add_local_plt): New function.
2372 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2373 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2374 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2375 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2376 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2377 IFUNC conditional.
2378 * testsuite/ifunc-sel.h: New file.
2379 * testsuite/ifuncmain1.c: New file.
2380 * testsuite/ifuncmain1vis.c: New file.
2381 * testsuite/ifuncmod1.c: New file.
2382 * testsuite/ifuncdep2.c: New file.
2383 * testsuite/ifuncmain2.c: New file.
2384 * testsuite/ifuncmain3.c: New file.
2385 * testsuite/ifuncmod3.c: New file.
2386 * testsuite/ifuncmain4.c: New file.
2387 * testsuite/ifuncmain5.c: New file.
2388 * testsuite/ifuncmod5.c: New file.
2389 * testsuite/ifuncmain6pie.c: New file.
2390 * testsuite/ifuncmod6.c: New file.
2391 * testsuite/ifuncmain7.c: New file.
2392 * configure, testsuite/Makefile.in: Rebuild.
2393
56f75c03
ILT
23942010-08-18 Ian Lance Taylor <iant@google.com>
2395
2396 * incremental.cc
2397 (Output_section_incremental_inputs::write_input_files): Add cast
2398 to avoid signed/unsigned comparison warning.
2399 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2400
55455f89
CC
24012010-08-12 Cary Coutant <ccoutant@google.com>
2402
2403 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2404
e2054bcb
ILT
24052010-08-13 Ian Lance Taylor <iant@google.com>
2406
2407 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2408
74f67560
DK
24092010-08-12 Cary Coutant <ccoutant@google.com>
2410 Doug Kwan <dougkwan@google.com>
2411
2412 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2413 defintion overrides non-weak undef, remember that the original undef
2414 is not weak.
2415 * symtab.cc (Symbol_table::sized_write_global): For undef without
2416 an original weak binding, set binding to global in output.
2417 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2418 * testsuite/Makefile.in: Regenerate.
2419 * testsuite/strong_ref_weak_def.sh: New file.
2420 * testsuite/strong_ref_weak_def_1.c: Ditto.
2421 * testsuite/strong_ref_weak_def_2.c: Ditto.
2422
d1238d12
CC
24232010-08-12 Cary Coutant <ccoutant@google.com>
2424
2425 * testsuite/incremental_test.sh: Rewrite.
2426 * testsuite/incremental_test_1.c: Rewrite.
2427 * testsuite/incremental_test_2.c: Rewrite.
2428
0e70b911
CC
24292010-08-12 Cary Coutant <ccoutant@google.com>
2430
2431 * arm.cc (Target_arm::got_size): Add const.
2432 (Target_arm::got_entry_count): New function.
2433 (Target_arm::plt_entry_count): New function.
2434 (Target_arm::first_plt_entry_offset): New function.
2435 (Target_arm::plt_entry_size): New function.
2436 (Output_data_plt_arm::entry_count): New function.
2437 (Output_data_plt_arm::first_plt_entry_offset): New function.
2438 (Output_data_plt_arm::get_plt_entry_size): New function.
2439 * i386.cc (Target_i386::got_size): Add const.
2440 (Target_i386::got_entry_count): New function.
2441 (Target_i386::plt_entry_count): New function.
2442 (Target_i386::first_plt_entry_offset): New function.
2443 (Target_i386::plt_entry_size): New function.
2444 (Output_data_plt_i386::entry_count): New function.
2445 (Output_data_plt_i386::first_plt_entry_offset): New function.
2446 (Output_data_plt_i386::get_plt_entry_size): New function.
2447 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2448 find_incremental_inputs_sections. Dump incremental_got_plt section.
2449 * incremental.cc: Include target.h.
2450 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2451 parameter. Adjust all callers. Find incremental_got_plt section.
2452 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2453 section.
2454 (Output_section_incremental_inputs::set_final_data_size): Calculate
2455 size of incremental_got_plt section.
2456 (Output_section_incremental_inputs::do_write): Write the
2457 incremental_got_plt section.
2458 (Got_plt_view_info): New struct.
2459 (Local_got_offset_visitor): New class.
2460 (Global_got_offset_visitor): New class.
2461 (Global_symbol_visitor_got_plt): New class.
2462 (Output_section_incremental_inputs::write_got_plt): New function.
2463 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2464 Add parameter. Adjust all callers.
2465 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2466 (Incremental_inputs::got_plt_section): New function.
2467 (Incremental_inputs::got_plt_section_): New data member.
2468 (Incremental_got_plt_reader): New class.
2469 * layout.cc (Layout::create_incremental_info_sections): Add the
2470 incremental_got_plt section.
2471 * object.h (Got_offset_list::get_list): New function.
2472 (Got offset_list::for_all_got_offsets): New function.
2473 (Sized_relobj::local_got_offset_list): New function.
2474 * powerpc.cc (Target_powerpc::got_size): Add const.
2475 (Target_powerpc::got_entry_count): New function.
2476 (Target_powerpc::plt_entry_count): New function.
2477 (Target_powerpc::first_plt_entry_offset): New function.
2478 (Target_powerpc::plt_entry_size): New function.
2479 (Output_data_plt_powerpc::entry_count): New function.
2480 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2481 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2482 * sparc.cc (Target_sparc::got_size): Add const.
2483 (Target_sparc::got_entry_count): New function.
2484 (Target_sparc::plt_entry_count): New function.
2485 (Target_sparc::first_plt_entry_offset): New function.
2486 (Target_sparc::plt_entry_size): New function.
2487 (Output_data_plt_sparc::entry_count): New function.
2488 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2489 (Output_data_plt_sparc::get_plt_entry_size): New function.
2490 * symtab.h (Symbol::got_offset_list): New function.
2491 (Symbol_table::for_all_symbols): New function.
2492 * target.h (Sized_target::got_entry_count): New function.
2493 (Sized_target::plt_entry_count): New function.
2494 (Sized_target::plt_entry_size): New function.
2495 * x86_64.cc (Target_x86_64::got_size): Add const.
2496 (Target_x86_64::got_entry_count): New function.
2497 (Target_x86_64::plt_entry_count): New function.
2498 (Target_x86_64::first_plt_entry_offset): New function.
2499 (Target_x86_64::plt_entry_size): New function.
2500 (Output_data_plt_x86_64::entry_count): New function.
2501 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2502 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2503
09ec0418
CC
25042010-08-12 Cary Coutant <ccoutant@google.com>
2505
2506 * archive.cc: Include incremental.h.
2507 (Archive::Archive): Initialize incremental_info_.
2508 (Archive::include_member): Record archive members in incremental info.
2509 (Add_archive_symbols::run): Record begin and end of an archive in
2510 incremental info.
2511 (Lib_group::include_member): Record objects in incremental info.
2512 * archive.h (Incremental_archive_entry): Forward declaration.
2513 (Archive::set_incremental_info): New member function.
2514 (Archive::incremental_info): New member function.
2515 (Archive::Unused_symbol_iterator): New class.
2516 (Archive::unused_symbols_begin): New member function.
2517 (Archive::unused_symbols_end): New member function.
2518 (Archive::incremental_info_): New data member.
2519 * incremental-dump.cc (find_input_containing_global): New function.
2520 (dump_incremental_inputs): Dump new incremental info sections.
2521 * incremental.cc: Include symtab.h.
2522 (Output_section_incremental_inputs): New class.
2523 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2524 new incremental info sections.
2525 (Sized_incremental_binary::do_check_inputs): Likewise.
2526 (Incremental_inputs::report_archive): Remove.
2527 (Incremental_inputs::report_archive_begin): New function.
2528 (Incremental_inputs::report_archive_end): New function.
2529 (Incremental_inputs::report_object): New function.
2530 (Incremental_inputs::finalize_inputs): Remove.
2531 (Incremental_inputs::report_input_section): New function.
2532 (Incremental_inputs::report_script): Rewrite.
2533 (Incremental_inputs::finalize): Do nothing but finalize string table.
2534 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2535 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2536 (Incremental_inputs::create_data_sections): New function.
2537 (Incremental_inputs::relocs_entsize): New function.
2538 (Output_section_incremental_inputs::set_final_data_size): New function.
2539 (Output_section_incremental_inputs::do_write): New function.
2540 (Output_section_incremental_inputs::write_header): New function.
2541 (Output_section_incremental_inputs::write_input_files): New function.
2542 (Output_section_incremental_inputs::write_info_blocks): New function.
2543 (Output_section_incremental_inputs::write_symtab): New function.
2544 * incremental.h (Incremental_script_entry): Forward declaration.
2545 (Incremental_object_entry): Forward declaration.
2546 (Incremental_archive_entry): Forward declaration.
2547 (Incremental_inputs): Forward declaration.
2548 (Incremental_inputs_header_data): Remove.
2549 (Incremental_inputs_header): Remove.
2550 (Incremental_inputs_header_write): Remove.
2551 (Incremental_inputs_entry_data): Remove.
2552 (Incremental_inputs_entry): Remove.
2553 (Incremental_inputs_entry_write): Remove.
2554 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2555 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2556 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2557 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2558 Likewise.
2559 (Incremental_input_entry): New class.
2560 (Incremental_script_entry): New class.
2561 (Incremental_object_entry): New class.
2562 (Incremental_archive_entry): New class.
2563 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2564 (Incremental_inputs::report_inputs): Remove.
2565 (Incremental_inputs::report_archive): Remove.
2566 (Incremental_inputs::report_archive_begin): New function.
2567 (Incremental_inputs::report_archive_end): New function.
2568 (Incremental_inputs::report_object): Change prototype.
2569 (Incremental_inputs::report_input_section): New function.
2570 (Incremental_inputs::report_script): Change prototype.
2571 (Incremental_inputs::get_reloc_count): New function.
2572 (Incremental_inputs::set_reloc_count): New function.
2573 (Incremental_inputs::create_data_sections): New function.
2574 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2575 (Incremental_inputs::inputs_section): New function.
2576 (Incremental_inputs::symtab_section): New function.
2577 (Incremental_inputs::relocs_section): New function.
2578 (Incremental_inputs::get_stringpool): Add const.
2579 (Incremental_inputs::command_line): Add const.
2580 (Incremental_inputs::inputs): Remove.
2581 (Incremental_inputs::command_line_key): New function.
2582 (Incremental_inputs::input_file_count): New function.
2583 (Incremental_inputs::input_files): New function.
2584 (Incremental_inputs::relocs_entsize): New function.
2585 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2586 (Incremental_inputs::finalize_inputs): Remove.
2587 (Incremental_inputs::Input_info): Remove.
2588 (Incremental_inputs::lock_): Remove.
2589 (Incremental_inputs::inputs_): Change type.
2590 (Incremental_inputs::inputs_map_): Remove.
2591 (Incremental_inputs::current_object_entry_): New data member.
2592 (Incremental_inputs::inputs_section_): New data member.
2593 (Incremental_inputs::symtab_section_): New data member.
2594 (Incremental_inputs::relocs_section_): New data member.
2595 (Incremental_inputs::reloc_count_): New data member.
2596 (Incremental_inputs_reader): New class.
2597 (Incremental_symtab_reader): New class.
2598 (Incremental_relocs_reader): New class.
2599 * layout.cc (Layout::finalize): Move finalization of incremental info
2600 and creation of incremental info sections to follow finalization of
2601 symbol table. Set offsets for postprocessing sections.
2602 (Layout::create_incremental_info_sections): Call
2603 Incremental_inputs::create_data_sections. Add incremental symtab
2604 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2605 sections to layout after input sections.
2606 * layout.h (struct Timespec): Forward declaration.
2607 (Layout::incremental_inputs): Add const.
2608 (Layout::create_incremental_info_sections): Add parameter.
2609 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2610 * object.cc: Include incremental.h.
2611 (Relobj::finalize_incremental_relocs): New function.
2612 (Sized_relobj::do_layout): Record input sections in incremental info.
2613 * object.h (Object::output_section): New function.
2614 (Object::output_section_offset): Moved from Relobj.
2615 (Object::get_incremental_reloc_base): New function.
2616 (Object::get_incremental_reloc_count): New function.
2617 (Object::do_output_section): New function.
2618 (Object::do_output_section_offset): Moved from Relobj.
2619 (Object::do_get_incremental_reloc_base): New function.
2620 (Object::do_get_incremental_reloc_count): New function.
2621 (Object::Object): Initialize new data members.
2622 (Relobj::output_section): Renamed do_output_section and moved to
2623 protected.
2624 (Relobj::output_section_offset): Moved to Object.
2625 (Relobj::do_get_incremental_reloc_base): New function.
2626 (Relobj::do_get_incremental_reloc_count): New function.
2627 (Relobj::allocate_incremental_reloc_counts): New function.
2628 (Relobj::count_incremental_reloc): New function.
2629 (Relobj::finalize_incremental_relocs): New function.
2630 (Relobj::next_incremental_reloc_index): New function.
2631 (Relobj::reloc_counts_): New data member.
2632 (Relobj::reloc_bases_): New data member.
2633 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2634 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2635 (Sized_relobj::incremental_relocs_scan): New function.
2636 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2637 (Sized_relobj::incremental_relocs_write): New function.
2638 (Sized_relobj::incremental_relocs_write_reltype): New function.
2639 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2640 incremental link.
2641 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2642 archives and object files elsewhere.
2643 (Add_symbols::run): Report object files here.
2644 (Finish_group::run): Report end of archive at end of group.
2645 * reloc.cc: Include layout.h, incremental.h.
2646 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2647 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2648 (Sized_relobj::incremental_relocs_scan): New function.
2649 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2650 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2651 (Sized_relobj::incremental_relocs_write): New function.
2652 (Sized_relobj::incremental_relocs_write_reltype): New function.
2653 * script.cc (read_input_script): Rewrite test for incremental link.
2654 Change call to Incremental_inputs::report_script.
2655 * symtab.h (Symbol_table::first_global_index): New function.
2656 (Symbol_table::output_count): New function.
2657
ce0d1972
DK
26582010-08-12 Doug Kwan <dougkwan@google.com>
2659
2660 * arm.cc (Target_arm::merge_object_attributes): Check command line
2661 options --no-wchar-size-warning and --no-enum-size-warning.
2662 * options.h (General_options): Add ld-compatible options
2663 --no-enum-size-warning and --no-wchar-size-warning.
2664
6e5710ce
ILT
26652010-08-04 Ian Lance Taylor <iant@google.com>
2666
2667 * x86_64.cc (Target_x86_64::Scan::local): Use
2668 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2669 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2670 (Target_x86_64::Scan::global): Likewise.
2671 (Target_x86_64::Relocate::relocate): Likewise.
2672 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2673 Likewise.
2674
fef830db
CC
26752010-08-03 Cary Coutant <ccoutant@google.com>
2676
2677 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2678 to reserve space in merged_strings vector. Keep total input size
2679 for stats.
2680 (Output_merge_string::do_print_merge_stats): Print total input size.
2681 * merge.h (Output_merge_string): Add input_size_ field.
2682 * stringpool.cc (Stringpool_template::string_length): Move
2683 implementations out of Stringpool_template class and place in
2684 stringpool.h.
2685 * stringpool.h (string_length): Move out of Stringpool_template.
2686
1e3811b0
ILT
26872010-08-03 Ian Lance Taylor <iant@google.com>
2688
2689 PR 11712
2690 * layout.cc (relaxation_loop_body): If address of load segment is
2691 set, adjust address to include headers if possible.
2692
7af0c620
ILT
26932010-08-03 Ian Lance Taylor <iant@google.com>
2694
2695 * version.cc (version_string): Bump to 1.10.
2696
22f0da72
ILT
26972010-08-03 Ian Lance Taylor <iant@google.com>
2698
2699 PR 11805
2700 * layout.h (enum Output_section_order): Define.
2701 (class Layout): Update declarations.
2702 * layout.cc (Layout::get_output_section): Add order parameter.
2703 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2704 is_first_non_relro parameters. Change all callers.
2705 (Layout::choose_output_section): Likewise.
2706 (Layout::add_output_section_data): Likewise.
2707 (Layout::make_output_section): Likewise. Set order.
2708 (Layout::default_section_order): New function.
2709 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2710 * output.cc (Output_section::Output_section): Initialize order_.
2711 Don't initialize deleted fields.
2712 (Output_segment::Output_segment): Don't initialize deleted
2713 fields.
2714 (Output_segment::add_output_section_to_load): New function
2715 replacing add_output_section. Change all callers to call this or
2716 add_output_section_to_nonload.
2717 (Output_segment::add_output_section_to_nonload): New function.
2718 (Output_segment::remove_output_section): Rewrite.
2719 (Output_segment::add_initial_output_data): Likewise.
2720 (Output_segment::has_any_data_sections): Likewise.
2721 (Output_segment::is_first_section_relro): Likewise.
2722 (Output_segment::maximum_alignment): Likewise.
2723 (Output_segment::has_dynamic_reloc): New function replacing
2724 dynamic_reloc_count. Change all callers.
2725 (Output_segment::has_dynamic_reloc_list): New function replacing
2726 dynamic_reloc_count_list. Change all callers.
2727 (Output_segment::set_section_addresses): Rewrite.
2728 (Output_segment::set_offset): Rewrite.
2729 (Output_segment::find_first_and_last_list): Remove.
2730 (Output_segment::set_tls_offsets): Rewrite.
2731 (Output_segment::first_section_load_address): Likewise.
2732 (Output_segment::output_section_count): Likewise.
2733 (Output_segment::section_with_lowest_load_address): Likewise.
2734 (Output_segment::write_section_headers): Likewise.
2735 (Output_segment::print_sections_to_map): Likewise.
2736 * output.h (class Output_data): Remove dynamic_reloc_count_
2737 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2738 (Output_data::add_dynamic_reloc): Rewrite.
2739 (Output_data::has_dynamic_reloc): New function.
2740 (Output_data::dynamic_reloc_count): Remove.
2741 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2742 is_last_relro_, is_first_non_relro_, is_interp_,
2743 is_dynamic_linker_section_ fields. Add order and set_order
2744 functions. Remove is_relro_local, set_is_relro_local,
2745 is_last_relro, set_is_last_relro, is_first_non_relro,
2746 set_is_first_non_relro functions, is_interp, set_is_interp,
2747 is_dynamic_linker_section, and set_is_dynamic_linker_section
2748 functions.
2749 (class Output_segment): Change Output_data_list from std::list to
2750 std:;vector. Add output_lists_ field. Remove output_data_ and
2751 output_bss_ fields. Update declarations.
2752
3ff2ccb0
ILT
27532010-08-02 Ian Lance Taylor <iant@google.com>
2754
2755 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2756 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2757 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2758
88a4108b
ILT
27592010-08-02 Ian Lance Taylor <iant@google.com>
2760
2761 PR 11855
2762 * script.cc (Script_options::Script_options): Initialize
2763 symbol_definitions_ and symbol_references_.
2764 (Script_options::add_symbol_assignment): Update
2765 symbol_definitions_ and symbol_references_.
2766 (Script_options::add_symbol_reference): New function.
2767 (script_symbol): New function.
2768 * script.h (class Script_options): Add symbol_definitions_ and
2769 symbol_references_ fields.
2770 (Script_options::referenced_const_iterator): New type.
2771 (Script_options::referenced_begin): New function.
2772 (Script_options::referenced_end): New function.
2773 (Script_options::is_referenced): New function.
2774 (Script_options::any_unreferenced): New function.
2775 * script-c.h (script_symbol): Declare.
2776 * yyscript.y (exp): Call script_symbol.
2777 * symtab.cc: Include "script.h".
2778 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2779 Change all callers. Check symbols referenced by scripts.
2780 (Symbol_table::add_undefined_symbols_from_command_line): Add
2781 layout parameter. Change all callers.
2782 (Symbol_table::do_add_undefined_symbols_from_command_line):
2783 Likewise. Break out loop body. Check symbols referenced by
2784 scripts.
2785 (Symbol_table::add_undefined_symbol_from_command_line): New
2786 function broken out of
2787 do_add_undefined_symbols_from_command_line.
2788 * symtab.h (class Symbol_table): Update declarations.
2789 * archive.cc: Include "layout.h".
2790 (Archive::should_include_member): Add layout parameter. Change
2791 all callers. Check for symbol mentioned in expression.
2792 * archive.h (class Archive): Update declaration.
2793 * object.cc (Sized_relobj::do_should_include_member): Add layout
2794 parameter.
2795 * object.h (Object::should_include_member): Add layout parameter.
2796 Change all callers.
2797 (Object::do_should_include_member): Add layout parameter.
2798 (class Sized_relobj): Update declaration.
2799 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2800 parameter.
2801 * dynobj.h (class Sized_dynobj): Update declaration.
2802 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2803 layout parameter.
2804 * plugin.h (class Sized_pluginobj): Update declaration.
2805
5f1ab67a
ILT
28062010-08-02 Ian Lance Taylor <iant@google.com>
2807
2808 PR 11866
2809 * output.cc (Output_segment::set_offset): Search for the first and
2810 last sections rather than assuming that the list is in order.
2811 (Output_segment::find_first_and_last_list): New function.
2812 * output.h (class Output_segment): Update declarations.
2813 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2814 (relro_strip_test_SOURCES): New variable.
2815 (relro_strip_test_DEPENDENCIES): New variable.
2816 (relro_strip_test_LDFLAGS): New variable.
2817 (relro_strip_test_LDADD): New variable.
2818 (relro_strip_test.so): New target.
2819
a8df5856
ILT
28202010-08-02 Ian Lance Taylor <iant@google.com>
2821
2822 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2823 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2824 (Target_i386::got_tlsdesc_section): New function.
2825 (Target_i386::got_section): Create space for GOT entries for
2826 TLSDESC relocations.
2827 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2828 R_386_TLS_GOTDESC.
2829 (Target_i386::Scan::global): Likewise.
2830 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2831 using TLSDESC GOT.
2832 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2833 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2834 (Target_x86_64::got_tlsdesc_section): New function.
2835 (Target_x86_64::got_section): Create space for GOT entries for
2836 TLSDESC relocations.
2837 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2838 R_386_TLS_GOTDESC.
2839 (Target_x86_64::Scan::global): Likewise.
2840 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2841 using TLSDESC GOT.
2842
0c10a0a6
ILT
28432010-08-02 Ian Lance Taylor <iant@google.com>
2844
2845 * testsuite/final_layout.sh: Use dc to convert from hex to
2846 decimal.
2847
41cbeecc
ST
28482010-07-29 Sriraman Tallam <tmsriram@google.com>
2849
2850 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2851 paramter to the call to gold::gc_process_relocs.
2852 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2853 paramter to the call to gold::gc_process_relocs.
2854 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2855 parameter to the call to gold::gc_process_relocs.
2856 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2857 template parameter to the call to gold::gc_process_relocs.
2858 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2859 paramter to the call to gold::gc_process_relocs.
2860 * gc.h (get_embedded_addend_size): New function.
2861 (gc_process_relocs): Save the size of the reloc for use by ICF.
2862 * icf.cc (get_section_contents): Get the addend from the text section
2863 for SHT_REL relocation sections.
2864 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2865 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2866 * int_encoding.h (read_from_pointer): New overloaded function.
2867 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2868 * testsuite/icf_sht_rel_addend_test.sh: New file.
2869 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2870 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2871
6ea55b82
RW
28722010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2873
2874 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2875 * Makefile.in: Regenerate.
2876 * testsuite/Makefile.in: Regenerate.
2877
9691462b
ILT
28782010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2879
2880 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2881 * gold/testsuite/debug_msg.cc: Likewise.
2882 * gold/testsuite/odr_violation1.cc
2883 * gold/testsuite/odr_violation2.cc
2884
76897331
CC
28852010-07-21 Cary Coutant <ccoutant@google.com>
2886
2887 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2888 string, and length fields.
2889 (Output_merge_string::Merged_strings_list): New type.
2890 (Output_merge_string::Merged_strings_lists): New typedef.
2891 (Output_merge_string): Replace merged_strings_ with
2892 merged_strings_lists_.
2893 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2894 Merged_strings_list per input object and section. Don't store pointer
2895 to the string. Don't store length with each merged string entry.
2896 (Output_merge_string::finalize_merged_data): Loop over list of merged
2897 strings lists. Recompute length of each merged string.
2898
78384e8f
CC
28992010-07-15 Cary Coutant <ccoutant@google.com>
2900
2901 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2902 here.
2903
783659f9
ILT
29042010-07-14 Ian Lance Taylor <iant@google.com>
2905
2906 * descriptors.cc (Descriptors::open): Report correct name in error
2907 message.
2908
131687b4
DK
29092010-07-13 Doug Kwan <dougkwan@google.com>
2910
2911 * arm.cc (Arm_input_section::Arm_input_section): For a
2912 SHT_ARM_EXIDX section, always keeps the input sections.
2913 (Arm_input_section::set_exidx_section_link): New method.
2914 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2915 has_errors_ to false.
2916 (Arm_exidx_input_section::has_errors,
2917 Arm_exidx_input_section::set_has_errors): New methods.
2918 (Arm_exidx_input_section::has_errors_): New data member.
2919 (Arm_relobj::get_exidx_shndx_list): New method.
2920 (Arm_output_section::append_text_sections_to_list): Do not skip
2921 section without SHF_EXECINSTR.
2922 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2923 errors.
2924 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2925 section header. Make error messages more verbose. Check for
2926 a non-executable section linked to an EXIDX section.
2927 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2928 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2929 check that there is no deferred EXIDX section if we exit early.
2930 Instead of not making an EXIDX section in case of an error, make one
2931 and set the has_errors flag of it.
2932 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2933 in a relocatable link.
2934 (Target_arm::do_relax): Look for the EXIDX output section instead of
2935 assuming that it is called .ARM.exidx.
2936 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2937 section list. Do not check for SHF_EXECINSTR section flags but
2938 skip any input section with errors.
2939 * output.cc (Output_section::Output_section): Initialize
2940 always_keeps_input_sections_ to false.
2941 (Output_section::add_input_section): Check for
2942 always_keeps_input_sections_.
2943 * output.h (Output_section::always_keeps_input_sections,
2944 Output_section::set_always_keeps_input_sections): New methods.
2945 (Output_section::always_keeps_input_sections): New data member.
2946
69517287
RÁE
29472010-07-13 Rafael Espindola <espindola@google.com>
2948
2949 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2950 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2951
82742395
ILT
29522010-07-13 Philip Herron <herron.philip@googlemail.com>
2953 Ian Lance Taylor <iant@google.com>
2954
2955 * output.h (Output_section_lookup_maps::add_merge_section):
2956 Correct check of whether value was inserted.
2957 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2958 (Output_section_lookup_maps::add_relaxed_input_section):
2959 Likewise.
2960 * arm.cc (Target_arm::got_section): Remove used local os.
2961 * i386.cc (Target_i386::got_section): Likewise.
2962 * x86_64.cc (Target_x86_64::got_section): Likewise.
2963 * sparc.cc (Target_sparc::got_section): Likewise.
2964 (Target_sparc::relocate): Remove unused local have_got_offset.
2965 * powerpc.cc (Target_powerpc::relocate): Likewise.
2966
f2d707b5
ILT
29672010-07-13 Ian Lance Taylor <iant@google.com>
2968
241531d6
ILT
2969 * compressed_output.cc (zlib_decompress): Fix signature in
2970 !HAVE_ZLIB_H case.
2971
f2d707b5
ILT
2972 * archive.cc (Archive::include_member): Unlock an external member
2973 of a thin archive. Don't bother to delete an object we know is
2974 NULL.
2975
a2e47362
CC
29762010-07-12 Cary Coutant <ccoutant@google.com>
2977
2978 * compressed_output.cc (zlib_decompress): New function.
2979 (get_uncompressed_size): New function.
2980 (decompress_input_section): New function.
2981 * compressed_output.h (get_uncompressed_size): New function.
2982 (decompress_input_section): New function.
2983 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2984 Handle compressed debug sections.
2985 * layout.cc (is_compressed_debug_section): New function.
2986 (Layout::output_section_name): Map compressed section names to
2987 canonical names.
2988 * layout.h (is_compressed_debug_section): New function.
2989 (is_debug_info_section): Recognize compressed debug sections.
2990 * merge.cc: Include compressed_output.h.
2991 (Output_merge_data::do_add_input_section): Handle compressed
2992 debug sections.
2993 (Output_merge_string::do_add_input_section): Handle compressed
2994 debug sections.
2995 * object.cc: Include compressed_output.h.
2996 (Sized_relobj::Sized_relobj): Initialize new data members.
2997 (build_compressed_section_map): New function.
2998 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2999 * object.h (Object::section_is_compressed): New method.
3000 (Object::do_section_is_compressed): New method.
3001 (Sized_relobj::Compressed_section_map): New type.
3002 (Sized_relobj::do_section_is_compressed): New method.
3003 (Sized_relobj::compressed_sections_): New data member.
3004 * output.cc (Output_section::add_input_section): Handle compressed
3005 debug sections.
3006 * reloc.cc: Include compressed_output.h.
3007 (Sized_relobj::write_sections): Handle compressed debug sections.
3008
ce279a62
CC
30092010-07-08 Cary Coutant <ccoutant@google.com>
3010
3011 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3012 weak when resolving to a dynamic def.
3013 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3014 for weak undef/dynamic def cases. Adjust callers.
3015 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3016 undef_binding_weak_.
3017 (Symbol_table::sized_write_globals): Adjust symbol binding.
3018 (Symbol_table::sized_write_symbol): Add binding parameter.
3019 * symtab.h (Symbol::set_undef_binding): New method.
3020 (Symbol::is_undef_binding_weak): New method.
3021 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3022 (Symbol_table::should_override): Add new parameter.
3023 (Symbol_table::sized_write_symbol): Add new parameter.
3024
3025 * testsuite/weak_undef_file1.cc: Add new test case.
3026 * testsuite/weak_undef_file2.cc: Fix header comment.
3027 * testsuite/weak_undef_test.cc: Add new test case.
3028
b2286c10
DK
30292010-06-29 Doug Kwan <dougkwan@google.com>
3030
3031 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3032 Initialize USE_SYMBOL_.
3033 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3034 definition.
3035 (Arm_reloc_property::uses_symbol_): New data member declaration.
3036 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3037 uses symbol value and symbol is undefined but not weakly undefined.
3038
4802450a
RÁE
30392010-06-28 Rafael Espindola <espindola@google.com>
3040
3041 * plugin.cc (Plugin::load): Use dlerror.
3042
e5ca47ba
ILT
30432010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3044
3045 * symtab.cc (detect_odr_violations): When reporting an ODR
3046 violation, report an object where the symbol is defined.
3047
8a75a161
DK
30482010-06-25 Doug Kwan <dougkwan@google.com>
3049
3050 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3051 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3052 definition.
3053 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3054 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3055 target hook to detect function points.
3056 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3057 * icf.h (Icf::check_section_for_function_pointers): Change type of
3058 parameter SECTION_NAME to const reference to std::string. Use
3059 target hook to determine if section may have unsafe pointers.
3060 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3061 method definition.
3062
42218b9f
RÁE
30632010-06-21 Rafael Espindola <espindola@google.com>
3064
3065 * fileread.cc (Input_file::find_fie): New
3066 (Input_file::open): Use Input_file::find_fie.
3067 * fileread.h (Input_file::find_fie): New
3068 * plugin.cc (set_extra_library_path): New.
3069 (Plugin::load): Add set_extra_library_path to the transfer vector.
3070 (Plugin_manager::set_extra_library_path): New.
3071 (Plugin_manager::add_input_file): Use the extra search path if set.
3072 (set_extra_library_path(): New.
3073 * plugin.h (Plugin_manager): Add set_extra_library_path and
3074 extra_search_path_.
3075
a0506cca
CC
30762010-06-19 Cary Coutant <ccoutant@google.com>
3077
3078 * layout.cc (gdb_sections): Add .debug_types.
3079 (lines_only_debug_sections): Likewise.
3080
6508b958
RÁE
30812010-06-18 Rafael Espindola <espindola@google.com>
3082
3083 * plugin.cc (add_input_file,add_input_library)
3084 (Plugin_manager::add_input_file): Make filename arguments const.
3085 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3086 const.
3087
3e235302
DK
30882010-06-16 Doug Kwan <dougkwan@google.com>
3089
3090 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3091 .ARM.attributes section if we have not merged any input
3092 attributes sections.
3093
106e8a6c
DK
30942010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3095
3096 * arm.cc: Allow combining objects with no EABI version
3097 information.
3098
91ff43fe
RÁE
30992010-06-15 Rafael Espindola <espindola@google.com>
3100
3101 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3102
68ed838c
ILT
31032010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3104
3105 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3106 (struct iovec): Correct !HAVE_READV definition.
3107
f3a2388f
CC
31082010-06-10 Cary Coutant <ccoutant@google.com>
3109
3110 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3111 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3112 reloc sections.
3113 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3114
3115 PR 11683
3116 * symtab.h (Symbol::is_placeholder): New member function.
3117 * target-reloc.h (relocate_section): Check for placeholder symbols.
3118
3119 * testsuite/Makefile.am (plugin_test_8): New test.
3120 (plugin_test_9): New test.
3121 * testsuite/Makefile.in: Regenerate.
3122
e1df38aa
NC
31232010-06-09 Nick Clifton <nickc@redhat.com>
3124
3125 * yyscript.y (input_list_element): Allow strings prefixed with
3126 the '-' character. Treat these as libraries.
3127 * script.cc (script_add_library): New function. Adds a library
3128 specified by "-l<name>" found in an input script.
3129 * script-c.h: Add prototype for script_add_library.
3130
25bbe950
DK
31312010-06-07 Doug Kwan <dougkwan@google.com>
3132
3133 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3134 Restrict stub-group size to be within long conditional branch
3135 range when working around cortex-A8 erratum.
3136
0f32ea4c
ILT
31372010-06-07 Damien Diederen <dd@crosstwine.com>
3138
3139 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3140 #ifdef typo.
3141
8fe2a369
ST
31422010-06-03 Sriraman Tallam <tmsriram@google.com>
3143
3144 PR gold/11658
3145 * output.cc
3146 (Output_section::Input_section_sort_entry::compare_section_ordering):
3147 Change to return non-zero correctly.
3148 (Output_section::Input_section_sort_section_order_index_compare
3149 ::operator()): Change to fix ambiguity in comparisons.
3150
6e9ba2ca
ST
31512010-06-01 Sriraman Tallam <tmsriram@google.com>
3152
3153 * gold.h (is_wildcard_string): New function.
3154 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3155 (Layout::layout_eh_frame): Ditto.
3156 (Layout::find_section_order_index): New method.
3157 (Layout::read_layout_from_file): New method.
3158 * layout.h (Layout::find_section_order_index): New method.
3159 (Layout::read_layout_from_file): New method.
3160 (Layout::input_section_position_): New private member.
3161 (Layout::input_section_glob_): New private member.
3162 * main.cc (main): Call read_layout_from_file here.
3163 * options.h (--section-ordering-file): New option.
3164 * output.cc (Output_section::input_section_order_specified_): New
3165 member.
3166 (Output_section::Output_section): Initialize new member.
3167 (Output_section::add_input_section): Add new parameter.
3168 Keep input sections when --section-ordering-file is used.
3169 (Output_section::set_final_data_size): Sort input sections when
3170 section ordering file is specified.
3171 (Output_section::Input_section_sort_entry): Add new parameter.
3172 Check sorting type.
3173 (Output_section::Input_section_sort_entry::compare_section_ordering):
3174 New method.
3175 (Output_section::Input_section_sort_compare::operator()): Change to
3176 consider section_order_index.
3177 (Output_section::Input_section_sort_init_fini_compare::operator()):
3178 Change to consider section_order_index.
3179 (Output_section::Input_section_sort_section_order_index_compare
3180 ::operator()): New method.
3181 (Output_section::sort_attached_input_sections): Change to sort
3182 according to section order when specified.
e1df38aa
NC
3183 (Output_section::add_input_section<32, true>): Add new parameter.
3184 (Output_section::add_input_section<64, true>): Add new parameter.
3185 (Output_section::add_input_section<32, false>): Add new parameter.
3186 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3187 * output.h (Output_section::add_input_section): Add new parameter.
3188 (Output_section::input_section_order_specified): New
3189 method.
3190 (Output_section::set_input_section_order_specified): New method.
3191 (Input_section::Input_section): Initialize section_order_index_.
3192 (Input_section::section_order_index): New method.
3193 (Input_section::set_section_order_index): New method.
3194 (Input_section::section_order_index_): New member.
3195 (Input_section::Input_section_sort_section_order_index_compare): New
3196 struct.
3197 (Output_section::input_section_order_specified_): New member.
3198 * script-sections.cc (is_wildcard_string): Delete and move modified
3199 method to gold.h.
3200 (Output_section_element_input::Output_section_element_input): Modify
3201 call to is_wildcard_string.
3202 (Output_section_element_input::Input_section_pattern
3203 ::Input_section_pattern): Ditto.
3204 (Output_section_element_input::Output_section_element_input): Ditto.
3205 * testsuite/Makefile.am (final_layout): New test case.
3206 * testsuite/Makefile.in: Regenerate.
3207 * testsuite/final_layout.cc: New file.
3208 * testsuite/final_layout.sh: New file.
3209
3537c84b
RÁE
32102010-06-01 Rafael Espindola <espindola@google.com>
3211
3212 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3213
105b6afd
RÁE
32142010-06-01 Rafael Espindola <espindola@google.com>
3215
3216 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3217 visibility of symbols.
3218
29e11421
DK
32192010-05-27 Doug Kwan <dougkwan@google.com>
3220
3221 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3222 from start of output section instead of address for a local symbol
3223 in a merged or relaxed section when doing a relocatable link.
3224
5e0f337e
RÁE
32252010-05-26 Rafael Espindola <espindola@google.com>
3226
3227 PR 11604
3228 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3229 adding sections the garbage collector removed.
3230 * gold/testsuite/Makefile.am: Add test.
3231 * gold/testsuite/Makefile.in: Regenerate.
3232 * gold/testsuite/plugin_test_7.sh: New.
3233 * gold/testsuite/plugin_test_7_1.c: New.
3234 * gold/testsuite/plugin_test_7_2.c: New.
3235
f4187277
RÁE
32362010-05-26 Rafael Espindola <espindola@google.com>
3237
3238 * script-sections.cc (Output_section_definition::set_section_addresses):
3239 Check for --section-start.
3240
5c388529
DK
32412010-05-26 Doug Kwan <dougkwan@google.com>
3242
3243 * arm.cc (Arm_scan_relocatable_relocs): New class.
3244 (Target_arm::relocate_special_relocatable): New method.
3245 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3246 (Arm_relocate_functions::thumb_branch_common): Same.
3247 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3248 instead of Default_scan_relocatable_relocs.
3249 * target-reloc.h (relocate_for_relocatable): Let target handle
3250 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3251 * target.h (Sized_target::relocate_special_relocatable): New method.
3252
bca1c3ae
ILT
32532010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3254
3255 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3256
0439c796
DK
32572010-05-23 Doug Kwan <dougkwan@google.com>
3258
3259 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3260 instead of a cast.
3261 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3262 with a direct branch, not a conditional branch, to a stub.
3263 * merge.cc (Output_merge_base::record_input_section): New method
3264 defintion.
3265 (Output_merge_data::do_add_input_section): Record input section if
3266 keeps-input-sections flag is set.
3267 (Output_merge_string::do_add_input_section): Ditto.
3268 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3269 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3270 INPUT_SECTIONS_.
3271 (Output_merge_base::keeps_input_sections,
3272 Output_merge_base::set_keeps_input_sections,
3273 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3274 method definitions.
3275 (Output_merge_base::Input_sections): New type declaration.
3276 (Output_merge_base::input_sections_begin,
3277 Output_merge_base::input_sections_end,
3278 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3279 (Output_merge_base::bool keeps_input_sections_,
3280 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3281 Output_merge_base::input_sections_): New data members.
3282 (Output_merge_data::do_set_keeps_input_sections): New method
3283 defintion.
3284 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3285 * output.cc (Output_section::Input_section::relobj): Move method
3286 defintion from class declaration to here and handle merge sections.
3287 (Output_section::Input_section::shndx): Ditto.
3288 (Output_section::Output_section): Remove initializations of removed
3289 data members and initialize new data member LOOKUP_MAPS_.
3290 (Output_section::add_input_section): Set keeps-input-sections flag
3291 for a newly created merge output section as appropriate. Adjust code
3292 to use Output_section_lookup_maps class.
3293 (Output_section::add_relaxed_input_section): Adjst code for lookup
3294 maps code refactoring.
3295 (Output_section::add_merge_input_section): Add a new parameter
3296 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3297 class. If adding input section to a newly created merge output
3298 section fails, remove the new merge section.
3299 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3300 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3301 (Output_section::find_merge_section): Ditto.
3302 (Output_section::build_lookup_maps): New method defintion.
3303 (Output_section::find_relaxed_input_section): Adjust code to use
3304 Output_section_lookup_maps class.
3305 (Output_section::get_input_sections): Export merge sections. Adjust
3306 code to use Output_section_lookup_maps class.
3307 (Output_section:::add_script_input_section): Adjust code to use
3308 Output_section_lookup_maps class. Update lookup maps for merge
3309 sections also.
3310 (Output_section::discard_states): Use Output_section_lookup_maps.
3311 (Output_section::restore_states): Same.
3312 * output.h (Merge_section_properties): Move class defintion out of
3313 Output_section.
3314 (Output_section_lookup_maps): New class.
3315 (Output_section::Input_section::is_merge_section): New method
3316 defintion.
3317 (Output_section::Input_section::relobj): Move defintion out of class
3318 defintion. Declare method only.
3319 (Output_section::Input_section::shndx): Ditto.
3320 (Output_section::Input_section::output_merge_base): New method defintion.
3321 (Output_section::Input_section::u2_.pomb): New union field.
3322 (Output_section::Merge_section_by_properties_map,
3323 Output_section::Output_section_data_by_input_section_map,
3324 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3325 Remove types.
3326 (Output_section::add_merge_input_section): Add new parameter
3327 KEEPS_INPUT_SECTIONS.
3328 (Output_section::build_lookup_maps): New method declaration.
3329 (Output_section::merge_section_map_,
3330 Output_section::merge_section_by_properties_map_,
3331 Output_section::relaxed_input_section_map_,
3332 Output_section::is_relaxed_input_section_map_valid_): Remove data
3333 members.
3334 (Output_section::lookup_maps_): New data member.
3335
76295588
L
33362010-05-21 Doug Kwan <dougkwan@google.com>
3337
3338 PR gold/11619
3339 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3340 avoid a compilation error.
3341
d103a984
RÁE
33422010-05-19 Rafael Espindola <espindola@google.com>
3343
3344 * script-sections.cc (Output_section_definition::allocate_to_segment):
3345 Update the phdrs_list even when the output section is NULL.
3346 * testsuite/Makefile.am: Add test.
3347 * testsuite/Makefile.in: Regenerate.
3348 * testsuite/script_test_9.cc: New.
3349 * testsuite/script_test_9.sh: New.
3350 * testsuite/script_test_9.t: New.
3351
6625d24e
DK
33522010-05-19 Doug Kwan <dougkwan@google.com>
3353
3354 * arm.cc (Arm_input_section::original_size): New method.
3355 (Arm_input_section::do_addralign): Add a cast.
3356 (Arm_input_section::do_output_offset): Remove static cast.
3357 (Arm_input_section::original_addralign,
3358 Arm_input_section::original_size_): Change type to uint32_t.
3359 (Arm_input_section::init): Add safe casts for section alignment
3360 and size.
3361 (Arm_input_section::set_final_data_size): Do not set address and
3362 offset of stub table.
3363 (Arm_output_section::fix_exidx_coverage): Change use of of
3364 Output_section::Simple_input_section to that of
3365 Output_section::Input_section.
3366 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3367 except for the first pass.
3368 * output.cc (Output_section::get_input_sections): Change type of
3369 input_sections to std::list<Input_section>.
3370 (Output_section::add_script_input_section): Rename from
3371 Output_section::add_simple_input_section. Change type of SIS
3372 parameter from Simple_input_section to Input_section.
3373 * output.h (Output_section::Simple_input_section): Remove class.
3374 (Output_section::Input_section): Change class visibility to public.
3375 (Output_section::Input_section::addralign): Use stored alignments
3376 for special input sections if set.
3377 (Output_section::Input_section::set_addralign): New method.
3378 (Output_section::get_input_sections): Change parameter type from
3379 list of Simple_input_section to list of Input_section.
3380 (Output_section::add_script_input_section): Rename from
3381 Output_section::add_simple_input_section. Change first parameter's
3382 type from Simple_input_section to Input_section and remove the
3383 second and third parameters.
3384 * script-sections.cc (Input_section::Input_section_list): Change
3385 type to list of Output_section::Input_section/
3386 (Input_section_info::Input_section_info): Change parameter type of
3387 INPUT_SECTION to Output_section::Input_section.
3388 (Input_section_info::input_section): Change return type.
3389 (Input_section_info::input_section_): Change type to
3390 Output_section::Input_section.
3391 (Output_section_element_input::set_section_addresses): Adjust code
3392 to use Output_section::Input_section instead of
3393 Output_section::Simple_input_section. Adjust code for renaming
3394 of Output_section::add_simple_input_section.
3395 (Orphan_output_section::set_section_addresses): Ditto.
3396
e1e82ea4
RW
33972010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3398
3399 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3400 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3401
91e75c8a
RÁE
34022010-05-18 Rafael Espindola <espindola@google.com>
3403
3404 * options.cc (General_options::finalize): Handle -nostdlib.
3405 * options.h (nostdlib): New option.
3406 * script.cc (script_add_search_dir): Handle -nostdlib.
3407
da59ad79
DK
34082010-05-12 Doug Kwan <dougkwan@google.com>
3409
3410 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3411 attributes section only if there no attributes section after merging.
3412 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3413 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3414 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3415 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3416 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3417 and arm_attr_merge_7.stdout.
3418 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3419 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3420 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3421 arm_attr_merge_7b.o): New rules.
3422 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3423 arm_attr_merge_7
3424 * testsuite/Makefile.in: Regenerate.
3425 * testsuite/arm_attr_merge.sh: New file.
3426 * testsuite/arm_attr_merge_[67][ab].s: Same.
3427
3e01a7fd
NC
34282010-05-05 Nick Clifton <nickc@redhat.com>
3429
3430 * po/es.po: Updated Spanish translation.
3431
7ad2014a
L
34322010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3433
3434 * Makefile.am (install-exec-local): Properly install gold as
3435 default cross linker.
3436 * Makefile.in: Regenerated.
3437
4fda8867
NC
34382010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3439 Nick Clifton <nickc@redhat.com>
3440
3441 * configure.ac (install_as_default): Define and set to false
3442 unless --enable-gold or --enable-gold=both/gold has been
3443 specified.
3444 * configure: Regenerate.
3445
3446 * Makefile.am (install-exec-local): Install the executable as
3447 'ld.gold'. If install_as_default is true then also install it as
3448 'ld'.
3449 * Makefile.in: Regenerated.
3450
bd288ea2
ILT
34512010-04-24 Ian Lance Taylor <iant@google.com>
3452
3453 * layout.cc (Layout::layout_reloc): In relocatable link don't
3454 combine reloc sections for grouped sections.
3455
ef38fd8a
ST
34562010-04-23 Sriraman Tallam <tmsriram@google.com>
3457
3458 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3459 sections that are not ordinary to icf.
3460 * icf.cc (get_section_contents): Handle relocation pointing to section
3461 with no object or shndx information.
3462 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3463 * testsuite/Makefile.in: Regenerate.
3464 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3465 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3466
f6973bdc
ILT
34672010-04-22 Ian Lance Taylor <iant@google.com>
3468
3469 * expression.cc (Expression::Expression_eval_info): Add
3470 result_alignment_pointer field.
3471 (Expression::eval_with_dot): Add result_alignment_pointer
3472 parameter. Change all callers.
3473 (Expression::eval_maybe_dot): Likewise.
3474 (class Binary_expression): Add alignment_pointer parameter to
3475 left_value and right_value. Change all callers.
3476 (BINARY_EXPRESSION): Set result alignment.
3477 (class Trinary_expression): Add alignment_pointer parameter to
3478 arg2_value and arg3_value. Change all callers.
3479 (Trinary_cond::value): Set result alignment.
3480 (Max_expression::value, Min_expression::value): Likewise.
3481 (Align_expression::value): Likewise.
3482 * script-sections.cc (class Sections_element): Add dot_alignment
3483 parameter to set_section_addresses virtual function. Update
3484 instantiations.
3485 (class Output_section_element): Likewise.
3486 (Script_sections::create_segments): Add dot_alignment parameter.
3487 Change all callers.
3488 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3489 (Script_sections::set_phdrs_clause_addresses): Likewise.
3490 * script-sections.h: Update declarations.
3491 * script.h: Update declarations.
3492 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3493 min_p_align.
3494 * testsuite/script_test_3.t: Set large alignment.
3495 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3496 segment has expected alignment.
3497
9c9c98a5
NC
34982010-04-22 Nick Clifton <nickc@redhat.com>
3499
3500 * po/gold.pot: Updated by the Translation project.
3501 * po/vi.po: Updated Vietnamese translation.
3502
2253bfba
L
35032010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3504
3505 * testsuite/Makefile.am (check_PROGRAMS): Add
3506 icf_virtual_function_folding_test.
3507 * testsuite/Makefile.in: Regenerated.
3508
85fdf906
AH
35092010-04-15 Andrew Haley <aph@redhat.com>
3510
3511 * options.h (merge_exidx_entries): New option.
3512 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3513 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3514 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3515 (Target_arm::merge_exidx_entries): New function.
3516 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3517 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3518 to Arm_exidx_fixup constructor.
3519 Add new arg, merge_exidx_entries.
3520 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3521 Arm_output_section::fix_exidx_coverage.
3522
ce97fa81
ST
35232010-04-18 Sriraman Tallam <tmsriram@google.com>
3524
3525 * icf.cc (get_section_contents): Check for preemptible functions.
3526 Ignore addend when appropriate.
3527 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3528 section folded.
3529 (add_from_relobj): Check for section folded.
3530 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3531 * symtab.h (should_add_dynsym_entry): Add new parameter.
3532 * target-reloc.h (scan_relocs): Check for section folded.
3533 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3534 Check reloc types for function pointers in shared objects.
3535 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3536 case.
3537 (icf_preemptible_functions_test): New test case.
3538 (icf_string_merge_test): New test case.
3539 * testsuite.Makefile.in: Regenerate.
3540 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3541 bar_glob. Refactor code.
3542 * testsuite/icf_preemptible_functions_test.cc: New file.
3543 * testsuite/icf_preemptible_functions_test.sh: New file.
3544 * testsuite/icf_string_merge_test.cc: New file.
3545 * testsuite/icf_string_merge_test.sh: New file.
3546 * testsuite/icf_virtual_function_folding_test.cc: New file.
3547 * testsuite/icf_virtual_function_folding_test.sh: New file.
3548
04ceb17c
DK
35492010-04-14 Doug Kwan <dougkwan@google.com>
3550
3551 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3552 for local symbol recounting if we remove a section due to ICF.
3553 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3554 there are no regular objects in input.
3555
153e7da4
DK
35562010-04-13 Doug Kwan <dougkwan@google.com>
3557
3558 * arm.cc (Arm_input_section::set_final_data_size): Compute
3559 accurate final data size instead of using current data size.
3560
4dbd9faf
DK
35612010-04-09 Doug Kwan <dougkwan@google.com>
3562
3563 * layout.cc (Layout::choose_output_section): Handle script section
3564 types.
3565 (Layout::make_output_section_for_script): Add section type parameter.
3566 Handle script section types.
3567 * layout.h (Layout::make_output_section_for_script): Add section
3568 type parameter.
3569 * output.cc (Output_section::Output_section): Initialize data member
3570 is_noload_.
3571 (Output_section::do_reset_address_and_file_offset): Do not set address
3572 to 0 if section is a NOLOAD section.
3573 * output.h (Output_section::is_noload): New method.
3574 (Output_section::set_is_noload): Ditto.
3575 (Output_section::is_noload_): New data member.
3576 * script-c.h (Script_section_type): New enum type.
3577 (struct Parser_output_section_header): Add new file section_type.
3578 * script-sections.cc (Sections_element::output_section_name): Add
3579 parameter for returning script section type.
3580 (Output_section_definition::output_section_name): Ditto.
3581 (Output_section_definition::section_type)P; New method.
3582 (Output_section_definiton::script_section_type_name): Ditto.
3583 (Output_section_definition::script_section_type_): New data member.
3584 (Output_section_definition::Output_section_definition): Initialize
3585 data member Output_section_definition::script_section_type_.
3586 (Output_section_definition::create_sections): Pass script section type
3587 to Layout::make_output_section_for_script.
3588 (Output_section_definition::output_section_name): Return script
3589 section type to caller.
3590 (Output_section_definition::set_section_address): Do not advance
3591 dot value and load address if section type is NOLOAD. Set address
3592 of NOLOAD sections regardless of section flags.
3593 (Output_section_definition::print): Print section type if it is
3594 not SCRIPT_SECTION_TYPE_NONE.
3595 (Output_section_definition::section_type): New method.
3596 (Output_section_definition::script_section_type_name): Ditto.
3597 (Script_sections::output_section_name): Add new parameter
3598 PSECTION_TYPE for returning script section type. Pass it to
3599 section elements. Handle discard sections.
3600 (Sort_output_sections::operator()): Handle NOLOAD sections.
3601 * script-sections.h (Script_sections::Section_type): New enum type.
3602 (Script_sections::output_section_name): Add a new parameter for
3603 returning script section type.
3604 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3605 INFO and NOLOAD.
3606 * yyscript.y (union): Add new field SECTION_TYPE.
3607 (COPY, DSECT, INFO, NOLOAD): New tokens.
3608 (opt_address_and_section_type): Change type to output_section_header.
3609 (section_type): New non-terminal
3610 (section_header): Handle section type.
2253bfba 3611 (opt_address_and_section_type): Return section type value.
4dbd9faf 3612
721ea635
L
36132010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3614
3615 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3616 * testsuite/plugin_common_test_2.c (foo): Likewise.
3617
6bf924b0
DK
36182010-04-08 Doug Kwan <dougkwan@google.com>
3619
3620 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3621 Output_merge_data.
3622 * output.cc (Output_section::add_merge_input_section): Simplify
3623 code and return status of Output_merge_base::add_input_section.
e1df38aa 3624 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3625 returns true.
3626
24af6f92
DK
36272010-04-07 Doug Kwan <dougkwan@google.com>
3628
3629 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3630 if section is marked as containing instructions but has no mapping
3631 symbols.
3632 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3633 correct section index.
3634 (Arm_relobj::find_linked_text_section): Ditto.
3635
00698fc5
CC
36362010-04-07 Cary Coutant <ccoutant@google.com>
3637
3638 * archive.cc (include_member): Destroy Read_symbols_data object before
3639 releasing file.
3640 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3641 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3642 (Read_symbols_data::~Read_symbols_data) New destructor.
3643 (Section_relocs::Section_relocs) New constructor.
3644 (Section_relocs::~Section_relocs) New destructor.
3645 (Read_relocs_data::Read_relocs_data) New constructor.
3646 (Read_relocs_data::~Read_relocs_data) New destructor.
3647 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3648 pointers to NULL after deleting.
3649
7296d933
DK
36502010-04-07 Doug Kwan <dougkwan@google.com>
3651
3652 * arm.cc: Replace "endianity" with "endianness" in comments.
3653 (Arm_exidx_cantunwind): Ditto.
3654 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3655 (Arm_relobj::merge_flags_and_attributes): New method.
3656 (Arm_relobj::merge_flags_and_attributes_): New data member.
3657 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3658 (Arm_relobj::scan_sections_for_stubs): Ditto.
3659 (Arm_relobj::do_read_symbols): Check to see if we really want to
3660 merge processor-specific flags and attributes. Exit early if
3661 an object is empty except for section names and the undefined symbol.
3662 (Target_arm::do_finalize_sections): Move check for ELF format to
3663 Arm_relobj::do_read_symbols. Merge processor specific flags and
3664 attributes from a regular object only when we have determined that
3665 it is aapropriate. Do not create an .ARM.attributes section in
3666 output if there is no regular input object.
3667 (Target_arm::merge_processor_specific_flags): Check
3668 --warn-mismatch before printing any error.
3669 (Target_arm::merge_object_attributes): Ditto.
3670 * gold.cc (queue_middle_tasks): Handle the case in which there is
3671 no regular object in input.
3672 * options.cc (General_options::parse_EB): New method.
3673 (General_options::parse_EL): Same.
3674 (General_options::General_options): Initialize endianness_.
3675 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3676 New options.
3677 (General_options::Endianness): New enum.
3678 (General_options::endianness): New method.
3679 (General_options::endianness_): New data member.
3680 * parameters.cc (Parameters::set_options): Check target endianness.
3681 (Parameters::set_target_once): Ditto.
3682 (Parameters::check_target_endianness): New method.
3683 (parameters_force_valid_target): If either -EL or -EB is specified,
3684 use it to define endianness of default target.
3685 * parameters.h (Parameters::check_target_endianness): New method
3686 declaration.
3687 * target.h (class Target): Change "endianity" to "endianness"
3688 in comments.
3689
efc8d4f2
RW
36902010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3691
3692 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3693 * configure: Regenerate.
3694 * Makefile.in: Regenerate.
3695 * testsuite/Makefile.in: Regenerate.
3696
be234d88
CC
36972010-04-06 Cary Coutant <ccoutant@google.com>
3698
3699 gcc PR lto/42757
3700 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3701 prevailing definitions of common symbols.
3702 * testsuite/plugin_test_6.sh: New test case.
3703 * testsuite/plugin_common_test_1.c: New test case.
3704 * testsuite/plugin_common_test_2.c: New test case.
3705 * testsuite/Makefile.am (plugin_test_6): New test case.
3706 * testsuite/Makefile.in: Regenerate.
3707
bd32c6bd
NC
37082010-04-06 Nick Clifton <nickc@redhat.com>
3709
3710 * po/vi.po: New Vietnamese translation.
3711
323c532f
DK
37122010-03-30 Doug Kwan <dougkwan@google.com>
3713
3714 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3715
4fcd97eb
DK
37162010-03-25 Doug Kwan <dougkwan@google.com>
3717
3718 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3719 to avoid a conversion warning on a 32-bit host.
3720
4ebf39db
ILT
37212010-03-24 Ian Lance Taylor <iant@google.com>
3722
3723 * testsuite/script_test_3.t: Add a TLS segment.
3724 * testsuite/Makefile.am (check_PROGRAMS): Add
3725 tls_phdrs_script_test.
3726 (tls_phdrs_script_test_SOURCES): Define.
3727 (tls_phdrs_script_test_DEPENDENCIES): Define.
3728 (tls_phdrs_script_test_LDFLAGS): Define.
3729 (tls_phdrs_script_test_LDADD): Define.
3730 * testsuite/Makefile.in: Rebuild.
3731
4a599bdd
CC
37322010-03-23 Cary Coutant <ccoutant@google.com>
3733
3734 * fileread.cc (find_or_make_view): Fix comment.
3735
6c93b22c
ILT
37362010-03-23 Ian Lance Taylor <iant@google.com>
3737
3738 * script-sections.cc (class Orphan_section_placement): Define
3739 PLACE_TLS and PLACE_TLS_BSS.
3740 (Orphan_section_placement::Orphan_section_placement): Initialize
3741 new places.
3742 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3743 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3744 (tls_script_test_SOURCES): Define.
3745 (tls_script_test_DEPENDENCIES): Define.
3746 (tls_script_test_LDFLAGS): Define.
3747 (tls_script_test_LDADD): Define.
3748 * testsuite/Makefile.in: Rebuild.
3749
a2c7281b
DK
37502010-03-22 Doug Kwan <dougkwan@google.com>
3751
3752 * arm.cc (Arm_relocate_functions::abs8,
3753 Arm_relocate_functions::abs16): Use correct check for overflow
3754 specified in the ARM ELF specs.
3755 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3756 target of a BLX instruction specially.
3757 (Reloc_stub::stub_type_for_reloc): Ditto.
3758 (Relocate::relocate): Use symbolic names instead of numeric relocation
3759 codes to report error.
3760 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3761 workaround.
3762 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3763 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3764 thumb2_blx_out_of_range.stdout
3765 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3766 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3767 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3768 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3769 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3770 thumb2_blx_in_range, thumb2_blx_in_range.o,
3771 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3772 thumb2_blx_out_of_range.o): New rules.
3773 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3774 thumb2_blx_in_range and thumb2_blx_out_of_range.
3775 * testsuite/Makefile.in: Regenerate.
3776 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3777 * testsuite/thumb_blx_in_range.s: New file.
3778 * testsuite/thumb_blx_out_of_range.s: New file.
3779
b0193076
RÁE
37802010-03-22 Rafael Espindola <espindola@google.com>
3781
3782 * archive.cc (Should_include): Move to archive.h.
3783 (should_include_member): Make it a member of Archive.
3784 (Lib_group): New.
3785 (Add_lib_group_symbols): New.
3786 * archive.h: Include options.h.
3787 (Archive_member): Moved from Archive.
3788 (Should_include): Moved from archive.cc.
3789 (Lib_group): New.
3790 (Add_lib_group_symbols): New.
3791 * dynobj.cc (do_should_include_member): New.
3792 * dynobj.h (do_should_include_member): New.
3793 * gold.cc (queue_initial_tasks): Update call to queue.
3794 * main.cc (main): Print lib group stats.
3795 * object.cc (do_should_include_member): New.
3796 * object.h: Include archive.h.
3797 (Object::should_include_member): New.
3798 (Object::do_should_include_member): New.
3799 (Sized_relobj::do_should_include_member): New.
3800 * options.cc (General_options::parse_start_lib): New.
3801 (General_options::parse_end_lib): New.
3802 (Input_arguments::add_file): Handle lib groups.
3803 (Input_arguments::start_group): Check we are not in a lib.
3804 (Input_arguments::start_lib): New.
3805 (Input_arguments::end_lib): New.
3806 * options.h (General_options): Add start_lib and end_lib.
3807 (Input_argument::lib_): New.
3808 (Input_argument::lib): New.
3809 (Input_argument::is_lib): New.
3810 (Input_file_lib): New.
3811 (Input_arguments::in_lib_): New.
3812 (Input_arguments::in_lib): New.
3813 (Input_arguments::start_lib): New.
3814 (Input_arguments::end_lib_): New.
3815 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3816 in unused members as preempted.
3817 (Sized_pluginobj::do_should_include_member): New.
3818 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3819 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3820 return the blocker.
3821 (Read_symbols::do_whole_lib_group): New.
3822 (Read_symbols::do_lib_group): New.
3823 (Read_symbols::do_read_symbols): Handle lib groups.
3824 (Read_symbols::get_name): Handle lib groups.
3825 * readsyms.h (Read_symbols): Add an archive member pointer.
3826 (Read_symbols::do_whole_lib_group): New.
3827 (Read_symbols::do_lib_group): New.
3828 (Read_symbols::member_): New.
3829 * script.cc (read_input_script): Update call to queue_soon.
3830
d099120c
DK
38312010-03-19 Doug Kwan <dougkwan@google.com>
3832
3833 * arm.cc (Stub_table::Stub_table): Initialize new data members
3834 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3835 (Stub_table::add_reloc_stub): Assign stub offset and update
3836 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3837 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3838 New data members.
3839 (Stub_table::update_data_size_and_addralign): Use
3840 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3841 instead of going over all reloc stubs.
3842 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3843 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3844 Stringpool_template::offset_ to size of Stringpool_char.
3845 (Stringpool_template::new_key_offset): Remove code to initialize
3846 Stringpool_template::offset_.
3847 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3848 Stringpool_template::offset_ to zero.
3849
1aa37384
DK
38502010-03-15 Doug Kwan <dougkwan@google.com>
3851
3852 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3853 offset_.
3854 (Stringpool_template::new_key_offset): New method.
3855 (Stringpool_template::add_string): Assign offsets when adding new
3856 strings.
3857 (Stringpool_template::set_string_offsets): Do not set string offsets
3858 when not optimizing.
3859 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3860 member size_.
3861 (Chunked_vector::clear): Clear size_.
3862 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3863 (Chunked_vector::size): Return size_.
3864 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3865 (Chunked_vector::size_): New data member.
1aa37384
DK
3866 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3867 (Stringpool_template::new_key_offset): New method declaration.
3868 (Stringpool_template::offset_): New data member.
3869
b672b057
RÁE
38702010-03-15 Rafael Espindola <espindola@google.com>
3871
3872 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3873 Add_symbols' constructor.
3874 * readsyms.h (Add_symbols): Remove the input_group member.
3875
b6848d3c
ILT
38762010-03-10 Ian Lance Taylor <iant@google.com>
3877
3878 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3879 target to ask whether a reference to a symbol requires a stack
3880 split.
3881 * target.h (Target::is_call_to_non_split): New function.
3882 (Target::do_is_call_to_non_split): Declare virtual function.
3883 * target.cc: Include "symtab.h".
3884 (Target::do_is_call_to_non_split): New function.
3885 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3886
a2a5469e
CC
38872010-03-10 Cary Coutant <ccoutant@google.com>
3888
3889 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3890 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3891 (File_read::open[2]): Add whole_file_view_ to list of views.
3892 (File_read::make_view): Remove test of whole_file_view_.
3893 (File_read::find_or_make_view): Create whole_file_view_ if
3894 necessary.
3895 (File_read::clear_views): Replace bool parameter with enum;
3896 adjust all callers. Don't delete views with permanent data;
3897 do delete cached views and views from archives if
3898 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3899 if clearing the corresponding view.
3900 * fileread.h (File_read::Clear_views_mode): New enum.
3901 (File_read::View::is_permanent_view): New method.
3902 (File_read::clear_views): Replace bool parameter
3903 with enum; adjust all callers.
3904 * options.h (General_options): Change keep_files_mapped option;
3905 add map_whole_files.
3906 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3907 releasing the file.
3908 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3909 the file.
3910
8861f32b
DM
39112010-03-10 David S. Miller <davem@davemloft.net>
3912
3913 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3914
d62d0f5f
ST
39152010-03-09 Sriraman Tallam <tmsriram@google.com>
3916
3917 * icf.cc (get_section_contents): Add '@' marker after processing the
3918 merge reloc.
3919
9177756d
DK
39202010-03-08 Doug Kwan <dougkwan@google.com>
3921
3922 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3923 due to a conversion warning.
3924 (Arm_relobj::update_output_local_symbol_count): Check for local
3925 symbol with unset output index.
3926
9e9e071b
ILT
39272010-03-05 Ian Lance Taylor <iant@google.com>
3928
3929 * options.h (class General_options): Add --spare-dynamic-tags.
3930 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3931 --spare-dynamic-tags.
3932
a81ee015
ILT
39332010-03-05 Ian Lance Taylor <iant@google.com>
3934
3935 * incremental.cc: Include "libiberty.h".
3936
44ec90b9
RO
39372010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3938
3939 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3940 function, is_info_ member.
3941 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3942 (Versions::Versions): Update caller.
3943 (Versions::define_base_version): Likewise.
3944 (Versions::add_def): Likewise.
3945
0897ed3b
ST
39462010-03-03 Sriraman Tallam <tmsriram@google.com>
3947
3948 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3949 (Scan::possible_function_pointer_reloc): New function.
3950 (Scan::local_reloc_may_be_function_pointer): Change to call
3951 possible_function_pointer_reloc.
3952 (Scan::global_reloc_may_be_function_pointer): Ditto.
3953 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3954 relocations in ".data.rel.ro._ZTV" section.
3955 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3956 * testsuite/icf_safe_so_test.cc: Ditto.
3957 * testsuite/icf_safe_test.cc: Ditto.
3958 * testsuite/icf_safe_test.sh: Ditto.
3959
d3bbad62
ILT
39602010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3961 Ian Lance Taylor <iant@google.com>
3962
3963 * target-reloc.h (relocate_section): Check the symbol table index
3964 for -1U before setting the local symbol index.
3965 (scan_relocatable_relocs): If copying the relocation, record that
3966 the local symbol is required.
3967 * object.h (Symbol_value::is_output_symtab_index_set): New
3968 function.
3969 (Symbol_value::may_be_discarded_from_output_symtab): New
3970 function.
3971 (Symbol_value::has_output_symtab_entry): New function.
3972 (Symbol_value::needs_output_symtab_entry): Remove.
3973 (Symbol_value::output_symtab_index): Make sure the symbol index is
3974 set.
3975 (Symbol_value::set_output_symtab_index): Make sure the symbol
3976 index is not set. Make sure the new index is valid.
3977 (Symbol_value::set_must_have_output_symtab_entry): New function.
3978 (Symbol_value::has_output_dynsym_entry): New function.
3979 (Symbol_value::set_output_dynsym_index): Make sure the new index
3980 is valid.
3981 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3982 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3983 local symbol if permitted.
3984 (Sized_relobj::do_finalize_local_symbols): Call
3985 is_output_symtab_index_set rather than needs_output_symtab_entry.
3986 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3987 rather than needs_output_symtab_entry. Call
3988 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3989 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3990 is_output_symtab_index_set rather than needs_output_symtab_entry.
3991 * testsuite/discard_locals_relocatable_test.c: New file.
3992 * testsuite/discard_locals_test.sh: Test -r.
3993 * testsuite/Makefile.am (check_DATA): Add
3994 discard_locals_relocatable_test1.syms,
3995 discard_local_relocatable_test2.syms.
3996 (MOSTLYCLEANFILES): Likewise. Also add
3997 discard_locals_relocatable_test1.lout and
3998 discard_locals_relocatable_test2.out.
3999 (discard_locals_relocatable_test1.syms): New target.
4000 (discard_locals_relocatable_test.o): New target.
4001 (discard_locals_relocatable_test1.out): New target.
4002 (discard_locals_relocatable_test2.syms): New target.
4003 (discard_locals_relocatable_test2.out): New target.
4004 (various): Add missing ../ld-new dependencies.
4005 * testsuite/Makefile.in: Rebuild.
4006
7e8ccf26
NC
40072010-03-03 Nick Clifton <nickc@redhat.com>
4008
4009 * po/fi.po: New Finnish translation.
4010
2a0ff005
DK
40112010-03-01 Doug Kwan <dougkwan@google.com>
4012
4013 * layout.cc (Layout::Layout): Force section types of .init_array*,
4014 .preinit_array* and .fini_array* sections.
4015 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4016 Fix check of return value of std::string::find.().
4017 (Output_section::Input_section_sort_compare::operator()): Remove
4018 comment about .init_array.
4019 (Output_section::Input_section_sort_init_fini_compare::operator()):
4020 New method.
4021 (Output_section::sort_attached_input_sections): Handle .init_array
4022 and .fini_array specially.
4023 * output.h (Output_section::Inut_section_sort_compare): Update
4024 comment.
4025 (Output_section::Input_section_sort_init_fini_compare): New struct.
4026
c3e4ae29
DK
40272010-02-26 Doug Kwan <dougkwan@google.com>
4028
4029 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4030 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4031 * testsuite/debug_msg.sh: Avoid matching source line number for
4032 use of global variable undef_int.
4033
2fd9ae7a
DK
40342010-02-26 Doug Kwan <dougkwan@google.com>
4035
4036 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4037 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4038 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4039 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4040 * options.cc (General_options::General_options): Initialize member
4041 fix_v4bx_.
4042 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4043 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4044 and rm_no_fix_v4bx.stdout
4045 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4046 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4047 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4048 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4049 and arm_no_fix_v4bx.
4050 * Makefile.in: Regenerate.
4051 * testsuite/arm_fix_v4bx.s: New file.
4052 * testsuite/arm_fix_v4bx.sh: Ditto.
4053
67ec7d0b
DK
40542010-02-24 Doug Kwan <dougkwan@google.com>
4055
4056 * arm.cc (Target_arm::got_section): Make the .got section the first
4057 non RELRO section in the data segment.
4058 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4059 suffixes of section names.
4060
10165461
DK
40612010-02-24 Doug Kwan <dougkwan@google.com>
4062
4063 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4064 flags and attributes merging if an input file is a binary file.
4065 * fileread.cc (Input_file::open): Record format of original file.
4066 * fileread.h (Input_file::Format): New enum type.
4067 (Input_file::Input_file): Initialize data member format_.
4068 (Input_file::format): New method definition.
4069 (Input_file::format_):: New data member.
4070
4a54abbb
DK
40712010-02-24 Doug Kwan <dougkwan@google.com>
4072
4073 * arm.cc (Arm_output_data_got): New class.
4074 (ARM_TCB_SIZE): New constant
4075 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4076 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4077 If user uses a script with a SECTIONS clause, issue only a warning
4078 for a misplaced EXIDX input section. Otherwise, issue an error.
4079 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4080 garbage collection.
4081 (Target_arm::got_mode_index_entry): Handle static linking.
4082 (Target_arm::Scan::local): Ditto.
4083 (Target_arm::Scan::global): Ditto.
4084 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4085 all incorrectly implemented relocations.
e1df38aa 4086 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4087 Arm_output_section::fix_exidx_coverage.
4088 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4089 from ".ARM.exidx." and ".ARM.extab.".
4090
ca419a6f
ILT
40912010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4092
4093 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4094 section if it does not already exist.
4095 * attributes.cc (Attributes_section_data::Attributes_section_data):
4096 Don't crash if size is zero.
4097
135b9c78
ILT
40982010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4099 Ian Lance Taylor <iant@google.com>
4100
4101 * gold.cc (queue_middle_tasks): If no input files were opened,
4102 exit.
4103 * workqueue.h (Task_function::Task_function): Assert that there is
4104 a blocker.
4105
bb0bfe4f
DK
41062010-02-22 Doug Kwan <dougkwan@google.com>
4107
4108 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4109 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4110 types to avoid warnings due to different uint64_t implementations
4111 on different hosts.
4112
2a2b6d42
DK
41132010-02-21 Doug Kwan <dougkwan@google.com>
4114
4115 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4116 handling of the maximum backward branch offset.
4117 (Arm_relocate_functions::thumb_branch_common): Ditto.
4118 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4119 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4120 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4121 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4122 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4123 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4124 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4125 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4126 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4127 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4128 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4129 thumb2_bl_out_of_range.o): New rules.
4130 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4131 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4132 thumb2_bl_out_of_range
4133 * testsuite/Makefile.in: Regenerate.
4134 * testsuite/arm_bl_in_range.s: New file.
4135 * testsuite/arm_bl_out_of_range.s: Ditto.
4136 * testsuite/arm_branch_in_range.sh: Ditto.
4137 * testsuite/arm_branch_range.t: Ditto.
4138 * testsuite/thumb2_branch_range.t: Ditto.
4139 * testsuite/thumb_bl_in_range.s: Ditto.
4140 * testsuite/thumb_bl_out_of_range.s: Ditto.
4141 * testsuite/thumb_branch_range.t: Ditto.
4142
b487ad64
ST
41432010-02-20 Sriraman Tallam <tmsriram@google.com>
4144
4145 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4146 Add reloc offset information.
4147 * icf.cc (get_section_contents): Change iterators to point to the new
4148 vectors. Add reloc offset information to the contents.
4149 * icf.h (Icf::Sections_reachable_info): New typedef.
4150 (Icf::Sections_reachable_list): New typedef.
4151 (Icf::Offset_info): New typedef.
4152 (Icf::Reloc_info): New struct typedef.
4153 (Icf::Reloc_info_list): New typedef.
4154 (Icf::symbol_reloc_list): Delete method.
4155 (Icf::addend_reloc_list): Delete method.
4156 (Icf::section_reloc_list): Delete method.
4157 (Icf::reloc_info_list): New method.
4158 (Icf::reloc_info_list_): New member.
4159
f96accdf
DK
41602010-02-19 Doug Kwan <dougkwan@google.com>
4161
4162 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4163 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4164 * arm.cc (Arm_relocation_functions): New forward declaration.
4165 (Target_arm::Target_arm): Initialize new data members
4166 got_mod_index_offset_ and tls_base_symbol_defined_.
4167 (Target_arm::Relocate::relocate_tls): New method.
4168 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4169 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4170 New methods.
4171 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4172 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4173 (Target_arm::got_mod_index_offset_,
4174 Target_arm::tls_base_symbol_defined_): New data members.
4175 (Target_arm::Scan::local, Target::Scan::global,
4176 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4177 relocations.
4178
c8761b9a
DK
41792010-02-18 Doug Kwan <dougkwan@google.com>
4180
4181 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4182 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4183 text section as a parameter becuase some broken tools may not set
4184 the link in section header.
4185 (Target_arm::has_got_section): New method.
4186 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4187 without any mapping symbol as data only. Remove warning.
4188 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4189 link in its section header, try to discover the link by inspecting the
4190 REL31 relocation at the beginning of the section.
4191 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4192 in error message.
4193 (Target_arm::Scan::global): Treat any reference to the symbol
4194 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4195
21bb3914
ST
41962010-02-12 Sriraman Tallam <tmsriram@google.com>
4197
4198 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4199 (Scan::global_reloc_may_be_function_pointer): New function.
4200 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4201 (Scan::global_reloc_may_be_function_pointer): New function.
4202 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4203 (Scan::global_reloc_may_be_function_pointer): New function.
4204 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4205 (Scan::global_reloc_may_be_function_pointer): New function.
4206 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4207 (Scan::global_reloc_may_be_function_pointer): New function.
4208 (Scan::possible_function_pointer_reloc): New function.
4209 (Target_x86_64::can_check_for_function_pointers): New function.
4210 * gc.h (gc_process_relocs): Scan relocation types to determine if
4211 function pointers were taken for targets that support it.
4212 * icf.cc (Icf::find_identical_sections): Include functions for
4213 folding in safe ICF whose pointer is not taken.
4214 * icf.h (Secn_fptr_taken_set): New typedef.
4215 (fptr_section_id_): New member.
4216 (section_has_function_pointers): New function.
4217 (set_section_has_function_pointers): New function.
4218 (check_section_for_function_pointers): New function.
4219 * options.h: Fix comment for safe ICF option.
4220 * target.h (can_check_for_function_pointers): New function.
4221 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4222 Modify icf_safe_test for X86-64.
4223 * testsuite/Makefile.in: Regenerate.
4224 * testsuite/icf_safe_so_test.cc: New file.
4225 * testsuite/icf_safe_so_test.sh: New file.
4226 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4227 (main): Change to take pointer to function kept_func_3.
4228 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4229 folding is done correctly for X86-64.
4230
0da6fa6c
DM
42312010-02-12 David S. Miller <davem@davemloft.net>
4232
4233 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4234 is_symbolless parameter.
4235 (Output_reloc<SHT_REL>::is_symbolless): New.
4236 (Output_reloc<SHT_REL>::is_symbolless_): New.
4237 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4238 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4239 (Output_reloc<SHT_RELA>::is_symbolless): New.
4240 (Output_data_reloc::add_global): Handle is_symbolless.
4241 (Output_data_reloc::add_global_relative): Likewise.
4242 (Output_data_reloc::add_local): Likewise.
4243 (Output_data_reloc::add_local_relative): Likewise.
4244 (Output_data_reloc::add_symbolless_global_addend): New.
4245 (Output_data_reloc::add_symbolless_local_addend): New.
4246 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4247 is_symbolless.
4248 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4249 instead of ->is_relative_
4250 (Output_reloc::write): Likewise.
4251 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4252 (Output_reloc::write_rel): Simplify.
4253
4254 * sparc.cc (Target_sparc::Scan::local): Use
4255 ->add_symbolless_local_addend as needed.
4256 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4257 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4258 based upon relocation offset.
4259
e4782e83
DK
42602010-02-11 Doug Kwan <dougkwan@google.com>
4261
4262 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4263 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4264 beginning of function.
4265 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4266 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4267 parameter is_32bit in calls to should_apply_static_reloc.
4268 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4269 (check_DATA): Add arm_abs_global.stdout.
4270 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4271 arm_abs_global.stdout): New rules.
4272 (MOSTLLYCLEANFILES): Add arm_abs_global
4273 * Makefile.in: Regenerate.
4274 * testsuite/arm_abs_global.s: New file.
4275 * testsuite/arm_abs_global.sh: Ditto.
4276 * testsuite/arm_abs_lib.s: Ditto.
4277
93ceb764
ILT
42782010-02-11 Ian Lance Taylor <iant@google.com>
4279
4280 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4281 Read_relocs task.
4282 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4283 Allocate_commons_task first.
4284 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4285 task, rather than symtab_lock_.
4286 (Gc_process_relocs::~Gc_process_relocs): New function.
4287 (Gc_process_relocs::is_runnable): Check this_blocker_.
4288 (Gc_process_relocs::locks): Use next_blocker_ rather than
4289 blocker_.
4290 (Scan_relocs::~Scan_relocs): New function.
4291 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4292 symtab_lock_.
4293 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4294 next_blocker_.
4295 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4296 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4297 constructor accordingly.
4298 (class Gc_process_relocs): Likewise.
4299 (class Scan_relocs): Likewise.
4300 * common.h (class Allocate_commons_task): Remove symtab_lock_
4301 field, and corresponding constructor parameter.
4302 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4303 symtab_lock_.
4304 (Allocate_commons_task::locks): Likewise.
4305
114dfbe1
ILT
43062010-02-11 Ian Lance Taylor <iant@google.com>
4307
4308 * gold-threads.h (class Once): Define.
4309 (class Initialize_lock): Rewrite as child of Once.
4310 * gold-threads.cc (class Once_initialize): Define.
4311 (once_pointer_control): New static variable.
4312 (once_pointer, once_arg): New static variables.
4313 (c_run_once): New static function.
4314 (Once::Once, Once::run_once, Once::internal_run): New functions.
4315 (class Initialize_lock_once): Remove.
4316 (initialize_lock_control): Remove.
4317 (initialize_lock_pointer): Remove.
4318 (initialize_lock_once): Remove.
4319 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4320 (Initialize_lock::initialize): Rewrite.
4321 (Initialize_lock::do_run_once): New function.
4322 * archive.cc (Archive::interpret_header): Only clear name if it is
4323 not already empty.
4324 * fileread.cc: Include "gold-threads.h"
4325 (file_counts_lock): New static variable.
4326 (file_counts_initialize_lock): Likewise.
4327 (File_read::release): Only increment counts when using --stats.
4328 Use a lock around the increment.
4329 * parameters.cc (class Set_parameters_target_once): Define.
4330 (set_parameters_target_once): New static variable.
4331 (Parameters::Parameters): Move here from parameters.h.
4332 (Parameters::set_target): Rewrite.
4333 (Parameters::set_target_once): New function.
4334 (Parameters::clear_target): Move here and rewrite.
4335 * parameters.h (class Parameters): Update declarations. Add
4336 set_parameters_target_once_ field.
4337 (Parameters::Parameters): Move to parameters.cc.
4338 (Parameters::clear_target): Likewise.
4339 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4340 task.
4341 (Start_group::~Start_group): New function.
4342 (Start_group::is_runnable): New function.
4343 (Start_group::locks, Start_group::run): New functions.
4344 (Finish_group::run): Change saw_undefined to size_t.
4345 * readsyms.h (class Start_group): Define.
4346 (class Finish_group): Change saw_undefined_ field to size_t.
4347 (Finish_group::Finish_group): Remove saw_undefined and
4348 this_blocker parameters. Change all callers.
4349 (Finish_group::set_saw_undefined): New function.
4350 (Finish_group::set_blocker): New function.
4351 * symtab.h (class Symbol_table): Change saw_undefined to return
4352 size_t. Change saw_undefined_ field to size_t.
4353 * target-select.cc (Set_target_once::do_run_once): New function.
4354 (Target_selector::Target_selector): Initialize set_target_once_
4355 field. Don't initialize lock_ and initialize_lock_ fields.
4356 (Target_selector::instantiate_target): Rewrite.
4357 (Target_selector::set_target): New function.
4358 * target-select.h (class Set_target_once): Define.
4359 (class Target_selector): Update declarations. Make
4360 Set_target_once a friend. Remove lock_ and initialize_lock_
4361 fields. Add set_target_once_ field.
4362
fa17a3f4
ILT
43632010-02-10 Ian Lance Taylor <iant@google.com>
4364
4365 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4366 queueing any tasks.
4367 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4368 (queue_middle_tasks): Add all blockers before queueing any tasks.
4369 (queue_final_tasks): Likewise.
4370 * token.h (Task_token::add_blockers): New function.
4371 * object.h (Input_objects::number_of_relobjs): New function.
4372
c7177d31
ILT
43732010-02-10 Ian Lance Taylor <iant@google.com>
4374
5de0e392
ILT
4375 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4376 shared, not if not position independent.
4377 * x86_64.cc (Relocate::relocate_tls): Likewise.
4378 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4379 (tls_pie_pic_test): New target.
4380 * testsuite/Makefile.in: Rebuild.
4381
c7177d31
ILT
4382 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4383 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4384 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4385 * testsuite/Makefile.in: Rebuild.
4386
684b268a
DM
43872010-02-09 David S. Miller <davem@davemloft.net>
4388
4389 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4390 R_SPARC_RELATIVE using ->add_local_relative().
4391 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4392
612a8d3d
DM
4393 * output.h (Output_data_dynamic::add_section_size): New method
4394 that takes two Output_data objects.
4395 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4396 entry param. Handle it in initializers.
4397 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4398 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4399 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4400 arg.
4401 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4402 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4403 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4404 for dynrel_includes_plt.
4405 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4406 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4407 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4408 before .rela.plt
4409 (Target_sparc::do_finalize_sections): Update to pass true for
4410 dynrel_includes_plt.
4411 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4412 output before .rela.plt
4413 (Target_powerpc::do_finalize_sections): Update to pass true for
4414 dynrel_includes_plt when 32-bit.
4415
cb1be87e
DK
44162010-02-08 Doug Kwan <dougkwan@google.com>
4417
4418 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4419 method.
4420 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4421 Arm_relobj::scan_section_for_cortex_a8_stubs,
4422 Arm_relobj::do_relocation_section): Instead of calling
4423 Output_section::output_address, use faster
4424 Arm_relobj::simple_input_section_output_address.
4425
705b5121
DM
44262010-02-08 David S. Miller <davem@davemloft.net>
4427
4428 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4429 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4430 relocation helper function.
4431
024c4466
DM
4432 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4433 just like R_SPARC_GOT{10,13,22}.
4434 (Target_sparc::Scan::local): Likewise.
4435 (Target_sparc::Relocate:relocate): Likewise.
4436
9109c078
ILT
44372010-02-06 Ian Lance Taylor <iant@google.com>
4438
4439 * configure.ac: Rewrite targetobjs duplicate removal code to use
4440 only shell constructs.
4441 * configure: Rebuild.
4442
cf846138
DK
44432010-02-05 Doug Kwan <dougkwan@google.com>
4444
4445 PR 11247
4446 * arm.cc (Arm_relobj::section_is_scannable): New method.
4447 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4448 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4449
6cfaf60b
DK
44502010-02-04 Doug Kwan <dougkwan@google.com>
4451
4452 PR 11247
4453 * arm-reloc-property.cc (cstdio): Include.
4454 * configure.ac (targetobjs): Remove duplicates.
4455 * configure: Regenerate.
4456 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4457 big and little endian version for a given address size.
4458
5c57f1be
DK
44592010-02-03 Doug Kwan <dougkwan@google.com>
4460
4461 * arm-reloc-property.cc
4462 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4463 definition.
4464 * arm-reloc-property.h
4465 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4466 New method definition.
4467 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4468 declaration.
4469 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4470 overflow to N.
4471 (GOT_PREL): Change implemented to Y.
4472 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4473 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4474 (Arm_relocate_functions::movw_abs_nc): Remove method.
4475 (Arm_relocate_functions::movt_abs): Ditto.
4476 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4477 (Arm_relocate_functions::thm_movt_abs): Ditto.
4478 (Arm_relocate_functions::movw_rel_nc): Ditto.
4479 (Arm_relocate_functions::movw_rel): Ditto.
4480 (Arm_relocate_functions::movt_rel): Ditto.
4481 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4482 (Arm_relocate_functions:thm_movw_rel): Ditto.
4483 (Arm_relocate_functions:thm_movt_rel): Ditto.
4484 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4485 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4486 New method definitions.
4487 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4488 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4489 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4490 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4491 (Target_arm::Relocate::relocate): Check for non-static or
4492 unimplemented relocation code and exit early. Change calls to
4493 Target_arm::reloc_uses_thumb_bit and
4494 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4495 instead. Refactor code to handle similar relocations to increase
4496 code sharing. Remove check for unsupported relocation code in switch
4497 statement.
4498 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4499 relocation property table to find out size. Change error message to
4500 print out the name of a relocation code instead of the numeric value.
4501 (Target_arm::scan_reloc_for_stub): Use relocation property table
4502 instead of calling Target_arm::reloc_uses_thumb_bit().
4503
218c5831
DK
45042010-02-02 Doug Kwan <dougkwan@google.com>
4505
4506 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4507 types of relaxed input section.
4508
0d31c79d
DK
45092010-02-02 Doug Kwan <dougkwan@google.com>
4510
4511 * Makefile.am (HFILES): Add arm-reloc-property.h.
4512 (DEFFILES): New.
4513 (TARGETSOURCES): Add arm-reloc-property.cc
4514 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4515 (libgold_a_SOURCES): $(DEFFILES)
4516 * Makefile.in: Regenerate.
4517 * arm-reloc-property.cc: New file.
4518 * arm-reloc-property.h: New file.
4519 * arm-reloc.def: New file.
4520 * arm.cc: Update comments.
4521 (arm-reloc-property.h): New included header.
4522 (arm_reloc_property_table): New global variable.
4523 (Target_arm::do_select_as_default_target): New method definition.
4524 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4525 arm-reloc-property to targ_extra_obj.
4526 * parameters.cc (set_parameters_target): Call
4527 Target::select_as_default_target().
4528 * target.h (Target::select_as_default_target): New method definition.
4529 (Target::do_select_as_default_target): Same.
4530
546c7457
DK
45312010-02-01 Doug Kwan <dougkwan@google.com>
4532
4533 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4534 first_output_text_section_.
4535 (Arm_exidx_fixup::first_output_text_section): New method definition.
4536 (Arm_exidx_fixup::first_output_text_section_): New data member.
4537 (Arm_exidx_fixup::process_exidx_section): Record the first text
4538 output section seen.
4539 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4540 and entsize in output section header.
4541
11b861d5
DK
45422010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4543
4544 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4545 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4546 (Arm_relocate_functions::thm_alu11): New Method.
4547 (Arm_relocate_functions::thm_pc8): New Method.
4548 (Arm_relocate_functions::thm_pc12): New Method.
4549 (Target_arm::Scan::local): Handle the relocations.
4550 (Target_arm::Scan::global): Likewise.
4551 (Target_arm::Relocate::relocate): Likewise.
4552 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4553
c9a2c125
DK
45542010-01-29 Doug Kwan <dougkwan@google.com>
4555
4556 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4557 of relocation types as ld.
4558
1521477a
DK
45592010-01-29 Doug Kwan <dougkwan@google.com>
4560
4561 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4562 to public.
4563 (Arm_relocate_functions::thumb_branch_common): Ditto.
4564 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4565 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4566 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4567 Arm_relocate_functions::jump24): Remove.
4568 (Target_arm::Relocate::relocate): Adjust code to call
4569 Arm_relocation_functions::arm_branch_common and
4570 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4571 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4572
e7eca48c
DK
45732010-01-29 Doug Kwan <dougkwan@google.com>
4574
4575 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4576 output_local_symbol_count_needs_update_.
4577 (Arm_relobj::output_local_symbol_count_needs_update,
4578 Arm_relobj::set_output_local_symbol_count_needs_update,
4579 Arm_relobj::update_output_local_symbol_count): New methods.
4580 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4581 member.
4582 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4583 of pointed function as in a R_ARM_PREL31 relocation.
4584 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4585 for output local symbol count updating.
4586 (Target_arm::do_relax): Update output local symbol counts in objects
4587 if necessary.
4588 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4589
02961d7e
ILT
45902010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4591
4592 * arm.cc: Added support for the ARM relocations:
4593 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4594 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4595 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4596 movw_prel_nc).
4597 (Arm_relocate_functions::movw_rel): New method.
4598 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4599 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4600 thm_movw_prel_nc).
4601 (Arm_relocate_functions::thm_movw_rel): New method.
4602 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4603 thm_movt_prel).
4604 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4605 relocations.
4606 (Target_arm::Scan::global): Likewise.
4607 (Target_arm::Relocate::relocate): Likewise.
4608 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4609 Likewise.
4610
b10d2873
ILT
46112010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4612
4613 * arm.cc: Added support for ARM group relocations.
4614 (Target_arm::reloc_needs_sym_origin): New method.
4615 (Arm_relocate_functions::calc_grp_kn): New method.
4616 (Arm_relocate_functions::calc_grp_residual): New method.
4617 (Arm_relocate_functions::calc_grp_gn): New method.
4618 (Arm_relocate_functions::arm_grp_alu): New Method.
4619 (Arm_relocate_functions::arm_grp_ldr): New Method.
4620 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4621 (Arm_relocate_functions::arm_grp_ldc): New Method.
4622 (Target_arm::Scan::local): Handle the ARM group relocations.
4623 (Target_arm::Scan::global): Likewise.
4624 (Target_arm::Relocate::relocate): Likewise.
4625 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4626 Likewise.
4627
2b328d4e
DK
46282010-01-26 Doug Kwan <dougkwan@google.com>
4629
4630 * arm.cc (set): Include.
4631 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4632 pointer type.
4633 (Arm_output_section::Text_section_list): New type.
4634 (Arm_output_section::append_text_sections_to_list): New method.
4635 (Arm_output_section::fix_exidx_coverage): Ditto.
4636 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4637 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4638 Relobj::set_section_offset() instead of
4639 Sized_relobj::invalidate_section_offset().
4640 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4641 parameter for section headers. Ignore relocation sections for
4642 unallocated sections and EXIDX sections.
4643 (Target_arm::fix_exidx_coverage): New method.
4644 (Target_arm::output_section_address_less_than): New type.
4645 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4646 linked text section instead of the EXIDX section.
4647 (Arm_output_section::create_stub_group): Add an assertion to check
4648 that this is not an EXIDX output section.
4649 (Arm_output_section::append_text_sections_to_list): New method.
4650 (Arm_output_section::fix_exidx_coverage): Ditto.
4651 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4652 Arm_relobj::section_needs_reloc_stub_scanning.
4653 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4654 first pass.
4655 (Target_arm::fix_exidx_coverage): New method.
4656 * object.h (Relobj::set_output_section): New method.
4657 (Sized_relobj::invalidate_section_offset): Remove method.
4658 (Sized_relobj::do_invalidate_section_offset): Remove method.
4659 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4660
c7f3c371
DK
46612010-01-25 Doug Kwan <dougkwan@google.com>
4662
4663 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4664 Fix warning due to signed and unsigned comparison on a 32-bit host.
4665
8923b24c
DK
46662010-01-22 Doug Kwan <dougkwan@google.com>
4667
4668 * arm.cc (Target_arm::do_relax): Record an output section for section
4669 offset adjustment it contains any stub table that has changed.
4670 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4671 offsets in an output section if necessary.
4672 * output.cc (Output_section::Output_section): Initialize
4673 section_offsets_need_adjustments_.
4674 (Output_section::add_input_section_for_script): Renamed to
4675 Output_section::add_simple_input_section.
4676 (Output_section::save_states): Add a comment.
4677 (Output_section::discard_states): New method defintion.
4678 (Output_section::adjust_section_offsets): Same.
4679 * output.h (Output_section::add_input_section_for_script): Renamed to
4680 Output_section::add_simple_input_section.
4681 (Output_section::discard_states): New method declaration.
4682 (Output_section::adjust_section_offsets): Same.
4683 (Output_section::section_offsets_need_adjustment,
4684 Output_section::set_section_offsets_need_adjustment): New method
4685 definitions.
4686 (Output_section::section_offsets_need_adjustment_): New data member.
4687 * script-sections.cc
4688 (Output_section_element_input::set_section_address): Adjust code for
4689 renaming of Output_section::add_input_section_for_script.
4690 (Orphan_output_section::set_section_address): Same.
4691
9b2fd367
DK
46922010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4693
4694 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4695 Fix_v4bx enum values .
4696 * gold/options.h (General_options): New option definitions.
4697 (General_options::fix_v4bx): New method.
4698 (General_options::Fix_v4bx): New enum.
4699 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4700 (General_options::parse_fix_v4bx_interworking): New method.
4701
80d0d023
DK
47022010-01-22 Doug Kwan <dougkwan@google.com>
4703
4704 * arm.cc (Arm_exidx_fixup): New class.
4705
af2cdeae
DK
47062010-01-21 Doug Kwan <dougkwan@google.com>
4707
4708 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4709 classes.
4710 (Arm_exidx_section_offset_map): New type.
4711
993d07c1
DK
47122010-01-21 Doug Kwan <dougkwan@google.com>
4713
4714 * arm.cc (Arm_exidx_input_section): New class.
4715 (Arm_relobj::exidx_input_section_by_link,
4716 Arm_relobj::exidx_input_section_by_shndx,
4717 Arm_relobj::make_exidx_input_section): New methods.
4718 (read_arm_attributes_section): Remove.
4719 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4720 information about them.
4721 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4722 to here.
4723
5ac169d4
DK
47242010-01-20 Doug Kwan <dougkwan@google.com>
4725
4726 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4727 Input_section_specifier to Section_id.
4728 (Target_arm::new_arm_input_section: Adjust code for change of key
4729 type.
4730 (Target_arm::find_arm_input_section): Ditto.
4731 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4732 (Section_id): Remove.
4733 (Garbage_collection::Section_id_hash): Remove.
4734 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4735 (Section_id): Remove.
4736 (Icf::Section_id_hash): Remove.
4737 * object.h (Section_id, Const_section_id, Section_id_hash,
4738 Const_section_id_hash): New type definitions.
4739 * output.cc (Output_section::add_relaxed_input_section): Change to
4740 use Const_section_id instead of Input_section_specifier as key type.
4741 (Output_section::add_merge_input_section): Ditto.
4742 (Output_section::build_relaxation_map): Change to use Section_id
4743 instead of Input_section_specifier as key type.
4744 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4745 Ditto.
4746 (Output_section::convert_input_sections_to_relaxed_sections): Change
4747 to use Const_section_id instead of Input_section_specifier as key type.
4748 (Output_section::find_merge_section): Ditto.
4749 (Output_section::find_relaxed_input_section): Ditto.
4750 * output.h (Input_section_specifier): Remove class.
4751 (Output_section::Output_section_data_by_input_section_map): Change
4752 key type to Const_section_id.
4753 (Output_section::Output_relaxed_input_section_by_input_section_map):
4754 Ditto.
4755 (Output_section::Relaxation_map): Change key type to Section_id.
4756
a2162063
ILT
47572010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4758
4759 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4760 (class Arm_v4bx_stub): New class.
4761 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4762 (Stub_factory::make_arm_v4bx_stub): New method.
4763 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4764 (Stub_table::empty): Handle v4bx stubs.
4765 (Stub_table::add_arm_v4bx_stub): New method.
4766 (Stub_table::find_arm_v4bx_stub): New method.
4767 (Arm_relocate_functions::v4bx): New method.
4768 (Target_arm::fix_v4bx): New method.
4769 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4770 (Stub_table::relocate_stubs): Likewise.
4771 (Stub_table::do_write): Likewise.
4772 (Stub_table::update_data_size_and_addralign): Likewise.
4773 (Stub_table::finalize_stubs): Likewise.
4774 (Target_arm::Scan::local): Likewise.
4775 (Target_arm::Scan::global): Likewise.
4776 (Target_arm::do_finalize_sections): Likewise.
4777 (Target_arm::Relocate::relocate): Likewise.
4778 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4779 Likewise.
4780 (Target_arm::scan_reloc_for_stub): Likewise.
4781 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4782
5696ab0b
ILT
47832010-01-19 Ian Lance Taylor <iant@google.com>
4784
4785 * output.cc (Output_section_headers::do_sized_write): Write large
4786 segment count to sh_info field.
4787 (Output_file_header::do_sized_write): For large segment count,
4788 write PN_XNUM to e_phnum field.
4789
800d0f56
ILT
47902010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4791
4792 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4793 (Arm_relocate_functions::thm_jump8): New function.
4794 (Arm_relocate_functions::thm_jump11): New function.
4795 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4796 R_ARM_THM_JUMP11.
4797 (Target_arm::Scan::global): Likewise.
4798 (Target_arm::Relocate::relocate): Likewise.
4799 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4800 Likewise.
4801
41263c05
DK
48022010-01-14 Doug Kwan <dougkwan@google.com>
4803
4804 * arm.cc (map, utility): Include headers.
4805 (Target_arm::apply_cortex_a8_workaround): New method.
4806 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4807 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4808 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4809 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4810 the --[no-]fix-cortex-a8 command line options.
4811 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4812 (Target_arm::relocate_stub): Use addend in instruction template.
4813 * options.h (DEFINE_bool): Set the user-set flag.
4814 (General_options): Add --[no-]-fix-cortex options.
4815 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4816 : Update fast look-up map after conversion.
41263c05 4817
459e9b03
ST
48182010-01-14 Sriraman Tallam <tmsriram@google.com>
4819
4820 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4821 in the first pass of do_layout.
4822
b521dfe4
DK
48232010-01-13 Doug Kwan <dougkwan@google.com>
4824
4825 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4826 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4827 apparent compiler problem of not folding static constant integral
4828 data members of elfcpp::Elf_sizes<32>.
4829
44272192
DK
48302010-01-13 Doug Kwan <dougkwan@google.com>
4831
4832 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4833 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4834 Arm_relobj::scan_section_for_cortex_a8_erratum,
4835 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4836 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4837 sections to scan for relocation stubs into a new method
4838 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4839 relocation and Cortex-A8 stub scanning.
4840 (Target_arm::do_relax): Force stubs to be after stubbed sections
4841 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4842 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4843 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4844
44b71ece
ILT
48452010-01-12 Ian Lance Taylor <iant@google.com>
4846
4847 * target-reloc.h (visibility_error): New inline function.
4848 (relocate_section): Call visibility_error.
4849 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4850 (MOSTLYCLEANFILES): Likewise.
4851 (protected_4_pic.o, protected_3.err): New targets.
4852 * testsuite/protected_4.cc: New file.
4853
a120bc7f
DK
48542010-01-12 Doug Kwan <dougkwan@google.com>
4855
4856 * arm.cc (Cortex_a8_reloc): New class.
4857 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4858 and cortex_a8_relocs_info_.
4859 (Target_arm::fix_cortex_a8): New method definition.
4860 (Target_arm::Cortex_a8_relocs_info): New type.
4861 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4862 New data member declarations.
4863 (Target_arm::scan_reloc_for_stub): Record information about
4864 relocations for THUMB branches that might be exempted from the
4865 Cortex-A8 workaround.
4866 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4867 at the beginning of a relaxation pass.
4868
20138696
DK
48692010-01-12 Doug Kwan <dougkwan@google.com>
4870
4871 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4872 (Arm_relobj::Mapping_symbol_position,
4873 Arm_reloj::Mapping_symbol_position_less,
4874 Arm_relobj::Mapping_symbols_info): New types.
4875 (Target_arm::is_mapping_symbol_name): New method definition.
4876 (Arm_relobj::do_count_local_symbols): Save information about mapping
4877 symbols.
4878
089d69dc
DK
48792010-01-11 Doug Kwan <dougkwan@google.com>
4880
4881 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4882 Arm_relocate_functions::thumb32_branch_upper,
4883 Arm_relocate_functions::thumb32_branch_lower,
4884 Arm_relocate_functions::thumb32_cond_branch_offset,
4885 Arm_relocate_functions::thumb32_cond_branch_upper,
4886 Arm_relocate_functions::thumb32_cond_branch_lower,
4887 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4888 branch offset encoding.
4889 (Arm_relocate_functions::thumb_branch_common): Use new branch
4890 offset encoding methods to avoid code duplication.
4891 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4892 (Stub_addend_reader::operator()): Use new branch encoding method
4893 to avoid code duplication.
4894
99e5bff2
DK
48952010-01-11 Doug Kwan <dougkwan@google.com>
4896
4897 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4898 (Target_arm::do_finalize_sections): Define special EXIDX section
4899 symbols only if referenced.
4900 * gc.h (Garbage_collection::add_reference): New method.
4901 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4902 code duplication.
4903
98e090bd
ILT
49042010-01-11 Ian Lance Taylor <iant@google.com>
4905
d0a91bd8
ILT
4906 * script.cc (Version_script_info::build_expression_list_lookup):
4907 Change complaing about duplicate wildcard match from error to
4908 warning.
4909
98e090bd
ILT
4910 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4911 of 2009-12-30.
4912 (Version_script_info::Version_script_info): Initialize globs_,
4913 default_version_, default_is_global_, and exact_. Don't
4914 initialize globals_ or locals_.
4915 (Version_script_info::build_lookup_tables): Build local symbols
4916 first.
4917 (Version_script_info::unquote): New function.
4918 (Version_script_info::add_exact_match): New function.
4919 (Version_script_info::build_expression_list_lookup): Remove lookup
4920 parameter. Add is_global parameter. Change all callers. Handle
4921 wildcard pattern specially. Unquote pattern. Call
4922 add_exact_match.
4923 (Version_script_info::get_name_to_match): New function.
4924 (Version_script_info::get_symbol_version): New function.
4925 (Version_script_info::get_symbol_version_helper): Remove.
4926 (Version_script_info::check_unmatched_names): Call unquote.
4927 * script.h (class Version_script_info): Change get_symbol_version
4928 to be non-inline and add is_global parameter; change all callers.
4929 Rewrite symbol_is_local. Update declarations. Define struct
4930 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4931 Remove globals_ and locals_ members. Add exact_, globs_,
4932 default_version_, is_global_.
4933 (Version_script_info::Glob): Remove pattern, add expression and
4934 is_global. Update constructor. Change all callers.
4935 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4936 default version.
4937 (Versions::symbol_section_contents): If a symbol is undefined, or
4938 defined in a dynamic object, set the version index to
4939 VER_NDX_LOCAL.
4940 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4941 symbol_is_local.
4942 (Symbol_table::add_from_pluginobj): Likewise.
4943 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4944
d56962d3
DK
49452010-01-11 Doug Kwan <dougkwan@google.com>
4946
4947 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4948 (incremental_dump_LDADD): Add linking option for libintl.
4949 * Makefile.in: Regenerate.
4950
94e6ee91
L
49512010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4952
4953 PR gold/11144
4954 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4955 instead of -Ds.
4956 * testsuite/Makefile.in: Regenerated.
4957
e96c574b
DK
49582010-01-10 Doug Kwan <dougkwan@google.com>
4959
4960 * options.h (DEFINE_var): Use parentheses around argument varname__
4961 in macro body to avoid any unintended subsequent substitutions.
4962
7198066b
ILT
49632010-01-10 Ian Lance Taylor <iant@google.com>
4964
ba4d53bf
ILT
4965 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4966 candidates before doing symbol resolution.
4967
7198066b
ILT
4968 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4969 ODR candidates if only one is weak.
4970
a2beed37
ILT
49712010-01-08 Ian Lance Taylor <iant@google.com>
4972
4973 * script.cc (Version_script_info::build_expression_list_lookup):
4974 Don't warn about ambiguous version, just record the ambiguity.
4975 (Version_script_info::get_symbol_version_helper): Give error if
4976 version is ambiguous.
4977
2fb7225c
DK
49782010-01-08 Doug Kwan <dougkwan@google.com>
4979
4980 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4981 prev_data_size_ and prev_addralign_. Remove initializer for
4982 deleted data member has_been_changed_.
4983 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4984 to determine if the table is empty.
4985 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4986 Remove.
4987 (Stub_table::add_reloc_stub): Define method in class definition
4988 instead of just declaring it there.
4989 (Stub_table::add_cortex_a8_stub): New method definition.
4990 (Stub_table::update_data_size_and_addralign): Ditto.
4991 (Stub_table::finalize_stubs): Ditto.
4992 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4993 (Stub_table::do_addralign_): Return address alignment in the
4994 (Stub_table::do_reset_address_and_file_offset): Define method in
4995 class definition instead of declaring it there. Set current data
4996 size to be the data size of the previous pass.
4997 (Stub_table::set_final_data_size): Use current data size as the
4998 final data size.
4999 (Stub_table::relocate_stub): Change parameter type of stub from
5000 Reloc_stub pointer to Stub pointer.
5001 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5002 (Stub_table::Cortex_a8_stub_list): New typedef.
5003 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5004 Stub_table::prev_addralign_): New data member.
5005 (Arm_relobj::Arm_relobj): Initialize data member
5006 section_has_cortex_a8_workaround_.
5007 (Arm_relobj::section_has_cortex_a8_workaround,
5008 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5009 definitions.
5010 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5011 declarations.
5012 (Target_arm::relocate_stub): Change parameter type of stub from
5013 Reloc_stub pointer to Stub pointer.
5014 (Insn_template::size, Insn_template::alignment): Handle
5015 THUMB16_SPECIAL_TYPE.
5016 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5017 Stub_table::update_data_size_and_addralign,
5018 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5019 definitions.
5020 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5021 (Stub_table::do_write): Ditto.
5022 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5023
880cd20d
ILT
50242010-01-08 Ian Lance Taylor <iant@google.com>
5025
5026 PR 11108
5027 * symtab.h (class Symbol): Remove fields is_target_special_ and
5028 has_plt_offset_. Add field is_defined_in_discarded_section_.
5029 (Symbol::is_defined_in_discarded_section): New function.
5030 (Symbol::set_is_defined_in_discarded_section): New function.
5031 (Symbol::has_plt_offset): Rewrite.
5032 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5033 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5034 Don't initialize is_target_special_ or has_plt_offset_.
5035 Initialize is_defined_in_discarded_section_.
5036 (Symbol_table::add_from_relobj): If appropriate, set
5037 is_defined_in_discarded_section.
5038 * resolve.cc (Symbol::override_base_with_special): Don't test
5039 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5040 * target-reloc.h (relocate_section): Do special handling for
5041 symbols defined in discarded sections for global symbols as well
5042 as local symbols.
5043
2703e3eb
ILT
50442010-01-08 Ian Lance Taylor <iant@google.com>
5045
5046 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5047 the SHT_SYMTAB case.
5048
339d40a3
ILT
50492010-01-08 Ian Lance Taylor <iant@google.com>
5050
5051 * object.cc (Sized_relobj::do_layout): Don't get confused if
5052 layout_eh_frame returns NULL.
5053
abecea76
ILT
50542010-01-08 Ian Lance Taylor <iant@google.com>
5055
5056 PR 11084
5057 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5058 dynamic symbol table, use the normal symbol table.
5059 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5060 symbol table.
5061
6b7dd3f3
ILT
50622010-01-08 Ian Lance Taylor <iant@google.com>
5063
5064 PR 11072
5065 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5066 sections.
5067
36c50e63
L
50682010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5069
5070 * version.cc (print_version): Change to "Copyright 2010".
5071
e291e7b9
ILT
50722010-01-08 Ian Lance Taylor <iant@google.com>
5073
5074 PR 10287
5075 PR 11063
5076 * i386.cc (class Target_i386): Change return type of plt_section
5077 to be non-const.
5078 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5079 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5080 tls_desc_rel_ field.
5081 (Output_data_plt_i386::rel_tls_desc): New function.
5082 (Target_i386::rel_tls_desc_section): New function.
5083 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5084 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5085 R_386_TLS_DESC reloc in rel_tls_desc_section.
5086 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5087 Define struct Tlsdesc_info.
5088 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5089 (Target_x86_64::do_reloc_symbol_index): New function.
5090 (Target_x86_64::add_tlsdesc_info): New function.
5091 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5092 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5093 tlsdesc_rel_ field.
5094 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5095 all callers.
5096 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5097 (Target_x86_64::rela_tlsdesc_section): New function.
5098 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5099 handling.
5100 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5101 (Target_x86_64::do_reloc_addend): New function.
5102 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5103 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5104 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5105 (Output_reloc::type): New function.
5106 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5107 (Output_reloc::is_target_specific): New function.
5108 (Output_reloc::target_arg): New function.
5109 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5110 absolute relocs and target specific relocs.
5111 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5112 add_target_specific.
5113 (class Output_data_reloc) [SHT_RELA]: Likewise.
5114 * output.cc (Output_reloc::Output_reloc): Add four new versions
5115 for absolute relocs and target specific relocs.
5116 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5117 (Output_reloc::get_symbol_index): Likewise.
5118 (Output_reloc::local_section_offset): Check that local_sym_index_
5119 is not TARGET_CODE or 0.
5120 (Output_reloc::symbol_value): Likewise.
5121 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5122 reloc.
5123 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5124 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5125 functions.
5126 * layout.cc (add_target_dynamic_tags): Use output section for
5127 DT_PLTRELSZ and DT_JMPREL.
5128
3a44184e
ILT
51292010-01-07 Ian Lance Taylor <iant@google.com>
5130
5131 PR 11061
5132 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5133 function.
5134 (class Output_data_reloc_generic): Define.
5135 (class Output_data_reloc_base): Change base class to
5136 Output_data_reloc_generic. Change add() method to call
5137 bump_relative_reloc_count for a relative reloc. Remove
5138 sort_relocs_ field.
5139 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5140 to sort_relocs().
5141 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5142 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5143 appropriate.
5144 * layout.h (class Layout): Update declaration.
5145
ea715a34
ILT
51462010-01-07 Ian Lance Taylor <iant@google.com>
5147
5148 * output.h (class Output_data): Add const version of
5149 output_section and do_output_section.
5150 (class Output_section_data): Add const version of
5151 do_output_section.
5152 (class Output_section): Likewise.
5153 * layout.cc (Layout::add_target_dynamic_tags): New function.
5154 * layout.h (class Layout): Update declarations.
5155 * arm.cc (Target_arm::do_finalize_sections): Use
5156 add_target_dynamic_tags.
5157 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5158 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5159 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5160 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5161
659948a4
ILT
51622010-01-07 Ian Lance Taylor <iant@google.com>
5163
5164 PR 11042
5165 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5166 object as needed.
5167
9d3b86f6
ILT
51682010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5169 Ian Lance Taylor <iant@google.com>
5170
5171 PR 11019
5172 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5173 Xindex::read_symtab_xindex.
5174
bb0d3eb0
DK
51752010-01-07 Doug Kwan <dougkwan@google.com>
5176
5177 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5178 (Insn_template::thumb16_bcond_insn): New method declaration.
5179 (Insn_template): Fix spelling.
5180 (Stub::thumb16_special): New method declaration.
5181 (Stub::do_write): Define virtual method which was previously pure
5182 virtual.
5183 (Stub::do_thumb16_special): New method declaration.
5184 (Stub::do_fixed_endian_write): New template member.
5185 (Reloc_stub::do_write): Remove.
5186 (Reloc_stub::do_fixed_endian_write): Remove.
5187 (Cortex_a8_stub): New class definition.
5188 (Stub_factory::make_cortex_a8_stub): New method definition.
5189 (Stub_factory::Stub_factory): Add missing static storage class
5190 qualifier for elf32_arm_stub_a8_veneer_blx.
5191
ffeef7df
ILT
51922010-01-07 Ian Lance Taylor <iant@google.com>
5193
dc3f80fe
ILT
5194 PR 10980
5195 * options.h (class General_options): Add --warn-unresolved-symbols
5196 and --error-unresolved-symbols.
5197 * errors.cc (Errors::undefined_symbol): Implement
5198 --warn-unresolved-symbols.
5199
ffeef7df
ILT
5200 * options.h (class General_options): Add -z text and -z textoff.
5201 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5202
f1ec9ded
ST
52032010-01-06 Sriraman Tallam <tmsriram@google.com>
5204
5205 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5206 (Garbage_collection::cident_sections): New function.
5207 (Garbage_collection::add_cident_section): New function.
5208 (Garbage_collection::cident_sections_): New member.
5209 (gc_process_relocs): Add references to sections whose names are C
5210 identifiers.
5211 * gold.h (cident_section_start_prefix): New constant.
5212 (cident_section_stop_prefix): New constant.
5213 (is_cident): New function.
5214 * layout.cc (Layout::define_section_symbols): Replace string constants
5215 with the newly defined constants.
5216 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5217 C identifiers.
5218 * testsuite/Makefile.am: Add gc_orphan_section_test.
5219 * testsuite/Makefile.in: Regenerate.
5220 * testsuite/gc_orphan_section_test.cc: New file.
5221 * testsuite/gc_orphan_section_test.sh: New file.
5222
6eda8c29
ILT
52232010-01-06 Ian Lance Taylor <iant@google.com>
5224
b9674e17
ILT
5225 PR 10980
5226 * options.h (class General_options): Add --warn-shared-textrel.
5227 * layout.cc (Layout::finish_dynamic_section): Implement
5228 --warn-shared-textrel.
5229
6eda8c29
ILT
5230 PR 10980
5231 * options.h (class General_options): Add --warn-multiple-gp.
5232
32dcd44e
ILT
52332010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5234
5235 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5236 $(THREADSLIB) and $(LIBDL).
5237 * Makefile.in: Rebuild.
5238
a192ba05
ILT
52392010-01-06 Ian Lance Taylor <iant@google.com>
5240
5241 PR 10980
5242 * options.cc (General_options::parse_section_start): New function.
5243 (General_options::section_start): New function.
5244 (General_options::General_options): Initialize all members.
5245 * options.h: Include <map>
5246 (class General_options): Add --section-start. Add section_starts_
5247 member.
5248 * layout.cc (Layout::attach_allocated_section_to_segment): If
5249 --section-start was used, set the address of the segment. Remove
5250 local sort_sections.
5251 (Layout::relaxation_loop_body): If the address of the load segment
5252 has been set by --section-start, don't use it.
5253 * output.h (Output_segment::update_flags_for_output_section): New
5254 function.
5255 * output.cc (Output_segment::add_output_section): Call
5256 update_flags_for_output_section.
5257
dde3f402
ILT
52582010-01-05 Ian Lance Taylor <iant@google.com>
5259
62dfdd4d
ILT
5260 PR 10980
5261 * options.h (class General_options): Add --undefined-version.
5262 * script.cc (struct Version_expression): Add was_matched_by_symbol
5263 field.
5264 (Version_script_info::matched_symbol): New function.
5265 (Version_script_info::get_symbol_version_helper): Call
5266 matched_symbol.
5267 (Version_script_info::check_unmatched_names): New function.
5268 * script.h (class Version_script_info): Update declarations.
5269 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5270
9c4ae156
ILT
5271 * options.h (class General_options): Use DEFINE_bool_alias for
5272 allow_multiple_definition.
5273 * resolve.cc (Symbol_table::should_override): Don't test
5274 allow_multiple_definition.
5275
dde3f402
ILT
5276 PR 10980
5277 * options.h (class General_options): Add --cref.
5278 * main.cc (main): Print cref table if --cref. Don't close mapfile
5279 until after printing cref table.
5280 * cref.cc: Include "symtab.h".
5281 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5282 (Cref_table_compare::operator()): New function.
5283 (Cref_inputs::gather_cref): New function.
5284 (filecol): New static const.
5285 (Cref_inputs::print_cref): New function.
5286 (Cref::print_cref): New function.
5287 * cref.h: Include <cstdio>.
5288 (class Cref): Update declarations.
5289 * mapfile.h (Mapfile::file): New function.
5290 * object.h (class Object): Define Symbols. Declare virtual
5291 do_get_global_symbols.
5292 (Object::get_global_symbols): New function.
5293 * object.cc (Input_objects::add_object): Pass object to cref_ if
5294 --cref.
5295 (Input_objects::archive_start): Likewise.
5296 (Input_objects::archive_stop): Likewise.
5297 (Input_objects::print_cref): New function.
5298 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5299 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5300 --cref.
5301 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5302 function.
5303 * plugin.h (class Sized_pluginobj): Update declarations.
5304
8781f709
ILT
53052010-01-05 Ian Lance Taylor <iant@google.com>
5306
5307 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5308 to is_default_version. Rename insdef to insdefault.
5309 (Symbol_table::add_from_relobj): Rename def to is_default_version
5310 and local to is_forced_local.
5311 (Symbol_table::add_from_pluginobj): Likewise.
5312 (Symbol_table::add_from_dynobj): Likewise.
5313 (Symbol_table::define_special_symbol): Rename insdef to
5314 insdefault.
5315
fe35d28d
ILT
53162010-01-04 Ian Lance Taylor <iant@google.com>
5317
30bc8c46
ILT
5318 PR 10980
5319 * options.h (class General_options): Add
5320 --allow-multiple-definition and -z muldefs.
5321 * resolve.cc (Symbol_table::should_override): Don't warn about a
5322 multiple symbol definition if --allow-multiple-definition or -z
5323 muldefs.
5324
7eaea549
ILT
5325 PR 10980
5326 * options.h (class General_options): Add --add-needed and
5327 --copy-dt-needed-entries. Tweak --as-needed help entry.
5328 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5329 error if --copy-dt-needed-entries aka --add-needed is used and
5330 would cause a change in behaviour.
5331
fe35d28d
ILT
5332 PR 10980
5333 * options.h (class General_options): Add -G as a short version of
5334 --shared. Add no-op options -assert, -g, and -i.
5335
55a2bb35
ST
53362010-01-04 Sriraman Tallam <tmsriram@google.com>
5337
5338 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5339 check for .text or .gnu.linkonce.t sections.
5340 * icf.cc (Icf::find_identical_sections): Ditto.
5341 Change the detection for mangled function name within the section
5342 name.
5343 * icf.h (is_section_foldable_candidate): New function.
5344
719328e1
ILT
53452009-12-30 Ian Lance Taylor <iant@google.com>
5346
5347 PR 10980
5348 * options.h (class General_options): Permit two dashes with
5349 --retain-symbols-file.
5350
d7bb5745
ILT
53512009-12-30 Ian Lance Taylor <iant@google.com>
5352
403a15dd
ILT
5353 PR 10979
5354 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5355 don't put the file header and segment headers in the text
5356 segment.
5357
eda294df
ILT
5358 PR 10979
5359 * common.cc (Sort_commons::operator()): Stabilize sort when both
5360 entries are NULL.
5361 (Symbol_table::do_allocate_commons_list): When allocating common
5362 symbols, skip a symbol which is no longer common.
5363 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5364 an object before checking its type.
5365 * testsuite/common_test_2.c: New file.
5366 * testsuite/common_test_3.c: New file.
5367 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5368 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5369 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5370 (common_test_2_pic.o, common_test_2.so): New targets.
5371 (common_test_3_pic.o, common_test_3.so): New targets.
5372 * testsuite/Makefile.in: Rebuild.
5373
d7bb5745
ILT
5374 PR 10979
5375 * script.cc (read_input_script): If we see a new SECTIONS clause,
5376 and we have added an input section, give an error.
5377 * layout.h (class Layout): Add have_added_input_section function.
5378 Add have_added_input_section_ field.
5379 * layout.cc (Layout::Layout): Initialize
5380 have_added_input_section_.
5381 (Layout::layout): Set have_added_input_section_.
5382 (Layout::layout_eh_frame): Likewise.
5383
fc59c572
ILT
53842009-12-30 Ian Lance Taylor <iant@google.com>
5385
5386 PR 10931
5387 * options.h (class General_options): Add --sort-common option.
5388 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5389 * common.cc (Sort_common): Add sort_order parameter to
5390 constructor. Add sort_order_ field.
5391 (Sort_commons::operator): Check sort_order_.
5392 (Symbol_table::allocate_commons): Determine the sort order.
5393 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5394 Change all callers.
5395 (Symbol_table::do_allocate_commons_list): Likewise.
5396
1c74fab0
ILT
53972009-12-30 Ian Lance Taylor <iant@google.com>
5398
5399 PR 10916
5400 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5401 symbols from this object, don't change the visibility of an
5402 undefined symbol.
5403 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5404
6affe781
ILT
54052009-12-30 Ian Lance Taylor <iant@google.com>
5406
5407 PR 10861
5408 * script.h (class Version_script_info): Define Language enum.
5409 Update declarations. Define Glob, Exact, and Lookup types. Add
5410 new fields globals_, locals_, and is_finalized_.
5411 * script.cc: Various formatting fixes.
5412 (class Parser_closure): Change language_stack_ from a vector of
5413 std::string to one of Version_script_info::Language. Adjust all
5414 uses accordingly.
5415 (class Lazy_demangler): Remove.
5416 (struct Version_expression): Change language from std::string to
5417 Version_script_info::Language.
5418 (Version_script_info::Version_script_info): New function.
5419 (Version_script_info::~Version_script_info): Don't call clear.
5420 (Version_script_info::finalize): New function.
5421 (Version_script_info::build_lookup_tables): New function.
5422 (Version_script_info::build_expression_list_lookup): New
5423 function.
5424 (Version_script_info::get_symbol_version_helper): Rewrite to use
5425 lookup tables.
5426 (Version_script_info::print_expression_list): Adjust to use
5427 Version_script_info::Language.
5428 (script_push_lex_into_version_mode): Check that the version script
5429 has not been finalized.
5430 (version_script_push_lang): Change language string to
5431 Version_script_info::Language.
5432 * options.cc (Command_line::version_script): New function.
5433 * options.h (class General_options): Add finalize_dynamic_list
5434 function. Change version_script from declaration to definition.
5435 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5436 * testsuite/version_script.map: Remove duplicate def of foo.
5437 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5438 version_script.map.
5439 * testsuite/Makefile.in: Rebuild.
5440
818bf354
ILT
54412009-12-30 Ian Lance Taylor <iant@google.com>
5442
5443 PR 10843
5444 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5445 if the input symbol index is 0, make the output symbol index 0.
5446
ebcc8304
ILT
54472009-12-30 Ian Lance Taylor <iant@google.com>
5448
5449 PR 10670
5450 * options.h (class General_options): Add -x/--discard-all.
5451 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5452 --discard-all. If the local symbol needs a dynamic entry, check
5453 that before handling --discard-locals.
5454
176fe33f
ILT
54552009-12-30 Ian Lance Taylor <iant@google.com>
5456
bb321bb1
ILT
5457 PR 10450
5458 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5459 flags to PF_R.
5460 (Output_segment::add_output_section): Don't change the flags if
5461 the type is PT_TLS.
5462
176fe33f
ILT
5463 PR 10450
5464 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5465 GNU hash table if they need a dynamic value. Otherwise, don't add
5466 them if they are defined in a dynamic object or are forced local.
5467
e8cd95c7
ILT
54682009-12-29 Ian Lance Taylor <iant@google.com>
5469
1b81fb71
ILT
5470 PR 10450
5471 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5472 .gnu.hash table for a 32-bit target.
5473
8d6d383d
ILT
5474 PR 10450
5475 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5476 regular and a dynamic object only needs a dynamic symbol table
5477 entry if it is externally visible.
5478
e785ec03
ILT
5479 PR 10450
5480 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5481 constructor. Add global_offset_table_ field.
5482 (Target_i386::got_section): Set global_offset_table_.
5483 (Target_i386::do_finalize_sections): Set global_offset_table_
5484 size.
5485 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5486 in constructor. Add global_offset_table_ field.
5487 (Target_x86_64::got_section): Set global_offset_table_.
5488 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5489 size.
5490
1a2dff53
ILT
5491 * layout.cc (Layout::Layout): Initialize increase_relro_.
5492 (Layout::get_output_section): Add is_relro, is_last_relro, and
5493 is_first_non_relro parameters. Change all callers.
5494 (Layout::choose_output_section): Likewise.
5495 (Layout::add_output_section_data): Likewise.
5496 (Layout::make_output_section): Likewise.
5497 (Layout::set_segment_offsets): Clear increase_relro when using a
5498 linker script.
5499 * layout.h (class Layout): Add increase_relro method. Add
5500 increase_relro_ field. Update declarations.
5501 * output.cc (Output_section::Output_section): Initialize
5502 is_last_relro_ and is_first_non_relro_.
5503 (Output_segment::add_output_section): Group relro sections is
5504 do_sort is true. Handle is_last_relro and is_first_non_relro.
5505 (Output_segment::maximum_alignment): Remove relro handling.
5506 (Output_segment::set_section_addresses): Add increase_relro
5507 parameter. Change all callers. Add initial alignment to align
5508 relro sections on separate page. Remove old relro handling.
5509 (Output_segment::set_section_list_addresses): Remove in_relro
5510 parameter. Change all callers.
5511 (Output_segment::set_offset): Add increase parameter. Change all
5512 callers. Remove old relro handling.
5513 * output.h (class Output_section): Add new methods: is_last_relro,
5514 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5515 Add is_last_relro_ and is_first_non_relro_ fields.
5516 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5517 Create separate .got.plt section. Call increase_relro.
5518 * x86_64.cc (Target_x86_64::got_section): Likewise.
5519 * testsuite/relro_script_test.t: Add .got.plt.
5520
f0ba79e2
ILT
5521 PR 10450
5522 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5523 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5524 (Layout::finalize): Call set_dynamic_symbol_size.
5525 (Layout::set_dynamic_symbol_size): New function.
5526 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5527 set_dynamic_symbol_size.
5528
e8cd95c7
ILT
5529 PR 10450
5530 * output.h (class Output_section): Add is_entsize_zero_ field.
5531 * output.cc (Output_section::Output_section): Initialize
5532 is_entsize_zero_.
5533 (Output_section::set_entsize): If two different entsizes are
5534 requested, force it to zero.
5535 (Output_section::add_input_section): Set flags for .debug_str
5536 before updating section flags. Set entsize.
5537 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5538 and SHF_STRING if all input sections have those flags.
5539
3e1b9a8a
RÁE
55402009-12-29 Rafael Espindola <espindola@google.com>
5541
5542 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5543 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5544 reporting.
3e1b9a8a 5545
3dcad376
ST
55462009-12-29 Sriraman Tallam <tmsriram@google.com>
5547
5548 * options.cc (General_options::parse_version): Allow -v to exit
5549 without an error if there is nothing to link.
5550
084e2665
ILT
55512009-12-29 Ian Lance Taylor <iant@google.com>
5552
5553 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5554 using a version of gcc before 4.1.
5555 * configure: Rebuild.
5556
250acde3
CD
55572009-12-28 Chris Demetriou <cgd@google.com>
5558
5559 * attributes.cc (Output_attributes_section_data::do_write): Use
5560 std::vector::front rather than std::vector::data.
5561
99fff23b
ILT
55622009-12-28 Ian Lance Taylor <iant@google.com>
5563
5564 * symtab.h (class Symbol_table): Add enum Defined.
5565 * resolve.cc (Symbol_table::should_override): Add defined
5566 parameter. Change all callers. Test whether object is NULL
5567 before calling a method on it.
5568 (Symbol_table::report_resolve_problem): Add defined parameter.
5569 Change all callers.
5570 (Symbol_table::should_override_with_special): Likewise.
5571 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5572 parameter. Change all callers.
5573 (Symbol_table::do_define_in_output_data): Likewise.
5574 (Symbol_table::define_in_output_segment): Likewise.
5575 (Symbol_table::do_define_in_output_segment): Likewise.
5576 (Symbol_table::define_as_constant): Likewise.
5577 (Symbol_table::do_define_as_constant): Likewise.
5578 * script.h (class Symbol_assignment): Add is_defsym parameter to
5579 constructor; change all callers.
5580 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5581 parameter. Change all callers. Add is_defsym_ field.
5582 (class Parser_closure): Add parsing_defsym parameter to
5583 constructor; change all callers. Add parsing_defsym accessor
5584 function. Add parsing_defsym_ field.
5585
556bd683
ILT
55862009-12-28 Ian Lance Taylor <iant@google.com>
5587
5588 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5589 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5590
1782c879
ILT
55912009-12-23 Ian Lance Taylor <iant@google.com>
5592
5593 * i386.cc (Target_i386::do_calls_non_split): Recognize
5594 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5595 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5596 -fsplit-stack prologue when using %r11.
1782c879 5597
329ca2b1
ST
55982009-12-21 Sriraman Tallam <tmsriram@google.com>
5599
5600 * options.cc (General_options::parse_version): Make -v continue and do
5601 the link like GNU ld does.
5602
d675ff46
RÁE
56032009-12-17 Rafael Avila de Espindola <espindola@google.com>
5604
5605 * Makefile.am (CCFILES): Add timer.cc.
5606 (HFILES): Add timer.h.
5607 * configure.ac: Check for sysconf and times.
5608 * main.cc: include timer.h.
5609 (main): Use Timer instead of get_run_time.
5610 * timer.cc: New.
5611 * timer.h: New.
5612 * workqueue.cc: include timer.h.
5613 (Workqueue::find_and_run_task):
5614 Report user, sys and wall time.
5615 * Makefile.in: Regenerate.
5616 * config.in: Regenerate.
5617 * configure: Regenerate.
5618
d6344fb5
DK
56192009-12-16 Doug Kwan <dougkwan@google.com>
5620
5621 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5622 sections.
5623 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5624 relaxed input sections.
5625 * output.cc (Output_section::find_relaxed_input_section): Change
5626 return type to Output_relaxed_input_section pointer. Adjust code
5627 for new type of relaxed_input_section_map_.
5628 * output.h (Output_section::find_relaxed_input_section): Change
5629 return type to Output_relaxed_input_section pointer.
5630 (Output_section::Output_relaxed_input_section_by_input_section_map):
5631 New type.
5632 (Output_section::relaxed_input_section_map_): Change type to
5633 Output_section::Output_relaxed_input_section_by_input_section_map.
5634 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5635 input section.
5636
0e0d5469
ILT
56372009-12-15 Ian Lance Taylor <iant@google.com>
5638
5639 * layout.cc (Layout::create_shstrtab): Only write out after input
5640 sections if we are compressing debug sections.
5641
0649a889
ILT
56422009-12-15 Ian Lance Taylor <iant@google.com>
5643
5644 * archive.cc (Archive::add_symbols): Only look up a symbol without
5645 a version if there is, in fact, a version.
5646
2ea97941
ILT
56472009-12-14 Ian Lance Taylor <iant@google.com>
5648
5649 Revert -Wshadow changes, all changes from:
5650 2009-12-11 Doug Kwan <dougkwan@google.com>
5651 2009-12-11 Nick Clifton <nickc@redhat.com>
5652 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5653
b0eec2cc
DK
56542009-12-11 Doug Kwan <dougkwan@google.com>
5655
5656 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5657 due to -Wshadow.
5658 * attributes.cc (Object_attribute::size): Ditto.
5659 (Attributes_section_data::size): Ditto.
5660 (Attributes_section_data::Attributes_section_data): Ditto.
5661 (Output_attributes_section_data::do_write): Ditto.
5662 * attributes.h (Object_attribute::set_type): Ditto.
5663 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5664
91d6fa6a
NC
56652009-12-11 Nick Clifton <nickc@redhat.com>
5666
5667 * archive.cc: Fix shadowed variable warnings.
5668 * arm.cc: Likewise.
5669 * compressed_output.cc: Likewise.
5670 * compressed_output.h: Likewise.
5671 * configure: Likewise.
5672 * dwarf_reader.cc: Likewise.
5673 * dynobj.cc: Likewise.
5674 * dynobj.h: Likewise.
5675 * ehframe.cc: Likewise.
5676 * ehframe.h: Likewise.
5677 * errors.cc: Likewise.
5678 * expression.cc: Likewise.
5679 * fileread.cc: Likewise.
5680 * fileread.h: Likewise.
5681 * freebsd.h: Likewise.
5682 * i386.cc: Likewise.
5683 * icf.cc: Likewise.
5684 * incremental.h: Likewise.
5685 * layout.cc: Likewise.
5686 * layout.h: Likewise.
5687 * mapfile.cc: Likewise.
5688 * merge.cc: Likewise.
5689 * merge.h: Likewise.
5690 * object.cc: Likewise.
5691 * object.h: Likewise.
5692 * options.h: Likewise.
5693 * output.cc: Likewise.
5694 * output.h: Likewise.
5695 * parameters.cc: Likewise.
5696 * plugin.cc: Likewise.
5697 * powerpc.cc: Likewise.
5698 * reduced_debug_output.cc: Likewise.
5699 * reduced_debug_output.h: Likewise.
5700 * reloc.cc: Likewise.
5701 * reloc.h: Likewise.
5702 * resolve.cc: Likewise.
5703 * script-sections.cc: Likewise.
5704 * script.cc: Likewise.
5705 * script.h: Likewise.
5706 * sparc.cc: Likewise.
5707 * symtab.cc: Likewise.
5708 * symtab.h: Likewise.
5709 * target-select.cc: Likewise.
5710 * target-select.h: Likewise.
5711 * token.h: Likewise.
5712 * workqueue.cc: Likewise.
5713 * workqueue.h: Likewise.
5714 * x86_64.cc: Likewise.
5715
a0351a69
DK
57162009-12-10 Doug Kwan <dougkwan@google.com>
5717
5718 * arm.cc (attributes.h): New include.
5719 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5720 (Arm_relobj::~Arm_relobj): Delete object pointed by
5721 attributes_section_data_.
5722 (Arm_relobj::attributes_section_data): New method definition.
5723 (Arm_relobj::attributes_section_data_): New data member declaration.
5724 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5725 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5726 attributes_section_data_.
5727 (Arm_dynobj::attributes_section_data): New method definition.
5728 (Arm_dynobj::attributes_section_data_): New data member declaration.
5729 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5730 initialization value of may_use_blx_ to false.
5731 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5732 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5733 object attributes to compute results instead of hard-coding.
5734 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5735 Target_arm::get_secondary_compatible_arch,
5736 Target_arm::set_secondary_compatible_arch
5737 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5738 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5739 New method declarations.
5740 (Target_arm::get_aeabi_object_attribute): New method definition.
5741 (Target_arm::attributes_section_data_): New data member declaration.
5742 (read_arm_attributes_section): New template definition.
5743 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5744 (Arm_dynobj::do_read_symbols): Ditto.
5745 (Target_arm::do_finalize_sections): Merge attributes sections from
5746 input. Check for BLX use after attributes section merging.
5747 Fix __exidx_start and __exidx_end visibility. Create an
5748 .ARM.attributes section if necessary.
5749 (Target_arm::get_secondary_compatible_arch,
5750 Target_arm::set_secondary_compatible_arch,
5751 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5752 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5753 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5754 New method definitions.
5755
b59befec
ILT
57562009-12-09 Ian Lance Taylor <iant@google.com>
5757
5758 * plugin.cc (Plugin::load): Don't cast from void* to a function
5759 pointer.
5760
1276bc89
ILT
57612009-12-09 Ian Lance Taylor <iant@google.com>
5762
5763 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5764 information fields.
5765
2f2de248
L
57662009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5767
5768 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5769 Replace two_file_shared_1.so with two_file_shared_2.so.
5770 * testsuite/Makefile.in: Regenerated.
5771
4f787271
DK
57722009-12-08 Doug Kwan <dougkwan@google.com>
5773
5774 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5775 (HFILES): Add attributes.h and int_encoding.h.
5776 * Makefile.in: Regenerate.
5777 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5778 function definitions to int_encoding.cc
5779 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5780 prototypes to int_encoding.h
5781 * reduced_debug_output.cc (int_encoding.h): New include.
5782 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5783 function definitions to int_encoding.cc
5784 (insert_into_vector, read_from_pointer): Move template definitions to
5785 int_encoding.h
5786 * attributes.cc: New file.
5787 * attributes.h: New file.
5788 * int_encoding.cc: New file.
5789 * int_encoding.h: New file.
5790
20b52f1a
RÁE
57912009-12-07 Rafael Avila de Espindola <espindola@google.com>
5792
5793 PR gold/11055
5794 * incremental-dump.cc (dump_incremental_inputs): New.
5795 (main): Use dump_incremental_inputs.
5796
53d7974c
L
57972009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5798
5799 PR gold/10893
5800 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5801 checking elfcpp::STT_FUNC.
5802 (Target_i386::Relocate::relocate): Likewise.
5803 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5804
5805 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5806 symbols from shared libraries into normal FUNC symbols.
5807
5808 * symtab.h (Symbol): Add is_func and use it.
5809
05a352e6
DK
58102009-12-05 Doug Kwan <dougkwan@google.com>
5811
5812 * arm.cc (Target_arm::arm_info): Initialize new fields
5813 attributes_section and attributes_vendor.
5814 * i386.cc (Target_i386::i386_info): Same.
5815 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5816 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5817 fields attributes_section and attributes_vendor.
53d7974c 5818 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5819 * target.h (Target::attributes_section, Target::attributes_vendor,
5820 Target::is_attributes_section, Target::attribute_arg_type,
5821 Target::attributes_order): New method definitions.
5822 (Target::Target_info::attributes_section,
5823 Target::Target_info::attributes_vendor): New fields.
5824 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5825 virtual method definitions.
5826 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5827 attributes_section and attributes_vendor.
5828 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5829
f4e5969c
DK
58302009-12-05 Doug Kwan <dougkwan@google.com>
5831
5832 * arm.cc: Update comments about interworking and stub generation.
5833 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5834 considered as non-PIC.
5835 (Arm_relocate_functions::base_abs): Fix formatting.
5836 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5837 of function to use GOT entry address instead of offset.
5838 (Target_arm::Scan::global): Issue an error if a symbol would need a
5839 PLT does not get one because it is untyped. Remove code to create
5840 dynamic symbols for relative branches.
5841 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5842 takes unsigned integer instead of boolean.
5843
1abce4a6
L
58442009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5845
5846 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5847 (two_file_test_LDADD): Likewise.
5848 (common_test_1_LDADD): Likewise.
5849 (exception_test_LDADD) Likewise.
5850 (weak_test_LDADD): Likewise.
5851 (many_sections_test_LDADD): Likewise.
5852 (initpri1_LDADD): Likewise.
5853 (script_test_1_LDADD): Likewise.
5854 (script_test_2_LDADD): Likewise.
5855 (justsyms_LDADD): Likewise.
5856 (binary_test_LDADD): Likewise.
5857 (large_LDADD): Likewise.
5858 * testsuite/Makefile.in: Regenerated.
5859
adcf2816 58602009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5861
adcf2816
L
5862 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5863 (Symbol_table::override_with_special): Likewise.
5864 (Symbol_table::add_from_object): Likewise.
5865
28e67f5d
RÁE
58662009-12-04 Rafael Avila de Espindola <espindola@google.com>
5867
5868 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5869 Don't set the data_offset twice.
5870
ae10a101
RÁE
58712009-12-04 Rafael Avila de Espindola <espindola@google.com>
5872
5873 * testsuite/Makefile.in: Regenerate.
5874
f59f41f3
DK
58752009-12-03 Doug Kwan <dougkwan@google.com>
5876
5877 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5878 (Target_arm::do_finalize_sections): Add parameter for symbol table
5879 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5880 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5881 parameter for symbol table pointer.
5882 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5883 an additional parameter for a pointer to symbol table.
5884 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5885 parameter for a symbol table pointer.
5886 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5887 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5888 Ditto.
5889 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5890 parameter for a symbol table pointer.
5891
ca55d848
RÁE
58922009-12-03 Rafael Avila de Espindola <espindola@google.com>
5893
5894 * incremental.cc (Incremental_inputs_header)
5895 (Incremental_inputs_header_write, Incremental_inputs_entry)
5896 (Incremental_inputs_entry_write): Move ...
5897 * incremental.h (Incremental_inputs_header)
5898 (Incremental_inputs_header_write, Incremental_inputs_entry)
5899 (Incremental_inputs_entry_write): here.
5900
3aec4f9c
RÁE
59012009-12-02 Rafael Avila de Espindola <espindola@google.com>
5902
5903 * incremental.cc (make_sized_incremental_binary): Set the target.
5904 Error if it is incompatible.
5905 * output.h (Output_file): Add filename method.
5906
9c0ae74d
RÁE
59072009-12-02 Rafael Avila de Espindola <espindola@google.com>
5908
5909 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5910 from the get_* methods.
5911
a45500ae
RÁE
59122009-12-02 Rafael Avila de Espindola <espindola@google.com>
5913
5914 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5915 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5916 Write 0 for the data_offset of scripts.
5917
325e6408
RÁE
59182009-12-02 Rafael Avila de Espindola <espindola@google.com>
5919
5920 * testsuite/Makefile.am: Add the incremental_test.sh test.
5921 * testsuite/incremental_test.sh: New.
5922 * testsuite/incremental_test_1.c: New.
5923 * testsuite/incremental_test_2.c: New.
5924
954c3e2e
RÁE
59252009-12-01 Rafael Avila de Espindola <espindola@google.com>
5926
5927 * incremental-dump.cc (main): Fix typos.
5928
f8086623
RÁE
59292009-11-27 Rafael Avila de Espindola <espindola@google.com>
5930
5931 PR gold/11025
5932 * incremental-dump.cc (main): Use llu to print 64 bit values.
5933
3b0dd6ac
L
59342009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5935 H.J. Lu <hongjiu.lu@intel.com>
5936
5937 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5938 $(LIBDL).
5939 (incremental_dump_LDADD): Likewise.
5940 * Makefile.in: Regenerated.
5941
a6d1ef57 59422009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5943
a6d1ef57
DK
5944 Revert:
5945
5946 2009-11-25 Doug Kwan <dougkwan@google.com>
5947
5948 * arm.cc (Target_arm::Target_arm): Move method definition
5949 outside of class definition. Add code to handle
5950 --target1-rel, --target1-abs and --target2= options.
5951 (Target_arm::get_reloc_reloc_type): Change method to be
5952 non-static and const.
5953 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5954 New data member declaration.
5955 (Target_arm::Scan::local, Target_arm::Scan::global,
5956 Target_arm::Relocate::relocate,
5957 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5958 Adjust call to Target_arm::get_real_reloc_type.
5959 (Target_arm::get_real_reloc_type): Use command line options
5960 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5961 * options.h (--target1-rel, --target1-abs, --target2): New
5962 ARM-only options.
5963
50aeb7d4
DK
59642009-11-25 Doug Kwan <dougkwan@google.com>
5965
5966 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5967 class definition. Add code to handle --target1-rel, --target1-abs
5968 and --target2= options.
5969 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5970 and const.
5971 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5972 member declaration.
5973 (Target_arm::Scan::local, Target_arm::Scan::global,
5974 Target_arm::Relocate::relocate,
5975 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5976 call to Target_arm::get_real_reloc_type.
5977 (Target_arm::get_real_reloc_type): Use command line options to
5978 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5979 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5980 options.
5981
51938283
DK
59822009-11-25 Doug Kwan <dougkwan@google.com>
5983
5984 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5985 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5986 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5987 formatting.
5988 (Arm_relocate_functions::thm_call): Replace body with a call to
5989 Arm_relocate_functions::thumb_branch_common.
5990 (Arm_relocate_functions::thm_jump24,
5991 Arm_relocate_functions::thm_xpc22): New method definitions.
5992 (Arm_relocate_functions::thumb_branch_common): New method definition.
5993 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5994 operator.
5995 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5996 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5997
e2b8f3c4
RÁE
59982009-11-24 Rafael Avila de Espindola <espindola@google.com>
5999
6000 * Makefile.am: Build incremental-dump
6001 * Makefile.in: Regenerate.
6002 * incremental-dump.cc: New.
6003 * incremental.cc (Incremental_inputs_header_data,
6004 Incremental_inputs_entry_data): Move to incremental.h
6005 * incremental.h: (Incremental_inputs_header_data,
6006 Incremental_inputs_entry_data): Move from incremental.cc
6007
bcba9aec
RÁE
60082009-11-24 Rafael Avila de Espindola <espindola@google.com>
6009
6010 * incremental.cc (Incremental_inputs_header,
6011 Incremental_inputs_header_write, Incremental_inputs_entry,
6012 Incremental_inputs_entry_write): Add a typedef with the data type.
6013
7c3afe08
RÁE
60142009-11-24 Rafael Avila de Espindola <espindola@google.com>
6015
6016 * incremental.cc (Incremental_inputs_header,
6017 Incremental_inputs_header_write, Incremental_inputs_entry,
6018 Incremental_inputs_entry_write): Update comment about which
6019 type has the filed descriptions.
6020
d204b6e9
DK
60212009-11-15 Doug Kwan <dougkwan@google.com>
6022
6023 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6024 (Arm_relocate_functions::arm_branch_common): Change method defintion
6025 in class definition to a method declaration and update list of formal
6026 parameters.
6027 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6028 Arm_relocation_functions::jump24): Adjust call to
6029 Arm_relocate_functions::arm_branch_common. Update list of formal
6030 parameters.
6031 (Arm_relocate_functions::xpc25): New method definition.
6032 (Arm_relocate_functions::arm_branch_common): Move method defintion
6033 out from class definition. Use stubs for mode-switching and extending
6034 branch ranges.
6035 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6036 specially. Change code to enable use of stubs in ARM branches.
6037
43d12afe
DK
60382009-11-10 Doug Kwan <dougkwan@google.com>
6039
6040 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6041 in method declaration.
6042 (Target_arm::relocate_stub): New method declaration.
6043 (Target_arm::default_target): Change to return a pointer instead of
6044 a const reference.
6045 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6046 Target_arm::default_target.
6047 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6048 method definition.
6049 (Target_arm::relocate_section): Adjust view.
6050 (Target_arm::relocate_stub): New method definition.
6051
ac33a407
DK
60522009-11-10 Doug Kwan <dougkwan@google.com>
6053
6054 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6055 a format warning.
6056 * incremental.cc (open_incremental_binary): Initialized local
6057 variables to avoid warnings.
6058 * object.cc (make_elf_object): Ditto.
6059 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6060 a format warning.
e1df38aa 6061
88ee28e9
L
6062009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6063
6064 PR gold/10930
6065 * testsuite/plugin_test.c: Include "config.h".
6066
2daedcd6
DK
60672009-11-09 Doug Kwan <dougkwan@google.com>
6068
6069 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6070 (arm_symbol_value): Remove.
6071 (Arm_relocate_functions::arm_branch_common,
6072 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6073 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6074 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6075 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6076 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6077 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6078 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6079 Arm_relocate_functions::thm_mobw_abs_nc,
6080 Arm_relocate_functions::thm_mov_abs,
6081 Arm_relocate_functions::movw_prel_nc,
6082 Arm_relocate_functions::thm_movt_abs,
6083 Arm_relocate_functions::movt_prel,
6084 Arm_relocate_functions::thm_movw_prel_nc,
6085 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6086 (Target_arm::Relocate::relocate): Only decompose address into two
6087 parts if relocation type uses the thumb-bit and pass the actual
6088 bit instead of a flag indicating that the thumb-bit is used. Adjust
6089 calls to methods in Arm_relocate_functions for this change.
6090
1276bc89 60912009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6092
6093 PR 10925
6094 * reloc.cc: Instantiate
6095 Sized_relobj::initialize_input_to_output_maps and
6096 Sized_relobj:free_input_to_output_maps.
6097
e53ad1b5
ILT
60982009-11-06 Ian Lance Taylor <iant@google.com>
6099
6100 PR 10876
6101 * defstd.cc (in_segment): Set only_if_ref true for "end".
6102
eb44217c
DK
61032009-11-06 Doug Kwan <dougkwan@google.com>
6104
6105 * arm.cc (class Reloc_stub): Correct a comment.
6106 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6107 (Target_arm::scan_section_for_stubs): New method declaration.
6108 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6109 Change methods from private to protected.
6110 (Target_arm::do_may_relax): New method definition.
6111 (Target_arm::do_relax, Target_arm::group_sections,
6112 Target_arm::scan_reloc_for_stub,
6113 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6114 (Target_arm::arm_input_section_map_): New data member declaration.
6115 (Target_arm::scan_reloc_for_stub,
6116 Target_arm::scan_reloc_section_for_stubs,
6117 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6118 Target_arm::do_relax): New method definitions.
6119
5d329b7d
ILT
61202009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6121
6122 * configure.ac: Check for (struct stat)::st_mtim
6123 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6124 * config.in: Regenerate.
6125 * configure: Regenerate.
6126
96a0d71b
ILT
61272009-11-05 Ian Lance Taylor <iant@google.com>
6128
6129 PR 10910
6130 * output.cc (Output_segment::add_output_section): Add missing
6131 return statement.
6132
594c8e5e
ILT
61332009-11-04 Ian Lance Taylor <iant@google.com>
6134
6135 PR 10880
6136 * object.h (class Object): Add is_needed and set_is_needed
6137 methods. Add is_needed_ field. Make bool fields into bitfields.
6138 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6139 defined in a dynamic object and referenced by a regular object,
6140 set is_needed for the dynamic object.
6141 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6142 if the file is marked with as_needed and it is not needed.
6143
22b127cc
ILT
61442009-11-04 Ian Lance Taylor <iant@google.com>
6145
6146 PR 10887
6147 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6148 tags if data is discarded by linker script.
6149 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6150 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6151 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6152 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6153
f5c870d2
ILT
61542009-11-04 Ian Lance Taylor <iant@google.com>
6155
6156 * layout.cc (Layout::get_output_section): Add is_interp and
6157 is_dynamic_linker_section parameters. Change all callers.
6158 (Layout::choose_output_section): Likewise.
6159 (Layout::make_output_section): Likewise.
6160 (Layout::add_output_section_data): Add is_dynamic_linker_section
6161 parameter. Change all callers.
6162 * layout.h (class Layout): Update declarations.
6163 * output.h (class Output_section): Add is_interp, set_is_interp,
6164 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6165 Add is_interp_, is_dynamic_linker_section_ fields. Change
6166 generate_code_fills_at_write_ to a bitfield.
6167 * output.cc (Output_section::Output_sections): Initialize new
6168 fields.
6169 (Output_segment::add_output_section): Add do_sort parameter.
6170 Change all callers.
6171
1ae4d23b
ILT
61722009-11-03 Ian Lance Taylor <iant@google.com>
6173
6174 PR 10860
6175 * options.h (class General_options): Add --warn-common.
6176 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6177 merging two common symbols.
6178 (Symbol_table::should_override): Handle --warn-common when merging
6179 a common symbol with a defined symbol. Use report_resolve_problem
6180 for multiple definitions.
6181 (Symbol_table::report_resolve_problem): New function.
6182 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6183
55da9579
DK
61842009-11-03 Doug Kwan <dougkwan@google.com>
6185
6186 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6187 stub_factory_.
6188 (Target_arm::stub_factory): New method definition.
6189 (Target_arm::new_arm_input_section,
6190 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6191 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6192 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6193 New type definitions.
6194 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6195 member declarations.
6196 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6197 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6198 New method definitions.
6199
37a9ac43
ILT
62002009-11-03 Ian Lance Taylor <iant@google.com>
6201
6202 * options.h (class General_options): Add --warn_constructors.
6203
b3d6a3d4
ILT
62042009-11-03 Ian Lance Taylor <iant@google.com>
6205
6206 PR 10893
6207 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6208 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6209
934b01dd
ILT
62102009-11-03 Ian Lance Taylor <iant@google.com>
6211
6212 PR 10895
6213 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6214 --msgid-bugs-address.
6215 (install-pdf): New target.
6216 (install-data_yes): Look up one directory to find mkinstalldirs.
6217
03c1939b
L
62182009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6219
6220 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6221 tree.
6222
ebd95253
DK
62232009-10-30 Doug Kwan <dougkwan@google.com>
6224
6225 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6226
e9bbb538
DK
62272009-10-30 Doug Kwan <dougkwan@google.com>
6228
6229 * arm.cc (Stub_addend_reader): New struct template definition
6230 and partial specializations.
6231 (Stub_addend_reader::operator()): New method definition for a
6232 partially specialized template.
6233
d5b40221
DK
62342009-10-30 Doug Kwan <dougkwan@google.com>
6235
6236 * arm.cc (Arm_relobj::processor_specific_flags): New method
6237 definition.
6238 (Arm_relobj::do_read_symbols): New method declaration.
6239 (Arm_relobj::processor_specific_flags_): New data member declaration.
6240 (Arm_dynobj): New class definition.
6241 (Target_arm::do_finalize_sections): Add input_objects parameter.
6242 (Target_arm::do_adjust_elf_header): New method declaration.
6243 (Target_arm::are_eabi_versions_compatible,
6244 (Target_arm::merge_processor_specific_flags): New method declaration.
6245 (Target_arm::do_make_elf_object): New overloaded method definitions
6246 and declaration.
6247 (Arm_relobj::do_read_symbols): New method definition.
6248 (Arm_dynobj::do_read_symbols): Ditto.
6249 (Target_arm::do_finalize_sections): Add input_objects parameters.
6250 Merge processor-specific flags from all input objects.
6251 (Target_arm::are_eabi_versions_compatible,
6252 Target_arm::merge_processor_specific_flags,
6253 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6254 New method definitions.
6255 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6256 Input_objects pointer type parameter.
6257 * layout.cc (Layout::finalize): Pass input objects to target's.
6258 finalize_sections function.
6259 * output.cc (Output_file_header::do_sized_write): Set ELF file
6260 header's processor-specific flags.
6261 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6262 Input_objects pointer type parameter.
6263 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6264 * target.h (Input_objects): New forward class declaration.
6265 (Target::processor_specific_flags,
6266 Target::are_processor_specific_flags_sect): New method definitions.
6267 (Target::finalize_sections): Add input_objects parameter.
6268 (Target::Target): Initialize processor_specific_flags_ and
6269 are_processor_specific_flags_set_.
6270 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6271 parameter.
6272 (Target::set_processor_specific_flags): New method definition.
6273 (Target::processor_specific_flags_,
6274 Target::are_processor_specific_flags_set_): New data member
6275 declarations.
6276 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6277 Input_objects pointer type parameter.
6278
ebabffbd
DK
62792009-10-30 Doug Kwan <dougkwan@google.com>
6280
6281 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6282
ad0f2072
ILT
62832009-10-28 Ian Lance Taylor <iant@google.com>
6284
6285 * object.h (class Relobj): Drop options parameter from
6286 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6287 do_scan_relocs, do_relocate. Change all callers.
6288 (class Sized_relobj): Drop options parameters from
6289 do_gc_process_relocs, do_scan_relocs, do_relocate,
6290 do_relocate_sections, relocate_sections, emit_relocs_scan,
6291 emit_relocs_scan_reltype. Change all callers.
6292 (struct Relocate_info): Remove options field and all references to
6293 it.
6294 * reloc.h (class Read_relocs): Remove options constructor
6295 parameter and options_ field. Change all callers.
6296 (class Gc_process_relocs, class Scan_relocs): Likewise.
6297 (class Relocate_task): Likewise.
6298 * target-reloc.h (scan_relocs): Remove options parameter. Change
6299 all callers.
6300 (scan_relocatable_relocs): Likewise.
6301 * target.h (class Sized_target): Remove options parameter from
6302 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6303 all callers.
6304 * gc.h (gc_process_relocs): Remove options parameter. Change all
6305 callers.
6306 * arm.cc: Update functions to remove options parameters.
6307 * i386.cc: Likewise.
6308 * powerpc.cc: Likewise.
6309 * sparc.cc: Likewise.
6310 * x86_64.cc: Likewise.
6311 * testsuite/testfile.cc: Likewise.
6312
8ffa3667
DK
63132009-10-28 Doug Kwan <dougkwan@google.com>
6314
6315 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6316 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6317 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6318 New method definitions.
6319
40f36857
CC
63202009-10-28 Cary Coutant <ccoutant@google.com>
6321
6322 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6323 (Plugin::cleanup_done_): New member.
6324 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6325 (Plugin_manager::cleanup_done_): Remove.
6326 (Plugin_manager::add_input_file): Edit error message.
6327 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6328 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6329
2c849493
ILT
63302009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6331
6332 * fileread.cc: (File_read::View::~View): Use the new
6333 data_ownership_ filed.
6334 (File_read::~File_read): Dispose the new whole_file_view_.
6335 (File_read::open): Mmap the whole file if needed.
6336 (File_read::open): Use whole_file_view_ instead of contents_.
6337 (File_read::find_view): Use whole_file_view_ if applicable.
6338 (File_read::do_read): Use whole_file_view_ instead of contents_.
6339 (File_read::make_view): Use whole_file_view_ instead of contents_,
6340 update File_read::View::View call.
6341 (File_read::find_or_make_view): Update File_read::View::View
6342 call.
6343 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6344 remove contents_
6345 (File_read::View::Data_ownership): New enum.
6346 (File_read::View::View): Replace bool mapped_ with Data_ownership
6347 argument.
6348 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6349 (File_read::View::data_ownership_): New field.
6350 (File_read::contents_): Remove (replaced by whole_file_view_).
6351 (File_read::whole_file_view_): New field.
6352 * options.h (class General_options): Add --keep-files-mapped.
6353
24998053
CC
63542009-10-27 Cary Coutant <ccoutant@google.com>
6355
6356 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6357 * testsuite/Makefile.am (plugin_test_5): New test case.
6358 * testsuite/Makefile.in: Regenerate.
6359
72adc4fa
DK
63602009-10-25 Doug Kwan <dougkwan@google.com>
6361
6362 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6363 from private to protected to allow access by child class.
6364 (Sized_relobj::do_relocate_sections): New method declaration.
6365 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6366 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6367 Sized_relobj::relocate_sections. Instantiate template explicitly
6368 for different target sizes and endianity.
6369
07f508a2
DK
63702009-10-24 Doug Kwan <dougkwan@google.com>
6371
6372 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6373 (Arm_input_section::as_arm_input_section): New method.
6374 (Arm_output_section): New class definition.
6375 (Arm_output_section::create_stub_group,
6376 Arm_output_section::group_sections): New method definitions.
6377
10ad9fe5
DK
63782009-10-22 Doug Kwan <dougkwan@google.com>
6379
6380 * arm.cc (Arm_input_section): New class definition.
6381 (Arm_input_section::init, Arm_input_section:do_write,
6382 Arm_input_section::set_final_data_size,
6383 Arm_input_section::do_reset_address_and_file_offset): New method
6384 definitions.
6385
56ee5e00
DK
63862009-10-21 Doug Kwan <dougkwan@google.com>
6387
6388 * arm.cc (Stub_table, Arm_input_section): New forward class
6389 declarations.
6390 (Stub_table): New class defintion.
6391 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6392 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6393 New method definition.
6394
b569affa
DK
63952009-10-21 Doug Kwan <dougkwan@google.com>
6396
6397 * arm.cc: Update copyright comments.
6398 (Target_arm): New forward class template declaration.
6399 (Arm_address): New type.
6400 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6401 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6402 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6403 constants.
6404 (Insn_template): Same.
6405 (DEF_STUBS): New macro.
6406 (Stub_type): New enum type.
6407 (Stub_template): New class definition.
6408 (Stub): Same.
6409 (Reloc_stub): Same.
6410 (Stub_factory): Same.
6411 (Target_arm::Target_arm): Initialize may_use_blx_ and
6412 should_force_pic_veneer_.
6413 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6414 Target_arm::should_force_pic_veneer,
6415 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6416 Target_arm::using_thumb_only, Target_arm:;default_target): New
6417 method defintions.
6418 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6419 New data member declarations.
6420 (Insn_template::size, Insn_template::alignment): New method defintions.
6421 (Stub_template::Stub_template): New method definition.
6422 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6423 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6424 (Stub_factory::Stub_factory): New method definition.
6425 * gold.h (string_hash): New template.
6426 * output.h (Input_section_specifier::hash_value): Use
6427 gold::string_hash.
6428 (Input_section_specifier::string_hash): Remove.
6429 * stringpool.cc (Stringpool_template::string_hash): Use
6430 gold::string_hash.
6431
6c172549
DK
64322009-10-20 Doug Kwan <dougkwan@google.com>
6433
6434 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6435 symbols of relaxed input sections.
6436 * output.h (Output_section::find_relaxed_input_section): Make
6437 method public.
6438
c5617f2f
DK
64392009-10-16 Doug Kwan <dougkwan@google.com>
6440
6441 * dynobj.cc (Versions::Versions): Initialize version_script_.
6442 Only insert base version symbol definition for a shared object
6443 if version script defines any version versions.
6444 (Versions::define_base_version): New method definition.
6445 (Versions::add_def): Check that base version is not needed.
6446 (Versions::add_need): Define base version lazily.
6447 * dynobj.h (Versions::define_base_version): New method declaration.
6448 (Versions::needs_base_version_): New data member declaration.
6449 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6450 (check_DATA): Add no_version_test.stdout.
6451 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6452 New make rules.
6453 * testsuite/Makefile.in: Regenerate.
6454 * testsuite/no_version_test.c: New file.
6455 * testsuite/no_version_test.sh: Ditto.
6456
3c12dcdb
DK
64572009-10-16 Doug Kwan <dougkwan@google.com>
6458
6459 * expression.cc (class Segment_start_expression): New class definition.
6460 (Segment_start_expression::value): New method definition.
6461 (script_exp_function_segment_start): Return a new
6462 Segment_start_expression.
6463 * gold/script-c.h (script_saw_segment_start_expression): New function
6464 prototype.
6465 * script-sections.cc (Script_sections::Script_sections): Initialize
6466 SAW_SEGMENT_START_EXPRESSION_ to false.
6467 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6468 and -Tbbs options to specify section addresses if given in
6469 command line and no SEGMENT_START expression is seen in a script.
6470 * script-sections.h (Script_sections::saw_segment_start_expression,
6471 Script_sections::set_saw_segment_start_expression): New method
6472 definition.
6473 (Script_sections::saw_segment_start_expression_): New data member
6474 declaration.
6475 * script.cc (script_saw_segment_start_expression): New function.
6476 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6477 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6478 script_test_7.sh and script_test_8.sh.
6479 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6480 script_test_8.stdout.
6481 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6482 (script_test_6, script_test_6.stdout, script_test_7,
6483 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6484 * Makefile.in: Regenerate.
6485 * testsuite/script_test_6.sh: New file.
6486 * testsuite/script_test_6.t: Same.
6487 * testsuite/script_test_7.sh: Same.
6488 * testsuite/script_test_7.t: Same.
6489 * testsuite/script_test_8.sh: Same.
6490
64b1ae37
DK
64912009-10-16 Doug Kwan <dougkwan@google.com>
6492
6493 * output.cc (Output_segment::set_section_list_address): Cast
6494 expressions to unsigned long long type to avoid format warnings.
6495
661be1e2
ILT
64962009-10-15 Ian Lance Taylor <iant@google.com>
6497
12edd763 6498 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6499 dot assignment to script_sections_.
12edd763
ILT
6500 * script-sections.cc (Script_sections::add_dot_assignment):
6501 Initialize if necessary.
6502
68b6574b
ILT
6503 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6504 program headers with no load segment if there is a linker script.
6505
661be1e2
ILT
6506 * layout.cc (Layout::set_segment_offsets): Align the file offset
6507 to the segment aligment for -N or -n with no load segment.
6508 * output.cc (Output_segment::add_output_section): Don't crash if
6509 the first section is a TLS section.
6510 (Output_segment::set_section_list_addresses): Print an error
6511 message if the address moves backward in a linker script.
6512 * script-sections.cc
6513 (Output_section_element_input::set_section_addresses): Don't
6514 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6515 (Orphan_output_section::set_section_addresses): Likewise.
6516
f15f61a7
DK
65172009-10-15 Doug Kwan <dougkwan@google.com>
6518
6519 * layout.cc (Layout::finish_dynamic_section): Generate tags
6520 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6521 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6522 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6523
82bb573a
ILT
65242009-10-14 Ian Lance Taylor <iant@google.com>
6525
6526 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6527 fields.
6528 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6529 data_shdr fields of relinfo.
6530 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6531 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6532 R_386_TLS_LDO_32, adjust based on section flags.
6533 (Target_i386::Relocate::fix_up_ldo): Remove.
6534
374ad285
ILT
65352009-10-13 Ian Lance Taylor <iant@google.com>
6536
6537 Add support for -pie.
6538 * options.h (class General_options): Add -pie and
6539 --pic-executable.
6540 (General_options::output_is_position_independent): Test -pie.
6541 (General_options::output_is_executable): Return true if not shared
6542 and not relocatable.
6543 (General_options::output_is_pie): Remove.
6544 * options.cc (General_options::finalize): Reject incompatible uses
6545 of -pie.
6546 * gold.cc (queue_middle_tasks): A -pie link is not static.
6547 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6548 * symtab.cc (Symbol::final_value_is_known): Return false if
6549 output_is_position_independent.
6550 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6551 output_is_position_independent.
6552 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6553 output_is_position_independent.
6554 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6555 output_is_position_independent.
6556 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6557 two_file_pie_test.
6558 (basic_pie_test.o, basic_pie_test): New targets.
6559 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6560 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6561 (two_file_pie_test): New target.
6562 * testsuite/Makefile.in: Rebuild.
6563 * README: Remove note saying that -pie is not supported.
6564
c6585162
ILT
65652009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6566
6567 * options.h (class General_options): Add -init and -fini.
6568 * layout.cc (Layout::finish_dynamic_section): Emit
6569 given init and fini functions.
6570
032ce4e9
ST
65712009-10-13 Sriraman Tallam <tmsriram@google.com>
6572
6573 * gc.h (gc_process_relocs): Check if icf is enabled using new
6574 function.
6575 * gold.cc (queue_initial_tasks): Likewise.
6576 (queue_middle_tasks): Likewise.
6577 * object.cc (do_layout): Likewise.
6578 * symtab.cc (is_section_folded): Likewise.
6579 * main.cc (main): Likewise.
6580 * reloc.cc (Read_relocs::run): Likewise.
6581 (Sized_relobj::do_scan_relocs): Likewise.
6582 * icf.cc (is_function_ctor_or_dtor): New function.
6583 (Icf::find_identical_sections): Check if function is ctor or dtor when
6584 safe icf is chosen.
6585 * options.h (General_options::icf): Change option to be an enum.
6586 (Icf_status): New enum.
6587 (icf_enabled): New method.
6588 (icf_safe_folding): New method.
6589 (set_icf_status): New method.
6590 (icf_status_): New variable.
6591 * (options.cc) (General_options::finalize): Set icf_status_.
6592 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6593 icf_test and icf_keep_unique_test to use the --icf enum flag.
6594 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6595 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6596
f345227a
ST
65972009-10-12 Sriraman Tallam <tmsriram@google.com>
6598
6599 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6600 includes to gc.h and icf.h.
6601 * arm.cc: Include gc.h.
6602 * gold.cc: Likewise.
6603 * i386.cc: Likewise.
6604 * powerpc.cc: Likewise.
6605 * sparc.cc: Likewise.
6606 * x86_64.cc: Likewise.
6607 * gc.h: Include icf.h.
6608
1c7814ed
ILT
66092009-10-11 Ian Lance Taylor <iant@google.com>
6610
6611 * plugin.cc: Include "gold.h" before other header files.
6612
ae3b5189
CD
66132009-10-10 Chris Demetriou <cgd@google.com>
6614
6615 * options.h (Input_file_argument::Input_file_type): New enum.
6616 (Input_file_argument::is_lib_): Replace with...
6617 (Input_file_argument::type_): New member.
6618 (Input_file_argument::Input_file_argument): Take Input_file_type
6619 'type' rather than boolean 'is_lib' as second argument.
6620 (Input_file_argument::is_lib): Use type_.
6621 (Input_file_argument::is_searched_file): New function.
6622 (Input_file_argument::may_need_search): Handle is_searched_file.
6623 * options.cc (General_options::parse_library): Support -l:filename.
6624 (General_options::parse_just_symbols): Update for Input_file_argument
6625 changes.
6626 (Command_line::process): Likewise.
6627 * archive.cc (Archive::get_file_and_offset): Likewise.
6628 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6629 * script.cc (read_script_file, script_add_file): Likewise.
6630 * fileread.cc (Input_file::Input_file): Likewise.
6631 (Input_file::will_search_for): Handle is_searched_file.
6632 (Input_file::open): Likewise.
6633 * readsyms.cc (Read_symbols::get_name): Likewise.
6634 * testsuite/Makefile.am (searched_file_test): New test.
6635 * testsuite/Makefile.in: Regenerate.
6636 * testsuite/searched_file_test.cc: New file.
6637 * testsuite/searched_file_test_lib.cc: New file.
6638
f3048a1d
ILT
66392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6640 Ian Lance Taylor <iant@google.com>
6641
6642 * descriptor.cc: Include <cstdio> and "binary-io.h".
6643 (Descriptors::open): Open the files in binary mode always.
6644 * script.cc (Lex::get_token): Treat \r as whitespace.
6645
d4780e57
ILT
66462009-10-09 Ian Lance Taylor <iant@google.com>
6647
6648 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6649
d9a893b8
ILT
66502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6651 Ian Lance Taylor <iant@google.com>
6652
6653 * configure.ac: Check for readv function also.
6654 * fileread.cc (readv): Define if not HAVE_READV.
6655 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6656 does not exist.
6657 * config.in: Regenerate.
6658 * configure: Regenerate.
6659
c0a62865
DK
66602009-10-09 Doug Kwan <dougkwan@google.com>
6661
6662 * layout.cc (Layout::make_output_section): Call target hook to make
6663 ordinary output section.
6664 (Layout::finalize): Adjust parameter list of call the
6665 Target::may_relax().
6666 * layout.h (class Layout::section_list): New method.
6667 * merge.h (Output_merge_base::entsize): Change visibility to public.
6668 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6669 New methods.
6670 (Output_merge_string::do_is_string): New method.
6671 * object.cc (Sized_relobj::do_setup): renamed from
6672 Sized_relobj::set_up.
6673 * object.h (Sized_relobj::adjust_shndx,
6674 Sized_relobj::initializ_input_to_output_maps,
6675 Sized_relobj::free_input_to_output_maps): Change visibilities to
6676 protected.
6677 (Sized_relobj::setup): Virtualize.
6678 (Sized_relobj::do_setup): New method declaration.
6679 (Sized_relobj::invalidate_section_offset,
6680 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6681 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6682 * options.cc (parse_int): New function.
6683 * options.h (parse_int): New declaration.
6684 (DEFINE_int): New macro.
6685 (stub_group_size): New option.
6686 * output.cc (Output_section::Output_section): Initialize memebers
6687 merge_section_map_, merge_section_by_properties_map_,
6688 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6689 (Output_section::add_input_section): Handled deferred code-fill
6690 generation and remove an old comment.
6691 (Output_section::add_relaxed_input_section): New method definition.
6692 (Output_section::add_merge_input_section): Use merge section by
6693 properties map to speed to search. Update merge section maps
6694 as appropriate.
6695 (Output_section::build_relaxation_map): New method definition.
6696 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6697 Same.
6698 (Output_section::relax_input_section): Renamed to
6699 Output_section::convert_input_sections_to_relaxed_sections and change
6700 interface to take a vector of pointers to relaxed sections.
6701 (Output_section::find_merge_section,
6702 Output_section::find_relaxed_input_section): New method definitions.
6703 (Output_section::is_input_address_mapped,
6704 Output_section::output_offset, Output_section::output_address):
6705 Use output section data maps to speed up searching.
6706 (Output_section::find_starting_output_address): Add comments.
6707 (Output_section::do_write,
6708 Output_section::write_to_postprocessing_buffer): Do code-fill
6709 generation as appropriate.
6710 (Output_section::get_input_sections): Invalidate relaxed input section
6711 map.
6712 (Output_section::restore_states): Adjust type of checkpoint .
6713 Invalidate relaxed input section map.
6714 * output.h (Output_merge_base): New class declaration.
6715 (Input_section_specifier): New class defintion.
6716 (class Output_relaxed_input_section) Change base class to
6717 Output_section_data_build.
6718 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6719 base class initializer.
6720 (Output_section::add_relaxed_input_section): New method declaration.
6721 (Output_section::Input_section): Change visibility to protected.
6722 (Output_section::Input_section::relobj,
6723 Output_section::Input_section::shndx): Handle relaxed input sections.
6724 Output_section::input_sections) Change visibility to protected. Also
6725 define overload to return a non-const pointer.
6726 (Output_section::Merge_section_properties): New class defintion.
6727 (Output_section::Merge_section_by_properties_map,
6728 Output_section::Output_section_data_by_input_section_map,
6729 Output_section::Relaxation_map): New types.
6730 (Output_section::relax_input_section): Rename method to
6731 Output_section::convert_input_sections_to_relaxed_sections and change
6732 interface to take a vector of relaxed section pointers.
6733 (Output_section::find_merge_section,
6734 Output_section::find_relaxed_input_section,
6735 Output_section::build_relaxation_map,
6736 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6737 New method declarations.
6738 (Output_section::merge_section_map_
6739 Output_section::merge_section_by_properties_map_,
6740 Output_section::relaxed_input_section_map_,
6741 Output_section::is_relaxed_input_section_map_valid_,
6742 Output_section::generate_code_fills_at_write_): New data members.
6743 * script-sections.cc
6744 (Output_section_element_input::set_section_addresses): Call
6745 current_data_size and addralign methods of relaxed input sections.
6746 (Orphan_output_section::set_section_addresses): Call current_data_size
6747 and addralign methods of relaxed input sections.
6748 * symtab.cc (Symbol_table::compute_final_value): Extract template
6749 from the body of Symbol_table::sized_finalize_symbol.
6750 (Symbol_table::sized_finalized_symbol): Call
6751 Symbol_table::compute_final_value.
6752 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6753 (Symbol_table::compute_final_value): New templated method declaration.
6754 * target.cc (Target::do_make_output_section): New method defintion.
6755 * target.h (Target::make_output_section): New method declaration.
6756 (Target::relax): Add more parameters for input objects, symbol table
6757 and layout. Adjust call to do_relax.
6758 (Target::do_make_output_section): New method declaration.
6759 (Target::do_relax): Add parameters for input objects, symbol table
6760 and layout.
6761
d446d6c4
ILT
67622009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6763
6764 * pread.c: Include stdio.h.
6765
bc06c745
ILT
67662009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6767
6768 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6769 defined.
6770
75aea3d0
ILT
67712009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6772
6773 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6774 Change read_shndx type to unsigned int.
6775 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6776 int.
6777 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6778 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6779 Change read_shndx type to unsigned int.
6780 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6781 int.
6782 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6783 * layout.cc (Layout::create_symtab_sections): Cast the result of
6784 local_symcount * symsize to off_t in the gold_assert.
6785
be8fcb75
ILT
67862009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6787
6788 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6789 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6790 R_ARM_BASE_ABS.
6791 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6792 (Arm_relocate_functions::thm_abs5): New function.
6793 (Arm_relocate_functions::abs12): New function.
6794 (Arm_relocate_functions::abs16): New function.
6795 (Arm_relocate_functions::base_abs): New function.
6796 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6797 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6798 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6799 R_ARM_BASE_ABS.
6800 (Scan::global): Likewise.
6801 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6802 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6803 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6804 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6805 R_ARM_BASE_ABS.
6806
c2a122b6
ILT
68072009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6808
6809 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6810 (Arm_relocate_functions::movt_prel): New function.
6811 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6812 (Arm_relocate_functions::thm_movt_prel): New function.
6813 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6814 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6815 (Scan::global, Relocate::relocate): Likewise.
6816 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6817
c4aa1e2d
ILT
68182009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6819
6820 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6821 Incremental_checker.
6822 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6823 unsigned int.
6824 (class Incremental_inputs_header): New class.
6825 (Incremental_inputs_header_writer): Edit comment.
6826 (Incremental_inputs_entry): New class.
6827 (Incremental_inputs_entry_writer): Edit comment.
6828 (Sized_incremental_binary::do_find_incremental_inputs_section):
6829 Add *strtab_shndx parameter, fill it.
6830 (Sized_incremental_binary::do_check_inputs): New method.
6831 (Incremental_checker::can_incrementally_link_output_file): Use
6832 Sized_incremental_binary::check_inputs.
6833 (Incremental_inputs::report_command_line): Save command line in
6834 command_line_.
6835 * incremental.h:
6836 (Incremental_binary::find_incremental_inputs_section): New
6837 method.
6838 (Incremental_binary::do_find_incremental_inputs_section): Add
6839 strtab_shndx parameter.
6840 (Incremental_binary::do_check_inputs): New pure virtual method.
6841 (Sized_incremental_binary::do_check_inputs): Declare.
6842 (Incremental_checker::Incremental_checker): Add incremental_inputs
6843 parameter, use it to initialize incremental_inputs_.
6844 (Incremental_checker::incremental_inputs_): New field.
6845 (Incremental_checker::command_line): New method.
6846 (Incremental_checker::inputs): New method.
6847 (Incremental_checker::command_line_): New field.
6848
c549a694
ILT
68492009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6850
6851 * incremental.cc: Include <cstdarg> and "target-select.h".
6852 (vexplain_no_incremental): New function.
6853 (explain_no_incremental): New function.
6854 (Incremental_binary::error): New method.
6855 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6856 method.
6857 (make_sized_incremental_binary): New function.
6858 (open_incremental_binary): New function.
6859 (can_incrementally_link_file): Add checks if output is ELF and has
6860 inputs section.
6861 * incremental.h: Include "elfcpp_file.h" and "output.h".
6862 (Incremental_binary): New class.
6863 (Sized_incremental_binary): New class.
6864 (open_incremental_binary): Declare.
6865 * object.cc (is_elf_object): Use
6866 elfcpp::Elf_recognizer::is_elf_file.
6867 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6868 * output.h (Output_file::filesize): New method.
6869
fd3c5f0b
ILT
68702009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6871
6872 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6873 New function.
6874 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6875 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6876 function.
6877 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6878 function.
6879 (Arm_relocate_functions::movw_abs_nc): New function.
6880 (Arm_relocate_functions::movt_abs): New function.
6881 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6882 (Arm_relocate_functions::thm_movt_abs): New function.
6883 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6884 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6885 (Scan::global): Likewise.
6886 (Relocate::relocate): Likewise.
6887 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6888
7f5309a5
ILT
68892009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6890
6891 * arm.cc (Arm_relocate_functions::got_prel) New function.
6892 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6893 (Relocate::relocate): Likewise.
6894 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6895
364c7fa5
ILT
68962009-10-06 Ian Lance Taylor <iant@google.com>
6897
6898 * options.h (class General_options): Define
6899 split_stack_adjust_size parameter.
6900 * object.h (class Object): Add uses_split_stack_ and
6901 has_no_split_stack_ fields. Add uses_split_stack and
6902 has_no_split_stack accessor functions. Declare
6903 handle_split_stack_section.
6904 (class Reloc_symbol_changes): Define.
6905 (class Sized_relobj): Define Function_offsets. Declare
6906 split_stack_adjust, split_stack_adjust_reltype, and
6907 find_functions.
6908 * object.cc (Object::handle_split_stack_section): New function.
6909 (Sized_relobj::do_layout): Call handle_split_stack_section.
6910 * dynobj.cc (Sized_dynobj::do_layout): Call
6911 handle_split_stack_section.
6912 * reloc.cc (Sized_relobj::relocate_sections): Call
6913 split_stack_adjust for executable sections in split_stack
6914 objects. Pass reloc_map to relocate_section.
6915 (Sized_relobj::split_stack_adjust): New function.
6916 (Sized_relobj::split_stack_adjust_reltype): New function.
6917 (Sized_relobj::find_functions): New function.
6918 * target-reloc.h: Include "object.h".
6919 (relocate_section): Add reloc_symbol_changes parameter. Change
6920 all callers.
6921 * target.h (class Target): Add calls_non_split method. Declare
6922 do_calls_non_split virtual method. Declare match_view and
6923 set_view_to_nop.
6924 * target.cc: Include "elfcpp.h".
6925 (Target::do_calls_non_split): New function.
6926 (Target::match_view): New function.
6927 (Target::set_view_to_nop): New function.
6928 * gold.cc (queue_middle_tasks): Give an error if mixing
6929 split-stack and non-split-stack objects with -r.
6930 * i386.cc (Target_i386::relocate_section): Add
6931 reloc_symbol_changes parameter.
6932 (Target_i386::do_calls_non_split): New function.
6933 * x86_64.cc (Target_x86_64::relocate_section): Add
6934 reloc_symbol_changes parameter.
6935 (Target_x86_64::do_calls_non_split): New function.
6936 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6937 parameter.
6938 * powerpc.cc (Target_powerpc::relocate_section): Add
6939 reloc_symbol_changes parameter.
6940 * sparc.cc (Target_sparc::relocate_section): Add
6941 reloc_symbol_changes parameter.
6942 * configure.ac: Call AM_CONDITIONAL for the default target.
6943 * configure: Rebuild.
6944 * testsuite/Makefile.am (TEST_AS): New variable.
6945 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6946 (check_DATA): Add split_i386 and split_x86_64 files.
6947 (SPLIT_DEFSYMS): Define.
6948 (split_i386_[1234n].o): New targets.
6949 (split_i386_[124]): New targets.
6950 (split_i386_[1234r].stdout): New targets.
6951 (split_x86_64_[1234n].o): New targets.
6952 (split_x86_64_[124]): New targets.
6953 (split_x86_64_[1234r].stdout): New targets.
6954 (MOSTLYCLEANFILES): Add new executables.
6955 * testsuite/split_i386.sh: New file.
6956 * testsuite/split_x86_64.sh: New file.
6957 * testsuite/split_i386_1.s: New file.
6958 * testsuite/split_i386_2.s: New file.
6959 * testsuite/split_i386_3.s: New file.
6960 * testsuite/split_i386_4.s: New file.
6961 * testsuite/split_i386_n.s: New file.
6962 * testsuite/split_x86_64_1.s: New file.
6963 * testsuite/split_x86_64_2.s: New file.
6964 * testsuite/split_x86_64_3.s: New file.
6965 * testsuite/split_x86_64_4.s: New file.
6966 * testsuite/split_x86_64_n.s: New file.
6967 * testsuite/testfile.cc (Target_test): Update relocation_section
6968 function.
6969 * testsuite/Makefile.in: Rebuild.
6970
e8a9fcda
ILT
69712009-10-06 Ian Lance Taylor <iant@google.com>
6972
6973 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6974 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6975 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6976 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6977 the address on ldo_addrs_.
6978 (Target_i386::Relocate::fix_up_ldo): New function.
6979
e99daf92
ILT
69802009-10-06 Rafael Espindola <espindola@google.com>
6981
6982 * plugin.cc (add_input_library): New.
6983 (Plugin::load): Add add_input_library to tv.
6984 (Plugin_manager::add_input_file): Add the is_lib argument.
6985 (add_input_file): Update call to Plugin_manager::add_input_file.
6986 (add_input_library): New.
6987 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6988
966d4097
DK
69892009-09-30 Doug Kwan <dougkwan@google.com>
6990
6991 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6992 symbol and call Symbol::may_need_copy_reloc to determine if
6993 a copy reloc is needed.
6994 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6995 nocopyreloc is given in command line.
6996 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6997 given in command line.
6998 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6999 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7000 of the removed Target_i386::may_need_copy_reloc.
7001 * options.h (copyreloc): New option with default value false.
7002 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7003 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7004 instead of the removed Target_powerpc::may_need_copy_reloc.
7005 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7006 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7007 instead of the removed Target_sparc::may_need_copy_reloc.
7008 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7009 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7010 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7011 instead of the removed Target_x86_64::may_need_copy_reloc.
7012
029ba973
ILT
70132009-09-30 Ian Lance Taylor <iant@google.com>
7014
7015 * object.h (class Object): Remove target_ field, and target,
7016 sized_target, and set_target methods.
7017 (Object::sized_target): Remove.
7018 (class Sized_relobj): Update declarations. Remove sized_target.
7019 * object.cc (Sized_relobj::setup): Remove target parameter.
7020 Change all callers.
7021 (Input_objects::add_object): Don't do anything with the target.
7022 (make_elf_sized_object): Add punconfigured parameter. Change all
7023 callers. Set or test parameter target.
7024 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7025 Change all callers.
7026 * parameters.cc (Parameters::set_target): Change parameter type to
7027 be non-const.
7028 (Parameters::default_target): Remove.
7029 (set_parameters_target): Change parameter type to be non-const.
7030 (parameters_force_valid_target): New function.
7031 (parameters_clear_target): New function.
7032 * parameters.h (class Parameters): Update declarations. Remove
7033 default_target method. Add sized_target and clear_target
7034 methods. Change target_ to be non-const.
7035 (set_parameters_target): Update declaration.
7036 (parameters_force_valid_target): Declare.
7037 (parameters_clear_target): Declare.
7038 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7039 as NULL if we aren't searching.
7040 (Add_symbols::run): Don't check for compatible target.
7041 * fileread.cc (Input_file::open_binary): Call
7042 parameters_force_valid_target.
7043 * gold.cc (queue_middle_tasks): Likewise.
7044 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7045 set_target on object.
7046 * dynobj.h (class Sized_dynobj): Update declarations.
7047 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7048 make_elf_object returns NULL.
7049 (Archive::include_member): Don't check whether object target is
7050 compatible.
7051 * output.cc (Output_section::add_input_section): Get target from
7052 parameters.
7053 (Output_section::relax_input_section): Likewise.
7054 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7055 parameters.
7056 (Sized_relobj::do_scan_relocs): Likewise.
7057 (Sized_relobj::relocate_sections): Likewise.
7058 * resolve.cc (Symbol_table::resolve): Likewise.
7059 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7060 parameter. Change all callers.
7061 (Symbol_table::add_from_object): Get target from parameters.
7062 (Symbol_table::add_from_relobj): Don't check object target.
7063 (Symbol_table::add_from_dynobj): Likewise.
7064 (Symbol_table::define_special_symbol): Get target from
7065 parameters.
7066 * symtab.h (class Symbol_table): Update declaration.
7067 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7068 parameter. Change all callers. Clear parameter target.
7069 (Binary_test): Test target here.
7070 * testsuite/object_unittest.cc (gold_testsuite): Remove
7071 target_test_pointer parameter. Change all callers.
7072 (Object_test): Test target here.
7073
a6a22b83
ILT
70742009-09-26 Ian Lance Taylor <iant@google.com>
7075
7076 * testsuite/initpri1.c: Don't try to use constructor priorities if
7077 compiling with gcc before 4.3.
7078
6a8f49fe
ILT
70792009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7080
7081 * testsuite/retain_symbols_file_test.sh (check_present): Change
7082 output file name to retain_symbols_file_test.stdout.
7083 (check_absent): Likewise.
7084
8c604651
CS
70852009-09-18 Craig Silverstein <csilvers@google.com>
7086
7087 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7088 * options.cc: Include <cerrno> and <fstream>.
7089 (General_options::finalize): Parse -retain-symbols-file tag.
7090 * options.h: New flag.
7091 (General_options): New method should_retain_symbol, new
7092 variable symbols_to_retain.
7093 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7094 should_retain_symbol map.
7095 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7096 * testsuite/Makefile.in: Regenerate.
7097 * testsuite/retain_symbols_file_test.sh: New file.
7098
ca58b19f
NC
70992009-09-18 Nick Clifton <nickc@redhat.com>
7100
7101 * po/es.po: Updated Spanish translation.
7102
20e6d0d6
DK
71032009-09-17 Doug Kwan <dougkwan@google.com>
7104
7105 * debug.h (DEBUG_RELAXATION): New constant.
7106 (DEBUG_ALL): Add DEBUG_RELAXATION.
7107 (debug_string_to_enum): Add relaxation debug option.
7108 * layout.cc
7109 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7110 Layout::Relaxation_debug_check::read_sections,
7111 Layout::Relaxation_debug_check::read_sections): New method definitions.
7112 (Layout::Layout): Initialize data members
7113 record_output_section_data_from_scrips_,
7114 script_output_section_data_list_ and relaxation_debug_check_.
7115 (Layout::save_segments, Layout::restore_segments,
7116 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7117 Layout::relaxation_loop_body): New method definitions.
7118 (Layout::finalize): Support relaxation. Move section layout code to
7119 Layout::relaxation_loop_body.
7120 (Layout::set_asection_address_from_script): Move code for orphan
7121 section placement out.
7122 (Layout::place_orphan_sections_in_script): New method definition.
7123 * layout.h (Output_segment_headers, Output_file_header):
7124 New forward class declarations.
7125 (Layout::~Layout): Define.
7126 (Layout::new_output_section_data_from_script): New method definition.
7127 (Layout::place_orphan_sections_in_script): New method declaration.
7128 (Layout::Segment_states): New type declaration.
7129 (Layout::save_segments, Layout::restore_segments,
7130 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7131 Layout::relaxation_loop_body): New method declarations.
7132 (Layout::Output_section_data_list): New type declaration.
7133 (Layout::Relaxation_debug_check): New class definition.
7134 (Layout::record_output_section_data_from_script_,
7135 Layout::script_output_section_data_list_, Layout::segment_states_,
7136 Layout::relaxation_debug_check_): New data members.
7137 * output.cc: (Output_section_headers::do_size): New method definition.
7138 (Output_section_headers::Output_section_headers): Move size
7139 computation to Output_section_headers::do_size.
7140 (Output_segment_headers::do_size): New method definition.
e1df38aa 7141 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7142 Output_file_header::do_size and call it.
7143 (Output_file_header::do_size): New method definition.
7144 (Output_data_group::Output_data_group): Adjust call to
7145 Output_section_data.
7146 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7147 (Output_symtab_xindex::do_write): Add array bound check.
7148 (Output_section::Input_section::print_to_mapfile): Handle
7149 RELAXED_INPUT_SECTION_CODE.
7150 (Output_section::Output_section): Initialize data member checkpoint_.
7151 (Output_section::~Output_section): Delete checkpoint object pointed
7152 by checkpoint_.
7153 (Output_section::add_input_section): Always add an Input_section if
7154 relaxing.
7155 (Output_section::add_merge_input_section): Add assert.
7156 (Output_section::relax_input_section): New method definition.
7157 (Output_section::set_final_data_size): Set load address to zero for
7158 an unallocated section.
7159 (Output_section::do_address_and_file_offset_have_reset_values):
7160 New method definition.
7161 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7162 Handle relaxed input section.
7163 (Output_section::sort_attached_input_sections): Checkpoint input
7164 section list lazily.
7165 (Output_section::get_input_sections): Change type of input_sections to
7166 list of Simple_input_section pointers. Checkpoint input section list
7167 lazily. Also handle relaxed input sections.
7168 (Output_section::add_input_section_for_script): Take a reference to
7169 a Simple_input_section object instead of Relobj pointer and section
7170 index as parameter. Handle relaxed input sections.
7171 (Output_section::save_states, Output_section::restore_states): New
7172 method definitions.
7173 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7174 (Output_data::is_data_size_fixed): New method definition.
7175 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7176 if it is fixed.
7177 (Output_data::address_and_file_offset_have_reset_values): New method
7178 definition.
7179 (Output_data::do_address_and_file_offset_have_reset_values): New method
7180 definition.
7181 (Output_data::set_data_size): Check that data size is not fixed.
7182 (Output_data::fix_data_size): New method definition.
7183 (Output_data::is_data_size_fixed_): New data member.
7184 (Output_section_headers::set_final_data_size): New method definition.
7185 (Output_section_headers::do_size): New method declaration.
7186 (Output_segment_headers::set_final_data_size): New method definition.
7187 (Output_segment_headers::do_size): New method declaration.
7188 (Output_file_header::set_final_data_size)::New method definition.
7189 (Output_file_header::do_size)::New method declaration.
7190 (Output_section_data::Output_section_data): Add new parameter
7191 is_data_size_fixed and use it to fix data size.
7192 (Output_data_const::Output_data_const): Adjust call to base class
7193 constructor and fix data size.
7194 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7195 base class constructor and fix data size.
7196 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7197 base class constructor and fix data size.
7198 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7199 class constructor and fix data size.
7200 (Output_data_group::set_final_data_size): New method definition.
7201 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7202 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7203 class constructor and fix data size.
7204 (Output_relaxed_input_section): New class definition.
7205 (Output_section::Simple_input_section): New class definition.
7206 (Output_section::get_input_sections): Adjust parameter list.
7207 (Output_section::add_input_section_for_script): Same.
7208 (Output_section::save_states, Output_section::restore_states,
7209 Output_section::do_address_and_file_offset_have_reset_values,
7210 (Output_section::Input_section::Input_section): Handle
7211 RELAXED_INPUT_SECTION_CODE. Add new overload for
7212 Output_relaxed_input_section.
7213 (Output_section::Input_section::is_input_section,
7214 Output_section::Input_section::set_output_section): Handle relaxed
7215 input section.
7216 (Output_section::Input_section::is_relaxed_input_section,
7217 Output_section::Input_section::output_section_data,
7218 Output_section::Input_section::relaxed_input_section): New method
7219 definitions.
7220 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7221 value.
7222 (Output_section::Input_section::u1_): Update comments.
7223 (Output_section::Input_section::u2_): Add new union member poris.
7224 (Output_section::Checkpoint_output_section): New classs definition.
7225 (Output_section::relax_input_section): New method declaration.
7226 (Output_section::checkpoint_): New data member.
7227 (Output_segment): Update comments.
7228 (Output_segment::Output_segment): Un-privatize copy constructor.
7229 (Output_segment::operator=): Un-privatize.
7230 * script-sections.cc (Output_section_element::Input_section_list):
7231 Change element type to Output_section::Simple_input_section.
7232 (Output_section_element_dot_assignment::set_section_addresses):
7233 Register output section data for relaxation clean up.
7234 (Output_data_exression::Output_data_expression): Adjust call to base
7235 constructor to fix data size.
7236 (Output_section_element_data::set_section_addresses): Register
7237 Output_data_expression object for relaxation clean up.
7238 (struct Input_section_info): Replace Relobj pointer and section index
7239 pair with Output_section::Simple_input_section and Convert struct to a
7240 class.
7241 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7242 Input_section_info data member to use accessors.
20e6d0d6
DK
7243 (Output_section_element_input::set_section_addresses): Use layout
7244 parameter. Adjust code to use Output_section::Simple_input_section
7245 and Input_secction_info classes. Register filler for relaxation
7246 clean up.
7247 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7248 and section index pair with Output_section::Simple_input_section
7249 class. Adjust code accordingly.
7250 (Phdrs_element::release_segment): New method definition.
7251 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7252 segment list.
7253 (Script_sections::release_segments): New method definition.
7254 * gold/script-sections.h (Script_sections::release_segments): New
7255 method declaration.
7256 * gold/target.h (Target::may_relax, Target::relax,
7257 Target::do_may_relax, Target::do_relax): New method definitions.
7258
5e445df6
ILT
72592009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7260
7261 * arm.cc (has_signed_unsigned_overflow): New function.
7262 (Arm_relocate_functions::abs8): New function.
7263 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7264 (Target_arm::Scan::global): Likewise.
7265 (Target_arm::relocate::relocate): Likewise.
7266 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7267 Likewise.
7268
8c604651 72692009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7270
7271 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7272 * testsuite/Makefile.in: Regenerate.
7273
1e9cc1c2
NC
72742009-09-11 Nick Clifton <nickc@redhat.com>
7275
7276 * po/gold.pot: Updated by the Translation project.
7277
6a89f575
CC
72782009-09-08 Cary Coutant <ccoutant@google.com>
7279
7280 * output.cc (Output_file::open): Add execute permission to empty file.
7281 * testsuite/Makefile.am (permission_test): New test.
7282 * testsuite/Makefile.in: Regenerate.
7283
fdcac5af
ILT
72842009-09-02 Ian Lance Taylor <iant@google.com>
7285
7286 * output.cc (Output_file::resize): Call map_no_anonymous rather
7287 than map.
7288
44453f85
ILT
72892009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7290
7291 * gold.cc: Include "incremental.h".
7292 (queue_initial_tasks): Call Incremental_checker methods.
7293 * incremental.cc: Include "output.h".
7294 (Incremental_checker::can_incrementally_link_output_file): New
7295 method.
7296 * incremental.h (Incremental_checker): New class.
7297
7298 * output.cc (Output_file::open_for_modification): New method.
7299 (Output_file::map_anonymous): Changed return type to bool. Record
7300 map in base_ field.
7301 (Output_file::map_no_anonymous): New method, broken out of map.
7302 (Output_file::map): Use map_no_anonymous and map_anonymous.
7303 * output.h (class Output_file): Update declarations.
7304
293c1386
CC
73052009-08-24 Cary Coutant <ccoutant@google.com>
7306
7307 * options.h (Command_line::Pre_options): New class.
7308 (Command_line::pre_options): New member.
7309 * options.cc (gold::options::ready_to_register): New variable.
7310 (One_option::register_option): Do nothing if not registering options.
7311 Assert if same short option registered twice.
7312 (General_options::General_options): Turn off option registration when
7313 done constructing.
7314 (Command_line::Pre_options::Pre_options): New constructor.
7315
f773f3d2
CC
73162009-08-24 Cary Coutant <ccoutant@google.com>
7317
06a73cfe
CC
7318 * options.h (General_options::no_keep_memory): Remove incorrect
7319 short option.
f773f3d2 7320
a15af8e2
RW
73212009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7322
7323 * Makefile.am (am__skiplex, am__skipyacc): New.
7324 * Makefile.in: Regenerate.
7325
c462b41b
RW
73262009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7327
14ec8efd
RW
7328 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7329 (INCLUDES): ... this.
7330 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7331 (AM_CPPFLAGS): Renamed from ...
7332 (INCLUDE): ... this.
7333 * Makefile.in, testsuite/Makefile.in: Regenerate.
7334
81ecdfbb
RW
7335 * Makefile.in: Regenerate.
7336 * aclocal.m4: Likewise.
7337 * config.in: Likewise.
7338 * configure: Likewise.
7339 * testsuite/Makefile.in: Likewise.
7340
c462b41b
RW
7341 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7342 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7343 * Makefile.in: Regenerate.
7344 * testsuite/Makefile.in: Regenerate.
7345
2da73f13
CC
73462009-08-19 Cary Coutant <ccoutant@google.com>
7347
7348 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7349 symbols in shared libraries overridden by hidden or internal symbols
7350 in the main program.
7351
2db70501
CD
73522009-08-19 Chris Demetriou <cgd@google.com>
7353
7354 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7355 checking source file names in error messages.
7356
f733487b
DK
73572009-08-18 Doug Kwan <dougkwan@google.com>
7358
7359 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7360 an elcpp::Ehdr as parameter. Adjust call to set_target.
7361 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7362 an elfcpp::Ehdr as parameter.
7363 * object.cc (Object::set_target): Remove the version that looks up
7364 a target and sets it.
7365 (Sized_relobj::setup): Take a Target object instead of
7366 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7367 (make_elf_sized_object): Find target and ask target to
7368 make an ELF object.
7369 * object.h: (Object::set_target): Remove the version that looks up
7370 a target and sets it.
7371 (Sized_relobj::setup): Take a Target object instead of
7372 an elfcpp:Ehdr as parameter.
7373 * target.cc: Include dynobj.h.
7374 (Target::do_make_elf_object_implementation): New.
7375 (Target::do_make_elf_object): New.
7376 * target.h (Target::make_elf_object): New template declaration.
7377 (Target::do_make_elf_object): New method declarations.
7378 (Target::do_make_elf_object_implementation): New template declaration.
7379
cc70f101
ILT
73802009-08-14 Ian Lance Taylor <iant@google.com>
7381
7382 * gold.h (FUNCTION_NAME): Define.
7383 (gold_unreachable): Use FUNCTION_NAME.
7384
ef5e0cb1
ST
73852009-08-12 Sriraman Tallam <tmsriram@google.com>
7386
7387 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7388 symbol in the --keep-unique list is not found.
7389
48c187ce
ST
73902009-08-12 Sriraman Tallam <tmsriram@google.com>
7391
7392 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7393 been maked as --keep-unique.
7394 (Icf::unfold_section): New function.
7395 * icf.h (Icf::unfold_section): New function.
7396 * options.h (General_options::keep_unique): New option.
7397 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7398 * testsuite/Makefile.in: Regenerate.
7399 * testsuite/icf_keep_unique_test.sh: New file.
7400 * testsuite/icf_keep_unique_test.cc: New file.
7401
645afe0c
CC
74022009-08-12 Cary Coutant <ccoutant@google.com>
7403
7404 PR 10471
7405 * resolve.cc (Symbol_table::resolve): Check for references from
7406 dynamic objects to hidden and internal symbols.
7407 * testsuite/Makefile.am (hidden_test.sh): New test.
7408 * testsuite/Makefile.in: Regenerate.
7409 * testsuite/hidden_test.sh: New script.
7410 * testsuite/hidden_test_1.c: New test source.
7411 * testsuite/hidden_test_main.c: New test source.
7412
11af873f
DK
74132009-08-11 Doug Kwan <dougkwan@google.com>
7414
7415 * arm.cc: Update comments.
7416 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7417 segment to locate the .ARM.exidx section if present.
7418
b9f7d72d
DK
74192009-08-09 Doug Kwan <dougkwan@google.com>
7420
7421 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7422 patch.
7423
ddd3c53c
ST
74242009-08-07 Sriraman Tallam <tmsriram@google.com>
7425 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7426 compiler warnings.
7427
27721062
ST
74282009-08-06 Sriraman Tallam <tmsriram@google.com>
7429
7430 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7431 valid tls_segment only for non-debug-section relocations.
7432 * testsuite/Makefile.am: Add gc_tls_test.
7433 * testsuite/Makefile.in: Regenerate.
7434 * testsuite/gc_tls_test.cc: New file.
7435 * testsuite/gc_tls_test.sh: New file.
7436
ef15dade 74372009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7438
ef15dade
ST
7439 * icf.cc: New file.
7440 * icf.h: New file.
7441 * Makefile.am (CCFILES): Add icf.cc.
7442 (HFILES): Add icf.h
7443 * Makefile.in: Regenerate.
7444 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7445 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7446 section, symbol and addend information for the relocs.
7447 * gold.cc (queue_middle_tasks): Call identical code folding.
7448 * gold.h: Add defines for multimap.
7449 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7450 to the call of finalize_local_symbols.
7451 * main.cc (main): Create object of class Icf.
7452 * object.cc (Sized_relobj::do_layout): Allow this function to be
7453 called twice during icf.
7454 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7455 to sections marked as identical by icf.
7456 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7457 when available.
7458 (Sized_relobj::do_section_entsize): New function.
7459 * object.h (Object::section_entsize): New function.
7460 (Object::do_section_entsize): New pure virtual function.
7461 (Relobj::finalize_local_symbols): Add new parameter.
7462 (Relobj::do_section_entsize): New function.
7463 * options.h (General_options::icf): New option.
7464 (General_options::icf_iterations): New option.
7465 (General_options::print_icf_sections): New option.
7466 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7467 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7468 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7469 icf.
7470 * symtab.cc (Symbol_table::is_section_folded): New function.
7471 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7472 to sections marked as identical by icf.
7473 * symtab.h (Symbol_table::set_icf): New function.
7474 (Symbol_table::icf): New function.
7475 (Symbol_table::is_section_folded): New function.
7476 (Symbol_table::icf_): New data member.
7477 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7478 * testsuite/Makefile.am: Add commands to build icf_test.
7479 * testsuite/Makefile.in: Regenerate.
7480 * testsuite/icf_test.sh: New file.
7481 * testsuite/icf_test.cc: New file.
7482
c3b65ac4
CD
74832009-07-24 Chris Demetriou <cgd@google.com>
7484
7485 * layout.cc (is_compressible_debug_section): Fix incorrect
7486 comment about compressed section names.
7487
1caf2c51
ILT
74882009-07-20 Ian Lance Taylor <ian@airs.com>
7489
7490 PR 10419
7491 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7492
1ef4d87f
ILT
74932009-07-16 Ian Lance Taylor <iant@google.com>
7494
7495 PR 10400
7496 * layout.h: #include <map>.
7497 (class Kept_section): Change from struct to class. Add accessors
7498 and setters. Add section size to Comdat_group mapping. Change
7499 Comdat_group to std::map. Add is_comdat_ field. Add
7500 linkonce_size field in union.
7501 (class Layout): Update declaration of find_or_add_kept_section.
7502 Don't declare find_kept_object.
7503 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7504 parameter. Add object, shndx, is_comdat, and is_group_name
7505 parameters. Change all callers. Adjust for new Kept_section.
7506 (Layout::find_kept_object): Remove.
7507 * object.cc (Sized_relobj::include_section_group): Update use of
7508 Kept_section. Rename secnum to shndx. Only record
7509 Kept_comdat_section if sections are the same size.
7510 (Sized_relobj::include_linkonce_section): Update use of
7511 Kept_section. Only record Kept_comdat_section if sections are the
7512 same size. Set size of linkonce section.
7513 (Sized_relobj::map_to_kept_section): Update call to
7514 get_kept_comdat_section.
7515 * object.h (class Sized_relobj): Rename fields in
7516 Kept_comdat_section to drop trailing underscores; change object
7517 field to Relobj*. Change Kept_comdat_section_table to store
7518 struct rather than pointer.
7519 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7520 Add kept_object and kept_shndx parameters. Change all callers.
7521 (Sized_relobj::get_kept_comdat_section): Change return type to
7522 bool. Add kept_object and kept_shndx parameters. Change all
7523 callers.
7524 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7525 Layout::find_or_add_kept_section.
7526
37c3b7b0
ILT
75272009-07-09 Ian Lance Taylor <iant@google.com>
7528
7529 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7530 Reserve space in the hash table.
7531
98fa85cb
ILT
75322009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7533
7534 * fileread.cc (File_read::get_mtime): New method.
7535 * fileread.h (Timespec): New structure.
7536 (File_read::get_mtime): New method.
7537 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7538 Renamed from timestamp_nsec.
7539 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7540 Elf_Xword.
e1df38aa 7541 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7542 timestamp_nsec.
e1df38aa 7543 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7544 (Incremental_inputs::report_obejct): Save mtime; style fix.
7545 (Incremental_inputs::report_script): Save mtime; style fix.
7546 (Incremental_inputs::finalize_inputs): Style fix.
7547 (Incremental_inputs::finalize): Style fix.
7548 (Incremental_inputs::create_input_section_data): Store inputs
7549 mtime.
7550 * incremental.h (Incremental_inputs::report_script): Add mtime
7551 argument.
7552 (Incremental_inputs::Input_info::Input_info): Intialize only one
7553 union member.
7554 (Incremental_inputs::Input_info::archive): Move to nameless
7555 union.
7556 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7557 (Incremental_inputs::Input_info::script): Move to nameless union.
7558 (Incremental_inputs::mtime): New field.
7559 * script.cc (read_input_script): Pass file mtime to
7560 Incremental_input.
7561 * script.h (Script_info::inputs): Style fix.
7562
c9d70757
ILT
75632009-07-01 Ian Lance Taylor <ian@airs.com>
7564
7565 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7566 instead of 32.
7567
9c547ec3
ILT
75682009-06-24 Ian Lance Taylor <iant@google.com>
7569
7570 PR 10156
7571 * layout.cc (Layout::choose_output_section): If we find an
7572 existing section, update the flags.
7573 (Layout::create_notes): New function, broken out of
7574 Layout::finalize.
7575 (Layout::finalize): Don't create note sections.
7576 (Layout::create_note): Don't crash if linker script discards
7577 section.
7578 (Layout::create_gold_note): Likewise.
7579 (Layout::create_build_id): Likewise. Don't set
7580 after_input_sections on the section.
7581 (Layout::create_executable_stack_info): Remove target parameter.
7582 Change caller.
7583 * layout.h (class Layout): Declare create_notes. Update
7584 declaration of create_executable_stack_info.
7585 * gold.cc (queue_middle_tasks): Call create_notes.
7586 * output.cc (Output_section::update_flags_for_input_section): Move
7587 here from output.h. If SHF_ALLOC flag is newly set, mark address
7588 invalid.
7589 * output.h (Output_data::mark_address_invalid): New function.
7590 (class Output_section): Only declare, not define,
7591 update_flags_for_input_section. Remove set_flags.
7592
55458500
ILT
75932009-06-24 Ian Lance Taylor <iant@google.com>
7594
7595 * script-sections.cc (Output_section_definition::
7596 set_section_addresses): Rename shadowing local load_address to
7597 laddr.
7598
1307d6cd
ILT
75992009-06-24 Ian Lance Taylor <iant@google.com>
7600
7601 PR 10244
7602 * reloc.cc (relocate_sections): Skip empty relocation sections.
7603
ec3f783e
ILT
76042009-06-23 Ian Lance Taylor <iant@google.com>
7605
7606 PR 10156
7607 * layout.cc (Layout::create_note): Use choose_output_section
7608 rather than make_output_section.
7609
459c9f1c
ILT
76102009-06-23 Ian Lance Taylor <iant@google.com>
7611
7612 PR 10237
7613 * options.cc (General_options::parse_V): Set printed_version_.
7614 (General_options::General_options): Initialize printed_version_.
7615 * options.h (class General_options): Add printed_version_ field.
7616 * gold.cc (queue_initial_tasks): If there are no input files,
7617 don't give a fatal error if we printed the version information.
7618 (queue_middle_tasks): If using -r with a shared object, give a
7619 fatal error rather than an ordinary error.
7620
1518dc8f
ILT
76212009-06-23 Ian Lance Taylor <iant@google.com>
7622
7623 PR 10219
7624 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7625 (Layout::make_output_section): Set have_stabstr_section_ if we see
7626 a .stab*str section.
7627 (Layout::finalize): Call link_stabs_sections.
7628 (Layout::link_stabs_sections): New file.
7629 * layout.h (class Layout): Add have_stabstr_section_ field.
7630 Declare link_stabs_sections.
7631
3d857b98
DK
76322009-06-23 Doug Kwan <dougkwan@google.com>
7633
7634 * Makefile.am (libgold_a_LIBADD): New.
7635 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7636 * Makefile.in: Regenerate.
7637 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7638 * configure: Regenerate.
7639 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7640 * fileread.cc: Include sys/state.h
7641 * gold.h: Declare memmem and strndup if found missing.
7642 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7643
0639a6f6
ILT
76442009-06-23 Ian Lance Taylor <iant@google.com>
7645
7646 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7647 * configure: Rebuild.
7648
8d63875c
ILT
76492009-06-23 Ian Lance Taylor <iant@google.com>
7650
7651 PR 10147
7652 * object.cc (Object::section_contents): Don't try to get a view if
7653 the section has length zero.
7654 (Object::handle_gnu_warning_section): If the section is empty, use
7655 the name of the section as the warning.
7656
f7c8a183
ILT
76572009-06-23 Ian Lance Taylor <iant@google.com>
7658
7659 PR 10133
7660 * stringpool.h (class Stringpool_template): Add optimize_ field.
7661 (Stringpool_template::set_optimize): New function.
7662 * stringpool.cc (Stringpool_template::Stringpool_template):
7663 Initialize optimize_ field.
7664 (Stringpool_template::set_string_offsets): Test local optimize
7665 fild rather than parameter.
7666 * layout.cc (Layout::Layout): Call set_optimize on the section
7667 name stringpool.
7668
e6a307ba
ILT
76692009-06-22 Ian Lance Taylor <iant@google.com>
7670
7671 PR 10030
7672 * yyscript.y: Parse TARGET.
7673 * script.cc (script_set_target): New function.
7674 * script-c.h (script_set_target): Declare.
7675 * options.cc (General_options::string_to_object_format): Rename
7676 from string_to_object_format in anonymous namespace. Change
7677 callers.
7678 * options.h (class General_options): Declare
7679 string_to_object_format.
7680
3ee173de
ILT
76812009-06-22 Ian Lance Taylor <iant@google.com>
7682
7683 * script-sections.cc (Script_sections::create_segments): Don't put
7684 program headers in a PT_LOAD segment if -n or -N.
7685
76862009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7687
7688 PR 10141
7689 * options.h (class General_options): Add -z lazy and -z now. Sort
7690 -z options into alphabetical order.
7691 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7692
cd6739a1 76932009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7694
7695 * layout.cc (Layout::make_output_section): Call
7696 Target::new_output_section.
7697 (Layout::attach_allocated_section_to_segment): Put large section
7698 sections in a separate load segment with the large segment flag
7699 set.
7700 (Layout::segment_precedes): Sort large data segments after other
7701 load segments.
7702 (align_file_offset): New static function.
7703 (Layout::set_segment_offsets): Use align_file_offset.
7704 * output.h (class Output_section): Add is_small_section_ and
7705 is_large_section_ fields.
7706 (Output_section::is_small_section): New function.
7707 (Output_section::set_is_small_section): New function.
7708 (Output_section::is_large_section): New function.
7709 (Output_section::set_is_large_section): New function.
7710 (Output_section::is_large_data_section): New function.
7711 (class Output_segment): Add is_large_data_segment_ field.
7712 (Output_segment::is_large_data_segment): New function.
7713 (Output_segment::set_is_large_data_segment): New function.
7714 * output.cc (Output_section::Output_section): Initialize new
7715 fields.
7716 (Output_segment::Output_segment): Likewise.
7717 (Output_segment::add_output_section): Add assertion that large
7718 data sections always go in large data segments. Force small data
7719 sections to the end of the list of data sections. Force small BSS
7720 sections to the start of the list of BSS sections. For large BSS
7721 sections to the end of the list of BSS sections.
7722 * symtab.h (class Symbol): Declare is_common_shndx.
7723 (Symbol::is_defined): Check Symbol::is_common_shndx.
7724 (Symbol::is_common): Likewise.
7725 (class Symbol_table): Define enum Commons_section_type. Update
7726 declarations. Add small_commons_ and large_commons_ fields.
7727 * symtab.cc (Symbol::is_common_shndx): New function.
7728 (Symbol_table::Symbol_table): Initialize new fields.
7729 (Symbol_table::add_from_object): Put small and large common
7730 symbols in the right list.
7731 (Symbol_table::sized_finalized_symbol): Check
7732 Symbol::is_common_shndx.
7733 (Symbol_table::sized_write_globals): Likewise.
7734 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7735 common symbol lists. Don't call do_allocate_commons_list if the
7736 list is empty.
7737 (Symbol_table::do_allocate_commons_list): Remove is_tls
7738 parameter. Add comons_section_type parameter. Change all
7739 callers. Handle small and large common symbols.
7740 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7741 Symbol::is_common_shndx.
7742 * resolve.cc (symbol_to_bits): Likewise.
7743 * target.h (Target::small_common_shndx): New function.
7744 (Target::small_common_section_flags): New function.
7745 (Target::large_common_shndx): New function.
7746 (Target::large_common_section_flags): New function.
7747 (Target::new_output_section): New function.
7748 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7749 small_common_section_flags, and large_common_section_flags
7750 fields.
7751 (Target::do_new_output_section): New virtual function.
7752 * arm.cc (Target_arm::arm_info): Initialize new fields.
7753 * i386.cc (Target_i386::i386_info): Likewise.
7754 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7755 Likewise.
7756 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7757 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7758 (Target_x86_64::do_new_output_section): New function.
7759 * configure.ac: Define conditional MCMODEL_MEDIUM.
7760 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7761 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7762 (large_LDFLAGS): Define.
7763 * testsuite/large.c: New file.
7764 * testsuite/testfile.cc (Target_test::test_target_info):
7765 Initialize new fields.
7766 * configure, testsuite/Makefile.in: Rebuild.
7767
bb04269c
DK
77682009-06-05 Doug Kwan <dougkwan@google.com>
7769
7770 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7771 * Makefile.in: Regenerate.
bb04269c
DK
7772 * i386.cc (class Target_i386): Define new virtual method to
7773 override do_is_local_label_name in parent.
7774 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7775 local symbols if --discard-locals or -X is given.
7776 * options.h (class General_options): Declare new options
7777 '--discard-locals' and '-X' for discarding locals.
7778 * target.h (class Target): Define new methods is_local_label_name.
7779 Declare new virtual method do_is_local_label_name.
7780 * target.cc: New file.
7781 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7782 (check_SCRIPTS): Add discard_locals_test.sh.
7783 (check_DATA): Add discard_local_tests.syms.
7784 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7785 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7786 * testsuite/Makefile.in: Regenerate.
7787 * testsuite/discard_locals_test.c: New file.
7788 * testsuite/discard_locals_test.sh: Same.
7789
805bb01c
DK
77902009-06-05 Doug Kwan <dougkwan@google.com>
7791
7792 * object.cc (Sized_relobj::Sized_relobj): Initialize
7793 discarded_eh_frame_shndx_ to -1U.
7794 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7795 section.
7796 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7797 a discarded .eh_frame section.
7798 (Sized_relobj::do_finalize_local_symbols): Ditto.
7799 * object.h (class Sized_relobj): Declare new member
7800 discarded_eh_frame_shndx_.
7801 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7802 (local_labels_test.o, local_labels_test): New rules.
7803 * testsuite/Makefile.in: Regenerate.
7804
1dcd334d
DK
78052009-06-04 Doug Kwan <dougkwan@google.com>
7806
7807 * layout.cc (Layout::section_name_mapping): Add mapping for
7808 special ARM sections.
7809
96d49306
DK
78102009-06-03 Doug Kwan <dougkwan@google.com>
7811
7812 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7813 (utils::has_overflow): Same.
7814
dff16297
ILT
78152009-06-03 Ian Lance Taylor <iant@google.com>
7816
7817 * layout.cc (Layout::section_name_mapping): New array, replacing
7818 Layout::linkonce_mapping.
7819 (Layout::section_name_mapping_count): New variable, replacing
7820 Layout::linkonce_mapping_count.
7821 (Layout::linkonce_output_name): Remove.
7822 (Layout::output_section_name): Rewrite.
7823 * layout.h (class Layout): Rename Linkonce_mapping to
7824 Section_name_mapping, linkonce_mapping to section_name_mapping,
7825 linkonce_mapping_count to section_name_mapping_count. Don't
7826 declare linkonce_output_name.
7827
c121c671
DK
78282009-06-03 Doug Kwan <dougkwan@google.com>
7829
7830 * gold/arm.cc (namespace utils): New.
7831 (Target_arm::reloc_is_non_pic): Define new method.
7832 (class Arm_relocate_functions): New.
7833 (Target_arm::Relocate::relocate): Handle relocation types used by
7834 Android.
7835
07800fab
ILT
78362009-06-03 Ian Lance Taylor <iant@google.com>
7837
7838 * arm.cc (Target_arm::scan::global): Use || instead of |.
7839
c121c671
DK
78402009-06-02 Doug Kwan <dougkwan@google.com>
7841
7842 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7843 issued_non_pic_error_.
7844 (class Target_arm::Scan): Declare new method check_non_pic.
7845 Define new method symbol_needs_plt_entry.
7846 Declare new data member issued_non_pic_error_.
7847 (class Target_arm::Relocate): Declare new method
7848 should_apply_static_reloc.
7849 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7850 (Target_arm::Scan::check_non_pic): Define new method.
7851 (Target_arm::Scan::local): Handle a small subset of reloc types used
7852 by Android.
7853 (Target_arm::Scan::local): Same.
7854 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7855
b19b0c6d
ILT
78562009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7857
7858 * incremental.cc (Incremental_inputs::report_command_line): Filter
7859 out --incremental-* options.
7860
94cdfcff
DK
78612009-05-29 Doug Kwan <dougkwan@google.com>
7862
7863 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7864 template class.
7865 (class Target_arm): Update comment.
7866 (Target_arm::Target_arm): Initialize new data members GOT_,
7867 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7868 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7869 and Target_arm::rel_dyn_section.
7870 Declare new_enum Target_arm::Got_type.
7871 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7872 and DYNBSS_.
7873 Update commments for member do_dynsym_value.
7874 (Target_arm::got_size, Target_arm::plt_section,
7875 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7876 new methods inside class defintion.
7877 (Target_arm::got_section): Define new method.
7878 (Target_arm::rel_dyn_section): Same.
7879 (Output_data_plt_arm): New template class.
7880 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7881 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7882 (Output_data_plt_arm::add_entry): Same.
7883 (Output_data_plt_arm::first_plt_entry): Define new
7884 static data member for PLT instruction template.
7885 (Output_data_plt_arm::plt_entry): Same.
7886 (Output_data_plt_arm::do_write): Define new method.
7887 (Target_arm::make_plt_entry): Same.
7888 (Target_arm::do_finalize_sections): Same.
7889 (Target_arm::do_dynsym_value): Same.
7890
4a657b0d
DK
78912009-05-28 Doug Kwan <dougkwan@google.com>
7892
7893 * Makefile.am (TARGETSOURCES): Add arm.cc.
7894 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7895 * Makefile.in: Regenerate.
7896 * arm.cc: New file.
7897 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7898
e7ae8c36
DK
78992009-05-26 Doug Kwan <dougkwan@google.com>
7900
7901 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7902 (General_options::check_excluded_libs): Strip off directories in
7903 archive name before matching like GNU ld does.
7904 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7905 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7906 (exclude_libs_test_LDFLAGS): Add linker option
7907 -Wl,--exclude-libs,libexclude_libs_test_3
7908 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7909 an explicit archive without using -l.
7910 (alt/libexclude_libs_test_3.a): New make rule.
7911 * testsuite/Makefile.in: Regenerate.
7912 * testsuite/exclude_libs_test.c : Declare lib3_default().
7913 (main): Call it.
7914 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7915 * exclude_libs_test_3.c: New file.
7916
f12e7348
NC
79172009-05-26 Nick Clifton <nickc@redhat.com>
7918
7919 * po/id.po: New Indonesian translation.
7920 * po/gold.pot: Updated template file.
7921
4daadc0d
ST
79222009-05-22 Sriraman Tallam <tmsriram@google.com>
7923
e1df38aa 7924 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7925 gc_comdat_test files. Add -Wl,--gc-sections to build
7926 gc_comdat_test.
7927 * testsuite/Makefile.in: Regenerate.
7928 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7929
531813ad
ST
79302009-05-21 Sriraman Tallam <tmsriram@google.com>
7931
7932 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7933 kept comdat section was garbage collected.
7934 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7935 * testsuite/Makefile.in: Regenerate.
7936 * testsuite/gc_comdat_test.sh: New file.
7937 * testsuite/gc_comdat_test_1.cc: New file.
7938 * testsuite/gc_comdat_test_2.cc: New file.
7939
65514900
CC
79402009-05-19 Doug Kwan <dougkwan@google.com>
7941
7942 * archive.cc (Archive::Archive): Move constructor from archive.h
7943 to here. Initialize no_export_.
7944 (Archive::get_elf_object_for_member): Set no_export flag of object.
7945 * archive.h (Archive::Archive): Move constructor body to
7946 archive.cc.
7947 (Archive::no_export): New method.
7948 (Archive::no_export_): New field.
7949 * object.h (Object::Object): Initialize no_export_ to false.
7950 (Object::no_export, Object::set_no_export): New methods.
7951 (Object::no_export_): New field.
7952 * options.cc (General_options::parse_exclude_libs): New method.
7953 (General_options::check_excluded_libs) Same.
7954 * options.h (exclude_libs): New option.
7955 (General_options::check_excluded_libs): New method declaration.
7956 (General_options::excluded_libs_): New field.
7957 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7958 default or protected visibility if an object has no-export flag set.
7959 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7960 (check_SCRIPTS): Add exclude_libs_test.sh.
7961 (check_DATA): Add exclude_libs_test.syms.
7962 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7963 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7964 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7965 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7966 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7967 libexclude_libs_test_2.a): New rules.
7968 * testsuite/Makefile.in: Regenerate.
7969 * testsuite/exclude_libs_test.c: New file.
7970 * testsuite/exclude_libs_test.sh: Ditto.
7971 * testsuite/exclude_libs_test_1.c: Ditto.
7972 * testsuite/exclude_libs_test_2.c: Ditto.
7973
1b77ea50
ILT
79742009-05-15 Ian Lance Taylor <iant@google.com>
7975
7976 * configure.ac: Check for declarations for cases where libiberty.h
7977 checks HAVE_DECL_xxx.
7978 * configure, config.in: Rebuild.
7979
072fe7ce
ILT
79802009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7981
7982 * gold.h (Incremental_argument_list): Remove (invalid) forward
7983 declaration.
7984 * incremental.cc (Incremental_inputs::report_achive): New method.
7985 (Incremental_inputs::report_object): New method.
7986 (Incremental_inputs::report_script): New method.
7987 (Incremental_inputs::finalize_inputs): New method.
7988 (Incremental_inputs::finalize): Call finalize_inputs().
7989 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7990 Create inputs entries.
7991 * incremental.h (Incremental_input_type): New enum.
7992 (Incremental_inputs::Incremental_input): Initialize new fields.
7993 (Incremental_inputs::report_inputs): New method.
7994 (Incremental_inputs::report_achive): New method.
7995 (Incremental_inputs::report_object): New method.
7996 (Incremental_inputs::report_script): New method.
7997 (Incremental_inputs::finalize_inputs): New method.
7998 (Incremental_inputs::Input_info): New struct.
7999 (Incremental_inputs::Input_info_map): New typedef.
8000 (Incremental_inputs::lock_): New field.
8001 (Incremental_inputs::Inputs_): New field.
8002 (Incremental_inputs::Inputs_map): New field.
8003 * main.cc (main): Call Incremental_input::report_inputs.
8004 * options.h (Input_argument_list): Typedef moved from
8005 Input_arguments.
8006 (Input_file_group::Files): Remove, use ::Input_argument_list.
8007 (Input_file_group::Input_argument_list): Remove, use
8008 ::Input_argument_list.
8009 * plugin.cc (Plugin_manager::add_input_file): Add error in
8010 incremental build.
8011 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8012 functions.
8013 * script.cc (read_input_script): Call
8014 Incremental_input::report_script.
8015 * script.h (Script_info): New class.
8016
b0481b0b
ILT
80172009-04-27 Ian Lance Taylor <iant@google.com>
8018
8019 * x86_64.cc (do_adjust_output_section): Set entsize to
8020 plt_entry_size.
8021
b22a5a41 80222009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8023
8024 * output.cc (Output_file::close): After short writes, continue
8025 writing from the correct offset in the buffer being written.
8026
40fde488
CD
80272009-04-23 Chris Demetriou <cgd@google.com>
8028
8029 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8030 * configure: Regenerate.
8031 * config.in: Regenerate.
8032 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8033 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8034
3ce2c28e
ILT
80352009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8036
8037 * incremental.cc (Incremental_inputs_header_data): Renamed from
8038 Incremental_input_header_data.
8039 (Incremental_inputs_header_data::data_size): New field.
8040 (Incremental_inputs_header_data::put_input_file_count): Renamed
8041 from input_file_count.
8042 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8043 from command_line_offset.
8044 (Incremental_inputs_header_data::put_reserved): Renamed from
8045 put_reserved.
8046 (Incremental_inputs_entry_data): Renamed from
8047 Incremental_input_entry_data.
8048 (Incremental_inputs_entry_data::data_size): New field.
8049 (Incremental_inputs::report_command_line): New method.
8050 (Incremental_inputs::finalize): New method.
8051 (Incremental_inputs::create_incremental_inputs_data): New method.
8052 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8053 * incremental.h: New file.
8054 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8055 (Layout::finalize): Create incremental inputs section in
8056 incremental builds.
8057 (Layout::create_incremental_info_sections): New method.
8058 * layout.h (Layout::incremental_inputs): New method.
8059 (Layout::create_incremental_info_sections): New method.
8060 (Layout::incremental_inputs_): New field.
8061 * main.cc (main): Notify Incremental_input of the command line.
8062
e55bde5e
ILT
80632009-04-01 Ian Lance Taylor <iant@google.com>
8064 Mikolaj Zalewski <mikolajz@google.com>
8065
8066 * gold.h (reserve_unordered_map): Define, three versions, one for
8067 each version of Unordered_map.
8068 * layout.cc (Layout::Layout): Remove options parameter. Add
8069 number_of_input_files parameter. Don't initialize options_.
8070 Initialize number_of_input_files_ and resized_signatures_. Move
8071 sections_are_attached_.
8072 (Layout::layout_group): Reserve space for group_signatures_.
8073 (Layout::find_or_add_kept_section): Change name parameter to be a
8074 reference. Resize signatures_ map when it gets large enough.
8075 (Layout::layout_eh_frame): Use parameters->options() instead of
8076 this->options_.
8077 (Layout::make_output_section): Likewise.
8078 (Layout::attach_allocated_section_to_segment): Likewise.
8079 (Layout::finalize, Layout::create_executable_stack): Likewise.
8080 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8081 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8082 * layout.h (class Layout): Update declarations. Remove options_
8083 field. Add number_of_input_files_ and resized_signatures_
8084 fields. Move sections_are_attached_ field.
8085 * main.cc (main): Pass number of input files to Layout
8086 constructor. Don't pass options.
8087
154b857c
ILT
80882009-03-30 Ian Lance Taylor <iant@google.com>
8089
8090 * ffsll.c (ffsll): Correct implementation.
8091
2f35ab9b
ILT
80922009-03-27 Ian Lance Taylor <iant@google.com>
8093
fd03461a
ILT
8094 * ffsll.c: New file.
8095 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8096 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8097 * ftruncate.c (ftruncate): Declare before definition.
8098 * mremap.c (mremap): Likewise.
8099 * pread.c (pread): Likewise.
8100 * configure, Makefile.in, config.in: Rebuild.
8101
2f35ab9b
ILT
8102 * mremap.c: New file.
8103 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8104 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8105 (mremap): Declare if HAVE_MREMAP is not defined.
8106 * configure, Makefile.in, config.in: Rebuild.
8107
33aea2fd
CC
81082009-03-27 Cary Coutant <ccoutant@google.com>
8109
8110 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8111 position independent.
8112 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8113 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8114
6d479619
CC
81152009-03-24 Cary Coutant <ccoutant@google.com>
8116
8117 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8118 an executable.
8119 (needs_dynamic_reloc): Likewise.
8120
afc06bb8
ILT
81212009-03-24 Ian Lance Taylor <iant@google.com>
8122
8123 * yyscript.y (file_cmd): Recognize EXTERN.
8124 (extern_name_list, extern_name_list_body): New nonterminals.
8125 * script.cc (script_add_extern): Define.
8126 * script-c.h (script_add_extern): Declare.
8127
f6060a4d
ILT
81282009-03-24 Rafael Avila de Espindola <espindola@google.com>
8129
8130 * object.cc (is_elf_object): Define.
8131 * object.h (is_elf_object): Declare.
8132 * archive.cc (Archive::get_elf_object_for_member): Call
8133 is_elf_object.
33aea2fd 8134 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8135
26736d8e
ILT
81362009-03-24 Elliott Hughes <enh@google.com>
8137
8138 * output.cc (Output_file::map_anonymous): Define.
8139 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8140 try an anonymous one. Report the size if the mmap fails.
8141 * output.h (class Output_file): Declare map_anonymous.
8142
22fd9730
ILT
81432009-03-24 Ian Lance Taylor <iant@google.com>
8144
8145 * target-select.cc (instantiate_target): Don't acquire the lock if
8146 the instantiated_target_ field has already been set.
8147
cb010894
ILT
81482009-03-23 Ian Lance Taylor <iant@google.com>
8149
7f055c20
ILT
8150 * gold-threads.h (class Initialize_lock): Define.
8151 * gold-threads.cc (class Initialize_lock_once): Define.
8152 (initialize_lock_control): New static variable.
8153 (initialize_lock_pointer): New static variable.
8154 (initialize_lock_once): New static function.
8155 (Initialize_lock::Initialize_lock): Define.
8156 (Initialize_lock::initialize): Define.
8157 * target-select.h: Include "gold-threads.h".
8158 (class Target_selector): Add lock_ and initialize_lock_ fields.
8159 Don't define instantiate_target, just declare it.
8160 * target-select.cc (Target_selector::Target_selector): Initialize
8161 new fields.
8162 (Target_selector::instantiate_target): Define.
8163 * descriptors.h: Include "gold-threads.h".
8164 (class Descriptors): Add initialize_lock_ field.
8165 * descriptors.cc (Descriptors::Descriptors): Initialize new
8166 field.
8167 (Descriptors::open): Use initialize_lock_ field
8168 * errors.h (class Errors): Add initialize_lock_ field.
8169 * errors.cc (Errors::Errors): Initialize new field.
8170 (Errors::initialize_lock): Use initialize_lock_ field.
8171 * powerpc.cc (class Target_selector_powerpc): Remove
8172 instantiated_target_ field. In do_recognize call
8173 instantiate_target rather than do_instantiate_target. In
8174 do_instantiate_target just allocate a new target.
8175 * sparc.cc (class Target_selector_sparc): Likewise.
8176
36959681
ILT
8177 * freebsd.h: New file.
8178 * i386.cc: Include "freebsd.h".
8179 (Target_i386): Derive from Target_freebsd rather than
8180 Sized_target.
8181 (Target_selector_i386): Derive from Target_selector_freebsd rather
8182 than Target_selector.
8183 * x86_64.cc: Include "freebsd.h".
8184 (Target_x86_64): Derive from Target_freebsd rather than
8185 Sized_target.
8186 (Target_selector_x86_64): Derive from Target_selector_freebsd
8187 rather than Target_selector.
8188 * target.h (class Target): Add adjust_elf_header and
8189 do_adjust_elf_header.
8190 * output.cc (Output_file_header:: do_sized_write): Call target
8191 adjust_elf_header routine.
8192 * configure.tgt: Set targ_osabi.
8193 * configure.ac: Define GOLD_DEFAULT_OSABI.
8194 * parameters.cc (Parameters::default_target): Pass
8195 GOLD_DEFAULT_OSABI to select_target.
8196 * target-select.h (class Target_selector): Make instantiate_target
8197 protected rather than private.
8198 * Makefile.am (HFILES): Add freebsd.h.
8199 * configure, Makefile.in, config.in: Rebuild.
8200
cb010894
ILT
8201 * merge.cc (do_add_input_section): Correct pend value. Change
8202 message about last entry not being null terminated from error to
8203 warning.
8204
0e879927
ILT
82052009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8206
8207 * incremental.cc: New file.
8208 * Makefile.am (CCFILES): Add incremental.cc.
8209 * Makefile.in: Rebuild.
8210
41105937
PP
82112009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8212
8213 * layout.cc (Layout::output_section_name): Preserve names
8214 of '.note.' sections.
e1df38aa 8215
60439920
ILT
82162009-03-19 Ian Lance Taylor <iant@google.com>
8217
8218 * descriptors.cc (Descriptors::open): Check that the options are
8219 valid before using them.
8220
0d371ad3
ILT
82212009-03-18 Ian Lance Taylor <iant@google.com>
8222
8223 * script-sections.h: Include <list>.
8224 (class Script_sections): Change Sections_elements from std::vector
8225 to std::list. Typedef public Elements_iterator. Add
8226 orphan_section_placement_, data_segment_align_start_, and
8227 saw_data_segment_align_ fields. Remove data_segment_align_index_
8228 field.
8229 * script-sections.cc (class Orphan_section_placement): New class.
8230 (class Sections_element): Add virtual functions is_relro and
8231 orphan_section_init. Remove virtual function place_orphan_here.
8232 (class Output_section_definition): Add is_relro and
8233 orphan_section_init. Remove place_orphan_here.
8234 (class Orphan_output_section): Likewise.
8235 (Script_sections::Script_sections): Update for field changes.
8236 (Script_sections::data_segment_align): Set saw_data_segment_align_
8237 and data_segment_align_start_, not data_segment_align_index.
8238 (Script_sections::data_segment_relro_end): Check
8239 saw_data_segment_align_. Use data_segment_align_start_ rather
8240 than data_segment_align_index_.
8241 (Script_sections::place_orphan): Rewrite to use
8242 Orphan_section_placement.
8243
9201d894
ILT
82442009-03-17 Ian Lance Taylor <iant@google.com>
8245
9c5b8369
ILT
8246 * archive.cc (Archive::add_symbols): Check for a version attached
8247 to the symbol name in the archive map.
8248 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8249 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8250 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8251 (ver_test_11.a): New target.
8252 * testsuite/Makefile.in: Rebuild.
8253
9201d894
ILT
8254 * configure.ac: Check for chsize and posix_fallocate. Replace
8255 ftruncate.
8256 * ftruncate.c: New file, from gnulib.
8257 * output.cc (posix_fallocate): Define dummy version if not
8258 HAVE_POSIX_FALLOCATE.
8259 (Output_file::map): Call posix_fallocate rather than lseek and
8260 write.
8261 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8262 * configure, Makefile.in, config.in: Rebuild.
8263
ef4ab7a8 82642009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8265
ef4ab7a8
PP
8266 * layout.h (Layout::create_note): Add section_name parameter.
8267 * layout.cc (Layout::create_note): Likewise.
8268 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8269
8c500701
ILT
82702009-03-17 Ian Lance Taylor <iant@google.com>
8271
e85b18e1
ILT
8272 * descriptors.cc: Include "options.h".
8273 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8274 (Descriptors::open): Always use O_CLOEXEC when opening a new
8275 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8276 then set FD_CLOEXEC.
8277
9efe6174
ILT
8278 * sparc.cc (class Target_sparc): Add has_got_section.
8279 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8280 make sure we have a GOT section.
8281
8282 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8283 (Target_sparc::Scan::local): Likewise.
8284 (Target_sparc::Scan::global): Likewise.
8285 (Target_sparc::Relocate::relocate): Likewise.
8286 (Target_sparc::Relocate::relocate_tls): Likewise.
8287
8c500701
ILT
8288 * symtab.cc (Symbol_table::define_default_version): New function,
8289 broken out of add_from_object.
8290 (Symbol_table::add_from_object): Call define_default_version.
8291 (Symbol_table::define_special_symbol): Add resolve_oldsym
8292 parameter. Change all callers. If the version for a symbol comes
8293 from a version script, resolve it with the symbol with the same
8294 name with no version. Also add the symbol without a version if
8295 appropriate.
8296 (do_define_in_output_data): If resolving with oldsym, don't delete
8297 sym.
8298 (do_define_in_output_segment): Likewise.
8299 (do_define_as_constant): Likewise.
8300 * symtab.h (class Symbol_table): Update declarations.
8301
f1ed28fb
ILT
83022009-03-13 Ian Lance Taylor <iant@google.com>
8303
15f8229b
ILT
8304 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8305 (Read_symbols::requeue): New function.
8306 (Read_symbols::do_read_symbols): If make_elf_object fails because
8307 the target type is not configured, and the file was searched for,
8308 issue a warning and retry with the next directory.
8309 (Add_symbols::run): If the file has an incompatible format, and
8310 it was searched for, requeue the Read_symbols task. On error,
8311 release the object.
8312 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8313 dirindex parameter to constructor. Change all callers. Declare
8314 incompatible_warning and requeue.
8315 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8316 input_argument_ and input_group_ fields. Add them to
8317 constructor. Change all callers.
8318 (class Read_script): Add dirindex_ field. Add it to constructor.
8319 Change all callers.
8320 * archive.cc (Archive::setup): Remove input_objects parameter.
8321 Change all callers.
8322 (Archive::get_file_and_offset): Likewise.
8323 (Archive::read_all_symbols): Likewise.
8324 (Archive::read_symbols): Likewise.
8325 (Archive::get_elf_object_for_member): Remove input_objects
8326 parameter. Add punconfigured parameter. Change all callers.
8327 (Archive::add_symbols): Change return type to bool. Check return
8328 value of include_member.
8329 (Archive::include_all_members): Likewise.
8330 (Archive::include_member): Change return type to bool. Return
8331 false if first included object has incompatible target. Set
8332 included_member_ field.
8333 (Add_archive_symbols::run): If add_symbols returns false, requeue
8334 Read_symbols task.
8335 * archive.h (class Archive): Add included_member_ field.
8336 Initialize it in constructor. Add input_file and searched_for
8337 methods. Update declarations.
8338 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8339 input_argument_ fields. Add them to constructor. Change all
8340 callers.
8341 * script.cc: Include "target-select.h".
8342 (class Parser_closure): Add skip_on_incompatible_target_ and
8343 found_incompatible_target_ fields. Add
8344 skip_on_incompatible_target parameter to constructor. Change all
8345 callers. Add methods skip_on_incompatible_target,
8346 clear_skip_on_incompatible_target, found_incompatible_target, and
8347 set_found_incompatible_target.
8348 (read_input_script): Add dirindex parameter. Change all callers.
8349 If parser finds an incompatible target, requeue Read_symbols
8350 task.
8351 (script_set_symbol): Clear skip_on_incompatible_target in
8352 closure.
8353 (script_add_assertion, script_parse_option): Likewise.
8354 (script_start_sections, script_add_phdr): Likewise.
8355 (script_check_output_format): New function.
8356 * script.h (read_input_script): Update declaration.
8357 * script-c.h (script_check_output_format): Declare.
8358 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8359 (ignore_cmd): Remove OUTPUT_FORMAT.
8360 * fileread.cc (Input_file::Input_file): Add explicit this.
8361 (Input_file::will_search_for): New function.
8362 (Input_file::open): Add pindex parameter. Change all callers.
8363 * fileread.h (class Input_file): Add input_file_argument method.
8364 Declare will_search_for. Update declarations.
8365 * object.cc (make_elf_object): Add punconfigured parameter.
8366 Change all callers.
8367 * object.h (class Object): Make input_file public. Add
8368 searched_for method.
8369 (make_elf_object): Update declaration.
8370 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8371 restart search.
8372 * dirsearch.h (class Dirsearch): Update declaration.
8373 * options.h (class General_options): Add --warn-search-mismatch.
8374 * parameters.cc (Parameters::is_compatible_target): New function.
8375 * parameters.h (class Parameters): Declare is_compatible_target.
8376 * workqueue.cc (Workqueue::add_blocker): New function.
8377 * workqueue.h (class Workqueue): Declare add_blocker.
8378
f1ed28fb
ILT
8379 * fileread.cc (Input_file::open): Remove options parameter.
8380 Change all callers.
8381 (Input_file::open_binary): Likewise.
8382 * script.cc (read_input_script): Likewise.
8383 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8384 options parameter from constructor. Change all callers.
8385 (class Read_script): Likewise.
8386 * fileread.h (class Input_file): Update declarations.
8387 * script.h (read_input_script): Update declaration.
8388
34dd024a
NC
83892009-03-10 Nick Clifton <nickc@redhat.com>
8390
8391 * po/es.po: New Spanish translation.
8392
6d71b17c
CC
83932009-03-06 Cary Coutant <ccoutant@google.com>
8394
8395 * options.cc (parse_short_option): Keep dash_z from registering itself.
8396
031cdbed
ILT
83972009-03-03 Ian Lance Taylor <iant@google.com>
8398
8399 PR 9918
8400 * target-reloc.h (relocate_section): Pass output_section to
8401 relocate.
8402 * i386.cc (Target_i386::should_apply_static_reloc): Add
8403 output_section parameter. Change all callers.
8404 (Target_i386::Relocate::relocate): Add output_section parameter.
8405 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8406 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8407 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8408 * testsuite/two_file_shared.sh: New script.
8409 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8410 (check_DATA): Add two_file_shared.dbg.
8411 (two_file_shared.dbg): New target.
8412 * testsuite/Makefile.in: Rebuild.
8413
15d5fa16
ILT
84142009-03-01 Ian Lance Taylor <iant@google.com>
8415
8416 * configure.ac: Check for byteswap.h.
8417 * configure: Rebuild.
8418 * config.in: Rebuild.
8419
8a4c0b0d
ILT
84202009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8421
8422 * layout.cc (Layout::find_or_add_kept_section): New function.
8423 (Layout::add_comdat): Removed.
8424 * layout.h (struct Kept_section): Move out of class Layout.
8425 Remove trailing underscores from field names. Add group_sections
8426 field. Rename group_ field to is_group. Change all uses.
8427 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8428 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8429 comdat_groups_ field.
8430 (Sized_relobj::include_section_group): Use
8431 find_or_add_kept_section and Kept_section::group_sections.
8432 (Sized_relobj::include_linkonce_section): Likewise.
8433 * object.cc (class Sized_relobj): Don't define Comdat_group or
8434 Comdat_group_table. Remove find_comdat_group and
8435 add_comdat_group. Remove comdat_groups_ field.
8436 * plugin.cc (include_comdat_group): Use
8437 Layout::find_or_add_kept_section.
8438
b4ecf66b
ILT
84392009-02-28 Ian Lance Taylor <iant@google.com>
8440
14359ca0
ILT
8441 * README: --gc-sections and map files are now supported. Document
8442 some build requirements.
8443
b4ecf66b
ILT
8444 PR 6992
8445 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8446 relocatable link set the value of the section symbol to zero.
8447 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8448 relocatable link don't include the section address in the local
8449 symbol value.
8450
0602e05a
ILT
84512009-02-27 Ian Lance Taylor <iant@google.com>
8452
fd9d194f
ILT
8453 PR 6811
8454 * options.h (class Search_directory): Add is_system_directory.
8455 (class General_options): Declare is_in_system_directory.
8456 * options.cc (get_relative_sysroot): Make static.
8457 (get_default_sysroot): Make static.
8458 (General_optoins::is_in_system_directory): New function.
8459 * fileread.cc (Input_file::is_in_system_directory): New function.
8460 * fileread.h (class Input_file): Declare is_in_system_directory.
8461 * object.h (class Object): Add is_in_system_directory.
8462 (class Input_objects): Remove system_library_directory_ field.
8463 * object.cc (Input_objects::add_object): Don't set
8464 system_library_directory_.
8465 (input_objects::found_in_system_library_directory): Remove.
8466 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8467 parameter. Change all callers.
8468 (Symbol_table::sized_write_globals): Likewise.
8469 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8470 Call Object::is_in_system_directory.
8471 * symtab.h (class Symbol_table): Update declarations.
8472
61edd21f
ILT
8473 PR 5990
8474 * descriptors.h (Open_descriptor): Add is_on_stack field.
8475 * descriptors.cc (Descriptors::open): If the descriptor is on the
8476 top of the stack, remove it. Initialize is_on_stack field.
8477 (Descriptors::release): Only add pod to stack if it is not on the
8478 stack already.
8479 (Descriptors::close_some_descriptor): Clear stack_next and
8480 is_on_stack fields.
8481
e29e076a
ILT
8482 PR 7091
8483 * output.cc (Output_section::find_starting_output_address): Rename
8484 from starting_output_address; add PADDR parameter; change return
8485 type.
8486 * output.h (class Output_section): Declare
8487 find_starting_output_address instead of starting_output_address.
8488 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8489 section symbol for which we can't find a merge section.
8490
0602e05a
ILT
8491 PR 9836
8492 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8493 hidden or internal, force the symbol to be local.
8494 * resolve.cc (Symbol::override_visibility): Define.
8495 (Symbol::override_base): Use override_visibility.
8496 (Symbol_table::resolve): Likewise.
8497 (Symbol::override_base_with_special): Likewise.
8498 (Symbol_table::override_with_special): If the visibility is hidden
8499 or internal, force the symbol to be local.
8500 * symtab.h (class Symbol): Add set_visibility and
8501 override_visibility.
8502 * testsuite/ver_test_1.sh: New file.
8503 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8504 (check_DATA): Add ver_test_1.syms.
8505 (ver_test_1.syms): New target.
8506 * testsuite/Makefile.in: Rebuild.
8507
401a9a73
CC
85082009-02-25 Cary Coutant <ccoutant@google.com>
8509
8510 * layout.cc (Layout::choose_output_section): Don't rename sections
8511 when using a linker script that has a SECTIONS clause.
8512 * Makefile.in: Regenerate.
8513
8514 * testsuite/Makefile.am (script_test_5.sh): New test case.
8515 * testsuite/Makefile.in: Regenerate.
8516 * testsuite/script_test_5.cc: New file.
8517 * testsuite/script_test_5.sh: New file.
8518 * testsuite/script_test_5.t: New file.
8519
f488e4b0
CC
85202009-02-13 Rafael Avila de Espindola <espindola@google.com>
8521
8522 * archive.cc (Archive::include_member): Update calls to add_symbols.
8523 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8524 the Layout argument.
8525 * dynobj.h (do_add_symbols): Add the Layout argument.
8526 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8527 Layout argument.
8528 * object.h (Object::add_symbols): Add the Layout argument.
8529 (Object::do_add_symbols): Add the Layout argument.
8530 (Sized_relobj::do_add_symbols): Add the Layout argument.
8531 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8532 Unify the two versions.
8533 (Add_plugin_symbols): Remove.
8534 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8535 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8536 (Add_plugin_symbols): Remove.
8537 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8538 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8539 (Add_symbols::run): Make it work with Pulginobj.
8540
89dd1680
ILT
85412009-02-06 Ian Lance Taylor <iant@google.com>
8542
8543 * object.cc (Sized_relobj::do_layout): Make info message start
8544 with lower case letter.
8545
266d0a74
ILT
85462009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8547
602b464e
ILT
8548 * binary.cc: Fix file comment.
8549
266d0a74
ILT
8550 * options.h (enum Incremental_disposition): Define.
8551 (class General_options): Add new options: --incremental,
8552 --incremental_changed, --incremental_unchanged,
8553 --incremental_unknown. Add incremental_disposition_ and
8554 implicit_incremental_ fields.
8555 (General_options::incremental_disposition): New function.
8556 (class Position_dependent_options): Add incremental_disposition
8557 option.
8558 (Position_dependent_options::copy_from_options): Set incremental
8559 dispositions.
8560 * options.cc (General_options::parse_incremental_changed): New
8561 function.
8562 (General_options::parse_incremental_unchanged): New function.
8563 (General_options::parse_incremental_unknown): New function.
8564 (General_options::General_options): Initialize new fields
8565 incremental_disposition_ and implicit_incremental_.
8566 (General_options::finalize): Check for uasge of --incremental-*
8567 without --incremental.
8568
f073bbf7
CD
85692009-02-06 Chris Demetriou <cgd@google.com>
8570
8571 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8572 pointer and to report location as the file name associated with
8573 the symbol.
8574 (gold_undefined_symbol_at_location): New function to replace the
8575 old gold_undefined_symbol functionality.
8576 * target-reloc.h (relocate_section): Update to use
8577 gold_undefined_symbol_at_location.
8578 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8579 Call gold_undefined_symbol function rather than gold_error.
8580 * errors.h (Errors::undefined_symbol): Take location as a
8581 string, rather than calculating it from a relocation.
8582 * errors.cc (Errors::fatal): Print "fatal error:" before the
8583 formatted message.
8584 (Errors::error, Errors::error_at_location): Print "error: "
8585 before the formatted message.
8586 (Errors::undefined_symbol): Take location as a string, rather
8587 than calculating it from a relocation.
8588 (gold_undefined_symbol_at_location): New function akin to
8589 old gold_undefined_symbol, calculates location from relocation.
8590 (gold_undefined_symbol): Change to take only a Symbol pointer
8591 and to report location as the file name associated with the symbol.
8592 * testsuite/debug_msg.sh: Update for changed error messages.
8593 * testsuite/undef_symbol.sh: Likewise.
8594
8e94a90c
ILT
85952009-02-04 Duncan Sands <baldrick@free.fr>
8596
8597 PR 9812
8598 * reduced_debug_output.h
8599 (Output_reduced_debug_abbrev_section::failed): Use format for
8600 gold_warning.
8601 (Output_reduced_debug_info_section::faild): Likewise.
8602
88a0e15b
ILT
86032009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8604
8605 * script.cc (Lazy_demangler): New class.
8606 (Version_script_info::get_symbol_version_helper): Demangle a
8607 symbol only once.
8608
5efc7cd2
CC
86092009-01-29 Cary Coutant <ccoutant@google.com>
8610
8611 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8612 to __tls_get_addr.
8613 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8614
e0ebcf42
ILT
86152009-01-28 Ian Lance Taylor <iant@google.com>
8616
5efc7cd2 8617 * version.cc (version_string): Bump to 1.9.
75fe7426 8618
e0ebcf42
ILT
8619 * gold.h: Include <cstring> and <stdint.h>.
8620 * version.cc: Include <cstdio>.
8621 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8622 warning.
8623 * reduced_debug_output.cc (insert_into_vector): Rename from
8624 Insert_into_vector; change all callers. Use Swap_unaligned to
8625 avoid aliasing issue; remove union since it is unnecessary.
8626
8e2813be 86272009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8628
8629 * Makefile.am (CCFILES): Add gc.cc.
8630 (HFILES): Add gc.h.
8631 * Makefile.in: Regenerate.
8632 * gold.cc (Gc_runner): New class.
8633 (queue_initial_tasks): Call garbage collection related tasks
8634 when corresponding options are invoked.
8635 (queue_middle_gc_tasks): New function.
8636 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8637 processed early before laying out sections during garbage collection.
8638 * gold.h (queue_middle_gc_tasks): New function.
8639 (is_prefix_of): Move from "layout.cc".
8640 * i386.cc (Target_i386::gc_process_relocs): New function.
8641 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8642 * main.cc (main): Create object of class "Garbage_collection".
8643 * object.cc (Relobj::copy_symbols_data): New function.
8644 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8645 (Sized_relobj::do_layout): Allow this function to be called twice
8646 during garbage collection and defer layout of section during the
6d03d481
ST
8647 first call.
8648 * object.h (Relobj::get_symbols_data): New function.
8649 (Relobj::is_section_name_included): New function.
8650 (Relobj::copy_symbols_data): New function.
8651 (Relobj::set_symbols_data): New function.
8652 (Relobj::get_relocs_data): New function.
8653 (Relobj::set_relocs_data): New function.
8654 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8655 (Relobj::gc_process_relocs): New function.
8656 (Relobj::do_gc_process_relocs): New pure virtual function.
8657 (Relobj::sd_): New data member.
8658 (Sized_relobj::is_output_section_offset_invalid): New function.
8659 (Sized_relobj::do_gc_process_relocs): New function.
8660 * options.h (General_options::gc_sections): Modify to not be a no-op.
8661 (General_options::print_gc_sections): New option.
8662 * plugin.cc (Plugin_finish::run): Remove function call to
8663 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8664 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8665 * reloc.cc (Read_relocs::run): Add task to process relocs and
8666 determine unreferenced sections when doing garbage collection.
8667 (Gc_process_relocs): New class.
8668 (Sized_relobj::do_gc_process_relocs): New function.
8669 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8670 sections that are garbage collected.
8671 * reloc.h (Gc_process_relocs): New class.
8672 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8673 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8674 symbols whose corresponding sections are garbage collected.
8675 (Symbol_table::Symbol_table): Add new parameter for the garbage
8676 collection object.
8677 (Symbol_table::gc_mark_undef_symbols): New function.
8678 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8679 (Symbol_table::gc_mark_dyn_syms): New function.
8680 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8681 as garbage.
8682 (Symbol_table::add_from_object): Likewise.
8683 (Symbol_table::add_from_relobj): When building shared objects, do not
8684 treat externally visible symbols as garbage.
8685 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8686 table information for static and relocatable links.
8687 * symtab.h (Symbol_table::set_gc): New function.
8688 (Symbol_table::gc): New function.
8689 (Symbol_table::gc_mark_undef_symbols): New function.
8690 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8691 (Symbol_table::gc_mark_dyn_syms): New function.
8692 (Symbol_table::gc_): New data member.
e1df38aa 8693 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8694 function.
8695 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8696 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8697
3b293544
CF
86982009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8699
8700 * options.h (General_options::gc_sections): Define as a no-op for now.
8701 (General_options::no_keep_memory): Ditto.
8702 (General_options::Bshareable): Define.
8703 * options.cc (General_options::finalize): Honor -Bshareable.
8704
83d22aa8
AS
87052009-01-20 Andreas Schwab <schwab@suse.de>
8706
8707 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8708 read the value in the contents, since we don't use it. Use the
8709 template endianness when writing.
8710 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8711
cd536b21
AS
87122009-01-19 Andreas Schwab <schwab@suse.de>
8713
8714 * configure.tgt (powerpc64-*): Fix targ_obj.
8715
99e9a495
ILT
87162009-01-15 Ian Lance Taylor <iant@google.com>
8717
8718 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8719 local symbols when stripping all symbols.
8720
bbbfea06
CC
87212009-01-14 Cary Coutant <ccoutant@google.com>
8722
99e9a495 8723 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8724
0f7c0701
CC
87252009-01-14 Cary Coutant <ccoutant@google.com>
8726
8727 * archive.cc (Archive::get_elf_object_for_member): Remove call
8728 to File_read::claim_for_plugin.
8729 * descriptors.cc (Descriptors::open): Remove reference to
8730 is_claimed.
8731 (Descriptors::claim_for_plugin): Remove.
8732 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8733 (Descriptors::is_claimed): Remove.
8734 (claim_descriptor_for_plugin): Remove.
8735 * fileread.cc (File_read::claim_for_plugin): Remove.
8736 * fileread.h (File_read::claim_for_plugin): Remove.
8737 (File_read::descriptor): Reopen descriptor if necessary.
8738 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8739 (Plugin_manager::all_symbols_read): Add task parameter. Change
8740 all callers.
8741 (Plugin_manager::get_input_file): New function.
8742 (Plugin_manager::release_input_file): New function.
8743 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8744 corresponding data member.
8745 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8746 and pass to base constructor. Change all callers.
8747 (get_input_file, release_input_file): New functions.
8748 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8749 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8750 (Plugin_manager::all_symbols_read): Add task parameter.
8751 (Plugin_manager::get_input_file): New function.
8752 (Plugin_manager::release_input_file): New function.
8753 (Plugin_manager::task_): New data member.
8754 (Pluginobj::Pluginobj): Add filesize parameter.
8755 (Pluginobj::filename): New function.
8756 (Pluginobj::descriptor): New function.
8757 (Pluginobj::filesize): New function.
8758 (Pluginobj::filesize_): New data member.
8759 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8760 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8761 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8762
8763 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8764 with archive libraries.
8765 * testsuite/Makefile.in: Regenerate.
8766 * testsuite/plugin_test.c (struct sym_info): New type.
8767 (get_input_file, release_input_file): New static variables.
8768 (onload): Capture new transfer vector entries.
8769 (claim_file_hook): Stop reading at end of file according to filesize.
8770 Factor out parsing of readelf output into separate function.
8771 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8772 APIs and get the source file name from the symbol table. Convert
8773 source file name to corresponding object file name. Print info
8774 message when adding new input files.
8775 (parse_readelf_line): New function.
8776 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8777 * testsuite/plugin_test_2.sh: Likewise.
8778 * testsuite/plugin_test_3.sh: Likewise.
8779 * testsuite/plugin_test_4.sh: New test case.
8780
62a6d109
ILT
87812009-01-07 Ian Lance Taylor <iant@google.com>
8782
8783 * version.cc (version_string): Bump to 1.8.
8784
483620e8
CC
87852008-12-23 Cary Coutant <ccoutant@google.com>
8786
8787 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8788 * plugin.cc (Plugin_manager::finish): Rename as
8789 layout_deferred_objects. Move cleanup to separate function.
8790 (Plugin_manager::cleanup): New function.
8791 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8792 separately.
8793 * plugin.h (Plugin_manager::finish): Rename as
8794 layout_deferred_objects.
8795 (Plugin_manager::cleanup): New function.
8796 (Plugin_manager::cleanup_done): New field.
8797
d66a9eb3
CC
87982008-12-23 Cary Coutant <ccoutant@google.com>
8799
8800 * plugin.cc (is_visible_from_outside): New function.
8801 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8802 so we don't return "IR only" status for exported symbols or -r links.
8803
8804 * testsuite/Makefile.am (plugin_test_3): New test case.
8805 * testsuite/Makefile.in: Regenerate.
8806 * testsuite/plugin_test_3.sh: New file.
8807
5995b570
CC
88082008-12-22 Cary Coutant <ccoutant@google.com>
8809
8810 * object.cc (Sized_relobj::layout_section): New function.
8811 (Sized_relobj::do_layout): Defer layout of input sections until after
8812 plugin has provided replacement files.
8813 (Sized_relobj::do_layout_deferred_sections): New function.
8814 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8815 (Relobj::layout_deferred_sections): New function.
8816 (Relobj::do_layout_deferred_sections): New function.
8817 (Sized_relobj::do_layout_deferred_sections): New function.
8818 (Sized_relobj::layout_section): New function.
8819 (Sized_relobj::Deferred_layout): New structure.
8820 (Sized_relobj::deferred_layout_): New field.
8821 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8822 Change all callers. Layout deferred sections.
8823 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8824 references.
8825 (Plugin_hook::run): Move code from do_plugin_hook inline.
8826 (Plugin_hook::do_plugin_hook): Remove.
8827 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8828 (Plugin_manager::finish): Renamed, was cleanup.
8829 (Plugin_manager::should_defer_layout): New function.
8830 (Plugin_manager::add_deferred_layout_object): New function.
8831 (Plugin_manager::Deferred_layout_list): New type.
8832 (Plugin_manager::deferred_layout_objects_): New field.
8833 (Plugin_hook::do_plugin_hook): Remove.
8834
ee769c88
ILT
88352008-12-17 Ian Lance Taylor <iant@google.com>
8836
8837 * options.h (class General_options): Add --no case for
8838 --export-dynamic.
8839
abc8dcba
CC
88402008-12-16 Cary Coutant <ccoutant@google.com>
8841
8842 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8843 vector.
8844 (Plugin_manager::claim_file): Create plugin object even if
8845 plugin did not call the add_symbols callback.
8846 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8847 asking for more symbols than were added.
8848 * testsuite/Makefile.am (plugin_test_1): Add test case with
8849 no global symbols.
8850 (empty.syms): New target.
8851 * testsuite/Makefile.in: Regenerate.
8852 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8853 message. Don't call add_symbols if no globals.
8854 (all_symbols_read_hook): Don't provide replacement for empty
8855 claimed file.
8856
b0074644
ILT
88572008-12-12 Ian Lance Taylor <iant@google.com>
8858
68943102
ILT
8859 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8860 r_type == 0 for a local symbol with r_sym == 0.
8861 (scan_relocatable_relocs): Pass r_sym to
8862 local_non_section_strategy.
8863 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8864 r_sym parameter.
8865
b0074644
ILT
8866 * configure.ac: Update test for TLS descriptors: they are
8867 supported as of glibc 2.9.
8868 * configure: Rebuild.
8869
c2508178
ILT
88702008-12-11 Ian Lance Taylor <iant@google.com>
8871
8872 PR 7091
8873 * target-reloc.h (Default_scan_relocatable_relocs): For each
8874 function, map r_type == 0 to RELOC_DISCARD.
8875
2756a258
CC
88762008-12-10 Cary Coutant <ccoutant@google.com>
8877
8878 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8879 object to override a kept COMDAT group from a plugin object.
8880
bb6f53d3
ILT
88812008-12-09 Ian Lance Taylor <iant@google.com>
8882
fbc558e1
ILT
8883 PR 7088
8884 * yyscript.y (file_cmd): Handle INPUT.
8885
bb6f53d3
ILT
8886 * testsuite/initpri1.c: Change all declarations to be full
8887 prototypes by adding void, to avoid compiler warnings.
8888
4674ecfc
CC
88892008-12-05 Rafael Avila de Espindola <espindola@google.com>
8890
8891 * options.cc (General_options::parse_plugin_opt): New.
8892 (General_options::add_plugin): The argument now is just the filename.
8893 (General_options::add_plugin_option): New.
8894 * options.h (plugin_opt): New.
8895 (add_plugin): Change argument name.
8896 (add_plugin_option): New.
8897 * plugin.cc (Plugin::load): Don't parse the plugin option.
8898 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8899 (Plugin::add_option): New.
8900 (Plugin::args_): Change type.
8901 (Plugin::filename_): New.
8902 (Plugin_manager::add_plugin_option): New.
8903 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8904 * testsuite/Makefile.in: Regenerate.
8905
fd06b4aa
CC
89062008-12-05 Cary Coutant <ccoutant@google.com>
8907
8908 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8909 Handle --strip-lto-sections option.
8910 * options.h (strip_lto_sections): New option.
8911
6c52134c
CC
89122008-12-01 Cary Coutant <ccoutant@google.com>
8913
8914 * plugin.cc (ld_plugin_message): Change format parameter to const.
8915 Fix mismatch between new[] and delete.
8916
a45248e0
CC
89172008-11-14 Cary Coutant <ccoutant@google.com>
8918
8919 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8920 instead of -1U.
8921
c82fbeee
CS
89222008-11-05 Craig Silverstein <csilvers@google.com>
8923
8924 * options.cc (General_options::parse_dynamic_list): New function.
8925 * options.h (General_options): New flags dynamic_list,
8926 dynamic_list_data, dynamic_list_cpp_new, and
8927 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8928 (General_options::in_dynamic_list): New function.
8929 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8930 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8931 (Lex::can_continue_name): Likewise.
8932 (yylex): Likewise.
8933 (read_script_file): New parameter script_options.
8934 (read_dynamic_list): New function.
8935 (Script_options::define_dynamic_list): New function.
8936 (dynamic_list_keyword_parsecodes): New variable.
8937 (dynamic_list_keywords): New variable.
8938 * script.h (Script_options::define_dynamic_list): New function
8939 prototype.
8940 (read_dynamic_list): New function prototype.
8941 * symtab.cc (strprefix): New macro.
8942 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8943 dynamic_list_data, dynamic_list_cpp_new, and
8944 dynamic_list_cpp_typeinfo.
8945 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8946 (dynamic_list_expr): New rule.
8947 (dynamic_list_nodes): Likewise.
8948 (dynamic_list_node): Likewise.
8949 * testsuite/Makefile.am (dynamic_list): New test.
8950 * testsuite/Makefile.in: Regenerated.
8951 * testsuite/dynamic_list.t: New file.
8952 * testsuite/dynamic_list.sh: New file.
8953
e0bb29a5
CS
89542008-11-05 Craig Silverstein <csilvers@google.com>
8955
8956 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8957 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8958 (t11_last): Likewise.
8959 * testsuite/ver_test_6.c (main): Likewise.
8960
4e1e25e0
CC
89612008-10-07 Cary Coutant <ccoutant@google.com>
8962
8963 * options.c (General_options::finalize): Add check for -static and
8964 -shared.
8965 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8966 is not empty.
8967
92f03fcb
CC
89682008-10-02 Cary Coutant <ccoutant@google.com>
8969
8970 * plugin.cc (make_sized_plugin_object): Fix conditional
8971 compilation to work when not all targets are enabled.
8972
fbd8a257
CC
89732008-09-29 Cary Coutant <ccoutant@google.com>
8974
8975 * archive.cc (Archive::get_file_and_offset): Use filename instead
8976 of name to get library path.
8977 (Archive::include_member): Unlock external member of a thin archive.
8978
8979 * testsuite/Makefile.am (TEST_AR): New variable.
8980 (thin_archive_test_1): New test.
8981 (thin_archive_test_2): New test.
81636b3f
CC
8982 * testsuite/Makefile.in: Regenerate.
8983 * testsuite/thin_archive_main.cc: New file.
8984 * testsuite/thin_archive_test_1.cc: New file.
8985 * testsuite/thin_archive_test_2.cc: New file.
8986 * testsuite/thin_archive_test_3.cc: New file.
8987 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8988
eff45813
CC
89892008-09-29 Cary Coutant <ccoutant@google.com>
8990
8991 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8992 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8993 instead of -1U.
8994 (Sized_relobj::do_finalize_local_symbols): Likewise.
8995 (Sized_relobj::map_to_kept_section): Likewise.
8996 * object.h (Sized_relobj::invalid_address): New constant.
8997 (Sized_relobj::do_output_section_offset): Check for invalid_address
8998 and return -1ULL.
8999 * output.cc (Output_reloc::local_section_offset): Use constant
9000 invalid_address instead of -1U.
9001 (Output_reloc::get_address): Likewise.
9002 (Output_section::output_address): Change -1U to -1ULL.
9003 * output.h (Output_reloc::invalid_address): New constant.
9004 * reloc.cc (Sized_relobj::write_sections): Use constant
9005 invalid_address instead of -1U.
9006 (Sized_relobj::relocate_sections): Likewise.
9007 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9008 values for merge sections.
9009 * target-reloc.h (relocate_for_relocatable): Use constant
9010 invalid_address instead of -1U.
9011
89fc3421
CC
90122008-09-19 Cary Coutant <ccoutant@google.com>
9013
9014 Add plugin functionality for link-time optimization (LTO).
9015 * configure.ac (plugins): Add --enable-plugins option.
9016 * configure: Regenerate.
9017 * config.in: Regenerate.
9018 * Makefile.am (LIBDL): New variable.
9019 (CCFILES): Add plugin.cc.
9020 (HFILES): Add plugin.h.
9021 (ldadd_var): Add LIBDL.
9022 * Makefile.in: Regenerate.
9023
9024 * archive.cc: Include "plugin.h".
9025 (Archive::setup): Don't preread archive symbols when using a plugin.
9026 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9027 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9028 files.
9029 (Archive::include_member): Add symbols from plugin objects.
9030 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9031 * descriptors.cc (Descriptors::open): Check for file descriptors
9032 abandoned by plugins.
9033 (Descriptors::claim_for_plugin): New function.
9034 * descriptors.h (Descriptors::claim_for_plugin): New function.
9035 (Open_descriptor::is_claimed): New field.
9036 (claim_descriptor_for_plugin): New function.
9037 * fileread.cc (File_read::claim_for_plugin): New function.
9038 * fileread.h (File_read::claim_for_plugin): New function.
9039 (File_read::descriptor): New function.
9040 * gold.cc: Include "plugin.h".
9041 (queue_initial_tasks): Add task to call plugin hooks for generating
9042 new object files.
9043 * main.cc: Include "plugin.h".
9044 (main): Load plugin libraries.
9045 * object.h (Pluginobj): Declare.
9046 (Object::pluginobj): New function.
9047 (Object::do_pluginobj): New function.
9048 (Object::set_target): New function.
9049 * options.cc: Include "plugin.h".
9050 (General_options::parse_plugin): New function.
9051 (General_options::General_options): Initialize plugins_ field.
9052 (General_options::add_plugin): New function.
9053 * options.h (Plugin_manager): Declare.
9054 (General_options): Add --plugin option.
9055 (General_options::has_plugins): New function.
9056 (General_options::plugins): New function.
9057 (General_options::add_plugin): New function.
9058 (General_options::plugins_): New field.
9059 * plugin.cc: New file.
9060 * plugin.h: New file.
9061 * readsyms.cc: Include "plugin.h".
9062 (Read_symbols::do_read_symbols): Check for archive before checking
9063 for ELF file. Call plugin hooks to claim files.
9064 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9065 from a real object file; force override when processing replacement
9066 files.
9067 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9068 (Symbol::init_base_object): Likewise.
9069 (Symbol::init_base_output_data): Likewise.
9070 (Symbol::init_base_output_segment): Likewise.
9071 (Symbol::init_base_constant): Likewise.
9072 (Symbol::init_base_undefined): Likewise.
9073 (Symbol::output_section): Assert that object is not a plugin.
9074 (Symbol_table::add_from_pluginobj): New function.
9075 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9076 undefined.
9077 (Symbol_table::sized_write_globals): Likewise.
9078 (Symbol_table::add_from_pluginobj): Instantiate template.
9079 * symtab.h (Sized_pluginobj): Declare.
9080 (Symbol::in_real_elf): New function.
9081 (Symbol::set_in_real_elf): New function.
9082 (Symbol::in_real_elf_): New field.
9083 (Symbol_table::add_from_pluginobj): New function.
9084
9085 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9086 (LIBDL): New variable.
9087 (LDADD): Add LIBDL.
9088 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9089 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9090 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9091 (MOSTLYCLEANFILES): Likewise.
9092 * testsuite/Makefile.in: Regenerate.
9093 * testsuite/plugin_test.c: New file.
9094 * testsuite/plugin_test_1.sh: New file.
9095 * testsuite/plugin_test_2.sh: New file.
9096
de31bda5
ILT
90972008-09-16 Ian Lance Taylor <iant@google.com>
9098
9c2d0ef9
ILT
9099 * target-reloc.h (relocate_section): Check whether a symbol is
9100 defined by the ABI before reporting an undefined symbol error.
9101 * target.h (Target::is_defined_by_abi): Make parameter const.
9102 (Target::do_is_defined_by_abi): Likewise.
9103 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9104 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9105 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9106 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9107 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9108 * testsuite/Makefile.in: Rebuild.
9109
de31bda5
ILT
9110 * fileread.cc (make_view): Add casts to avoid warning.
9111
9fa33bee
AO
91122008-09-16 Alexandre Oliva <aoliva@redhat.com>
9113
9114 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9115 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9116
183fd0e3
AO
91172008-09-16 Alexandre Oliva <aoliva@redhat.com>
9118
9119 * options.h (General_options::output_is_executable): New.
9120 (General_options::output_is_pie): New.
9121 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9122 for shared libraries.
9123 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9124
7be8330a
CD
91252008-09-11 Chris Demetriou <cgd@google.com>
9126
9127 * options.h (origin): New -z option.
9128 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9129 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9130 in DT_FLAGS_1.
9131
a9caad02
CC
91322008-09-05 Cary Coutant <ccoutant@google.com>
9133
9134 * fileread.cc (File_read::make_view): Add check for attempt to map
9135 beyond end of file.
9136
ae6dce4d
CC
91372008-09-05 Cary Coutant <ccoutant@google.com>
9138
9139 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9140 explicit instantiations.
9141
d7ab2a47
KVH
91422008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9143
9144 PR gold/6858
9145 * options.cc (General_options::finalize): Allow undefined symbols
9146 in shlibs if linking -shared.
9147
9148 PR gold/6859
9149 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9150 symbols as not needing a dynsym entry.
9151
1e52a9c1
CS
91522008-08-20 Craig Silverstein <csilvers@google.com>
9153
9154 * fileread.cc (File_read::open): Do not lock the file unless it
9155 was successfully opened.
9156
d85c80a3
CC
91572008-08-14 Cary Coutant <ccoutant@google.com>
9158
9159 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9160 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9161 * testsuite/tls_test.cc (struct int128): 128-bit struct
9162 for testing TLS relocs with non-zero addend.
9163 (v12): New TLS variable.
9164 (t12): New test.
9165 (t_last): Add check for v12.
9166 * testsuite/tls_test.h (t12): New function.
9167 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9168
2d924fd9
ILT
91692008-08-13 Ian Lance Taylor <iant@google.com>
9170
9171 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9172 set tls_segment_ or relro_segment_.
9173 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9174 when appropriate.
9175 * output.h (Output_section::clear_is_relro): New function.
9176 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9177 sections specially even when output_data_ is empty.
9178 (Output_segment::maximum_alignment): When first section is relro,
9179 only force alignment for PT_LOAD segments.
9180 * script.cc (script_data_segment_align): New function.
9181 (script_data_segment_relro_end): New function.
9182 * script-c.h (script_data_segment_align): Declare.
9183 (script_data_segment_relro_end): Declare.
9184 * script-sections.h (class Script_sections): Declare
9185 data_segment_align and data_segment_relro_end. Add fields
9186 segment_align_index_ and saw_relro_end_.
9187 * script-sections.cc (class Sections_element): Add set_is_relro
9188 virtual function. Add new bool* parameter to place_orphan_here.
9189 Add get_output_section virtual function.
9190 (class Output_section_definition): Add set_is_relro. Add new
9191 bool* parameter to place_orphan_here. Add get_output_section.
9192 Add is_relro_ field.
9193 (Output_section_definition::Output_section_definition): Initialize
9194 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9195 and is_relro_ fields.
9196 (Output_section_definition::place_orphan_here): Add is_relro
9197 parameter.
9198 (Output_section_definition::set_section_addresses): Set relro for
9199 output section.
9200 (Output_section_definition::alternate_constraint): Likewise.
9201 (class Orphan_output_section): Add new bool* parameter to
9202 place_orphan_here. Add get_output_section.
9203 (Orphan_output_section::place_orphan_here): Add is_relro
9204 parameter.
9205 (Script_sections::Script_sections): Initialize
9206 data_segment_align_index_ and saw_relro_end_.
9207 (Script_sections::data_segment_align): New function.
9208 (Script_sections::data_segment_relro_end): New function.
9209 (Script_sections::place_orphan): Set or clear is_relro.
9210 (Script_sections::set_section_addresses): Force alignment of first
9211 TLS section.
9212 * yyscript.y (exp): Call script_data_segment_align and
9213 script_data_segment_relro_end.
9214 * testsuite/relro_script_test.t: New file.
9215 * testsuite/relro_test.cc (using_script): Declare.
9216 (t1, t2): Test using_script.
9217 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9218 (relro_script_test_SOURCES): Define.
9219 (relro_script_test_DEPENDENCIES): Define.
9220 (relro_script_test_LDFLAGS): Define.
9221 (relro_script_test_LDADD): Define.
9222 (relro_script_test.so): New target.
9223 * testsuite/Makefile.in: Rebuild.
9224
f827c9a9
CC
92252008-08-06 Cary Coutant <ccoutant@google.com>
9226
9227 * archive.cc (Archive::total_archives, Archive::total_members)
9228 (Archive::total_members_loaded): New variables.
9229 (Archive::setup): Add parameter. Add option to preread
9230 archive symbols.
9231 (Archive::read_armap): Add counter.
9232 (Archive::get_file_and_offset): New function.
9233 (Archive::get_elf_object_for_member): New function.
9234 (Archive::read_all_symbols): New function.
9235 (Archive::read_symbols): New function.
9236 (Archive::add_symbols): Add counters.
9237 (Archive::include_all_members): Use armap to find members if it's
9238 already built.
9239 (Archive::include_member): Skip reading symbols if already read.
9240 Factored code into Archive::get_file_and_offset and
9241 Archive::get_elf_object_for_member. Changed call to
9242 Mapfile::report_include_archive_member.
9243 (Archive::print_stats): New function.
9244 * archive.h: Declare Object and Read_symbols_data classes.
9245 (Archive::Archive): Add initializers for new members.
9246 (Archive::setup): Add parameter.
9247 (Archive::print_stats): New function.
9248 (Archive::total_archives, Archive::total_members)
9249 (Archive::total_members_loaded): New variables.
9250 (Archive::get_file_and_offset): New function.
9251 (Archive::get_elf_object_for_member): New function.
9252 (Archive::read_all_symbols): New function.
9253 (Archive::read_symbols): New function.
9254 (Archive::Archive_member): New class.
9255 (Archive::members_): New member.
9256 (Archive::num_members_): New member.
9257 * main.cc: Include archive.h.
9258 (main): Call Archive::print_stats.
9259 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9260 archive parameter; member_name is now the fully-decorated name.
9261 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9262 * options.h: (General_options): Add --preread-archive-symbols option.
9263 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9264 Archive::setup.
9265
de4c45bd
ILT
92662008-08-04 Ian Lance Taylor <iant@google.com>
9267
9268 * symtab.h (Symbol::use_plt_offset): New function.
9269 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9270 * powerpc.cc (Relocate::relocate): Likewise.
9271 * sparc.cc (Relocate::relocate): Likewise.
9272 * x86_64.cc (Relocate::relocate): Likewise.
9273 * testsuite/weak_plt.sh: New test.
9274 * testsuite/weak_plt_main.cc: New test.
9275 * testsuite/weak_plt_shared.cc: New test.
9276 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9277 (check_PROGRAMS): Add weak_plt.
9278 (check_DATA): Add weak_plt_shared.so.
9279 (weak_plt_main_pic.o, weak_plt): New targets.
9280 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9281 * testsuite/Makefile.in: Rebuild.
9282
9283 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9284 gcctestdir/ld.
9285 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9286 * testsuite/Makefile.in: Rebuild.
9287
323ee3f4
AM
92882008-08-04 Alan Modra <amodra@bigpond.net.au>
9289
9290 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9291 * Makefile.in: Regenerate.
9292 * po/POTFILES.in: Regenerate.
9293
7c07ecec
ILT
92942008-07-29 Ian Lance Taylor <iant@google.com>
9295
9296 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9297 symbols before other symbols.
9298 * testsuite/script_test_2.cc (test_addr): Declare.
9299 (test_addr_alias): Declare.
9300 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9301 values.
7c07ecec
ILT
9302 * testsuite/script_test_2.t: Define test_addr_alias and
9303 test_addr.
9304
5778530e
ILT
93052008-07-24 Ian Lance Taylor <iant@google.com>
9306
2a00e4fb
ILT
9307 PR 5990
9308 * descriptors.cc: New file.
9309 * descriptors.h: New file.
9310 * gold-threads.h (class Hold_optional_lock): New class.
9311 * fileread.cc: Include "descriptors.h".
9312 (File_read::~File_read): Release descriptor rather than closing
9313 it.
9314 (File_read::open) [file]: Call open_descriptor rather than open.
9315 Set is_descriptor_opened_.
9316 (File_read::open) [memory]: Assert that descriptor is not open.
9317 (File_read::reopen_descriptor): New function.
9318 (File_read::release): Release descriptor.
9319 (File_read::do_read): Make non-const. Reopen descriptor.
9320 (File_read::read): Make non-const.
9321 (File_read::make_view): Reopen descriptor.
9322 (File_read::do_readv): Likewise.
9323 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9324 Update declarations.
9325 * layout.cc: Include "descriptors.h".
9326 (Layout::create_build_id): Use open_descriptor rather than open.
9327 * output.cc: Include "descriptors.h".
9328 (Output_file::open): Use open_descriptor rather than open.
9329 * archive.cc (Archive::const_iterator): Change Archive to be
9330 non-const.
9331 (Archive::begin, Archive::end): Make non-const.
9332 (Archive::count_members): Likewise.
9333 * archive.h (class Archive): Update declarations.
9334 * object.h (Object::read): Make non-const.
9335 * Makefile.am (CCFILES): Add descriptors.cc.
9336 (HFILES): Add descriptors.h.
9337 * Makefile.in: Rebuild.
9338
801647d1
ILT
9339 PR 6716
9340 * gold.h: Always include <clocale>. Add Solaris workarounds
9341 following code in binutils/sysdep.h.
9342
5edd166e
ILT
9343 PR 6048
9344 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9345 this->eh_frame_hdr_ is NULL before using it.
9346
c89ad728
ILT
9347 * dynobj.cc (Versions::Versions): Update comment.
9348
aa86f06b
ILT
9349 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9350 the base version name.
9351
5778530e
ILT
9352 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9353 array size plus one.
9354 (Stringpool_template::set_string_offsets): Subtract one from key
9355 before using it as an array index.
9356 (Stringpool_template::get_offset_with_length): Likewise.
9357 (Stringpool_template::write_to_buffer): Likewise.
9358 * stringpool.h (Stringpool_template::get_offset_from_key):
9359 Likewise.
9360
057ead22
ILT
93612008-07-23 Ian Lance Taylor <iant@google.com>
9362
7f649c59
ILT
9363 PR 6658
9364 * object.h (Merged_symbol_value::value): Do our best to handle a
9365 negative addend.
9366
057ead22
ILT
9367 PR 6647
9368 * script.cc (Version_script_info::get_versions): Don't add empty
9369 version tag to return value.
9370 (Version_script_info::get_symbol_version_helper): Change return
9371 type to bool. Add pversion parameter. Change all callers.
9372 (script_register_vers_node): Don't require a non-NULL tag.
9373 * script.h (class Version_script_info): Update declarations.
9374 (Version_script_info::get_symbol_version): Change return type to
9375 bool. Add version parameter. Change all callers.
9376 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9377 handling. Handle an empty version from a version script.
9378 (Symbol_table::define_special_symbol): Likewise.
9379 * testsuite/ver_test_10.script: New file.
9380 * testsuite/ver_test_10.sh: New file.
9381 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9382 (check_DATA): Add ver_test_10.syms.
9383 (ver_test_10.syms, ver_test_10.so): New target.
9384 * testsuite/Makefile.in: Rebuild.
9385
58e54ac2
CD
93862008-07-23 Simon Baldwin <simonb@google.com>
9387
9388 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9389 to zero for undefined symbols from dynamic libraries.
9390
95d14cd3
ILT
93912008-07-23 Ian Lance Taylor <iant@google.com>
9392
9393 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9394 Change all callers.
9395 * symtab.h (class Symbol_table): Update declaration.
9396 * testsuite/ver_test_9.cc: New file.
9397 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9398 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9399 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9400 (ver_test_9.so, ver_test_9.o): New targets.
9401 * testsuite/Makefile.in: Rebuild.
9402
92de84a6
ILT
94032008-07-22 Ian Lance Taylor <iant@google.com>
9404
34810851
ILT
9405 * options.h (class General_options): Define --check-sections.
9406 * layout.cc (Layout::set_segment_offsets): Handle
9407 --check-sections.
9408
af6156ef
ILT
9409 * options.h (class General_options): Define -n/--nmagic and
9410 -N/--omagic.
9411 * options.cc (General_options::finalize): For -n/--nmagic or
9412 -N/--omagic, set -static.
9413 * layout.cc (Layout::attach_allocated_section_to_segment): If
9414 -N/--omagic, don't put read-only and read-write sections in
9415 different segments.
9416 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9417 finding a read-only segment.
9418 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9419 don't set the minimum segment alignment to the common page size,
9420 and don't set the file offset to the address modulo the page size.
9421 * script-sections.cc (Script_sections::create_segments): If
9422 -n/--omagic, don't put read-only and read-write sections in
9423 different segments.
9424
92de84a6
ILT
9425 * cref.cc: New file.
9426 * cref.h: New file.
9427 * options.h (class General_options): Add --print-symbol-counts.
9428 * main.cc (main): Issue defined symbol report if requested.
9429 * archive.cc (Archive::interpret_header): Make into a const member
9430 function.
9431 (Archive::add_symbols): Call Input_objects::archive_start and
9432 archive_stop.
9433 (Archive::const_iterator): Define new class.
9434 (Archive::begin, Archive::end): New functions.
9435 (Archive::include_all_members): Rewrite to use iterator.
9436 (Archive::count_members): New function.
9437 * archive.h (class Archive): Update declarations.
9438 (Archive::filename): New function.
9439 * object.cc: Include "cref.h".
9440 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9441 (Sized_relobj::do_get_global_symbol_counts): New function.
9442 (Input_objects::add_object): Add object to cross-referencer.
9443 (Input_objects::archive_start): New function.
9444 (Input_objects::archive_stop): New function.
9445 (Input_objects::print_symbol_counts): New function.
9446 * object.h: Declare Cref and Archive.
9447 (Object::get_global_symbol_counts): New function.
9448 (Object::do_get_global_symbol_counts): New pure virtual function.
9449 (class Sized_relobj): Add defined_count_ field. Update
9450 declarations.
9451 (class Input_objects): Add cref_ field. Update constructor.
9452 Update declarations.
9453 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9454 defined_count_.
9455 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9456 symbol counts.
9457 (Sized_dynobj::do_get_global_symbol_counts): New function.
9458 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9459 defined_count_. Update declarations. Define Symbols typedef.
9460 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9461 parameter. Change all callers.
9462 (Symbol_table::add_from_dynobj): Add sympointers and defined
9463 parameters. Change all callers.
9464 * symtab.h (class Symbol_table): Update declarations.
9465 * Makefile.am (CCFILES): Add cref.cc.
9466 (HFILES): Add cref.h.
9467 * Makefile.in: Rebuild.
9468
3f7c5e1d
CD
94692008-07-22 Simon Baldwin <simonb@google.com>
9470
9471 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9472 to zero when writing undefined symbols.
9473
e0b64032
ILT
94742008-07-22 Ian Lance Taylor <iant@google.com>
9475
9476 * output.cc (Output_section::add_input_section): Don't try to
9477 merge empty merge sections.
9478
096b02cf
CS
94792008-07-21 Craig Silverstein <csilvers@google.com>
9480
9481 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9482 Include symbol version in error message.
cd536b21 9483
1d1f116d
CD
94842008-07-20 Chris Demetriou <cgd@google.com>
9485
cd536b21 9486 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9487 (RANDOM_SEED_CFLAGS): New substituted variable.
9488 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9489 * configure: Rebuild.
9490 * Makefile.in: Likewise.
9491 * testsuite/Makefile.in: Likewise.
9492
a18f591e
ILT
94932008-07-18 Ian Lance Taylor <iant@google.com>
9494
9495 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9496 where we see NAME/NULL and NAME/VERSION as separate symbols.
9497 * testsuite/ver_test_main.cc (main): Call t4.
9498 (t4, t4_2a): Define.
9499 * testsuite/ver_test_2.cc (t4_2): Define.
9500 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9501 * testsuite/ver_test_4.cc (t4_2a): Define.
9502 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9503 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9504
c6e3f6ed
ILT
95052008-07-17 Ian Lance Taylor <iant@google.com>
9506
9507 * dynobj.cc (Versions::add_def): If we give an error about a
9508 missing version, go ahead and create the version anyhow.
9509
ef9beddf
ILT
95102008-07-10 Ian Lance Taylor <iant@google.com>
9511
9512 Handle output sections with more than 0x7fffffff bytes.
9513 * object.h (class Relobj): Change map_to_output_ to
9514 output_sections_, and just keep a section pointer. Change all
9515 uses. Move comdat group support to Sized_relobj.
9516 (Relobj::is_section_specially_mapped): Remove.
9517 (Relobj::output_section): Remove poff parameter. Change all
9518 callers.
9519 (Relobj::output_section_offset): New function.
9520 (Relobj::set_section_offset): Rewrite.
9521 (Relobj::map_to_output): Remove.
9522 (Relobj::output_sections): New function.
9523 (Relobj::do_output_section_offset): New pure virtual function.
9524 (Relobj::do_set_section_offset): Likewise.
9525 (class Sized_relobj): Add section_offsets_ field. Add comdat
9526 group support from Relobj. Update declarations.
9527 (Sized_relobj::get_output_section_offset): New function.
9528 (Sized_relobj::do_output_section_offset): New function.
9529 (Sized_relobj::do_set_section_offset): New function.
9530 * object.cc (Relobj::output_section_address): Remove.
9531 (Sized_relobj::Sized_relobj): Initialize new fields.
9532 (Sized_relobj::include_section_group): Cast find_kept_object to
9533 Sized_relobj.
9534 (Sized_relobj::include_linkonce_section): Likewise.
9535 (Sized_relobj::do_layout): Use separate arrays for output section
9536 and output offset.
9537 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9538 output_sections.
9539 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9540 output_sections and section_offsets.
9541 (Sized_relobj::write_local_symbols): Likewise.
9542 (map_to_kept_section): Compute output address directly.
9543 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9544 output_sections and section_offsets.
9545 (Sized_relobj::write_sections): Likewise.
9546 (Sized_relobj::relocate_sections): Likewise.
9547 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9548 * output.h (class Output_reloc): Update declarations. Change
9549 u2_.relobj to Sized_relobj*.
9550 (class Output_data_reloc): Change add functions to use
9551 Sized_relobj*.
9552 * output.cc (Output_reloc::Output_reloc): Change relobj to
9553 Sized_relobj*.
9554 (Output_reloc::local_section_offset): Change return type to
9555 Elf_Addr. Use get_output_section_offset.
9556 (Output_reloc::get_address): Likewise.
9557 (Output_section::is_input_address_mapped): Don't call
9558 is_section_specially_mapped.
9559 (Output_section::output_offset): Likewise.
9560 (Output_section::output_address): Likewise.
9561 (Output_section::starting_output_address): Likewise.
9562 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9563 parameter to Sized_relobj*.
9564 (Copy_relocs::need_copy_reloc): Likewise.
9565 (Copy_relocs::save): Likewise.
9566 * copy-relocs.h (class Copy_relocs): Update declarations.
9567 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9568 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9569 * target-reloc.h (relocate_for_relocatable): Change
9570 offset_in_output_section type to Elf_Addr. Change code that uses
9571 it as well.
9572 * layout.cc (Layout::layout): Always set *off.
9573 * mapfile.cc (Mapfile::print_input_section): Use
9574 output_section_offset.
9575 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9576 Sized_relobj*.
9577 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9578 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9579 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9580
5cb66f97
ILT
95812008-07-03 Ian Lance Taylor <iant@google.com>
9582
9583 * layout.cc (Layout::include_section): Do not discard unrecognized
9584 SHT_STRTAB sections.
9585
afe47622
CS
95862008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9587
9588 * script.cc (Lex::can_continue_name): Make '?' allowable in
9589 version-script names.
9590 * testsuite/version_script.map: Change glob pattern to use '?'
9591
5adf9721
ILT
95922008-06-30 Manish Singh <yosh@gimp.org>
9593
9594 PR 6585
9595 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9596 Correct typo.
9597
e6fde208
ILT
95982008-06-30 Ian Lance Taylor <iant@google.com>
9599
9600 PR 6660
9601 PR 6682
9602 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9603 versions]: Don't try to read the value in the contents, since we
9604 don't use it. Use the template endianness when writing.
9605
3f2e6a2d
CC
96062008-06-25 Cary Coutant <ccoutant@google.com>
9607
9608 * fileread.cc (File_read::make_view): Assert on zero-length view.
9609 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9610 symbol table when there are no symbols to read.
9611
c43d3a48
CS
96122008-06-23 Craig Silverstein <csilvers@google.com>
9613
9614 * version.cc (version_string): Bump to 1.7
9615
5f494ea0
CS
96162008-06-18 Craig Silverstein <csilvers@google.com>
9617
9618 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9619 constant 0xFFFF to type Valtype.
9620 (Powerpc_relocate_functions::rel16_ha): Likewise.
9621
c42e122e
ILT
96222008-06-17 Ian Lance Taylor <iant@google.com>
9623
f34787f8
ILT
9624 * output.h (Output_section::Input_section): Initialize p2align_ to
9625 zero for Output_section_data constructors.
9626 (Output_section::Input_section::addralign): If not an input
9627 section, return the alignment of the Output_section_data.
9628 * testsuite/copy_test.cc: New file.
9629 * testsuite/copy_test_1.cc: New file.
9630 * testsuite/copy_test_2.cc: New file.
9631 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9632 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9633 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9634 (copy_test_1_pic.o, copy_test_1.so): New targets.
9635 (copy_test_2_pic.o, copy_test_2.so): New targets.
9636 * testsuite/Makefile.in: Rebuild.
9637
c42e122e
ILT
9638 * script-sections.cc (Script_sections::place_orphan): Initialize
9639 local variable exact.
9640
ce3ac18a
DE
96412008-06-13 David Edelsohn <edelsohn@gnu.org>
9642
9643 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9644
42cacb20
DE
96452008-06-12 David Edelsohn <edelsohn@gnu.org>
9646 David S. Miller <davem@davemloft.net>
9647
9648 * powerpc.cc: New file.
9649 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9650 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9651 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9652 * Makefile.in: Rebuild.
9653
7b308235
ILT
96542008-06-09 Ian Lance Taylor <iant@google.com>
9655
9656 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9657 <exception>.
9658 (throwing, orig_terminate): New static variables.
9659 (terminate_handler): New static function.
9660 (t2): Set terminate handler.
9661
f0b886e3
ILT
96622008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9663
9664 PR 6584
cd536b21 9665 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9666 alignment.
9667
3e90f135
CC
96682008-05-30 Cary Coutant <ccoutant@google.com>
9669
9670 * archive.cc (Archive::include_all_members) Correct to step
9671 over symbol table and extended name table in thin archives.
9672
e09ad04a
ILT
96732008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9674
9675 PR 6407
9676 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9677 calculation.
9678
62b01cb5
ILT
96792008-05-28 Caleb Howe <cshowe@google.com>
9680
9681 * reduced_debug_output.cc: New file.
9682 * reduced_debug_output.h: New file.
92de84a6 9683 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9684 * options.cc (General_options::finalize): Add strip_debug_non_line
9685 to the strip heirarchy.
9686 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9687 fields.
9688 * layout.cc: Include "reduced_debug_output.h".
9689 (Layout::Layout): Initialize new fields.
9690 (line_only_debug_sections): New static array.
9691 (is_lines_only_debug_sections): New static inline function.
9692 (Layout::include_section): Handle --strip-debug-non-line.
9693 (Layout::make_output_section): If --strip-debug-non-line, build
9694 new output sections for .debug_abbrev and .debug_info.
9695 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9696 gold. Warn about possible overflow.
9697 (read_signed_LEB_128): Likewise.
9698 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9699 (read_signed_LEB_128): Declare.
9700 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9701 (HFILES): Add reduced_debug_output.h.
9702 * Makefile.in: Rebuild.
9703
7d9e3d98
ILT
97042008-05-21 Ian Lance Taylor <iant@google.com>
9705
9706 * mapfile.cc: New file.
9707 * mapfile.h: New file.
9708 * options.h (class General_options): Add -M/--print-map and -Map.
9709 * options.cc (General_options::finalize): Make -M equivalent to
9710 -Map -.
9711 * main.cc: Include <cstdio> and "mapfile.h".
9712 (main): Open mapfile if requested.
9713 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9714 constructor. Change caller.
9715 (queue_initial_tasks): Add mapfile parameter. Change caller.
9716 (queue_middle_tasks): Likewise.
9717 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9718 declarations.
9719 * archive.cc: Include "mapfile.h".
9720 (Archive::add_symbols): Add mapfile parameter. Change all
9721 callers. Pass mapfile, symbol, and reason to include_member.
9722 (Archive::include_all_members): Add mapfile parameter. Change all
9723 callers.
9724 (Archive::include_member): Add mapfile, sym, and why parameters.
9725 Change all callers. Report inclusion to map file.
9726 * archive.h: Include "fileread.h".
9727 (class Archive): Update declarations.
9728 (Archive::file): New const method.
9729 (class Add_archive_symbols): Add mapfile_ field. Update
9730 constructor. Change all callers.
9731 * readsyms.h (class Read_symbols): Likewise.
9732 (class Finish_group): Likewise.
9733 (class Read_script): Likewise.
9734 * common.cc: Include "mapfile.h".
9735 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9736 all callers.
9737 (Symbol_table::do_allocate_commons): Likewise.
9738 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9739 symbol allocation to mapfile.
9740 * common.h (class Allocate_commons_task): Add mapfile_ field.
9741 Update constructor. Change all callers.
9742 * symtab.h (class Symbol_table): Update declarations.
9743 * layout.cc: Include "mapfile.h".
9744 (Layout_task_runner::run): Print information to mapfile.
9745 (Layout::create_gold_note): Change Output_data_fixed_space to
9746 Output_data_zero_fill.
9747 (Layout::create_build_id): Likewise.
9748 (Layout::print_to_mapfile): New function.
9749 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9750 constructor. Change caller.
9751 (class Layout): Declare print_to_mapfile.
9752 * output.cc (Output_section::Input_section::print_to_mapfile): New
9753 function.
9754 (Output_section::add_input_section): If producing a map, always
9755 add to input_sections_ list.
9756 (Output_section::do_print_to_mapfile): New function.
9757 (Output_segment::print_sections_to_mapfile): New function.
9758 (Output_segment::print_section_list_to_mapfile): New function.
9759 * output.h: Include "mapfile.h".
9760 (Output_data::print_to_mapfile): New function.
9761 (Output_data::do_print_to_mapfile): New virtual function.
9762 (Output_segment_headers::do_print_to_mapfile): New function.
9763 (Output_file_header::do_print_to_mapfile): New function.
9764 (Output_data_const::do_print_to_mapfile): New function.
9765 (class Output_data_const_buffer): Add map_name_ field. Update
9766 constructor. Change all callers. Add do_print_to_mapfile
9767 function.
9768 (class Output_data_fixed_space): Likewise.
9769 (class Output_data_space): Likewise.
9770 (class Output_data_zero_fill): New class.
9771 (Output_data_strtab::do_print_to_mapfile): New function.
9772 (Output_data_reloc_base::do_print_to_mapfile): New function.
9773 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9774 (Output_data_group::do_print_to_mapfile): New function.
9775 (Output_data_got::do_print_to_mapfile): New function.
9776 (Output_data_dynamic::do_print_to_mapfile): New function.
9777 (Output_symtab_xindex::do_print_to_mapfile): New function.
9778 (class Output_section): Declare do_print_to_mapflie. Declare
9779 print_to_mapfile in Input_section.
9780 (class Output_segment): Declare new functions.
9781 * object.h (Sized_relobj::symbol_count): New function.
9782 * script-sections.cc
9783 (Output_section_element_dot_assignment::set_section_addresses):
9784 Change Output_data_fixed_space to Output_data_zero_fill.
9785 (Output_data_expression::do_print_to_mapfile): New function.
9786 * script.cc (read_input_script): Add mapfile parameter. Change
9787 all callers.
9788 * script.h (read_input_script): Update declaration.
9789 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9790 (Eh_frame::do_print_to_mapfile): New function.
9791 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9792 (Output_merge_string::do_print_to_mapfile): New function.
9793 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9794 function.
9795 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9796 function.
9797 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9798 function.
9799 * Makefile.am (CCFILES): Add mapfile.cc.
9800 (HFILES): Add mapfile.h.
9801 * Makefile.in: Rebuild.
9802
9f1d377b
ILT
98032008-05-19 Ian Lance Taylor <iant@google.com>
9804
9805 * options.h (class General_options): Add -z relro.
9806 * layout.cc (Layout::Layout): Initialize relro_segment_.
9807 (Layout::add_output_section_data): Return the output section.
9808 (Layout::make_output_section): Rcognize relro sections and mark
9809 them appropriately.
9810 (Layout::attach_allocated_section_to_segment): Put relro sections
9811 in a PT_GNU_RELRO segment.
9812 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9813 section as relro.
9814 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9815 PT_TLS segments.
9816 (Layout::linkonce_mapping): Map d.rel.ro.local to
9817 .data.rel.ro.local.
9818 (Layout::output_section_name): Us .data.rel.ro.local for any
9819 section which begins with that.
9820 * layout.h (class Layout): Update add_output_section_data
9821 declaration. Add relro_segment_ field.
9822 * output.cc (Output_section::Output_section): Initialize is_relro_
9823 and is_relro_local_ fields.
9824 (Output_segment::add_output_section): Group relro sections.
9825 (Output_segment::is_first_section_relro): New function.
9826 (Output_segment::maximum_alignment): If there is a relro section,
9827 align the segment to the common page size.
9828 (Output_segment::set_section_addresses): Track whether we are
9829 looking at relro sections. If the last section is a relro
9830 section, align to the common page size.
9831 (Output_segment::set_section_list_addresses): Add in_relro
9832 parameter. Change all callers. Align to the page size when
9833 moving from relro to non-relro section.
9834 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9835 segment.
9836 * output.h (class Output_section): Add is_relro_ and
9837 is_relro_local_ fields.
9838 (Output_section::is_relro): New function.
9839 (Output_section::set_is_relro): New function.
9840 (Output_section::is_relro_local): New function.
9841 (Output_section::set_is_relro_local): New function.
9842 (class Output_segment): Update declarations.
9843 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9844 * sparc.cc (Target_sparc::got_section): Likewise.
9845 * x86_64.cc (Target_x86_64::got_section): Likewise.
9846 * testsuite/relro_test_main.cc: New file.
9847 * testsuite/relro_test.cc: New file.
9848 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9849 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9850 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9851 (relro_test.so, relro_test_pic.o): New targets.
9852 * testsuite/Makefile.in: Rebuild.
9853
a984ee1d
ILT
98542008-05-16 Ian Lance Taylor <iant@google.com>
9855
01676dcd
ILT
9856 * output.cc (Output_segment::add_output_section): Remove front
9857 parameter.
9858 * output.h (class Output_segment): Remove
9859 add_initial_output_section and overloaded add_output_section.
9860 Update declaration of remaining add_output_section.
9861 * layout.cc (Layout::create_interp): Call add_output_section
9862 rather than add_initial_output_section.
9863 (Layout::finish_dynamic_section): Likewise.
9864
497897f9
ILT
9865 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9866 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9867 know the dynamic type.
9868 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9869 field. Initialize it in constructor.
9870 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9871 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9872 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9873 reloc.
9874
a984ee1d
ILT
9875 * output.cc (Output_reloc::get_address): Change return type to
9876 Elf_Addr.
9877 * output.h (class Output_reloc): Update get_address declaration.
9878 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9879 for section addresses.
9880
55ba0940
ILT
98812008-05-09 Ian Lance Taylor <iant@google.com>
9882
9883 PR 6493
9884 * gold.cc (gold_nomem): Use return value of write.
9885
75517b77
ILT
98862008-05-08 Ian Lance Taylor <iant@google.com>
9887
9888 * symtab.c (Symbol::init_base_output_data): Add version
9889 parameter. Change all callers.
9890 (Symbol::init_base_output_segment): Likewise.
9891 (Symbol::init_base_constant): Likewise.
9892 (Symbol::init_base_undefined): Likewise.
9893 (Sized_symbol::init_output_data): Likewise.
9894 (Sized_symbol::init_output_segment): Likewise.
9895 (Sized_symbol::init_constant): Likewise.
9896 (Sized_symbol::init_undefined): Likewise.
9897 (Symbol_table::do_define_in_output_data): If the new symbol has a
9898 version, mark it as the default.
9899 (Symbol_table::do_define_in_output_segment): Likewise.
9900 (Symbol_table::do_define_as_constant): Likewise.
9901 * symtab.h (class Symbol): Update declarations.
9902 (class Sized_symbol): Likewise.
9903 * resolve.cc (Symbol::override_version): New function.
c42e122e 9904 (Symbol::override_base): Call override_version.
75517b77
ILT
9905 (Symbol::override_base_with_special): Likewise.
9906 * testsuite/ver_script_8.script: New file.
9907 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9908 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9909 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9910 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9911
f1f70eae
ILT
99122008-05-06 Ian Lance Taylor <iant@google.com>
9913
f3e9c5c5
ILT
9914 PR 6049
9915 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9916 functions.
9917 (class General_options): Remove existing --undefined, and add
9918 --no-undefined instead. Add new --undefined as synonym for -u.
9919 * archive.cc (Archive::add_symbols): Check whether symbol was
9920 named with -u.
9921 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9922 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9923 all uses. Add IS_UNDEFINED. Update declarations to split
9924 different versions of init_base. Declare init_base_undefined.
9925 (Symbol::is_defined): Handle IS_UNDEFINED.
9926 (Symbol::is_undefined): Likewise.
9927 (Symbol::is_weak_undefined): Call is_undefined.
9928 (Symbol::is_absolute): Handle IS_CONSTANT.
9929 (class Sized_symbol): Update declarations to split different
9930 versions of init. Declare init_undefined.
9931 (class Symbol_table): Declare new functions.
9932 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9933 Change all callers.
9934 (Symbol::init_base_output_data): Likewise.
9935 (Symbol::init_base_output_segment): Likewise.
9936 (Symbol::init_base_constant): Likewise.
9937 (Symbol::init_base_undefined): New function.
9938 (Sized_symbol::init_object): Rename from init. Change all
9939 callers.
9940 (Sized_symbol::init_output_data): Likewise.
9941 (Sized_symbol::init_output_segment): Likewise.
9942 (Sized_symbol::init_constant): Likewise.
9943 (Sized_symbol::init_undefined): New function.
9944 (Symbol_table::add_undefined_symbols_from_command_line): New
9945 function.
9946 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9947 function.
9948 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9949 (Symbol::output_section): Likewise.
9950 (Symbol::set_output_section): Likewise.
9951 (Symbol_table::sized_finalize_symbol): Likewise.
9952 (Symbol_table::sized_write_globals): Likewise.
9953 * resolve.cc (Symbol_table::should_override): Likewise.
9954 (Symbol::override_base_with_special): Likewise.
9955
8bdcdf2c
ILT
9956 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9957 symbol, change it to have default visibility.
9958 * testsuite/protected_1.cc: New file.
9959 * testsuite/protected_2.cc: New file.
9960 * testsuite/protected_3.cc: New file.
9961 * testsuite/protected_main_1.cc: New file.
9962 * testsuite/protected_main_2.cc: New file.
9963 * testsuite/protected_main_3.cc: New file.
9964 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9965 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9966 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9967 (protected_1.so): New target.
9968 (protected_1_pic.o, protected_2_pic.o): New targets.
9969 (protected_3_pic.o): New target.
9970 (check_PROGRAMS): Add protected_2.
9971 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9972 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9973 * testsuite/Makefile.in: Rebuild.
9974
2b706932
ILT
9975 * options.h (DEFINE_var): Add set_user_set_##varname__.
9976 (DEFINE_bool_alias): New macro.
9977 (class General_options): Define -Bstatic using DEFINE_bool_alias
9978 rather than DEFINE_special. Add --undefined as an alias for -z
9979 defs.
9980 * options.cc (General_options::parse_Bstatic): Remove.
9981
d82a5bcc
ILT
9982 * options.h (class General_options): Add --fatal-warnings.
9983 * main.cc (main): Implement --fatal-warnings.
9984 * errors.h (Errors::warning_count): New function.
9985
f1f70eae
ILT
9986 * options.h (class General_options): Add -Bsymbolic-functions.
9987 * symtab.h (Symbol::is_preemptible): Check for
9988 -Bsymbolic-functions.
9989
8825ac63
ILT
99902008-05-05 Ian Lance Taylor <iant@google.com>
9991
d98bc257
ILT
9992 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9993 as noVARNAME rather than no-VARNAME.
9994 (class General_options): Add option -z combreloc.
9995 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9996 get_address.
9997 (Output_reloc::sort_before) [SHT_REL]: New function.
9998 (Output_reloc::sort_before) [SHT_RELA]: New function.
9999 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10000 Sort_relocs_comparison.
10001 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10002 parameter. Change all callers.
10003 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10004 sort_relocs parameter. Change all callers.
10005 * output.cc (Output_reloc::get_address): New function, broken out
10006 of write_rel.
10007 (Output_reloc::write_rel): Call it.
10008 (Output_reloc::compare): New function.
10009 (Output_data_reloc_base::do_write): Optionally sort relocs.
10010
60b2b4e7
ILT
10011 * configure.ac: If targ_extra_obj is set, link it in.
10012 * configure.tgt: Initialize all variables.
10013 (x86_64*): Set targ_extra_obj and targ_extra_size.
10014 * configure: Rebuild.
10015
8825ac63
ILT
10016 * object.cc (Sized_relobj::include_section_group): Adjust section
10017 indexes read from group data. Build vector to pass to
10018 layout_group.
10019 * layout.cc (Layout::layout_group): Add flags and shndxes
10020 parameters. Remove contents parameter. Change caller. Update
10021 explicit instantiations.
10022 * layout.h (class Layout): Update layout_group declaration.
10023 * output.cc (Output_data_group::Output_data_group): Add flags and
10024 input_shndxes parameters. Remove contents parameter. Change
10025 caller.
10026 (Output_data_group::do_write): Change input_sections_ to
10027 input_shndxes_.
10028 * output.h (class Output_data_group): Update constructor
10029 declaration. Rename input_sections_ to input_shndxes_.
10030 * testsuite/many_sections_test.cc: Add template.
10031
e94cf127
CC
100322008-04-30 Cary Coutant <ccoutant@google.com>
10033
4418b2d5
CC
10034 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10035
e94cf127
CC
10036 * layout.cc (Layout::include_section): Refactored check for debug
10037 info section.
10038 (Layout::add_comdat): Add new parameters. Change type
10039 of signature parameter. Add object and shndx to signatures table.
10040 (Layout::find_kept_object): New function.
10041 * layout.h: Include <cstring>.
10042 (Layout::is_debug_info_section): New function.
10043 (Layout::add_comdat): Add new parameters.
10044 (Layout::find_kept_object): New function.
10045 (Layout::Kept_section): New struct.
10046 (Layout::Signatures): Change type of map range.
10047 * object.cc (Relobj::output_section_address): New function.
10048 (Sized_relobj::include_section_group): Add new parameters. Change
10049 calls to Layout::add_comdat. Change to build table of kept comdat
10050 groups and table mapping discarded sections to kept sections.
10051 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10052 (Sized_relobj::do_layout): Change calls to include_section_group and
10053 include_linkonce_section.
10054 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10055 value to zero when section is discarded.
10056 (Sized_relobj::map_to_kept_section): New function.
10057 * object.h (Relobj::output_section_address): New function.
10058 (Relobj::Comdat_group): New type.
10059 (Relobj::find_comdat_group): New function.
10060 (Relobj::Comdat_group_table): New type.
10061 (Relobj::Kept_comdat_section): New type.
10062 (Relobj::Kept_comdat_section_table): New type.
10063 (Relobj::add_comdat_group): New function.
10064 (Relobj::set_kept_comdat_section): New function.
10065 (Relobj::get_kept_comdat_section): New function.
10066 (Relobj::comdat_groups_): New field.
10067 (Relobj::kept_comdat_sections_): New field.
10068 (Symbol_value::input_value): Update comment.
10069 (Sized_relobj::map_to_kept_section) New function.
10070 (Sized_relobj::include_linkonce_section): Add new parameter.
10071 * target-reloc.h (Comdat_behavior): New type.
10072 (get_comdat_behavior): New function.
10073 (relocate_section): Add code to map a discarded section to the
10074 corresponding kept section when applying a relocation.
10075
e4e5049b
CS
100762008-04-30 Craig Silverstein <csilvers@google.com>
10077
10078 * dwarf_reader.cc (next_generation_count): New static var.
10079 (Addr2line_cache_entry): New struct.
10080 (addr2line_cache): New static var.
10081 (Dwarf_line_info::one_addr2line): Added caching.
10082 (Dwarf_line_info::clear_addr2line_cache): New function.
10083 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10084 cache-size parameter.
10085 (Dwarf_line_info::one_addr2line_cache): New function.
10086 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10087 new cache-size argument to one_addr2line(), and clear cache.
10088
d09e9154
CC
100892008-04-28 Cary Coutant <ccoutant@google.com>
10090
10091 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10092 R_386_PC8 relocations.
10093
7ef73768
ILT
100942008-04-23 Ian Lance Taylor <iant@google.com>
10095
55438702
ILT
10096 * object.cc (Sized_relobj::include_section_group): Check for
10097 invalid section group.
10098
c165fb93
ILT
10099 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10100 header size.
10101
7ef73768
ILT
10102 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10103 than read for file header.
10104 * archive.cc (Archive::include_member): Likewise.
10105
6194aaab
L
101062008-04-23 Paolo Bonzini <bonzini@gnu.org>
10107
10108 * aclocal.m4: Regenerate.
10109 * configure: Regenerate.
10110
d491d34e
ILT
101112008-04-19 Ian Lance Taylor <iant@google.com>
10112
5ea2bac6
ILT
10113 * version.cc (version_string): Bump to 1.6.
10114
7bc3e21a
ILT
10115 * testsuite/Makefile.am (many_sections_r_test): New target.
10116 (many_sections_r_test_SOURCES): Remove.
10117 (many_sections_r_test_DEPENDENCIES): Remove.
10118 (many_sections_r_test_LDFLAGS): Remove.
10119 (many_sections_r_test_LDADD): Remove.
10120
7fcd3aa9
ILT
10121 * object.cc (Sized_relobj::do_add_symbols): Always pass
10122 local_symbol_count_ to add_from_relobj.
10123
4c94d6ae
ILT
10124 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10125 every thousand variables.
10126 * testsuite/Makefile.in: Rebuild.
10127
d491d34e
ILT
10128 * object.cc (Xindex::initialize_symtab_xindex): New function.
10129 (Xindex::read_symtab_xindex): New function.
10130 (Xindex::sym_xindex_to_shndx): New function.
10131 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10132 available.
10133 (Sized_relobj::do_initialize_xindex): New function.
10134 (Sized_relobj::do_read_symbols): Adjust section links.
10135 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10136 parameter. Change all callers.
10137 (Sized_relobj::include_section_group): Adjust section links and
10138 symbol section indexes.
10139 (Sized_relobj::do_layout): Adjust section links.
10140 (Sized_relobj::do_count_local_symbols): Adjust section links and
10141 symbol section indexes.
10142 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10143 ordinary and special symbols.
10144 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10145 dynsym_xindex parameters. Change all callers. Adjust section
10146 links. Use SHN_XINDEX when needed.
10147 (Sized_relobj::get_symbol_location_info): Adjust section links.
10148 Don't get fooled by special symbols.
10149 * object.h (class Xindex): Define.
10150 (class Object): Add xindex_ parameter. Declare virtual functoin
10151 do_initialize_xindex.
10152 (Object::adjust_sym_shndx): New function.
10153 (Object::set_xindex): New protected function.
10154 (class Symbol_value): Add is_ordinary_shndx_ field.
10155 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10156 (Symbol_value::value): Assert ordinary section.
10157 (Symbol_value::initialize_input_to_output_map): Likewise.
10158 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10159 Change all callers.
10160 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10161 all callers.
10162 (class Sized_relobj): Update declarations.
10163 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10164 parameter. Change all callers.
10165 (Sized_relobj::adjust_shndx): New function.
10166 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10167 field.
10168 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10169 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10170 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10171 (Sized_dynobj::read_dynsym_section): Adjust section links.
10172 (Sized_dynobj::read_dynamic): Likewise.
10173 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10174 section links.
10175 (Sized_dynobj::do_initialize_xindex): New function.
10176 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10177 do_initialize_xindex.
10178 (Sized_dynobj::adjust_shndx): New function.
10179 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10180 dynsym_xindex_ fields.
10181 (Layout::finalize): Add a call to set_section_indexes before
10182 creating the symtab sections.
10183 (Layout::set_section_indexes): Don't do anything if the section
10184 already has a section index.
10185 (Layout::create_symtab_sections): Add shnum parameter. Change
10186 caller. Create .symtab_shndx section if needed.
10187 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10188 caller.
10189 (Layout::allocated_output_section_count): New function.
10190 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10191 needed.
10192 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10193 fields. Update declarations.
10194 (Layout::symtab_xindex): New function.
10195 (Layout::dynsym_xindex): New function.
10196 (class Write_symbols_task): Add layout_ field.
10197 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10198 Change caller.
10199 * output.cc (Output_section_headers::Output_section_headers): Add
10200 shstrtab_section parameter. Change all callers.
10201 (Output_section_headers::do_sized_write): Store overflow values
10202 for section count and section string table section index in
10203 section header zero.
10204 (Output_file_header::do_sized_write): Check for overflow of
10205 section count and section string table section index.
10206 (Output_symtab_xindex::do_write): New function.
10207 (Output_symtab_xindex::endian_do_write): New function.
10208 * output.h (class Output_section_headers): Add shstrtab_section_.
10209 Update declarations.
10210 (class Output_symtab_xindex): Define.
10211 (Output_section::has_out_shndx): New function.
10212 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10213 field.
10214 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10215 Change all callers.
10216 (Sized_symbol::init): Likewise.
10217 (Symbol::output_section): Check for ordinary symbol.
10218 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10219 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10220 callers.
10221 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10222 Change all callers. Simplify handling of symbols from sections
10223 not included in the link.
10224 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10225 distinction.
10226 (Weak_alias_sorter::operator()): Assert that symbols are
10227 ordinary.
10228 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10229 distinction.
10230 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10231 parameters. Change all callers.
10232 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10233 symbol distinction. Use SHN_XINDEX when needed.
10234 (Symbol_table::write_section_symbol): Add symtab_xindex
10235 parameter. Change all callers.
10236 (Symbol_table::sized_write_section_symbol): Likewise. Use
10237 SHN_XINDEX when needed.
10238 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10239 declarations.
10240 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10241 (Symbol::is_defined): Check is_ordinary.
10242 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10243 (Symbol::is_absolute, Symbol::is_common): Likewise.
10244 (class Sized_symbol): Update declarations.
10245 (class Symbol_table): Update declarations.
10246 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10247 parameters. Change all callers.
10248 (Sized_symbol::override): Likewise.
10249 (Symbol_table::override): Likewise.
10250 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10251 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10252 is_ordinary, and orig_st_shndx parameters. Change all callers.
10253 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10254 to be in an ordinary section.
10255 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10256 object and is_ordinary parameters. Change all callers.
10257 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10258 Change all callers. Don't add undefined or non-ordinary symbols
10259 to reloc_map_.
10260 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10261 Change all callers.
10262 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10263 declarations.
10264 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10265 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10266 (Sized_relobj::relocate_sections): Likewise.
10267 * target-reloc.h (scan_relocs): Adjust section symbol index.
10268 (scan_relocatable_relocs): Likewise.
10269 * i386.cc (Scan::local): Check for ordinary symbols.
10270 * sparc.cc (Scan::local): Likewise.
10271 * x86_64.cc (Scan::local): Likewise.
10272 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10273 to symbol_section_and_value.
10274 * testsuite/many_sections_test.cc: New file.
10275 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10276 (check_PROGRAMS): Add many_sections_test.
10277 (many_sections_test_SOURCES): Define.
10278 (many_sections_test_DEPENDENCIES): Define.
10279 (many_sections_test_LDFLAGS): Define.
10280 (BUILT_SOURCES): Add many_sections_define.h.
10281 (many_sections_define.h): New target.
10282 (BUILT_SOURCES): Add many_sections_check.h.
10283 (many_sections_check.h): New target.
10284 (check_PROGRAMS): Add many_sections_r_test.
10285 (many_sections_r_test_SOURCES): Define.
10286 (many_sections_r_test_DEPENDENCIES): Define.
10287 (many_sections_r_test_LDFLAGS): Define.
10288 (many_sections_r_test_LDADD): Define.
10289 (many_sections_r_test.o): New target.
10290 * testsuite/Makefile.in: Rebuild.
10291
c5818ff1
CC
102922008-04-17 Cary Coutant <ccoutant@google.com>
10293
10294 * errors.cc (Errors::info): New function.
10295 (gold_info): New function.
10296 * errors.h (Errors::info): New function.
10297 * gold.h (gold_info): New function.
10298 * object.cc (Input_objects::add_object): Print trace output.
10299 * options.cc (options::parse_set): New function.
10300 (General_options::parse_wrap): Deleted.
10301 (General_options::General_options): Deleted initializer.
10302 * options.h (options::String_set): New typedef.
10303 (options::parse_set): New function.
10304 (DEFINE_set): New macro.
10305 (General_options::wrap): Changed to use DEFINE_set. Changed
10306 callers of any_wrap_symbols and is_wrap_symbol.
10307 (General_options::trace, General_options::trace_symbol):
10308 New options.
10309 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10310 (General_options::wrap_symbols_): Deleted.
10311 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10312
b5be4a7c
DM
103132008-04-17 David S. Miller <davem@davemloft.net>
10314
10315 * options.cc (General_options::parse_V): New function.
10316 * options.h: Add entries for -V and -Qy.
10317
155a0dd7
ILT
103182008-04-17 Ian Lance Taylor <iant@google.com>
10319
10320 * common.cc (Symbol_table::allocate_commons): Remove options
10321 parameter. Change caller.
10322 (Symbol_table::do_allocate_commons): Remove options parameter.
10323 Change caller. Just call do_allocate_commons_list twice.
10324 (Symbol_table::do_allocate_commons_list): New function, broken out
10325 of do_allocate_commons.
10326 * common.h (class Allocate_commons_task): Remove options_ field.
10327 Update constructor.
10328 * symtab.cc (Symbol_table::Symbol_table): Initialize
10329 tls_commons_.
10330 (Symbol_table::add_from_object): Put TLS common symbols on
10331 tls_commons_ list.
10332 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10333 which are IN_OUTPUT_DATA.
10334 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10335 allocate_commons and do_allocate_commons declarations. Declare
10336 do_allocate_commons_list.
10337 * gold.cc (queue_middle_tasks): Update creation of
10338 Allocate_commons_task to not pass options.
10339 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10340 (TLS_TEST_C_FLAGS): New variable.
10341 (tls_test_c_pic.o): New target.
10342 (tls_test_shared.so): Link in tls_test_c_pic.o.
10343 (tls_test_c_pic_ie.o): New target.
10344 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10345 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10346 (tls_test_c.o): New target.
10347 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10348 (tls_pic_test_LDADD): Likewise.
10349 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10350 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10351 (tls_test_c_gnu2.o): New target.
10352 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10353 tls_test_c_gnu2.o.
10354 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10355 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10356 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10357 * testsuite/tls_test.cc: Include "config.h".
10358 (t_last): Call t11_last.
10359 * testsuite/tls_test.h (t11, t11_last): Declare.
10360 * testsuite/tls_test_c.c: New file.
10361 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10362 * configure.ac: Check for OpenMP support.
10363 * configure, config.in, Makefile.in: Rebuild.
10364 * testsuite/Makefile.in: Rebuild.
10365
edfbb029
CC
103662008-04-16 Cary Coutant <ccoutant@google.com>
10367
10368 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10369 (Target_i386::tls_base_symbol_defined_): New field.
10370 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10371 (Target_i386::Scan::global): Likewise.
10372 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10373 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10374 (Target_x86_64::tls_base_symbol_defined_): New field.
10375 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10376 (Target_x86_64::Scan::global): Likewise.
10377
f3c69fca
CC
103782008-04-16 Cary Coutant <ccoutant@google.com>
10379
10380 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10381 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10382 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10383 building shared libraries.
10384 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10385 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10386 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10387 * testsuite/Makefile.in: Rebuild.
10388 * testsuite/weak_undef.h: New file.
10389 * testsuite/weak_undef_file1.cc: Add extra test cases.
10390 * testsuite/weak_undef_file2.cc: Likewise.
10391 * testsuite/weak_undef_test.cc: Likewise.
10392
7c414435
DM
103932008-04-16 David S. Miller <davem@davemloft.net>
10394
32b769e1
DM
10395 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10396 Add issued_non_pic_error_ field. Declare check_non_pic.
10397 (Target_sparc::Scan::check_non_pic): New function.
10398 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10399 (Target_sparc::Scan::global): Likewise.
10400
11936fb1
DM
10401 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10402 * configure: Rebuild.
10403
7c414435
DM
10404 * options.h (DEFINE_enable): New macro.
10405 (new_dtags): New enable option.
10406 (initfirst, interpose, loadfltr, nodefaultlib,
10407 nodelete, nodlopen, nodump): New -z options.
10408 * layout.cc (Layout:finish_dynamic_section): If new
10409 dtags enabled, emit DT_RUNPATH. Also, emit a
10410 DT_FLAGS_1 containing any specified -z flags.
10411
85c7bf8b
ILT
104122008-04-16 Ian Lance Taylor <iant@google.com>
10413
12c0daef
ILT
10414 * copy-relocs.cc: New file.
10415 * copy-relocs.h: New file.
10416 * reloc.cc: Remove Copy_relocs code.
10417 * reloc.h: Likewise.
10418 * reloc-types.h (struct Reloc_types) [both versions]: Add
10419 get_reloc_addend_noerror.
10420 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10421 variants of add_global which take an addend which must be zero.
10422 * i386.cc: Include "copy-relocs.h".
10423 (class Target_i386): Change type of copy_relocs_ to variable,
10424 update initializer.
10425 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10426 Change all callers.
10427 (Target_i386::do_finalize_sections): Change handling of
10428 copy_relocs_.
10429 * sparc.cc: Include "copy-relocs.h".
10430 (class Target_sparc): Change type of copy_relocs_ to variable,
10431 update initializer.
10432 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10433 Change all callers.
10434 (Target_sparc::do_finalize_sections): Change handling of
10435 copy_relocs_.
10436 * x86_64.cc: Include "copy-relocs.h".
10437 (class Target_x86_64): Change type of copy_relocs_ to variable,
10438 update initializer.
10439 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10440 class. Change all callers.
10441 (Target_x86_64::do_finalize_sections): Change handling of
10442 copy_relocs_.
10443 * Makefile.am (CCFILES): Add copy-relocs.cc.
10444 (HFILES): Add copy-relocs.h.
10445
4f4995b6
ILT
10446 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10447
85c7bf8b
ILT
10448 * testsuite/script_test_4.sh: Permit leading zeroes.
10449
4f2a9edd
ILT
104502008-04-15 Ian Lance Taylor <iant@google.com>
10451
e6188289
ILT
10452 * script-sections.cc (Script_sections::create_segments): Use
10453 header_size_adjustment even when there is enough room for the
10454 headers.
10455 * testsuite/script_test_4.sh: New file.
10456 * testsuite/script_test_4.t: New file.
10457 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10458 (check_DATA): Add script_test_4.stdout.
10459 (MOSTLYCLEANFILES): Likewise.
10460 (script_test_4): New target.
10461 (script_test_4.stdout): New target.
10462 * testsuite/Makefile.in: Rebuild.
10463
4f2a9edd
ILT
10464 * sparc.cc: Add definitions for Output_data_plt_sparc class
10465 constants.
10466
f5314dd5
DM
104672008-04-14 David S. Miller <davem@davemloft.net>
10468
10469 * sparc.cc: New file.
10470 * Makefile.am (TARGETSOURCES): Add sparc.cc
10471 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10472 * configure.tgt: Document targ_extra_size and
10473 targ_extra_big_endian. Add entries for sparc-* and
10474 sparc64-*.
10475 * configure.ac: Handle targ_extra_size and
10476 targ_extra_big_endian.
10477 * Makefile.in: Rebuild.
10478 * configure: Likewise.
10479 * po/POTFILES.in: Likewise.
10480 * po/gold.pot: Likewise.
10481
154e0e9a
ILT
104822008-04-14 Ian Lance Taylor <iant@google.com>
10483
10484 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10485 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10486 in the name/type/flags to section mapping. Don't call
10487 allocate_output_section.
10488 (Layout::choose_output_section): Change parameter from adjust_name
10489 to is_input_section. Don't permit input sections after sections
10490 are attached to segments. Don't call allocate_output_section.
10491 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10492 not write_enable_output_section.
10493 (Layout::make_output_section): Don't push to
10494 unattached_section_list_ nor call attach_to_segment. Call
10495 attach_section_to_segment if sections are attached.
10496 (Layout::attach_sections_to_segments): New function.
10497 (Layout::attach_section_to_segment): New function.
10498 (Layout::attach_allocated_section_to_segment): Rename from
10499 attach_to_segment. Remove flags parameter.
10500 (Layout::allocate_output_section): Remove function.
10501 (Layout::write_enable_output_section): Remove function.
10502 * layout.h (class Layout): Update for above changes. Add new
10503 field sections_are_attached_.
10504 * output.h (Output_section::update_flags_for_input_section): New
10505 function.
10506 * output.cc (Output_section::add_input_section): Call
10507 update_flags_for_input_section.
10508 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10509
009a67a2
CC
105102008-04-11 Cary Coutant <ccoutant@google.com>
10511
10512 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10513 thought unnecessary.
10514 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10515
759b1a24
ILT
105162008-04-11 Ian Lance Taylor <iant@google.com>
10517
10518 * output.h (class Output_section_data): Remove inline definition
10519 of set_addralign.
10520 * output.cc (Output_section_data::set_addralign): New function.
10521
c2b45e22
CC
105222008-04-11 Cary Coutant <ccoutant@google.com>
10523
10524 Add support for TLS descriptors for i386 and x86_64.
10525 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10526 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10527 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10528 GOT_TYPE_TLS_DESC.
10529 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10530 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10531 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10532 relocations.
10533 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10534 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10535 Fix problem with initial-exec relocations.
10536 (Target_i386::Relocate::relocate_tls): Likewise.
10537 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10538 relaxation.
10539 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10540 support for section-plus-offset dynamic table entries.
10541 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10542 (Output_data_dynamic::Dynamic_entry): Add support for
10543 section-plus-offset dynamic table entries.
10544 (Output_data_dynamic::Classification): Likewise.
10545 (Output_data_dynamic::classification_): Renamed offset_.
10546 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10547 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10548 (Target_x86_64::make_plt_section): New function.
10549 (Target_x86_64::reserve_tlsdesc_entries): New function.
10550 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10551 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10552 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10553 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10554 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10555 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10556 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10557 add extra PLT entry for TLS descriptors.
10558 (Output_data_plt_x86_64::got_): New field.
10559 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10560 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10561 fields.
10562 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10563 descriptors.
10564 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10565 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10566 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10567 R_386_TLS_DESC_CALL relocations.
10568 (Target_x86_64::Scan::global): Likewise.
10569 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10570 for TLS descriptors.
10571 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10572 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10573 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10574 GD-to-IE relaxation.
10575 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10576 and TLS_DESCRIPTORS.
10577 * Makefile.in: Rebuild.
10578 * configure: Rebuild.
10579 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10580 (tls_test_shared2.so): New target.
10581 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10582 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10583 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10584 (tls_shared_gd_to_ie_test_LDADD): New variable.
10585 (tls_shared_gnu2_gd_to_ie_test): New target.
10586 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10587 New targets.
10588 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10589 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10590 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10591 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10592 (tls_shared_gnu2_test): New target.
10593 (tls_test_gnu2_shared.so): New target.
10594 (tls_shared_gnu2_test_SOURCES): New variable.
10595 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10596 (tls_shared_gnu2_test_LDFLAGS): New variable.
10597 (tls_shared_gnu2_test_LDADD): New variable.
10598 * testsuite/Makefile.in: Rebuild.
10599 * testsuite/Makefile.
10600
83bfb6b7
ILT
106012008-04-11 Ian Lance Taylor <iant@google.com>
10602
10603 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10604 justsyms.t.
10605 * testsuite/Makefile.in: Rebuild.
10606
10607 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10608 long.
10609 * testsuite/script_test_2.cc (main): Adjust test.
10610
706e1f5e
ILT
106112008-04-11 David S. Miller <davem@davemloft.net>
10612 Ian Lance Taylor <iant@google.com>
10613
10614 * options.h (General_options): Add entries for '-Y' and
10615 '-relax'.
10616 * options.cc (General_options:finalize): If -Y was used, add those
10617 entries to the library path instead of the default "/lib" and
10618 "/usr/lib".
10619
7c98e6bb
DM
106202008-04-11 David S. Miller <davem@davemloft.net>
10621
10622 * testsuite/justsyms.t: Start at 0x100.
10623 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10624 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10625 long.
10626 * testsuite/script_test_2.cc: Adjust string and section length
10627 checks.
7c98e6bb 10628
99a37bfd
ILT
106292008-04-09 Ian Lance Taylor <iant@google.com>
10630
2cefc357
ILT
10631 PR gold/5996
10632 * script-sections.cc (Sections_element::allocate_to_segment): Add
10633 orphan parameter.
10634 (Output_section_definition::allocate_to_segment): Likewise.
10635 (Orphan_output_section::allocate_to_segment): Likewise.
10636 (Script_sections::attach_sections_using_phdrs_clause): Don't
10637 propagate non-PT_LOAD segments to orphan sections.
10638 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10639 readelf rather than objdump.
10640 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10641 .interp section and PT_INTERP segment are the same size.
10642 * testsuite/Makefile.in: Rebuild.
10643
99a37bfd
ILT
10644 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10645 aliases for symbols defined in the same object.
10646 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10647 (weak_alias_test_SOURCES): New variable.
10648 (weak_alias_test_DEPENDENCIES): New variable.
10649 (weak_alias_test_LDFLAGS): New variable.
10650 (weak_alias_test_LDADD): New variable.
10651 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10652 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10653 (weak_alias_test_3.o): New target.
10654 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10655 * testsuite/weak_alias_test_main.cc: New file.
10656 * testsuite/weak_alias_test_1.cc: New file.
10657 * testsuite/weak_alias_test_2.cc: New file.
10658 * testsuite/weak_alias_test_3.cc: New file.
10659
780e49c5
ILT
106602008-04-08 Ian Lance Taylor <iant@google.com>
10661
cdb0b8f5
ILT
10662 * options.h (class General_options): Add --noinhibit-exec option.
10663 * main.cc (main): Check --noinhibit-exec.
10664
0864d551
ILT
10665 * options.h (class General_options): Define --wrap as a special
10666 option. Add wrap_symbols_ field.
10667 (General_options::any_wrap_symbols): New function.
10668 (General_options::is_wrap_symbol): New function.
10669 * options.cc (General_options::parse_wrap): New function.
10670 (General_options::General_options): Initialize wrap_symbols_.
10671 * symtab.cc (Symbol_table::wrap_symbol): New function.
10672 (Symbol_table::add_from_object): Handle --wrap.
10673 * symtab.h (class Symbol_table): Declare wrap_symbol.
10674 * target.h (Target::wrap_char): New function.
10675 (Target::Target_info): Add wrap_char field.
10676 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10677 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10678 * testsuite/testfile.cc (Target_test::test_target_info):
10679 Likewise.
10680
789aa6de
ILT
10681 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10682 there is one.
10683
2c38906f
ILT
10684 * layout.h (class Layout): Add added_eh_frame_data_ field.
10685 * layout.cc (Layout::Layout): Initialize new field.
10686 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10687 output section until we find a section we merged successfully.
10688 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10689 that the size be non-zero.
10690
780e49c5
ILT
10691 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10692 qualifier.
10693
7fcd0256
ILT
106942008-04-08 Craig Silverstein <csilvers@google.com>
10695
10696 * configure.ac: Export new conditional variable HAVE_ZLIB.
10697 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10698 on HAVE_ZLIB.
10699 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10700 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10701
6835af53
ILT
107022008-04-07 Ian Lance Taylor <iant@google.com>
10703
e24f324c
ILT
10704 * version.cc (version_string): Set to "1.5".
10705
a036edd8
ILT
10706 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10707 Add issued_non_pic_error_ field. Declare check_non_pic.
10708 (Target_x86_64::Scan::check_non_pic): New function.
10709 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10710 (Target_x86_64::Scan::global): Likewise.
10711
624f8810
ILT
10712 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10713 addend parameter. Change caller. Handle merge sections.
10714 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10715 Address to Addend. Don't add in the result of
10716 local_section_offset, pass down the addend and use the returned
10717 value.
10718 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10719 Update declarations of local_section_offset and symbol_value.
10720 * testsuite/two_file_test_1.cc (t18): New function.
10721 * testsuite/two_file_test_2.cc (f18): New function.
10722 * testsuite/two_file_test_main.cc (main): Call t18.
10723 * testsuite/two_file_test.h (t18, f18): Declare.
10724
6835af53
ILT
10725 * configure.ac: Don't test for objdump, c++filt, or readelf.
10726 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10727 conditionals.
10728 (TEST_READELF): New variable.
10729 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10730 (check_PROGRAMS): Add two_file_strip_test.
10731 (two_file_strip_test): New target.
10732 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10733 (two_file_same_shared_strip_test_SOURCES): New variable.
10734 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10735 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10736 (two_file_same_shared_strip_test_LDADD): New variable.
10737 (two_file_shared_strip.so): New target.
10738 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10739 (ver_test_5.syms, ver_test_7.syms): Likewise.
10740 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10741 (strip_test_3.stdout): Use TEST_OBJDUMP.
10742 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10743
86925eef
CC
107442008-04-04 Cary Coutant <ccoutant@google.com>
10745
10746 * symtab.h (Symbol::is_weak_undefined): New function.
10747 (Symbol::is_strong_undefined): New function.
10748 (Symbol::is_absolute): New function.
10749 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10750 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10751 absolute symbols.
10752 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10753 (weak_undef_test): New target.
10754 * testsuite/Makefile.in: Rebuild.
10755 * testsuite/weak_undef_file1.cc: New file.
10756 * testsuite/weak_undef_file2.cc: New file.
10757 * testsuite/weak_undef_test.cc: New file.
10758
126f3ece
ILT
107592008-04-03 Craig Silverstein <csilvers@google.com>
10760
10761 * compressed_output.h (class Output_compressed_section): Use
10762 unsigned buffer.
10763 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10764 add zlib header.
10765 (zlib_compressed_suffix): Removed.
10766 (Output_compressed_section::set_final_data_size): Use unsigned
10767 buffers.
10768 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10769 Fix linker invocation.
10770 (flagstest_o_specialfile_and_compress_debug_sections):
10771 Likewise.
10772 * testsuite/Makefile.in: Regenerated.
10773
deae2a14
DM
107742008-04-02 David S. Miller <davem@davemloft.net>
10775
10776 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10777 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10778
70752818
ILT
107792008-04-02 Craig Silverstein <csilvers@google.com>
10780
10781 * TODO: New file.
10782
39d0cb0e
ILT
107832008-04-02 Ian Lance Taylor <iant@google.com>
10784
10785 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10786 parameters. Update for new key type to views_. Change all
10787 callers.
10788 (File_read::read): Adjust for byteshift in returned view.
10789 (File_read::add_view): New function, broken out of
10790 find_and_make_view.
10791 (File_read::make_view): New function, broken out of
10792 find_and_make_view.
10793 (File_read::find_or_make_view): Add offset and aligned
10794 parameters. Rewrite accordingly. Change all callers.
10795 (File_read::get_view): Add offset and aligned parameters. Adjust
10796 for byteshift in return value.
10797 (File_read::get_lasting_view): Likewise.
10798 * fileread.h (class File_read): Update declarations.
10799 (class File_read::View): Add byteshift_ field. Add byteshift to
10800 constructor. Add byteshift method.
10801 * archive.h (Archive::clear_uncached_views): New function.
10802 (Archive::get_view): Add aligned parameter. Change all callers.
10803 * object.h (Object::get_view): Add aligned parameter. Change all
10804 callers.
10805 (Object::get_lasting_view): Likewise.
10806
10807 * fileread.cc (File_read::release): Don't call clear_views if
10808 there are multiple objects.
10809 * fileread.h (File_read::clear_uncached_views): New function.
10810 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10811 on the archive.
10812
a1207466
CC
108132008-03-31 Cary Coutant <ccoutant@google.com>
10814
10815 Add thin archive support.
10816 * archive.cc (Archive::armagt): New const.
10817 (Archive::setup): Remove task parameter and calls to unlock.
10818 (Archive::unlock_nested_archives): New function.
10819 (Archive::read_header): Add nested_off parameter. Change
10820 all callers.
10821 (Archive::interpret_header): Likewise.
10822 (Archive::include_all_members): Change to handle thin
10823 archives.
10824 (Archive::include_member): Likewise.
10825 * archive.h (Archive::Archive): Add new parameters and
10826 initializers.
10827 (Archive::armagt): New const.
10828 (Archive::setup): Remove task parameter.
10829 (Archive::unlock_nested_archives): New function.
10830 (Archive::read_header): Add nested_off parameter.
10831 (Archive::interpret_header): Likewise.
10832 (Archive::Nested_archive_table): New typedef.
10833 (Archive::is_thin_archive_): New field.
10834 (Archive::nested_archives_): New field.
10835 (Archive::options_): New field.
10836 (Archive::dirpath_): New field.
10837 (Archive::task_): New field.
10838 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10839 for thin archives. Pass additional parameters to
10840 Archive::Archive. Unlock the archive file after calling
10841 Archive::setup.
cd536b21 10842
479f6503
ILT
108432008-03-29 Ian Lance Taylor <iant@google.com>
10844
686c8caf
ILT
10845 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10846 version symbol to be local.
10847 * testsuite/ver_test_4.sh: New file.
10848 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10849 (check_DATA): Add ver_test_4.syms.
10850 (ver_test_4.syms): New target.
10851 * testsuite/Makefile.in: Rebuild.
10852
ab794b6b
ILT
10853 * output.cc
10854 (Output_section::Input_section_sort_entry::has_priority): New
10855 function.
10856 (Output_section::Input_section_sort_entry::match_file_name): New
10857 function.
10858 (Output_section::Input_section_sort_entry::match_section_name):
10859 Remove.
10860 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10861 Remove.
10862 (Output_section::Input_section_sort_entry::match_section_file):
10863 Remove.
10864 (Output_section::Input_section_sort_compare::operator()): Rewrite
10865 using new Input_section_sort_entry functions. Sort crtbegin and
10866 crtend first. Sort sections with no priority before sections with
10867 a priority.
10868 * testsuite/initpri1.c (d3): Check j != 4.
10869 (cd5): New constructor/destructor function.
10870 (main): Check j != 2.
10871
479f6503
ILT
10872 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10873 new symbol when resolving, don't call set_is_default.
10874 * testsuite/ver_test_7.cc: New file.
10875 * testsuite/ver_test_7.sh: New file.
10876 * testsuite/Makefile.am (ver_test_7.so): New target.
10877 (ver_test_7.o): New target.
10878 (check_SCRIPTS): Add ver_test_7.sh.
10879 (check_DATA): Add ver_test_7.syms.
10880 (ver_test_7.syms): New target.
10881
2fd32231
ILT
108822008-03-28 Ian Lance Taylor <iant@google.com>
10883
10884 * layout.cc (Layout::layout): If we see an input section with a
10885 name that needs sorting, set the must_sort flag for the output
10886 section.
10887 (Layout::make_output_section): If the name of the output section
10888 indicates that it might require sorting, set the may_sort flag.
10889 * output.h (Output_section::may_sort_attached_input_sections): New
10890 function.
10891 (Output_section::set_may_sort_attached_input_sections): New
10892 function.
10893 (Output_section::must_sort_attached_input_sections): New
10894 function.
10895 (Output_section::set_must_sort_attached_input_sections): New
10896 function.
10897 (class Output_section): Declare Input_section_sort_entry. Define
10898 Input_section_sort_compare. Declare
10899 sort_attached_input_sections. Add new fields:
10900 may_sort_attached_input_sections_,
10901 must_sort_attached_input_sections_,
10902 attached_input_sections_are_sorted_.
10903 * output.cc (Output_section::Output_section): Initialize new
10904 fields.
10905 (Output_section::add_input_section): Add an entry to
10906 input_sections_ if may_sort or must_sort are true.
10907 (Output_section::set_final_data_size): Call
10908 sort_attached_input_sections if necessary.
10909 (Output_section::Input_section_sort_entry): Define new class.
10910 (Output_section::Input_section_sort_compare::operator()): New
10911 function.
10912 (Output_section::sort_attached_input_sections): New function.
10913 * configure.ac: Check whether the compiler supports constructor
10914 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10915 * testsuite/initpri1.c: New file.
10916 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10917 CONSTRUCTOR_PRIORITY.
10918 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10919 (initpri1_LDFLAGS): New variable.
10920 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10921
18e6b24e
ILT
109222008-03-27 Ian Lance Taylor <iant@google.com>
10923
49bdd526
ILT
10924 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10925 * testsuite/common_test_1.c: New file.
10926 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10927 (common_test_1_SOURCES): New variable.
10928 (common_test_1_DEPENDENCIES): New variable.
10929 (common_test_1_LDFLAGS): New variable.
10930
18e6b24e
ILT
10931 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10932 and commons_ correctly when NAME/VERSION does not override
10933 NAME/NULL.
10934 * testsuite/ver_test_6.c: New file.
10935 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10936 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10937 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10938
04bf7072
ILT
109392008-03-26 Ian Lance Taylor <iant@google.com>
10940
5871526f
ILT
10941 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10942 of an undefined symbol from a version script.
10943 * testsuite/Makefile.am (ver_test_5.so): New target.
10944 (ver_test_5.o): New target.
10945 (check_SCRIPTS): Add ver_test_5.sh.
10946 (check_DATA): Add ver_test_5.syms.
10947 (ver_test_5.syms): New target.
10948 * testsuite/ver_test_5.cc: New file.
10949 * testsuite/ver_test_5.script: New file.
10950 * testsuite/ver_test_5.sh: New file.
10951 * Makefile.in, testsuite/Makefile.in: Rebuild.
10952
04bf7072
ILT
10953 PR gold/5986
10954 Fix problems building gold with gcc 4.3.0.
10955 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10956 (gold_error_at_location, gold_warning_at_location): Use it.
10957 * configure.ac: Check whether we can compile and use a template
10958 function with a printf attribute.
10959 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10960 when jumping over bytes.
10961 * object.cc: Instantiate Object::read_section_data.
10962 * debug.h: Include <cstring>
10963 * dwarf_reader.cc: Include <algorithm>
10964 * main.cc: Include <cstring>.
10965 * options.cc: Include <cstring>.
10966 * output.cc: Include <cstring>.
10967 * script.cc: Include <cstring>.
10968 * script.h: Include <string>.
10969 * symtab.cc: Include <cstring> and <algorithm>.
10970 * target-select.cc: Include <cstring>.
10971 * version.cc: Include <string>.
10972 * testsuite/testmain.cc: Include <cstdlib>.
10973 * configure, config.in: Rebuild.
10974
874c5b28
ILT
109752008-03-25 Ian Lance Taylor <iant@google.com>
10976
819d6c3a
ILT
10977 * options.cc: Include "../bfd/bfdver.h".
10978 (options::help): Print bug reporting address.
10979
f4b2c6f5
ILT
10980 * version.cc (print_version): Adjust output for current value of
10981 BFD_VERSION_STRING.
10982
10983 * NEWS: New file.
10984
e96caa79
ILT
10985 * options.cc (options::help): Print list of supported targets.
10986 * target-select.h: Include <vector>.
10987 (class Target_selector): Make machine_, size_, and is_big_endian_
10988 fields const. Add bfd_name_ and instantiated_target_ fields.
10989 (Target_selector::Target_selector): Add bfd_name parameter.
10990 (Target_selector::recognize): Make non-virtual, call
10991 do_recognize.
10992 (Target_selector::recognize_by_name): Make non-virtual, call
10993 do_recognize_by_name.
10994 (Target_selector::supported_names): New function.
10995 (Target_selector::bfd_name): New function.
10996 (Target_selector::do_instantiate_target): New pure virtual
10997 function.
10998 (Target_selector::do_recognize): New virtual function.
10999 (Target_selector::do_recognize_by_name): New virtual function.
11000 (Target_selector::instantiate_target): New private function.
11001 (supported_target_names): Declare.
11002 * target-select.cc (Target_selector::Target_selector): Update for
11003 new parameter and fields.
11004 (select_target_by_name): Check that the name matches before
11005 calling recognize_by_name.
11006 (supported_target_names): New function.
11007 * i386.cc (class Target_selector_i386): Update Target_selector
11008 constructor call. Remove recognize and recognize_by_name. Add
11009 do_instantiate_target.
11010 * x86_64.cc (class Target_selector_x86_64): Likewise.
11011 * testsuite/testfile.cc (class Target_selector_test): Update for
11012 changes to Target_selector.
11013
874c5b28
ILT
11014 * README: Rewrite, with some notes on unsupported features.
11015
0a65a3a7
CC
110162008-03-24 Cary Coutant <ccoutant@google.com>
11017
11018 * i386.cc (Target_i386::Got_type): New enum declaration.
11019 (Target_i386::Scan::local): Updated callers of Output_data_got
11020 member functions.
11021 (Target_i386::Scan::global): Likewise.
11022 (Target_i386::Relocate::relocate): Likewise.
11023 (Target_i386::Relocate::relocate_tls): Likewise.
11024 * object.h (Got_offset_list): New class.
11025 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11026 (Sized_relobj::local_got_offset): Likewise.
11027 (Sized_relobj::set_local_got_offset): Likewise.
11028 (Sized_relobj::local_has_tls_got_offset): Removed.
11029 (Sized_relobj::local_tls_got_offset): Removed.
11030 (Sized_relobj::set_local_tls_got_offset): Removed.
11031 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11032 * output.cc (Output_data_got::add_global): Added got_type parameter.
11033 (Output_data_got::add_global_with_rel): Likewise.
11034 (Output_data_got::add_global_with_rela): Likewise.
11035 (Output_data_got::add_global_pair_with_rel): New function.
11036 (Output_data_got::add_global_pair_with_rela): New function.
11037 (Output_data_got::add_local): Added got_type parameter.
11038 (Output_data_got::add_local_with_rel): Likewise.
11039 (Output_data_got::add_local_with_rela): Likewise.
11040 (Output_data_got::add_local_pair_with_rel): New function.
11041 (Output_data_got::add_local_pair_with_rela): New function.
11042 (Output_data_got::add_global_tls): Removed.
11043 (Output_data_got::add_global_tls_with_rel): Removed.
11044 (Output_data_got::add_global_tls_with_rela): Removed.
11045 (Output_data_got::add_local_tls): Removed.
11046 (Output_data_got::add_local_tls_with_rel): Removed.
11047 (Output_data_got::add_local_tls_with_rela): Removed.
11048 * output.h (Output_data_got::add_global): Added got_type parameter.
11049 (Output_data_got::add_global_with_rel): Likewise.
11050 (Output_data_got::add_global_with_rela): Likewise.
11051 (Output_data_got::add_global_pair_with_rel): New function.
11052 (Output_data_got::add_global_pair_with_rela): New function.
11053 (Output_data_got::add_local): Added got_type parameter.
11054 (Output_data_got::add_local_with_rel): Likewise.
11055 (Output_data_got::add_local_with_rela): Likewise.
11056 (Output_data_got::add_local_pair_with_rel): New function.
11057 (Output_data_got::add_local_pair_with_rela): New function.
11058 (Output_data_got::add_global_tls): Removed.
11059 (Output_data_got::add_global_tls_with_rel): Removed.
11060 (Output_data_got::add_global_tls_with_rela): Removed.
11061 (Output_data_got::add_local_tls): Removed.
11062 (Output_data_got::add_local_tls_with_rel): Removed.
11063 (Output_data_got::add_local_tls_with_rela): Removed.
11064 * resolve.cc (Symbol::override_base_with_special): Removed
11065 reference to has_got_offset_ field.
11066 * symtab.cc (Symbol::init_fields): Replaced initialization
11067 of got_offset_ with got_offsets_. Removed initialization
11068 of has_got_offset_
53fcba31 11069 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11070 (Symbol::got_offset): Likewise.
11071 (Symbol::set_got_offset): Likewise.
11072 (Symbol::has_tls_got_offset): Removed.
11073 (Symbol::tls_got_offset): Removed.
11074 (Symbol::set_tls_got_offset): Removed.
11075 (Symbol::got_offset_): Removed.
11076 (Symbol::tls_mod_got_offset_): Removed.
11077 (Symbol::tls_pair_got_offset_): Removed.
11078 (Symbol::got_offsets_): New field.
11079 (Symbol::has_got_offset): Removed.
11080 (Symbol::has_tls_mod_got_offset): Removed.
11081 (Symbol::has_tls_pair_got_offset): Removed.
11082 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11083 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11084 member functions.
11085 (Target_x86_64::Scan::global): Likewise.
11086 (Target_x86_64::Relocate::relocate): Likewise.
11087 (Target_x86_64::Relocate::relocate_tls): Likewise.
11088
bd52eafb
BE
110892008-03-25 Ben Elliston <bje@au.ibm.com>
11090
11091 * yyscript.y: Fix spelling error in comment.
11092
8b105e34
ILT
110932008-03-24 Ian Lance Taylor <iant@google.com>
11094
8ed814a9
ILT
11095 * options.h (class General_options): Define build_id option.
11096 * layout.h (class Layout): Declare write_build_id, create_note,
11097 create_build_id. Add build_id_note_ member.
11098 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11099 "libiberty.h", "md5.h", "sha1.h".
11100 (Layout::Layout): Initialize eh_frame_data_,
11101 eh_frame_hdr_section_, and build_id_note_.
11102 (Layout::finalize): Call create_build_id.
11103 (Layout::create_note): New function, broken out of
11104 Layout::create_gold_note.
11105 (Layout::create_gold_note): Call create_note.
11106 (Layout::create_build_id): New function.
11107 (Layout::write_build_id): New function.
11108 (Close_task_runner::run): Call write_build_id.
11109
8b105e34
ILT
11110 * x86_64.cc: Correct license to GPLv3.
11111
086a1841
ILT
111122008-03-23 Ian Lance Taylor <iant@google.com>
11113
11114 * options.cc: Include "demangle.h".
11115 (parse_optional_string): New function.
11116 (parse_long_option): Handle takes_optional_argument.
11117 (parse_short_option): Update dash_z initializer. Handle
11118 takes_optional_argument.
11119 (General_options::General_options): Initialize do_demangle_.
11120 (General_options::finalize): Set do_demangle_. Handle demangling
11121 style.
11122 * options.h (parse_optional_string): Declare.
11123 (struct One_option): Add optional_arg field. Update constructor.
11124 Update call constructor calls. Add takes_optional_argument
11125 function.
11126 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11127 (DEFINE_optional_string): Define.
11128 (General_options::demangle): Change from DEFINE_bool to
11129 DEFINE_optional_string.
11130 (General_options::no_demangle): New function.
11131 (General_options::do_demangle): New function.
11132 (General_options::set_do_demangle): New function.
11133 (General_options::execstack_status_): Move definition to end of
11134 class definition.
11135 (General_options::static_): Likewise.
11136 (General_options::do_demangle_): New field.
11137 * object.cc (big_endian>::get_symbol_location_info): Call
11138 Options::do_demangle, not Options::demangle.
11139 * symtab.cc (demangle): Likewise.
11140
cbb93e63
ILT
111412008-03-22 Ian Lance Taylor <iant@google.com>
11142
11143 * gold.h: Include <cstddef> and <sys/types.h>
11144 * options.h: Include <cstring>.
11145
ec531623
ILT
111462008-03-21 Ian Lance Taylor <iant@google.com>
11147
11148 * Added source code to GNU binutils.
This page took 0.639564 seconds and 4 git commands to generate.