* archive.cc (Library_base::should_include_member): Pull in object
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
a10ae760
ILT
12011-05-24 Ian Lance Taylor <iant@google.com>
2
3 * archive.cc (Library_base::should_include_member): Pull in object
4 from archive if it defines the entry symbol.
5 * parameters.cc (Parameters::entry): New function.
6 * parameters.h (class Parameters): Declare entry.
7 * output.h (class Output_file_header): Remove entry_ field.
8 * output.cc (Output_file_header::Output_file_header): Remove entry
9 parameter. Change all callers.
10 (Output_file_header::entry): Use parameters->entry.
11 * gold.cc (queue_middle_tasks): Likewise.
12 * plugin.cc (Plugin_hook::run): Likewise.
13
aa92d6ed
CC
142011-05-24 Cary Coutant <ccoutant@google.com>
15
16 * gold.cc (queue_initial_tasks): Pass incremental base filename
17 to Output_file::open_base_file; don't print error message.
18 * incremental-dump.cc (main): Adjust call to
19 Output_file::open_for_modification.
20 * incremental-dump.cc (main): Likewise.
21 * incremental.cc (Incremental_inputs::report_command_line):
22 Ignore --incremental-base option when comparing command lines.
23 Ignore parameter when given as separate argument.
24 * options.h (class General_options): Add --incremental-base.
25 * output.cc (Output_file::Output_file):
26 (Output_file::open_base_file): Add base_name and writable parameters;
27 read base file into new file; print error message here.
28 (Output_file::map_no_anonymous): Add writable parameter; adjust all
29 callers.
30 * output.h (Output_file::open_for_modification): Rename to...
31 (Output_file::open_base_file): ...this; add base_name and
32 writable parameters; adjust all callers.
33 (Output_file::map_no_anonymous): Add writable parameter; adjust all
34 callers.
35 * testsuite/Makefile.am (incremental_test_4): Test
36 --incremental-base.
37 * testsuite/Makefile.in: Regenerate.
38
2eedd706
CC
392011-05-24 Cary Coutant <ccoutant@google.com>
40
41 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
42 incremental_test_4.
43 * testsuite/Makefile.in: Regenerate.
44 * testsuite/two_file_test_1_v1.cc: New test source file.
45 * testsuite/two_file_test_1b_v1.cc: New test source file.
46 * testsuite/two_file_test_2_v1.cc: New test source file.
47
0f1c85a6
CC
482011-05-24 Cary Coutant <ccoutant@google.com>
49
50 * dynobj.h (Dynobj::do_dynobj): New function.
51 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
52 flag and soname for shared objects.
53 * incremental.cc (Incremental_inputs::report_object): Make
54 either Incremental_object_entry or Incremental_dynobj_entry; add
55 soname to string table.
56 (Incremental_inputs::report_input_section): Add assertion.
57 (Output_section_incremental_inputs::set_final_data_size): Adjust
58 type of input file entry for shared libraries; adjust size of
59 shared library info entry.
60 (Output_section_incremental_inputs::write_input_files): Write
61 as_needed flag for shared libraries.
62 (Output_section_incremental_inputs::write_info_blocks): Adjust type
63 of input file entry for shared libraries; write soname.
64 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
65 soname from incremental info.
66 * incremental.h (enum Incremental_input_flags): Add
67 INCREMENTAL_INPUT_AS_NEEDED.
68 (Incremental_input_entry::Incremental_input_entry): Initialize new
69 data member.
70 (Incremental_input_entry::set_as_needed): New function.
71 (Incremental_input_entry::as_needed): New function.
72 (Incremental_input_entry::do_dynobj_entry): New function.
73 (Incremental_input_entry::as_needed_): New data member.
74 (Incremental_object_entry::Incremental_object_entry): Don't check
75 for shared library.
76 (Incremental_object_entry::do_type): Likewise.
77 (class Incremental_dynobj_entry): New class.
78 (Incremental_input_entry_reader::as_needed): New function.
79 (Incremental_input_entry_reader::get_soname): New function.
80 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
81 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
82 size of shared library info entry.
83 * layout.cc (Layout::finish_dynamic_section): Don't test for
84 incremental link when adding DT_NEEDED entries.
85 * object.h (Object::Object): Initialize new data member.
86 (Object::dynobj): New function.
87 (Object::set_as_needed): New function.
88 (Object::as_needed): New function.
89 (Object::do_dynobj): New function.
90 (Object::as_needed_): New data member.
91
6fa2a40b
CC
922011-05-24 Cary Coutant <ccoutant@google.com>
93
94 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
95 info; adjust display of GOT entries.
96 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
97 vector of input objects; remove file_status_.
98 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
99 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
100 got_plt reader; call target hooks to reserve GOT entries.
101 (Output_section_incremental_inputs::set_final_data_size): Adjust size
102 of input file info header and GOT info entry.
103 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
104 relocation info.
105 (Got_plt_view_info::got_descriptor): Remove.
106 (Got_plt_view_info::sym_index): New data member.
107 (Got_plt_view_info::input_index): New data member.
108 (Local_got_offset_visitor::visit): Write input file index.
109 (Global_got_offset_visitor::visit): Write 0 for input file index.
110 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
111 with sym_index and input_index.
112 (Output_section_incremental_inputs::write_got_plt): Adjust size of
113 incremental info GOT entry; replace got_descriptor with input_index.
114 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
115 map from input file index to object.
116 (Sized_relobj_incr::do_layout): Replace direct data member reference
117 with accessor function.
118 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
119 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
120 Adjust size of input file info header.
121 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
122 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
123 (Incremental_input_entry_reader::get_input_section): Adjust size of
124 input file info header.
125 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
126 of incremental info GOT entry.
127 (Incremental_got_plt_reader::get_got_desc): Remove.
128 (Incremental_got_plt_reader::get_got_symndx): New function.
129 (Incremental_got_plt_reader::get_got_input_index): New function.
130 (Sized_incremental_binary::Sized_incremental_binary): Remove
131 file_status_; add input_objects_.
132 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
133 (Sized_incremental_binary::set_file_is_unchanged): Remove.
134 (Sized_incremental_binary::file_is_unchanged): Remove.
135 (Sized_incremental_binary::set_input_object): New function.
136 (Sized_incremental_binary::input_object): New function.
137 (Sized_incremental_binary::file_status_): Remove.
138 (Sized_incremental_binary::input_objects_): New data member.
139 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
140 references.
141 (Sized_relobj_incr::invalid_address): Move to base class.
142 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
143 class.
144 (Sized_relobj_incr::do_output_section_offset): Likewise.
145 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
146 (Sized_relobj_incr::section_offsets_): Likewise.
147 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
148 function.
149 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
150 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
151 with accessor function.
152 (Sized_relobj_file::do_layout): Likewise.
153 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
154 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
155 (Sized_relobj_file::compute_final_local_value): Replace refs to
156 section_offsets_ with accessor function.
157 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
158 * object.h (Relobj::Relobj): Initialize new data members.
159 (Relobj::add_dyn_reloc): New function.
160 (Relobj::first_dyn_reloc): New function.
161 (Relobj::dyn_reloc_count): New function.
162 (Relobj::first_dyn_reloc_): New data member.
163 (Relobj::dyn_reloc_count_): New data member.
164 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
165 references.
166 (Sized_relobj::Address): New typedef.
167 (Sized_relobj::invalid_address): Move here from child class.
168 (Sized_relobj::Sized_relobj): Initialize new data members.
169 (Sized_relobj::sized_relobj): New function.
170 (Sized_relobj::is_output_section_offset_invalid): Move here from
171 child class.
172 (Sized_relobj::get_output_section_offset): Likewise.
173 (Sized_relobj::local_has_got_offset): Likewise.
174 (Sized_relobj::local_got_offset): Likewise.
175 (Sized_relobj::set_local_got_offset): Likewise.
176 (Sized_relobj::do_for_all_local_got_entries): Likewise.
177 (Sized_relobj::clear_got_offsets): New function.
178 (Sized_relobj::section_offsets): Move here from child class.
179 (Sized_relobj::do_output_section_offset): Likewise.
180 (Sized_relobj::do_set_section_offset): Likewise.
181 (Sized_relobj::Local_got_offsets): Likewise.
182 (Sized_relobj::local_got_offsets_): Likewise.
183 (Sized_relobj::section_offsets_): Likewise.
184 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
185 references.
186 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
187 class.
188 (Sized_relobj_file::sized_relobj): New function
189 (Sized_relobj_file::local_has_got_offset): Move to base class.
190 (Sized_relobj_file::local_got_offset): Likewise.
191 (Sized_relobj_file::set_local_got_offset): Likewise.
192 (Sized_relobj_file::get_output_section_offset): Likewise.
193 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
194 (Sized_relobj_file::do_output_section_offset): Likewise.
195 (Sized_relobj_file::do_set_section_offset): Likewise.
196 (Sized_relobj_file::Local_got_offsets): Likewise.
197 (Sized_relobj_file::local_got_offsets_): Likewise.
198 (Sized_relobj_file::section_offsets_): Likewise.
199 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
200 (all constructors).
201 (set_needs_dynsym_index): Convert relobj to derived class pointer.
202 (Output_reloc::get_symbol_index): Likewise.
203 (Output_reloc::local_section_offset): Likewise.
204 (Output_reloc::get_address): Likewise.
205 (Output_reloc::symbol_value): Likewise.
206 (Output_data_got::reserve_slot): Move to class definition.
207 (Output_data_got::reserve_local): New function.
208 (Output_data_got::reserve_slot_for_global): Remove.
209 (Output_data_got::reserve_global): New function.
210 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
211 (all constructors, two instantiations).
212 (Output_reloc::get_relobj): New function (two instantiations).
213 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
214 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
215 (Output_data_reloc::add_global): Adjust type of relobj.
216 (Output_data_reloc::add_global_relative): Likewise.
217 (Output_data_reloc::add_symbolless_global_addend): Likewise.
218 (Output_data_reloc::add_local): Likewise.
219 (Output_data_reloc::add_local_relative): Likewise.
220 (Output_data_reloc::add_symbolless_local_addend): Likewise.
221 (Output_data_reloc::add_local_section): Likewise.
222 (Output_data_reloc::add_output_section): Likewise.
223 (Output_data_reloc::add_absolute): Likewise.
224 (Output_data_reloc::add_target_specific): Likewise.
225 (Output_data_got::reserve_slot): Move definition here.
226 (Output_data_got::reserve_local): New function.
227 (Output_data_got::reserve_global): New function.
228 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
229 section_offsets_ with accessor function.
230 (Sized_relobj_file::write_sections): Likewise.
231 (Sized_relobj_file::do_relocate_sections): Likewise.
232 * target.h (Sized_target::reserve_local_got_entry): New function.
233 (Sized_target::reserve_global_got_entry): New function.
234 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
235 (Target_x86_64::reserve_global_got_entry): New function.
236 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
237
4829d394
CC
2382011-05-23 Cary Coutant <ccoutant@google.com>
239
240 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
241 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
242 bit when checking got_type.
243 * incremental.cc (Sized_incremental_binary::setup_readers):
244 Store symbol table and string table locations; initialize bit vector
245 of file status flags.
246 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
247 unchanged files.
248 (Sized_incremental_binary::do_process_got_plt): New function.
249 (Sized_incremental_binary::get_symtab_view): Use stored locations.
250 (Output_section_incremental_inputs::set_final_data_size): Record
251 file index for each input file.
252 (Output_section_incremental_inputs::write_got_plt): Store file index
253 instead of input entry offset for each GOT entry.
254 * incremental.h
255 (Incremental_input_entry::Incremental_input_entry): Initialize new
256 data member.
257 (Incremental_input_entry::set_offset): Store file index.
258 (Incremental_input_entry::get_file_index): New function.
259 (Incremental_input_entry::file_index_): New data member.
260 (Incremental_binary::process_got_plt): New function.
261 (Incremental_binary::do_process_got_plt): New function.
262 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
263 data members.
264 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
265 (Sized_incremental_binary::set_file_is_unchanged): New function.
266 (Sized_incremental_binary::file_is_unchanged): New function.
267 (Sized_incremental_binary::do_process_got_plt): New function.
268 (Sized_incremental_binary::file_status_): New data member.
269 (Sized_incremental_binary::main_symtab_loc_): New data member.
270 (Sized_incremental_binary::main_strtab_loc_): New data member.
271 * output.cc (Output_data_got::Got_entry::write): Add case
272 RESERVED_CODE.
273 (Output_data_got::add_global): Call add_got_entry.
274 (Output_data_got::add_global_plt): Likewise.
275 (Output_data_got::add_global_with_rel): Likewise.
276 (Output_data_got::add_global_with_rela): Likewise.
277 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
278 (Output_data_got::add_global_pair_with_rela): Likewise.
279 (Output_data_got::add_local): Call add_got_entry.
280 (Output_data_got::add_local_plt): Likewise.
281 (Output_data_got::add_local_with_rel): Likewise.
282 (Output_data_got::add_local_with_rela): Likewise.
283 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
284 (Output_data_got::add_local_pair_with_rela): Likewise.
285 (Output_data_got::reserve_slot): New function.
286 (Output_data_got::reserve_slot_for_global): New function.
287 (Output_data_got::add_got_entry): New function.
288 (Output_data_got::add_got_entry_pair): New function.
289 (Output_section::add_output_section_data): Edit FIXME.
290 * output.h
291 (Output_section_data_build::Output_section_data_build): New
292 constructor with size parameter.
293 (Output_data_space::Output_data_space): Likewise.
294 (Output_data_got::Output_data_got): Initialize new data member; new
295 constructor with size parameter.
296 (Output_data_got::add_constant): Call add_got_entry.
297 (Output_data_got::reserve_slot): New function.
298 (Output_data_got::reserve_slot_for_global): New function.
299 (class Output_data_got::Got_entry): Add RESERVED_CODE.
300 (Output_data_got::add_got_entry): New function.
301 (Output_data_got::add_got_entry_pair): New function.
302 (Output_data_got::free_list_): New data member.
303 * target.h (Sized_target::init_got_plt_for_update): New function.
304 (Sized_target::register_global_plt_entry): New function.
305 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
306 Initialize new data member; call init; add constructor with PLT count.
307 (Output_data_plt_x86_64::init): New function.
308 (Output_data_plt_x86_64::add_relocation): New function.
309 (Output_data_plt_x86_64::reserve_slot): New function.
310 (Output_data_plt_x86_64::free_list_): New data member.
311 (Target_x86_64::init_got_plt_for_update): New function.
312 (Target_x86_64::register_global_plt_entry): New function.
313 (Output_data_plt_x86_64::add_entry): Allocate from free list for
314 incremental updates.
315 (Output_data_plt_x86_64::add_relocation): New function.
316 * testsuite/object_unittest.cc (Object_test): Set default options.
317
ec69d6da
ILT
3182011-05-16 Ian Lance Taylor <iant@google.com>
319
320 * options.h (class General_options): Make -i a synonym for -r.
321
732e31de
ILT
3222011-05-16 Ian Lance Taylor <iant@google.com>
323
324 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
325
403676b5
CC
3262011-05-10 Cary Coutant <ccoutant@google.com>
327
328 * object.cc (Sized_relobj::do_count_local_symbols): Check for
329 strip_all (-s).
330
5b7b7d6e
ILT
3312011-05-06 Ian Lance Taylor <iant@google.com>
332
333 * layout.cc (Layout::layout): If the output section flags change,
334 update the ordering.
335
f0f9babf
CC
3362011-04-25 Cary Coutant <ccoutant@google.com>
337
338 * incremental-dump.cc (dump_incremental_inputs): Print local
339 symbol info for each input file.
340 * incremental.cc
341 (Output_section_incremental_inputs::set_final_data_size): Add local
342 symbol info to input file entries in incremental info.
343 (Output_section_incremental_inputs::write_info_blocks): Likewise.
344 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
345 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
346 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
347 implementation.
348 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
349 (Sized_incr_relobj::do_relocate): Write the local symbols.
350 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
351 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
352 Adjust size of input file header.
353 (Incremental_inputs_reader::get_local_symbol_offset): New function.
354 (Incremental_inputs_reader::get_local_symbol_count): New function.
355 (Incremental_inputs_reader::get_input_section): Adjust size of input
356 file header.
357 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
358 (Sized_incr_relobj::This): New typedef.
359 (Sized_incr_relobj::sym_size): New const data member.
360 (Sized_incr_relobj::Local_symbol): New struct.
361 (Sized_incr_relobj::do_output_local_symbol_count): New function.
362 (Sized_incr_relobj::do_local_symbol_offset): New function.
363 (Sized_incr_relobj::local_symbol_count_): New data member.
364 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
365 (Sized_incr_relobj::local_symbol_index_): New data member.
366 (Sized_incr_relobj::local_symbol_offset_): New data member.
367 (Sized_incr_relobj::local_dynsym_offset_): New data member.
368 (Sized_incr_relobj::local_symbols_): New data member.
369 * object.h (Relobj::output_local_symbol_count): New function.
370 (Relobj::local_symbol_offset): New function.
371 (Relobj::do_output_local_symbol_count): New function.
372 (Relobj::do_local_symbol_offset): New function.
373 (Sized_relobj::do_output_local_symbol_count): New function.
374 (Sized_relobj::do_local_symbol_offset): New function.
375
d0a9ace3
ILT
3762011-04-22 Vladimir Simonov <sv@sw.ru>
377
378 * descriptors.cc (set_close_on_exec): New function.
379 (Descriptors::open): Use set_close_on_exec.
380 * output.cc (S_ISLNK): Define if not defined.
381
94a3fc8b
CC
3822011-04-22 Cary Coutant <ccoutant@google.com>
383
384 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
385 global symbol map.
386 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
387 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
388 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
389 relocations.
390 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
391 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
392 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
393 * incremental.h
394 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
395 function.
396 (Incremental_binary::apply_incremental_relocs): New function.
397 (Incremental_binary::do_apply_incremental_relocs): New function.
398 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
399 data member.
400 (Sized_incremental_binary::add_global_symbol): New function.
401 (Sized_incremental_binary::global_symbol): New function.
402 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
403 (Sized_incremental_binary::symbol_map_): New data member.
404 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
405 * target.h (Sized_target::apply_relocation): New function.
406 * target-reloc.h (apply_relocation): New function.
407 * x86_64.cc (Target_x86_64::apply_relocation): New function.
408
c87e4302
DK
4092011-04-22 Doug Kwan <dougkwan@google.com>
410
411 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
412 flag of a SHT_ARM_EXIDX section.
413 * testsuite/Makefile.am (arm_exidx_test): New test rules.
414 * testsuite/Makefile.in: Regenerate.
415 * testsuite/arm_exidx_test.s: New file.
416 * testsuite/arm_exidx_test.sh: Same.
417
e7782cf6
CC
4182011-04-20 Cary Coutant <ccoutant@google.com>
419
420 PR gold/12689
421 * archive.h (Incremental_archive_entry::Archive_member):
422 Initialize arg_serial_ (second constructor).
423
308ecdc7
ILT
4242011-04-17 Ian Lance Taylor <iant@google.com>
425
426 * object.cc (Relocate_info::location): Simplify location string.
427 * errors.cc (Errors::error_at_location): Don't print program
428 name.
429 (Errors::warning_at_location): Likewise.
430 (Errors::undefined_symbol): Likewise.
431 * testsuite/debug_msg.sh: Update accordingly.
432
bec5b579
CC
4332011-04-14 Cary Coutant <ccoutant@google.com>
434
435 * gold/layout.cc (Layout::symtab_section_offset): New function.
436 * gold/layout.h (Layout::symtab_section_offset): New function.
437 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
438
88597d34
ILT
4392011-04-12 Ian Lance Taylor <iant@google.com>
440
441 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
442 with MREMAP_MAYMOVE.
443 * output.h (class Output_file): Add map_is_allocated_ field.
444 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
445 not available, provide stubs. If mremap is not available, #define
446 it to gold_mremap.
447 (MREMAP_MAYMOVE): Define if not defined.
448 (Output_file::Output_file): Initialize map_is_allocated_.
449 (Output_file::resize): Check map_is_allocated_.
450 (Output_file::map_anonymous): If mmap fails, use malloc.
451 (Output_file::unmap): Don't do anything for an anonymous map.
452 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
453 is not available, provide stubs.
454 (File_read::View::~View): Use free rather than delete[].
455 (File_read::make_view): Use malloc rather than new[]. If mmap
456 fails, use malloc.
457 (File_read::find_or_make_view): Use malloc rather than new[].
458 * gold.h: Remove HAVE_REMAP code.
459 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
460 exists. Rename mremap to gold_mremap. If mmap is not available
461 don't do anything.
462 * configure, config.in: Rebuild.
463
11e361bc
ILT
4642011-04-11 Ian Lance Taylor <iant@google.com>
465
466 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
467 initialize local variable v.
468
cdc29364
CC
4692011-04-11 Cary Coutant <ccoutant@google.com>
470
471 * archive.cc (Archive::include_member): Adjust call to
472 report_object.
473 (Add_archive_symbols::run): Track argument serial numbers.
474 (Lib_group::include_member): Likewise.
475 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
476 * archive.h (Incremental_archive_entry::Archive_member):
477 Initialize arg_serial_.
478 (Archive_member::arg_serial_): New data member.
479 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
480 (Sized_dynobj::do_add_symbols): Track symbols when doing an
481 incremental link.
482 (Sized_dynobj::do_for_all_local_got_entries): New function.
483 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
484 function.
485 * fileread.cc (get_mtime): New function.
486 * fileread.h (get_mtime): New function.
487 * gold.cc (queue_initial_tasks): Check for incremental update.
488 (process_incremental_input): New function.
489 (queue_middle_tasks): Don't force valid target for incremental
490 update.
491 * incremental-dump.cc (find_input_containing_global): Adjust
492 size of symbol info entry.
493 (dump_incremental_inputs): Dump argument serial number and
494 in_system_directory flag; bias shndx by 1; print symbol names
495 when dumping per-file symbol lists; use new symbol info readers.
496 * incremental.cc
497 (Output_section_incremental_inputs:update_data_size): New function.
498 (Sized_incremental_binary::setup_readers): Setup input readers
499 for each input file; build maps for files added from libraries
500 and scripts.
501 (Sized_incremental_binary::check_input_args): New function.
502 (Sized_incremental_binary::do_check_inputs): Build map of argument
503 serial numbers to input arguments.
504 (Sized_incremental_binary::do_file_has_changed): Rename
505 do_file_is_unchanged to this; compare file modification times.
506 (Sized_incremental_binary::do_init_layout): New function.
507 (Sized_incremental_binary::do_reserve_layout): New function.
508 (Sized_incremental_binary::do_get_input_reader): Remove.
509 (Sized_incremental_binary::get_symtab_view): New function.
510 (Incremental_checker::can_incrementally_link_output_file): Remove.
511 (Incremental_inputs::report_command_line): Exclude --debug options.
512 (Incremental_inputs::report_archive_begin): Add parameter; track
513 argument serial numbers; don't put input file entry for archive
514 before archive members.
515 (Incremental_inputs::report_archive_end): Put input file entry
516 for archive after archive members.
517 (Incremental_inputs::report_object): Add parameter; track argument
518 serial numbers and in_system_directory flag.
519 (Incremental_inputs::report_script): Add parameter; track argument
520 serial numbers.
521 (Output_section_incremental_inputs::set_final_data_size): Adjust
522 size of symbol info entry; check for forwarding symbols.
523 (Output_section_incremental_inputs::write_input_files): Write
524 in_system_directory flag and argument serial number.
525 (Output_section_incremental_inputs::write_info_blocks): Map section
526 indices between incremental info and original input file; store
527 input section index for each symbol.
528 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
529 change operator() to visit().
530 (class Global_got_offset_visitor): Likewise.
531 (class Global_symbol_visitor_got_plt):
532 (Output_section_incremental_inputs::write_got_plt): Use new visitor
533 classes.
534 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
535 (Sized_incr_relobj::do_read_symbols): New function.
536 (Sized_incr_relobj::do_layout): New function.
537 (Sized_incr_relobj::do_layout_deferred_sections): New function.
538 (Sized_incr_relobj::do_add_symbols): New function.
539 (Sized_incr_relobj::do_should_include_member): New function.
540 (Sized_incr_relobj::do_for_all_global_symbols): New function.
541 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
542 (Sized_incr_relobj::do_section_size): New function.
543 (Sized_incr_relobj::do_section_name): New function.
544 (Sized_incr_relobj::do_section_contents): New function.
545 (Sized_incr_relobj::do_section_flags): New function.
546 (Sized_incr_relobj::do_section_entsize): New function.
547 (Sized_incr_relobj::do_section_address): New function.
548 (Sized_incr_relobj::do_section_type): New function.
549 (Sized_incr_relobj::do_section_link): New function.
550 (Sized_incr_relobj::do_section_info): New function.
551 (Sized_incr_relobj::do_section_addralign): New function.
552 (Sized_incr_relobj::do_initialize_xindex): New function.
553 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
554 (Sized_incr_relobj::do_read_relocs): New function.
555 (Sized_incr_relobj::do_gc_process_relocs): New function.
556 (Sized_incr_relobj::do_scan_relocs): New function.
557 (Sized_incr_relobj::do_count_local_symbols): New function.
558 (Sized_incr_relobj::do_finalize_local_symbols): New function.
559 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
560 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
561 (Sized_incr_relobj::do_relocate): New function.
562 (Sized_incr_relobj::do_set_section_offset): New function.
563 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
564 (Sized_incr_dynobj::do_read_symbols): New function.
565 (Sized_incr_dynobj::do_layout): New function.
566 (Sized_incr_dynobj::do_add_symbols): New function.
567 (Sized_incr_dynobj::do_should_include_member): New function.
568 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
569 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
570 (Sized_incr_dynobj::do_section_size): New function.
571 (Sized_incr_dynobj::do_section_name): New function.
572 (Sized_incr_dynobj::do_section_contents): New function.
573 (Sized_incr_dynobj::do_section_flags): New function.
574 (Sized_incr_dynobj::do_section_entsize): New function.
575 (Sized_incr_dynobj::do_section_address): New function.
576 (Sized_incr_dynobj::do_section_type): New function.
577 (Sized_incr_dynobj::do_section_link): New function.
578 (Sized_incr_dynobj::do_section_info): New function.
579 (Sized_incr_dynobj::do_section_addralign): New function.
580 (Sized_incr_dynobj::do_initialize_xindex): New function.
581 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
582 (make_sized_incremental_object): New function.
583 (Incremental_library::copy_unused_symbols): New function.
584 (Incremental_library::do_for_all_unused_symbols): New function.
585 * incremental.h (enum Incremental_input_flags): New type.
586 (class Incremental_checker): Remove.
587 (Incremental_input_entry::Incremental_input_entry): Add argument
588 serial number.
589 (Incremental_input_entry::arg_serial): New function.
590 (Incremental_input_entry::set_is_in_system_directory): New function.
591 (Incremental_input_entry::is_in_system_directory): New function.
592 (Incremental_input_entry::arg_serial_): New data member.
593 (Incremental_input_entry::is_in_system_directory_): New data member.
594 (class Script_info): Move here from script.h.
595 (Script_info::Script_info): Add filename parameter.
596 (Script_info::filename): New function.
597 (Script_info::filename_): New data member.
598 (Incremental_script_entry::Incremental_script_entry): Add argument
599 serial number.
600 (Incremental_object_entry::Incremental_object_entry): Likewise.
601 (Incremental_object_entry::add_input_section): Build list of input
602 sections with map to original shndx.
603 (Incremental_object_entry::get_input_section_index): New function.
604 (Incremental_object_entry::shndx_): New data member.
605 (Incremental_object_entry::name_key_): Rename; adjust all refs.
606 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
607 (Incremental_archive_entry::Incremental_archive_entry): Add argument
608 serial number.
609 (Incremental_inputs::report_archive_begin): Likewise.
610 (Incremental_inputs::report_object): Likewise.
611 (Incremental_inputs::report_script): Likewise.
612 (class Incremental_global_symbol_reader): New class.
613 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
614 and store flags and input file type.
615 (Incremental_input_entry_reader::arg_serial): New function.
616 (Incremental_input_entry_reader::type): Extract type from flags.
617 (Incremental_input_entry_reader::is_in_system_directory): New function.
618 (Incremental_input_entry_reader::get_input_section_count): Call
619 accessor function for type.
620 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
621 function for type; adjust size of global symbol entry.
622 (Incremental_input_entry_reader::get_global_symbol_count): Call
623 accessor function for type.
624 (Incremental_input_entry_reader::get_object_count): Likewise.
625 (Incremental_input_entry_reader::get_object_offset): Likewise.
626 (Incremental_input_entry_reader::get_member_count): Likewise.
627 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
628 (Incremental_input_entry_reader::get_member_offset): Likewise.
629 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
630 (Incremental_input_entry_reader::Global_symbol_info): Remove.
631 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
632 (Incremental_input_entry_reader::get_global_symbol_reader): New
633 function.
634 (Incremental_input_entry_reader::get_output_symbol_index): New
635 function.
636 (Incremental_input_entry_reader::type_): Remove.
637 (Incremental_input_entry_reader::flags_): New data member.
638 (Incremental_inputs_reader::input_file_offset): New function.
639 (Incremental_inputs_reader::input_file_index): New function.
640 (Incremental_inputs_reader::input_file): Call input_file_offset.
641 (Incremental_inputs_reader::input_file_at_offset): New function.
642 (Incremental_relocs_reader::get_r_type): Reformat.
643 (Incremental_relocs_reader::get_r_shndx): Reformat.
644 (Incremental_relocs_reader::get_r_offset): Reformat.
645 (Incremental_relocs_reader::data): New function.
646 (Incremental_binary::Incremental_binary): Initialize new data members.
647 (Incremental_binary::check_inputs): Add cmdline parameter.
648 (Incremental_binary::file_is_unchanged): Remove.
649 (Input_reader::arg_serial): New function.
650 (Input_reader::get_unused_symbol_count): New function.
651 (Input_reader::get_unused_symbol): New function.
652 (Input_reader::do_arg_serial): New function.
653 (Input_reader::do_get_unused_symbol_count): New function.
654 (Input_reader::do_get_unused_symbol): New function.
655 (Incremental_binary::input_file_count): New function.
656 (Incremental_binary::get_input_reader): Change signature to use
657 index instead of filename.
658 (Incremental_binary::file_has_changed): New function.
659 (Incremental_binary::get_input_argument): New function.
660 (Incremental_binary::get_library): New function.
661 (Incremental_binary::get_script_info): New function.
662 (Incremental_binary::init_layout): New function.
663 (Incremental_binary::reserve_layout): New function.
664 (Incremental_binary::output_file): New function.
665 (Incremental_binary::do_check_inputs): New function.
666 (Incremental_binary::do_file_is_unchanged): Remove.
667 (Incremental_binary::do_file_has_changed): New function.
668 (Incremental_binary::do_init_layout): New function.
669 (Incremental_binary::do_reserve_layout): New function.
670 (Incremental_binary::do_input_file_count): New function.
671 (Incremental_binary::do_get_input_reader): Change signature.
672 (Incremental_binary::input_args_map_): New data member.
673 (Incremental_binary::library_map_): New data member.
674 (Incremental_binary::script_map_): New data member.
675 (Sized_incremental_binary::Sized_incremental_binary): Initialize
676 new data members.
677 (Sized_incremental_binary::output_section): New function.
678 (Sized_incremental_binary::inputs_reader): Add const.
679 (Sized_incremental_binary::symtab_reader): Add const.
680 (Sized_incremental_binary::relocs_reader): Add const.
681 (Sized_incremental_binary::got_plt_reader): Add const.
682 (Sized_incremental_binary::get_symtab_view): New function.
683 (Sized_incremental_binary::Inputs_reader): New typedef.
684 (Sized_incremental_binary::Input_entry_reader): New typedef.
685 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
686 (Sized_incremental_binary::do_file_is_unchanged): Remove.
687 (Sized_incremental_binary::do_file_has_changed): New function.
688 (Sized_incremental_binary::do_init_layout): New function.
689 (Sized_incremental_binary::do_reserve_layout): New function.
690 (Sized_input_reader::Inputs_reader): Remove.
691 (Sized_input_reader::Input_entry_reader): Remove.
692 (Sized_input_reader::do_arg_serial): New function.
693 (Sized_input_reader::do_get_unused_symbol_count): New function.
694 (Sized_input_reader::do_get_unused_symbol): New function.
695 (Sized_incremental_binary::do_input_file_count): New function.
696 (Sized_incremental_binary::do_get_input_reader): Change signature;
697 use index instead of filename.
698 (Sized_incremental_binary::section_map_): New data member.
699 (Sized_incremental_binary::input_entry_readers_): New data member.
700 (class Sized_incr_relobj): New class.
701 (class Sized_incr_dynobj): New class.
702 (make_sized_incremental_object): New function.
703 (class Incremental_library): New class.
704 * layout.cc (Free_list::num_lists): New static data member.
705 (Free_list::num_nodes): New static data member.
706 (Free_list::num_removes): New static data member.
707 (Free_list::num_remove_visits): New static data member.
708 (Free_list::num_allocates): New static data member.
709 (Free_list::num_allocate_visits): New static data member.
710 (Free_list::init): New function.
711 (Free_list::remove): New function.
712 (Free_list::allocate): New function.
713 (Free_list::dump): New function.
714 (Free_list::print_stats): New function.
715 (Layout_task_runner::run): Resize output file for incremental updates.
716 (Layout::Layout): Initialize new data members.
717 (Layout::set_incremental_base): New function.
718 (Layout::init_fixed_output_section): New function.
719 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
720 incremental updates.
721 (Layout::create_gold_note): Do not create gold note section for
722 incremental updates.
723 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
724 for incremental updates.
725 (Layout::set_section_offsets): For incremental updates, allocate space
726 from free list.
727 (Layout::create_symtab_sections): Layout with offsets relative to
728 start of section; for incremental updates, allocate space from free
729 list.
730 (Layout::create_shdrs): For incremental updates, allocate space from
731 free list.
732 (Layout::finish_dynamic_section): For incremental updates, do not
733 check --as-needed (fixed in subsequent patch).
734 * layout.h (class Free_list): New class.
735 (Layout::set_incremental_base): New function.
736 (Layout::incremental_base): New function.
737 (Layout::init_fixed_output_section): New function.
738 (Layout::allocate): New function.
739 (Layout::incremental_base_): New data member.
740 (Layout::free_list_): New data member.
741 * main.cc (main): Print Free_list statistics.
742 * object.cc (Relobj::finalize_incremental_relocs): Add
743 clear_counts parameter; clear counts only when clear_counts is set.
744 (Sized_relobj::Sized_relobj): Initialize new base class.
745 (Sized_relobj::do_layout): Don't report special sections.
746 (Sized_relobj::do_for_all_local_got_entries): New function.
747 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
748 symtab_off to all symbol table offsets.
749 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
750 * object.h (class Got_offset_list): Move to top of file.
751 (Object::Object): Allow case where input_file == NULL.
752 (Object::~Object): Likewise.
753 (Object::input_file): Assert that input_file != NULL.
754 (Object::lock): Allow case where input_file == NULL.
755 (Object::unlock): Likewise.
756 (Object::is_locked): Likewise.
757 (Object::token): Likewise.
758 (Object::release): Likewise.
759 (Object::is_incremental): New function.
760 (Object::get_mtime): New function.
761 (Object::for_all_local_got_entries): New function.
762 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
763 (Object::set_is_in_system_directory): New function.
764 (Object::is_in_system_directory): New function.
765 (Object::do_is_incremental): New function.
766 (Object::do_get_mtime): New function.
767 (Object::do_for_all_local_got_entries): New function.
768 (Object::is_in_system_directory_): New data member.
769 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
770 (class Sized_relobj_base): New class.
771 (class Sized_relobj): Derive from Sized_relobj_base.
772 (class Sized_relobj::Symbols): Redeclare from base class.
773 (class Sized_relobj::local_got_offset_list): Remove.
774 (class Sized_relobj::Output_sections): Redeclare from base class.
775 (class Sized_relobj::do_for_all_local_got_entries): New function.
776 (class Sized_relobj::write_local_symbols): Add offset parameter.
777 (class Sized_relobj::local_symbol_offset_): Update comment.
778 (class Sized_relobj::local_dynsym_offset_): Update comment.
779 * options.cc (Input_arguments::add_file): Remove const.
780 * options.h (Input_file_argument::Input_file_argument):
781 Initialize arg_serial_ (all constructors).
782 (Input_file_argument::set_arg_serial): New function.
783 (Input_file_argument::arg_serial): New function.
784 (Input_file_argument::arg_serial_): New data member.
785 (Input_arguments::Input_arguments): Initialize file_count_.
786 (Input_arguments::add_file): Remove const.
787 (Input_arguments::number_of_input_files): New function.
788 (Input_arguments::file_count_): New data member.
789 (Command_line::number_of_input_files): Call
790 Input_arguments::number_of_input_files.
791 * output.cc (Output_segment_headers::Output_segment_headers):
792 Set current size.
793 (Output_section::Input_section::current_data_size): New function.
794 (Output_section::Output_section): Initialize new data members.
795 (Output_section::add_input_section): Don't do merge sections for
796 an incremental link; allocate space from free list for an
797 incremental update.
798 (Output_section::add_output_section_data): Allocate space from
799 free list for an incremental update.
800 (Output_section::update_data_size): New function.
801 (Output_section::set_fixed_layout): New function.
802 (Output_section::reserve): New function.
803 (Output_segment::set_section_addresses): Remove const.
804 (Output_segment::set_section_list_addresses): Remove const; allocate
805 space from free list for an incremental update.
806 (Output_segment::set_offset): Adjust size of RELRO segment for an
807 incremental update.
808 * output.h (Output_data::current_data_size): Move here from
809 child classes.
810 (Output_data::pre_finalize_data_size): New function.
811 (Output_data::update_data_size): New function.
812 (Output_section_headers::update_data_size): new function.
813 (Output_section_data_build::current_data_size): Move to Output_data.
814 (Output_data_strtab::update_data_size): New function.
815 (Output_section::current_data_size): Move to Output_data.
816 (Output_section::set_fixed_layout): New function.
817 (Output_section::has_fixed_layout): New function.
818 (Output_section::reserve): New function.
819 (Output_section::update_data_size): New function.
820 (Output_section::has_fixed_layout_): New data member.
821 (Output_section::free_list_): New data member.
822 (Output_segment::set_section_addresses): Remove const.
823 (Output_segment::set_section_list_addresses): Remove const.
824 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
825 New function.
826 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
827 New function.
828 * readsyms.cc (Read_symbols::do_read_symbols): Add library
829 parameter when calling Add_symbols constructor; store argument
830 serial number for members of a lib group.
831 (Add_symbols::locks): Allow case where token == NULL.
832 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
833 (Read_member::~Read_member): New function.
834 (Read_member::is_runnable): New function.
835 (Read_member::locks): New function.
836 (Read_member::run): New function.
837 (Check_script::~Check_script): New function.
838 (Check_script::is_runnable): New function.
839 (Check_script::locks): New function.
840 (Check_script::run): New function.
841 (Check_library::~Check_library): New function.
842 (Check_library::is_runnable): New function.
843 (Check_library::locks): New function.
844 (Check_library::run): New function.
845 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
846 (Add_symbols::library_): New data member.
847 (class Read_member): New class.
848 (class Check_script): New class.
849 (class Check_library): New class.
850 * reloc.cc (Read_relocs::is_runnable): Allow case where
851 token == NULL.
852 (Read_relocs::locks): Likewise.
853 (Scan_relocs::locks): Likewise.
854 (Relocate_task::locks): Likewise.
855 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
856 to clear counters.
857 (Sized_relobj::incremental_relocs_scan): Fix comment.
858 (Sized_relobj::do_relocate): Pass output file offset to
859 write_local_symbols.
860 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
861 from class declaration.
862 * script.cc (read_input_script): Allocate Script_info; pass
863 argument serial number to report_script.
864 * script.h (class Script_info): Move to incremental.h.
865 * symtab.cc (Symbol_table::add_from_incrobj): New function.
866 * symtab.h (Symbol_table::add_from_incrobj): New function.
867 (Symbol_table::set_file_offset): New function.
868
b961d0d7
CC
8692011-04-05 Cary Coutant <ccoutant@google.com>
870
871 * incremental-dump.cc (dump_incremental_inputs): Change signature
872 to take a Sized_incremental_binary; change caller. Use readers
873 in Sized_incremental_binary.
874 * incremental.cc
875 (Sized_incremental_binary::find_incremental_inputs_sections):
876 Rename do_find_incremental_inputs_sections to this.
877 (Sized_incremental_binary::setup_readers): New function.
878 (Sized_incremental_binary::do_check_inputs): Check
879 has_incremental_info_ flag; move setup code to setup_readers;
880 use input readers.
881 (Sized_incremental_binary::do_file_is_unchanged): New function.
882 (Sized_incremental_binary::do_get_input_reader): New function.
883 * incremental.h (class Incremental_binary): Move to end of file.
884 (Incremental_binary::file_is_unchanged): New function.
885 (Incremental_binary::do_file_is_unchanged): New function.
886 (Incremental_binary::Input_reader): New class.
887 (Incremental_binary::get_input_reader): New function.
888 (class Sized_incremental_binary): Move to end of file.
889 (Sized_incremental_binary::Sized_incremental_binary): Setup the
890 input section reader classes.
891 (Sized_incremental_binary::has_incremental_info): New function.
892 (Sized_incremental_binary::inputs_reader): New function.
893 (Sized_incremental_binary::symtab_reader): New function.
894 (Sized_incremental_binary::relocs_reader): New function.
895 (Sized_incremental_binary::got_plt_reader): New function.
896 (Sized_incremental_binary::do_file_is_unchanged): New function.
897 (Sized_incremental_binary::Sized_input_reader): New class.
898 (Sized_incremental_binary::get_input_reader): New function.
899 (Sized_incremental_binary::find_incremental_inputs_sections):
900 Rename do_find_incremental_inputs_sections to this.
901 (Sized_incremental_binary::setup_readers): New function.
902 (Sized_incremental_binary::has_incremental_info_): New data member.
903 (Sized_incremental_binary::inputs_reader_): New data member.
904 (Sized_incremental_binary::symtab_reader_): New data member.
905 (Sized_incremental_binary::relocs_reader_): New data member.
906 (Sized_incremental_binary::got_plt_reader_): New data member.
907 (Sized_incremental_binary::current_input_file_): New data member.
908
a869183f
PP
9092011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
910
911 PR gold/12640
912 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
913 violation.
914
9152011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
916
917 * archive.cc (Archive::include_member): Adjust call to report_object.
918 (Add_archive_symbols::run): Add script_info to call to
919 report_archive_begin.
920 (Lib_group::include_member): Adjust call to report_object.
921 (Add_lib_group_symbols::run): Adjust call to report_object.
922 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
923 blocks. Add object count for script input files.
924 * incremental.cc (Incremental_inputs::report_archive_begin): Add
925 script_info parameter; change all callers.
926 (Incremental_inputs::report_object): Add script_info parameter;
927 change all callers.
928 (Incremental_inputs::report_script): Store backpointer to
929 incremental info entry.
930 (Output_section_incremental_inputs::set_final_data_size): Record
931 additional information for scripts.
932 (Output_section_incremental_inputs::write_info_blocks): Likewise.
933 * incremental.h (Incremental_script_entry::add_object): New function.
934 (Incremental_script_entry::get_object_count): New function.
935 (Incremental_script_entry::get_object): New function.
936 (Incremental_script_entry::objects_): New data member; adjust
937 constructor.
938 (Incremental_inputs::report_archive_begin): Add script_info parameter.
939 (Incremental_inputs::report_object): Add script_info parameter.
940 (Incremental_inputs_reader::get_object_count): New function.
941 (Incremental_inputs_reader::get_object_offset): New function.
942 * options.cc (Input_arguments::add_file): Return reference to
943 new input argument.
944 * options.h (Input_argument::set_script_info): New function.
945 (Input_argument::script_info): New function.
946 (Input_argument::script_info_): New data member; adjust all
947 constructors.
948 (Input_file_group::add_file): Return reference to new input argument.
949 (Input_file_lib::add_file): Likewise.
950 (Input_arguments::add_file): Likewise.
951 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
952 * script.cc (Parser_closure::Parser_closure): Add script_info
953 parameter; adjust all callers.
954 (Parser_closure::script_info): New function.
955 (Parser_closure::script_info_): New data member.
956 (read_input_script): Report scripts earlier to incremental info.
957 (script_add_file): Set script_info in Input_argument.
958 (script_add_library): Likewise.
959 * script.h (Script_options::Script_info): Rewrite class.
960
a869183f 9612011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
962
963 * archive.cc (Library_base::should_include_member): Move
964 method here from class Archive.
965 (Archive::Archive): Initialize base class.
966 (Archive::should_include_member): Move to base class.
967 (Archive::do_for_all_unused_symbols): New function.
968 (Add_archive_symbols::run): Remove redundant access to
969 incremental_inputs.
970 (Lib_group::Lib_group): Initialize base class.
971 (Lib_group::do_filename): New function.
972 (Lib_group::include_member): Pass pointer to Lib_group to
973 report_object.
974 (Lib_group::do_for_all_unused_symbols): New function.
975 (Add_lib_group_symbols::run): Report archive information for
976 incremental links.
977 * archive.h (class Library_base): New base class.
978 (class Archive): Derive from Library_base.
979 (Archive::filename): Move to base class.
980 (Archive::set_incremental_info): Likewise.
981 (Archive::incremental_info): Likewise.
982 (Archive::Should_include): Likewise.
983 (Archive::should_include_member): Likewise.
984 (Archive::Armap_entry): Remove.
985 (Archive::Unused_symbol_iterator): Remove.
986 (Archive::unused_symbols_begin): Remove.
987 (Archive::unused_symbols_end): Remove.
988 (Archive::do_filename): New function.
989 (Archive::do_get_mtime): New function.
990 (Archive::do_for_all_unused_symbols): New function.
991 (Archive::task_): Move to base class.
992 (Archive::incremental_info_): Likewise.
993 (class Lib_group): Derive from Library_base.
994 (Lib_group::do_filename): New function.
995 (Lib_group::do_get_mtime): New function.
996 (Lib_group::do_for_all_unused_symbols): New function.
997 (Lib_group::task_): Move to base class.
998 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
999 function.
1000 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1001 function.
1002 * incremental.cc (Incremental_inputs::report_archive_begin):
1003 Use Library_base; call library's get_mtime; add incremental inputs
1004 entry before members.
1005 (class Unused_symbol_visitor): New class.
1006 (Incremental_inputs::report_archive_end): Use Library_base; use
1007 visitor class to record unused symbols; don't add incremental inputs
1008 entry after members.
1009 (Incremental_inputs::report_object): Use Library_base.
1010 * incremental.h
1011 (Incremental_archive_entry::Incremental_archive_entry): Remove
1012 unused Archive parameter.
1013 (Incremental_inputs::report_archive_begin): Use Library_base.
1014 (Incremental_inputs::report_archive_end): Likewise.
1015 (Incremental_inputs::report_object): Likewise.
1016 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1017 function.
1018 * object.h (Object::for_all_global_symbols): New function.
1019 (Object::do_for_all_global_symbols): New function.
1020 (Sized_relobj::do_for_all_global_symbols): New function.
1021 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1022 function.
1023 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1024 function.
1025
61ab3e40
ILT
10262011-03-27 Ian Lance Taylor <iant@google.com>
1027
1028 * archive.cc (Archive::interpret_header): Return -1 if something
1029 goes wrong. Change callers accordingly.
1030
30e1f9e6
CC
10312011-03-25 Cary Coutant <ccoutant@google.com>
1032
1033 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1034 * testsuite/Makefile.in: Regenerate.
1035
9c793f14
RÁE
10362010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1037
1038 * plugin.cc (get_view): New.
1039 (Plugin::load): Pass get_view to the plugin.
1040 (Plugin_manager::get_view): New.
1041
9312bb0a
ILT
10422011-03-21 Ian Lance Taylor <iant@google.com>
1043
1044 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1045 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1046
7e12ba9e
ST
10472011-03-21 Sriraman Tallam <tmsriram@google.com>
1048
1049 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1050 Change == to -eq.
1051 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1052 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1053 Change == to -eq.
1054 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1055 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1056
fd7a005d
ILT
10572011-03-14 Ian Lance Taylor <iant@google.com>
1058
1059 * script-sections.cc (Sort_output_sections::script_compare):
1060 Rename from is_before, change return type.
1061 (Sort_output_sections::operator()): Adjust accordingly.
1062
ed16fd1b
ILT
10632011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1064
1065 PR gold/12572
1066 * testsuite/odr_violation2.cc: Add comment to make all error line
1067 numbers double digits.
1068 * testsuite/debug_msg.sh: Adjust expected errors.
1069
71ff8986
ILT
10702011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1071
1072 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1073 but mark earlier ones as non-canonical
1074 (offset_to_iterator): Update search target and example
1075 (do_addr2line): Return extra lines in a vector*
1076 (format_file_lineno): Extract from do_addr2line
1077 (one_addr2line): Add vector* out-param
1078 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1079 when a lineno entry appeared last for its instruction
1080 (Dwarf_line_info): Add vector* out-param
1081 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1082 * symtab.cc (Odr_violation_compare): Include the lineno in the
1083 comparison again.
1084 (linenos_from_loc): New. Combine the canonical line for an
1085 address with its other lines.
1086 (True_if_intersect): New. Helper functor to make
1087 std::set_intersection a query.
1088 (detect_odr_violations): Compare sets of lines instead of just
1089 one line for each function. This became less deterministic, but
1090 has fewer false positives.
1091 * symtab.h: Declarations.
1092 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1093 mix an optimized and non-optimized object in the same binary
1094 (odr_violation2.so): Same.
1095 * testsuite/Makefile.in: Regenerate from Makefile.am.
1096 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1097 * testsuite/debug_msg.sh: Update line numbers and add
1098 assertions.
1099 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1100 non-optimized context.
1101 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1102 isn't inlined, and use OdrDerived in an optimized context.
1103 * testsuite/odr_header1.h: Defines OdrDerived, where
1104 optimization will change the
1105 first-instruction-in-the-destructor's file and line number.
1106 * testsuite/odr_header2.h: Defines OdrBase.
1107
a19fefdc
ILT
11082011-03-09 Ian Lance Taylor <iant@google.com>
1109
1110 * fileread.cc (File_read::clear_views): Don't delete the whole
1111 file view.
1112
ecb351e9
ILT
11132011-03-08 Ian Lance Taylor <iant@google.com>
1114
1115 PR gold/12525
1116 * fileread.cc: #include <climits>.
1117 (GOLD_IOV_MAX): Define.
1118 (File_read::read_multiple): Limit number of entries by iov_max.
1119 * fileread.h (class File_read): Always set max_readv_entries to
1120 128.
1121
b821d13c
ILT
11222011-03-07 Ian Lance Taylor <iant@google.com>
1123
1124 PR gold/12525
1125 * options.h (class General_options): Add -dy and -dn.
1126
89243142
CC
11272011-03-02 Cary Coutant <ccoutant@google.com>
1128
1129 * testsuite/script_test_9.t: Add TLS segment.
1130
d0773f31
ILT
11312011-03-02 Simon Baldwin <simonb@google.com>
1132
1133 * configure.ac: Add check for gnu_indirect_function support in
1134 the toolchain building binutils.
1135 * configure: Rebuild.
1136
badc8139
RÁE
11372010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1138
1139 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1140 plugin only symbols.
1141 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1142 in plugin files as not needed in the symbol table.
1143
4cf7a849
ST
11442011-02-11 Sriraman Tallam <tmsriram@google.com>
1145
1146 * output.cc (Output_section::add_input_section): Delay fill
1147 generation for section ordering.
1148
b578bd7d
ILT
11492011-02-09 Ian Lance Taylor <iant@google.com>
1150
1151 PR gold/12316
1152 * object.h (class Sized_relobj): Remove clear_local_symbols.
1153 * reloc.cc (Sized_relobj::do_relocate): Don't call
1154 clear_local_symbols.
1155
84ced98a
RÁE
11562010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1157
1158 * plugin.cc (is_visible_from_outside): Return true for symbols
1159 in the -u option.
1160
55382fb7
ILT
11612011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1162
1163 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1164 filename.
1165
4e271fff
ST
11662011-02-02 Sriraman Tallam <tmsriram@google.com>
1167
1168 * icf.h (is_section_foldable_candidate): Change type of parameter
1169 to std::string.
1170 * icf.cc (Icf::find_identical_sections): Change type of local variable
1171 section_name to be std::string.
1172 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1173
d433c3ac
ILT
11742011-01-25 Ian Lance Taylor <iant@google.com>
1175
1176 * script.cc (script_add_extern): Rewrite to use
1177 add_symbol_reference.
1178
880473a6
DK
11792011-01-25 Doug Kwan <dougkwan@google.com>
1180
d433c3ac 1181 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1182
f30f86fa
ILT
11832011-01-24 Ian Lance Taylor <iant@google.com>
1184
1185 * options.h (class General_options): Accept
1186 --no-detect-odr-violations.
1187
8e51a0b9
ILT
11882011-01-24 Ian Lance Taylor <iant@google.com>
1189
1190 * version.cc (version_string): Bump to 1.11.
1191
0f3b89d8
ILT
11922011-01-24 Ian Lance Taylor <iant@google.com>
1193
1194 * plugin.cc (class Plugin_rescan): Define new class.
1195 (Plugin_manager::claim_file): Set any_claimed_.
1196 (Plugin_manager::save_archive): New function.
1197 (Plugin_manager::save_input_group): New function.
1198 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1199 necessary.
1200 (Plugin_manager::new_undefined_symbol): New function.
1201 (Plugin_manager::rescan): New function.
1202 (Plugin_manager::rescannable_defines): New function.
1203 (Plugin_manager::add_input_file): Set any_added_.
1204 * plugin.h (class Plugin_manager): define new fields rescannable_,
1205 undefined_symbols_, any_claimed_, and any_added_. Declare
1206 Plugin_rescan as friend. Declare new functions.
1207 (Plugin_manager::Rescannable): Define type.
1208 (Plugin_manager::Rescannable_list): Define type.
1209 (Plugin_manager::Undefined_symbol_list): Define type.
1210 (Plugin_manager::Plugin_manager): Initialize new fields.
1211 * archive.cc (Archive::defines_symbol): New function.
1212 (Add_archive_symbols::run): Pass archive to plugins if any.
1213 * archive.h (class Archive): Declare defines_symbol.
1214 * readsyms.cc (Input_group::~Input_group): New function.
1215 (Finish_group::run): Pass input_group to plugins if any.
1216 * readsyms.h (class Input_group): Declare destructor.
1217 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1218 any.
1219
3bb951e5
ILT
12202011-01-10 Ian Lance Taylor <iant@google.com>
1221
1222 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1223 section as relro.
1224 (Layout::set_segment_offsets): Reset increase_relro before calling
1225 set_section_addresses a second time.
1226
0aa45fac
CC
12272011-01-04 Cary Coutant <ccoutant@google.com>
1228
1229 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1230 sections before NOBITS sections.
1231
0db46eb4
L
12322011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1233
1234 * version.cc (print_version): Update copyright to 2011.
1235
829c9745
CC
12362010-12-23 Cary Coutant <ccoutant@google.com>
1237
1238 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1239 of OS to this->add. Add OD parameter to second form of the function.
1240
7500420b
ILT
12412010-12-20 Ian Lance Taylor <iant@google.com>
1242
1243 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1244 second of two consecutive entries with same offset.
1245
f8e9a930
RW
12462010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1247
1248 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1249 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1250 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1251 to avoid unneeded links against $(LDADD).
1252 * testsuite/Makefile.in: Regenerate.
1253
2fbb4320
ILT
12542010-12-15 Ian Lance Taylor <iant@google.com>
1255
1256 PR gold/12324
1257 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1258 for R_X86_64_32 and R_X86_64_PC32.
1259 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1260 ver_matching_def_pic.o.
1261 (ver_matching_def_pic.o): New target.
1262
fedb228d
RW
12632010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1264
1265 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1266 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1267 Move definition before File_read::View member definitions.
1268 (File_read::View::~View): Initialize and hold lock before
1269 updating current_mapped_bytes.
1270
9b547ce6
RW
12712010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1272
1273 * dwarf_reader.cc: Remove outdated comment.
1274 * gold-threads.cc: Fix typo in error message.
1275 * archive.cc: Fix typos in comments.
1276 * archive.h: Likewise.
1277 * arm-reloc-property.cc: Likewise.
1278 * arm-reloc-property.h: Likewise.
1279 * arm-reloc.def: Likewise.
1280 * arm.cc: Likewise.
1281 * attributes.h: Likewise.
1282 * cref.cc: Likewise.
1283 * ehframe.cc: Likewise.
1284 * fileread.h: Likewise.
1285 * gold.h: Likewise.
1286 * i386.cc: Likewise.
1287 * icf.cc: Likewise.
1288 * incremental.h: Likewise.
1289 * int_encoding.cc: Likewise.
1290 * layout.h: Likewise.
1291 * main.cc: Likewise.
1292 * merge.h: Likewise.
1293 * object.cc: Likewise.
1294 * object.h: Likewise.
1295 * options.cc: Likewise.
1296 * readsyms.cc: Likewise.
1297 * reduced_debug_output.cc: Likewise.
1298 * reloc.cc: Likewise.
1299 * script-sections.cc: Likewise.
1300 * sparc.cc: Likewise.
1301 * symtab.h: Likewise.
1302 * target-reloc.h: Likewise.
1303 * target.cc: Likewise.
1304 * target.h: Likewise.
1305 * timer.cc: Likewise.
1306 * timer.h: Likewise.
1307 * x86_64.cc: Likewise.
1308
83e17bd5
CC
13092010-12-09 Cary Coutant <ccoutant@google.com>
1310
1311 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1312 stack.
1313 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1314 parameter; change all callers.
1315 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1316 * options.h (warn_execstack): New option.
1317
017257f8
DK
13182010-12-07 Doug Kwan <dougkwan@google.com>
1319
1320 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1321 like function call relocations.
1322
c20cbc06
ILT
13232010-12-07 Ian Lance Taylor <iant@google.com>
1324
1325 * archive.cc (Archive::get_elf_object_for_member): Permit
1326 punconfigured to be NULL.
1327 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1328 (Archive::include_member): Pass NULL to get_elf_object_for_member
1329 if we searched for the archive and this is the first included
1330 object.
1331
4dbfafcc
ILT
13322010-12-01 Ian Lance Taylor <iant@google.com>
1333
1334 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1335 track_relocs_type_ field.
1336 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1337 Set track_relocs_type_.
1338 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1339 contents when using RELA relocs.
1340 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1341 reloc_map_.
1342 * reloc.cc (Track_relocs::next_addend): New function.
1343 * reloc.h (class Track_relocs): Declare next_addend.
1344
e5e19edd
ILT
13452010-12-01 Ian Lance Taylor <iant@google.com>
1346
1347 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1348 virtual destructor.
1349
9a5ce24c
ILT
13502010-12-01 Ian Lance Taylor <iant@google.com>
1351
1352 * README: Update compilers known to work and fail.
1353
c7791212
NC
13542010-11-23 Matthias Klose <doko@ubuntu.com>
1355
1356 * configure.in: For --enable-gold, handle value `default' instead of
1357 `both*'. Always install ld as ld.bfd, install as ld if gold is
1358 not the default.
1359 * configure: Regenerate.
1360
0ad220c9
DK
13612010-11-18 Doug Kwan <dougkwan@google.com>
1362
1363 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1364 and right_alignment to be zero. Store result alignment only if it is
1365 greater than existing alignment.
1366
ab8056e0
CC
13672010-11-16 Cary Coutant <ccoutant@google.com>
1368
1369 PR gold/12220
1370 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1371 Check for ".zdebug_line".
1372
fd064a5b
CC
13732010-11-16 Doug Kwan <dougkwan@google.com>
1374 Cary Coutant <ccoutant@google.com>
1375
1376 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1377 by reference; adjust all callers.
1378 * output.cc (Output_segment::set_section_addresses): Adjust references
1379 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1380 list is empty.
1381 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1382 end at page boundary.
1383
6fc6ea19
CC
13842010-11-16 Cary Coutant <ccoutant@google.com>
1385
1386 PR gold/12220
1387 * layout.cc (Layout::choose_output_section): Transform names of
1388 compressed sections even when using a script with a SECTIONS clause.
1389 (Layout::output_section_name): Remove code to transform
1390 compressed debug section names.
1391 * output.cc (Output_section::add_input_section): Use uncompressed
1392 section size when tracking input sections.
1393
95a2c8d6
RS
13942010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1395
1396 * symtab.h (Symbol::NON_PIC_REF): Remove.
1397 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1398 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1399 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1400 (Symbol::use_plt_offset): Take a flags argument and pass it
1401 directly to needs_dynamic_reloc. Restrict check for undefined
1402 weak symbols to function calls.
1403 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1404 (Target_arm::Scan::global): Use it.
1405 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1406 (Target_arm::Relocate::relocate): Likewise.
1407 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1408 parameter with an r_type parameter. Use get_reference_flags
1409 to get the flags.
1410 (Target_arm::Relocate::relocate): Update accordingly.
1411 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1412 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1413 (Target_i386::Scan::global): Likewise.
1414 (Target_i386::Relocate::relocate): Likewise.
1415 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1416 parameter with an r_type parameter. Use get_reference_flags
1417 to get the flags.
1418 (Target_i386::Relocate::relocate): Update accordingly.
1419 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1420 (Target_powerpc::Scan::global): Use it.
1421 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1422 (Target_powerpc::Relocate::relocate): Likewise.
1423 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1424 (Target_sparc::Scan::global): Use it.
1425 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1426 (Target_sparc::Relocate::relocate): Likewise.
1427 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1428 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1429 (Target_x86_64::Scan::global): Likewise.
1430 (Target_x86_64::Relocate::relocate): Likewise.
1431
f625ae50
DK
14322010-11-08 Doug Kwan <dougkwan@google.com>
1433 Cary Coutant <ccoutant@google.com>
1434
1435 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1436 (Arm_exidx_merge_section::section_contents_): New data member.
1437 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1438 (Arm_input_section::~Arm_input_section): De-allocate memory.
1439 (Arm_input_section::original_contents_): New data member.
1440 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1441 in parameters instead of calling Object::section_contents without
1442 locking.
1443 (Arm_output_section::group_section): New parameter TASK. Pass it
1444 to callees that need locking objects.
1445 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1446 to lock EXIDX input sections. Fix a formatting issue. Call
1447 Arm_exidx_merged_section::build_contents to create merged section
1448 contents.
1449 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1450 to lock object of stub table owner.
1451 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1452 TEXT_SIZE to initialize data member TEXT_SIZE_.
1453 (Arm_exidx_input_section::addralign): Fix typo in comment.
1454 (Arm_exidx_input_section::text_size): New method.
1455 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1456 that require locking objects. Lock objects before scanning for stubs
1457 and updating local symbols.
1458 (Arm_input_section<big_endian>::init): Copy contents of original
1459 input section.
1460 (Arm_input_section<big_endian>::do_write): Use saved contents of
1461 original input section instead of calling Object::section_contents
1462 without locking.
1463 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1464 size without calling Object::section_size().
1465 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1466 for size. Allocate a buffer for merged EXIDX entries.
1467 (Arm_exidx_merged_section::build_contents): New method.
1468 (Arm_exidx_merged_section::do_write): Move merge section contents
1469 building code to Arm_exidx_merged_section::build_contetns. Write
1470 out contetns in buffer instead of building it on the fly.
1471 (Arm_relobj::make_exidx_input_section): Also pass text section size
1472 to Arm_exidx_input_section constructor.
1473 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1474 (Arm_dynobj::do_read_symbols): Fix memory leak.
1475 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1476 * target.h: (class Task): Add forward declaration.
1477 (Target::relax): Add new parameter TASK and pass it to
1478 Target::do_relax().
1479 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1480
5f9bcf58
CC
14812010-11-05 Cary Coutant <ccoutant@google.com>
1482
1483 PR gold/10708
1484 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1485 object when reading from the file.
1486 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1487 second layout pass.
1488 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1489 when reading section contents.
1490 (get_section_contents): Likewise.
1491 (icf::find_identical_sections): Likewise.
1492 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1493 object when reading from the file.
1494 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1495 the object when doing deferred section layout.
1496
e597fa08
NC
14972010-11-03 Nick Clifton <nickc@redhat.com>
1498
1499 PR gold/12001
1500 * script.h (class Symbol_assignment: name): New member. Returns
1501 the name of the symbol.
1502 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1503 Returns true if the given symbol name is on the list of
1504 assignments wating to be processed.
1505 * archive.cc (should_incldue_member): If the symbol is undefined,
1506 check to see if it is on the list of symbols pending assignment.
1507
3f9a3278
ILT
15082010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1509
1510 * script-sections.cc (Script_sections::find_memory_region): Check
1511 for a NULL output section pointer.
1512
d06fb4d1
DK
15132010-10-29 Doug Kwan <dougkwan@google.com>
1514
1515 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1516 Output_section::add_relaxed_input_section.
1517 * output.cc (Output_section::add_relaxed_input_section): Add new
1518 arguments LAYOUT and NAME. Set section order index.
1519 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1520 Copy section order index.
1521 * output.h (Output_section::add_relaxed_input_section): Add new
1522 arguments LAYOUT and NAME.
1523
90e24de5
ILT
15242010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1525
1526 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1527 NATIVE_OR_CROSS_LINKER.
1528 * testsuite/Makefile.in: Regenerate.
1529
c9484ea5
DK
15302010-10-20 Doug Kwan <dougkwan@google.com>
1531
1532 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1533 without SHF_LINK_ORDER flags.
1534 * layout.cc (Layout::choose_output_section): Do not filter
1535 SHF_LINK_ORDER flag in a relocatable link.
1536
5bc2f5be
CC
15372010-10-17 Cary Coutant <ccoutant@google.com>
1538
1539 * output.h (Output_segment::set_section_addresses): Change function
1540 signature. Update all callers.
1541 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1542 sections.
1543 (Output_segment::set_section_addresses): Align after last TLS
1544 section. Add padding before last relro section instead of after.
1545
0c91cf04
DK
15462010-10-17 Doug Kwan <dougkwan@google.com>
1547
1548 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1549 GOT output section to be writable.
1550
8c21d9d3
CC
15512010-10-14 Cary Coutant <ccoutant@google.com>
1552
1553 * debug.h (DEBUG_INCREMENTAL): New flag.
1554 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1555 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1556 mode.
1557 * incremental.cc (report_command_line): Ignore all forms of
1558 --incremental.
1559 * layout.cc (Layout::Layout): Check parameters for incremental link
1560 mode.
1561 * options.cc (General_options::parse_incremental): New function.
1562 (General_options::parse_no_incremental): New function.
1563 (General_options::parse_incremental_full): New function.
1564 (General_options::parse_incremental_update): New function.
1565 (General_options::incremental_mode_): New data member.
1566 (General_options::finalize): Check incremental_mode_.
1567 * options.h (General_options): Update help text for --incremental.
1568 Add --no-incremental, --incremental-full, --incremental-update.
1569 (General_options::Incremental_mode): New enum type.
1570 (General_options::incremental_mode): New function.
1571 (General_options::incremental_mode_): New data member.
1572 * parameters.cc (Parameters::incremental_mode_): New data member.
1573 (Parameters::set_options): Set incremental_mode_.
1574 (Parameters::set_incremental_full): New function.
1575 (Parameters::incremental): New function.
1576 (Parameters::incremental_update): New function.
1577 (set_parameters_incremental_full): New function.
1578 * parameters.h (Parameters::set_incremental_full): New function.
1579 (Parameters::incremental): New function.
1580 (Parameters::incremental_update): New function.
1581 (Parameters::incremental_mode_): New data member.
1582 (set_parameters_incremental_full): New function.
1583 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1584 incremental link mode.
1585 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1586 (Sized_relobj::do_relocate_sections): Likewise.
1587 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1588 option.
1589 * testsuite/Makefile.in: Regenerate.
1590 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1591
bb32aa18 15922010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1593
1594 * script-sections.h (class Script_sections): Make
1595 Sections_elements typedef public.
1596 * script-sections.cc (class Sort_output_sections): Add elements_
1597 field. Add constructor which sets it; change all callers.
1598 (Sort_output_sections::is_before): New function.
1599 (Sort_output_sections::operator()): Call is_before.
1600 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1601 conditional.
1602 * testsuite/script_test_10.sh: New test. Test script section
1603 order.
1604 * testsuite/script_test_10.t: Likewise.
1605 * testsuite/script_test_10.s: Likewise.
1606 * testsuite/Makefile.am: Wrap the cross linker tests and the
1607 common tests into NATIVE_OR_CROSS_LINKER.
1608 (check_SCRIPTS): Add script_test_10.sh.
1609 (check_DATA): Add script_test_10.stdout.
1610 (script_test_10.o, script_test_10): New targets.
1611 (script_test_10.stdout): New target.
1612 * configure, testsuite/Makefile.in: Regenerate.
1613
3cef7179
ILT
16142010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1615
1616 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1617 error for the deprecated relocations.
1618 (Target_arm::Scan::global): Likewise.
1619 (Target_arm::Relocate::relocate): Likewise.
1620
7411e9a8
RS
16212010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1622
1623 * fileread.cc (Input_file::find_file): Initialize *found_name
1624 and *namep when using the fallback search for case 4.
1625
6a9da32a
CC
16262010-10-11 Cary Coutant <ccoutant@google.com>
1627
1628 * options.h (class General_options): Redefine -z lazy as an alias for
1629 the negation of -z now.
1630
ac897c20
ILT
16312010-10-11 Ian Lance Taylor <iant@google.com>
1632
1633 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1634 binding.
1635
ea5cae92
NC
16362010-10-06 Nick Clifton <nickc@redhat.com>
1637
1638 * script-sections.cc(class Memory_region): Remove
1639 current_lma_offset_ field. Rename current_vma_offset_ to
1640 current_offset_. Add last_section_ field.
1641 (Memory_region::get_current_vma_address): Rename to
1642 get_current_address.
1643 (Memory_region::get_current_lma_address): Delete.
1644 (Memory_region::increment_vma_offset): Rename to
1645 increment_offset.
1646 (Memory_region::increment_lma_offset): Delete.
1647 (Memory_region::attributes_compatible): New method. Returns
1648 true if the provided section is compatible with the region.
1649 (Memory_region::get_last_section): New method. Returns the last
1650 section to use the region.
1651 (Memory_region::set_last_section): New method. Stores the last
1652 section to use the region.
1653 (Script_sections::block_in_region): New method. Returns true if
1654 a block of memory is contained within a region.
1655 (Script_sections::find_memory_region): New method. Locates a
1656 memory region to be used to set a VMA or LMA address.
1657 (Output_section_definition::set_section_addresses): Add code to
1658 check for addresses set by memory regions.
1659 (Output_segment::set_section_addresses): Remove memory region
1660 walking code.
1661 (Script_sections::create_segment): Add a warning if a header
1662 segment is created outside of any region.
1663 * script-sections.h (class Script_sections): Add prototypes for
1664 find_memory_region and block_in_region methods.
1665 * testsuite/memory_test.s: Use .long instead of .word.
1666 * testsuite/memory_test.t: Add some more output sections.
1667 * testsuite/memory_test.sh: Update expected output.
1668
a9bfd952
DK
16692010-10-02 Doug Kwan <dougkwan@google.com>
1670
1671 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1672 defintion to symtab.h
1673 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1674 declaration to defintion.
1675
bacff3ab
NC
16762010-10-01 Nick Clifton <nickc@redhat.com>
1677
1678 * expression.cc (eval): Replace dummy argument with NULL.
1679 (eval_maybe_dot): Check for a NULL result section pointer.
1680 (Symbol_expression::value): Likewise.
1681 (Dot_expression::value): Likewise.
1682 (BINARY_EXPRESSION): Likewise.
1683 (Max_expression::value): Likewise.
1684 (Min_expression::value): Likewise.
1685 (Absolute_expression::value): Likewise.
1686 (Addr_expression::value_from_output_section): Likewise.
1687 (Loaddddr_expression::value_from_output_section): Likewise.
1688 (Segment_start_expression::value): Likewise.
1689 * script-sections.cc
1690 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1691 argument with NULL.
1692 (Sections_elememt_dot_assignment::set_section_addresses):
1693 Likewise.
1694 (Output_data_expression::do_write_to_buffer): Likewise.
1695 (Output_section_definition::finalize_symbols): Likewise.
1696 (Output_section_definition::set_section_addresses): Likewise.
1697
f81bc8b5
DK
16982010-09-30 Doug Kwan <dougkwan@google.com>
1699
1700 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1701
c95e9f27
ST
17022010-09-28 Sriraman Tallam <tmsriram@google.com>
1703
1704 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1705 function.
c95e9f27
ST
1706 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1707 virtual function.
1708 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1709 virtual function.
1710 * icf.cc (get_section_contents): Inline merge sections only when
1711 target allows it.
1712
3cac54d2
RW
17132010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1714
1715 * configure: Regenerate.
1716
2904037a
ILT
17172010-09-17 Ian Lance Taylor <iant@google.com>
1718
1719 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1720 * testsuite/Makefile.am (memory_test.o): New target.
1721 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1722 memory_test.t.
1723 * testsuite/Makefile.in: Rebuild.
2904037a 1724
bca7fb63
DK
17252010-09-17 Doug Kwan <dougkwan@google.com>
1726
1727 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1728 defintion if relocation uses GOT entries of the symbol.
1729 * testsuite/icf_safe_test.sh: Fix test.
1730 * testsuite/icf_safe_so_test.sh: Fix test.
1731
4ef28648
CC
17322010-09-16 Cary Coutant <ccoutant@google.com>
1733
1734 * script_sections.cc (class Memory_region): Remove "NULL" from
1735 vector initializations.
1736
793990de
CC
17372010-09-15 Cary Coutant <ccoutant@google.com>
1738
1739 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1740 Resolve forwarding symbols.
1741
81e015e2
DK
17422010-09-15 Doug Kwan <dougkwan@google.com>
1743
1744 * gold/testsuite/script_test_3.t: Add ARM special sections.
1745 * gold/testsuite/script_test_4.t: Same.
1746 * gold/testsuite/script_test_5.t: Same.
1747 * gold/testsuite/script_test_6.t: Same.
1748 * gold/testsuite/script_test_7.t: Same.
1749 * gold/testsuite/script_test_7.t: Same.
1750 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1751
36171d64
CC
17522010-09-14 Cary Coutant <ccoutant@google.com>
1753
1754 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1755 (Target_x86_64::Relocate::relocate_tls): Replace check for
1756 saw_tls_block_reloc_ with test for executable section.
1757
d89051bd
CC
17582010-09-12 Cary Coutant <ccoutant@google.com>
1759
1760 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1761 position-independent executables to shared libraries need dynamic
1762 relocations.
1763 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1764 position-independent executables.
1765 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1766 * testsuite/Makefile.in: Regenerate.
1767
fca41f0f
NC
17682010-09-10 Nick Clifton <nickc@redhat.com>
1769
1770 PR gold/11997
1771 * testsuite/memory_test.t: Discard any sections that are not
1772 needed.
1773
6695e4b3
L
17742010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1775
1776 PR gold/11996
1777 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1778 "This::" to work around a bug in gcc 4.2.
1779
1780 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1781
0f72bf6f
RÁE
17822010-09-09 Rafael Espindola <espindola@google.com>
1783
1784 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1785 sections with different PF_X flags in the same segment.
1786 (Layout::find_first_load_seg): Search all segments to find the first
1787 one.
1788 * options.h (rosegment): New.
1789
17902010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1791
05a79166 1792 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1793
aa98ff75
DK
17942010-09-08 Doug Kwan <dougkwan@google.com>
1795
1796 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1797 (Arm_relobj::do_relocate_sections): Add new parameter for output
1798 file to match the parent.
1799 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1800 of local symbols instead of input values. Update code to track
1801 changes in gold::relocate_section.
1802 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1803 (Sized_relobj::compute_final_local_value_internal): New methods.
1804 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1805 body into private version of Sized_relobj::compute_final_local_value.
1806 Call the inline method.
1807 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1808 merged symbol value if there is one.
1809 (Symbol_value::has_output_value): New method defintiion.
1810 (Sized_relobj::Compute_final_local_value_status): New enum type.
1811 (Sized_relobj::compute_final_local_value): New methods.
1812 (Sized_relobj::compute_final_local_value_internal): New methods.
1813 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1814 and arm_cortex_a8.sh.
1815 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1816 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1817 New tests.
1818 * Makefile.in: Regenerate.
1819 * testsuite/arm_bl_out_of_range.s: Update test.
1820 * testsuite/thumb_bl_out_of_range.s: Ditto.
1821 * testsuite/thumb_blx_out_of_range.s: Ditto.
1822 * testsuite/arm_branch_out_of_range.sh: New file.
1823 * testsuite/arm_cortex_a8.sh: Ditto.
1824 * testsuite/arm_cortex_a8_b.s: Ditto.
1825 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1826 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1827 * testsuite/arm_cortex_a8_bl.s: Ditto.
1828 * testsuite/arm_cortex_a8_blx.s: Ditto.
1829 * testsuite/arm_cortex_a8_local.s: Ditto.
1830 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1831 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1832
05a79166
L
18332010-09-08 Rafael Espindola <espindola@google.com>
1834
1835 * Makefile.am (memory_test.stdout): Run readelf with -W.
1836 * Makefile.in: Regenerate.
1837 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1838 64 bit output.
1839
33dbc701
RÁE
18402010-09-08 Rafael Espindola <espindola@google.com>
1841
1842 * script-sections.cc (Script_sections::add_memory_region): Convert
1843 field precision to int.
1844 * script.cc (script_set_section_region, script_set_section_region):
1845 Convert field precision to int.
1846
731ca54a
RÁE
18472010-09-08 Rafael Espindola <espindola@google.com>
1848
1849 * arm.cc (do_finalize_sections): Create the __exidx_start and
1850 __exdix_end symbols even when the section is missing.
1851
7f8cd844
NC
18522010-09-08 Nick Clifton <nickc@redhat.com>
1853
1854 * README: Remove claim that MEMORY is not supported.
1855 * expression.cc (script_exp_function_origin)
1856 (script_exp_function_length): Move from here to ...
1857 * script.cc: ... here.
1858 (script_set_section_region, script_add_memory)
1859 (script_parse_memory_attr, script_include_directive): New
1860 functions.
1861 * script-sections.cc
1862 (class Memory_region): New class.
1863 (class Output_section_definition): Add set_memory_region,
1864 set_section_vma, set_section_lma and get_section_name methods.
1865 (class Script_Sections): Add add_memory_region,
1866 find_memory_region, find_memory_region_origin,
1867 find_memory_region_length and set_memory_region methods.
1868 Have set_section_addresses method walk the list of set memory
1869 regions.
1870 Extend the print methos to display memory regions.
1871 * script-sections.h: Add prototypes for new methods.
1872 Add enum for MEMORY region attributes.
1873 * yyscript.y: Add support for parsing MEMORY regions.
1874 * script-c.h: Add prototypes for new functions.
1875 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1876 * testsuite/Makefile.in: Regenerate.
1877 * testsuite/memory_test.sh: New script.
1878 * testsuite/memory_test.s: New assembler source file.
1879 * testsuite/memory_test.t: New linker script.
1880
a4649286
DK
18812010-08-27 Doug Kwan <dougkwan@google.com>
1882
1883 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1884 reference override an existing dynamic weak reference.
1885 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1886 * testsuite/Makefile.in: Regenerate.
1887 * testsuite/dyn_weak_ref.sh: New file.
1888 * testsuite/dyn_weak_ref_1.c: Ditto.
1889 * testsuite/dyn_weak_ref_2.c: Ditto.
1890
b56648ad
ILT
18912010-08-27 Ian Lance Taylor <iant@google.com>
1892
1893 * incremental.h (class Incremental_input_entry): Add virtual
1894 destructor.
1895
809313cb
ILT
18962010-08-27 Ian Lance Taylor <iant@google.com>
1897
1898 * testsuite/start_lib_test_3.c: Mark t3 as used.
1899
11e32464
NC
19002010-08-27 Nick Clifton <nickc@redhat.com>
1901
1902 * options.cc (version_script): Fix small typo in previous
1903 whitespace tidyup.
1904
ca09d69a
NC
19052010-08-25 Nick Clifton <nickc@redhat.com>
1906
1907 * archive.cc: Formatting fixes: Remove whitespace between
1908 typename and following asterisk. Remove whitespace between
1909 function name and opening parenthesis.
1910 * archive.h: Likewise.
1911 * arm.cc: Likewise.
1912 * attributes.cc: Likewise.
1913 * attributes.h: Likewise.
1914 * common.cc: Likewise.
1915 * copy-relocs.cc: Likewise.
1916 * dirsearch.h: Likewise.
1917 * dynobj.cc: Likewise.
1918 * ehframe.cc: Likewise.
1919 * ehframe.h: Likewise.
1920 * expression.cc: Likewise.
1921 * fileread.cc: Likewise.
1922 * fileread.h: Likewise.
1923 * gc.h: Likewise.
1924 * gold-threads.cc: Likewise.
1925 * gold.cc: Likewise.
1926 * i386.cc: Likewise.
1927 * icf.h: Likewise.
1928 * incremental-dump.cc: Likewise.
1929 * incremental.cc: Likewise.
1930 * layout.cc: Likewise.
1931 * layout.h: Likewise.
1932 * main.cc: Likewise.
1933 * merge.cc: Likewise.
1934 * merge.h: Likewise.
1935 * object.cc: Likewise.
1936 * object.h: Likewise.
1937 * options.cc: Likewise.
1938 * options.h: Likewise.
1939 * output.cc: Likewise.
1940 * output.h: Likewise.
1941 * plugin.cc: Likewise.
1942 * plugin.h: Likewise.
1943 * powerpc.cc: Likewise.
1944 * reloc.cc: Likewise.
1945 * script-c.h: Likewise.
1946 * script-sections.cc: Likewise.
1947 * script.cc: Likewise.
1948 * stringpool.cc: Likewise.
1949 * symtab.cc: Likewise.
1950 * symtab.h: Likewise.
1951 * target.cc: Likewise.
1952 * timer.cc: Likewise.
1953 * timer.h: Likewise.
1954 * version.cc: Likewise.
1955 * x86_64.cc: Likewise.
1956
b8fa8750
NC
19572010-08-24 Nick Clifton <nickc@redhat.com>
1958
1959 PR 11899
1960 * layout.cc (segment_precedes): Sort segments by their physical
1961 addresses, if they have been set.
1962
9919d93b
CC
19632010-08-23 Cary Coutant <ccoutant@google.com>
1964
1965 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1966 symbols data.
1967 (Lib_group::include_member): Unlock object after deleting its
1968 symbols data.
1969 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1970 the bug fixed here.
1971
97b4be1c
CC
19722010-08-19 Neil Vachharajani <nvachhar@google.com>
1973 Cary Coutant <ccoutant@google.com>
1974
1975 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1976 constructor, and set_blocker.
1977 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1978 readsyms_blocker_.
1979 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1980 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1981 * testsuite/Makefile.am (start_lib_test): New test case.
1982 * testsuite/Makefile.in: Regenerate.
1983 * testsuite/start_lib_test_main.c: New file.
1984 * testsuite/start_lib_test_1.c: New file.
1985 * testsuite/start_lib_test_2.c: New file.
1986 * testsuite/start_lib_test_3.c: New file.
1987
dd0b1884
ILT
19882010-08-19 Ian Lance Taylor <iant@google.com>
1989
1990 * Makefile.in: Rebuild with automake 1.11.1.
1991 * aclocal.m4: Likewise.
1992 * testsuite/Makefile.in: Likewise.
1993
7223e9ca
ILT
19942010-08-19 Ian Lance Taylor <iant@google.com>
1995
1996 PR 10893
1997 * i386.cc (class Output_data_plt_i386): Update declarations.
1998 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1999 local_ifuncs_ fields.
2000 (Target_i386::do_plt_section_for_global): New function.
2001 (Target_i386::do_plt_section_for_local): New function.
2002 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2003 parameter; change all callers. Initialize global_ifuncs_ and
2004 local_ifuncs_. If doing a static link define __rel_iplt_start and
2005 __rel_iplt_end.
2006 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2007 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2008 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2009 symbols.
2010 (Target_i386::make_plt_section): New function, broken out of
2011 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2012 (Target_i386::make_plt_entry): Call make_plt_section.
2013 (Target_i386::make_local_ifunc_plt_entry): New function.
2014 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2015 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2016 R_386_IRELATIVE to switch.
2017 (Target_i386::Scan::global): Likewise.
2018 (Target_i386::Relocate::relocate): Likewise.
2019 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2020 switch.
2021 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2022 (Target_x86_64::do_plt_section_for_global): New function.
2023 (Target_x86_64::do_plt_section_for_local): New function.
2024 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2025 parameter; change all callers. If doing a static link define
2026 __rela_iplt_start and __rela_iplt_end.
2027 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2028 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2029 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2030 to point to .plt.
2031 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2032 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2033 switch.
2034 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2035 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2036 R_X86_64_IRELATIVE to switch.
2037 (Target_x86_64::Scan::global): Likewise.
2038 (Target_x86_64::Relocate::relocate): Likewise.
2039 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2040 switch.
2041 * target.h (class Target): Add plt_section_for_global and
2042 plt_section_for_local functions. Add do_plt_section_for_global
2043 and do_plt_section_for_local virtual functions.
2044 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2045 clarifying comments.
2046 (Symbol::use_plt_offset): Handle IFUNC symbol.
2047 * object.cc (Sized_relobj::Sized_relobj): Initialize
2048 local_plt_offsets_.
2049 (Sized_relobj::local_has_plt_offset): New function.
2050 (Sized_relobj::local_plt_offset): New function.
2051 (Sized_relobj::set_local_plt_offset): New function.
2052 (Sized_relobj::do_count): Handle IFUNC symbol.
2053 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2054 a bit away from input_shndx_ field. Add set_is_func_symbol and
2055 is_ifunc_symbol functions.
2056 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2057 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2058 local_plt_offsets_ field.
2059 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2060 * output.h (class Output_section_data): Add non-const
2061 output_section function.
2062 (class Output_data_got): Update declarations.
2063 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2064 Add use_plt_offset parameter to global and local constructors.
2065 Change all callers. Change local_sym_index_ field to 31 bits.
2066 Change GSYM_CODE and CONSTANT_CODE accordingly.
2067 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2068 doing a static link don't set sh_link field.
2069 (Output_data_got::Got_entry::write): Use PLT offset if
2070 appropriate.
2071 (Output_data_got::add_global_plt): New function.
2072 (Output_data_got::add_local_plt): New function.
2073 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2074 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2075 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2076 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2077 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2078 IFUNC conditional.
2079 * testsuite/ifunc-sel.h: New file.
2080 * testsuite/ifuncmain1.c: New file.
2081 * testsuite/ifuncmain1vis.c: New file.
2082 * testsuite/ifuncmod1.c: New file.
2083 * testsuite/ifuncdep2.c: New file.
2084 * testsuite/ifuncmain2.c: New file.
2085 * testsuite/ifuncmain3.c: New file.
2086 * testsuite/ifuncmod3.c: New file.
2087 * testsuite/ifuncmain4.c: New file.
2088 * testsuite/ifuncmain5.c: New file.
2089 * testsuite/ifuncmod5.c: New file.
2090 * testsuite/ifuncmain6pie.c: New file.
2091 * testsuite/ifuncmod6.c: New file.
2092 * testsuite/ifuncmain7.c: New file.
2093 * configure, testsuite/Makefile.in: Rebuild.
2094
56f75c03
ILT
20952010-08-18 Ian Lance Taylor <iant@google.com>
2096
2097 * incremental.cc
2098 (Output_section_incremental_inputs::write_input_files): Add cast
2099 to avoid signed/unsigned comparison warning.
2100 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2101
55455f89
CC
21022010-08-12 Cary Coutant <ccoutant@google.com>
2103
2104 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2105
e2054bcb
ILT
21062010-08-13 Ian Lance Taylor <iant@google.com>
2107
2108 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2109
74f67560
DK
21102010-08-12 Cary Coutant <ccoutant@google.com>
2111 Doug Kwan <dougkwan@google.com>
2112
2113 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2114 defintion overrides non-weak undef, remember that the original undef
2115 is not weak.
2116 * symtab.cc (Symbol_table::sized_write_global): For undef without
2117 an original weak binding, set binding to global in output.
2118 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2119 * testsuite/Makefile.in: Regenerate.
2120 * testsuite/strong_ref_weak_def.sh: New file.
2121 * testsuite/strong_ref_weak_def_1.c: Ditto.
2122 * testsuite/strong_ref_weak_def_2.c: Ditto.
2123
d1238d12
CC
21242010-08-12 Cary Coutant <ccoutant@google.com>
2125
2126 * testsuite/incremental_test.sh: Rewrite.
2127 * testsuite/incremental_test_1.c: Rewrite.
2128 * testsuite/incremental_test_2.c: Rewrite.
2129
0e70b911
CC
21302010-08-12 Cary Coutant <ccoutant@google.com>
2131
2132 * arm.cc (Target_arm::got_size): Add const.
2133 (Target_arm::got_entry_count): New function.
2134 (Target_arm::plt_entry_count): New function.
2135 (Target_arm::first_plt_entry_offset): New function.
2136 (Target_arm::plt_entry_size): New function.
2137 (Output_data_plt_arm::entry_count): New function.
2138 (Output_data_plt_arm::first_plt_entry_offset): New function.
2139 (Output_data_plt_arm::get_plt_entry_size): New function.
2140 * i386.cc (Target_i386::got_size): Add const.
2141 (Target_i386::got_entry_count): New function.
2142 (Target_i386::plt_entry_count): New function.
2143 (Target_i386::first_plt_entry_offset): New function.
2144 (Target_i386::plt_entry_size): New function.
2145 (Output_data_plt_i386::entry_count): New function.
2146 (Output_data_plt_i386::first_plt_entry_offset): New function.
2147 (Output_data_plt_i386::get_plt_entry_size): New function.
2148 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2149 find_incremental_inputs_sections. Dump incremental_got_plt section.
2150 * incremental.cc: Include target.h.
2151 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2152 parameter. Adjust all callers. Find incremental_got_plt section.
2153 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2154 section.
2155 (Output_section_incremental_inputs::set_final_data_size): Calculate
2156 size of incremental_got_plt section.
2157 (Output_section_incremental_inputs::do_write): Write the
2158 incremental_got_plt section.
2159 (Got_plt_view_info): New struct.
2160 (Local_got_offset_visitor): New class.
2161 (Global_got_offset_visitor): New class.
2162 (Global_symbol_visitor_got_plt): New class.
2163 (Output_section_incremental_inputs::write_got_plt): New function.
2164 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2165 Add parameter. Adjust all callers.
2166 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2167 (Incremental_inputs::got_plt_section): New function.
2168 (Incremental_inputs::got_plt_section_): New data member.
2169 (Incremental_got_plt_reader): New class.
2170 * layout.cc (Layout::create_incremental_info_sections): Add the
2171 incremental_got_plt section.
2172 * object.h (Got_offset_list::get_list): New function.
2173 (Got offset_list::for_all_got_offsets): New function.
2174 (Sized_relobj::local_got_offset_list): New function.
2175 * powerpc.cc (Target_powerpc::got_size): Add const.
2176 (Target_powerpc::got_entry_count): New function.
2177 (Target_powerpc::plt_entry_count): New function.
2178 (Target_powerpc::first_plt_entry_offset): New function.
2179 (Target_powerpc::plt_entry_size): New function.
2180 (Output_data_plt_powerpc::entry_count): New function.
2181 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2182 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2183 * sparc.cc (Target_sparc::got_size): Add const.
2184 (Target_sparc::got_entry_count): New function.
2185 (Target_sparc::plt_entry_count): New function.
2186 (Target_sparc::first_plt_entry_offset): New function.
2187 (Target_sparc::plt_entry_size): New function.
2188 (Output_data_plt_sparc::entry_count): New function.
2189 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2190 (Output_data_plt_sparc::get_plt_entry_size): New function.
2191 * symtab.h (Symbol::got_offset_list): New function.
2192 (Symbol_table::for_all_symbols): New function.
2193 * target.h (Sized_target::got_entry_count): New function.
2194 (Sized_target::plt_entry_count): New function.
2195 (Sized_target::plt_entry_size): New function.
2196 * x86_64.cc (Target_x86_64::got_size): Add const.
2197 (Target_x86_64::got_entry_count): New function.
2198 (Target_x86_64::plt_entry_count): New function.
2199 (Target_x86_64::first_plt_entry_offset): New function.
2200 (Target_x86_64::plt_entry_size): New function.
2201 (Output_data_plt_x86_64::entry_count): New function.
2202 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2203 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2204
09ec0418
CC
22052010-08-12 Cary Coutant <ccoutant@google.com>
2206
2207 * archive.cc: Include incremental.h.
2208 (Archive::Archive): Initialize incremental_info_.
2209 (Archive::include_member): Record archive members in incremental info.
2210 (Add_archive_symbols::run): Record begin and end of an archive in
2211 incremental info.
2212 (Lib_group::include_member): Record objects in incremental info.
2213 * archive.h (Incremental_archive_entry): Forward declaration.
2214 (Archive::set_incremental_info): New member function.
2215 (Archive::incremental_info): New member function.
2216 (Archive::Unused_symbol_iterator): New class.
2217 (Archive::unused_symbols_begin): New member function.
2218 (Archive::unused_symbols_end): New member function.
2219 (Archive::incremental_info_): New data member.
2220 * incremental-dump.cc (find_input_containing_global): New function.
2221 (dump_incremental_inputs): Dump new incremental info sections.
2222 * incremental.cc: Include symtab.h.
2223 (Output_section_incremental_inputs): New class.
2224 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2225 new incremental info sections.
2226 (Sized_incremental_binary::do_check_inputs): Likewise.
2227 (Incremental_inputs::report_archive): Remove.
2228 (Incremental_inputs::report_archive_begin): New function.
2229 (Incremental_inputs::report_archive_end): New function.
2230 (Incremental_inputs::report_object): New function.
2231 (Incremental_inputs::finalize_inputs): Remove.
2232 (Incremental_inputs::report_input_section): New function.
2233 (Incremental_inputs::report_script): Rewrite.
2234 (Incremental_inputs::finalize): Do nothing but finalize string table.
2235 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2236 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2237 (Incremental_inputs::create_data_sections): New function.
2238 (Incremental_inputs::relocs_entsize): New function.
2239 (Output_section_incremental_inputs::set_final_data_size): New function.
2240 (Output_section_incremental_inputs::do_write): New function.
2241 (Output_section_incremental_inputs::write_header): New function.
2242 (Output_section_incremental_inputs::write_input_files): New function.
2243 (Output_section_incremental_inputs::write_info_blocks): New function.
2244 (Output_section_incremental_inputs::write_symtab): New function.
2245 * incremental.h (Incremental_script_entry): Forward declaration.
2246 (Incremental_object_entry): Forward declaration.
2247 (Incremental_archive_entry): Forward declaration.
2248 (Incremental_inputs): Forward declaration.
2249 (Incremental_inputs_header_data): Remove.
2250 (Incremental_inputs_header): Remove.
2251 (Incremental_inputs_header_write): Remove.
2252 (Incremental_inputs_entry_data): Remove.
2253 (Incremental_inputs_entry): Remove.
2254 (Incremental_inputs_entry_write): Remove.
2255 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2256 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2257 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2258 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2259 Likewise.
2260 (Incremental_input_entry): New class.
2261 (Incremental_script_entry): New class.
2262 (Incremental_object_entry): New class.
2263 (Incremental_archive_entry): New class.
2264 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2265 (Incremental_inputs::report_inputs): Remove.
2266 (Incremental_inputs::report_archive): Remove.
2267 (Incremental_inputs::report_archive_begin): New function.
2268 (Incremental_inputs::report_archive_end): New function.
2269 (Incremental_inputs::report_object): Change prototype.
2270 (Incremental_inputs::report_input_section): New function.
2271 (Incremental_inputs::report_script): Change prototype.
2272 (Incremental_inputs::get_reloc_count): New function.
2273 (Incremental_inputs::set_reloc_count): New function.
2274 (Incremental_inputs::create_data_sections): New function.
2275 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2276 (Incremental_inputs::inputs_section): New function.
2277 (Incremental_inputs::symtab_section): New function.
2278 (Incremental_inputs::relocs_section): New function.
2279 (Incremental_inputs::get_stringpool): Add const.
2280 (Incremental_inputs::command_line): Add const.
2281 (Incremental_inputs::inputs): Remove.
2282 (Incremental_inputs::command_line_key): New function.
2283 (Incremental_inputs::input_file_count): New function.
2284 (Incremental_inputs::input_files): New function.
2285 (Incremental_inputs::relocs_entsize): New function.
2286 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2287 (Incremental_inputs::finalize_inputs): Remove.
2288 (Incremental_inputs::Input_info): Remove.
2289 (Incremental_inputs::lock_): Remove.
2290 (Incremental_inputs::inputs_): Change type.
2291 (Incremental_inputs::inputs_map_): Remove.
2292 (Incremental_inputs::current_object_entry_): New data member.
2293 (Incremental_inputs::inputs_section_): New data member.
2294 (Incremental_inputs::symtab_section_): New data member.
2295 (Incremental_inputs::relocs_section_): New data member.
2296 (Incremental_inputs::reloc_count_): New data member.
2297 (Incremental_inputs_reader): New class.
2298 (Incremental_symtab_reader): New class.
2299 (Incremental_relocs_reader): New class.
2300 * layout.cc (Layout::finalize): Move finalization of incremental info
2301 and creation of incremental info sections to follow finalization of
2302 symbol table. Set offsets for postprocessing sections.
2303 (Layout::create_incremental_info_sections): Call
2304 Incremental_inputs::create_data_sections. Add incremental symtab
2305 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2306 sections to layout after input sections.
2307 * layout.h (struct Timespec): Forward declaration.
2308 (Layout::incremental_inputs): Add const.
2309 (Layout::create_incremental_info_sections): Add parameter.
2310 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2311 * object.cc: Include incremental.h.
2312 (Relobj::finalize_incremental_relocs): New function.
2313 (Sized_relobj::do_layout): Record input sections in incremental info.
2314 * object.h (Object::output_section): New function.
2315 (Object::output_section_offset): Moved from Relobj.
2316 (Object::get_incremental_reloc_base): New function.
2317 (Object::get_incremental_reloc_count): New function.
2318 (Object::do_output_section): New function.
2319 (Object::do_output_section_offset): Moved from Relobj.
2320 (Object::do_get_incremental_reloc_base): New function.
2321 (Object::do_get_incremental_reloc_count): New function.
2322 (Object::Object): Initialize new data members.
2323 (Relobj::output_section): Renamed do_output_section and moved to
2324 protected.
2325 (Relobj::output_section_offset): Moved to Object.
2326 (Relobj::do_get_incremental_reloc_base): New function.
2327 (Relobj::do_get_incremental_reloc_count): New function.
2328 (Relobj::allocate_incremental_reloc_counts): New function.
2329 (Relobj::count_incremental_reloc): New function.
2330 (Relobj::finalize_incremental_relocs): New function.
2331 (Relobj::next_incremental_reloc_index): New function.
2332 (Relobj::reloc_counts_): New data member.
2333 (Relobj::reloc_bases_): New data member.
2334 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2335 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2336 (Sized_relobj::incremental_relocs_scan): New function.
2337 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2338 (Sized_relobj::incremental_relocs_write): New function.
2339 (Sized_relobj::incremental_relocs_write_reltype): New function.
2340 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2341 incremental link.
2342 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2343 archives and object files elsewhere.
2344 (Add_symbols::run): Report object files here.
2345 (Finish_group::run): Report end of archive at end of group.
2346 * reloc.cc: Include layout.h, incremental.h.
2347 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2348 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2349 (Sized_relobj::incremental_relocs_scan): New function.
2350 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2351 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2352 (Sized_relobj::incremental_relocs_write): New function.
2353 (Sized_relobj::incremental_relocs_write_reltype): New function.
2354 * script.cc (read_input_script): Rewrite test for incremental link.
2355 Change call to Incremental_inputs::report_script.
2356 * symtab.h (Symbol_table::first_global_index): New function.
2357 (Symbol_table::output_count): New function.
2358
ce0d1972
DK
23592010-08-12 Doug Kwan <dougkwan@google.com>
2360
2361 * arm.cc (Target_arm::merge_object_attributes): Check command line
2362 options --no-wchar-size-warning and --no-enum-size-warning.
2363 * options.h (General_options): Add ld-compatible options
2364 --no-enum-size-warning and --no-wchar-size-warning.
2365
6e5710ce
ILT
23662010-08-04 Ian Lance Taylor <iant@google.com>
2367
2368 * x86_64.cc (Target_x86_64::Scan::local): Use
2369 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2370 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2371 (Target_x86_64::Scan::global): Likewise.
2372 (Target_x86_64::Relocate::relocate): Likewise.
2373 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2374 Likewise.
2375
fef830db
CC
23762010-08-03 Cary Coutant <ccoutant@google.com>
2377
2378 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2379 to reserve space in merged_strings vector. Keep total input size
2380 for stats.
2381 (Output_merge_string::do_print_merge_stats): Print total input size.
2382 * merge.h (Output_merge_string): Add input_size_ field.
2383 * stringpool.cc (Stringpool_template::string_length): Move
2384 implementations out of Stringpool_template class and place in
2385 stringpool.h.
2386 * stringpool.h (string_length): Move out of Stringpool_template.
2387
1e3811b0
ILT
23882010-08-03 Ian Lance Taylor <iant@google.com>
2389
2390 PR 11712
2391 * layout.cc (relaxation_loop_body): If address of load segment is
2392 set, adjust address to include headers if possible.
2393
7af0c620
ILT
23942010-08-03 Ian Lance Taylor <iant@google.com>
2395
2396 * version.cc (version_string): Bump to 1.10.
2397
22f0da72
ILT
23982010-08-03 Ian Lance Taylor <iant@google.com>
2399
2400 PR 11805
2401 * layout.h (enum Output_section_order): Define.
2402 (class Layout): Update declarations.
2403 * layout.cc (Layout::get_output_section): Add order parameter.
2404 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2405 is_first_non_relro parameters. Change all callers.
2406 (Layout::choose_output_section): Likewise.
2407 (Layout::add_output_section_data): Likewise.
2408 (Layout::make_output_section): Likewise. Set order.
2409 (Layout::default_section_order): New function.
2410 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2411 * output.cc (Output_section::Output_section): Initialize order_.
2412 Don't initialize deleted fields.
2413 (Output_segment::Output_segment): Don't initialize deleted
2414 fields.
2415 (Output_segment::add_output_section_to_load): New function
2416 replacing add_output_section. Change all callers to call this or
2417 add_output_section_to_nonload.
2418 (Output_segment::add_output_section_to_nonload): New function.
2419 (Output_segment::remove_output_section): Rewrite.
2420 (Output_segment::add_initial_output_data): Likewise.
2421 (Output_segment::has_any_data_sections): Likewise.
2422 (Output_segment::is_first_section_relro): Likewise.
2423 (Output_segment::maximum_alignment): Likewise.
2424 (Output_segment::has_dynamic_reloc): New function replacing
2425 dynamic_reloc_count. Change all callers.
2426 (Output_segment::has_dynamic_reloc_list): New function replacing
2427 dynamic_reloc_count_list. Change all callers.
2428 (Output_segment::set_section_addresses): Rewrite.
2429 (Output_segment::set_offset): Rewrite.
2430 (Output_segment::find_first_and_last_list): Remove.
2431 (Output_segment::set_tls_offsets): Rewrite.
2432 (Output_segment::first_section_load_address): Likewise.
2433 (Output_segment::output_section_count): Likewise.
2434 (Output_segment::section_with_lowest_load_address): Likewise.
2435 (Output_segment::write_section_headers): Likewise.
2436 (Output_segment::print_sections_to_map): Likewise.
2437 * output.h (class Output_data): Remove dynamic_reloc_count_
2438 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2439 (Output_data::add_dynamic_reloc): Rewrite.
2440 (Output_data::has_dynamic_reloc): New function.
2441 (Output_data::dynamic_reloc_count): Remove.
2442 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2443 is_last_relro_, is_first_non_relro_, is_interp_,
2444 is_dynamic_linker_section_ fields. Add order and set_order
2445 functions. Remove is_relro_local, set_is_relro_local,
2446 is_last_relro, set_is_last_relro, is_first_non_relro,
2447 set_is_first_non_relro functions, is_interp, set_is_interp,
2448 is_dynamic_linker_section, and set_is_dynamic_linker_section
2449 functions.
2450 (class Output_segment): Change Output_data_list from std::list to
2451 std:;vector. Add output_lists_ field. Remove output_data_ and
2452 output_bss_ fields. Update declarations.
2453
3ff2ccb0
ILT
24542010-08-02 Ian Lance Taylor <iant@google.com>
2455
2456 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2457 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2458 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2459
88a4108b
ILT
24602010-08-02 Ian Lance Taylor <iant@google.com>
2461
2462 PR 11855
2463 * script.cc (Script_options::Script_options): Initialize
2464 symbol_definitions_ and symbol_references_.
2465 (Script_options::add_symbol_assignment): Update
2466 symbol_definitions_ and symbol_references_.
2467 (Script_options::add_symbol_reference): New function.
2468 (script_symbol): New function.
2469 * script.h (class Script_options): Add symbol_definitions_ and
2470 symbol_references_ fields.
2471 (Script_options::referenced_const_iterator): New type.
2472 (Script_options::referenced_begin): New function.
2473 (Script_options::referenced_end): New function.
2474 (Script_options::is_referenced): New function.
2475 (Script_options::any_unreferenced): New function.
2476 * script-c.h (script_symbol): Declare.
2477 * yyscript.y (exp): Call script_symbol.
2478 * symtab.cc: Include "script.h".
2479 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2480 Change all callers. Check symbols referenced by scripts.
2481 (Symbol_table::add_undefined_symbols_from_command_line): Add
2482 layout parameter. Change all callers.
2483 (Symbol_table::do_add_undefined_symbols_from_command_line):
2484 Likewise. Break out loop body. Check symbols referenced by
2485 scripts.
2486 (Symbol_table::add_undefined_symbol_from_command_line): New
2487 function broken out of
2488 do_add_undefined_symbols_from_command_line.
2489 * symtab.h (class Symbol_table): Update declarations.
2490 * archive.cc: Include "layout.h".
2491 (Archive::should_include_member): Add layout parameter. Change
2492 all callers. Check for symbol mentioned in expression.
2493 * archive.h (class Archive): Update declaration.
2494 * object.cc (Sized_relobj::do_should_include_member): Add layout
2495 parameter.
2496 * object.h (Object::should_include_member): Add layout parameter.
2497 Change all callers.
2498 (Object::do_should_include_member): Add layout parameter.
2499 (class Sized_relobj): Update declaration.
2500 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2501 parameter.
2502 * dynobj.h (class Sized_dynobj): Update declaration.
2503 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2504 layout parameter.
2505 * plugin.h (class Sized_pluginobj): Update declaration.
2506
5f1ab67a
ILT
25072010-08-02 Ian Lance Taylor <iant@google.com>
2508
2509 PR 11866
2510 * output.cc (Output_segment::set_offset): Search for the first and
2511 last sections rather than assuming that the list is in order.
2512 (Output_segment::find_first_and_last_list): New function.
2513 * output.h (class Output_segment): Update declarations.
2514 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2515 (relro_strip_test_SOURCES): New variable.
2516 (relro_strip_test_DEPENDENCIES): New variable.
2517 (relro_strip_test_LDFLAGS): New variable.
2518 (relro_strip_test_LDADD): New variable.
2519 (relro_strip_test.so): New target.
2520
a8df5856
ILT
25212010-08-02 Ian Lance Taylor <iant@google.com>
2522
2523 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2524 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2525 (Target_i386::got_tlsdesc_section): New function.
2526 (Target_i386::got_section): Create space for GOT entries for
2527 TLSDESC relocations.
2528 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2529 R_386_TLS_GOTDESC.
2530 (Target_i386::Scan::global): Likewise.
2531 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2532 using TLSDESC GOT.
2533 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2534 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2535 (Target_x86_64::got_tlsdesc_section): New function.
2536 (Target_x86_64::got_section): Create space for GOT entries for
2537 TLSDESC relocations.
2538 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2539 R_386_TLS_GOTDESC.
2540 (Target_x86_64::Scan::global): Likewise.
2541 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2542 using TLSDESC GOT.
2543
0c10a0a6
ILT
25442010-08-02 Ian Lance Taylor <iant@google.com>
2545
2546 * testsuite/final_layout.sh: Use dc to convert from hex to
2547 decimal.
2548
41cbeecc
ST
25492010-07-29 Sriraman Tallam <tmsriram@google.com>
2550
2551 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2552 paramter to the call to gold::gc_process_relocs.
2553 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2554 paramter to the call to gold::gc_process_relocs.
2555 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2556 parameter to the call to gold::gc_process_relocs.
2557 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2558 template parameter to the call to gold::gc_process_relocs.
2559 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2560 paramter to the call to gold::gc_process_relocs.
2561 * gc.h (get_embedded_addend_size): New function.
2562 (gc_process_relocs): Save the size of the reloc for use by ICF.
2563 * icf.cc (get_section_contents): Get the addend from the text section
2564 for SHT_REL relocation sections.
2565 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2566 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2567 * int_encoding.h (read_from_pointer): New overloaded function.
2568 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2569 * testsuite/icf_sht_rel_addend_test.sh: New file.
2570 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2571 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2572
6ea55b82
RW
25732010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2574
2575 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2576 * Makefile.in: Regenerate.
2577 * testsuite/Makefile.in: Regenerate.
2578
9691462b
ILT
25792010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2580
2581 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2582 * gold/testsuite/debug_msg.cc: Likewise.
2583 * gold/testsuite/odr_violation1.cc
2584 * gold/testsuite/odr_violation2.cc
2585
76897331
CC
25862010-07-21 Cary Coutant <ccoutant@google.com>
2587
2588 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2589 string, and length fields.
2590 (Output_merge_string::Merged_strings_list): New type.
2591 (Output_merge_string::Merged_strings_lists): New typedef.
2592 (Output_merge_string): Replace merged_strings_ with
2593 merged_strings_lists_.
2594 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2595 Merged_strings_list per input object and section. Don't store pointer
2596 to the string. Don't store length with each merged string entry.
2597 (Output_merge_string::finalize_merged_data): Loop over list of merged
2598 strings lists. Recompute length of each merged string.
2599
78384e8f
CC
26002010-07-15 Cary Coutant <ccoutant@google.com>
2601
2602 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2603 here.
2604
783659f9
ILT
26052010-07-14 Ian Lance Taylor <iant@google.com>
2606
2607 * descriptors.cc (Descriptors::open): Report correct name in error
2608 message.
2609
131687b4
DK
26102010-07-13 Doug Kwan <dougkwan@google.com>
2611
2612 * arm.cc (Arm_input_section::Arm_input_section): For a
2613 SHT_ARM_EXIDX section, always keeps the input sections.
2614 (Arm_input_section::set_exidx_section_link): New method.
2615 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2616 has_errors_ to false.
2617 (Arm_exidx_input_section::has_errors,
2618 Arm_exidx_input_section::set_has_errors): New methods.
2619 (Arm_exidx_input_section::has_errors_): New data member.
2620 (Arm_relobj::get_exidx_shndx_list): New method.
2621 (Arm_output_section::append_text_sections_to_list): Do not skip
2622 section without SHF_EXECINSTR.
2623 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2624 errors.
2625 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2626 section header. Make error messages more verbose. Check for
2627 a non-executable section linked to an EXIDX section.
2628 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2629 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2630 check that there is no deferred EXIDX section if we exit early.
2631 Instead of not making an EXIDX section in case of an error, make one
2632 and set the has_errors flag of it.
2633 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2634 in a relocatable link.
2635 (Target_arm::do_relax): Look for the EXIDX output section instead of
2636 assuming that it is called .ARM.exidx.
2637 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2638 section list. Do not check for SHF_EXECINSTR section flags but
2639 skip any input section with errors.
2640 * output.cc (Output_section::Output_section): Initialize
2641 always_keeps_input_sections_ to false.
2642 (Output_section::add_input_section): Check for
2643 always_keeps_input_sections_.
2644 * output.h (Output_section::always_keeps_input_sections,
2645 Output_section::set_always_keeps_input_sections): New methods.
2646 (Output_section::always_keeps_input_sections): New data member.
2647
69517287
RÁE
26482010-07-13 Rafael Espindola <espindola@google.com>
2649
2650 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2651 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2652
82742395
ILT
26532010-07-13 Philip Herron <herron.philip@googlemail.com>
2654 Ian Lance Taylor <iant@google.com>
2655
2656 * output.h (Output_section_lookup_maps::add_merge_section):
2657 Correct check of whether value was inserted.
2658 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2659 (Output_section_lookup_maps::add_relaxed_input_section):
2660 Likewise.
2661 * arm.cc (Target_arm::got_section): Remove used local os.
2662 * i386.cc (Target_i386::got_section): Likewise.
2663 * x86_64.cc (Target_x86_64::got_section): Likewise.
2664 * sparc.cc (Target_sparc::got_section): Likewise.
2665 (Target_sparc::relocate): Remove unused local have_got_offset.
2666 * powerpc.cc (Target_powerpc::relocate): Likewise.
2667
f2d707b5
ILT
26682010-07-13 Ian Lance Taylor <iant@google.com>
2669
241531d6
ILT
2670 * compressed_output.cc (zlib_decompress): Fix signature in
2671 !HAVE_ZLIB_H case.
2672
f2d707b5
ILT
2673 * archive.cc (Archive::include_member): Unlock an external member
2674 of a thin archive. Don't bother to delete an object we know is
2675 NULL.
2676
a2e47362
CC
26772010-07-12 Cary Coutant <ccoutant@google.com>
2678
2679 * compressed_output.cc (zlib_decompress): New function.
2680 (get_uncompressed_size): New function.
2681 (decompress_input_section): New function.
2682 * compressed_output.h (get_uncompressed_size): New function.
2683 (decompress_input_section): New function.
2684 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2685 Handle compressed debug sections.
2686 * layout.cc (is_compressed_debug_section): New function.
2687 (Layout::output_section_name): Map compressed section names to
2688 canonical names.
2689 * layout.h (is_compressed_debug_section): New function.
2690 (is_debug_info_section): Recognize compressed debug sections.
2691 * merge.cc: Include compressed_output.h.
2692 (Output_merge_data::do_add_input_section): Handle compressed
2693 debug sections.
2694 (Output_merge_string::do_add_input_section): Handle compressed
2695 debug sections.
2696 * object.cc: Include compressed_output.h.
2697 (Sized_relobj::Sized_relobj): Initialize new data members.
2698 (build_compressed_section_map): New function.
2699 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2700 * object.h (Object::section_is_compressed): New method.
2701 (Object::do_section_is_compressed): New method.
2702 (Sized_relobj::Compressed_section_map): New type.
2703 (Sized_relobj::do_section_is_compressed): New method.
2704 (Sized_relobj::compressed_sections_): New data member.
2705 * output.cc (Output_section::add_input_section): Handle compressed
2706 debug sections.
2707 * reloc.cc: Include compressed_output.h.
2708 (Sized_relobj::write_sections): Handle compressed debug sections.
2709
ce279a62
CC
27102010-07-08 Cary Coutant <ccoutant@google.com>
2711
2712 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2713 weak when resolving to a dynamic def.
2714 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2715 for weak undef/dynamic def cases. Adjust callers.
2716 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2717 undef_binding_weak_.
2718 (Symbol_table::sized_write_globals): Adjust symbol binding.
2719 (Symbol_table::sized_write_symbol): Add binding parameter.
2720 * symtab.h (Symbol::set_undef_binding): New method.
2721 (Symbol::is_undef_binding_weak): New method.
2722 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2723 (Symbol_table::should_override): Add new parameter.
2724 (Symbol_table::sized_write_symbol): Add new parameter.
2725
2726 * testsuite/weak_undef_file1.cc: Add new test case.
2727 * testsuite/weak_undef_file2.cc: Fix header comment.
2728 * testsuite/weak_undef_test.cc: Add new test case.
2729
b2286c10
DK
27302010-06-29 Doug Kwan <dougkwan@google.com>
2731
2732 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2733 Initialize USE_SYMBOL_.
2734 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2735 definition.
2736 (Arm_reloc_property::uses_symbol_): New data member declaration.
2737 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2738 uses symbol value and symbol is undefined but not weakly undefined.
2739
4802450a
RÁE
27402010-06-28 Rafael Espindola <espindola@google.com>
2741
2742 * plugin.cc (Plugin::load): Use dlerror.
2743
e5ca47ba
ILT
27442010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2745
2746 * symtab.cc (detect_odr_violations): When reporting an ODR
2747 violation, report an object where the symbol is defined.
2748
8a75a161
DK
27492010-06-25 Doug Kwan <dougkwan@google.com>
2750
2751 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2752 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2753 definition.
2754 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2755 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2756 target hook to detect function points.
2757 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2758 * icf.h (Icf::check_section_for_function_pointers): Change type of
2759 parameter SECTION_NAME to const reference to std::string. Use
2760 target hook to determine if section may have unsafe pointers.
2761 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2762 method definition.
2763
42218b9f
RÁE
27642010-06-21 Rafael Espindola <espindola@google.com>
2765
2766 * fileread.cc (Input_file::find_fie): New
2767 (Input_file::open): Use Input_file::find_fie.
2768 * fileread.h (Input_file::find_fie): New
2769 * plugin.cc (set_extra_library_path): New.
2770 (Plugin::load): Add set_extra_library_path to the transfer vector.
2771 (Plugin_manager::set_extra_library_path): New.
2772 (Plugin_manager::add_input_file): Use the extra search path if set.
2773 (set_extra_library_path(): New.
2774 * plugin.h (Plugin_manager): Add set_extra_library_path and
2775 extra_search_path_.
2776
a0506cca
CC
27772010-06-19 Cary Coutant <ccoutant@google.com>
2778
2779 * layout.cc (gdb_sections): Add .debug_types.
2780 (lines_only_debug_sections): Likewise.
2781
6508b958
RÁE
27822010-06-18 Rafael Espindola <espindola@google.com>
2783
2784 * plugin.cc (add_input_file,add_input_library)
2785 (Plugin_manager::add_input_file): Make filename arguments const.
2786 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2787 const.
2788
3e235302
DK
27892010-06-16 Doug Kwan <dougkwan@google.com>
2790
2791 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2792 .ARM.attributes section if we have not merged any input
2793 attributes sections.
2794
106e8a6c
DK
27952010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2796
2797 * arm.cc: Allow combining objects with no EABI version
2798 information.
2799
91ff43fe
RÁE
28002010-06-15 Rafael Espindola <espindola@google.com>
2801
2802 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2803
68ed838c
ILT
28042010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2805
2806 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2807 (struct iovec): Correct !HAVE_READV definition.
2808
f3a2388f
CC
28092010-06-10 Cary Coutant <ccoutant@google.com>
2810
2811 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2812 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2813 reloc sections.
2814 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2815
2816 PR 11683
2817 * symtab.h (Symbol::is_placeholder): New member function.
2818 * target-reloc.h (relocate_section): Check for placeholder symbols.
2819
2820 * testsuite/Makefile.am (plugin_test_8): New test.
2821 (plugin_test_9): New test.
2822 * testsuite/Makefile.in: Regenerate.
2823
e1df38aa
NC
28242010-06-09 Nick Clifton <nickc@redhat.com>
2825
2826 * yyscript.y (input_list_element): Allow strings prefixed with
2827 the '-' character. Treat these as libraries.
2828 * script.cc (script_add_library): New function. Adds a library
2829 specified by "-l<name>" found in an input script.
2830 * script-c.h: Add prototype for script_add_library.
2831
25bbe950
DK
28322010-06-07 Doug Kwan <dougkwan@google.com>
2833
2834 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2835 Restrict stub-group size to be within long conditional branch
2836 range when working around cortex-A8 erratum.
2837
0f32ea4c
ILT
28382010-06-07 Damien Diederen <dd@crosstwine.com>
2839
2840 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2841 #ifdef typo.
2842
8fe2a369
ST
28432010-06-03 Sriraman Tallam <tmsriram@google.com>
2844
2845 PR gold/11658
2846 * output.cc
2847 (Output_section::Input_section_sort_entry::compare_section_ordering):
2848 Change to return non-zero correctly.
2849 (Output_section::Input_section_sort_section_order_index_compare
2850 ::operator()): Change to fix ambiguity in comparisons.
2851
6e9ba2ca
ST
28522010-06-01 Sriraman Tallam <tmsriram@google.com>
2853
2854 * gold.h (is_wildcard_string): New function.
2855 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2856 (Layout::layout_eh_frame): Ditto.
2857 (Layout::find_section_order_index): New method.
2858 (Layout::read_layout_from_file): New method.
2859 * layout.h (Layout::find_section_order_index): New method.
2860 (Layout::read_layout_from_file): New method.
2861 (Layout::input_section_position_): New private member.
2862 (Layout::input_section_glob_): New private member.
2863 * main.cc (main): Call read_layout_from_file here.
2864 * options.h (--section-ordering-file): New option.
2865 * output.cc (Output_section::input_section_order_specified_): New
2866 member.
2867 (Output_section::Output_section): Initialize new member.
2868 (Output_section::add_input_section): Add new parameter.
2869 Keep input sections when --section-ordering-file is used.
2870 (Output_section::set_final_data_size): Sort input sections when
2871 section ordering file is specified.
2872 (Output_section::Input_section_sort_entry): Add new parameter.
2873 Check sorting type.
2874 (Output_section::Input_section_sort_entry::compare_section_ordering):
2875 New method.
2876 (Output_section::Input_section_sort_compare::operator()): Change to
2877 consider section_order_index.
2878 (Output_section::Input_section_sort_init_fini_compare::operator()):
2879 Change to consider section_order_index.
2880 (Output_section::Input_section_sort_section_order_index_compare
2881 ::operator()): New method.
2882 (Output_section::sort_attached_input_sections): Change to sort
2883 according to section order when specified.
e1df38aa
NC
2884 (Output_section::add_input_section<32, true>): Add new parameter.
2885 (Output_section::add_input_section<64, true>): Add new parameter.
2886 (Output_section::add_input_section<32, false>): Add new parameter.
2887 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2888 * output.h (Output_section::add_input_section): Add new parameter.
2889 (Output_section::input_section_order_specified): New
2890 method.
2891 (Output_section::set_input_section_order_specified): New method.
2892 (Input_section::Input_section): Initialize section_order_index_.
2893 (Input_section::section_order_index): New method.
2894 (Input_section::set_section_order_index): New method.
2895 (Input_section::section_order_index_): New member.
2896 (Input_section::Input_section_sort_section_order_index_compare): New
2897 struct.
2898 (Output_section::input_section_order_specified_): New member.
2899 * script-sections.cc (is_wildcard_string): Delete and move modified
2900 method to gold.h.
2901 (Output_section_element_input::Output_section_element_input): Modify
2902 call to is_wildcard_string.
2903 (Output_section_element_input::Input_section_pattern
2904 ::Input_section_pattern): Ditto.
2905 (Output_section_element_input::Output_section_element_input): Ditto.
2906 * testsuite/Makefile.am (final_layout): New test case.
2907 * testsuite/Makefile.in: Regenerate.
2908 * testsuite/final_layout.cc: New file.
2909 * testsuite/final_layout.sh: New file.
2910
3537c84b
RÁE
29112010-06-01 Rafael Espindola <espindola@google.com>
2912
2913 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2914
105b6afd
RÁE
29152010-06-01 Rafael Espindola <espindola@google.com>
2916
2917 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2918 visibility of symbols.
2919
29e11421
DK
29202010-05-27 Doug Kwan <dougkwan@google.com>
2921
2922 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2923 from start of output section instead of address for a local symbol
2924 in a merged or relaxed section when doing a relocatable link.
2925
5e0f337e
RÁE
29262010-05-26 Rafael Espindola <espindola@google.com>
2927
2928 PR 11604
2929 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2930 adding sections the garbage collector removed.
2931 * gold/testsuite/Makefile.am: Add test.
2932 * gold/testsuite/Makefile.in: Regenerate.
2933 * gold/testsuite/plugin_test_7.sh: New.
2934 * gold/testsuite/plugin_test_7_1.c: New.
2935 * gold/testsuite/plugin_test_7_2.c: New.
2936
f4187277
RÁE
29372010-05-26 Rafael Espindola <espindola@google.com>
2938
2939 * script-sections.cc (Output_section_definition::set_section_addresses):
2940 Check for --section-start.
2941
5c388529
DK
29422010-05-26 Doug Kwan <dougkwan@google.com>
2943
2944 * arm.cc (Arm_scan_relocatable_relocs): New class.
2945 (Target_arm::relocate_special_relocatable): New method.
2946 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2947 (Arm_relocate_functions::thumb_branch_common): Same.
2948 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2949 instead of Default_scan_relocatable_relocs.
2950 * target-reloc.h (relocate_for_relocatable): Let target handle
2951 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2952 * target.h (Sized_target::relocate_special_relocatable): New method.
2953
bca1c3ae
ILT
29542010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2955
2956 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2957
0439c796
DK
29582010-05-23 Doug Kwan <dougkwan@google.com>
2959
2960 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2961 instead of a cast.
2962 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2963 with a direct branch, not a conditional branch, to a stub.
2964 * merge.cc (Output_merge_base::record_input_section): New method
2965 defintion.
2966 (Output_merge_data::do_add_input_section): Record input section if
2967 keeps-input-sections flag is set.
2968 (Output_merge_string::do_add_input_section): Ditto.
2969 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2970 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2971 INPUT_SECTIONS_.
2972 (Output_merge_base::keeps_input_sections,
2973 Output_merge_base::set_keeps_input_sections,
2974 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2975 method definitions.
2976 (Output_merge_base::Input_sections): New type declaration.
2977 (Output_merge_base::input_sections_begin,
2978 Output_merge_base::input_sections_end,
2979 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2980 (Output_merge_base::bool keeps_input_sections_,
2981 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2982 Output_merge_base::input_sections_): New data members.
2983 (Output_merge_data::do_set_keeps_input_sections): New method
2984 defintion.
2985 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2986 * output.cc (Output_section::Input_section::relobj): Move method
2987 defintion from class declaration to here and handle merge sections.
2988 (Output_section::Input_section::shndx): Ditto.
2989 (Output_section::Output_section): Remove initializations of removed
2990 data members and initialize new data member LOOKUP_MAPS_.
2991 (Output_section::add_input_section): Set keeps-input-sections flag
2992 for a newly created merge output section as appropriate. Adjust code
2993 to use Output_section_lookup_maps class.
2994 (Output_section::add_relaxed_input_section): Adjst code for lookup
2995 maps code refactoring.
2996 (Output_section::add_merge_input_section): Add a new parameter
2997 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2998 class. If adding input section to a newly created merge output
2999 section fails, remove the new merge section.
3000 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3001 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3002 (Output_section::find_merge_section): Ditto.
3003 (Output_section::build_lookup_maps): New method defintion.
3004 (Output_section::find_relaxed_input_section): Adjust code to use
3005 Output_section_lookup_maps class.
3006 (Output_section::get_input_sections): Export merge sections. Adjust
3007 code to use Output_section_lookup_maps class.
3008 (Output_section:::add_script_input_section): Adjust code to use
3009 Output_section_lookup_maps class. Update lookup maps for merge
3010 sections also.
3011 (Output_section::discard_states): Use Output_section_lookup_maps.
3012 (Output_section::restore_states): Same.
3013 * output.h (Merge_section_properties): Move class defintion out of
3014 Output_section.
3015 (Output_section_lookup_maps): New class.
3016 (Output_section::Input_section::is_merge_section): New method
3017 defintion.
3018 (Output_section::Input_section::relobj): Move defintion out of class
3019 defintion. Declare method only.
3020 (Output_section::Input_section::shndx): Ditto.
3021 (Output_section::Input_section::output_merge_base): New method defintion.
3022 (Output_section::Input_section::u2_.pomb): New union field.
3023 (Output_section::Merge_section_by_properties_map,
3024 Output_section::Output_section_data_by_input_section_map,
3025 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3026 Remove types.
3027 (Output_section::add_merge_input_section): Add new parameter
3028 KEEPS_INPUT_SECTIONS.
3029 (Output_section::build_lookup_maps): New method declaration.
3030 (Output_section::merge_section_map_,
3031 Output_section::merge_section_by_properties_map_,
3032 Output_section::relaxed_input_section_map_,
3033 Output_section::is_relaxed_input_section_map_valid_): Remove data
3034 members.
3035 (Output_section::lookup_maps_): New data member.
3036
76295588
L
30372010-05-21 Doug Kwan <dougkwan@google.com>
3038
3039 PR gold/11619
3040 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3041 avoid a compilation error.
3042
d103a984
RÁE
30432010-05-19 Rafael Espindola <espindola@google.com>
3044
3045 * script-sections.cc (Output_section_definition::allocate_to_segment):
3046 Update the phdrs_list even when the output section is NULL.
3047 * testsuite/Makefile.am: Add test.
3048 * testsuite/Makefile.in: Regenerate.
3049 * testsuite/script_test_9.cc: New.
3050 * testsuite/script_test_9.sh: New.
3051 * testsuite/script_test_9.t: New.
3052
6625d24e
DK
30532010-05-19 Doug Kwan <dougkwan@google.com>
3054
3055 * arm.cc (Arm_input_section::original_size): New method.
3056 (Arm_input_section::do_addralign): Add a cast.
3057 (Arm_input_section::do_output_offset): Remove static cast.
3058 (Arm_input_section::original_addralign,
3059 Arm_input_section::original_size_): Change type to uint32_t.
3060 (Arm_input_section::init): Add safe casts for section alignment
3061 and size.
3062 (Arm_input_section::set_final_data_size): Do not set address and
3063 offset of stub table.
3064 (Arm_output_section::fix_exidx_coverage): Change use of of
3065 Output_section::Simple_input_section to that of
3066 Output_section::Input_section.
3067 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3068 except for the first pass.
3069 * output.cc (Output_section::get_input_sections): Change type of
3070 input_sections to std::list<Input_section>.
3071 (Output_section::add_script_input_section): Rename from
3072 Output_section::add_simple_input_section. Change type of SIS
3073 parameter from Simple_input_section to Input_section.
3074 * output.h (Output_section::Simple_input_section): Remove class.
3075 (Output_section::Input_section): Change class visibility to public.
3076 (Output_section::Input_section::addralign): Use stored alignments
3077 for special input sections if set.
3078 (Output_section::Input_section::set_addralign): New method.
3079 (Output_section::get_input_sections): Change parameter type from
3080 list of Simple_input_section to list of Input_section.
3081 (Output_section::add_script_input_section): Rename from
3082 Output_section::add_simple_input_section. Change first parameter's
3083 type from Simple_input_section to Input_section and remove the
3084 second and third parameters.
3085 * script-sections.cc (Input_section::Input_section_list): Change
3086 type to list of Output_section::Input_section/
3087 (Input_section_info::Input_section_info): Change parameter type of
3088 INPUT_SECTION to Output_section::Input_section.
3089 (Input_section_info::input_section): Change return type.
3090 (Input_section_info::input_section_): Change type to
3091 Output_section::Input_section.
3092 (Output_section_element_input::set_section_addresses): Adjust code
3093 to use Output_section::Input_section instead of
3094 Output_section::Simple_input_section. Adjust code for renaming
3095 of Output_section::add_simple_input_section.
3096 (Orphan_output_section::set_section_addresses): Ditto.
3097
e1e82ea4
RW
30982010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3099
3100 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3101 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3102
91e75c8a
RÁE
31032010-05-18 Rafael Espindola <espindola@google.com>
3104
3105 * options.cc (General_options::finalize): Handle -nostdlib.
3106 * options.h (nostdlib): New option.
3107 * script.cc (script_add_search_dir): Handle -nostdlib.
3108
da59ad79
DK
31092010-05-12 Doug Kwan <dougkwan@google.com>
3110
3111 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3112 attributes section only if there no attributes section after merging.
3113 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3114 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3115 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3116 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3117 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3118 and arm_attr_merge_7.stdout.
3119 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3120 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3121 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3122 arm_attr_merge_7b.o): New rules.
3123 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3124 arm_attr_merge_7
3125 * testsuite/Makefile.in: Regenerate.
3126 * testsuite/arm_attr_merge.sh: New file.
3127 * testsuite/arm_attr_merge_[67][ab].s: Same.
3128
3e01a7fd
NC
31292010-05-05 Nick Clifton <nickc@redhat.com>
3130
3131 * po/es.po: Updated Spanish translation.
3132
7ad2014a
L
31332010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3134
3135 * Makefile.am (install-exec-local): Properly install gold as
3136 default cross linker.
3137 * Makefile.in: Regenerated.
3138
4fda8867
NC
31392010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3140 Nick Clifton <nickc@redhat.com>
3141
3142 * configure.ac (install_as_default): Define and set to false
3143 unless --enable-gold or --enable-gold=both/gold has been
3144 specified.
3145 * configure: Regenerate.
3146
3147 * Makefile.am (install-exec-local): Install the executable as
3148 'ld.gold'. If install_as_default is true then also install it as
3149 'ld'.
3150 * Makefile.in: Regenerated.
3151
bd288ea2
ILT
31522010-04-24 Ian Lance Taylor <iant@google.com>
3153
3154 * layout.cc (Layout::layout_reloc): In relocatable link don't
3155 combine reloc sections for grouped sections.
3156
ef38fd8a
ST
31572010-04-23 Sriraman Tallam <tmsriram@google.com>
3158
3159 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3160 sections that are not ordinary to icf.
3161 * icf.cc (get_section_contents): Handle relocation pointing to section
3162 with no object or shndx information.
3163 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3164 * testsuite/Makefile.in: Regenerate.
3165 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3166 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3167
f6973bdc
ILT
31682010-04-22 Ian Lance Taylor <iant@google.com>
3169
3170 * expression.cc (Expression::Expression_eval_info): Add
3171 result_alignment_pointer field.
3172 (Expression::eval_with_dot): Add result_alignment_pointer
3173 parameter. Change all callers.
3174 (Expression::eval_maybe_dot): Likewise.
3175 (class Binary_expression): Add alignment_pointer parameter to
3176 left_value and right_value. Change all callers.
3177 (BINARY_EXPRESSION): Set result alignment.
3178 (class Trinary_expression): Add alignment_pointer parameter to
3179 arg2_value and arg3_value. Change all callers.
3180 (Trinary_cond::value): Set result alignment.
3181 (Max_expression::value, Min_expression::value): Likewise.
3182 (Align_expression::value): Likewise.
3183 * script-sections.cc (class Sections_element): Add dot_alignment
3184 parameter to set_section_addresses virtual function. Update
3185 instantiations.
3186 (class Output_section_element): Likewise.
3187 (Script_sections::create_segments): Add dot_alignment parameter.
3188 Change all callers.
3189 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3190 (Script_sections::set_phdrs_clause_addresses): Likewise.
3191 * script-sections.h: Update declarations.
3192 * script.h: Update declarations.
3193 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3194 min_p_align.
3195 * testsuite/script_test_3.t: Set large alignment.
3196 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3197 segment has expected alignment.
3198
9c9c98a5
NC
31992010-04-22 Nick Clifton <nickc@redhat.com>
3200
3201 * po/gold.pot: Updated by the Translation project.
3202 * po/vi.po: Updated Vietnamese translation.
3203
2253bfba
L
32042010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3205
3206 * testsuite/Makefile.am (check_PROGRAMS): Add
3207 icf_virtual_function_folding_test.
3208 * testsuite/Makefile.in: Regenerated.
3209
85fdf906
AH
32102010-04-15 Andrew Haley <aph@redhat.com>
3211
3212 * options.h (merge_exidx_entries): New option.
3213 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3214 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3215 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3216 (Target_arm::merge_exidx_entries): New function.
3217 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3218 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3219 to Arm_exidx_fixup constructor.
3220 Add new arg, merge_exidx_entries.
3221 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3222 Arm_output_section::fix_exidx_coverage.
3223
ce97fa81
ST
32242010-04-18 Sriraman Tallam <tmsriram@google.com>
3225
3226 * icf.cc (get_section_contents): Check for preemptible functions.
3227 Ignore addend when appropriate.
3228 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3229 section folded.
3230 (add_from_relobj): Check for section folded.
3231 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3232 * symtab.h (should_add_dynsym_entry): Add new parameter.
3233 * target-reloc.h (scan_relocs): Check for section folded.
3234 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3235 Check reloc types for function pointers in shared objects.
3236 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3237 case.
3238 (icf_preemptible_functions_test): New test case.
3239 (icf_string_merge_test): New test case.
3240 * testsuite.Makefile.in: Regenerate.
3241 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3242 bar_glob. Refactor code.
3243 * testsuite/icf_preemptible_functions_test.cc: New file.
3244 * testsuite/icf_preemptible_functions_test.sh: New file.
3245 * testsuite/icf_string_merge_test.cc: New file.
3246 * testsuite/icf_string_merge_test.sh: New file.
3247 * testsuite/icf_virtual_function_folding_test.cc: New file.
3248 * testsuite/icf_virtual_function_folding_test.sh: New file.
3249
04ceb17c
DK
32502010-04-14 Doug Kwan <dougkwan@google.com>
3251
3252 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3253 for local symbol recounting if we remove a section due to ICF.
3254 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3255 there are no regular objects in input.
3256
153e7da4
DK
32572010-04-13 Doug Kwan <dougkwan@google.com>
3258
3259 * arm.cc (Arm_input_section::set_final_data_size): Compute
3260 accurate final data size instead of using current data size.
3261
4dbd9faf
DK
32622010-04-09 Doug Kwan <dougkwan@google.com>
3263
3264 * layout.cc (Layout::choose_output_section): Handle script section
3265 types.
3266 (Layout::make_output_section_for_script): Add section type parameter.
3267 Handle script section types.
3268 * layout.h (Layout::make_output_section_for_script): Add section
3269 type parameter.
3270 * output.cc (Output_section::Output_section): Initialize data member
3271 is_noload_.
3272 (Output_section::do_reset_address_and_file_offset): Do not set address
3273 to 0 if section is a NOLOAD section.
3274 * output.h (Output_section::is_noload): New method.
3275 (Output_section::set_is_noload): Ditto.
3276 (Output_section::is_noload_): New data member.
3277 * script-c.h (Script_section_type): New enum type.
3278 (struct Parser_output_section_header): Add new file section_type.
3279 * script-sections.cc (Sections_element::output_section_name): Add
3280 parameter for returning script section type.
3281 (Output_section_definition::output_section_name): Ditto.
3282 (Output_section_definition::section_type)P; New method.
3283 (Output_section_definiton::script_section_type_name): Ditto.
3284 (Output_section_definition::script_section_type_): New data member.
3285 (Output_section_definition::Output_section_definition): Initialize
3286 data member Output_section_definition::script_section_type_.
3287 (Output_section_definition::create_sections): Pass script section type
3288 to Layout::make_output_section_for_script.
3289 (Output_section_definition::output_section_name): Return script
3290 section type to caller.
3291 (Output_section_definition::set_section_address): Do not advance
3292 dot value and load address if section type is NOLOAD. Set address
3293 of NOLOAD sections regardless of section flags.
3294 (Output_section_definition::print): Print section type if it is
3295 not SCRIPT_SECTION_TYPE_NONE.
3296 (Output_section_definition::section_type): New method.
3297 (Output_section_definition::script_section_type_name): Ditto.
3298 (Script_sections::output_section_name): Add new parameter
3299 PSECTION_TYPE for returning script section type. Pass it to
3300 section elements. Handle discard sections.
3301 (Sort_output_sections::operator()): Handle NOLOAD sections.
3302 * script-sections.h (Script_sections::Section_type): New enum type.
3303 (Script_sections::output_section_name): Add a new parameter for
3304 returning script section type.
3305 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3306 INFO and NOLOAD.
3307 * yyscript.y (union): Add new field SECTION_TYPE.
3308 (COPY, DSECT, INFO, NOLOAD): New tokens.
3309 (opt_address_and_section_type): Change type to output_section_header.
3310 (section_type): New non-terminal
3311 (section_header): Handle section type.
2253bfba 3312 (opt_address_and_section_type): Return section type value.
4dbd9faf 3313
721ea635
L
33142010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3315
3316 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3317 * testsuite/plugin_common_test_2.c (foo): Likewise.
3318
6bf924b0
DK
33192010-04-08 Doug Kwan <dougkwan@google.com>
3320
3321 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3322 Output_merge_data.
3323 * output.cc (Output_section::add_merge_input_section): Simplify
3324 code and return status of Output_merge_base::add_input_section.
e1df38aa 3325 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3326 returns true.
3327
24af6f92
DK
33282010-04-07 Doug Kwan <dougkwan@google.com>
3329
3330 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3331 if section is marked as containing instructions but has no mapping
3332 symbols.
3333 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3334 correct section index.
3335 (Arm_relobj::find_linked_text_section): Ditto.
3336
00698fc5
CC
33372010-04-07 Cary Coutant <ccoutant@google.com>
3338
3339 * archive.cc (include_member): Destroy Read_symbols_data object before
3340 releasing file.
3341 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3342 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3343 (Read_symbols_data::~Read_symbols_data) New destructor.
3344 (Section_relocs::Section_relocs) New constructor.
3345 (Section_relocs::~Section_relocs) New destructor.
3346 (Read_relocs_data::Read_relocs_data) New constructor.
3347 (Read_relocs_data::~Read_relocs_data) New destructor.
3348 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3349 pointers to NULL after deleting.
3350
7296d933
DK
33512010-04-07 Doug Kwan <dougkwan@google.com>
3352
3353 * arm.cc: Replace "endianity" with "endianness" in comments.
3354 (Arm_exidx_cantunwind): Ditto.
3355 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3356 (Arm_relobj::merge_flags_and_attributes): New method.
3357 (Arm_relobj::merge_flags_and_attributes_): New data member.
3358 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3359 (Arm_relobj::scan_sections_for_stubs): Ditto.
3360 (Arm_relobj::do_read_symbols): Check to see if we really want to
3361 merge processor-specific flags and attributes. Exit early if
3362 an object is empty except for section names and the undefined symbol.
3363 (Target_arm::do_finalize_sections): Move check for ELF format to
3364 Arm_relobj::do_read_symbols. Merge processor specific flags and
3365 attributes from a regular object only when we have determined that
3366 it is aapropriate. Do not create an .ARM.attributes section in
3367 output if there is no regular input object.
3368 (Target_arm::merge_processor_specific_flags): Check
3369 --warn-mismatch before printing any error.
3370 (Target_arm::merge_object_attributes): Ditto.
3371 * gold.cc (queue_middle_tasks): Handle the case in which there is
3372 no regular object in input.
3373 * options.cc (General_options::parse_EB): New method.
3374 (General_options::parse_EL): Same.
3375 (General_options::General_options): Initialize endianness_.
3376 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3377 New options.
3378 (General_options::Endianness): New enum.
3379 (General_options::endianness): New method.
3380 (General_options::endianness_): New data member.
3381 * parameters.cc (Parameters::set_options): Check target endianness.
3382 (Parameters::set_target_once): Ditto.
3383 (Parameters::check_target_endianness): New method.
3384 (parameters_force_valid_target): If either -EL or -EB is specified,
3385 use it to define endianness of default target.
3386 * parameters.h (Parameters::check_target_endianness): New method
3387 declaration.
3388 * target.h (class Target): Change "endianity" to "endianness"
3389 in comments.
3390
efc8d4f2
RW
33912010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3392
3393 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3394 * configure: Regenerate.
3395 * Makefile.in: Regenerate.
3396 * testsuite/Makefile.in: Regenerate.
3397
be234d88
CC
33982010-04-06 Cary Coutant <ccoutant@google.com>
3399
3400 gcc PR lto/42757
3401 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3402 prevailing definitions of common symbols.
3403 * testsuite/plugin_test_6.sh: New test case.
3404 * testsuite/plugin_common_test_1.c: New test case.
3405 * testsuite/plugin_common_test_2.c: New test case.
3406 * testsuite/Makefile.am (plugin_test_6): New test case.
3407 * testsuite/Makefile.in: Regenerate.
3408
bd32c6bd
NC
34092010-04-06 Nick Clifton <nickc@redhat.com>
3410
3411 * po/vi.po: New Vietnamese translation.
3412
323c532f
DK
34132010-03-30 Doug Kwan <dougkwan@google.com>
3414
3415 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3416
4fcd97eb
DK
34172010-03-25 Doug Kwan <dougkwan@google.com>
3418
3419 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3420 to avoid a conversion warning on a 32-bit host.
3421
4ebf39db
ILT
34222010-03-24 Ian Lance Taylor <iant@google.com>
3423
3424 * testsuite/script_test_3.t: Add a TLS segment.
3425 * testsuite/Makefile.am (check_PROGRAMS): Add
3426 tls_phdrs_script_test.
3427 (tls_phdrs_script_test_SOURCES): Define.
3428 (tls_phdrs_script_test_DEPENDENCIES): Define.
3429 (tls_phdrs_script_test_LDFLAGS): Define.
3430 (tls_phdrs_script_test_LDADD): Define.
3431 * testsuite/Makefile.in: Rebuild.
3432
4a599bdd
CC
34332010-03-23 Cary Coutant <ccoutant@google.com>
3434
3435 * fileread.cc (find_or_make_view): Fix comment.
3436
6c93b22c
ILT
34372010-03-23 Ian Lance Taylor <iant@google.com>
3438
3439 * script-sections.cc (class Orphan_section_placement): Define
3440 PLACE_TLS and PLACE_TLS_BSS.
3441 (Orphan_section_placement::Orphan_section_placement): Initialize
3442 new places.
3443 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3444 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3445 (tls_script_test_SOURCES): Define.
3446 (tls_script_test_DEPENDENCIES): Define.
3447 (tls_script_test_LDFLAGS): Define.
3448 (tls_script_test_LDADD): Define.
3449 * testsuite/Makefile.in: Rebuild.
3450
a2c7281b
DK
34512010-03-22 Doug Kwan <dougkwan@google.com>
3452
3453 * arm.cc (Arm_relocate_functions::abs8,
3454 Arm_relocate_functions::abs16): Use correct check for overflow
3455 specified in the ARM ELF specs.
3456 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3457 target of a BLX instruction specially.
3458 (Reloc_stub::stub_type_for_reloc): Ditto.
3459 (Relocate::relocate): Use symbolic names instead of numeric relocation
3460 codes to report error.
3461 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3462 workaround.
3463 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3464 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3465 thumb2_blx_out_of_range.stdout
3466 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3467 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3468 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3469 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3470 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3471 thumb2_blx_in_range, thumb2_blx_in_range.o,
3472 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3473 thumb2_blx_out_of_range.o): New rules.
3474 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3475 thumb2_blx_in_range and thumb2_blx_out_of_range.
3476 * testsuite/Makefile.in: Regenerate.
3477 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3478 * testsuite/thumb_blx_in_range.s: New file.
3479 * testsuite/thumb_blx_out_of_range.s: New file.
3480
b0193076
RÁE
34812010-03-22 Rafael Espindola <espindola@google.com>
3482
3483 * archive.cc (Should_include): Move to archive.h.
3484 (should_include_member): Make it a member of Archive.
3485 (Lib_group): New.
3486 (Add_lib_group_symbols): New.
3487 * archive.h: Include options.h.
3488 (Archive_member): Moved from Archive.
3489 (Should_include): Moved from archive.cc.
3490 (Lib_group): New.
3491 (Add_lib_group_symbols): New.
3492 * dynobj.cc (do_should_include_member): New.
3493 * dynobj.h (do_should_include_member): New.
3494 * gold.cc (queue_initial_tasks): Update call to queue.
3495 * main.cc (main): Print lib group stats.
3496 * object.cc (do_should_include_member): New.
3497 * object.h: Include archive.h.
3498 (Object::should_include_member): New.
3499 (Object::do_should_include_member): New.
3500 (Sized_relobj::do_should_include_member): New.
3501 * options.cc (General_options::parse_start_lib): New.
3502 (General_options::parse_end_lib): New.
3503 (Input_arguments::add_file): Handle lib groups.
3504 (Input_arguments::start_group): Check we are not in a lib.
3505 (Input_arguments::start_lib): New.
3506 (Input_arguments::end_lib): New.
3507 * options.h (General_options): Add start_lib and end_lib.
3508 (Input_argument::lib_): New.
3509 (Input_argument::lib): New.
3510 (Input_argument::is_lib): New.
3511 (Input_file_lib): New.
3512 (Input_arguments::in_lib_): New.
3513 (Input_arguments::in_lib): New.
3514 (Input_arguments::start_lib): New.
3515 (Input_arguments::end_lib_): New.
3516 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3517 in unused members as preempted.
3518 (Sized_pluginobj::do_should_include_member): New.
3519 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3520 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3521 return the blocker.
3522 (Read_symbols::do_whole_lib_group): New.
3523 (Read_symbols::do_lib_group): New.
3524 (Read_symbols::do_read_symbols): Handle lib groups.
3525 (Read_symbols::get_name): Handle lib groups.
3526 * readsyms.h (Read_symbols): Add an archive member pointer.
3527 (Read_symbols::do_whole_lib_group): New.
3528 (Read_symbols::do_lib_group): New.
3529 (Read_symbols::member_): New.
3530 * script.cc (read_input_script): Update call to queue_soon.
3531
d099120c
DK
35322010-03-19 Doug Kwan <dougkwan@google.com>
3533
3534 * arm.cc (Stub_table::Stub_table): Initialize new data members
3535 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3536 (Stub_table::add_reloc_stub): Assign stub offset and update
3537 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3538 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3539 New data members.
3540 (Stub_table::update_data_size_and_addralign): Use
3541 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3542 instead of going over all reloc stubs.
3543 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3544 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3545 Stringpool_template::offset_ to size of Stringpool_char.
3546 (Stringpool_template::new_key_offset): Remove code to initialize
3547 Stringpool_template::offset_.
3548 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3549 Stringpool_template::offset_ to zero.
3550
1aa37384
DK
35512010-03-15 Doug Kwan <dougkwan@google.com>
3552
3553 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3554 offset_.
3555 (Stringpool_template::new_key_offset): New method.
3556 (Stringpool_template::add_string): Assign offsets when adding new
3557 strings.
3558 (Stringpool_template::set_string_offsets): Do not set string offsets
3559 when not optimizing.
3560 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3561 member size_.
3562 (Chunked_vector::clear): Clear size_.
3563 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3564 (Chunked_vector::size): Return size_.
3565 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3566 (Chunked_vector::size_): New data member.
1aa37384
DK
3567 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3568 (Stringpool_template::new_key_offset): New method declaration.
3569 (Stringpool_template::offset_): New data member.
3570
b672b057
RÁE
35712010-03-15 Rafael Espindola <espindola@google.com>
3572
3573 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3574 Add_symbols' constructor.
3575 * readsyms.h (Add_symbols): Remove the input_group member.
3576
b6848d3c
ILT
35772010-03-10 Ian Lance Taylor <iant@google.com>
3578
3579 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3580 target to ask whether a reference to a symbol requires a stack
3581 split.
3582 * target.h (Target::is_call_to_non_split): New function.
3583 (Target::do_is_call_to_non_split): Declare virtual function.
3584 * target.cc: Include "symtab.h".
3585 (Target::do_is_call_to_non_split): New function.
3586 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3587
a2a5469e
CC
35882010-03-10 Cary Coutant <ccoutant@google.com>
3589
3590 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3591 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3592 (File_read::open[2]): Add whole_file_view_ to list of views.
3593 (File_read::make_view): Remove test of whole_file_view_.
3594 (File_read::find_or_make_view): Create whole_file_view_ if
3595 necessary.
3596 (File_read::clear_views): Replace bool parameter with enum;
3597 adjust all callers. Don't delete views with permanent data;
3598 do delete cached views and views from archives if
3599 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3600 if clearing the corresponding view.
3601 * fileread.h (File_read::Clear_views_mode): New enum.
3602 (File_read::View::is_permanent_view): New method.
3603 (File_read::clear_views): Replace bool parameter
3604 with enum; adjust all callers.
3605 * options.h (General_options): Change keep_files_mapped option;
3606 add map_whole_files.
3607 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3608 releasing the file.
3609 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3610 the file.
3611
8861f32b
DM
36122010-03-10 David S. Miller <davem@davemloft.net>
3613
3614 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3615
d62d0f5f
ST
36162010-03-09 Sriraman Tallam <tmsriram@google.com>
3617
3618 * icf.cc (get_section_contents): Add '@' marker after processing the
3619 merge reloc.
3620
9177756d
DK
36212010-03-08 Doug Kwan <dougkwan@google.com>
3622
3623 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3624 due to a conversion warning.
3625 (Arm_relobj::update_output_local_symbol_count): Check for local
3626 symbol with unset output index.
3627
9e9e071b
ILT
36282010-03-05 Ian Lance Taylor <iant@google.com>
3629
3630 * options.h (class General_options): Add --spare-dynamic-tags.
3631 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3632 --spare-dynamic-tags.
3633
a81ee015
ILT
36342010-03-05 Ian Lance Taylor <iant@google.com>
3635
3636 * incremental.cc: Include "libiberty.h".
3637
44ec90b9
RO
36382010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3639
3640 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3641 function, is_info_ member.
3642 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3643 (Versions::Versions): Update caller.
3644 (Versions::define_base_version): Likewise.
3645 (Versions::add_def): Likewise.
3646
0897ed3b
ST
36472010-03-03 Sriraman Tallam <tmsriram@google.com>
3648
3649 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3650 (Scan::possible_function_pointer_reloc): New function.
3651 (Scan::local_reloc_may_be_function_pointer): Change to call
3652 possible_function_pointer_reloc.
3653 (Scan::global_reloc_may_be_function_pointer): Ditto.
3654 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3655 relocations in ".data.rel.ro._ZTV" section.
3656 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3657 * testsuite/icf_safe_so_test.cc: Ditto.
3658 * testsuite/icf_safe_test.cc: Ditto.
3659 * testsuite/icf_safe_test.sh: Ditto.
3660
d3bbad62
ILT
36612010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3662 Ian Lance Taylor <iant@google.com>
3663
3664 * target-reloc.h (relocate_section): Check the symbol table index
3665 for -1U before setting the local symbol index.
3666 (scan_relocatable_relocs): If copying the relocation, record that
3667 the local symbol is required.
3668 * object.h (Symbol_value::is_output_symtab_index_set): New
3669 function.
3670 (Symbol_value::may_be_discarded_from_output_symtab): New
3671 function.
3672 (Symbol_value::has_output_symtab_entry): New function.
3673 (Symbol_value::needs_output_symtab_entry): Remove.
3674 (Symbol_value::output_symtab_index): Make sure the symbol index is
3675 set.
3676 (Symbol_value::set_output_symtab_index): Make sure the symbol
3677 index is not set. Make sure the new index is valid.
3678 (Symbol_value::set_must_have_output_symtab_entry): New function.
3679 (Symbol_value::has_output_dynsym_entry): New function.
3680 (Symbol_value::set_output_dynsym_index): Make sure the new index
3681 is valid.
3682 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3683 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3684 local symbol if permitted.
3685 (Sized_relobj::do_finalize_local_symbols): Call
3686 is_output_symtab_index_set rather than needs_output_symtab_entry.
3687 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3688 rather than needs_output_symtab_entry. Call
3689 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3690 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3691 is_output_symtab_index_set rather than needs_output_symtab_entry.
3692 * testsuite/discard_locals_relocatable_test.c: New file.
3693 * testsuite/discard_locals_test.sh: Test -r.
3694 * testsuite/Makefile.am (check_DATA): Add
3695 discard_locals_relocatable_test1.syms,
3696 discard_local_relocatable_test2.syms.
3697 (MOSTLYCLEANFILES): Likewise. Also add
3698 discard_locals_relocatable_test1.lout and
3699 discard_locals_relocatable_test2.out.
3700 (discard_locals_relocatable_test1.syms): New target.
3701 (discard_locals_relocatable_test.o): New target.
3702 (discard_locals_relocatable_test1.out): New target.
3703 (discard_locals_relocatable_test2.syms): New target.
3704 (discard_locals_relocatable_test2.out): New target.
3705 (various): Add missing ../ld-new dependencies.
3706 * testsuite/Makefile.in: Rebuild.
3707
7e8ccf26
NC
37082010-03-03 Nick Clifton <nickc@redhat.com>
3709
3710 * po/fi.po: New Finnish translation.
3711
2a0ff005
DK
37122010-03-01 Doug Kwan <dougkwan@google.com>
3713
3714 * layout.cc (Layout::Layout): Force section types of .init_array*,
3715 .preinit_array* and .fini_array* sections.
3716 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3717 Fix check of return value of std::string::find.().
3718 (Output_section::Input_section_sort_compare::operator()): Remove
3719 comment about .init_array.
3720 (Output_section::Input_section_sort_init_fini_compare::operator()):
3721 New method.
3722 (Output_section::sort_attached_input_sections): Handle .init_array
3723 and .fini_array specially.
3724 * output.h (Output_section::Inut_section_sort_compare): Update
3725 comment.
3726 (Output_section::Input_section_sort_init_fini_compare): New struct.
3727
c3e4ae29
DK
37282010-02-26 Doug Kwan <dougkwan@google.com>
3729
3730 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3731 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3732 * testsuite/debug_msg.sh: Avoid matching source line number for
3733 use of global variable undef_int.
3734
2fd9ae7a
DK
37352010-02-26 Doug Kwan <dougkwan@google.com>
3736
3737 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3738 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3739 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3740 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3741 * options.cc (General_options::General_options): Initialize member
3742 fix_v4bx_.
3743 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3744 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3745 and rm_no_fix_v4bx.stdout
3746 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3747 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3748 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3749 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3750 and arm_no_fix_v4bx.
3751 * Makefile.in: Regenerate.
3752 * testsuite/arm_fix_v4bx.s: New file.
3753 * testsuite/arm_fix_v4bx.sh: Ditto.
3754
67ec7d0b
DK
37552010-02-24 Doug Kwan <dougkwan@google.com>
3756
3757 * arm.cc (Target_arm::got_section): Make the .got section the first
3758 non RELRO section in the data segment.
3759 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3760 suffixes of section names.
3761
10165461
DK
37622010-02-24 Doug Kwan <dougkwan@google.com>
3763
3764 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3765 flags and attributes merging if an input file is a binary file.
3766 * fileread.cc (Input_file::open): Record format of original file.
3767 * fileread.h (Input_file::Format): New enum type.
3768 (Input_file::Input_file): Initialize data member format_.
3769 (Input_file::format): New method definition.
3770 (Input_file::format_):: New data member.
3771
4a54abbb
DK
37722010-02-24 Doug Kwan <dougkwan@google.com>
3773
3774 * arm.cc (Arm_output_data_got): New class.
3775 (ARM_TCB_SIZE): New constant
3776 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3777 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3778 If user uses a script with a SECTIONS clause, issue only a warning
3779 for a misplaced EXIDX input section. Otherwise, issue an error.
3780 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3781 garbage collection.
3782 (Target_arm::got_mode_index_entry): Handle static linking.
3783 (Target_arm::Scan::local): Ditto.
3784 (Target_arm::Scan::global): Ditto.
3785 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3786 all incorrectly implemented relocations.
e1df38aa 3787 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3788 Arm_output_section::fix_exidx_coverage.
3789 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3790 from ".ARM.exidx." and ".ARM.extab.".
3791
ca419a6f
ILT
37922010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3793
3794 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3795 section if it does not already exist.
3796 * attributes.cc (Attributes_section_data::Attributes_section_data):
3797 Don't crash if size is zero.
3798
135b9c78
ILT
37992010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3800 Ian Lance Taylor <iant@google.com>
3801
3802 * gold.cc (queue_middle_tasks): If no input files were opened,
3803 exit.
3804 * workqueue.h (Task_function::Task_function): Assert that there is
3805 a blocker.
3806
bb0bfe4f
DK
38072010-02-22 Doug Kwan <dougkwan@google.com>
3808
3809 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3810 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3811 types to avoid warnings due to different uint64_t implementations
3812 on different hosts.
3813
2a2b6d42
DK
38142010-02-21 Doug Kwan <dougkwan@google.com>
3815
3816 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3817 handling of the maximum backward branch offset.
3818 (Arm_relocate_functions::thumb_branch_common): Ditto.
3819 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3820 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3821 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3822 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3823 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3824 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3825 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3826 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3827 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3828 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3829 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3830 thumb2_bl_out_of_range.o): New rules.
3831 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3832 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3833 thumb2_bl_out_of_range
3834 * testsuite/Makefile.in: Regenerate.
3835 * testsuite/arm_bl_in_range.s: New file.
3836 * testsuite/arm_bl_out_of_range.s: Ditto.
3837 * testsuite/arm_branch_in_range.sh: Ditto.
3838 * testsuite/arm_branch_range.t: Ditto.
3839 * testsuite/thumb2_branch_range.t: Ditto.
3840 * testsuite/thumb_bl_in_range.s: Ditto.
3841 * testsuite/thumb_bl_out_of_range.s: Ditto.
3842 * testsuite/thumb_branch_range.t: Ditto.
3843
b487ad64
ST
38442010-02-20 Sriraman Tallam <tmsriram@google.com>
3845
3846 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3847 Add reloc offset information.
3848 * icf.cc (get_section_contents): Change iterators to point to the new
3849 vectors. Add reloc offset information to the contents.
3850 * icf.h (Icf::Sections_reachable_info): New typedef.
3851 (Icf::Sections_reachable_list): New typedef.
3852 (Icf::Offset_info): New typedef.
3853 (Icf::Reloc_info): New struct typedef.
3854 (Icf::Reloc_info_list): New typedef.
3855 (Icf::symbol_reloc_list): Delete method.
3856 (Icf::addend_reloc_list): Delete method.
3857 (Icf::section_reloc_list): Delete method.
3858 (Icf::reloc_info_list): New method.
3859 (Icf::reloc_info_list_): New member.
3860
f96accdf
DK
38612010-02-19 Doug Kwan <dougkwan@google.com>
3862
3863 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3864 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3865 * arm.cc (Arm_relocation_functions): New forward declaration.
3866 (Target_arm::Target_arm): Initialize new data members
3867 got_mod_index_offset_ and tls_base_symbol_defined_.
3868 (Target_arm::Relocate::relocate_tls): New method.
3869 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3870 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3871 New methods.
3872 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3873 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3874 (Target_arm::got_mod_index_offset_,
3875 Target_arm::tls_base_symbol_defined_): New data members.
3876 (Target_arm::Scan::local, Target::Scan::global,
3877 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3878 relocations.
3879
c8761b9a
DK
38802010-02-18 Doug Kwan <dougkwan@google.com>
3881
3882 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3883 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3884 text section as a parameter becuase some broken tools may not set
3885 the link in section header.
3886 (Target_arm::has_got_section): New method.
3887 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3888 without any mapping symbol as data only. Remove warning.
3889 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3890 link in its section header, try to discover the link by inspecting the
3891 REL31 relocation at the beginning of the section.
3892 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3893 in error message.
3894 (Target_arm::Scan::global): Treat any reference to the symbol
3895 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3896
21bb3914
ST
38972010-02-12 Sriraman Tallam <tmsriram@google.com>
3898
3899 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3900 (Scan::global_reloc_may_be_function_pointer): New function.
3901 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3902 (Scan::global_reloc_may_be_function_pointer): New function.
3903 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3904 (Scan::global_reloc_may_be_function_pointer): New function.
3905 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3906 (Scan::global_reloc_may_be_function_pointer): New function.
3907 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3908 (Scan::global_reloc_may_be_function_pointer): New function.
3909 (Scan::possible_function_pointer_reloc): New function.
3910 (Target_x86_64::can_check_for_function_pointers): New function.
3911 * gc.h (gc_process_relocs): Scan relocation types to determine if
3912 function pointers were taken for targets that support it.
3913 * icf.cc (Icf::find_identical_sections): Include functions for
3914 folding in safe ICF whose pointer is not taken.
3915 * icf.h (Secn_fptr_taken_set): New typedef.
3916 (fptr_section_id_): New member.
3917 (section_has_function_pointers): New function.
3918 (set_section_has_function_pointers): New function.
3919 (check_section_for_function_pointers): New function.
3920 * options.h: Fix comment for safe ICF option.
3921 * target.h (can_check_for_function_pointers): New function.
3922 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3923 Modify icf_safe_test for X86-64.
3924 * testsuite/Makefile.in: Regenerate.
3925 * testsuite/icf_safe_so_test.cc: New file.
3926 * testsuite/icf_safe_so_test.sh: New file.
3927 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3928 (main): Change to take pointer to function kept_func_3.
3929 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3930 folding is done correctly for X86-64.
3931
0da6fa6c
DM
39322010-02-12 David S. Miller <davem@davemloft.net>
3933
3934 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3935 is_symbolless parameter.
3936 (Output_reloc<SHT_REL>::is_symbolless): New.
3937 (Output_reloc<SHT_REL>::is_symbolless_): New.
3938 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3939 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3940 (Output_reloc<SHT_RELA>::is_symbolless): New.
3941 (Output_data_reloc::add_global): Handle is_symbolless.
3942 (Output_data_reloc::add_global_relative): Likewise.
3943 (Output_data_reloc::add_local): Likewise.
3944 (Output_data_reloc::add_local_relative): Likewise.
3945 (Output_data_reloc::add_symbolless_global_addend): New.
3946 (Output_data_reloc::add_symbolless_local_addend): New.
3947 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3948 is_symbolless.
3949 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3950 instead of ->is_relative_
3951 (Output_reloc::write): Likewise.
3952 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3953 (Output_reloc::write_rel): Simplify.
3954
3955 * sparc.cc (Target_sparc::Scan::local): Use
3956 ->add_symbolless_local_addend as needed.
3957 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3958 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3959 based upon relocation offset.
3960
e4782e83
DK
39612010-02-11 Doug Kwan <dougkwan@google.com>
3962
3963 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3964 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3965 beginning of function.
3966 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3967 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3968 parameter is_32bit in calls to should_apply_static_reloc.
3969 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3970 (check_DATA): Add arm_abs_global.stdout.
3971 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3972 arm_abs_global.stdout): New rules.
3973 (MOSTLLYCLEANFILES): Add arm_abs_global
3974 * Makefile.in: Regenerate.
3975 * testsuite/arm_abs_global.s: New file.
3976 * testsuite/arm_abs_global.sh: Ditto.
3977 * testsuite/arm_abs_lib.s: Ditto.
3978
93ceb764
ILT
39792010-02-11 Ian Lance Taylor <iant@google.com>
3980
3981 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3982 Read_relocs task.
3983 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3984 Allocate_commons_task first.
3985 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3986 task, rather than symtab_lock_.
3987 (Gc_process_relocs::~Gc_process_relocs): New function.
3988 (Gc_process_relocs::is_runnable): Check this_blocker_.
3989 (Gc_process_relocs::locks): Use next_blocker_ rather than
3990 blocker_.
3991 (Scan_relocs::~Scan_relocs): New function.
3992 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3993 symtab_lock_.
3994 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3995 next_blocker_.
3996 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3997 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3998 constructor accordingly.
3999 (class Gc_process_relocs): Likewise.
4000 (class Scan_relocs): Likewise.
4001 * common.h (class Allocate_commons_task): Remove symtab_lock_
4002 field, and corresponding constructor parameter.
4003 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4004 symtab_lock_.
4005 (Allocate_commons_task::locks): Likewise.
4006
114dfbe1
ILT
40072010-02-11 Ian Lance Taylor <iant@google.com>
4008
4009 * gold-threads.h (class Once): Define.
4010 (class Initialize_lock): Rewrite as child of Once.
4011 * gold-threads.cc (class Once_initialize): Define.
4012 (once_pointer_control): New static variable.
4013 (once_pointer, once_arg): New static variables.
4014 (c_run_once): New static function.
4015 (Once::Once, Once::run_once, Once::internal_run): New functions.
4016 (class Initialize_lock_once): Remove.
4017 (initialize_lock_control): Remove.
4018 (initialize_lock_pointer): Remove.
4019 (initialize_lock_once): Remove.
4020 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4021 (Initialize_lock::initialize): Rewrite.
4022 (Initialize_lock::do_run_once): New function.
4023 * archive.cc (Archive::interpret_header): Only clear name if it is
4024 not already empty.
4025 * fileread.cc: Include "gold-threads.h"
4026 (file_counts_lock): New static variable.
4027 (file_counts_initialize_lock): Likewise.
4028 (File_read::release): Only increment counts when using --stats.
4029 Use a lock around the increment.
4030 * parameters.cc (class Set_parameters_target_once): Define.
4031 (set_parameters_target_once): New static variable.
4032 (Parameters::Parameters): Move here from parameters.h.
4033 (Parameters::set_target): Rewrite.
4034 (Parameters::set_target_once): New function.
4035 (Parameters::clear_target): Move here and rewrite.
4036 * parameters.h (class Parameters): Update declarations. Add
4037 set_parameters_target_once_ field.
4038 (Parameters::Parameters): Move to parameters.cc.
4039 (Parameters::clear_target): Likewise.
4040 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4041 task.
4042 (Start_group::~Start_group): New function.
4043 (Start_group::is_runnable): New function.
4044 (Start_group::locks, Start_group::run): New functions.
4045 (Finish_group::run): Change saw_undefined to size_t.
4046 * readsyms.h (class Start_group): Define.
4047 (class Finish_group): Change saw_undefined_ field to size_t.
4048 (Finish_group::Finish_group): Remove saw_undefined and
4049 this_blocker parameters. Change all callers.
4050 (Finish_group::set_saw_undefined): New function.
4051 (Finish_group::set_blocker): New function.
4052 * symtab.h (class Symbol_table): Change saw_undefined to return
4053 size_t. Change saw_undefined_ field to size_t.
4054 * target-select.cc (Set_target_once::do_run_once): New function.
4055 (Target_selector::Target_selector): Initialize set_target_once_
4056 field. Don't initialize lock_ and initialize_lock_ fields.
4057 (Target_selector::instantiate_target): Rewrite.
4058 (Target_selector::set_target): New function.
4059 * target-select.h (class Set_target_once): Define.
4060 (class Target_selector): Update declarations. Make
4061 Set_target_once a friend. Remove lock_ and initialize_lock_
4062 fields. Add set_target_once_ field.
4063
fa17a3f4
ILT
40642010-02-10 Ian Lance Taylor <iant@google.com>
4065
4066 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4067 queueing any tasks.
4068 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4069 (queue_middle_tasks): Add all blockers before queueing any tasks.
4070 (queue_final_tasks): Likewise.
4071 * token.h (Task_token::add_blockers): New function.
4072 * object.h (Input_objects::number_of_relobjs): New function.
4073
c7177d31
ILT
40742010-02-10 Ian Lance Taylor <iant@google.com>
4075
5de0e392
ILT
4076 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4077 shared, not if not position independent.
4078 * x86_64.cc (Relocate::relocate_tls): Likewise.
4079 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4080 (tls_pie_pic_test): New target.
4081 * testsuite/Makefile.in: Rebuild.
4082
c7177d31
ILT
4083 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4084 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4085 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4086 * testsuite/Makefile.in: Rebuild.
4087
684b268a
DM
40882010-02-09 David S. Miller <davem@davemloft.net>
4089
4090 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4091 R_SPARC_RELATIVE using ->add_local_relative().
4092 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4093
612a8d3d
DM
4094 * output.h (Output_data_dynamic::add_section_size): New method
4095 that takes two Output_data objects.
4096 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4097 entry param. Handle it in initializers.
4098 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4099 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4100 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4101 arg.
4102 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4103 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4104 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4105 for dynrel_includes_plt.
4106 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4107 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4108 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4109 before .rela.plt
4110 (Target_sparc::do_finalize_sections): Update to pass true for
4111 dynrel_includes_plt.
4112 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4113 output before .rela.plt
4114 (Target_powerpc::do_finalize_sections): Update to pass true for
4115 dynrel_includes_plt when 32-bit.
4116
cb1be87e
DK
41172010-02-08 Doug Kwan <dougkwan@google.com>
4118
4119 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4120 method.
4121 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4122 Arm_relobj::scan_section_for_cortex_a8_stubs,
4123 Arm_relobj::do_relocation_section): Instead of calling
4124 Output_section::output_address, use faster
4125 Arm_relobj::simple_input_section_output_address.
4126
705b5121
DM
41272010-02-08 David S. Miller <davem@davemloft.net>
4128
4129 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4130 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4131 relocation helper function.
4132
024c4466
DM
4133 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4134 just like R_SPARC_GOT{10,13,22}.
4135 (Target_sparc::Scan::local): Likewise.
4136 (Target_sparc::Relocate:relocate): Likewise.
4137
9109c078
ILT
41382010-02-06 Ian Lance Taylor <iant@google.com>
4139
4140 * configure.ac: Rewrite targetobjs duplicate removal code to use
4141 only shell constructs.
4142 * configure: Rebuild.
4143
cf846138
DK
41442010-02-05 Doug Kwan <dougkwan@google.com>
4145
4146 PR 11247
4147 * arm.cc (Arm_relobj::section_is_scannable): New method.
4148 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4149 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4150
6cfaf60b
DK
41512010-02-04 Doug Kwan <dougkwan@google.com>
4152
4153 PR 11247
4154 * arm-reloc-property.cc (cstdio): Include.
4155 * configure.ac (targetobjs): Remove duplicates.
4156 * configure: Regenerate.
4157 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4158 big and little endian version for a given address size.
4159
5c57f1be
DK
41602010-02-03 Doug Kwan <dougkwan@google.com>
4161
4162 * arm-reloc-property.cc
4163 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4164 definition.
4165 * arm-reloc-property.h
4166 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4167 New method definition.
4168 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4169 declaration.
4170 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4171 overflow to N.
4172 (GOT_PREL): Change implemented to Y.
4173 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4174 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4175 (Arm_relocate_functions::movw_abs_nc): Remove method.
4176 (Arm_relocate_functions::movt_abs): Ditto.
4177 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4178 (Arm_relocate_functions::thm_movt_abs): Ditto.
4179 (Arm_relocate_functions::movw_rel_nc): Ditto.
4180 (Arm_relocate_functions::movw_rel): Ditto.
4181 (Arm_relocate_functions::movt_rel): Ditto.
4182 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4183 (Arm_relocate_functions:thm_movw_rel): Ditto.
4184 (Arm_relocate_functions:thm_movt_rel): Ditto.
4185 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4186 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4187 New method definitions.
4188 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4189 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4190 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4191 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4192 (Target_arm::Relocate::relocate): Check for non-static or
4193 unimplemented relocation code and exit early. Change calls to
4194 Target_arm::reloc_uses_thumb_bit and
4195 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4196 instead. Refactor code to handle similar relocations to increase
4197 code sharing. Remove check for unsupported relocation code in switch
4198 statement.
4199 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4200 relocation property table to find out size. Change error message to
4201 print out the name of a relocation code instead of the numeric value.
4202 (Target_arm::scan_reloc_for_stub): Use relocation property table
4203 instead of calling Target_arm::reloc_uses_thumb_bit().
4204
218c5831
DK
42052010-02-02 Doug Kwan <dougkwan@google.com>
4206
4207 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4208 types of relaxed input section.
4209
0d31c79d
DK
42102010-02-02 Doug Kwan <dougkwan@google.com>
4211
4212 * Makefile.am (HFILES): Add arm-reloc-property.h.
4213 (DEFFILES): New.
4214 (TARGETSOURCES): Add arm-reloc-property.cc
4215 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4216 (libgold_a_SOURCES): $(DEFFILES)
4217 * Makefile.in: Regenerate.
4218 * arm-reloc-property.cc: New file.
4219 * arm-reloc-property.h: New file.
4220 * arm-reloc.def: New file.
4221 * arm.cc: Update comments.
4222 (arm-reloc-property.h): New included header.
4223 (arm_reloc_property_table): New global variable.
4224 (Target_arm::do_select_as_default_target): New method definition.
4225 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4226 arm-reloc-property to targ_extra_obj.
4227 * parameters.cc (set_parameters_target): Call
4228 Target::select_as_default_target().
4229 * target.h (Target::select_as_default_target): New method definition.
4230 (Target::do_select_as_default_target): Same.
4231
546c7457
DK
42322010-02-01 Doug Kwan <dougkwan@google.com>
4233
4234 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4235 first_output_text_section_.
4236 (Arm_exidx_fixup::first_output_text_section): New method definition.
4237 (Arm_exidx_fixup::first_output_text_section_): New data member.
4238 (Arm_exidx_fixup::process_exidx_section): Record the first text
4239 output section seen.
4240 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4241 and entsize in output section header.
4242
11b861d5
DK
42432010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4244
4245 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4246 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4247 (Arm_relocate_functions::thm_alu11): New Method.
4248 (Arm_relocate_functions::thm_pc8): New Method.
4249 (Arm_relocate_functions::thm_pc12): New Method.
4250 (Target_arm::Scan::local): Handle the relocations.
4251 (Target_arm::Scan::global): Likewise.
4252 (Target_arm::Relocate::relocate): Likewise.
4253 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4254
c9a2c125
DK
42552010-01-29 Doug Kwan <dougkwan@google.com>
4256
4257 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4258 of relocation types as ld.
4259
1521477a
DK
42602010-01-29 Doug Kwan <dougkwan@google.com>
4261
4262 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4263 to public.
4264 (Arm_relocate_functions::thumb_branch_common): Ditto.
4265 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4266 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4267 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4268 Arm_relocate_functions::jump24): Remove.
4269 (Target_arm::Relocate::relocate): Adjust code to call
4270 Arm_relocation_functions::arm_branch_common and
4271 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4272 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4273
e7eca48c
DK
42742010-01-29 Doug Kwan <dougkwan@google.com>
4275
4276 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4277 output_local_symbol_count_needs_update_.
4278 (Arm_relobj::output_local_symbol_count_needs_update,
4279 Arm_relobj::set_output_local_symbol_count_needs_update,
4280 Arm_relobj::update_output_local_symbol_count): New methods.
4281 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4282 member.
4283 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4284 of pointed function as in a R_ARM_PREL31 relocation.
4285 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4286 for output local symbol count updating.
4287 (Target_arm::do_relax): Update output local symbol counts in objects
4288 if necessary.
4289 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4290
02961d7e
ILT
42912010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4292
4293 * arm.cc: Added support for the ARM relocations:
4294 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4295 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4296 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4297 movw_prel_nc).
4298 (Arm_relocate_functions::movw_rel): New method.
4299 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4300 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4301 thm_movw_prel_nc).
4302 (Arm_relocate_functions::thm_movw_rel): New method.
4303 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4304 thm_movt_prel).
4305 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4306 relocations.
4307 (Target_arm::Scan::global): Likewise.
4308 (Target_arm::Relocate::relocate): Likewise.
4309 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4310 Likewise.
4311
b10d2873
ILT
43122010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4313
4314 * arm.cc: Added support for ARM group relocations.
4315 (Target_arm::reloc_needs_sym_origin): New method.
4316 (Arm_relocate_functions::calc_grp_kn): New method.
4317 (Arm_relocate_functions::calc_grp_residual): New method.
4318 (Arm_relocate_functions::calc_grp_gn): New method.
4319 (Arm_relocate_functions::arm_grp_alu): New Method.
4320 (Arm_relocate_functions::arm_grp_ldr): New Method.
4321 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4322 (Arm_relocate_functions::arm_grp_ldc): New Method.
4323 (Target_arm::Scan::local): Handle the ARM group relocations.
4324 (Target_arm::Scan::global): Likewise.
4325 (Target_arm::Relocate::relocate): Likewise.
4326 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4327 Likewise.
4328
2b328d4e
DK
43292010-01-26 Doug Kwan <dougkwan@google.com>
4330
4331 * arm.cc (set): Include.
4332 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4333 pointer type.
4334 (Arm_output_section::Text_section_list): New type.
4335 (Arm_output_section::append_text_sections_to_list): New method.
4336 (Arm_output_section::fix_exidx_coverage): Ditto.
4337 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4338 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4339 Relobj::set_section_offset() instead of
4340 Sized_relobj::invalidate_section_offset().
4341 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4342 parameter for section headers. Ignore relocation sections for
4343 unallocated sections and EXIDX sections.
4344 (Target_arm::fix_exidx_coverage): New method.
4345 (Target_arm::output_section_address_less_than): New type.
4346 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4347 linked text section instead of the EXIDX section.
4348 (Arm_output_section::create_stub_group): Add an assertion to check
4349 that this is not an EXIDX output section.
4350 (Arm_output_section::append_text_sections_to_list): New method.
4351 (Arm_output_section::fix_exidx_coverage): Ditto.
4352 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4353 Arm_relobj::section_needs_reloc_stub_scanning.
4354 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4355 first pass.
4356 (Target_arm::fix_exidx_coverage): New method.
4357 * object.h (Relobj::set_output_section): New method.
4358 (Sized_relobj::invalidate_section_offset): Remove method.
4359 (Sized_relobj::do_invalidate_section_offset): Remove method.
4360 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4361
c7f3c371
DK
43622010-01-25 Doug Kwan <dougkwan@google.com>
4363
4364 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4365 Fix warning due to signed and unsigned comparison on a 32-bit host.
4366
8923b24c
DK
43672010-01-22 Doug Kwan <dougkwan@google.com>
4368
4369 * arm.cc (Target_arm::do_relax): Record an output section for section
4370 offset adjustment it contains any stub table that has changed.
4371 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4372 offsets in an output section if necessary.
4373 * output.cc (Output_section::Output_section): Initialize
4374 section_offsets_need_adjustments_.
4375 (Output_section::add_input_section_for_script): Renamed to
4376 Output_section::add_simple_input_section.
4377 (Output_section::save_states): Add a comment.
4378 (Output_section::discard_states): New method defintion.
4379 (Output_section::adjust_section_offsets): Same.
4380 * output.h (Output_section::add_input_section_for_script): Renamed to
4381 Output_section::add_simple_input_section.
4382 (Output_section::discard_states): New method declaration.
4383 (Output_section::adjust_section_offsets): Same.
4384 (Output_section::section_offsets_need_adjustment,
4385 Output_section::set_section_offsets_need_adjustment): New method
4386 definitions.
4387 (Output_section::section_offsets_need_adjustment_): New data member.
4388 * script-sections.cc
4389 (Output_section_element_input::set_section_address): Adjust code for
4390 renaming of Output_section::add_input_section_for_script.
4391 (Orphan_output_section::set_section_address): Same.
4392
9b2fd367
DK
43932010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4394
4395 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4396 Fix_v4bx enum values .
4397 * gold/options.h (General_options): New option definitions.
4398 (General_options::fix_v4bx): New method.
4399 (General_options::Fix_v4bx): New enum.
4400 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4401 (General_options::parse_fix_v4bx_interworking): New method.
4402
80d0d023
DK
44032010-01-22 Doug Kwan <dougkwan@google.com>
4404
4405 * arm.cc (Arm_exidx_fixup): New class.
4406
af2cdeae
DK
44072010-01-21 Doug Kwan <dougkwan@google.com>
4408
4409 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4410 classes.
4411 (Arm_exidx_section_offset_map): New type.
4412
993d07c1
DK
44132010-01-21 Doug Kwan <dougkwan@google.com>
4414
4415 * arm.cc (Arm_exidx_input_section): New class.
4416 (Arm_relobj::exidx_input_section_by_link,
4417 Arm_relobj::exidx_input_section_by_shndx,
4418 Arm_relobj::make_exidx_input_section): New methods.
4419 (read_arm_attributes_section): Remove.
4420 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4421 information about them.
4422 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4423 to here.
4424
5ac169d4
DK
44252010-01-20 Doug Kwan <dougkwan@google.com>
4426
4427 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4428 Input_section_specifier to Section_id.
4429 (Target_arm::new_arm_input_section: Adjust code for change of key
4430 type.
4431 (Target_arm::find_arm_input_section): Ditto.
4432 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4433 (Section_id): Remove.
4434 (Garbage_collection::Section_id_hash): Remove.
4435 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4436 (Section_id): Remove.
4437 (Icf::Section_id_hash): Remove.
4438 * object.h (Section_id, Const_section_id, Section_id_hash,
4439 Const_section_id_hash): New type definitions.
4440 * output.cc (Output_section::add_relaxed_input_section): Change to
4441 use Const_section_id instead of Input_section_specifier as key type.
4442 (Output_section::add_merge_input_section): Ditto.
4443 (Output_section::build_relaxation_map): Change to use Section_id
4444 instead of Input_section_specifier as key type.
4445 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4446 Ditto.
4447 (Output_section::convert_input_sections_to_relaxed_sections): Change
4448 to use Const_section_id instead of Input_section_specifier as key type.
4449 (Output_section::find_merge_section): Ditto.
4450 (Output_section::find_relaxed_input_section): Ditto.
4451 * output.h (Input_section_specifier): Remove class.
4452 (Output_section::Output_section_data_by_input_section_map): Change
4453 key type to Const_section_id.
4454 (Output_section::Output_relaxed_input_section_by_input_section_map):
4455 Ditto.
4456 (Output_section::Relaxation_map): Change key type to Section_id.
4457
a2162063
ILT
44582010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4459
4460 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4461 (class Arm_v4bx_stub): New class.
4462 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4463 (Stub_factory::make_arm_v4bx_stub): New method.
4464 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4465 (Stub_table::empty): Handle v4bx stubs.
4466 (Stub_table::add_arm_v4bx_stub): New method.
4467 (Stub_table::find_arm_v4bx_stub): New method.
4468 (Arm_relocate_functions::v4bx): New method.
4469 (Target_arm::fix_v4bx): New method.
4470 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4471 (Stub_table::relocate_stubs): Likewise.
4472 (Stub_table::do_write): Likewise.
4473 (Stub_table::update_data_size_and_addralign): Likewise.
4474 (Stub_table::finalize_stubs): Likewise.
4475 (Target_arm::Scan::local): Likewise.
4476 (Target_arm::Scan::global): Likewise.
4477 (Target_arm::do_finalize_sections): Likewise.
4478 (Target_arm::Relocate::relocate): Likewise.
4479 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4480 Likewise.
4481 (Target_arm::scan_reloc_for_stub): Likewise.
4482 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4483
5696ab0b
ILT
44842010-01-19 Ian Lance Taylor <iant@google.com>
4485
4486 * output.cc (Output_section_headers::do_sized_write): Write large
4487 segment count to sh_info field.
4488 (Output_file_header::do_sized_write): For large segment count,
4489 write PN_XNUM to e_phnum field.
4490
800d0f56
ILT
44912010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4492
4493 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4494 (Arm_relocate_functions::thm_jump8): New function.
4495 (Arm_relocate_functions::thm_jump11): New function.
4496 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4497 R_ARM_THM_JUMP11.
4498 (Target_arm::Scan::global): Likewise.
4499 (Target_arm::Relocate::relocate): Likewise.
4500 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4501 Likewise.
4502
41263c05
DK
45032010-01-14 Doug Kwan <dougkwan@google.com>
4504
4505 * arm.cc (map, utility): Include headers.
4506 (Target_arm::apply_cortex_a8_workaround): New method.
4507 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4508 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4509 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4510 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4511 the --[no-]fix-cortex-a8 command line options.
4512 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4513 (Target_arm::relocate_stub): Use addend in instruction template.
4514 * options.h (DEFINE_bool): Set the user-set flag.
4515 (General_options): Add --[no-]-fix-cortex options.
4516 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4517 : Update fast look-up map after conversion.
41263c05 4518
459e9b03
ST
45192010-01-14 Sriraman Tallam <tmsriram@google.com>
4520
4521 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4522 in the first pass of do_layout.
4523
b521dfe4
DK
45242010-01-13 Doug Kwan <dougkwan@google.com>
4525
4526 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4527 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4528 apparent compiler problem of not folding static constant integral
4529 data members of elfcpp::Elf_sizes<32>.
4530
44272192
DK
45312010-01-13 Doug Kwan <dougkwan@google.com>
4532
4533 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4534 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4535 Arm_relobj::scan_section_for_cortex_a8_erratum,
4536 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4537 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4538 sections to scan for relocation stubs into a new method
4539 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4540 relocation and Cortex-A8 stub scanning.
4541 (Target_arm::do_relax): Force stubs to be after stubbed sections
4542 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4543 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4544 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4545
44b71ece
ILT
45462010-01-12 Ian Lance Taylor <iant@google.com>
4547
4548 * target-reloc.h (visibility_error): New inline function.
4549 (relocate_section): Call visibility_error.
4550 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4551 (MOSTLYCLEANFILES): Likewise.
4552 (protected_4_pic.o, protected_3.err): New targets.
4553 * testsuite/protected_4.cc: New file.
4554
a120bc7f
DK
45552010-01-12 Doug Kwan <dougkwan@google.com>
4556
4557 * arm.cc (Cortex_a8_reloc): New class.
4558 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4559 and cortex_a8_relocs_info_.
4560 (Target_arm::fix_cortex_a8): New method definition.
4561 (Target_arm::Cortex_a8_relocs_info): New type.
4562 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4563 New data member declarations.
4564 (Target_arm::scan_reloc_for_stub): Record information about
4565 relocations for THUMB branches that might be exempted from the
4566 Cortex-A8 workaround.
4567 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4568 at the beginning of a relaxation pass.
4569
20138696
DK
45702010-01-12 Doug Kwan <dougkwan@google.com>
4571
4572 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4573 (Arm_relobj::Mapping_symbol_position,
4574 Arm_reloj::Mapping_symbol_position_less,
4575 Arm_relobj::Mapping_symbols_info): New types.
4576 (Target_arm::is_mapping_symbol_name): New method definition.
4577 (Arm_relobj::do_count_local_symbols): Save information about mapping
4578 symbols.
4579
089d69dc
DK
45802010-01-11 Doug Kwan <dougkwan@google.com>
4581
4582 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4583 Arm_relocate_functions::thumb32_branch_upper,
4584 Arm_relocate_functions::thumb32_branch_lower,
4585 Arm_relocate_functions::thumb32_cond_branch_offset,
4586 Arm_relocate_functions::thumb32_cond_branch_upper,
4587 Arm_relocate_functions::thumb32_cond_branch_lower,
4588 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4589 branch offset encoding.
4590 (Arm_relocate_functions::thumb_branch_common): Use new branch
4591 offset encoding methods to avoid code duplication.
4592 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4593 (Stub_addend_reader::operator()): Use new branch encoding method
4594 to avoid code duplication.
4595
99e5bff2
DK
45962010-01-11 Doug Kwan <dougkwan@google.com>
4597
4598 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4599 (Target_arm::do_finalize_sections): Define special EXIDX section
4600 symbols only if referenced.
4601 * gc.h (Garbage_collection::add_reference): New method.
4602 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4603 code duplication.
4604
98e090bd
ILT
46052010-01-11 Ian Lance Taylor <iant@google.com>
4606
d0a91bd8
ILT
4607 * script.cc (Version_script_info::build_expression_list_lookup):
4608 Change complaing about duplicate wildcard match from error to
4609 warning.
4610
98e090bd
ILT
4611 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4612 of 2009-12-30.
4613 (Version_script_info::Version_script_info): Initialize globs_,
4614 default_version_, default_is_global_, and exact_. Don't
4615 initialize globals_ or locals_.
4616 (Version_script_info::build_lookup_tables): Build local symbols
4617 first.
4618 (Version_script_info::unquote): New function.
4619 (Version_script_info::add_exact_match): New function.
4620 (Version_script_info::build_expression_list_lookup): Remove lookup
4621 parameter. Add is_global parameter. Change all callers. Handle
4622 wildcard pattern specially. Unquote pattern. Call
4623 add_exact_match.
4624 (Version_script_info::get_name_to_match): New function.
4625 (Version_script_info::get_symbol_version): New function.
4626 (Version_script_info::get_symbol_version_helper): Remove.
4627 (Version_script_info::check_unmatched_names): Call unquote.
4628 * script.h (class Version_script_info): Change get_symbol_version
4629 to be non-inline and add is_global parameter; change all callers.
4630 Rewrite symbol_is_local. Update declarations. Define struct
4631 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4632 Remove globals_ and locals_ members. Add exact_, globs_,
4633 default_version_, is_global_.
4634 (Version_script_info::Glob): Remove pattern, add expression and
4635 is_global. Update constructor. Change all callers.
4636 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4637 default version.
4638 (Versions::symbol_section_contents): If a symbol is undefined, or
4639 defined in a dynamic object, set the version index to
4640 VER_NDX_LOCAL.
4641 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4642 symbol_is_local.
4643 (Symbol_table::add_from_pluginobj): Likewise.
4644 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4645
d56962d3
DK
46462010-01-11 Doug Kwan <dougkwan@google.com>
4647
4648 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4649 (incremental_dump_LDADD): Add linking option for libintl.
4650 * Makefile.in: Regenerate.
4651
94e6ee91
L
46522010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4653
4654 PR gold/11144
4655 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4656 instead of -Ds.
4657 * testsuite/Makefile.in: Regenerated.
4658
e96c574b
DK
46592010-01-10 Doug Kwan <dougkwan@google.com>
4660
4661 * options.h (DEFINE_var): Use parentheses around argument varname__
4662 in macro body to avoid any unintended subsequent substitutions.
4663
7198066b
ILT
46642010-01-10 Ian Lance Taylor <iant@google.com>
4665
ba4d53bf
ILT
4666 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4667 candidates before doing symbol resolution.
4668
7198066b
ILT
4669 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4670 ODR candidates if only one is weak.
4671
a2beed37
ILT
46722010-01-08 Ian Lance Taylor <iant@google.com>
4673
4674 * script.cc (Version_script_info::build_expression_list_lookup):
4675 Don't warn about ambiguous version, just record the ambiguity.
4676 (Version_script_info::get_symbol_version_helper): Give error if
4677 version is ambiguous.
4678
2fb7225c
DK
46792010-01-08 Doug Kwan <dougkwan@google.com>
4680
4681 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4682 prev_data_size_ and prev_addralign_. Remove initializer for
4683 deleted data member has_been_changed_.
4684 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4685 to determine if the table is empty.
4686 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4687 Remove.
4688 (Stub_table::add_reloc_stub): Define method in class definition
4689 instead of just declaring it there.
4690 (Stub_table::add_cortex_a8_stub): New method definition.
4691 (Stub_table::update_data_size_and_addralign): Ditto.
4692 (Stub_table::finalize_stubs): Ditto.
4693 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4694 (Stub_table::do_addralign_): Return address alignment in the
4695 (Stub_table::do_reset_address_and_file_offset): Define method in
4696 class definition instead of declaring it there. Set current data
4697 size to be the data size of the previous pass.
4698 (Stub_table::set_final_data_size): Use current data size as the
4699 final data size.
4700 (Stub_table::relocate_stub): Change parameter type of stub from
4701 Reloc_stub pointer to Stub pointer.
4702 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4703 (Stub_table::Cortex_a8_stub_list): New typedef.
4704 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4705 Stub_table::prev_addralign_): New data member.
4706 (Arm_relobj::Arm_relobj): Initialize data member
4707 section_has_cortex_a8_workaround_.
4708 (Arm_relobj::section_has_cortex_a8_workaround,
4709 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4710 definitions.
4711 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4712 declarations.
4713 (Target_arm::relocate_stub): Change parameter type of stub from
4714 Reloc_stub pointer to Stub pointer.
4715 (Insn_template::size, Insn_template::alignment): Handle
4716 THUMB16_SPECIAL_TYPE.
4717 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4718 Stub_table::update_data_size_and_addralign,
4719 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4720 definitions.
4721 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4722 (Stub_table::do_write): Ditto.
4723 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4724
880cd20d
ILT
47252010-01-08 Ian Lance Taylor <iant@google.com>
4726
4727 PR 11108
4728 * symtab.h (class Symbol): Remove fields is_target_special_ and
4729 has_plt_offset_. Add field is_defined_in_discarded_section_.
4730 (Symbol::is_defined_in_discarded_section): New function.
4731 (Symbol::set_is_defined_in_discarded_section): New function.
4732 (Symbol::has_plt_offset): Rewrite.
4733 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4734 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4735 Don't initialize is_target_special_ or has_plt_offset_.
4736 Initialize is_defined_in_discarded_section_.
4737 (Symbol_table::add_from_relobj): If appropriate, set
4738 is_defined_in_discarded_section.
4739 * resolve.cc (Symbol::override_base_with_special): Don't test
4740 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4741 * target-reloc.h (relocate_section): Do special handling for
4742 symbols defined in discarded sections for global symbols as well
4743 as local symbols.
4744
2703e3eb
ILT
47452010-01-08 Ian Lance Taylor <iant@google.com>
4746
4747 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4748 the SHT_SYMTAB case.
4749
339d40a3
ILT
47502010-01-08 Ian Lance Taylor <iant@google.com>
4751
4752 * object.cc (Sized_relobj::do_layout): Don't get confused if
4753 layout_eh_frame returns NULL.
4754
abecea76
ILT
47552010-01-08 Ian Lance Taylor <iant@google.com>
4756
4757 PR 11084
4758 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4759 dynamic symbol table, use the normal symbol table.
4760 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4761 symbol table.
4762
6b7dd3f3
ILT
47632010-01-08 Ian Lance Taylor <iant@google.com>
4764
4765 PR 11072
4766 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4767 sections.
4768
36c50e63
L
47692010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4770
4771 * version.cc (print_version): Change to "Copyright 2010".
4772
e291e7b9
ILT
47732010-01-08 Ian Lance Taylor <iant@google.com>
4774
4775 PR 10287
4776 PR 11063
4777 * i386.cc (class Target_i386): Change return type of plt_section
4778 to be non-const.
4779 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4780 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4781 tls_desc_rel_ field.
4782 (Output_data_plt_i386::rel_tls_desc): New function.
4783 (Target_i386::rel_tls_desc_section): New function.
4784 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4785 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4786 R_386_TLS_DESC reloc in rel_tls_desc_section.
4787 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4788 Define struct Tlsdesc_info.
4789 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4790 (Target_x86_64::do_reloc_symbol_index): New function.
4791 (Target_x86_64::add_tlsdesc_info): New function.
4792 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4793 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4794 tlsdesc_rel_ field.
4795 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4796 all callers.
4797 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4798 (Target_x86_64::rela_tlsdesc_section): New function.
4799 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4800 handling.
4801 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4802 (Target_x86_64::do_reloc_addend): New function.
4803 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4804 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4805 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4806 (Output_reloc::type): New function.
4807 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4808 (Output_reloc::is_target_specific): New function.
4809 (Output_reloc::target_arg): New function.
4810 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4811 absolute relocs and target specific relocs.
4812 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4813 add_target_specific.
4814 (class Output_data_reloc) [SHT_RELA]: Likewise.
4815 * output.cc (Output_reloc::Output_reloc): Add four new versions
4816 for absolute relocs and target specific relocs.
4817 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4818 (Output_reloc::get_symbol_index): Likewise.
4819 (Output_reloc::local_section_offset): Check that local_sym_index_
4820 is not TARGET_CODE or 0.
4821 (Output_reloc::symbol_value): Likewise.
4822 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4823 reloc.
4824 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4825 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4826 functions.
4827 * layout.cc (add_target_dynamic_tags): Use output section for
4828 DT_PLTRELSZ and DT_JMPREL.
4829
3a44184e
ILT
48302010-01-07 Ian Lance Taylor <iant@google.com>
4831
4832 PR 11061
4833 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4834 function.
4835 (class Output_data_reloc_generic): Define.
4836 (class Output_data_reloc_base): Change base class to
4837 Output_data_reloc_generic. Change add() method to call
4838 bump_relative_reloc_count for a relative reloc. Remove
4839 sort_relocs_ field.
4840 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4841 to sort_relocs().
4842 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4843 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4844 appropriate.
4845 * layout.h (class Layout): Update declaration.
4846
ea715a34
ILT
48472010-01-07 Ian Lance Taylor <iant@google.com>
4848
4849 * output.h (class Output_data): Add const version of
4850 output_section and do_output_section.
4851 (class Output_section_data): Add const version of
4852 do_output_section.
4853 (class Output_section): Likewise.
4854 * layout.cc (Layout::add_target_dynamic_tags): New function.
4855 * layout.h (class Layout): Update declarations.
4856 * arm.cc (Target_arm::do_finalize_sections): Use
4857 add_target_dynamic_tags.
4858 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4859 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4860 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4861 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4862
659948a4
ILT
48632010-01-07 Ian Lance Taylor <iant@google.com>
4864
4865 PR 11042
4866 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4867 object as needed.
4868
9d3b86f6
ILT
48692010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4870 Ian Lance Taylor <iant@google.com>
4871
4872 PR 11019
4873 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4874 Xindex::read_symtab_xindex.
4875
bb0d3eb0
DK
48762010-01-07 Doug Kwan <dougkwan@google.com>
4877
4878 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4879 (Insn_template::thumb16_bcond_insn): New method declaration.
4880 (Insn_template): Fix spelling.
4881 (Stub::thumb16_special): New method declaration.
4882 (Stub::do_write): Define virtual method which was previously pure
4883 virtual.
4884 (Stub::do_thumb16_special): New method declaration.
4885 (Stub::do_fixed_endian_write): New template member.
4886 (Reloc_stub::do_write): Remove.
4887 (Reloc_stub::do_fixed_endian_write): Remove.
4888 (Cortex_a8_stub): New class definition.
4889 (Stub_factory::make_cortex_a8_stub): New method definition.
4890 (Stub_factory::Stub_factory): Add missing static storage class
4891 qualifier for elf32_arm_stub_a8_veneer_blx.
4892
ffeef7df
ILT
48932010-01-07 Ian Lance Taylor <iant@google.com>
4894
dc3f80fe
ILT
4895 PR 10980
4896 * options.h (class General_options): Add --warn-unresolved-symbols
4897 and --error-unresolved-symbols.
4898 * errors.cc (Errors::undefined_symbol): Implement
4899 --warn-unresolved-symbols.
4900
ffeef7df
ILT
4901 * options.h (class General_options): Add -z text and -z textoff.
4902 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4903
f1ec9ded
ST
49042010-01-06 Sriraman Tallam <tmsriram@google.com>
4905
4906 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4907 (Garbage_collection::cident_sections): New function.
4908 (Garbage_collection::add_cident_section): New function.
4909 (Garbage_collection::cident_sections_): New member.
4910 (gc_process_relocs): Add references to sections whose names are C
4911 identifiers.
4912 * gold.h (cident_section_start_prefix): New constant.
4913 (cident_section_stop_prefix): New constant.
4914 (is_cident): New function.
4915 * layout.cc (Layout::define_section_symbols): Replace string constants
4916 with the newly defined constants.
4917 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4918 C identifiers.
4919 * testsuite/Makefile.am: Add gc_orphan_section_test.
4920 * testsuite/Makefile.in: Regenerate.
4921 * testsuite/gc_orphan_section_test.cc: New file.
4922 * testsuite/gc_orphan_section_test.sh: New file.
4923
6eda8c29
ILT
49242010-01-06 Ian Lance Taylor <iant@google.com>
4925
b9674e17
ILT
4926 PR 10980
4927 * options.h (class General_options): Add --warn-shared-textrel.
4928 * layout.cc (Layout::finish_dynamic_section): Implement
4929 --warn-shared-textrel.
4930
6eda8c29
ILT
4931 PR 10980
4932 * options.h (class General_options): Add --warn-multiple-gp.
4933
32dcd44e
ILT
49342010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4935
4936 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4937 $(THREADSLIB) and $(LIBDL).
4938 * Makefile.in: Rebuild.
4939
a192ba05
ILT
49402010-01-06 Ian Lance Taylor <iant@google.com>
4941
4942 PR 10980
4943 * options.cc (General_options::parse_section_start): New function.
4944 (General_options::section_start): New function.
4945 (General_options::General_options): Initialize all members.
4946 * options.h: Include <map>
4947 (class General_options): Add --section-start. Add section_starts_
4948 member.
4949 * layout.cc (Layout::attach_allocated_section_to_segment): If
4950 --section-start was used, set the address of the segment. Remove
4951 local sort_sections.
4952 (Layout::relaxation_loop_body): If the address of the load segment
4953 has been set by --section-start, don't use it.
4954 * output.h (Output_segment::update_flags_for_output_section): New
4955 function.
4956 * output.cc (Output_segment::add_output_section): Call
4957 update_flags_for_output_section.
4958
dde3f402
ILT
49592010-01-05 Ian Lance Taylor <iant@google.com>
4960
62dfdd4d
ILT
4961 PR 10980
4962 * options.h (class General_options): Add --undefined-version.
4963 * script.cc (struct Version_expression): Add was_matched_by_symbol
4964 field.
4965 (Version_script_info::matched_symbol): New function.
4966 (Version_script_info::get_symbol_version_helper): Call
4967 matched_symbol.
4968 (Version_script_info::check_unmatched_names): New function.
4969 * script.h (class Version_script_info): Update declarations.
4970 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4971
9c4ae156
ILT
4972 * options.h (class General_options): Use DEFINE_bool_alias for
4973 allow_multiple_definition.
4974 * resolve.cc (Symbol_table::should_override): Don't test
4975 allow_multiple_definition.
4976
dde3f402
ILT
4977 PR 10980
4978 * options.h (class General_options): Add --cref.
4979 * main.cc (main): Print cref table if --cref. Don't close mapfile
4980 until after printing cref table.
4981 * cref.cc: Include "symtab.h".
4982 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4983 (Cref_table_compare::operator()): New function.
4984 (Cref_inputs::gather_cref): New function.
4985 (filecol): New static const.
4986 (Cref_inputs::print_cref): New function.
4987 (Cref::print_cref): New function.
4988 * cref.h: Include <cstdio>.
4989 (class Cref): Update declarations.
4990 * mapfile.h (Mapfile::file): New function.
4991 * object.h (class Object): Define Symbols. Declare virtual
4992 do_get_global_symbols.
4993 (Object::get_global_symbols): New function.
4994 * object.cc (Input_objects::add_object): Pass object to cref_ if
4995 --cref.
4996 (Input_objects::archive_start): Likewise.
4997 (Input_objects::archive_stop): Likewise.
4998 (Input_objects::print_cref): New function.
4999 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5000 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5001 --cref.
5002 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5003 function.
5004 * plugin.h (class Sized_pluginobj): Update declarations.
5005
8781f709
ILT
50062010-01-05 Ian Lance Taylor <iant@google.com>
5007
5008 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5009 to is_default_version. Rename insdef to insdefault.
5010 (Symbol_table::add_from_relobj): Rename def to is_default_version
5011 and local to is_forced_local.
5012 (Symbol_table::add_from_pluginobj): Likewise.
5013 (Symbol_table::add_from_dynobj): Likewise.
5014 (Symbol_table::define_special_symbol): Rename insdef to
5015 insdefault.
5016
fe35d28d
ILT
50172010-01-04 Ian Lance Taylor <iant@google.com>
5018
30bc8c46
ILT
5019 PR 10980
5020 * options.h (class General_options): Add
5021 --allow-multiple-definition and -z muldefs.
5022 * resolve.cc (Symbol_table::should_override): Don't warn about a
5023 multiple symbol definition if --allow-multiple-definition or -z
5024 muldefs.
5025
7eaea549
ILT
5026 PR 10980
5027 * options.h (class General_options): Add --add-needed and
5028 --copy-dt-needed-entries. Tweak --as-needed help entry.
5029 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5030 error if --copy-dt-needed-entries aka --add-needed is used and
5031 would cause a change in behaviour.
5032
fe35d28d
ILT
5033 PR 10980
5034 * options.h (class General_options): Add -G as a short version of
5035 --shared. Add no-op options -assert, -g, and -i.
5036
55a2bb35
ST
50372010-01-04 Sriraman Tallam <tmsriram@google.com>
5038
5039 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5040 check for .text or .gnu.linkonce.t sections.
5041 * icf.cc (Icf::find_identical_sections): Ditto.
5042 Change the detection for mangled function name within the section
5043 name.
5044 * icf.h (is_section_foldable_candidate): New function.
5045
719328e1
ILT
50462009-12-30 Ian Lance Taylor <iant@google.com>
5047
5048 PR 10980
5049 * options.h (class General_options): Permit two dashes with
5050 --retain-symbols-file.
5051
d7bb5745
ILT
50522009-12-30 Ian Lance Taylor <iant@google.com>
5053
403a15dd
ILT
5054 PR 10979
5055 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5056 don't put the file header and segment headers in the text
5057 segment.
5058
eda294df
ILT
5059 PR 10979
5060 * common.cc (Sort_commons::operator()): Stabilize sort when both
5061 entries are NULL.
5062 (Symbol_table::do_allocate_commons_list): When allocating common
5063 symbols, skip a symbol which is no longer common.
5064 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5065 an object before checking its type.
5066 * testsuite/common_test_2.c: New file.
5067 * testsuite/common_test_3.c: New file.
5068 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5069 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5070 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5071 (common_test_2_pic.o, common_test_2.so): New targets.
5072 (common_test_3_pic.o, common_test_3.so): New targets.
5073 * testsuite/Makefile.in: Rebuild.
5074
d7bb5745
ILT
5075 PR 10979
5076 * script.cc (read_input_script): If we see a new SECTIONS clause,
5077 and we have added an input section, give an error.
5078 * layout.h (class Layout): Add have_added_input_section function.
5079 Add have_added_input_section_ field.
5080 * layout.cc (Layout::Layout): Initialize
5081 have_added_input_section_.
5082 (Layout::layout): Set have_added_input_section_.
5083 (Layout::layout_eh_frame): Likewise.
5084
fc59c572
ILT
50852009-12-30 Ian Lance Taylor <iant@google.com>
5086
5087 PR 10931
5088 * options.h (class General_options): Add --sort-common option.
5089 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5090 * common.cc (Sort_common): Add sort_order parameter to
5091 constructor. Add sort_order_ field.
5092 (Sort_commons::operator): Check sort_order_.
5093 (Symbol_table::allocate_commons): Determine the sort order.
5094 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5095 Change all callers.
5096 (Symbol_table::do_allocate_commons_list): Likewise.
5097
1c74fab0
ILT
50982009-12-30 Ian Lance Taylor <iant@google.com>
5099
5100 PR 10916
5101 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5102 symbols from this object, don't change the visibility of an
5103 undefined symbol.
5104 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5105
6affe781
ILT
51062009-12-30 Ian Lance Taylor <iant@google.com>
5107
5108 PR 10861
5109 * script.h (class Version_script_info): Define Language enum.
5110 Update declarations. Define Glob, Exact, and Lookup types. Add
5111 new fields globals_, locals_, and is_finalized_.
5112 * script.cc: Various formatting fixes.
5113 (class Parser_closure): Change language_stack_ from a vector of
5114 std::string to one of Version_script_info::Language. Adjust all
5115 uses accordingly.
5116 (class Lazy_demangler): Remove.
5117 (struct Version_expression): Change language from std::string to
5118 Version_script_info::Language.
5119 (Version_script_info::Version_script_info): New function.
5120 (Version_script_info::~Version_script_info): Don't call clear.
5121 (Version_script_info::finalize): New function.
5122 (Version_script_info::build_lookup_tables): New function.
5123 (Version_script_info::build_expression_list_lookup): New
5124 function.
5125 (Version_script_info::get_symbol_version_helper): Rewrite to use
5126 lookup tables.
5127 (Version_script_info::print_expression_list): Adjust to use
5128 Version_script_info::Language.
5129 (script_push_lex_into_version_mode): Check that the version script
5130 has not been finalized.
5131 (version_script_push_lang): Change language string to
5132 Version_script_info::Language.
5133 * options.cc (Command_line::version_script): New function.
5134 * options.h (class General_options): Add finalize_dynamic_list
5135 function. Change version_script from declaration to definition.
5136 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5137 * testsuite/version_script.map: Remove duplicate def of foo.
5138 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5139 version_script.map.
5140 * testsuite/Makefile.in: Rebuild.
5141
818bf354
ILT
51422009-12-30 Ian Lance Taylor <iant@google.com>
5143
5144 PR 10843
5145 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5146 if the input symbol index is 0, make the output symbol index 0.
5147
ebcc8304
ILT
51482009-12-30 Ian Lance Taylor <iant@google.com>
5149
5150 PR 10670
5151 * options.h (class General_options): Add -x/--discard-all.
5152 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5153 --discard-all. If the local symbol needs a dynamic entry, check
5154 that before handling --discard-locals.
5155
176fe33f
ILT
51562009-12-30 Ian Lance Taylor <iant@google.com>
5157
bb321bb1
ILT
5158 PR 10450
5159 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5160 flags to PF_R.
5161 (Output_segment::add_output_section): Don't change the flags if
5162 the type is PT_TLS.
5163
176fe33f
ILT
5164 PR 10450
5165 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5166 GNU hash table if they need a dynamic value. Otherwise, don't add
5167 them if they are defined in a dynamic object or are forced local.
5168
e8cd95c7
ILT
51692009-12-29 Ian Lance Taylor <iant@google.com>
5170
1b81fb71
ILT
5171 PR 10450
5172 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5173 .gnu.hash table for a 32-bit target.
5174
8d6d383d
ILT
5175 PR 10450
5176 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5177 regular and a dynamic object only needs a dynamic symbol table
5178 entry if it is externally visible.
5179
e785ec03
ILT
5180 PR 10450
5181 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5182 constructor. Add global_offset_table_ field.
5183 (Target_i386::got_section): Set global_offset_table_.
5184 (Target_i386::do_finalize_sections): Set global_offset_table_
5185 size.
5186 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5187 in constructor. Add global_offset_table_ field.
5188 (Target_x86_64::got_section): Set global_offset_table_.
5189 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5190 size.
5191
1a2dff53
ILT
5192 * layout.cc (Layout::Layout): Initialize increase_relro_.
5193 (Layout::get_output_section): Add is_relro, is_last_relro, and
5194 is_first_non_relro parameters. Change all callers.
5195 (Layout::choose_output_section): Likewise.
5196 (Layout::add_output_section_data): Likewise.
5197 (Layout::make_output_section): Likewise.
5198 (Layout::set_segment_offsets): Clear increase_relro when using a
5199 linker script.
5200 * layout.h (class Layout): Add increase_relro method. Add
5201 increase_relro_ field. Update declarations.
5202 * output.cc (Output_section::Output_section): Initialize
5203 is_last_relro_ and is_first_non_relro_.
5204 (Output_segment::add_output_section): Group relro sections is
5205 do_sort is true. Handle is_last_relro and is_first_non_relro.
5206 (Output_segment::maximum_alignment): Remove relro handling.
5207 (Output_segment::set_section_addresses): Add increase_relro
5208 parameter. Change all callers. Add initial alignment to align
5209 relro sections on separate page. Remove old relro handling.
5210 (Output_segment::set_section_list_addresses): Remove in_relro
5211 parameter. Change all callers.
5212 (Output_segment::set_offset): Add increase parameter. Change all
5213 callers. Remove old relro handling.
5214 * output.h (class Output_section): Add new methods: is_last_relro,
5215 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5216 Add is_last_relro_ and is_first_non_relro_ fields.
5217 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5218 Create separate .got.plt section. Call increase_relro.
5219 * x86_64.cc (Target_x86_64::got_section): Likewise.
5220 * testsuite/relro_script_test.t: Add .got.plt.
5221
f0ba79e2
ILT
5222 PR 10450
5223 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5224 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5225 (Layout::finalize): Call set_dynamic_symbol_size.
5226 (Layout::set_dynamic_symbol_size): New function.
5227 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5228 set_dynamic_symbol_size.
5229
e8cd95c7
ILT
5230 PR 10450
5231 * output.h (class Output_section): Add is_entsize_zero_ field.
5232 * output.cc (Output_section::Output_section): Initialize
5233 is_entsize_zero_.
5234 (Output_section::set_entsize): If two different entsizes are
5235 requested, force it to zero.
5236 (Output_section::add_input_section): Set flags for .debug_str
5237 before updating section flags. Set entsize.
5238 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5239 and SHF_STRING if all input sections have those flags.
5240
3e1b9a8a
RÁE
52412009-12-29 Rafael Espindola <espindola@google.com>
5242
5243 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5244 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5245 reporting.
3e1b9a8a 5246
3dcad376
ST
52472009-12-29 Sriraman Tallam <tmsriram@google.com>
5248
5249 * options.cc (General_options::parse_version): Allow -v to exit
5250 without an error if there is nothing to link.
5251
084e2665
ILT
52522009-12-29 Ian Lance Taylor <iant@google.com>
5253
5254 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5255 using a version of gcc before 4.1.
5256 * configure: Rebuild.
5257
250acde3
CD
52582009-12-28 Chris Demetriou <cgd@google.com>
5259
5260 * attributes.cc (Output_attributes_section_data::do_write): Use
5261 std::vector::front rather than std::vector::data.
5262
99fff23b
ILT
52632009-12-28 Ian Lance Taylor <iant@google.com>
5264
5265 * symtab.h (class Symbol_table): Add enum Defined.
5266 * resolve.cc (Symbol_table::should_override): Add defined
5267 parameter. Change all callers. Test whether object is NULL
5268 before calling a method on it.
5269 (Symbol_table::report_resolve_problem): Add defined parameter.
5270 Change all callers.
5271 (Symbol_table::should_override_with_special): Likewise.
5272 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5273 parameter. Change all callers.
5274 (Symbol_table::do_define_in_output_data): Likewise.
5275 (Symbol_table::define_in_output_segment): Likewise.
5276 (Symbol_table::do_define_in_output_segment): Likewise.
5277 (Symbol_table::define_as_constant): Likewise.
5278 (Symbol_table::do_define_as_constant): Likewise.
5279 * script.h (class Symbol_assignment): Add is_defsym parameter to
5280 constructor; change all callers.
5281 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5282 parameter. Change all callers. Add is_defsym_ field.
5283 (class Parser_closure): Add parsing_defsym parameter to
5284 constructor; change all callers. Add parsing_defsym accessor
5285 function. Add parsing_defsym_ field.
5286
556bd683
ILT
52872009-12-28 Ian Lance Taylor <iant@google.com>
5288
5289 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5290 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5291
1782c879
ILT
52922009-12-23 Ian Lance Taylor <iant@google.com>
5293
5294 * i386.cc (Target_i386::do_calls_non_split): Recognize
5295 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5296 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5297 -fsplit-stack prologue when using %r11.
1782c879 5298
329ca2b1
ST
52992009-12-21 Sriraman Tallam <tmsriram@google.com>
5300
5301 * options.cc (General_options::parse_version): Make -v continue and do
5302 the link like GNU ld does.
5303
d675ff46
RÁE
53042009-12-17 Rafael Avila de Espindola <espindola@google.com>
5305
5306 * Makefile.am (CCFILES): Add timer.cc.
5307 (HFILES): Add timer.h.
5308 * configure.ac: Check for sysconf and times.
5309 * main.cc: include timer.h.
5310 (main): Use Timer instead of get_run_time.
5311 * timer.cc: New.
5312 * timer.h: New.
5313 * workqueue.cc: include timer.h.
5314 (Workqueue::find_and_run_task):
5315 Report user, sys and wall time.
5316 * Makefile.in: Regenerate.
5317 * config.in: Regenerate.
5318 * configure: Regenerate.
5319
d6344fb5
DK
53202009-12-16 Doug Kwan <dougkwan@google.com>
5321
5322 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5323 sections.
5324 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5325 relaxed input sections.
5326 * output.cc (Output_section::find_relaxed_input_section): Change
5327 return type to Output_relaxed_input_section pointer. Adjust code
5328 for new type of relaxed_input_section_map_.
5329 * output.h (Output_section::find_relaxed_input_section): Change
5330 return type to Output_relaxed_input_section pointer.
5331 (Output_section::Output_relaxed_input_section_by_input_section_map):
5332 New type.
5333 (Output_section::relaxed_input_section_map_): Change type to
5334 Output_section::Output_relaxed_input_section_by_input_section_map.
5335 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5336 input section.
5337
0e0d5469
ILT
53382009-12-15 Ian Lance Taylor <iant@google.com>
5339
5340 * layout.cc (Layout::create_shstrtab): Only write out after input
5341 sections if we are compressing debug sections.
5342
0649a889
ILT
53432009-12-15 Ian Lance Taylor <iant@google.com>
5344
5345 * archive.cc (Archive::add_symbols): Only look up a symbol without
5346 a version if there is, in fact, a version.
5347
2ea97941
ILT
53482009-12-14 Ian Lance Taylor <iant@google.com>
5349
5350 Revert -Wshadow changes, all changes from:
5351 2009-12-11 Doug Kwan <dougkwan@google.com>
5352 2009-12-11 Nick Clifton <nickc@redhat.com>
5353 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5354
b0eec2cc
DK
53552009-12-11 Doug Kwan <dougkwan@google.com>
5356
5357 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5358 due to -Wshadow.
5359 * attributes.cc (Object_attribute::size): Ditto.
5360 (Attributes_section_data::size): Ditto.
5361 (Attributes_section_data::Attributes_section_data): Ditto.
5362 (Output_attributes_section_data::do_write): Ditto.
5363 * attributes.h (Object_attribute::set_type): Ditto.
5364 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5365
91d6fa6a
NC
53662009-12-11 Nick Clifton <nickc@redhat.com>
5367
5368 * archive.cc: Fix shadowed variable warnings.
5369 * arm.cc: Likewise.
5370 * compressed_output.cc: Likewise.
5371 * compressed_output.h: Likewise.
5372 * configure: Likewise.
5373 * dwarf_reader.cc: Likewise.
5374 * dynobj.cc: Likewise.
5375 * dynobj.h: Likewise.
5376 * ehframe.cc: Likewise.
5377 * ehframe.h: Likewise.
5378 * errors.cc: Likewise.
5379 * expression.cc: Likewise.
5380 * fileread.cc: Likewise.
5381 * fileread.h: Likewise.
5382 * freebsd.h: Likewise.
5383 * i386.cc: Likewise.
5384 * icf.cc: Likewise.
5385 * incremental.h: Likewise.
5386 * layout.cc: Likewise.
5387 * layout.h: Likewise.
5388 * mapfile.cc: Likewise.
5389 * merge.cc: Likewise.
5390 * merge.h: Likewise.
5391 * object.cc: Likewise.
5392 * object.h: Likewise.
5393 * options.h: Likewise.
5394 * output.cc: Likewise.
5395 * output.h: Likewise.
5396 * parameters.cc: Likewise.
5397 * plugin.cc: Likewise.
5398 * powerpc.cc: Likewise.
5399 * reduced_debug_output.cc: Likewise.
5400 * reduced_debug_output.h: Likewise.
5401 * reloc.cc: Likewise.
5402 * reloc.h: Likewise.
5403 * resolve.cc: Likewise.
5404 * script-sections.cc: Likewise.
5405 * script.cc: Likewise.
5406 * script.h: Likewise.
5407 * sparc.cc: Likewise.
5408 * symtab.cc: Likewise.
5409 * symtab.h: Likewise.
5410 * target-select.cc: Likewise.
5411 * target-select.h: Likewise.
5412 * token.h: Likewise.
5413 * workqueue.cc: Likewise.
5414 * workqueue.h: Likewise.
5415 * x86_64.cc: Likewise.
5416
a0351a69
DK
54172009-12-10 Doug Kwan <dougkwan@google.com>
5418
5419 * arm.cc (attributes.h): New include.
5420 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5421 (Arm_relobj::~Arm_relobj): Delete object pointed by
5422 attributes_section_data_.
5423 (Arm_relobj::attributes_section_data): New method definition.
5424 (Arm_relobj::attributes_section_data_): New data member declaration.
5425 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5426 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5427 attributes_section_data_.
5428 (Arm_dynobj::attributes_section_data): New method definition.
5429 (Arm_dynobj::attributes_section_data_): New data member declaration.
5430 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5431 initialization value of may_use_blx_ to false.
5432 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5433 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5434 object attributes to compute results instead of hard-coding.
5435 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5436 Target_arm::get_secondary_compatible_arch,
5437 Target_arm::set_secondary_compatible_arch
5438 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5439 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5440 New method declarations.
5441 (Target_arm::get_aeabi_object_attribute): New method definition.
5442 (Target_arm::attributes_section_data_): New data member declaration.
5443 (read_arm_attributes_section): New template definition.
5444 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5445 (Arm_dynobj::do_read_symbols): Ditto.
5446 (Target_arm::do_finalize_sections): Merge attributes sections from
5447 input. Check for BLX use after attributes section merging.
5448 Fix __exidx_start and __exidx_end visibility. Create an
5449 .ARM.attributes section if necessary.
5450 (Target_arm::get_secondary_compatible_arch,
5451 Target_arm::set_secondary_compatible_arch,
5452 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5453 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5454 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5455 New method definitions.
5456
b59befec
ILT
54572009-12-09 Ian Lance Taylor <iant@google.com>
5458
5459 * plugin.cc (Plugin::load): Don't cast from void* to a function
5460 pointer.
5461
1276bc89
ILT
54622009-12-09 Ian Lance Taylor <iant@google.com>
5463
5464 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5465 information fields.
5466
2f2de248
L
54672009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5468
5469 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5470 Replace two_file_shared_1.so with two_file_shared_2.so.
5471 * testsuite/Makefile.in: Regenerated.
5472
4f787271
DK
54732009-12-08 Doug Kwan <dougkwan@google.com>
5474
5475 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5476 (HFILES): Add attributes.h and int_encoding.h.
5477 * Makefile.in: Regenerate.
5478 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5479 function definitions to int_encoding.cc
5480 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5481 prototypes to int_encoding.h
5482 * reduced_debug_output.cc (int_encoding.h): New include.
5483 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5484 function definitions to int_encoding.cc
5485 (insert_into_vector, read_from_pointer): Move template definitions to
5486 int_encoding.h
5487 * attributes.cc: New file.
5488 * attributes.h: New file.
5489 * int_encoding.cc: New file.
5490 * int_encoding.h: New file.
5491
20b52f1a
RÁE
54922009-12-07 Rafael Avila de Espindola <espindola@google.com>
5493
5494 PR gold/11055
5495 * incremental-dump.cc (dump_incremental_inputs): New.
5496 (main): Use dump_incremental_inputs.
5497
53d7974c
L
54982009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5499
5500 PR gold/10893
5501 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5502 checking elfcpp::STT_FUNC.
5503 (Target_i386::Relocate::relocate): Likewise.
5504 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5505
5506 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5507 symbols from shared libraries into normal FUNC symbols.
5508
5509 * symtab.h (Symbol): Add is_func and use it.
5510
05a352e6
DK
55112009-12-05 Doug Kwan <dougkwan@google.com>
5512
5513 * arm.cc (Target_arm::arm_info): Initialize new fields
5514 attributes_section and attributes_vendor.
5515 * i386.cc (Target_i386::i386_info): Same.
5516 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5517 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5518 fields attributes_section and attributes_vendor.
53d7974c 5519 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5520 * target.h (Target::attributes_section, Target::attributes_vendor,
5521 Target::is_attributes_section, Target::attribute_arg_type,
5522 Target::attributes_order): New method definitions.
5523 (Target::Target_info::attributes_section,
5524 Target::Target_info::attributes_vendor): New fields.
5525 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5526 virtual method definitions.
5527 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5528 attributes_section and attributes_vendor.
5529 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5530
f4e5969c
DK
55312009-12-05 Doug Kwan <dougkwan@google.com>
5532
5533 * arm.cc: Update comments about interworking and stub generation.
5534 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5535 considered as non-PIC.
5536 (Arm_relocate_functions::base_abs): Fix formatting.
5537 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5538 of function to use GOT entry address instead of offset.
5539 (Target_arm::Scan::global): Issue an error if a symbol would need a
5540 PLT does not get one because it is untyped. Remove code to create
5541 dynamic symbols for relative branches.
5542 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5543 takes unsigned integer instead of boolean.
5544
1abce4a6
L
55452009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5546
5547 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5548 (two_file_test_LDADD): Likewise.
5549 (common_test_1_LDADD): Likewise.
5550 (exception_test_LDADD) Likewise.
5551 (weak_test_LDADD): Likewise.
5552 (many_sections_test_LDADD): Likewise.
5553 (initpri1_LDADD): Likewise.
5554 (script_test_1_LDADD): Likewise.
5555 (script_test_2_LDADD): Likewise.
5556 (justsyms_LDADD): Likewise.
5557 (binary_test_LDADD): Likewise.
5558 (large_LDADD): Likewise.
5559 * testsuite/Makefile.in: Regenerated.
5560
adcf2816 55612009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5562
adcf2816
L
5563 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5564 (Symbol_table::override_with_special): Likewise.
5565 (Symbol_table::add_from_object): Likewise.
5566
28e67f5d
RÁE
55672009-12-04 Rafael Avila de Espindola <espindola@google.com>
5568
5569 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5570 Don't set the data_offset twice.
5571
ae10a101
RÁE
55722009-12-04 Rafael Avila de Espindola <espindola@google.com>
5573
5574 * testsuite/Makefile.in: Regenerate.
5575
f59f41f3
DK
55762009-12-03 Doug Kwan <dougkwan@google.com>
5577
5578 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5579 (Target_arm::do_finalize_sections): Add parameter for symbol table
5580 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5581 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5582 parameter for symbol table pointer.
5583 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5584 an additional parameter for a pointer to symbol table.
5585 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5586 parameter for a symbol table pointer.
5587 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5588 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5589 Ditto.
5590 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5591 parameter for a symbol table pointer.
5592
ca55d848
RÁE
55932009-12-03 Rafael Avila de Espindola <espindola@google.com>
5594
5595 * incremental.cc (Incremental_inputs_header)
5596 (Incremental_inputs_header_write, Incremental_inputs_entry)
5597 (Incremental_inputs_entry_write): Move ...
5598 * incremental.h (Incremental_inputs_header)
5599 (Incremental_inputs_header_write, Incremental_inputs_entry)
5600 (Incremental_inputs_entry_write): here.
5601
3aec4f9c
RÁE
56022009-12-02 Rafael Avila de Espindola <espindola@google.com>
5603
5604 * incremental.cc (make_sized_incremental_binary): Set the target.
5605 Error if it is incompatible.
5606 * output.h (Output_file): Add filename method.
5607
9c0ae74d
RÁE
56082009-12-02 Rafael Avila de Espindola <espindola@google.com>
5609
5610 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5611 from the get_* methods.
5612
a45500ae
RÁE
56132009-12-02 Rafael Avila de Espindola <espindola@google.com>
5614
5615 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5616 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5617 Write 0 for the data_offset of scripts.
5618
325e6408
RÁE
56192009-12-02 Rafael Avila de Espindola <espindola@google.com>
5620
5621 * testsuite/Makefile.am: Add the incremental_test.sh test.
5622 * testsuite/incremental_test.sh: New.
5623 * testsuite/incremental_test_1.c: New.
5624 * testsuite/incremental_test_2.c: New.
5625
954c3e2e
RÁE
56262009-12-01 Rafael Avila de Espindola <espindola@google.com>
5627
5628 * incremental-dump.cc (main): Fix typos.
5629
f8086623
RÁE
56302009-11-27 Rafael Avila de Espindola <espindola@google.com>
5631
5632 PR gold/11025
5633 * incremental-dump.cc (main): Use llu to print 64 bit values.
5634
3b0dd6ac
L
56352009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5636 H.J. Lu <hongjiu.lu@intel.com>
5637
5638 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5639 $(LIBDL).
5640 (incremental_dump_LDADD): Likewise.
5641 * Makefile.in: Regenerated.
5642
a6d1ef57 56432009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5644
a6d1ef57
DK
5645 Revert:
5646
5647 2009-11-25 Doug Kwan <dougkwan@google.com>
5648
5649 * arm.cc (Target_arm::Target_arm): Move method definition
5650 outside of class definition. Add code to handle
5651 --target1-rel, --target1-abs and --target2= options.
5652 (Target_arm::get_reloc_reloc_type): Change method to be
5653 non-static and const.
5654 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5655 New data member declaration.
5656 (Target_arm::Scan::local, Target_arm::Scan::global,
5657 Target_arm::Relocate::relocate,
5658 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5659 Adjust call to Target_arm::get_real_reloc_type.
5660 (Target_arm::get_real_reloc_type): Use command line options
5661 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5662 * options.h (--target1-rel, --target1-abs, --target2): New
5663 ARM-only options.
5664
50aeb7d4
DK
56652009-11-25 Doug Kwan <dougkwan@google.com>
5666
5667 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5668 class definition. Add code to handle --target1-rel, --target1-abs
5669 and --target2= options.
5670 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5671 and const.
5672 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5673 member declaration.
5674 (Target_arm::Scan::local, Target_arm::Scan::global,
5675 Target_arm::Relocate::relocate,
5676 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5677 call to Target_arm::get_real_reloc_type.
5678 (Target_arm::get_real_reloc_type): Use command line options to
5679 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5680 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5681 options.
5682
51938283
DK
56832009-11-25 Doug Kwan <dougkwan@google.com>
5684
5685 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5686 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5687 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5688 formatting.
5689 (Arm_relocate_functions::thm_call): Replace body with a call to
5690 Arm_relocate_functions::thumb_branch_common.
5691 (Arm_relocate_functions::thm_jump24,
5692 Arm_relocate_functions::thm_xpc22): New method definitions.
5693 (Arm_relocate_functions::thumb_branch_common): New method definition.
5694 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5695 operator.
5696 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5697 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5698
e2b8f3c4
RÁE
56992009-11-24 Rafael Avila de Espindola <espindola@google.com>
5700
5701 * Makefile.am: Build incremental-dump
5702 * Makefile.in: Regenerate.
5703 * incremental-dump.cc: New.
5704 * incremental.cc (Incremental_inputs_header_data,
5705 Incremental_inputs_entry_data): Move to incremental.h
5706 * incremental.h: (Incremental_inputs_header_data,
5707 Incremental_inputs_entry_data): Move from incremental.cc
5708
bcba9aec
RÁE
57092009-11-24 Rafael Avila de Espindola <espindola@google.com>
5710
5711 * incremental.cc (Incremental_inputs_header,
5712 Incremental_inputs_header_write, Incremental_inputs_entry,
5713 Incremental_inputs_entry_write): Add a typedef with the data type.
5714
7c3afe08
RÁE
57152009-11-24 Rafael Avila de Espindola <espindola@google.com>
5716
5717 * incremental.cc (Incremental_inputs_header,
5718 Incremental_inputs_header_write, Incremental_inputs_entry,
5719 Incremental_inputs_entry_write): Update comment about which
5720 type has the filed descriptions.
5721
d204b6e9
DK
57222009-11-15 Doug Kwan <dougkwan@google.com>
5723
5724 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5725 (Arm_relocate_functions::arm_branch_common): Change method defintion
5726 in class definition to a method declaration and update list of formal
5727 parameters.
5728 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5729 Arm_relocation_functions::jump24): Adjust call to
5730 Arm_relocate_functions::arm_branch_common. Update list of formal
5731 parameters.
5732 (Arm_relocate_functions::xpc25): New method definition.
5733 (Arm_relocate_functions::arm_branch_common): Move method defintion
5734 out from class definition. Use stubs for mode-switching and extending
5735 branch ranges.
5736 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5737 specially. Change code to enable use of stubs in ARM branches.
5738
43d12afe
DK
57392009-11-10 Doug Kwan <dougkwan@google.com>
5740
5741 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5742 in method declaration.
5743 (Target_arm::relocate_stub): New method declaration.
5744 (Target_arm::default_target): Change to return a pointer instead of
5745 a const reference.
5746 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5747 Target_arm::default_target.
5748 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5749 method definition.
5750 (Target_arm::relocate_section): Adjust view.
5751 (Target_arm::relocate_stub): New method definition.
5752
ac33a407
DK
57532009-11-10 Doug Kwan <dougkwan@google.com>
5754
5755 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5756 a format warning.
5757 * incremental.cc (open_incremental_binary): Initialized local
5758 variables to avoid warnings.
5759 * object.cc (make_elf_object): Ditto.
5760 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5761 a format warning.
e1df38aa 5762
88ee28e9
L
5763009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5764
5765 PR gold/10930
5766 * testsuite/plugin_test.c: Include "config.h".
5767
2daedcd6
DK
57682009-11-09 Doug Kwan <dougkwan@google.com>
5769
5770 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5771 (arm_symbol_value): Remove.
5772 (Arm_relocate_functions::arm_branch_common,
5773 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5774 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5775 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5776 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5777 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5778 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5779 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5780 Arm_relocate_functions::thm_mobw_abs_nc,
5781 Arm_relocate_functions::thm_mov_abs,
5782 Arm_relocate_functions::movw_prel_nc,
5783 Arm_relocate_functions::thm_movt_abs,
5784 Arm_relocate_functions::movt_prel,
5785 Arm_relocate_functions::thm_movw_prel_nc,
5786 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5787 (Target_arm::Relocate::relocate): Only decompose address into two
5788 parts if relocation type uses the thumb-bit and pass the actual
5789 bit instead of a flag indicating that the thumb-bit is used. Adjust
5790 calls to methods in Arm_relocate_functions for this change.
5791
1276bc89 57922009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5793
5794 PR 10925
5795 * reloc.cc: Instantiate
5796 Sized_relobj::initialize_input_to_output_maps and
5797 Sized_relobj:free_input_to_output_maps.
5798
e53ad1b5
ILT
57992009-11-06 Ian Lance Taylor <iant@google.com>
5800
5801 PR 10876
5802 * defstd.cc (in_segment): Set only_if_ref true for "end".
5803
eb44217c
DK
58042009-11-06 Doug Kwan <dougkwan@google.com>
5805
5806 * arm.cc (class Reloc_stub): Correct a comment.
5807 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5808 (Target_arm::scan_section_for_stubs): New method declaration.
5809 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5810 Change methods from private to protected.
5811 (Target_arm::do_may_relax): New method definition.
5812 (Target_arm::do_relax, Target_arm::group_sections,
5813 Target_arm::scan_reloc_for_stub,
5814 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5815 (Target_arm::arm_input_section_map_): New data member declaration.
5816 (Target_arm::scan_reloc_for_stub,
5817 Target_arm::scan_reloc_section_for_stubs,
5818 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5819 Target_arm::do_relax): New method definitions.
5820
5d329b7d
ILT
58212009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5822
5823 * configure.ac: Check for (struct stat)::st_mtim
5824 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5825 * config.in: Regenerate.
5826 * configure: Regenerate.
5827
96a0d71b
ILT
58282009-11-05 Ian Lance Taylor <iant@google.com>
5829
5830 PR 10910
5831 * output.cc (Output_segment::add_output_section): Add missing
5832 return statement.
5833
594c8e5e
ILT
58342009-11-04 Ian Lance Taylor <iant@google.com>
5835
5836 PR 10880
5837 * object.h (class Object): Add is_needed and set_is_needed
5838 methods. Add is_needed_ field. Make bool fields into bitfields.
5839 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5840 defined in a dynamic object and referenced by a regular object,
5841 set is_needed for the dynamic object.
5842 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5843 if the file is marked with as_needed and it is not needed.
5844
22b127cc
ILT
58452009-11-04 Ian Lance Taylor <iant@google.com>
5846
5847 PR 10887
5848 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5849 tags if data is discarded by linker script.
5850 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5851 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5852 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5853 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5854
f5c870d2
ILT
58552009-11-04 Ian Lance Taylor <iant@google.com>
5856
5857 * layout.cc (Layout::get_output_section): Add is_interp and
5858 is_dynamic_linker_section parameters. Change all callers.
5859 (Layout::choose_output_section): Likewise.
5860 (Layout::make_output_section): Likewise.
5861 (Layout::add_output_section_data): Add is_dynamic_linker_section
5862 parameter. Change all callers.
5863 * layout.h (class Layout): Update declarations.
5864 * output.h (class Output_section): Add is_interp, set_is_interp,
5865 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5866 Add is_interp_, is_dynamic_linker_section_ fields. Change
5867 generate_code_fills_at_write_ to a bitfield.
5868 * output.cc (Output_section::Output_sections): Initialize new
5869 fields.
5870 (Output_segment::add_output_section): Add do_sort parameter.
5871 Change all callers.
5872
1ae4d23b
ILT
58732009-11-03 Ian Lance Taylor <iant@google.com>
5874
5875 PR 10860
5876 * options.h (class General_options): Add --warn-common.
5877 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5878 merging two common symbols.
5879 (Symbol_table::should_override): Handle --warn-common when merging
5880 a common symbol with a defined symbol. Use report_resolve_problem
5881 for multiple definitions.
5882 (Symbol_table::report_resolve_problem): New function.
5883 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5884
55da9579
DK
58852009-11-03 Doug Kwan <dougkwan@google.com>
5886
5887 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5888 stub_factory_.
5889 (Target_arm::stub_factory): New method definition.
5890 (Target_arm::new_arm_input_section,
5891 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5892 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5893 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5894 New type definitions.
5895 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5896 member declarations.
5897 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5898 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5899 New method definitions.
5900
37a9ac43
ILT
59012009-11-03 Ian Lance Taylor <iant@google.com>
5902
5903 * options.h (class General_options): Add --warn_constructors.
5904
b3d6a3d4
ILT
59052009-11-03 Ian Lance Taylor <iant@google.com>
5906
5907 PR 10893
5908 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5909 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5910
934b01dd
ILT
59112009-11-03 Ian Lance Taylor <iant@google.com>
5912
5913 PR 10895
5914 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5915 --msgid-bugs-address.
5916 (install-pdf): New target.
5917 (install-data_yes): Look up one directory to find mkinstalldirs.
5918
03c1939b
L
59192009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5920
5921 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5922 tree.
5923
ebd95253
DK
59242009-10-30 Doug Kwan <dougkwan@google.com>
5925
5926 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5927
e9bbb538
DK
59282009-10-30 Doug Kwan <dougkwan@google.com>
5929
5930 * arm.cc (Stub_addend_reader): New struct template definition
5931 and partial specializations.
5932 (Stub_addend_reader::operator()): New method definition for a
5933 partially specialized template.
5934
d5b40221
DK
59352009-10-30 Doug Kwan <dougkwan@google.com>
5936
5937 * arm.cc (Arm_relobj::processor_specific_flags): New method
5938 definition.
5939 (Arm_relobj::do_read_symbols): New method declaration.
5940 (Arm_relobj::processor_specific_flags_): New data member declaration.
5941 (Arm_dynobj): New class definition.
5942 (Target_arm::do_finalize_sections): Add input_objects parameter.
5943 (Target_arm::do_adjust_elf_header): New method declaration.
5944 (Target_arm::are_eabi_versions_compatible,
5945 (Target_arm::merge_processor_specific_flags): New method declaration.
5946 (Target_arm::do_make_elf_object): New overloaded method definitions
5947 and declaration.
5948 (Arm_relobj::do_read_symbols): New method definition.
5949 (Arm_dynobj::do_read_symbols): Ditto.
5950 (Target_arm::do_finalize_sections): Add input_objects parameters.
5951 Merge processor-specific flags from all input objects.
5952 (Target_arm::are_eabi_versions_compatible,
5953 Target_arm::merge_processor_specific_flags,
5954 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5955 New method definitions.
5956 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5957 Input_objects pointer type parameter.
5958 * layout.cc (Layout::finalize): Pass input objects to target's.
5959 finalize_sections function.
5960 * output.cc (Output_file_header::do_sized_write): Set ELF file
5961 header's processor-specific flags.
5962 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5963 Input_objects pointer type parameter.
5964 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5965 * target.h (Input_objects): New forward class declaration.
5966 (Target::processor_specific_flags,
5967 Target::are_processor_specific_flags_sect): New method definitions.
5968 (Target::finalize_sections): Add input_objects parameter.
5969 (Target::Target): Initialize processor_specific_flags_ and
5970 are_processor_specific_flags_set_.
5971 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5972 parameter.
5973 (Target::set_processor_specific_flags): New method definition.
5974 (Target::processor_specific_flags_,
5975 Target::are_processor_specific_flags_set_): New data member
5976 declarations.
5977 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5978 Input_objects pointer type parameter.
5979
ebabffbd
DK
59802009-10-30 Doug Kwan <dougkwan@google.com>
5981
5982 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5983
ad0f2072
ILT
59842009-10-28 Ian Lance Taylor <iant@google.com>
5985
5986 * object.h (class Relobj): Drop options parameter from
5987 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5988 do_scan_relocs, do_relocate. Change all callers.
5989 (class Sized_relobj): Drop options parameters from
5990 do_gc_process_relocs, do_scan_relocs, do_relocate,
5991 do_relocate_sections, relocate_sections, emit_relocs_scan,
5992 emit_relocs_scan_reltype. Change all callers.
5993 (struct Relocate_info): Remove options field and all references to
5994 it.
5995 * reloc.h (class Read_relocs): Remove options constructor
5996 parameter and options_ field. Change all callers.
5997 (class Gc_process_relocs, class Scan_relocs): Likewise.
5998 (class Relocate_task): Likewise.
5999 * target-reloc.h (scan_relocs): Remove options parameter. Change
6000 all callers.
6001 (scan_relocatable_relocs): Likewise.
6002 * target.h (class Sized_target): Remove options parameter from
6003 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6004 all callers.
6005 * gc.h (gc_process_relocs): Remove options parameter. Change all
6006 callers.
6007 * arm.cc: Update functions to remove options parameters.
6008 * i386.cc: Likewise.
6009 * powerpc.cc: Likewise.
6010 * sparc.cc: Likewise.
6011 * x86_64.cc: Likewise.
6012 * testsuite/testfile.cc: Likewise.
6013
8ffa3667
DK
60142009-10-28 Doug Kwan <dougkwan@google.com>
6015
6016 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6017 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6018 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6019 New method definitions.
6020
40f36857
CC
60212009-10-28 Cary Coutant <ccoutant@google.com>
6022
6023 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6024 (Plugin::cleanup_done_): New member.
6025 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6026 (Plugin_manager::cleanup_done_): Remove.
6027 (Plugin_manager::add_input_file): Edit error message.
6028 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6029 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6030
2c849493
ILT
60312009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6032
6033 * fileread.cc: (File_read::View::~View): Use the new
6034 data_ownership_ filed.
6035 (File_read::~File_read): Dispose the new whole_file_view_.
6036 (File_read::open): Mmap the whole file if needed.
6037 (File_read::open): Use whole_file_view_ instead of contents_.
6038 (File_read::find_view): Use whole_file_view_ if applicable.
6039 (File_read::do_read): Use whole_file_view_ instead of contents_.
6040 (File_read::make_view): Use whole_file_view_ instead of contents_,
6041 update File_read::View::View call.
6042 (File_read::find_or_make_view): Update File_read::View::View
6043 call.
6044 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6045 remove contents_
6046 (File_read::View::Data_ownership): New enum.
6047 (File_read::View::View): Replace bool mapped_ with Data_ownership
6048 argument.
6049 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6050 (File_read::View::data_ownership_): New field.
6051 (File_read::contents_): Remove (replaced by whole_file_view_).
6052 (File_read::whole_file_view_): New field.
6053 * options.h (class General_options): Add --keep-files-mapped.
6054
24998053
CC
60552009-10-27 Cary Coutant <ccoutant@google.com>
6056
6057 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6058 * testsuite/Makefile.am (plugin_test_5): New test case.
6059 * testsuite/Makefile.in: Regenerate.
6060
72adc4fa
DK
60612009-10-25 Doug Kwan <dougkwan@google.com>
6062
6063 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6064 from private to protected to allow access by child class.
6065 (Sized_relobj::do_relocate_sections): New method declaration.
6066 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6067 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6068 Sized_relobj::relocate_sections. Instantiate template explicitly
6069 for different target sizes and endianity.
6070
07f508a2
DK
60712009-10-24 Doug Kwan <dougkwan@google.com>
6072
6073 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6074 (Arm_input_section::as_arm_input_section): New method.
6075 (Arm_output_section): New class definition.
6076 (Arm_output_section::create_stub_group,
6077 Arm_output_section::group_sections): New method definitions.
6078
10ad9fe5
DK
60792009-10-22 Doug Kwan <dougkwan@google.com>
6080
6081 * arm.cc (Arm_input_section): New class definition.
6082 (Arm_input_section::init, Arm_input_section:do_write,
6083 Arm_input_section::set_final_data_size,
6084 Arm_input_section::do_reset_address_and_file_offset): New method
6085 definitions.
6086
56ee5e00
DK
60872009-10-21 Doug Kwan <dougkwan@google.com>
6088
6089 * arm.cc (Stub_table, Arm_input_section): New forward class
6090 declarations.
6091 (Stub_table): New class defintion.
6092 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6093 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6094 New method definition.
6095
b569affa
DK
60962009-10-21 Doug Kwan <dougkwan@google.com>
6097
6098 * arm.cc: Update copyright comments.
6099 (Target_arm): New forward class template declaration.
6100 (Arm_address): New type.
6101 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6102 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6103 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6104 constants.
6105 (Insn_template): Same.
6106 (DEF_STUBS): New macro.
6107 (Stub_type): New enum type.
6108 (Stub_template): New class definition.
6109 (Stub): Same.
6110 (Reloc_stub): Same.
6111 (Stub_factory): Same.
6112 (Target_arm::Target_arm): Initialize may_use_blx_ and
6113 should_force_pic_veneer_.
6114 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6115 Target_arm::should_force_pic_veneer,
6116 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6117 Target_arm::using_thumb_only, Target_arm:;default_target): New
6118 method defintions.
6119 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6120 New data member declarations.
6121 (Insn_template::size, Insn_template::alignment): New method defintions.
6122 (Stub_template::Stub_template): New method definition.
6123 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6124 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6125 (Stub_factory::Stub_factory): New method definition.
6126 * gold.h (string_hash): New template.
6127 * output.h (Input_section_specifier::hash_value): Use
6128 gold::string_hash.
6129 (Input_section_specifier::string_hash): Remove.
6130 * stringpool.cc (Stringpool_template::string_hash): Use
6131 gold::string_hash.
6132
6c172549
DK
61332009-10-20 Doug Kwan <dougkwan@google.com>
6134
6135 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6136 symbols of relaxed input sections.
6137 * output.h (Output_section::find_relaxed_input_section): Make
6138 method public.
6139
c5617f2f
DK
61402009-10-16 Doug Kwan <dougkwan@google.com>
6141
6142 * dynobj.cc (Versions::Versions): Initialize version_script_.
6143 Only insert base version symbol definition for a shared object
6144 if version script defines any version versions.
6145 (Versions::define_base_version): New method definition.
6146 (Versions::add_def): Check that base version is not needed.
6147 (Versions::add_need): Define base version lazily.
6148 * dynobj.h (Versions::define_base_version): New method declaration.
6149 (Versions::needs_base_version_): New data member declaration.
6150 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6151 (check_DATA): Add no_version_test.stdout.
6152 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6153 New make rules.
6154 * testsuite/Makefile.in: Regenerate.
6155 * testsuite/no_version_test.c: New file.
6156 * testsuite/no_version_test.sh: Ditto.
6157
3c12dcdb
DK
61582009-10-16 Doug Kwan <dougkwan@google.com>
6159
6160 * expression.cc (class Segment_start_expression): New class definition.
6161 (Segment_start_expression::value): New method definition.
6162 (script_exp_function_segment_start): Return a new
6163 Segment_start_expression.
6164 * gold/script-c.h (script_saw_segment_start_expression): New function
6165 prototype.
6166 * script-sections.cc (Script_sections::Script_sections): Initialize
6167 SAW_SEGMENT_START_EXPRESSION_ to false.
6168 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6169 and -Tbbs options to specify section addresses if given in
6170 command line and no SEGMENT_START expression is seen in a script.
6171 * script-sections.h (Script_sections::saw_segment_start_expression,
6172 Script_sections::set_saw_segment_start_expression): New method
6173 definition.
6174 (Script_sections::saw_segment_start_expression_): New data member
6175 declaration.
6176 * script.cc (script_saw_segment_start_expression): New function.
6177 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6178 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6179 script_test_7.sh and script_test_8.sh.
6180 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6181 script_test_8.stdout.
6182 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6183 (script_test_6, script_test_6.stdout, script_test_7,
6184 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6185 * Makefile.in: Regenerate.
6186 * testsuite/script_test_6.sh: New file.
6187 * testsuite/script_test_6.t: Same.
6188 * testsuite/script_test_7.sh: Same.
6189 * testsuite/script_test_7.t: Same.
6190 * testsuite/script_test_8.sh: Same.
6191
64b1ae37
DK
61922009-10-16 Doug Kwan <dougkwan@google.com>
6193
6194 * output.cc (Output_segment::set_section_list_address): Cast
6195 expressions to unsigned long long type to avoid format warnings.
6196
661be1e2
ILT
61972009-10-15 Ian Lance Taylor <iant@google.com>
6198
12edd763 6199 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6200 dot assignment to script_sections_.
12edd763
ILT
6201 * script-sections.cc (Script_sections::add_dot_assignment):
6202 Initialize if necessary.
6203
68b6574b
ILT
6204 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6205 program headers with no load segment if there is a linker script.
6206
661be1e2
ILT
6207 * layout.cc (Layout::set_segment_offsets): Align the file offset
6208 to the segment aligment for -N or -n with no load segment.
6209 * output.cc (Output_segment::add_output_section): Don't crash if
6210 the first section is a TLS section.
6211 (Output_segment::set_section_list_addresses): Print an error
6212 message if the address moves backward in a linker script.
6213 * script-sections.cc
6214 (Output_section_element_input::set_section_addresses): Don't
6215 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6216 (Orphan_output_section::set_section_addresses): Likewise.
6217
f15f61a7
DK
62182009-10-15 Doug Kwan <dougkwan@google.com>
6219
6220 * layout.cc (Layout::finish_dynamic_section): Generate tags
6221 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6222 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6223 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6224
82bb573a
ILT
62252009-10-14 Ian Lance Taylor <iant@google.com>
6226
6227 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6228 fields.
6229 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6230 data_shdr fields of relinfo.
6231 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6232 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6233 R_386_TLS_LDO_32, adjust based on section flags.
6234 (Target_i386::Relocate::fix_up_ldo): Remove.
6235
374ad285
ILT
62362009-10-13 Ian Lance Taylor <iant@google.com>
6237
6238 Add support for -pie.
6239 * options.h (class General_options): Add -pie and
6240 --pic-executable.
6241 (General_options::output_is_position_independent): Test -pie.
6242 (General_options::output_is_executable): Return true if not shared
6243 and not relocatable.
6244 (General_options::output_is_pie): Remove.
6245 * options.cc (General_options::finalize): Reject incompatible uses
6246 of -pie.
6247 * gold.cc (queue_middle_tasks): A -pie link is not static.
6248 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6249 * symtab.cc (Symbol::final_value_is_known): Return false if
6250 output_is_position_independent.
6251 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6252 output_is_position_independent.
6253 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6254 output_is_position_independent.
6255 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6256 output_is_position_independent.
6257 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6258 two_file_pie_test.
6259 (basic_pie_test.o, basic_pie_test): New targets.
6260 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6261 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6262 (two_file_pie_test): New target.
6263 * testsuite/Makefile.in: Rebuild.
6264 * README: Remove note saying that -pie is not supported.
6265
c6585162
ILT
62662009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6267
6268 * options.h (class General_options): Add -init and -fini.
6269 * layout.cc (Layout::finish_dynamic_section): Emit
6270 given init and fini functions.
6271
032ce4e9
ST
62722009-10-13 Sriraman Tallam <tmsriram@google.com>
6273
6274 * gc.h (gc_process_relocs): Check if icf is enabled using new
6275 function.
6276 * gold.cc (queue_initial_tasks): Likewise.
6277 (queue_middle_tasks): Likewise.
6278 * object.cc (do_layout): Likewise.
6279 * symtab.cc (is_section_folded): Likewise.
6280 * main.cc (main): Likewise.
6281 * reloc.cc (Read_relocs::run): Likewise.
6282 (Sized_relobj::do_scan_relocs): Likewise.
6283 * icf.cc (is_function_ctor_or_dtor): New function.
6284 (Icf::find_identical_sections): Check if function is ctor or dtor when
6285 safe icf is chosen.
6286 * options.h (General_options::icf): Change option to be an enum.
6287 (Icf_status): New enum.
6288 (icf_enabled): New method.
6289 (icf_safe_folding): New method.
6290 (set_icf_status): New method.
6291 (icf_status_): New variable.
6292 * (options.cc) (General_options::finalize): Set icf_status_.
6293 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6294 icf_test and icf_keep_unique_test to use the --icf enum flag.
6295 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6296 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6297
f345227a
ST
62982009-10-12 Sriraman Tallam <tmsriram@google.com>
6299
6300 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6301 includes to gc.h and icf.h.
6302 * arm.cc: Include gc.h.
6303 * gold.cc: Likewise.
6304 * i386.cc: Likewise.
6305 * powerpc.cc: Likewise.
6306 * sparc.cc: Likewise.
6307 * x86_64.cc: Likewise.
6308 * gc.h: Include icf.h.
6309
1c7814ed
ILT
63102009-10-11 Ian Lance Taylor <iant@google.com>
6311
6312 * plugin.cc: Include "gold.h" before other header files.
6313
ae3b5189
CD
63142009-10-10 Chris Demetriou <cgd@google.com>
6315
6316 * options.h (Input_file_argument::Input_file_type): New enum.
6317 (Input_file_argument::is_lib_): Replace with...
6318 (Input_file_argument::type_): New member.
6319 (Input_file_argument::Input_file_argument): Take Input_file_type
6320 'type' rather than boolean 'is_lib' as second argument.
6321 (Input_file_argument::is_lib): Use type_.
6322 (Input_file_argument::is_searched_file): New function.
6323 (Input_file_argument::may_need_search): Handle is_searched_file.
6324 * options.cc (General_options::parse_library): Support -l:filename.
6325 (General_options::parse_just_symbols): Update for Input_file_argument
6326 changes.
6327 (Command_line::process): Likewise.
6328 * archive.cc (Archive::get_file_and_offset): Likewise.
6329 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6330 * script.cc (read_script_file, script_add_file): Likewise.
6331 * fileread.cc (Input_file::Input_file): Likewise.
6332 (Input_file::will_search_for): Handle is_searched_file.
6333 (Input_file::open): Likewise.
6334 * readsyms.cc (Read_symbols::get_name): Likewise.
6335 * testsuite/Makefile.am (searched_file_test): New test.
6336 * testsuite/Makefile.in: Regenerate.
6337 * testsuite/searched_file_test.cc: New file.
6338 * testsuite/searched_file_test_lib.cc: New file.
6339
f3048a1d
ILT
63402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6341 Ian Lance Taylor <iant@google.com>
6342
6343 * descriptor.cc: Include <cstdio> and "binary-io.h".
6344 (Descriptors::open): Open the files in binary mode always.
6345 * script.cc (Lex::get_token): Treat \r as whitespace.
6346
d4780e57
ILT
63472009-10-09 Ian Lance Taylor <iant@google.com>
6348
6349 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6350
d9a893b8
ILT
63512009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6352 Ian Lance Taylor <iant@google.com>
6353
6354 * configure.ac: Check for readv function also.
6355 * fileread.cc (readv): Define if not HAVE_READV.
6356 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6357 does not exist.
6358 * config.in: Regenerate.
6359 * configure: Regenerate.
6360
c0a62865
DK
63612009-10-09 Doug Kwan <dougkwan@google.com>
6362
6363 * layout.cc (Layout::make_output_section): Call target hook to make
6364 ordinary output section.
6365 (Layout::finalize): Adjust parameter list of call the
6366 Target::may_relax().
6367 * layout.h (class Layout::section_list): New method.
6368 * merge.h (Output_merge_base::entsize): Change visibility to public.
6369 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6370 New methods.
6371 (Output_merge_string::do_is_string): New method.
6372 * object.cc (Sized_relobj::do_setup): renamed from
6373 Sized_relobj::set_up.
6374 * object.h (Sized_relobj::adjust_shndx,
6375 Sized_relobj::initializ_input_to_output_maps,
6376 Sized_relobj::free_input_to_output_maps): Change visibilities to
6377 protected.
6378 (Sized_relobj::setup): Virtualize.
6379 (Sized_relobj::do_setup): New method declaration.
6380 (Sized_relobj::invalidate_section_offset,
6381 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6382 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6383 * options.cc (parse_int): New function.
6384 * options.h (parse_int): New declaration.
6385 (DEFINE_int): New macro.
6386 (stub_group_size): New option.
6387 * output.cc (Output_section::Output_section): Initialize memebers
6388 merge_section_map_, merge_section_by_properties_map_,
6389 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6390 (Output_section::add_input_section): Handled deferred code-fill
6391 generation and remove an old comment.
6392 (Output_section::add_relaxed_input_section): New method definition.
6393 (Output_section::add_merge_input_section): Use merge section by
6394 properties map to speed to search. Update merge section maps
6395 as appropriate.
6396 (Output_section::build_relaxation_map): New method definition.
6397 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6398 Same.
6399 (Output_section::relax_input_section): Renamed to
6400 Output_section::convert_input_sections_to_relaxed_sections and change
6401 interface to take a vector of pointers to relaxed sections.
6402 (Output_section::find_merge_section,
6403 Output_section::find_relaxed_input_section): New method definitions.
6404 (Output_section::is_input_address_mapped,
6405 Output_section::output_offset, Output_section::output_address):
6406 Use output section data maps to speed up searching.
6407 (Output_section::find_starting_output_address): Add comments.
6408 (Output_section::do_write,
6409 Output_section::write_to_postprocessing_buffer): Do code-fill
6410 generation as appropriate.
6411 (Output_section::get_input_sections): Invalidate relaxed input section
6412 map.
6413 (Output_section::restore_states): Adjust type of checkpoint .
6414 Invalidate relaxed input section map.
6415 * output.h (Output_merge_base): New class declaration.
6416 (Input_section_specifier): New class defintion.
6417 (class Output_relaxed_input_section) Change base class to
6418 Output_section_data_build.
6419 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6420 base class initializer.
6421 (Output_section::add_relaxed_input_section): New method declaration.
6422 (Output_section::Input_section): Change visibility to protected.
6423 (Output_section::Input_section::relobj,
6424 Output_section::Input_section::shndx): Handle relaxed input sections.
6425 Output_section::input_sections) Change visibility to protected. Also
6426 define overload to return a non-const pointer.
6427 (Output_section::Merge_section_properties): New class defintion.
6428 (Output_section::Merge_section_by_properties_map,
6429 Output_section::Output_section_data_by_input_section_map,
6430 Output_section::Relaxation_map): New types.
6431 (Output_section::relax_input_section): Rename method to
6432 Output_section::convert_input_sections_to_relaxed_sections and change
6433 interface to take a vector of relaxed section pointers.
6434 (Output_section::find_merge_section,
6435 Output_section::find_relaxed_input_section,
6436 Output_section::build_relaxation_map,
6437 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6438 New method declarations.
6439 (Output_section::merge_section_map_
6440 Output_section::merge_section_by_properties_map_,
6441 Output_section::relaxed_input_section_map_,
6442 Output_section::is_relaxed_input_section_map_valid_,
6443 Output_section::generate_code_fills_at_write_): New data members.
6444 * script-sections.cc
6445 (Output_section_element_input::set_section_addresses): Call
6446 current_data_size and addralign methods of relaxed input sections.
6447 (Orphan_output_section::set_section_addresses): Call current_data_size
6448 and addralign methods of relaxed input sections.
6449 * symtab.cc (Symbol_table::compute_final_value): Extract template
6450 from the body of Symbol_table::sized_finalize_symbol.
6451 (Symbol_table::sized_finalized_symbol): Call
6452 Symbol_table::compute_final_value.
6453 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6454 (Symbol_table::compute_final_value): New templated method declaration.
6455 * target.cc (Target::do_make_output_section): New method defintion.
6456 * target.h (Target::make_output_section): New method declaration.
6457 (Target::relax): Add more parameters for input objects, symbol table
6458 and layout. Adjust call to do_relax.
6459 (Target::do_make_output_section): New method declaration.
6460 (Target::do_relax): Add parameters for input objects, symbol table
6461 and layout.
6462
d446d6c4
ILT
64632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6464
6465 * pread.c: Include stdio.h.
6466
bc06c745
ILT
64672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6468
6469 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6470 defined.
6471
75aea3d0
ILT
64722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6473
6474 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6475 Change read_shndx type to unsigned int.
6476 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6477 int.
6478 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6479 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6480 Change read_shndx type to unsigned int.
6481 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6482 int.
6483 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6484 * layout.cc (Layout::create_symtab_sections): Cast the result of
6485 local_symcount * symsize to off_t in the gold_assert.
6486
be8fcb75
ILT
64872009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6488
6489 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6490 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6491 R_ARM_BASE_ABS.
6492 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6493 (Arm_relocate_functions::thm_abs5): New function.
6494 (Arm_relocate_functions::abs12): New function.
6495 (Arm_relocate_functions::abs16): New function.
6496 (Arm_relocate_functions::base_abs): New function.
6497 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6498 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6499 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6500 R_ARM_BASE_ABS.
6501 (Scan::global): Likewise.
6502 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6503 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6504 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6505 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6506 R_ARM_BASE_ABS.
6507
c2a122b6
ILT
65082009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6509
6510 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6511 (Arm_relocate_functions::movt_prel): New function.
6512 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6513 (Arm_relocate_functions::thm_movt_prel): New function.
6514 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6515 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6516 (Scan::global, Relocate::relocate): Likewise.
6517 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6518
c4aa1e2d
ILT
65192009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6520
6521 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6522 Incremental_checker.
6523 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6524 unsigned int.
6525 (class Incremental_inputs_header): New class.
6526 (Incremental_inputs_header_writer): Edit comment.
6527 (Incremental_inputs_entry): New class.
6528 (Incremental_inputs_entry_writer): Edit comment.
6529 (Sized_incremental_binary::do_find_incremental_inputs_section):
6530 Add *strtab_shndx parameter, fill it.
6531 (Sized_incremental_binary::do_check_inputs): New method.
6532 (Incremental_checker::can_incrementally_link_output_file): Use
6533 Sized_incremental_binary::check_inputs.
6534 (Incremental_inputs::report_command_line): Save command line in
6535 command_line_.
6536 * incremental.h:
6537 (Incremental_binary::find_incremental_inputs_section): New
6538 method.
6539 (Incremental_binary::do_find_incremental_inputs_section): Add
6540 strtab_shndx parameter.
6541 (Incremental_binary::do_check_inputs): New pure virtual method.
6542 (Sized_incremental_binary::do_check_inputs): Declare.
6543 (Incremental_checker::Incremental_checker): Add incremental_inputs
6544 parameter, use it to initialize incremental_inputs_.
6545 (Incremental_checker::incremental_inputs_): New field.
6546 (Incremental_checker::command_line): New method.
6547 (Incremental_checker::inputs): New method.
6548 (Incremental_checker::command_line_): New field.
6549
c549a694
ILT
65502009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6551
6552 * incremental.cc: Include <cstdarg> and "target-select.h".
6553 (vexplain_no_incremental): New function.
6554 (explain_no_incremental): New function.
6555 (Incremental_binary::error): New method.
6556 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6557 method.
6558 (make_sized_incremental_binary): New function.
6559 (open_incremental_binary): New function.
6560 (can_incrementally_link_file): Add checks if output is ELF and has
6561 inputs section.
6562 * incremental.h: Include "elfcpp_file.h" and "output.h".
6563 (Incremental_binary): New class.
6564 (Sized_incremental_binary): New class.
6565 (open_incremental_binary): Declare.
6566 * object.cc (is_elf_object): Use
6567 elfcpp::Elf_recognizer::is_elf_file.
6568 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6569 * output.h (Output_file::filesize): New method.
6570
fd3c5f0b
ILT
65712009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6572
6573 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6574 New function.
6575 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6576 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6577 function.
6578 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6579 function.
6580 (Arm_relocate_functions::movw_abs_nc): New function.
6581 (Arm_relocate_functions::movt_abs): New function.
6582 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6583 (Arm_relocate_functions::thm_movt_abs): New function.
6584 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6585 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6586 (Scan::global): Likewise.
6587 (Relocate::relocate): Likewise.
6588 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6589
7f5309a5
ILT
65902009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6591
6592 * arm.cc (Arm_relocate_functions::got_prel) New function.
6593 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6594 (Relocate::relocate): Likewise.
6595 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6596
364c7fa5
ILT
65972009-10-06 Ian Lance Taylor <iant@google.com>
6598
6599 * options.h (class General_options): Define
6600 split_stack_adjust_size parameter.
6601 * object.h (class Object): Add uses_split_stack_ and
6602 has_no_split_stack_ fields. Add uses_split_stack and
6603 has_no_split_stack accessor functions. Declare
6604 handle_split_stack_section.
6605 (class Reloc_symbol_changes): Define.
6606 (class Sized_relobj): Define Function_offsets. Declare
6607 split_stack_adjust, split_stack_adjust_reltype, and
6608 find_functions.
6609 * object.cc (Object::handle_split_stack_section): New function.
6610 (Sized_relobj::do_layout): Call handle_split_stack_section.
6611 * dynobj.cc (Sized_dynobj::do_layout): Call
6612 handle_split_stack_section.
6613 * reloc.cc (Sized_relobj::relocate_sections): Call
6614 split_stack_adjust for executable sections in split_stack
6615 objects. Pass reloc_map to relocate_section.
6616 (Sized_relobj::split_stack_adjust): New function.
6617 (Sized_relobj::split_stack_adjust_reltype): New function.
6618 (Sized_relobj::find_functions): New function.
6619 * target-reloc.h: Include "object.h".
6620 (relocate_section): Add reloc_symbol_changes parameter. Change
6621 all callers.
6622 * target.h (class Target): Add calls_non_split method. Declare
6623 do_calls_non_split virtual method. Declare match_view and
6624 set_view_to_nop.
6625 * target.cc: Include "elfcpp.h".
6626 (Target::do_calls_non_split): New function.
6627 (Target::match_view): New function.
6628 (Target::set_view_to_nop): New function.
6629 * gold.cc (queue_middle_tasks): Give an error if mixing
6630 split-stack and non-split-stack objects with -r.
6631 * i386.cc (Target_i386::relocate_section): Add
6632 reloc_symbol_changes parameter.
6633 (Target_i386::do_calls_non_split): New function.
6634 * x86_64.cc (Target_x86_64::relocate_section): Add
6635 reloc_symbol_changes parameter.
6636 (Target_x86_64::do_calls_non_split): New function.
6637 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6638 parameter.
6639 * powerpc.cc (Target_powerpc::relocate_section): Add
6640 reloc_symbol_changes parameter.
6641 * sparc.cc (Target_sparc::relocate_section): Add
6642 reloc_symbol_changes parameter.
6643 * configure.ac: Call AM_CONDITIONAL for the default target.
6644 * configure: Rebuild.
6645 * testsuite/Makefile.am (TEST_AS): New variable.
6646 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6647 (check_DATA): Add split_i386 and split_x86_64 files.
6648 (SPLIT_DEFSYMS): Define.
6649 (split_i386_[1234n].o): New targets.
6650 (split_i386_[124]): New targets.
6651 (split_i386_[1234r].stdout): New targets.
6652 (split_x86_64_[1234n].o): New targets.
6653 (split_x86_64_[124]): New targets.
6654 (split_x86_64_[1234r].stdout): New targets.
6655 (MOSTLYCLEANFILES): Add new executables.
6656 * testsuite/split_i386.sh: New file.
6657 * testsuite/split_x86_64.sh: New file.
6658 * testsuite/split_i386_1.s: New file.
6659 * testsuite/split_i386_2.s: New file.
6660 * testsuite/split_i386_3.s: New file.
6661 * testsuite/split_i386_4.s: New file.
6662 * testsuite/split_i386_n.s: New file.
6663 * testsuite/split_x86_64_1.s: New file.
6664 * testsuite/split_x86_64_2.s: New file.
6665 * testsuite/split_x86_64_3.s: New file.
6666 * testsuite/split_x86_64_4.s: New file.
6667 * testsuite/split_x86_64_n.s: New file.
6668 * testsuite/testfile.cc (Target_test): Update relocation_section
6669 function.
6670 * testsuite/Makefile.in: Rebuild.
6671
e8a9fcda
ILT
66722009-10-06 Ian Lance Taylor <iant@google.com>
6673
6674 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6675 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6676 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6677 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6678 the address on ldo_addrs_.
6679 (Target_i386::Relocate::fix_up_ldo): New function.
6680
e99daf92
ILT
66812009-10-06 Rafael Espindola <espindola@google.com>
6682
6683 * plugin.cc (add_input_library): New.
6684 (Plugin::load): Add add_input_library to tv.
6685 (Plugin_manager::add_input_file): Add the is_lib argument.
6686 (add_input_file): Update call to Plugin_manager::add_input_file.
6687 (add_input_library): New.
6688 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6689
966d4097
DK
66902009-09-30 Doug Kwan <dougkwan@google.com>
6691
6692 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6693 symbol and call Symbol::may_need_copy_reloc to determine if
6694 a copy reloc is needed.
6695 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6696 nocopyreloc is given in command line.
6697 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6698 given in command line.
6699 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6700 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6701 of the removed Target_i386::may_need_copy_reloc.
6702 * options.h (copyreloc): New option with default value false.
6703 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6704 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6705 instead of the removed Target_powerpc::may_need_copy_reloc.
6706 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6707 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6708 instead of the removed Target_sparc::may_need_copy_reloc.
6709 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6710 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6711 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6712 instead of the removed Target_x86_64::may_need_copy_reloc.
6713
029ba973
ILT
67142009-09-30 Ian Lance Taylor <iant@google.com>
6715
6716 * object.h (class Object): Remove target_ field, and target,
6717 sized_target, and set_target methods.
6718 (Object::sized_target): Remove.
6719 (class Sized_relobj): Update declarations. Remove sized_target.
6720 * object.cc (Sized_relobj::setup): Remove target parameter.
6721 Change all callers.
6722 (Input_objects::add_object): Don't do anything with the target.
6723 (make_elf_sized_object): Add punconfigured parameter. Change all
6724 callers. Set or test parameter target.
6725 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6726 Change all callers.
6727 * parameters.cc (Parameters::set_target): Change parameter type to
6728 be non-const.
6729 (Parameters::default_target): Remove.
6730 (set_parameters_target): Change parameter type to be non-const.
6731 (parameters_force_valid_target): New function.
6732 (parameters_clear_target): New function.
6733 * parameters.h (class Parameters): Update declarations. Remove
6734 default_target method. Add sized_target and clear_target
6735 methods. Change target_ to be non-const.
6736 (set_parameters_target): Update declaration.
6737 (parameters_force_valid_target): Declare.
6738 (parameters_clear_target): Declare.
6739 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6740 as NULL if we aren't searching.
6741 (Add_symbols::run): Don't check for compatible target.
6742 * fileread.cc (Input_file::open_binary): Call
6743 parameters_force_valid_target.
6744 * gold.cc (queue_middle_tasks): Likewise.
6745 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6746 set_target on object.
6747 * dynobj.h (class Sized_dynobj): Update declarations.
6748 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6749 make_elf_object returns NULL.
6750 (Archive::include_member): Don't check whether object target is
6751 compatible.
6752 * output.cc (Output_section::add_input_section): Get target from
6753 parameters.
6754 (Output_section::relax_input_section): Likewise.
6755 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6756 parameters.
6757 (Sized_relobj::do_scan_relocs): Likewise.
6758 (Sized_relobj::relocate_sections): Likewise.
6759 * resolve.cc (Symbol_table::resolve): Likewise.
6760 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6761 parameter. Change all callers.
6762 (Symbol_table::add_from_object): Get target from parameters.
6763 (Symbol_table::add_from_relobj): Don't check object target.
6764 (Symbol_table::add_from_dynobj): Likewise.
6765 (Symbol_table::define_special_symbol): Get target from
6766 parameters.
6767 * symtab.h (class Symbol_table): Update declaration.
6768 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6769 parameter. Change all callers. Clear parameter target.
6770 (Binary_test): Test target here.
6771 * testsuite/object_unittest.cc (gold_testsuite): Remove
6772 target_test_pointer parameter. Change all callers.
6773 (Object_test): Test target here.
6774
a6a22b83
ILT
67752009-09-26 Ian Lance Taylor <iant@google.com>
6776
6777 * testsuite/initpri1.c: Don't try to use constructor priorities if
6778 compiling with gcc before 4.3.
6779
6a8f49fe
ILT
67802009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6781
6782 * testsuite/retain_symbols_file_test.sh (check_present): Change
6783 output file name to retain_symbols_file_test.stdout.
6784 (check_absent): Likewise.
6785
8c604651
CS
67862009-09-18 Craig Silverstein <csilvers@google.com>
6787
6788 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6789 * options.cc: Include <cerrno> and <fstream>.
6790 (General_options::finalize): Parse -retain-symbols-file tag.
6791 * options.h: New flag.
6792 (General_options): New method should_retain_symbol, new
6793 variable symbols_to_retain.
6794 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6795 should_retain_symbol map.
6796 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6797 * testsuite/Makefile.in: Regenerate.
6798 * testsuite/retain_symbols_file_test.sh: New file.
6799
ca58b19f
NC
68002009-09-18 Nick Clifton <nickc@redhat.com>
6801
6802 * po/es.po: Updated Spanish translation.
6803
20e6d0d6
DK
68042009-09-17 Doug Kwan <dougkwan@google.com>
6805
6806 * debug.h (DEBUG_RELAXATION): New constant.
6807 (DEBUG_ALL): Add DEBUG_RELAXATION.
6808 (debug_string_to_enum): Add relaxation debug option.
6809 * layout.cc
6810 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6811 Layout::Relaxation_debug_check::read_sections,
6812 Layout::Relaxation_debug_check::read_sections): New method definitions.
6813 (Layout::Layout): Initialize data members
6814 record_output_section_data_from_scrips_,
6815 script_output_section_data_list_ and relaxation_debug_check_.
6816 (Layout::save_segments, Layout::restore_segments,
6817 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6818 Layout::relaxation_loop_body): New method definitions.
6819 (Layout::finalize): Support relaxation. Move section layout code to
6820 Layout::relaxation_loop_body.
6821 (Layout::set_asection_address_from_script): Move code for orphan
6822 section placement out.
6823 (Layout::place_orphan_sections_in_script): New method definition.
6824 * layout.h (Output_segment_headers, Output_file_header):
6825 New forward class declarations.
6826 (Layout::~Layout): Define.
6827 (Layout::new_output_section_data_from_script): New method definition.
6828 (Layout::place_orphan_sections_in_script): New method declaration.
6829 (Layout::Segment_states): New type declaration.
6830 (Layout::save_segments, Layout::restore_segments,
6831 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6832 Layout::relaxation_loop_body): New method declarations.
6833 (Layout::Output_section_data_list): New type declaration.
6834 (Layout::Relaxation_debug_check): New class definition.
6835 (Layout::record_output_section_data_from_script_,
6836 Layout::script_output_section_data_list_, Layout::segment_states_,
6837 Layout::relaxation_debug_check_): New data members.
6838 * output.cc: (Output_section_headers::do_size): New method definition.
6839 (Output_section_headers::Output_section_headers): Move size
6840 computation to Output_section_headers::do_size.
6841 (Output_segment_headers::do_size): New method definition.
e1df38aa 6842 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6843 Output_file_header::do_size and call it.
6844 (Output_file_header::do_size): New method definition.
6845 (Output_data_group::Output_data_group): Adjust call to
6846 Output_section_data.
6847 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6848 (Output_symtab_xindex::do_write): Add array bound check.
6849 (Output_section::Input_section::print_to_mapfile): Handle
6850 RELAXED_INPUT_SECTION_CODE.
6851 (Output_section::Output_section): Initialize data member checkpoint_.
6852 (Output_section::~Output_section): Delete checkpoint object pointed
6853 by checkpoint_.
6854 (Output_section::add_input_section): Always add an Input_section if
6855 relaxing.
6856 (Output_section::add_merge_input_section): Add assert.
6857 (Output_section::relax_input_section): New method definition.
6858 (Output_section::set_final_data_size): Set load address to zero for
6859 an unallocated section.
6860 (Output_section::do_address_and_file_offset_have_reset_values):
6861 New method definition.
6862 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6863 Handle relaxed input section.
6864 (Output_section::sort_attached_input_sections): Checkpoint input
6865 section list lazily.
6866 (Output_section::get_input_sections): Change type of input_sections to
6867 list of Simple_input_section pointers. Checkpoint input section list
6868 lazily. Also handle relaxed input sections.
6869 (Output_section::add_input_section_for_script): Take a reference to
6870 a Simple_input_section object instead of Relobj pointer and section
6871 index as parameter. Handle relaxed input sections.
6872 (Output_section::save_states, Output_section::restore_states): New
6873 method definitions.
6874 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6875 (Output_data::is_data_size_fixed): New method definition.
6876 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6877 if it is fixed.
6878 (Output_data::address_and_file_offset_have_reset_values): New method
6879 definition.
6880 (Output_data::do_address_and_file_offset_have_reset_values): New method
6881 definition.
6882 (Output_data::set_data_size): Check that data size is not fixed.
6883 (Output_data::fix_data_size): New method definition.
6884 (Output_data::is_data_size_fixed_): New data member.
6885 (Output_section_headers::set_final_data_size): New method definition.
6886 (Output_section_headers::do_size): New method declaration.
6887 (Output_segment_headers::set_final_data_size): New method definition.
6888 (Output_segment_headers::do_size): New method declaration.
6889 (Output_file_header::set_final_data_size)::New method definition.
6890 (Output_file_header::do_size)::New method declaration.
6891 (Output_section_data::Output_section_data): Add new parameter
6892 is_data_size_fixed and use it to fix data size.
6893 (Output_data_const::Output_data_const): Adjust call to base class
6894 constructor and fix data size.
6895 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6896 base class constructor and fix data size.
6897 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6898 base class constructor and fix data size.
6899 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6900 class constructor and fix data size.
6901 (Output_data_group::set_final_data_size): New method definition.
6902 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6903 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6904 class constructor and fix data size.
6905 (Output_relaxed_input_section): New class definition.
6906 (Output_section::Simple_input_section): New class definition.
6907 (Output_section::get_input_sections): Adjust parameter list.
6908 (Output_section::add_input_section_for_script): Same.
6909 (Output_section::save_states, Output_section::restore_states,
6910 Output_section::do_address_and_file_offset_have_reset_values,
6911 (Output_section::Input_section::Input_section): Handle
6912 RELAXED_INPUT_SECTION_CODE. Add new overload for
6913 Output_relaxed_input_section.
6914 (Output_section::Input_section::is_input_section,
6915 Output_section::Input_section::set_output_section): Handle relaxed
6916 input section.
6917 (Output_section::Input_section::is_relaxed_input_section,
6918 Output_section::Input_section::output_section_data,
6919 Output_section::Input_section::relaxed_input_section): New method
6920 definitions.
6921 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6922 value.
6923 (Output_section::Input_section::u1_): Update comments.
6924 (Output_section::Input_section::u2_): Add new union member poris.
6925 (Output_section::Checkpoint_output_section): New classs definition.
6926 (Output_section::relax_input_section): New method declaration.
6927 (Output_section::checkpoint_): New data member.
6928 (Output_segment): Update comments.
6929 (Output_segment::Output_segment): Un-privatize copy constructor.
6930 (Output_segment::operator=): Un-privatize.
6931 * script-sections.cc (Output_section_element::Input_section_list):
6932 Change element type to Output_section::Simple_input_section.
6933 (Output_section_element_dot_assignment::set_section_addresses):
6934 Register output section data for relaxation clean up.
6935 (Output_data_exression::Output_data_expression): Adjust call to base
6936 constructor to fix data size.
6937 (Output_section_element_data::set_section_addresses): Register
6938 Output_data_expression object for relaxation clean up.
6939 (struct Input_section_info): Replace Relobj pointer and section index
6940 pair with Output_section::Simple_input_section and Convert struct to a
6941 class.
6942 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6943 Input_section_info data member to use accessors.
20e6d0d6
DK
6944 (Output_section_element_input::set_section_addresses): Use layout
6945 parameter. Adjust code to use Output_section::Simple_input_section
6946 and Input_secction_info classes. Register filler for relaxation
6947 clean up.
6948 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6949 and section index pair with Output_section::Simple_input_section
6950 class. Adjust code accordingly.
6951 (Phdrs_element::release_segment): New method definition.
6952 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6953 segment list.
6954 (Script_sections::release_segments): New method definition.
6955 * gold/script-sections.h (Script_sections::release_segments): New
6956 method declaration.
6957 * gold/target.h (Target::may_relax, Target::relax,
6958 Target::do_may_relax, Target::do_relax): New method definitions.
6959
5e445df6
ILT
69602009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6961
6962 * arm.cc (has_signed_unsigned_overflow): New function.
6963 (Arm_relocate_functions::abs8): New function.
6964 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6965 (Target_arm::Scan::global): Likewise.
6966 (Target_arm::relocate::relocate): Likewise.
6967 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6968 Likewise.
6969
8c604651 69702009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6971
6972 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6973 * testsuite/Makefile.in: Regenerate.
6974
1e9cc1c2
NC
69752009-09-11 Nick Clifton <nickc@redhat.com>
6976
6977 * po/gold.pot: Updated by the Translation project.
6978
6a89f575
CC
69792009-09-08 Cary Coutant <ccoutant@google.com>
6980
6981 * output.cc (Output_file::open): Add execute permission to empty file.
6982 * testsuite/Makefile.am (permission_test): New test.
6983 * testsuite/Makefile.in: Regenerate.
6984
fdcac5af
ILT
69852009-09-02 Ian Lance Taylor <iant@google.com>
6986
6987 * output.cc (Output_file::resize): Call map_no_anonymous rather
6988 than map.
6989
44453f85
ILT
69902009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6991
6992 * gold.cc: Include "incremental.h".
6993 (queue_initial_tasks): Call Incremental_checker methods.
6994 * incremental.cc: Include "output.h".
6995 (Incremental_checker::can_incrementally_link_output_file): New
6996 method.
6997 * incremental.h (Incremental_checker): New class.
6998
6999 * output.cc (Output_file::open_for_modification): New method.
7000 (Output_file::map_anonymous): Changed return type to bool. Record
7001 map in base_ field.
7002 (Output_file::map_no_anonymous): New method, broken out of map.
7003 (Output_file::map): Use map_no_anonymous and map_anonymous.
7004 * output.h (class Output_file): Update declarations.
7005
293c1386
CC
70062009-08-24 Cary Coutant <ccoutant@google.com>
7007
7008 * options.h (Command_line::Pre_options): New class.
7009 (Command_line::pre_options): New member.
7010 * options.cc (gold::options::ready_to_register): New variable.
7011 (One_option::register_option): Do nothing if not registering options.
7012 Assert if same short option registered twice.
7013 (General_options::General_options): Turn off option registration when
7014 done constructing.
7015 (Command_line::Pre_options::Pre_options): New constructor.
7016
f773f3d2
CC
70172009-08-24 Cary Coutant <ccoutant@google.com>
7018
06a73cfe
CC
7019 * options.h (General_options::no_keep_memory): Remove incorrect
7020 short option.
f773f3d2 7021
a15af8e2
RW
70222009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7023
7024 * Makefile.am (am__skiplex, am__skipyacc): New.
7025 * Makefile.in: Regenerate.
7026
c462b41b
RW
70272009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7028
14ec8efd
RW
7029 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7030 (INCLUDES): ... this.
7031 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7032 (AM_CPPFLAGS): Renamed from ...
7033 (INCLUDE): ... this.
7034 * Makefile.in, testsuite/Makefile.in: Regenerate.
7035
81ecdfbb
RW
7036 * Makefile.in: Regenerate.
7037 * aclocal.m4: Likewise.
7038 * config.in: Likewise.
7039 * configure: Likewise.
7040 * testsuite/Makefile.in: Likewise.
7041
c462b41b
RW
7042 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7043 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7044 * Makefile.in: Regenerate.
7045 * testsuite/Makefile.in: Regenerate.
7046
2da73f13
CC
70472009-08-19 Cary Coutant <ccoutant@google.com>
7048
7049 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7050 symbols in shared libraries overridden by hidden or internal symbols
7051 in the main program.
7052
2db70501
CD
70532009-08-19 Chris Demetriou <cgd@google.com>
7054
7055 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7056 checking source file names in error messages.
7057
f733487b
DK
70582009-08-18 Doug Kwan <dougkwan@google.com>
7059
7060 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7061 an elcpp::Ehdr as parameter. Adjust call to set_target.
7062 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7063 an elfcpp::Ehdr as parameter.
7064 * object.cc (Object::set_target): Remove the version that looks up
7065 a target and sets it.
7066 (Sized_relobj::setup): Take a Target object instead of
7067 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7068 (make_elf_sized_object): Find target and ask target to
7069 make an ELF object.
7070 * object.h: (Object::set_target): Remove the version that looks up
7071 a target and sets it.
7072 (Sized_relobj::setup): Take a Target object instead of
7073 an elfcpp:Ehdr as parameter.
7074 * target.cc: Include dynobj.h.
7075 (Target::do_make_elf_object_implementation): New.
7076 (Target::do_make_elf_object): New.
7077 * target.h (Target::make_elf_object): New template declaration.
7078 (Target::do_make_elf_object): New method declarations.
7079 (Target::do_make_elf_object_implementation): New template declaration.
7080
cc70f101
ILT
70812009-08-14 Ian Lance Taylor <iant@google.com>
7082
7083 * gold.h (FUNCTION_NAME): Define.
7084 (gold_unreachable): Use FUNCTION_NAME.
7085
ef5e0cb1
ST
70862009-08-12 Sriraman Tallam <tmsriram@google.com>
7087
7088 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7089 symbol in the --keep-unique list is not found.
7090
48c187ce
ST
70912009-08-12 Sriraman Tallam <tmsriram@google.com>
7092
7093 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7094 been maked as --keep-unique.
7095 (Icf::unfold_section): New function.
7096 * icf.h (Icf::unfold_section): New function.
7097 * options.h (General_options::keep_unique): New option.
7098 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7099 * testsuite/Makefile.in: Regenerate.
7100 * testsuite/icf_keep_unique_test.sh: New file.
7101 * testsuite/icf_keep_unique_test.cc: New file.
7102
645afe0c
CC
71032009-08-12 Cary Coutant <ccoutant@google.com>
7104
7105 PR 10471
7106 * resolve.cc (Symbol_table::resolve): Check for references from
7107 dynamic objects to hidden and internal symbols.
7108 * testsuite/Makefile.am (hidden_test.sh): New test.
7109 * testsuite/Makefile.in: Regenerate.
7110 * testsuite/hidden_test.sh: New script.
7111 * testsuite/hidden_test_1.c: New test source.
7112 * testsuite/hidden_test_main.c: New test source.
7113
11af873f
DK
71142009-08-11 Doug Kwan <dougkwan@google.com>
7115
7116 * arm.cc: Update comments.
7117 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7118 segment to locate the .ARM.exidx section if present.
7119
b9f7d72d
DK
71202009-08-09 Doug Kwan <dougkwan@google.com>
7121
7122 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7123 patch.
7124
ddd3c53c
ST
71252009-08-07 Sriraman Tallam <tmsriram@google.com>
7126 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7127 compiler warnings.
7128
27721062
ST
71292009-08-06 Sriraman Tallam <tmsriram@google.com>
7130
7131 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7132 valid tls_segment only for non-debug-section relocations.
7133 * testsuite/Makefile.am: Add gc_tls_test.
7134 * testsuite/Makefile.in: Regenerate.
7135 * testsuite/gc_tls_test.cc: New file.
7136 * testsuite/gc_tls_test.sh: New file.
7137
ef15dade 71382009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7139
ef15dade
ST
7140 * icf.cc: New file.
7141 * icf.h: New file.
7142 * Makefile.am (CCFILES): Add icf.cc.
7143 (HFILES): Add icf.h
7144 * Makefile.in: Regenerate.
7145 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7146 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7147 section, symbol and addend information for the relocs.
7148 * gold.cc (queue_middle_tasks): Call identical code folding.
7149 * gold.h: Add defines for multimap.
7150 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7151 to the call of finalize_local_symbols.
7152 * main.cc (main): Create object of class Icf.
7153 * object.cc (Sized_relobj::do_layout): Allow this function to be
7154 called twice during icf.
7155 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7156 to sections marked as identical by icf.
7157 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7158 when available.
7159 (Sized_relobj::do_section_entsize): New function.
7160 * object.h (Object::section_entsize): New function.
7161 (Object::do_section_entsize): New pure virtual function.
7162 (Relobj::finalize_local_symbols): Add new parameter.
7163 (Relobj::do_section_entsize): New function.
7164 * options.h (General_options::icf): New option.
7165 (General_options::icf_iterations): New option.
7166 (General_options::print_icf_sections): New option.
7167 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7168 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7169 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7170 icf.
7171 * symtab.cc (Symbol_table::is_section_folded): New function.
7172 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7173 to sections marked as identical by icf.
7174 * symtab.h (Symbol_table::set_icf): New function.
7175 (Symbol_table::icf): New function.
7176 (Symbol_table::is_section_folded): New function.
7177 (Symbol_table::icf_): New data member.
7178 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7179 * testsuite/Makefile.am: Add commands to build icf_test.
7180 * testsuite/Makefile.in: Regenerate.
7181 * testsuite/icf_test.sh: New file.
7182 * testsuite/icf_test.cc: New file.
7183
c3b65ac4
CD
71842009-07-24 Chris Demetriou <cgd@google.com>
7185
7186 * layout.cc (is_compressible_debug_section): Fix incorrect
7187 comment about compressed section names.
7188
1caf2c51
ILT
71892009-07-20 Ian Lance Taylor <ian@airs.com>
7190
7191 PR 10419
7192 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7193
1ef4d87f
ILT
71942009-07-16 Ian Lance Taylor <iant@google.com>
7195
7196 PR 10400
7197 * layout.h: #include <map>.
7198 (class Kept_section): Change from struct to class. Add accessors
7199 and setters. Add section size to Comdat_group mapping. Change
7200 Comdat_group to std::map. Add is_comdat_ field. Add
7201 linkonce_size field in union.
7202 (class Layout): Update declaration of find_or_add_kept_section.
7203 Don't declare find_kept_object.
7204 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7205 parameter. Add object, shndx, is_comdat, and is_group_name
7206 parameters. Change all callers. Adjust for new Kept_section.
7207 (Layout::find_kept_object): Remove.
7208 * object.cc (Sized_relobj::include_section_group): Update use of
7209 Kept_section. Rename secnum to shndx. Only record
7210 Kept_comdat_section if sections are the same size.
7211 (Sized_relobj::include_linkonce_section): Update use of
7212 Kept_section. Only record Kept_comdat_section if sections are the
7213 same size. Set size of linkonce section.
7214 (Sized_relobj::map_to_kept_section): Update call to
7215 get_kept_comdat_section.
7216 * object.h (class Sized_relobj): Rename fields in
7217 Kept_comdat_section to drop trailing underscores; change object
7218 field to Relobj*. Change Kept_comdat_section_table to store
7219 struct rather than pointer.
7220 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7221 Add kept_object and kept_shndx parameters. Change all callers.
7222 (Sized_relobj::get_kept_comdat_section): Change return type to
7223 bool. Add kept_object and kept_shndx parameters. Change all
7224 callers.
7225 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7226 Layout::find_or_add_kept_section.
7227
37c3b7b0
ILT
72282009-07-09 Ian Lance Taylor <iant@google.com>
7229
7230 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7231 Reserve space in the hash table.
7232
98fa85cb
ILT
72332009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7234
7235 * fileread.cc (File_read::get_mtime): New method.
7236 * fileread.h (Timespec): New structure.
7237 (File_read::get_mtime): New method.
7238 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7239 Renamed from timestamp_nsec.
7240 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7241 Elf_Xword.
e1df38aa 7242 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7243 timestamp_nsec.
e1df38aa 7244 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7245 (Incremental_inputs::report_obejct): Save mtime; style fix.
7246 (Incremental_inputs::report_script): Save mtime; style fix.
7247 (Incremental_inputs::finalize_inputs): Style fix.
7248 (Incremental_inputs::finalize): Style fix.
7249 (Incremental_inputs::create_input_section_data): Store inputs
7250 mtime.
7251 * incremental.h (Incremental_inputs::report_script): Add mtime
7252 argument.
7253 (Incremental_inputs::Input_info::Input_info): Intialize only one
7254 union member.
7255 (Incremental_inputs::Input_info::archive): Move to nameless
7256 union.
7257 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7258 (Incremental_inputs::Input_info::script): Move to nameless union.
7259 (Incremental_inputs::mtime): New field.
7260 * script.cc (read_input_script): Pass file mtime to
7261 Incremental_input.
7262 * script.h (Script_info::inputs): Style fix.
7263
c9d70757
ILT
72642009-07-01 Ian Lance Taylor <ian@airs.com>
7265
7266 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7267 instead of 32.
7268
9c547ec3
ILT
72692009-06-24 Ian Lance Taylor <iant@google.com>
7270
7271 PR 10156
7272 * layout.cc (Layout::choose_output_section): If we find an
7273 existing section, update the flags.
7274 (Layout::create_notes): New function, broken out of
7275 Layout::finalize.
7276 (Layout::finalize): Don't create note sections.
7277 (Layout::create_note): Don't crash if linker script discards
7278 section.
7279 (Layout::create_gold_note): Likewise.
7280 (Layout::create_build_id): Likewise. Don't set
7281 after_input_sections on the section.
7282 (Layout::create_executable_stack_info): Remove target parameter.
7283 Change caller.
7284 * layout.h (class Layout): Declare create_notes. Update
7285 declaration of create_executable_stack_info.
7286 * gold.cc (queue_middle_tasks): Call create_notes.
7287 * output.cc (Output_section::update_flags_for_input_section): Move
7288 here from output.h. If SHF_ALLOC flag is newly set, mark address
7289 invalid.
7290 * output.h (Output_data::mark_address_invalid): New function.
7291 (class Output_section): Only declare, not define,
7292 update_flags_for_input_section. Remove set_flags.
7293
55458500
ILT
72942009-06-24 Ian Lance Taylor <iant@google.com>
7295
7296 * script-sections.cc (Output_section_definition::
7297 set_section_addresses): Rename shadowing local load_address to
7298 laddr.
7299
1307d6cd
ILT
73002009-06-24 Ian Lance Taylor <iant@google.com>
7301
7302 PR 10244
7303 * reloc.cc (relocate_sections): Skip empty relocation sections.
7304
ec3f783e
ILT
73052009-06-23 Ian Lance Taylor <iant@google.com>
7306
7307 PR 10156
7308 * layout.cc (Layout::create_note): Use choose_output_section
7309 rather than make_output_section.
7310
459c9f1c
ILT
73112009-06-23 Ian Lance Taylor <iant@google.com>
7312
7313 PR 10237
7314 * options.cc (General_options::parse_V): Set printed_version_.
7315 (General_options::General_options): Initialize printed_version_.
7316 * options.h (class General_options): Add printed_version_ field.
7317 * gold.cc (queue_initial_tasks): If there are no input files,
7318 don't give a fatal error if we printed the version information.
7319 (queue_middle_tasks): If using -r with a shared object, give a
7320 fatal error rather than an ordinary error.
7321
1518dc8f
ILT
73222009-06-23 Ian Lance Taylor <iant@google.com>
7323
7324 PR 10219
7325 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7326 (Layout::make_output_section): Set have_stabstr_section_ if we see
7327 a .stab*str section.
7328 (Layout::finalize): Call link_stabs_sections.
7329 (Layout::link_stabs_sections): New file.
7330 * layout.h (class Layout): Add have_stabstr_section_ field.
7331 Declare link_stabs_sections.
7332
3d857b98
DK
73332009-06-23 Doug Kwan <dougkwan@google.com>
7334
7335 * Makefile.am (libgold_a_LIBADD): New.
7336 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7337 * Makefile.in: Regenerate.
7338 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7339 * configure: Regenerate.
7340 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7341 * fileread.cc: Include sys/state.h
7342 * gold.h: Declare memmem and strndup if found missing.
7343 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7344
0639a6f6
ILT
73452009-06-23 Ian Lance Taylor <iant@google.com>
7346
7347 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7348 * configure: Rebuild.
7349
8d63875c
ILT
73502009-06-23 Ian Lance Taylor <iant@google.com>
7351
7352 PR 10147
7353 * object.cc (Object::section_contents): Don't try to get a view if
7354 the section has length zero.
7355 (Object::handle_gnu_warning_section): If the section is empty, use
7356 the name of the section as the warning.
7357
f7c8a183
ILT
73582009-06-23 Ian Lance Taylor <iant@google.com>
7359
7360 PR 10133
7361 * stringpool.h (class Stringpool_template): Add optimize_ field.
7362 (Stringpool_template::set_optimize): New function.
7363 * stringpool.cc (Stringpool_template::Stringpool_template):
7364 Initialize optimize_ field.
7365 (Stringpool_template::set_string_offsets): Test local optimize
7366 fild rather than parameter.
7367 * layout.cc (Layout::Layout): Call set_optimize on the section
7368 name stringpool.
7369
e6a307ba
ILT
73702009-06-22 Ian Lance Taylor <iant@google.com>
7371
7372 PR 10030
7373 * yyscript.y: Parse TARGET.
7374 * script.cc (script_set_target): New function.
7375 * script-c.h (script_set_target): Declare.
7376 * options.cc (General_options::string_to_object_format): Rename
7377 from string_to_object_format in anonymous namespace. Change
7378 callers.
7379 * options.h (class General_options): Declare
7380 string_to_object_format.
7381
3ee173de
ILT
73822009-06-22 Ian Lance Taylor <iant@google.com>
7383
7384 * script-sections.cc (Script_sections::create_segments): Don't put
7385 program headers in a PT_LOAD segment if -n or -N.
7386
73872009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7388
7389 PR 10141
7390 * options.h (class General_options): Add -z lazy and -z now. Sort
7391 -z options into alphabetical order.
7392 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7393
cd6739a1 73942009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7395
7396 * layout.cc (Layout::make_output_section): Call
7397 Target::new_output_section.
7398 (Layout::attach_allocated_section_to_segment): Put large section
7399 sections in a separate load segment with the large segment flag
7400 set.
7401 (Layout::segment_precedes): Sort large data segments after other
7402 load segments.
7403 (align_file_offset): New static function.
7404 (Layout::set_segment_offsets): Use align_file_offset.
7405 * output.h (class Output_section): Add is_small_section_ and
7406 is_large_section_ fields.
7407 (Output_section::is_small_section): New function.
7408 (Output_section::set_is_small_section): New function.
7409 (Output_section::is_large_section): New function.
7410 (Output_section::set_is_large_section): New function.
7411 (Output_section::is_large_data_section): New function.
7412 (class Output_segment): Add is_large_data_segment_ field.
7413 (Output_segment::is_large_data_segment): New function.
7414 (Output_segment::set_is_large_data_segment): New function.
7415 * output.cc (Output_section::Output_section): Initialize new
7416 fields.
7417 (Output_segment::Output_segment): Likewise.
7418 (Output_segment::add_output_section): Add assertion that large
7419 data sections always go in large data segments. Force small data
7420 sections to the end of the list of data sections. Force small BSS
7421 sections to the start of the list of BSS sections. For large BSS
7422 sections to the end of the list of BSS sections.
7423 * symtab.h (class Symbol): Declare is_common_shndx.
7424 (Symbol::is_defined): Check Symbol::is_common_shndx.
7425 (Symbol::is_common): Likewise.
7426 (class Symbol_table): Define enum Commons_section_type. Update
7427 declarations. Add small_commons_ and large_commons_ fields.
7428 * symtab.cc (Symbol::is_common_shndx): New function.
7429 (Symbol_table::Symbol_table): Initialize new fields.
7430 (Symbol_table::add_from_object): Put small and large common
7431 symbols in the right list.
7432 (Symbol_table::sized_finalized_symbol): Check
7433 Symbol::is_common_shndx.
7434 (Symbol_table::sized_write_globals): Likewise.
7435 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7436 common symbol lists. Don't call do_allocate_commons_list if the
7437 list is empty.
7438 (Symbol_table::do_allocate_commons_list): Remove is_tls
7439 parameter. Add comons_section_type parameter. Change all
7440 callers. Handle small and large common symbols.
7441 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7442 Symbol::is_common_shndx.
7443 * resolve.cc (symbol_to_bits): Likewise.
7444 * target.h (Target::small_common_shndx): New function.
7445 (Target::small_common_section_flags): New function.
7446 (Target::large_common_shndx): New function.
7447 (Target::large_common_section_flags): New function.
7448 (Target::new_output_section): New function.
7449 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7450 small_common_section_flags, and large_common_section_flags
7451 fields.
7452 (Target::do_new_output_section): New virtual function.
7453 * arm.cc (Target_arm::arm_info): Initialize new fields.
7454 * i386.cc (Target_i386::i386_info): Likewise.
7455 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7456 Likewise.
7457 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7458 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7459 (Target_x86_64::do_new_output_section): New function.
7460 * configure.ac: Define conditional MCMODEL_MEDIUM.
7461 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7462 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7463 (large_LDFLAGS): Define.
7464 * testsuite/large.c: New file.
7465 * testsuite/testfile.cc (Target_test::test_target_info):
7466 Initialize new fields.
7467 * configure, testsuite/Makefile.in: Rebuild.
7468
bb04269c
DK
74692009-06-05 Doug Kwan <dougkwan@google.com>
7470
7471 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7472 * Makefile.in: Regenerate.
bb04269c
DK
7473 * i386.cc (class Target_i386): Define new virtual method to
7474 override do_is_local_label_name in parent.
7475 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7476 local symbols if --discard-locals or -X is given.
7477 * options.h (class General_options): Declare new options
7478 '--discard-locals' and '-X' for discarding locals.
7479 * target.h (class Target): Define new methods is_local_label_name.
7480 Declare new virtual method do_is_local_label_name.
7481 * target.cc: New file.
7482 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7483 (check_SCRIPTS): Add discard_locals_test.sh.
7484 (check_DATA): Add discard_local_tests.syms.
7485 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7486 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7487 * testsuite/Makefile.in: Regenerate.
7488 * testsuite/discard_locals_test.c: New file.
7489 * testsuite/discard_locals_test.sh: Same.
7490
805bb01c
DK
74912009-06-05 Doug Kwan <dougkwan@google.com>
7492
7493 * object.cc (Sized_relobj::Sized_relobj): Initialize
7494 discarded_eh_frame_shndx_ to -1U.
7495 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7496 section.
7497 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7498 a discarded .eh_frame section.
7499 (Sized_relobj::do_finalize_local_symbols): Ditto.
7500 * object.h (class Sized_relobj): Declare new member
7501 discarded_eh_frame_shndx_.
7502 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7503 (local_labels_test.o, local_labels_test): New rules.
7504 * testsuite/Makefile.in: Regenerate.
7505
1dcd334d
DK
75062009-06-04 Doug Kwan <dougkwan@google.com>
7507
7508 * layout.cc (Layout::section_name_mapping): Add mapping for
7509 special ARM sections.
7510
96d49306
DK
75112009-06-03 Doug Kwan <dougkwan@google.com>
7512
7513 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7514 (utils::has_overflow): Same.
7515
dff16297
ILT
75162009-06-03 Ian Lance Taylor <iant@google.com>
7517
7518 * layout.cc (Layout::section_name_mapping): New array, replacing
7519 Layout::linkonce_mapping.
7520 (Layout::section_name_mapping_count): New variable, replacing
7521 Layout::linkonce_mapping_count.
7522 (Layout::linkonce_output_name): Remove.
7523 (Layout::output_section_name): Rewrite.
7524 * layout.h (class Layout): Rename Linkonce_mapping to
7525 Section_name_mapping, linkonce_mapping to section_name_mapping,
7526 linkonce_mapping_count to section_name_mapping_count. Don't
7527 declare linkonce_output_name.
7528
c121c671
DK
75292009-06-03 Doug Kwan <dougkwan@google.com>
7530
7531 * gold/arm.cc (namespace utils): New.
7532 (Target_arm::reloc_is_non_pic): Define new method.
7533 (class Arm_relocate_functions): New.
7534 (Target_arm::Relocate::relocate): Handle relocation types used by
7535 Android.
7536
07800fab
ILT
75372009-06-03 Ian Lance Taylor <iant@google.com>
7538
7539 * arm.cc (Target_arm::scan::global): Use || instead of |.
7540
c121c671
DK
75412009-06-02 Doug Kwan <dougkwan@google.com>
7542
7543 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7544 issued_non_pic_error_.
7545 (class Target_arm::Scan): Declare new method check_non_pic.
7546 Define new method symbol_needs_plt_entry.
7547 Declare new data member issued_non_pic_error_.
7548 (class Target_arm::Relocate): Declare new method
7549 should_apply_static_reloc.
7550 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7551 (Target_arm::Scan::check_non_pic): Define new method.
7552 (Target_arm::Scan::local): Handle a small subset of reloc types used
7553 by Android.
7554 (Target_arm::Scan::local): Same.
7555 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7556
b19b0c6d
ILT
75572009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7558
7559 * incremental.cc (Incremental_inputs::report_command_line): Filter
7560 out --incremental-* options.
7561
94cdfcff
DK
75622009-05-29 Doug Kwan <dougkwan@google.com>
7563
7564 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7565 template class.
7566 (class Target_arm): Update comment.
7567 (Target_arm::Target_arm): Initialize new data members GOT_,
7568 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7569 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7570 and Target_arm::rel_dyn_section.
7571 Declare new_enum Target_arm::Got_type.
7572 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7573 and DYNBSS_.
7574 Update commments for member do_dynsym_value.
7575 (Target_arm::got_size, Target_arm::plt_section,
7576 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7577 new methods inside class defintion.
7578 (Target_arm::got_section): Define new method.
7579 (Target_arm::rel_dyn_section): Same.
7580 (Output_data_plt_arm): New template class.
7581 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7582 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7583 (Output_data_plt_arm::add_entry): Same.
7584 (Output_data_plt_arm::first_plt_entry): Define new
7585 static data member for PLT instruction template.
7586 (Output_data_plt_arm::plt_entry): Same.
7587 (Output_data_plt_arm::do_write): Define new method.
7588 (Target_arm::make_plt_entry): Same.
7589 (Target_arm::do_finalize_sections): Same.
7590 (Target_arm::do_dynsym_value): Same.
7591
4a657b0d
DK
75922009-05-28 Doug Kwan <dougkwan@google.com>
7593
7594 * Makefile.am (TARGETSOURCES): Add arm.cc.
7595 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7596 * Makefile.in: Regenerate.
7597 * arm.cc: New file.
7598 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7599
e7ae8c36
DK
76002009-05-26 Doug Kwan <dougkwan@google.com>
7601
7602 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7603 (General_options::check_excluded_libs): Strip off directories in
7604 archive name before matching like GNU ld does.
7605 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7606 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7607 (exclude_libs_test_LDFLAGS): Add linker option
7608 -Wl,--exclude-libs,libexclude_libs_test_3
7609 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7610 an explicit archive without using -l.
7611 (alt/libexclude_libs_test_3.a): New make rule.
7612 * testsuite/Makefile.in: Regenerate.
7613 * testsuite/exclude_libs_test.c : Declare lib3_default().
7614 (main): Call it.
7615 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7616 * exclude_libs_test_3.c: New file.
7617
f12e7348
NC
76182009-05-26 Nick Clifton <nickc@redhat.com>
7619
7620 * po/id.po: New Indonesian translation.
7621 * po/gold.pot: Updated template file.
7622
4daadc0d
ST
76232009-05-22 Sriraman Tallam <tmsriram@google.com>
7624
e1df38aa 7625 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7626 gc_comdat_test files. Add -Wl,--gc-sections to build
7627 gc_comdat_test.
7628 * testsuite/Makefile.in: Regenerate.
7629 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7630
531813ad
ST
76312009-05-21 Sriraman Tallam <tmsriram@google.com>
7632
7633 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7634 kept comdat section was garbage collected.
7635 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7636 * testsuite/Makefile.in: Regenerate.
7637 * testsuite/gc_comdat_test.sh: New file.
7638 * testsuite/gc_comdat_test_1.cc: New file.
7639 * testsuite/gc_comdat_test_2.cc: New file.
7640
65514900
CC
76412009-05-19 Doug Kwan <dougkwan@google.com>
7642
7643 * archive.cc (Archive::Archive): Move constructor from archive.h
7644 to here. Initialize no_export_.
7645 (Archive::get_elf_object_for_member): Set no_export flag of object.
7646 * archive.h (Archive::Archive): Move constructor body to
7647 archive.cc.
7648 (Archive::no_export): New method.
7649 (Archive::no_export_): New field.
7650 * object.h (Object::Object): Initialize no_export_ to false.
7651 (Object::no_export, Object::set_no_export): New methods.
7652 (Object::no_export_): New field.
7653 * options.cc (General_options::parse_exclude_libs): New method.
7654 (General_options::check_excluded_libs) Same.
7655 * options.h (exclude_libs): New option.
7656 (General_options::check_excluded_libs): New method declaration.
7657 (General_options::excluded_libs_): New field.
7658 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7659 default or protected visibility if an object has no-export flag set.
7660 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7661 (check_SCRIPTS): Add exclude_libs_test.sh.
7662 (check_DATA): Add exclude_libs_test.syms.
7663 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7664 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7665 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7666 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7667 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7668 libexclude_libs_test_2.a): New rules.
7669 * testsuite/Makefile.in: Regenerate.
7670 * testsuite/exclude_libs_test.c: New file.
7671 * testsuite/exclude_libs_test.sh: Ditto.
7672 * testsuite/exclude_libs_test_1.c: Ditto.
7673 * testsuite/exclude_libs_test_2.c: Ditto.
7674
1b77ea50
ILT
76752009-05-15 Ian Lance Taylor <iant@google.com>
7676
7677 * configure.ac: Check for declarations for cases where libiberty.h
7678 checks HAVE_DECL_xxx.
7679 * configure, config.in: Rebuild.
7680
072fe7ce
ILT
76812009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7682
7683 * gold.h (Incremental_argument_list): Remove (invalid) forward
7684 declaration.
7685 * incremental.cc (Incremental_inputs::report_achive): New method.
7686 (Incremental_inputs::report_object): New method.
7687 (Incremental_inputs::report_script): New method.
7688 (Incremental_inputs::finalize_inputs): New method.
7689 (Incremental_inputs::finalize): Call finalize_inputs().
7690 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7691 Create inputs entries.
7692 * incremental.h (Incremental_input_type): New enum.
7693 (Incremental_inputs::Incremental_input): Initialize new fields.
7694 (Incremental_inputs::report_inputs): New method.
7695 (Incremental_inputs::report_achive): New method.
7696 (Incremental_inputs::report_object): New method.
7697 (Incremental_inputs::report_script): New method.
7698 (Incremental_inputs::finalize_inputs): New method.
7699 (Incremental_inputs::Input_info): New struct.
7700 (Incremental_inputs::Input_info_map): New typedef.
7701 (Incremental_inputs::lock_): New field.
7702 (Incremental_inputs::Inputs_): New field.
7703 (Incremental_inputs::Inputs_map): New field.
7704 * main.cc (main): Call Incremental_input::report_inputs.
7705 * options.h (Input_argument_list): Typedef moved from
7706 Input_arguments.
7707 (Input_file_group::Files): Remove, use ::Input_argument_list.
7708 (Input_file_group::Input_argument_list): Remove, use
7709 ::Input_argument_list.
7710 * plugin.cc (Plugin_manager::add_input_file): Add error in
7711 incremental build.
7712 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7713 functions.
7714 * script.cc (read_input_script): Call
7715 Incremental_input::report_script.
7716 * script.h (Script_info): New class.
7717
b0481b0b
ILT
77182009-04-27 Ian Lance Taylor <iant@google.com>
7719
7720 * x86_64.cc (do_adjust_output_section): Set entsize to
7721 plt_entry_size.
7722
b22a5a41 77232009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7724
7725 * output.cc (Output_file::close): After short writes, continue
7726 writing from the correct offset in the buffer being written.
7727
40fde488
CD
77282009-04-23 Chris Demetriou <cgd@google.com>
7729
7730 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7731 * configure: Regenerate.
7732 * config.in: Regenerate.
7733 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7734 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7735
3ce2c28e
ILT
77362009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7737
7738 * incremental.cc (Incremental_inputs_header_data): Renamed from
7739 Incremental_input_header_data.
7740 (Incremental_inputs_header_data::data_size): New field.
7741 (Incremental_inputs_header_data::put_input_file_count): Renamed
7742 from input_file_count.
7743 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7744 from command_line_offset.
7745 (Incremental_inputs_header_data::put_reserved): Renamed from
7746 put_reserved.
7747 (Incremental_inputs_entry_data): Renamed from
7748 Incremental_input_entry_data.
7749 (Incremental_inputs_entry_data::data_size): New field.
7750 (Incremental_inputs::report_command_line): New method.
7751 (Incremental_inputs::finalize): New method.
7752 (Incremental_inputs::create_incremental_inputs_data): New method.
7753 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7754 * incremental.h: New file.
7755 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7756 (Layout::finalize): Create incremental inputs section in
7757 incremental builds.
7758 (Layout::create_incremental_info_sections): New method.
7759 * layout.h (Layout::incremental_inputs): New method.
7760 (Layout::create_incremental_info_sections): New method.
7761 (Layout::incremental_inputs_): New field.
7762 * main.cc (main): Notify Incremental_input of the command line.
7763
e55bde5e
ILT
77642009-04-01 Ian Lance Taylor <iant@google.com>
7765 Mikolaj Zalewski <mikolajz@google.com>
7766
7767 * gold.h (reserve_unordered_map): Define, three versions, one for
7768 each version of Unordered_map.
7769 * layout.cc (Layout::Layout): Remove options parameter. Add
7770 number_of_input_files parameter. Don't initialize options_.
7771 Initialize number_of_input_files_ and resized_signatures_. Move
7772 sections_are_attached_.
7773 (Layout::layout_group): Reserve space for group_signatures_.
7774 (Layout::find_or_add_kept_section): Change name parameter to be a
7775 reference. Resize signatures_ map when it gets large enough.
7776 (Layout::layout_eh_frame): Use parameters->options() instead of
7777 this->options_.
7778 (Layout::make_output_section): Likewise.
7779 (Layout::attach_allocated_section_to_segment): Likewise.
7780 (Layout::finalize, Layout::create_executable_stack): Likewise.
7781 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7782 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7783 * layout.h (class Layout): Update declarations. Remove options_
7784 field. Add number_of_input_files_ and resized_signatures_
7785 fields. Move sections_are_attached_ field.
7786 * main.cc (main): Pass number of input files to Layout
7787 constructor. Don't pass options.
7788
154b857c
ILT
77892009-03-30 Ian Lance Taylor <iant@google.com>
7790
7791 * ffsll.c (ffsll): Correct implementation.
7792
2f35ab9b
ILT
77932009-03-27 Ian Lance Taylor <iant@google.com>
7794
fd03461a
ILT
7795 * ffsll.c: New file.
7796 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7797 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7798 * ftruncate.c (ftruncate): Declare before definition.
7799 * mremap.c (mremap): Likewise.
7800 * pread.c (pread): Likewise.
7801 * configure, Makefile.in, config.in: Rebuild.
7802
2f35ab9b
ILT
7803 * mremap.c: New file.
7804 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7805 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7806 (mremap): Declare if HAVE_MREMAP is not defined.
7807 * configure, Makefile.in, config.in: Rebuild.
7808
33aea2fd
CC
78092009-03-27 Cary Coutant <ccoutant@google.com>
7810
7811 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7812 position independent.
7813 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7814 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7815
6d479619
CC
78162009-03-24 Cary Coutant <ccoutant@google.com>
7817
7818 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7819 an executable.
7820 (needs_dynamic_reloc): Likewise.
7821
afc06bb8
ILT
78222009-03-24 Ian Lance Taylor <iant@google.com>
7823
7824 * yyscript.y (file_cmd): Recognize EXTERN.
7825 (extern_name_list, extern_name_list_body): New nonterminals.
7826 * script.cc (script_add_extern): Define.
7827 * script-c.h (script_add_extern): Declare.
7828
f6060a4d
ILT
78292009-03-24 Rafael Avila de Espindola <espindola@google.com>
7830
7831 * object.cc (is_elf_object): Define.
7832 * object.h (is_elf_object): Declare.
7833 * archive.cc (Archive::get_elf_object_for_member): Call
7834 is_elf_object.
33aea2fd 7835 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7836
26736d8e
ILT
78372009-03-24 Elliott Hughes <enh@google.com>
7838
7839 * output.cc (Output_file::map_anonymous): Define.
7840 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7841 try an anonymous one. Report the size if the mmap fails.
7842 * output.h (class Output_file): Declare map_anonymous.
7843
22fd9730
ILT
78442009-03-24 Ian Lance Taylor <iant@google.com>
7845
7846 * target-select.cc (instantiate_target): Don't acquire the lock if
7847 the instantiated_target_ field has already been set.
7848
cb010894
ILT
78492009-03-23 Ian Lance Taylor <iant@google.com>
7850
7f055c20
ILT
7851 * gold-threads.h (class Initialize_lock): Define.
7852 * gold-threads.cc (class Initialize_lock_once): Define.
7853 (initialize_lock_control): New static variable.
7854 (initialize_lock_pointer): New static variable.
7855 (initialize_lock_once): New static function.
7856 (Initialize_lock::Initialize_lock): Define.
7857 (Initialize_lock::initialize): Define.
7858 * target-select.h: Include "gold-threads.h".
7859 (class Target_selector): Add lock_ and initialize_lock_ fields.
7860 Don't define instantiate_target, just declare it.
7861 * target-select.cc (Target_selector::Target_selector): Initialize
7862 new fields.
7863 (Target_selector::instantiate_target): Define.
7864 * descriptors.h: Include "gold-threads.h".
7865 (class Descriptors): Add initialize_lock_ field.
7866 * descriptors.cc (Descriptors::Descriptors): Initialize new
7867 field.
7868 (Descriptors::open): Use initialize_lock_ field
7869 * errors.h (class Errors): Add initialize_lock_ field.
7870 * errors.cc (Errors::Errors): Initialize new field.
7871 (Errors::initialize_lock): Use initialize_lock_ field.
7872 * powerpc.cc (class Target_selector_powerpc): Remove
7873 instantiated_target_ field. In do_recognize call
7874 instantiate_target rather than do_instantiate_target. In
7875 do_instantiate_target just allocate a new target.
7876 * sparc.cc (class Target_selector_sparc): Likewise.
7877
36959681
ILT
7878 * freebsd.h: New file.
7879 * i386.cc: Include "freebsd.h".
7880 (Target_i386): Derive from Target_freebsd rather than
7881 Sized_target.
7882 (Target_selector_i386): Derive from Target_selector_freebsd rather
7883 than Target_selector.
7884 * x86_64.cc: Include "freebsd.h".
7885 (Target_x86_64): Derive from Target_freebsd rather than
7886 Sized_target.
7887 (Target_selector_x86_64): Derive from Target_selector_freebsd
7888 rather than Target_selector.
7889 * target.h (class Target): Add adjust_elf_header and
7890 do_adjust_elf_header.
7891 * output.cc (Output_file_header:: do_sized_write): Call target
7892 adjust_elf_header routine.
7893 * configure.tgt: Set targ_osabi.
7894 * configure.ac: Define GOLD_DEFAULT_OSABI.
7895 * parameters.cc (Parameters::default_target): Pass
7896 GOLD_DEFAULT_OSABI to select_target.
7897 * target-select.h (class Target_selector): Make instantiate_target
7898 protected rather than private.
7899 * Makefile.am (HFILES): Add freebsd.h.
7900 * configure, Makefile.in, config.in: Rebuild.
7901
cb010894
ILT
7902 * merge.cc (do_add_input_section): Correct pend value. Change
7903 message about last entry not being null terminated from error to
7904 warning.
7905
0e879927
ILT
79062009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7907
7908 * incremental.cc: New file.
7909 * Makefile.am (CCFILES): Add incremental.cc.
7910 * Makefile.in: Rebuild.
7911
41105937
PP
79122009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7913
7914 * layout.cc (Layout::output_section_name): Preserve names
7915 of '.note.' sections.
e1df38aa 7916
60439920
ILT
79172009-03-19 Ian Lance Taylor <iant@google.com>
7918
7919 * descriptors.cc (Descriptors::open): Check that the options are
7920 valid before using them.
7921
0d371ad3
ILT
79222009-03-18 Ian Lance Taylor <iant@google.com>
7923
7924 * script-sections.h: Include <list>.
7925 (class Script_sections): Change Sections_elements from std::vector
7926 to std::list. Typedef public Elements_iterator. Add
7927 orphan_section_placement_, data_segment_align_start_, and
7928 saw_data_segment_align_ fields. Remove data_segment_align_index_
7929 field.
7930 * script-sections.cc (class Orphan_section_placement): New class.
7931 (class Sections_element): Add virtual functions is_relro and
7932 orphan_section_init. Remove virtual function place_orphan_here.
7933 (class Output_section_definition): Add is_relro and
7934 orphan_section_init. Remove place_orphan_here.
7935 (class Orphan_output_section): Likewise.
7936 (Script_sections::Script_sections): Update for field changes.
7937 (Script_sections::data_segment_align): Set saw_data_segment_align_
7938 and data_segment_align_start_, not data_segment_align_index.
7939 (Script_sections::data_segment_relro_end): Check
7940 saw_data_segment_align_. Use data_segment_align_start_ rather
7941 than data_segment_align_index_.
7942 (Script_sections::place_orphan): Rewrite to use
7943 Orphan_section_placement.
7944
9201d894
ILT
79452009-03-17 Ian Lance Taylor <iant@google.com>
7946
9c5b8369
ILT
7947 * archive.cc (Archive::add_symbols): Check for a version attached
7948 to the symbol name in the archive map.
7949 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7950 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7951 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7952 (ver_test_11.a): New target.
7953 * testsuite/Makefile.in: Rebuild.
7954
9201d894
ILT
7955 * configure.ac: Check for chsize and posix_fallocate. Replace
7956 ftruncate.
7957 * ftruncate.c: New file, from gnulib.
7958 * output.cc (posix_fallocate): Define dummy version if not
7959 HAVE_POSIX_FALLOCATE.
7960 (Output_file::map): Call posix_fallocate rather than lseek and
7961 write.
7962 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7963 * configure, Makefile.in, config.in: Rebuild.
7964
ef4ab7a8 79652009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7966
ef4ab7a8
PP
7967 * layout.h (Layout::create_note): Add section_name parameter.
7968 * layout.cc (Layout::create_note): Likewise.
7969 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7970
8c500701
ILT
79712009-03-17 Ian Lance Taylor <iant@google.com>
7972
e85b18e1
ILT
7973 * descriptors.cc: Include "options.h".
7974 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7975 (Descriptors::open): Always use O_CLOEXEC when opening a new
7976 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7977 then set FD_CLOEXEC.
7978
9efe6174
ILT
7979 * sparc.cc (class Target_sparc): Add has_got_section.
7980 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7981 make sure we have a GOT section.
7982
7983 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7984 (Target_sparc::Scan::local): Likewise.
7985 (Target_sparc::Scan::global): Likewise.
7986 (Target_sparc::Relocate::relocate): Likewise.
7987 (Target_sparc::Relocate::relocate_tls): Likewise.
7988
8c500701
ILT
7989 * symtab.cc (Symbol_table::define_default_version): New function,
7990 broken out of add_from_object.
7991 (Symbol_table::add_from_object): Call define_default_version.
7992 (Symbol_table::define_special_symbol): Add resolve_oldsym
7993 parameter. Change all callers. If the version for a symbol comes
7994 from a version script, resolve it with the symbol with the same
7995 name with no version. Also add the symbol without a version if
7996 appropriate.
7997 (do_define_in_output_data): If resolving with oldsym, don't delete
7998 sym.
7999 (do_define_in_output_segment): Likewise.
8000 (do_define_as_constant): Likewise.
8001 * symtab.h (class Symbol_table): Update declarations.
8002
f1ed28fb
ILT
80032009-03-13 Ian Lance Taylor <iant@google.com>
8004
15f8229b
ILT
8005 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8006 (Read_symbols::requeue): New function.
8007 (Read_symbols::do_read_symbols): If make_elf_object fails because
8008 the target type is not configured, and the file was searched for,
8009 issue a warning and retry with the next directory.
8010 (Add_symbols::run): If the file has an incompatible format, and
8011 it was searched for, requeue the Read_symbols task. On error,
8012 release the object.
8013 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8014 dirindex parameter to constructor. Change all callers. Declare
8015 incompatible_warning and requeue.
8016 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8017 input_argument_ and input_group_ fields. Add them to
8018 constructor. Change all callers.
8019 (class Read_script): Add dirindex_ field. Add it to constructor.
8020 Change all callers.
8021 * archive.cc (Archive::setup): Remove input_objects parameter.
8022 Change all callers.
8023 (Archive::get_file_and_offset): Likewise.
8024 (Archive::read_all_symbols): Likewise.
8025 (Archive::read_symbols): Likewise.
8026 (Archive::get_elf_object_for_member): Remove input_objects
8027 parameter. Add punconfigured parameter. Change all callers.
8028 (Archive::add_symbols): Change return type to bool. Check return
8029 value of include_member.
8030 (Archive::include_all_members): Likewise.
8031 (Archive::include_member): Change return type to bool. Return
8032 false if first included object has incompatible target. Set
8033 included_member_ field.
8034 (Add_archive_symbols::run): If add_symbols returns false, requeue
8035 Read_symbols task.
8036 * archive.h (class Archive): Add included_member_ field.
8037 Initialize it in constructor. Add input_file and searched_for
8038 methods. Update declarations.
8039 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8040 input_argument_ fields. Add them to constructor. Change all
8041 callers.
8042 * script.cc: Include "target-select.h".
8043 (class Parser_closure): Add skip_on_incompatible_target_ and
8044 found_incompatible_target_ fields. Add
8045 skip_on_incompatible_target parameter to constructor. Change all
8046 callers. Add methods skip_on_incompatible_target,
8047 clear_skip_on_incompatible_target, found_incompatible_target, and
8048 set_found_incompatible_target.
8049 (read_input_script): Add dirindex parameter. Change all callers.
8050 If parser finds an incompatible target, requeue Read_symbols
8051 task.
8052 (script_set_symbol): Clear skip_on_incompatible_target in
8053 closure.
8054 (script_add_assertion, script_parse_option): Likewise.
8055 (script_start_sections, script_add_phdr): Likewise.
8056 (script_check_output_format): New function.
8057 * script.h (read_input_script): Update declaration.
8058 * script-c.h (script_check_output_format): Declare.
8059 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8060 (ignore_cmd): Remove OUTPUT_FORMAT.
8061 * fileread.cc (Input_file::Input_file): Add explicit this.
8062 (Input_file::will_search_for): New function.
8063 (Input_file::open): Add pindex parameter. Change all callers.
8064 * fileread.h (class Input_file): Add input_file_argument method.
8065 Declare will_search_for. Update declarations.
8066 * object.cc (make_elf_object): Add punconfigured parameter.
8067 Change all callers.
8068 * object.h (class Object): Make input_file public. Add
8069 searched_for method.
8070 (make_elf_object): Update declaration.
8071 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8072 restart search.
8073 * dirsearch.h (class Dirsearch): Update declaration.
8074 * options.h (class General_options): Add --warn-search-mismatch.
8075 * parameters.cc (Parameters::is_compatible_target): New function.
8076 * parameters.h (class Parameters): Declare is_compatible_target.
8077 * workqueue.cc (Workqueue::add_blocker): New function.
8078 * workqueue.h (class Workqueue): Declare add_blocker.
8079
f1ed28fb
ILT
8080 * fileread.cc (Input_file::open): Remove options parameter.
8081 Change all callers.
8082 (Input_file::open_binary): Likewise.
8083 * script.cc (read_input_script): Likewise.
8084 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8085 options parameter from constructor. Change all callers.
8086 (class Read_script): Likewise.
8087 * fileread.h (class Input_file): Update declarations.
8088 * script.h (read_input_script): Update declaration.
8089
34dd024a
NC
80902009-03-10 Nick Clifton <nickc@redhat.com>
8091
8092 * po/es.po: New Spanish translation.
8093
6d71b17c
CC
80942009-03-06 Cary Coutant <ccoutant@google.com>
8095
8096 * options.cc (parse_short_option): Keep dash_z from registering itself.
8097
031cdbed
ILT
80982009-03-03 Ian Lance Taylor <iant@google.com>
8099
8100 PR 9918
8101 * target-reloc.h (relocate_section): Pass output_section to
8102 relocate.
8103 * i386.cc (Target_i386::should_apply_static_reloc): Add
8104 output_section parameter. Change all callers.
8105 (Target_i386::Relocate::relocate): Add output_section parameter.
8106 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8107 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8108 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8109 * testsuite/two_file_shared.sh: New script.
8110 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8111 (check_DATA): Add two_file_shared.dbg.
8112 (two_file_shared.dbg): New target.
8113 * testsuite/Makefile.in: Rebuild.
8114
15d5fa16
ILT
81152009-03-01 Ian Lance Taylor <iant@google.com>
8116
8117 * configure.ac: Check for byteswap.h.
8118 * configure: Rebuild.
8119 * config.in: Rebuild.
8120
8a4c0b0d
ILT
81212009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8122
8123 * layout.cc (Layout::find_or_add_kept_section): New function.
8124 (Layout::add_comdat): Removed.
8125 * layout.h (struct Kept_section): Move out of class Layout.
8126 Remove trailing underscores from field names. Add group_sections
8127 field. Rename group_ field to is_group. Change all uses.
8128 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8129 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8130 comdat_groups_ field.
8131 (Sized_relobj::include_section_group): Use
8132 find_or_add_kept_section and Kept_section::group_sections.
8133 (Sized_relobj::include_linkonce_section): Likewise.
8134 * object.cc (class Sized_relobj): Don't define Comdat_group or
8135 Comdat_group_table. Remove find_comdat_group and
8136 add_comdat_group. Remove comdat_groups_ field.
8137 * plugin.cc (include_comdat_group): Use
8138 Layout::find_or_add_kept_section.
8139
b4ecf66b
ILT
81402009-02-28 Ian Lance Taylor <iant@google.com>
8141
14359ca0
ILT
8142 * README: --gc-sections and map files are now supported. Document
8143 some build requirements.
8144
b4ecf66b
ILT
8145 PR 6992
8146 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8147 relocatable link set the value of the section symbol to zero.
8148 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8149 relocatable link don't include the section address in the local
8150 symbol value.
8151
0602e05a
ILT
81522009-02-27 Ian Lance Taylor <iant@google.com>
8153
fd9d194f
ILT
8154 PR 6811
8155 * options.h (class Search_directory): Add is_system_directory.
8156 (class General_options): Declare is_in_system_directory.
8157 * options.cc (get_relative_sysroot): Make static.
8158 (get_default_sysroot): Make static.
8159 (General_optoins::is_in_system_directory): New function.
8160 * fileread.cc (Input_file::is_in_system_directory): New function.
8161 * fileread.h (class Input_file): Declare is_in_system_directory.
8162 * object.h (class Object): Add is_in_system_directory.
8163 (class Input_objects): Remove system_library_directory_ field.
8164 * object.cc (Input_objects::add_object): Don't set
8165 system_library_directory_.
8166 (input_objects::found_in_system_library_directory): Remove.
8167 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8168 parameter. Change all callers.
8169 (Symbol_table::sized_write_globals): Likewise.
8170 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8171 Call Object::is_in_system_directory.
8172 * symtab.h (class Symbol_table): Update declarations.
8173
61edd21f
ILT
8174 PR 5990
8175 * descriptors.h (Open_descriptor): Add is_on_stack field.
8176 * descriptors.cc (Descriptors::open): If the descriptor is on the
8177 top of the stack, remove it. Initialize is_on_stack field.
8178 (Descriptors::release): Only add pod to stack if it is not on the
8179 stack already.
8180 (Descriptors::close_some_descriptor): Clear stack_next and
8181 is_on_stack fields.
8182
e29e076a
ILT
8183 PR 7091
8184 * output.cc (Output_section::find_starting_output_address): Rename
8185 from starting_output_address; add PADDR parameter; change return
8186 type.
8187 * output.h (class Output_section): Declare
8188 find_starting_output_address instead of starting_output_address.
8189 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8190 section symbol for which we can't find a merge section.
8191
0602e05a
ILT
8192 PR 9836
8193 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8194 hidden or internal, force the symbol to be local.
8195 * resolve.cc (Symbol::override_visibility): Define.
8196 (Symbol::override_base): Use override_visibility.
8197 (Symbol_table::resolve): Likewise.
8198 (Symbol::override_base_with_special): Likewise.
8199 (Symbol_table::override_with_special): If the visibility is hidden
8200 or internal, force the symbol to be local.
8201 * symtab.h (class Symbol): Add set_visibility and
8202 override_visibility.
8203 * testsuite/ver_test_1.sh: New file.
8204 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8205 (check_DATA): Add ver_test_1.syms.
8206 (ver_test_1.syms): New target.
8207 * testsuite/Makefile.in: Rebuild.
8208
401a9a73
CC
82092009-02-25 Cary Coutant <ccoutant@google.com>
8210
8211 * layout.cc (Layout::choose_output_section): Don't rename sections
8212 when using a linker script that has a SECTIONS clause.
8213 * Makefile.in: Regenerate.
8214
8215 * testsuite/Makefile.am (script_test_5.sh): New test case.
8216 * testsuite/Makefile.in: Regenerate.
8217 * testsuite/script_test_5.cc: New file.
8218 * testsuite/script_test_5.sh: New file.
8219 * testsuite/script_test_5.t: New file.
8220
f488e4b0
CC
82212009-02-13 Rafael Avila de Espindola <espindola@google.com>
8222
8223 * archive.cc (Archive::include_member): Update calls to add_symbols.
8224 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8225 the Layout argument.
8226 * dynobj.h (do_add_symbols): Add the Layout argument.
8227 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8228 Layout argument.
8229 * object.h (Object::add_symbols): Add the Layout argument.
8230 (Object::do_add_symbols): Add the Layout argument.
8231 (Sized_relobj::do_add_symbols): Add the Layout argument.
8232 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8233 Unify the two versions.
8234 (Add_plugin_symbols): Remove.
8235 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8236 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8237 (Add_plugin_symbols): Remove.
8238 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8239 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8240 (Add_symbols::run): Make it work with Pulginobj.
8241
89dd1680
ILT
82422009-02-06 Ian Lance Taylor <iant@google.com>
8243
8244 * object.cc (Sized_relobj::do_layout): Make info message start
8245 with lower case letter.
8246
266d0a74
ILT
82472009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8248
602b464e
ILT
8249 * binary.cc: Fix file comment.
8250
266d0a74
ILT
8251 * options.h (enum Incremental_disposition): Define.
8252 (class General_options): Add new options: --incremental,
8253 --incremental_changed, --incremental_unchanged,
8254 --incremental_unknown. Add incremental_disposition_ and
8255 implicit_incremental_ fields.
8256 (General_options::incremental_disposition): New function.
8257 (class Position_dependent_options): Add incremental_disposition
8258 option.
8259 (Position_dependent_options::copy_from_options): Set incremental
8260 dispositions.
8261 * options.cc (General_options::parse_incremental_changed): New
8262 function.
8263 (General_options::parse_incremental_unchanged): New function.
8264 (General_options::parse_incremental_unknown): New function.
8265 (General_options::General_options): Initialize new fields
8266 incremental_disposition_ and implicit_incremental_.
8267 (General_options::finalize): Check for uasge of --incremental-*
8268 without --incremental.
8269
f073bbf7
CD
82702009-02-06 Chris Demetriou <cgd@google.com>
8271
8272 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8273 pointer and to report location as the file name associated with
8274 the symbol.
8275 (gold_undefined_symbol_at_location): New function to replace the
8276 old gold_undefined_symbol functionality.
8277 * target-reloc.h (relocate_section): Update to use
8278 gold_undefined_symbol_at_location.
8279 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8280 Call gold_undefined_symbol function rather than gold_error.
8281 * errors.h (Errors::undefined_symbol): Take location as a
8282 string, rather than calculating it from a relocation.
8283 * errors.cc (Errors::fatal): Print "fatal error:" before the
8284 formatted message.
8285 (Errors::error, Errors::error_at_location): Print "error: "
8286 before the formatted message.
8287 (Errors::undefined_symbol): Take location as a string, rather
8288 than calculating it from a relocation.
8289 (gold_undefined_symbol_at_location): New function akin to
8290 old gold_undefined_symbol, calculates location from relocation.
8291 (gold_undefined_symbol): Change to take only a Symbol pointer
8292 and to report location as the file name associated with the symbol.
8293 * testsuite/debug_msg.sh: Update for changed error messages.
8294 * testsuite/undef_symbol.sh: Likewise.
8295
8e94a90c
ILT
82962009-02-04 Duncan Sands <baldrick@free.fr>
8297
8298 PR 9812
8299 * reduced_debug_output.h
8300 (Output_reduced_debug_abbrev_section::failed): Use format for
8301 gold_warning.
8302 (Output_reduced_debug_info_section::faild): Likewise.
8303
88a0e15b
ILT
83042009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8305
8306 * script.cc (Lazy_demangler): New class.
8307 (Version_script_info::get_symbol_version_helper): Demangle a
8308 symbol only once.
8309
5efc7cd2
CC
83102009-01-29 Cary Coutant <ccoutant@google.com>
8311
8312 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8313 to __tls_get_addr.
8314 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8315
e0ebcf42
ILT
83162009-01-28 Ian Lance Taylor <iant@google.com>
8317
5efc7cd2 8318 * version.cc (version_string): Bump to 1.9.
75fe7426 8319
e0ebcf42
ILT
8320 * gold.h: Include <cstring> and <stdint.h>.
8321 * version.cc: Include <cstdio>.
8322 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8323 warning.
8324 * reduced_debug_output.cc (insert_into_vector): Rename from
8325 Insert_into_vector; change all callers. Use Swap_unaligned to
8326 avoid aliasing issue; remove union since it is unnecessary.
8327
8e2813be 83282009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8329
8330 * Makefile.am (CCFILES): Add gc.cc.
8331 (HFILES): Add gc.h.
8332 * Makefile.in: Regenerate.
8333 * gold.cc (Gc_runner): New class.
8334 (queue_initial_tasks): Call garbage collection related tasks
8335 when corresponding options are invoked.
8336 (queue_middle_gc_tasks): New function.
8337 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8338 processed early before laying out sections during garbage collection.
8339 * gold.h (queue_middle_gc_tasks): New function.
8340 (is_prefix_of): Move from "layout.cc".
8341 * i386.cc (Target_i386::gc_process_relocs): New function.
8342 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8343 * main.cc (main): Create object of class "Garbage_collection".
8344 * object.cc (Relobj::copy_symbols_data): New function.
8345 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8346 (Sized_relobj::do_layout): Allow this function to be called twice
8347 during garbage collection and defer layout of section during the
6d03d481
ST
8348 first call.
8349 * object.h (Relobj::get_symbols_data): New function.
8350 (Relobj::is_section_name_included): New function.
8351 (Relobj::copy_symbols_data): New function.
8352 (Relobj::set_symbols_data): New function.
8353 (Relobj::get_relocs_data): New function.
8354 (Relobj::set_relocs_data): New function.
8355 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8356 (Relobj::gc_process_relocs): New function.
8357 (Relobj::do_gc_process_relocs): New pure virtual function.
8358 (Relobj::sd_): New data member.
8359 (Sized_relobj::is_output_section_offset_invalid): New function.
8360 (Sized_relobj::do_gc_process_relocs): New function.
8361 * options.h (General_options::gc_sections): Modify to not be a no-op.
8362 (General_options::print_gc_sections): New option.
8363 * plugin.cc (Plugin_finish::run): Remove function call to
8364 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8365 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8366 * reloc.cc (Read_relocs::run): Add task to process relocs and
8367 determine unreferenced sections when doing garbage collection.
8368 (Gc_process_relocs): New class.
8369 (Sized_relobj::do_gc_process_relocs): New function.
8370 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8371 sections that are garbage collected.
8372 * reloc.h (Gc_process_relocs): New class.
8373 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8374 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8375 symbols whose corresponding sections are garbage collected.
8376 (Symbol_table::Symbol_table): Add new parameter for the garbage
8377 collection object.
8378 (Symbol_table::gc_mark_undef_symbols): New function.
8379 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8380 (Symbol_table::gc_mark_dyn_syms): New function.
8381 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8382 as garbage.
8383 (Symbol_table::add_from_object): Likewise.
8384 (Symbol_table::add_from_relobj): When building shared objects, do not
8385 treat externally visible symbols as garbage.
8386 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8387 table information for static and relocatable links.
8388 * symtab.h (Symbol_table::set_gc): New function.
8389 (Symbol_table::gc): New function.
8390 (Symbol_table::gc_mark_undef_symbols): New function.
8391 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8392 (Symbol_table::gc_mark_dyn_syms): New function.
8393 (Symbol_table::gc_): New data member.
e1df38aa 8394 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8395 function.
8396 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8397 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8398
3b293544
CF
83992009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8400
8401 * options.h (General_options::gc_sections): Define as a no-op for now.
8402 (General_options::no_keep_memory): Ditto.
8403 (General_options::Bshareable): Define.
8404 * options.cc (General_options::finalize): Honor -Bshareable.
8405
83d22aa8
AS
84062009-01-20 Andreas Schwab <schwab@suse.de>
8407
8408 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8409 read the value in the contents, since we don't use it. Use the
8410 template endianness when writing.
8411 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8412
cd536b21
AS
84132009-01-19 Andreas Schwab <schwab@suse.de>
8414
8415 * configure.tgt (powerpc64-*): Fix targ_obj.
8416
99e9a495
ILT
84172009-01-15 Ian Lance Taylor <iant@google.com>
8418
8419 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8420 local symbols when stripping all symbols.
8421
bbbfea06
CC
84222009-01-14 Cary Coutant <ccoutant@google.com>
8423
99e9a495 8424 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8425
0f7c0701
CC
84262009-01-14 Cary Coutant <ccoutant@google.com>
8427
8428 * archive.cc (Archive::get_elf_object_for_member): Remove call
8429 to File_read::claim_for_plugin.
8430 * descriptors.cc (Descriptors::open): Remove reference to
8431 is_claimed.
8432 (Descriptors::claim_for_plugin): Remove.
8433 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8434 (Descriptors::is_claimed): Remove.
8435 (claim_descriptor_for_plugin): Remove.
8436 * fileread.cc (File_read::claim_for_plugin): Remove.
8437 * fileread.h (File_read::claim_for_plugin): Remove.
8438 (File_read::descriptor): Reopen descriptor if necessary.
8439 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8440 (Plugin_manager::all_symbols_read): Add task parameter. Change
8441 all callers.
8442 (Plugin_manager::get_input_file): New function.
8443 (Plugin_manager::release_input_file): New function.
8444 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8445 corresponding data member.
8446 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8447 and pass to base constructor. Change all callers.
8448 (get_input_file, release_input_file): New functions.
8449 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8450 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8451 (Plugin_manager::all_symbols_read): Add task parameter.
8452 (Plugin_manager::get_input_file): New function.
8453 (Plugin_manager::release_input_file): New function.
8454 (Plugin_manager::task_): New data member.
8455 (Pluginobj::Pluginobj): Add filesize parameter.
8456 (Pluginobj::filename): New function.
8457 (Pluginobj::descriptor): New function.
8458 (Pluginobj::filesize): New function.
8459 (Pluginobj::filesize_): New data member.
8460 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8461 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8462 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8463
8464 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8465 with archive libraries.
8466 * testsuite/Makefile.in: Regenerate.
8467 * testsuite/plugin_test.c (struct sym_info): New type.
8468 (get_input_file, release_input_file): New static variables.
8469 (onload): Capture new transfer vector entries.
8470 (claim_file_hook): Stop reading at end of file according to filesize.
8471 Factor out parsing of readelf output into separate function.
8472 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8473 APIs and get the source file name from the symbol table. Convert
8474 source file name to corresponding object file name. Print info
8475 message when adding new input files.
8476 (parse_readelf_line): New function.
8477 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8478 * testsuite/plugin_test_2.sh: Likewise.
8479 * testsuite/plugin_test_3.sh: Likewise.
8480 * testsuite/plugin_test_4.sh: New test case.
8481
62a6d109
ILT
84822009-01-07 Ian Lance Taylor <iant@google.com>
8483
8484 * version.cc (version_string): Bump to 1.8.
8485
483620e8
CC
84862008-12-23 Cary Coutant <ccoutant@google.com>
8487
8488 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8489 * plugin.cc (Plugin_manager::finish): Rename as
8490 layout_deferred_objects. Move cleanup to separate function.
8491 (Plugin_manager::cleanup): New function.
8492 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8493 separately.
8494 * plugin.h (Plugin_manager::finish): Rename as
8495 layout_deferred_objects.
8496 (Plugin_manager::cleanup): New function.
8497 (Plugin_manager::cleanup_done): New field.
8498
d66a9eb3
CC
84992008-12-23 Cary Coutant <ccoutant@google.com>
8500
8501 * plugin.cc (is_visible_from_outside): New function.
8502 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8503 so we don't return "IR only" status for exported symbols or -r links.
8504
8505 * testsuite/Makefile.am (plugin_test_3): New test case.
8506 * testsuite/Makefile.in: Regenerate.
8507 * testsuite/plugin_test_3.sh: New file.
8508
5995b570
CC
85092008-12-22 Cary Coutant <ccoutant@google.com>
8510
8511 * object.cc (Sized_relobj::layout_section): New function.
8512 (Sized_relobj::do_layout): Defer layout of input sections until after
8513 plugin has provided replacement files.
8514 (Sized_relobj::do_layout_deferred_sections): New function.
8515 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8516 (Relobj::layout_deferred_sections): New function.
8517 (Relobj::do_layout_deferred_sections): New function.
8518 (Sized_relobj::do_layout_deferred_sections): New function.
8519 (Sized_relobj::layout_section): New function.
8520 (Sized_relobj::Deferred_layout): New structure.
8521 (Sized_relobj::deferred_layout_): New field.
8522 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8523 Change all callers. Layout deferred sections.
8524 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8525 references.
8526 (Plugin_hook::run): Move code from do_plugin_hook inline.
8527 (Plugin_hook::do_plugin_hook): Remove.
8528 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8529 (Plugin_manager::finish): Renamed, was cleanup.
8530 (Plugin_manager::should_defer_layout): New function.
8531 (Plugin_manager::add_deferred_layout_object): New function.
8532 (Plugin_manager::Deferred_layout_list): New type.
8533 (Plugin_manager::deferred_layout_objects_): New field.
8534 (Plugin_hook::do_plugin_hook): Remove.
8535
ee769c88
ILT
85362008-12-17 Ian Lance Taylor <iant@google.com>
8537
8538 * options.h (class General_options): Add --no case for
8539 --export-dynamic.
8540
abc8dcba
CC
85412008-12-16 Cary Coutant <ccoutant@google.com>
8542
8543 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8544 vector.
8545 (Plugin_manager::claim_file): Create plugin object even if
8546 plugin did not call the add_symbols callback.
8547 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8548 asking for more symbols than were added.
8549 * testsuite/Makefile.am (plugin_test_1): Add test case with
8550 no global symbols.
8551 (empty.syms): New target.
8552 * testsuite/Makefile.in: Regenerate.
8553 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8554 message. Don't call add_symbols if no globals.
8555 (all_symbols_read_hook): Don't provide replacement for empty
8556 claimed file.
8557
b0074644
ILT
85582008-12-12 Ian Lance Taylor <iant@google.com>
8559
68943102
ILT
8560 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8561 r_type == 0 for a local symbol with r_sym == 0.
8562 (scan_relocatable_relocs): Pass r_sym to
8563 local_non_section_strategy.
8564 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8565 r_sym parameter.
8566
b0074644
ILT
8567 * configure.ac: Update test for TLS descriptors: they are
8568 supported as of glibc 2.9.
8569 * configure: Rebuild.
8570
c2508178
ILT
85712008-12-11 Ian Lance Taylor <iant@google.com>
8572
8573 PR 7091
8574 * target-reloc.h (Default_scan_relocatable_relocs): For each
8575 function, map r_type == 0 to RELOC_DISCARD.
8576
2756a258
CC
85772008-12-10 Cary Coutant <ccoutant@google.com>
8578
8579 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8580 object to override a kept COMDAT group from a plugin object.
8581
bb6f53d3
ILT
85822008-12-09 Ian Lance Taylor <iant@google.com>
8583
fbc558e1
ILT
8584 PR 7088
8585 * yyscript.y (file_cmd): Handle INPUT.
8586
bb6f53d3
ILT
8587 * testsuite/initpri1.c: Change all declarations to be full
8588 prototypes by adding void, to avoid compiler warnings.
8589
4674ecfc
CC
85902008-12-05 Rafael Avila de Espindola <espindola@google.com>
8591
8592 * options.cc (General_options::parse_plugin_opt): New.
8593 (General_options::add_plugin): The argument now is just the filename.
8594 (General_options::add_plugin_option): New.
8595 * options.h (plugin_opt): New.
8596 (add_plugin): Change argument name.
8597 (add_plugin_option): New.
8598 * plugin.cc (Plugin::load): Don't parse the plugin option.
8599 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8600 (Plugin::add_option): New.
8601 (Plugin::args_): Change type.
8602 (Plugin::filename_): New.
8603 (Plugin_manager::add_plugin_option): New.
8604 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8605 * testsuite/Makefile.in: Regenerate.
8606
fd06b4aa
CC
86072008-12-05 Cary Coutant <ccoutant@google.com>
8608
8609 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8610 Handle --strip-lto-sections option.
8611 * options.h (strip_lto_sections): New option.
8612
6c52134c
CC
86132008-12-01 Cary Coutant <ccoutant@google.com>
8614
8615 * plugin.cc (ld_plugin_message): Change format parameter to const.
8616 Fix mismatch between new[] and delete.
8617
a45248e0
CC
86182008-11-14 Cary Coutant <ccoutant@google.com>
8619
8620 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8621 instead of -1U.
8622
c82fbeee
CS
86232008-11-05 Craig Silverstein <csilvers@google.com>
8624
8625 * options.cc (General_options::parse_dynamic_list): New function.
8626 * options.h (General_options): New flags dynamic_list,
8627 dynamic_list_data, dynamic_list_cpp_new, and
8628 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8629 (General_options::in_dynamic_list): New function.
8630 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8631 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8632 (Lex::can_continue_name): Likewise.
8633 (yylex): Likewise.
8634 (read_script_file): New parameter script_options.
8635 (read_dynamic_list): New function.
8636 (Script_options::define_dynamic_list): New function.
8637 (dynamic_list_keyword_parsecodes): New variable.
8638 (dynamic_list_keywords): New variable.
8639 * script.h (Script_options::define_dynamic_list): New function
8640 prototype.
8641 (read_dynamic_list): New function prototype.
8642 * symtab.cc (strprefix): New macro.
8643 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8644 dynamic_list_data, dynamic_list_cpp_new, and
8645 dynamic_list_cpp_typeinfo.
8646 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8647 (dynamic_list_expr): New rule.
8648 (dynamic_list_nodes): Likewise.
8649 (dynamic_list_node): Likewise.
8650 * testsuite/Makefile.am (dynamic_list): New test.
8651 * testsuite/Makefile.in: Regenerated.
8652 * testsuite/dynamic_list.t: New file.
8653 * testsuite/dynamic_list.sh: New file.
8654
e0bb29a5
CS
86552008-11-05 Craig Silverstein <csilvers@google.com>
8656
8657 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8658 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8659 (t11_last): Likewise.
8660 * testsuite/ver_test_6.c (main): Likewise.
8661
4e1e25e0
CC
86622008-10-07 Cary Coutant <ccoutant@google.com>
8663
8664 * options.c (General_options::finalize): Add check for -static and
8665 -shared.
8666 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8667 is not empty.
8668
92f03fcb
CC
86692008-10-02 Cary Coutant <ccoutant@google.com>
8670
8671 * plugin.cc (make_sized_plugin_object): Fix conditional
8672 compilation to work when not all targets are enabled.
8673
fbd8a257
CC
86742008-09-29 Cary Coutant <ccoutant@google.com>
8675
8676 * archive.cc (Archive::get_file_and_offset): Use filename instead
8677 of name to get library path.
8678 (Archive::include_member): Unlock external member of a thin archive.
8679
8680 * testsuite/Makefile.am (TEST_AR): New variable.
8681 (thin_archive_test_1): New test.
8682 (thin_archive_test_2): New test.
81636b3f
CC
8683 * testsuite/Makefile.in: Regenerate.
8684 * testsuite/thin_archive_main.cc: New file.
8685 * testsuite/thin_archive_test_1.cc: New file.
8686 * testsuite/thin_archive_test_2.cc: New file.
8687 * testsuite/thin_archive_test_3.cc: New file.
8688 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8689
eff45813
CC
86902008-09-29 Cary Coutant <ccoutant@google.com>
8691
8692 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8693 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8694 instead of -1U.
8695 (Sized_relobj::do_finalize_local_symbols): Likewise.
8696 (Sized_relobj::map_to_kept_section): Likewise.
8697 * object.h (Sized_relobj::invalid_address): New constant.
8698 (Sized_relobj::do_output_section_offset): Check for invalid_address
8699 and return -1ULL.
8700 * output.cc (Output_reloc::local_section_offset): Use constant
8701 invalid_address instead of -1U.
8702 (Output_reloc::get_address): Likewise.
8703 (Output_section::output_address): Change -1U to -1ULL.
8704 * output.h (Output_reloc::invalid_address): New constant.
8705 * reloc.cc (Sized_relobj::write_sections): Use constant
8706 invalid_address instead of -1U.
8707 (Sized_relobj::relocate_sections): Likewise.
8708 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8709 values for merge sections.
8710 * target-reloc.h (relocate_for_relocatable): Use constant
8711 invalid_address instead of -1U.
8712
89fc3421
CC
87132008-09-19 Cary Coutant <ccoutant@google.com>
8714
8715 Add plugin functionality for link-time optimization (LTO).
8716 * configure.ac (plugins): Add --enable-plugins option.
8717 * configure: Regenerate.
8718 * config.in: Regenerate.
8719 * Makefile.am (LIBDL): New variable.
8720 (CCFILES): Add plugin.cc.
8721 (HFILES): Add plugin.h.
8722 (ldadd_var): Add LIBDL.
8723 * Makefile.in: Regenerate.
8724
8725 * archive.cc: Include "plugin.h".
8726 (Archive::setup): Don't preread archive symbols when using a plugin.
8727 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8728 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8729 files.
8730 (Archive::include_member): Add symbols from plugin objects.
8731 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8732 * descriptors.cc (Descriptors::open): Check for file descriptors
8733 abandoned by plugins.
8734 (Descriptors::claim_for_plugin): New function.
8735 * descriptors.h (Descriptors::claim_for_plugin): New function.
8736 (Open_descriptor::is_claimed): New field.
8737 (claim_descriptor_for_plugin): New function.
8738 * fileread.cc (File_read::claim_for_plugin): New function.
8739 * fileread.h (File_read::claim_for_plugin): New function.
8740 (File_read::descriptor): New function.
8741 * gold.cc: Include "plugin.h".
8742 (queue_initial_tasks): Add task to call plugin hooks for generating
8743 new object files.
8744 * main.cc: Include "plugin.h".
8745 (main): Load plugin libraries.
8746 * object.h (Pluginobj): Declare.
8747 (Object::pluginobj): New function.
8748 (Object::do_pluginobj): New function.
8749 (Object::set_target): New function.
8750 * options.cc: Include "plugin.h".
8751 (General_options::parse_plugin): New function.
8752 (General_options::General_options): Initialize plugins_ field.
8753 (General_options::add_plugin): New function.
8754 * options.h (Plugin_manager): Declare.
8755 (General_options): Add --plugin option.
8756 (General_options::has_plugins): New function.
8757 (General_options::plugins): New function.
8758 (General_options::add_plugin): New function.
8759 (General_options::plugins_): New field.
8760 * plugin.cc: New file.
8761 * plugin.h: New file.
8762 * readsyms.cc: Include "plugin.h".
8763 (Read_symbols::do_read_symbols): Check for archive before checking
8764 for ELF file. Call plugin hooks to claim files.
8765 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8766 from a real object file; force override when processing replacement
8767 files.
8768 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8769 (Symbol::init_base_object): Likewise.
8770 (Symbol::init_base_output_data): Likewise.
8771 (Symbol::init_base_output_segment): Likewise.
8772 (Symbol::init_base_constant): Likewise.
8773 (Symbol::init_base_undefined): Likewise.
8774 (Symbol::output_section): Assert that object is not a plugin.
8775 (Symbol_table::add_from_pluginobj): New function.
8776 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8777 undefined.
8778 (Symbol_table::sized_write_globals): Likewise.
8779 (Symbol_table::add_from_pluginobj): Instantiate template.
8780 * symtab.h (Sized_pluginobj): Declare.
8781 (Symbol::in_real_elf): New function.
8782 (Symbol::set_in_real_elf): New function.
8783 (Symbol::in_real_elf_): New field.
8784 (Symbol_table::add_from_pluginobj): New function.
8785
8786 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8787 (LIBDL): New variable.
8788 (LDADD): Add LIBDL.
8789 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8790 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8791 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8792 (MOSTLYCLEANFILES): Likewise.
8793 * testsuite/Makefile.in: Regenerate.
8794 * testsuite/plugin_test.c: New file.
8795 * testsuite/plugin_test_1.sh: New file.
8796 * testsuite/plugin_test_2.sh: New file.
8797
de31bda5
ILT
87982008-09-16 Ian Lance Taylor <iant@google.com>
8799
9c2d0ef9
ILT
8800 * target-reloc.h (relocate_section): Check whether a symbol is
8801 defined by the ABI before reporting an undefined symbol error.
8802 * target.h (Target::is_defined_by_abi): Make parameter const.
8803 (Target::do_is_defined_by_abi): Likewise.
8804 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8805 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8806 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8807 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8808 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8809 * testsuite/Makefile.in: Rebuild.
8810
de31bda5
ILT
8811 * fileread.cc (make_view): Add casts to avoid warning.
8812
9fa33bee
AO
88132008-09-16 Alexandre Oliva <aoliva@redhat.com>
8814
8815 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8816 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8817
183fd0e3
AO
88182008-09-16 Alexandre Oliva <aoliva@redhat.com>
8819
8820 * options.h (General_options::output_is_executable): New.
8821 (General_options::output_is_pie): New.
8822 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8823 for shared libraries.
8824 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8825
7be8330a
CD
88262008-09-11 Chris Demetriou <cgd@google.com>
8827
8828 * options.h (origin): New -z option.
8829 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8830 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8831 in DT_FLAGS_1.
8832
a9caad02
CC
88332008-09-05 Cary Coutant <ccoutant@google.com>
8834
8835 * fileread.cc (File_read::make_view): Add check for attempt to map
8836 beyond end of file.
8837
ae6dce4d
CC
88382008-09-05 Cary Coutant <ccoutant@google.com>
8839
8840 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8841 explicit instantiations.
8842
d7ab2a47
KVH
88432008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8844
8845 PR gold/6858
8846 * options.cc (General_options::finalize): Allow undefined symbols
8847 in shlibs if linking -shared.
8848
8849 PR gold/6859
8850 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8851 symbols as not needing a dynsym entry.
8852
1e52a9c1
CS
88532008-08-20 Craig Silverstein <csilvers@google.com>
8854
8855 * fileread.cc (File_read::open): Do not lock the file unless it
8856 was successfully opened.
8857
d85c80a3
CC
88582008-08-14 Cary Coutant <ccoutant@google.com>
8859
8860 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8861 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8862 * testsuite/tls_test.cc (struct int128): 128-bit struct
8863 for testing TLS relocs with non-zero addend.
8864 (v12): New TLS variable.
8865 (t12): New test.
8866 (t_last): Add check for v12.
8867 * testsuite/tls_test.h (t12): New function.
8868 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8869
2d924fd9
ILT
88702008-08-13 Ian Lance Taylor <iant@google.com>
8871
8872 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8873 set tls_segment_ or relro_segment_.
8874 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8875 when appropriate.
8876 * output.h (Output_section::clear_is_relro): New function.
8877 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8878 sections specially even when output_data_ is empty.
8879 (Output_segment::maximum_alignment): When first section is relro,
8880 only force alignment for PT_LOAD segments.
8881 * script.cc (script_data_segment_align): New function.
8882 (script_data_segment_relro_end): New function.
8883 * script-c.h (script_data_segment_align): Declare.
8884 (script_data_segment_relro_end): Declare.
8885 * script-sections.h (class Script_sections): Declare
8886 data_segment_align and data_segment_relro_end. Add fields
8887 segment_align_index_ and saw_relro_end_.
8888 * script-sections.cc (class Sections_element): Add set_is_relro
8889 virtual function. Add new bool* parameter to place_orphan_here.
8890 Add get_output_section virtual function.
8891 (class Output_section_definition): Add set_is_relro. Add new
8892 bool* parameter to place_orphan_here. Add get_output_section.
8893 Add is_relro_ field.
8894 (Output_section_definition::Output_section_definition): Initialize
8895 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8896 and is_relro_ fields.
8897 (Output_section_definition::place_orphan_here): Add is_relro
8898 parameter.
8899 (Output_section_definition::set_section_addresses): Set relro for
8900 output section.
8901 (Output_section_definition::alternate_constraint): Likewise.
8902 (class Orphan_output_section): Add new bool* parameter to
8903 place_orphan_here. Add get_output_section.
8904 (Orphan_output_section::place_orphan_here): Add is_relro
8905 parameter.
8906 (Script_sections::Script_sections): Initialize
8907 data_segment_align_index_ and saw_relro_end_.
8908 (Script_sections::data_segment_align): New function.
8909 (Script_sections::data_segment_relro_end): New function.
8910 (Script_sections::place_orphan): Set or clear is_relro.
8911 (Script_sections::set_section_addresses): Force alignment of first
8912 TLS section.
8913 * yyscript.y (exp): Call script_data_segment_align and
8914 script_data_segment_relro_end.
8915 * testsuite/relro_script_test.t: New file.
8916 * testsuite/relro_test.cc (using_script): Declare.
8917 (t1, t2): Test using_script.
8918 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8919 (relro_script_test_SOURCES): Define.
8920 (relro_script_test_DEPENDENCIES): Define.
8921 (relro_script_test_LDFLAGS): Define.
8922 (relro_script_test_LDADD): Define.
8923 (relro_script_test.so): New target.
8924 * testsuite/Makefile.in: Rebuild.
8925
f827c9a9
CC
89262008-08-06 Cary Coutant <ccoutant@google.com>
8927
8928 * archive.cc (Archive::total_archives, Archive::total_members)
8929 (Archive::total_members_loaded): New variables.
8930 (Archive::setup): Add parameter. Add option to preread
8931 archive symbols.
8932 (Archive::read_armap): Add counter.
8933 (Archive::get_file_and_offset): New function.
8934 (Archive::get_elf_object_for_member): New function.
8935 (Archive::read_all_symbols): New function.
8936 (Archive::read_symbols): New function.
8937 (Archive::add_symbols): Add counters.
8938 (Archive::include_all_members): Use armap to find members if it's
8939 already built.
8940 (Archive::include_member): Skip reading symbols if already read.
8941 Factored code into Archive::get_file_and_offset and
8942 Archive::get_elf_object_for_member. Changed call to
8943 Mapfile::report_include_archive_member.
8944 (Archive::print_stats): New function.
8945 * archive.h: Declare Object and Read_symbols_data classes.
8946 (Archive::Archive): Add initializers for new members.
8947 (Archive::setup): Add parameter.
8948 (Archive::print_stats): New function.
8949 (Archive::total_archives, Archive::total_members)
8950 (Archive::total_members_loaded): New variables.
8951 (Archive::get_file_and_offset): New function.
8952 (Archive::get_elf_object_for_member): New function.
8953 (Archive::read_all_symbols): New function.
8954 (Archive::read_symbols): New function.
8955 (Archive::Archive_member): New class.
8956 (Archive::members_): New member.
8957 (Archive::num_members_): New member.
8958 * main.cc: Include archive.h.
8959 (main): Call Archive::print_stats.
8960 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8961 archive parameter; member_name is now the fully-decorated name.
8962 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8963 * options.h: (General_options): Add --preread-archive-symbols option.
8964 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8965 Archive::setup.
8966
de4c45bd
ILT
89672008-08-04 Ian Lance Taylor <iant@google.com>
8968
8969 * symtab.h (Symbol::use_plt_offset): New function.
8970 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8971 * powerpc.cc (Relocate::relocate): Likewise.
8972 * sparc.cc (Relocate::relocate): Likewise.
8973 * x86_64.cc (Relocate::relocate): Likewise.
8974 * testsuite/weak_plt.sh: New test.
8975 * testsuite/weak_plt_main.cc: New test.
8976 * testsuite/weak_plt_shared.cc: New test.
8977 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8978 (check_PROGRAMS): Add weak_plt.
8979 (check_DATA): Add weak_plt_shared.so.
8980 (weak_plt_main_pic.o, weak_plt): New targets.
8981 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8982 * testsuite/Makefile.in: Rebuild.
8983
8984 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8985 gcctestdir/ld.
8986 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8987 * testsuite/Makefile.in: Rebuild.
8988
323ee3f4
AM
89892008-08-04 Alan Modra <amodra@bigpond.net.au>
8990
8991 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8992 * Makefile.in: Regenerate.
8993 * po/POTFILES.in: Regenerate.
8994
7c07ecec
ILT
89952008-07-29 Ian Lance Taylor <iant@google.com>
8996
8997 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8998 symbols before other symbols.
8999 * testsuite/script_test_2.cc (test_addr): Declare.
9000 (test_addr_alias): Declare.
9001 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9002 values.
7c07ecec
ILT
9003 * testsuite/script_test_2.t: Define test_addr_alias and
9004 test_addr.
9005
5778530e
ILT
90062008-07-24 Ian Lance Taylor <iant@google.com>
9007
2a00e4fb
ILT
9008 PR 5990
9009 * descriptors.cc: New file.
9010 * descriptors.h: New file.
9011 * gold-threads.h (class Hold_optional_lock): New class.
9012 * fileread.cc: Include "descriptors.h".
9013 (File_read::~File_read): Release descriptor rather than closing
9014 it.
9015 (File_read::open) [file]: Call open_descriptor rather than open.
9016 Set is_descriptor_opened_.
9017 (File_read::open) [memory]: Assert that descriptor is not open.
9018 (File_read::reopen_descriptor): New function.
9019 (File_read::release): Release descriptor.
9020 (File_read::do_read): Make non-const. Reopen descriptor.
9021 (File_read::read): Make non-const.
9022 (File_read::make_view): Reopen descriptor.
9023 (File_read::do_readv): Likewise.
9024 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9025 Update declarations.
9026 * layout.cc: Include "descriptors.h".
9027 (Layout::create_build_id): Use open_descriptor rather than open.
9028 * output.cc: Include "descriptors.h".
9029 (Output_file::open): Use open_descriptor rather than open.
9030 * archive.cc (Archive::const_iterator): Change Archive to be
9031 non-const.
9032 (Archive::begin, Archive::end): Make non-const.
9033 (Archive::count_members): Likewise.
9034 * archive.h (class Archive): Update declarations.
9035 * object.h (Object::read): Make non-const.
9036 * Makefile.am (CCFILES): Add descriptors.cc.
9037 (HFILES): Add descriptors.h.
9038 * Makefile.in: Rebuild.
9039
801647d1
ILT
9040 PR 6716
9041 * gold.h: Always include <clocale>. Add Solaris workarounds
9042 following code in binutils/sysdep.h.
9043
5edd166e
ILT
9044 PR 6048
9045 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9046 this->eh_frame_hdr_ is NULL before using it.
9047
c89ad728
ILT
9048 * dynobj.cc (Versions::Versions): Update comment.
9049
aa86f06b
ILT
9050 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9051 the base version name.
9052
5778530e
ILT
9053 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9054 array size plus one.
9055 (Stringpool_template::set_string_offsets): Subtract one from key
9056 before using it as an array index.
9057 (Stringpool_template::get_offset_with_length): Likewise.
9058 (Stringpool_template::write_to_buffer): Likewise.
9059 * stringpool.h (Stringpool_template::get_offset_from_key):
9060 Likewise.
9061
057ead22
ILT
90622008-07-23 Ian Lance Taylor <iant@google.com>
9063
7f649c59
ILT
9064 PR 6658
9065 * object.h (Merged_symbol_value::value): Do our best to handle a
9066 negative addend.
9067
057ead22
ILT
9068 PR 6647
9069 * script.cc (Version_script_info::get_versions): Don't add empty
9070 version tag to return value.
9071 (Version_script_info::get_symbol_version_helper): Change return
9072 type to bool. Add pversion parameter. Change all callers.
9073 (script_register_vers_node): Don't require a non-NULL tag.
9074 * script.h (class Version_script_info): Update declarations.
9075 (Version_script_info::get_symbol_version): Change return type to
9076 bool. Add version parameter. Change all callers.
9077 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9078 handling. Handle an empty version from a version script.
9079 (Symbol_table::define_special_symbol): Likewise.
9080 * testsuite/ver_test_10.script: New file.
9081 * testsuite/ver_test_10.sh: New file.
9082 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9083 (check_DATA): Add ver_test_10.syms.
9084 (ver_test_10.syms, ver_test_10.so): New target.
9085 * testsuite/Makefile.in: Rebuild.
9086
58e54ac2
CD
90872008-07-23 Simon Baldwin <simonb@google.com>
9088
9089 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9090 to zero for undefined symbols from dynamic libraries.
9091
95d14cd3
ILT
90922008-07-23 Ian Lance Taylor <iant@google.com>
9093
9094 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9095 Change all callers.
9096 * symtab.h (class Symbol_table): Update declaration.
9097 * testsuite/ver_test_9.cc: New file.
9098 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9099 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9100 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9101 (ver_test_9.so, ver_test_9.o): New targets.
9102 * testsuite/Makefile.in: Rebuild.
9103
92de84a6
ILT
91042008-07-22 Ian Lance Taylor <iant@google.com>
9105
34810851
ILT
9106 * options.h (class General_options): Define --check-sections.
9107 * layout.cc (Layout::set_segment_offsets): Handle
9108 --check-sections.
9109
af6156ef
ILT
9110 * options.h (class General_options): Define -n/--nmagic and
9111 -N/--omagic.
9112 * options.cc (General_options::finalize): For -n/--nmagic or
9113 -N/--omagic, set -static.
9114 * layout.cc (Layout::attach_allocated_section_to_segment): If
9115 -N/--omagic, don't put read-only and read-write sections in
9116 different segments.
9117 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9118 finding a read-only segment.
9119 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9120 don't set the minimum segment alignment to the common page size,
9121 and don't set the file offset to the address modulo the page size.
9122 * script-sections.cc (Script_sections::create_segments): If
9123 -n/--omagic, don't put read-only and read-write sections in
9124 different segments.
9125
92de84a6
ILT
9126 * cref.cc: New file.
9127 * cref.h: New file.
9128 * options.h (class General_options): Add --print-symbol-counts.
9129 * main.cc (main): Issue defined symbol report if requested.
9130 * archive.cc (Archive::interpret_header): Make into a const member
9131 function.
9132 (Archive::add_symbols): Call Input_objects::archive_start and
9133 archive_stop.
9134 (Archive::const_iterator): Define new class.
9135 (Archive::begin, Archive::end): New functions.
9136 (Archive::include_all_members): Rewrite to use iterator.
9137 (Archive::count_members): New function.
9138 * archive.h (class Archive): Update declarations.
9139 (Archive::filename): New function.
9140 * object.cc: Include "cref.h".
9141 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9142 (Sized_relobj::do_get_global_symbol_counts): New function.
9143 (Input_objects::add_object): Add object to cross-referencer.
9144 (Input_objects::archive_start): New function.
9145 (Input_objects::archive_stop): New function.
9146 (Input_objects::print_symbol_counts): New function.
9147 * object.h: Declare Cref and Archive.
9148 (Object::get_global_symbol_counts): New function.
9149 (Object::do_get_global_symbol_counts): New pure virtual function.
9150 (class Sized_relobj): Add defined_count_ field. Update
9151 declarations.
9152 (class Input_objects): Add cref_ field. Update constructor.
9153 Update declarations.
9154 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9155 defined_count_.
9156 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9157 symbol counts.
9158 (Sized_dynobj::do_get_global_symbol_counts): New function.
9159 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9160 defined_count_. Update declarations. Define Symbols typedef.
9161 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9162 parameter. Change all callers.
9163 (Symbol_table::add_from_dynobj): Add sympointers and defined
9164 parameters. Change all callers.
9165 * symtab.h (class Symbol_table): Update declarations.
9166 * Makefile.am (CCFILES): Add cref.cc.
9167 (HFILES): Add cref.h.
9168 * Makefile.in: Rebuild.
9169
3f7c5e1d
CD
91702008-07-22 Simon Baldwin <simonb@google.com>
9171
9172 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9173 to zero when writing undefined symbols.
9174
e0b64032
ILT
91752008-07-22 Ian Lance Taylor <iant@google.com>
9176
9177 * output.cc (Output_section::add_input_section): Don't try to
9178 merge empty merge sections.
9179
096b02cf
CS
91802008-07-21 Craig Silverstein <csilvers@google.com>
9181
9182 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9183 Include symbol version in error message.
cd536b21 9184
1d1f116d
CD
91852008-07-20 Chris Demetriou <cgd@google.com>
9186
cd536b21 9187 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9188 (RANDOM_SEED_CFLAGS): New substituted variable.
9189 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9190 * configure: Rebuild.
9191 * Makefile.in: Likewise.
9192 * testsuite/Makefile.in: Likewise.
9193
a18f591e
ILT
91942008-07-18 Ian Lance Taylor <iant@google.com>
9195
9196 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9197 where we see NAME/NULL and NAME/VERSION as separate symbols.
9198 * testsuite/ver_test_main.cc (main): Call t4.
9199 (t4, t4_2a): Define.
9200 * testsuite/ver_test_2.cc (t4_2): Define.
9201 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9202 * testsuite/ver_test_4.cc (t4_2a): Define.
9203 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9204 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9205
c6e3f6ed
ILT
92062008-07-17 Ian Lance Taylor <iant@google.com>
9207
9208 * dynobj.cc (Versions::add_def): If we give an error about a
9209 missing version, go ahead and create the version anyhow.
9210
ef9beddf
ILT
92112008-07-10 Ian Lance Taylor <iant@google.com>
9212
9213 Handle output sections with more than 0x7fffffff bytes.
9214 * object.h (class Relobj): Change map_to_output_ to
9215 output_sections_, and just keep a section pointer. Change all
9216 uses. Move comdat group support to Sized_relobj.
9217 (Relobj::is_section_specially_mapped): Remove.
9218 (Relobj::output_section): Remove poff parameter. Change all
9219 callers.
9220 (Relobj::output_section_offset): New function.
9221 (Relobj::set_section_offset): Rewrite.
9222 (Relobj::map_to_output): Remove.
9223 (Relobj::output_sections): New function.
9224 (Relobj::do_output_section_offset): New pure virtual function.
9225 (Relobj::do_set_section_offset): Likewise.
9226 (class Sized_relobj): Add section_offsets_ field. Add comdat
9227 group support from Relobj. Update declarations.
9228 (Sized_relobj::get_output_section_offset): New function.
9229 (Sized_relobj::do_output_section_offset): New function.
9230 (Sized_relobj::do_set_section_offset): New function.
9231 * object.cc (Relobj::output_section_address): Remove.
9232 (Sized_relobj::Sized_relobj): Initialize new fields.
9233 (Sized_relobj::include_section_group): Cast find_kept_object to
9234 Sized_relobj.
9235 (Sized_relobj::include_linkonce_section): Likewise.
9236 (Sized_relobj::do_layout): Use separate arrays for output section
9237 and output offset.
9238 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9239 output_sections.
9240 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9241 output_sections and section_offsets.
9242 (Sized_relobj::write_local_symbols): Likewise.
9243 (map_to_kept_section): Compute output address directly.
9244 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9245 output_sections and section_offsets.
9246 (Sized_relobj::write_sections): Likewise.
9247 (Sized_relobj::relocate_sections): Likewise.
9248 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9249 * output.h (class Output_reloc): Update declarations. Change
9250 u2_.relobj to Sized_relobj*.
9251 (class Output_data_reloc): Change add functions to use
9252 Sized_relobj*.
9253 * output.cc (Output_reloc::Output_reloc): Change relobj to
9254 Sized_relobj*.
9255 (Output_reloc::local_section_offset): Change return type to
9256 Elf_Addr. Use get_output_section_offset.
9257 (Output_reloc::get_address): Likewise.
9258 (Output_section::is_input_address_mapped): Don't call
9259 is_section_specially_mapped.
9260 (Output_section::output_offset): Likewise.
9261 (Output_section::output_address): Likewise.
9262 (Output_section::starting_output_address): Likewise.
9263 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9264 parameter to Sized_relobj*.
9265 (Copy_relocs::need_copy_reloc): Likewise.
9266 (Copy_relocs::save): Likewise.
9267 * copy-relocs.h (class Copy_relocs): Update declarations.
9268 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9269 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9270 * target-reloc.h (relocate_for_relocatable): Change
9271 offset_in_output_section type to Elf_Addr. Change code that uses
9272 it as well.
9273 * layout.cc (Layout::layout): Always set *off.
9274 * mapfile.cc (Mapfile::print_input_section): Use
9275 output_section_offset.
9276 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9277 Sized_relobj*.
9278 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9279 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9280 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9281
5cb66f97
ILT
92822008-07-03 Ian Lance Taylor <iant@google.com>
9283
9284 * layout.cc (Layout::include_section): Do not discard unrecognized
9285 SHT_STRTAB sections.
9286
afe47622
CS
92872008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9288
9289 * script.cc (Lex::can_continue_name): Make '?' allowable in
9290 version-script names.
9291 * testsuite/version_script.map: Change glob pattern to use '?'
9292
5adf9721
ILT
92932008-06-30 Manish Singh <yosh@gimp.org>
9294
9295 PR 6585
9296 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9297 Correct typo.
9298
e6fde208
ILT
92992008-06-30 Ian Lance Taylor <iant@google.com>
9300
9301 PR 6660
9302 PR 6682
9303 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9304 versions]: Don't try to read the value in the contents, since we
9305 don't use it. Use the template endianness when writing.
9306
3f2e6a2d
CC
93072008-06-25 Cary Coutant <ccoutant@google.com>
9308
9309 * fileread.cc (File_read::make_view): Assert on zero-length view.
9310 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9311 symbol table when there are no symbols to read.
9312
c43d3a48
CS
93132008-06-23 Craig Silverstein <csilvers@google.com>
9314
9315 * version.cc (version_string): Bump to 1.7
9316
5f494ea0
CS
93172008-06-18 Craig Silverstein <csilvers@google.com>
9318
9319 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9320 constant 0xFFFF to type Valtype.
9321 (Powerpc_relocate_functions::rel16_ha): Likewise.
9322
c42e122e
ILT
93232008-06-17 Ian Lance Taylor <iant@google.com>
9324
f34787f8
ILT
9325 * output.h (Output_section::Input_section): Initialize p2align_ to
9326 zero for Output_section_data constructors.
9327 (Output_section::Input_section::addralign): If not an input
9328 section, return the alignment of the Output_section_data.
9329 * testsuite/copy_test.cc: New file.
9330 * testsuite/copy_test_1.cc: New file.
9331 * testsuite/copy_test_2.cc: New file.
9332 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9333 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9334 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9335 (copy_test_1_pic.o, copy_test_1.so): New targets.
9336 (copy_test_2_pic.o, copy_test_2.so): New targets.
9337 * testsuite/Makefile.in: Rebuild.
9338
c42e122e
ILT
9339 * script-sections.cc (Script_sections::place_orphan): Initialize
9340 local variable exact.
9341
ce3ac18a
DE
93422008-06-13 David Edelsohn <edelsohn@gnu.org>
9343
9344 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9345
42cacb20
DE
93462008-06-12 David Edelsohn <edelsohn@gnu.org>
9347 David S. Miller <davem@davemloft.net>
9348
9349 * powerpc.cc: New file.
9350 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9351 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9352 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9353 * Makefile.in: Rebuild.
9354
7b308235
ILT
93552008-06-09 Ian Lance Taylor <iant@google.com>
9356
9357 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9358 <exception>.
9359 (throwing, orig_terminate): New static variables.
9360 (terminate_handler): New static function.
9361 (t2): Set terminate handler.
9362
f0b886e3
ILT
93632008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9364
9365 PR 6584
cd536b21 9366 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9367 alignment.
9368
3e90f135
CC
93692008-05-30 Cary Coutant <ccoutant@google.com>
9370
9371 * archive.cc (Archive::include_all_members) Correct to step
9372 over symbol table and extended name table in thin archives.
9373
e09ad04a
ILT
93742008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9375
9376 PR 6407
9377 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9378 calculation.
9379
62b01cb5
ILT
93802008-05-28 Caleb Howe <cshowe@google.com>
9381
9382 * reduced_debug_output.cc: New file.
9383 * reduced_debug_output.h: New file.
92de84a6 9384 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9385 * options.cc (General_options::finalize): Add strip_debug_non_line
9386 to the strip heirarchy.
9387 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9388 fields.
9389 * layout.cc: Include "reduced_debug_output.h".
9390 (Layout::Layout): Initialize new fields.
9391 (line_only_debug_sections): New static array.
9392 (is_lines_only_debug_sections): New static inline function.
9393 (Layout::include_section): Handle --strip-debug-non-line.
9394 (Layout::make_output_section): If --strip-debug-non-line, build
9395 new output sections for .debug_abbrev and .debug_info.
9396 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9397 gold. Warn about possible overflow.
9398 (read_signed_LEB_128): Likewise.
9399 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9400 (read_signed_LEB_128): Declare.
9401 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9402 (HFILES): Add reduced_debug_output.h.
9403 * Makefile.in: Rebuild.
9404
7d9e3d98
ILT
94052008-05-21 Ian Lance Taylor <iant@google.com>
9406
9407 * mapfile.cc: New file.
9408 * mapfile.h: New file.
9409 * options.h (class General_options): Add -M/--print-map and -Map.
9410 * options.cc (General_options::finalize): Make -M equivalent to
9411 -Map -.
9412 * main.cc: Include <cstdio> and "mapfile.h".
9413 (main): Open mapfile if requested.
9414 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9415 constructor. Change caller.
9416 (queue_initial_tasks): Add mapfile parameter. Change caller.
9417 (queue_middle_tasks): Likewise.
9418 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9419 declarations.
9420 * archive.cc: Include "mapfile.h".
9421 (Archive::add_symbols): Add mapfile parameter. Change all
9422 callers. Pass mapfile, symbol, and reason to include_member.
9423 (Archive::include_all_members): Add mapfile parameter. Change all
9424 callers.
9425 (Archive::include_member): Add mapfile, sym, and why parameters.
9426 Change all callers. Report inclusion to map file.
9427 * archive.h: Include "fileread.h".
9428 (class Archive): Update declarations.
9429 (Archive::file): New const method.
9430 (class Add_archive_symbols): Add mapfile_ field. Update
9431 constructor. Change all callers.
9432 * readsyms.h (class Read_symbols): Likewise.
9433 (class Finish_group): Likewise.
9434 (class Read_script): Likewise.
9435 * common.cc: Include "mapfile.h".
9436 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9437 all callers.
9438 (Symbol_table::do_allocate_commons): Likewise.
9439 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9440 symbol allocation to mapfile.
9441 * common.h (class Allocate_commons_task): Add mapfile_ field.
9442 Update constructor. Change all callers.
9443 * symtab.h (class Symbol_table): Update declarations.
9444 * layout.cc: Include "mapfile.h".
9445 (Layout_task_runner::run): Print information to mapfile.
9446 (Layout::create_gold_note): Change Output_data_fixed_space to
9447 Output_data_zero_fill.
9448 (Layout::create_build_id): Likewise.
9449 (Layout::print_to_mapfile): New function.
9450 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9451 constructor. Change caller.
9452 (class Layout): Declare print_to_mapfile.
9453 * output.cc (Output_section::Input_section::print_to_mapfile): New
9454 function.
9455 (Output_section::add_input_section): If producing a map, always
9456 add to input_sections_ list.
9457 (Output_section::do_print_to_mapfile): New function.
9458 (Output_segment::print_sections_to_mapfile): New function.
9459 (Output_segment::print_section_list_to_mapfile): New function.
9460 * output.h: Include "mapfile.h".
9461 (Output_data::print_to_mapfile): New function.
9462 (Output_data::do_print_to_mapfile): New virtual function.
9463 (Output_segment_headers::do_print_to_mapfile): New function.
9464 (Output_file_header::do_print_to_mapfile): New function.
9465 (Output_data_const::do_print_to_mapfile): New function.
9466 (class Output_data_const_buffer): Add map_name_ field. Update
9467 constructor. Change all callers. Add do_print_to_mapfile
9468 function.
9469 (class Output_data_fixed_space): Likewise.
9470 (class Output_data_space): Likewise.
9471 (class Output_data_zero_fill): New class.
9472 (Output_data_strtab::do_print_to_mapfile): New function.
9473 (Output_data_reloc_base::do_print_to_mapfile): New function.
9474 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9475 (Output_data_group::do_print_to_mapfile): New function.
9476 (Output_data_got::do_print_to_mapfile): New function.
9477 (Output_data_dynamic::do_print_to_mapfile): New function.
9478 (Output_symtab_xindex::do_print_to_mapfile): New function.
9479 (class Output_section): Declare do_print_to_mapflie. Declare
9480 print_to_mapfile in Input_section.
9481 (class Output_segment): Declare new functions.
9482 * object.h (Sized_relobj::symbol_count): New function.
9483 * script-sections.cc
9484 (Output_section_element_dot_assignment::set_section_addresses):
9485 Change Output_data_fixed_space to Output_data_zero_fill.
9486 (Output_data_expression::do_print_to_mapfile): New function.
9487 * script.cc (read_input_script): Add mapfile parameter. Change
9488 all callers.
9489 * script.h (read_input_script): Update declaration.
9490 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9491 (Eh_frame::do_print_to_mapfile): New function.
9492 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9493 (Output_merge_string::do_print_to_mapfile): New function.
9494 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9495 function.
9496 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9497 function.
9498 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9499 function.
9500 * Makefile.am (CCFILES): Add mapfile.cc.
9501 (HFILES): Add mapfile.h.
9502 * Makefile.in: Rebuild.
9503
9f1d377b
ILT
95042008-05-19 Ian Lance Taylor <iant@google.com>
9505
9506 * options.h (class General_options): Add -z relro.
9507 * layout.cc (Layout::Layout): Initialize relro_segment_.
9508 (Layout::add_output_section_data): Return the output section.
9509 (Layout::make_output_section): Rcognize relro sections and mark
9510 them appropriately.
9511 (Layout::attach_allocated_section_to_segment): Put relro sections
9512 in a PT_GNU_RELRO segment.
9513 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9514 section as relro.
9515 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9516 PT_TLS segments.
9517 (Layout::linkonce_mapping): Map d.rel.ro.local to
9518 .data.rel.ro.local.
9519 (Layout::output_section_name): Us .data.rel.ro.local for any
9520 section which begins with that.
9521 * layout.h (class Layout): Update add_output_section_data
9522 declaration. Add relro_segment_ field.
9523 * output.cc (Output_section::Output_section): Initialize is_relro_
9524 and is_relro_local_ fields.
9525 (Output_segment::add_output_section): Group relro sections.
9526 (Output_segment::is_first_section_relro): New function.
9527 (Output_segment::maximum_alignment): If there is a relro section,
9528 align the segment to the common page size.
9529 (Output_segment::set_section_addresses): Track whether we are
9530 looking at relro sections. If the last section is a relro
9531 section, align to the common page size.
9532 (Output_segment::set_section_list_addresses): Add in_relro
9533 parameter. Change all callers. Align to the page size when
9534 moving from relro to non-relro section.
9535 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9536 segment.
9537 * output.h (class Output_section): Add is_relro_ and
9538 is_relro_local_ fields.
9539 (Output_section::is_relro): New function.
9540 (Output_section::set_is_relro): New function.
9541 (Output_section::is_relro_local): New function.
9542 (Output_section::set_is_relro_local): New function.
9543 (class Output_segment): Update declarations.
9544 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9545 * sparc.cc (Target_sparc::got_section): Likewise.
9546 * x86_64.cc (Target_x86_64::got_section): Likewise.
9547 * testsuite/relro_test_main.cc: New file.
9548 * testsuite/relro_test.cc: New file.
9549 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9550 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9551 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9552 (relro_test.so, relro_test_pic.o): New targets.
9553 * testsuite/Makefile.in: Rebuild.
9554
a984ee1d
ILT
95552008-05-16 Ian Lance Taylor <iant@google.com>
9556
01676dcd
ILT
9557 * output.cc (Output_segment::add_output_section): Remove front
9558 parameter.
9559 * output.h (class Output_segment): Remove
9560 add_initial_output_section and overloaded add_output_section.
9561 Update declaration of remaining add_output_section.
9562 * layout.cc (Layout::create_interp): Call add_output_section
9563 rather than add_initial_output_section.
9564 (Layout::finish_dynamic_section): Likewise.
9565
497897f9
ILT
9566 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9567 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9568 know the dynamic type.
9569 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9570 field. Initialize it in constructor.
9571 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9572 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9573 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9574 reloc.
9575
a984ee1d
ILT
9576 * output.cc (Output_reloc::get_address): Change return type to
9577 Elf_Addr.
9578 * output.h (class Output_reloc): Update get_address declaration.
9579 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9580 for section addresses.
9581
55ba0940
ILT
95822008-05-09 Ian Lance Taylor <iant@google.com>
9583
9584 PR 6493
9585 * gold.cc (gold_nomem): Use return value of write.
9586
75517b77
ILT
95872008-05-08 Ian Lance Taylor <iant@google.com>
9588
9589 * symtab.c (Symbol::init_base_output_data): Add version
9590 parameter. Change all callers.
9591 (Symbol::init_base_output_segment): Likewise.
9592 (Symbol::init_base_constant): Likewise.
9593 (Symbol::init_base_undefined): Likewise.
9594 (Sized_symbol::init_output_data): Likewise.
9595 (Sized_symbol::init_output_segment): Likewise.
9596 (Sized_symbol::init_constant): Likewise.
9597 (Sized_symbol::init_undefined): Likewise.
9598 (Symbol_table::do_define_in_output_data): If the new symbol has a
9599 version, mark it as the default.
9600 (Symbol_table::do_define_in_output_segment): Likewise.
9601 (Symbol_table::do_define_as_constant): Likewise.
9602 * symtab.h (class Symbol): Update declarations.
9603 (class Sized_symbol): Likewise.
9604 * resolve.cc (Symbol::override_version): New function.
c42e122e 9605 (Symbol::override_base): Call override_version.
75517b77
ILT
9606 (Symbol::override_base_with_special): Likewise.
9607 * testsuite/ver_script_8.script: New file.
9608 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9609 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9610 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9611 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9612
f1f70eae
ILT
96132008-05-06 Ian Lance Taylor <iant@google.com>
9614
f3e9c5c5
ILT
9615 PR 6049
9616 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9617 functions.
9618 (class General_options): Remove existing --undefined, and add
9619 --no-undefined instead. Add new --undefined as synonym for -u.
9620 * archive.cc (Archive::add_symbols): Check whether symbol was
9621 named with -u.
9622 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9623 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9624 all uses. Add IS_UNDEFINED. Update declarations to split
9625 different versions of init_base. Declare init_base_undefined.
9626 (Symbol::is_defined): Handle IS_UNDEFINED.
9627 (Symbol::is_undefined): Likewise.
9628 (Symbol::is_weak_undefined): Call is_undefined.
9629 (Symbol::is_absolute): Handle IS_CONSTANT.
9630 (class Sized_symbol): Update declarations to split different
9631 versions of init. Declare init_undefined.
9632 (class Symbol_table): Declare new functions.
9633 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9634 Change all callers.
9635 (Symbol::init_base_output_data): Likewise.
9636 (Symbol::init_base_output_segment): Likewise.
9637 (Symbol::init_base_constant): Likewise.
9638 (Symbol::init_base_undefined): New function.
9639 (Sized_symbol::init_object): Rename from init. Change all
9640 callers.
9641 (Sized_symbol::init_output_data): Likewise.
9642 (Sized_symbol::init_output_segment): Likewise.
9643 (Sized_symbol::init_constant): Likewise.
9644 (Sized_symbol::init_undefined): New function.
9645 (Symbol_table::add_undefined_symbols_from_command_line): New
9646 function.
9647 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9648 function.
9649 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9650 (Symbol::output_section): Likewise.
9651 (Symbol::set_output_section): Likewise.
9652 (Symbol_table::sized_finalize_symbol): Likewise.
9653 (Symbol_table::sized_write_globals): Likewise.
9654 * resolve.cc (Symbol_table::should_override): Likewise.
9655 (Symbol::override_base_with_special): Likewise.
9656
8bdcdf2c
ILT
9657 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9658 symbol, change it to have default visibility.
9659 * testsuite/protected_1.cc: New file.
9660 * testsuite/protected_2.cc: New file.
9661 * testsuite/protected_3.cc: New file.
9662 * testsuite/protected_main_1.cc: New file.
9663 * testsuite/protected_main_2.cc: New file.
9664 * testsuite/protected_main_3.cc: New file.
9665 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9666 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9667 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9668 (protected_1.so): New target.
9669 (protected_1_pic.o, protected_2_pic.o): New targets.
9670 (protected_3_pic.o): New target.
9671 (check_PROGRAMS): Add protected_2.
9672 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9673 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9674 * testsuite/Makefile.in: Rebuild.
9675
2b706932
ILT
9676 * options.h (DEFINE_var): Add set_user_set_##varname__.
9677 (DEFINE_bool_alias): New macro.
9678 (class General_options): Define -Bstatic using DEFINE_bool_alias
9679 rather than DEFINE_special. Add --undefined as an alias for -z
9680 defs.
9681 * options.cc (General_options::parse_Bstatic): Remove.
9682
d82a5bcc
ILT
9683 * options.h (class General_options): Add --fatal-warnings.
9684 * main.cc (main): Implement --fatal-warnings.
9685 * errors.h (Errors::warning_count): New function.
9686
f1f70eae
ILT
9687 * options.h (class General_options): Add -Bsymbolic-functions.
9688 * symtab.h (Symbol::is_preemptible): Check for
9689 -Bsymbolic-functions.
9690
8825ac63
ILT
96912008-05-05 Ian Lance Taylor <iant@google.com>
9692
d98bc257
ILT
9693 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9694 as noVARNAME rather than no-VARNAME.
9695 (class General_options): Add option -z combreloc.
9696 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9697 get_address.
9698 (Output_reloc::sort_before) [SHT_REL]: New function.
9699 (Output_reloc::sort_before) [SHT_RELA]: New function.
9700 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9701 Sort_relocs_comparison.
9702 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9703 parameter. Change all callers.
9704 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9705 sort_relocs parameter. Change all callers.
9706 * output.cc (Output_reloc::get_address): New function, broken out
9707 of write_rel.
9708 (Output_reloc::write_rel): Call it.
9709 (Output_reloc::compare): New function.
9710 (Output_data_reloc_base::do_write): Optionally sort relocs.
9711
60b2b4e7
ILT
9712 * configure.ac: If targ_extra_obj is set, link it in.
9713 * configure.tgt: Initialize all variables.
9714 (x86_64*): Set targ_extra_obj and targ_extra_size.
9715 * configure: Rebuild.
9716
8825ac63
ILT
9717 * object.cc (Sized_relobj::include_section_group): Adjust section
9718 indexes read from group data. Build vector to pass to
9719 layout_group.
9720 * layout.cc (Layout::layout_group): Add flags and shndxes
9721 parameters. Remove contents parameter. Change caller. Update
9722 explicit instantiations.
9723 * layout.h (class Layout): Update layout_group declaration.
9724 * output.cc (Output_data_group::Output_data_group): Add flags and
9725 input_shndxes parameters. Remove contents parameter. Change
9726 caller.
9727 (Output_data_group::do_write): Change input_sections_ to
9728 input_shndxes_.
9729 * output.h (class Output_data_group): Update constructor
9730 declaration. Rename input_sections_ to input_shndxes_.
9731 * testsuite/many_sections_test.cc: Add template.
9732
e94cf127
CC
97332008-04-30 Cary Coutant <ccoutant@google.com>
9734
4418b2d5
CC
9735 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9736
e94cf127
CC
9737 * layout.cc (Layout::include_section): Refactored check for debug
9738 info section.
9739 (Layout::add_comdat): Add new parameters. Change type
9740 of signature parameter. Add object and shndx to signatures table.
9741 (Layout::find_kept_object): New function.
9742 * layout.h: Include <cstring>.
9743 (Layout::is_debug_info_section): New function.
9744 (Layout::add_comdat): Add new parameters.
9745 (Layout::find_kept_object): New function.
9746 (Layout::Kept_section): New struct.
9747 (Layout::Signatures): Change type of map range.
9748 * object.cc (Relobj::output_section_address): New function.
9749 (Sized_relobj::include_section_group): Add new parameters. Change
9750 calls to Layout::add_comdat. Change to build table of kept comdat
9751 groups and table mapping discarded sections to kept sections.
9752 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9753 (Sized_relobj::do_layout): Change calls to include_section_group and
9754 include_linkonce_section.
9755 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9756 value to zero when section is discarded.
9757 (Sized_relobj::map_to_kept_section): New function.
9758 * object.h (Relobj::output_section_address): New function.
9759 (Relobj::Comdat_group): New type.
9760 (Relobj::find_comdat_group): New function.
9761 (Relobj::Comdat_group_table): New type.
9762 (Relobj::Kept_comdat_section): New type.
9763 (Relobj::Kept_comdat_section_table): New type.
9764 (Relobj::add_comdat_group): New function.
9765 (Relobj::set_kept_comdat_section): New function.
9766 (Relobj::get_kept_comdat_section): New function.
9767 (Relobj::comdat_groups_): New field.
9768 (Relobj::kept_comdat_sections_): New field.
9769 (Symbol_value::input_value): Update comment.
9770 (Sized_relobj::map_to_kept_section) New function.
9771 (Sized_relobj::include_linkonce_section): Add new parameter.
9772 * target-reloc.h (Comdat_behavior): New type.
9773 (get_comdat_behavior): New function.
9774 (relocate_section): Add code to map a discarded section to the
9775 corresponding kept section when applying a relocation.
9776
e4e5049b
CS
97772008-04-30 Craig Silverstein <csilvers@google.com>
9778
9779 * dwarf_reader.cc (next_generation_count): New static var.
9780 (Addr2line_cache_entry): New struct.
9781 (addr2line_cache): New static var.
9782 (Dwarf_line_info::one_addr2line): Added caching.
9783 (Dwarf_line_info::clear_addr2line_cache): New function.
9784 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9785 cache-size parameter.
9786 (Dwarf_line_info::one_addr2line_cache): New function.
9787 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9788 new cache-size argument to one_addr2line(), and clear cache.
9789
d09e9154
CC
97902008-04-28 Cary Coutant <ccoutant@google.com>
9791
9792 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9793 R_386_PC8 relocations.
9794
7ef73768
ILT
97952008-04-23 Ian Lance Taylor <iant@google.com>
9796
55438702
ILT
9797 * object.cc (Sized_relobj::include_section_group): Check for
9798 invalid section group.
9799
c165fb93
ILT
9800 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9801 header size.
9802
7ef73768
ILT
9803 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9804 than read for file header.
9805 * archive.cc (Archive::include_member): Likewise.
9806
6194aaab
L
98072008-04-23 Paolo Bonzini <bonzini@gnu.org>
9808
9809 * aclocal.m4: Regenerate.
9810 * configure: Regenerate.
9811
d491d34e
ILT
98122008-04-19 Ian Lance Taylor <iant@google.com>
9813
5ea2bac6
ILT
9814 * version.cc (version_string): Bump to 1.6.
9815
7bc3e21a
ILT
9816 * testsuite/Makefile.am (many_sections_r_test): New target.
9817 (many_sections_r_test_SOURCES): Remove.
9818 (many_sections_r_test_DEPENDENCIES): Remove.
9819 (many_sections_r_test_LDFLAGS): Remove.
9820 (many_sections_r_test_LDADD): Remove.
9821
7fcd3aa9
ILT
9822 * object.cc (Sized_relobj::do_add_symbols): Always pass
9823 local_symbol_count_ to add_from_relobj.
9824
4c94d6ae
ILT
9825 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9826 every thousand variables.
9827 * testsuite/Makefile.in: Rebuild.
9828
d491d34e
ILT
9829 * object.cc (Xindex::initialize_symtab_xindex): New function.
9830 (Xindex::read_symtab_xindex): New function.
9831 (Xindex::sym_xindex_to_shndx): New function.
9832 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9833 available.
9834 (Sized_relobj::do_initialize_xindex): New function.
9835 (Sized_relobj::do_read_symbols): Adjust section links.
9836 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9837 parameter. Change all callers.
9838 (Sized_relobj::include_section_group): Adjust section links and
9839 symbol section indexes.
9840 (Sized_relobj::do_layout): Adjust section links.
9841 (Sized_relobj::do_count_local_symbols): Adjust section links and
9842 symbol section indexes.
9843 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9844 ordinary and special symbols.
9845 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9846 dynsym_xindex parameters. Change all callers. Adjust section
9847 links. Use SHN_XINDEX when needed.
9848 (Sized_relobj::get_symbol_location_info): Adjust section links.
9849 Don't get fooled by special symbols.
9850 * object.h (class Xindex): Define.
9851 (class Object): Add xindex_ parameter. Declare virtual functoin
9852 do_initialize_xindex.
9853 (Object::adjust_sym_shndx): New function.
9854 (Object::set_xindex): New protected function.
9855 (class Symbol_value): Add is_ordinary_shndx_ field.
9856 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9857 (Symbol_value::value): Assert ordinary section.
9858 (Symbol_value::initialize_input_to_output_map): Likewise.
9859 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9860 Change all callers.
9861 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9862 all callers.
9863 (class Sized_relobj): Update declarations.
9864 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9865 parameter. Change all callers.
9866 (Sized_relobj::adjust_shndx): New function.
9867 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9868 field.
9869 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9870 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9871 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9872 (Sized_dynobj::read_dynsym_section): Adjust section links.
9873 (Sized_dynobj::read_dynamic): Likewise.
9874 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9875 section links.
9876 (Sized_dynobj::do_initialize_xindex): New function.
9877 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9878 do_initialize_xindex.
9879 (Sized_dynobj::adjust_shndx): New function.
9880 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9881 dynsym_xindex_ fields.
9882 (Layout::finalize): Add a call to set_section_indexes before
9883 creating the symtab sections.
9884 (Layout::set_section_indexes): Don't do anything if the section
9885 already has a section index.
9886 (Layout::create_symtab_sections): Add shnum parameter. Change
9887 caller. Create .symtab_shndx section if needed.
9888 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9889 caller.
9890 (Layout::allocated_output_section_count): New function.
9891 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9892 needed.
9893 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9894 fields. Update declarations.
9895 (Layout::symtab_xindex): New function.
9896 (Layout::dynsym_xindex): New function.
9897 (class Write_symbols_task): Add layout_ field.
9898 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9899 Change caller.
9900 * output.cc (Output_section_headers::Output_section_headers): Add
9901 shstrtab_section parameter. Change all callers.
9902 (Output_section_headers::do_sized_write): Store overflow values
9903 for section count and section string table section index in
9904 section header zero.
9905 (Output_file_header::do_sized_write): Check for overflow of
9906 section count and section string table section index.
9907 (Output_symtab_xindex::do_write): New function.
9908 (Output_symtab_xindex::endian_do_write): New function.
9909 * output.h (class Output_section_headers): Add shstrtab_section_.
9910 Update declarations.
9911 (class Output_symtab_xindex): Define.
9912 (Output_section::has_out_shndx): New function.
9913 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9914 field.
9915 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9916 Change all callers.
9917 (Sized_symbol::init): Likewise.
9918 (Symbol::output_section): Check for ordinary symbol.
9919 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9920 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9921 callers.
9922 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9923 Change all callers. Simplify handling of symbols from sections
9924 not included in the link.
9925 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9926 distinction.
9927 (Weak_alias_sorter::operator()): Assert that symbols are
9928 ordinary.
9929 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9930 distinction.
9931 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9932 parameters. Change all callers.
9933 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9934 symbol distinction. Use SHN_XINDEX when needed.
9935 (Symbol_table::write_section_symbol): Add symtab_xindex
9936 parameter. Change all callers.
9937 (Symbol_table::sized_write_section_symbol): Likewise. Use
9938 SHN_XINDEX when needed.
9939 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9940 declarations.
9941 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9942 (Symbol::is_defined): Check is_ordinary.
9943 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9944 (Symbol::is_absolute, Symbol::is_common): Likewise.
9945 (class Sized_symbol): Update declarations.
9946 (class Symbol_table): Update declarations.
9947 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9948 parameters. Change all callers.
9949 (Sized_symbol::override): Likewise.
9950 (Symbol_table::override): Likewise.
9951 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9952 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9953 is_ordinary, and orig_st_shndx parameters. Change all callers.
9954 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9955 to be in an ordinary section.
9956 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9957 object and is_ordinary parameters. Change all callers.
9958 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9959 Change all callers. Don't add undefined or non-ordinary symbols
9960 to reloc_map_.
9961 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9962 Change all callers.
9963 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9964 declarations.
9965 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9966 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9967 (Sized_relobj::relocate_sections): Likewise.
9968 * target-reloc.h (scan_relocs): Adjust section symbol index.
9969 (scan_relocatable_relocs): Likewise.
9970 * i386.cc (Scan::local): Check for ordinary symbols.
9971 * sparc.cc (Scan::local): Likewise.
9972 * x86_64.cc (Scan::local): Likewise.
9973 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9974 to symbol_section_and_value.
9975 * testsuite/many_sections_test.cc: New file.
9976 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9977 (check_PROGRAMS): Add many_sections_test.
9978 (many_sections_test_SOURCES): Define.
9979 (many_sections_test_DEPENDENCIES): Define.
9980 (many_sections_test_LDFLAGS): Define.
9981 (BUILT_SOURCES): Add many_sections_define.h.
9982 (many_sections_define.h): New target.
9983 (BUILT_SOURCES): Add many_sections_check.h.
9984 (many_sections_check.h): New target.
9985 (check_PROGRAMS): Add many_sections_r_test.
9986 (many_sections_r_test_SOURCES): Define.
9987 (many_sections_r_test_DEPENDENCIES): Define.
9988 (many_sections_r_test_LDFLAGS): Define.
9989 (many_sections_r_test_LDADD): Define.
9990 (many_sections_r_test.o): New target.
9991 * testsuite/Makefile.in: Rebuild.
9992
c5818ff1
CC
99932008-04-17 Cary Coutant <ccoutant@google.com>
9994
9995 * errors.cc (Errors::info): New function.
9996 (gold_info): New function.
9997 * errors.h (Errors::info): New function.
9998 * gold.h (gold_info): New function.
9999 * object.cc (Input_objects::add_object): Print trace output.
10000 * options.cc (options::parse_set): New function.
10001 (General_options::parse_wrap): Deleted.
10002 (General_options::General_options): Deleted initializer.
10003 * options.h (options::String_set): New typedef.
10004 (options::parse_set): New function.
10005 (DEFINE_set): New macro.
10006 (General_options::wrap): Changed to use DEFINE_set. Changed
10007 callers of any_wrap_symbols and is_wrap_symbol.
10008 (General_options::trace, General_options::trace_symbol):
10009 New options.
10010 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10011 (General_options::wrap_symbols_): Deleted.
10012 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10013
b5be4a7c
DM
100142008-04-17 David S. Miller <davem@davemloft.net>
10015
10016 * options.cc (General_options::parse_V): New function.
10017 * options.h: Add entries for -V and -Qy.
10018
155a0dd7
ILT
100192008-04-17 Ian Lance Taylor <iant@google.com>
10020
10021 * common.cc (Symbol_table::allocate_commons): Remove options
10022 parameter. Change caller.
10023 (Symbol_table::do_allocate_commons): Remove options parameter.
10024 Change caller. Just call do_allocate_commons_list twice.
10025 (Symbol_table::do_allocate_commons_list): New function, broken out
10026 of do_allocate_commons.
10027 * common.h (class Allocate_commons_task): Remove options_ field.
10028 Update constructor.
10029 * symtab.cc (Symbol_table::Symbol_table): Initialize
10030 tls_commons_.
10031 (Symbol_table::add_from_object): Put TLS common symbols on
10032 tls_commons_ list.
10033 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10034 which are IN_OUTPUT_DATA.
10035 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10036 allocate_commons and do_allocate_commons declarations. Declare
10037 do_allocate_commons_list.
10038 * gold.cc (queue_middle_tasks): Update creation of
10039 Allocate_commons_task to not pass options.
10040 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10041 (TLS_TEST_C_FLAGS): New variable.
10042 (tls_test_c_pic.o): New target.
10043 (tls_test_shared.so): Link in tls_test_c_pic.o.
10044 (tls_test_c_pic_ie.o): New target.
10045 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10046 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10047 (tls_test_c.o): New target.
10048 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10049 (tls_pic_test_LDADD): Likewise.
10050 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10051 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10052 (tls_test_c_gnu2.o): New target.
10053 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10054 tls_test_c_gnu2.o.
10055 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10056 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10057 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10058 * testsuite/tls_test.cc: Include "config.h".
10059 (t_last): Call t11_last.
10060 * testsuite/tls_test.h (t11, t11_last): Declare.
10061 * testsuite/tls_test_c.c: New file.
10062 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10063 * configure.ac: Check for OpenMP support.
10064 * configure, config.in, Makefile.in: Rebuild.
10065 * testsuite/Makefile.in: Rebuild.
10066
edfbb029
CC
100672008-04-16 Cary Coutant <ccoutant@google.com>
10068
10069 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10070 (Target_i386::tls_base_symbol_defined_): New field.
10071 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10072 (Target_i386::Scan::global): Likewise.
10073 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10074 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10075 (Target_x86_64::tls_base_symbol_defined_): New field.
10076 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10077 (Target_x86_64::Scan::global): Likewise.
10078
f3c69fca
CC
100792008-04-16 Cary Coutant <ccoutant@google.com>
10080
10081 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10082 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10083 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10084 building shared libraries.
10085 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10086 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10087 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10088 * testsuite/Makefile.in: Rebuild.
10089 * testsuite/weak_undef.h: New file.
10090 * testsuite/weak_undef_file1.cc: Add extra test cases.
10091 * testsuite/weak_undef_file2.cc: Likewise.
10092 * testsuite/weak_undef_test.cc: Likewise.
10093
7c414435
DM
100942008-04-16 David S. Miller <davem@davemloft.net>
10095
32b769e1
DM
10096 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10097 Add issued_non_pic_error_ field. Declare check_non_pic.
10098 (Target_sparc::Scan::check_non_pic): New function.
10099 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10100 (Target_sparc::Scan::global): Likewise.
10101
11936fb1
DM
10102 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10103 * configure: Rebuild.
10104
7c414435
DM
10105 * options.h (DEFINE_enable): New macro.
10106 (new_dtags): New enable option.
10107 (initfirst, interpose, loadfltr, nodefaultlib,
10108 nodelete, nodlopen, nodump): New -z options.
10109 * layout.cc (Layout:finish_dynamic_section): If new
10110 dtags enabled, emit DT_RUNPATH. Also, emit a
10111 DT_FLAGS_1 containing any specified -z flags.
10112
85c7bf8b
ILT
101132008-04-16 Ian Lance Taylor <iant@google.com>
10114
12c0daef
ILT
10115 * copy-relocs.cc: New file.
10116 * copy-relocs.h: New file.
10117 * reloc.cc: Remove Copy_relocs code.
10118 * reloc.h: Likewise.
10119 * reloc-types.h (struct Reloc_types) [both versions]: Add
10120 get_reloc_addend_noerror.
10121 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10122 variants of add_global which take an addend which must be zero.
10123 * i386.cc: Include "copy-relocs.h".
10124 (class Target_i386): Change type of copy_relocs_ to variable,
10125 update initializer.
10126 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10127 Change all callers.
10128 (Target_i386::do_finalize_sections): Change handling of
10129 copy_relocs_.
10130 * sparc.cc: Include "copy-relocs.h".
10131 (class Target_sparc): Change type of copy_relocs_ to variable,
10132 update initializer.
10133 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10134 Change all callers.
10135 (Target_sparc::do_finalize_sections): Change handling of
10136 copy_relocs_.
10137 * x86_64.cc: Include "copy-relocs.h".
10138 (class Target_x86_64): Change type of copy_relocs_ to variable,
10139 update initializer.
10140 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10141 class. Change all callers.
10142 (Target_x86_64::do_finalize_sections): Change handling of
10143 copy_relocs_.
10144 * Makefile.am (CCFILES): Add copy-relocs.cc.
10145 (HFILES): Add copy-relocs.h.
10146
4f4995b6
ILT
10147 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10148
85c7bf8b
ILT
10149 * testsuite/script_test_4.sh: Permit leading zeroes.
10150
4f2a9edd
ILT
101512008-04-15 Ian Lance Taylor <iant@google.com>
10152
e6188289
ILT
10153 * script-sections.cc (Script_sections::create_segments): Use
10154 header_size_adjustment even when there is enough room for the
10155 headers.
10156 * testsuite/script_test_4.sh: New file.
10157 * testsuite/script_test_4.t: New file.
10158 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10159 (check_DATA): Add script_test_4.stdout.
10160 (MOSTLYCLEANFILES): Likewise.
10161 (script_test_4): New target.
10162 (script_test_4.stdout): New target.
10163 * testsuite/Makefile.in: Rebuild.
10164
4f2a9edd
ILT
10165 * sparc.cc: Add definitions for Output_data_plt_sparc class
10166 constants.
10167
f5314dd5
DM
101682008-04-14 David S. Miller <davem@davemloft.net>
10169
10170 * sparc.cc: New file.
10171 * Makefile.am (TARGETSOURCES): Add sparc.cc
10172 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10173 * configure.tgt: Document targ_extra_size and
10174 targ_extra_big_endian. Add entries for sparc-* and
10175 sparc64-*.
10176 * configure.ac: Handle targ_extra_size and
10177 targ_extra_big_endian.
10178 * Makefile.in: Rebuild.
10179 * configure: Likewise.
10180 * po/POTFILES.in: Likewise.
10181 * po/gold.pot: Likewise.
10182
154e0e9a
ILT
101832008-04-14 Ian Lance Taylor <iant@google.com>
10184
10185 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10186 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10187 in the name/type/flags to section mapping. Don't call
10188 allocate_output_section.
10189 (Layout::choose_output_section): Change parameter from adjust_name
10190 to is_input_section. Don't permit input sections after sections
10191 are attached to segments. Don't call allocate_output_section.
10192 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10193 not write_enable_output_section.
10194 (Layout::make_output_section): Don't push to
10195 unattached_section_list_ nor call attach_to_segment. Call
10196 attach_section_to_segment if sections are attached.
10197 (Layout::attach_sections_to_segments): New function.
10198 (Layout::attach_section_to_segment): New function.
10199 (Layout::attach_allocated_section_to_segment): Rename from
10200 attach_to_segment. Remove flags parameter.
10201 (Layout::allocate_output_section): Remove function.
10202 (Layout::write_enable_output_section): Remove function.
10203 * layout.h (class Layout): Update for above changes. Add new
10204 field sections_are_attached_.
10205 * output.h (Output_section::update_flags_for_input_section): New
10206 function.
10207 * output.cc (Output_section::add_input_section): Call
10208 update_flags_for_input_section.
10209 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10210
009a67a2
CC
102112008-04-11 Cary Coutant <ccoutant@google.com>
10212
10213 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10214 thought unnecessary.
10215 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10216
759b1a24
ILT
102172008-04-11 Ian Lance Taylor <iant@google.com>
10218
10219 * output.h (class Output_section_data): Remove inline definition
10220 of set_addralign.
10221 * output.cc (Output_section_data::set_addralign): New function.
10222
c2b45e22
CC
102232008-04-11 Cary Coutant <ccoutant@google.com>
10224
10225 Add support for TLS descriptors for i386 and x86_64.
10226 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10227 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10228 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10229 GOT_TYPE_TLS_DESC.
10230 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10231 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10232 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10233 relocations.
10234 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10235 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10236 Fix problem with initial-exec relocations.
10237 (Target_i386::Relocate::relocate_tls): Likewise.
10238 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10239 relaxation.
10240 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10241 support for section-plus-offset dynamic table entries.
10242 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10243 (Output_data_dynamic::Dynamic_entry): Add support for
10244 section-plus-offset dynamic table entries.
10245 (Output_data_dynamic::Classification): Likewise.
10246 (Output_data_dynamic::classification_): Renamed offset_.
10247 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10248 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10249 (Target_x86_64::make_plt_section): New function.
10250 (Target_x86_64::reserve_tlsdesc_entries): New function.
10251 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10252 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10253 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10254 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10255 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10256 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10257 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10258 add extra PLT entry for TLS descriptors.
10259 (Output_data_plt_x86_64::got_): New field.
10260 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10261 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10262 fields.
10263 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10264 descriptors.
10265 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10266 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10267 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10268 R_386_TLS_DESC_CALL relocations.
10269 (Target_x86_64::Scan::global): Likewise.
10270 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10271 for TLS descriptors.
10272 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10273 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10274 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10275 GD-to-IE relaxation.
10276 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10277 and TLS_DESCRIPTORS.
10278 * Makefile.in: Rebuild.
10279 * configure: Rebuild.
10280 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10281 (tls_test_shared2.so): New target.
10282 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10283 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10284 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10285 (tls_shared_gd_to_ie_test_LDADD): New variable.
10286 (tls_shared_gnu2_gd_to_ie_test): New target.
10287 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10288 New targets.
10289 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10290 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10291 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10292 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10293 (tls_shared_gnu2_test): New target.
10294 (tls_test_gnu2_shared.so): New target.
10295 (tls_shared_gnu2_test_SOURCES): New variable.
10296 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10297 (tls_shared_gnu2_test_LDFLAGS): New variable.
10298 (tls_shared_gnu2_test_LDADD): New variable.
10299 * testsuite/Makefile.in: Rebuild.
10300 * testsuite/Makefile.
10301
83bfb6b7
ILT
103022008-04-11 Ian Lance Taylor <iant@google.com>
10303
10304 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10305 justsyms.t.
10306 * testsuite/Makefile.in: Rebuild.
10307
10308 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10309 long.
10310 * testsuite/script_test_2.cc (main): Adjust test.
10311
706e1f5e
ILT
103122008-04-11 David S. Miller <davem@davemloft.net>
10313 Ian Lance Taylor <iant@google.com>
10314
10315 * options.h (General_options): Add entries for '-Y' and
10316 '-relax'.
10317 * options.cc (General_options:finalize): If -Y was used, add those
10318 entries to the library path instead of the default "/lib" and
10319 "/usr/lib".
10320
7c98e6bb
DM
103212008-04-11 David S. Miller <davem@davemloft.net>
10322
10323 * testsuite/justsyms.t: Start at 0x100.
10324 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10325 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10326 long.
10327 * testsuite/script_test_2.cc: Adjust string and section length
10328 checks.
7c98e6bb 10329
99a37bfd
ILT
103302008-04-09 Ian Lance Taylor <iant@google.com>
10331
2cefc357
ILT
10332 PR gold/5996
10333 * script-sections.cc (Sections_element::allocate_to_segment): Add
10334 orphan parameter.
10335 (Output_section_definition::allocate_to_segment): Likewise.
10336 (Orphan_output_section::allocate_to_segment): Likewise.
10337 (Script_sections::attach_sections_using_phdrs_clause): Don't
10338 propagate non-PT_LOAD segments to orphan sections.
10339 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10340 readelf rather than objdump.
10341 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10342 .interp section and PT_INTERP segment are the same size.
10343 * testsuite/Makefile.in: Rebuild.
10344
99a37bfd
ILT
10345 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10346 aliases for symbols defined in the same object.
10347 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10348 (weak_alias_test_SOURCES): New variable.
10349 (weak_alias_test_DEPENDENCIES): New variable.
10350 (weak_alias_test_LDFLAGS): New variable.
10351 (weak_alias_test_LDADD): New variable.
10352 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10353 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10354 (weak_alias_test_3.o): New target.
10355 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10356 * testsuite/weak_alias_test_main.cc: New file.
10357 * testsuite/weak_alias_test_1.cc: New file.
10358 * testsuite/weak_alias_test_2.cc: New file.
10359 * testsuite/weak_alias_test_3.cc: New file.
10360
780e49c5
ILT
103612008-04-08 Ian Lance Taylor <iant@google.com>
10362
cdb0b8f5
ILT
10363 * options.h (class General_options): Add --noinhibit-exec option.
10364 * main.cc (main): Check --noinhibit-exec.
10365
0864d551
ILT
10366 * options.h (class General_options): Define --wrap as a special
10367 option. Add wrap_symbols_ field.
10368 (General_options::any_wrap_symbols): New function.
10369 (General_options::is_wrap_symbol): New function.
10370 * options.cc (General_options::parse_wrap): New function.
10371 (General_options::General_options): Initialize wrap_symbols_.
10372 * symtab.cc (Symbol_table::wrap_symbol): New function.
10373 (Symbol_table::add_from_object): Handle --wrap.
10374 * symtab.h (class Symbol_table): Declare wrap_symbol.
10375 * target.h (Target::wrap_char): New function.
10376 (Target::Target_info): Add wrap_char field.
10377 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10378 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10379 * testsuite/testfile.cc (Target_test::test_target_info):
10380 Likewise.
10381
789aa6de
ILT
10382 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10383 there is one.
10384
2c38906f
ILT
10385 * layout.h (class Layout): Add added_eh_frame_data_ field.
10386 * layout.cc (Layout::Layout): Initialize new field.
10387 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10388 output section until we find a section we merged successfully.
10389 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10390 that the size be non-zero.
10391
780e49c5
ILT
10392 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10393 qualifier.
10394
7fcd0256
ILT
103952008-04-08 Craig Silverstein <csilvers@google.com>
10396
10397 * configure.ac: Export new conditional variable HAVE_ZLIB.
10398 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10399 on HAVE_ZLIB.
10400 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10401 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10402
6835af53
ILT
104032008-04-07 Ian Lance Taylor <iant@google.com>
10404
e24f324c
ILT
10405 * version.cc (version_string): Set to "1.5".
10406
a036edd8
ILT
10407 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10408 Add issued_non_pic_error_ field. Declare check_non_pic.
10409 (Target_x86_64::Scan::check_non_pic): New function.
10410 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10411 (Target_x86_64::Scan::global): Likewise.
10412
624f8810
ILT
10413 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10414 addend parameter. Change caller. Handle merge sections.
10415 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10416 Address to Addend. Don't add in the result of
10417 local_section_offset, pass down the addend and use the returned
10418 value.
10419 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10420 Update declarations of local_section_offset and symbol_value.
10421 * testsuite/two_file_test_1.cc (t18): New function.
10422 * testsuite/two_file_test_2.cc (f18): New function.
10423 * testsuite/two_file_test_main.cc (main): Call t18.
10424 * testsuite/two_file_test.h (t18, f18): Declare.
10425
6835af53
ILT
10426 * configure.ac: Don't test for objdump, c++filt, or readelf.
10427 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10428 conditionals.
10429 (TEST_READELF): New variable.
10430 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10431 (check_PROGRAMS): Add two_file_strip_test.
10432 (two_file_strip_test): New target.
10433 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10434 (two_file_same_shared_strip_test_SOURCES): New variable.
10435 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10436 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10437 (two_file_same_shared_strip_test_LDADD): New variable.
10438 (two_file_shared_strip.so): New target.
10439 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10440 (ver_test_5.syms, ver_test_7.syms): Likewise.
10441 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10442 (strip_test_3.stdout): Use TEST_OBJDUMP.
10443 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10444
86925eef
CC
104452008-04-04 Cary Coutant <ccoutant@google.com>
10446
10447 * symtab.h (Symbol::is_weak_undefined): New function.
10448 (Symbol::is_strong_undefined): New function.
10449 (Symbol::is_absolute): New function.
10450 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10451 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10452 absolute symbols.
10453 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10454 (weak_undef_test): New target.
10455 * testsuite/Makefile.in: Rebuild.
10456 * testsuite/weak_undef_file1.cc: New file.
10457 * testsuite/weak_undef_file2.cc: New file.
10458 * testsuite/weak_undef_test.cc: New file.
10459
126f3ece
ILT
104602008-04-03 Craig Silverstein <csilvers@google.com>
10461
10462 * compressed_output.h (class Output_compressed_section): Use
10463 unsigned buffer.
10464 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10465 add zlib header.
10466 (zlib_compressed_suffix): Removed.
10467 (Output_compressed_section::set_final_data_size): Use unsigned
10468 buffers.
10469 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10470 Fix linker invocation.
10471 (flagstest_o_specialfile_and_compress_debug_sections):
10472 Likewise.
10473 * testsuite/Makefile.in: Regenerated.
10474
deae2a14
DM
104752008-04-02 David S. Miller <davem@davemloft.net>
10476
10477 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10478 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10479
70752818
ILT
104802008-04-02 Craig Silverstein <csilvers@google.com>
10481
10482 * TODO: New file.
10483
39d0cb0e
ILT
104842008-04-02 Ian Lance Taylor <iant@google.com>
10485
10486 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10487 parameters. Update for new key type to views_. Change all
10488 callers.
10489 (File_read::read): Adjust for byteshift in returned view.
10490 (File_read::add_view): New function, broken out of
10491 find_and_make_view.
10492 (File_read::make_view): New function, broken out of
10493 find_and_make_view.
10494 (File_read::find_or_make_view): Add offset and aligned
10495 parameters. Rewrite accordingly. Change all callers.
10496 (File_read::get_view): Add offset and aligned parameters. Adjust
10497 for byteshift in return value.
10498 (File_read::get_lasting_view): Likewise.
10499 * fileread.h (class File_read): Update declarations.
10500 (class File_read::View): Add byteshift_ field. Add byteshift to
10501 constructor. Add byteshift method.
10502 * archive.h (Archive::clear_uncached_views): New function.
10503 (Archive::get_view): Add aligned parameter. Change all callers.
10504 * object.h (Object::get_view): Add aligned parameter. Change all
10505 callers.
10506 (Object::get_lasting_view): Likewise.
10507
10508 * fileread.cc (File_read::release): Don't call clear_views if
10509 there are multiple objects.
10510 * fileread.h (File_read::clear_uncached_views): New function.
10511 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10512 on the archive.
10513
a1207466
CC
105142008-03-31 Cary Coutant <ccoutant@google.com>
10515
10516 Add thin archive support.
10517 * archive.cc (Archive::armagt): New const.
10518 (Archive::setup): Remove task parameter and calls to unlock.
10519 (Archive::unlock_nested_archives): New function.
10520 (Archive::read_header): Add nested_off parameter. Change
10521 all callers.
10522 (Archive::interpret_header): Likewise.
10523 (Archive::include_all_members): Change to handle thin
10524 archives.
10525 (Archive::include_member): Likewise.
10526 * archive.h (Archive::Archive): Add new parameters and
10527 initializers.
10528 (Archive::armagt): New const.
10529 (Archive::setup): Remove task parameter.
10530 (Archive::unlock_nested_archives): New function.
10531 (Archive::read_header): Add nested_off parameter.
10532 (Archive::interpret_header): Likewise.
10533 (Archive::Nested_archive_table): New typedef.
10534 (Archive::is_thin_archive_): New field.
10535 (Archive::nested_archives_): New field.
10536 (Archive::options_): New field.
10537 (Archive::dirpath_): New field.
10538 (Archive::task_): New field.
10539 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10540 for thin archives. Pass additional parameters to
10541 Archive::Archive. Unlock the archive file after calling
10542 Archive::setup.
cd536b21 10543
479f6503
ILT
105442008-03-29 Ian Lance Taylor <iant@google.com>
10545
686c8caf
ILT
10546 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10547 version symbol to be local.
10548 * testsuite/ver_test_4.sh: New file.
10549 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10550 (check_DATA): Add ver_test_4.syms.
10551 (ver_test_4.syms): New target.
10552 * testsuite/Makefile.in: Rebuild.
10553
ab794b6b
ILT
10554 * output.cc
10555 (Output_section::Input_section_sort_entry::has_priority): New
10556 function.
10557 (Output_section::Input_section_sort_entry::match_file_name): New
10558 function.
10559 (Output_section::Input_section_sort_entry::match_section_name):
10560 Remove.
10561 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10562 Remove.
10563 (Output_section::Input_section_sort_entry::match_section_file):
10564 Remove.
10565 (Output_section::Input_section_sort_compare::operator()): Rewrite
10566 using new Input_section_sort_entry functions. Sort crtbegin and
10567 crtend first. Sort sections with no priority before sections with
10568 a priority.
10569 * testsuite/initpri1.c (d3): Check j != 4.
10570 (cd5): New constructor/destructor function.
10571 (main): Check j != 2.
10572
479f6503
ILT
10573 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10574 new symbol when resolving, don't call set_is_default.
10575 * testsuite/ver_test_7.cc: New file.
10576 * testsuite/ver_test_7.sh: New file.
10577 * testsuite/Makefile.am (ver_test_7.so): New target.
10578 (ver_test_7.o): New target.
10579 (check_SCRIPTS): Add ver_test_7.sh.
10580 (check_DATA): Add ver_test_7.syms.
10581 (ver_test_7.syms): New target.
10582
2fd32231
ILT
105832008-03-28 Ian Lance Taylor <iant@google.com>
10584
10585 * layout.cc (Layout::layout): If we see an input section with a
10586 name that needs sorting, set the must_sort flag for the output
10587 section.
10588 (Layout::make_output_section): If the name of the output section
10589 indicates that it might require sorting, set the may_sort flag.
10590 * output.h (Output_section::may_sort_attached_input_sections): New
10591 function.
10592 (Output_section::set_may_sort_attached_input_sections): New
10593 function.
10594 (Output_section::must_sort_attached_input_sections): New
10595 function.
10596 (Output_section::set_must_sort_attached_input_sections): New
10597 function.
10598 (class Output_section): Declare Input_section_sort_entry. Define
10599 Input_section_sort_compare. Declare
10600 sort_attached_input_sections. Add new fields:
10601 may_sort_attached_input_sections_,
10602 must_sort_attached_input_sections_,
10603 attached_input_sections_are_sorted_.
10604 * output.cc (Output_section::Output_section): Initialize new
10605 fields.
10606 (Output_section::add_input_section): Add an entry to
10607 input_sections_ if may_sort or must_sort are true.
10608 (Output_section::set_final_data_size): Call
10609 sort_attached_input_sections if necessary.
10610 (Output_section::Input_section_sort_entry): Define new class.
10611 (Output_section::Input_section_sort_compare::operator()): New
10612 function.
10613 (Output_section::sort_attached_input_sections): New function.
10614 * configure.ac: Check whether the compiler supports constructor
10615 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10616 * testsuite/initpri1.c: New file.
10617 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10618 CONSTRUCTOR_PRIORITY.
10619 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10620 (initpri1_LDFLAGS): New variable.
10621 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10622
18e6b24e
ILT
106232008-03-27 Ian Lance Taylor <iant@google.com>
10624
49bdd526
ILT
10625 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10626 * testsuite/common_test_1.c: New file.
10627 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10628 (common_test_1_SOURCES): New variable.
10629 (common_test_1_DEPENDENCIES): New variable.
10630 (common_test_1_LDFLAGS): New variable.
10631
18e6b24e
ILT
10632 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10633 and commons_ correctly when NAME/VERSION does not override
10634 NAME/NULL.
10635 * testsuite/ver_test_6.c: New file.
10636 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10637 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10638 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10639
04bf7072
ILT
106402008-03-26 Ian Lance Taylor <iant@google.com>
10641
5871526f
ILT
10642 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10643 of an undefined symbol from a version script.
10644 * testsuite/Makefile.am (ver_test_5.so): New target.
10645 (ver_test_5.o): New target.
10646 (check_SCRIPTS): Add ver_test_5.sh.
10647 (check_DATA): Add ver_test_5.syms.
10648 (ver_test_5.syms): New target.
10649 * testsuite/ver_test_5.cc: New file.
10650 * testsuite/ver_test_5.script: New file.
10651 * testsuite/ver_test_5.sh: New file.
10652 * Makefile.in, testsuite/Makefile.in: Rebuild.
10653
04bf7072
ILT
10654 PR gold/5986
10655 Fix problems building gold with gcc 4.3.0.
10656 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10657 (gold_error_at_location, gold_warning_at_location): Use it.
10658 * configure.ac: Check whether we can compile and use a template
10659 function with a printf attribute.
10660 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10661 when jumping over bytes.
10662 * object.cc: Instantiate Object::read_section_data.
10663 * debug.h: Include <cstring>
10664 * dwarf_reader.cc: Include <algorithm>
10665 * main.cc: Include <cstring>.
10666 * options.cc: Include <cstring>.
10667 * output.cc: Include <cstring>.
10668 * script.cc: Include <cstring>.
10669 * script.h: Include <string>.
10670 * symtab.cc: Include <cstring> and <algorithm>.
10671 * target-select.cc: Include <cstring>.
10672 * version.cc: Include <string>.
10673 * testsuite/testmain.cc: Include <cstdlib>.
10674 * configure, config.in: Rebuild.
10675
874c5b28
ILT
106762008-03-25 Ian Lance Taylor <iant@google.com>
10677
819d6c3a
ILT
10678 * options.cc: Include "../bfd/bfdver.h".
10679 (options::help): Print bug reporting address.
10680
f4b2c6f5
ILT
10681 * version.cc (print_version): Adjust output for current value of
10682 BFD_VERSION_STRING.
10683
10684 * NEWS: New file.
10685
e96caa79
ILT
10686 * options.cc (options::help): Print list of supported targets.
10687 * target-select.h: Include <vector>.
10688 (class Target_selector): Make machine_, size_, and is_big_endian_
10689 fields const. Add bfd_name_ and instantiated_target_ fields.
10690 (Target_selector::Target_selector): Add bfd_name parameter.
10691 (Target_selector::recognize): Make non-virtual, call
10692 do_recognize.
10693 (Target_selector::recognize_by_name): Make non-virtual, call
10694 do_recognize_by_name.
10695 (Target_selector::supported_names): New function.
10696 (Target_selector::bfd_name): New function.
10697 (Target_selector::do_instantiate_target): New pure virtual
10698 function.
10699 (Target_selector::do_recognize): New virtual function.
10700 (Target_selector::do_recognize_by_name): New virtual function.
10701 (Target_selector::instantiate_target): New private function.
10702 (supported_target_names): Declare.
10703 * target-select.cc (Target_selector::Target_selector): Update for
10704 new parameter and fields.
10705 (select_target_by_name): Check that the name matches before
10706 calling recognize_by_name.
10707 (supported_target_names): New function.
10708 * i386.cc (class Target_selector_i386): Update Target_selector
10709 constructor call. Remove recognize and recognize_by_name. Add
10710 do_instantiate_target.
10711 * x86_64.cc (class Target_selector_x86_64): Likewise.
10712 * testsuite/testfile.cc (class Target_selector_test): Update for
10713 changes to Target_selector.
10714
874c5b28
ILT
10715 * README: Rewrite, with some notes on unsupported features.
10716
0a65a3a7
CC
107172008-03-24 Cary Coutant <ccoutant@google.com>
10718
10719 * i386.cc (Target_i386::Got_type): New enum declaration.
10720 (Target_i386::Scan::local): Updated callers of Output_data_got
10721 member functions.
10722 (Target_i386::Scan::global): Likewise.
10723 (Target_i386::Relocate::relocate): Likewise.
10724 (Target_i386::Relocate::relocate_tls): Likewise.
10725 * object.h (Got_offset_list): New class.
10726 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10727 (Sized_relobj::local_got_offset): Likewise.
10728 (Sized_relobj::set_local_got_offset): Likewise.
10729 (Sized_relobj::local_has_tls_got_offset): Removed.
10730 (Sized_relobj::local_tls_got_offset): Removed.
10731 (Sized_relobj::set_local_tls_got_offset): Removed.
10732 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10733 * output.cc (Output_data_got::add_global): Added got_type parameter.
10734 (Output_data_got::add_global_with_rel): Likewise.
10735 (Output_data_got::add_global_with_rela): Likewise.
10736 (Output_data_got::add_global_pair_with_rel): New function.
10737 (Output_data_got::add_global_pair_with_rela): New function.
10738 (Output_data_got::add_local): Added got_type parameter.
10739 (Output_data_got::add_local_with_rel): Likewise.
10740 (Output_data_got::add_local_with_rela): Likewise.
10741 (Output_data_got::add_local_pair_with_rel): New function.
10742 (Output_data_got::add_local_pair_with_rela): New function.
10743 (Output_data_got::add_global_tls): Removed.
10744 (Output_data_got::add_global_tls_with_rel): Removed.
10745 (Output_data_got::add_global_tls_with_rela): Removed.
10746 (Output_data_got::add_local_tls): Removed.
10747 (Output_data_got::add_local_tls_with_rel): Removed.
10748 (Output_data_got::add_local_tls_with_rela): Removed.
10749 * output.h (Output_data_got::add_global): Added got_type parameter.
10750 (Output_data_got::add_global_with_rel): Likewise.
10751 (Output_data_got::add_global_with_rela): Likewise.
10752 (Output_data_got::add_global_pair_with_rel): New function.
10753 (Output_data_got::add_global_pair_with_rela): New function.
10754 (Output_data_got::add_local): Added got_type parameter.
10755 (Output_data_got::add_local_with_rel): Likewise.
10756 (Output_data_got::add_local_with_rela): Likewise.
10757 (Output_data_got::add_local_pair_with_rel): New function.
10758 (Output_data_got::add_local_pair_with_rela): New function.
10759 (Output_data_got::add_global_tls): Removed.
10760 (Output_data_got::add_global_tls_with_rel): Removed.
10761 (Output_data_got::add_global_tls_with_rela): Removed.
10762 (Output_data_got::add_local_tls): Removed.
10763 (Output_data_got::add_local_tls_with_rel): Removed.
10764 (Output_data_got::add_local_tls_with_rela): Removed.
10765 * resolve.cc (Symbol::override_base_with_special): Removed
10766 reference to has_got_offset_ field.
10767 * symtab.cc (Symbol::init_fields): Replaced initialization
10768 of got_offset_ with got_offsets_. Removed initialization
10769 of has_got_offset_
53fcba31 10770 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10771 (Symbol::got_offset): Likewise.
10772 (Symbol::set_got_offset): Likewise.
10773 (Symbol::has_tls_got_offset): Removed.
10774 (Symbol::tls_got_offset): Removed.
10775 (Symbol::set_tls_got_offset): Removed.
10776 (Symbol::got_offset_): Removed.
10777 (Symbol::tls_mod_got_offset_): Removed.
10778 (Symbol::tls_pair_got_offset_): Removed.
10779 (Symbol::got_offsets_): New field.
10780 (Symbol::has_got_offset): Removed.
10781 (Symbol::has_tls_mod_got_offset): Removed.
10782 (Symbol::has_tls_pair_got_offset): Removed.
10783 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10784 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10785 member functions.
10786 (Target_x86_64::Scan::global): Likewise.
10787 (Target_x86_64::Relocate::relocate): Likewise.
10788 (Target_x86_64::Relocate::relocate_tls): Likewise.
10789
bd52eafb
BE
107902008-03-25 Ben Elliston <bje@au.ibm.com>
10791
10792 * yyscript.y: Fix spelling error in comment.
10793
8b105e34
ILT
107942008-03-24 Ian Lance Taylor <iant@google.com>
10795
8ed814a9
ILT
10796 * options.h (class General_options): Define build_id option.
10797 * layout.h (class Layout): Declare write_build_id, create_note,
10798 create_build_id. Add build_id_note_ member.
10799 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10800 "libiberty.h", "md5.h", "sha1.h".
10801 (Layout::Layout): Initialize eh_frame_data_,
10802 eh_frame_hdr_section_, and build_id_note_.
10803 (Layout::finalize): Call create_build_id.
10804 (Layout::create_note): New function, broken out of
10805 Layout::create_gold_note.
10806 (Layout::create_gold_note): Call create_note.
10807 (Layout::create_build_id): New function.
10808 (Layout::write_build_id): New function.
10809 (Close_task_runner::run): Call write_build_id.
10810
8b105e34
ILT
10811 * x86_64.cc: Correct license to GPLv3.
10812
086a1841
ILT
108132008-03-23 Ian Lance Taylor <iant@google.com>
10814
10815 * options.cc: Include "demangle.h".
10816 (parse_optional_string): New function.
10817 (parse_long_option): Handle takes_optional_argument.
10818 (parse_short_option): Update dash_z initializer. Handle
10819 takes_optional_argument.
10820 (General_options::General_options): Initialize do_demangle_.
10821 (General_options::finalize): Set do_demangle_. Handle demangling
10822 style.
10823 * options.h (parse_optional_string): Declare.
10824 (struct One_option): Add optional_arg field. Update constructor.
10825 Update call constructor calls. Add takes_optional_argument
10826 function.
10827 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10828 (DEFINE_optional_string): Define.
10829 (General_options::demangle): Change from DEFINE_bool to
10830 DEFINE_optional_string.
10831 (General_options::no_demangle): New function.
10832 (General_options::do_demangle): New function.
10833 (General_options::set_do_demangle): New function.
10834 (General_options::execstack_status_): Move definition to end of
10835 class definition.
10836 (General_options::static_): Likewise.
10837 (General_options::do_demangle_): New field.
10838 * object.cc (big_endian>::get_symbol_location_info): Call
10839 Options::do_demangle, not Options::demangle.
10840 * symtab.cc (demangle): Likewise.
10841
cbb93e63
ILT
108422008-03-22 Ian Lance Taylor <iant@google.com>
10843
10844 * gold.h: Include <cstddef> and <sys/types.h>
10845 * options.h: Include <cstring>.
10846
ec531623
ILT
108472008-03-21 Ian Lance Taylor <iant@google.com>
10848
10849 * Added source code to GNU binutils.
This page took 0.62014 seconds and 4 git commands to generate.