* x86_64.cc (check_non_pic): Add gsym parameter. Change all
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a29b0dad
ILT
12011-06-17 Ian Lance Taylor <iant@google.com>
2
3 * x86_64.cc (check_non_pic): Add gsym parameter. Change all
4 callers. Don't issue warning about PC32 against locally defined
5 symbol.
6
9d3b0698
ILT
72011-06-16 Ian Lance Taylor <iant@google.com>
8
9 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
10 occurs in same object.
11
85b0f90c
AM
122011-06-14 Alan Modra <amodra@gmail.com>
13
14 * po/POTFILES.in: Regenerate.
15
a94907d9
ILT
162011-06-09 Ian Lance Taylor <iant@google.com>
17
18 * script-sections.cc
19 (Orphan_output_section::set_section_addresses): For a relocatable
20 link set address to 0.
21
4fb3a1c3
CC
222011-06-09 Cary Coutant <ccoutant@google.com>
23
24 PR gold/12804
25 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
26 used with --compress-debug-sections.
27 * gold/object.cc (Sized_relobj_file::do_layout): Report
28 uncompressed size of compressed input sections.
29
61220854
CC
302011-06-08 Cary Coutant <ccoutant@google.com>
31
32 PR gold/12804
33 * testsuite/two_file_test_2_v1.cc: Change initialization of
34 v2 to keep it in .data.
35
e6455dfb
CC
362011-06-07 Cary Coutant <ccoutant@google.com>
37
38 * common.cc (Symbol_table::do_allocate_commons_list): Call
39 gold_fallback.
40 * errors.cc (Errors::fatal): Adjust call to gold_exit.
41 (Errors::fallback): New function.
42 (gold_fallback): New function.
43 * errors.h (Errors::fallback): New function.
44 * gold.cc (gold_exit): Change status parameter to enum; adjust
45 all callers.
46 (queue_initial_tasks): Call gold_fallback.
47 * gold.h: Include cstdlib.
48 (Exit_status): New enum type.
49 (gold_exit): Change status parameter to enum.
50 (gold_fallback): New function.
51 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
52 (Layout::create_symtab_sections): Likewise.
53 (Layout::create_shdrs): Likewise.
54 * main.cc (main): Adjust call to gold_exit.
55 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
56 (Output_data_got::add_got_entry_pair): Likewise.
57 (Output_section::add_input_section): Likewise.
58 (Output_section::add_output_section_data): Likewise.
59 (Output_segment::set_section_list_addresses): Likewise.
60 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
61
fb0e076f
CC
622011-06-07 Cary Coutant <ccoutant@google.com>
63
64 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
65 for incremental links.
66 * output.cc (Output_segment::set_section_list_addresses): Remove
67 FIXME and test for TLS or BSS.
68
a5ee4d5d
CC
692011-06-07 Cary Coutant <ccoutant@google.com>
70
71 * testsuite/Makefile.am: Add incremental_copy_test,
72 incremental_common_test_1.
73 * testsuite/Makefile.in: Regenerate.
74 * testsuite/common_test_1_v1.c: New source file.
75 * testsuite/common_test_1_v2.c: New source file.
76 * testsuite/copy_test_v1.cc: New source file.
77
5146f448
CC
782011-06-07 Cary Coutant <ccoutant@google.com>
79
80 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
81 update, allocate common from bss section's free list.
82 * incremental-dump.cc (dump_incremental_inputs): Print flag for
83 linker-defined symbols.
84 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
85 Skip GOT and PLT entries that are no longer referenced.
86 (Output_section_incremental_inputs::write_info_blocks): Mark
87 linker-defined symbols.
88 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
89 * output.cc (Output_section::allocate): New function.
90 * output.h (Output_section::allocate): New function.
91 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
92 linker-defined symbols.
93 (Symbol::override_base_with_special): Copy is_predefined_ flag.
94 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
95 (Symbol::init_base_output_data): Likewise.
96 (Symbol::init_base_output_segment): Likewise.
97 (Symbol::init_base_constant): Likewise.
98 (Sized_symbol::init_output_data): Likewise.
99 (Sized_symbol::init_output_segment): Likewise.
100 (Sized_symbol::init_constant): Likewise.
101 (Symbol_table::do_define_in_output_data): Likewise.
102 (Symbol_table::do_define_in_output_segment): Likewise.
103 (Symbol_table::do_define_as_constant): Likewise.
104 * symtab.h (Symbol::is_predefined): New function.
105 (Symbol::init_base_output_data): Add is_predefined parameter.
106 (Symbol::init_base_output_segment): Likewise.
107 (Symbol::init_base_constant): Likewise.
108 (Symbol::is_predefined_): New data member.
109 (Sized_symbol::init_output_data): Add is_predefined parameter.
110 (Sized_symbol::init_output_segment): Likewise.
111 (Sized_symbol::init_constant): Likewise.
112 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
113
26d3c67d
CC
1142011-06-07 Cary Coutant <ccoutant@google.com>
115
116 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
117 instead of emit_copy_reloc.
118 (Copy_relocs::emit_copy_reloc): Refactor.
119 (Copy_relocs::make_copy_reloc): New function.
120 (Copy_relocs::add_copy_reloc): Remove.
121 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
122 section.
123 (Copy_relocs::make_copy_reloc): New function.
124 (Copy_relocs::add_copy_reloc): Remove.
125 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
126 unchanged input files.
127 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
128 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
129 Reserve BSS space for COPY relocations.
130 (Sized_incremental_binary::do_emit_copy_relocs): New function.
131 (Output_section_incremental_inputs::write_info_blocks): Record
132 whether a symbol is copied from a shared object.
133 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
134 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
135 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
136 (Incremental_input_entry_reader::get_output_symbol_index): Add
137 is_copy parameter.
138 (Incremental_binary::emit_copy_relocs): New function.
139 (Incremental_binary::do_emit_copy_relocs): New function.
140 (Sized_incremental_binary::Sized_incremental_binary): Initialize
141 new data member.
142 (Sized_incremental_binary::add_copy_reloc): New function.
143 (Sized_incremental_binary::do_emit_copy_relocs): New function.
144 (Sized_incremental_binary::Copy_reloc): New struct.
145 (Sized_incremental_binary::Copy_relocs): New typedef.
146 (Sized_incremental_binary::copy_relocs_): New data member.
147 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
148 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
149 * target.h (Sized_target::emit_copy_reloc): New function.
150 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
151
7cdb37d9
CC
1522011-06-02 Cary Coutant <ccoutant@google.com>
153
154 PR gold/12163
155 * gold/archive.cc (Archive::Archive): Initialize new data member.
156 (Archive::include_all_members): Return if archive has already been
157 included.
158 * gold/archive.h (Archive::include_all_members_): New data member.
159
cc643b88
NC
1602011-06-02 Nick Clifton <nickc@redhat.com>
161
162 * dynobj.h: Fix spelling mistake in comment.
163 * output.cc: Likewise.
164
f62a3ca7
DK
1652011-05-31 Doug Kwan <dougkwan@google.com>
166 Asier Llano
167
168 PR gold/12826
cc643b88 169 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
170 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
171 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
172 redundant arm_exidx_test.so.
173 * testsuite/Makefile.in: Regenerate.
174 (check_SCRIPTS): Add pr12826.sh
175 (check_DATA): Add pr12826.stdout
176 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
177 * testsuite/pr12826.sh: New file.
178 * testsuite/pr12826_1.s: Ditto.
179 * testsuite/pr12826_1.s: Ditto.
180
8dbe1edc
ILT
1812011-05-30 Ian Lance Taylor <iant@google.com>
182
183 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
184 sections.
185
c49875be
ILT
1862011-05-29 Ian Lance Taylor <iant@google.com>
187
188 PR gold/12804
189 * testsuite/Makefile.am: Use different file name for two_file_test
190 temporary file for each incremental test.
191 * testsuite/Makefile.in: Rebuild.
192
69d53f7a
ILT
1932011-05-29 Ian Lance Taylor <iant@google.com>
194
195 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
196 binary input file is empty.
197
41d0ab5f
ILT
1982011-05-27 Ian Lance Taylor <iant@google.com>
199
200 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
201 (ver_test_9.so): Likewise.
202 * testsuite/Makefile.in: Rebuild.
203
89d8a36b
CC
2042011-05-26 Cary Coutant <ccoutant@google.com>
205
206 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
207 * incremental.cc (Incremental_inputs::report_input_section): Fix
208 comment, indentation.
209 (Incremental_inputs::report_comdat_group): New function.
210 (Output_section_incremental_inputs::set_final_data_size): Adjust size
211 of data for incremental input file entry.
212 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
213 group count, COMDAT group signatures.
214 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
215 an unchanged input file.
216 * incremental.h (Incremental_object_entry::Incremental_object_entry):
217 Initialize new data member.
218 (Incremental_object_entry::add_comdat_group): New function.
219 (Incremental_object_entry::get_comdat_group_count): New function.
220 (Incremental_object_entry::get_comdat_signature_key): New function.
221 (Incremental_object_entry::groups_): New data member.
222 (Incremental_inputs::report_comdat_group): New function.
223 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
224 data for incremental input file entry.
225 (Incremental_input_entry_reader::get_comdat_group_count): New function.
226 (Incremental_input_entry_reader::get_input_section): Adjust size of
227 data for incremental input file entry.
228 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
229 (Incremental_input_entry_reader::get_comdat_group_signature): New
230 function.
231 * object.cc (Sized_relobj::include_section_group): Report kept
232 COMDAT groups for incremental links.
233
1706a06f
ILT
2342011-05-24 David Meyer <pdox@google.com>
235
236 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
237 with name parameter. Add found_name parameter.
238 * fileread.cc (Input_file::find_file): Adjust code accordingly.
239 * dirsearch.h (class Dirsearch): Update declaration.
240
a10ae760
ILT
2412011-05-24 Ian Lance Taylor <iant@google.com>
242
243 * archive.cc (Library_base::should_include_member): Pull in object
244 from archive if it defines the entry symbol.
245 * parameters.cc (Parameters::entry): New function.
246 * parameters.h (class Parameters): Declare entry.
247 * output.h (class Output_file_header): Remove entry_ field.
248 * output.cc (Output_file_header::Output_file_header): Remove entry
249 parameter. Change all callers.
250 (Output_file_header::entry): Use parameters->entry.
251 * gold.cc (queue_middle_tasks): Likewise.
252 * plugin.cc (Plugin_hook::run): Likewise.
253
aa92d6ed
CC
2542011-05-24 Cary Coutant <ccoutant@google.com>
255
256 * gold.cc (queue_initial_tasks): Pass incremental base filename
257 to Output_file::open_base_file; don't print error message.
258 * incremental-dump.cc (main): Adjust call to
259 Output_file::open_for_modification.
260 * incremental-dump.cc (main): Likewise.
261 * incremental.cc (Incremental_inputs::report_command_line):
262 Ignore --incremental-base option when comparing command lines.
263 Ignore parameter when given as separate argument.
264 * options.h (class General_options): Add --incremental-base.
265 * output.cc (Output_file::Output_file):
266 (Output_file::open_base_file): Add base_name and writable parameters;
267 read base file into new file; print error message here.
268 (Output_file::map_no_anonymous): Add writable parameter; adjust all
269 callers.
270 * output.h (Output_file::open_for_modification): Rename to...
271 (Output_file::open_base_file): ...this; add base_name and
272 writable parameters; adjust all callers.
273 (Output_file::map_no_anonymous): Add writable parameter; adjust all
274 callers.
275 * testsuite/Makefile.am (incremental_test_4): Test
276 --incremental-base.
277 * testsuite/Makefile.in: Regenerate.
278
2eedd706
CC
2792011-05-24 Cary Coutant <ccoutant@google.com>
280
281 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
282 incremental_test_4.
283 * testsuite/Makefile.in: Regenerate.
284 * testsuite/two_file_test_1_v1.cc: New test source file.
285 * testsuite/two_file_test_1b_v1.cc: New test source file.
286 * testsuite/two_file_test_2_v1.cc: New test source file.
287
0f1c85a6
CC
2882011-05-24 Cary Coutant <ccoutant@google.com>
289
290 * dynobj.h (Dynobj::do_dynobj): New function.
291 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
292 flag and soname for shared objects.
293 * incremental.cc (Incremental_inputs::report_object): Make
294 either Incremental_object_entry or Incremental_dynobj_entry; add
295 soname to string table.
296 (Incremental_inputs::report_input_section): Add assertion.
297 (Output_section_incremental_inputs::set_final_data_size): Adjust
298 type of input file entry for shared libraries; adjust size of
299 shared library info entry.
300 (Output_section_incremental_inputs::write_input_files): Write
301 as_needed flag for shared libraries.
302 (Output_section_incremental_inputs::write_info_blocks): Adjust type
303 of input file entry for shared libraries; write soname.
304 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
305 soname from incremental info.
306 * incremental.h (enum Incremental_input_flags): Add
307 INCREMENTAL_INPUT_AS_NEEDED.
308 (Incremental_input_entry::Incremental_input_entry): Initialize new
309 data member.
310 (Incremental_input_entry::set_as_needed): New function.
311 (Incremental_input_entry::as_needed): New function.
312 (Incremental_input_entry::do_dynobj_entry): New function.
313 (Incremental_input_entry::as_needed_): New data member.
314 (Incremental_object_entry::Incremental_object_entry): Don't check
315 for shared library.
316 (Incremental_object_entry::do_type): Likewise.
317 (class Incremental_dynobj_entry): New class.
318 (Incremental_input_entry_reader::as_needed): New function.
319 (Incremental_input_entry_reader::get_soname): New function.
320 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
321 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
322 size of shared library info entry.
323 * layout.cc (Layout::finish_dynamic_section): Don't test for
324 incremental link when adding DT_NEEDED entries.
325 * object.h (Object::Object): Initialize new data member.
326 (Object::dynobj): New function.
327 (Object::set_as_needed): New function.
328 (Object::as_needed): New function.
329 (Object::do_dynobj): New function.
330 (Object::as_needed_): New data member.
331
6fa2a40b
CC
3322011-05-24 Cary Coutant <ccoutant@google.com>
333
334 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
335 info; adjust display of GOT entries.
336 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
337 vector of input objects; remove file_status_.
338 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
339 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
340 got_plt reader; call target hooks to reserve GOT entries.
341 (Output_section_incremental_inputs::set_final_data_size): Adjust size
342 of input file info header and GOT info entry.
343 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
344 relocation info.
345 (Got_plt_view_info::got_descriptor): Remove.
346 (Got_plt_view_info::sym_index): New data member.
347 (Got_plt_view_info::input_index): New data member.
348 (Local_got_offset_visitor::visit): Write input file index.
349 (Global_got_offset_visitor::visit): Write 0 for input file index.
350 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
351 with sym_index and input_index.
352 (Output_section_incremental_inputs::write_got_plt): Adjust size of
353 incremental info GOT entry; replace got_descriptor with input_index.
354 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
355 map from input file index to object.
356 (Sized_relobj_incr::do_layout): Replace direct data member reference
357 with accessor function.
358 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
359 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
360 Adjust size of input file info header.
361 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
362 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
363 (Incremental_input_entry_reader::get_input_section): Adjust size of
364 input file info header.
365 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
366 of incremental info GOT entry.
367 (Incremental_got_plt_reader::get_got_desc): Remove.
368 (Incremental_got_plt_reader::get_got_symndx): New function.
369 (Incremental_got_plt_reader::get_got_input_index): New function.
370 (Sized_incremental_binary::Sized_incremental_binary): Remove
371 file_status_; add input_objects_.
372 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
373 (Sized_incremental_binary::set_file_is_unchanged): Remove.
374 (Sized_incremental_binary::file_is_unchanged): Remove.
375 (Sized_incremental_binary::set_input_object): New function.
376 (Sized_incremental_binary::input_object): New function.
377 (Sized_incremental_binary::file_status_): Remove.
378 (Sized_incremental_binary::input_objects_): New data member.
379 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
380 references.
381 (Sized_relobj_incr::invalid_address): Move to base class.
382 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
383 class.
384 (Sized_relobj_incr::do_output_section_offset): Likewise.
385 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
386 (Sized_relobj_incr::section_offsets_): Likewise.
387 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
388 function.
389 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
390 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
391 with accessor function.
392 (Sized_relobj_file::do_layout): Likewise.
393 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
394 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
395 (Sized_relobj_file::compute_final_local_value): Replace refs to
396 section_offsets_ with accessor function.
397 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
398 * object.h (Relobj::Relobj): Initialize new data members.
399 (Relobj::add_dyn_reloc): New function.
400 (Relobj::first_dyn_reloc): New function.
401 (Relobj::dyn_reloc_count): New function.
402 (Relobj::first_dyn_reloc_): New data member.
403 (Relobj::dyn_reloc_count_): New data member.
404 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
405 references.
406 (Sized_relobj::Address): New typedef.
407 (Sized_relobj::invalid_address): Move here from child class.
408 (Sized_relobj::Sized_relobj): Initialize new data members.
409 (Sized_relobj::sized_relobj): New function.
410 (Sized_relobj::is_output_section_offset_invalid): Move here from
411 child class.
412 (Sized_relobj::get_output_section_offset): Likewise.
413 (Sized_relobj::local_has_got_offset): Likewise.
414 (Sized_relobj::local_got_offset): Likewise.
415 (Sized_relobj::set_local_got_offset): Likewise.
416 (Sized_relobj::do_for_all_local_got_entries): Likewise.
417 (Sized_relobj::clear_got_offsets): New function.
418 (Sized_relobj::section_offsets): Move here from child class.
419 (Sized_relobj::do_output_section_offset): Likewise.
420 (Sized_relobj::do_set_section_offset): Likewise.
421 (Sized_relobj::Local_got_offsets): Likewise.
422 (Sized_relobj::local_got_offsets_): Likewise.
423 (Sized_relobj::section_offsets_): Likewise.
424 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
425 references.
426 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
427 class.
428 (Sized_relobj_file::sized_relobj): New function
429 (Sized_relobj_file::local_has_got_offset): Move to base class.
430 (Sized_relobj_file::local_got_offset): Likewise.
431 (Sized_relobj_file::set_local_got_offset): Likewise.
432 (Sized_relobj_file::get_output_section_offset): Likewise.
433 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
434 (Sized_relobj_file::do_output_section_offset): Likewise.
435 (Sized_relobj_file::do_set_section_offset): Likewise.
436 (Sized_relobj_file::Local_got_offsets): Likewise.
437 (Sized_relobj_file::local_got_offsets_): Likewise.
438 (Sized_relobj_file::section_offsets_): Likewise.
439 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
440 (all constructors).
441 (set_needs_dynsym_index): Convert relobj to derived class pointer.
442 (Output_reloc::get_symbol_index): Likewise.
443 (Output_reloc::local_section_offset): Likewise.
444 (Output_reloc::get_address): Likewise.
445 (Output_reloc::symbol_value): Likewise.
446 (Output_data_got::reserve_slot): Move to class definition.
447 (Output_data_got::reserve_local): New function.
448 (Output_data_got::reserve_slot_for_global): Remove.
449 (Output_data_got::reserve_global): New function.
450 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
451 (all constructors, two instantiations).
452 (Output_reloc::get_relobj): New function (two instantiations).
453 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
454 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
455 (Output_data_reloc::add_global): Adjust type of relobj.
456 (Output_data_reloc::add_global_relative): Likewise.
457 (Output_data_reloc::add_symbolless_global_addend): Likewise.
458 (Output_data_reloc::add_local): Likewise.
459 (Output_data_reloc::add_local_relative): Likewise.
460 (Output_data_reloc::add_symbolless_local_addend): Likewise.
461 (Output_data_reloc::add_local_section): Likewise.
462 (Output_data_reloc::add_output_section): Likewise.
463 (Output_data_reloc::add_absolute): Likewise.
464 (Output_data_reloc::add_target_specific): Likewise.
465 (Output_data_got::reserve_slot): Move definition here.
466 (Output_data_got::reserve_local): New function.
467 (Output_data_got::reserve_global): New function.
468 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
469 section_offsets_ with accessor function.
470 (Sized_relobj_file::write_sections): Likewise.
471 (Sized_relobj_file::do_relocate_sections): Likewise.
472 * target.h (Sized_target::reserve_local_got_entry): New function.
473 (Sized_target::reserve_global_got_entry): New function.
474 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
475 (Target_x86_64::reserve_global_got_entry): New function.
476 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
477
4829d394
CC
4782011-05-23 Cary Coutant <ccoutant@google.com>
479
480 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
481 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
482 bit when checking got_type.
483 * incremental.cc (Sized_incremental_binary::setup_readers):
484 Store symbol table and string table locations; initialize bit vector
485 of file status flags.
486 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
487 unchanged files.
488 (Sized_incremental_binary::do_process_got_plt): New function.
489 (Sized_incremental_binary::get_symtab_view): Use stored locations.
490 (Output_section_incremental_inputs::set_final_data_size): Record
491 file index for each input file.
492 (Output_section_incremental_inputs::write_got_plt): Store file index
493 instead of input entry offset for each GOT entry.
494 * incremental.h
495 (Incremental_input_entry::Incremental_input_entry): Initialize new
496 data member.
497 (Incremental_input_entry::set_offset): Store file index.
498 (Incremental_input_entry::get_file_index): New function.
499 (Incremental_input_entry::file_index_): New data member.
500 (Incremental_binary::process_got_plt): New function.
501 (Incremental_binary::do_process_got_plt): New function.
502 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
503 data members.
504 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
505 (Sized_incremental_binary::set_file_is_unchanged): New function.
506 (Sized_incremental_binary::file_is_unchanged): New function.
507 (Sized_incremental_binary::do_process_got_plt): New function.
508 (Sized_incremental_binary::file_status_): New data member.
509 (Sized_incremental_binary::main_symtab_loc_): New data member.
510 (Sized_incremental_binary::main_strtab_loc_): New data member.
511 * output.cc (Output_data_got::Got_entry::write): Add case
512 RESERVED_CODE.
513 (Output_data_got::add_global): Call add_got_entry.
514 (Output_data_got::add_global_plt): Likewise.
515 (Output_data_got::add_global_with_rel): Likewise.
516 (Output_data_got::add_global_with_rela): Likewise.
517 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
518 (Output_data_got::add_global_pair_with_rela): Likewise.
519 (Output_data_got::add_local): Call add_got_entry.
520 (Output_data_got::add_local_plt): Likewise.
521 (Output_data_got::add_local_with_rel): Likewise.
522 (Output_data_got::add_local_with_rela): Likewise.
523 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
524 (Output_data_got::add_local_pair_with_rela): Likewise.
525 (Output_data_got::reserve_slot): New function.
526 (Output_data_got::reserve_slot_for_global): New function.
527 (Output_data_got::add_got_entry): New function.
528 (Output_data_got::add_got_entry_pair): New function.
529 (Output_section::add_output_section_data): Edit FIXME.
530 * output.h
531 (Output_section_data_build::Output_section_data_build): New
532 constructor with size parameter.
533 (Output_data_space::Output_data_space): Likewise.
534 (Output_data_got::Output_data_got): Initialize new data member; new
535 constructor with size parameter.
536 (Output_data_got::add_constant): Call add_got_entry.
537 (Output_data_got::reserve_slot): New function.
538 (Output_data_got::reserve_slot_for_global): New function.
539 (class Output_data_got::Got_entry): Add RESERVED_CODE.
540 (Output_data_got::add_got_entry): New function.
541 (Output_data_got::add_got_entry_pair): New function.
542 (Output_data_got::free_list_): New data member.
543 * target.h (Sized_target::init_got_plt_for_update): New function.
544 (Sized_target::register_global_plt_entry): New function.
545 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
546 Initialize new data member; call init; add constructor with PLT count.
547 (Output_data_plt_x86_64::init): New function.
548 (Output_data_plt_x86_64::add_relocation): New function.
549 (Output_data_plt_x86_64::reserve_slot): New function.
550 (Output_data_plt_x86_64::free_list_): New data member.
551 (Target_x86_64::init_got_plt_for_update): New function.
552 (Target_x86_64::register_global_plt_entry): New function.
553 (Output_data_plt_x86_64::add_entry): Allocate from free list for
554 incremental updates.
555 (Output_data_plt_x86_64::add_relocation): New function.
556 * testsuite/object_unittest.cc (Object_test): Set default options.
557
ec69d6da
ILT
5582011-05-16 Ian Lance Taylor <iant@google.com>
559
560 * options.h (class General_options): Make -i a synonym for -r.
561
732e31de
ILT
5622011-05-16 Ian Lance Taylor <iant@google.com>
563
564 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
565
403676b5
CC
5662011-05-10 Cary Coutant <ccoutant@google.com>
567
568 * object.cc (Sized_relobj::do_count_local_symbols): Check for
569 strip_all (-s).
570
5b7b7d6e
ILT
5712011-05-06 Ian Lance Taylor <iant@google.com>
572
573 * layout.cc (Layout::layout): If the output section flags change,
574 update the ordering.
575
f0f9babf
CC
5762011-04-25 Cary Coutant <ccoutant@google.com>
577
578 * incremental-dump.cc (dump_incremental_inputs): Print local
579 symbol info for each input file.
580 * incremental.cc
581 (Output_section_incremental_inputs::set_final_data_size): Add local
582 symbol info to input file entries in incremental info.
583 (Output_section_incremental_inputs::write_info_blocks): Likewise.
584 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
585 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
586 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
587 implementation.
588 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
589 (Sized_incr_relobj::do_relocate): Write the local symbols.
590 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
591 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
592 Adjust size of input file header.
593 (Incremental_inputs_reader::get_local_symbol_offset): New function.
594 (Incremental_inputs_reader::get_local_symbol_count): New function.
595 (Incremental_inputs_reader::get_input_section): Adjust size of input
596 file header.
597 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
598 (Sized_incr_relobj::This): New typedef.
599 (Sized_incr_relobj::sym_size): New const data member.
600 (Sized_incr_relobj::Local_symbol): New struct.
601 (Sized_incr_relobj::do_output_local_symbol_count): New function.
602 (Sized_incr_relobj::do_local_symbol_offset): New function.
603 (Sized_incr_relobj::local_symbol_count_): New data member.
604 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
605 (Sized_incr_relobj::local_symbol_index_): New data member.
606 (Sized_incr_relobj::local_symbol_offset_): New data member.
607 (Sized_incr_relobj::local_dynsym_offset_): New data member.
608 (Sized_incr_relobj::local_symbols_): New data member.
609 * object.h (Relobj::output_local_symbol_count): New function.
610 (Relobj::local_symbol_offset): New function.
611 (Relobj::do_output_local_symbol_count): New function.
612 (Relobj::do_local_symbol_offset): New function.
613 (Sized_relobj::do_output_local_symbol_count): New function.
614 (Sized_relobj::do_local_symbol_offset): New function.
615
d0a9ace3
ILT
6162011-04-22 Vladimir Simonov <sv@sw.ru>
617
618 * descriptors.cc (set_close_on_exec): New function.
619 (Descriptors::open): Use set_close_on_exec.
620 * output.cc (S_ISLNK): Define if not defined.
621
94a3fc8b
CC
6222011-04-22 Cary Coutant <ccoutant@google.com>
623
624 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
625 global symbol map.
626 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
627 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
628 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
629 relocations.
630 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
631 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
632 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
633 * incremental.h
634 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
635 function.
636 (Incremental_binary::apply_incremental_relocs): New function.
637 (Incremental_binary::do_apply_incremental_relocs): New function.
638 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
639 data member.
640 (Sized_incremental_binary::add_global_symbol): New function.
641 (Sized_incremental_binary::global_symbol): New function.
642 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
643 (Sized_incremental_binary::symbol_map_): New data member.
644 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
645 * target.h (Sized_target::apply_relocation): New function.
646 * target-reloc.h (apply_relocation): New function.
647 * x86_64.cc (Target_x86_64::apply_relocation): New function.
648
c87e4302
DK
6492011-04-22 Doug Kwan <dougkwan@google.com>
650
651 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
652 flag of a SHT_ARM_EXIDX section.
653 * testsuite/Makefile.am (arm_exidx_test): New test rules.
654 * testsuite/Makefile.in: Regenerate.
655 * testsuite/arm_exidx_test.s: New file.
656 * testsuite/arm_exidx_test.sh: Same.
657
e7782cf6
CC
6582011-04-20 Cary Coutant <ccoutant@google.com>
659
660 PR gold/12689
661 * archive.h (Incremental_archive_entry::Archive_member):
662 Initialize arg_serial_ (second constructor).
663
308ecdc7
ILT
6642011-04-17 Ian Lance Taylor <iant@google.com>
665
666 * object.cc (Relocate_info::location): Simplify location string.
667 * errors.cc (Errors::error_at_location): Don't print program
668 name.
669 (Errors::warning_at_location): Likewise.
670 (Errors::undefined_symbol): Likewise.
671 * testsuite/debug_msg.sh: Update accordingly.
672
bec5b579
CC
6732011-04-14 Cary Coutant <ccoutant@google.com>
674
675 * gold/layout.cc (Layout::symtab_section_offset): New function.
676 * gold/layout.h (Layout::symtab_section_offset): New function.
677 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
678
88597d34
ILT
6792011-04-12 Ian Lance Taylor <iant@google.com>
680
681 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
682 with MREMAP_MAYMOVE.
683 * output.h (class Output_file): Add map_is_allocated_ field.
684 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
685 not available, provide stubs. If mremap is not available, #define
686 it to gold_mremap.
687 (MREMAP_MAYMOVE): Define if not defined.
688 (Output_file::Output_file): Initialize map_is_allocated_.
689 (Output_file::resize): Check map_is_allocated_.
690 (Output_file::map_anonymous): If mmap fails, use malloc.
691 (Output_file::unmap): Don't do anything for an anonymous map.
692 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
693 is not available, provide stubs.
694 (File_read::View::~View): Use free rather than delete[].
695 (File_read::make_view): Use malloc rather than new[]. If mmap
696 fails, use malloc.
697 (File_read::find_or_make_view): Use malloc rather than new[].
698 * gold.h: Remove HAVE_REMAP code.
699 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
700 exists. Rename mremap to gold_mremap. If mmap is not available
701 don't do anything.
702 * configure, config.in: Rebuild.
703
11e361bc
ILT
7042011-04-11 Ian Lance Taylor <iant@google.com>
705
706 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
707 initialize local variable v.
708
cdc29364
CC
7092011-04-11 Cary Coutant <ccoutant@google.com>
710
711 * archive.cc (Archive::include_member): Adjust call to
712 report_object.
713 (Add_archive_symbols::run): Track argument serial numbers.
714 (Lib_group::include_member): Likewise.
715 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
716 * archive.h (Incremental_archive_entry::Archive_member):
717 Initialize arg_serial_.
718 (Archive_member::arg_serial_): New data member.
719 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
720 (Sized_dynobj::do_add_symbols): Track symbols when doing an
721 incremental link.
722 (Sized_dynobj::do_for_all_local_got_entries): New function.
723 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
724 function.
725 * fileread.cc (get_mtime): New function.
726 * fileread.h (get_mtime): New function.
727 * gold.cc (queue_initial_tasks): Check for incremental update.
728 (process_incremental_input): New function.
729 (queue_middle_tasks): Don't force valid target for incremental
730 update.
731 * incremental-dump.cc (find_input_containing_global): Adjust
732 size of symbol info entry.
733 (dump_incremental_inputs): Dump argument serial number and
734 in_system_directory flag; bias shndx by 1; print symbol names
735 when dumping per-file symbol lists; use new symbol info readers.
736 * incremental.cc
737 (Output_section_incremental_inputs:update_data_size): New function.
738 (Sized_incremental_binary::setup_readers): Setup input readers
739 for each input file; build maps for files added from libraries
740 and scripts.
741 (Sized_incremental_binary::check_input_args): New function.
742 (Sized_incremental_binary::do_check_inputs): Build map of argument
743 serial numbers to input arguments.
744 (Sized_incremental_binary::do_file_has_changed): Rename
745 do_file_is_unchanged to this; compare file modification times.
746 (Sized_incremental_binary::do_init_layout): New function.
747 (Sized_incremental_binary::do_reserve_layout): New function.
748 (Sized_incremental_binary::do_get_input_reader): Remove.
749 (Sized_incremental_binary::get_symtab_view): New function.
750 (Incremental_checker::can_incrementally_link_output_file): Remove.
751 (Incremental_inputs::report_command_line): Exclude --debug options.
752 (Incremental_inputs::report_archive_begin): Add parameter; track
753 argument serial numbers; don't put input file entry for archive
754 before archive members.
755 (Incremental_inputs::report_archive_end): Put input file entry
756 for archive after archive members.
757 (Incremental_inputs::report_object): Add parameter; track argument
758 serial numbers and in_system_directory flag.
759 (Incremental_inputs::report_script): Add parameter; track argument
760 serial numbers.
761 (Output_section_incremental_inputs::set_final_data_size): Adjust
762 size of symbol info entry; check for forwarding symbols.
763 (Output_section_incremental_inputs::write_input_files): Write
764 in_system_directory flag and argument serial number.
765 (Output_section_incremental_inputs::write_info_blocks): Map section
766 indices between incremental info and original input file; store
767 input section index for each symbol.
768 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
769 change operator() to visit().
770 (class Global_got_offset_visitor): Likewise.
771 (class Global_symbol_visitor_got_plt):
772 (Output_section_incremental_inputs::write_got_plt): Use new visitor
773 classes.
774 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
775 (Sized_incr_relobj::do_read_symbols): New function.
776 (Sized_incr_relobj::do_layout): New function.
777 (Sized_incr_relobj::do_layout_deferred_sections): New function.
778 (Sized_incr_relobj::do_add_symbols): New function.
779 (Sized_incr_relobj::do_should_include_member): New function.
780 (Sized_incr_relobj::do_for_all_global_symbols): New function.
781 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
782 (Sized_incr_relobj::do_section_size): New function.
783 (Sized_incr_relobj::do_section_name): New function.
784 (Sized_incr_relobj::do_section_contents): New function.
785 (Sized_incr_relobj::do_section_flags): New function.
786 (Sized_incr_relobj::do_section_entsize): New function.
787 (Sized_incr_relobj::do_section_address): New function.
788 (Sized_incr_relobj::do_section_type): New function.
789 (Sized_incr_relobj::do_section_link): New function.
790 (Sized_incr_relobj::do_section_info): New function.
791 (Sized_incr_relobj::do_section_addralign): New function.
792 (Sized_incr_relobj::do_initialize_xindex): New function.
793 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
794 (Sized_incr_relobj::do_read_relocs): New function.
795 (Sized_incr_relobj::do_gc_process_relocs): New function.
796 (Sized_incr_relobj::do_scan_relocs): New function.
797 (Sized_incr_relobj::do_count_local_symbols): New function.
798 (Sized_incr_relobj::do_finalize_local_symbols): New function.
799 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
800 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
801 (Sized_incr_relobj::do_relocate): New function.
802 (Sized_incr_relobj::do_set_section_offset): New function.
803 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
804 (Sized_incr_dynobj::do_read_symbols): New function.
805 (Sized_incr_dynobj::do_layout): New function.
806 (Sized_incr_dynobj::do_add_symbols): New function.
807 (Sized_incr_dynobj::do_should_include_member): New function.
808 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
809 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
810 (Sized_incr_dynobj::do_section_size): New function.
811 (Sized_incr_dynobj::do_section_name): New function.
812 (Sized_incr_dynobj::do_section_contents): New function.
813 (Sized_incr_dynobj::do_section_flags): New function.
814 (Sized_incr_dynobj::do_section_entsize): New function.
815 (Sized_incr_dynobj::do_section_address): New function.
816 (Sized_incr_dynobj::do_section_type): New function.
817 (Sized_incr_dynobj::do_section_link): New function.
818 (Sized_incr_dynobj::do_section_info): New function.
819 (Sized_incr_dynobj::do_section_addralign): New function.
820 (Sized_incr_dynobj::do_initialize_xindex): New function.
821 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
822 (make_sized_incremental_object): New function.
823 (Incremental_library::copy_unused_symbols): New function.
824 (Incremental_library::do_for_all_unused_symbols): New function.
825 * incremental.h (enum Incremental_input_flags): New type.
826 (class Incremental_checker): Remove.
827 (Incremental_input_entry::Incremental_input_entry): Add argument
828 serial number.
829 (Incremental_input_entry::arg_serial): New function.
830 (Incremental_input_entry::set_is_in_system_directory): New function.
831 (Incremental_input_entry::is_in_system_directory): New function.
832 (Incremental_input_entry::arg_serial_): New data member.
833 (Incremental_input_entry::is_in_system_directory_): New data member.
834 (class Script_info): Move here from script.h.
835 (Script_info::Script_info): Add filename parameter.
836 (Script_info::filename): New function.
837 (Script_info::filename_): New data member.
838 (Incremental_script_entry::Incremental_script_entry): Add argument
839 serial number.
840 (Incremental_object_entry::Incremental_object_entry): Likewise.
841 (Incremental_object_entry::add_input_section): Build list of input
842 sections with map to original shndx.
843 (Incremental_object_entry::get_input_section_index): New function.
844 (Incremental_object_entry::shndx_): New data member.
845 (Incremental_object_entry::name_key_): Rename; adjust all refs.
846 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
847 (Incremental_archive_entry::Incremental_archive_entry): Add argument
848 serial number.
849 (Incremental_inputs::report_archive_begin): Likewise.
850 (Incremental_inputs::report_object): Likewise.
851 (Incremental_inputs::report_script): Likewise.
852 (class Incremental_global_symbol_reader): New class.
853 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
854 and store flags and input file type.
855 (Incremental_input_entry_reader::arg_serial): New function.
856 (Incremental_input_entry_reader::type): Extract type from flags.
857 (Incremental_input_entry_reader::is_in_system_directory): New function.
858 (Incremental_input_entry_reader::get_input_section_count): Call
859 accessor function for type.
860 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
861 function for type; adjust size of global symbol entry.
862 (Incremental_input_entry_reader::get_global_symbol_count): Call
863 accessor function for type.
864 (Incremental_input_entry_reader::get_object_count): Likewise.
865 (Incremental_input_entry_reader::get_object_offset): Likewise.
866 (Incremental_input_entry_reader::get_member_count): Likewise.
867 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
868 (Incremental_input_entry_reader::get_member_offset): Likewise.
869 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
870 (Incremental_input_entry_reader::Global_symbol_info): Remove.
871 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
872 (Incremental_input_entry_reader::get_global_symbol_reader): New
873 function.
874 (Incremental_input_entry_reader::get_output_symbol_index): New
875 function.
876 (Incremental_input_entry_reader::type_): Remove.
877 (Incremental_input_entry_reader::flags_): New data member.
878 (Incremental_inputs_reader::input_file_offset): New function.
879 (Incremental_inputs_reader::input_file_index): New function.
880 (Incremental_inputs_reader::input_file): Call input_file_offset.
881 (Incremental_inputs_reader::input_file_at_offset): New function.
882 (Incremental_relocs_reader::get_r_type): Reformat.
883 (Incremental_relocs_reader::get_r_shndx): Reformat.
884 (Incremental_relocs_reader::get_r_offset): Reformat.
885 (Incremental_relocs_reader::data): New function.
886 (Incremental_binary::Incremental_binary): Initialize new data members.
887 (Incremental_binary::check_inputs): Add cmdline parameter.
888 (Incremental_binary::file_is_unchanged): Remove.
889 (Input_reader::arg_serial): New function.
890 (Input_reader::get_unused_symbol_count): New function.
891 (Input_reader::get_unused_symbol): New function.
892 (Input_reader::do_arg_serial): New function.
893 (Input_reader::do_get_unused_symbol_count): New function.
894 (Input_reader::do_get_unused_symbol): New function.
895 (Incremental_binary::input_file_count): New function.
896 (Incremental_binary::get_input_reader): Change signature to use
897 index instead of filename.
898 (Incremental_binary::file_has_changed): New function.
899 (Incremental_binary::get_input_argument): New function.
900 (Incremental_binary::get_library): New function.
901 (Incremental_binary::get_script_info): New function.
902 (Incremental_binary::init_layout): New function.
903 (Incremental_binary::reserve_layout): New function.
904 (Incremental_binary::output_file): New function.
905 (Incremental_binary::do_check_inputs): New function.
906 (Incremental_binary::do_file_is_unchanged): Remove.
907 (Incremental_binary::do_file_has_changed): New function.
908 (Incremental_binary::do_init_layout): New function.
909 (Incremental_binary::do_reserve_layout): New function.
910 (Incremental_binary::do_input_file_count): New function.
911 (Incremental_binary::do_get_input_reader): Change signature.
912 (Incremental_binary::input_args_map_): New data member.
913 (Incremental_binary::library_map_): New data member.
914 (Incremental_binary::script_map_): New data member.
915 (Sized_incremental_binary::Sized_incremental_binary): Initialize
916 new data members.
917 (Sized_incremental_binary::output_section): New function.
918 (Sized_incremental_binary::inputs_reader): Add const.
919 (Sized_incremental_binary::symtab_reader): Add const.
920 (Sized_incremental_binary::relocs_reader): Add const.
921 (Sized_incremental_binary::got_plt_reader): Add const.
922 (Sized_incremental_binary::get_symtab_view): New function.
923 (Sized_incremental_binary::Inputs_reader): New typedef.
924 (Sized_incremental_binary::Input_entry_reader): New typedef.
925 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
926 (Sized_incremental_binary::do_file_is_unchanged): Remove.
927 (Sized_incremental_binary::do_file_has_changed): New function.
928 (Sized_incremental_binary::do_init_layout): New function.
929 (Sized_incremental_binary::do_reserve_layout): New function.
930 (Sized_input_reader::Inputs_reader): Remove.
931 (Sized_input_reader::Input_entry_reader): Remove.
932 (Sized_input_reader::do_arg_serial): New function.
933 (Sized_input_reader::do_get_unused_symbol_count): New function.
934 (Sized_input_reader::do_get_unused_symbol): New function.
935 (Sized_incremental_binary::do_input_file_count): New function.
936 (Sized_incremental_binary::do_get_input_reader): Change signature;
937 use index instead of filename.
938 (Sized_incremental_binary::section_map_): New data member.
939 (Sized_incremental_binary::input_entry_readers_): New data member.
940 (class Sized_incr_relobj): New class.
941 (class Sized_incr_dynobj): New class.
942 (make_sized_incremental_object): New function.
943 (class Incremental_library): New class.
944 * layout.cc (Free_list::num_lists): New static data member.
945 (Free_list::num_nodes): New static data member.
946 (Free_list::num_removes): New static data member.
947 (Free_list::num_remove_visits): New static data member.
948 (Free_list::num_allocates): New static data member.
949 (Free_list::num_allocate_visits): New static data member.
950 (Free_list::init): New function.
951 (Free_list::remove): New function.
952 (Free_list::allocate): New function.
953 (Free_list::dump): New function.
954 (Free_list::print_stats): New function.
955 (Layout_task_runner::run): Resize output file for incremental updates.
956 (Layout::Layout): Initialize new data members.
957 (Layout::set_incremental_base): New function.
958 (Layout::init_fixed_output_section): New function.
959 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
960 incremental updates.
961 (Layout::create_gold_note): Do not create gold note section for
962 incremental updates.
963 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
964 for incremental updates.
965 (Layout::set_section_offsets): For incremental updates, allocate space
966 from free list.
967 (Layout::create_symtab_sections): Layout with offsets relative to
968 start of section; for incremental updates, allocate space from free
969 list.
970 (Layout::create_shdrs): For incremental updates, allocate space from
971 free list.
972 (Layout::finish_dynamic_section): For incremental updates, do not
973 check --as-needed (fixed in subsequent patch).
974 * layout.h (class Free_list): New class.
975 (Layout::set_incremental_base): New function.
976 (Layout::incremental_base): New function.
977 (Layout::init_fixed_output_section): New function.
978 (Layout::allocate): New function.
979 (Layout::incremental_base_): New data member.
980 (Layout::free_list_): New data member.
981 * main.cc (main): Print Free_list statistics.
982 * object.cc (Relobj::finalize_incremental_relocs): Add
983 clear_counts parameter; clear counts only when clear_counts is set.
984 (Sized_relobj::Sized_relobj): Initialize new base class.
985 (Sized_relobj::do_layout): Don't report special sections.
986 (Sized_relobj::do_for_all_local_got_entries): New function.
987 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
988 symtab_off to all symbol table offsets.
989 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
990 * object.h (class Got_offset_list): Move to top of file.
991 (Object::Object): Allow case where input_file == NULL.
992 (Object::~Object): Likewise.
993 (Object::input_file): Assert that input_file != NULL.
994 (Object::lock): Allow case where input_file == NULL.
995 (Object::unlock): Likewise.
996 (Object::is_locked): Likewise.
997 (Object::token): Likewise.
998 (Object::release): Likewise.
999 (Object::is_incremental): New function.
1000 (Object::get_mtime): New function.
1001 (Object::for_all_local_got_entries): New function.
1002 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1003 (Object::set_is_in_system_directory): New function.
1004 (Object::is_in_system_directory): New function.
1005 (Object::do_is_incremental): New function.
1006 (Object::do_get_mtime): New function.
1007 (Object::do_for_all_local_got_entries): New function.
1008 (Object::is_in_system_directory_): New data member.
1009 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1010 (class Sized_relobj_base): New class.
1011 (class Sized_relobj): Derive from Sized_relobj_base.
1012 (class Sized_relobj::Symbols): Redeclare from base class.
1013 (class Sized_relobj::local_got_offset_list): Remove.
1014 (class Sized_relobj::Output_sections): Redeclare from base class.
1015 (class Sized_relobj::do_for_all_local_got_entries): New function.
1016 (class Sized_relobj::write_local_symbols): Add offset parameter.
1017 (class Sized_relobj::local_symbol_offset_): Update comment.
1018 (class Sized_relobj::local_dynsym_offset_): Update comment.
1019 * options.cc (Input_arguments::add_file): Remove const.
1020 * options.h (Input_file_argument::Input_file_argument):
1021 Initialize arg_serial_ (all constructors).
1022 (Input_file_argument::set_arg_serial): New function.
1023 (Input_file_argument::arg_serial): New function.
1024 (Input_file_argument::arg_serial_): New data member.
1025 (Input_arguments::Input_arguments): Initialize file_count_.
1026 (Input_arguments::add_file): Remove const.
1027 (Input_arguments::number_of_input_files): New function.
1028 (Input_arguments::file_count_): New data member.
1029 (Command_line::number_of_input_files): Call
1030 Input_arguments::number_of_input_files.
1031 * output.cc (Output_segment_headers::Output_segment_headers):
1032 Set current size.
1033 (Output_section::Input_section::current_data_size): New function.
1034 (Output_section::Output_section): Initialize new data members.
1035 (Output_section::add_input_section): Don't do merge sections for
1036 an incremental link; allocate space from free list for an
1037 incremental update.
1038 (Output_section::add_output_section_data): Allocate space from
1039 free list for an incremental update.
1040 (Output_section::update_data_size): New function.
1041 (Output_section::set_fixed_layout): New function.
1042 (Output_section::reserve): New function.
1043 (Output_segment::set_section_addresses): Remove const.
1044 (Output_segment::set_section_list_addresses): Remove const; allocate
1045 space from free list for an incremental update.
1046 (Output_segment::set_offset): Adjust size of RELRO segment for an
1047 incremental update.
1048 * output.h (Output_data::current_data_size): Move here from
1049 child classes.
1050 (Output_data::pre_finalize_data_size): New function.
1051 (Output_data::update_data_size): New function.
1052 (Output_section_headers::update_data_size): new function.
1053 (Output_section_data_build::current_data_size): Move to Output_data.
1054 (Output_data_strtab::update_data_size): New function.
1055 (Output_section::current_data_size): Move to Output_data.
1056 (Output_section::set_fixed_layout): New function.
1057 (Output_section::has_fixed_layout): New function.
1058 (Output_section::reserve): New function.
1059 (Output_section::update_data_size): New function.
1060 (Output_section::has_fixed_layout_): New data member.
1061 (Output_section::free_list_): New data member.
1062 (Output_segment::set_section_addresses): Remove const.
1063 (Output_segment::set_section_list_addresses): Remove const.
1064 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1065 New function.
1066 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1067 New function.
1068 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1069 parameter when calling Add_symbols constructor; store argument
1070 serial number for members of a lib group.
1071 (Add_symbols::locks): Allow case where token == NULL.
1072 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1073 (Read_member::~Read_member): New function.
1074 (Read_member::is_runnable): New function.
1075 (Read_member::locks): New function.
1076 (Read_member::run): New function.
1077 (Check_script::~Check_script): New function.
1078 (Check_script::is_runnable): New function.
1079 (Check_script::locks): New function.
1080 (Check_script::run): New function.
1081 (Check_library::~Check_library): New function.
1082 (Check_library::is_runnable): New function.
1083 (Check_library::locks): New function.
1084 (Check_library::run): New function.
1085 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1086 (Add_symbols::library_): New data member.
1087 (class Read_member): New class.
1088 (class Check_script): New class.
1089 (class Check_library): New class.
1090 * reloc.cc (Read_relocs::is_runnable): Allow case where
1091 token == NULL.
1092 (Read_relocs::locks): Likewise.
1093 (Scan_relocs::locks): Likewise.
1094 (Relocate_task::locks): Likewise.
1095 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1096 to clear counters.
1097 (Sized_relobj::incremental_relocs_scan): Fix comment.
1098 (Sized_relobj::do_relocate): Pass output file offset to
1099 write_local_symbols.
1100 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1101 from class declaration.
1102 * script.cc (read_input_script): Allocate Script_info; pass
1103 argument serial number to report_script.
1104 * script.h (class Script_info): Move to incremental.h.
1105 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1106 * symtab.h (Symbol_table::add_from_incrobj): New function.
1107 (Symbol_table::set_file_offset): New function.
1108
b961d0d7
CC
11092011-04-05 Cary Coutant <ccoutant@google.com>
1110
1111 * incremental-dump.cc (dump_incremental_inputs): Change signature
1112 to take a Sized_incremental_binary; change caller. Use readers
1113 in Sized_incremental_binary.
1114 * incremental.cc
1115 (Sized_incremental_binary::find_incremental_inputs_sections):
1116 Rename do_find_incremental_inputs_sections to this.
1117 (Sized_incremental_binary::setup_readers): New function.
1118 (Sized_incremental_binary::do_check_inputs): Check
1119 has_incremental_info_ flag; move setup code to setup_readers;
1120 use input readers.
1121 (Sized_incremental_binary::do_file_is_unchanged): New function.
1122 (Sized_incremental_binary::do_get_input_reader): New function.
1123 * incremental.h (class Incremental_binary): Move to end of file.
1124 (Incremental_binary::file_is_unchanged): New function.
1125 (Incremental_binary::do_file_is_unchanged): New function.
1126 (Incremental_binary::Input_reader): New class.
1127 (Incremental_binary::get_input_reader): New function.
1128 (class Sized_incremental_binary): Move to end of file.
1129 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1130 input section reader classes.
1131 (Sized_incremental_binary::has_incremental_info): New function.
1132 (Sized_incremental_binary::inputs_reader): New function.
1133 (Sized_incremental_binary::symtab_reader): New function.
1134 (Sized_incremental_binary::relocs_reader): New function.
1135 (Sized_incremental_binary::got_plt_reader): New function.
1136 (Sized_incremental_binary::do_file_is_unchanged): New function.
1137 (Sized_incremental_binary::Sized_input_reader): New class.
1138 (Sized_incremental_binary::get_input_reader): New function.
1139 (Sized_incremental_binary::find_incremental_inputs_sections):
1140 Rename do_find_incremental_inputs_sections to this.
1141 (Sized_incremental_binary::setup_readers): New function.
1142 (Sized_incremental_binary::has_incremental_info_): New data member.
1143 (Sized_incremental_binary::inputs_reader_): New data member.
1144 (Sized_incremental_binary::symtab_reader_): New data member.
1145 (Sized_incremental_binary::relocs_reader_): New data member.
1146 (Sized_incremental_binary::got_plt_reader_): New data member.
1147 (Sized_incremental_binary::current_input_file_): New data member.
1148
a869183f
PP
11492011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1150
1151 PR gold/12640
1152 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1153 violation.
1154
11552011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1156
1157 * archive.cc (Archive::include_member): Adjust call to report_object.
1158 (Add_archive_symbols::run): Add script_info to call to
1159 report_archive_begin.
1160 (Lib_group::include_member): Adjust call to report_object.
1161 (Add_lib_group_symbols::run): Adjust call to report_object.
1162 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1163 blocks. Add object count for script input files.
1164 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1165 script_info parameter; change all callers.
1166 (Incremental_inputs::report_object): Add script_info parameter;
1167 change all callers.
1168 (Incremental_inputs::report_script): Store backpointer to
1169 incremental info entry.
1170 (Output_section_incremental_inputs::set_final_data_size): Record
1171 additional information for scripts.
1172 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1173 * incremental.h (Incremental_script_entry::add_object): New function.
1174 (Incremental_script_entry::get_object_count): New function.
1175 (Incremental_script_entry::get_object): New function.
1176 (Incremental_script_entry::objects_): New data member; adjust
1177 constructor.
1178 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1179 (Incremental_inputs::report_object): Add script_info parameter.
1180 (Incremental_inputs_reader::get_object_count): New function.
1181 (Incremental_inputs_reader::get_object_offset): New function.
1182 * options.cc (Input_arguments::add_file): Return reference to
1183 new input argument.
1184 * options.h (Input_argument::set_script_info): New function.
1185 (Input_argument::script_info): New function.
1186 (Input_argument::script_info_): New data member; adjust all
1187 constructors.
1188 (Input_file_group::add_file): Return reference to new input argument.
1189 (Input_file_lib::add_file): Likewise.
1190 (Input_arguments::add_file): Likewise.
1191 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1192 * script.cc (Parser_closure::Parser_closure): Add script_info
1193 parameter; adjust all callers.
1194 (Parser_closure::script_info): New function.
1195 (Parser_closure::script_info_): New data member.
1196 (read_input_script): Report scripts earlier to incremental info.
1197 (script_add_file): Set script_info in Input_argument.
1198 (script_add_library): Likewise.
1199 * script.h (Script_options::Script_info): Rewrite class.
1200
a869183f 12012011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1202
1203 * archive.cc (Library_base::should_include_member): Move
1204 method here from class Archive.
1205 (Archive::Archive): Initialize base class.
1206 (Archive::should_include_member): Move to base class.
1207 (Archive::do_for_all_unused_symbols): New function.
1208 (Add_archive_symbols::run): Remove redundant access to
1209 incremental_inputs.
1210 (Lib_group::Lib_group): Initialize base class.
1211 (Lib_group::do_filename): New function.
1212 (Lib_group::include_member): Pass pointer to Lib_group to
1213 report_object.
1214 (Lib_group::do_for_all_unused_symbols): New function.
1215 (Add_lib_group_symbols::run): Report archive information for
1216 incremental links.
1217 * archive.h (class Library_base): New base class.
1218 (class Archive): Derive from Library_base.
1219 (Archive::filename): Move to base class.
1220 (Archive::set_incremental_info): Likewise.
1221 (Archive::incremental_info): Likewise.
1222 (Archive::Should_include): Likewise.
1223 (Archive::should_include_member): Likewise.
1224 (Archive::Armap_entry): Remove.
1225 (Archive::Unused_symbol_iterator): Remove.
1226 (Archive::unused_symbols_begin): Remove.
1227 (Archive::unused_symbols_end): Remove.
1228 (Archive::do_filename): New function.
1229 (Archive::do_get_mtime): New function.
1230 (Archive::do_for_all_unused_symbols): New function.
1231 (Archive::task_): Move to base class.
1232 (Archive::incremental_info_): Likewise.
1233 (class Lib_group): Derive from Library_base.
1234 (Lib_group::do_filename): New function.
1235 (Lib_group::do_get_mtime): New function.
1236 (Lib_group::do_for_all_unused_symbols): New function.
1237 (Lib_group::task_): Move to base class.
1238 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1239 function.
1240 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1241 function.
1242 * incremental.cc (Incremental_inputs::report_archive_begin):
1243 Use Library_base; call library's get_mtime; add incremental inputs
1244 entry before members.
1245 (class Unused_symbol_visitor): New class.
1246 (Incremental_inputs::report_archive_end): Use Library_base; use
1247 visitor class to record unused symbols; don't add incremental inputs
1248 entry after members.
1249 (Incremental_inputs::report_object): Use Library_base.
1250 * incremental.h
1251 (Incremental_archive_entry::Incremental_archive_entry): Remove
1252 unused Archive parameter.
1253 (Incremental_inputs::report_archive_begin): Use Library_base.
1254 (Incremental_inputs::report_archive_end): Likewise.
1255 (Incremental_inputs::report_object): Likewise.
1256 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1257 function.
1258 * object.h (Object::for_all_global_symbols): New function.
1259 (Object::do_for_all_global_symbols): New function.
1260 (Sized_relobj::do_for_all_global_symbols): New function.
1261 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1262 function.
1263 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1264 function.
1265
61ab3e40
ILT
12662011-03-27 Ian Lance Taylor <iant@google.com>
1267
1268 * archive.cc (Archive::interpret_header): Return -1 if something
1269 goes wrong. Change callers accordingly.
1270
30e1f9e6
CC
12712011-03-25 Cary Coutant <ccoutant@google.com>
1272
1273 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1274 * testsuite/Makefile.in: Regenerate.
1275
9c793f14
RÁE
12762010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1277
1278 * plugin.cc (get_view): New.
1279 (Plugin::load): Pass get_view to the plugin.
1280 (Plugin_manager::get_view): New.
1281
9312bb0a
ILT
12822011-03-21 Ian Lance Taylor <iant@google.com>
1283
1284 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1285 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1286
7e12ba9e
ST
12872011-03-21 Sriraman Tallam <tmsriram@google.com>
1288
1289 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1290 Change == to -eq.
1291 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1292 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1293 Change == to -eq.
1294 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1295 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1296
fd7a005d
ILT
12972011-03-14 Ian Lance Taylor <iant@google.com>
1298
1299 * script-sections.cc (Sort_output_sections::script_compare):
1300 Rename from is_before, change return type.
1301 (Sort_output_sections::operator()): Adjust accordingly.
1302
ed16fd1b
ILT
13032011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1304
1305 PR gold/12572
1306 * testsuite/odr_violation2.cc: Add comment to make all error line
1307 numbers double digits.
1308 * testsuite/debug_msg.sh: Adjust expected errors.
1309
71ff8986
ILT
13102011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1311
1312 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1313 but mark earlier ones as non-canonical
1314 (offset_to_iterator): Update search target and example
1315 (do_addr2line): Return extra lines in a vector*
1316 (format_file_lineno): Extract from do_addr2line
1317 (one_addr2line): Add vector* out-param
1318 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1319 when a lineno entry appeared last for its instruction
1320 (Dwarf_line_info): Add vector* out-param
1321 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1322 * symtab.cc (Odr_violation_compare): Include the lineno in the
1323 comparison again.
1324 (linenos_from_loc): New. Combine the canonical line for an
1325 address with its other lines.
1326 (True_if_intersect): New. Helper functor to make
1327 std::set_intersection a query.
1328 (detect_odr_violations): Compare sets of lines instead of just
1329 one line for each function. This became less deterministic, but
1330 has fewer false positives.
1331 * symtab.h: Declarations.
1332 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1333 mix an optimized and non-optimized object in the same binary
1334 (odr_violation2.so): Same.
1335 * testsuite/Makefile.in: Regenerate from Makefile.am.
1336 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1337 * testsuite/debug_msg.sh: Update line numbers and add
1338 assertions.
1339 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1340 non-optimized context.
1341 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1342 isn't inlined, and use OdrDerived in an optimized context.
1343 * testsuite/odr_header1.h: Defines OdrDerived, where
1344 optimization will change the
1345 first-instruction-in-the-destructor's file and line number.
1346 * testsuite/odr_header2.h: Defines OdrBase.
1347
a19fefdc
ILT
13482011-03-09 Ian Lance Taylor <iant@google.com>
1349
1350 * fileread.cc (File_read::clear_views): Don't delete the whole
1351 file view.
1352
ecb351e9
ILT
13532011-03-08 Ian Lance Taylor <iant@google.com>
1354
1355 PR gold/12525
1356 * fileread.cc: #include <climits>.
1357 (GOLD_IOV_MAX): Define.
1358 (File_read::read_multiple): Limit number of entries by iov_max.
1359 * fileread.h (class File_read): Always set max_readv_entries to
1360 128.
1361
b821d13c
ILT
13622011-03-07 Ian Lance Taylor <iant@google.com>
1363
1364 PR gold/12525
1365 * options.h (class General_options): Add -dy and -dn.
1366
89243142
CC
13672011-03-02 Cary Coutant <ccoutant@google.com>
1368
1369 * testsuite/script_test_9.t: Add TLS segment.
1370
d0773f31
ILT
13712011-03-02 Simon Baldwin <simonb@google.com>
1372
1373 * configure.ac: Add check for gnu_indirect_function support in
1374 the toolchain building binutils.
1375 * configure: Rebuild.
1376
badc8139
RÁE
13772010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1378
1379 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1380 plugin only symbols.
1381 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1382 in plugin files as not needed in the symbol table.
1383
4cf7a849
ST
13842011-02-11 Sriraman Tallam <tmsriram@google.com>
1385
1386 * output.cc (Output_section::add_input_section): Delay fill
1387 generation for section ordering.
1388
b578bd7d
ILT
13892011-02-09 Ian Lance Taylor <iant@google.com>
1390
1391 PR gold/12316
1392 * object.h (class Sized_relobj): Remove clear_local_symbols.
1393 * reloc.cc (Sized_relobj::do_relocate): Don't call
1394 clear_local_symbols.
1395
84ced98a
RÁE
13962010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1397
1398 * plugin.cc (is_visible_from_outside): Return true for symbols
1399 in the -u option.
1400
55382fb7
ILT
14012011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1402
1403 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1404 filename.
1405
4e271fff
ST
14062011-02-02 Sriraman Tallam <tmsriram@google.com>
1407
1408 * icf.h (is_section_foldable_candidate): Change type of parameter
1409 to std::string.
1410 * icf.cc (Icf::find_identical_sections): Change type of local variable
1411 section_name to be std::string.
1412 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1413
d433c3ac
ILT
14142011-01-25 Ian Lance Taylor <iant@google.com>
1415
1416 * script.cc (script_add_extern): Rewrite to use
1417 add_symbol_reference.
1418
880473a6
DK
14192011-01-25 Doug Kwan <dougkwan@google.com>
1420
d433c3ac 1421 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1422
f30f86fa
ILT
14232011-01-24 Ian Lance Taylor <iant@google.com>
1424
1425 * options.h (class General_options): Accept
1426 --no-detect-odr-violations.
1427
8e51a0b9
ILT
14282011-01-24 Ian Lance Taylor <iant@google.com>
1429
1430 * version.cc (version_string): Bump to 1.11.
1431
0f3b89d8
ILT
14322011-01-24 Ian Lance Taylor <iant@google.com>
1433
1434 * plugin.cc (class Plugin_rescan): Define new class.
1435 (Plugin_manager::claim_file): Set any_claimed_.
1436 (Plugin_manager::save_archive): New function.
1437 (Plugin_manager::save_input_group): New function.
1438 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1439 necessary.
1440 (Plugin_manager::new_undefined_symbol): New function.
1441 (Plugin_manager::rescan): New function.
1442 (Plugin_manager::rescannable_defines): New function.
1443 (Plugin_manager::add_input_file): Set any_added_.
1444 * plugin.h (class Plugin_manager): define new fields rescannable_,
1445 undefined_symbols_, any_claimed_, and any_added_. Declare
1446 Plugin_rescan as friend. Declare new functions.
1447 (Plugin_manager::Rescannable): Define type.
1448 (Plugin_manager::Rescannable_list): Define type.
1449 (Plugin_manager::Undefined_symbol_list): Define type.
1450 (Plugin_manager::Plugin_manager): Initialize new fields.
1451 * archive.cc (Archive::defines_symbol): New function.
1452 (Add_archive_symbols::run): Pass archive to plugins if any.
1453 * archive.h (class Archive): Declare defines_symbol.
1454 * readsyms.cc (Input_group::~Input_group): New function.
1455 (Finish_group::run): Pass input_group to plugins if any.
1456 * readsyms.h (class Input_group): Declare destructor.
1457 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1458 any.
1459
3bb951e5
ILT
14602011-01-10 Ian Lance Taylor <iant@google.com>
1461
1462 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1463 section as relro.
1464 (Layout::set_segment_offsets): Reset increase_relro before calling
1465 set_section_addresses a second time.
1466
0aa45fac
CC
14672011-01-04 Cary Coutant <ccoutant@google.com>
1468
1469 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1470 sections before NOBITS sections.
1471
0db46eb4
L
14722011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1473
1474 * version.cc (print_version): Update copyright to 2011.
1475
829c9745
CC
14762010-12-23 Cary Coutant <ccoutant@google.com>
1477
1478 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1479 of OS to this->add. Add OD parameter to second form of the function.
1480
7500420b
ILT
14812010-12-20 Ian Lance Taylor <iant@google.com>
1482
1483 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1484 second of two consecutive entries with same offset.
1485
f8e9a930
RW
14862010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1487
1488 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1489 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1490 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1491 to avoid unneeded links against $(LDADD).
1492 * testsuite/Makefile.in: Regenerate.
1493
2fbb4320
ILT
14942010-12-15 Ian Lance Taylor <iant@google.com>
1495
1496 PR gold/12324
1497 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1498 for R_X86_64_32 and R_X86_64_PC32.
1499 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1500 ver_matching_def_pic.o.
1501 (ver_matching_def_pic.o): New target.
1502
fedb228d
RW
15032010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1504
1505 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1506 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1507 Move definition before File_read::View member definitions.
1508 (File_read::View::~View): Initialize and hold lock before
1509 updating current_mapped_bytes.
1510
9b547ce6
RW
15112010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1512
1513 * dwarf_reader.cc: Remove outdated comment.
1514 * gold-threads.cc: Fix typo in error message.
1515 * archive.cc: Fix typos in comments.
1516 * archive.h: Likewise.
1517 * arm-reloc-property.cc: Likewise.
1518 * arm-reloc-property.h: Likewise.
1519 * arm-reloc.def: Likewise.
1520 * arm.cc: Likewise.
1521 * attributes.h: Likewise.
1522 * cref.cc: Likewise.
1523 * ehframe.cc: Likewise.
1524 * fileread.h: Likewise.
1525 * gold.h: Likewise.
1526 * i386.cc: Likewise.
1527 * icf.cc: Likewise.
1528 * incremental.h: Likewise.
1529 * int_encoding.cc: Likewise.
1530 * layout.h: Likewise.
1531 * main.cc: Likewise.
1532 * merge.h: Likewise.
1533 * object.cc: Likewise.
1534 * object.h: Likewise.
1535 * options.cc: Likewise.
1536 * readsyms.cc: Likewise.
1537 * reduced_debug_output.cc: Likewise.
1538 * reloc.cc: Likewise.
1539 * script-sections.cc: Likewise.
1540 * sparc.cc: Likewise.
1541 * symtab.h: Likewise.
1542 * target-reloc.h: Likewise.
1543 * target.cc: Likewise.
1544 * target.h: Likewise.
1545 * timer.cc: Likewise.
1546 * timer.h: Likewise.
1547 * x86_64.cc: Likewise.
1548
83e17bd5
CC
15492010-12-09 Cary Coutant <ccoutant@google.com>
1550
1551 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1552 stack.
1553 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1554 parameter; change all callers.
1555 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1556 * options.h (warn_execstack): New option.
1557
017257f8
DK
15582010-12-07 Doug Kwan <dougkwan@google.com>
1559
1560 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1561 like function call relocations.
1562
c20cbc06
ILT
15632010-12-07 Ian Lance Taylor <iant@google.com>
1564
1565 * archive.cc (Archive::get_elf_object_for_member): Permit
1566 punconfigured to be NULL.
1567 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1568 (Archive::include_member): Pass NULL to get_elf_object_for_member
1569 if we searched for the archive and this is the first included
1570 object.
1571
4dbfafcc
ILT
15722010-12-01 Ian Lance Taylor <iant@google.com>
1573
1574 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1575 track_relocs_type_ field.
1576 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1577 Set track_relocs_type_.
1578 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1579 contents when using RELA relocs.
1580 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1581 reloc_map_.
1582 * reloc.cc (Track_relocs::next_addend): New function.
1583 * reloc.h (class Track_relocs): Declare next_addend.
1584
e5e19edd
ILT
15852010-12-01 Ian Lance Taylor <iant@google.com>
1586
1587 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1588 virtual destructor.
1589
9a5ce24c
ILT
15902010-12-01 Ian Lance Taylor <iant@google.com>
1591
1592 * README: Update compilers known to work and fail.
1593
c7791212
NC
15942010-11-23 Matthias Klose <doko@ubuntu.com>
1595
1596 * configure.in: For --enable-gold, handle value `default' instead of
1597 `both*'. Always install ld as ld.bfd, install as ld if gold is
1598 not the default.
1599 * configure: Regenerate.
1600
0ad220c9
DK
16012010-11-18 Doug Kwan <dougkwan@google.com>
1602
1603 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1604 and right_alignment to be zero. Store result alignment only if it is
1605 greater than existing alignment.
1606
ab8056e0
CC
16072010-11-16 Cary Coutant <ccoutant@google.com>
1608
1609 PR gold/12220
1610 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1611 Check for ".zdebug_line".
1612
fd064a5b
CC
16132010-11-16 Doug Kwan <dougkwan@google.com>
1614 Cary Coutant <ccoutant@google.com>
1615
1616 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1617 by reference; adjust all callers.
1618 * output.cc (Output_segment::set_section_addresses): Adjust references
1619 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1620 list is empty.
1621 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1622 end at page boundary.
1623
6fc6ea19
CC
16242010-11-16 Cary Coutant <ccoutant@google.com>
1625
1626 PR gold/12220
1627 * layout.cc (Layout::choose_output_section): Transform names of
1628 compressed sections even when using a script with a SECTIONS clause.
1629 (Layout::output_section_name): Remove code to transform
1630 compressed debug section names.
1631 * output.cc (Output_section::add_input_section): Use uncompressed
1632 section size when tracking input sections.
1633
95a2c8d6
RS
16342010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1635
1636 * symtab.h (Symbol::NON_PIC_REF): Remove.
1637 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1638 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1639 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1640 (Symbol::use_plt_offset): Take a flags argument and pass it
1641 directly to needs_dynamic_reloc. Restrict check for undefined
1642 weak symbols to function calls.
1643 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1644 (Target_arm::Scan::global): Use it.
1645 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1646 (Target_arm::Relocate::relocate): Likewise.
1647 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1648 parameter with an r_type parameter. Use get_reference_flags
1649 to get the flags.
1650 (Target_arm::Relocate::relocate): Update accordingly.
1651 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1652 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1653 (Target_i386::Scan::global): Likewise.
1654 (Target_i386::Relocate::relocate): Likewise.
1655 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1656 parameter with an r_type parameter. Use get_reference_flags
1657 to get the flags.
1658 (Target_i386::Relocate::relocate): Update accordingly.
1659 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1660 (Target_powerpc::Scan::global): Use it.
1661 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1662 (Target_powerpc::Relocate::relocate): Likewise.
1663 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1664 (Target_sparc::Scan::global): Use it.
1665 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1666 (Target_sparc::Relocate::relocate): Likewise.
1667 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1668 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1669 (Target_x86_64::Scan::global): Likewise.
1670 (Target_x86_64::Relocate::relocate): Likewise.
1671
f625ae50
DK
16722010-11-08 Doug Kwan <dougkwan@google.com>
1673 Cary Coutant <ccoutant@google.com>
1674
1675 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1676 (Arm_exidx_merge_section::section_contents_): New data member.
1677 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1678 (Arm_input_section::~Arm_input_section): De-allocate memory.
1679 (Arm_input_section::original_contents_): New data member.
1680 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1681 in parameters instead of calling Object::section_contents without
1682 locking.
1683 (Arm_output_section::group_section): New parameter TASK. Pass it
1684 to callees that need locking objects.
1685 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1686 to lock EXIDX input sections. Fix a formatting issue. Call
1687 Arm_exidx_merged_section::build_contents to create merged section
1688 contents.
1689 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1690 to lock object of stub table owner.
1691 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1692 TEXT_SIZE to initialize data member TEXT_SIZE_.
1693 (Arm_exidx_input_section::addralign): Fix typo in comment.
1694 (Arm_exidx_input_section::text_size): New method.
1695 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1696 that require locking objects. Lock objects before scanning for stubs
1697 and updating local symbols.
1698 (Arm_input_section<big_endian>::init): Copy contents of original
1699 input section.
1700 (Arm_input_section<big_endian>::do_write): Use saved contents of
1701 original input section instead of calling Object::section_contents
1702 without locking.
1703 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1704 size without calling Object::section_size().
1705 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1706 for size. Allocate a buffer for merged EXIDX entries.
1707 (Arm_exidx_merged_section::build_contents): New method.
1708 (Arm_exidx_merged_section::do_write): Move merge section contents
1709 building code to Arm_exidx_merged_section::build_contetns. Write
1710 out contetns in buffer instead of building it on the fly.
1711 (Arm_relobj::make_exidx_input_section): Also pass text section size
1712 to Arm_exidx_input_section constructor.
1713 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1714 (Arm_dynobj::do_read_symbols): Fix memory leak.
1715 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1716 * target.h: (class Task): Add forward declaration.
1717 (Target::relax): Add new parameter TASK and pass it to
1718 Target::do_relax().
1719 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1720
5f9bcf58
CC
17212010-11-05 Cary Coutant <ccoutant@google.com>
1722
1723 PR gold/10708
1724 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1725 object when reading from the file.
1726 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1727 second layout pass.
1728 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1729 when reading section contents.
1730 (get_section_contents): Likewise.
1731 (icf::find_identical_sections): Likewise.
1732 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1733 object when reading from the file.
1734 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1735 the object when doing deferred section layout.
1736
e597fa08
NC
17372010-11-03 Nick Clifton <nickc@redhat.com>
1738
1739 PR gold/12001
1740 * script.h (class Symbol_assignment: name): New member. Returns
1741 the name of the symbol.
1742 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1743 Returns true if the given symbol name is on the list of
1744 assignments wating to be processed.
1745 * archive.cc (should_incldue_member): If the symbol is undefined,
1746 check to see if it is on the list of symbols pending assignment.
1747
3f9a3278
ILT
17482010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1749
1750 * script-sections.cc (Script_sections::find_memory_region): Check
1751 for a NULL output section pointer.
1752
d06fb4d1
DK
17532010-10-29 Doug Kwan <dougkwan@google.com>
1754
1755 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1756 Output_section::add_relaxed_input_section.
1757 * output.cc (Output_section::add_relaxed_input_section): Add new
1758 arguments LAYOUT and NAME. Set section order index.
1759 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1760 Copy section order index.
1761 * output.h (Output_section::add_relaxed_input_section): Add new
1762 arguments LAYOUT and NAME.
1763
90e24de5
ILT
17642010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1765
1766 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1767 NATIVE_OR_CROSS_LINKER.
1768 * testsuite/Makefile.in: Regenerate.
1769
c9484ea5
DK
17702010-10-20 Doug Kwan <dougkwan@google.com>
1771
1772 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1773 without SHF_LINK_ORDER flags.
1774 * layout.cc (Layout::choose_output_section): Do not filter
1775 SHF_LINK_ORDER flag in a relocatable link.
1776
5bc2f5be
CC
17772010-10-17 Cary Coutant <ccoutant@google.com>
1778
1779 * output.h (Output_segment::set_section_addresses): Change function
1780 signature. Update all callers.
1781 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1782 sections.
1783 (Output_segment::set_section_addresses): Align after last TLS
1784 section. Add padding before last relro section instead of after.
1785
0c91cf04
DK
17862010-10-17 Doug Kwan <dougkwan@google.com>
1787
1788 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1789 GOT output section to be writable.
1790
8c21d9d3
CC
17912010-10-14 Cary Coutant <ccoutant@google.com>
1792
1793 * debug.h (DEBUG_INCREMENTAL): New flag.
1794 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1795 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1796 mode.
1797 * incremental.cc (report_command_line): Ignore all forms of
1798 --incremental.
1799 * layout.cc (Layout::Layout): Check parameters for incremental link
1800 mode.
1801 * options.cc (General_options::parse_incremental): New function.
1802 (General_options::parse_no_incremental): New function.
1803 (General_options::parse_incremental_full): New function.
1804 (General_options::parse_incremental_update): New function.
1805 (General_options::incremental_mode_): New data member.
1806 (General_options::finalize): Check incremental_mode_.
1807 * options.h (General_options): Update help text for --incremental.
1808 Add --no-incremental, --incremental-full, --incremental-update.
1809 (General_options::Incremental_mode): New enum type.
1810 (General_options::incremental_mode): New function.
1811 (General_options::incremental_mode_): New data member.
1812 * parameters.cc (Parameters::incremental_mode_): New data member.
1813 (Parameters::set_options): Set incremental_mode_.
1814 (Parameters::set_incremental_full): New function.
1815 (Parameters::incremental): New function.
1816 (Parameters::incremental_update): New function.
1817 (set_parameters_incremental_full): New function.
1818 * parameters.h (Parameters::set_incremental_full): New function.
1819 (Parameters::incremental): New function.
1820 (Parameters::incremental_update): New function.
1821 (Parameters::incremental_mode_): New data member.
1822 (set_parameters_incremental_full): New function.
1823 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1824 incremental link mode.
1825 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1826 (Sized_relobj::do_relocate_sections): Likewise.
1827 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1828 option.
1829 * testsuite/Makefile.in: Regenerate.
1830 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1831
bb32aa18 18322010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1833
1834 * script-sections.h (class Script_sections): Make
1835 Sections_elements typedef public.
1836 * script-sections.cc (class Sort_output_sections): Add elements_
1837 field. Add constructor which sets it; change all callers.
1838 (Sort_output_sections::is_before): New function.
1839 (Sort_output_sections::operator()): Call is_before.
1840 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1841 conditional.
1842 * testsuite/script_test_10.sh: New test. Test script section
1843 order.
1844 * testsuite/script_test_10.t: Likewise.
1845 * testsuite/script_test_10.s: Likewise.
1846 * testsuite/Makefile.am: Wrap the cross linker tests and the
1847 common tests into NATIVE_OR_CROSS_LINKER.
1848 (check_SCRIPTS): Add script_test_10.sh.
1849 (check_DATA): Add script_test_10.stdout.
1850 (script_test_10.o, script_test_10): New targets.
1851 (script_test_10.stdout): New target.
1852 * configure, testsuite/Makefile.in: Regenerate.
1853
3cef7179
ILT
18542010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1855
1856 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1857 error for the deprecated relocations.
1858 (Target_arm::Scan::global): Likewise.
1859 (Target_arm::Relocate::relocate): Likewise.
1860
7411e9a8
RS
18612010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1862
1863 * fileread.cc (Input_file::find_file): Initialize *found_name
1864 and *namep when using the fallback search for case 4.
1865
6a9da32a
CC
18662010-10-11 Cary Coutant <ccoutant@google.com>
1867
1868 * options.h (class General_options): Redefine -z lazy as an alias for
1869 the negation of -z now.
1870
ac897c20
ILT
18712010-10-11 Ian Lance Taylor <iant@google.com>
1872
1873 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1874 binding.
1875
ea5cae92
NC
18762010-10-06 Nick Clifton <nickc@redhat.com>
1877
1878 * script-sections.cc(class Memory_region): Remove
1879 current_lma_offset_ field. Rename current_vma_offset_ to
1880 current_offset_. Add last_section_ field.
1881 (Memory_region::get_current_vma_address): Rename to
1882 get_current_address.
1883 (Memory_region::get_current_lma_address): Delete.
1884 (Memory_region::increment_vma_offset): Rename to
1885 increment_offset.
1886 (Memory_region::increment_lma_offset): Delete.
1887 (Memory_region::attributes_compatible): New method. Returns
1888 true if the provided section is compatible with the region.
1889 (Memory_region::get_last_section): New method. Returns the last
1890 section to use the region.
1891 (Memory_region::set_last_section): New method. Stores the last
1892 section to use the region.
1893 (Script_sections::block_in_region): New method. Returns true if
1894 a block of memory is contained within a region.
1895 (Script_sections::find_memory_region): New method. Locates a
1896 memory region to be used to set a VMA or LMA address.
1897 (Output_section_definition::set_section_addresses): Add code to
1898 check for addresses set by memory regions.
1899 (Output_segment::set_section_addresses): Remove memory region
1900 walking code.
1901 (Script_sections::create_segment): Add a warning if a header
1902 segment is created outside of any region.
1903 * script-sections.h (class Script_sections): Add prototypes for
1904 find_memory_region and block_in_region methods.
1905 * testsuite/memory_test.s: Use .long instead of .word.
1906 * testsuite/memory_test.t: Add some more output sections.
1907 * testsuite/memory_test.sh: Update expected output.
1908
a9bfd952
DK
19092010-10-02 Doug Kwan <dougkwan@google.com>
1910
1911 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1912 defintion to symtab.h
1913 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1914 declaration to defintion.
1915
bacff3ab
NC
19162010-10-01 Nick Clifton <nickc@redhat.com>
1917
1918 * expression.cc (eval): Replace dummy argument with NULL.
1919 (eval_maybe_dot): Check for a NULL result section pointer.
1920 (Symbol_expression::value): Likewise.
1921 (Dot_expression::value): Likewise.
1922 (BINARY_EXPRESSION): Likewise.
1923 (Max_expression::value): Likewise.
1924 (Min_expression::value): Likewise.
1925 (Absolute_expression::value): Likewise.
1926 (Addr_expression::value_from_output_section): Likewise.
1927 (Loaddddr_expression::value_from_output_section): Likewise.
1928 (Segment_start_expression::value): Likewise.
1929 * script-sections.cc
1930 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1931 argument with NULL.
1932 (Sections_elememt_dot_assignment::set_section_addresses):
1933 Likewise.
1934 (Output_data_expression::do_write_to_buffer): Likewise.
1935 (Output_section_definition::finalize_symbols): Likewise.
1936 (Output_section_definition::set_section_addresses): Likewise.
1937
f81bc8b5
DK
19382010-09-30 Doug Kwan <dougkwan@google.com>
1939
1940 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1941
c95e9f27
ST
19422010-09-28 Sriraman Tallam <tmsriram@google.com>
1943
1944 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1945 function.
c95e9f27
ST
1946 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1947 virtual function.
1948 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1949 virtual function.
1950 * icf.cc (get_section_contents): Inline merge sections only when
1951 target allows it.
1952
3cac54d2
RW
19532010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1954
1955 * configure: Regenerate.
1956
2904037a
ILT
19572010-09-17 Ian Lance Taylor <iant@google.com>
1958
1959 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1960 * testsuite/Makefile.am (memory_test.o): New target.
1961 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1962 memory_test.t.
1963 * testsuite/Makefile.in: Rebuild.
2904037a 1964
bca7fb63
DK
19652010-09-17 Doug Kwan <dougkwan@google.com>
1966
1967 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1968 defintion if relocation uses GOT entries of the symbol.
1969 * testsuite/icf_safe_test.sh: Fix test.
1970 * testsuite/icf_safe_so_test.sh: Fix test.
1971
4ef28648
CC
19722010-09-16 Cary Coutant <ccoutant@google.com>
1973
1974 * script_sections.cc (class Memory_region): Remove "NULL" from
1975 vector initializations.
1976
793990de
CC
19772010-09-15 Cary Coutant <ccoutant@google.com>
1978
1979 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1980 Resolve forwarding symbols.
1981
81e015e2
DK
19822010-09-15 Doug Kwan <dougkwan@google.com>
1983
1984 * gold/testsuite/script_test_3.t: Add ARM special sections.
1985 * gold/testsuite/script_test_4.t: Same.
1986 * gold/testsuite/script_test_5.t: Same.
1987 * gold/testsuite/script_test_6.t: Same.
1988 * gold/testsuite/script_test_7.t: Same.
1989 * gold/testsuite/script_test_7.t: Same.
1990 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1991
36171d64
CC
19922010-09-14 Cary Coutant <ccoutant@google.com>
1993
1994 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1995 (Target_x86_64::Relocate::relocate_tls): Replace check for
1996 saw_tls_block_reloc_ with test for executable section.
1997
d89051bd
CC
19982010-09-12 Cary Coutant <ccoutant@google.com>
1999
2000 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2001 position-independent executables to shared libraries need dynamic
2002 relocations.
2003 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2004 position-independent executables.
2005 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2006 * testsuite/Makefile.in: Regenerate.
2007
fca41f0f
NC
20082010-09-10 Nick Clifton <nickc@redhat.com>
2009
2010 PR gold/11997
2011 * testsuite/memory_test.t: Discard any sections that are not
2012 needed.
2013
6695e4b3
L
20142010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2015
2016 PR gold/11996
2017 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2018 "This::" to work around a bug in gcc 4.2.
2019
2020 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2021
0f72bf6f
RÁE
20222010-09-09 Rafael Espindola <espindola@google.com>
2023
2024 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2025 sections with different PF_X flags in the same segment.
2026 (Layout::find_first_load_seg): Search all segments to find the first
2027 one.
2028 * options.h (rosegment): New.
2029
20302010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2031
05a79166 2032 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2033
aa98ff75
DK
20342010-09-08 Doug Kwan <dougkwan@google.com>
2035
2036 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2037 (Arm_relobj::do_relocate_sections): Add new parameter for output
2038 file to match the parent.
2039 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2040 of local symbols instead of input values. Update code to track
2041 changes in gold::relocate_section.
2042 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2043 (Sized_relobj::compute_final_local_value_internal): New methods.
2044 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2045 body into private version of Sized_relobj::compute_final_local_value.
2046 Call the inline method.
2047 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2048 merged symbol value if there is one.
2049 (Symbol_value::has_output_value): New method defintiion.
2050 (Sized_relobj::Compute_final_local_value_status): New enum type.
2051 (Sized_relobj::compute_final_local_value): New methods.
2052 (Sized_relobj::compute_final_local_value_internal): New methods.
2053 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2054 and arm_cortex_a8.sh.
2055 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2056 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2057 New tests.
2058 * Makefile.in: Regenerate.
2059 * testsuite/arm_bl_out_of_range.s: Update test.
2060 * testsuite/thumb_bl_out_of_range.s: Ditto.
2061 * testsuite/thumb_blx_out_of_range.s: Ditto.
2062 * testsuite/arm_branch_out_of_range.sh: New file.
2063 * testsuite/arm_cortex_a8.sh: Ditto.
2064 * testsuite/arm_cortex_a8_b.s: Ditto.
2065 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2066 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2067 * testsuite/arm_cortex_a8_bl.s: Ditto.
2068 * testsuite/arm_cortex_a8_blx.s: Ditto.
2069 * testsuite/arm_cortex_a8_local.s: Ditto.
2070 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2071 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2072
05a79166
L
20732010-09-08 Rafael Espindola <espindola@google.com>
2074
2075 * Makefile.am (memory_test.stdout): Run readelf with -W.
2076 * Makefile.in: Regenerate.
2077 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2078 64 bit output.
2079
33dbc701
RÁE
20802010-09-08 Rafael Espindola <espindola@google.com>
2081
2082 * script-sections.cc (Script_sections::add_memory_region): Convert
2083 field precision to int.
2084 * script.cc (script_set_section_region, script_set_section_region):
2085 Convert field precision to int.
2086
731ca54a
RÁE
20872010-09-08 Rafael Espindola <espindola@google.com>
2088
2089 * arm.cc (do_finalize_sections): Create the __exidx_start and
2090 __exdix_end symbols even when the section is missing.
2091
7f8cd844
NC
20922010-09-08 Nick Clifton <nickc@redhat.com>
2093
2094 * README: Remove claim that MEMORY is not supported.
2095 * expression.cc (script_exp_function_origin)
2096 (script_exp_function_length): Move from here to ...
2097 * script.cc: ... here.
2098 (script_set_section_region, script_add_memory)
2099 (script_parse_memory_attr, script_include_directive): New
2100 functions.
2101 * script-sections.cc
2102 (class Memory_region): New class.
2103 (class Output_section_definition): Add set_memory_region,
2104 set_section_vma, set_section_lma and get_section_name methods.
2105 (class Script_Sections): Add add_memory_region,
2106 find_memory_region, find_memory_region_origin,
2107 find_memory_region_length and set_memory_region methods.
2108 Have set_section_addresses method walk the list of set memory
2109 regions.
2110 Extend the print methos to display memory regions.
2111 * script-sections.h: Add prototypes for new methods.
2112 Add enum for MEMORY region attributes.
2113 * yyscript.y: Add support for parsing MEMORY regions.
2114 * script-c.h: Add prototypes for new functions.
2115 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2116 * testsuite/Makefile.in: Regenerate.
2117 * testsuite/memory_test.sh: New script.
2118 * testsuite/memory_test.s: New assembler source file.
2119 * testsuite/memory_test.t: New linker script.
2120
a4649286
DK
21212010-08-27 Doug Kwan <dougkwan@google.com>
2122
2123 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2124 reference override an existing dynamic weak reference.
2125 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2126 * testsuite/Makefile.in: Regenerate.
2127 * testsuite/dyn_weak_ref.sh: New file.
2128 * testsuite/dyn_weak_ref_1.c: Ditto.
2129 * testsuite/dyn_weak_ref_2.c: Ditto.
2130
b56648ad
ILT
21312010-08-27 Ian Lance Taylor <iant@google.com>
2132
2133 * incremental.h (class Incremental_input_entry): Add virtual
2134 destructor.
2135
809313cb
ILT
21362010-08-27 Ian Lance Taylor <iant@google.com>
2137
2138 * testsuite/start_lib_test_3.c: Mark t3 as used.
2139
11e32464
NC
21402010-08-27 Nick Clifton <nickc@redhat.com>
2141
2142 * options.cc (version_script): Fix small typo in previous
2143 whitespace tidyup.
2144
ca09d69a
NC
21452010-08-25 Nick Clifton <nickc@redhat.com>
2146
2147 * archive.cc: Formatting fixes: Remove whitespace between
2148 typename and following asterisk. Remove whitespace between
2149 function name and opening parenthesis.
2150 * archive.h: Likewise.
2151 * arm.cc: Likewise.
2152 * attributes.cc: Likewise.
2153 * attributes.h: Likewise.
2154 * common.cc: Likewise.
2155 * copy-relocs.cc: Likewise.
2156 * dirsearch.h: Likewise.
2157 * dynobj.cc: Likewise.
2158 * ehframe.cc: Likewise.
2159 * ehframe.h: Likewise.
2160 * expression.cc: Likewise.
2161 * fileread.cc: Likewise.
2162 * fileread.h: Likewise.
2163 * gc.h: Likewise.
2164 * gold-threads.cc: Likewise.
2165 * gold.cc: Likewise.
2166 * i386.cc: Likewise.
2167 * icf.h: Likewise.
2168 * incremental-dump.cc: Likewise.
2169 * incremental.cc: Likewise.
2170 * layout.cc: Likewise.
2171 * layout.h: Likewise.
2172 * main.cc: Likewise.
2173 * merge.cc: Likewise.
2174 * merge.h: Likewise.
2175 * object.cc: Likewise.
2176 * object.h: Likewise.
2177 * options.cc: Likewise.
2178 * options.h: Likewise.
2179 * output.cc: Likewise.
2180 * output.h: Likewise.
2181 * plugin.cc: Likewise.
2182 * plugin.h: Likewise.
2183 * powerpc.cc: Likewise.
2184 * reloc.cc: Likewise.
2185 * script-c.h: Likewise.
2186 * script-sections.cc: Likewise.
2187 * script.cc: Likewise.
2188 * stringpool.cc: Likewise.
2189 * symtab.cc: Likewise.
2190 * symtab.h: Likewise.
2191 * target.cc: Likewise.
2192 * timer.cc: Likewise.
2193 * timer.h: Likewise.
2194 * version.cc: Likewise.
2195 * x86_64.cc: Likewise.
2196
b8fa8750
NC
21972010-08-24 Nick Clifton <nickc@redhat.com>
2198
2199 PR 11899
2200 * layout.cc (segment_precedes): Sort segments by their physical
2201 addresses, if they have been set.
2202
9919d93b
CC
22032010-08-23 Cary Coutant <ccoutant@google.com>
2204
2205 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2206 symbols data.
2207 (Lib_group::include_member): Unlock object after deleting its
2208 symbols data.
2209 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2210 the bug fixed here.
2211
97b4be1c
CC
22122010-08-19 Neil Vachharajani <nvachhar@google.com>
2213 Cary Coutant <ccoutant@google.com>
2214
2215 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2216 constructor, and set_blocker.
2217 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2218 readsyms_blocker_.
2219 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2220 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2221 * testsuite/Makefile.am (start_lib_test): New test case.
2222 * testsuite/Makefile.in: Regenerate.
2223 * testsuite/start_lib_test_main.c: New file.
2224 * testsuite/start_lib_test_1.c: New file.
2225 * testsuite/start_lib_test_2.c: New file.
2226 * testsuite/start_lib_test_3.c: New file.
2227
dd0b1884
ILT
22282010-08-19 Ian Lance Taylor <iant@google.com>
2229
2230 * Makefile.in: Rebuild with automake 1.11.1.
2231 * aclocal.m4: Likewise.
2232 * testsuite/Makefile.in: Likewise.
2233
7223e9ca
ILT
22342010-08-19 Ian Lance Taylor <iant@google.com>
2235
2236 PR 10893
2237 * i386.cc (class Output_data_plt_i386): Update declarations.
2238 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2239 local_ifuncs_ fields.
2240 (Target_i386::do_plt_section_for_global): New function.
2241 (Target_i386::do_plt_section_for_local): New function.
2242 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2243 parameter; change all callers. Initialize global_ifuncs_ and
2244 local_ifuncs_. If doing a static link define __rel_iplt_start and
2245 __rel_iplt_end.
2246 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2247 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2248 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2249 symbols.
2250 (Target_i386::make_plt_section): New function, broken out of
2251 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2252 (Target_i386::make_plt_entry): Call make_plt_section.
2253 (Target_i386::make_local_ifunc_plt_entry): New function.
2254 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2255 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2256 R_386_IRELATIVE to switch.
2257 (Target_i386::Scan::global): Likewise.
2258 (Target_i386::Relocate::relocate): Likewise.
2259 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2260 switch.
2261 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2262 (Target_x86_64::do_plt_section_for_global): New function.
2263 (Target_x86_64::do_plt_section_for_local): New function.
2264 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2265 parameter; change all callers. If doing a static link define
2266 __rela_iplt_start and __rela_iplt_end.
2267 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2268 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2269 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2270 to point to .plt.
2271 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2272 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2273 switch.
2274 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2275 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2276 R_X86_64_IRELATIVE to switch.
2277 (Target_x86_64::Scan::global): Likewise.
2278 (Target_x86_64::Relocate::relocate): Likewise.
2279 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2280 switch.
2281 * target.h (class Target): Add plt_section_for_global and
2282 plt_section_for_local functions. Add do_plt_section_for_global
2283 and do_plt_section_for_local virtual functions.
2284 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2285 clarifying comments.
2286 (Symbol::use_plt_offset): Handle IFUNC symbol.
2287 * object.cc (Sized_relobj::Sized_relobj): Initialize
2288 local_plt_offsets_.
2289 (Sized_relobj::local_has_plt_offset): New function.
2290 (Sized_relobj::local_plt_offset): New function.
2291 (Sized_relobj::set_local_plt_offset): New function.
2292 (Sized_relobj::do_count): Handle IFUNC symbol.
2293 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2294 a bit away from input_shndx_ field. Add set_is_func_symbol and
2295 is_ifunc_symbol functions.
2296 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2297 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2298 local_plt_offsets_ field.
2299 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2300 * output.h (class Output_section_data): Add non-const
2301 output_section function.
2302 (class Output_data_got): Update declarations.
2303 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2304 Add use_plt_offset parameter to global and local constructors.
2305 Change all callers. Change local_sym_index_ field to 31 bits.
2306 Change GSYM_CODE and CONSTANT_CODE accordingly.
2307 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2308 doing a static link don't set sh_link field.
2309 (Output_data_got::Got_entry::write): Use PLT offset if
2310 appropriate.
2311 (Output_data_got::add_global_plt): New function.
2312 (Output_data_got::add_local_plt): New function.
2313 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2314 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2315 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2316 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2317 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2318 IFUNC conditional.
2319 * testsuite/ifunc-sel.h: New file.
2320 * testsuite/ifuncmain1.c: New file.
2321 * testsuite/ifuncmain1vis.c: New file.
2322 * testsuite/ifuncmod1.c: New file.
2323 * testsuite/ifuncdep2.c: New file.
2324 * testsuite/ifuncmain2.c: New file.
2325 * testsuite/ifuncmain3.c: New file.
2326 * testsuite/ifuncmod3.c: New file.
2327 * testsuite/ifuncmain4.c: New file.
2328 * testsuite/ifuncmain5.c: New file.
2329 * testsuite/ifuncmod5.c: New file.
2330 * testsuite/ifuncmain6pie.c: New file.
2331 * testsuite/ifuncmod6.c: New file.
2332 * testsuite/ifuncmain7.c: New file.
2333 * configure, testsuite/Makefile.in: Rebuild.
2334
56f75c03
ILT
23352010-08-18 Ian Lance Taylor <iant@google.com>
2336
2337 * incremental.cc
2338 (Output_section_incremental_inputs::write_input_files): Add cast
2339 to avoid signed/unsigned comparison warning.
2340 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2341
55455f89
CC
23422010-08-12 Cary Coutant <ccoutant@google.com>
2343
2344 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2345
e2054bcb
ILT
23462010-08-13 Ian Lance Taylor <iant@google.com>
2347
2348 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2349
74f67560
DK
23502010-08-12 Cary Coutant <ccoutant@google.com>
2351 Doug Kwan <dougkwan@google.com>
2352
2353 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2354 defintion overrides non-weak undef, remember that the original undef
2355 is not weak.
2356 * symtab.cc (Symbol_table::sized_write_global): For undef without
2357 an original weak binding, set binding to global in output.
2358 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2359 * testsuite/Makefile.in: Regenerate.
2360 * testsuite/strong_ref_weak_def.sh: New file.
2361 * testsuite/strong_ref_weak_def_1.c: Ditto.
2362 * testsuite/strong_ref_weak_def_2.c: Ditto.
2363
d1238d12
CC
23642010-08-12 Cary Coutant <ccoutant@google.com>
2365
2366 * testsuite/incremental_test.sh: Rewrite.
2367 * testsuite/incremental_test_1.c: Rewrite.
2368 * testsuite/incremental_test_2.c: Rewrite.
2369
0e70b911
CC
23702010-08-12 Cary Coutant <ccoutant@google.com>
2371
2372 * arm.cc (Target_arm::got_size): Add const.
2373 (Target_arm::got_entry_count): New function.
2374 (Target_arm::plt_entry_count): New function.
2375 (Target_arm::first_plt_entry_offset): New function.
2376 (Target_arm::plt_entry_size): New function.
2377 (Output_data_plt_arm::entry_count): New function.
2378 (Output_data_plt_arm::first_plt_entry_offset): New function.
2379 (Output_data_plt_arm::get_plt_entry_size): New function.
2380 * i386.cc (Target_i386::got_size): Add const.
2381 (Target_i386::got_entry_count): New function.
2382 (Target_i386::plt_entry_count): New function.
2383 (Target_i386::first_plt_entry_offset): New function.
2384 (Target_i386::plt_entry_size): New function.
2385 (Output_data_plt_i386::entry_count): New function.
2386 (Output_data_plt_i386::first_plt_entry_offset): New function.
2387 (Output_data_plt_i386::get_plt_entry_size): New function.
2388 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2389 find_incremental_inputs_sections. Dump incremental_got_plt section.
2390 * incremental.cc: Include target.h.
2391 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2392 parameter. Adjust all callers. Find incremental_got_plt section.
2393 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2394 section.
2395 (Output_section_incremental_inputs::set_final_data_size): Calculate
2396 size of incremental_got_plt section.
2397 (Output_section_incremental_inputs::do_write): Write the
2398 incremental_got_plt section.
2399 (Got_plt_view_info): New struct.
2400 (Local_got_offset_visitor): New class.
2401 (Global_got_offset_visitor): New class.
2402 (Global_symbol_visitor_got_plt): New class.
2403 (Output_section_incremental_inputs::write_got_plt): New function.
2404 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2405 Add parameter. Adjust all callers.
2406 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2407 (Incremental_inputs::got_plt_section): New function.
2408 (Incremental_inputs::got_plt_section_): New data member.
2409 (Incremental_got_plt_reader): New class.
2410 * layout.cc (Layout::create_incremental_info_sections): Add the
2411 incremental_got_plt section.
2412 * object.h (Got_offset_list::get_list): New function.
2413 (Got offset_list::for_all_got_offsets): New function.
2414 (Sized_relobj::local_got_offset_list): New function.
2415 * powerpc.cc (Target_powerpc::got_size): Add const.
2416 (Target_powerpc::got_entry_count): New function.
2417 (Target_powerpc::plt_entry_count): New function.
2418 (Target_powerpc::first_plt_entry_offset): New function.
2419 (Target_powerpc::plt_entry_size): New function.
2420 (Output_data_plt_powerpc::entry_count): New function.
2421 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2422 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2423 * sparc.cc (Target_sparc::got_size): Add const.
2424 (Target_sparc::got_entry_count): New function.
2425 (Target_sparc::plt_entry_count): New function.
2426 (Target_sparc::first_plt_entry_offset): New function.
2427 (Target_sparc::plt_entry_size): New function.
2428 (Output_data_plt_sparc::entry_count): New function.
2429 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2430 (Output_data_plt_sparc::get_plt_entry_size): New function.
2431 * symtab.h (Symbol::got_offset_list): New function.
2432 (Symbol_table::for_all_symbols): New function.
2433 * target.h (Sized_target::got_entry_count): New function.
2434 (Sized_target::plt_entry_count): New function.
2435 (Sized_target::plt_entry_size): New function.
2436 * x86_64.cc (Target_x86_64::got_size): Add const.
2437 (Target_x86_64::got_entry_count): New function.
2438 (Target_x86_64::plt_entry_count): New function.
2439 (Target_x86_64::first_plt_entry_offset): New function.
2440 (Target_x86_64::plt_entry_size): New function.
2441 (Output_data_plt_x86_64::entry_count): New function.
2442 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2443 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2444
09ec0418
CC
24452010-08-12 Cary Coutant <ccoutant@google.com>
2446
2447 * archive.cc: Include incremental.h.
2448 (Archive::Archive): Initialize incremental_info_.
2449 (Archive::include_member): Record archive members in incremental info.
2450 (Add_archive_symbols::run): Record begin and end of an archive in
2451 incremental info.
2452 (Lib_group::include_member): Record objects in incremental info.
2453 * archive.h (Incremental_archive_entry): Forward declaration.
2454 (Archive::set_incremental_info): New member function.
2455 (Archive::incremental_info): New member function.
2456 (Archive::Unused_symbol_iterator): New class.
2457 (Archive::unused_symbols_begin): New member function.
2458 (Archive::unused_symbols_end): New member function.
2459 (Archive::incremental_info_): New data member.
2460 * incremental-dump.cc (find_input_containing_global): New function.
2461 (dump_incremental_inputs): Dump new incremental info sections.
2462 * incremental.cc: Include symtab.h.
2463 (Output_section_incremental_inputs): New class.
2464 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2465 new incremental info sections.
2466 (Sized_incremental_binary::do_check_inputs): Likewise.
2467 (Incremental_inputs::report_archive): Remove.
2468 (Incremental_inputs::report_archive_begin): New function.
2469 (Incremental_inputs::report_archive_end): New function.
2470 (Incremental_inputs::report_object): New function.
2471 (Incremental_inputs::finalize_inputs): Remove.
2472 (Incremental_inputs::report_input_section): New function.
2473 (Incremental_inputs::report_script): Rewrite.
2474 (Incremental_inputs::finalize): Do nothing but finalize string table.
2475 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2476 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2477 (Incremental_inputs::create_data_sections): New function.
2478 (Incremental_inputs::relocs_entsize): New function.
2479 (Output_section_incremental_inputs::set_final_data_size): New function.
2480 (Output_section_incremental_inputs::do_write): New function.
2481 (Output_section_incremental_inputs::write_header): New function.
2482 (Output_section_incremental_inputs::write_input_files): New function.
2483 (Output_section_incremental_inputs::write_info_blocks): New function.
2484 (Output_section_incremental_inputs::write_symtab): New function.
2485 * incremental.h (Incremental_script_entry): Forward declaration.
2486 (Incremental_object_entry): Forward declaration.
2487 (Incremental_archive_entry): Forward declaration.
2488 (Incremental_inputs): Forward declaration.
2489 (Incremental_inputs_header_data): Remove.
2490 (Incremental_inputs_header): Remove.
2491 (Incremental_inputs_header_write): Remove.
2492 (Incremental_inputs_entry_data): Remove.
2493 (Incremental_inputs_entry): Remove.
2494 (Incremental_inputs_entry_write): Remove.
2495 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2496 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2497 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2498 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2499 Likewise.
2500 (Incremental_input_entry): New class.
2501 (Incremental_script_entry): New class.
2502 (Incremental_object_entry): New class.
2503 (Incremental_archive_entry): New class.
2504 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2505 (Incremental_inputs::report_inputs): Remove.
2506 (Incremental_inputs::report_archive): Remove.
2507 (Incremental_inputs::report_archive_begin): New function.
2508 (Incremental_inputs::report_archive_end): New function.
2509 (Incremental_inputs::report_object): Change prototype.
2510 (Incremental_inputs::report_input_section): New function.
2511 (Incremental_inputs::report_script): Change prototype.
2512 (Incremental_inputs::get_reloc_count): New function.
2513 (Incremental_inputs::set_reloc_count): New function.
2514 (Incremental_inputs::create_data_sections): New function.
2515 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2516 (Incremental_inputs::inputs_section): New function.
2517 (Incremental_inputs::symtab_section): New function.
2518 (Incremental_inputs::relocs_section): New function.
2519 (Incremental_inputs::get_stringpool): Add const.
2520 (Incremental_inputs::command_line): Add const.
2521 (Incremental_inputs::inputs): Remove.
2522 (Incremental_inputs::command_line_key): New function.
2523 (Incremental_inputs::input_file_count): New function.
2524 (Incremental_inputs::input_files): New function.
2525 (Incremental_inputs::relocs_entsize): New function.
2526 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2527 (Incremental_inputs::finalize_inputs): Remove.
2528 (Incremental_inputs::Input_info): Remove.
2529 (Incremental_inputs::lock_): Remove.
2530 (Incremental_inputs::inputs_): Change type.
2531 (Incremental_inputs::inputs_map_): Remove.
2532 (Incremental_inputs::current_object_entry_): New data member.
2533 (Incremental_inputs::inputs_section_): New data member.
2534 (Incremental_inputs::symtab_section_): New data member.
2535 (Incremental_inputs::relocs_section_): New data member.
2536 (Incremental_inputs::reloc_count_): New data member.
2537 (Incremental_inputs_reader): New class.
2538 (Incremental_symtab_reader): New class.
2539 (Incremental_relocs_reader): New class.
2540 * layout.cc (Layout::finalize): Move finalization of incremental info
2541 and creation of incremental info sections to follow finalization of
2542 symbol table. Set offsets for postprocessing sections.
2543 (Layout::create_incremental_info_sections): Call
2544 Incremental_inputs::create_data_sections. Add incremental symtab
2545 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2546 sections to layout after input sections.
2547 * layout.h (struct Timespec): Forward declaration.
2548 (Layout::incremental_inputs): Add const.
2549 (Layout::create_incremental_info_sections): Add parameter.
2550 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2551 * object.cc: Include incremental.h.
2552 (Relobj::finalize_incremental_relocs): New function.
2553 (Sized_relobj::do_layout): Record input sections in incremental info.
2554 * object.h (Object::output_section): New function.
2555 (Object::output_section_offset): Moved from Relobj.
2556 (Object::get_incremental_reloc_base): New function.
2557 (Object::get_incremental_reloc_count): New function.
2558 (Object::do_output_section): New function.
2559 (Object::do_output_section_offset): Moved from Relobj.
2560 (Object::do_get_incremental_reloc_base): New function.
2561 (Object::do_get_incremental_reloc_count): New function.
2562 (Object::Object): Initialize new data members.
2563 (Relobj::output_section): Renamed do_output_section and moved to
2564 protected.
2565 (Relobj::output_section_offset): Moved to Object.
2566 (Relobj::do_get_incremental_reloc_base): New function.
2567 (Relobj::do_get_incremental_reloc_count): New function.
2568 (Relobj::allocate_incremental_reloc_counts): New function.
2569 (Relobj::count_incremental_reloc): New function.
2570 (Relobj::finalize_incremental_relocs): New function.
2571 (Relobj::next_incremental_reloc_index): New function.
2572 (Relobj::reloc_counts_): New data member.
2573 (Relobj::reloc_bases_): New data member.
2574 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2575 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2576 (Sized_relobj::incremental_relocs_scan): New function.
2577 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2578 (Sized_relobj::incremental_relocs_write): New function.
2579 (Sized_relobj::incremental_relocs_write_reltype): New function.
2580 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2581 incremental link.
2582 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2583 archives and object files elsewhere.
2584 (Add_symbols::run): Report object files here.
2585 (Finish_group::run): Report end of archive at end of group.
2586 * reloc.cc: Include layout.h, incremental.h.
2587 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2588 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2589 (Sized_relobj::incremental_relocs_scan): New function.
2590 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2591 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2592 (Sized_relobj::incremental_relocs_write): New function.
2593 (Sized_relobj::incremental_relocs_write_reltype): New function.
2594 * script.cc (read_input_script): Rewrite test for incremental link.
2595 Change call to Incremental_inputs::report_script.
2596 * symtab.h (Symbol_table::first_global_index): New function.
2597 (Symbol_table::output_count): New function.
2598
ce0d1972
DK
25992010-08-12 Doug Kwan <dougkwan@google.com>
2600
2601 * arm.cc (Target_arm::merge_object_attributes): Check command line
2602 options --no-wchar-size-warning and --no-enum-size-warning.
2603 * options.h (General_options): Add ld-compatible options
2604 --no-enum-size-warning and --no-wchar-size-warning.
2605
6e5710ce
ILT
26062010-08-04 Ian Lance Taylor <iant@google.com>
2607
2608 * x86_64.cc (Target_x86_64::Scan::local): Use
2609 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2610 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2611 (Target_x86_64::Scan::global): Likewise.
2612 (Target_x86_64::Relocate::relocate): Likewise.
2613 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2614 Likewise.
2615
fef830db
CC
26162010-08-03 Cary Coutant <ccoutant@google.com>
2617
2618 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2619 to reserve space in merged_strings vector. Keep total input size
2620 for stats.
2621 (Output_merge_string::do_print_merge_stats): Print total input size.
2622 * merge.h (Output_merge_string): Add input_size_ field.
2623 * stringpool.cc (Stringpool_template::string_length): Move
2624 implementations out of Stringpool_template class and place in
2625 stringpool.h.
2626 * stringpool.h (string_length): Move out of Stringpool_template.
2627
1e3811b0
ILT
26282010-08-03 Ian Lance Taylor <iant@google.com>
2629
2630 PR 11712
2631 * layout.cc (relaxation_loop_body): If address of load segment is
2632 set, adjust address to include headers if possible.
2633
7af0c620
ILT
26342010-08-03 Ian Lance Taylor <iant@google.com>
2635
2636 * version.cc (version_string): Bump to 1.10.
2637
22f0da72
ILT
26382010-08-03 Ian Lance Taylor <iant@google.com>
2639
2640 PR 11805
2641 * layout.h (enum Output_section_order): Define.
2642 (class Layout): Update declarations.
2643 * layout.cc (Layout::get_output_section): Add order parameter.
2644 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2645 is_first_non_relro parameters. Change all callers.
2646 (Layout::choose_output_section): Likewise.
2647 (Layout::add_output_section_data): Likewise.
2648 (Layout::make_output_section): Likewise. Set order.
2649 (Layout::default_section_order): New function.
2650 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2651 * output.cc (Output_section::Output_section): Initialize order_.
2652 Don't initialize deleted fields.
2653 (Output_segment::Output_segment): Don't initialize deleted
2654 fields.
2655 (Output_segment::add_output_section_to_load): New function
2656 replacing add_output_section. Change all callers to call this or
2657 add_output_section_to_nonload.
2658 (Output_segment::add_output_section_to_nonload): New function.
2659 (Output_segment::remove_output_section): Rewrite.
2660 (Output_segment::add_initial_output_data): Likewise.
2661 (Output_segment::has_any_data_sections): Likewise.
2662 (Output_segment::is_first_section_relro): Likewise.
2663 (Output_segment::maximum_alignment): Likewise.
2664 (Output_segment::has_dynamic_reloc): New function replacing
2665 dynamic_reloc_count. Change all callers.
2666 (Output_segment::has_dynamic_reloc_list): New function replacing
2667 dynamic_reloc_count_list. Change all callers.
2668 (Output_segment::set_section_addresses): Rewrite.
2669 (Output_segment::set_offset): Rewrite.
2670 (Output_segment::find_first_and_last_list): Remove.
2671 (Output_segment::set_tls_offsets): Rewrite.
2672 (Output_segment::first_section_load_address): Likewise.
2673 (Output_segment::output_section_count): Likewise.
2674 (Output_segment::section_with_lowest_load_address): Likewise.
2675 (Output_segment::write_section_headers): Likewise.
2676 (Output_segment::print_sections_to_map): Likewise.
2677 * output.h (class Output_data): Remove dynamic_reloc_count_
2678 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2679 (Output_data::add_dynamic_reloc): Rewrite.
2680 (Output_data::has_dynamic_reloc): New function.
2681 (Output_data::dynamic_reloc_count): Remove.
2682 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2683 is_last_relro_, is_first_non_relro_, is_interp_,
2684 is_dynamic_linker_section_ fields. Add order and set_order
2685 functions. Remove is_relro_local, set_is_relro_local,
2686 is_last_relro, set_is_last_relro, is_first_non_relro,
2687 set_is_first_non_relro functions, is_interp, set_is_interp,
2688 is_dynamic_linker_section, and set_is_dynamic_linker_section
2689 functions.
2690 (class Output_segment): Change Output_data_list from std::list to
2691 std:;vector. Add output_lists_ field. Remove output_data_ and
2692 output_bss_ fields. Update declarations.
2693
3ff2ccb0
ILT
26942010-08-02 Ian Lance Taylor <iant@google.com>
2695
2696 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2697 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2698 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2699
88a4108b
ILT
27002010-08-02 Ian Lance Taylor <iant@google.com>
2701
2702 PR 11855
2703 * script.cc (Script_options::Script_options): Initialize
2704 symbol_definitions_ and symbol_references_.
2705 (Script_options::add_symbol_assignment): Update
2706 symbol_definitions_ and symbol_references_.
2707 (Script_options::add_symbol_reference): New function.
2708 (script_symbol): New function.
2709 * script.h (class Script_options): Add symbol_definitions_ and
2710 symbol_references_ fields.
2711 (Script_options::referenced_const_iterator): New type.
2712 (Script_options::referenced_begin): New function.
2713 (Script_options::referenced_end): New function.
2714 (Script_options::is_referenced): New function.
2715 (Script_options::any_unreferenced): New function.
2716 * script-c.h (script_symbol): Declare.
2717 * yyscript.y (exp): Call script_symbol.
2718 * symtab.cc: Include "script.h".
2719 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2720 Change all callers. Check symbols referenced by scripts.
2721 (Symbol_table::add_undefined_symbols_from_command_line): Add
2722 layout parameter. Change all callers.
2723 (Symbol_table::do_add_undefined_symbols_from_command_line):
2724 Likewise. Break out loop body. Check symbols referenced by
2725 scripts.
2726 (Symbol_table::add_undefined_symbol_from_command_line): New
2727 function broken out of
2728 do_add_undefined_symbols_from_command_line.
2729 * symtab.h (class Symbol_table): Update declarations.
2730 * archive.cc: Include "layout.h".
2731 (Archive::should_include_member): Add layout parameter. Change
2732 all callers. Check for symbol mentioned in expression.
2733 * archive.h (class Archive): Update declaration.
2734 * object.cc (Sized_relobj::do_should_include_member): Add layout
2735 parameter.
2736 * object.h (Object::should_include_member): Add layout parameter.
2737 Change all callers.
2738 (Object::do_should_include_member): Add layout parameter.
2739 (class Sized_relobj): Update declaration.
2740 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2741 parameter.
2742 * dynobj.h (class Sized_dynobj): Update declaration.
2743 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2744 layout parameter.
2745 * plugin.h (class Sized_pluginobj): Update declaration.
2746
5f1ab67a
ILT
27472010-08-02 Ian Lance Taylor <iant@google.com>
2748
2749 PR 11866
2750 * output.cc (Output_segment::set_offset): Search for the first and
2751 last sections rather than assuming that the list is in order.
2752 (Output_segment::find_first_and_last_list): New function.
2753 * output.h (class Output_segment): Update declarations.
2754 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2755 (relro_strip_test_SOURCES): New variable.
2756 (relro_strip_test_DEPENDENCIES): New variable.
2757 (relro_strip_test_LDFLAGS): New variable.
2758 (relro_strip_test_LDADD): New variable.
2759 (relro_strip_test.so): New target.
2760
a8df5856
ILT
27612010-08-02 Ian Lance Taylor <iant@google.com>
2762
2763 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2764 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2765 (Target_i386::got_tlsdesc_section): New function.
2766 (Target_i386::got_section): Create space for GOT entries for
2767 TLSDESC relocations.
2768 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2769 R_386_TLS_GOTDESC.
2770 (Target_i386::Scan::global): Likewise.
2771 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2772 using TLSDESC GOT.
2773 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2774 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2775 (Target_x86_64::got_tlsdesc_section): New function.
2776 (Target_x86_64::got_section): Create space for GOT entries for
2777 TLSDESC relocations.
2778 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2779 R_386_TLS_GOTDESC.
2780 (Target_x86_64::Scan::global): Likewise.
2781 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2782 using TLSDESC GOT.
2783
0c10a0a6
ILT
27842010-08-02 Ian Lance Taylor <iant@google.com>
2785
2786 * testsuite/final_layout.sh: Use dc to convert from hex to
2787 decimal.
2788
41cbeecc
ST
27892010-07-29 Sriraman Tallam <tmsriram@google.com>
2790
2791 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2792 paramter to the call to gold::gc_process_relocs.
2793 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2794 paramter to the call to gold::gc_process_relocs.
2795 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2796 parameter to the call to gold::gc_process_relocs.
2797 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2798 template parameter to the call to gold::gc_process_relocs.
2799 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2800 paramter to the call to gold::gc_process_relocs.
2801 * gc.h (get_embedded_addend_size): New function.
2802 (gc_process_relocs): Save the size of the reloc for use by ICF.
2803 * icf.cc (get_section_contents): Get the addend from the text section
2804 for SHT_REL relocation sections.
2805 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2806 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2807 * int_encoding.h (read_from_pointer): New overloaded function.
2808 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2809 * testsuite/icf_sht_rel_addend_test.sh: New file.
2810 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2811 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2812
6ea55b82
RW
28132010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2814
2815 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2816 * Makefile.in: Regenerate.
2817 * testsuite/Makefile.in: Regenerate.
2818
9691462b
ILT
28192010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2820
2821 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2822 * gold/testsuite/debug_msg.cc: Likewise.
2823 * gold/testsuite/odr_violation1.cc
2824 * gold/testsuite/odr_violation2.cc
2825
76897331
CC
28262010-07-21 Cary Coutant <ccoutant@google.com>
2827
2828 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2829 string, and length fields.
2830 (Output_merge_string::Merged_strings_list): New type.
2831 (Output_merge_string::Merged_strings_lists): New typedef.
2832 (Output_merge_string): Replace merged_strings_ with
2833 merged_strings_lists_.
2834 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2835 Merged_strings_list per input object and section. Don't store pointer
2836 to the string. Don't store length with each merged string entry.
2837 (Output_merge_string::finalize_merged_data): Loop over list of merged
2838 strings lists. Recompute length of each merged string.
2839
78384e8f
CC
28402010-07-15 Cary Coutant <ccoutant@google.com>
2841
2842 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2843 here.
2844
783659f9
ILT
28452010-07-14 Ian Lance Taylor <iant@google.com>
2846
2847 * descriptors.cc (Descriptors::open): Report correct name in error
2848 message.
2849
131687b4
DK
28502010-07-13 Doug Kwan <dougkwan@google.com>
2851
2852 * arm.cc (Arm_input_section::Arm_input_section): For a
2853 SHT_ARM_EXIDX section, always keeps the input sections.
2854 (Arm_input_section::set_exidx_section_link): New method.
2855 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2856 has_errors_ to false.
2857 (Arm_exidx_input_section::has_errors,
2858 Arm_exidx_input_section::set_has_errors): New methods.
2859 (Arm_exidx_input_section::has_errors_): New data member.
2860 (Arm_relobj::get_exidx_shndx_list): New method.
2861 (Arm_output_section::append_text_sections_to_list): Do not skip
2862 section without SHF_EXECINSTR.
2863 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2864 errors.
2865 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2866 section header. Make error messages more verbose. Check for
2867 a non-executable section linked to an EXIDX section.
2868 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2869 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2870 check that there is no deferred EXIDX section if we exit early.
2871 Instead of not making an EXIDX section in case of an error, make one
2872 and set the has_errors flag of it.
2873 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2874 in a relocatable link.
2875 (Target_arm::do_relax): Look for the EXIDX output section instead of
2876 assuming that it is called .ARM.exidx.
2877 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2878 section list. Do not check for SHF_EXECINSTR section flags but
2879 skip any input section with errors.
2880 * output.cc (Output_section::Output_section): Initialize
2881 always_keeps_input_sections_ to false.
2882 (Output_section::add_input_section): Check for
2883 always_keeps_input_sections_.
2884 * output.h (Output_section::always_keeps_input_sections,
2885 Output_section::set_always_keeps_input_sections): New methods.
2886 (Output_section::always_keeps_input_sections): New data member.
2887
69517287
RÁE
28882010-07-13 Rafael Espindola <espindola@google.com>
2889
2890 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2891 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2892
82742395
ILT
28932010-07-13 Philip Herron <herron.philip@googlemail.com>
2894 Ian Lance Taylor <iant@google.com>
2895
2896 * output.h (Output_section_lookup_maps::add_merge_section):
2897 Correct check of whether value was inserted.
2898 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2899 (Output_section_lookup_maps::add_relaxed_input_section):
2900 Likewise.
2901 * arm.cc (Target_arm::got_section): Remove used local os.
2902 * i386.cc (Target_i386::got_section): Likewise.
2903 * x86_64.cc (Target_x86_64::got_section): Likewise.
2904 * sparc.cc (Target_sparc::got_section): Likewise.
2905 (Target_sparc::relocate): Remove unused local have_got_offset.
2906 * powerpc.cc (Target_powerpc::relocate): Likewise.
2907
f2d707b5
ILT
29082010-07-13 Ian Lance Taylor <iant@google.com>
2909
241531d6
ILT
2910 * compressed_output.cc (zlib_decompress): Fix signature in
2911 !HAVE_ZLIB_H case.
2912
f2d707b5
ILT
2913 * archive.cc (Archive::include_member): Unlock an external member
2914 of a thin archive. Don't bother to delete an object we know is
2915 NULL.
2916
a2e47362
CC
29172010-07-12 Cary Coutant <ccoutant@google.com>
2918
2919 * compressed_output.cc (zlib_decompress): New function.
2920 (get_uncompressed_size): New function.
2921 (decompress_input_section): New function.
2922 * compressed_output.h (get_uncompressed_size): New function.
2923 (decompress_input_section): New function.
2924 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2925 Handle compressed debug sections.
2926 * layout.cc (is_compressed_debug_section): New function.
2927 (Layout::output_section_name): Map compressed section names to
2928 canonical names.
2929 * layout.h (is_compressed_debug_section): New function.
2930 (is_debug_info_section): Recognize compressed debug sections.
2931 * merge.cc: Include compressed_output.h.
2932 (Output_merge_data::do_add_input_section): Handle compressed
2933 debug sections.
2934 (Output_merge_string::do_add_input_section): Handle compressed
2935 debug sections.
2936 * object.cc: Include compressed_output.h.
2937 (Sized_relobj::Sized_relobj): Initialize new data members.
2938 (build_compressed_section_map): New function.
2939 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2940 * object.h (Object::section_is_compressed): New method.
2941 (Object::do_section_is_compressed): New method.
2942 (Sized_relobj::Compressed_section_map): New type.
2943 (Sized_relobj::do_section_is_compressed): New method.
2944 (Sized_relobj::compressed_sections_): New data member.
2945 * output.cc (Output_section::add_input_section): Handle compressed
2946 debug sections.
2947 * reloc.cc: Include compressed_output.h.
2948 (Sized_relobj::write_sections): Handle compressed debug sections.
2949
ce279a62
CC
29502010-07-08 Cary Coutant <ccoutant@google.com>
2951
2952 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2953 weak when resolving to a dynamic def.
2954 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2955 for weak undef/dynamic def cases. Adjust callers.
2956 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2957 undef_binding_weak_.
2958 (Symbol_table::sized_write_globals): Adjust symbol binding.
2959 (Symbol_table::sized_write_symbol): Add binding parameter.
2960 * symtab.h (Symbol::set_undef_binding): New method.
2961 (Symbol::is_undef_binding_weak): New method.
2962 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2963 (Symbol_table::should_override): Add new parameter.
2964 (Symbol_table::sized_write_symbol): Add new parameter.
2965
2966 * testsuite/weak_undef_file1.cc: Add new test case.
2967 * testsuite/weak_undef_file2.cc: Fix header comment.
2968 * testsuite/weak_undef_test.cc: Add new test case.
2969
b2286c10
DK
29702010-06-29 Doug Kwan <dougkwan@google.com>
2971
2972 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2973 Initialize USE_SYMBOL_.
2974 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2975 definition.
2976 (Arm_reloc_property::uses_symbol_): New data member declaration.
2977 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2978 uses symbol value and symbol is undefined but not weakly undefined.
2979
4802450a
RÁE
29802010-06-28 Rafael Espindola <espindola@google.com>
2981
2982 * plugin.cc (Plugin::load): Use dlerror.
2983
e5ca47ba
ILT
29842010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2985
2986 * symtab.cc (detect_odr_violations): When reporting an ODR
2987 violation, report an object where the symbol is defined.
2988
8a75a161
DK
29892010-06-25 Doug Kwan <dougkwan@google.com>
2990
2991 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2992 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2993 definition.
2994 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2995 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2996 target hook to detect function points.
2997 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2998 * icf.h (Icf::check_section_for_function_pointers): Change type of
2999 parameter SECTION_NAME to const reference to std::string. Use
3000 target hook to determine if section may have unsafe pointers.
3001 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3002 method definition.
3003
42218b9f
RÁE
30042010-06-21 Rafael Espindola <espindola@google.com>
3005
3006 * fileread.cc (Input_file::find_fie): New
3007 (Input_file::open): Use Input_file::find_fie.
3008 * fileread.h (Input_file::find_fie): New
3009 * plugin.cc (set_extra_library_path): New.
3010 (Plugin::load): Add set_extra_library_path to the transfer vector.
3011 (Plugin_manager::set_extra_library_path): New.
3012 (Plugin_manager::add_input_file): Use the extra search path if set.
3013 (set_extra_library_path(): New.
3014 * plugin.h (Plugin_manager): Add set_extra_library_path and
3015 extra_search_path_.
3016
a0506cca
CC
30172010-06-19 Cary Coutant <ccoutant@google.com>
3018
3019 * layout.cc (gdb_sections): Add .debug_types.
3020 (lines_only_debug_sections): Likewise.
3021
6508b958
RÁE
30222010-06-18 Rafael Espindola <espindola@google.com>
3023
3024 * plugin.cc (add_input_file,add_input_library)
3025 (Plugin_manager::add_input_file): Make filename arguments const.
3026 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3027 const.
3028
3e235302
DK
30292010-06-16 Doug Kwan <dougkwan@google.com>
3030
3031 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3032 .ARM.attributes section if we have not merged any input
3033 attributes sections.
3034
106e8a6c
DK
30352010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3036
3037 * arm.cc: Allow combining objects with no EABI version
3038 information.
3039
91ff43fe
RÁE
30402010-06-15 Rafael Espindola <espindola@google.com>
3041
3042 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3043
68ed838c
ILT
30442010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3045
3046 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3047 (struct iovec): Correct !HAVE_READV definition.
3048
f3a2388f
CC
30492010-06-10 Cary Coutant <ccoutant@google.com>
3050
3051 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3052 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3053 reloc sections.
3054 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3055
3056 PR 11683
3057 * symtab.h (Symbol::is_placeholder): New member function.
3058 * target-reloc.h (relocate_section): Check for placeholder symbols.
3059
3060 * testsuite/Makefile.am (plugin_test_8): New test.
3061 (plugin_test_9): New test.
3062 * testsuite/Makefile.in: Regenerate.
3063
e1df38aa
NC
30642010-06-09 Nick Clifton <nickc@redhat.com>
3065
3066 * yyscript.y (input_list_element): Allow strings prefixed with
3067 the '-' character. Treat these as libraries.
3068 * script.cc (script_add_library): New function. Adds a library
3069 specified by "-l<name>" found in an input script.
3070 * script-c.h: Add prototype for script_add_library.
3071
25bbe950
DK
30722010-06-07 Doug Kwan <dougkwan@google.com>
3073
3074 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3075 Restrict stub-group size to be within long conditional branch
3076 range when working around cortex-A8 erratum.
3077
0f32ea4c
ILT
30782010-06-07 Damien Diederen <dd@crosstwine.com>
3079
3080 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3081 #ifdef typo.
3082
8fe2a369
ST
30832010-06-03 Sriraman Tallam <tmsriram@google.com>
3084
3085 PR gold/11658
3086 * output.cc
3087 (Output_section::Input_section_sort_entry::compare_section_ordering):
3088 Change to return non-zero correctly.
3089 (Output_section::Input_section_sort_section_order_index_compare
3090 ::operator()): Change to fix ambiguity in comparisons.
3091
6e9ba2ca
ST
30922010-06-01 Sriraman Tallam <tmsriram@google.com>
3093
3094 * gold.h (is_wildcard_string): New function.
3095 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3096 (Layout::layout_eh_frame): Ditto.
3097 (Layout::find_section_order_index): New method.
3098 (Layout::read_layout_from_file): New method.
3099 * layout.h (Layout::find_section_order_index): New method.
3100 (Layout::read_layout_from_file): New method.
3101 (Layout::input_section_position_): New private member.
3102 (Layout::input_section_glob_): New private member.
3103 * main.cc (main): Call read_layout_from_file here.
3104 * options.h (--section-ordering-file): New option.
3105 * output.cc (Output_section::input_section_order_specified_): New
3106 member.
3107 (Output_section::Output_section): Initialize new member.
3108 (Output_section::add_input_section): Add new parameter.
3109 Keep input sections when --section-ordering-file is used.
3110 (Output_section::set_final_data_size): Sort input sections when
3111 section ordering file is specified.
3112 (Output_section::Input_section_sort_entry): Add new parameter.
3113 Check sorting type.
3114 (Output_section::Input_section_sort_entry::compare_section_ordering):
3115 New method.
3116 (Output_section::Input_section_sort_compare::operator()): Change to
3117 consider section_order_index.
3118 (Output_section::Input_section_sort_init_fini_compare::operator()):
3119 Change to consider section_order_index.
3120 (Output_section::Input_section_sort_section_order_index_compare
3121 ::operator()): New method.
3122 (Output_section::sort_attached_input_sections): Change to sort
3123 according to section order when specified.
e1df38aa
NC
3124 (Output_section::add_input_section<32, true>): Add new parameter.
3125 (Output_section::add_input_section<64, true>): Add new parameter.
3126 (Output_section::add_input_section<32, false>): Add new parameter.
3127 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3128 * output.h (Output_section::add_input_section): Add new parameter.
3129 (Output_section::input_section_order_specified): New
3130 method.
3131 (Output_section::set_input_section_order_specified): New method.
3132 (Input_section::Input_section): Initialize section_order_index_.
3133 (Input_section::section_order_index): New method.
3134 (Input_section::set_section_order_index): New method.
3135 (Input_section::section_order_index_): New member.
3136 (Input_section::Input_section_sort_section_order_index_compare): New
3137 struct.
3138 (Output_section::input_section_order_specified_): New member.
3139 * script-sections.cc (is_wildcard_string): Delete and move modified
3140 method to gold.h.
3141 (Output_section_element_input::Output_section_element_input): Modify
3142 call to is_wildcard_string.
3143 (Output_section_element_input::Input_section_pattern
3144 ::Input_section_pattern): Ditto.
3145 (Output_section_element_input::Output_section_element_input): Ditto.
3146 * testsuite/Makefile.am (final_layout): New test case.
3147 * testsuite/Makefile.in: Regenerate.
3148 * testsuite/final_layout.cc: New file.
3149 * testsuite/final_layout.sh: New file.
3150
3537c84b
RÁE
31512010-06-01 Rafael Espindola <espindola@google.com>
3152
3153 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3154
105b6afd
RÁE
31552010-06-01 Rafael Espindola <espindola@google.com>
3156
3157 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3158 visibility of symbols.
3159
29e11421
DK
31602010-05-27 Doug Kwan <dougkwan@google.com>
3161
3162 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3163 from start of output section instead of address for a local symbol
3164 in a merged or relaxed section when doing a relocatable link.
3165
5e0f337e
RÁE
31662010-05-26 Rafael Espindola <espindola@google.com>
3167
3168 PR 11604
3169 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3170 adding sections the garbage collector removed.
3171 * gold/testsuite/Makefile.am: Add test.
3172 * gold/testsuite/Makefile.in: Regenerate.
3173 * gold/testsuite/plugin_test_7.sh: New.
3174 * gold/testsuite/plugin_test_7_1.c: New.
3175 * gold/testsuite/plugin_test_7_2.c: New.
3176
f4187277
RÁE
31772010-05-26 Rafael Espindola <espindola@google.com>
3178
3179 * script-sections.cc (Output_section_definition::set_section_addresses):
3180 Check for --section-start.
3181
5c388529
DK
31822010-05-26 Doug Kwan <dougkwan@google.com>
3183
3184 * arm.cc (Arm_scan_relocatable_relocs): New class.
3185 (Target_arm::relocate_special_relocatable): New method.
3186 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3187 (Arm_relocate_functions::thumb_branch_common): Same.
3188 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3189 instead of Default_scan_relocatable_relocs.
3190 * target-reloc.h (relocate_for_relocatable): Let target handle
3191 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3192 * target.h (Sized_target::relocate_special_relocatable): New method.
3193
bca1c3ae
ILT
31942010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3195
3196 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3197
0439c796
DK
31982010-05-23 Doug Kwan <dougkwan@google.com>
3199
3200 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3201 instead of a cast.
3202 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3203 with a direct branch, not a conditional branch, to a stub.
3204 * merge.cc (Output_merge_base::record_input_section): New method
3205 defintion.
3206 (Output_merge_data::do_add_input_section): Record input section if
3207 keeps-input-sections flag is set.
3208 (Output_merge_string::do_add_input_section): Ditto.
3209 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3210 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3211 INPUT_SECTIONS_.
3212 (Output_merge_base::keeps_input_sections,
3213 Output_merge_base::set_keeps_input_sections,
3214 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3215 method definitions.
3216 (Output_merge_base::Input_sections): New type declaration.
3217 (Output_merge_base::input_sections_begin,
3218 Output_merge_base::input_sections_end,
3219 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3220 (Output_merge_base::bool keeps_input_sections_,
3221 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3222 Output_merge_base::input_sections_): New data members.
3223 (Output_merge_data::do_set_keeps_input_sections): New method
3224 defintion.
3225 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3226 * output.cc (Output_section::Input_section::relobj): Move method
3227 defintion from class declaration to here and handle merge sections.
3228 (Output_section::Input_section::shndx): Ditto.
3229 (Output_section::Output_section): Remove initializations of removed
3230 data members and initialize new data member LOOKUP_MAPS_.
3231 (Output_section::add_input_section): Set keeps-input-sections flag
3232 for a newly created merge output section as appropriate. Adjust code
3233 to use Output_section_lookup_maps class.
3234 (Output_section::add_relaxed_input_section): Adjst code for lookup
3235 maps code refactoring.
3236 (Output_section::add_merge_input_section): Add a new parameter
3237 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3238 class. If adding input section to a newly created merge output
3239 section fails, remove the new merge section.
3240 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3241 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3242 (Output_section::find_merge_section): Ditto.
3243 (Output_section::build_lookup_maps): New method defintion.
3244 (Output_section::find_relaxed_input_section): Adjust code to use
3245 Output_section_lookup_maps class.
3246 (Output_section::get_input_sections): Export merge sections. Adjust
3247 code to use Output_section_lookup_maps class.
3248 (Output_section:::add_script_input_section): Adjust code to use
3249 Output_section_lookup_maps class. Update lookup maps for merge
3250 sections also.
3251 (Output_section::discard_states): Use Output_section_lookup_maps.
3252 (Output_section::restore_states): Same.
3253 * output.h (Merge_section_properties): Move class defintion out of
3254 Output_section.
3255 (Output_section_lookup_maps): New class.
3256 (Output_section::Input_section::is_merge_section): New method
3257 defintion.
3258 (Output_section::Input_section::relobj): Move defintion out of class
3259 defintion. Declare method only.
3260 (Output_section::Input_section::shndx): Ditto.
3261 (Output_section::Input_section::output_merge_base): New method defintion.
3262 (Output_section::Input_section::u2_.pomb): New union field.
3263 (Output_section::Merge_section_by_properties_map,
3264 Output_section::Output_section_data_by_input_section_map,
3265 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3266 Remove types.
3267 (Output_section::add_merge_input_section): Add new parameter
3268 KEEPS_INPUT_SECTIONS.
3269 (Output_section::build_lookup_maps): New method declaration.
3270 (Output_section::merge_section_map_,
3271 Output_section::merge_section_by_properties_map_,
3272 Output_section::relaxed_input_section_map_,
3273 Output_section::is_relaxed_input_section_map_valid_): Remove data
3274 members.
3275 (Output_section::lookup_maps_): New data member.
3276
76295588
L
32772010-05-21 Doug Kwan <dougkwan@google.com>
3278
3279 PR gold/11619
3280 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3281 avoid a compilation error.
3282
d103a984
RÁE
32832010-05-19 Rafael Espindola <espindola@google.com>
3284
3285 * script-sections.cc (Output_section_definition::allocate_to_segment):
3286 Update the phdrs_list even when the output section is NULL.
3287 * testsuite/Makefile.am: Add test.
3288 * testsuite/Makefile.in: Regenerate.
3289 * testsuite/script_test_9.cc: New.
3290 * testsuite/script_test_9.sh: New.
3291 * testsuite/script_test_9.t: New.
3292
6625d24e
DK
32932010-05-19 Doug Kwan <dougkwan@google.com>
3294
3295 * arm.cc (Arm_input_section::original_size): New method.
3296 (Arm_input_section::do_addralign): Add a cast.
3297 (Arm_input_section::do_output_offset): Remove static cast.
3298 (Arm_input_section::original_addralign,
3299 Arm_input_section::original_size_): Change type to uint32_t.
3300 (Arm_input_section::init): Add safe casts for section alignment
3301 and size.
3302 (Arm_input_section::set_final_data_size): Do not set address and
3303 offset of stub table.
3304 (Arm_output_section::fix_exidx_coverage): Change use of of
3305 Output_section::Simple_input_section to that of
3306 Output_section::Input_section.
3307 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3308 except for the first pass.
3309 * output.cc (Output_section::get_input_sections): Change type of
3310 input_sections to std::list<Input_section>.
3311 (Output_section::add_script_input_section): Rename from
3312 Output_section::add_simple_input_section. Change type of SIS
3313 parameter from Simple_input_section to Input_section.
3314 * output.h (Output_section::Simple_input_section): Remove class.
3315 (Output_section::Input_section): Change class visibility to public.
3316 (Output_section::Input_section::addralign): Use stored alignments
3317 for special input sections if set.
3318 (Output_section::Input_section::set_addralign): New method.
3319 (Output_section::get_input_sections): Change parameter type from
3320 list of Simple_input_section to list of Input_section.
3321 (Output_section::add_script_input_section): Rename from
3322 Output_section::add_simple_input_section. Change first parameter's
3323 type from Simple_input_section to Input_section and remove the
3324 second and third parameters.
3325 * script-sections.cc (Input_section::Input_section_list): Change
3326 type to list of Output_section::Input_section/
3327 (Input_section_info::Input_section_info): Change parameter type of
3328 INPUT_SECTION to Output_section::Input_section.
3329 (Input_section_info::input_section): Change return type.
3330 (Input_section_info::input_section_): Change type to
3331 Output_section::Input_section.
3332 (Output_section_element_input::set_section_addresses): Adjust code
3333 to use Output_section::Input_section instead of
3334 Output_section::Simple_input_section. Adjust code for renaming
3335 of Output_section::add_simple_input_section.
3336 (Orphan_output_section::set_section_addresses): Ditto.
3337
e1e82ea4
RW
33382010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3339
3340 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3341 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3342
91e75c8a
RÁE
33432010-05-18 Rafael Espindola <espindola@google.com>
3344
3345 * options.cc (General_options::finalize): Handle -nostdlib.
3346 * options.h (nostdlib): New option.
3347 * script.cc (script_add_search_dir): Handle -nostdlib.
3348
da59ad79
DK
33492010-05-12 Doug Kwan <dougkwan@google.com>
3350
3351 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3352 attributes section only if there no attributes section after merging.
3353 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3354 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3355 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3356 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3357 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3358 and arm_attr_merge_7.stdout.
3359 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3360 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3361 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3362 arm_attr_merge_7b.o): New rules.
3363 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3364 arm_attr_merge_7
3365 * testsuite/Makefile.in: Regenerate.
3366 * testsuite/arm_attr_merge.sh: New file.
3367 * testsuite/arm_attr_merge_[67][ab].s: Same.
3368
3e01a7fd
NC
33692010-05-05 Nick Clifton <nickc@redhat.com>
3370
3371 * po/es.po: Updated Spanish translation.
3372
7ad2014a
L
33732010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3374
3375 * Makefile.am (install-exec-local): Properly install gold as
3376 default cross linker.
3377 * Makefile.in: Regenerated.
3378
4fda8867
NC
33792010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3380 Nick Clifton <nickc@redhat.com>
3381
3382 * configure.ac (install_as_default): Define and set to false
3383 unless --enable-gold or --enable-gold=both/gold has been
3384 specified.
3385 * configure: Regenerate.
3386
3387 * Makefile.am (install-exec-local): Install the executable as
3388 'ld.gold'. If install_as_default is true then also install it as
3389 'ld'.
3390 * Makefile.in: Regenerated.
3391
bd288ea2
ILT
33922010-04-24 Ian Lance Taylor <iant@google.com>
3393
3394 * layout.cc (Layout::layout_reloc): In relocatable link don't
3395 combine reloc sections for grouped sections.
3396
ef38fd8a
ST
33972010-04-23 Sriraman Tallam <tmsriram@google.com>
3398
3399 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3400 sections that are not ordinary to icf.
3401 * icf.cc (get_section_contents): Handle relocation pointing to section
3402 with no object or shndx information.
3403 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3404 * testsuite/Makefile.in: Regenerate.
3405 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3406 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3407
f6973bdc
ILT
34082010-04-22 Ian Lance Taylor <iant@google.com>
3409
3410 * expression.cc (Expression::Expression_eval_info): Add
3411 result_alignment_pointer field.
3412 (Expression::eval_with_dot): Add result_alignment_pointer
3413 parameter. Change all callers.
3414 (Expression::eval_maybe_dot): Likewise.
3415 (class Binary_expression): Add alignment_pointer parameter to
3416 left_value and right_value. Change all callers.
3417 (BINARY_EXPRESSION): Set result alignment.
3418 (class Trinary_expression): Add alignment_pointer parameter to
3419 arg2_value and arg3_value. Change all callers.
3420 (Trinary_cond::value): Set result alignment.
3421 (Max_expression::value, Min_expression::value): Likewise.
3422 (Align_expression::value): Likewise.
3423 * script-sections.cc (class Sections_element): Add dot_alignment
3424 parameter to set_section_addresses virtual function. Update
3425 instantiations.
3426 (class Output_section_element): Likewise.
3427 (Script_sections::create_segments): Add dot_alignment parameter.
3428 Change all callers.
3429 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3430 (Script_sections::set_phdrs_clause_addresses): Likewise.
3431 * script-sections.h: Update declarations.
3432 * script.h: Update declarations.
3433 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3434 min_p_align.
3435 * testsuite/script_test_3.t: Set large alignment.
3436 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3437 segment has expected alignment.
3438
9c9c98a5
NC
34392010-04-22 Nick Clifton <nickc@redhat.com>
3440
3441 * po/gold.pot: Updated by the Translation project.
3442 * po/vi.po: Updated Vietnamese translation.
3443
2253bfba
L
34442010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3445
3446 * testsuite/Makefile.am (check_PROGRAMS): Add
3447 icf_virtual_function_folding_test.
3448 * testsuite/Makefile.in: Regenerated.
3449
85fdf906
AH
34502010-04-15 Andrew Haley <aph@redhat.com>
3451
3452 * options.h (merge_exidx_entries): New option.
3453 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3454 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3455 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3456 (Target_arm::merge_exidx_entries): New function.
3457 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3458 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3459 to Arm_exidx_fixup constructor.
3460 Add new arg, merge_exidx_entries.
3461 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3462 Arm_output_section::fix_exidx_coverage.
3463
ce97fa81
ST
34642010-04-18 Sriraman Tallam <tmsriram@google.com>
3465
3466 * icf.cc (get_section_contents): Check for preemptible functions.
3467 Ignore addend when appropriate.
3468 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3469 section folded.
3470 (add_from_relobj): Check for section folded.
3471 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3472 * symtab.h (should_add_dynsym_entry): Add new parameter.
3473 * target-reloc.h (scan_relocs): Check for section folded.
3474 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3475 Check reloc types for function pointers in shared objects.
3476 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3477 case.
3478 (icf_preemptible_functions_test): New test case.
3479 (icf_string_merge_test): New test case.
3480 * testsuite.Makefile.in: Regenerate.
3481 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3482 bar_glob. Refactor code.
3483 * testsuite/icf_preemptible_functions_test.cc: New file.
3484 * testsuite/icf_preemptible_functions_test.sh: New file.
3485 * testsuite/icf_string_merge_test.cc: New file.
3486 * testsuite/icf_string_merge_test.sh: New file.
3487 * testsuite/icf_virtual_function_folding_test.cc: New file.
3488 * testsuite/icf_virtual_function_folding_test.sh: New file.
3489
04ceb17c
DK
34902010-04-14 Doug Kwan <dougkwan@google.com>
3491
3492 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3493 for local symbol recounting if we remove a section due to ICF.
3494 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3495 there are no regular objects in input.
3496
153e7da4
DK
34972010-04-13 Doug Kwan <dougkwan@google.com>
3498
3499 * arm.cc (Arm_input_section::set_final_data_size): Compute
3500 accurate final data size instead of using current data size.
3501
4dbd9faf
DK
35022010-04-09 Doug Kwan <dougkwan@google.com>
3503
3504 * layout.cc (Layout::choose_output_section): Handle script section
3505 types.
3506 (Layout::make_output_section_for_script): Add section type parameter.
3507 Handle script section types.
3508 * layout.h (Layout::make_output_section_for_script): Add section
3509 type parameter.
3510 * output.cc (Output_section::Output_section): Initialize data member
3511 is_noload_.
3512 (Output_section::do_reset_address_and_file_offset): Do not set address
3513 to 0 if section is a NOLOAD section.
3514 * output.h (Output_section::is_noload): New method.
3515 (Output_section::set_is_noload): Ditto.
3516 (Output_section::is_noload_): New data member.
3517 * script-c.h (Script_section_type): New enum type.
3518 (struct Parser_output_section_header): Add new file section_type.
3519 * script-sections.cc (Sections_element::output_section_name): Add
3520 parameter for returning script section type.
3521 (Output_section_definition::output_section_name): Ditto.
3522 (Output_section_definition::section_type)P; New method.
3523 (Output_section_definiton::script_section_type_name): Ditto.
3524 (Output_section_definition::script_section_type_): New data member.
3525 (Output_section_definition::Output_section_definition): Initialize
3526 data member Output_section_definition::script_section_type_.
3527 (Output_section_definition::create_sections): Pass script section type
3528 to Layout::make_output_section_for_script.
3529 (Output_section_definition::output_section_name): Return script
3530 section type to caller.
3531 (Output_section_definition::set_section_address): Do not advance
3532 dot value and load address if section type is NOLOAD. Set address
3533 of NOLOAD sections regardless of section flags.
3534 (Output_section_definition::print): Print section type if it is
3535 not SCRIPT_SECTION_TYPE_NONE.
3536 (Output_section_definition::section_type): New method.
3537 (Output_section_definition::script_section_type_name): Ditto.
3538 (Script_sections::output_section_name): Add new parameter
3539 PSECTION_TYPE for returning script section type. Pass it to
3540 section elements. Handle discard sections.
3541 (Sort_output_sections::operator()): Handle NOLOAD sections.
3542 * script-sections.h (Script_sections::Section_type): New enum type.
3543 (Script_sections::output_section_name): Add a new parameter for
3544 returning script section type.
3545 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3546 INFO and NOLOAD.
3547 * yyscript.y (union): Add new field SECTION_TYPE.
3548 (COPY, DSECT, INFO, NOLOAD): New tokens.
3549 (opt_address_and_section_type): Change type to output_section_header.
3550 (section_type): New non-terminal
3551 (section_header): Handle section type.
2253bfba 3552 (opt_address_and_section_type): Return section type value.
4dbd9faf 3553
721ea635
L
35542010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3555
3556 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3557 * testsuite/plugin_common_test_2.c (foo): Likewise.
3558
6bf924b0
DK
35592010-04-08 Doug Kwan <dougkwan@google.com>
3560
3561 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3562 Output_merge_data.
3563 * output.cc (Output_section::add_merge_input_section): Simplify
3564 code and return status of Output_merge_base::add_input_section.
e1df38aa 3565 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3566 returns true.
3567
24af6f92
DK
35682010-04-07 Doug Kwan <dougkwan@google.com>
3569
3570 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3571 if section is marked as containing instructions but has no mapping
3572 symbols.
3573 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3574 correct section index.
3575 (Arm_relobj::find_linked_text_section): Ditto.
3576
00698fc5
CC
35772010-04-07 Cary Coutant <ccoutant@google.com>
3578
3579 * archive.cc (include_member): Destroy Read_symbols_data object before
3580 releasing file.
3581 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3582 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3583 (Read_symbols_data::~Read_symbols_data) New destructor.
3584 (Section_relocs::Section_relocs) New constructor.
3585 (Section_relocs::~Section_relocs) New destructor.
3586 (Read_relocs_data::Read_relocs_data) New constructor.
3587 (Read_relocs_data::~Read_relocs_data) New destructor.
3588 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3589 pointers to NULL after deleting.
3590
7296d933
DK
35912010-04-07 Doug Kwan <dougkwan@google.com>
3592
3593 * arm.cc: Replace "endianity" with "endianness" in comments.
3594 (Arm_exidx_cantunwind): Ditto.
3595 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3596 (Arm_relobj::merge_flags_and_attributes): New method.
3597 (Arm_relobj::merge_flags_and_attributes_): New data member.
3598 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3599 (Arm_relobj::scan_sections_for_stubs): Ditto.
3600 (Arm_relobj::do_read_symbols): Check to see if we really want to
3601 merge processor-specific flags and attributes. Exit early if
3602 an object is empty except for section names and the undefined symbol.
3603 (Target_arm::do_finalize_sections): Move check for ELF format to
3604 Arm_relobj::do_read_symbols. Merge processor specific flags and
3605 attributes from a regular object only when we have determined that
3606 it is aapropriate. Do not create an .ARM.attributes section in
3607 output if there is no regular input object.
3608 (Target_arm::merge_processor_specific_flags): Check
3609 --warn-mismatch before printing any error.
3610 (Target_arm::merge_object_attributes): Ditto.
3611 * gold.cc (queue_middle_tasks): Handle the case in which there is
3612 no regular object in input.
3613 * options.cc (General_options::parse_EB): New method.
3614 (General_options::parse_EL): Same.
3615 (General_options::General_options): Initialize endianness_.
3616 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3617 New options.
3618 (General_options::Endianness): New enum.
3619 (General_options::endianness): New method.
3620 (General_options::endianness_): New data member.
3621 * parameters.cc (Parameters::set_options): Check target endianness.
3622 (Parameters::set_target_once): Ditto.
3623 (Parameters::check_target_endianness): New method.
3624 (parameters_force_valid_target): If either -EL or -EB is specified,
3625 use it to define endianness of default target.
3626 * parameters.h (Parameters::check_target_endianness): New method
3627 declaration.
3628 * target.h (class Target): Change "endianity" to "endianness"
3629 in comments.
3630
efc8d4f2
RW
36312010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3632
3633 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3634 * configure: Regenerate.
3635 * Makefile.in: Regenerate.
3636 * testsuite/Makefile.in: Regenerate.
3637
be234d88
CC
36382010-04-06 Cary Coutant <ccoutant@google.com>
3639
3640 gcc PR lto/42757
3641 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3642 prevailing definitions of common symbols.
3643 * testsuite/plugin_test_6.sh: New test case.
3644 * testsuite/plugin_common_test_1.c: New test case.
3645 * testsuite/plugin_common_test_2.c: New test case.
3646 * testsuite/Makefile.am (plugin_test_6): New test case.
3647 * testsuite/Makefile.in: Regenerate.
3648
bd32c6bd
NC
36492010-04-06 Nick Clifton <nickc@redhat.com>
3650
3651 * po/vi.po: New Vietnamese translation.
3652
323c532f
DK
36532010-03-30 Doug Kwan <dougkwan@google.com>
3654
3655 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3656
4fcd97eb
DK
36572010-03-25 Doug Kwan <dougkwan@google.com>
3658
3659 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3660 to avoid a conversion warning on a 32-bit host.
3661
4ebf39db
ILT
36622010-03-24 Ian Lance Taylor <iant@google.com>
3663
3664 * testsuite/script_test_3.t: Add a TLS segment.
3665 * testsuite/Makefile.am (check_PROGRAMS): Add
3666 tls_phdrs_script_test.
3667 (tls_phdrs_script_test_SOURCES): Define.
3668 (tls_phdrs_script_test_DEPENDENCIES): Define.
3669 (tls_phdrs_script_test_LDFLAGS): Define.
3670 (tls_phdrs_script_test_LDADD): Define.
3671 * testsuite/Makefile.in: Rebuild.
3672
4a599bdd
CC
36732010-03-23 Cary Coutant <ccoutant@google.com>
3674
3675 * fileread.cc (find_or_make_view): Fix comment.
3676
6c93b22c
ILT
36772010-03-23 Ian Lance Taylor <iant@google.com>
3678
3679 * script-sections.cc (class Orphan_section_placement): Define
3680 PLACE_TLS and PLACE_TLS_BSS.
3681 (Orphan_section_placement::Orphan_section_placement): Initialize
3682 new places.
3683 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3684 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3685 (tls_script_test_SOURCES): Define.
3686 (tls_script_test_DEPENDENCIES): Define.
3687 (tls_script_test_LDFLAGS): Define.
3688 (tls_script_test_LDADD): Define.
3689 * testsuite/Makefile.in: Rebuild.
3690
a2c7281b
DK
36912010-03-22 Doug Kwan <dougkwan@google.com>
3692
3693 * arm.cc (Arm_relocate_functions::abs8,
3694 Arm_relocate_functions::abs16): Use correct check for overflow
3695 specified in the ARM ELF specs.
3696 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3697 target of a BLX instruction specially.
3698 (Reloc_stub::stub_type_for_reloc): Ditto.
3699 (Relocate::relocate): Use symbolic names instead of numeric relocation
3700 codes to report error.
3701 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3702 workaround.
3703 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3704 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3705 thumb2_blx_out_of_range.stdout
3706 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3707 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3708 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3709 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3710 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3711 thumb2_blx_in_range, thumb2_blx_in_range.o,
3712 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3713 thumb2_blx_out_of_range.o): New rules.
3714 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3715 thumb2_blx_in_range and thumb2_blx_out_of_range.
3716 * testsuite/Makefile.in: Regenerate.
3717 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3718 * testsuite/thumb_blx_in_range.s: New file.
3719 * testsuite/thumb_blx_out_of_range.s: New file.
3720
b0193076
RÁE
37212010-03-22 Rafael Espindola <espindola@google.com>
3722
3723 * archive.cc (Should_include): Move to archive.h.
3724 (should_include_member): Make it a member of Archive.
3725 (Lib_group): New.
3726 (Add_lib_group_symbols): New.
3727 * archive.h: Include options.h.
3728 (Archive_member): Moved from Archive.
3729 (Should_include): Moved from archive.cc.
3730 (Lib_group): New.
3731 (Add_lib_group_symbols): New.
3732 * dynobj.cc (do_should_include_member): New.
3733 * dynobj.h (do_should_include_member): New.
3734 * gold.cc (queue_initial_tasks): Update call to queue.
3735 * main.cc (main): Print lib group stats.
3736 * object.cc (do_should_include_member): New.
3737 * object.h: Include archive.h.
3738 (Object::should_include_member): New.
3739 (Object::do_should_include_member): New.
3740 (Sized_relobj::do_should_include_member): New.
3741 * options.cc (General_options::parse_start_lib): New.
3742 (General_options::parse_end_lib): New.
3743 (Input_arguments::add_file): Handle lib groups.
3744 (Input_arguments::start_group): Check we are not in a lib.
3745 (Input_arguments::start_lib): New.
3746 (Input_arguments::end_lib): New.
3747 * options.h (General_options): Add start_lib and end_lib.
3748 (Input_argument::lib_): New.
3749 (Input_argument::lib): New.
3750 (Input_argument::is_lib): New.
3751 (Input_file_lib): New.
3752 (Input_arguments::in_lib_): New.
3753 (Input_arguments::in_lib): New.
3754 (Input_arguments::start_lib): New.
3755 (Input_arguments::end_lib_): New.
3756 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3757 in unused members as preempted.
3758 (Sized_pluginobj::do_should_include_member): New.
3759 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3760 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3761 return the blocker.
3762 (Read_symbols::do_whole_lib_group): New.
3763 (Read_symbols::do_lib_group): New.
3764 (Read_symbols::do_read_symbols): Handle lib groups.
3765 (Read_symbols::get_name): Handle lib groups.
3766 * readsyms.h (Read_symbols): Add an archive member pointer.
3767 (Read_symbols::do_whole_lib_group): New.
3768 (Read_symbols::do_lib_group): New.
3769 (Read_symbols::member_): New.
3770 * script.cc (read_input_script): Update call to queue_soon.
3771
d099120c
DK
37722010-03-19 Doug Kwan <dougkwan@google.com>
3773
3774 * arm.cc (Stub_table::Stub_table): Initialize new data members
3775 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3776 (Stub_table::add_reloc_stub): Assign stub offset and update
3777 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3778 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3779 New data members.
3780 (Stub_table::update_data_size_and_addralign): Use
3781 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3782 instead of going over all reloc stubs.
3783 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3784 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3785 Stringpool_template::offset_ to size of Stringpool_char.
3786 (Stringpool_template::new_key_offset): Remove code to initialize
3787 Stringpool_template::offset_.
3788 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3789 Stringpool_template::offset_ to zero.
3790
1aa37384
DK
37912010-03-15 Doug Kwan <dougkwan@google.com>
3792
3793 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3794 offset_.
3795 (Stringpool_template::new_key_offset): New method.
3796 (Stringpool_template::add_string): Assign offsets when adding new
3797 strings.
3798 (Stringpool_template::set_string_offsets): Do not set string offsets
3799 when not optimizing.
3800 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3801 member size_.
3802 (Chunked_vector::clear): Clear size_.
3803 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3804 (Chunked_vector::size): Return size_.
3805 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3806 (Chunked_vector::size_): New data member.
1aa37384
DK
3807 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3808 (Stringpool_template::new_key_offset): New method declaration.
3809 (Stringpool_template::offset_): New data member.
3810
b672b057
RÁE
38112010-03-15 Rafael Espindola <espindola@google.com>
3812
3813 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3814 Add_symbols' constructor.
3815 * readsyms.h (Add_symbols): Remove the input_group member.
3816
b6848d3c
ILT
38172010-03-10 Ian Lance Taylor <iant@google.com>
3818
3819 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3820 target to ask whether a reference to a symbol requires a stack
3821 split.
3822 * target.h (Target::is_call_to_non_split): New function.
3823 (Target::do_is_call_to_non_split): Declare virtual function.
3824 * target.cc: Include "symtab.h".
3825 (Target::do_is_call_to_non_split): New function.
3826 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3827
a2a5469e
CC
38282010-03-10 Cary Coutant <ccoutant@google.com>
3829
3830 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3831 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3832 (File_read::open[2]): Add whole_file_view_ to list of views.
3833 (File_read::make_view): Remove test of whole_file_view_.
3834 (File_read::find_or_make_view): Create whole_file_view_ if
3835 necessary.
3836 (File_read::clear_views): Replace bool parameter with enum;
3837 adjust all callers. Don't delete views with permanent data;
3838 do delete cached views and views from archives if
3839 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3840 if clearing the corresponding view.
3841 * fileread.h (File_read::Clear_views_mode): New enum.
3842 (File_read::View::is_permanent_view): New method.
3843 (File_read::clear_views): Replace bool parameter
3844 with enum; adjust all callers.
3845 * options.h (General_options): Change keep_files_mapped option;
3846 add map_whole_files.
3847 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3848 releasing the file.
3849 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3850 the file.
3851
8861f32b
DM
38522010-03-10 David S. Miller <davem@davemloft.net>
3853
3854 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3855
d62d0f5f
ST
38562010-03-09 Sriraman Tallam <tmsriram@google.com>
3857
3858 * icf.cc (get_section_contents): Add '@' marker after processing the
3859 merge reloc.
3860
9177756d
DK
38612010-03-08 Doug Kwan <dougkwan@google.com>
3862
3863 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3864 due to a conversion warning.
3865 (Arm_relobj::update_output_local_symbol_count): Check for local
3866 symbol with unset output index.
3867
9e9e071b
ILT
38682010-03-05 Ian Lance Taylor <iant@google.com>
3869
3870 * options.h (class General_options): Add --spare-dynamic-tags.
3871 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3872 --spare-dynamic-tags.
3873
a81ee015
ILT
38742010-03-05 Ian Lance Taylor <iant@google.com>
3875
3876 * incremental.cc: Include "libiberty.h".
3877
44ec90b9
RO
38782010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3879
3880 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3881 function, is_info_ member.
3882 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3883 (Versions::Versions): Update caller.
3884 (Versions::define_base_version): Likewise.
3885 (Versions::add_def): Likewise.
3886
0897ed3b
ST
38872010-03-03 Sriraman Tallam <tmsriram@google.com>
3888
3889 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3890 (Scan::possible_function_pointer_reloc): New function.
3891 (Scan::local_reloc_may_be_function_pointer): Change to call
3892 possible_function_pointer_reloc.
3893 (Scan::global_reloc_may_be_function_pointer): Ditto.
3894 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3895 relocations in ".data.rel.ro._ZTV" section.
3896 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3897 * testsuite/icf_safe_so_test.cc: Ditto.
3898 * testsuite/icf_safe_test.cc: Ditto.
3899 * testsuite/icf_safe_test.sh: Ditto.
3900
d3bbad62
ILT
39012010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3902 Ian Lance Taylor <iant@google.com>
3903
3904 * target-reloc.h (relocate_section): Check the symbol table index
3905 for -1U before setting the local symbol index.
3906 (scan_relocatable_relocs): If copying the relocation, record that
3907 the local symbol is required.
3908 * object.h (Symbol_value::is_output_symtab_index_set): New
3909 function.
3910 (Symbol_value::may_be_discarded_from_output_symtab): New
3911 function.
3912 (Symbol_value::has_output_symtab_entry): New function.
3913 (Symbol_value::needs_output_symtab_entry): Remove.
3914 (Symbol_value::output_symtab_index): Make sure the symbol index is
3915 set.
3916 (Symbol_value::set_output_symtab_index): Make sure the symbol
3917 index is not set. Make sure the new index is valid.
3918 (Symbol_value::set_must_have_output_symtab_entry): New function.
3919 (Symbol_value::has_output_dynsym_entry): New function.
3920 (Symbol_value::set_output_dynsym_index): Make sure the new index
3921 is valid.
3922 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3923 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3924 local symbol if permitted.
3925 (Sized_relobj::do_finalize_local_symbols): Call
3926 is_output_symtab_index_set rather than needs_output_symtab_entry.
3927 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3928 rather than needs_output_symtab_entry. Call
3929 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3930 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3931 is_output_symtab_index_set rather than needs_output_symtab_entry.
3932 * testsuite/discard_locals_relocatable_test.c: New file.
3933 * testsuite/discard_locals_test.sh: Test -r.
3934 * testsuite/Makefile.am (check_DATA): Add
3935 discard_locals_relocatable_test1.syms,
3936 discard_local_relocatable_test2.syms.
3937 (MOSTLYCLEANFILES): Likewise. Also add
3938 discard_locals_relocatable_test1.lout and
3939 discard_locals_relocatable_test2.out.
3940 (discard_locals_relocatable_test1.syms): New target.
3941 (discard_locals_relocatable_test.o): New target.
3942 (discard_locals_relocatable_test1.out): New target.
3943 (discard_locals_relocatable_test2.syms): New target.
3944 (discard_locals_relocatable_test2.out): New target.
3945 (various): Add missing ../ld-new dependencies.
3946 * testsuite/Makefile.in: Rebuild.
3947
7e8ccf26
NC
39482010-03-03 Nick Clifton <nickc@redhat.com>
3949
3950 * po/fi.po: New Finnish translation.
3951
2a0ff005
DK
39522010-03-01 Doug Kwan <dougkwan@google.com>
3953
3954 * layout.cc (Layout::Layout): Force section types of .init_array*,
3955 .preinit_array* and .fini_array* sections.
3956 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3957 Fix check of return value of std::string::find.().
3958 (Output_section::Input_section_sort_compare::operator()): Remove
3959 comment about .init_array.
3960 (Output_section::Input_section_sort_init_fini_compare::operator()):
3961 New method.
3962 (Output_section::sort_attached_input_sections): Handle .init_array
3963 and .fini_array specially.
3964 * output.h (Output_section::Inut_section_sort_compare): Update
3965 comment.
3966 (Output_section::Input_section_sort_init_fini_compare): New struct.
3967
c3e4ae29
DK
39682010-02-26 Doug Kwan <dougkwan@google.com>
3969
3970 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3971 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3972 * testsuite/debug_msg.sh: Avoid matching source line number for
3973 use of global variable undef_int.
3974
2fd9ae7a
DK
39752010-02-26 Doug Kwan <dougkwan@google.com>
3976
3977 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3978 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3979 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3980 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3981 * options.cc (General_options::General_options): Initialize member
3982 fix_v4bx_.
3983 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3984 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3985 and rm_no_fix_v4bx.stdout
3986 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3987 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3988 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3989 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3990 and arm_no_fix_v4bx.
3991 * Makefile.in: Regenerate.
3992 * testsuite/arm_fix_v4bx.s: New file.
3993 * testsuite/arm_fix_v4bx.sh: Ditto.
3994
67ec7d0b
DK
39952010-02-24 Doug Kwan <dougkwan@google.com>
3996
3997 * arm.cc (Target_arm::got_section): Make the .got section the first
3998 non RELRO section in the data segment.
3999 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4000 suffixes of section names.
4001
10165461
DK
40022010-02-24 Doug Kwan <dougkwan@google.com>
4003
4004 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4005 flags and attributes merging if an input file is a binary file.
4006 * fileread.cc (Input_file::open): Record format of original file.
4007 * fileread.h (Input_file::Format): New enum type.
4008 (Input_file::Input_file): Initialize data member format_.
4009 (Input_file::format): New method definition.
4010 (Input_file::format_):: New data member.
4011
4a54abbb
DK
40122010-02-24 Doug Kwan <dougkwan@google.com>
4013
4014 * arm.cc (Arm_output_data_got): New class.
4015 (ARM_TCB_SIZE): New constant
4016 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4017 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4018 If user uses a script with a SECTIONS clause, issue only a warning
4019 for a misplaced EXIDX input section. Otherwise, issue an error.
4020 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4021 garbage collection.
4022 (Target_arm::got_mode_index_entry): Handle static linking.
4023 (Target_arm::Scan::local): Ditto.
4024 (Target_arm::Scan::global): Ditto.
4025 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4026 all incorrectly implemented relocations.
e1df38aa 4027 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4028 Arm_output_section::fix_exidx_coverage.
4029 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4030 from ".ARM.exidx." and ".ARM.extab.".
4031
ca419a6f
ILT
40322010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4033
4034 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4035 section if it does not already exist.
4036 * attributes.cc (Attributes_section_data::Attributes_section_data):
4037 Don't crash if size is zero.
4038
135b9c78
ILT
40392010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4040 Ian Lance Taylor <iant@google.com>
4041
4042 * gold.cc (queue_middle_tasks): If no input files were opened,
4043 exit.
4044 * workqueue.h (Task_function::Task_function): Assert that there is
4045 a blocker.
4046
bb0bfe4f
DK
40472010-02-22 Doug Kwan <dougkwan@google.com>
4048
4049 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4050 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4051 types to avoid warnings due to different uint64_t implementations
4052 on different hosts.
4053
2a2b6d42
DK
40542010-02-21 Doug Kwan <dougkwan@google.com>
4055
4056 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4057 handling of the maximum backward branch offset.
4058 (Arm_relocate_functions::thumb_branch_common): Ditto.
4059 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4060 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4061 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4062 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4063 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4064 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4065 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4066 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4067 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4068 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4069 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4070 thumb2_bl_out_of_range.o): New rules.
4071 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4072 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4073 thumb2_bl_out_of_range
4074 * testsuite/Makefile.in: Regenerate.
4075 * testsuite/arm_bl_in_range.s: New file.
4076 * testsuite/arm_bl_out_of_range.s: Ditto.
4077 * testsuite/arm_branch_in_range.sh: Ditto.
4078 * testsuite/arm_branch_range.t: Ditto.
4079 * testsuite/thumb2_branch_range.t: Ditto.
4080 * testsuite/thumb_bl_in_range.s: Ditto.
4081 * testsuite/thumb_bl_out_of_range.s: Ditto.
4082 * testsuite/thumb_branch_range.t: Ditto.
4083
b487ad64
ST
40842010-02-20 Sriraman Tallam <tmsriram@google.com>
4085
4086 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4087 Add reloc offset information.
4088 * icf.cc (get_section_contents): Change iterators to point to the new
4089 vectors. Add reloc offset information to the contents.
4090 * icf.h (Icf::Sections_reachable_info): New typedef.
4091 (Icf::Sections_reachable_list): New typedef.
4092 (Icf::Offset_info): New typedef.
4093 (Icf::Reloc_info): New struct typedef.
4094 (Icf::Reloc_info_list): New typedef.
4095 (Icf::symbol_reloc_list): Delete method.
4096 (Icf::addend_reloc_list): Delete method.
4097 (Icf::section_reloc_list): Delete method.
4098 (Icf::reloc_info_list): New method.
4099 (Icf::reloc_info_list_): New member.
4100
f96accdf
DK
41012010-02-19 Doug Kwan <dougkwan@google.com>
4102
4103 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4104 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4105 * arm.cc (Arm_relocation_functions): New forward declaration.
4106 (Target_arm::Target_arm): Initialize new data members
4107 got_mod_index_offset_ and tls_base_symbol_defined_.
4108 (Target_arm::Relocate::relocate_tls): New method.
4109 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4110 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4111 New methods.
4112 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4113 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4114 (Target_arm::got_mod_index_offset_,
4115 Target_arm::tls_base_symbol_defined_): New data members.
4116 (Target_arm::Scan::local, Target::Scan::global,
4117 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4118 relocations.
4119
c8761b9a
DK
41202010-02-18 Doug Kwan <dougkwan@google.com>
4121
4122 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4123 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4124 text section as a parameter becuase some broken tools may not set
4125 the link in section header.
4126 (Target_arm::has_got_section): New method.
4127 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4128 without any mapping symbol as data only. Remove warning.
4129 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4130 link in its section header, try to discover the link by inspecting the
4131 REL31 relocation at the beginning of the section.
4132 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4133 in error message.
4134 (Target_arm::Scan::global): Treat any reference to the symbol
4135 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4136
21bb3914
ST
41372010-02-12 Sriraman Tallam <tmsriram@google.com>
4138
4139 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4140 (Scan::global_reloc_may_be_function_pointer): New function.
4141 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4142 (Scan::global_reloc_may_be_function_pointer): New function.
4143 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4144 (Scan::global_reloc_may_be_function_pointer): New function.
4145 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4146 (Scan::global_reloc_may_be_function_pointer): New function.
4147 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4148 (Scan::global_reloc_may_be_function_pointer): New function.
4149 (Scan::possible_function_pointer_reloc): New function.
4150 (Target_x86_64::can_check_for_function_pointers): New function.
4151 * gc.h (gc_process_relocs): Scan relocation types to determine if
4152 function pointers were taken for targets that support it.
4153 * icf.cc (Icf::find_identical_sections): Include functions for
4154 folding in safe ICF whose pointer is not taken.
4155 * icf.h (Secn_fptr_taken_set): New typedef.
4156 (fptr_section_id_): New member.
4157 (section_has_function_pointers): New function.
4158 (set_section_has_function_pointers): New function.
4159 (check_section_for_function_pointers): New function.
4160 * options.h: Fix comment for safe ICF option.
4161 * target.h (can_check_for_function_pointers): New function.
4162 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4163 Modify icf_safe_test for X86-64.
4164 * testsuite/Makefile.in: Regenerate.
4165 * testsuite/icf_safe_so_test.cc: New file.
4166 * testsuite/icf_safe_so_test.sh: New file.
4167 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4168 (main): Change to take pointer to function kept_func_3.
4169 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4170 folding is done correctly for X86-64.
4171
0da6fa6c
DM
41722010-02-12 David S. Miller <davem@davemloft.net>
4173
4174 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4175 is_symbolless parameter.
4176 (Output_reloc<SHT_REL>::is_symbolless): New.
4177 (Output_reloc<SHT_REL>::is_symbolless_): New.
4178 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4179 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4180 (Output_reloc<SHT_RELA>::is_symbolless): New.
4181 (Output_data_reloc::add_global): Handle is_symbolless.
4182 (Output_data_reloc::add_global_relative): Likewise.
4183 (Output_data_reloc::add_local): Likewise.
4184 (Output_data_reloc::add_local_relative): Likewise.
4185 (Output_data_reloc::add_symbolless_global_addend): New.
4186 (Output_data_reloc::add_symbolless_local_addend): New.
4187 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4188 is_symbolless.
4189 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4190 instead of ->is_relative_
4191 (Output_reloc::write): Likewise.
4192 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4193 (Output_reloc::write_rel): Simplify.
4194
4195 * sparc.cc (Target_sparc::Scan::local): Use
4196 ->add_symbolless_local_addend as needed.
4197 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4198 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4199 based upon relocation offset.
4200
e4782e83
DK
42012010-02-11 Doug Kwan <dougkwan@google.com>
4202
4203 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4204 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4205 beginning of function.
4206 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4207 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4208 parameter is_32bit in calls to should_apply_static_reloc.
4209 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4210 (check_DATA): Add arm_abs_global.stdout.
4211 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4212 arm_abs_global.stdout): New rules.
4213 (MOSTLLYCLEANFILES): Add arm_abs_global
4214 * Makefile.in: Regenerate.
4215 * testsuite/arm_abs_global.s: New file.
4216 * testsuite/arm_abs_global.sh: Ditto.
4217 * testsuite/arm_abs_lib.s: Ditto.
4218
93ceb764
ILT
42192010-02-11 Ian Lance Taylor <iant@google.com>
4220
4221 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4222 Read_relocs task.
4223 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4224 Allocate_commons_task first.
4225 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4226 task, rather than symtab_lock_.
4227 (Gc_process_relocs::~Gc_process_relocs): New function.
4228 (Gc_process_relocs::is_runnable): Check this_blocker_.
4229 (Gc_process_relocs::locks): Use next_blocker_ rather than
4230 blocker_.
4231 (Scan_relocs::~Scan_relocs): New function.
4232 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4233 symtab_lock_.
4234 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4235 next_blocker_.
4236 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4237 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4238 constructor accordingly.
4239 (class Gc_process_relocs): Likewise.
4240 (class Scan_relocs): Likewise.
4241 * common.h (class Allocate_commons_task): Remove symtab_lock_
4242 field, and corresponding constructor parameter.
4243 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4244 symtab_lock_.
4245 (Allocate_commons_task::locks): Likewise.
4246
114dfbe1
ILT
42472010-02-11 Ian Lance Taylor <iant@google.com>
4248
4249 * gold-threads.h (class Once): Define.
4250 (class Initialize_lock): Rewrite as child of Once.
4251 * gold-threads.cc (class Once_initialize): Define.
4252 (once_pointer_control): New static variable.
4253 (once_pointer, once_arg): New static variables.
4254 (c_run_once): New static function.
4255 (Once::Once, Once::run_once, Once::internal_run): New functions.
4256 (class Initialize_lock_once): Remove.
4257 (initialize_lock_control): Remove.
4258 (initialize_lock_pointer): Remove.
4259 (initialize_lock_once): Remove.
4260 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4261 (Initialize_lock::initialize): Rewrite.
4262 (Initialize_lock::do_run_once): New function.
4263 * archive.cc (Archive::interpret_header): Only clear name if it is
4264 not already empty.
4265 * fileread.cc: Include "gold-threads.h"
4266 (file_counts_lock): New static variable.
4267 (file_counts_initialize_lock): Likewise.
4268 (File_read::release): Only increment counts when using --stats.
4269 Use a lock around the increment.
4270 * parameters.cc (class Set_parameters_target_once): Define.
4271 (set_parameters_target_once): New static variable.
4272 (Parameters::Parameters): Move here from parameters.h.
4273 (Parameters::set_target): Rewrite.
4274 (Parameters::set_target_once): New function.
4275 (Parameters::clear_target): Move here and rewrite.
4276 * parameters.h (class Parameters): Update declarations. Add
4277 set_parameters_target_once_ field.
4278 (Parameters::Parameters): Move to parameters.cc.
4279 (Parameters::clear_target): Likewise.
4280 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4281 task.
4282 (Start_group::~Start_group): New function.
4283 (Start_group::is_runnable): New function.
4284 (Start_group::locks, Start_group::run): New functions.
4285 (Finish_group::run): Change saw_undefined to size_t.
4286 * readsyms.h (class Start_group): Define.
4287 (class Finish_group): Change saw_undefined_ field to size_t.
4288 (Finish_group::Finish_group): Remove saw_undefined and
4289 this_blocker parameters. Change all callers.
4290 (Finish_group::set_saw_undefined): New function.
4291 (Finish_group::set_blocker): New function.
4292 * symtab.h (class Symbol_table): Change saw_undefined to return
4293 size_t. Change saw_undefined_ field to size_t.
4294 * target-select.cc (Set_target_once::do_run_once): New function.
4295 (Target_selector::Target_selector): Initialize set_target_once_
4296 field. Don't initialize lock_ and initialize_lock_ fields.
4297 (Target_selector::instantiate_target): Rewrite.
4298 (Target_selector::set_target): New function.
4299 * target-select.h (class Set_target_once): Define.
4300 (class Target_selector): Update declarations. Make
4301 Set_target_once a friend. Remove lock_ and initialize_lock_
4302 fields. Add set_target_once_ field.
4303
fa17a3f4
ILT
43042010-02-10 Ian Lance Taylor <iant@google.com>
4305
4306 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4307 queueing any tasks.
4308 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4309 (queue_middle_tasks): Add all blockers before queueing any tasks.
4310 (queue_final_tasks): Likewise.
4311 * token.h (Task_token::add_blockers): New function.
4312 * object.h (Input_objects::number_of_relobjs): New function.
4313
c7177d31
ILT
43142010-02-10 Ian Lance Taylor <iant@google.com>
4315
5de0e392
ILT
4316 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4317 shared, not if not position independent.
4318 * x86_64.cc (Relocate::relocate_tls): Likewise.
4319 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4320 (tls_pie_pic_test): New target.
4321 * testsuite/Makefile.in: Rebuild.
4322
c7177d31
ILT
4323 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4324 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4325 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4326 * testsuite/Makefile.in: Rebuild.
4327
684b268a
DM
43282010-02-09 David S. Miller <davem@davemloft.net>
4329
4330 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4331 R_SPARC_RELATIVE using ->add_local_relative().
4332 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4333
612a8d3d
DM
4334 * output.h (Output_data_dynamic::add_section_size): New method
4335 that takes two Output_data objects.
4336 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4337 entry param. Handle it in initializers.
4338 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4339 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4340 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4341 arg.
4342 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4343 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4344 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4345 for dynrel_includes_plt.
4346 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4347 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4348 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4349 before .rela.plt
4350 (Target_sparc::do_finalize_sections): Update to pass true for
4351 dynrel_includes_plt.
4352 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4353 output before .rela.plt
4354 (Target_powerpc::do_finalize_sections): Update to pass true for
4355 dynrel_includes_plt when 32-bit.
4356
cb1be87e
DK
43572010-02-08 Doug Kwan <dougkwan@google.com>
4358
4359 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4360 method.
4361 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4362 Arm_relobj::scan_section_for_cortex_a8_stubs,
4363 Arm_relobj::do_relocation_section): Instead of calling
4364 Output_section::output_address, use faster
4365 Arm_relobj::simple_input_section_output_address.
4366
705b5121
DM
43672010-02-08 David S. Miller <davem@davemloft.net>
4368
4369 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4370 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4371 relocation helper function.
4372
024c4466
DM
4373 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4374 just like R_SPARC_GOT{10,13,22}.
4375 (Target_sparc::Scan::local): Likewise.
4376 (Target_sparc::Relocate:relocate): Likewise.
4377
9109c078
ILT
43782010-02-06 Ian Lance Taylor <iant@google.com>
4379
4380 * configure.ac: Rewrite targetobjs duplicate removal code to use
4381 only shell constructs.
4382 * configure: Rebuild.
4383
cf846138
DK
43842010-02-05 Doug Kwan <dougkwan@google.com>
4385
4386 PR 11247
4387 * arm.cc (Arm_relobj::section_is_scannable): New method.
4388 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4389 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4390
6cfaf60b
DK
43912010-02-04 Doug Kwan <dougkwan@google.com>
4392
4393 PR 11247
4394 * arm-reloc-property.cc (cstdio): Include.
4395 * configure.ac (targetobjs): Remove duplicates.
4396 * configure: Regenerate.
4397 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4398 big and little endian version for a given address size.
4399
5c57f1be
DK
44002010-02-03 Doug Kwan <dougkwan@google.com>
4401
4402 * arm-reloc-property.cc
4403 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4404 definition.
4405 * arm-reloc-property.h
4406 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4407 New method definition.
4408 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4409 declaration.
4410 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4411 overflow to N.
4412 (GOT_PREL): Change implemented to Y.
4413 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4414 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4415 (Arm_relocate_functions::movw_abs_nc): Remove method.
4416 (Arm_relocate_functions::movt_abs): Ditto.
4417 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4418 (Arm_relocate_functions::thm_movt_abs): Ditto.
4419 (Arm_relocate_functions::movw_rel_nc): Ditto.
4420 (Arm_relocate_functions::movw_rel): Ditto.
4421 (Arm_relocate_functions::movt_rel): Ditto.
4422 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4423 (Arm_relocate_functions:thm_movw_rel): Ditto.
4424 (Arm_relocate_functions:thm_movt_rel): Ditto.
4425 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4426 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4427 New method definitions.
4428 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4429 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4430 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4431 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4432 (Target_arm::Relocate::relocate): Check for non-static or
4433 unimplemented relocation code and exit early. Change calls to
4434 Target_arm::reloc_uses_thumb_bit and
4435 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4436 instead. Refactor code to handle similar relocations to increase
4437 code sharing. Remove check for unsupported relocation code in switch
4438 statement.
4439 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4440 relocation property table to find out size. Change error message to
4441 print out the name of a relocation code instead of the numeric value.
4442 (Target_arm::scan_reloc_for_stub): Use relocation property table
4443 instead of calling Target_arm::reloc_uses_thumb_bit().
4444
218c5831
DK
44452010-02-02 Doug Kwan <dougkwan@google.com>
4446
4447 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4448 types of relaxed input section.
4449
0d31c79d
DK
44502010-02-02 Doug Kwan <dougkwan@google.com>
4451
4452 * Makefile.am (HFILES): Add arm-reloc-property.h.
4453 (DEFFILES): New.
4454 (TARGETSOURCES): Add arm-reloc-property.cc
4455 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4456 (libgold_a_SOURCES): $(DEFFILES)
4457 * Makefile.in: Regenerate.
4458 * arm-reloc-property.cc: New file.
4459 * arm-reloc-property.h: New file.
4460 * arm-reloc.def: New file.
4461 * arm.cc: Update comments.
4462 (arm-reloc-property.h): New included header.
4463 (arm_reloc_property_table): New global variable.
4464 (Target_arm::do_select_as_default_target): New method definition.
4465 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4466 arm-reloc-property to targ_extra_obj.
4467 * parameters.cc (set_parameters_target): Call
4468 Target::select_as_default_target().
4469 * target.h (Target::select_as_default_target): New method definition.
4470 (Target::do_select_as_default_target): Same.
4471
546c7457
DK
44722010-02-01 Doug Kwan <dougkwan@google.com>
4473
4474 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4475 first_output_text_section_.
4476 (Arm_exidx_fixup::first_output_text_section): New method definition.
4477 (Arm_exidx_fixup::first_output_text_section_): New data member.
4478 (Arm_exidx_fixup::process_exidx_section): Record the first text
4479 output section seen.
4480 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4481 and entsize in output section header.
4482
11b861d5
DK
44832010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4484
4485 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4486 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4487 (Arm_relocate_functions::thm_alu11): New Method.
4488 (Arm_relocate_functions::thm_pc8): New Method.
4489 (Arm_relocate_functions::thm_pc12): New Method.
4490 (Target_arm::Scan::local): Handle the relocations.
4491 (Target_arm::Scan::global): Likewise.
4492 (Target_arm::Relocate::relocate): Likewise.
4493 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4494
c9a2c125
DK
44952010-01-29 Doug Kwan <dougkwan@google.com>
4496
4497 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4498 of relocation types as ld.
4499
1521477a
DK
45002010-01-29 Doug Kwan <dougkwan@google.com>
4501
4502 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4503 to public.
4504 (Arm_relocate_functions::thumb_branch_common): Ditto.
4505 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4506 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4507 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4508 Arm_relocate_functions::jump24): Remove.
4509 (Target_arm::Relocate::relocate): Adjust code to call
4510 Arm_relocation_functions::arm_branch_common and
4511 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4512 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4513
e7eca48c
DK
45142010-01-29 Doug Kwan <dougkwan@google.com>
4515
4516 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4517 output_local_symbol_count_needs_update_.
4518 (Arm_relobj::output_local_symbol_count_needs_update,
4519 Arm_relobj::set_output_local_symbol_count_needs_update,
4520 Arm_relobj::update_output_local_symbol_count): New methods.
4521 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4522 member.
4523 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4524 of pointed function as in a R_ARM_PREL31 relocation.
4525 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4526 for output local symbol count updating.
4527 (Target_arm::do_relax): Update output local symbol counts in objects
4528 if necessary.
4529 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4530
02961d7e
ILT
45312010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4532
4533 * arm.cc: Added support for the ARM relocations:
4534 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4535 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4536 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4537 movw_prel_nc).
4538 (Arm_relocate_functions::movw_rel): New method.
4539 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4540 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4541 thm_movw_prel_nc).
4542 (Arm_relocate_functions::thm_movw_rel): New method.
4543 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4544 thm_movt_prel).
4545 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4546 relocations.
4547 (Target_arm::Scan::global): Likewise.
4548 (Target_arm::Relocate::relocate): Likewise.
4549 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4550 Likewise.
4551
b10d2873
ILT
45522010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4553
4554 * arm.cc: Added support for ARM group relocations.
4555 (Target_arm::reloc_needs_sym_origin): New method.
4556 (Arm_relocate_functions::calc_grp_kn): New method.
4557 (Arm_relocate_functions::calc_grp_residual): New method.
4558 (Arm_relocate_functions::calc_grp_gn): New method.
4559 (Arm_relocate_functions::arm_grp_alu): New Method.
4560 (Arm_relocate_functions::arm_grp_ldr): New Method.
4561 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4562 (Arm_relocate_functions::arm_grp_ldc): New Method.
4563 (Target_arm::Scan::local): Handle the ARM group relocations.
4564 (Target_arm::Scan::global): Likewise.
4565 (Target_arm::Relocate::relocate): Likewise.
4566 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4567 Likewise.
4568
2b328d4e
DK
45692010-01-26 Doug Kwan <dougkwan@google.com>
4570
4571 * arm.cc (set): Include.
4572 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4573 pointer type.
4574 (Arm_output_section::Text_section_list): New type.
4575 (Arm_output_section::append_text_sections_to_list): New method.
4576 (Arm_output_section::fix_exidx_coverage): Ditto.
4577 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4578 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4579 Relobj::set_section_offset() instead of
4580 Sized_relobj::invalidate_section_offset().
4581 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4582 parameter for section headers. Ignore relocation sections for
4583 unallocated sections and EXIDX sections.
4584 (Target_arm::fix_exidx_coverage): New method.
4585 (Target_arm::output_section_address_less_than): New type.
4586 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4587 linked text section instead of the EXIDX section.
4588 (Arm_output_section::create_stub_group): Add an assertion to check
4589 that this is not an EXIDX output section.
4590 (Arm_output_section::append_text_sections_to_list): New method.
4591 (Arm_output_section::fix_exidx_coverage): Ditto.
4592 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4593 Arm_relobj::section_needs_reloc_stub_scanning.
4594 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4595 first pass.
4596 (Target_arm::fix_exidx_coverage): New method.
4597 * object.h (Relobj::set_output_section): New method.
4598 (Sized_relobj::invalidate_section_offset): Remove method.
4599 (Sized_relobj::do_invalidate_section_offset): Remove method.
4600 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4601
c7f3c371
DK
46022010-01-25 Doug Kwan <dougkwan@google.com>
4603
4604 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4605 Fix warning due to signed and unsigned comparison on a 32-bit host.
4606
8923b24c
DK
46072010-01-22 Doug Kwan <dougkwan@google.com>
4608
4609 * arm.cc (Target_arm::do_relax): Record an output section for section
4610 offset adjustment it contains any stub table that has changed.
4611 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4612 offsets in an output section if necessary.
4613 * output.cc (Output_section::Output_section): Initialize
4614 section_offsets_need_adjustments_.
4615 (Output_section::add_input_section_for_script): Renamed to
4616 Output_section::add_simple_input_section.
4617 (Output_section::save_states): Add a comment.
4618 (Output_section::discard_states): New method defintion.
4619 (Output_section::adjust_section_offsets): Same.
4620 * output.h (Output_section::add_input_section_for_script): Renamed to
4621 Output_section::add_simple_input_section.
4622 (Output_section::discard_states): New method declaration.
4623 (Output_section::adjust_section_offsets): Same.
4624 (Output_section::section_offsets_need_adjustment,
4625 Output_section::set_section_offsets_need_adjustment): New method
4626 definitions.
4627 (Output_section::section_offsets_need_adjustment_): New data member.
4628 * script-sections.cc
4629 (Output_section_element_input::set_section_address): Adjust code for
4630 renaming of Output_section::add_input_section_for_script.
4631 (Orphan_output_section::set_section_address): Same.
4632
9b2fd367
DK
46332010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4634
4635 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4636 Fix_v4bx enum values .
4637 * gold/options.h (General_options): New option definitions.
4638 (General_options::fix_v4bx): New method.
4639 (General_options::Fix_v4bx): New enum.
4640 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4641 (General_options::parse_fix_v4bx_interworking): New method.
4642
80d0d023
DK
46432010-01-22 Doug Kwan <dougkwan@google.com>
4644
4645 * arm.cc (Arm_exidx_fixup): New class.
4646
af2cdeae
DK
46472010-01-21 Doug Kwan <dougkwan@google.com>
4648
4649 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4650 classes.
4651 (Arm_exidx_section_offset_map): New type.
4652
993d07c1
DK
46532010-01-21 Doug Kwan <dougkwan@google.com>
4654
4655 * arm.cc (Arm_exidx_input_section): New class.
4656 (Arm_relobj::exidx_input_section_by_link,
4657 Arm_relobj::exidx_input_section_by_shndx,
4658 Arm_relobj::make_exidx_input_section): New methods.
4659 (read_arm_attributes_section): Remove.
4660 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4661 information about them.
4662 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4663 to here.
4664
5ac169d4
DK
46652010-01-20 Doug Kwan <dougkwan@google.com>
4666
4667 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4668 Input_section_specifier to Section_id.
4669 (Target_arm::new_arm_input_section: Adjust code for change of key
4670 type.
4671 (Target_arm::find_arm_input_section): Ditto.
4672 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4673 (Section_id): Remove.
4674 (Garbage_collection::Section_id_hash): Remove.
4675 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4676 (Section_id): Remove.
4677 (Icf::Section_id_hash): Remove.
4678 * object.h (Section_id, Const_section_id, Section_id_hash,
4679 Const_section_id_hash): New type definitions.
4680 * output.cc (Output_section::add_relaxed_input_section): Change to
4681 use Const_section_id instead of Input_section_specifier as key type.
4682 (Output_section::add_merge_input_section): Ditto.
4683 (Output_section::build_relaxation_map): Change to use Section_id
4684 instead of Input_section_specifier as key type.
4685 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4686 Ditto.
4687 (Output_section::convert_input_sections_to_relaxed_sections): Change
4688 to use Const_section_id instead of Input_section_specifier as key type.
4689 (Output_section::find_merge_section): Ditto.
4690 (Output_section::find_relaxed_input_section): Ditto.
4691 * output.h (Input_section_specifier): Remove class.
4692 (Output_section::Output_section_data_by_input_section_map): Change
4693 key type to Const_section_id.
4694 (Output_section::Output_relaxed_input_section_by_input_section_map):
4695 Ditto.
4696 (Output_section::Relaxation_map): Change key type to Section_id.
4697
a2162063
ILT
46982010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4699
4700 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4701 (class Arm_v4bx_stub): New class.
4702 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4703 (Stub_factory::make_arm_v4bx_stub): New method.
4704 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4705 (Stub_table::empty): Handle v4bx stubs.
4706 (Stub_table::add_arm_v4bx_stub): New method.
4707 (Stub_table::find_arm_v4bx_stub): New method.
4708 (Arm_relocate_functions::v4bx): New method.
4709 (Target_arm::fix_v4bx): New method.
4710 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4711 (Stub_table::relocate_stubs): Likewise.
4712 (Stub_table::do_write): Likewise.
4713 (Stub_table::update_data_size_and_addralign): Likewise.
4714 (Stub_table::finalize_stubs): Likewise.
4715 (Target_arm::Scan::local): Likewise.
4716 (Target_arm::Scan::global): Likewise.
4717 (Target_arm::do_finalize_sections): Likewise.
4718 (Target_arm::Relocate::relocate): Likewise.
4719 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4720 Likewise.
4721 (Target_arm::scan_reloc_for_stub): Likewise.
4722 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4723
5696ab0b
ILT
47242010-01-19 Ian Lance Taylor <iant@google.com>
4725
4726 * output.cc (Output_section_headers::do_sized_write): Write large
4727 segment count to sh_info field.
4728 (Output_file_header::do_sized_write): For large segment count,
4729 write PN_XNUM to e_phnum field.
4730
800d0f56
ILT
47312010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4732
4733 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4734 (Arm_relocate_functions::thm_jump8): New function.
4735 (Arm_relocate_functions::thm_jump11): New function.
4736 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4737 R_ARM_THM_JUMP11.
4738 (Target_arm::Scan::global): Likewise.
4739 (Target_arm::Relocate::relocate): Likewise.
4740 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4741 Likewise.
4742
41263c05
DK
47432010-01-14 Doug Kwan <dougkwan@google.com>
4744
4745 * arm.cc (map, utility): Include headers.
4746 (Target_arm::apply_cortex_a8_workaround): New method.
4747 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4748 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4749 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4750 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4751 the --[no-]fix-cortex-a8 command line options.
4752 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4753 (Target_arm::relocate_stub): Use addend in instruction template.
4754 * options.h (DEFINE_bool): Set the user-set flag.
4755 (General_options): Add --[no-]-fix-cortex options.
4756 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4757 : Update fast look-up map after conversion.
41263c05 4758
459e9b03
ST
47592010-01-14 Sriraman Tallam <tmsriram@google.com>
4760
4761 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4762 in the first pass of do_layout.
4763
b521dfe4
DK
47642010-01-13 Doug Kwan <dougkwan@google.com>
4765
4766 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4767 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4768 apparent compiler problem of not folding static constant integral
4769 data members of elfcpp::Elf_sizes<32>.
4770
44272192
DK
47712010-01-13 Doug Kwan <dougkwan@google.com>
4772
4773 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4774 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4775 Arm_relobj::scan_section_for_cortex_a8_erratum,
4776 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4777 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4778 sections to scan for relocation stubs into a new method
4779 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4780 relocation and Cortex-A8 stub scanning.
4781 (Target_arm::do_relax): Force stubs to be after stubbed sections
4782 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4783 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4784 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4785
44b71ece
ILT
47862010-01-12 Ian Lance Taylor <iant@google.com>
4787
4788 * target-reloc.h (visibility_error): New inline function.
4789 (relocate_section): Call visibility_error.
4790 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4791 (MOSTLYCLEANFILES): Likewise.
4792 (protected_4_pic.o, protected_3.err): New targets.
4793 * testsuite/protected_4.cc: New file.
4794
a120bc7f
DK
47952010-01-12 Doug Kwan <dougkwan@google.com>
4796
4797 * arm.cc (Cortex_a8_reloc): New class.
4798 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4799 and cortex_a8_relocs_info_.
4800 (Target_arm::fix_cortex_a8): New method definition.
4801 (Target_arm::Cortex_a8_relocs_info): New type.
4802 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4803 New data member declarations.
4804 (Target_arm::scan_reloc_for_stub): Record information about
4805 relocations for THUMB branches that might be exempted from the
4806 Cortex-A8 workaround.
4807 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4808 at the beginning of a relaxation pass.
4809
20138696
DK
48102010-01-12 Doug Kwan <dougkwan@google.com>
4811
4812 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4813 (Arm_relobj::Mapping_symbol_position,
4814 Arm_reloj::Mapping_symbol_position_less,
4815 Arm_relobj::Mapping_symbols_info): New types.
4816 (Target_arm::is_mapping_symbol_name): New method definition.
4817 (Arm_relobj::do_count_local_symbols): Save information about mapping
4818 symbols.
4819
089d69dc
DK
48202010-01-11 Doug Kwan <dougkwan@google.com>
4821
4822 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4823 Arm_relocate_functions::thumb32_branch_upper,
4824 Arm_relocate_functions::thumb32_branch_lower,
4825 Arm_relocate_functions::thumb32_cond_branch_offset,
4826 Arm_relocate_functions::thumb32_cond_branch_upper,
4827 Arm_relocate_functions::thumb32_cond_branch_lower,
4828 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4829 branch offset encoding.
4830 (Arm_relocate_functions::thumb_branch_common): Use new branch
4831 offset encoding methods to avoid code duplication.
4832 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4833 (Stub_addend_reader::operator()): Use new branch encoding method
4834 to avoid code duplication.
4835
99e5bff2
DK
48362010-01-11 Doug Kwan <dougkwan@google.com>
4837
4838 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4839 (Target_arm::do_finalize_sections): Define special EXIDX section
4840 symbols only if referenced.
4841 * gc.h (Garbage_collection::add_reference): New method.
4842 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4843 code duplication.
4844
98e090bd
ILT
48452010-01-11 Ian Lance Taylor <iant@google.com>
4846
d0a91bd8
ILT
4847 * script.cc (Version_script_info::build_expression_list_lookup):
4848 Change complaing about duplicate wildcard match from error to
4849 warning.
4850
98e090bd
ILT
4851 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4852 of 2009-12-30.
4853 (Version_script_info::Version_script_info): Initialize globs_,
4854 default_version_, default_is_global_, and exact_. Don't
4855 initialize globals_ or locals_.
4856 (Version_script_info::build_lookup_tables): Build local symbols
4857 first.
4858 (Version_script_info::unquote): New function.
4859 (Version_script_info::add_exact_match): New function.
4860 (Version_script_info::build_expression_list_lookup): Remove lookup
4861 parameter. Add is_global parameter. Change all callers. Handle
4862 wildcard pattern specially. Unquote pattern. Call
4863 add_exact_match.
4864 (Version_script_info::get_name_to_match): New function.
4865 (Version_script_info::get_symbol_version): New function.
4866 (Version_script_info::get_symbol_version_helper): Remove.
4867 (Version_script_info::check_unmatched_names): Call unquote.
4868 * script.h (class Version_script_info): Change get_symbol_version
4869 to be non-inline and add is_global parameter; change all callers.
4870 Rewrite symbol_is_local. Update declarations. Define struct
4871 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4872 Remove globals_ and locals_ members. Add exact_, globs_,
4873 default_version_, is_global_.
4874 (Version_script_info::Glob): Remove pattern, add expression and
4875 is_global. Update constructor. Change all callers.
4876 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4877 default version.
4878 (Versions::symbol_section_contents): If a symbol is undefined, or
4879 defined in a dynamic object, set the version index to
4880 VER_NDX_LOCAL.
4881 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4882 symbol_is_local.
4883 (Symbol_table::add_from_pluginobj): Likewise.
4884 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4885
d56962d3
DK
48862010-01-11 Doug Kwan <dougkwan@google.com>
4887
4888 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4889 (incremental_dump_LDADD): Add linking option for libintl.
4890 * Makefile.in: Regenerate.
4891
94e6ee91
L
48922010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4893
4894 PR gold/11144
4895 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4896 instead of -Ds.
4897 * testsuite/Makefile.in: Regenerated.
4898
e96c574b
DK
48992010-01-10 Doug Kwan <dougkwan@google.com>
4900
4901 * options.h (DEFINE_var): Use parentheses around argument varname__
4902 in macro body to avoid any unintended subsequent substitutions.
4903
7198066b
ILT
49042010-01-10 Ian Lance Taylor <iant@google.com>
4905
ba4d53bf
ILT
4906 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4907 candidates before doing symbol resolution.
4908
7198066b
ILT
4909 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4910 ODR candidates if only one is weak.
4911
a2beed37
ILT
49122010-01-08 Ian Lance Taylor <iant@google.com>
4913
4914 * script.cc (Version_script_info::build_expression_list_lookup):
4915 Don't warn about ambiguous version, just record the ambiguity.
4916 (Version_script_info::get_symbol_version_helper): Give error if
4917 version is ambiguous.
4918
2fb7225c
DK
49192010-01-08 Doug Kwan <dougkwan@google.com>
4920
4921 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4922 prev_data_size_ and prev_addralign_. Remove initializer for
4923 deleted data member has_been_changed_.
4924 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4925 to determine if the table is empty.
4926 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4927 Remove.
4928 (Stub_table::add_reloc_stub): Define method in class definition
4929 instead of just declaring it there.
4930 (Stub_table::add_cortex_a8_stub): New method definition.
4931 (Stub_table::update_data_size_and_addralign): Ditto.
4932 (Stub_table::finalize_stubs): Ditto.
4933 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4934 (Stub_table::do_addralign_): Return address alignment in the
4935 (Stub_table::do_reset_address_and_file_offset): Define method in
4936 class definition instead of declaring it there. Set current data
4937 size to be the data size of the previous pass.
4938 (Stub_table::set_final_data_size): Use current data size as the
4939 final data size.
4940 (Stub_table::relocate_stub): Change parameter type of stub from
4941 Reloc_stub pointer to Stub pointer.
4942 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4943 (Stub_table::Cortex_a8_stub_list): New typedef.
4944 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4945 Stub_table::prev_addralign_): New data member.
4946 (Arm_relobj::Arm_relobj): Initialize data member
4947 section_has_cortex_a8_workaround_.
4948 (Arm_relobj::section_has_cortex_a8_workaround,
4949 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4950 definitions.
4951 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4952 declarations.
4953 (Target_arm::relocate_stub): Change parameter type of stub from
4954 Reloc_stub pointer to Stub pointer.
4955 (Insn_template::size, Insn_template::alignment): Handle
4956 THUMB16_SPECIAL_TYPE.
4957 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4958 Stub_table::update_data_size_and_addralign,
4959 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4960 definitions.
4961 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4962 (Stub_table::do_write): Ditto.
4963 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4964
880cd20d
ILT
49652010-01-08 Ian Lance Taylor <iant@google.com>
4966
4967 PR 11108
4968 * symtab.h (class Symbol): Remove fields is_target_special_ and
4969 has_plt_offset_. Add field is_defined_in_discarded_section_.
4970 (Symbol::is_defined_in_discarded_section): New function.
4971 (Symbol::set_is_defined_in_discarded_section): New function.
4972 (Symbol::has_plt_offset): Rewrite.
4973 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4974 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4975 Don't initialize is_target_special_ or has_plt_offset_.
4976 Initialize is_defined_in_discarded_section_.
4977 (Symbol_table::add_from_relobj): If appropriate, set
4978 is_defined_in_discarded_section.
4979 * resolve.cc (Symbol::override_base_with_special): Don't test
4980 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4981 * target-reloc.h (relocate_section): Do special handling for
4982 symbols defined in discarded sections for global symbols as well
4983 as local symbols.
4984
2703e3eb
ILT
49852010-01-08 Ian Lance Taylor <iant@google.com>
4986
4987 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4988 the SHT_SYMTAB case.
4989
339d40a3
ILT
49902010-01-08 Ian Lance Taylor <iant@google.com>
4991
4992 * object.cc (Sized_relobj::do_layout): Don't get confused if
4993 layout_eh_frame returns NULL.
4994
abecea76
ILT
49952010-01-08 Ian Lance Taylor <iant@google.com>
4996
4997 PR 11084
4998 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4999 dynamic symbol table, use the normal symbol table.
5000 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5001 symbol table.
5002
6b7dd3f3
ILT
50032010-01-08 Ian Lance Taylor <iant@google.com>
5004
5005 PR 11072
5006 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5007 sections.
5008
36c50e63
L
50092010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5010
5011 * version.cc (print_version): Change to "Copyright 2010".
5012
e291e7b9
ILT
50132010-01-08 Ian Lance Taylor <iant@google.com>
5014
5015 PR 10287
5016 PR 11063
5017 * i386.cc (class Target_i386): Change return type of plt_section
5018 to be non-const.
5019 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5020 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5021 tls_desc_rel_ field.
5022 (Output_data_plt_i386::rel_tls_desc): New function.
5023 (Target_i386::rel_tls_desc_section): New function.
5024 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5025 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5026 R_386_TLS_DESC reloc in rel_tls_desc_section.
5027 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5028 Define struct Tlsdesc_info.
5029 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5030 (Target_x86_64::do_reloc_symbol_index): New function.
5031 (Target_x86_64::add_tlsdesc_info): New function.
5032 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5033 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5034 tlsdesc_rel_ field.
5035 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5036 all callers.
5037 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5038 (Target_x86_64::rela_tlsdesc_section): New function.
5039 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5040 handling.
5041 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5042 (Target_x86_64::do_reloc_addend): New function.
5043 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5044 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5045 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5046 (Output_reloc::type): New function.
5047 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5048 (Output_reloc::is_target_specific): New function.
5049 (Output_reloc::target_arg): New function.
5050 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5051 absolute relocs and target specific relocs.
5052 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5053 add_target_specific.
5054 (class Output_data_reloc) [SHT_RELA]: Likewise.
5055 * output.cc (Output_reloc::Output_reloc): Add four new versions
5056 for absolute relocs and target specific relocs.
5057 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5058 (Output_reloc::get_symbol_index): Likewise.
5059 (Output_reloc::local_section_offset): Check that local_sym_index_
5060 is not TARGET_CODE or 0.
5061 (Output_reloc::symbol_value): Likewise.
5062 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5063 reloc.
5064 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5065 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5066 functions.
5067 * layout.cc (add_target_dynamic_tags): Use output section for
5068 DT_PLTRELSZ and DT_JMPREL.
5069
3a44184e
ILT
50702010-01-07 Ian Lance Taylor <iant@google.com>
5071
5072 PR 11061
5073 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5074 function.
5075 (class Output_data_reloc_generic): Define.
5076 (class Output_data_reloc_base): Change base class to
5077 Output_data_reloc_generic. Change add() method to call
5078 bump_relative_reloc_count for a relative reloc. Remove
5079 sort_relocs_ field.
5080 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5081 to sort_relocs().
5082 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5083 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5084 appropriate.
5085 * layout.h (class Layout): Update declaration.
5086
ea715a34
ILT
50872010-01-07 Ian Lance Taylor <iant@google.com>
5088
5089 * output.h (class Output_data): Add const version of
5090 output_section and do_output_section.
5091 (class Output_section_data): Add const version of
5092 do_output_section.
5093 (class Output_section): Likewise.
5094 * layout.cc (Layout::add_target_dynamic_tags): New function.
5095 * layout.h (class Layout): Update declarations.
5096 * arm.cc (Target_arm::do_finalize_sections): Use
5097 add_target_dynamic_tags.
5098 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5099 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5100 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5101 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5102
659948a4
ILT
51032010-01-07 Ian Lance Taylor <iant@google.com>
5104
5105 PR 11042
5106 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5107 object as needed.
5108
9d3b86f6
ILT
51092010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5110 Ian Lance Taylor <iant@google.com>
5111
5112 PR 11019
5113 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5114 Xindex::read_symtab_xindex.
5115
bb0d3eb0
DK
51162010-01-07 Doug Kwan <dougkwan@google.com>
5117
5118 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5119 (Insn_template::thumb16_bcond_insn): New method declaration.
5120 (Insn_template): Fix spelling.
5121 (Stub::thumb16_special): New method declaration.
5122 (Stub::do_write): Define virtual method which was previously pure
5123 virtual.
5124 (Stub::do_thumb16_special): New method declaration.
5125 (Stub::do_fixed_endian_write): New template member.
5126 (Reloc_stub::do_write): Remove.
5127 (Reloc_stub::do_fixed_endian_write): Remove.
5128 (Cortex_a8_stub): New class definition.
5129 (Stub_factory::make_cortex_a8_stub): New method definition.
5130 (Stub_factory::Stub_factory): Add missing static storage class
5131 qualifier for elf32_arm_stub_a8_veneer_blx.
5132
ffeef7df
ILT
51332010-01-07 Ian Lance Taylor <iant@google.com>
5134
dc3f80fe
ILT
5135 PR 10980
5136 * options.h (class General_options): Add --warn-unresolved-symbols
5137 and --error-unresolved-symbols.
5138 * errors.cc (Errors::undefined_symbol): Implement
5139 --warn-unresolved-symbols.
5140
ffeef7df
ILT
5141 * options.h (class General_options): Add -z text and -z textoff.
5142 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5143
f1ec9ded
ST
51442010-01-06 Sriraman Tallam <tmsriram@google.com>
5145
5146 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5147 (Garbage_collection::cident_sections): New function.
5148 (Garbage_collection::add_cident_section): New function.
5149 (Garbage_collection::cident_sections_): New member.
5150 (gc_process_relocs): Add references to sections whose names are C
5151 identifiers.
5152 * gold.h (cident_section_start_prefix): New constant.
5153 (cident_section_stop_prefix): New constant.
5154 (is_cident): New function.
5155 * layout.cc (Layout::define_section_symbols): Replace string constants
5156 with the newly defined constants.
5157 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5158 C identifiers.
5159 * testsuite/Makefile.am: Add gc_orphan_section_test.
5160 * testsuite/Makefile.in: Regenerate.
5161 * testsuite/gc_orphan_section_test.cc: New file.
5162 * testsuite/gc_orphan_section_test.sh: New file.
5163
6eda8c29
ILT
51642010-01-06 Ian Lance Taylor <iant@google.com>
5165
b9674e17
ILT
5166 PR 10980
5167 * options.h (class General_options): Add --warn-shared-textrel.
5168 * layout.cc (Layout::finish_dynamic_section): Implement
5169 --warn-shared-textrel.
5170
6eda8c29
ILT
5171 PR 10980
5172 * options.h (class General_options): Add --warn-multiple-gp.
5173
32dcd44e
ILT
51742010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5175
5176 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5177 $(THREADSLIB) and $(LIBDL).
5178 * Makefile.in: Rebuild.
5179
a192ba05
ILT
51802010-01-06 Ian Lance Taylor <iant@google.com>
5181
5182 PR 10980
5183 * options.cc (General_options::parse_section_start): New function.
5184 (General_options::section_start): New function.
5185 (General_options::General_options): Initialize all members.
5186 * options.h: Include <map>
5187 (class General_options): Add --section-start. Add section_starts_
5188 member.
5189 * layout.cc (Layout::attach_allocated_section_to_segment): If
5190 --section-start was used, set the address of the segment. Remove
5191 local sort_sections.
5192 (Layout::relaxation_loop_body): If the address of the load segment
5193 has been set by --section-start, don't use it.
5194 * output.h (Output_segment::update_flags_for_output_section): New
5195 function.
5196 * output.cc (Output_segment::add_output_section): Call
5197 update_flags_for_output_section.
5198
dde3f402
ILT
51992010-01-05 Ian Lance Taylor <iant@google.com>
5200
62dfdd4d
ILT
5201 PR 10980
5202 * options.h (class General_options): Add --undefined-version.
5203 * script.cc (struct Version_expression): Add was_matched_by_symbol
5204 field.
5205 (Version_script_info::matched_symbol): New function.
5206 (Version_script_info::get_symbol_version_helper): Call
5207 matched_symbol.
5208 (Version_script_info::check_unmatched_names): New function.
5209 * script.h (class Version_script_info): Update declarations.
5210 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5211
9c4ae156
ILT
5212 * options.h (class General_options): Use DEFINE_bool_alias for
5213 allow_multiple_definition.
5214 * resolve.cc (Symbol_table::should_override): Don't test
5215 allow_multiple_definition.
5216
dde3f402
ILT
5217 PR 10980
5218 * options.h (class General_options): Add --cref.
5219 * main.cc (main): Print cref table if --cref. Don't close mapfile
5220 until after printing cref table.
5221 * cref.cc: Include "symtab.h".
5222 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5223 (Cref_table_compare::operator()): New function.
5224 (Cref_inputs::gather_cref): New function.
5225 (filecol): New static const.
5226 (Cref_inputs::print_cref): New function.
5227 (Cref::print_cref): New function.
5228 * cref.h: Include <cstdio>.
5229 (class Cref): Update declarations.
5230 * mapfile.h (Mapfile::file): New function.
5231 * object.h (class Object): Define Symbols. Declare virtual
5232 do_get_global_symbols.
5233 (Object::get_global_symbols): New function.
5234 * object.cc (Input_objects::add_object): Pass object to cref_ if
5235 --cref.
5236 (Input_objects::archive_start): Likewise.
5237 (Input_objects::archive_stop): Likewise.
5238 (Input_objects::print_cref): New function.
5239 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5240 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5241 --cref.
5242 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5243 function.
5244 * plugin.h (class Sized_pluginobj): Update declarations.
5245
8781f709
ILT
52462010-01-05 Ian Lance Taylor <iant@google.com>
5247
5248 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5249 to is_default_version. Rename insdef to insdefault.
5250 (Symbol_table::add_from_relobj): Rename def to is_default_version
5251 and local to is_forced_local.
5252 (Symbol_table::add_from_pluginobj): Likewise.
5253 (Symbol_table::add_from_dynobj): Likewise.
5254 (Symbol_table::define_special_symbol): Rename insdef to
5255 insdefault.
5256
fe35d28d
ILT
52572010-01-04 Ian Lance Taylor <iant@google.com>
5258
30bc8c46
ILT
5259 PR 10980
5260 * options.h (class General_options): Add
5261 --allow-multiple-definition and -z muldefs.
5262 * resolve.cc (Symbol_table::should_override): Don't warn about a
5263 multiple symbol definition if --allow-multiple-definition or -z
5264 muldefs.
5265
7eaea549
ILT
5266 PR 10980
5267 * options.h (class General_options): Add --add-needed and
5268 --copy-dt-needed-entries. Tweak --as-needed help entry.
5269 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5270 error if --copy-dt-needed-entries aka --add-needed is used and
5271 would cause a change in behaviour.
5272
fe35d28d
ILT
5273 PR 10980
5274 * options.h (class General_options): Add -G as a short version of
5275 --shared. Add no-op options -assert, -g, and -i.
5276
55a2bb35
ST
52772010-01-04 Sriraman Tallam <tmsriram@google.com>
5278
5279 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5280 check for .text or .gnu.linkonce.t sections.
5281 * icf.cc (Icf::find_identical_sections): Ditto.
5282 Change the detection for mangled function name within the section
5283 name.
5284 * icf.h (is_section_foldable_candidate): New function.
5285
719328e1
ILT
52862009-12-30 Ian Lance Taylor <iant@google.com>
5287
5288 PR 10980
5289 * options.h (class General_options): Permit two dashes with
5290 --retain-symbols-file.
5291
d7bb5745
ILT
52922009-12-30 Ian Lance Taylor <iant@google.com>
5293
403a15dd
ILT
5294 PR 10979
5295 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5296 don't put the file header and segment headers in the text
5297 segment.
5298
eda294df
ILT
5299 PR 10979
5300 * common.cc (Sort_commons::operator()): Stabilize sort when both
5301 entries are NULL.
5302 (Symbol_table::do_allocate_commons_list): When allocating common
5303 symbols, skip a symbol which is no longer common.
5304 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5305 an object before checking its type.
5306 * testsuite/common_test_2.c: New file.
5307 * testsuite/common_test_3.c: New file.
5308 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5309 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5310 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5311 (common_test_2_pic.o, common_test_2.so): New targets.
5312 (common_test_3_pic.o, common_test_3.so): New targets.
5313 * testsuite/Makefile.in: Rebuild.
5314
d7bb5745
ILT
5315 PR 10979
5316 * script.cc (read_input_script): If we see a new SECTIONS clause,
5317 and we have added an input section, give an error.
5318 * layout.h (class Layout): Add have_added_input_section function.
5319 Add have_added_input_section_ field.
5320 * layout.cc (Layout::Layout): Initialize
5321 have_added_input_section_.
5322 (Layout::layout): Set have_added_input_section_.
5323 (Layout::layout_eh_frame): Likewise.
5324
fc59c572
ILT
53252009-12-30 Ian Lance Taylor <iant@google.com>
5326
5327 PR 10931
5328 * options.h (class General_options): Add --sort-common option.
5329 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5330 * common.cc (Sort_common): Add sort_order parameter to
5331 constructor. Add sort_order_ field.
5332 (Sort_commons::operator): Check sort_order_.
5333 (Symbol_table::allocate_commons): Determine the sort order.
5334 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5335 Change all callers.
5336 (Symbol_table::do_allocate_commons_list): Likewise.
5337
1c74fab0
ILT
53382009-12-30 Ian Lance Taylor <iant@google.com>
5339
5340 PR 10916
5341 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5342 symbols from this object, don't change the visibility of an
5343 undefined symbol.
5344 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5345
6affe781
ILT
53462009-12-30 Ian Lance Taylor <iant@google.com>
5347
5348 PR 10861
5349 * script.h (class Version_script_info): Define Language enum.
5350 Update declarations. Define Glob, Exact, and Lookup types. Add
5351 new fields globals_, locals_, and is_finalized_.
5352 * script.cc: Various formatting fixes.
5353 (class Parser_closure): Change language_stack_ from a vector of
5354 std::string to one of Version_script_info::Language. Adjust all
5355 uses accordingly.
5356 (class Lazy_demangler): Remove.
5357 (struct Version_expression): Change language from std::string to
5358 Version_script_info::Language.
5359 (Version_script_info::Version_script_info): New function.
5360 (Version_script_info::~Version_script_info): Don't call clear.
5361 (Version_script_info::finalize): New function.
5362 (Version_script_info::build_lookup_tables): New function.
5363 (Version_script_info::build_expression_list_lookup): New
5364 function.
5365 (Version_script_info::get_symbol_version_helper): Rewrite to use
5366 lookup tables.
5367 (Version_script_info::print_expression_list): Adjust to use
5368 Version_script_info::Language.
5369 (script_push_lex_into_version_mode): Check that the version script
5370 has not been finalized.
5371 (version_script_push_lang): Change language string to
5372 Version_script_info::Language.
5373 * options.cc (Command_line::version_script): New function.
5374 * options.h (class General_options): Add finalize_dynamic_list
5375 function. Change version_script from declaration to definition.
5376 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5377 * testsuite/version_script.map: Remove duplicate def of foo.
5378 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5379 version_script.map.
5380 * testsuite/Makefile.in: Rebuild.
5381
818bf354
ILT
53822009-12-30 Ian Lance Taylor <iant@google.com>
5383
5384 PR 10843
5385 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5386 if the input symbol index is 0, make the output symbol index 0.
5387
ebcc8304
ILT
53882009-12-30 Ian Lance Taylor <iant@google.com>
5389
5390 PR 10670
5391 * options.h (class General_options): Add -x/--discard-all.
5392 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5393 --discard-all. If the local symbol needs a dynamic entry, check
5394 that before handling --discard-locals.
5395
176fe33f
ILT
53962009-12-30 Ian Lance Taylor <iant@google.com>
5397
bb321bb1
ILT
5398 PR 10450
5399 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5400 flags to PF_R.
5401 (Output_segment::add_output_section): Don't change the flags if
5402 the type is PT_TLS.
5403
176fe33f
ILT
5404 PR 10450
5405 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5406 GNU hash table if they need a dynamic value. Otherwise, don't add
5407 them if they are defined in a dynamic object or are forced local.
5408
e8cd95c7
ILT
54092009-12-29 Ian Lance Taylor <iant@google.com>
5410
1b81fb71
ILT
5411 PR 10450
5412 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5413 .gnu.hash table for a 32-bit target.
5414
8d6d383d
ILT
5415 PR 10450
5416 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5417 regular and a dynamic object only needs a dynamic symbol table
5418 entry if it is externally visible.
5419
e785ec03
ILT
5420 PR 10450
5421 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5422 constructor. Add global_offset_table_ field.
5423 (Target_i386::got_section): Set global_offset_table_.
5424 (Target_i386::do_finalize_sections): Set global_offset_table_
5425 size.
5426 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5427 in constructor. Add global_offset_table_ field.
5428 (Target_x86_64::got_section): Set global_offset_table_.
5429 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5430 size.
5431
1a2dff53
ILT
5432 * layout.cc (Layout::Layout): Initialize increase_relro_.
5433 (Layout::get_output_section): Add is_relro, is_last_relro, and
5434 is_first_non_relro parameters. Change all callers.
5435 (Layout::choose_output_section): Likewise.
5436 (Layout::add_output_section_data): Likewise.
5437 (Layout::make_output_section): Likewise.
5438 (Layout::set_segment_offsets): Clear increase_relro when using a
5439 linker script.
5440 * layout.h (class Layout): Add increase_relro method. Add
5441 increase_relro_ field. Update declarations.
5442 * output.cc (Output_section::Output_section): Initialize
5443 is_last_relro_ and is_first_non_relro_.
5444 (Output_segment::add_output_section): Group relro sections is
5445 do_sort is true. Handle is_last_relro and is_first_non_relro.
5446 (Output_segment::maximum_alignment): Remove relro handling.
5447 (Output_segment::set_section_addresses): Add increase_relro
5448 parameter. Change all callers. Add initial alignment to align
5449 relro sections on separate page. Remove old relro handling.
5450 (Output_segment::set_section_list_addresses): Remove in_relro
5451 parameter. Change all callers.
5452 (Output_segment::set_offset): Add increase parameter. Change all
5453 callers. Remove old relro handling.
5454 * output.h (class Output_section): Add new methods: is_last_relro,
5455 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5456 Add is_last_relro_ and is_first_non_relro_ fields.
5457 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5458 Create separate .got.plt section. Call increase_relro.
5459 * x86_64.cc (Target_x86_64::got_section): Likewise.
5460 * testsuite/relro_script_test.t: Add .got.plt.
5461
f0ba79e2
ILT
5462 PR 10450
5463 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5464 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5465 (Layout::finalize): Call set_dynamic_symbol_size.
5466 (Layout::set_dynamic_symbol_size): New function.
5467 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5468 set_dynamic_symbol_size.
5469
e8cd95c7
ILT
5470 PR 10450
5471 * output.h (class Output_section): Add is_entsize_zero_ field.
5472 * output.cc (Output_section::Output_section): Initialize
5473 is_entsize_zero_.
5474 (Output_section::set_entsize): If two different entsizes are
5475 requested, force it to zero.
5476 (Output_section::add_input_section): Set flags for .debug_str
5477 before updating section flags. Set entsize.
5478 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5479 and SHF_STRING if all input sections have those flags.
5480
3e1b9a8a
RÁE
54812009-12-29 Rafael Espindola <espindola@google.com>
5482
5483 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5484 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5485 reporting.
3e1b9a8a 5486
3dcad376
ST
54872009-12-29 Sriraman Tallam <tmsriram@google.com>
5488
5489 * options.cc (General_options::parse_version): Allow -v to exit
5490 without an error if there is nothing to link.
5491
084e2665
ILT
54922009-12-29 Ian Lance Taylor <iant@google.com>
5493
5494 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5495 using a version of gcc before 4.1.
5496 * configure: Rebuild.
5497
250acde3
CD
54982009-12-28 Chris Demetriou <cgd@google.com>
5499
5500 * attributes.cc (Output_attributes_section_data::do_write): Use
5501 std::vector::front rather than std::vector::data.
5502
99fff23b
ILT
55032009-12-28 Ian Lance Taylor <iant@google.com>
5504
5505 * symtab.h (class Symbol_table): Add enum Defined.
5506 * resolve.cc (Symbol_table::should_override): Add defined
5507 parameter. Change all callers. Test whether object is NULL
5508 before calling a method on it.
5509 (Symbol_table::report_resolve_problem): Add defined parameter.
5510 Change all callers.
5511 (Symbol_table::should_override_with_special): Likewise.
5512 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5513 parameter. Change all callers.
5514 (Symbol_table::do_define_in_output_data): Likewise.
5515 (Symbol_table::define_in_output_segment): Likewise.
5516 (Symbol_table::do_define_in_output_segment): Likewise.
5517 (Symbol_table::define_as_constant): Likewise.
5518 (Symbol_table::do_define_as_constant): Likewise.
5519 * script.h (class Symbol_assignment): Add is_defsym parameter to
5520 constructor; change all callers.
5521 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5522 parameter. Change all callers. Add is_defsym_ field.
5523 (class Parser_closure): Add parsing_defsym parameter to
5524 constructor; change all callers. Add parsing_defsym accessor
5525 function. Add parsing_defsym_ field.
5526
556bd683
ILT
55272009-12-28 Ian Lance Taylor <iant@google.com>
5528
5529 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5530 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5531
1782c879
ILT
55322009-12-23 Ian Lance Taylor <iant@google.com>
5533
5534 * i386.cc (Target_i386::do_calls_non_split): Recognize
5535 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5536 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5537 -fsplit-stack prologue when using %r11.
1782c879 5538
329ca2b1
ST
55392009-12-21 Sriraman Tallam <tmsriram@google.com>
5540
5541 * options.cc (General_options::parse_version): Make -v continue and do
5542 the link like GNU ld does.
5543
d675ff46
RÁE
55442009-12-17 Rafael Avila de Espindola <espindola@google.com>
5545
5546 * Makefile.am (CCFILES): Add timer.cc.
5547 (HFILES): Add timer.h.
5548 * configure.ac: Check for sysconf and times.
5549 * main.cc: include timer.h.
5550 (main): Use Timer instead of get_run_time.
5551 * timer.cc: New.
5552 * timer.h: New.
5553 * workqueue.cc: include timer.h.
5554 (Workqueue::find_and_run_task):
5555 Report user, sys and wall time.
5556 * Makefile.in: Regenerate.
5557 * config.in: Regenerate.
5558 * configure: Regenerate.
5559
d6344fb5
DK
55602009-12-16 Doug Kwan <dougkwan@google.com>
5561
5562 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5563 sections.
5564 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5565 relaxed input sections.
5566 * output.cc (Output_section::find_relaxed_input_section): Change
5567 return type to Output_relaxed_input_section pointer. Adjust code
5568 for new type of relaxed_input_section_map_.
5569 * output.h (Output_section::find_relaxed_input_section): Change
5570 return type to Output_relaxed_input_section pointer.
5571 (Output_section::Output_relaxed_input_section_by_input_section_map):
5572 New type.
5573 (Output_section::relaxed_input_section_map_): Change type to
5574 Output_section::Output_relaxed_input_section_by_input_section_map.
5575 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5576 input section.
5577
0e0d5469
ILT
55782009-12-15 Ian Lance Taylor <iant@google.com>
5579
5580 * layout.cc (Layout::create_shstrtab): Only write out after input
5581 sections if we are compressing debug sections.
5582
0649a889
ILT
55832009-12-15 Ian Lance Taylor <iant@google.com>
5584
5585 * archive.cc (Archive::add_symbols): Only look up a symbol without
5586 a version if there is, in fact, a version.
5587
2ea97941
ILT
55882009-12-14 Ian Lance Taylor <iant@google.com>
5589
5590 Revert -Wshadow changes, all changes from:
5591 2009-12-11 Doug Kwan <dougkwan@google.com>
5592 2009-12-11 Nick Clifton <nickc@redhat.com>
5593 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5594
b0eec2cc
DK
55952009-12-11 Doug Kwan <dougkwan@google.com>
5596
5597 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5598 due to -Wshadow.
5599 * attributes.cc (Object_attribute::size): Ditto.
5600 (Attributes_section_data::size): Ditto.
5601 (Attributes_section_data::Attributes_section_data): Ditto.
5602 (Output_attributes_section_data::do_write): Ditto.
5603 * attributes.h (Object_attribute::set_type): Ditto.
5604 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5605
91d6fa6a
NC
56062009-12-11 Nick Clifton <nickc@redhat.com>
5607
5608 * archive.cc: Fix shadowed variable warnings.
5609 * arm.cc: Likewise.
5610 * compressed_output.cc: Likewise.
5611 * compressed_output.h: Likewise.
5612 * configure: Likewise.
5613 * dwarf_reader.cc: Likewise.
5614 * dynobj.cc: Likewise.
5615 * dynobj.h: Likewise.
5616 * ehframe.cc: Likewise.
5617 * ehframe.h: Likewise.
5618 * errors.cc: Likewise.
5619 * expression.cc: Likewise.
5620 * fileread.cc: Likewise.
5621 * fileread.h: Likewise.
5622 * freebsd.h: Likewise.
5623 * i386.cc: Likewise.
5624 * icf.cc: Likewise.
5625 * incremental.h: Likewise.
5626 * layout.cc: Likewise.
5627 * layout.h: Likewise.
5628 * mapfile.cc: Likewise.
5629 * merge.cc: Likewise.
5630 * merge.h: Likewise.
5631 * object.cc: Likewise.
5632 * object.h: Likewise.
5633 * options.h: Likewise.
5634 * output.cc: Likewise.
5635 * output.h: Likewise.
5636 * parameters.cc: Likewise.
5637 * plugin.cc: Likewise.
5638 * powerpc.cc: Likewise.
5639 * reduced_debug_output.cc: Likewise.
5640 * reduced_debug_output.h: Likewise.
5641 * reloc.cc: Likewise.
5642 * reloc.h: Likewise.
5643 * resolve.cc: Likewise.
5644 * script-sections.cc: Likewise.
5645 * script.cc: Likewise.
5646 * script.h: Likewise.
5647 * sparc.cc: Likewise.
5648 * symtab.cc: Likewise.
5649 * symtab.h: Likewise.
5650 * target-select.cc: Likewise.
5651 * target-select.h: Likewise.
5652 * token.h: Likewise.
5653 * workqueue.cc: Likewise.
5654 * workqueue.h: Likewise.
5655 * x86_64.cc: Likewise.
5656
a0351a69
DK
56572009-12-10 Doug Kwan <dougkwan@google.com>
5658
5659 * arm.cc (attributes.h): New include.
5660 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5661 (Arm_relobj::~Arm_relobj): Delete object pointed by
5662 attributes_section_data_.
5663 (Arm_relobj::attributes_section_data): New method definition.
5664 (Arm_relobj::attributes_section_data_): New data member declaration.
5665 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5666 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5667 attributes_section_data_.
5668 (Arm_dynobj::attributes_section_data): New method definition.
5669 (Arm_dynobj::attributes_section_data_): New data member declaration.
5670 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5671 initialization value of may_use_blx_ to false.
5672 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5673 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5674 object attributes to compute results instead of hard-coding.
5675 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5676 Target_arm::get_secondary_compatible_arch,
5677 Target_arm::set_secondary_compatible_arch
5678 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5679 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5680 New method declarations.
5681 (Target_arm::get_aeabi_object_attribute): New method definition.
5682 (Target_arm::attributes_section_data_): New data member declaration.
5683 (read_arm_attributes_section): New template definition.
5684 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5685 (Arm_dynobj::do_read_symbols): Ditto.
5686 (Target_arm::do_finalize_sections): Merge attributes sections from
5687 input. Check for BLX use after attributes section merging.
5688 Fix __exidx_start and __exidx_end visibility. Create an
5689 .ARM.attributes section if necessary.
5690 (Target_arm::get_secondary_compatible_arch,
5691 Target_arm::set_secondary_compatible_arch,
5692 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5693 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5694 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5695 New method definitions.
5696
b59befec
ILT
56972009-12-09 Ian Lance Taylor <iant@google.com>
5698
5699 * plugin.cc (Plugin::load): Don't cast from void* to a function
5700 pointer.
5701
1276bc89
ILT
57022009-12-09 Ian Lance Taylor <iant@google.com>
5703
5704 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5705 information fields.
5706
2f2de248
L
57072009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5708
5709 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5710 Replace two_file_shared_1.so with two_file_shared_2.so.
5711 * testsuite/Makefile.in: Regenerated.
5712
4f787271
DK
57132009-12-08 Doug Kwan <dougkwan@google.com>
5714
5715 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5716 (HFILES): Add attributes.h and int_encoding.h.
5717 * Makefile.in: Regenerate.
5718 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5719 function definitions to int_encoding.cc
5720 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5721 prototypes to int_encoding.h
5722 * reduced_debug_output.cc (int_encoding.h): New include.
5723 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5724 function definitions to int_encoding.cc
5725 (insert_into_vector, read_from_pointer): Move template definitions to
5726 int_encoding.h
5727 * attributes.cc: New file.
5728 * attributes.h: New file.
5729 * int_encoding.cc: New file.
5730 * int_encoding.h: New file.
5731
20b52f1a
RÁE
57322009-12-07 Rafael Avila de Espindola <espindola@google.com>
5733
5734 PR gold/11055
5735 * incremental-dump.cc (dump_incremental_inputs): New.
5736 (main): Use dump_incremental_inputs.
5737
53d7974c
L
57382009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5739
5740 PR gold/10893
5741 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5742 checking elfcpp::STT_FUNC.
5743 (Target_i386::Relocate::relocate): Likewise.
5744 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5745
5746 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5747 symbols from shared libraries into normal FUNC symbols.
5748
5749 * symtab.h (Symbol): Add is_func and use it.
5750
05a352e6
DK
57512009-12-05 Doug Kwan <dougkwan@google.com>
5752
5753 * arm.cc (Target_arm::arm_info): Initialize new fields
5754 attributes_section and attributes_vendor.
5755 * i386.cc (Target_i386::i386_info): Same.
5756 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5757 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5758 fields attributes_section and attributes_vendor.
53d7974c 5759 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5760 * target.h (Target::attributes_section, Target::attributes_vendor,
5761 Target::is_attributes_section, Target::attribute_arg_type,
5762 Target::attributes_order): New method definitions.
5763 (Target::Target_info::attributes_section,
5764 Target::Target_info::attributes_vendor): New fields.
5765 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5766 virtual method definitions.
5767 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5768 attributes_section and attributes_vendor.
5769 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5770
f4e5969c
DK
57712009-12-05 Doug Kwan <dougkwan@google.com>
5772
5773 * arm.cc: Update comments about interworking and stub generation.
5774 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5775 considered as non-PIC.
5776 (Arm_relocate_functions::base_abs): Fix formatting.
5777 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5778 of function to use GOT entry address instead of offset.
5779 (Target_arm::Scan::global): Issue an error if a symbol would need a
5780 PLT does not get one because it is untyped. Remove code to create
5781 dynamic symbols for relative branches.
5782 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5783 takes unsigned integer instead of boolean.
5784
1abce4a6
L
57852009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5786
5787 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5788 (two_file_test_LDADD): Likewise.
5789 (common_test_1_LDADD): Likewise.
5790 (exception_test_LDADD) Likewise.
5791 (weak_test_LDADD): Likewise.
5792 (many_sections_test_LDADD): Likewise.
5793 (initpri1_LDADD): Likewise.
5794 (script_test_1_LDADD): Likewise.
5795 (script_test_2_LDADD): Likewise.
5796 (justsyms_LDADD): Likewise.
5797 (binary_test_LDADD): Likewise.
5798 (large_LDADD): Likewise.
5799 * testsuite/Makefile.in: Regenerated.
5800
adcf2816 58012009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5802
adcf2816
L
5803 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5804 (Symbol_table::override_with_special): Likewise.
5805 (Symbol_table::add_from_object): Likewise.
5806
28e67f5d
RÁE
58072009-12-04 Rafael Avila de Espindola <espindola@google.com>
5808
5809 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5810 Don't set the data_offset twice.
5811
ae10a101
RÁE
58122009-12-04 Rafael Avila de Espindola <espindola@google.com>
5813
5814 * testsuite/Makefile.in: Regenerate.
5815
f59f41f3
DK
58162009-12-03 Doug Kwan <dougkwan@google.com>
5817
5818 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5819 (Target_arm::do_finalize_sections): Add parameter for symbol table
5820 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5821 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5822 parameter for symbol table pointer.
5823 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5824 an additional parameter for a pointer to symbol table.
5825 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5826 parameter for a symbol table pointer.
5827 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5828 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5829 Ditto.
5830 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5831 parameter for a symbol table pointer.
5832
ca55d848
RÁE
58332009-12-03 Rafael Avila de Espindola <espindola@google.com>
5834
5835 * incremental.cc (Incremental_inputs_header)
5836 (Incremental_inputs_header_write, Incremental_inputs_entry)
5837 (Incremental_inputs_entry_write): Move ...
5838 * incremental.h (Incremental_inputs_header)
5839 (Incremental_inputs_header_write, Incremental_inputs_entry)
5840 (Incremental_inputs_entry_write): here.
5841
3aec4f9c
RÁE
58422009-12-02 Rafael Avila de Espindola <espindola@google.com>
5843
5844 * incremental.cc (make_sized_incremental_binary): Set the target.
5845 Error if it is incompatible.
5846 * output.h (Output_file): Add filename method.
5847
9c0ae74d
RÁE
58482009-12-02 Rafael Avila de Espindola <espindola@google.com>
5849
5850 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5851 from the get_* methods.
5852
a45500ae
RÁE
58532009-12-02 Rafael Avila de Espindola <espindola@google.com>
5854
5855 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5856 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5857 Write 0 for the data_offset of scripts.
5858
325e6408
RÁE
58592009-12-02 Rafael Avila de Espindola <espindola@google.com>
5860
5861 * testsuite/Makefile.am: Add the incremental_test.sh test.
5862 * testsuite/incremental_test.sh: New.
5863 * testsuite/incremental_test_1.c: New.
5864 * testsuite/incremental_test_2.c: New.
5865
954c3e2e
RÁE
58662009-12-01 Rafael Avila de Espindola <espindola@google.com>
5867
5868 * incremental-dump.cc (main): Fix typos.
5869
f8086623
RÁE
58702009-11-27 Rafael Avila de Espindola <espindola@google.com>
5871
5872 PR gold/11025
5873 * incremental-dump.cc (main): Use llu to print 64 bit values.
5874
3b0dd6ac
L
58752009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5876 H.J. Lu <hongjiu.lu@intel.com>
5877
5878 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5879 $(LIBDL).
5880 (incremental_dump_LDADD): Likewise.
5881 * Makefile.in: Regenerated.
5882
a6d1ef57 58832009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5884
a6d1ef57
DK
5885 Revert:
5886
5887 2009-11-25 Doug Kwan <dougkwan@google.com>
5888
5889 * arm.cc (Target_arm::Target_arm): Move method definition
5890 outside of class definition. Add code to handle
5891 --target1-rel, --target1-abs and --target2= options.
5892 (Target_arm::get_reloc_reloc_type): Change method to be
5893 non-static and const.
5894 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5895 New data member declaration.
5896 (Target_arm::Scan::local, Target_arm::Scan::global,
5897 Target_arm::Relocate::relocate,
5898 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5899 Adjust call to Target_arm::get_real_reloc_type.
5900 (Target_arm::get_real_reloc_type): Use command line options
5901 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5902 * options.h (--target1-rel, --target1-abs, --target2): New
5903 ARM-only options.
5904
50aeb7d4
DK
59052009-11-25 Doug Kwan <dougkwan@google.com>
5906
5907 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5908 class definition. Add code to handle --target1-rel, --target1-abs
5909 and --target2= options.
5910 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5911 and const.
5912 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5913 member declaration.
5914 (Target_arm::Scan::local, Target_arm::Scan::global,
5915 Target_arm::Relocate::relocate,
5916 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5917 call to Target_arm::get_real_reloc_type.
5918 (Target_arm::get_real_reloc_type): Use command line options to
5919 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5920 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5921 options.
5922
51938283
DK
59232009-11-25 Doug Kwan <dougkwan@google.com>
5924
5925 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5926 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5927 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5928 formatting.
5929 (Arm_relocate_functions::thm_call): Replace body with a call to
5930 Arm_relocate_functions::thumb_branch_common.
5931 (Arm_relocate_functions::thm_jump24,
5932 Arm_relocate_functions::thm_xpc22): New method definitions.
5933 (Arm_relocate_functions::thumb_branch_common): New method definition.
5934 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5935 operator.
5936 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5937 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5938
e2b8f3c4
RÁE
59392009-11-24 Rafael Avila de Espindola <espindola@google.com>
5940
5941 * Makefile.am: Build incremental-dump
5942 * Makefile.in: Regenerate.
5943 * incremental-dump.cc: New.
5944 * incremental.cc (Incremental_inputs_header_data,
5945 Incremental_inputs_entry_data): Move to incremental.h
5946 * incremental.h: (Incremental_inputs_header_data,
5947 Incremental_inputs_entry_data): Move from incremental.cc
5948
bcba9aec
RÁE
59492009-11-24 Rafael Avila de Espindola <espindola@google.com>
5950
5951 * incremental.cc (Incremental_inputs_header,
5952 Incremental_inputs_header_write, Incremental_inputs_entry,
5953 Incremental_inputs_entry_write): Add a typedef with the data type.
5954
7c3afe08
RÁE
59552009-11-24 Rafael Avila de Espindola <espindola@google.com>
5956
5957 * incremental.cc (Incremental_inputs_header,
5958 Incremental_inputs_header_write, Incremental_inputs_entry,
5959 Incremental_inputs_entry_write): Update comment about which
5960 type has the filed descriptions.
5961
d204b6e9
DK
59622009-11-15 Doug Kwan <dougkwan@google.com>
5963
5964 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5965 (Arm_relocate_functions::arm_branch_common): Change method defintion
5966 in class definition to a method declaration and update list of formal
5967 parameters.
5968 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5969 Arm_relocation_functions::jump24): Adjust call to
5970 Arm_relocate_functions::arm_branch_common. Update list of formal
5971 parameters.
5972 (Arm_relocate_functions::xpc25): New method definition.
5973 (Arm_relocate_functions::arm_branch_common): Move method defintion
5974 out from class definition. Use stubs for mode-switching and extending
5975 branch ranges.
5976 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5977 specially. Change code to enable use of stubs in ARM branches.
5978
43d12afe
DK
59792009-11-10 Doug Kwan <dougkwan@google.com>
5980
5981 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5982 in method declaration.
5983 (Target_arm::relocate_stub): New method declaration.
5984 (Target_arm::default_target): Change to return a pointer instead of
5985 a const reference.
5986 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5987 Target_arm::default_target.
5988 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5989 method definition.
5990 (Target_arm::relocate_section): Adjust view.
5991 (Target_arm::relocate_stub): New method definition.
5992
ac33a407
DK
59932009-11-10 Doug Kwan <dougkwan@google.com>
5994
5995 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5996 a format warning.
5997 * incremental.cc (open_incremental_binary): Initialized local
5998 variables to avoid warnings.
5999 * object.cc (make_elf_object): Ditto.
6000 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6001 a format warning.
e1df38aa 6002
88ee28e9
L
6003009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6004
6005 PR gold/10930
6006 * testsuite/plugin_test.c: Include "config.h".
6007
2daedcd6
DK
60082009-11-09 Doug Kwan <dougkwan@google.com>
6009
6010 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6011 (arm_symbol_value): Remove.
6012 (Arm_relocate_functions::arm_branch_common,
6013 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6014 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6015 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6016 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6017 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6018 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6019 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6020 Arm_relocate_functions::thm_mobw_abs_nc,
6021 Arm_relocate_functions::thm_mov_abs,
6022 Arm_relocate_functions::movw_prel_nc,
6023 Arm_relocate_functions::thm_movt_abs,
6024 Arm_relocate_functions::movt_prel,
6025 Arm_relocate_functions::thm_movw_prel_nc,
6026 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6027 (Target_arm::Relocate::relocate): Only decompose address into two
6028 parts if relocation type uses the thumb-bit and pass the actual
6029 bit instead of a flag indicating that the thumb-bit is used. Adjust
6030 calls to methods in Arm_relocate_functions for this change.
6031
1276bc89 60322009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6033
6034 PR 10925
6035 * reloc.cc: Instantiate
6036 Sized_relobj::initialize_input_to_output_maps and
6037 Sized_relobj:free_input_to_output_maps.
6038
e53ad1b5
ILT
60392009-11-06 Ian Lance Taylor <iant@google.com>
6040
6041 PR 10876
6042 * defstd.cc (in_segment): Set only_if_ref true for "end".
6043
eb44217c
DK
60442009-11-06 Doug Kwan <dougkwan@google.com>
6045
6046 * arm.cc (class Reloc_stub): Correct a comment.
6047 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6048 (Target_arm::scan_section_for_stubs): New method declaration.
6049 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6050 Change methods from private to protected.
6051 (Target_arm::do_may_relax): New method definition.
6052 (Target_arm::do_relax, Target_arm::group_sections,
6053 Target_arm::scan_reloc_for_stub,
6054 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6055 (Target_arm::arm_input_section_map_): New data member declaration.
6056 (Target_arm::scan_reloc_for_stub,
6057 Target_arm::scan_reloc_section_for_stubs,
6058 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6059 Target_arm::do_relax): New method definitions.
6060
5d329b7d
ILT
60612009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6062
6063 * configure.ac: Check for (struct stat)::st_mtim
6064 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6065 * config.in: Regenerate.
6066 * configure: Regenerate.
6067
96a0d71b
ILT
60682009-11-05 Ian Lance Taylor <iant@google.com>
6069
6070 PR 10910
6071 * output.cc (Output_segment::add_output_section): Add missing
6072 return statement.
6073
594c8e5e
ILT
60742009-11-04 Ian Lance Taylor <iant@google.com>
6075
6076 PR 10880
6077 * object.h (class Object): Add is_needed and set_is_needed
6078 methods. Add is_needed_ field. Make bool fields into bitfields.
6079 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6080 defined in a dynamic object and referenced by a regular object,
6081 set is_needed for the dynamic object.
6082 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6083 if the file is marked with as_needed and it is not needed.
6084
22b127cc
ILT
60852009-11-04 Ian Lance Taylor <iant@google.com>
6086
6087 PR 10887
6088 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6089 tags if data is discarded by linker script.
6090 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6091 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6092 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6093 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6094
f5c870d2
ILT
60952009-11-04 Ian Lance Taylor <iant@google.com>
6096
6097 * layout.cc (Layout::get_output_section): Add is_interp and
6098 is_dynamic_linker_section parameters. Change all callers.
6099 (Layout::choose_output_section): Likewise.
6100 (Layout::make_output_section): Likewise.
6101 (Layout::add_output_section_data): Add is_dynamic_linker_section
6102 parameter. Change all callers.
6103 * layout.h (class Layout): Update declarations.
6104 * output.h (class Output_section): Add is_interp, set_is_interp,
6105 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6106 Add is_interp_, is_dynamic_linker_section_ fields. Change
6107 generate_code_fills_at_write_ to a bitfield.
6108 * output.cc (Output_section::Output_sections): Initialize new
6109 fields.
6110 (Output_segment::add_output_section): Add do_sort parameter.
6111 Change all callers.
6112
1ae4d23b
ILT
61132009-11-03 Ian Lance Taylor <iant@google.com>
6114
6115 PR 10860
6116 * options.h (class General_options): Add --warn-common.
6117 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6118 merging two common symbols.
6119 (Symbol_table::should_override): Handle --warn-common when merging
6120 a common symbol with a defined symbol. Use report_resolve_problem
6121 for multiple definitions.
6122 (Symbol_table::report_resolve_problem): New function.
6123 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6124
55da9579
DK
61252009-11-03 Doug Kwan <dougkwan@google.com>
6126
6127 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6128 stub_factory_.
6129 (Target_arm::stub_factory): New method definition.
6130 (Target_arm::new_arm_input_section,
6131 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6132 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6133 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6134 New type definitions.
6135 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6136 member declarations.
6137 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6138 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6139 New method definitions.
6140
37a9ac43
ILT
61412009-11-03 Ian Lance Taylor <iant@google.com>
6142
6143 * options.h (class General_options): Add --warn_constructors.
6144
b3d6a3d4
ILT
61452009-11-03 Ian Lance Taylor <iant@google.com>
6146
6147 PR 10893
6148 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6149 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6150
934b01dd
ILT
61512009-11-03 Ian Lance Taylor <iant@google.com>
6152
6153 PR 10895
6154 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6155 --msgid-bugs-address.
6156 (install-pdf): New target.
6157 (install-data_yes): Look up one directory to find mkinstalldirs.
6158
03c1939b
L
61592009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6160
6161 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6162 tree.
6163
ebd95253
DK
61642009-10-30 Doug Kwan <dougkwan@google.com>
6165
6166 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6167
e9bbb538
DK
61682009-10-30 Doug Kwan <dougkwan@google.com>
6169
6170 * arm.cc (Stub_addend_reader): New struct template definition
6171 and partial specializations.
6172 (Stub_addend_reader::operator()): New method definition for a
6173 partially specialized template.
6174
d5b40221
DK
61752009-10-30 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (Arm_relobj::processor_specific_flags): New method
6178 definition.
6179 (Arm_relobj::do_read_symbols): New method declaration.
6180 (Arm_relobj::processor_specific_flags_): New data member declaration.
6181 (Arm_dynobj): New class definition.
6182 (Target_arm::do_finalize_sections): Add input_objects parameter.
6183 (Target_arm::do_adjust_elf_header): New method declaration.
6184 (Target_arm::are_eabi_versions_compatible,
6185 (Target_arm::merge_processor_specific_flags): New method declaration.
6186 (Target_arm::do_make_elf_object): New overloaded method definitions
6187 and declaration.
6188 (Arm_relobj::do_read_symbols): New method definition.
6189 (Arm_dynobj::do_read_symbols): Ditto.
6190 (Target_arm::do_finalize_sections): Add input_objects parameters.
6191 Merge processor-specific flags from all input objects.
6192 (Target_arm::are_eabi_versions_compatible,
6193 Target_arm::merge_processor_specific_flags,
6194 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6195 New method definitions.
6196 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6197 Input_objects pointer type parameter.
6198 * layout.cc (Layout::finalize): Pass input objects to target's.
6199 finalize_sections function.
6200 * output.cc (Output_file_header::do_sized_write): Set ELF file
6201 header's processor-specific flags.
6202 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6203 Input_objects pointer type parameter.
6204 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6205 * target.h (Input_objects): New forward class declaration.
6206 (Target::processor_specific_flags,
6207 Target::are_processor_specific_flags_sect): New method definitions.
6208 (Target::finalize_sections): Add input_objects parameter.
6209 (Target::Target): Initialize processor_specific_flags_ and
6210 are_processor_specific_flags_set_.
6211 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6212 parameter.
6213 (Target::set_processor_specific_flags): New method definition.
6214 (Target::processor_specific_flags_,
6215 Target::are_processor_specific_flags_set_): New data member
6216 declarations.
6217 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6218 Input_objects pointer type parameter.
6219
ebabffbd
DK
62202009-10-30 Doug Kwan <dougkwan@google.com>
6221
6222 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6223
ad0f2072
ILT
62242009-10-28 Ian Lance Taylor <iant@google.com>
6225
6226 * object.h (class Relobj): Drop options parameter from
6227 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6228 do_scan_relocs, do_relocate. Change all callers.
6229 (class Sized_relobj): Drop options parameters from
6230 do_gc_process_relocs, do_scan_relocs, do_relocate,
6231 do_relocate_sections, relocate_sections, emit_relocs_scan,
6232 emit_relocs_scan_reltype. Change all callers.
6233 (struct Relocate_info): Remove options field and all references to
6234 it.
6235 * reloc.h (class Read_relocs): Remove options constructor
6236 parameter and options_ field. Change all callers.
6237 (class Gc_process_relocs, class Scan_relocs): Likewise.
6238 (class Relocate_task): Likewise.
6239 * target-reloc.h (scan_relocs): Remove options parameter. Change
6240 all callers.
6241 (scan_relocatable_relocs): Likewise.
6242 * target.h (class Sized_target): Remove options parameter from
6243 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6244 all callers.
6245 * gc.h (gc_process_relocs): Remove options parameter. Change all
6246 callers.
6247 * arm.cc: Update functions to remove options parameters.
6248 * i386.cc: Likewise.
6249 * powerpc.cc: Likewise.
6250 * sparc.cc: Likewise.
6251 * x86_64.cc: Likewise.
6252 * testsuite/testfile.cc: Likewise.
6253
8ffa3667
DK
62542009-10-28 Doug Kwan <dougkwan@google.com>
6255
6256 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6257 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6258 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6259 New method definitions.
6260
40f36857
CC
62612009-10-28 Cary Coutant <ccoutant@google.com>
6262
6263 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6264 (Plugin::cleanup_done_): New member.
6265 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6266 (Plugin_manager::cleanup_done_): Remove.
6267 (Plugin_manager::add_input_file): Edit error message.
6268 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6269 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6270
2c849493
ILT
62712009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6272
6273 * fileread.cc: (File_read::View::~View): Use the new
6274 data_ownership_ filed.
6275 (File_read::~File_read): Dispose the new whole_file_view_.
6276 (File_read::open): Mmap the whole file if needed.
6277 (File_read::open): Use whole_file_view_ instead of contents_.
6278 (File_read::find_view): Use whole_file_view_ if applicable.
6279 (File_read::do_read): Use whole_file_view_ instead of contents_.
6280 (File_read::make_view): Use whole_file_view_ instead of contents_,
6281 update File_read::View::View call.
6282 (File_read::find_or_make_view): Update File_read::View::View
6283 call.
6284 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6285 remove contents_
6286 (File_read::View::Data_ownership): New enum.
6287 (File_read::View::View): Replace bool mapped_ with Data_ownership
6288 argument.
6289 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6290 (File_read::View::data_ownership_): New field.
6291 (File_read::contents_): Remove (replaced by whole_file_view_).
6292 (File_read::whole_file_view_): New field.
6293 * options.h (class General_options): Add --keep-files-mapped.
6294
24998053
CC
62952009-10-27 Cary Coutant <ccoutant@google.com>
6296
6297 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6298 * testsuite/Makefile.am (plugin_test_5): New test case.
6299 * testsuite/Makefile.in: Regenerate.
6300
72adc4fa
DK
63012009-10-25 Doug Kwan <dougkwan@google.com>
6302
6303 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6304 from private to protected to allow access by child class.
6305 (Sized_relobj::do_relocate_sections): New method declaration.
6306 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6307 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6308 Sized_relobj::relocate_sections. Instantiate template explicitly
6309 for different target sizes and endianity.
6310
07f508a2
DK
63112009-10-24 Doug Kwan <dougkwan@google.com>
6312
6313 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6314 (Arm_input_section::as_arm_input_section): New method.
6315 (Arm_output_section): New class definition.
6316 (Arm_output_section::create_stub_group,
6317 Arm_output_section::group_sections): New method definitions.
6318
10ad9fe5
DK
63192009-10-22 Doug Kwan <dougkwan@google.com>
6320
6321 * arm.cc (Arm_input_section): New class definition.
6322 (Arm_input_section::init, Arm_input_section:do_write,
6323 Arm_input_section::set_final_data_size,
6324 Arm_input_section::do_reset_address_and_file_offset): New method
6325 definitions.
6326
56ee5e00
DK
63272009-10-21 Doug Kwan <dougkwan@google.com>
6328
6329 * arm.cc (Stub_table, Arm_input_section): New forward class
6330 declarations.
6331 (Stub_table): New class defintion.
6332 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6333 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6334 New method definition.
6335
b569affa
DK
63362009-10-21 Doug Kwan <dougkwan@google.com>
6337
6338 * arm.cc: Update copyright comments.
6339 (Target_arm): New forward class template declaration.
6340 (Arm_address): New type.
6341 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6342 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6343 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6344 constants.
6345 (Insn_template): Same.
6346 (DEF_STUBS): New macro.
6347 (Stub_type): New enum type.
6348 (Stub_template): New class definition.
6349 (Stub): Same.
6350 (Reloc_stub): Same.
6351 (Stub_factory): Same.
6352 (Target_arm::Target_arm): Initialize may_use_blx_ and
6353 should_force_pic_veneer_.
6354 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6355 Target_arm::should_force_pic_veneer,
6356 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6357 Target_arm::using_thumb_only, Target_arm:;default_target): New
6358 method defintions.
6359 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6360 New data member declarations.
6361 (Insn_template::size, Insn_template::alignment): New method defintions.
6362 (Stub_template::Stub_template): New method definition.
6363 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6364 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6365 (Stub_factory::Stub_factory): New method definition.
6366 * gold.h (string_hash): New template.
6367 * output.h (Input_section_specifier::hash_value): Use
6368 gold::string_hash.
6369 (Input_section_specifier::string_hash): Remove.
6370 * stringpool.cc (Stringpool_template::string_hash): Use
6371 gold::string_hash.
6372
6c172549
DK
63732009-10-20 Doug Kwan <dougkwan@google.com>
6374
6375 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6376 symbols of relaxed input sections.
6377 * output.h (Output_section::find_relaxed_input_section): Make
6378 method public.
6379
c5617f2f
DK
63802009-10-16 Doug Kwan <dougkwan@google.com>
6381
6382 * dynobj.cc (Versions::Versions): Initialize version_script_.
6383 Only insert base version symbol definition for a shared object
6384 if version script defines any version versions.
6385 (Versions::define_base_version): New method definition.
6386 (Versions::add_def): Check that base version is not needed.
6387 (Versions::add_need): Define base version lazily.
6388 * dynobj.h (Versions::define_base_version): New method declaration.
6389 (Versions::needs_base_version_): New data member declaration.
6390 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6391 (check_DATA): Add no_version_test.stdout.
6392 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6393 New make rules.
6394 * testsuite/Makefile.in: Regenerate.
6395 * testsuite/no_version_test.c: New file.
6396 * testsuite/no_version_test.sh: Ditto.
6397
3c12dcdb
DK
63982009-10-16 Doug Kwan <dougkwan@google.com>
6399
6400 * expression.cc (class Segment_start_expression): New class definition.
6401 (Segment_start_expression::value): New method definition.
6402 (script_exp_function_segment_start): Return a new
6403 Segment_start_expression.
6404 * gold/script-c.h (script_saw_segment_start_expression): New function
6405 prototype.
6406 * script-sections.cc (Script_sections::Script_sections): Initialize
6407 SAW_SEGMENT_START_EXPRESSION_ to false.
6408 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6409 and -Tbbs options to specify section addresses if given in
6410 command line and no SEGMENT_START expression is seen in a script.
6411 * script-sections.h (Script_sections::saw_segment_start_expression,
6412 Script_sections::set_saw_segment_start_expression): New method
6413 definition.
6414 (Script_sections::saw_segment_start_expression_): New data member
6415 declaration.
6416 * script.cc (script_saw_segment_start_expression): New function.
6417 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6418 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6419 script_test_7.sh and script_test_8.sh.
6420 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6421 script_test_8.stdout.
6422 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6423 (script_test_6, script_test_6.stdout, script_test_7,
6424 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6425 * Makefile.in: Regenerate.
6426 * testsuite/script_test_6.sh: New file.
6427 * testsuite/script_test_6.t: Same.
6428 * testsuite/script_test_7.sh: Same.
6429 * testsuite/script_test_7.t: Same.
6430 * testsuite/script_test_8.sh: Same.
6431
64b1ae37
DK
64322009-10-16 Doug Kwan <dougkwan@google.com>
6433
6434 * output.cc (Output_segment::set_section_list_address): Cast
6435 expressions to unsigned long long type to avoid format warnings.
6436
661be1e2
ILT
64372009-10-15 Ian Lance Taylor <iant@google.com>
6438
12edd763 6439 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6440 dot assignment to script_sections_.
12edd763
ILT
6441 * script-sections.cc (Script_sections::add_dot_assignment):
6442 Initialize if necessary.
6443
68b6574b
ILT
6444 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6445 program headers with no load segment if there is a linker script.
6446
661be1e2
ILT
6447 * layout.cc (Layout::set_segment_offsets): Align the file offset
6448 to the segment aligment for -N or -n with no load segment.
6449 * output.cc (Output_segment::add_output_section): Don't crash if
6450 the first section is a TLS section.
6451 (Output_segment::set_section_list_addresses): Print an error
6452 message if the address moves backward in a linker script.
6453 * script-sections.cc
6454 (Output_section_element_input::set_section_addresses): Don't
6455 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6456 (Orphan_output_section::set_section_addresses): Likewise.
6457
f15f61a7
DK
64582009-10-15 Doug Kwan <dougkwan@google.com>
6459
6460 * layout.cc (Layout::finish_dynamic_section): Generate tags
6461 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6462 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6463 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6464
82bb573a
ILT
64652009-10-14 Ian Lance Taylor <iant@google.com>
6466
6467 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6468 fields.
6469 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6470 data_shdr fields of relinfo.
6471 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6472 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6473 R_386_TLS_LDO_32, adjust based on section flags.
6474 (Target_i386::Relocate::fix_up_ldo): Remove.
6475
374ad285
ILT
64762009-10-13 Ian Lance Taylor <iant@google.com>
6477
6478 Add support for -pie.
6479 * options.h (class General_options): Add -pie and
6480 --pic-executable.
6481 (General_options::output_is_position_independent): Test -pie.
6482 (General_options::output_is_executable): Return true if not shared
6483 and not relocatable.
6484 (General_options::output_is_pie): Remove.
6485 * options.cc (General_options::finalize): Reject incompatible uses
6486 of -pie.
6487 * gold.cc (queue_middle_tasks): A -pie link is not static.
6488 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6489 * symtab.cc (Symbol::final_value_is_known): Return false if
6490 output_is_position_independent.
6491 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6492 output_is_position_independent.
6493 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6494 output_is_position_independent.
6495 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6496 output_is_position_independent.
6497 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6498 two_file_pie_test.
6499 (basic_pie_test.o, basic_pie_test): New targets.
6500 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6501 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6502 (two_file_pie_test): New target.
6503 * testsuite/Makefile.in: Rebuild.
6504 * README: Remove note saying that -pie is not supported.
6505
c6585162
ILT
65062009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6507
6508 * options.h (class General_options): Add -init and -fini.
6509 * layout.cc (Layout::finish_dynamic_section): Emit
6510 given init and fini functions.
6511
032ce4e9
ST
65122009-10-13 Sriraman Tallam <tmsriram@google.com>
6513
6514 * gc.h (gc_process_relocs): Check if icf is enabled using new
6515 function.
6516 * gold.cc (queue_initial_tasks): Likewise.
6517 (queue_middle_tasks): Likewise.
6518 * object.cc (do_layout): Likewise.
6519 * symtab.cc (is_section_folded): Likewise.
6520 * main.cc (main): Likewise.
6521 * reloc.cc (Read_relocs::run): Likewise.
6522 (Sized_relobj::do_scan_relocs): Likewise.
6523 * icf.cc (is_function_ctor_or_dtor): New function.
6524 (Icf::find_identical_sections): Check if function is ctor or dtor when
6525 safe icf is chosen.
6526 * options.h (General_options::icf): Change option to be an enum.
6527 (Icf_status): New enum.
6528 (icf_enabled): New method.
6529 (icf_safe_folding): New method.
6530 (set_icf_status): New method.
6531 (icf_status_): New variable.
6532 * (options.cc) (General_options::finalize): Set icf_status_.
6533 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6534 icf_test and icf_keep_unique_test to use the --icf enum flag.
6535 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6536 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6537
f345227a
ST
65382009-10-12 Sriraman Tallam <tmsriram@google.com>
6539
6540 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6541 includes to gc.h and icf.h.
6542 * arm.cc: Include gc.h.
6543 * gold.cc: Likewise.
6544 * i386.cc: Likewise.
6545 * powerpc.cc: Likewise.
6546 * sparc.cc: Likewise.
6547 * x86_64.cc: Likewise.
6548 * gc.h: Include icf.h.
6549
1c7814ed
ILT
65502009-10-11 Ian Lance Taylor <iant@google.com>
6551
6552 * plugin.cc: Include "gold.h" before other header files.
6553
ae3b5189
CD
65542009-10-10 Chris Demetriou <cgd@google.com>
6555
6556 * options.h (Input_file_argument::Input_file_type): New enum.
6557 (Input_file_argument::is_lib_): Replace with...
6558 (Input_file_argument::type_): New member.
6559 (Input_file_argument::Input_file_argument): Take Input_file_type
6560 'type' rather than boolean 'is_lib' as second argument.
6561 (Input_file_argument::is_lib): Use type_.
6562 (Input_file_argument::is_searched_file): New function.
6563 (Input_file_argument::may_need_search): Handle is_searched_file.
6564 * options.cc (General_options::parse_library): Support -l:filename.
6565 (General_options::parse_just_symbols): Update for Input_file_argument
6566 changes.
6567 (Command_line::process): Likewise.
6568 * archive.cc (Archive::get_file_and_offset): Likewise.
6569 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6570 * script.cc (read_script_file, script_add_file): Likewise.
6571 * fileread.cc (Input_file::Input_file): Likewise.
6572 (Input_file::will_search_for): Handle is_searched_file.
6573 (Input_file::open): Likewise.
6574 * readsyms.cc (Read_symbols::get_name): Likewise.
6575 * testsuite/Makefile.am (searched_file_test): New test.
6576 * testsuite/Makefile.in: Regenerate.
6577 * testsuite/searched_file_test.cc: New file.
6578 * testsuite/searched_file_test_lib.cc: New file.
6579
f3048a1d
ILT
65802009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6581 Ian Lance Taylor <iant@google.com>
6582
6583 * descriptor.cc: Include <cstdio> and "binary-io.h".
6584 (Descriptors::open): Open the files in binary mode always.
6585 * script.cc (Lex::get_token): Treat \r as whitespace.
6586
d4780e57
ILT
65872009-10-09 Ian Lance Taylor <iant@google.com>
6588
6589 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6590
d9a893b8
ILT
65912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6592 Ian Lance Taylor <iant@google.com>
6593
6594 * configure.ac: Check for readv function also.
6595 * fileread.cc (readv): Define if not HAVE_READV.
6596 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6597 does not exist.
6598 * config.in: Regenerate.
6599 * configure: Regenerate.
6600
c0a62865
DK
66012009-10-09 Doug Kwan <dougkwan@google.com>
6602
6603 * layout.cc (Layout::make_output_section): Call target hook to make
6604 ordinary output section.
6605 (Layout::finalize): Adjust parameter list of call the
6606 Target::may_relax().
6607 * layout.h (class Layout::section_list): New method.
6608 * merge.h (Output_merge_base::entsize): Change visibility to public.
6609 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6610 New methods.
6611 (Output_merge_string::do_is_string): New method.
6612 * object.cc (Sized_relobj::do_setup): renamed from
6613 Sized_relobj::set_up.
6614 * object.h (Sized_relobj::adjust_shndx,
6615 Sized_relobj::initializ_input_to_output_maps,
6616 Sized_relobj::free_input_to_output_maps): Change visibilities to
6617 protected.
6618 (Sized_relobj::setup): Virtualize.
6619 (Sized_relobj::do_setup): New method declaration.
6620 (Sized_relobj::invalidate_section_offset,
6621 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6622 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6623 * options.cc (parse_int): New function.
6624 * options.h (parse_int): New declaration.
6625 (DEFINE_int): New macro.
6626 (stub_group_size): New option.
6627 * output.cc (Output_section::Output_section): Initialize memebers
6628 merge_section_map_, merge_section_by_properties_map_,
6629 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6630 (Output_section::add_input_section): Handled deferred code-fill
6631 generation and remove an old comment.
6632 (Output_section::add_relaxed_input_section): New method definition.
6633 (Output_section::add_merge_input_section): Use merge section by
6634 properties map to speed to search. Update merge section maps
6635 as appropriate.
6636 (Output_section::build_relaxation_map): New method definition.
6637 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6638 Same.
6639 (Output_section::relax_input_section): Renamed to
6640 Output_section::convert_input_sections_to_relaxed_sections and change
6641 interface to take a vector of pointers to relaxed sections.
6642 (Output_section::find_merge_section,
6643 Output_section::find_relaxed_input_section): New method definitions.
6644 (Output_section::is_input_address_mapped,
6645 Output_section::output_offset, Output_section::output_address):
6646 Use output section data maps to speed up searching.
6647 (Output_section::find_starting_output_address): Add comments.
6648 (Output_section::do_write,
6649 Output_section::write_to_postprocessing_buffer): Do code-fill
6650 generation as appropriate.
6651 (Output_section::get_input_sections): Invalidate relaxed input section
6652 map.
6653 (Output_section::restore_states): Adjust type of checkpoint .
6654 Invalidate relaxed input section map.
6655 * output.h (Output_merge_base): New class declaration.
6656 (Input_section_specifier): New class defintion.
6657 (class Output_relaxed_input_section) Change base class to
6658 Output_section_data_build.
6659 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6660 base class initializer.
6661 (Output_section::add_relaxed_input_section): New method declaration.
6662 (Output_section::Input_section): Change visibility to protected.
6663 (Output_section::Input_section::relobj,
6664 Output_section::Input_section::shndx): Handle relaxed input sections.
6665 Output_section::input_sections) Change visibility to protected. Also
6666 define overload to return a non-const pointer.
6667 (Output_section::Merge_section_properties): New class defintion.
6668 (Output_section::Merge_section_by_properties_map,
6669 Output_section::Output_section_data_by_input_section_map,
6670 Output_section::Relaxation_map): New types.
6671 (Output_section::relax_input_section): Rename method to
6672 Output_section::convert_input_sections_to_relaxed_sections and change
6673 interface to take a vector of relaxed section pointers.
6674 (Output_section::find_merge_section,
6675 Output_section::find_relaxed_input_section,
6676 Output_section::build_relaxation_map,
6677 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6678 New method declarations.
6679 (Output_section::merge_section_map_
6680 Output_section::merge_section_by_properties_map_,
6681 Output_section::relaxed_input_section_map_,
6682 Output_section::is_relaxed_input_section_map_valid_,
6683 Output_section::generate_code_fills_at_write_): New data members.
6684 * script-sections.cc
6685 (Output_section_element_input::set_section_addresses): Call
6686 current_data_size and addralign methods of relaxed input sections.
6687 (Orphan_output_section::set_section_addresses): Call current_data_size
6688 and addralign methods of relaxed input sections.
6689 * symtab.cc (Symbol_table::compute_final_value): Extract template
6690 from the body of Symbol_table::sized_finalize_symbol.
6691 (Symbol_table::sized_finalized_symbol): Call
6692 Symbol_table::compute_final_value.
6693 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6694 (Symbol_table::compute_final_value): New templated method declaration.
6695 * target.cc (Target::do_make_output_section): New method defintion.
6696 * target.h (Target::make_output_section): New method declaration.
6697 (Target::relax): Add more parameters for input objects, symbol table
6698 and layout. Adjust call to do_relax.
6699 (Target::do_make_output_section): New method declaration.
6700 (Target::do_relax): Add parameters for input objects, symbol table
6701 and layout.
6702
d446d6c4
ILT
67032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6704
6705 * pread.c: Include stdio.h.
6706
bc06c745
ILT
67072009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6708
6709 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6710 defined.
6711
75aea3d0
ILT
67122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6713
6714 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6715 Change read_shndx type to unsigned int.
6716 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6717 int.
6718 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6719 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6720 Change read_shndx type to unsigned int.
6721 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6722 int.
6723 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6724 * layout.cc (Layout::create_symtab_sections): Cast the result of
6725 local_symcount * symsize to off_t in the gold_assert.
6726
be8fcb75
ILT
67272009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6728
6729 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6730 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6731 R_ARM_BASE_ABS.
6732 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6733 (Arm_relocate_functions::thm_abs5): New function.
6734 (Arm_relocate_functions::abs12): New function.
6735 (Arm_relocate_functions::abs16): New function.
6736 (Arm_relocate_functions::base_abs): New function.
6737 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6738 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6739 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6740 R_ARM_BASE_ABS.
6741 (Scan::global): Likewise.
6742 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6743 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6744 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6745 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6746 R_ARM_BASE_ABS.
6747
c2a122b6
ILT
67482009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6749
6750 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6751 (Arm_relocate_functions::movt_prel): New function.
6752 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6753 (Arm_relocate_functions::thm_movt_prel): New function.
6754 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6755 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6756 (Scan::global, Relocate::relocate): Likewise.
6757 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6758
c4aa1e2d
ILT
67592009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6760
6761 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6762 Incremental_checker.
6763 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6764 unsigned int.
6765 (class Incremental_inputs_header): New class.
6766 (Incremental_inputs_header_writer): Edit comment.
6767 (Incremental_inputs_entry): New class.
6768 (Incremental_inputs_entry_writer): Edit comment.
6769 (Sized_incremental_binary::do_find_incremental_inputs_section):
6770 Add *strtab_shndx parameter, fill it.
6771 (Sized_incremental_binary::do_check_inputs): New method.
6772 (Incremental_checker::can_incrementally_link_output_file): Use
6773 Sized_incremental_binary::check_inputs.
6774 (Incremental_inputs::report_command_line): Save command line in
6775 command_line_.
6776 * incremental.h:
6777 (Incremental_binary::find_incremental_inputs_section): New
6778 method.
6779 (Incremental_binary::do_find_incremental_inputs_section): Add
6780 strtab_shndx parameter.
6781 (Incremental_binary::do_check_inputs): New pure virtual method.
6782 (Sized_incremental_binary::do_check_inputs): Declare.
6783 (Incremental_checker::Incremental_checker): Add incremental_inputs
6784 parameter, use it to initialize incremental_inputs_.
6785 (Incremental_checker::incremental_inputs_): New field.
6786 (Incremental_checker::command_line): New method.
6787 (Incremental_checker::inputs): New method.
6788 (Incremental_checker::command_line_): New field.
6789
c549a694
ILT
67902009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6791
6792 * incremental.cc: Include <cstdarg> and "target-select.h".
6793 (vexplain_no_incremental): New function.
6794 (explain_no_incremental): New function.
6795 (Incremental_binary::error): New method.
6796 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6797 method.
6798 (make_sized_incremental_binary): New function.
6799 (open_incremental_binary): New function.
6800 (can_incrementally_link_file): Add checks if output is ELF and has
6801 inputs section.
6802 * incremental.h: Include "elfcpp_file.h" and "output.h".
6803 (Incremental_binary): New class.
6804 (Sized_incremental_binary): New class.
6805 (open_incremental_binary): Declare.
6806 * object.cc (is_elf_object): Use
6807 elfcpp::Elf_recognizer::is_elf_file.
6808 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6809 * output.h (Output_file::filesize): New method.
6810
fd3c5f0b
ILT
68112009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6812
6813 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6814 New function.
6815 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6816 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6817 function.
6818 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6819 function.
6820 (Arm_relocate_functions::movw_abs_nc): New function.
6821 (Arm_relocate_functions::movt_abs): New function.
6822 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6823 (Arm_relocate_functions::thm_movt_abs): New function.
6824 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6825 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6826 (Scan::global): Likewise.
6827 (Relocate::relocate): Likewise.
6828 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6829
7f5309a5
ILT
68302009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6831
6832 * arm.cc (Arm_relocate_functions::got_prel) New function.
6833 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6834 (Relocate::relocate): Likewise.
6835 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6836
364c7fa5
ILT
68372009-10-06 Ian Lance Taylor <iant@google.com>
6838
6839 * options.h (class General_options): Define
6840 split_stack_adjust_size parameter.
6841 * object.h (class Object): Add uses_split_stack_ and
6842 has_no_split_stack_ fields. Add uses_split_stack and
6843 has_no_split_stack accessor functions. Declare
6844 handle_split_stack_section.
6845 (class Reloc_symbol_changes): Define.
6846 (class Sized_relobj): Define Function_offsets. Declare
6847 split_stack_adjust, split_stack_adjust_reltype, and
6848 find_functions.
6849 * object.cc (Object::handle_split_stack_section): New function.
6850 (Sized_relobj::do_layout): Call handle_split_stack_section.
6851 * dynobj.cc (Sized_dynobj::do_layout): Call
6852 handle_split_stack_section.
6853 * reloc.cc (Sized_relobj::relocate_sections): Call
6854 split_stack_adjust for executable sections in split_stack
6855 objects. Pass reloc_map to relocate_section.
6856 (Sized_relobj::split_stack_adjust): New function.
6857 (Sized_relobj::split_stack_adjust_reltype): New function.
6858 (Sized_relobj::find_functions): New function.
6859 * target-reloc.h: Include "object.h".
6860 (relocate_section): Add reloc_symbol_changes parameter. Change
6861 all callers.
6862 * target.h (class Target): Add calls_non_split method. Declare
6863 do_calls_non_split virtual method. Declare match_view and
6864 set_view_to_nop.
6865 * target.cc: Include "elfcpp.h".
6866 (Target::do_calls_non_split): New function.
6867 (Target::match_view): New function.
6868 (Target::set_view_to_nop): New function.
6869 * gold.cc (queue_middle_tasks): Give an error if mixing
6870 split-stack and non-split-stack objects with -r.
6871 * i386.cc (Target_i386::relocate_section): Add
6872 reloc_symbol_changes parameter.
6873 (Target_i386::do_calls_non_split): New function.
6874 * x86_64.cc (Target_x86_64::relocate_section): Add
6875 reloc_symbol_changes parameter.
6876 (Target_x86_64::do_calls_non_split): New function.
6877 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6878 parameter.
6879 * powerpc.cc (Target_powerpc::relocate_section): Add
6880 reloc_symbol_changes parameter.
6881 * sparc.cc (Target_sparc::relocate_section): Add
6882 reloc_symbol_changes parameter.
6883 * configure.ac: Call AM_CONDITIONAL for the default target.
6884 * configure: Rebuild.
6885 * testsuite/Makefile.am (TEST_AS): New variable.
6886 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6887 (check_DATA): Add split_i386 and split_x86_64 files.
6888 (SPLIT_DEFSYMS): Define.
6889 (split_i386_[1234n].o): New targets.
6890 (split_i386_[124]): New targets.
6891 (split_i386_[1234r].stdout): New targets.
6892 (split_x86_64_[1234n].o): New targets.
6893 (split_x86_64_[124]): New targets.
6894 (split_x86_64_[1234r].stdout): New targets.
6895 (MOSTLYCLEANFILES): Add new executables.
6896 * testsuite/split_i386.sh: New file.
6897 * testsuite/split_x86_64.sh: New file.
6898 * testsuite/split_i386_1.s: New file.
6899 * testsuite/split_i386_2.s: New file.
6900 * testsuite/split_i386_3.s: New file.
6901 * testsuite/split_i386_4.s: New file.
6902 * testsuite/split_i386_n.s: New file.
6903 * testsuite/split_x86_64_1.s: New file.
6904 * testsuite/split_x86_64_2.s: New file.
6905 * testsuite/split_x86_64_3.s: New file.
6906 * testsuite/split_x86_64_4.s: New file.
6907 * testsuite/split_x86_64_n.s: New file.
6908 * testsuite/testfile.cc (Target_test): Update relocation_section
6909 function.
6910 * testsuite/Makefile.in: Rebuild.
6911
e8a9fcda
ILT
69122009-10-06 Ian Lance Taylor <iant@google.com>
6913
6914 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6915 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6916 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6917 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6918 the address on ldo_addrs_.
6919 (Target_i386::Relocate::fix_up_ldo): New function.
6920
e99daf92
ILT
69212009-10-06 Rafael Espindola <espindola@google.com>
6922
6923 * plugin.cc (add_input_library): New.
6924 (Plugin::load): Add add_input_library to tv.
6925 (Plugin_manager::add_input_file): Add the is_lib argument.
6926 (add_input_file): Update call to Plugin_manager::add_input_file.
6927 (add_input_library): New.
6928 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6929
966d4097
DK
69302009-09-30 Doug Kwan <dougkwan@google.com>
6931
6932 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6933 symbol and call Symbol::may_need_copy_reloc to determine if
6934 a copy reloc is needed.
6935 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6936 nocopyreloc is given in command line.
6937 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6938 given in command line.
6939 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6940 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6941 of the removed Target_i386::may_need_copy_reloc.
6942 * options.h (copyreloc): New option with default value false.
6943 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6944 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6945 instead of the removed Target_powerpc::may_need_copy_reloc.
6946 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6947 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6948 instead of the removed Target_sparc::may_need_copy_reloc.
6949 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6950 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6951 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6952 instead of the removed Target_x86_64::may_need_copy_reloc.
6953
029ba973
ILT
69542009-09-30 Ian Lance Taylor <iant@google.com>
6955
6956 * object.h (class Object): Remove target_ field, and target,
6957 sized_target, and set_target methods.
6958 (Object::sized_target): Remove.
6959 (class Sized_relobj): Update declarations. Remove sized_target.
6960 * object.cc (Sized_relobj::setup): Remove target parameter.
6961 Change all callers.
6962 (Input_objects::add_object): Don't do anything with the target.
6963 (make_elf_sized_object): Add punconfigured parameter. Change all
6964 callers. Set or test parameter target.
6965 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6966 Change all callers.
6967 * parameters.cc (Parameters::set_target): Change parameter type to
6968 be non-const.
6969 (Parameters::default_target): Remove.
6970 (set_parameters_target): Change parameter type to be non-const.
6971 (parameters_force_valid_target): New function.
6972 (parameters_clear_target): New function.
6973 * parameters.h (class Parameters): Update declarations. Remove
6974 default_target method. Add sized_target and clear_target
6975 methods. Change target_ to be non-const.
6976 (set_parameters_target): Update declaration.
6977 (parameters_force_valid_target): Declare.
6978 (parameters_clear_target): Declare.
6979 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6980 as NULL if we aren't searching.
6981 (Add_symbols::run): Don't check for compatible target.
6982 * fileread.cc (Input_file::open_binary): Call
6983 parameters_force_valid_target.
6984 * gold.cc (queue_middle_tasks): Likewise.
6985 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6986 set_target on object.
6987 * dynobj.h (class Sized_dynobj): Update declarations.
6988 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6989 make_elf_object returns NULL.
6990 (Archive::include_member): Don't check whether object target is
6991 compatible.
6992 * output.cc (Output_section::add_input_section): Get target from
6993 parameters.
6994 (Output_section::relax_input_section): Likewise.
6995 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6996 parameters.
6997 (Sized_relobj::do_scan_relocs): Likewise.
6998 (Sized_relobj::relocate_sections): Likewise.
6999 * resolve.cc (Symbol_table::resolve): Likewise.
7000 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7001 parameter. Change all callers.
7002 (Symbol_table::add_from_object): Get target from parameters.
7003 (Symbol_table::add_from_relobj): Don't check object target.
7004 (Symbol_table::add_from_dynobj): Likewise.
7005 (Symbol_table::define_special_symbol): Get target from
7006 parameters.
7007 * symtab.h (class Symbol_table): Update declaration.
7008 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7009 parameter. Change all callers. Clear parameter target.
7010 (Binary_test): Test target here.
7011 * testsuite/object_unittest.cc (gold_testsuite): Remove
7012 target_test_pointer parameter. Change all callers.
7013 (Object_test): Test target here.
7014
a6a22b83
ILT
70152009-09-26 Ian Lance Taylor <iant@google.com>
7016
7017 * testsuite/initpri1.c: Don't try to use constructor priorities if
7018 compiling with gcc before 4.3.
7019
6a8f49fe
ILT
70202009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7021
7022 * testsuite/retain_symbols_file_test.sh (check_present): Change
7023 output file name to retain_symbols_file_test.stdout.
7024 (check_absent): Likewise.
7025
8c604651
CS
70262009-09-18 Craig Silverstein <csilvers@google.com>
7027
7028 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7029 * options.cc: Include <cerrno> and <fstream>.
7030 (General_options::finalize): Parse -retain-symbols-file tag.
7031 * options.h: New flag.
7032 (General_options): New method should_retain_symbol, new
7033 variable symbols_to_retain.
7034 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7035 should_retain_symbol map.
7036 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7037 * testsuite/Makefile.in: Regenerate.
7038 * testsuite/retain_symbols_file_test.sh: New file.
7039
ca58b19f
NC
70402009-09-18 Nick Clifton <nickc@redhat.com>
7041
7042 * po/es.po: Updated Spanish translation.
7043
20e6d0d6
DK
70442009-09-17 Doug Kwan <dougkwan@google.com>
7045
7046 * debug.h (DEBUG_RELAXATION): New constant.
7047 (DEBUG_ALL): Add DEBUG_RELAXATION.
7048 (debug_string_to_enum): Add relaxation debug option.
7049 * layout.cc
7050 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7051 Layout::Relaxation_debug_check::read_sections,
7052 Layout::Relaxation_debug_check::read_sections): New method definitions.
7053 (Layout::Layout): Initialize data members
7054 record_output_section_data_from_scrips_,
7055 script_output_section_data_list_ and relaxation_debug_check_.
7056 (Layout::save_segments, Layout::restore_segments,
7057 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7058 Layout::relaxation_loop_body): New method definitions.
7059 (Layout::finalize): Support relaxation. Move section layout code to
7060 Layout::relaxation_loop_body.
7061 (Layout::set_asection_address_from_script): Move code for orphan
7062 section placement out.
7063 (Layout::place_orphan_sections_in_script): New method definition.
7064 * layout.h (Output_segment_headers, Output_file_header):
7065 New forward class declarations.
7066 (Layout::~Layout): Define.
7067 (Layout::new_output_section_data_from_script): New method definition.
7068 (Layout::place_orphan_sections_in_script): New method declaration.
7069 (Layout::Segment_states): New type declaration.
7070 (Layout::save_segments, Layout::restore_segments,
7071 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7072 Layout::relaxation_loop_body): New method declarations.
7073 (Layout::Output_section_data_list): New type declaration.
7074 (Layout::Relaxation_debug_check): New class definition.
7075 (Layout::record_output_section_data_from_script_,
7076 Layout::script_output_section_data_list_, Layout::segment_states_,
7077 Layout::relaxation_debug_check_): New data members.
7078 * output.cc: (Output_section_headers::do_size): New method definition.
7079 (Output_section_headers::Output_section_headers): Move size
7080 computation to Output_section_headers::do_size.
7081 (Output_segment_headers::do_size): New method definition.
e1df38aa 7082 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7083 Output_file_header::do_size and call it.
7084 (Output_file_header::do_size): New method definition.
7085 (Output_data_group::Output_data_group): Adjust call to
7086 Output_section_data.
7087 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7088 (Output_symtab_xindex::do_write): Add array bound check.
7089 (Output_section::Input_section::print_to_mapfile): Handle
7090 RELAXED_INPUT_SECTION_CODE.
7091 (Output_section::Output_section): Initialize data member checkpoint_.
7092 (Output_section::~Output_section): Delete checkpoint object pointed
7093 by checkpoint_.
7094 (Output_section::add_input_section): Always add an Input_section if
7095 relaxing.
7096 (Output_section::add_merge_input_section): Add assert.
7097 (Output_section::relax_input_section): New method definition.
7098 (Output_section::set_final_data_size): Set load address to zero for
7099 an unallocated section.
7100 (Output_section::do_address_and_file_offset_have_reset_values):
7101 New method definition.
7102 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7103 Handle relaxed input section.
7104 (Output_section::sort_attached_input_sections): Checkpoint input
7105 section list lazily.
7106 (Output_section::get_input_sections): Change type of input_sections to
7107 list of Simple_input_section pointers. Checkpoint input section list
7108 lazily. Also handle relaxed input sections.
7109 (Output_section::add_input_section_for_script): Take a reference to
7110 a Simple_input_section object instead of Relobj pointer and section
7111 index as parameter. Handle relaxed input sections.
7112 (Output_section::save_states, Output_section::restore_states): New
7113 method definitions.
7114 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7115 (Output_data::is_data_size_fixed): New method definition.
7116 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7117 if it is fixed.
7118 (Output_data::address_and_file_offset_have_reset_values): New method
7119 definition.
7120 (Output_data::do_address_and_file_offset_have_reset_values): New method
7121 definition.
7122 (Output_data::set_data_size): Check that data size is not fixed.
7123 (Output_data::fix_data_size): New method definition.
7124 (Output_data::is_data_size_fixed_): New data member.
7125 (Output_section_headers::set_final_data_size): New method definition.
7126 (Output_section_headers::do_size): New method declaration.
7127 (Output_segment_headers::set_final_data_size): New method definition.
7128 (Output_segment_headers::do_size): New method declaration.
7129 (Output_file_header::set_final_data_size)::New method definition.
7130 (Output_file_header::do_size)::New method declaration.
7131 (Output_section_data::Output_section_data): Add new parameter
7132 is_data_size_fixed and use it to fix data size.
7133 (Output_data_const::Output_data_const): Adjust call to base class
7134 constructor and fix data size.
7135 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7136 base class constructor and fix data size.
7137 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7138 base class constructor and fix data size.
7139 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7140 class constructor and fix data size.
7141 (Output_data_group::set_final_data_size): New method definition.
7142 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7143 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7144 class constructor and fix data size.
7145 (Output_relaxed_input_section): New class definition.
7146 (Output_section::Simple_input_section): New class definition.
7147 (Output_section::get_input_sections): Adjust parameter list.
7148 (Output_section::add_input_section_for_script): Same.
7149 (Output_section::save_states, Output_section::restore_states,
7150 Output_section::do_address_and_file_offset_have_reset_values,
7151 (Output_section::Input_section::Input_section): Handle
7152 RELAXED_INPUT_SECTION_CODE. Add new overload for
7153 Output_relaxed_input_section.
7154 (Output_section::Input_section::is_input_section,
7155 Output_section::Input_section::set_output_section): Handle relaxed
7156 input section.
7157 (Output_section::Input_section::is_relaxed_input_section,
7158 Output_section::Input_section::output_section_data,
7159 Output_section::Input_section::relaxed_input_section): New method
7160 definitions.
7161 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7162 value.
7163 (Output_section::Input_section::u1_): Update comments.
7164 (Output_section::Input_section::u2_): Add new union member poris.
7165 (Output_section::Checkpoint_output_section): New classs definition.
7166 (Output_section::relax_input_section): New method declaration.
7167 (Output_section::checkpoint_): New data member.
7168 (Output_segment): Update comments.
7169 (Output_segment::Output_segment): Un-privatize copy constructor.
7170 (Output_segment::operator=): Un-privatize.
7171 * script-sections.cc (Output_section_element::Input_section_list):
7172 Change element type to Output_section::Simple_input_section.
7173 (Output_section_element_dot_assignment::set_section_addresses):
7174 Register output section data for relaxation clean up.
7175 (Output_data_exression::Output_data_expression): Adjust call to base
7176 constructor to fix data size.
7177 (Output_section_element_data::set_section_addresses): Register
7178 Output_data_expression object for relaxation clean up.
7179 (struct Input_section_info): Replace Relobj pointer and section index
7180 pair with Output_section::Simple_input_section and Convert struct to a
7181 class.
7182 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7183 Input_section_info data member to use accessors.
20e6d0d6
DK
7184 (Output_section_element_input::set_section_addresses): Use layout
7185 parameter. Adjust code to use Output_section::Simple_input_section
7186 and Input_secction_info classes. Register filler for relaxation
7187 clean up.
7188 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7189 and section index pair with Output_section::Simple_input_section
7190 class. Adjust code accordingly.
7191 (Phdrs_element::release_segment): New method definition.
7192 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7193 segment list.
7194 (Script_sections::release_segments): New method definition.
7195 * gold/script-sections.h (Script_sections::release_segments): New
7196 method declaration.
7197 * gold/target.h (Target::may_relax, Target::relax,
7198 Target::do_may_relax, Target::do_relax): New method definitions.
7199
5e445df6
ILT
72002009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7201
7202 * arm.cc (has_signed_unsigned_overflow): New function.
7203 (Arm_relocate_functions::abs8): New function.
7204 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7205 (Target_arm::Scan::global): Likewise.
7206 (Target_arm::relocate::relocate): Likewise.
7207 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7208 Likewise.
7209
8c604651 72102009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7211
7212 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7213 * testsuite/Makefile.in: Regenerate.
7214
1e9cc1c2
NC
72152009-09-11 Nick Clifton <nickc@redhat.com>
7216
7217 * po/gold.pot: Updated by the Translation project.
7218
6a89f575
CC
72192009-09-08 Cary Coutant <ccoutant@google.com>
7220
7221 * output.cc (Output_file::open): Add execute permission to empty file.
7222 * testsuite/Makefile.am (permission_test): New test.
7223 * testsuite/Makefile.in: Regenerate.
7224
fdcac5af
ILT
72252009-09-02 Ian Lance Taylor <iant@google.com>
7226
7227 * output.cc (Output_file::resize): Call map_no_anonymous rather
7228 than map.
7229
44453f85
ILT
72302009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7231
7232 * gold.cc: Include "incremental.h".
7233 (queue_initial_tasks): Call Incremental_checker methods.
7234 * incremental.cc: Include "output.h".
7235 (Incremental_checker::can_incrementally_link_output_file): New
7236 method.
7237 * incremental.h (Incremental_checker): New class.
7238
7239 * output.cc (Output_file::open_for_modification): New method.
7240 (Output_file::map_anonymous): Changed return type to bool. Record
7241 map in base_ field.
7242 (Output_file::map_no_anonymous): New method, broken out of map.
7243 (Output_file::map): Use map_no_anonymous and map_anonymous.
7244 * output.h (class Output_file): Update declarations.
7245
293c1386
CC
72462009-08-24 Cary Coutant <ccoutant@google.com>
7247
7248 * options.h (Command_line::Pre_options): New class.
7249 (Command_line::pre_options): New member.
7250 * options.cc (gold::options::ready_to_register): New variable.
7251 (One_option::register_option): Do nothing if not registering options.
7252 Assert if same short option registered twice.
7253 (General_options::General_options): Turn off option registration when
7254 done constructing.
7255 (Command_line::Pre_options::Pre_options): New constructor.
7256
f773f3d2
CC
72572009-08-24 Cary Coutant <ccoutant@google.com>
7258
06a73cfe
CC
7259 * options.h (General_options::no_keep_memory): Remove incorrect
7260 short option.
f773f3d2 7261
a15af8e2
RW
72622009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7263
7264 * Makefile.am (am__skiplex, am__skipyacc): New.
7265 * Makefile.in: Regenerate.
7266
c462b41b
RW
72672009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7268
14ec8efd
RW
7269 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7270 (INCLUDES): ... this.
7271 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7272 (AM_CPPFLAGS): Renamed from ...
7273 (INCLUDE): ... this.
7274 * Makefile.in, testsuite/Makefile.in: Regenerate.
7275
81ecdfbb
RW
7276 * Makefile.in: Regenerate.
7277 * aclocal.m4: Likewise.
7278 * config.in: Likewise.
7279 * configure: Likewise.
7280 * testsuite/Makefile.in: Likewise.
7281
c462b41b
RW
7282 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7283 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7284 * Makefile.in: Regenerate.
7285 * testsuite/Makefile.in: Regenerate.
7286
2da73f13
CC
72872009-08-19 Cary Coutant <ccoutant@google.com>
7288
7289 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7290 symbols in shared libraries overridden by hidden or internal symbols
7291 in the main program.
7292
2db70501
CD
72932009-08-19 Chris Demetriou <cgd@google.com>
7294
7295 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7296 checking source file names in error messages.
7297
f733487b
DK
72982009-08-18 Doug Kwan <dougkwan@google.com>
7299
7300 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7301 an elcpp::Ehdr as parameter. Adjust call to set_target.
7302 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7303 an elfcpp::Ehdr as parameter.
7304 * object.cc (Object::set_target): Remove the version that looks up
7305 a target and sets it.
7306 (Sized_relobj::setup): Take a Target object instead of
7307 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7308 (make_elf_sized_object): Find target and ask target to
7309 make an ELF object.
7310 * object.h: (Object::set_target): Remove the version that looks up
7311 a target and sets it.
7312 (Sized_relobj::setup): Take a Target object instead of
7313 an elfcpp:Ehdr as parameter.
7314 * target.cc: Include dynobj.h.
7315 (Target::do_make_elf_object_implementation): New.
7316 (Target::do_make_elf_object): New.
7317 * target.h (Target::make_elf_object): New template declaration.
7318 (Target::do_make_elf_object): New method declarations.
7319 (Target::do_make_elf_object_implementation): New template declaration.
7320
cc70f101
ILT
73212009-08-14 Ian Lance Taylor <iant@google.com>
7322
7323 * gold.h (FUNCTION_NAME): Define.
7324 (gold_unreachable): Use FUNCTION_NAME.
7325
ef5e0cb1
ST
73262009-08-12 Sriraman Tallam <tmsriram@google.com>
7327
7328 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7329 symbol in the --keep-unique list is not found.
7330
48c187ce
ST
73312009-08-12 Sriraman Tallam <tmsriram@google.com>
7332
7333 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7334 been maked as --keep-unique.
7335 (Icf::unfold_section): New function.
7336 * icf.h (Icf::unfold_section): New function.
7337 * options.h (General_options::keep_unique): New option.
7338 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7339 * testsuite/Makefile.in: Regenerate.
7340 * testsuite/icf_keep_unique_test.sh: New file.
7341 * testsuite/icf_keep_unique_test.cc: New file.
7342
645afe0c
CC
73432009-08-12 Cary Coutant <ccoutant@google.com>
7344
7345 PR 10471
7346 * resolve.cc (Symbol_table::resolve): Check for references from
7347 dynamic objects to hidden and internal symbols.
7348 * testsuite/Makefile.am (hidden_test.sh): New test.
7349 * testsuite/Makefile.in: Regenerate.
7350 * testsuite/hidden_test.sh: New script.
7351 * testsuite/hidden_test_1.c: New test source.
7352 * testsuite/hidden_test_main.c: New test source.
7353
11af873f
DK
73542009-08-11 Doug Kwan <dougkwan@google.com>
7355
7356 * arm.cc: Update comments.
7357 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7358 segment to locate the .ARM.exidx section if present.
7359
b9f7d72d
DK
73602009-08-09 Doug Kwan <dougkwan@google.com>
7361
7362 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7363 patch.
7364
ddd3c53c
ST
73652009-08-07 Sriraman Tallam <tmsriram@google.com>
7366 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7367 compiler warnings.
7368
27721062
ST
73692009-08-06 Sriraman Tallam <tmsriram@google.com>
7370
7371 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7372 valid tls_segment only for non-debug-section relocations.
7373 * testsuite/Makefile.am: Add gc_tls_test.
7374 * testsuite/Makefile.in: Regenerate.
7375 * testsuite/gc_tls_test.cc: New file.
7376 * testsuite/gc_tls_test.sh: New file.
7377
ef15dade 73782009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7379
ef15dade
ST
7380 * icf.cc: New file.
7381 * icf.h: New file.
7382 * Makefile.am (CCFILES): Add icf.cc.
7383 (HFILES): Add icf.h
7384 * Makefile.in: Regenerate.
7385 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7386 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7387 section, symbol and addend information for the relocs.
7388 * gold.cc (queue_middle_tasks): Call identical code folding.
7389 * gold.h: Add defines for multimap.
7390 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7391 to the call of finalize_local_symbols.
7392 * main.cc (main): Create object of class Icf.
7393 * object.cc (Sized_relobj::do_layout): Allow this function to be
7394 called twice during icf.
7395 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7396 to sections marked as identical by icf.
7397 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7398 when available.
7399 (Sized_relobj::do_section_entsize): New function.
7400 * object.h (Object::section_entsize): New function.
7401 (Object::do_section_entsize): New pure virtual function.
7402 (Relobj::finalize_local_symbols): Add new parameter.
7403 (Relobj::do_section_entsize): New function.
7404 * options.h (General_options::icf): New option.
7405 (General_options::icf_iterations): New option.
7406 (General_options::print_icf_sections): New option.
7407 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7408 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7409 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7410 icf.
7411 * symtab.cc (Symbol_table::is_section_folded): New function.
7412 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7413 to sections marked as identical by icf.
7414 * symtab.h (Symbol_table::set_icf): New function.
7415 (Symbol_table::icf): New function.
7416 (Symbol_table::is_section_folded): New function.
7417 (Symbol_table::icf_): New data member.
7418 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7419 * testsuite/Makefile.am: Add commands to build icf_test.
7420 * testsuite/Makefile.in: Regenerate.
7421 * testsuite/icf_test.sh: New file.
7422 * testsuite/icf_test.cc: New file.
7423
c3b65ac4
CD
74242009-07-24 Chris Demetriou <cgd@google.com>
7425
7426 * layout.cc (is_compressible_debug_section): Fix incorrect
7427 comment about compressed section names.
7428
1caf2c51
ILT
74292009-07-20 Ian Lance Taylor <ian@airs.com>
7430
7431 PR 10419
7432 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7433
1ef4d87f
ILT
74342009-07-16 Ian Lance Taylor <iant@google.com>
7435
7436 PR 10400
7437 * layout.h: #include <map>.
7438 (class Kept_section): Change from struct to class. Add accessors
7439 and setters. Add section size to Comdat_group mapping. Change
7440 Comdat_group to std::map. Add is_comdat_ field. Add
7441 linkonce_size field in union.
7442 (class Layout): Update declaration of find_or_add_kept_section.
7443 Don't declare find_kept_object.
7444 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7445 parameter. Add object, shndx, is_comdat, and is_group_name
7446 parameters. Change all callers. Adjust for new Kept_section.
7447 (Layout::find_kept_object): Remove.
7448 * object.cc (Sized_relobj::include_section_group): Update use of
7449 Kept_section. Rename secnum to shndx. Only record
7450 Kept_comdat_section if sections are the same size.
7451 (Sized_relobj::include_linkonce_section): Update use of
7452 Kept_section. Only record Kept_comdat_section if sections are the
7453 same size. Set size of linkonce section.
7454 (Sized_relobj::map_to_kept_section): Update call to
7455 get_kept_comdat_section.
7456 * object.h (class Sized_relobj): Rename fields in
7457 Kept_comdat_section to drop trailing underscores; change object
7458 field to Relobj*. Change Kept_comdat_section_table to store
7459 struct rather than pointer.
7460 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7461 Add kept_object and kept_shndx parameters. Change all callers.
7462 (Sized_relobj::get_kept_comdat_section): Change return type to
7463 bool. Add kept_object and kept_shndx parameters. Change all
7464 callers.
7465 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7466 Layout::find_or_add_kept_section.
7467
37c3b7b0
ILT
74682009-07-09 Ian Lance Taylor <iant@google.com>
7469
7470 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7471 Reserve space in the hash table.
7472
98fa85cb
ILT
74732009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7474
7475 * fileread.cc (File_read::get_mtime): New method.
7476 * fileread.h (Timespec): New structure.
7477 (File_read::get_mtime): New method.
7478 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7479 Renamed from timestamp_nsec.
7480 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7481 Elf_Xword.
e1df38aa 7482 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7483 timestamp_nsec.
e1df38aa 7484 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7485 (Incremental_inputs::report_obejct): Save mtime; style fix.
7486 (Incremental_inputs::report_script): Save mtime; style fix.
7487 (Incremental_inputs::finalize_inputs): Style fix.
7488 (Incremental_inputs::finalize): Style fix.
7489 (Incremental_inputs::create_input_section_data): Store inputs
7490 mtime.
7491 * incremental.h (Incremental_inputs::report_script): Add mtime
7492 argument.
7493 (Incremental_inputs::Input_info::Input_info): Intialize only one
7494 union member.
7495 (Incremental_inputs::Input_info::archive): Move to nameless
7496 union.
7497 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7498 (Incremental_inputs::Input_info::script): Move to nameless union.
7499 (Incremental_inputs::mtime): New field.
7500 * script.cc (read_input_script): Pass file mtime to
7501 Incremental_input.
7502 * script.h (Script_info::inputs): Style fix.
7503
c9d70757
ILT
75042009-07-01 Ian Lance Taylor <ian@airs.com>
7505
7506 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7507 instead of 32.
7508
9c547ec3
ILT
75092009-06-24 Ian Lance Taylor <iant@google.com>
7510
7511 PR 10156
7512 * layout.cc (Layout::choose_output_section): If we find an
7513 existing section, update the flags.
7514 (Layout::create_notes): New function, broken out of
7515 Layout::finalize.
7516 (Layout::finalize): Don't create note sections.
7517 (Layout::create_note): Don't crash if linker script discards
7518 section.
7519 (Layout::create_gold_note): Likewise.
7520 (Layout::create_build_id): Likewise. Don't set
7521 after_input_sections on the section.
7522 (Layout::create_executable_stack_info): Remove target parameter.
7523 Change caller.
7524 * layout.h (class Layout): Declare create_notes. Update
7525 declaration of create_executable_stack_info.
7526 * gold.cc (queue_middle_tasks): Call create_notes.
7527 * output.cc (Output_section::update_flags_for_input_section): Move
7528 here from output.h. If SHF_ALLOC flag is newly set, mark address
7529 invalid.
7530 * output.h (Output_data::mark_address_invalid): New function.
7531 (class Output_section): Only declare, not define,
7532 update_flags_for_input_section. Remove set_flags.
7533
55458500
ILT
75342009-06-24 Ian Lance Taylor <iant@google.com>
7535
7536 * script-sections.cc (Output_section_definition::
7537 set_section_addresses): Rename shadowing local load_address to
7538 laddr.
7539
1307d6cd
ILT
75402009-06-24 Ian Lance Taylor <iant@google.com>
7541
7542 PR 10244
7543 * reloc.cc (relocate_sections): Skip empty relocation sections.
7544
ec3f783e
ILT
75452009-06-23 Ian Lance Taylor <iant@google.com>
7546
7547 PR 10156
7548 * layout.cc (Layout::create_note): Use choose_output_section
7549 rather than make_output_section.
7550
459c9f1c
ILT
75512009-06-23 Ian Lance Taylor <iant@google.com>
7552
7553 PR 10237
7554 * options.cc (General_options::parse_V): Set printed_version_.
7555 (General_options::General_options): Initialize printed_version_.
7556 * options.h (class General_options): Add printed_version_ field.
7557 * gold.cc (queue_initial_tasks): If there are no input files,
7558 don't give a fatal error if we printed the version information.
7559 (queue_middle_tasks): If using -r with a shared object, give a
7560 fatal error rather than an ordinary error.
7561
1518dc8f
ILT
75622009-06-23 Ian Lance Taylor <iant@google.com>
7563
7564 PR 10219
7565 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7566 (Layout::make_output_section): Set have_stabstr_section_ if we see
7567 a .stab*str section.
7568 (Layout::finalize): Call link_stabs_sections.
7569 (Layout::link_stabs_sections): New file.
7570 * layout.h (class Layout): Add have_stabstr_section_ field.
7571 Declare link_stabs_sections.
7572
3d857b98
DK
75732009-06-23 Doug Kwan <dougkwan@google.com>
7574
7575 * Makefile.am (libgold_a_LIBADD): New.
7576 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7577 * Makefile.in: Regenerate.
7578 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7579 * configure: Regenerate.
7580 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7581 * fileread.cc: Include sys/state.h
7582 * gold.h: Declare memmem and strndup if found missing.
7583 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7584
0639a6f6
ILT
75852009-06-23 Ian Lance Taylor <iant@google.com>
7586
7587 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7588 * configure: Rebuild.
7589
8d63875c
ILT
75902009-06-23 Ian Lance Taylor <iant@google.com>
7591
7592 PR 10147
7593 * object.cc (Object::section_contents): Don't try to get a view if
7594 the section has length zero.
7595 (Object::handle_gnu_warning_section): If the section is empty, use
7596 the name of the section as the warning.
7597
f7c8a183
ILT
75982009-06-23 Ian Lance Taylor <iant@google.com>
7599
7600 PR 10133
7601 * stringpool.h (class Stringpool_template): Add optimize_ field.
7602 (Stringpool_template::set_optimize): New function.
7603 * stringpool.cc (Stringpool_template::Stringpool_template):
7604 Initialize optimize_ field.
7605 (Stringpool_template::set_string_offsets): Test local optimize
7606 fild rather than parameter.
7607 * layout.cc (Layout::Layout): Call set_optimize on the section
7608 name stringpool.
7609
e6a307ba
ILT
76102009-06-22 Ian Lance Taylor <iant@google.com>
7611
7612 PR 10030
7613 * yyscript.y: Parse TARGET.
7614 * script.cc (script_set_target): New function.
7615 * script-c.h (script_set_target): Declare.
7616 * options.cc (General_options::string_to_object_format): Rename
7617 from string_to_object_format in anonymous namespace. Change
7618 callers.
7619 * options.h (class General_options): Declare
7620 string_to_object_format.
7621
3ee173de
ILT
76222009-06-22 Ian Lance Taylor <iant@google.com>
7623
7624 * script-sections.cc (Script_sections::create_segments): Don't put
7625 program headers in a PT_LOAD segment if -n or -N.
7626
76272009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7628
7629 PR 10141
7630 * options.h (class General_options): Add -z lazy and -z now. Sort
7631 -z options into alphabetical order.
7632 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7633
cd6739a1 76342009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7635
7636 * layout.cc (Layout::make_output_section): Call
7637 Target::new_output_section.
7638 (Layout::attach_allocated_section_to_segment): Put large section
7639 sections in a separate load segment with the large segment flag
7640 set.
7641 (Layout::segment_precedes): Sort large data segments after other
7642 load segments.
7643 (align_file_offset): New static function.
7644 (Layout::set_segment_offsets): Use align_file_offset.
7645 * output.h (class Output_section): Add is_small_section_ and
7646 is_large_section_ fields.
7647 (Output_section::is_small_section): New function.
7648 (Output_section::set_is_small_section): New function.
7649 (Output_section::is_large_section): New function.
7650 (Output_section::set_is_large_section): New function.
7651 (Output_section::is_large_data_section): New function.
7652 (class Output_segment): Add is_large_data_segment_ field.
7653 (Output_segment::is_large_data_segment): New function.
7654 (Output_segment::set_is_large_data_segment): New function.
7655 * output.cc (Output_section::Output_section): Initialize new
7656 fields.
7657 (Output_segment::Output_segment): Likewise.
7658 (Output_segment::add_output_section): Add assertion that large
7659 data sections always go in large data segments. Force small data
7660 sections to the end of the list of data sections. Force small BSS
7661 sections to the start of the list of BSS sections. For large BSS
7662 sections to the end of the list of BSS sections.
7663 * symtab.h (class Symbol): Declare is_common_shndx.
7664 (Symbol::is_defined): Check Symbol::is_common_shndx.
7665 (Symbol::is_common): Likewise.
7666 (class Symbol_table): Define enum Commons_section_type. Update
7667 declarations. Add small_commons_ and large_commons_ fields.
7668 * symtab.cc (Symbol::is_common_shndx): New function.
7669 (Symbol_table::Symbol_table): Initialize new fields.
7670 (Symbol_table::add_from_object): Put small and large common
7671 symbols in the right list.
7672 (Symbol_table::sized_finalized_symbol): Check
7673 Symbol::is_common_shndx.
7674 (Symbol_table::sized_write_globals): Likewise.
7675 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7676 common symbol lists. Don't call do_allocate_commons_list if the
7677 list is empty.
7678 (Symbol_table::do_allocate_commons_list): Remove is_tls
7679 parameter. Add comons_section_type parameter. Change all
7680 callers. Handle small and large common symbols.
7681 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7682 Symbol::is_common_shndx.
7683 * resolve.cc (symbol_to_bits): Likewise.
7684 * target.h (Target::small_common_shndx): New function.
7685 (Target::small_common_section_flags): New function.
7686 (Target::large_common_shndx): New function.
7687 (Target::large_common_section_flags): New function.
7688 (Target::new_output_section): New function.
7689 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7690 small_common_section_flags, and large_common_section_flags
7691 fields.
7692 (Target::do_new_output_section): New virtual function.
7693 * arm.cc (Target_arm::arm_info): Initialize new fields.
7694 * i386.cc (Target_i386::i386_info): Likewise.
7695 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7696 Likewise.
7697 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7698 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7699 (Target_x86_64::do_new_output_section): New function.
7700 * configure.ac: Define conditional MCMODEL_MEDIUM.
7701 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7702 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7703 (large_LDFLAGS): Define.
7704 * testsuite/large.c: New file.
7705 * testsuite/testfile.cc (Target_test::test_target_info):
7706 Initialize new fields.
7707 * configure, testsuite/Makefile.in: Rebuild.
7708
bb04269c
DK
77092009-06-05 Doug Kwan <dougkwan@google.com>
7710
7711 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7712 * Makefile.in: Regenerate.
bb04269c
DK
7713 * i386.cc (class Target_i386): Define new virtual method to
7714 override do_is_local_label_name in parent.
7715 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7716 local symbols if --discard-locals or -X is given.
7717 * options.h (class General_options): Declare new options
7718 '--discard-locals' and '-X' for discarding locals.
7719 * target.h (class Target): Define new methods is_local_label_name.
7720 Declare new virtual method do_is_local_label_name.
7721 * target.cc: New file.
7722 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7723 (check_SCRIPTS): Add discard_locals_test.sh.
7724 (check_DATA): Add discard_local_tests.syms.
7725 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7726 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7727 * testsuite/Makefile.in: Regenerate.
7728 * testsuite/discard_locals_test.c: New file.
7729 * testsuite/discard_locals_test.sh: Same.
7730
805bb01c
DK
77312009-06-05 Doug Kwan <dougkwan@google.com>
7732
7733 * object.cc (Sized_relobj::Sized_relobj): Initialize
7734 discarded_eh_frame_shndx_ to -1U.
7735 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7736 section.
7737 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7738 a discarded .eh_frame section.
7739 (Sized_relobj::do_finalize_local_symbols): Ditto.
7740 * object.h (class Sized_relobj): Declare new member
7741 discarded_eh_frame_shndx_.
7742 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7743 (local_labels_test.o, local_labels_test): New rules.
7744 * testsuite/Makefile.in: Regenerate.
7745
1dcd334d
DK
77462009-06-04 Doug Kwan <dougkwan@google.com>
7747
7748 * layout.cc (Layout::section_name_mapping): Add mapping for
7749 special ARM sections.
7750
96d49306
DK
77512009-06-03 Doug Kwan <dougkwan@google.com>
7752
7753 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7754 (utils::has_overflow): Same.
7755
dff16297
ILT
77562009-06-03 Ian Lance Taylor <iant@google.com>
7757
7758 * layout.cc (Layout::section_name_mapping): New array, replacing
7759 Layout::linkonce_mapping.
7760 (Layout::section_name_mapping_count): New variable, replacing
7761 Layout::linkonce_mapping_count.
7762 (Layout::linkonce_output_name): Remove.
7763 (Layout::output_section_name): Rewrite.
7764 * layout.h (class Layout): Rename Linkonce_mapping to
7765 Section_name_mapping, linkonce_mapping to section_name_mapping,
7766 linkonce_mapping_count to section_name_mapping_count. Don't
7767 declare linkonce_output_name.
7768
c121c671
DK
77692009-06-03 Doug Kwan <dougkwan@google.com>
7770
7771 * gold/arm.cc (namespace utils): New.
7772 (Target_arm::reloc_is_non_pic): Define new method.
7773 (class Arm_relocate_functions): New.
7774 (Target_arm::Relocate::relocate): Handle relocation types used by
7775 Android.
7776
07800fab
ILT
77772009-06-03 Ian Lance Taylor <iant@google.com>
7778
7779 * arm.cc (Target_arm::scan::global): Use || instead of |.
7780
c121c671
DK
77812009-06-02 Doug Kwan <dougkwan@google.com>
7782
7783 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7784 issued_non_pic_error_.
7785 (class Target_arm::Scan): Declare new method check_non_pic.
7786 Define new method symbol_needs_plt_entry.
7787 Declare new data member issued_non_pic_error_.
7788 (class Target_arm::Relocate): Declare new method
7789 should_apply_static_reloc.
7790 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7791 (Target_arm::Scan::check_non_pic): Define new method.
7792 (Target_arm::Scan::local): Handle a small subset of reloc types used
7793 by Android.
7794 (Target_arm::Scan::local): Same.
7795 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7796
b19b0c6d
ILT
77972009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7798
7799 * incremental.cc (Incremental_inputs::report_command_line): Filter
7800 out --incremental-* options.
7801
94cdfcff
DK
78022009-05-29 Doug Kwan <dougkwan@google.com>
7803
7804 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7805 template class.
7806 (class Target_arm): Update comment.
7807 (Target_arm::Target_arm): Initialize new data members GOT_,
7808 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7809 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7810 and Target_arm::rel_dyn_section.
7811 Declare new_enum Target_arm::Got_type.
7812 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7813 and DYNBSS_.
7814 Update commments for member do_dynsym_value.
7815 (Target_arm::got_size, Target_arm::plt_section,
7816 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7817 new methods inside class defintion.
7818 (Target_arm::got_section): Define new method.
7819 (Target_arm::rel_dyn_section): Same.
7820 (Output_data_plt_arm): New template class.
7821 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7822 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7823 (Output_data_plt_arm::add_entry): Same.
7824 (Output_data_plt_arm::first_plt_entry): Define new
7825 static data member for PLT instruction template.
7826 (Output_data_plt_arm::plt_entry): Same.
7827 (Output_data_plt_arm::do_write): Define new method.
7828 (Target_arm::make_plt_entry): Same.
7829 (Target_arm::do_finalize_sections): Same.
7830 (Target_arm::do_dynsym_value): Same.
7831
4a657b0d
DK
78322009-05-28 Doug Kwan <dougkwan@google.com>
7833
7834 * Makefile.am (TARGETSOURCES): Add arm.cc.
7835 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7836 * Makefile.in: Regenerate.
7837 * arm.cc: New file.
7838 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7839
e7ae8c36
DK
78402009-05-26 Doug Kwan <dougkwan@google.com>
7841
7842 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7843 (General_options::check_excluded_libs): Strip off directories in
7844 archive name before matching like GNU ld does.
7845 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7846 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7847 (exclude_libs_test_LDFLAGS): Add linker option
7848 -Wl,--exclude-libs,libexclude_libs_test_3
7849 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7850 an explicit archive without using -l.
7851 (alt/libexclude_libs_test_3.a): New make rule.
7852 * testsuite/Makefile.in: Regenerate.
7853 * testsuite/exclude_libs_test.c : Declare lib3_default().
7854 (main): Call it.
7855 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7856 * exclude_libs_test_3.c: New file.
7857
f12e7348
NC
78582009-05-26 Nick Clifton <nickc@redhat.com>
7859
7860 * po/id.po: New Indonesian translation.
7861 * po/gold.pot: Updated template file.
7862
4daadc0d
ST
78632009-05-22 Sriraman Tallam <tmsriram@google.com>
7864
e1df38aa 7865 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7866 gc_comdat_test files. Add -Wl,--gc-sections to build
7867 gc_comdat_test.
7868 * testsuite/Makefile.in: Regenerate.
7869 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7870
531813ad
ST
78712009-05-21 Sriraman Tallam <tmsriram@google.com>
7872
7873 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7874 kept comdat section was garbage collected.
7875 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7876 * testsuite/Makefile.in: Regenerate.
7877 * testsuite/gc_comdat_test.sh: New file.
7878 * testsuite/gc_comdat_test_1.cc: New file.
7879 * testsuite/gc_comdat_test_2.cc: New file.
7880
65514900
CC
78812009-05-19 Doug Kwan <dougkwan@google.com>
7882
7883 * archive.cc (Archive::Archive): Move constructor from archive.h
7884 to here. Initialize no_export_.
7885 (Archive::get_elf_object_for_member): Set no_export flag of object.
7886 * archive.h (Archive::Archive): Move constructor body to
7887 archive.cc.
7888 (Archive::no_export): New method.
7889 (Archive::no_export_): New field.
7890 * object.h (Object::Object): Initialize no_export_ to false.
7891 (Object::no_export, Object::set_no_export): New methods.
7892 (Object::no_export_): New field.
7893 * options.cc (General_options::parse_exclude_libs): New method.
7894 (General_options::check_excluded_libs) Same.
7895 * options.h (exclude_libs): New option.
7896 (General_options::check_excluded_libs): New method declaration.
7897 (General_options::excluded_libs_): New field.
7898 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7899 default or protected visibility if an object has no-export flag set.
7900 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7901 (check_SCRIPTS): Add exclude_libs_test.sh.
7902 (check_DATA): Add exclude_libs_test.syms.
7903 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7904 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7905 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7906 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7907 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7908 libexclude_libs_test_2.a): New rules.
7909 * testsuite/Makefile.in: Regenerate.
7910 * testsuite/exclude_libs_test.c: New file.
7911 * testsuite/exclude_libs_test.sh: Ditto.
7912 * testsuite/exclude_libs_test_1.c: Ditto.
7913 * testsuite/exclude_libs_test_2.c: Ditto.
7914
1b77ea50
ILT
79152009-05-15 Ian Lance Taylor <iant@google.com>
7916
7917 * configure.ac: Check for declarations for cases where libiberty.h
7918 checks HAVE_DECL_xxx.
7919 * configure, config.in: Rebuild.
7920
072fe7ce
ILT
79212009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7922
7923 * gold.h (Incremental_argument_list): Remove (invalid) forward
7924 declaration.
7925 * incremental.cc (Incremental_inputs::report_achive): New method.
7926 (Incremental_inputs::report_object): New method.
7927 (Incremental_inputs::report_script): New method.
7928 (Incremental_inputs::finalize_inputs): New method.
7929 (Incremental_inputs::finalize): Call finalize_inputs().
7930 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7931 Create inputs entries.
7932 * incremental.h (Incremental_input_type): New enum.
7933 (Incremental_inputs::Incremental_input): Initialize new fields.
7934 (Incremental_inputs::report_inputs): New method.
7935 (Incremental_inputs::report_achive): New method.
7936 (Incremental_inputs::report_object): New method.
7937 (Incremental_inputs::report_script): New method.
7938 (Incremental_inputs::finalize_inputs): New method.
7939 (Incremental_inputs::Input_info): New struct.
7940 (Incremental_inputs::Input_info_map): New typedef.
7941 (Incremental_inputs::lock_): New field.
7942 (Incremental_inputs::Inputs_): New field.
7943 (Incremental_inputs::Inputs_map): New field.
7944 * main.cc (main): Call Incremental_input::report_inputs.
7945 * options.h (Input_argument_list): Typedef moved from
7946 Input_arguments.
7947 (Input_file_group::Files): Remove, use ::Input_argument_list.
7948 (Input_file_group::Input_argument_list): Remove, use
7949 ::Input_argument_list.
7950 * plugin.cc (Plugin_manager::add_input_file): Add error in
7951 incremental build.
7952 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7953 functions.
7954 * script.cc (read_input_script): Call
7955 Incremental_input::report_script.
7956 * script.h (Script_info): New class.
7957
b0481b0b
ILT
79582009-04-27 Ian Lance Taylor <iant@google.com>
7959
7960 * x86_64.cc (do_adjust_output_section): Set entsize to
7961 plt_entry_size.
7962
b22a5a41 79632009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7964
7965 * output.cc (Output_file::close): After short writes, continue
7966 writing from the correct offset in the buffer being written.
7967
40fde488
CD
79682009-04-23 Chris Demetriou <cgd@google.com>
7969
7970 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7971 * configure: Regenerate.
7972 * config.in: Regenerate.
7973 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7974 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7975
3ce2c28e
ILT
79762009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7977
7978 * incremental.cc (Incremental_inputs_header_data): Renamed from
7979 Incremental_input_header_data.
7980 (Incremental_inputs_header_data::data_size): New field.
7981 (Incremental_inputs_header_data::put_input_file_count): Renamed
7982 from input_file_count.
7983 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7984 from command_line_offset.
7985 (Incremental_inputs_header_data::put_reserved): Renamed from
7986 put_reserved.
7987 (Incremental_inputs_entry_data): Renamed from
7988 Incremental_input_entry_data.
7989 (Incremental_inputs_entry_data::data_size): New field.
7990 (Incremental_inputs::report_command_line): New method.
7991 (Incremental_inputs::finalize): New method.
7992 (Incremental_inputs::create_incremental_inputs_data): New method.
7993 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7994 * incremental.h: New file.
7995 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7996 (Layout::finalize): Create incremental inputs section in
7997 incremental builds.
7998 (Layout::create_incremental_info_sections): New method.
7999 * layout.h (Layout::incremental_inputs): New method.
8000 (Layout::create_incremental_info_sections): New method.
8001 (Layout::incremental_inputs_): New field.
8002 * main.cc (main): Notify Incremental_input of the command line.
8003
e55bde5e
ILT
80042009-04-01 Ian Lance Taylor <iant@google.com>
8005 Mikolaj Zalewski <mikolajz@google.com>
8006
8007 * gold.h (reserve_unordered_map): Define, three versions, one for
8008 each version of Unordered_map.
8009 * layout.cc (Layout::Layout): Remove options parameter. Add
8010 number_of_input_files parameter. Don't initialize options_.
8011 Initialize number_of_input_files_ and resized_signatures_. Move
8012 sections_are_attached_.
8013 (Layout::layout_group): Reserve space for group_signatures_.
8014 (Layout::find_or_add_kept_section): Change name parameter to be a
8015 reference. Resize signatures_ map when it gets large enough.
8016 (Layout::layout_eh_frame): Use parameters->options() instead of
8017 this->options_.
8018 (Layout::make_output_section): Likewise.
8019 (Layout::attach_allocated_section_to_segment): Likewise.
8020 (Layout::finalize, Layout::create_executable_stack): Likewise.
8021 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8022 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8023 * layout.h (class Layout): Update declarations. Remove options_
8024 field. Add number_of_input_files_ and resized_signatures_
8025 fields. Move sections_are_attached_ field.
8026 * main.cc (main): Pass number of input files to Layout
8027 constructor. Don't pass options.
8028
154b857c
ILT
80292009-03-30 Ian Lance Taylor <iant@google.com>
8030
8031 * ffsll.c (ffsll): Correct implementation.
8032
2f35ab9b
ILT
80332009-03-27 Ian Lance Taylor <iant@google.com>
8034
fd03461a
ILT
8035 * ffsll.c: New file.
8036 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8037 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8038 * ftruncate.c (ftruncate): Declare before definition.
8039 * mremap.c (mremap): Likewise.
8040 * pread.c (pread): Likewise.
8041 * configure, Makefile.in, config.in: Rebuild.
8042
2f35ab9b
ILT
8043 * mremap.c: New file.
8044 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8045 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8046 (mremap): Declare if HAVE_MREMAP is not defined.
8047 * configure, Makefile.in, config.in: Rebuild.
8048
33aea2fd
CC
80492009-03-27 Cary Coutant <ccoutant@google.com>
8050
8051 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8052 position independent.
8053 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8054 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8055
6d479619
CC
80562009-03-24 Cary Coutant <ccoutant@google.com>
8057
8058 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8059 an executable.
8060 (needs_dynamic_reloc): Likewise.
8061
afc06bb8
ILT
80622009-03-24 Ian Lance Taylor <iant@google.com>
8063
8064 * yyscript.y (file_cmd): Recognize EXTERN.
8065 (extern_name_list, extern_name_list_body): New nonterminals.
8066 * script.cc (script_add_extern): Define.
8067 * script-c.h (script_add_extern): Declare.
8068
f6060a4d
ILT
80692009-03-24 Rafael Avila de Espindola <espindola@google.com>
8070
8071 * object.cc (is_elf_object): Define.
8072 * object.h (is_elf_object): Declare.
8073 * archive.cc (Archive::get_elf_object_for_member): Call
8074 is_elf_object.
33aea2fd 8075 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8076
26736d8e
ILT
80772009-03-24 Elliott Hughes <enh@google.com>
8078
8079 * output.cc (Output_file::map_anonymous): Define.
8080 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8081 try an anonymous one. Report the size if the mmap fails.
8082 * output.h (class Output_file): Declare map_anonymous.
8083
22fd9730
ILT
80842009-03-24 Ian Lance Taylor <iant@google.com>
8085
8086 * target-select.cc (instantiate_target): Don't acquire the lock if
8087 the instantiated_target_ field has already been set.
8088
cb010894
ILT
80892009-03-23 Ian Lance Taylor <iant@google.com>
8090
7f055c20
ILT
8091 * gold-threads.h (class Initialize_lock): Define.
8092 * gold-threads.cc (class Initialize_lock_once): Define.
8093 (initialize_lock_control): New static variable.
8094 (initialize_lock_pointer): New static variable.
8095 (initialize_lock_once): New static function.
8096 (Initialize_lock::Initialize_lock): Define.
8097 (Initialize_lock::initialize): Define.
8098 * target-select.h: Include "gold-threads.h".
8099 (class Target_selector): Add lock_ and initialize_lock_ fields.
8100 Don't define instantiate_target, just declare it.
8101 * target-select.cc (Target_selector::Target_selector): Initialize
8102 new fields.
8103 (Target_selector::instantiate_target): Define.
8104 * descriptors.h: Include "gold-threads.h".
8105 (class Descriptors): Add initialize_lock_ field.
8106 * descriptors.cc (Descriptors::Descriptors): Initialize new
8107 field.
8108 (Descriptors::open): Use initialize_lock_ field
8109 * errors.h (class Errors): Add initialize_lock_ field.
8110 * errors.cc (Errors::Errors): Initialize new field.
8111 (Errors::initialize_lock): Use initialize_lock_ field.
8112 * powerpc.cc (class Target_selector_powerpc): Remove
8113 instantiated_target_ field. In do_recognize call
8114 instantiate_target rather than do_instantiate_target. In
8115 do_instantiate_target just allocate a new target.
8116 * sparc.cc (class Target_selector_sparc): Likewise.
8117
36959681
ILT
8118 * freebsd.h: New file.
8119 * i386.cc: Include "freebsd.h".
8120 (Target_i386): Derive from Target_freebsd rather than
8121 Sized_target.
8122 (Target_selector_i386): Derive from Target_selector_freebsd rather
8123 than Target_selector.
8124 * x86_64.cc: Include "freebsd.h".
8125 (Target_x86_64): Derive from Target_freebsd rather than
8126 Sized_target.
8127 (Target_selector_x86_64): Derive from Target_selector_freebsd
8128 rather than Target_selector.
8129 * target.h (class Target): Add adjust_elf_header and
8130 do_adjust_elf_header.
8131 * output.cc (Output_file_header:: do_sized_write): Call target
8132 adjust_elf_header routine.
8133 * configure.tgt: Set targ_osabi.
8134 * configure.ac: Define GOLD_DEFAULT_OSABI.
8135 * parameters.cc (Parameters::default_target): Pass
8136 GOLD_DEFAULT_OSABI to select_target.
8137 * target-select.h (class Target_selector): Make instantiate_target
8138 protected rather than private.
8139 * Makefile.am (HFILES): Add freebsd.h.
8140 * configure, Makefile.in, config.in: Rebuild.
8141
cb010894
ILT
8142 * merge.cc (do_add_input_section): Correct pend value. Change
8143 message about last entry not being null terminated from error to
8144 warning.
8145
0e879927
ILT
81462009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8147
8148 * incremental.cc: New file.
8149 * Makefile.am (CCFILES): Add incremental.cc.
8150 * Makefile.in: Rebuild.
8151
41105937
PP
81522009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8153
8154 * layout.cc (Layout::output_section_name): Preserve names
8155 of '.note.' sections.
e1df38aa 8156
60439920
ILT
81572009-03-19 Ian Lance Taylor <iant@google.com>
8158
8159 * descriptors.cc (Descriptors::open): Check that the options are
8160 valid before using them.
8161
0d371ad3
ILT
81622009-03-18 Ian Lance Taylor <iant@google.com>
8163
8164 * script-sections.h: Include <list>.
8165 (class Script_sections): Change Sections_elements from std::vector
8166 to std::list. Typedef public Elements_iterator. Add
8167 orphan_section_placement_, data_segment_align_start_, and
8168 saw_data_segment_align_ fields. Remove data_segment_align_index_
8169 field.
8170 * script-sections.cc (class Orphan_section_placement): New class.
8171 (class Sections_element): Add virtual functions is_relro and
8172 orphan_section_init. Remove virtual function place_orphan_here.
8173 (class Output_section_definition): Add is_relro and
8174 orphan_section_init. Remove place_orphan_here.
8175 (class Orphan_output_section): Likewise.
8176 (Script_sections::Script_sections): Update for field changes.
8177 (Script_sections::data_segment_align): Set saw_data_segment_align_
8178 and data_segment_align_start_, not data_segment_align_index.
8179 (Script_sections::data_segment_relro_end): Check
8180 saw_data_segment_align_. Use data_segment_align_start_ rather
8181 than data_segment_align_index_.
8182 (Script_sections::place_orphan): Rewrite to use
8183 Orphan_section_placement.
8184
9201d894
ILT
81852009-03-17 Ian Lance Taylor <iant@google.com>
8186
9c5b8369
ILT
8187 * archive.cc (Archive::add_symbols): Check for a version attached
8188 to the symbol name in the archive map.
8189 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8190 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8191 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8192 (ver_test_11.a): New target.
8193 * testsuite/Makefile.in: Rebuild.
8194
9201d894
ILT
8195 * configure.ac: Check for chsize and posix_fallocate. Replace
8196 ftruncate.
8197 * ftruncate.c: New file, from gnulib.
8198 * output.cc (posix_fallocate): Define dummy version if not
8199 HAVE_POSIX_FALLOCATE.
8200 (Output_file::map): Call posix_fallocate rather than lseek and
8201 write.
8202 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8203 * configure, Makefile.in, config.in: Rebuild.
8204
ef4ab7a8 82052009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8206
ef4ab7a8
PP
8207 * layout.h (Layout::create_note): Add section_name parameter.
8208 * layout.cc (Layout::create_note): Likewise.
8209 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8210
8c500701
ILT
82112009-03-17 Ian Lance Taylor <iant@google.com>
8212
e85b18e1
ILT
8213 * descriptors.cc: Include "options.h".
8214 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8215 (Descriptors::open): Always use O_CLOEXEC when opening a new
8216 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8217 then set FD_CLOEXEC.
8218
9efe6174
ILT
8219 * sparc.cc (class Target_sparc): Add has_got_section.
8220 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8221 make sure we have a GOT section.
8222
8223 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8224 (Target_sparc::Scan::local): Likewise.
8225 (Target_sparc::Scan::global): Likewise.
8226 (Target_sparc::Relocate::relocate): Likewise.
8227 (Target_sparc::Relocate::relocate_tls): Likewise.
8228
8c500701
ILT
8229 * symtab.cc (Symbol_table::define_default_version): New function,
8230 broken out of add_from_object.
8231 (Symbol_table::add_from_object): Call define_default_version.
8232 (Symbol_table::define_special_symbol): Add resolve_oldsym
8233 parameter. Change all callers. If the version for a symbol comes
8234 from a version script, resolve it with the symbol with the same
8235 name with no version. Also add the symbol without a version if
8236 appropriate.
8237 (do_define_in_output_data): If resolving with oldsym, don't delete
8238 sym.
8239 (do_define_in_output_segment): Likewise.
8240 (do_define_as_constant): Likewise.
8241 * symtab.h (class Symbol_table): Update declarations.
8242
f1ed28fb
ILT
82432009-03-13 Ian Lance Taylor <iant@google.com>
8244
15f8229b
ILT
8245 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8246 (Read_symbols::requeue): New function.
8247 (Read_symbols::do_read_symbols): If make_elf_object fails because
8248 the target type is not configured, and the file was searched for,
8249 issue a warning and retry with the next directory.
8250 (Add_symbols::run): If the file has an incompatible format, and
8251 it was searched for, requeue the Read_symbols task. On error,
8252 release the object.
8253 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8254 dirindex parameter to constructor. Change all callers. Declare
8255 incompatible_warning and requeue.
8256 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8257 input_argument_ and input_group_ fields. Add them to
8258 constructor. Change all callers.
8259 (class Read_script): Add dirindex_ field. Add it to constructor.
8260 Change all callers.
8261 * archive.cc (Archive::setup): Remove input_objects parameter.
8262 Change all callers.
8263 (Archive::get_file_and_offset): Likewise.
8264 (Archive::read_all_symbols): Likewise.
8265 (Archive::read_symbols): Likewise.
8266 (Archive::get_elf_object_for_member): Remove input_objects
8267 parameter. Add punconfigured parameter. Change all callers.
8268 (Archive::add_symbols): Change return type to bool. Check return
8269 value of include_member.
8270 (Archive::include_all_members): Likewise.
8271 (Archive::include_member): Change return type to bool. Return
8272 false if first included object has incompatible target. Set
8273 included_member_ field.
8274 (Add_archive_symbols::run): If add_symbols returns false, requeue
8275 Read_symbols task.
8276 * archive.h (class Archive): Add included_member_ field.
8277 Initialize it in constructor. Add input_file and searched_for
8278 methods. Update declarations.
8279 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8280 input_argument_ fields. Add them to constructor. Change all
8281 callers.
8282 * script.cc: Include "target-select.h".
8283 (class Parser_closure): Add skip_on_incompatible_target_ and
8284 found_incompatible_target_ fields. Add
8285 skip_on_incompatible_target parameter to constructor. Change all
8286 callers. Add methods skip_on_incompatible_target,
8287 clear_skip_on_incompatible_target, found_incompatible_target, and
8288 set_found_incompatible_target.
8289 (read_input_script): Add dirindex parameter. Change all callers.
8290 If parser finds an incompatible target, requeue Read_symbols
8291 task.
8292 (script_set_symbol): Clear skip_on_incompatible_target in
8293 closure.
8294 (script_add_assertion, script_parse_option): Likewise.
8295 (script_start_sections, script_add_phdr): Likewise.
8296 (script_check_output_format): New function.
8297 * script.h (read_input_script): Update declaration.
8298 * script-c.h (script_check_output_format): Declare.
8299 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8300 (ignore_cmd): Remove OUTPUT_FORMAT.
8301 * fileread.cc (Input_file::Input_file): Add explicit this.
8302 (Input_file::will_search_for): New function.
8303 (Input_file::open): Add pindex parameter. Change all callers.
8304 * fileread.h (class Input_file): Add input_file_argument method.
8305 Declare will_search_for. Update declarations.
8306 * object.cc (make_elf_object): Add punconfigured parameter.
8307 Change all callers.
8308 * object.h (class Object): Make input_file public. Add
8309 searched_for method.
8310 (make_elf_object): Update declaration.
8311 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8312 restart search.
8313 * dirsearch.h (class Dirsearch): Update declaration.
8314 * options.h (class General_options): Add --warn-search-mismatch.
8315 * parameters.cc (Parameters::is_compatible_target): New function.
8316 * parameters.h (class Parameters): Declare is_compatible_target.
8317 * workqueue.cc (Workqueue::add_blocker): New function.
8318 * workqueue.h (class Workqueue): Declare add_blocker.
8319
f1ed28fb
ILT
8320 * fileread.cc (Input_file::open): Remove options parameter.
8321 Change all callers.
8322 (Input_file::open_binary): Likewise.
8323 * script.cc (read_input_script): Likewise.
8324 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8325 options parameter from constructor. Change all callers.
8326 (class Read_script): Likewise.
8327 * fileread.h (class Input_file): Update declarations.
8328 * script.h (read_input_script): Update declaration.
8329
34dd024a
NC
83302009-03-10 Nick Clifton <nickc@redhat.com>
8331
8332 * po/es.po: New Spanish translation.
8333
6d71b17c
CC
83342009-03-06 Cary Coutant <ccoutant@google.com>
8335
8336 * options.cc (parse_short_option): Keep dash_z from registering itself.
8337
031cdbed
ILT
83382009-03-03 Ian Lance Taylor <iant@google.com>
8339
8340 PR 9918
8341 * target-reloc.h (relocate_section): Pass output_section to
8342 relocate.
8343 * i386.cc (Target_i386::should_apply_static_reloc): Add
8344 output_section parameter. Change all callers.
8345 (Target_i386::Relocate::relocate): Add output_section parameter.
8346 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8347 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8348 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8349 * testsuite/two_file_shared.sh: New script.
8350 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8351 (check_DATA): Add two_file_shared.dbg.
8352 (two_file_shared.dbg): New target.
8353 * testsuite/Makefile.in: Rebuild.
8354
15d5fa16
ILT
83552009-03-01 Ian Lance Taylor <iant@google.com>
8356
8357 * configure.ac: Check for byteswap.h.
8358 * configure: Rebuild.
8359 * config.in: Rebuild.
8360
8a4c0b0d
ILT
83612009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8362
8363 * layout.cc (Layout::find_or_add_kept_section): New function.
8364 (Layout::add_comdat): Removed.
8365 * layout.h (struct Kept_section): Move out of class Layout.
8366 Remove trailing underscores from field names. Add group_sections
8367 field. Rename group_ field to is_group. Change all uses.
8368 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8369 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8370 comdat_groups_ field.
8371 (Sized_relobj::include_section_group): Use
8372 find_or_add_kept_section and Kept_section::group_sections.
8373 (Sized_relobj::include_linkonce_section): Likewise.
8374 * object.cc (class Sized_relobj): Don't define Comdat_group or
8375 Comdat_group_table. Remove find_comdat_group and
8376 add_comdat_group. Remove comdat_groups_ field.
8377 * plugin.cc (include_comdat_group): Use
8378 Layout::find_or_add_kept_section.
8379
b4ecf66b
ILT
83802009-02-28 Ian Lance Taylor <iant@google.com>
8381
14359ca0
ILT
8382 * README: --gc-sections and map files are now supported. Document
8383 some build requirements.
8384
b4ecf66b
ILT
8385 PR 6992
8386 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8387 relocatable link set the value of the section symbol to zero.
8388 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8389 relocatable link don't include the section address in the local
8390 symbol value.
8391
0602e05a
ILT
83922009-02-27 Ian Lance Taylor <iant@google.com>
8393
fd9d194f
ILT
8394 PR 6811
8395 * options.h (class Search_directory): Add is_system_directory.
8396 (class General_options): Declare is_in_system_directory.
8397 * options.cc (get_relative_sysroot): Make static.
8398 (get_default_sysroot): Make static.
8399 (General_optoins::is_in_system_directory): New function.
8400 * fileread.cc (Input_file::is_in_system_directory): New function.
8401 * fileread.h (class Input_file): Declare is_in_system_directory.
8402 * object.h (class Object): Add is_in_system_directory.
8403 (class Input_objects): Remove system_library_directory_ field.
8404 * object.cc (Input_objects::add_object): Don't set
8405 system_library_directory_.
8406 (input_objects::found_in_system_library_directory): Remove.
8407 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8408 parameter. Change all callers.
8409 (Symbol_table::sized_write_globals): Likewise.
8410 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8411 Call Object::is_in_system_directory.
8412 * symtab.h (class Symbol_table): Update declarations.
8413
61edd21f
ILT
8414 PR 5990
8415 * descriptors.h (Open_descriptor): Add is_on_stack field.
8416 * descriptors.cc (Descriptors::open): If the descriptor is on the
8417 top of the stack, remove it. Initialize is_on_stack field.
8418 (Descriptors::release): Only add pod to stack if it is not on the
8419 stack already.
8420 (Descriptors::close_some_descriptor): Clear stack_next and
8421 is_on_stack fields.
8422
e29e076a
ILT
8423 PR 7091
8424 * output.cc (Output_section::find_starting_output_address): Rename
8425 from starting_output_address; add PADDR parameter; change return
8426 type.
8427 * output.h (class Output_section): Declare
8428 find_starting_output_address instead of starting_output_address.
8429 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8430 section symbol for which we can't find a merge section.
8431
0602e05a
ILT
8432 PR 9836
8433 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8434 hidden or internal, force the symbol to be local.
8435 * resolve.cc (Symbol::override_visibility): Define.
8436 (Symbol::override_base): Use override_visibility.
8437 (Symbol_table::resolve): Likewise.
8438 (Symbol::override_base_with_special): Likewise.
8439 (Symbol_table::override_with_special): If the visibility is hidden
8440 or internal, force the symbol to be local.
8441 * symtab.h (class Symbol): Add set_visibility and
8442 override_visibility.
8443 * testsuite/ver_test_1.sh: New file.
8444 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8445 (check_DATA): Add ver_test_1.syms.
8446 (ver_test_1.syms): New target.
8447 * testsuite/Makefile.in: Rebuild.
8448
401a9a73
CC
84492009-02-25 Cary Coutant <ccoutant@google.com>
8450
8451 * layout.cc (Layout::choose_output_section): Don't rename sections
8452 when using a linker script that has a SECTIONS clause.
8453 * Makefile.in: Regenerate.
8454
8455 * testsuite/Makefile.am (script_test_5.sh): New test case.
8456 * testsuite/Makefile.in: Regenerate.
8457 * testsuite/script_test_5.cc: New file.
8458 * testsuite/script_test_5.sh: New file.
8459 * testsuite/script_test_5.t: New file.
8460
f488e4b0
CC
84612009-02-13 Rafael Avila de Espindola <espindola@google.com>
8462
8463 * archive.cc (Archive::include_member): Update calls to add_symbols.
8464 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8465 the Layout argument.
8466 * dynobj.h (do_add_symbols): Add the Layout argument.
8467 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8468 Layout argument.
8469 * object.h (Object::add_symbols): Add the Layout argument.
8470 (Object::do_add_symbols): Add the Layout argument.
8471 (Sized_relobj::do_add_symbols): Add the Layout argument.
8472 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8473 Unify the two versions.
8474 (Add_plugin_symbols): Remove.
8475 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8476 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8477 (Add_plugin_symbols): Remove.
8478 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8479 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8480 (Add_symbols::run): Make it work with Pulginobj.
8481
89dd1680
ILT
84822009-02-06 Ian Lance Taylor <iant@google.com>
8483
8484 * object.cc (Sized_relobj::do_layout): Make info message start
8485 with lower case letter.
8486
266d0a74
ILT
84872009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8488
602b464e
ILT
8489 * binary.cc: Fix file comment.
8490
266d0a74
ILT
8491 * options.h (enum Incremental_disposition): Define.
8492 (class General_options): Add new options: --incremental,
8493 --incremental_changed, --incremental_unchanged,
8494 --incremental_unknown. Add incremental_disposition_ and
8495 implicit_incremental_ fields.
8496 (General_options::incremental_disposition): New function.
8497 (class Position_dependent_options): Add incremental_disposition
8498 option.
8499 (Position_dependent_options::copy_from_options): Set incremental
8500 dispositions.
8501 * options.cc (General_options::parse_incremental_changed): New
8502 function.
8503 (General_options::parse_incremental_unchanged): New function.
8504 (General_options::parse_incremental_unknown): New function.
8505 (General_options::General_options): Initialize new fields
8506 incremental_disposition_ and implicit_incremental_.
8507 (General_options::finalize): Check for uasge of --incremental-*
8508 without --incremental.
8509
f073bbf7
CD
85102009-02-06 Chris Demetriou <cgd@google.com>
8511
8512 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8513 pointer and to report location as the file name associated with
8514 the symbol.
8515 (gold_undefined_symbol_at_location): New function to replace the
8516 old gold_undefined_symbol functionality.
8517 * target-reloc.h (relocate_section): Update to use
8518 gold_undefined_symbol_at_location.
8519 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8520 Call gold_undefined_symbol function rather than gold_error.
8521 * errors.h (Errors::undefined_symbol): Take location as a
8522 string, rather than calculating it from a relocation.
8523 * errors.cc (Errors::fatal): Print "fatal error:" before the
8524 formatted message.
8525 (Errors::error, Errors::error_at_location): Print "error: "
8526 before the formatted message.
8527 (Errors::undefined_symbol): Take location as a string, rather
8528 than calculating it from a relocation.
8529 (gold_undefined_symbol_at_location): New function akin to
8530 old gold_undefined_symbol, calculates location from relocation.
8531 (gold_undefined_symbol): Change to take only a Symbol pointer
8532 and to report location as the file name associated with the symbol.
8533 * testsuite/debug_msg.sh: Update for changed error messages.
8534 * testsuite/undef_symbol.sh: Likewise.
8535
8e94a90c
ILT
85362009-02-04 Duncan Sands <baldrick@free.fr>
8537
8538 PR 9812
8539 * reduced_debug_output.h
8540 (Output_reduced_debug_abbrev_section::failed): Use format for
8541 gold_warning.
8542 (Output_reduced_debug_info_section::faild): Likewise.
8543
88a0e15b
ILT
85442009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8545
8546 * script.cc (Lazy_demangler): New class.
8547 (Version_script_info::get_symbol_version_helper): Demangle a
8548 symbol only once.
8549
5efc7cd2
CC
85502009-01-29 Cary Coutant <ccoutant@google.com>
8551
8552 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8553 to __tls_get_addr.
8554 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8555
e0ebcf42
ILT
85562009-01-28 Ian Lance Taylor <iant@google.com>
8557
5efc7cd2 8558 * version.cc (version_string): Bump to 1.9.
75fe7426 8559
e0ebcf42
ILT
8560 * gold.h: Include <cstring> and <stdint.h>.
8561 * version.cc: Include <cstdio>.
8562 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8563 warning.
8564 * reduced_debug_output.cc (insert_into_vector): Rename from
8565 Insert_into_vector; change all callers. Use Swap_unaligned to
8566 avoid aliasing issue; remove union since it is unnecessary.
8567
8e2813be 85682009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8569
8570 * Makefile.am (CCFILES): Add gc.cc.
8571 (HFILES): Add gc.h.
8572 * Makefile.in: Regenerate.
8573 * gold.cc (Gc_runner): New class.
8574 (queue_initial_tasks): Call garbage collection related tasks
8575 when corresponding options are invoked.
8576 (queue_middle_gc_tasks): New function.
8577 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8578 processed early before laying out sections during garbage collection.
8579 * gold.h (queue_middle_gc_tasks): New function.
8580 (is_prefix_of): Move from "layout.cc".
8581 * i386.cc (Target_i386::gc_process_relocs): New function.
8582 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8583 * main.cc (main): Create object of class "Garbage_collection".
8584 * object.cc (Relobj::copy_symbols_data): New function.
8585 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8586 (Sized_relobj::do_layout): Allow this function to be called twice
8587 during garbage collection and defer layout of section during the
6d03d481
ST
8588 first call.
8589 * object.h (Relobj::get_symbols_data): New function.
8590 (Relobj::is_section_name_included): New function.
8591 (Relobj::copy_symbols_data): New function.
8592 (Relobj::set_symbols_data): New function.
8593 (Relobj::get_relocs_data): New function.
8594 (Relobj::set_relocs_data): New function.
8595 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8596 (Relobj::gc_process_relocs): New function.
8597 (Relobj::do_gc_process_relocs): New pure virtual function.
8598 (Relobj::sd_): New data member.
8599 (Sized_relobj::is_output_section_offset_invalid): New function.
8600 (Sized_relobj::do_gc_process_relocs): New function.
8601 * options.h (General_options::gc_sections): Modify to not be a no-op.
8602 (General_options::print_gc_sections): New option.
8603 * plugin.cc (Plugin_finish::run): Remove function call to
8604 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8605 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8606 * reloc.cc (Read_relocs::run): Add task to process relocs and
8607 determine unreferenced sections when doing garbage collection.
8608 (Gc_process_relocs): New class.
8609 (Sized_relobj::do_gc_process_relocs): New function.
8610 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8611 sections that are garbage collected.
8612 * reloc.h (Gc_process_relocs): New class.
8613 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8614 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8615 symbols whose corresponding sections are garbage collected.
8616 (Symbol_table::Symbol_table): Add new parameter for the garbage
8617 collection object.
8618 (Symbol_table::gc_mark_undef_symbols): New function.
8619 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8620 (Symbol_table::gc_mark_dyn_syms): New function.
8621 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8622 as garbage.
8623 (Symbol_table::add_from_object): Likewise.
8624 (Symbol_table::add_from_relobj): When building shared objects, do not
8625 treat externally visible symbols as garbage.
8626 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8627 table information for static and relocatable links.
8628 * symtab.h (Symbol_table::set_gc): New function.
8629 (Symbol_table::gc): New function.
8630 (Symbol_table::gc_mark_undef_symbols): New function.
8631 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8632 (Symbol_table::gc_mark_dyn_syms): New function.
8633 (Symbol_table::gc_): New data member.
e1df38aa 8634 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8635 function.
8636 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8637 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8638
3b293544
CF
86392009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8640
8641 * options.h (General_options::gc_sections): Define as a no-op for now.
8642 (General_options::no_keep_memory): Ditto.
8643 (General_options::Bshareable): Define.
8644 * options.cc (General_options::finalize): Honor -Bshareable.
8645
83d22aa8
AS
86462009-01-20 Andreas Schwab <schwab@suse.de>
8647
8648 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8649 read the value in the contents, since we don't use it. Use the
8650 template endianness when writing.
8651 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8652
cd536b21
AS
86532009-01-19 Andreas Schwab <schwab@suse.de>
8654
8655 * configure.tgt (powerpc64-*): Fix targ_obj.
8656
99e9a495
ILT
86572009-01-15 Ian Lance Taylor <iant@google.com>
8658
8659 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8660 local symbols when stripping all symbols.
8661
bbbfea06
CC
86622009-01-14 Cary Coutant <ccoutant@google.com>
8663
99e9a495 8664 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8665
0f7c0701
CC
86662009-01-14 Cary Coutant <ccoutant@google.com>
8667
8668 * archive.cc (Archive::get_elf_object_for_member): Remove call
8669 to File_read::claim_for_plugin.
8670 * descriptors.cc (Descriptors::open): Remove reference to
8671 is_claimed.
8672 (Descriptors::claim_for_plugin): Remove.
8673 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8674 (Descriptors::is_claimed): Remove.
8675 (claim_descriptor_for_plugin): Remove.
8676 * fileread.cc (File_read::claim_for_plugin): Remove.
8677 * fileread.h (File_read::claim_for_plugin): Remove.
8678 (File_read::descriptor): Reopen descriptor if necessary.
8679 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8680 (Plugin_manager::all_symbols_read): Add task parameter. Change
8681 all callers.
8682 (Plugin_manager::get_input_file): New function.
8683 (Plugin_manager::release_input_file): New function.
8684 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8685 corresponding data member.
8686 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8687 and pass to base constructor. Change all callers.
8688 (get_input_file, release_input_file): New functions.
8689 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8690 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8691 (Plugin_manager::all_symbols_read): Add task parameter.
8692 (Plugin_manager::get_input_file): New function.
8693 (Plugin_manager::release_input_file): New function.
8694 (Plugin_manager::task_): New data member.
8695 (Pluginobj::Pluginobj): Add filesize parameter.
8696 (Pluginobj::filename): New function.
8697 (Pluginobj::descriptor): New function.
8698 (Pluginobj::filesize): New function.
8699 (Pluginobj::filesize_): New data member.
8700 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8701 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8702 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8703
8704 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8705 with archive libraries.
8706 * testsuite/Makefile.in: Regenerate.
8707 * testsuite/plugin_test.c (struct sym_info): New type.
8708 (get_input_file, release_input_file): New static variables.
8709 (onload): Capture new transfer vector entries.
8710 (claim_file_hook): Stop reading at end of file according to filesize.
8711 Factor out parsing of readelf output into separate function.
8712 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8713 APIs and get the source file name from the symbol table. Convert
8714 source file name to corresponding object file name. Print info
8715 message when adding new input files.
8716 (parse_readelf_line): New function.
8717 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8718 * testsuite/plugin_test_2.sh: Likewise.
8719 * testsuite/plugin_test_3.sh: Likewise.
8720 * testsuite/plugin_test_4.sh: New test case.
8721
62a6d109
ILT
87222009-01-07 Ian Lance Taylor <iant@google.com>
8723
8724 * version.cc (version_string): Bump to 1.8.
8725
483620e8
CC
87262008-12-23 Cary Coutant <ccoutant@google.com>
8727
8728 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8729 * plugin.cc (Plugin_manager::finish): Rename as
8730 layout_deferred_objects. Move cleanup to separate function.
8731 (Plugin_manager::cleanup): New function.
8732 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8733 separately.
8734 * plugin.h (Plugin_manager::finish): Rename as
8735 layout_deferred_objects.
8736 (Plugin_manager::cleanup): New function.
8737 (Plugin_manager::cleanup_done): New field.
8738
d66a9eb3
CC
87392008-12-23 Cary Coutant <ccoutant@google.com>
8740
8741 * plugin.cc (is_visible_from_outside): New function.
8742 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8743 so we don't return "IR only" status for exported symbols or -r links.
8744
8745 * testsuite/Makefile.am (plugin_test_3): New test case.
8746 * testsuite/Makefile.in: Regenerate.
8747 * testsuite/plugin_test_3.sh: New file.
8748
5995b570
CC
87492008-12-22 Cary Coutant <ccoutant@google.com>
8750
8751 * object.cc (Sized_relobj::layout_section): New function.
8752 (Sized_relobj::do_layout): Defer layout of input sections until after
8753 plugin has provided replacement files.
8754 (Sized_relobj::do_layout_deferred_sections): New function.
8755 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8756 (Relobj::layout_deferred_sections): New function.
8757 (Relobj::do_layout_deferred_sections): New function.
8758 (Sized_relobj::do_layout_deferred_sections): New function.
8759 (Sized_relobj::layout_section): New function.
8760 (Sized_relobj::Deferred_layout): New structure.
8761 (Sized_relobj::deferred_layout_): New field.
8762 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8763 Change all callers. Layout deferred sections.
8764 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8765 references.
8766 (Plugin_hook::run): Move code from do_plugin_hook inline.
8767 (Plugin_hook::do_plugin_hook): Remove.
8768 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8769 (Plugin_manager::finish): Renamed, was cleanup.
8770 (Plugin_manager::should_defer_layout): New function.
8771 (Plugin_manager::add_deferred_layout_object): New function.
8772 (Plugin_manager::Deferred_layout_list): New type.
8773 (Plugin_manager::deferred_layout_objects_): New field.
8774 (Plugin_hook::do_plugin_hook): Remove.
8775
ee769c88
ILT
87762008-12-17 Ian Lance Taylor <iant@google.com>
8777
8778 * options.h (class General_options): Add --no case for
8779 --export-dynamic.
8780
abc8dcba
CC
87812008-12-16 Cary Coutant <ccoutant@google.com>
8782
8783 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8784 vector.
8785 (Plugin_manager::claim_file): Create plugin object even if
8786 plugin did not call the add_symbols callback.
8787 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8788 asking for more symbols than were added.
8789 * testsuite/Makefile.am (plugin_test_1): Add test case with
8790 no global symbols.
8791 (empty.syms): New target.
8792 * testsuite/Makefile.in: Regenerate.
8793 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8794 message. Don't call add_symbols if no globals.
8795 (all_symbols_read_hook): Don't provide replacement for empty
8796 claimed file.
8797
b0074644
ILT
87982008-12-12 Ian Lance Taylor <iant@google.com>
8799
68943102
ILT
8800 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8801 r_type == 0 for a local symbol with r_sym == 0.
8802 (scan_relocatable_relocs): Pass r_sym to
8803 local_non_section_strategy.
8804 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8805 r_sym parameter.
8806
b0074644
ILT
8807 * configure.ac: Update test for TLS descriptors: they are
8808 supported as of glibc 2.9.
8809 * configure: Rebuild.
8810
c2508178
ILT
88112008-12-11 Ian Lance Taylor <iant@google.com>
8812
8813 PR 7091
8814 * target-reloc.h (Default_scan_relocatable_relocs): For each
8815 function, map r_type == 0 to RELOC_DISCARD.
8816
2756a258
CC
88172008-12-10 Cary Coutant <ccoutant@google.com>
8818
8819 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8820 object to override a kept COMDAT group from a plugin object.
8821
bb6f53d3
ILT
88222008-12-09 Ian Lance Taylor <iant@google.com>
8823
fbc558e1
ILT
8824 PR 7088
8825 * yyscript.y (file_cmd): Handle INPUT.
8826
bb6f53d3
ILT
8827 * testsuite/initpri1.c: Change all declarations to be full
8828 prototypes by adding void, to avoid compiler warnings.
8829
4674ecfc
CC
88302008-12-05 Rafael Avila de Espindola <espindola@google.com>
8831
8832 * options.cc (General_options::parse_plugin_opt): New.
8833 (General_options::add_plugin): The argument now is just the filename.
8834 (General_options::add_plugin_option): New.
8835 * options.h (plugin_opt): New.
8836 (add_plugin): Change argument name.
8837 (add_plugin_option): New.
8838 * plugin.cc (Plugin::load): Don't parse the plugin option.
8839 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8840 (Plugin::add_option): New.
8841 (Plugin::args_): Change type.
8842 (Plugin::filename_): New.
8843 (Plugin_manager::add_plugin_option): New.
8844 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8845 * testsuite/Makefile.in: Regenerate.
8846
fd06b4aa
CC
88472008-12-05 Cary Coutant <ccoutant@google.com>
8848
8849 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8850 Handle --strip-lto-sections option.
8851 * options.h (strip_lto_sections): New option.
8852
6c52134c
CC
88532008-12-01 Cary Coutant <ccoutant@google.com>
8854
8855 * plugin.cc (ld_plugin_message): Change format parameter to const.
8856 Fix mismatch between new[] and delete.
8857
a45248e0
CC
88582008-11-14 Cary Coutant <ccoutant@google.com>
8859
8860 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8861 instead of -1U.
8862
c82fbeee
CS
88632008-11-05 Craig Silverstein <csilvers@google.com>
8864
8865 * options.cc (General_options::parse_dynamic_list): New function.
8866 * options.h (General_options): New flags dynamic_list,
8867 dynamic_list_data, dynamic_list_cpp_new, and
8868 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8869 (General_options::in_dynamic_list): New function.
8870 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8871 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8872 (Lex::can_continue_name): Likewise.
8873 (yylex): Likewise.
8874 (read_script_file): New parameter script_options.
8875 (read_dynamic_list): New function.
8876 (Script_options::define_dynamic_list): New function.
8877 (dynamic_list_keyword_parsecodes): New variable.
8878 (dynamic_list_keywords): New variable.
8879 * script.h (Script_options::define_dynamic_list): New function
8880 prototype.
8881 (read_dynamic_list): New function prototype.
8882 * symtab.cc (strprefix): New macro.
8883 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8884 dynamic_list_data, dynamic_list_cpp_new, and
8885 dynamic_list_cpp_typeinfo.
8886 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8887 (dynamic_list_expr): New rule.
8888 (dynamic_list_nodes): Likewise.
8889 (dynamic_list_node): Likewise.
8890 * testsuite/Makefile.am (dynamic_list): New test.
8891 * testsuite/Makefile.in: Regenerated.
8892 * testsuite/dynamic_list.t: New file.
8893 * testsuite/dynamic_list.sh: New file.
8894
e0bb29a5
CS
88952008-11-05 Craig Silverstein <csilvers@google.com>
8896
8897 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8898 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8899 (t11_last): Likewise.
8900 * testsuite/ver_test_6.c (main): Likewise.
8901
4e1e25e0
CC
89022008-10-07 Cary Coutant <ccoutant@google.com>
8903
8904 * options.c (General_options::finalize): Add check for -static and
8905 -shared.
8906 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8907 is not empty.
8908
92f03fcb
CC
89092008-10-02 Cary Coutant <ccoutant@google.com>
8910
8911 * plugin.cc (make_sized_plugin_object): Fix conditional
8912 compilation to work when not all targets are enabled.
8913
fbd8a257
CC
89142008-09-29 Cary Coutant <ccoutant@google.com>
8915
8916 * archive.cc (Archive::get_file_and_offset): Use filename instead
8917 of name to get library path.
8918 (Archive::include_member): Unlock external member of a thin archive.
8919
8920 * testsuite/Makefile.am (TEST_AR): New variable.
8921 (thin_archive_test_1): New test.
8922 (thin_archive_test_2): New test.
81636b3f
CC
8923 * testsuite/Makefile.in: Regenerate.
8924 * testsuite/thin_archive_main.cc: New file.
8925 * testsuite/thin_archive_test_1.cc: New file.
8926 * testsuite/thin_archive_test_2.cc: New file.
8927 * testsuite/thin_archive_test_3.cc: New file.
8928 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8929
eff45813
CC
89302008-09-29 Cary Coutant <ccoutant@google.com>
8931
8932 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8933 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8934 instead of -1U.
8935 (Sized_relobj::do_finalize_local_symbols): Likewise.
8936 (Sized_relobj::map_to_kept_section): Likewise.
8937 * object.h (Sized_relobj::invalid_address): New constant.
8938 (Sized_relobj::do_output_section_offset): Check for invalid_address
8939 and return -1ULL.
8940 * output.cc (Output_reloc::local_section_offset): Use constant
8941 invalid_address instead of -1U.
8942 (Output_reloc::get_address): Likewise.
8943 (Output_section::output_address): Change -1U to -1ULL.
8944 * output.h (Output_reloc::invalid_address): New constant.
8945 * reloc.cc (Sized_relobj::write_sections): Use constant
8946 invalid_address instead of -1U.
8947 (Sized_relobj::relocate_sections): Likewise.
8948 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8949 values for merge sections.
8950 * target-reloc.h (relocate_for_relocatable): Use constant
8951 invalid_address instead of -1U.
8952
89fc3421
CC
89532008-09-19 Cary Coutant <ccoutant@google.com>
8954
8955 Add plugin functionality for link-time optimization (LTO).
8956 * configure.ac (plugins): Add --enable-plugins option.
8957 * configure: Regenerate.
8958 * config.in: Regenerate.
8959 * Makefile.am (LIBDL): New variable.
8960 (CCFILES): Add plugin.cc.
8961 (HFILES): Add plugin.h.
8962 (ldadd_var): Add LIBDL.
8963 * Makefile.in: Regenerate.
8964
8965 * archive.cc: Include "plugin.h".
8966 (Archive::setup): Don't preread archive symbols when using a plugin.
8967 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8968 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8969 files.
8970 (Archive::include_member): Add symbols from plugin objects.
8971 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8972 * descriptors.cc (Descriptors::open): Check for file descriptors
8973 abandoned by plugins.
8974 (Descriptors::claim_for_plugin): New function.
8975 * descriptors.h (Descriptors::claim_for_plugin): New function.
8976 (Open_descriptor::is_claimed): New field.
8977 (claim_descriptor_for_plugin): New function.
8978 * fileread.cc (File_read::claim_for_plugin): New function.
8979 * fileread.h (File_read::claim_for_plugin): New function.
8980 (File_read::descriptor): New function.
8981 * gold.cc: Include "plugin.h".
8982 (queue_initial_tasks): Add task to call plugin hooks for generating
8983 new object files.
8984 * main.cc: Include "plugin.h".
8985 (main): Load plugin libraries.
8986 * object.h (Pluginobj): Declare.
8987 (Object::pluginobj): New function.
8988 (Object::do_pluginobj): New function.
8989 (Object::set_target): New function.
8990 * options.cc: Include "plugin.h".
8991 (General_options::parse_plugin): New function.
8992 (General_options::General_options): Initialize plugins_ field.
8993 (General_options::add_plugin): New function.
8994 * options.h (Plugin_manager): Declare.
8995 (General_options): Add --plugin option.
8996 (General_options::has_plugins): New function.
8997 (General_options::plugins): New function.
8998 (General_options::add_plugin): New function.
8999 (General_options::plugins_): New field.
9000 * plugin.cc: New file.
9001 * plugin.h: New file.
9002 * readsyms.cc: Include "plugin.h".
9003 (Read_symbols::do_read_symbols): Check for archive before checking
9004 for ELF file. Call plugin hooks to claim files.
9005 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9006 from a real object file; force override when processing replacement
9007 files.
9008 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9009 (Symbol::init_base_object): Likewise.
9010 (Symbol::init_base_output_data): Likewise.
9011 (Symbol::init_base_output_segment): Likewise.
9012 (Symbol::init_base_constant): Likewise.
9013 (Symbol::init_base_undefined): Likewise.
9014 (Symbol::output_section): Assert that object is not a plugin.
9015 (Symbol_table::add_from_pluginobj): New function.
9016 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9017 undefined.
9018 (Symbol_table::sized_write_globals): Likewise.
9019 (Symbol_table::add_from_pluginobj): Instantiate template.
9020 * symtab.h (Sized_pluginobj): Declare.
9021 (Symbol::in_real_elf): New function.
9022 (Symbol::set_in_real_elf): New function.
9023 (Symbol::in_real_elf_): New field.
9024 (Symbol_table::add_from_pluginobj): New function.
9025
9026 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9027 (LIBDL): New variable.
9028 (LDADD): Add LIBDL.
9029 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9030 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9031 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9032 (MOSTLYCLEANFILES): Likewise.
9033 * testsuite/Makefile.in: Regenerate.
9034 * testsuite/plugin_test.c: New file.
9035 * testsuite/plugin_test_1.sh: New file.
9036 * testsuite/plugin_test_2.sh: New file.
9037
de31bda5
ILT
90382008-09-16 Ian Lance Taylor <iant@google.com>
9039
9c2d0ef9
ILT
9040 * target-reloc.h (relocate_section): Check whether a symbol is
9041 defined by the ABI before reporting an undefined symbol error.
9042 * target.h (Target::is_defined_by_abi): Make parameter const.
9043 (Target::do_is_defined_by_abi): Likewise.
9044 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9045 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9046 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9047 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9048 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9049 * testsuite/Makefile.in: Rebuild.
9050
de31bda5
ILT
9051 * fileread.cc (make_view): Add casts to avoid warning.
9052
9fa33bee
AO
90532008-09-16 Alexandre Oliva <aoliva@redhat.com>
9054
9055 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9056 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9057
183fd0e3
AO
90582008-09-16 Alexandre Oliva <aoliva@redhat.com>
9059
9060 * options.h (General_options::output_is_executable): New.
9061 (General_options::output_is_pie): New.
9062 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9063 for shared libraries.
9064 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9065
7be8330a
CD
90662008-09-11 Chris Demetriou <cgd@google.com>
9067
9068 * options.h (origin): New -z option.
9069 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9070 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9071 in DT_FLAGS_1.
9072
a9caad02
CC
90732008-09-05 Cary Coutant <ccoutant@google.com>
9074
9075 * fileread.cc (File_read::make_view): Add check for attempt to map
9076 beyond end of file.
9077
ae6dce4d
CC
90782008-09-05 Cary Coutant <ccoutant@google.com>
9079
9080 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9081 explicit instantiations.
9082
d7ab2a47
KVH
90832008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9084
9085 PR gold/6858
9086 * options.cc (General_options::finalize): Allow undefined symbols
9087 in shlibs if linking -shared.
9088
9089 PR gold/6859
9090 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9091 symbols as not needing a dynsym entry.
9092
1e52a9c1
CS
90932008-08-20 Craig Silverstein <csilvers@google.com>
9094
9095 * fileread.cc (File_read::open): Do not lock the file unless it
9096 was successfully opened.
9097
d85c80a3
CC
90982008-08-14 Cary Coutant <ccoutant@google.com>
9099
9100 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9101 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9102 * testsuite/tls_test.cc (struct int128): 128-bit struct
9103 for testing TLS relocs with non-zero addend.
9104 (v12): New TLS variable.
9105 (t12): New test.
9106 (t_last): Add check for v12.
9107 * testsuite/tls_test.h (t12): New function.
9108 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9109
2d924fd9
ILT
91102008-08-13 Ian Lance Taylor <iant@google.com>
9111
9112 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9113 set tls_segment_ or relro_segment_.
9114 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9115 when appropriate.
9116 * output.h (Output_section::clear_is_relro): New function.
9117 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9118 sections specially even when output_data_ is empty.
9119 (Output_segment::maximum_alignment): When first section is relro,
9120 only force alignment for PT_LOAD segments.
9121 * script.cc (script_data_segment_align): New function.
9122 (script_data_segment_relro_end): New function.
9123 * script-c.h (script_data_segment_align): Declare.
9124 (script_data_segment_relro_end): Declare.
9125 * script-sections.h (class Script_sections): Declare
9126 data_segment_align and data_segment_relro_end. Add fields
9127 segment_align_index_ and saw_relro_end_.
9128 * script-sections.cc (class Sections_element): Add set_is_relro
9129 virtual function. Add new bool* parameter to place_orphan_here.
9130 Add get_output_section virtual function.
9131 (class Output_section_definition): Add set_is_relro. Add new
9132 bool* parameter to place_orphan_here. Add get_output_section.
9133 Add is_relro_ field.
9134 (Output_section_definition::Output_section_definition): Initialize
9135 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9136 and is_relro_ fields.
9137 (Output_section_definition::place_orphan_here): Add is_relro
9138 parameter.
9139 (Output_section_definition::set_section_addresses): Set relro for
9140 output section.
9141 (Output_section_definition::alternate_constraint): Likewise.
9142 (class Orphan_output_section): Add new bool* parameter to
9143 place_orphan_here. Add get_output_section.
9144 (Orphan_output_section::place_orphan_here): Add is_relro
9145 parameter.
9146 (Script_sections::Script_sections): Initialize
9147 data_segment_align_index_ and saw_relro_end_.
9148 (Script_sections::data_segment_align): New function.
9149 (Script_sections::data_segment_relro_end): New function.
9150 (Script_sections::place_orphan): Set or clear is_relro.
9151 (Script_sections::set_section_addresses): Force alignment of first
9152 TLS section.
9153 * yyscript.y (exp): Call script_data_segment_align and
9154 script_data_segment_relro_end.
9155 * testsuite/relro_script_test.t: New file.
9156 * testsuite/relro_test.cc (using_script): Declare.
9157 (t1, t2): Test using_script.
9158 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9159 (relro_script_test_SOURCES): Define.
9160 (relro_script_test_DEPENDENCIES): Define.
9161 (relro_script_test_LDFLAGS): Define.
9162 (relro_script_test_LDADD): Define.
9163 (relro_script_test.so): New target.
9164 * testsuite/Makefile.in: Rebuild.
9165
f827c9a9
CC
91662008-08-06 Cary Coutant <ccoutant@google.com>
9167
9168 * archive.cc (Archive::total_archives, Archive::total_members)
9169 (Archive::total_members_loaded): New variables.
9170 (Archive::setup): Add parameter. Add option to preread
9171 archive symbols.
9172 (Archive::read_armap): Add counter.
9173 (Archive::get_file_and_offset): New function.
9174 (Archive::get_elf_object_for_member): New function.
9175 (Archive::read_all_symbols): New function.
9176 (Archive::read_symbols): New function.
9177 (Archive::add_symbols): Add counters.
9178 (Archive::include_all_members): Use armap to find members if it's
9179 already built.
9180 (Archive::include_member): Skip reading symbols if already read.
9181 Factored code into Archive::get_file_and_offset and
9182 Archive::get_elf_object_for_member. Changed call to
9183 Mapfile::report_include_archive_member.
9184 (Archive::print_stats): New function.
9185 * archive.h: Declare Object and Read_symbols_data classes.
9186 (Archive::Archive): Add initializers for new members.
9187 (Archive::setup): Add parameter.
9188 (Archive::print_stats): New function.
9189 (Archive::total_archives, Archive::total_members)
9190 (Archive::total_members_loaded): New variables.
9191 (Archive::get_file_and_offset): New function.
9192 (Archive::get_elf_object_for_member): New function.
9193 (Archive::read_all_symbols): New function.
9194 (Archive::read_symbols): New function.
9195 (Archive::Archive_member): New class.
9196 (Archive::members_): New member.
9197 (Archive::num_members_): New member.
9198 * main.cc: Include archive.h.
9199 (main): Call Archive::print_stats.
9200 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9201 archive parameter; member_name is now the fully-decorated name.
9202 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9203 * options.h: (General_options): Add --preread-archive-symbols option.
9204 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9205 Archive::setup.
9206
de4c45bd
ILT
92072008-08-04 Ian Lance Taylor <iant@google.com>
9208
9209 * symtab.h (Symbol::use_plt_offset): New function.
9210 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9211 * powerpc.cc (Relocate::relocate): Likewise.
9212 * sparc.cc (Relocate::relocate): Likewise.
9213 * x86_64.cc (Relocate::relocate): Likewise.
9214 * testsuite/weak_plt.sh: New test.
9215 * testsuite/weak_plt_main.cc: New test.
9216 * testsuite/weak_plt_shared.cc: New test.
9217 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9218 (check_PROGRAMS): Add weak_plt.
9219 (check_DATA): Add weak_plt_shared.so.
9220 (weak_plt_main_pic.o, weak_plt): New targets.
9221 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9222 * testsuite/Makefile.in: Rebuild.
9223
9224 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9225 gcctestdir/ld.
9226 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9227 * testsuite/Makefile.in: Rebuild.
9228
323ee3f4
AM
92292008-08-04 Alan Modra <amodra@bigpond.net.au>
9230
9231 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9232 * Makefile.in: Regenerate.
9233 * po/POTFILES.in: Regenerate.
9234
7c07ecec
ILT
92352008-07-29 Ian Lance Taylor <iant@google.com>
9236
9237 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9238 symbols before other symbols.
9239 * testsuite/script_test_2.cc (test_addr): Declare.
9240 (test_addr_alias): Declare.
9241 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9242 values.
7c07ecec
ILT
9243 * testsuite/script_test_2.t: Define test_addr_alias and
9244 test_addr.
9245
5778530e
ILT
92462008-07-24 Ian Lance Taylor <iant@google.com>
9247
2a00e4fb
ILT
9248 PR 5990
9249 * descriptors.cc: New file.
9250 * descriptors.h: New file.
9251 * gold-threads.h (class Hold_optional_lock): New class.
9252 * fileread.cc: Include "descriptors.h".
9253 (File_read::~File_read): Release descriptor rather than closing
9254 it.
9255 (File_read::open) [file]: Call open_descriptor rather than open.
9256 Set is_descriptor_opened_.
9257 (File_read::open) [memory]: Assert that descriptor is not open.
9258 (File_read::reopen_descriptor): New function.
9259 (File_read::release): Release descriptor.
9260 (File_read::do_read): Make non-const. Reopen descriptor.
9261 (File_read::read): Make non-const.
9262 (File_read::make_view): Reopen descriptor.
9263 (File_read::do_readv): Likewise.
9264 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9265 Update declarations.
9266 * layout.cc: Include "descriptors.h".
9267 (Layout::create_build_id): Use open_descriptor rather than open.
9268 * output.cc: Include "descriptors.h".
9269 (Output_file::open): Use open_descriptor rather than open.
9270 * archive.cc (Archive::const_iterator): Change Archive to be
9271 non-const.
9272 (Archive::begin, Archive::end): Make non-const.
9273 (Archive::count_members): Likewise.
9274 * archive.h (class Archive): Update declarations.
9275 * object.h (Object::read): Make non-const.
9276 * Makefile.am (CCFILES): Add descriptors.cc.
9277 (HFILES): Add descriptors.h.
9278 * Makefile.in: Rebuild.
9279
801647d1
ILT
9280 PR 6716
9281 * gold.h: Always include <clocale>. Add Solaris workarounds
9282 following code in binutils/sysdep.h.
9283
5edd166e
ILT
9284 PR 6048
9285 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9286 this->eh_frame_hdr_ is NULL before using it.
9287
c89ad728
ILT
9288 * dynobj.cc (Versions::Versions): Update comment.
9289
aa86f06b
ILT
9290 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9291 the base version name.
9292
5778530e
ILT
9293 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9294 array size plus one.
9295 (Stringpool_template::set_string_offsets): Subtract one from key
9296 before using it as an array index.
9297 (Stringpool_template::get_offset_with_length): Likewise.
9298 (Stringpool_template::write_to_buffer): Likewise.
9299 * stringpool.h (Stringpool_template::get_offset_from_key):
9300 Likewise.
9301
057ead22
ILT
93022008-07-23 Ian Lance Taylor <iant@google.com>
9303
7f649c59
ILT
9304 PR 6658
9305 * object.h (Merged_symbol_value::value): Do our best to handle a
9306 negative addend.
9307
057ead22
ILT
9308 PR 6647
9309 * script.cc (Version_script_info::get_versions): Don't add empty
9310 version tag to return value.
9311 (Version_script_info::get_symbol_version_helper): Change return
9312 type to bool. Add pversion parameter. Change all callers.
9313 (script_register_vers_node): Don't require a non-NULL tag.
9314 * script.h (class Version_script_info): Update declarations.
9315 (Version_script_info::get_symbol_version): Change return type to
9316 bool. Add version parameter. Change all callers.
9317 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9318 handling. Handle an empty version from a version script.
9319 (Symbol_table::define_special_symbol): Likewise.
9320 * testsuite/ver_test_10.script: New file.
9321 * testsuite/ver_test_10.sh: New file.
9322 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9323 (check_DATA): Add ver_test_10.syms.
9324 (ver_test_10.syms, ver_test_10.so): New target.
9325 * testsuite/Makefile.in: Rebuild.
9326
58e54ac2
CD
93272008-07-23 Simon Baldwin <simonb@google.com>
9328
9329 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9330 to zero for undefined symbols from dynamic libraries.
9331
95d14cd3
ILT
93322008-07-23 Ian Lance Taylor <iant@google.com>
9333
9334 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9335 Change all callers.
9336 * symtab.h (class Symbol_table): Update declaration.
9337 * testsuite/ver_test_9.cc: New file.
9338 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9339 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9340 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9341 (ver_test_9.so, ver_test_9.o): New targets.
9342 * testsuite/Makefile.in: Rebuild.
9343
92de84a6
ILT
93442008-07-22 Ian Lance Taylor <iant@google.com>
9345
34810851
ILT
9346 * options.h (class General_options): Define --check-sections.
9347 * layout.cc (Layout::set_segment_offsets): Handle
9348 --check-sections.
9349
af6156ef
ILT
9350 * options.h (class General_options): Define -n/--nmagic and
9351 -N/--omagic.
9352 * options.cc (General_options::finalize): For -n/--nmagic or
9353 -N/--omagic, set -static.
9354 * layout.cc (Layout::attach_allocated_section_to_segment): If
9355 -N/--omagic, don't put read-only and read-write sections in
9356 different segments.
9357 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9358 finding a read-only segment.
9359 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9360 don't set the minimum segment alignment to the common page size,
9361 and don't set the file offset to the address modulo the page size.
9362 * script-sections.cc (Script_sections::create_segments): If
9363 -n/--omagic, don't put read-only and read-write sections in
9364 different segments.
9365
92de84a6
ILT
9366 * cref.cc: New file.
9367 * cref.h: New file.
9368 * options.h (class General_options): Add --print-symbol-counts.
9369 * main.cc (main): Issue defined symbol report if requested.
9370 * archive.cc (Archive::interpret_header): Make into a const member
9371 function.
9372 (Archive::add_symbols): Call Input_objects::archive_start and
9373 archive_stop.
9374 (Archive::const_iterator): Define new class.
9375 (Archive::begin, Archive::end): New functions.
9376 (Archive::include_all_members): Rewrite to use iterator.
9377 (Archive::count_members): New function.
9378 * archive.h (class Archive): Update declarations.
9379 (Archive::filename): New function.
9380 * object.cc: Include "cref.h".
9381 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9382 (Sized_relobj::do_get_global_symbol_counts): New function.
9383 (Input_objects::add_object): Add object to cross-referencer.
9384 (Input_objects::archive_start): New function.
9385 (Input_objects::archive_stop): New function.
9386 (Input_objects::print_symbol_counts): New function.
9387 * object.h: Declare Cref and Archive.
9388 (Object::get_global_symbol_counts): New function.
9389 (Object::do_get_global_symbol_counts): New pure virtual function.
9390 (class Sized_relobj): Add defined_count_ field. Update
9391 declarations.
9392 (class Input_objects): Add cref_ field. Update constructor.
9393 Update declarations.
9394 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9395 defined_count_.
9396 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9397 symbol counts.
9398 (Sized_dynobj::do_get_global_symbol_counts): New function.
9399 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9400 defined_count_. Update declarations. Define Symbols typedef.
9401 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9402 parameter. Change all callers.
9403 (Symbol_table::add_from_dynobj): Add sympointers and defined
9404 parameters. Change all callers.
9405 * symtab.h (class Symbol_table): Update declarations.
9406 * Makefile.am (CCFILES): Add cref.cc.
9407 (HFILES): Add cref.h.
9408 * Makefile.in: Rebuild.
9409
3f7c5e1d
CD
94102008-07-22 Simon Baldwin <simonb@google.com>
9411
9412 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9413 to zero when writing undefined symbols.
9414
e0b64032
ILT
94152008-07-22 Ian Lance Taylor <iant@google.com>
9416
9417 * output.cc (Output_section::add_input_section): Don't try to
9418 merge empty merge sections.
9419
096b02cf
CS
94202008-07-21 Craig Silverstein <csilvers@google.com>
9421
9422 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9423 Include symbol version in error message.
cd536b21 9424
1d1f116d
CD
94252008-07-20 Chris Demetriou <cgd@google.com>
9426
cd536b21 9427 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9428 (RANDOM_SEED_CFLAGS): New substituted variable.
9429 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9430 * configure: Rebuild.
9431 * Makefile.in: Likewise.
9432 * testsuite/Makefile.in: Likewise.
9433
a18f591e
ILT
94342008-07-18 Ian Lance Taylor <iant@google.com>
9435
9436 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9437 where we see NAME/NULL and NAME/VERSION as separate symbols.
9438 * testsuite/ver_test_main.cc (main): Call t4.
9439 (t4, t4_2a): Define.
9440 * testsuite/ver_test_2.cc (t4_2): Define.
9441 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9442 * testsuite/ver_test_4.cc (t4_2a): Define.
9443 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9444 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9445
c6e3f6ed
ILT
94462008-07-17 Ian Lance Taylor <iant@google.com>
9447
9448 * dynobj.cc (Versions::add_def): If we give an error about a
9449 missing version, go ahead and create the version anyhow.
9450
ef9beddf
ILT
94512008-07-10 Ian Lance Taylor <iant@google.com>
9452
9453 Handle output sections with more than 0x7fffffff bytes.
9454 * object.h (class Relobj): Change map_to_output_ to
9455 output_sections_, and just keep a section pointer. Change all
9456 uses. Move comdat group support to Sized_relobj.
9457 (Relobj::is_section_specially_mapped): Remove.
9458 (Relobj::output_section): Remove poff parameter. Change all
9459 callers.
9460 (Relobj::output_section_offset): New function.
9461 (Relobj::set_section_offset): Rewrite.
9462 (Relobj::map_to_output): Remove.
9463 (Relobj::output_sections): New function.
9464 (Relobj::do_output_section_offset): New pure virtual function.
9465 (Relobj::do_set_section_offset): Likewise.
9466 (class Sized_relobj): Add section_offsets_ field. Add comdat
9467 group support from Relobj. Update declarations.
9468 (Sized_relobj::get_output_section_offset): New function.
9469 (Sized_relobj::do_output_section_offset): New function.
9470 (Sized_relobj::do_set_section_offset): New function.
9471 * object.cc (Relobj::output_section_address): Remove.
9472 (Sized_relobj::Sized_relobj): Initialize new fields.
9473 (Sized_relobj::include_section_group): Cast find_kept_object to
9474 Sized_relobj.
9475 (Sized_relobj::include_linkonce_section): Likewise.
9476 (Sized_relobj::do_layout): Use separate arrays for output section
9477 and output offset.
9478 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9479 output_sections.
9480 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9481 output_sections and section_offsets.
9482 (Sized_relobj::write_local_symbols): Likewise.
9483 (map_to_kept_section): Compute output address directly.
9484 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9485 output_sections and section_offsets.
9486 (Sized_relobj::write_sections): Likewise.
9487 (Sized_relobj::relocate_sections): Likewise.
9488 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9489 * output.h (class Output_reloc): Update declarations. Change
9490 u2_.relobj to Sized_relobj*.
9491 (class Output_data_reloc): Change add functions to use
9492 Sized_relobj*.
9493 * output.cc (Output_reloc::Output_reloc): Change relobj to
9494 Sized_relobj*.
9495 (Output_reloc::local_section_offset): Change return type to
9496 Elf_Addr. Use get_output_section_offset.
9497 (Output_reloc::get_address): Likewise.
9498 (Output_section::is_input_address_mapped): Don't call
9499 is_section_specially_mapped.
9500 (Output_section::output_offset): Likewise.
9501 (Output_section::output_address): Likewise.
9502 (Output_section::starting_output_address): Likewise.
9503 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9504 parameter to Sized_relobj*.
9505 (Copy_relocs::need_copy_reloc): Likewise.
9506 (Copy_relocs::save): Likewise.
9507 * copy-relocs.h (class Copy_relocs): Update declarations.
9508 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9509 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9510 * target-reloc.h (relocate_for_relocatable): Change
9511 offset_in_output_section type to Elf_Addr. Change code that uses
9512 it as well.
9513 * layout.cc (Layout::layout): Always set *off.
9514 * mapfile.cc (Mapfile::print_input_section): Use
9515 output_section_offset.
9516 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9517 Sized_relobj*.
9518 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9519 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9520 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9521
5cb66f97
ILT
95222008-07-03 Ian Lance Taylor <iant@google.com>
9523
9524 * layout.cc (Layout::include_section): Do not discard unrecognized
9525 SHT_STRTAB sections.
9526
afe47622
CS
95272008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9528
9529 * script.cc (Lex::can_continue_name): Make '?' allowable in
9530 version-script names.
9531 * testsuite/version_script.map: Change glob pattern to use '?'
9532
5adf9721
ILT
95332008-06-30 Manish Singh <yosh@gimp.org>
9534
9535 PR 6585
9536 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9537 Correct typo.
9538
e6fde208
ILT
95392008-06-30 Ian Lance Taylor <iant@google.com>
9540
9541 PR 6660
9542 PR 6682
9543 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9544 versions]: Don't try to read the value in the contents, since we
9545 don't use it. Use the template endianness when writing.
9546
3f2e6a2d
CC
95472008-06-25 Cary Coutant <ccoutant@google.com>
9548
9549 * fileread.cc (File_read::make_view): Assert on zero-length view.
9550 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9551 symbol table when there are no symbols to read.
9552
c43d3a48
CS
95532008-06-23 Craig Silverstein <csilvers@google.com>
9554
9555 * version.cc (version_string): Bump to 1.7
9556
5f494ea0
CS
95572008-06-18 Craig Silverstein <csilvers@google.com>
9558
9559 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9560 constant 0xFFFF to type Valtype.
9561 (Powerpc_relocate_functions::rel16_ha): Likewise.
9562
c42e122e
ILT
95632008-06-17 Ian Lance Taylor <iant@google.com>
9564
f34787f8
ILT
9565 * output.h (Output_section::Input_section): Initialize p2align_ to
9566 zero for Output_section_data constructors.
9567 (Output_section::Input_section::addralign): If not an input
9568 section, return the alignment of the Output_section_data.
9569 * testsuite/copy_test.cc: New file.
9570 * testsuite/copy_test_1.cc: New file.
9571 * testsuite/copy_test_2.cc: New file.
9572 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9573 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9574 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9575 (copy_test_1_pic.o, copy_test_1.so): New targets.
9576 (copy_test_2_pic.o, copy_test_2.so): New targets.
9577 * testsuite/Makefile.in: Rebuild.
9578
c42e122e
ILT
9579 * script-sections.cc (Script_sections::place_orphan): Initialize
9580 local variable exact.
9581
ce3ac18a
DE
95822008-06-13 David Edelsohn <edelsohn@gnu.org>
9583
9584 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9585
42cacb20
DE
95862008-06-12 David Edelsohn <edelsohn@gnu.org>
9587 David S. Miller <davem@davemloft.net>
9588
9589 * powerpc.cc: New file.
9590 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9591 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9592 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9593 * Makefile.in: Rebuild.
9594
7b308235
ILT
95952008-06-09 Ian Lance Taylor <iant@google.com>
9596
9597 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9598 <exception>.
9599 (throwing, orig_terminate): New static variables.
9600 (terminate_handler): New static function.
9601 (t2): Set terminate handler.
9602
f0b886e3
ILT
96032008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9604
9605 PR 6584
cd536b21 9606 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9607 alignment.
9608
3e90f135
CC
96092008-05-30 Cary Coutant <ccoutant@google.com>
9610
9611 * archive.cc (Archive::include_all_members) Correct to step
9612 over symbol table and extended name table in thin archives.
9613
e09ad04a
ILT
96142008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9615
9616 PR 6407
9617 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9618 calculation.
9619
62b01cb5
ILT
96202008-05-28 Caleb Howe <cshowe@google.com>
9621
9622 * reduced_debug_output.cc: New file.
9623 * reduced_debug_output.h: New file.
92de84a6 9624 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9625 * options.cc (General_options::finalize): Add strip_debug_non_line
9626 to the strip heirarchy.
9627 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9628 fields.
9629 * layout.cc: Include "reduced_debug_output.h".
9630 (Layout::Layout): Initialize new fields.
9631 (line_only_debug_sections): New static array.
9632 (is_lines_only_debug_sections): New static inline function.
9633 (Layout::include_section): Handle --strip-debug-non-line.
9634 (Layout::make_output_section): If --strip-debug-non-line, build
9635 new output sections for .debug_abbrev and .debug_info.
9636 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9637 gold. Warn about possible overflow.
9638 (read_signed_LEB_128): Likewise.
9639 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9640 (read_signed_LEB_128): Declare.
9641 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9642 (HFILES): Add reduced_debug_output.h.
9643 * Makefile.in: Rebuild.
9644
7d9e3d98
ILT
96452008-05-21 Ian Lance Taylor <iant@google.com>
9646
9647 * mapfile.cc: New file.
9648 * mapfile.h: New file.
9649 * options.h (class General_options): Add -M/--print-map and -Map.
9650 * options.cc (General_options::finalize): Make -M equivalent to
9651 -Map -.
9652 * main.cc: Include <cstdio> and "mapfile.h".
9653 (main): Open mapfile if requested.
9654 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9655 constructor. Change caller.
9656 (queue_initial_tasks): Add mapfile parameter. Change caller.
9657 (queue_middle_tasks): Likewise.
9658 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9659 declarations.
9660 * archive.cc: Include "mapfile.h".
9661 (Archive::add_symbols): Add mapfile parameter. Change all
9662 callers. Pass mapfile, symbol, and reason to include_member.
9663 (Archive::include_all_members): Add mapfile parameter. Change all
9664 callers.
9665 (Archive::include_member): Add mapfile, sym, and why parameters.
9666 Change all callers. Report inclusion to map file.
9667 * archive.h: Include "fileread.h".
9668 (class Archive): Update declarations.
9669 (Archive::file): New const method.
9670 (class Add_archive_symbols): Add mapfile_ field. Update
9671 constructor. Change all callers.
9672 * readsyms.h (class Read_symbols): Likewise.
9673 (class Finish_group): Likewise.
9674 (class Read_script): Likewise.
9675 * common.cc: Include "mapfile.h".
9676 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9677 all callers.
9678 (Symbol_table::do_allocate_commons): Likewise.
9679 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9680 symbol allocation to mapfile.
9681 * common.h (class Allocate_commons_task): Add mapfile_ field.
9682 Update constructor. Change all callers.
9683 * symtab.h (class Symbol_table): Update declarations.
9684 * layout.cc: Include "mapfile.h".
9685 (Layout_task_runner::run): Print information to mapfile.
9686 (Layout::create_gold_note): Change Output_data_fixed_space to
9687 Output_data_zero_fill.
9688 (Layout::create_build_id): Likewise.
9689 (Layout::print_to_mapfile): New function.
9690 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9691 constructor. Change caller.
9692 (class Layout): Declare print_to_mapfile.
9693 * output.cc (Output_section::Input_section::print_to_mapfile): New
9694 function.
9695 (Output_section::add_input_section): If producing a map, always
9696 add to input_sections_ list.
9697 (Output_section::do_print_to_mapfile): New function.
9698 (Output_segment::print_sections_to_mapfile): New function.
9699 (Output_segment::print_section_list_to_mapfile): New function.
9700 * output.h: Include "mapfile.h".
9701 (Output_data::print_to_mapfile): New function.
9702 (Output_data::do_print_to_mapfile): New virtual function.
9703 (Output_segment_headers::do_print_to_mapfile): New function.
9704 (Output_file_header::do_print_to_mapfile): New function.
9705 (Output_data_const::do_print_to_mapfile): New function.
9706 (class Output_data_const_buffer): Add map_name_ field. Update
9707 constructor. Change all callers. Add do_print_to_mapfile
9708 function.
9709 (class Output_data_fixed_space): Likewise.
9710 (class Output_data_space): Likewise.
9711 (class Output_data_zero_fill): New class.
9712 (Output_data_strtab::do_print_to_mapfile): New function.
9713 (Output_data_reloc_base::do_print_to_mapfile): New function.
9714 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9715 (Output_data_group::do_print_to_mapfile): New function.
9716 (Output_data_got::do_print_to_mapfile): New function.
9717 (Output_data_dynamic::do_print_to_mapfile): New function.
9718 (Output_symtab_xindex::do_print_to_mapfile): New function.
9719 (class Output_section): Declare do_print_to_mapflie. Declare
9720 print_to_mapfile in Input_section.
9721 (class Output_segment): Declare new functions.
9722 * object.h (Sized_relobj::symbol_count): New function.
9723 * script-sections.cc
9724 (Output_section_element_dot_assignment::set_section_addresses):
9725 Change Output_data_fixed_space to Output_data_zero_fill.
9726 (Output_data_expression::do_print_to_mapfile): New function.
9727 * script.cc (read_input_script): Add mapfile parameter. Change
9728 all callers.
9729 * script.h (read_input_script): Update declaration.
9730 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9731 (Eh_frame::do_print_to_mapfile): New function.
9732 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9733 (Output_merge_string::do_print_to_mapfile): New function.
9734 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9735 function.
9736 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9737 function.
9738 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9739 function.
9740 * Makefile.am (CCFILES): Add mapfile.cc.
9741 (HFILES): Add mapfile.h.
9742 * Makefile.in: Rebuild.
9743
9f1d377b
ILT
97442008-05-19 Ian Lance Taylor <iant@google.com>
9745
9746 * options.h (class General_options): Add -z relro.
9747 * layout.cc (Layout::Layout): Initialize relro_segment_.
9748 (Layout::add_output_section_data): Return the output section.
9749 (Layout::make_output_section): Rcognize relro sections and mark
9750 them appropriately.
9751 (Layout::attach_allocated_section_to_segment): Put relro sections
9752 in a PT_GNU_RELRO segment.
9753 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9754 section as relro.
9755 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9756 PT_TLS segments.
9757 (Layout::linkonce_mapping): Map d.rel.ro.local to
9758 .data.rel.ro.local.
9759 (Layout::output_section_name): Us .data.rel.ro.local for any
9760 section which begins with that.
9761 * layout.h (class Layout): Update add_output_section_data
9762 declaration. Add relro_segment_ field.
9763 * output.cc (Output_section::Output_section): Initialize is_relro_
9764 and is_relro_local_ fields.
9765 (Output_segment::add_output_section): Group relro sections.
9766 (Output_segment::is_first_section_relro): New function.
9767 (Output_segment::maximum_alignment): If there is a relro section,
9768 align the segment to the common page size.
9769 (Output_segment::set_section_addresses): Track whether we are
9770 looking at relro sections. If the last section is a relro
9771 section, align to the common page size.
9772 (Output_segment::set_section_list_addresses): Add in_relro
9773 parameter. Change all callers. Align to the page size when
9774 moving from relro to non-relro section.
9775 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9776 segment.
9777 * output.h (class Output_section): Add is_relro_ and
9778 is_relro_local_ fields.
9779 (Output_section::is_relro): New function.
9780 (Output_section::set_is_relro): New function.
9781 (Output_section::is_relro_local): New function.
9782 (Output_section::set_is_relro_local): New function.
9783 (class Output_segment): Update declarations.
9784 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9785 * sparc.cc (Target_sparc::got_section): Likewise.
9786 * x86_64.cc (Target_x86_64::got_section): Likewise.
9787 * testsuite/relro_test_main.cc: New file.
9788 * testsuite/relro_test.cc: New file.
9789 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9790 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9791 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9792 (relro_test.so, relro_test_pic.o): New targets.
9793 * testsuite/Makefile.in: Rebuild.
9794
a984ee1d
ILT
97952008-05-16 Ian Lance Taylor <iant@google.com>
9796
01676dcd
ILT
9797 * output.cc (Output_segment::add_output_section): Remove front
9798 parameter.
9799 * output.h (class Output_segment): Remove
9800 add_initial_output_section and overloaded add_output_section.
9801 Update declaration of remaining add_output_section.
9802 * layout.cc (Layout::create_interp): Call add_output_section
9803 rather than add_initial_output_section.
9804 (Layout::finish_dynamic_section): Likewise.
9805
497897f9
ILT
9806 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9807 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9808 know the dynamic type.
9809 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9810 field. Initialize it in constructor.
9811 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9812 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9813 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9814 reloc.
9815
a984ee1d
ILT
9816 * output.cc (Output_reloc::get_address): Change return type to
9817 Elf_Addr.
9818 * output.h (class Output_reloc): Update get_address declaration.
9819 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9820 for section addresses.
9821
55ba0940
ILT
98222008-05-09 Ian Lance Taylor <iant@google.com>
9823
9824 PR 6493
9825 * gold.cc (gold_nomem): Use return value of write.
9826
75517b77
ILT
98272008-05-08 Ian Lance Taylor <iant@google.com>
9828
9829 * symtab.c (Symbol::init_base_output_data): Add version
9830 parameter. Change all callers.
9831 (Symbol::init_base_output_segment): Likewise.
9832 (Symbol::init_base_constant): Likewise.
9833 (Symbol::init_base_undefined): Likewise.
9834 (Sized_symbol::init_output_data): Likewise.
9835 (Sized_symbol::init_output_segment): Likewise.
9836 (Sized_symbol::init_constant): Likewise.
9837 (Sized_symbol::init_undefined): Likewise.
9838 (Symbol_table::do_define_in_output_data): If the new symbol has a
9839 version, mark it as the default.
9840 (Symbol_table::do_define_in_output_segment): Likewise.
9841 (Symbol_table::do_define_as_constant): Likewise.
9842 * symtab.h (class Symbol): Update declarations.
9843 (class Sized_symbol): Likewise.
9844 * resolve.cc (Symbol::override_version): New function.
c42e122e 9845 (Symbol::override_base): Call override_version.
75517b77
ILT
9846 (Symbol::override_base_with_special): Likewise.
9847 * testsuite/ver_script_8.script: New file.
9848 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9849 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9850 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9851 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9852
f1f70eae
ILT
98532008-05-06 Ian Lance Taylor <iant@google.com>
9854
f3e9c5c5
ILT
9855 PR 6049
9856 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9857 functions.
9858 (class General_options): Remove existing --undefined, and add
9859 --no-undefined instead. Add new --undefined as synonym for -u.
9860 * archive.cc (Archive::add_symbols): Check whether symbol was
9861 named with -u.
9862 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9863 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9864 all uses. Add IS_UNDEFINED. Update declarations to split
9865 different versions of init_base. Declare init_base_undefined.
9866 (Symbol::is_defined): Handle IS_UNDEFINED.
9867 (Symbol::is_undefined): Likewise.
9868 (Symbol::is_weak_undefined): Call is_undefined.
9869 (Symbol::is_absolute): Handle IS_CONSTANT.
9870 (class Sized_symbol): Update declarations to split different
9871 versions of init. Declare init_undefined.
9872 (class Symbol_table): Declare new functions.
9873 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9874 Change all callers.
9875 (Symbol::init_base_output_data): Likewise.
9876 (Symbol::init_base_output_segment): Likewise.
9877 (Symbol::init_base_constant): Likewise.
9878 (Symbol::init_base_undefined): New function.
9879 (Sized_symbol::init_object): Rename from init. Change all
9880 callers.
9881 (Sized_symbol::init_output_data): Likewise.
9882 (Sized_symbol::init_output_segment): Likewise.
9883 (Sized_symbol::init_constant): Likewise.
9884 (Sized_symbol::init_undefined): New function.
9885 (Symbol_table::add_undefined_symbols_from_command_line): New
9886 function.
9887 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9888 function.
9889 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9890 (Symbol::output_section): Likewise.
9891 (Symbol::set_output_section): Likewise.
9892 (Symbol_table::sized_finalize_symbol): Likewise.
9893 (Symbol_table::sized_write_globals): Likewise.
9894 * resolve.cc (Symbol_table::should_override): Likewise.
9895 (Symbol::override_base_with_special): Likewise.
9896
8bdcdf2c
ILT
9897 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9898 symbol, change it to have default visibility.
9899 * testsuite/protected_1.cc: New file.
9900 * testsuite/protected_2.cc: New file.
9901 * testsuite/protected_3.cc: New file.
9902 * testsuite/protected_main_1.cc: New file.
9903 * testsuite/protected_main_2.cc: New file.
9904 * testsuite/protected_main_3.cc: New file.
9905 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9906 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9907 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9908 (protected_1.so): New target.
9909 (protected_1_pic.o, protected_2_pic.o): New targets.
9910 (protected_3_pic.o): New target.
9911 (check_PROGRAMS): Add protected_2.
9912 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9913 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9914 * testsuite/Makefile.in: Rebuild.
9915
2b706932
ILT
9916 * options.h (DEFINE_var): Add set_user_set_##varname__.
9917 (DEFINE_bool_alias): New macro.
9918 (class General_options): Define -Bstatic using DEFINE_bool_alias
9919 rather than DEFINE_special. Add --undefined as an alias for -z
9920 defs.
9921 * options.cc (General_options::parse_Bstatic): Remove.
9922
d82a5bcc
ILT
9923 * options.h (class General_options): Add --fatal-warnings.
9924 * main.cc (main): Implement --fatal-warnings.
9925 * errors.h (Errors::warning_count): New function.
9926
f1f70eae
ILT
9927 * options.h (class General_options): Add -Bsymbolic-functions.
9928 * symtab.h (Symbol::is_preemptible): Check for
9929 -Bsymbolic-functions.
9930
8825ac63
ILT
99312008-05-05 Ian Lance Taylor <iant@google.com>
9932
d98bc257
ILT
9933 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9934 as noVARNAME rather than no-VARNAME.
9935 (class General_options): Add option -z combreloc.
9936 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9937 get_address.
9938 (Output_reloc::sort_before) [SHT_REL]: New function.
9939 (Output_reloc::sort_before) [SHT_RELA]: New function.
9940 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9941 Sort_relocs_comparison.
9942 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9943 parameter. Change all callers.
9944 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9945 sort_relocs parameter. Change all callers.
9946 * output.cc (Output_reloc::get_address): New function, broken out
9947 of write_rel.
9948 (Output_reloc::write_rel): Call it.
9949 (Output_reloc::compare): New function.
9950 (Output_data_reloc_base::do_write): Optionally sort relocs.
9951
60b2b4e7
ILT
9952 * configure.ac: If targ_extra_obj is set, link it in.
9953 * configure.tgt: Initialize all variables.
9954 (x86_64*): Set targ_extra_obj and targ_extra_size.
9955 * configure: Rebuild.
9956
8825ac63
ILT
9957 * object.cc (Sized_relobj::include_section_group): Adjust section
9958 indexes read from group data. Build vector to pass to
9959 layout_group.
9960 * layout.cc (Layout::layout_group): Add flags and shndxes
9961 parameters. Remove contents parameter. Change caller. Update
9962 explicit instantiations.
9963 * layout.h (class Layout): Update layout_group declaration.
9964 * output.cc (Output_data_group::Output_data_group): Add flags and
9965 input_shndxes parameters. Remove contents parameter. Change
9966 caller.
9967 (Output_data_group::do_write): Change input_sections_ to
9968 input_shndxes_.
9969 * output.h (class Output_data_group): Update constructor
9970 declaration. Rename input_sections_ to input_shndxes_.
9971 * testsuite/many_sections_test.cc: Add template.
9972
e94cf127
CC
99732008-04-30 Cary Coutant <ccoutant@google.com>
9974
4418b2d5
CC
9975 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9976
e94cf127
CC
9977 * layout.cc (Layout::include_section): Refactored check for debug
9978 info section.
9979 (Layout::add_comdat): Add new parameters. Change type
9980 of signature parameter. Add object and shndx to signatures table.
9981 (Layout::find_kept_object): New function.
9982 * layout.h: Include <cstring>.
9983 (Layout::is_debug_info_section): New function.
9984 (Layout::add_comdat): Add new parameters.
9985 (Layout::find_kept_object): New function.
9986 (Layout::Kept_section): New struct.
9987 (Layout::Signatures): Change type of map range.
9988 * object.cc (Relobj::output_section_address): New function.
9989 (Sized_relobj::include_section_group): Add new parameters. Change
9990 calls to Layout::add_comdat. Change to build table of kept comdat
9991 groups and table mapping discarded sections to kept sections.
9992 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9993 (Sized_relobj::do_layout): Change calls to include_section_group and
9994 include_linkonce_section.
9995 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9996 value to zero when section is discarded.
9997 (Sized_relobj::map_to_kept_section): New function.
9998 * object.h (Relobj::output_section_address): New function.
9999 (Relobj::Comdat_group): New type.
10000 (Relobj::find_comdat_group): New function.
10001 (Relobj::Comdat_group_table): New type.
10002 (Relobj::Kept_comdat_section): New type.
10003 (Relobj::Kept_comdat_section_table): New type.
10004 (Relobj::add_comdat_group): New function.
10005 (Relobj::set_kept_comdat_section): New function.
10006 (Relobj::get_kept_comdat_section): New function.
10007 (Relobj::comdat_groups_): New field.
10008 (Relobj::kept_comdat_sections_): New field.
10009 (Symbol_value::input_value): Update comment.
10010 (Sized_relobj::map_to_kept_section) New function.
10011 (Sized_relobj::include_linkonce_section): Add new parameter.
10012 * target-reloc.h (Comdat_behavior): New type.
10013 (get_comdat_behavior): New function.
10014 (relocate_section): Add code to map a discarded section to the
10015 corresponding kept section when applying a relocation.
10016
e4e5049b
CS
100172008-04-30 Craig Silverstein <csilvers@google.com>
10018
10019 * dwarf_reader.cc (next_generation_count): New static var.
10020 (Addr2line_cache_entry): New struct.
10021 (addr2line_cache): New static var.
10022 (Dwarf_line_info::one_addr2line): Added caching.
10023 (Dwarf_line_info::clear_addr2line_cache): New function.
10024 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10025 cache-size parameter.
10026 (Dwarf_line_info::one_addr2line_cache): New function.
10027 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10028 new cache-size argument to one_addr2line(), and clear cache.
10029
d09e9154
CC
100302008-04-28 Cary Coutant <ccoutant@google.com>
10031
10032 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10033 R_386_PC8 relocations.
10034
7ef73768
ILT
100352008-04-23 Ian Lance Taylor <iant@google.com>
10036
55438702
ILT
10037 * object.cc (Sized_relobj::include_section_group): Check for
10038 invalid section group.
10039
c165fb93
ILT
10040 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10041 header size.
10042
7ef73768
ILT
10043 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10044 than read for file header.
10045 * archive.cc (Archive::include_member): Likewise.
10046
6194aaab
L
100472008-04-23 Paolo Bonzini <bonzini@gnu.org>
10048
10049 * aclocal.m4: Regenerate.
10050 * configure: Regenerate.
10051
d491d34e
ILT
100522008-04-19 Ian Lance Taylor <iant@google.com>
10053
5ea2bac6
ILT
10054 * version.cc (version_string): Bump to 1.6.
10055
7bc3e21a
ILT
10056 * testsuite/Makefile.am (many_sections_r_test): New target.
10057 (many_sections_r_test_SOURCES): Remove.
10058 (many_sections_r_test_DEPENDENCIES): Remove.
10059 (many_sections_r_test_LDFLAGS): Remove.
10060 (many_sections_r_test_LDADD): Remove.
10061
7fcd3aa9
ILT
10062 * object.cc (Sized_relobj::do_add_symbols): Always pass
10063 local_symbol_count_ to add_from_relobj.
10064
4c94d6ae
ILT
10065 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10066 every thousand variables.
10067 * testsuite/Makefile.in: Rebuild.
10068
d491d34e
ILT
10069 * object.cc (Xindex::initialize_symtab_xindex): New function.
10070 (Xindex::read_symtab_xindex): New function.
10071 (Xindex::sym_xindex_to_shndx): New function.
10072 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10073 available.
10074 (Sized_relobj::do_initialize_xindex): New function.
10075 (Sized_relobj::do_read_symbols): Adjust section links.
10076 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10077 parameter. Change all callers.
10078 (Sized_relobj::include_section_group): Adjust section links and
10079 symbol section indexes.
10080 (Sized_relobj::do_layout): Adjust section links.
10081 (Sized_relobj::do_count_local_symbols): Adjust section links and
10082 symbol section indexes.
10083 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10084 ordinary and special symbols.
10085 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10086 dynsym_xindex parameters. Change all callers. Adjust section
10087 links. Use SHN_XINDEX when needed.
10088 (Sized_relobj::get_symbol_location_info): Adjust section links.
10089 Don't get fooled by special symbols.
10090 * object.h (class Xindex): Define.
10091 (class Object): Add xindex_ parameter. Declare virtual functoin
10092 do_initialize_xindex.
10093 (Object::adjust_sym_shndx): New function.
10094 (Object::set_xindex): New protected function.
10095 (class Symbol_value): Add is_ordinary_shndx_ field.
10096 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10097 (Symbol_value::value): Assert ordinary section.
10098 (Symbol_value::initialize_input_to_output_map): Likewise.
10099 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10100 Change all callers.
10101 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10102 all callers.
10103 (class Sized_relobj): Update declarations.
10104 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10105 parameter. Change all callers.
10106 (Sized_relobj::adjust_shndx): New function.
10107 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10108 field.
10109 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10110 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10111 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10112 (Sized_dynobj::read_dynsym_section): Adjust section links.
10113 (Sized_dynobj::read_dynamic): Likewise.
10114 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10115 section links.
10116 (Sized_dynobj::do_initialize_xindex): New function.
10117 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10118 do_initialize_xindex.
10119 (Sized_dynobj::adjust_shndx): New function.
10120 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10121 dynsym_xindex_ fields.
10122 (Layout::finalize): Add a call to set_section_indexes before
10123 creating the symtab sections.
10124 (Layout::set_section_indexes): Don't do anything if the section
10125 already has a section index.
10126 (Layout::create_symtab_sections): Add shnum parameter. Change
10127 caller. Create .symtab_shndx section if needed.
10128 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10129 caller.
10130 (Layout::allocated_output_section_count): New function.
10131 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10132 needed.
10133 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10134 fields. Update declarations.
10135 (Layout::symtab_xindex): New function.
10136 (Layout::dynsym_xindex): New function.
10137 (class Write_symbols_task): Add layout_ field.
10138 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10139 Change caller.
10140 * output.cc (Output_section_headers::Output_section_headers): Add
10141 shstrtab_section parameter. Change all callers.
10142 (Output_section_headers::do_sized_write): Store overflow values
10143 for section count and section string table section index in
10144 section header zero.
10145 (Output_file_header::do_sized_write): Check for overflow of
10146 section count and section string table section index.
10147 (Output_symtab_xindex::do_write): New function.
10148 (Output_symtab_xindex::endian_do_write): New function.
10149 * output.h (class Output_section_headers): Add shstrtab_section_.
10150 Update declarations.
10151 (class Output_symtab_xindex): Define.
10152 (Output_section::has_out_shndx): New function.
10153 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10154 field.
10155 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10156 Change all callers.
10157 (Sized_symbol::init): Likewise.
10158 (Symbol::output_section): Check for ordinary symbol.
10159 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10160 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10161 callers.
10162 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10163 Change all callers. Simplify handling of symbols from sections
10164 not included in the link.
10165 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10166 distinction.
10167 (Weak_alias_sorter::operator()): Assert that symbols are
10168 ordinary.
10169 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10170 distinction.
10171 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10172 parameters. Change all callers.
10173 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10174 symbol distinction. Use SHN_XINDEX when needed.
10175 (Symbol_table::write_section_symbol): Add symtab_xindex
10176 parameter. Change all callers.
10177 (Symbol_table::sized_write_section_symbol): Likewise. Use
10178 SHN_XINDEX when needed.
10179 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10180 declarations.
10181 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10182 (Symbol::is_defined): Check is_ordinary.
10183 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10184 (Symbol::is_absolute, Symbol::is_common): Likewise.
10185 (class Sized_symbol): Update declarations.
10186 (class Symbol_table): Update declarations.
10187 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10188 parameters. Change all callers.
10189 (Sized_symbol::override): Likewise.
10190 (Symbol_table::override): Likewise.
10191 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10192 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10193 is_ordinary, and orig_st_shndx parameters. Change all callers.
10194 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10195 to be in an ordinary section.
10196 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10197 object and is_ordinary parameters. Change all callers.
10198 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10199 Change all callers. Don't add undefined or non-ordinary symbols
10200 to reloc_map_.
10201 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10202 Change all callers.
10203 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10204 declarations.
10205 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10206 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10207 (Sized_relobj::relocate_sections): Likewise.
10208 * target-reloc.h (scan_relocs): Adjust section symbol index.
10209 (scan_relocatable_relocs): Likewise.
10210 * i386.cc (Scan::local): Check for ordinary symbols.
10211 * sparc.cc (Scan::local): Likewise.
10212 * x86_64.cc (Scan::local): Likewise.
10213 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10214 to symbol_section_and_value.
10215 * testsuite/many_sections_test.cc: New file.
10216 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10217 (check_PROGRAMS): Add many_sections_test.
10218 (many_sections_test_SOURCES): Define.
10219 (many_sections_test_DEPENDENCIES): Define.
10220 (many_sections_test_LDFLAGS): Define.
10221 (BUILT_SOURCES): Add many_sections_define.h.
10222 (many_sections_define.h): New target.
10223 (BUILT_SOURCES): Add many_sections_check.h.
10224 (many_sections_check.h): New target.
10225 (check_PROGRAMS): Add many_sections_r_test.
10226 (many_sections_r_test_SOURCES): Define.
10227 (many_sections_r_test_DEPENDENCIES): Define.
10228 (many_sections_r_test_LDFLAGS): Define.
10229 (many_sections_r_test_LDADD): Define.
10230 (many_sections_r_test.o): New target.
10231 * testsuite/Makefile.in: Rebuild.
10232
c5818ff1
CC
102332008-04-17 Cary Coutant <ccoutant@google.com>
10234
10235 * errors.cc (Errors::info): New function.
10236 (gold_info): New function.
10237 * errors.h (Errors::info): New function.
10238 * gold.h (gold_info): New function.
10239 * object.cc (Input_objects::add_object): Print trace output.
10240 * options.cc (options::parse_set): New function.
10241 (General_options::parse_wrap): Deleted.
10242 (General_options::General_options): Deleted initializer.
10243 * options.h (options::String_set): New typedef.
10244 (options::parse_set): New function.
10245 (DEFINE_set): New macro.
10246 (General_options::wrap): Changed to use DEFINE_set. Changed
10247 callers of any_wrap_symbols and is_wrap_symbol.
10248 (General_options::trace, General_options::trace_symbol):
10249 New options.
10250 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10251 (General_options::wrap_symbols_): Deleted.
10252 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10253
b5be4a7c
DM
102542008-04-17 David S. Miller <davem@davemloft.net>
10255
10256 * options.cc (General_options::parse_V): New function.
10257 * options.h: Add entries for -V and -Qy.
10258
155a0dd7
ILT
102592008-04-17 Ian Lance Taylor <iant@google.com>
10260
10261 * common.cc (Symbol_table::allocate_commons): Remove options
10262 parameter. Change caller.
10263 (Symbol_table::do_allocate_commons): Remove options parameter.
10264 Change caller. Just call do_allocate_commons_list twice.
10265 (Symbol_table::do_allocate_commons_list): New function, broken out
10266 of do_allocate_commons.
10267 * common.h (class Allocate_commons_task): Remove options_ field.
10268 Update constructor.
10269 * symtab.cc (Symbol_table::Symbol_table): Initialize
10270 tls_commons_.
10271 (Symbol_table::add_from_object): Put TLS common symbols on
10272 tls_commons_ list.
10273 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10274 which are IN_OUTPUT_DATA.
10275 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10276 allocate_commons and do_allocate_commons declarations. Declare
10277 do_allocate_commons_list.
10278 * gold.cc (queue_middle_tasks): Update creation of
10279 Allocate_commons_task to not pass options.
10280 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10281 (TLS_TEST_C_FLAGS): New variable.
10282 (tls_test_c_pic.o): New target.
10283 (tls_test_shared.so): Link in tls_test_c_pic.o.
10284 (tls_test_c_pic_ie.o): New target.
10285 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10286 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10287 (tls_test_c.o): New target.
10288 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10289 (tls_pic_test_LDADD): Likewise.
10290 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10291 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10292 (tls_test_c_gnu2.o): New target.
10293 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10294 tls_test_c_gnu2.o.
10295 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10296 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10297 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10298 * testsuite/tls_test.cc: Include "config.h".
10299 (t_last): Call t11_last.
10300 * testsuite/tls_test.h (t11, t11_last): Declare.
10301 * testsuite/tls_test_c.c: New file.
10302 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10303 * configure.ac: Check for OpenMP support.
10304 * configure, config.in, Makefile.in: Rebuild.
10305 * testsuite/Makefile.in: Rebuild.
10306
edfbb029
CC
103072008-04-16 Cary Coutant <ccoutant@google.com>
10308
10309 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10310 (Target_i386::tls_base_symbol_defined_): New field.
10311 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10312 (Target_i386::Scan::global): Likewise.
10313 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10314 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10315 (Target_x86_64::tls_base_symbol_defined_): New field.
10316 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10317 (Target_x86_64::Scan::global): Likewise.
10318
f3c69fca
CC
103192008-04-16 Cary Coutant <ccoutant@google.com>
10320
10321 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10322 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10323 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10324 building shared libraries.
10325 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10326 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10327 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10328 * testsuite/Makefile.in: Rebuild.
10329 * testsuite/weak_undef.h: New file.
10330 * testsuite/weak_undef_file1.cc: Add extra test cases.
10331 * testsuite/weak_undef_file2.cc: Likewise.
10332 * testsuite/weak_undef_test.cc: Likewise.
10333
7c414435
DM
103342008-04-16 David S. Miller <davem@davemloft.net>
10335
32b769e1
DM
10336 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10337 Add issued_non_pic_error_ field. Declare check_non_pic.
10338 (Target_sparc::Scan::check_non_pic): New function.
10339 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10340 (Target_sparc::Scan::global): Likewise.
10341
11936fb1
DM
10342 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10343 * configure: Rebuild.
10344
7c414435
DM
10345 * options.h (DEFINE_enable): New macro.
10346 (new_dtags): New enable option.
10347 (initfirst, interpose, loadfltr, nodefaultlib,
10348 nodelete, nodlopen, nodump): New -z options.
10349 * layout.cc (Layout:finish_dynamic_section): If new
10350 dtags enabled, emit DT_RUNPATH. Also, emit a
10351 DT_FLAGS_1 containing any specified -z flags.
10352
85c7bf8b
ILT
103532008-04-16 Ian Lance Taylor <iant@google.com>
10354
12c0daef
ILT
10355 * copy-relocs.cc: New file.
10356 * copy-relocs.h: New file.
10357 * reloc.cc: Remove Copy_relocs code.
10358 * reloc.h: Likewise.
10359 * reloc-types.h (struct Reloc_types) [both versions]: Add
10360 get_reloc_addend_noerror.
10361 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10362 variants of add_global which take an addend which must be zero.
10363 * i386.cc: Include "copy-relocs.h".
10364 (class Target_i386): Change type of copy_relocs_ to variable,
10365 update initializer.
10366 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10367 Change all callers.
10368 (Target_i386::do_finalize_sections): Change handling of
10369 copy_relocs_.
10370 * sparc.cc: Include "copy-relocs.h".
10371 (class Target_sparc): Change type of copy_relocs_ to variable,
10372 update initializer.
10373 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10374 Change all callers.
10375 (Target_sparc::do_finalize_sections): Change handling of
10376 copy_relocs_.
10377 * x86_64.cc: Include "copy-relocs.h".
10378 (class Target_x86_64): Change type of copy_relocs_ to variable,
10379 update initializer.
10380 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10381 class. Change all callers.
10382 (Target_x86_64::do_finalize_sections): Change handling of
10383 copy_relocs_.
10384 * Makefile.am (CCFILES): Add copy-relocs.cc.
10385 (HFILES): Add copy-relocs.h.
10386
4f4995b6
ILT
10387 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10388
85c7bf8b
ILT
10389 * testsuite/script_test_4.sh: Permit leading zeroes.
10390
4f2a9edd
ILT
103912008-04-15 Ian Lance Taylor <iant@google.com>
10392
e6188289
ILT
10393 * script-sections.cc (Script_sections::create_segments): Use
10394 header_size_adjustment even when there is enough room for the
10395 headers.
10396 * testsuite/script_test_4.sh: New file.
10397 * testsuite/script_test_4.t: New file.
10398 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10399 (check_DATA): Add script_test_4.stdout.
10400 (MOSTLYCLEANFILES): Likewise.
10401 (script_test_4): New target.
10402 (script_test_4.stdout): New target.
10403 * testsuite/Makefile.in: Rebuild.
10404
4f2a9edd
ILT
10405 * sparc.cc: Add definitions for Output_data_plt_sparc class
10406 constants.
10407
f5314dd5
DM
104082008-04-14 David S. Miller <davem@davemloft.net>
10409
10410 * sparc.cc: New file.
10411 * Makefile.am (TARGETSOURCES): Add sparc.cc
10412 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10413 * configure.tgt: Document targ_extra_size and
10414 targ_extra_big_endian. Add entries for sparc-* and
10415 sparc64-*.
10416 * configure.ac: Handle targ_extra_size and
10417 targ_extra_big_endian.
10418 * Makefile.in: Rebuild.
10419 * configure: Likewise.
10420 * po/POTFILES.in: Likewise.
10421 * po/gold.pot: Likewise.
10422
154e0e9a
ILT
104232008-04-14 Ian Lance Taylor <iant@google.com>
10424
10425 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10426 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10427 in the name/type/flags to section mapping. Don't call
10428 allocate_output_section.
10429 (Layout::choose_output_section): Change parameter from adjust_name
10430 to is_input_section. Don't permit input sections after sections
10431 are attached to segments. Don't call allocate_output_section.
10432 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10433 not write_enable_output_section.
10434 (Layout::make_output_section): Don't push to
10435 unattached_section_list_ nor call attach_to_segment. Call
10436 attach_section_to_segment if sections are attached.
10437 (Layout::attach_sections_to_segments): New function.
10438 (Layout::attach_section_to_segment): New function.
10439 (Layout::attach_allocated_section_to_segment): Rename from
10440 attach_to_segment. Remove flags parameter.
10441 (Layout::allocate_output_section): Remove function.
10442 (Layout::write_enable_output_section): Remove function.
10443 * layout.h (class Layout): Update for above changes. Add new
10444 field sections_are_attached_.
10445 * output.h (Output_section::update_flags_for_input_section): New
10446 function.
10447 * output.cc (Output_section::add_input_section): Call
10448 update_flags_for_input_section.
10449 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10450
009a67a2
CC
104512008-04-11 Cary Coutant <ccoutant@google.com>
10452
10453 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10454 thought unnecessary.
10455 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10456
759b1a24
ILT
104572008-04-11 Ian Lance Taylor <iant@google.com>
10458
10459 * output.h (class Output_section_data): Remove inline definition
10460 of set_addralign.
10461 * output.cc (Output_section_data::set_addralign): New function.
10462
c2b45e22
CC
104632008-04-11 Cary Coutant <ccoutant@google.com>
10464
10465 Add support for TLS descriptors for i386 and x86_64.
10466 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10467 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10468 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10469 GOT_TYPE_TLS_DESC.
10470 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10471 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10472 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10473 relocations.
10474 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10475 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10476 Fix problem with initial-exec relocations.
10477 (Target_i386::Relocate::relocate_tls): Likewise.
10478 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10479 relaxation.
10480 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10481 support for section-plus-offset dynamic table entries.
10482 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10483 (Output_data_dynamic::Dynamic_entry): Add support for
10484 section-plus-offset dynamic table entries.
10485 (Output_data_dynamic::Classification): Likewise.
10486 (Output_data_dynamic::classification_): Renamed offset_.
10487 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10488 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10489 (Target_x86_64::make_plt_section): New function.
10490 (Target_x86_64::reserve_tlsdesc_entries): New function.
10491 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10492 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10493 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10494 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10495 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10496 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10497 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10498 add extra PLT entry for TLS descriptors.
10499 (Output_data_plt_x86_64::got_): New field.
10500 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10501 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10502 fields.
10503 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10504 descriptors.
10505 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10506 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10507 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10508 R_386_TLS_DESC_CALL relocations.
10509 (Target_x86_64::Scan::global): Likewise.
10510 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10511 for TLS descriptors.
10512 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10513 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10514 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10515 GD-to-IE relaxation.
10516 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10517 and TLS_DESCRIPTORS.
10518 * Makefile.in: Rebuild.
10519 * configure: Rebuild.
10520 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10521 (tls_test_shared2.so): New target.
10522 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10523 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10524 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10525 (tls_shared_gd_to_ie_test_LDADD): New variable.
10526 (tls_shared_gnu2_gd_to_ie_test): New target.
10527 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10528 New targets.
10529 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10530 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10531 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10532 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10533 (tls_shared_gnu2_test): New target.
10534 (tls_test_gnu2_shared.so): New target.
10535 (tls_shared_gnu2_test_SOURCES): New variable.
10536 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10537 (tls_shared_gnu2_test_LDFLAGS): New variable.
10538 (tls_shared_gnu2_test_LDADD): New variable.
10539 * testsuite/Makefile.in: Rebuild.
10540 * testsuite/Makefile.
10541
83bfb6b7
ILT
105422008-04-11 Ian Lance Taylor <iant@google.com>
10543
10544 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10545 justsyms.t.
10546 * testsuite/Makefile.in: Rebuild.
10547
10548 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10549 long.
10550 * testsuite/script_test_2.cc (main): Adjust test.
10551
706e1f5e
ILT
105522008-04-11 David S. Miller <davem@davemloft.net>
10553 Ian Lance Taylor <iant@google.com>
10554
10555 * options.h (General_options): Add entries for '-Y' and
10556 '-relax'.
10557 * options.cc (General_options:finalize): If -Y was used, add those
10558 entries to the library path instead of the default "/lib" and
10559 "/usr/lib".
10560
7c98e6bb
DM
105612008-04-11 David S. Miller <davem@davemloft.net>
10562
10563 * testsuite/justsyms.t: Start at 0x100.
10564 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10565 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10566 long.
10567 * testsuite/script_test_2.cc: Adjust string and section length
10568 checks.
7c98e6bb 10569
99a37bfd
ILT
105702008-04-09 Ian Lance Taylor <iant@google.com>
10571
2cefc357
ILT
10572 PR gold/5996
10573 * script-sections.cc (Sections_element::allocate_to_segment): Add
10574 orphan parameter.
10575 (Output_section_definition::allocate_to_segment): Likewise.
10576 (Orphan_output_section::allocate_to_segment): Likewise.
10577 (Script_sections::attach_sections_using_phdrs_clause): Don't
10578 propagate non-PT_LOAD segments to orphan sections.
10579 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10580 readelf rather than objdump.
10581 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10582 .interp section and PT_INTERP segment are the same size.
10583 * testsuite/Makefile.in: Rebuild.
10584
99a37bfd
ILT
10585 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10586 aliases for symbols defined in the same object.
10587 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10588 (weak_alias_test_SOURCES): New variable.
10589 (weak_alias_test_DEPENDENCIES): New variable.
10590 (weak_alias_test_LDFLAGS): New variable.
10591 (weak_alias_test_LDADD): New variable.
10592 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10593 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10594 (weak_alias_test_3.o): New target.
10595 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10596 * testsuite/weak_alias_test_main.cc: New file.
10597 * testsuite/weak_alias_test_1.cc: New file.
10598 * testsuite/weak_alias_test_2.cc: New file.
10599 * testsuite/weak_alias_test_3.cc: New file.
10600
780e49c5
ILT
106012008-04-08 Ian Lance Taylor <iant@google.com>
10602
cdb0b8f5
ILT
10603 * options.h (class General_options): Add --noinhibit-exec option.
10604 * main.cc (main): Check --noinhibit-exec.
10605
0864d551
ILT
10606 * options.h (class General_options): Define --wrap as a special
10607 option. Add wrap_symbols_ field.
10608 (General_options::any_wrap_symbols): New function.
10609 (General_options::is_wrap_symbol): New function.
10610 * options.cc (General_options::parse_wrap): New function.
10611 (General_options::General_options): Initialize wrap_symbols_.
10612 * symtab.cc (Symbol_table::wrap_symbol): New function.
10613 (Symbol_table::add_from_object): Handle --wrap.
10614 * symtab.h (class Symbol_table): Declare wrap_symbol.
10615 * target.h (Target::wrap_char): New function.
10616 (Target::Target_info): Add wrap_char field.
10617 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10618 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10619 * testsuite/testfile.cc (Target_test::test_target_info):
10620 Likewise.
10621
789aa6de
ILT
10622 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10623 there is one.
10624
2c38906f
ILT
10625 * layout.h (class Layout): Add added_eh_frame_data_ field.
10626 * layout.cc (Layout::Layout): Initialize new field.
10627 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10628 output section until we find a section we merged successfully.
10629 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10630 that the size be non-zero.
10631
780e49c5
ILT
10632 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10633 qualifier.
10634
7fcd0256
ILT
106352008-04-08 Craig Silverstein <csilvers@google.com>
10636
10637 * configure.ac: Export new conditional variable HAVE_ZLIB.
10638 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10639 on HAVE_ZLIB.
10640 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10641 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10642
6835af53
ILT
106432008-04-07 Ian Lance Taylor <iant@google.com>
10644
e24f324c
ILT
10645 * version.cc (version_string): Set to "1.5".
10646
a036edd8
ILT
10647 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10648 Add issued_non_pic_error_ field. Declare check_non_pic.
10649 (Target_x86_64::Scan::check_non_pic): New function.
10650 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10651 (Target_x86_64::Scan::global): Likewise.
10652
624f8810
ILT
10653 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10654 addend parameter. Change caller. Handle merge sections.
10655 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10656 Address to Addend. Don't add in the result of
10657 local_section_offset, pass down the addend and use the returned
10658 value.
10659 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10660 Update declarations of local_section_offset and symbol_value.
10661 * testsuite/two_file_test_1.cc (t18): New function.
10662 * testsuite/two_file_test_2.cc (f18): New function.
10663 * testsuite/two_file_test_main.cc (main): Call t18.
10664 * testsuite/two_file_test.h (t18, f18): Declare.
10665
6835af53
ILT
10666 * configure.ac: Don't test for objdump, c++filt, or readelf.
10667 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10668 conditionals.
10669 (TEST_READELF): New variable.
10670 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10671 (check_PROGRAMS): Add two_file_strip_test.
10672 (two_file_strip_test): New target.
10673 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10674 (two_file_same_shared_strip_test_SOURCES): New variable.
10675 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10676 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10677 (two_file_same_shared_strip_test_LDADD): New variable.
10678 (two_file_shared_strip.so): New target.
10679 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10680 (ver_test_5.syms, ver_test_7.syms): Likewise.
10681 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10682 (strip_test_3.stdout): Use TEST_OBJDUMP.
10683 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10684
86925eef
CC
106852008-04-04 Cary Coutant <ccoutant@google.com>
10686
10687 * symtab.h (Symbol::is_weak_undefined): New function.
10688 (Symbol::is_strong_undefined): New function.
10689 (Symbol::is_absolute): New function.
10690 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10691 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10692 absolute symbols.
10693 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10694 (weak_undef_test): New target.
10695 * testsuite/Makefile.in: Rebuild.
10696 * testsuite/weak_undef_file1.cc: New file.
10697 * testsuite/weak_undef_file2.cc: New file.
10698 * testsuite/weak_undef_test.cc: New file.
10699
126f3ece
ILT
107002008-04-03 Craig Silverstein <csilvers@google.com>
10701
10702 * compressed_output.h (class Output_compressed_section): Use
10703 unsigned buffer.
10704 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10705 add zlib header.
10706 (zlib_compressed_suffix): Removed.
10707 (Output_compressed_section::set_final_data_size): Use unsigned
10708 buffers.
10709 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10710 Fix linker invocation.
10711 (flagstest_o_specialfile_and_compress_debug_sections):
10712 Likewise.
10713 * testsuite/Makefile.in: Regenerated.
10714
deae2a14
DM
107152008-04-02 David S. Miller <davem@davemloft.net>
10716
10717 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10718 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10719
70752818
ILT
107202008-04-02 Craig Silverstein <csilvers@google.com>
10721
10722 * TODO: New file.
10723
39d0cb0e
ILT
107242008-04-02 Ian Lance Taylor <iant@google.com>
10725
10726 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10727 parameters. Update for new key type to views_. Change all
10728 callers.
10729 (File_read::read): Adjust for byteshift in returned view.
10730 (File_read::add_view): New function, broken out of
10731 find_and_make_view.
10732 (File_read::make_view): New function, broken out of
10733 find_and_make_view.
10734 (File_read::find_or_make_view): Add offset and aligned
10735 parameters. Rewrite accordingly. Change all callers.
10736 (File_read::get_view): Add offset and aligned parameters. Adjust
10737 for byteshift in return value.
10738 (File_read::get_lasting_view): Likewise.
10739 * fileread.h (class File_read): Update declarations.
10740 (class File_read::View): Add byteshift_ field. Add byteshift to
10741 constructor. Add byteshift method.
10742 * archive.h (Archive::clear_uncached_views): New function.
10743 (Archive::get_view): Add aligned parameter. Change all callers.
10744 * object.h (Object::get_view): Add aligned parameter. Change all
10745 callers.
10746 (Object::get_lasting_view): Likewise.
10747
10748 * fileread.cc (File_read::release): Don't call clear_views if
10749 there are multiple objects.
10750 * fileread.h (File_read::clear_uncached_views): New function.
10751 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10752 on the archive.
10753
a1207466
CC
107542008-03-31 Cary Coutant <ccoutant@google.com>
10755
10756 Add thin archive support.
10757 * archive.cc (Archive::armagt): New const.
10758 (Archive::setup): Remove task parameter and calls to unlock.
10759 (Archive::unlock_nested_archives): New function.
10760 (Archive::read_header): Add nested_off parameter. Change
10761 all callers.
10762 (Archive::interpret_header): Likewise.
10763 (Archive::include_all_members): Change to handle thin
10764 archives.
10765 (Archive::include_member): Likewise.
10766 * archive.h (Archive::Archive): Add new parameters and
10767 initializers.
10768 (Archive::armagt): New const.
10769 (Archive::setup): Remove task parameter.
10770 (Archive::unlock_nested_archives): New function.
10771 (Archive::read_header): Add nested_off parameter.
10772 (Archive::interpret_header): Likewise.
10773 (Archive::Nested_archive_table): New typedef.
10774 (Archive::is_thin_archive_): New field.
10775 (Archive::nested_archives_): New field.
10776 (Archive::options_): New field.
10777 (Archive::dirpath_): New field.
10778 (Archive::task_): New field.
10779 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10780 for thin archives. Pass additional parameters to
10781 Archive::Archive. Unlock the archive file after calling
10782 Archive::setup.
cd536b21 10783
479f6503
ILT
107842008-03-29 Ian Lance Taylor <iant@google.com>
10785
686c8caf
ILT
10786 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10787 version symbol to be local.
10788 * testsuite/ver_test_4.sh: New file.
10789 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10790 (check_DATA): Add ver_test_4.syms.
10791 (ver_test_4.syms): New target.
10792 * testsuite/Makefile.in: Rebuild.
10793
ab794b6b
ILT
10794 * output.cc
10795 (Output_section::Input_section_sort_entry::has_priority): New
10796 function.
10797 (Output_section::Input_section_sort_entry::match_file_name): New
10798 function.
10799 (Output_section::Input_section_sort_entry::match_section_name):
10800 Remove.
10801 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10802 Remove.
10803 (Output_section::Input_section_sort_entry::match_section_file):
10804 Remove.
10805 (Output_section::Input_section_sort_compare::operator()): Rewrite
10806 using new Input_section_sort_entry functions. Sort crtbegin and
10807 crtend first. Sort sections with no priority before sections with
10808 a priority.
10809 * testsuite/initpri1.c (d3): Check j != 4.
10810 (cd5): New constructor/destructor function.
10811 (main): Check j != 2.
10812
479f6503
ILT
10813 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10814 new symbol when resolving, don't call set_is_default.
10815 * testsuite/ver_test_7.cc: New file.
10816 * testsuite/ver_test_7.sh: New file.
10817 * testsuite/Makefile.am (ver_test_7.so): New target.
10818 (ver_test_7.o): New target.
10819 (check_SCRIPTS): Add ver_test_7.sh.
10820 (check_DATA): Add ver_test_7.syms.
10821 (ver_test_7.syms): New target.
10822
2fd32231
ILT
108232008-03-28 Ian Lance Taylor <iant@google.com>
10824
10825 * layout.cc (Layout::layout): If we see an input section with a
10826 name that needs sorting, set the must_sort flag for the output
10827 section.
10828 (Layout::make_output_section): If the name of the output section
10829 indicates that it might require sorting, set the may_sort flag.
10830 * output.h (Output_section::may_sort_attached_input_sections): New
10831 function.
10832 (Output_section::set_may_sort_attached_input_sections): New
10833 function.
10834 (Output_section::must_sort_attached_input_sections): New
10835 function.
10836 (Output_section::set_must_sort_attached_input_sections): New
10837 function.
10838 (class Output_section): Declare Input_section_sort_entry. Define
10839 Input_section_sort_compare. Declare
10840 sort_attached_input_sections. Add new fields:
10841 may_sort_attached_input_sections_,
10842 must_sort_attached_input_sections_,
10843 attached_input_sections_are_sorted_.
10844 * output.cc (Output_section::Output_section): Initialize new
10845 fields.
10846 (Output_section::add_input_section): Add an entry to
10847 input_sections_ if may_sort or must_sort are true.
10848 (Output_section::set_final_data_size): Call
10849 sort_attached_input_sections if necessary.
10850 (Output_section::Input_section_sort_entry): Define new class.
10851 (Output_section::Input_section_sort_compare::operator()): New
10852 function.
10853 (Output_section::sort_attached_input_sections): New function.
10854 * configure.ac: Check whether the compiler supports constructor
10855 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10856 * testsuite/initpri1.c: New file.
10857 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10858 CONSTRUCTOR_PRIORITY.
10859 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10860 (initpri1_LDFLAGS): New variable.
10861 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10862
18e6b24e
ILT
108632008-03-27 Ian Lance Taylor <iant@google.com>
10864
49bdd526
ILT
10865 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10866 * testsuite/common_test_1.c: New file.
10867 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10868 (common_test_1_SOURCES): New variable.
10869 (common_test_1_DEPENDENCIES): New variable.
10870 (common_test_1_LDFLAGS): New variable.
10871
18e6b24e
ILT
10872 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10873 and commons_ correctly when NAME/VERSION does not override
10874 NAME/NULL.
10875 * testsuite/ver_test_6.c: New file.
10876 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10877 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10878 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10879
04bf7072
ILT
108802008-03-26 Ian Lance Taylor <iant@google.com>
10881
5871526f
ILT
10882 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10883 of an undefined symbol from a version script.
10884 * testsuite/Makefile.am (ver_test_5.so): New target.
10885 (ver_test_5.o): New target.
10886 (check_SCRIPTS): Add ver_test_5.sh.
10887 (check_DATA): Add ver_test_5.syms.
10888 (ver_test_5.syms): New target.
10889 * testsuite/ver_test_5.cc: New file.
10890 * testsuite/ver_test_5.script: New file.
10891 * testsuite/ver_test_5.sh: New file.
10892 * Makefile.in, testsuite/Makefile.in: Rebuild.
10893
04bf7072
ILT
10894 PR gold/5986
10895 Fix problems building gold with gcc 4.3.0.
10896 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10897 (gold_error_at_location, gold_warning_at_location): Use it.
10898 * configure.ac: Check whether we can compile and use a template
10899 function with a printf attribute.
10900 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10901 when jumping over bytes.
10902 * object.cc: Instantiate Object::read_section_data.
10903 * debug.h: Include <cstring>
10904 * dwarf_reader.cc: Include <algorithm>
10905 * main.cc: Include <cstring>.
10906 * options.cc: Include <cstring>.
10907 * output.cc: Include <cstring>.
10908 * script.cc: Include <cstring>.
10909 * script.h: Include <string>.
10910 * symtab.cc: Include <cstring> and <algorithm>.
10911 * target-select.cc: Include <cstring>.
10912 * version.cc: Include <string>.
10913 * testsuite/testmain.cc: Include <cstdlib>.
10914 * configure, config.in: Rebuild.
10915
874c5b28
ILT
109162008-03-25 Ian Lance Taylor <iant@google.com>
10917
819d6c3a
ILT
10918 * options.cc: Include "../bfd/bfdver.h".
10919 (options::help): Print bug reporting address.
10920
f4b2c6f5
ILT
10921 * version.cc (print_version): Adjust output for current value of
10922 BFD_VERSION_STRING.
10923
10924 * NEWS: New file.
10925
e96caa79
ILT
10926 * options.cc (options::help): Print list of supported targets.
10927 * target-select.h: Include <vector>.
10928 (class Target_selector): Make machine_, size_, and is_big_endian_
10929 fields const. Add bfd_name_ and instantiated_target_ fields.
10930 (Target_selector::Target_selector): Add bfd_name parameter.
10931 (Target_selector::recognize): Make non-virtual, call
10932 do_recognize.
10933 (Target_selector::recognize_by_name): Make non-virtual, call
10934 do_recognize_by_name.
10935 (Target_selector::supported_names): New function.
10936 (Target_selector::bfd_name): New function.
10937 (Target_selector::do_instantiate_target): New pure virtual
10938 function.
10939 (Target_selector::do_recognize): New virtual function.
10940 (Target_selector::do_recognize_by_name): New virtual function.
10941 (Target_selector::instantiate_target): New private function.
10942 (supported_target_names): Declare.
10943 * target-select.cc (Target_selector::Target_selector): Update for
10944 new parameter and fields.
10945 (select_target_by_name): Check that the name matches before
10946 calling recognize_by_name.
10947 (supported_target_names): New function.
10948 * i386.cc (class Target_selector_i386): Update Target_selector
10949 constructor call. Remove recognize and recognize_by_name. Add
10950 do_instantiate_target.
10951 * x86_64.cc (class Target_selector_x86_64): Likewise.
10952 * testsuite/testfile.cc (class Target_selector_test): Update for
10953 changes to Target_selector.
10954
874c5b28
ILT
10955 * README: Rewrite, with some notes on unsupported features.
10956
0a65a3a7
CC
109572008-03-24 Cary Coutant <ccoutant@google.com>
10958
10959 * i386.cc (Target_i386::Got_type): New enum declaration.
10960 (Target_i386::Scan::local): Updated callers of Output_data_got
10961 member functions.
10962 (Target_i386::Scan::global): Likewise.
10963 (Target_i386::Relocate::relocate): Likewise.
10964 (Target_i386::Relocate::relocate_tls): Likewise.
10965 * object.h (Got_offset_list): New class.
10966 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10967 (Sized_relobj::local_got_offset): Likewise.
10968 (Sized_relobj::set_local_got_offset): Likewise.
10969 (Sized_relobj::local_has_tls_got_offset): Removed.
10970 (Sized_relobj::local_tls_got_offset): Removed.
10971 (Sized_relobj::set_local_tls_got_offset): Removed.
10972 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10973 * output.cc (Output_data_got::add_global): Added got_type parameter.
10974 (Output_data_got::add_global_with_rel): Likewise.
10975 (Output_data_got::add_global_with_rela): Likewise.
10976 (Output_data_got::add_global_pair_with_rel): New function.
10977 (Output_data_got::add_global_pair_with_rela): New function.
10978 (Output_data_got::add_local): Added got_type parameter.
10979 (Output_data_got::add_local_with_rel): Likewise.
10980 (Output_data_got::add_local_with_rela): Likewise.
10981 (Output_data_got::add_local_pair_with_rel): New function.
10982 (Output_data_got::add_local_pair_with_rela): New function.
10983 (Output_data_got::add_global_tls): Removed.
10984 (Output_data_got::add_global_tls_with_rel): Removed.
10985 (Output_data_got::add_global_tls_with_rela): Removed.
10986 (Output_data_got::add_local_tls): Removed.
10987 (Output_data_got::add_local_tls_with_rel): Removed.
10988 (Output_data_got::add_local_tls_with_rela): Removed.
10989 * output.h (Output_data_got::add_global): Added got_type parameter.
10990 (Output_data_got::add_global_with_rel): Likewise.
10991 (Output_data_got::add_global_with_rela): Likewise.
10992 (Output_data_got::add_global_pair_with_rel): New function.
10993 (Output_data_got::add_global_pair_with_rela): New function.
10994 (Output_data_got::add_local): Added got_type parameter.
10995 (Output_data_got::add_local_with_rel): Likewise.
10996 (Output_data_got::add_local_with_rela): Likewise.
10997 (Output_data_got::add_local_pair_with_rel): New function.
10998 (Output_data_got::add_local_pair_with_rela): New function.
10999 (Output_data_got::add_global_tls): Removed.
11000 (Output_data_got::add_global_tls_with_rel): Removed.
11001 (Output_data_got::add_global_tls_with_rela): Removed.
11002 (Output_data_got::add_local_tls): Removed.
11003 (Output_data_got::add_local_tls_with_rel): Removed.
11004 (Output_data_got::add_local_tls_with_rela): Removed.
11005 * resolve.cc (Symbol::override_base_with_special): Removed
11006 reference to has_got_offset_ field.
11007 * symtab.cc (Symbol::init_fields): Replaced initialization
11008 of got_offset_ with got_offsets_. Removed initialization
11009 of has_got_offset_
53fcba31 11010 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11011 (Symbol::got_offset): Likewise.
11012 (Symbol::set_got_offset): Likewise.
11013 (Symbol::has_tls_got_offset): Removed.
11014 (Symbol::tls_got_offset): Removed.
11015 (Symbol::set_tls_got_offset): Removed.
11016 (Symbol::got_offset_): Removed.
11017 (Symbol::tls_mod_got_offset_): Removed.
11018 (Symbol::tls_pair_got_offset_): Removed.
11019 (Symbol::got_offsets_): New field.
11020 (Symbol::has_got_offset): Removed.
11021 (Symbol::has_tls_mod_got_offset): Removed.
11022 (Symbol::has_tls_pair_got_offset): Removed.
11023 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11024 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11025 member functions.
11026 (Target_x86_64::Scan::global): Likewise.
11027 (Target_x86_64::Relocate::relocate): Likewise.
11028 (Target_x86_64::Relocate::relocate_tls): Likewise.
11029
bd52eafb
BE
110302008-03-25 Ben Elliston <bje@au.ibm.com>
11031
11032 * yyscript.y: Fix spelling error in comment.
11033
8b105e34
ILT
110342008-03-24 Ian Lance Taylor <iant@google.com>
11035
8ed814a9
ILT
11036 * options.h (class General_options): Define build_id option.
11037 * layout.h (class Layout): Declare write_build_id, create_note,
11038 create_build_id. Add build_id_note_ member.
11039 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11040 "libiberty.h", "md5.h", "sha1.h".
11041 (Layout::Layout): Initialize eh_frame_data_,
11042 eh_frame_hdr_section_, and build_id_note_.
11043 (Layout::finalize): Call create_build_id.
11044 (Layout::create_note): New function, broken out of
11045 Layout::create_gold_note.
11046 (Layout::create_gold_note): Call create_note.
11047 (Layout::create_build_id): New function.
11048 (Layout::write_build_id): New function.
11049 (Close_task_runner::run): Call write_build_id.
11050
8b105e34
ILT
11051 * x86_64.cc: Correct license to GPLv3.
11052
086a1841
ILT
110532008-03-23 Ian Lance Taylor <iant@google.com>
11054
11055 * options.cc: Include "demangle.h".
11056 (parse_optional_string): New function.
11057 (parse_long_option): Handle takes_optional_argument.
11058 (parse_short_option): Update dash_z initializer. Handle
11059 takes_optional_argument.
11060 (General_options::General_options): Initialize do_demangle_.
11061 (General_options::finalize): Set do_demangle_. Handle demangling
11062 style.
11063 * options.h (parse_optional_string): Declare.
11064 (struct One_option): Add optional_arg field. Update constructor.
11065 Update call constructor calls. Add takes_optional_argument
11066 function.
11067 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11068 (DEFINE_optional_string): Define.
11069 (General_options::demangle): Change from DEFINE_bool to
11070 DEFINE_optional_string.
11071 (General_options::no_demangle): New function.
11072 (General_options::do_demangle): New function.
11073 (General_options::set_do_demangle): New function.
11074 (General_options::execstack_status_): Move definition to end of
11075 class definition.
11076 (General_options::static_): Likewise.
11077 (General_options::do_demangle_): New field.
11078 * object.cc (big_endian>::get_symbol_location_info): Call
11079 Options::do_demangle, not Options::demangle.
11080 * symtab.cc (demangle): Likewise.
11081
cbb93e63
ILT
110822008-03-22 Ian Lance Taylor <iant@google.com>
11083
11084 * gold.h: Include <cstddef> and <sys/types.h>
11085 * options.h: Include <cstring>.
11086
ec531623
ILT
110872008-03-21 Ian Lance Taylor <iant@google.com>
11088
11089 * Added source code to GNU binutils.
This page took 0.655885 seconds and 4 git commands to generate.